@sailresearch/sdk on npm), built
for TS agent harnesses on Node 22+ and Bun. It shares one engine with
the Python and Rust SDKs, so behavior matches across
languages. This page covers install and TypeScript-specific notes.
Install
Configure
SetSAIL_API_KEY in the environment; the SDK also
reads ~/.sail. The object-model statics use this configuration by default, or
construct a Client explicitly with Client.fromConfig({ apiKey }).
Quickstart
Custom images
Use the fluentImage builder and pass it to Sailbox.create. Local files and
directories are hashed and uploaded for you when the sailbox is created.
Surface
Voyages (agent tracing) and inference calls are currently Python-only; the
TypeScript SDK covers the full sailbox surface. See the Voyages
reference.
Sailbox:create/get/list/listPage/fromCheckpoint, and per-instanceexec,shell,read/write/writeStream/readStream,expose/unexpose/listeners/listener/waitForListener,ingressAuthHeaders,enableSsh, andterminate/pause/sleep/resume/checkpoint/upgrade.App:find/list.Volume:find/list, and per-instancedelete.Image:debian/devbox,aptInstall/pipInstall/runCommand/env,addLocalFile/addLocalDir,build,toSpec(Sailbox.createbuilds it for you).Client: the lower-level surface with the same operations.
Errors
Everything the SDK throws extendsSailError, so one
catch (e) { if (e instanceof SailError) } handles all of it; subclasses like
NotFoundError and SailboxExecutionError let you match specific failures. See
Errors for the full hierarchy.