Classes
ApiError
A transient, retryable server-side API failure.Extends
Constructors
Constructor
new ApiError(message):ApiError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
ApiError
Overrides
SailError.constructor
Properties
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
| Parameter | Type |
|---|---|
name | string |
options | ClientOptions & object |
Returns
Promise<App>
list()
Every app the current org owns, newest first.staticlist(options?):Promise<App[]>
Parameters
| Parameter | Type |
|---|---|
options | ClientOptions |
Returns
Promise<App[]>
BrokenPipeError
A stream (e.g. exec stdin) was closed and can no longer be written.Extends
Constructors
Constructor
new BrokenPipeError(message):BrokenPipeError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
BrokenPipeError
Overrides
SailError.constructor
Properties
Client
A configured Sail client: the low-level surface over the native core (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 builtin base skips the build;def,timeoutSeconds):Promise<ImageSpec>
timeoutSeconds bounds the whole pipeline
(hashing, uploads, and the build).
Parameters
| Parameter | Type |
|---|---|
def | ImageDefinition |
timeoutSeconds | number |
Returns
Promise<ImageSpec>
buildSpecToReady()
buildSpecToReady(Build an already-resolved spec to ready (submit + poll), bounded byspec,timeoutSeconds):Promise<ImageBuild>
timeoutSeconds.
Parameters
| Parameter | Type |
|---|---|
spec | ImageSpec |
timeoutSeconds | number |
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
| Parameter | Type |
|---|---|
sailboxId | string |
options | CheckpointOptions |
Returns
Promise<SailboxCheckpoint>
createFromCheckpoint()
createFromCheckpoint(Create a new sailbox from a checkpoint.params):Promise<SailboxHandle>
Parameters
| Parameter | Type |
|---|---|
params | FromCheckpointRequest |
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. Timed-out attempts are retried,
reattaching to the same box, so when the overall budget is exhausted the
box may still be coming up server-side: find or terminate it by name.
image defaults to a plain Debian base.
Parameters
| Parameter | Type | Default value |
|---|---|---|
req | CreateSailboxRequest | undefined |
timeoutSeconds | number | 600 |
Returns
Promise<SailboxHandle>
deleteVolume()
deleteVolume(Delete a volume by id. ResolvesvolumeId,allowMissing?):Promise<VolumeInfo|null>
null when allowMissing and it’s gone.
Parameters
| Parameter | Type | Default value |
|---|---|---|
volumeId | string | undefined |
allowMissing | boolean | false |
Returns
Promise<VolumeInfo | null>
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 CIDRs, 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
| Parameter | Type |
|---|---|
sailboxId | string |
options | EnableSshOptions |
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).
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
command | string | string[] |
options | ExecOptions |
Returns
Promise<ExecProcess>
exposeListener()
exposeListener(Expose a guest port at runtime (route status starts “unspecified”; the response confirms configuration, not reachability).sailboxId,guestPort,protocol?,allowlist?):Promise<Listener>
Parameters
| Parameter | Type | Default value |
|---|---|---|
sailboxId | string | undefined |
guestPort | number | undefined |
protocol | IngressProtocol | "http" |
allowlist | string[] | [] |
Returns
Promise<Listener>
findApp()
findApp(Find an app by name, optionally minting it.name,mintIfMissing?):Promise<AppInfo>
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
mintIfMissing | boolean | false |
Returns
Promise<AppInfo>
getListener()
getListener(Fetch one listener by guest port without waking the box.sailboxId,guestPort):Promise<Listener>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
guestPort | number |
Returns
Promise<Listener>
getSailbox()
getSailbox(Fetch one sailbox by id.sailboxId):Promise<SailboxInfo>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<SailboxInfo>
getVolume()
getVolume(Look up (optionally minting) an NFS volume by name.name,mintIfMissing?):Promise<VolumeInfo>
Parameters
| Parameter | Type | Default value |
|---|---|---|
name | string | undefined |
mintIfMissing | boolean | false |
Returns
Promise<VolumeInfo>
ingressAuthHeaders()
ingressAuthHeaders(Ingress-identity headers for this sailbox, as a name→value map.sailboxId):Promise<Record<string,string>>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<Record<string, string>>
isBuiltinBaseSpec()
isBuiltinBaseSpec(Whether a spec is a bare builtin base the backend ships prebuilt (no build needed).spec):boolean
Parameters
| Parameter | Type |
|---|---|
spec | ImageSpec |
Returns
boolean
listApps()
listApps():Every app the current org owns, newest first.Promise<AppInfo[]>
Returns
Promise<AppInfo[]>
listListeners()
listListeners(List a sailbox’s listeners without waking it.sailboxId):Promise<Listener[]>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<Listener[]>
listSailboxes()
listSailboxes(List one page of sailboxes in the current org.params?):Promise<SailboxInfoPage>
Parameters
| Parameter | Type |
|---|---|
params | ListSailboxesQuery |
Returns
Promise<SailboxInfoPage>
listVolumes()
listVolumes(List NFS volumes in the current org.maxObjects?):Promise<VolumeInfo[]>
Parameters
| Parameter | Type |
|---|---|
maxObjects? | number |
Returns
Promise<VolumeInfo[]>
orgSshCaPublicKey()
orgSshCaPublicKey():Fetch (creating on first use) the org SSH certificate authority public key. Used to preflight SSH before a box is provisioned.Promise<string>
Returns
Promise<string>
pauseSailbox()
pauseSailbox(Pause a sailbox in memory.sailboxId):Promise<void>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<void>
readStream()
readStream(Open a streaming read of a guest file.sailboxId,path):Promise<FileStream>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
path | string |
Returns
Promise<FileStream>
resolveImage()
resolveImage(Resolve an image definition into a content-addressed ImageSpec: the core walks local directories (gitignore-styledef):Promise<ImageSpec>
ignore), hashes every
file, and uploads content the server does not already have.
Parameters
| Parameter | Type |
|---|---|
def | ImageDefinition |
Returns
Promise<ImageSpec>
resumeSailbox()
resumeSailbox(Resume a paused or sleeping sailbox.sailboxId):Promise<SailboxHandle>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<SailboxHandle>
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
| Parameter | Type |
|---|---|
sailboxId | string |
command? | string |
options? | ShellOptions |
Returns
Promise<number>
sleepSailbox()
sleepSailbox(Sleep a sailbox to disk (wakes on traffic).sailboxId):Promise<void>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<void>
terminateSailbox()
terminateSailbox(Terminate a sailbox (idempotent).sailboxId):Promise<void>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<void>
unexposeListener()
unexposeListener(Remove a runtime ingress port.sailboxId,guestPort):Promise<void>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
guestPort | number |
Returns
Promise<void>
upgradeSailbox()
upgradeSailbox(Upgrade a sailbox’s in-guest agent (now if running, else at next wake).sailboxId):Promise<UpgradeResult>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
Returns
Promise<UpgradeResult>
waitForListener()
waitForListener(Block until the listener onsailboxId,guestPort,timeoutSeconds,pollIntervalSeconds):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
| Parameter | Type |
|---|---|
sailboxId | string |
guestPort | number |
timeoutSeconds | number |
pollIntervalSeconds | number |
Returns
Promise<Listener>
writeStream()
writeStream(Open a streaming upload to a guest file.sailboxId,path,options?):Promise<FileWriter>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
path | string |
options | WriteOptions |
Returns
Promise<FileWriter>
fromConfig()
Build a client from an explicit ClientConfig.staticfromConfig(config):Client
Parameters
| Parameter | Type |
|---|---|
config | ClientConfig |
Returns
Client
fromEnv()
Build a client from the environment (staticfromEnv():Client
SAIL_API_KEY, …).
Returns
Client
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
| Property | Modifier | Type | Description |
|---|---|---|---|
stderr | readonly | ExecStream | Stderr as an async iterable of decoded chunks. |
stdout | readonly | ExecStream | Stdout as an async iterable of decoded chunks. |
Accessors
execRequestId
Get Signature
get execRequestId(): string
The durable exec request id.
Returns
string
idempotencyKey
Get Signature
get idempotencyKey(): string
The idempotency key used to launch the command.
Returns
string
output
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
ExecStream
Methods
[asyncDispose]()
[asyncDispose]():Promise<void>
await using support: detaches on scope exit.
Returns
Promise<void>
[dispose]()
[dispose](): void
using support: detaches on scope exit.
Returns
void
cancel()
cancel(Cancel the command (SIGINT by default, SIGKILL withoptions?):Promise<void>
force).
Parameters
| Parameter | Type |
|---|---|
options | CancelOptions |
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
void
closeStdin()
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 worker-lost exec (no real exit code), as wait does.
Returns
number | null
resize()
resize(Resize the pty (no-op without one).cols,rows):Promise<void>
Parameters
| Parameter | Type |
|---|---|
cols | number |
rows | number |
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
| Parameter | Type |
|---|---|
timeoutSeconds | number |
Returns
Promise<boolean>
writeStdin()
writeStdin(Write to the command’s stdin (requiresdata):Promise<void>
openStdin).
Parameters
| Parameter | Type |
|---|---|
data | string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike> |
Returns
Promise<void>
ExecStream
An async-iterable view of one exec stream (stdout or stderr). Chunks are decoded UTF-8 strings; iteration ends at end of stream.Example
Implements
AsyncIterable<string>
Methods
[asyncIterator]()
[asyncIterator]():AsyncIterator<string>
Returns
AsyncIterator<string>
Implementation of
AsyncIterable.[asyncIterator]
text()
text():Collect the whole stream into a single string.Promise<string>
Returns
Promise<string>
toReadable()
toReadable(): Readable
Adapt to a Node Readable (e.g. to .pipe() it somewhere).
Returns
Readable
FileNotFoundError
A remote file path does not exist.Extends
Constructors
Constructor
new FileNotFoundError(message):FileNotFoundError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
FileNotFoundError
Overrides
SailError.constructor
Properties
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
Readable
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
abort()
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
void
finish()
finish():Confirm the write, creating an empty file if nothing was written.Promise<void>
Returns
Promise<void>
write()
write(Write bytes (adata):Promise<void>
string is encoded as UTF-8). The core splits them into
transport-sized chunks.
Parameters
| Parameter | Type |
|---|---|
data | string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike> |
Returns
Promise<void>
Image
A custom image definition. Immutable and fluent: each method returns a newImage. Local files/dirs are recorded here and hashed + uploaded by the
core 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
| Parameter | Type |
|---|---|
localPath | string |
remotePath | string |
options | AddLocalDirOptions |
Returns
Image
addLocalFile()
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
| Parameter | Type |
|---|---|
localPath | string |
remotePath | string |
options | AddLocalFileOptions |
Returns
Image
aptInstall()
aptInstall(…Install system packages with apt.packages):Image
Parameters
| Parameter | Type |
|---|---|
…packages | string[] |
Returns
Image
build()
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.options?):Promise<ImageSpec>
Parameters
Returns
Promise<ImageSpec>
env()
env(Bake environment variables into the image (keys are trimmed).env):Image
Parameters
| Parameter | Type |
|---|---|
env | Record<string, string> |
Returns
Image
pipInstall()
pipInstall(…Install Python packages with pip.packages):Image
Parameters
| Parameter | Type |
|---|---|
…packages | string[] |
Returns
Image
runCommand()
runCommand(Run a shell command during the build.command):Image
Parameters
| Parameter | Type |
|---|---|
command | string |
Returns
Image
toSpec()
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
| Parameter | Type |
|---|---|
client? | Client |
Returns
Promise<ImageSpec>
debian()
A Debian base image (defaults to arm64).staticdebian(architecture?):Image
Parameters
| Parameter | Type | Default value |
|---|---|---|
architecture | ImageArchitecture | "arm64" |
Returns
Image
devbox()
The devbox base image (defaults to arm64): a prebuilt Debian base with a baked development layer. Prebuilt-only, so it does not support build steps or env; start from Image.debian to customize.staticdevbox(architecture?):Image
Parameters
| Parameter | Type | Default value |
|---|---|---|
architecture | ImageArchitecture | "arm64" |
Returns
Image
ImageBuildError
A custom image could not be built or its local content could not be uploaded.Extends
Constructors
Constructor
new ImageBuildError(message):ImageBuildError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
ImageBuildError
Overrides
SailError.constructor
Properties
InternalError
An unexpected internal SDK/core failure.Extends
Constructors
Constructor
new InternalError(message):InternalError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
InternalError
Overrides
SailError.constructor
Properties
InvalidArgumentError
Invalid arguments or configuration (bad request, missing/invalid API key).Extends
Constructors
Constructor
new InvalidArgumentError(message):InvalidArgumentError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
InvalidArgumentError
Overrides
SailError.constructor
Properties
NotFoundError
The sailbox, volume, or other resource does not exist (or is another org’s).Extends
Constructors
Constructor
new NotFoundError(message):NotFoundError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
NotFoundError
Overrides
SailError.constructor
Properties
PermissionDeniedError
The credential is not permitted to perform the operation.Extends
Constructors
Constructor
new PermissionDeniedError(message):PermissionDeniedError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
PermissionDeniedError
Overrides
SailError.constructor
Properties
Sailbox
A sandbox (sailbox): the primary object agent harnesses work with. Create one with Sailbox.create, run commands with exec, move files with writeStream/readStream, 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 | undefined
appName
Get Signature
get appName():Name of the owning app.string|undefined
Returns
string | undefined
architecture
Get Signature
get architecture():CPU architecture (for examplestring|undefined
arm64).
Returns
string | undefined
checkpointGeneration
Get Signature
get checkpointGeneration():Checkpoint generation counter as of the snapshot.number|undefined
Returns
number | undefined
client
Get Signature
get client(): Client
The underlying Client.
Returns
Client
cpuRequestedVcpu
Get Signature
get cpuRequestedVcpu():Requested CPU, in vCPUs.number|undefined
Returns
number | undefined
cpuUsedVcpu
Get Signature
get cpuUsedVcpu():Current CPU usage, in vCPUs, as of the snapshot.number|undefined
Returns
number | undefined
createdAt
Get Signature
get createdAt():When the sailbox was created.Date|undefined
Returns
Date | undefined
diskRequestedBytes
Get Signature
get diskRequestedBytes():Requested disk, in bytes.number|undefined
Returns
number | undefined
diskUsedBytes
Get Signature
get diskUsedBytes():Current disk usage, in bytes, as of the snapshot.number|undefined
Returns
number | undefined
errorMessage
Get Signature
get errorMessage():Failure detail when the status isstring|undefined
failed.
Returns
string | undefined
guestSchemaVersion
Get Signature
get guestSchemaVersion():In-guest agent schema version the sailbox last booted with.number|undefined
Returns
number | undefined
imageId
Get Signature
get imageId():Identifier of the image the sailbox was created from.string|undefined
Returns
string | undefined
lastCheckpointedAt
Get Signature
get lastCheckpointedAt():When the most recent checkpoint was taken.Date|undefined
Returns
Date | undefined
memoryMib
Get Signature
get memoryMib():Configured memory, in MiB.number|undefined
Returns
number | undefined
memoryRequestedBytes
Get Signature
get memoryRequestedBytes():Requested memory, in bytes.number|undefined
Returns
number | undefined
memoryUsedBytes
Get Signature
get memoryUsedBytes():Current memory usage, in bytes, as of the snapshot.number|undefined
Returns
number | undefined
name
Get Signature
get name(): string
The sailbox name.
Returns
string
sailboxId
Get Signature
get sailboxId(): string
The sailbox’s stable identifier.
Returns
string
startedAt
Get Signature
get startedAt():When the current boot started (RFC 3339).Date|undefined
Returns
Date | undefined
stateDiskSizeGib
Get Signature
get stateDiskSizeGib():Configured state-disk size, in GiB.number|undefined
Returns
number | undefined
status
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
SailboxStatus
updatedAt
Get Signature
get updatedAt():When the sailbox last changed.Date|undefined
Returns
Date | undefined
vcpuCount
Get Signature
get vcpuCount():Configured number of vCPUs.number|undefined
Returns
number | undefined
Methods
checkpoint()
checkpoint(Take a checkpoint of this sailbox. The returned handle carriesoptions?):Promise<SailboxCheckpoint>
expiresAt, when it becomes eligible for garbage collection.
Parameters
| Parameter | Type |
|---|---|
options | CheckpointOptions |
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). 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
| Parameter | Type |
|---|---|
options | EnableSshOptions |
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).
Parameters
| Parameter | Type |
|---|---|
command | string | string[] |
options? | ExecOptions |
Returns
Promise<ExecProcess>
expose()
expose(Expose a guest port at runtime. The returned listener carries the resolved endpoint but anguestPort,protocol?,allowlist?):Promise<Listener>
"unspecified" route status: the response
confirms configuration, not reachability; waitForListener
confirms the route is live.
Parameters
| Parameter | Type | Default value |
|---|---|---|
guestPort | number | undefined |
protocol | IngressProtocol | "http" |
allowlist | string[] | [] |
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 box.guestPort):Promise<Listener>
Parameters
| Parameter | Type |
|---|---|
guestPort | number |
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>
read()
read(Read a guest file fully into memory (convenience over readStream).path):Promise<Buffer<ArrayBufferLike>>
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<Buffer<ArrayBufferLike>>
readStream()
readStream(Open a streaming read of a guest file.path):Promise<FileStream>
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<FileStream>
resume()
resume():Resume this sailbox (updates status).Promise<void>
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).
Parameters
| Parameter | Type |
|---|---|
command? | string |
options? | ShellOptions |
Returns
Promise<number>
sleep()
sleep():Sleep this sailbox to disk (wakes on traffic).Promise<void>
Returns
Promise<void>
terminate()
terminate():Terminate (delete) this sailbox (updates status).Promise<void>
Returns
Promise<void>
unexpose()
unexpose(Remove a runtime ingress port.guestPort):Promise<void>
Parameters
| Parameter | Type |
|---|---|
guestPort | number |
Returns
Promise<void>
upgrade()
upgrade():Upgrade this sailbox’s in-guest agent.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
| Parameter | Type |
|---|---|
guestPort | number |
options | WaitForListenerOptions |
Returns
Promise<Listener>
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
| Parameter | Type |
|---|---|
path | string |
data | string | Buffer<ArrayBufferLike> | Uint8Array<ArrayBufferLike> |
options? | WriteOptions |
Returns
Promise<void>
writeStream()
writeStream(Open a streaming upload to a guest file.path,options?):Promise<FileWriter>
Parameters
| Parameter | Type |
|---|---|
path | string |
options? | WriteOptions |
Returns
Promise<FileWriter>
create()
Create a new sailbox.staticcreate(options):Promise<Sailbox>
Parameters
| Parameter | Type |
|---|---|
options | CreateSailboxOptions |
Returns
Promise<Sailbox>
fromCheckpoint()
Create a new sailbox from a checkpoint.staticfromCheckpoint(options):Promise<Sailbox>
Parameters
| Parameter | Type |
|---|---|
options | FromCheckpointOptions |
Returns
Promise<Sailbox>
get()
Fetch an existing sailbox by id.staticget(sailboxId,options?):Promise<Sailbox>
Parameters
| Parameter | Type |
|---|---|
sailboxId | string |
options | ClientOptions |
Returns
Promise<Sailbox>
list()
List one page of sailboxes as Sailbox instances.staticlist(params?,options?):Promise<Sailbox[]>
Parameters
| Parameter | Type |
|---|---|
params | ListSailboxesQuery |
options | ClientOptions |
Returns
Promise<Sailbox[]>
listPage()
Like list but also returns the pagination envelope (staticlistPage(params?,options?):Promise<SailboxPage>
total/hasMore) for paging through large result sets.
Parameters
| Parameter | Type |
|---|---|
params | ListSailboxesQuery |
options | ClientOptions |
Returns
Promise<SailboxPage>
SailboxCreationError
A sailbox could not be created (provisioning failed).Extends
Constructors
Constructor
new SailboxCreationError(message):SailboxCreationError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
SailboxCreationError
Overrides
SailError.constructor
Properties
SailboxExecRequestNotFoundError
The exec request could not be found (for example after the sailbox moved machines).Extends
Constructors
Constructor
new SailboxExecRequestNotFoundError(message):SailboxExecRequestNotFoundError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
SailboxExecRequestNotFoundError
Overrides
SailboxExecutionError.constructor
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
code | readonly | string | Stable, language-neutral error code (e.g. "NotFound"). | SailboxExecutionError.code |
SailboxExecutionError
Base class for failures during an exec.Extends
Extended by
Constructors
Constructor
new SailboxExecutionError(message,code?):SailboxExecutionError
Parameters
| Parameter | Type | Default value |
|---|---|---|
message | string | undefined |
code | string | "SailboxExecutionError" |
Returns
SailboxExecutionError
Overrides
SailError.constructor
Properties
SailboxTerminatedError
The sailbox was terminated while an exec was in flight.Extends
Constructors
Constructor
new SailboxTerminatedError(message):SailboxTerminatedError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
SailboxTerminatedError
Overrides
SailboxExecutionError.constructor
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
code | readonly | string | Stable, language-neutral error code (e.g. "NotFound"). | SailboxExecutionError.code |
SailboxWorkerLostError
The machine hosting the sailbox was lost while an exec was in flight.Extends
Constructors
Constructor
new SailboxWorkerLostError(message):SailboxWorkerLostError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
SailboxWorkerLostError
Overrides
SailboxExecutionError.constructor
Properties
| Property | Modifier | Type | Description | Inherited from |
|---|---|---|---|---|
code | readonly | string | Stable, language-neutral error code (e.g. "NotFound"). | SailboxExecutionError.code |
SailError
Base class for every error surfaced by the SDK.Extends
Error
Extended by
InvalidArgumentErrorInternalErrorNotFoundErrorPermissionDeniedErrorFileNotFoundErrorBrokenPipeErrorTimeoutErrorTransportErrorApiErrorSailboxCreationErrorImageBuildErrorSailboxExecutionError
Constructors
Constructor
new SailError(message,code?):SailError
Parameters
| Parameter | Type | Default value |
|---|---|---|
message | string | undefined |
code | string | "SailError" |
Returns
SailError
Overrides
Error.constructor
Properties
TimeoutError
A request exceeded its timeout.Extends
Constructors
Constructor
new TimeoutError(message):TimeoutError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
TimeoutError
Overrides
SailError.constructor
Properties
TransportError
A network/connection transport failure.Extends
Constructors
Constructor
new TransportError(message):TransportError
Parameters
| Parameter | Type |
|---|---|
message | string |
Returns
TransportError
Overrides
SailError.constructor
Properties
Volume
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.
Properties
| Property | Modifier | Type | Default value | Description |
|---|---|---|---|---|
backend | readonly | string | undefined | Storage backend serving the volume. |
createdAt | readonly | Date | null | undefined | Creation time, if reported. |
id | readonly | string | undefined | Stable volume id. |
mountPath | readonly | string | null | null | Guest mount path, when loaded via Volume.fromMount. |
name | readonly | string | undefined | Volume name. |
status | readonly | string | undefined | Lifecycle status. |
updatedAt | readonly | Date | null | undefined | Last-update time, if reported. |
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
| Parameter | Type |
|---|---|
options | { allowMissing?: boolean; } |
options.allowMissing? | boolean |
Returns
Promise<boolean>
find()
Look up an NFS volume by name, optionally minting it if missing.staticfind(name,options?):Promise<Volume>
Parameters
| Parameter | Type |
|---|---|
name | string |
options | ClientOptions & object |
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
| Parameter | Type |
|---|---|
path | string |
Returns
Volume
list()
List NFS volumes in the current org.staticlist(options?):Promise<Volume[]>
Parameters
| Parameter | Type |
|---|---|
options | ClientOptions & object |
Returns
Promise<Volume[]>
Interfaces
AddLocalDir
A tree of local files copied into the image.Properties
| Property | Type | Description |
|---|---|---|
files? | AddLocalDirFile[] | The files to place under remotePath. |
remotePath? | string | Absolute guest path of the directory root. |
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
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
Properties
| Property | Type | Description |
|---|---|---|
client? | Client | Use a specific client instead of the default (env) one. |
CreateSailboxOptions
Options for Sailbox.create: the create request plus a per-attempt timeout and an optional explicit client.image defaults to a Debian base.
Extends
Omit<CreateSailboxRequest,"image"|"appId"|"volumeMounts"|"ingressPorts">.ClientOptions
Properties
| Property | Type | Description | Overrides | Inherited from |
|---|---|---|---|---|
app | string | App | The owning app, or its id. | - | - |
autosleepTimeoutMinutes? | number | Idle minutes (1-1440) after which Sail may sleep the box. | - | Omit.autosleepTimeoutMinutes |
client? | Client | Use a specific client instead of the default (env) one. | - | ClientOptions.client |
diskGib? | number | Disk size in whole GiB within the size’s range; the size’s default when omitted. | - | Omit.diskGib |
image? | ImageSpec | Image | Image spec, or an Image builder (built and resolved at create). Defaults to a plain Debian base. | - | - |
imageBuildTimeoutSeconds? | number | Timeout in seconds for building a custom Image before create (1800). | - | - |
ingressPorts? | (number | IngressPortInput)[] | Guest ports to expose: a bare number is HTTP shorthand. | - | - |
memoryGib? | number | Memory limit in whole GiB within the size’s range; the size’s default when omitted. | - | Omit.memoryGib |
name | string | The sailbox name. | - | Omit.name |
size? | SailboxSize | Resource size; "m" when omitted. | - | CreateSailboxRequest.size |
ssh? | boolean | Enable SSH on the new sailbox after create: trust the org SSH CA, start sshd, and expose guest port 22 as TCP once the CA-only daemon owns it (an explicit port-22 ingress entry contributes just its allowlist). Equivalent to calling Sailbox.enableSsh after create. | Omit.ssh | - |
timeoutSeconds? | number | Bounds each create attempt (default 600s); pass 0 for no client-side timeout. Timed-out attempts are retried, reattaching to the same box, so when the overall budget is exhausted the box may still be coming up server-side: find or terminate it by name. | - | - |
volumes? | Record<string, string | Volume> | Shared volumes to mount, mapping an absolute guest path to a Volume or volume id. | - | - |
CreateSailboxRequest
Extends
Omit<native.CreateSailboxRequest,"image"|"ingressPorts"|"size">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
appId | string | Identifier of the owning app. | Omit.appId |
autosleepTimeoutMinutes? | number | Idle minutes (1-1440) after which Sail may sleep the box. | Omit.autosleepTimeoutMinutes |
diskGib? | number | Disk size in whole GiB within the size’s range; the size’s default when omitted. | Omit.diskGib |
image? | ImageSpec | Image to boot; defaults to a plain Debian base when omitted. | - |
ingressPorts? | IngressPortInput[] | Guest ports to reserve for ingress. | - |
memoryGib? | number | Memory limit in whole GiB within the size’s range; the size’s default when omitted. | Omit.memoryGib |
name | string | The sailbox name. | Omit.name |
size? | SailboxSize | Resource size; "m" when omitted. | - |
ssh? | boolean | Enable SSH on the new sailbox after create: trust the org SSH CA, start sshd, and expose guest port 22 as TCP once the CA-only daemon owns it (an explicit port-22 ingress entry contributes just its allowlist). | Omit.ssh |
volumeMounts? | VolumeMountInput[] | NFS volumes to mount. | Omit.volumeMounts |
EnableSshOptions
Options for enabling SSH on a sailbox.Properties
ExecOptions
Options for starting an exec.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
FromCheckpointOptions
Options for Sailbox.fromCheckpoint.Extends
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
checkpointId | string | The checkpoint to restore from. | FromCheckpointRequest.checkpointId |
client? | Client | Use a specific client instead of the default (env) one. | ClientOptions.client |
name? | string | Name for the new sailbox; defaults to the source box’s name. | FromCheckpointRequest.name |
timeoutSeconds? | number | Restore timeout in whole seconds (positive); omitted uses the server default. | FromCheckpointRequest.timeoutSeconds |
FromCheckpointRequest
The create-from-checkpoint request.Extended by
Properties
HttpEndpoint
The routable HTTPS address of anhttp listener.
Properties
ImageBuild
The state of a custom image build.Extends
Omit<native.ImageBuild,"status">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
errorMessage? | string | Human-readable failure detail; present when status is failed. | Omit.errorMessage |
imageId | string | The content-addressed image id. | Omit.imageId |
status | ImageBuildStatus | - | - |
ImageDefinition
A custom image definition: a base image plus ordered build steps, where local-file steps still reference paths on this machine.Properties
| Property | Type | Description |
|---|---|---|
architecture? | string | Target CPU architecture: amd64 or arm64; unset lets the backend choose. |
base? | string | Base image to build on: debian or devbox. |
env? | Record<string, string> | Environment variables baked into the image. |
pythonVersion? | string | Exact Python version to install as python3; unset uses the builder default. |
steps? | ImageDefinitionStep[] | Ordered build steps. |
ImageDefinitionStep
One image-definition step. Exactly one of the fields must be set.Properties
| Property | Type | Description |
|---|---|---|
addLocalDir? | LocalDirInput | Bake a local directory tree into the image. |
addLocalFile? | LocalFileInput | Bake one local file into the image. |
aptInstall? | string[] | Install system packages with apt. |
pipInstall? | string[] | Install Python packages with pip. |
runCommand? | string | Run a shell command during the build. |
ImageSpec
A sailbox image: a base image plus ordered build steps.Extends
Omit<native.ImageSpec,"base"|"buildSteps"|"architecture">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
architecture? | ImageArchitecture | Target CPU architecture; unset lets the backend choose. | - |
base? | BaseImage | Base image to build on. | - |
buildSteps? | ImageBuildStep[] | Ordered build steps applied on top of the base image. | - |
env? | Record<string, string> | Environment variables baked into the image. | Omit.env |
pythonVersion? | string | Exact Python version to install as python3; unset uses the builder default. | Omit.pythonVersion |
IngressPortInput
A guest port to reserve for ingress at create time.Extends
Omit<native.IngressPortInput,"protocol">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
allowlist? | string[] | Source addresses allowed to reach the port; empty allows all. | Omit.allowlist |
guestPort | number | The in-guest port to expose (1-65535). | Omit.guestPort |
protocol | IngressProtocol | http or tcp. | - |
Listener
An exposed guest port and how to reach it.Properties
| Property | Type | Description |
|---|---|---|
endpoint? | ListenerEndpoint | How to reach the port; undefined until the listener is routable. |
guestPort | number | The in-guest port traffic is forwarded to. |
protocol | Protocol | Wire protocol exposed. |
routeStatus | ListenerRouteStatus | Status of the listener’s ingress route. |
ListSailboxesQuery
Filters for listing sailboxes.Extends
Omit<native.ListSailboxesQuery,"status">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
appId? | string | Filter to one app by its id. | Omit.appId |
limit? | number | Page size. | Omit.limit |
maxGuestSchemaVersion? | number | Only sailboxes at or below this guest schema version. | Omit.maxGuestSchemaVersion |
offset? | number | Page offset. | Omit.offset |
search? | string | Substring filter on the sailbox name. | Omit.search |
status? | SailboxStatusFilter | Filter by lifecycle status. | - |
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
PackageInstall
A set of packages to install (apt or pip).Properties
ResolvedConfig
The config resolved from the environment and~/.sail.
Extends
Omit<native.ResolvedConfig,"ingressScheme">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
apiKey? | string | The resolved API key; absent when none is configured. | Omit.apiKey |
apiUrl | string | Sail API URL. | Omit.apiUrl |
imagebuilderUrl | string | Image-build endpoint (host:port). | Omit.imagebuilderUrl |
ingressBase | string | Base host/URL public listeners are addressed under. | Omit.ingressBase |
ingressScheme | IngressScheme | - | - |
sailboxApiUrl | string | Sailbox-API URL. | Omit.sailboxApiUrl |
RunCommand
A shell command to run during the build.Properties
SailboxCheckpoint
A durable checkpoint handle.Extends
Omit<native.SailboxCheckpoint,"status"|"expiresAt">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
checkpointGeneration | number | Checkpoint generation captured by this checkpoint. | Omit.checkpointGeneration |
checkpointId | string | The checkpoint id. | Omit.checkpointId |
expiresAt? | Date | When the handle becomes eligible for garbage collection, if bounded. | - |
sailboxId | string | The sailbox the checkpoint was taken from. | Omit.sailboxId |
status | SailboxStatus | - | - |
SailboxHandle
Returned by create / resume / fromCheckpoint: the sailbox’s identity and lifecycle status.Extends
Omit<native.SailboxHandle,"status">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
name | string | The sailbox name. | Omit.name |
sailboxId | string | The sailbox id. | Omit.sailboxId |
status | SailboxStatus | - | - |
SailboxInfo
A read snapshot of a sailbox (get / list). Timestamps are RFC 3339 strings.Extends
Omit<native.SailboxInfo,"status">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
appId | string | Identifier of the owning app. | Omit.appId |
appName | string | Name of the owning app. | Omit.appName |
architecture | string | CPU architecture (for example arm64). | Omit.architecture |
checkpointGeneration | number | Monotonic checkpoint generation counter. | Omit.checkpointGeneration |
cpuRequestedVcpu | number | Requested CPU, in vCPUs. | Omit.cpuRequestedVcpu |
cpuUsedVcpu | number | Current CPU usage, in vCPUs. | Omit.cpuUsedVcpu |
createdAt | string | When the sailbox was created (RFC 3339). | Omit.createdAt |
diskRequestedBytes | number | Requested disk, in bytes. | Omit.diskRequestedBytes |
diskUsedBytes | number | Current disk usage, in bytes. | Omit.diskUsedBytes |
errorMessage? | string | Human-readable error detail when the box is in an error state. | Omit.errorMessage |
guestSchemaVersion? | number | Guest schema version; absent for boxes created before it was recorded (treat as the oldest possible version). | Omit.guestSchemaVersion |
imageId | string | Identifier of the image the sailbox was created from. | Omit.imageId |
lastCheckpointedAt? | string | When the most recent checkpoint was taken, if any (RFC 3339). | Omit.lastCheckpointedAt |
memoryMib | number | Configured memory, in MiB. | Omit.memoryMib |
memoryRequestedBytes | number | Requested memory, in bytes. | Omit.memoryRequestedBytes |
memoryUsedBytes | number | Current memory usage, in bytes. | Omit.memoryUsedBytes |
name | string | The sailbox name. | Omit.name |
sailboxId | string | The sailbox id. | Omit.sailboxId |
startedAt? | string | When the box last started, if it ever has (RFC 3339). | Omit.startedAt |
stateDiskSizeGib | number | Configured state-disk size, in GiB. | Omit.stateDiskSizeGib |
status | SailboxStatus | - | - |
updatedAt | string | When the sailbox was last updated (RFC 3339). | Omit.updatedAt |
vcpuCount | number | Configured number of vCPUs. | Omit.vcpuCount |
SailboxInfoPage
One page of list results plus the pagination envelope.Extends
Omit<native.SailboxInfoPage,"items">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
hasMore | boolean | Whether more results exist past this page. | Omit.hasMore |
items | SailboxInfo[] | - | - |
limit | number | The page size that was applied. | Omit.limit |
offset | number | The offset that was applied. | Omit.offset |
total | number | Total matching sailboxes across all pages. | Omit.total |
SailboxPage
One page of Sailbox instances plus the pagination envelope.Extends
Omit<SailboxInfoPage,"items">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
hasMore | boolean | Whether more results exist past this page. | Omit.hasMore |
items | Sailbox[] | - | - |
limit | number | The page size that was applied. | Omit.limit |
offset | number | The offset that was applied. | Omit.offset |
total | number | Total matching sailboxes across all pages. | Omit.total |
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 an in-guest agent upgrade.Extends
Omit<native.UpgradeResult,"status">
Properties
| Property | Type | Description | Inherited from |
|---|---|---|---|
applied | boolean | True when applied immediately (running box); false when deferred to the next wake. | Omit.applied |
status | SailboxStatus | - | - |
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
Type Aliases
BaseImage
BaseImage ="debian"|"devbox"
ImageArchitecture
ImageArchitecture ="amd64"|"arm64"
ImageBuildStatus
ImageBuildStatus =The status of a custom image build."unspecified"|"queued"|"building"|"ready"|"failed"
ImageBuildStep
ImageBuildStep = {One build step: exactly one operation.aptInstall:PackageInstall; } | {pipInstall:PackageInstall; } | {runCommand:RunCommand; } | {addLocalFile:AddLocalFile; } | {addLocalDir:AddLocalDir; }
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.
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)."unspecified"|"pending"|"active"|"restoring"|"unavailable"|string&object
Protocol
Protocol =The protocol reported on a listener (open: tolerates unknown values)."tcp"|"http"|string&object
SailboxSize
SailboxSize =Named resource size; each sets the vCPU count plus default memory/disk."s"|"m"
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"
Functions
defaultClient()
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
Client
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>
resolveConfig()
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. The core
is the single source of truth for endpoint resolution.
Returns
ResolvedConfig
setDefaultClient()
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
| Parameter | Type |
|---|---|
client | Client | undefined |
Returns
void