@sailresearch/sdk on npm) runs on Node 22+ and Bun.
It shares one engine with the Python and
Rust SDKs, so behavior matches across languages.
Install
npm install @sailresearch/sdk@latest.
Configure
SetSAIL_API_KEY in the environment; the SDK also reads the credential
sail auth login stores under ~/.sail. The statics on Sailbox, App, and
Volume use this configuration by default, or construct a Client explicitly
with Client.fromConfig({ apiKey }). See
Configuration.
Quickstart
Errors
Every failure the SDK recognizes extendsSailError, so one
catch (e) { if (e instanceof SailError) } handles them; a truly unexpected
native error surfaces unchanged. Subclasses like NotFoundError and
SailboxExecutionError match specific failures, every error carries an
advisory retryable flag, and isSailError() is the realm-safe check.
See Errors.
Reference
The docs below are auto-generated.Sailbox
A sandbox (Sailbox): the primary object agent harnesses work with. Create one with Sailbox.create, run commands with exec, move files with fs, expose ports with expose, and manage its lifecycle. The statics use a default env-configured client unless you pass one.Example
Accessors
appId
Get Signature
get appId():Identifier of the owning app.string|undefined
Returns
string | undefinedappName
Get Signature
get appName():Name of the owning app.string|undefined
Returns
string | undefinedarchitecture
Get Signature
get architecture():CPU architecture (for examplestring|undefined
arm64).Returns
string | undefinedautoSleep
Get Signature
get autoSleep():When Sail may sleep this Sailbox on its own: from the latest Sailbox.get snapshot, or your own last Sailbox.setAutoSleep through this object.AutoSleep|undefined
undefined before
either; a Sailbox created by Sailbox.fromCheckpoint inherits its
source’s preference, so call
Sailbox.get to learn an inherited value.Returns
AutoSleep | undefinedcheckpointGeneration
Get Signature
get checkpointGeneration():Checkpoint generation counter as of the snapshot.number|undefined
Returns
number | undefinedclient
Get Signature
get client(): Client
The underlying Client.Returns
ClientcpuRequestedVcpu
Get Signature
get cpuRequestedVcpu():Requested CPU, in vCPUs.number|undefined
Returns
number | undefinedcpuUsedVcpu
Get Signature
get cpuUsedVcpu():Current CPU usage, in vCPUs, as of the snapshot.number|undefined
Returns
number | undefinedcreatedAt
Get Signature
get createdAt():When the Sailbox was created.Date|undefined
Returns
Date | undefinedcreatedByUserId
Get Signature
get createdByUserId():The user whose credential created this Sailbox (for a restore, the user who ran it).string|undefined
undefined for service-key creates.Returns
string | undefineddeprecation
Get Signature
get deprecation():Actionable runtime deprecation notice, when an upgrade is needed.SailboxDeprecation|undefined
Returns
SailboxDeprecation | undefineddiskRequestedBytes
Get Signature
get diskRequestedBytes():Requested disk, in bytes.number|undefined
Returns
number | undefineddiskUsedBytes
Get Signature
get diskUsedBytes():Current disk usage, in bytes, as of the snapshot.number|undefined
Returns
number | undefinederrorMessage
Get Signature
get errorMessage():Failure detail when the status isstring|undefined
failed.Returns
string | undefinedfs
Get Signature
get fs(): SailboxFs
Filesystem operations on this Sailbox’s guest: read and write files
(buffered or streaming), and directory helpers.Returns
SailboxFsguestSchemaVersion
Get Signature
get guestSchemaVersion():The Sailbox runtime schema version the Sailbox last booted with.number|undefined
Returns
number | undefinedimageId
Get Signature
get imageId():Identifier of the image the Sailbox was created from.string|undefined
Returns
string | undefinedlastCheckpointedAt
Get Signature
get lastCheckpointedAt():When the most recent checkpoint was taken.Date|undefined
Returns
Date | undefinedmemoryMib
Get Signature
get memoryMib():Configured memory, in MiB.number|undefined
Returns
number | undefinedmemoryRequestedBytes
Get Signature
get memoryRequestedBytes():Requested memory, in bytes.number|undefined
Returns
number | undefinedmemoryUsedBytes
Get Signature
get memoryUsedBytes():Current memory usage, in bytes, as of the snapshot.number|undefined
Returns
number | undefinedname
Get Signature
get name(): string
The Sailbox name.Returns
stringsailboxId
Get Signature
get sailboxId(): string
The Sailbox’s stable identifier.Returns
stringstartedAt
Get Signature
get startedAt():When the Sailbox first started running. A resume does not rewrite it.Date|undefined
Returns
Date | undefinedstateDiskSizeGib
Get Signature
get stateDiskSizeGib():Configured state-disk size, in GiB.number|undefined
Returns
number | undefinedstatus
Get Signature
get status(): SailboxStatus
The lifecycle status as of the call that produced this handle (updated
by lifecycle calls on this instance). Use Sailbox.get for a fresh
snapshot.Returns
SailboxStatusupdatedAt
Get Signature
get updatedAt():When the Sailbox last changed.Date|undefined
Returns
Date | undefinedvcpuCount
Get Signature
get vcpuCount():Configured number of vCPUs.number|undefined
Returns
number | undefinedvisibility
Get Signature
get visibility():string|undefined
"private" when access is restricted to the creator; undefined/"org"
is the default org-wide access.Returns
string | undefinedvolumeMounts
Get Signature
get volumeMounts():Volumes attached to this Sailbox and the paths they are mounted at.SailboxVolumeMount[] |undefined
Returns
SailboxVolumeMount[] | undefinedMethods
checkpoint()
checkpoint(Take a checkpoint of this Sailbox. The returned handle carriesoptions?):Promise<SailboxCheckpoint>
expiresAt, after which starting a Sailbox from it fails.Parameters
Returns
Promise<SailboxCheckpoint>enableSsh()
enableSsh(Enable SSH on this Sailbox: trust the org SSH CA, startoptions?):Promise<SshEndpoint|null>
sshd, and
expose guest port 22 as TCP once the CA-only daemon owns it. Org members
connect with a short-lived certificate (fetched by the sail box ssh
CLI); a private Sailbox accepts only its creator’s certificates. Safe to
re-run. With wait (the default), polls until the endpoint is reachable
and returns it, throwing TimeoutError if it is not within
timeoutSeconds; with wait: false, skips the probe and resolves
null.Parameters
Returns
Promise<SshEndpoint | null>exec()
exec(Run a command and return a handle to the live process. Acommand,options?):Promise<ExecProcess>
string command
is run via /bin/sh -lc; a string[] is exec’d directly. options can set
a working directory or detach the command (see ExecOptions).
Stopping the command is the caller’s job via ExecProcess.cancel.Parameters
Returns
Promise<ExecProcess>expose()
expose(Expose a guest port at runtime. Re-exposing a port under the same protocol sets itsguestPort,options?):Promise<Listener>
allowlist to what you pass, so pass the whole list
every time; passing none clears the restriction and reopens the port. The
returned listener carries the resolved endpoint but an "unknown" route
status: the response confirms configuration, not reachability;
waitForListener confirms the route is live.Parameters
Returns
Promise<Listener>ingressAuthHeaders()
ingressAuthHeaders():Ingress-identity headers for this Sailbox, as a name→value map.Promise<Record<string,string>>
Returns
Promise<Record<string, string>>listener()
listener(Fetch one listener by guest port without waking the Sailbox.guestPort):Promise<Listener>
Parameters
Returns
Promise<Listener>listeners()
listeners():List this Sailbox’s listeners without waking it.Promise<Listener[]>
Returns
Promise<Listener[]>pause()
pause():Pause this Sailbox in memory.Promise<void>
Returns
Promise<void>resume()
resume():Resume this Sailbox (updates status).Promise<void>
Returns
Promise<void>run()
run(Run a command to completion and return its buffered result: a one-shot convenience over exec followed by ExecProcess.wait. Acommand,options?):Promise<ExecResult>
string command runs via /bin/sh -lc; a string[] is exec’d directly.
Set env in options to add environment variables; cwd sets the
working directory (string commands only, like exec); signal
force-cancels the command on abort (see RunOptions). The result’s
stdout/stderr are the buffered output (capped, drop-oldest); for unbounded
output, stream it live via exec instead. openStdin, pty, and
background are excluded from RunOptions and rejected at runtime:
run() waits for the command to finish and buffers its output, so an
interactive command would hang and a backgrounded one would return the
launcher’s result, not the command’s; use exec for those.Parameters
Returns
Promise<ExecResult>setAutoSleep()
setAutoSleep(Replace when Sail may sleep this Sailbox on its own.Each call replaces the whole setting: switching toautoSleep):Promise<void>
{ automatic: false }
clears any minimum wait set earlier, and switching back does not restore
it. Calling Sailbox.sleep yourself is unaffected, and so are
pause, resume, and scheduled wakes.Parameters
Returns
Promise<void>shell()
shell(Open an interactive pty session on this Sailbox, bridged to the local terminal. With nocommand?,options?):Promise<number>
command, runs a login shell; pass a command to run
that under a pty instead (e.g. a REPL or an editor). Blocks until the
remote process exits and resolves with its exit code. Requires an
interactive terminal (stdin and stdout TTYs) on a Unix machine. The
session runs as the image’s USER when the image sets one, root
otherwise; see ShellOptions.user. While the session is open,
browser opens, localhost servers, paste, drag-and-drop, and clipboard are
forwarded to your machine (the clipboard is two-way on devbox images);
see ShellOptions.noForward.Parameters
Returns
Promise<number>sleep()
sleep(Sleep this Sailbox to disk (wakes on traffic), optionally scheduling a wall-clock wake first.wakeAt?):Promise<Date|undefined>
wakeAt, when given, records the wake before the
sleep starts and the returned value is the effective wake time: the
sooner of this request and any wake already scheduled. If the Sailbox
is sleeping when that moment arrives, Sail restores it. The wake can
fire a little after the time you set, so treat it as approximate.
Sleeping an already-sleeping Sailbox succeeds and just updates the
scheduled wake.Parameters
Returns
Promise<Date | undefined>terminate()
terminate():Terminate (delete) this Sailbox (updates status).Promise<void>
Returns
Promise<void>unexpose()
unexpose(Remove a runtime ingress port.guestPort):Promise<void>
Parameters
Returns
Promise<void>upgrade()
upgrade():Upgrade this Sailbox’s runtime.Promise<UpgradeResult>
Returns
Promise<UpgradeResult>waitForListener()
waitForListener(Block until the listener onguestPort,options?):Promise<Listener>
guestPort is reachable end to end and
return it, or throw TimeoutError after timeoutSeconds. An HTTP
listener is ready once the guest server answers; a TCP listener once the
guest sends bytes or holds the connection open. A connectivity check, not
an application health check.Parameters
Returns
Promise<Listener>create()
Create a new Sailbox.A custom image definition passed asstaticcreate(options):Promise<Sailbox>
image is built first.Sail may sleep a fully idle Sailbox; it wakes transparently on traffic or
the next operation.Parameters
Returns
Promise<Sailbox>fromCheckpoint()
Create a new running Sailbox from a durable checkpoint handle. The new Sailbox restores the memory saved in the checkpoint as well as the writable disk, so processes the original was running carry on here, and it runs independently of the Sailbox that took the checkpoint. Commands started with Sailbox.exec stop here, though their writes up to the checkpoint are kept, and one started withstaticfromCheckpoint(options):Promise<Sailbox>
background: true keeps
running. Start the other execs the new Sailbox needs. Sometimes it comes
up cold instead, with the disk intact and nothing running, and a Sailbox
that mounts a volume always does. Volumes are mounted on it at the same
paths as on the original, and they are the same volumes, so both Sailboxes
read and write the same files.Parameters
Returns
Promise<Sailbox>fromId()
Bind a handle to an existing Sailbox id without a network call.The returned handle carries no snapshot fields (its name and status are empty), just the operable surface. The id is not verified to exist: operations on an unknown or inaccessible id reject with NotFoundError. Use get to validate the id and fetch a fresh snapshot instead.staticfromId(sailboxId,options?):Sailbox
Parameters
Returns
Sailboxget()
Fetch an existing Sailbox by id.staticget(sailboxId,options?):Promise<Sailbox>
Parameters
Returns
Promise<Sailbox>list()
List the Sailboxes that match the filters, fetching pages internally until every match (orstaticlist(params?):Promise<Sailbox[]>
limit of them) is collected; use
listPage to page through results manually instead. limit caps
the total returned, bounding the fetch for large orgs. A client can
ride along in the query object.Parameters
Returns
Promise<Sailbox[]>listPage()
List one page of Sailboxes alongside the pagination envelope (staticlistPage(params?):Promise<SailboxPage>
total/hasMore). Takes the same filters as list, plus limit
and offset to select the page.Parameters
Returns
Promise<SailboxPage>App
An app: the billing/ownership scope a Sailbox belongs to. Look one up (or mint it) with App.find, then pass it (or its App.id) to Sailbox.create.Properties
Methods
find()
Find an app by name, optionally minting it if missing.staticfind(name,options?):Promise<App>
Parameters
Returns
Promise<App>list()
Every app the current org owns, newest first.staticlist(options?):Promise<App[]>
Parameters
Returns
Promise<App[]>Image
A Sailbox image: a base, registry, or Dockerfile image plus ordered build steps. Immutable and fluent: each method returns a newImage. Local
files/dirs are recorded here and hashed and uploaded when the image is
resolved to a spec (at Sailbox.create, or via toSpec), so
chaining stays synchronous.Example
Methods
addLocalDir()
addLocalDir(Bake a local directory tree into the image atlocalPath,remotePath,options?):Image
path. Each regular
file is hashed + uploaded at resolve; symlinks are skipped and file modes
preserved. ignore takes gitignore-style patterns.Parameters
Returns
ImageaddLocalFile()
addLocalFile(Bake one local file into the image atlocalPath,remotePath,options?):Image
path (absolute POSIX path;
a trailing / appends the source basename). Hashed + uploaded at resolve.Parameters
Returns
ImageaptInstall()
aptInstall(…Install system packages with apt.packages):Image
Parameters
Returns
Imagebuild()
build(Upload any local files and build the image, waiting until it is ready. Returns the resolved ImageSpec. Sailbox.create calls this for a custom image before creating the Sailbox (the backend serves the content-addressed built image); a bare base image skips the build. Local files are re-hashed on every call, so edits always reach the build, and rebuilding an unchanged, already-built image returns quickly. Creating Sailboxes from the returned spec needs no further build. For an image imported with Image.fromRegistry through a tag, the spec is also pinned to the exact version the build resolved the tag to, even if the tag later moves upstream. ImageBuildOptions.forceBuild looks the tag up again and moves the tag’s meaning for your whole organization. For an image built with Image.fromDockerfile, the returned spec is likewise pinned to the versions the build resolved for itsoptions?):Promise<ImageSpec>
FROM and COPY --from images;
ImageBuildOptions.forceBuild moves those pins for your whole
organization, while specs built earlier keep their pinned versions.Parameters
Returns
Promise<ImageSpec>env()
env(Bake environment variables into the image (keys are trimmed).env):Image
Parameters
Returns
ImagepipInstall()
pipInstall(…Install Python packages with pip.packages):Image
Parameters
Returns
ImagerunCommand()
runCommand(Run a shell command during the build.command):Image
Parameters
Returns
ImagetoSpec()
toSpec(Resolve to an ImageSpec: walks local files/dirs (honoring gitignore), hashes them, and uploads their content viaclient?):Promise<ImageSpec>
client (defaults
to the env client). Sailbox.create calls this for you; use it
directly only if you need the raw spec.Parameters
Returns
Promise<ImageSpec>debian()
A Debian base image (defaults to amd64).staticdebian(architecture?):Image
Parameters
Returns
Imagedevbox()
The devbox base image (defaults to amd64): a prebuilt Debian base with a baked development layer. Docker is included, and its daemon starts automatically when the Sailbox boots and keeps running across sleeps. The daemon can take a few seconds to accept commands right after boot. If it stops, it is not restarted automatically. Prebuilt-only, so it does not support build steps or env; start from Image.debian to customize.staticdevbox(architecture?):Image
Parameters
Returns
ImagefromDockerfile()
Build your own Dockerfile into a Sailbox image, with everything Sail needs layered on top. Pass the path to a Dockerfile on this machine, or its literal text wrapped asstaticfromDockerfile(dockerfile,options?):Image
{ contents }. The result behaves like any
other image: build steps, env, and pip/apt installs work the same as on
Image.debian.Pass contextDir to give the Dockerfile’s COPY and ADD
instructions a build context; if omitted, the build runs without one.
A .dockerignore in that directory is honored, and ignore patterns
are applied after it, so they take precedence on conflict. A file named
after the Dockerfile, like Dockerfile.dockerignore, sitting next to
it is used instead of the context’s .dockerignore, as it is with
Docker. The files the ignore rules keep are hashed and uploaded when
the image is built, so edits up to that point reach the build. File
modes, empty directories, and symbolic links are carried into the
build.Every image a FROM (or COPY --from) instruction names must live on a
supported public registry (docker.io, ghcr.io, public.ecr.aws, or
quay.io); a short name like python:3.12 means
docker.io/library/python:3.12. Each named image is pinned to the
version its tag pointed at the first time your organization used it,
and those pinned versions become part of the built image’s identity,
so rebuilding the same spec reuses the same image even after a tag
moves. Pass forceBuild to Image.build to look the tags up
again and build what they point at now. The Dockerfile must produce a
Debian- or Ubuntu-based filesystem.A # syntax= line can declare docker/dockerfile:1 or a release
from 1.4 through 1.22.0. A file that declares anything else is
rejected. The declared release does not change how the file is built.Multi-stage Dockerfiles work. A RUN --mount of type cache, secret,
or ssh is rejected; tmpfs mounts work, and bind mounts work when
they read from the build context or another build stage. Mount options
must be literal text, and ONBUILD is not supported, in the Dockerfile
or in an image a FROM names.The built image’s environment variables, working directory, and USER
become the defaults for commands you run with Sailbox.exec or
Sailbox.run; per-call env, cwd, and user override them
(pass user: "0:0" to run as root on an image that sets USER). The
image’s ENTRYPOINT and CMD are not run: a Sailbox manages its own
processes, and your commands say what to execute. Build steps you chain
onto the image (such as aptInstall) and SSH sessions still run as root.Parameters
Returns
ImageExample
fromRegistry()
Your own image as the Sailbox root filesystem, with everything Sail needs layered on top. The result behaves like any other image: build steps, env, and pip/apt installs work the same as on Image.debian.Reference an image on a supported public registry (staticfromRegistry(ref,options?):Image
docker.io,
ghcr.io, public.ecr.aws, or quay.io), fully qualified, e.g.
docker.io/library/python:3.13. You can pass a tag, a @sha256:...
digest, or just the name, which means the latest tag. The image must be
Debian- or Ubuntu-based.Your Sailbox runs on the CPU architecture the image was built for. An
image published for both amd64 and arm64 runs on amd64. Pass
architecture to require one instead, and building fails if the image was
not built for it.A tag is pinned for your organization once an image has been built from
it: later builds keep using that image even after the tag moves
upstream. Call
build({ forceBuild: true }) to look the tag up again and build the
version it points at now for your whole organization; see
ImageBuildOptions.forceBuild for how the switch propagates. A
digest names exactly one image, so it never moves.The image’s environment variables, working directory, and USER become
the defaults for commands you run with Sailbox.exec or
Sailbox.run; per-call env, cwd, and user override them
(pass user: "0:0" to run as root on an image that sets USER). The
image’s ENTRYPOINT and CMD are not run: a Sailbox manages its own
processes, and your commands say what to execute. Build steps you chain
onto the image (such as aptInstall) and SSH sessions still run as root.Parameters
Returns
ImageExample
ExecProcess
A live command running in a Sailbox. Stream stdout/stderr, write to writeStdin, and wait for the result. Not killed on GC; call close to detach, or cancel to stop the command.Example
Properties
Accessors
execRequestId
Get Signature
get execRequestId(): string
The durable exec request id.Returns
stringidempotencyKey
Get Signature
get idempotencyKey(): string
The idempotency key used to launch the command.Returns
stringoutput
Get Signature
get output(): ExecStream
Alias for stdout: under a pty the two output streams merge onto
stdout, and output names that merged terminal stream.Returns
ExecStreamMethods
[asyncDispose]()
[asyncDispose]():Promise<void>
await using support: detaches on scope exit.Returns
Promise<void>[dispose]()
[dispose](): void
using support: detaches on scope exit.Returns
voidcancel()
cancel(Cancel the command (SIGINT by default, SIGKILL withoptions?):Promise<void>
force).
Transient failures are retried briefly, covering the window right after
the command starts when the guest cannot accept signals for it yet.Parameters
Returns
Promise<void>close()
close(): void
Stop the output pump and detach (does not kill the command). Call this on
early exit from streaming a long-running command so the stream is not held
until GC.Returns
voidcloseStdin()
closeStdin():Close the command’s stdin (send EOF).Promise<void>
Returns
Promise<void>poll()
poll():The exit code if the exit frame has arrived on the stream, elsenumber|null
null.
Throws for a host-lost exec (no real exit code), as wait does.Returns
number | nullresize()
resize(Resize the pty (no-op without one).cols,rows):Promise<void>
Parameters
Returns
Promise<void>resync()
resync():Ask a pty exec to repaint its current screen (no-op without a pty). A command runs at full speed and never waits for a slow reader, so if you fall far behind the oldest output is dropped. Call this after that happens to receive the current screen instead of a broken, partial one. Advisory and best-effort.Promise<void>
Returns
Promise<void>wait()
wait():Await the authoritative result (exit code, buffered output, flags).Promise<ExecResult>
Returns
Promise<ExecResult>waitStreamEnded()
waitStreamEnded(Wait up totimeoutSeconds):Promise<boolean>
timeoutSeconds for the streams to end; returns whether they
did. Infinity waits indefinitely.Parameters
Returns
Promise<boolean>writeStdin()
writeStdin(Write to the command’s stdin (requiresdata):Promise<void>
openStdin).Parameters
Returns
Promise<void>ExecStream
An async-iterable view of one exec stream (stdout or stderr). Default iteration yieldsstring chunks, incrementally decoded as UTF-8 (a
multibyte character split across chunks is carried until complete); use
raw for the unmodified byte stream.Example
Implements
AsyncIterable<string>
Methods
[asyncIterator]()
[asyncIterator]():AsyncIterator<string>
Returns
AsyncIterator<string>Implementation of
AsyncIterable.[asyncIterator]bytes()
bytes():Collect the whole raw byte stream into a singlePromise<Buffer<ArrayBufferLike>>
Buffer.Returns
Promise<Buffer<ArrayBufferLike>>raw()
raw():Iterate the raw byte stream, exactly as the command wrote it (escape sequences and binary payloads included).AsyncIterableIterator<Buffer<ArrayBufferLike>>
Returns
AsyncIterableIterator<Buffer<ArrayBufferLike>>text()
text():Collect the whole stream into a single string.Promise<string>
Returns
Promise<string>toReadable()
toReadable(): Readable
Adapt to a Node Readable of string chunks (e.g. to .pipe() it).Returns
ReadableSailboxFs
Filesystem operations on a Sailbox’s guest, reached via Sailbox.fs. File I/O streams bytes to/from the guest; the directory helpers create, remove, test, and transfer paths.Writes give what they create to the image’sUSER by default (root when
the image sets none), the same identity commands run as, so an uploaded
file is usable by the code in the Sailbox. Reads and the directory helpers
act as root by default, so they work on any path.Every operation except the reads and the directory download takes an
optional user in Docker’s USER syntax (name, uid, name:group,
or uid:gid; "0:0" is always root). The directory helpers other than
the transfers run their command as that user, with its permissions
enforced. Writes and the directory upload keep running as root but give
that user what they create, like COPY --chown. Reads and the download
take no user: a user only decides which paths an operation may touch
and who owns what it creates. A read creates nothing in the Sailbox, and
a download reads any path as root, the way the reads do. A user other
than "0:0" requires a Sailbox whose guest honors requested users; on
older Sailboxes these calls fail until Sailbox.upgrade is
called.Methods
downloadDir()
downloadDir(Download a directory’s contents from the Sailbox into a local directory.dirs):Promise<void>
guestDir’s entries land inside localDir, which is created if needed.
Entries the download does not name are left in place; a same-named file
is replaced. The transfer reads every file in the tree, so download
directories of ordinary files: system trees like /proc or /sys hold
files that
cannot be read as plain data, and downloading them fails. A file that
is being written while the download runs is captured as it is at that
moment, the way copying a live file would; download after writers finish
for a consistent copy. On Windows, a directory that contains symbolic
links cannot be downloaded, since Windows restricts creating them. The
Sailbox’s image must provide tar and gzip, which the transfer uses
to ship the directory as one compressed archive; the default images
do.Parameters
Returns
Promise<void>exists()
exists(Whetherpath,options?):Promise<boolean>
path exists in the guest. Follows symlinks (like test -e), so
a dangling symlink reports false even though ls lists it. A
user reports existence as observable by that user: a path the user lacks
permission to reach also reports false.Parameters
Returns
Promise<boolean>ls()
ls(List a directory’s immediate entries as DirEntry records (no recursion). A missing path throws, as does a path that is not a directory and a listing too large for the exec output cap. An entry whose name is not valid UTF-8 fails the listing, since the path API cannot address it. Apath,options?):Promise<DirEntry[]>
user runs the listing as that user, so a directory it may not read fails
with a permission error.Parameters
Returns
Promise<DirEntry[]>mkdir()
mkdir(Create a directory and any missing parents (likepath,options?):Promise<void>
mkdir -p); a no-op if
it already exists. A user runs the mkdir as that user, so created
directories are owned by it.Parameters
Returns
Promise<void>read()
read(Read a guest file fully into memory (convenience over readStream).path):Promise<Buffer<ArrayBufferLike>>
Parameters
Returns
Promise<Buffer<ArrayBufferLike>>readStream()
readStream(Open a streaming read of a guest file.path):Promise<FileStream>
Parameters
Returns
Promise<FileStream>remove()
remove(Remove a file or directory tree (likepath,options?):Promise<void>
rm -rf); a no-op if it is already
absent. A user runs the removal as that user, limiting it to what that
user may delete.Parameters
Returns
Promise<void>uploadDir()
uploadDir(Upload a local directory’s contents into a directory on the Sailbox.dirs):Promise<void>
localDir’s entries land inside guestDir, which is created if needed.
Entries the upload does not name are left in place; a same-named file is
replaced. Uploaded files belong to the image’s USER, the same identity
commands run as, so the code in the Sailbox can use them. When the image
sets no USER, or that user cannot be resolved in the Sailbox, they
belong to root. guestDir and any missing parents the upload creates
get the same owner. Files keep their permission bits, except that the
setuid, setgid, and sticky bits are cleared.
A user (the same syntax the other operations take) gives the entries
to that user instead, like COPY --chown; it must exist in the Sailbox,
and like the other operations’ user it requires a Sailbox whose guest
honors requested users. The Sailbox’s image must provide tar and
gzip, which the transfer uses to ship the directory as one compressed
archive; the default images do.Parameters
Returns
Promise<void>write()
write(Write bytes (apath,data,options?):Promise<void>
string is encoded as UTF-8) to a guest file, creating it
and any missing parent directories (convenience over writeStream;
pass createParents: false to opt out).Parameters
Returns
Promise<void>writeStream()
writeStream(Open a streaming upload to a guest file.path,options?):Promise<FileWriter>
Parameters
Returns
Promise<FileWriter>FileWriter
A streaming write to a guest file. Push chunks with write, then confirm with finish; onlyfinish commits the write. A writer
that goes away without finishing (abort, an error path, or garbage
collection) cancels the transfer instead; the guest file state is then
unspecified.Methods
[asyncDispose]()
[asyncDispose]():Promise<void>
await using support; same semantics as the synchronous form.Returns
Promise<void>[dispose]()
[dispose](): void
using support: aborts the write if it was never finished, so leaving
scope on an error path cancels instead of committing a partial file.
abort is synchronous, so the plain form suffices.Returns
voidabort()
abort(): void
Abort the write: cancel the RPC so the server does not commit it.
Idempotent. A later finish reports the abort instead of
succeeding; the guest file state after an abort is unspecified.Returns
voidfinish()
finish():Confirm the write, creating an empty file if nothing was written.Promise<void>
Returns
Promise<void>toWritable()
toWritable(): Writable
Adapt to a Node Writable: end() runs finish (only that
commits the write), destroying the stream aborts it, and backpressure
follows the underlying transfer since each chunk’s callback fires when
its write resolves.Returns
Writablewrite()
write(Write bytes (adata):Promise<void>
string is encoded as UTF-8). The SDK splits them into
transport-sized chunks.Parameters
Returns
Promise<void>FileStream
An async-iterable download of a guest file. Chunks areBuffers; iteration
ends at end of file. The underlying stream is released when iteration finishes
or is abandoned (via a generator finally), or explicitly via close.Implements
AsyncIterable<Buffer>
Methods
[asyncDispose]()
[asyncDispose]():Promise<void>
await using support.Returns
Promise<void>[asyncIterator]()
[asyncIterator]():AsyncIterator<Buffer<ArrayBufferLike>>
Returns
AsyncIterator<Buffer<ArrayBufferLike>>Implementation of
AsyncIterable.[asyncIterator]bytes()
bytes():Collect the whole file into a singlePromise<Buffer<ArrayBufferLike>>
Buffer.Returns
Promise<Buffer<ArrayBufferLike>>close()
close():Release the underlying download stream (idempotent).Promise<void>
Returns
Promise<void>toReadable()
toReadable(): Readable
Adapt to a Node Readable.Returns
ReadableVolume
A managed NFS volume that can be mounted into Sailboxes. Look one up (or mint it) with Volume.find, then pass it (or its Volume.id) in a Sailbox’svolumes mapping.Volumes are currently in Alpha. To pilot them, reach out in the Sail Slack:
https://join.slack.com/t/sailresearchcrew/shared_invite/zt-41pdcym9j-UU0Ey~A~r6n2H0DQVQsQHQ.Properties
Methods
delete()
delete(Delete this volume. Resolvesoptions?):Promise<boolean>
true if it was deleted, false if it was
already gone (only possible with allowMissing).Parameters
Returns
Promise<boolean>find()
Look up an NFS volume by name, optionally minting it if missing.staticfind(name,options?):Promise<Volume>
Parameters
Returns
Promise<Volume>fromMount()
Guest-side: load the volume handle for a path mounted into this Sailbox (reads the mount’s metadata; only available inside a guest).staticfromMount(path):Volume
Parameters
Returns
Volumelist()
List NFS volumes in the current org.staticlist(options?):Promise<Volume[]>
Parameters
Returns
Promise<Volume[]>ingressAuthHeaders()
ingressAuthHeaders():Guest-side: headers that authenticate this Sailbox as an ingress allowlist source (only available inside a Sailbox guest).Record<string,string>
Returns
Record<string, string>Client
A configured Sail client: the low-level, one-method-per-operation surface (one config snapshot; env vars are read at construction). Every client operation is here. The object-model API (Sailbox, App, Volume) is built on top of it.Construct with Client.fromEnv or Client.fromConfig.Methods
buildImageDefinition()
buildImageDefinition(Resolve an image definition and build it to ready, returning the content-addressed ImageSpec to create Sailboxes from. A bare Debian or devbox base image skips the build;def,timeoutSeconds,options?):Promise<ImageSpec>
timeoutSeconds bounds the whole pipeline
(hashing, uploads, and the build).By default, Sail may reuse an existing ready build for this
definition. forceBuild builds it again and waits for the fresh build
to become ready: new Sailboxes use the fresh image once it is ready,
Sailboxes that already exist keep the filesystem they were created
with, and a forced build that fails changes nothing. For an image
imported with Image.fromRegistry through a tag, a forced build
also asks the registry what the tag points at now and builds that
version. The tag then means that version for your whole organization,
while specs built earlier keep their pinned version. A forced build of
an image built with Image.fromDockerfile looks up the tags its
FROM and COPY --from instructions name and moves those pins for
your whole organization, while specs built earlier keep the versions
their build used. If forced builds overlap, the last-requested
one that succeeds decides which image new Sailboxes use and, for a
tag, what the tag means.Parameters
Returns
Promise<ImageSpec>buildSpecToReady()
buildSpecToReady(Build an already-resolved spec to ready (submit + poll), bounded byspec,timeoutSeconds,options?):Promise<ImageBuild>
timeoutSeconds. forceBuild builds the image again even if a build
already exists; see Client.buildImageDefinition.Parameters
Returns
Promise<ImageBuild>checkpointSailbox()
checkpointSailbox(Take a checkpoint of a Sailbox.sailboxId,options?):Promise<SailboxCheckpoint>
name sets the handle’s display name;
ttlSeconds, when given, overrides the server’s default retention
window.Parameters
Returns
Promise<SailboxCheckpoint>createFromCheckpoint()
createFromCheckpoint(Create a new Sailbox from a checkpoint.params):Promise<SailboxHandle>
Parameters
Returns
Promise<SailboxHandle>createSailbox()
createSailbox(Create a Sailbox.req,timeoutSeconds?):Promise<SailboxHandle>
timeoutSeconds bounds each create attempt (default
600s); pass 0 for no client-side timeout. A timed-out attempt is retried,
and a retry usually reattaches to the Sailbox already coming up rather than
starting another. When the overall budget is exhausted the Sailbox may still
be coming up server-side: find or terminate it by name. image defaults
to a plain Debian base.Parameters
Returns
Promise<SailboxHandle>deleteVolume()
deleteVolume(Delete a volume by id.volumeId,allowMissing?):Promise<VolumeInfo|null>
allowMissing tolerates an already-deleted
volume, resolving null instead of throwing.Parameters
Returns
Promise<VolumeInfo | null>downloadDir()
downloadDir(Download a guest directory’s contents into a local directory, named insailboxId,dirs):Promise<void>
dirs.Parameters
Returns
Promise<void>enableSsh()
enableSsh(Enable SSH on a Sailbox: trust the org SSH CA, startsailboxId,options?):Promise<SshEndpoint|null>
sshd, and expose
guest port 22 as TCP once the CA-only daemon owns it. A non-empty
allowlist restricts port 22 to those source addresses or ranges,
replacing any existing restriction. With wait (the default), polls until
the endpoint is reachable and returns it, throwing TimeoutError if
it is not within timeoutSeconds; with wait: false, skips the probe and
resolves null.Parameters
Returns
Promise<SshEndpoint | null>exec()
exec(Run a command in a Sailbox and return a handle to the live process. AsailboxId,command,options?):Promise<ExecProcess>
string command is run via /bin/sh -lc; a string[] is exec’d directly.
cwd/background apply to string commands (see ExecOptions).
Stopping the command is the caller’s job via ExecProcess.cancel.Parameters
Returns
Promise<ExecProcess>exposeListener()
exposeListener(Expose a guest port at runtime. Re-exposing a port under the same protocol sets itssailboxId,guestPort,protocol?,allowlist?):Promise<Listener>
allowlist to what you pass, so pass the whole list
every time; an empty one clears the restriction and reopens the port. The
route status starts “unknown”: the response confirms configuration, not
reachability.Parameters
Returns
Promise<Listener>findApp()
findApp(Find an app by name;name,mintIfMissing?):Promise<AppInfo>
mintIfMissing creates it when absent.Parameters
Returns
Promise<AppInfo>getListener()
getListener(Fetch one listener by guest port without waking the Sailbox.sailboxId,guestPort):Promise<Listener>
Parameters
Returns
Promise<Listener>getSailbox()
getSailbox(Fetch one Sailbox by id.sailboxId):Promise<SailboxInfo>
Parameters
Returns
Promise<SailboxInfo>getVolume()
getVolume(Look up an NFS volume by name;name,mintIfMissing?):Promise<VolumeInfo>
mintIfMissing creates it when absent.Parameters
Returns
Promise<VolumeInfo>ingressAuthHeaders()
ingressAuthHeaders(Ingress-identity headers for this Sailbox, as a name→value map.sailboxId):Promise<Record<string,string>>
Parameters
Returns
Promise<Record<string, string>>listApps()
listApps():Every app the current org owns, newest first.Promise<AppInfo[]>
Returns
Promise<AppInfo[]>listDir()
listDir(List a directory’s immediate entries as structured records.sailboxId,path,user?):Promise<DirEntry[]>
Parameters
Returns
Promise<DirEntry[]>listListeners()
listListeners(List a Sailbox’s listeners without waking it.sailboxId):Promise<Listener[]>
Parameters
Returns
Promise<Listener[]>listSailboxes()
listSailboxes(List one page of Sailboxes in the current org.params?):Promise<SailboxInfoPage>
Parameters
Returns
Promise<SailboxInfoPage>listVolumes()
listVolumes(List NFS volumes in the current org.maxObjects?):Promise<VolumeInfo[]>
Parameters
Returns
Promise<VolumeInfo[]>makeDir()
makeDir(Create a directory and any missing parents (likesailboxId,path,user?):Promise<void>
mkdir -p); a no-op if
it already exists.Parameters
Returns
Promise<void>orgSshCaPublicKey()
orgSshCaPublicKey():Fetch (creating on first use) the org SSH certificate authority public key. Used to preflight SSH before a Sailbox is provisioned.Promise<string>
Returns
Promise<string>pathExists()
pathExists(WhethersailboxId,path,user?):Promise<boolean>
path exists in the guest.Parameters
Returns
Promise<boolean>pauseSailbox()
pauseSailbox(Pause a Sailbox in memory.sailboxId):Promise<void>
Parameters
Returns
Promise<void>readStream()
readStream(Open a streaming read of a guest file.sailboxId,path):Promise<FileStream>
Parameters
Returns
Promise<FileStream>removePath()
removePath(Remove a file or directory tree (likesailboxId,path,user?):Promise<void>
rm -rf); a no-op if it is already
absent.Parameters
Returns
Promise<void>resolveImage()
resolveImage(Resolve an image definition into a content-addressed ImageSpec: the SDK walks local directories (gitignore-styledef):Promise<ImageSpec>
ignore), hashes every
file, and uploads content the server does not already have.Parameters
Returns
Promise<ImageSpec>resumeSailbox()
resumeSailbox(Resume a paused or sleeping Sailbox.sailboxId):Promise<SailboxHandle>
Parameters
Returns
Promise<SailboxHandle>setSailboxAutoSleep()
setSailboxAutoSleep(Replace when Sail may sleep a Sailbox on its own. Each call replaces the whole setting: switching tosailboxId,autoSleep):Promise<void>
{ automatic: false } clears any minimum wait
set earlier. Most callers use Sailbox.setAutoSleep.Parameters
Returns
Promise<void>shell()
shell(Open an interactive pty session on a Sailbox, bridged to the local terminal: raw keystrokes reach the remote process, output renders locally, and resizes propagate. Resolves with the remote process’s exit code. Requires an interactive terminal (stdin and stdout TTYs).sailboxId,command?,options?):Promise<number>
Parameters
Returns
Promise<number>sleepSailbox()
sleepSailbox(Sleep a Sailbox to disk (wakes on traffic), optionally scheduling a wall-clock wake first.sailboxId,wakeAt?):Promise<string|null>
wakeAt is an RFC 3339 timestamp; the returned
value is the effective (sooner) wake time, or null when no wake was
requested. Most callers use Sailbox.sleep, which takes and
returns Date.Parameters
Returns
Promise<string | null>terminateSailbox()
terminateSailbox(Terminate a Sailbox (idempotent).sailboxId):Promise<void>
Parameters
Returns
Promise<void>unexposeListener()
unexposeListener(Remove a runtime ingress port.sailboxId,guestPort):Promise<void>
Parameters
Returns
Promise<void>upgradeSailbox()
upgradeSailbox(Upgrade a Sailbox’s runtime (now if running, else at next wake).sailboxId):Promise<UpgradeResult>
Parameters
Returns
Promise<UpgradeResult>uploadDir()
uploadDir(Upload a local directory’s contents into a guest directory, named insailboxId,dirs):Promise<void>
dirs. user gives the uploaded entries to that user instead of the
image’s USER.Parameters
Returns
Promise<void>waitForListener()
waitForListener(Block until the listener onsailboxId,guestPort,timeoutSeconds):Promise<Listener>
guestPort is reachable end to end and
return it, throwing TimeoutError after timeoutSeconds. An HTTP
listener is ready once the guest server answers; a TCP listener once the
guest sends bytes or holds the connection open. A connectivity check, not
an application health check.Parameters
Returns
Promise<Listener>writeStream()
writeStream(Open a streaming upload to a guest file.sailboxId,path,options?):Promise<FileWriter>
Parameters
Returns
Promise<FileWriter>fromConfig()
Build a client from an explicit ClientConfig.staticfromConfig(config):Client
Parameters
Returns
ClientfromEnv()
Build a client from the environment (staticfromEnv():Client
SAIL_API_KEY, …).Returns
ClientdefaultClient()
defaultClient(): Client
The process-wide client used by the object-model statics (Sailbox,
App, Volume) when no explicit client is passed. Created
lazily from the environment on first use.Returns
ClientsetDefaultClient()
setDefaultClient(Override (or clear, withclient):void
undefined) the process-wide default client. Useful
for tests or to point the object-model API at an explicitly configured client.Parameters
Returns
voidresolveConfig()
resolveConfig(): ResolvedConfig
Resolve the SDK config from the environment (SAIL_API_KEY, SAIL_API_URL,
SAILBOX_API_URL, …) and ~/.sail, without requiring an API key. This is
the same resolution a client performs at construction.Returns
ResolvedConfigisSailError()
isSailError(Whethererr):err is SailError
err is a SailError, matched on the stable shape (code
string plus retryable boolean) rather than the prototype chain. Use it
where instanceof can lie: across realms (worker threads, vm contexts)
or when two copies of the SDK are loaded. It does not survive
structuredClone or postMessage serialization, which strip an Error’s
custom fields; send { name, message, code, retryable } yourself when an
error must cross a serialization boundary.Parameters
Returns
err is SailErrorTypes
Plain data types accepted by and returned from the calls above.AddLocalDir
A tree of local files copied into the image.Properties
AddLocalDirFile
One file within anaddLocalDir step.Properties
AddLocalDirOptions
Options for Image.addLocalDir.Properties
AddLocalFile
One local file copied into the image, referenced by content hash.Properties
AddLocalFileOptions
Options for Image.addLocalFile.Properties
AppInfo
A Sail app.Properties
AutoSleep
AutoSleep =When Sail may put a Sailbox to sleep on its own.Sail sleeps Sailboxes that are doing nothing, freeing their memory and waking them the moment anything needs them again. Waking takes a couple of seconds: free for a batch job, unwelcome if someone is waiting at a terminal.Both settings can only make Sail sleep the Sailbox less often. Neither causes a sleep, and Sail still sleeps a Sailbox only when it sits fully idle: no busy process, no imminent timer, nothing a sleep would interrupt. CallingAutomaticSleep|NeverSleep
sleep() yourself is unaffected, and so are pause,
resume, and scheduled wakes.The two forms are alternatives, so minSecondsBeforeSleep cannot be combined
with turning automatic sleep off.AutomaticSleep
Let Sail decide when to sleep a Sailbox, optionally after a minimum wait.Properties
BaseImage
BaseImage ="debian"|"devbox"
CancelOptions
Options for cancelling an exec.Properties
CheckpointOptions
Options for Sailbox.checkpoint.Properties
ClientConfig
Explicit client configuration (an alternative to environment resolution).Extends
Omit<native.ClientConfig,"mode">
Properties
ClientOptions
Options for statics that select which Client to use.Extended by
FindAppOptionsFindVolumeOptionsListVolumesOptionsCreateSailboxOptionsFromCheckpointOptionsListSailboxesOptionsListSailboxesPageOptions
Properties
CreateSailboxOptions
Options for Sailbox.create: the create request plus a per-attempt timeout and an optional explicit client.image defaults to the prebuilt
Debian base.Extends
Omit<CreateSailboxRequest,"image"|"appId"|"volumeMounts"|"ingressPorts">.ClientOptions
Properties
CreateSailboxRequest
Extends
Omit<native.CreateSailboxRequest,"image"|"ingressPorts"|"size"|"volumeMounts"|"autoSleep">
Properties
DeleteVolumeOptions
Options for Volume.delete.Properties
DirEntry
One entry in a directory listing fromSailbox.fs.ls, with type
narrowed to DirEntryType.Extends
Omit<native.DirEntry,"type">
Properties
DirEntryType
DirEntryType =The kind of a directory entry, reported for the entry itself: a symlink is"file"|"directory"|"symlink"|"other"
"symlink" regardless of what it points at.DockerfileContextDir
One directory of a Dockerfile build context.Properties
DockerfileContextSymlink
One symbolic link of a Dockerfile build context.Properties
DockerfileFromResolution
What one external image reference in a Dockerfile resolved to when an image was built.Properties
DockerfileImage
Your own Dockerfile built into an image, with its resolved build context. ARUN --mount of type cache, secret, or ssh, a bind mount
reading from another image, mount options that are not literal text, and
ONBUILD instructions are rejected.Properties
DockerfileSourceInput
A Dockerfile to build into the image, with its local build context. ARUN --mount of type cache, secret, or ssh, a bind mount
reading from another image, mount options that are not literal text, and
ONBUILD instructions are rejected.Properties
EnableSshOptions
Options for enabling SSH on a Sailbox.Properties
ExecOptions
Options for starting an exec.Extends
Omit<native.ExecStartOptions,"env">
Properties
ExecResult
The authoritative result of a finished exec.The bufferedstdout/stderr are a capped, drop-oldest tail (the server
keeps a bounded ring). To capture the complete output of a large-output
command, stream it live and consult the *Truncated/*Complete flags.Properties
ExposeOptions
Options for Sailbox.expose.Properties
FindAppOptions
Options for App.find.Extends
Properties
FindVolumeOptions
Options for Volume.find.Extends
Properties
FromCheckpointOptions
Options for Sailbox.fromCheckpoint.Extends
Properties
FromCheckpointRequest
The create-from-checkpoint request.Extended by
Properties
FromDockerfileOptions
Options for Image.fromDockerfile.Properties
FromRegistryOptions
Options for Image.fromRegistry.Properties
FsOptions
Options for the directory helpers (SailboxFs.mkdir, SailboxFs.remove, SailboxFs.exists, SailboxFs.ls).Properties
HttpEndpoint
The routable HTTPS address of anhttp listener.Properties
ImageArchitecture
ImageArchitecture ="amd64"|"arm64"
ImageBuild
The state of a custom image build.Extends
Omit<native.ImageBuild,"status">
Properties
ImageBuildOptions
Options for Image.build.Properties
ImageBuildStatus
ImageBuildStatus =The status of a custom image build."unknown"|"queued"|"building"|"ready"|"failed"
ImageBuildStep
ImageBuildStep = {One build step: exactly one operation. Each union memberaddLocalDir?:never;addLocalFile?:never;aptInstall:PackageInstall;pipInstall?:never;runCommand?:never; } | {addLocalDir?:never;addLocalFile?:never;aptInstall?:never;pipInstall:PackageInstall;runCommand?:never; } | {addLocalDir?:never;addLocalFile?:never;aptInstall?:never;pipInstall?:never;runCommand:RunCommand; } | {addLocalDir?:never;addLocalFile:AddLocalFile;aptInstall?:never;pipInstall?:never;runCommand?:never; } | {addLocalDir:AddLocalDir;addLocalFile?:never;aptInstall?:never;pipInstall?:never;runCommand?:never; }
never-types the
other operations, so a step that sets two of them is a compile error (a
bare union of the operations would accept it).ImageDefinition
A custom image definition: a base, registry, or Dockerfile image plus ordered build steps, where local-file steps still reference paths on this machine.Properties
ImageDefinitionStep
One image-definition step. Exactly one of the fields must be set.Properties
ImageSpec
A Sailbox image: a base or registry image plus ordered build steps.Extends
Omit<native.ImageSpec,"base"|"buildSteps"|"architecture"|"filesystem">
Properties
IngressPortInput
A guest port to reserve for ingress at create time.Extends
Omit<native.IngressPortInput,"protocol"|"allowlist">
Properties
IngressProtocol
IngressProtocol =The protocol you request when exposing a port."tcp"|"http"
IngressScheme
IngressScheme =How a listener’s URL is addressed under"path"|"subdomain"
ingressBase.ListSailboxesOptions
Options for Sailbox.list: the server-side filters, a total-caplimit, and an optional client.Extends
Omit<ListSailboxesQuery,"limit"|"offset">.ClientOptions
Properties
ListSailboxesPageOptions
Options for Sailbox.listPage: the same filters as ListSailboxesOptions, pluslimit/offset page selection and an
optional client.Extends
Properties
ListSailboxesQuery
Filters for listing Sailboxes.Extends
Omit<native.ListSailboxesQuery,"status"|"order">
Extended by
Properties
ListVolumesOptions
Options for Volume.list.Extends
Properties
Listener
An exposed guest port and how to reach it.Properties
ListenerEndpoint
ListenerEndpoint =How to reach an exposed listener; discriminate onHttpEndpoint|TcpEndpoint
kind.ListenerRouteStatus
ListenerRouteStatus =Status of a listener’s ingress route (open: tolerates unknown values)."unknown"|"pending"|"active"|"restoring"|"unavailable"|string&object
LocalDirInput
A local directory tree to bake into the image (walked, hashed, and uploaded at resolve; symlinks skipped, file modes preserved).Properties
LocalFileInput
One local file to bake into the image (hashed and uploaded at resolve).Properties
NeverSleep
Stop Sail sleeping a Sailbox on its own.minSecondsBeforeSleep belongs to
AutomaticSleep, so it cannot be combined with this.Properties
PackageInstall
A set of packages to install (apt or pip).Properties
Protocol
Protocol =The protocol reported on a listener (open: tolerates unknown values)."tcp"|"http"|string&object
ResolvedConfig
The config resolved from the environment and~/.sail.Extends
Omit<native.ResolvedConfig,"ingressScheme"|"mode">
Properties
RunCommand
A shell command to run during the build.Properties
RunOptions
Options for Sailbox.run: the subset of ExecOptions that fits a buffered, run-to-completion command.Extends
Pick<ExecOptions,"timeoutSeconds"|"cwd"|"env"|"user"|"idempotencyKey">
Properties
SailboxCheckpoint
A durable checkpoint handle.Extends
Omit<native.SailboxCheckpoint,"status"|"expiresAt">
Properties
SailboxDeprecation
SailboxDeprecation = native.SailboxDeprecation
Actionable notice that a Sailbox’s runtime should be upgraded: a deadline
date and a message with upgrade instructions.SailboxHandle
Returned by create / resume / fromCheckpoint: the Sailbox’s identity and lifecycle status.Properties
SailboxInfo
A read snapshot of a Sailbox (get / list). Timestamps are RFC 3339 strings.Extends
Omit<native.SailboxInfo,"status"|"autoSleep">
Properties
SailboxInfoPage
One page of list results plus the pagination envelope.Extends
Omit<native.SailboxInfoPage,"items">
Properties
SailboxListOrder
SailboxListOrder =Result ordering for a Sailbox list: most recently active first, or newest created first."newest_active"|"newest_created"
SailboxPage
One page of Sailbox instances plus the pagination envelope.Extends
Omit<SailboxInfoPage,"items">
Properties
SailboxSize
SailboxSize =Named resource size; each sets the vCPU count plus default memory/disk."s"|"m"|"l"
SailboxStatus
SailboxStatus =Lifecycle status of a Sailbox. Open: tolerates values added server-side."running"|"paused"|"sleeping"|"failed"|"terminated"|string&object
SailboxStatusFilter
SailboxStatusFilter =The closed set of statuses accepted as a list filter."running"|"paused"|"sleeping"|"failed"|"terminated"
ShellOptions
Options for Sailbox.shell.Properties
SshEndpoint
The public TCP endpoint a Sailbox’s SSH listener is reachable at.Properties
TcpEndpoint
The address to dial for atcp listener.Properties
UpgradeResult
The outcome of a Sailbox runtime upgrade.Extends
Omit<native.UpgradeResult,"status">
Properties
VolumeInfo
A managed NFS volume. Timestamps are RFC 3339 strings.Properties
VolumeMountInput
An NFS volume to mount at create time.Properties
WaitForListenerOptions
Options for Sailbox.waitForListener.Properties
WriteOptions
Options for uploading a file.Properties
Errors
Errors thrown by this SDK surface. All of them extend SailError, so aninstanceof SailError check matches everything below.SailError
Base class for every error surfaced by the SDK.Extends
Error
Extended by
InvalidArgumentErrorInternalErrorNotFoundErrorPermissionDeniedErrorFileNotFoundErrorBrokenPipeErrorTimeoutErrorTransportErrorApiErrorSailboxCreationErrorImageBuildErrorSailboxExecutionError
Constructors
Constructor
new SailError(message,code?,details?):SailError
Parameters
Returns
SailErrorOverrides
Error.constructorProperties
ApiError
A non-2xx API response.Extends
Constructors
Constructor
new ApiError(message,details?):ApiError
Parameters
Returns
ApiErrorOverrides
SailError.constructorProperties
BrokenPipeError
A stream (e.g. exec stdin) was closed and can no longer be written.Extends
Constructors
Constructor
new BrokenPipeError(message,details?):BrokenPipeError
Parameters
Returns
BrokenPipeErrorOverrides
SailError.constructorProperties
CommandFailedError
Thrown by Sailbox.run withcheck when the command exits nonzero
or times out. Carries the completed result as result.Extends
Constructors
Constructor
new CommandFailedError(message,result):CommandFailedError
Parameters
Returns
CommandFailedErrorOverrides
SailboxExecutionError.constructorProperties
FileNotFoundError
A remote file path does not exist.Extends
Constructors
Constructor
new FileNotFoundError(message,details?):FileNotFoundError
Parameters
Returns
FileNotFoundErrorOverrides
SailError.constructorProperties
ImageBuildError
A custom image could not be built or its local content could not be uploaded.Extends
Constructors
Constructor
new ImageBuildError(message,details?):ImageBuildError
Parameters
Returns
ImageBuildErrorOverrides
SailError.constructorProperties
InternalError
An unexpected internal SDK failure.Extends
Constructors
Constructor
new InternalError(message,details?):InternalError
Parameters
Returns
InternalErrorOverrides
SailError.constructorProperties
InvalidArgumentError
Invalid arguments or configuration (bad request, missing/invalid API key).Extends
Constructors
Constructor
new InvalidArgumentError(message,details?):InvalidArgumentError
Parameters
Returns
InvalidArgumentErrorOverrides
SailError.constructorProperties
NotFoundError
The Sailbox, volume, or other resource does not exist (or is another org’s).Extends
Constructors
Constructor
new NotFoundError(message,details?):NotFoundError
Parameters
Returns
NotFoundErrorOverrides
SailError.constructorProperties
PermissionDeniedError
The credential is not permitted to perform the operation.Extends
Constructors
Constructor
new PermissionDeniedError(message,details?):PermissionDeniedError
Parameters
Returns
PermissionDeniedErrorOverrides
SailError.constructorProperties
SailboxCreationError
A Sailbox could not be created (provisioning failed).Extends
Constructors
Constructor
new SailboxCreationError(message,details?):SailboxCreationError
Parameters
Returns
SailboxCreationErrorOverrides
SailError.constructorProperties
SailboxExecRequestNotFoundError
The exec request could not be found (for example after the Sailbox moved machines).Extends
Constructors
Constructor
new SailboxExecRequestNotFoundError(message,details?):SailboxExecRequestNotFoundError
Parameters
Returns
SailboxExecRequestNotFoundErrorOverrides
SailboxExecutionError.constructorProperties
SailboxExecutionError
Base class for failures during an exec.Extends
Extended by
Constructors
Constructor
new SailboxExecutionError(message,code?,details?):SailboxExecutionError
Parameters
Returns
SailboxExecutionErrorOverrides
SailError.constructorProperties
SailboxHostLostError
The machine hosting the Sailbox was lost while an exec was in flight.Extends
Constructors
Constructor
new SailboxHostLostError(message,details?):SailboxHostLostError
Parameters
Returns
SailboxHostLostErrorOverrides
SailboxExecutionError.constructorProperties
SailboxTerminatedError
The Sailbox was terminated while an exec was in flight.Extends
Constructors
Constructor
new SailboxTerminatedError(message,details?):SailboxTerminatedError
Parameters
Returns
SailboxTerminatedErrorOverrides
SailboxExecutionError.constructorProperties
TimeoutError
A request exceeded its timeout.Extends
Constructors
Constructor
new TimeoutError(message,details?):TimeoutError
Parameters
Returns
TimeoutErrorOverrides
SailError.constructorProperties
TransportError
A network/connection transport failure.Extends
Constructors
Constructor
new TransportError(message,details?):TransportError
Parameters
Returns
TransportErrorOverrides
SailError.constructor