> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sailresearch.com/llms.txt
> Use this file to discover all available pages before exploring further.

# TypeScript SDK

> TypeScript SDK installation and full reference

The Sail TypeScript SDK (`@sailresearch/sdk` on npm) runs on Node 22+ and Bun.
Sail also provides [Python](/reference/python-sdk) and
[Rust](/reference/rust-sdk) SDKs.

## Install

<CodeGroup>
  ```bash npm theme={null}
  npm install @sailresearch/sdk
  ```

  ```bash pnpm theme={null}
  pnpm add @sailresearch/sdk
  ```

  ```bash bun theme={null}
  bun add @sailresearch/sdk
  ```
</CodeGroup>

The SDK supports Linux x64/arm64 (glibc and musl), macOS x64/arm64, and
Windows x64.

The Sail API warns when your SDK version is nearing the end of its support
window. The SDK prints that warning to stderr once per process. A version past
the end of its support window is rejected with an upgrade error before any
operation runs. Upgrade with `npm install @sailresearch/sdk@latest`.

## Configure

Set `SAIL_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](/reference/sdk-configuration).

## Quickstart

```ts theme={null}
import { App, Sailbox } from "@sailresearch/sdk";

// Look up (or create) the app your sandboxes belong to.
const app = await App.find("example-app", { mintIfMissing: true });

// Boot a sandbox.
const sb = await Sailbox.create({ app, name: "worker-1" });

// Run a command and stream its output.
const proc = await sb.exec("echo hello && ls /");
for await (const chunk of proc.stdout) process.stdout.write(chunk);
const result = await proc.wait();
console.log("exit code:", result.exitCode);

// Move files.
await sb.fs.write("/tmp/note.txt", "hi\n");
const contents = await sb.fs.read("/tmp/note.txt");

// Expose a port and wait until it is reachable.
await sb.expose(8080, { protocol: "http" });
const listener = await sb.waitForListener(8080);
if (listener.endpoint?.kind === "http") {
  console.log("reachable at:", listener.endpoint.url);
}

// Clean up (see also pause / sleep / resume / checkpoint).
await sb.terminate();
```

## Errors

Every failure the SDK recognizes extends `SailError`, so one
`catch (e) { if (e instanceof SailError) }` handles them; a truly unexpected
error is rethrown 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](/sailbox-sdk-errors).

## Reference

The docs below are auto-generated.

<div className="reference-fold prose prose-gray dark:prose-invert">
  <a id="sailbox" />

  ## Sailbox

  A sandbox (Sailbox): the primary object agent harnesses work with. Create one
  with [Sailbox.create](#create-1), run commands with [exec](#exec-1), move files with
  [fs](#fs), expose ports with [expose](#expose), and
  manage its lifecycle. The statics use a default env-configured client unless
  you pass one.

  ### Example

  ```ts theme={null}
  import { App, Sailbox } from "@sailresearch/sdk";

  const app = await App.find("example-app", { mintIfMissing: true });
  const box = await Sailbox.create({ app, name: "worker-1" });
  const proc = await box.exec(["bash", "-lc", "echo hello"]);
  console.log(await proc.stdout.text());
  await box.terminate();
  ```

  ### Accessors

  <a id="appid-1" />

  #### appId

  ##### Get Signature

  > **get** **appId**(): `string` | `undefined`

  Identifier of the owning app.

  ##### Returns

  `string` | `undefined`

  <a id="appname-1" />

  #### appName

  ##### Get Signature

  > **get** **appName**(): `string` | `undefined`

  Name of the owning app.

  ##### Returns

  `string` | `undefined`

  <a id="architecture" />

  #### architecture

  ##### Get Signature

  > **get** **architecture**(): `string` | `undefined`

  CPU architecture (for example `arm64`).

  ##### Returns

  `string` | `undefined`

  <a id="autosleep" />

  #### autoSleep

  ##### Get Signature

  > **get** **autoSleep**(): [`AutoSleep`](#autosleep-4) | `undefined`

  When Sail may sleep this Sailbox on its own: from the latest
  [Sailbox.get](#get-1) snapshot, or your own last
  [Sailbox.setAutoSleep](#setautosleep) through this object. `undefined` before
  either; a Sailbox created by [Sailbox.fromCheckpoint](#fromcheckpoint) inherits its
  source's preference, so call
  [Sailbox.get](#get-1) to learn an inherited value.

  ##### Returns

  [`AutoSleep`](#autosleep-4) | `undefined`

  <a id="checkpointgeneration" />

  #### checkpointGeneration

  ##### Get Signature

  > **get** **checkpointGeneration**(): `number` | `undefined`

  Checkpoint generation counter as of the snapshot.

  ##### Returns

  `number` | `undefined`

  <a id="client-1" />

  #### client

  ##### Get Signature

  > **get** **client**(): [`Client`](#client)

  The underlying [Client](#client).

  ##### Returns

  [`Client`](#client)

  <a id="cpurequestedvcpu" />

  #### cpuRequestedVcpu

  ##### Get Signature

  > **get** **cpuRequestedVcpu**(): `number` | `undefined`

  Requested CPU, in vCPUs.

  ##### Returns

  `number` | `undefined`

  <a id="cpuusedvcpu" />

  #### cpuUsedVcpu

  ##### Get Signature

  > **get** **cpuUsedVcpu**(): `number` | `undefined`

  Current CPU usage, in vCPUs, as of the snapshot.

  ##### Returns

  `number` | `undefined`

  <a id="createdat-2" />

  #### createdAt

  ##### Get Signature

  > **get** **createdAt**(): `Date` | `undefined`

  When the Sailbox was created.

  ##### Returns

  `Date` | `undefined`

  <a id="createdbyuserid" />

  #### createdByUserId

  ##### Get Signature

  > **get** **createdByUserId**(): `string` | `undefined`

  The user whose credential created this Sailbox (for a restore, the user
  who ran it). `undefined` for service-key creates.

  ##### Returns

  `string` | `undefined`

  <a id="deprecation" />

  #### deprecation

  ##### Get Signature

  > **get** **deprecation**(): `SailboxDeprecation` | `undefined`

  Actionable runtime deprecation notice, when an upgrade is needed.

  ##### Returns

  `SailboxDeprecation` | `undefined`

  <a id="diskrequestedbytes" />

  #### diskRequestedBytes

  ##### Get Signature

  > **get** **diskRequestedBytes**(): `number` | `undefined`

  Requested disk, in bytes.

  ##### Returns

  `number` | `undefined`

  <a id="diskusedbytes" />

  #### diskUsedBytes

  ##### Get Signature

  > **get** **diskUsedBytes**(): `number` | `undefined`

  Current disk usage, in bytes, as of the snapshot.

  ##### Returns

  `number` | `undefined`

  <a id="errormessage" />

  #### errorMessage

  ##### Get Signature

  > **get** **errorMessage**(): `string` | `undefined`

  Failure detail when the status is `failed`.

  ##### Returns

  `string` | `undefined`

  <a id="fs" />

  #### fs

  ##### Get Signature

  > **get** **fs**(): [`SailboxFs`](#sailboxfs-1)

  Filesystem operations on this Sailbox's guest: read and write files
  (buffered or streaming), and directory helpers.

  ##### Returns

  [`SailboxFs`](#sailboxfs-1)

  <a id="guestschemaversion" />

  #### guestSchemaVersion

  ##### Get Signature

  > **get** **guestSchemaVersion**(): `number` | `undefined`

  The Sailbox runtime schema version the Sailbox last booted with.

  ##### Returns

  `number` | `undefined`

  <a id="imageid" />

  #### imageId

  ##### Get Signature

  > **get** **imageId**(): `string` | `undefined`

  Identifier of the image the Sailbox was created from.

  ##### Returns

  `string` | `undefined`

  <a id="lastcheckpointedat" />

  #### lastCheckpointedAt

  ##### Get Signature

  > **get** **lastCheckpointedAt**(): `Date` | `undefined`

  When the most recent checkpoint was taken.

  ##### Returns

  `Date` | `undefined`

  <a id="memorymib" />

  #### memoryMib

  ##### Get Signature

  > **get** **memoryMib**(): `number` | `undefined`

  Configured memory, in MiB.

  ##### Returns

  `number` | `undefined`

  <a id="memoryrequestedbytes" />

  #### memoryRequestedBytes

  ##### Get Signature

  > **get** **memoryRequestedBytes**(): `number` | `undefined`

  Requested memory, in bytes.

  ##### Returns

  `number` | `undefined`

  <a id="memoryusedbytes" />

  #### memoryUsedBytes

  ##### Get Signature

  > **get** **memoryUsedBytes**(): `number` | `undefined`

  Current memory usage, in bytes, as of the snapshot.

  ##### Returns

  `number` | `undefined`

  <a id="name-2" />

  #### name

  ##### Get Signature

  > **get** **name**(): `string`

  The Sailbox name.

  ##### Returns

  `string`

  <a id="networkpolicy" />

  #### networkPolicy

  ##### Get Signature

  > **get** **networkPolicy**(): [`NetworkPolicyInfo`](#networkpolicyinfo) | `undefined`

  The Sailbox's network policy, frozen at creation, from the latest
  [Sailbox.get](#get-1) or [Sailbox.list](#list-2) snapshot. `undefined` means
  public (unrestricted outbound access) or that no snapshot has been taken
  yet; a present value carries the restrictive mode so you can verify what
  is enforced, including on a Sailbox created from a checkpoint.

  ##### Returns

  [`NetworkPolicyInfo`](#networkpolicyinfo) | `undefined`

  <a id="sailboxid" />

  #### sailboxId

  ##### Get Signature

  > **get** **sailboxId**(): `string`

  The Sailbox's stable identifier.

  ##### Returns

  `string`

  <a id="startedat" />

  #### startedAt

  ##### Get Signature

  > **get** **startedAt**(): `Date` | `undefined`

  When the Sailbox first started running. A resume does not rewrite it.

  ##### Returns

  `Date` | `undefined`

  <a id="statedisksizegib" />

  #### stateDiskSizeGib

  ##### Get Signature

  > **get** **stateDiskSizeGib**(): `number` | `undefined`

  Configured state-disk size, in GiB.

  ##### Returns

  `number` | `undefined`

  <a id="status-2" />

  #### status

  ##### Get Signature

  > **get** **status**(): [`SailboxStatus`](#sailboxstatus-1)

  The lifecycle status as of the call that produced this handle (updated
  by lifecycle calls on this instance). Use [Sailbox.get](#get-1) for a fresh
  snapshot.

  ##### Returns

  [`SailboxStatus`](#sailboxstatus-1)

  <a id="updatedat-1" />

  #### updatedAt

  ##### Get Signature

  > **get** **updatedAt**(): `Date` | `undefined`

  When the Sailbox last changed.

  ##### Returns

  `Date` | `undefined`

  <a id="vcpucount" />

  #### vcpuCount

  ##### Get Signature

  > **get** **vcpuCount**(): `number` | `undefined`

  Configured number of vCPUs.

  ##### Returns

  `number` | `undefined`

  <a id="visibility" />

  #### visibility

  ##### Get Signature

  > **get** **visibility**(): `string` | `undefined`

  `"private"` when access is restricted to the creator; `undefined`/`"org"`
  is the default org-wide access.

  ##### Returns

  `string` | `undefined`

  <a id="volumemounts" />

  #### volumeMounts

  ##### Get Signature

  > **get** **volumeMounts**(): `SailboxVolumeMount`\[] | `undefined`

  Volumes attached to this Sailbox and the paths they are mounted at.

  ##### Returns

  `SailboxVolumeMount`\[] | `undefined`

  ### Methods

  <a id="checkpoint" />

  #### checkpoint()

  > **checkpoint**(`options?`): `Promise`\<[`SailboxCheckpoint`](#sailboxcheckpoint-1)>

  Take a checkpoint of this Sailbox and prepare its clean start state. The
  returned handle carries `expiresAt`, after which starting a Sailbox from it
  fails. Sailboxes with volume mounts are not supported. Upgrade a Sailbox
  that uses an older guest payload before creating a checkpoint handle.

  ##### Parameters

  | Parameter | Type                                      |
  | --------- | ----------------------------------------- |
  | `options` | [`CheckpointOptions`](#checkpointoptions) |

  ##### Returns

  `Promise`\<[`SailboxCheckpoint`](#sailboxcheckpoint-1)>

  <a id="clearhttppolicy" />

  #### clearHttpPolicy()

  > **clearHttpPolicy**(): `Promise`\<`void`>

  Clear this Sailbox's attached HTTP policy. The change applies to HTTPS
  connections this Sailbox opens after the call; connections already open
  keep the previous policy until they close. This also resolves when no
  policy is attached.

  ##### Returns

  `Promise`\<`void`>

  <a id="enablessh-1" />

  #### enableSsh()

  > **enableSsh**(`options?`): `Promise`\<[`SshEndpoint`](#sshendpoint) | `null`>

  Enable SSH on this Sailbox: trust the org SSH CA, start `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](#timeouterror) if it is not within
  `timeoutSeconds`; with `wait: false`, skips the probe and resolves
  `null`.

  ##### Parameters

  | Parameter | Type                                    |
  | --------- | --------------------------------------- |
  | `options` | [`EnableSshOptions`](#enablesshoptions) |

  ##### Returns

  `Promise`\<[`SshEndpoint`](#sshendpoint) | `null`>

  <a id="exec-1" />

  #### exec()

  > **exec**(`command`, `options?`): `Promise`\<[`ExecProcess`](#execprocess)>

  Run a command and return a handle to the live process. A `string` command
  is run via `/bin/sh -lc`; a `string[]` is exec'd directly. By default a
  stream you are consuming pauses the command when you fall behind, so
  nothing is lost until a cancel or the exec timeout ends the pauses, and a
  stream you are not consuming keeps only its most
  recent 1 MiB; start consuming right after this call returns to get every
  byte. `outputMode` and `outputBufferBytes` in `options` change that (see
  [ExecProcess](#execprocess)). `options` can also set a working directory or
  detach the command (see [ExecOptions](#execoptions)). Stopping the command is the
  caller's job via [ExecProcess.cancel](#cancel).

  ##### Parameters

  | Parameter  | Type                             |
  | ---------- | -------------------------------- |
  | `command`  | `string` \| readonly `string`\[] |
  | `options?` | [`ExecOptions`](#execoptions)    |

  ##### Returns

  `Promise`\<[`ExecProcess`](#execprocess)>

  <a id="expose" />

  #### expose()

  > **expose**(`guestPort`, `options?`): `Promise`\<[`Listener`](#listener-1)>

  Expose a guest port at runtime. Re-exposing a port under the same
  protocol sets its `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](#waitforlistener-1) confirms the route is live.

  ##### Parameters

  | Parameter   | Type                              |
  | ----------- | --------------------------------- |
  | `guestPort` | `number`                          |
  | `options`   | [`ExposeOptions`](#exposeoptions) |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="httppolicy-1" />

  #### httpPolicy()

  > **httpPolicy**(): `Promise`\<[`HttpPolicy`](#httppolicy) | `null`>

  The HTTP policy attached to this Sailbox, or `null` when no policy is
  attached.

  ##### Returns

  `Promise`\<[`HttpPolicy`](#httppolicy) | `null`>

  <a id="ingressauthheaders-1" />

  #### ingressAuthHeaders()

  > **ingressAuthHeaders**(): `Promise`\<`Record`\<`string`, `string`>>

  Ingress-identity headers for this Sailbox, as a name→value map.

  ##### Returns

  `Promise`\<`Record`\<`string`, `string`>>

  <a id="listener" />

  #### listener()

  > **listener**(`guestPort`): `Promise`\<[`Listener`](#listener-1)>

  Fetch one listener by guest port without waking the Sailbox.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `guestPort` | `number` |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="listeners" />

  #### listeners()

  > **listeners**(): `Promise`\<[`Listener`](#listener-1)\[]>

  List this Sailbox's listeners without waking it.

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)\[]>

  <a id="pause" />

  #### pause()

  > **pause**(): `Promise`\<`void`>

  Pause this Sailbox in memory.

  ##### Returns

  `Promise`\<`void`>

  <a id="resume" />

  #### resume()

  > **resume**(): `Promise`\<`void`>

  Resume this Sailbox (updates [status](#status-2)).

  ##### Returns

  `Promise`\<`void`>

  <a id="run" />

  #### run()

  > **run**(`command`, `options?`): `Promise`\<[`ExecResult`](#execresult)>

  Run a command to completion and return its buffered result: a one-shot
  convenience over [exec](#exec-1) followed by [ExecProcess.wait](#wait). A
  `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](#exec-1)); `signal`
  force-cancels the command on abort (see [RunOptions](#runoptions)). The result's
  stdout and stderr hold only the most recent `outputBufferBytes` of each
  stream (1 MiB by default, up to 64 MiB), with `stdoutTruncated` and
  `stderrTruncated` set when older output was dropped; the command never
  pauses for unread output. While the first call is still running, a
  second call with the same `idempotencyKey` takes over its output stream,
  and the earlier call's result may come back truncated. To get every
  byte, use [exec](#exec-1) and consume the stream (see
  [ExecProcess](#execprocess)). `openStdin`, `pty`, `background`, and
  `outputMode: "pipe"` are excluded from [RunOptions](#runoptions) and rejected at
  runtime: run() waits for the command to finish and buffers its output,
  so an interactive command would hang, a backgrounded one would return
  the launcher's result, not the command's, and a pipe would pause forever
  with nobody consuming it; use [exec](#exec-1) for those.

  ##### Parameters

  | Parameter  | Type                             |
  | ---------- | -------------------------------- |
  | `command`  | `string` \| readonly `string`\[] |
  | `options?` | [`RunOptions`](#runoptions)      |

  ##### Returns

  `Promise`\<[`ExecResult`](#execresult)>

  <a id="setautosleep" />

  #### setAutoSleep()

  > **setAutoSleep**(`autoSleep`): `Promise`\<`void`>

  Replace when Sail may sleep this Sailbox on its own.

  Each call replaces the whole setting: switching to `{ automatic: false }`
  clears any minimum wait set earlier, and switching back does not restore
  it. Calling [Sailbox.sleep](#sleep) yourself is unaffected, and so are
  `pause`, `resume`, and scheduled wakes.

  ##### Parameters

  | Parameter   | Type                        |
  | ----------- | --------------------------- |
  | `autoSleep` | [`AutoSleep`](#autosleep-4) |

  ##### Returns

  `Promise`\<`void`>

  <a id="sethttppolicy" />

  #### setHttpPolicy()

  > **setHttpPolicy**(`policy`): `Promise`\<`void`>

  Attach an HTTP policy to this Sailbox, replacing any policy already
  attached (a Sailbox has at most one). Accepts an [HttpPolicy](#httppolicy), a
  listing summary, or a policy id string. The policy applies to HTTPS
  connections this Sailbox opens after the call; connections already open
  keep the previous policy until they close.

  ##### Parameters

  | Parameter | Type                                |
  | --------- | ----------------------------------- |
  | `policy`  | [`HttpPolicyLike`](#httppolicylike) |

  ##### Returns

  `Promise`\<`void`>

  <a id="shell-1" />

  #### shell()

  > **shell**(`command?`, `options?`): `Promise`\<`number`>

  Open an interactive pty session on this Sailbox, bridged to the local
  terminal. With no `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](#user-3). 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](#noforward).

  ##### Parameters

  | Parameter  | Type                            |
  | ---------- | ------------------------------- |
  | `command?` | `string`                        |
  | `options?` | [`ShellOptions`](#shelloptions) |

  ##### Returns

  `Promise`\<`number`>

  <a id="sleep" />

  #### sleep()

  > **sleep**(`wakeAt?`): `Promise`\<`Date` | `undefined`>

  Sleep this Sailbox to disk (wakes on traffic), optionally scheduling a
  wall-clock wake first. `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

  | Parameter | Type   |
  | --------- | ------ |
  | `wakeAt?` | `Date` |

  ##### Returns

  `Promise`\<`Date` | `undefined`>

  <a id="terminate" />

  #### terminate()

  > **terminate**(): `Promise`\<`void`>

  Terminate (delete) this Sailbox (updates [status](#status-2)).

  ##### Returns

  `Promise`\<`void`>

  <a id="unexpose" />

  #### unexpose()

  > **unexpose**(`guestPort`): `Promise`\<`void`>

  Remove a runtime ingress port.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `guestPort` | `number` |

  ##### Returns

  `Promise`\<`void`>

  <a id="upgrade" />

  #### upgrade()

  > **upgrade**(): `Promise`\<[`UpgradeResult`](#upgraderesult)>

  Upgrade this Sailbox's runtime.

  ##### Returns

  `Promise`\<[`UpgradeResult`](#upgraderesult)>

  <a id="waitforlistener-1" />

  #### waitForListener()

  > **waitForListener**(`guestPort`, `options?`): `Promise`\<[`Listener`](#listener-1)>

  Block until the listener on `guestPort` is reachable end to end and
  return it, or throw [TimeoutError](#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`](#waitforlisteneroptions) |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="create-1" />

  #### create()

  > `static` **create**(`options`): `Promise`\<[`Sailbox`](#sailbox)>

  Create a new Sailbox.

  A custom image definition passed as `image` is built first.

  Sail may sleep a fully idle Sailbox; it wakes transparently on traffic or
  the next operation.

  ##### Parameters

  | Parameter | Type                                            |
  | --------- | ----------------------------------------------- |
  | `options` | [`CreateSailboxOptions`](#createsailboxoptions) |

  ##### Returns

  `Promise`\<[`Sailbox`](#sailbox)>

  <a id="fromcheckpoint" />

  #### fromCheckpoint()

  > `static` **fromCheckpoint**(`options`): `Promise`\<[`Sailbox`](#sailbox)>

  Create a new running Sailbox from a durable checkpoint handle. The new
  Sailbox uses the checkpoint's writable disk and cleaned memory state, so
  background processes continue and the new Sailbox runs independently of
  the source. Commands started with [Sailbox.exec](#exec-1) stop, though their
  writes up to the checkpoint remain. Host-specific identity and network
  routes are removed before the checkpoint handle becomes ready. A Sailbox
  with volume mounts cannot create a reusable checkpoint. If Sail cannot
  resume the saved memory, it starts the child cold with its writable disk
  intact and without the saved processes. The new Sailbox keeps the
  original's network policy; read it back with [Sailbox.get](#get-1).

  ##### Parameters

  | Parameter | Type                                              |
  | --------- | ------------------------------------------------- |
  | `options` | [`FromCheckpointOptions`](#fromcheckpointoptions) |

  ##### Returns

  `Promise`\<[`Sailbox`](#sailbox)>

  <a id="fromid" />

  #### fromId()

  > `static` **fromId**(`sailboxId`, `options?`): [`Sailbox`](#sailbox)

  Bind a handle to an existing Sailbox id without a network call.

  The returned handle carries no snapshot fields (its [name](#name-2) and
  [status](#status-2) are empty), just the operable surface. The id is not
  verified to exist: operations on an unknown or inaccessible id reject
  with [NotFoundError](#notfounderror). Use [get](#get-1) to validate the id and fetch
  a fresh snapshot instead.

  ##### Parameters

  | Parameter   | Type                              |
  | ----------- | --------------------------------- |
  | `sailboxId` | `string`                          |
  | `options`   | [`ClientOptions`](#clientoptions) |

  ##### Returns

  [`Sailbox`](#sailbox)

  <a id="get-1" />

  #### get()

  > `static` **get**(`sailboxId`, `options?`): `Promise`\<[`Sailbox`](#sailbox)>

  Fetch an existing Sailbox by id.

  ##### Parameters

  | Parameter   | Type                              |
  | ----------- | --------------------------------- |
  | `sailboxId` | `string`                          |
  | `options`   | [`ClientOptions`](#clientoptions) |

  ##### Returns

  `Promise`\<[`Sailbox`](#sailbox)>

  <a id="list-2" />

  #### list()

  > `static` **list**(`params?`): `Promise`\<[`Sailbox`](#sailbox)\[]>

  List the Sailboxes that match the filters, fetching pages internally
  until every match (or `limit` of them) is collected; use
  [listPage](#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

  | Parameter | Type                                            |
  | --------- | ----------------------------------------------- |
  | `params`  | [`ListSailboxesOptions`](#listsailboxesoptions) |

  ##### Returns

  `Promise`\<[`Sailbox`](#sailbox)\[]>

  <a id="listpage" />

  #### listPage()

  > `static` **listPage**(`params?`): `Promise`\<[`SailboxPage`](#sailboxpage)>

  List one page of Sailboxes alongside the pagination envelope
  (`total`/`hasMore`). Takes the same filters as [list](#list-2), plus `limit`
  and `offset` to select the page.

  ##### Parameters

  | Parameter | Type                                                    |
  | --------- | ------------------------------------------------------- |
  | `params`  | [`ListSailboxesPageOptions`](#listsailboxespageoptions) |

  ##### Returns

  `Promise`\<[`SailboxPage`](#sailboxpage)>

  ***

  <a id="app" />

  ## App

  An app: the billing/ownership scope a Sailbox belongs to. Look one up (or mint
  it) with [App.find](#find), then pass it (or its [App.id](#id)) to
  [Sailbox.create](#create-1).

  ### Properties

  | Property                         | Modifier   | Type     | Description    |
  | -------------------------------- | ---------- | -------- | -------------- |
  | <a id="createdat" /> `createdAt` | `readonly` | `Date`   | Creation time. |
  | <a id="id" /> `id`               | `readonly` | `string` | Stable app id. |
  | <a id="name" /> `name`           | `readonly` | `string` | App name.      |

  ### Methods

  <a id="find" />

  #### find()

  > `static` **find**(`name`, `options?`): `Promise`\<[`App`](#app)>

  Find an app by name, optionally minting it if missing.

  ##### Parameters

  | Parameter | Type                                |
  | --------- | ----------------------------------- |
  | `name`    | `string`                            |
  | `options` | [`FindAppOptions`](#findappoptions) |

  ##### Returns

  `Promise`\<[`App`](#app)>

  <a id="list" />

  #### list()

  > `static` **list**(`options?`): `Promise`\<[`App`](#app)\[]>

  Every app the current org owns, newest first.

  ##### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `options` | [`ClientOptions`](#clientoptions) |

  ##### Returns

  `Promise`\<[`App`](#app)\[]>

  ***

  <a id="image" />

  ## Image

  A Sailbox image: a base, registry, or Dockerfile image plus ordered build
  steps. Immutable and fluent: each method returns a new `Image`. Local
  files/dirs are recorded here and hashed and uploaded when the image is
  resolved to a spec (at [Sailbox.create](#create-1), or via [toSpec](#tospec)), so
  chaining stays synchronous.

  ### Example

  ```ts theme={null}
  const image = Image.debian()
    .aptInstall("git")
    .pipInstall("numpy")
    .addLocalDir("./app", "/app", { ignore: ["*.pyc", "__pycache__/"] })
    .runCommand("pip install -e /app");
  const box = await Sailbox.create({ app, name: "w", image });
  ```

  ### Methods

  <a id="addlocaldir" />

  #### addLocalDir()

  > **addLocalDir**(`localPath`, `remotePath`, `options?`): [`Image`](#image)

  Bake a local directory tree into the image at `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`](#addlocaldiroptions) |

  ##### Returns

  [`Image`](#image)

  <a id="addlocalfile" />

  #### addLocalFile()

  > **addLocalFile**(`localPath`, `remotePath`, `options?`): [`Image`](#image)

  Bake one local file into the image at `path` (absolute POSIX path;
  a trailing `/` appends the source basename). Hashed + uploaded at resolve.

  ##### Parameters

  | Parameter    | Type                                          |
  | ------------ | --------------------------------------------- |
  | `localPath`  | `string`                                      |
  | `remotePath` | `string`                                      |
  | `options`    | [`AddLocalFileOptions`](#addlocalfileoptions) |

  ##### Returns

  [`Image`](#image)

  <a id="aptinstall" />

  #### aptInstall()

  > **aptInstall**(...`packages`): [`Image`](#image)

  Install system packages with apt.

  ##### Parameters

  | Parameter     | Type        |
  | ------------- | ----------- |
  | ...`packages` | `string`\[] |

  ##### Returns

  [`Image`](#image)

  <a id="build" />

  #### build()

  > **build**(`options?`): `Promise`\<[`ImageSpec`](#imagespec)>

  Upload any local files and build the image, waiting until it is ready.
  Returns the resolved [ImageSpec](#imagespec). [Sailbox.create](#create-1) 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](#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](#forcebuild)
  looks the tag up again and moves the tag's meaning for your whole
  organization. For an image built with [Image.fromDockerfile](#fromdockerfile),
  the returned spec is likewise pinned to the versions the build
  resolved for its `FROM` and `COPY --from` images;
  [ImageBuildOptions.forceBuild](#forcebuild) moves those pins for your whole
  organization, while specs built earlier keep their pinned versions.

  ##### Parameters

  | Parameter | Type                                      |
  | --------- | ----------------------------------------- |
  | `options` | [`ImageBuildOptions`](#imagebuildoptions) |

  ##### Returns

  `Promise`\<[`ImageSpec`](#imagespec)>

  <a id="env" />

  #### env()

  > **env**(`env`): [`Image`](#image)

  Bake environment variables into the image (keys are trimmed).

  ##### Parameters

  | Parameter | Type                                       |
  | --------- | ------------------------------------------ |
  | `env`     | `Readonly`\<`Record`\<`string`, `string`>> |

  ##### Returns

  [`Image`](#image)

  <a id="pipinstall" />

  #### pipInstall()

  > **pipInstall**(...`packages`): [`Image`](#image)

  Install Python packages with pip.

  ##### Parameters

  | Parameter     | Type        |
  | ------------- | ----------- |
  | ...`packages` | `string`\[] |

  ##### Returns

  [`Image`](#image)

  <a id="runcommand" />

  #### runCommand()

  > **runCommand**(`command`): [`Image`](#image)

  Run a shell command during the build.

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `command` | `string` |

  ##### Returns

  [`Image`](#image)

  <a id="tospec" />

  #### toSpec()

  > **toSpec**(`client?`): `Promise`\<[`ImageSpec`](#imagespec)>

  Resolve to an [ImageSpec](#imagespec): walks local files/dirs (honoring
  gitignore), hashes them, and uploads their content via `client` (defaults
  to the env client). [Sailbox.create](#create-1) calls this for you; use it
  directly only if you need the raw spec.

  ##### Parameters

  | Parameter | Type                |
  | --------- | ------------------- |
  | `client?` | [`Client`](#client) |

  ##### Returns

  `Promise`\<[`ImageSpec`](#imagespec)>

  <a id="debian" />

  #### debian()

  > `static` **debian**(`architecture?`): [`Image`](#image)

  A Debian base image (defaults to amd64).

  ##### Parameters

  | Parameter      | Type                                      | Default value |
  | -------------- | ----------------------------------------- | ------------- |
  | `architecture` | [`ImageArchitecture`](#imagearchitecture) | `"amd64"`     |

  ##### Returns

  [`Image`](#image)

  <a id="devbox" />

  #### devbox()

  > `static` **devbox**(`architecture?`): [`Image`](#image)

  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](#debian) to customize.

  ##### Parameters

  | Parameter      | Type                                      | Default value |
  | -------------- | ----------------------------------------- | ------------- |
  | `architecture` | [`ImageArchitecture`](#imagearchitecture) | `"amd64"`     |

  ##### Returns

  [`Image`](#image)

  <a id="fromdockerfile" />

  #### fromDockerfile()

  > `static` **fromDockerfile**(`dockerfile`, `options?`): [`Image`](#image)

  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 as `{ contents }`. The result behaves like any
  other image: build steps, env, and pip/apt installs work the same as on
  [Image.debian](#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](#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](#exec-1) or
  [Sailbox.run](#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

  | Parameter    | Type                                              |
  | ------------ | ------------------------------------------------- |
  | `dockerfile` | `string` \| \{ `contents`: `string`; }            |
  | `options`    | [`FromDockerfileOptions`](#fromdockerfileoptions) |

  ##### Returns

  [`Image`](#image)

  ##### Example

  ```ts theme={null}
  const image = Image.fromDockerfile("./envs/task1/Dockerfile", {
    contextDir: "./envs/task1",
  });
  ```

  <a id="fromregistry" />

  #### fromRegistry()

  > `static` **fromRegistry**(`ref`, `options?`): [`Image`](#image)

  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](#debian).

  Reference an image on a supported public registry (`docker.io`,
  `ghcr.io`, `public.ecr.aws`, or `quay.io`), written as you would for
  `docker pull`: `python:3.13` means `docker.io/library/python:3.13` and
  `acme/tool` means `docker.io/acme/tool`; name the registry for the
  others, as in `ghcr.io/acme/tool`. 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](#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](#exec-1) or
  [Sailbox.run](#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

  | Parameter | Type                                          |
  | --------- | --------------------------------------------- |
  | `ref`     | `string`                                      |
  | `options` | [`FromRegistryOptions`](#fromregistryoptions) |

  ##### Returns

  [`Image`](#image)

  ##### Example

  ```ts theme={null}
  const image = Image.fromRegistry(
    "docker.io/library/python:3.13"
  ).aptInstall("git");
  ```

  ***

  <a id="execprocess" />

  ## ExecProcess

  A live command running in a Sailbox. Stream [stdout](#stdout)/[stderr](#stderr),
  write to [writeStdin](#writestdin), and [wait](#wait) for the result. Not killed on GC;
  call [close](#close) to detach, or [cancel](#cancel) to stop the command.

  Each stream has a buffer, 1 MiB by default (`outputBufferBytes`), and the
  `outputMode` says what happens when it fills. With the default `"auto"`:
  if you are not consuming a stream, the command never pauses and the stream
  keeps only its most recent bytes; if you are consuming a stream and fall
  behind, the command pauses when the buffer fills and resumes as you read,
  like a pipe. Consuming a stream is how you get every byte, and it slows the
  command when you cannot keep up. `"pipe"` holds both streams from the
  start, so a consumer that starts late still gets every byte; `"tail"`
  never pauses the command for you. See `OutputMode`.

  With `"auto"`, start consuming right after `exec()` returns to get every
  byte. You can consume stdout without holding stderr, or the reverse; the
  stream you are not holding keeps its most recent bytes and never pauses
  the command when it fills. If you hold both, consume them at the same time
  (`Promise.all`). The exit code is available from [poll](#poll) once the
  streams end and from [wait](#wait).

  Accessing `proc.stdout` or `proc.stderr` claims nothing. A stream is claimed
  when you start iterating it (`for await`, [ExecStream.raw](#raw),
  [ExecStream.text](#text), [ExecStream.bytes](#bytes)) or call
  [ExecStream.toReadable](#toreadable), and released when the iteration finishes or
  you leave it (`break`, `return`, a thrown error), when `.text()` or
  `.bytes()` reaches the end, or when the `Readable` is destroyed. Each
  stream can be claimed once; a second attempt rejects with
  `InvalidArgumentError`.

  [wait](#wait) returns each stream's buffer, its most recent output, with
  `stdoutTruncated` / `stderrTruncated` set when older output was dropped.
  [close](#close), or your process exiting, releases both streams; the command
  keeps running, and `wait()` rejects after `close()` unless it already
  resolved a result. Sail may reattach
  after an interruption, but reattachment does not guarantee exact output
  replay. A pty command never pauses; [resync](#resync) requests a fresh screen.

  ### Example

  ```ts theme={null}
  const proc = await box.exec(["bash", "-lc", "echo hi"]);
  for await (const chunk of proc.stdout) process.stdout.write(chunk);
  const result = await proc.wait();
  console.log(result.exitCode, result.stderr);
  ```

  ### Accessors

  <a id="execrequestid" />

  #### execRequestId

  ##### Get Signature

  > **get** **execRequestId**(): `string`

  The durable exec request id: the launch's idempotency key as Sail
  recorded it (yours, or the one Sail generated when you did not supply
  one; read it here to learn the generated value). Reading it marks a
  generated identity as shareable: a second handle started with it takes
  over the stream, so from then on this handle no longer reclaims the
  stream after any interruption, a clean end or a dropped connection
  alike, and resolves from the recorded result instead. Reading back a
  key you supplied changes nothing.

  ##### Returns

  `string`

  <a id="output" />

  #### output

  ##### Get Signature

  > **get** **output**(): [`ExecStream`](#execstream)

  Alias for [stdout](#stdout): under a pty the two output streams merge onto
  stdout, and `output` names that merged terminal stream.

  ##### Returns

  [`ExecStream`](#execstream)

  <a id="stderr" />

  #### stderr

  ##### Get Signature

  > **get** **stderr**(): [`ExecStream`](#execstream)

  The sole stderr stream: string iteration by default, `.raw()` for bytes.
  Claimed and released the same way as [stdout](#stdout).

  ##### Returns

  [`ExecStream`](#execstream)

  <a id="stdout" />

  #### stdout

  ##### Get Signature

  > **get** **stdout**(): [`ExecStream`](#execstream)

  The sole stdout stream: string iteration by default, `.raw()` for bytes.
  Accessing this property claims nothing; the stream is claimed when you
  start consuming it and released when the iteration finishes or you leave
  it (see [ExecStream](#execstream)).

  ##### Returns

  [`ExecStream`](#execstream)

  ### Methods

  <a id="asyncdispose" />

  #### \[asyncDispose]\()

  > **\[asyncDispose]**(): `Promise`\<`void`>

  `await using` support: detaches on scope exit.

  ##### Returns

  `Promise`\<`void`>

  <a id="dispose" />

  #### \[dispose]\()

  > **\[dispose]**(): `void`

  `using` support: detaches on scope exit.

  ##### Returns

  `void`

  <a id="cancel" />

  #### cancel()

  > **cancel**(`options?`): `Promise`\<`void`>

  Cancel the command (SIGINT by default, SIGKILL with `force`).
  Transient failures are retried briefly, covering the window right after
  the command starts when the guest cannot accept signals for it yet.

  ##### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `options` | [`CancelOptions`](#canceloptions) |

  ##### Returns

  `Promise`\<`void`>

  <a id="close" />

  #### close()

  > **close**(): `void`

  Abandon the handle without killing the command. It releases both
  streams. The command keeps running and never pauses, and Sail keeps only
  the most recent output of each stream. Call [cancel](#cancel) instead if the
  command should stop. [wait](#wait) rejects after `close()` unless it
  already resolved a result.

  ##### Returns

  `void`

  <a id="closestdin" />

  #### closeStdin()

  > **closeStdin**(): `Promise`\<`void`>

  Close the command's stdin (send EOF).

  ##### Returns

  `Promise`\<`void`>

  <a id="poll" />

  #### poll()

  > **poll**(): `number` | `null`

  The exit code once the output stream has ended, else `null`. Never
  blocks and never drops output. If the connection was lost for good
  mid-command, the stream ends early with the outcome still unknown:
  `poll()` stays `null` and [wait](#wait) fetches the result Sail
  recorded. A host-lost exec (the machine running the Sailbox was lost
  mid-command) has no real exit code: [wait](#wait) always throws
  `SailboxHostLostError` for one, and `poll()` throws it when that
  loss is what ended the stream.

  ##### Returns

  `number` | `null`

  <a id="resize" />

  #### resize()

  > **resize**(`cols`, `rows`): `Promise`\<`void`>

  Resize the pty (no-op without one).

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `cols`    | `number` |
  | `rows`    | `number` |

  ##### Returns

  `Promise`\<`void`>

  <a id="resync" />

  #### resync()

  > **resync**(): `Promise`\<`void`>

  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.

  ##### Returns

  `Promise`\<`void`>

  <a id="wait" />

  #### wait()

  > **wait**(): `Promise`\<[`ExecResult`](#execresult)>

  Wait for the command to finish and return its result.

  `stdout` and `stderr` on the result hold each stream's buffer, its most
  recent output (1 MiB by default), with `stdoutTruncated` /
  `stderrTruncated` set when older output was dropped; to get every byte,
  consume the stream (see [ExecProcess](#execprocess)). `wait()` itself never
  pauses the command and may run alongside an active consumer. With
  `outputMode: "pipe"`, a stream nobody consumes pauses the command when its
  buffer fills, and `wait()` then waits for as long as the command stays
  paused. It rejects after [close](#close) unless it already resolved a
  result.

  ##### Returns

  `Promise`\<[`ExecResult`](#execresult)>

  <a id="writestdin" />

  #### writeStdin()

  > **writeStdin**(`data`): `Promise`\<`void`>

  Write to the command's stdin (requires `openStdin`).

  ##### Parameters

  | Parameter | Type                                                                         |
  | --------- | ---------------------------------------------------------------------------- |
  | `data`    | `string` \| `Buffer`\<`ArrayBufferLike`> \| `Uint8Array`\<`ArrayBufferLike`> |

  ##### Returns

  `Promise`\<`void`>

  ***

  <a id="execstream" />

  ## ExecStream

  An async-iterable view of one exec stream (stdout or stderr). Default
  iteration yields `string` chunks, incrementally decoded as UTF-8 (a
  multibyte character split across chunks is carried until complete); use
  [raw](#raw) for the unmodified byte stream. Iteration ends once the command
  finishes and its remaining output has been delivered; if the connection was
  lost for good mid-command, it ends early with the outcome still unknown,
  and [ExecProcess.wait](#wait) fetches the result Sail recorded.

  An `ExecStream` can be consumed once: string iteration, [raw](#raw),
  [toReadable](#toreadable), [text](#text), or [bytes](#bytes); a second consumer
  rejects with `InvalidArgumentError`. Accessing `proc.stdout` claims nothing.
  The stream is claimed when you start consuming it, and from then on nothing
  is lost: the command pauses when you fall behind. That does not hold for
  pty output, for `outputMode: "tail"`, or after `cancel()` or the exec timeout
  has ended the pauses (see [ExecProcess](#execprocess)).
  It is released when the iteration finishes or you leave it (`break`,
  `return`, a thrown error), when [text](#text) or [bytes](#bytes) reaches the
  end, or when the `Readable` from [toReadable](#toreadable) is destroyed. While
  nobody is consuming, Sail keeps only the stream's most recent bytes (1 MiB
  by default) unless the exec runs with `outputMode: "pipe"`, so start consuming
  right after `exec()` returns when you need every byte. Pty output never
  pauses the command and keeps only its most recent bytes.

  ### Example

  ```ts theme={null}
  for await (const chunk of proc.stdout) process.stdout.write(chunk);
  ```

  ### Implements

  * `AsyncIterable`\<`string`>

  ### Methods

  <a id="asynciterator" />

  #### \[asyncIterator]\()

  > **\[asyncIterator]**(): `AsyncIterator`\<`string`>

  ##### Returns

  `AsyncIterator`\<`string`>

  ##### Implementation of

  `AsyncIterable.[asyncIterator]`

  <a id="bytes" />

  #### bytes()

  > **bytes**(): `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  Consume and collect the raw byte stream into a single `Buffer`.

  ##### Returns

  `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  <a id="raw" />

  #### raw()

  > **raw**(): `AsyncIterableIterator`\<`Buffer`\<`ArrayBufferLike`>>

  Iterate the raw byte stream, exactly as the command wrote it (escape
  sequences and binary payloads included). This consumes the stream.

  ##### Returns

  `AsyncIterableIterator`\<`Buffer`\<`ArrayBufferLike`>>

  <a id="text" />

  #### text()

  > **text**(): `Promise`\<`string`>

  Consume and collect the stream into a single string.

  ##### Returns

  `Promise`\<`string`>

  <a id="toreadable" />

  #### toReadable()

  > **toReadable**(): `Readable`

  Consume this stream as a Node `Readable` of string chunks. Calling this
  claims the stream at once; destroying the `Readable` releases it at once,
  even while a read is waiting for output.

  ##### Returns

  `Readable`

  ***

  <a id="sailboxfs-1" />

  ## SailboxFs

  Filesystem operations on a Sailbox's guest, reached via [Sailbox.fs](#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's `USER` 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](#upgrade) is
  called.

  ### Methods

  <a id="downloaddir-1" />

  #### downloadDir()

  > **downloadDir**(`dirs`): `Promise`\<`void`>

  Download a directory's contents from the Sailbox into a local directory.

  `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

  | Parameter       | Type                                             |
  | --------------- | ------------------------------------------------ |
  | `dirs`          | \{ `guestDir`: `string`; `localDir`: `string`; } |
  | `dirs.guestDir` | `string`                                         |
  | `dirs.localDir` | `string`                                         |

  ##### Returns

  `Promise`\<`void`>

  <a id="exists" />

  #### exists()

  > **exists**(`path`, `options?`): `Promise`\<`boolean`>

  Whether `path` exists in the guest. Follows symlinks (like `test -e`), so
  a dangling symlink reports `false` even though [ls](#ls) lists it. A
  `user` reports existence as observable by that user: a path the user lacks
  permission to reach also reports `false`.

  ##### Parameters

  | Parameter  | Type                      |
  | ---------- | ------------------------- |
  | `path`     | `string`                  |
  | `options?` | [`FsOptions`](#fsoptions) |

  ##### Returns

  `Promise`\<`boolean`>

  <a id="ls" />

  #### ls()

  > **ls**(`path`, `options?`): `Promise`\<[`DirEntry`](#direntry)\[]>

  List a directory's immediate entries as [DirEntry](#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. A
  `user` runs the listing as that user, so a directory it may not read fails
  with a permission error.

  ##### Parameters

  | Parameter  | Type                      |
  | ---------- | ------------------------- |
  | `path`     | `string`                  |
  | `options?` | [`FsOptions`](#fsoptions) |

  ##### Returns

  `Promise`\<[`DirEntry`](#direntry)\[]>

  <a id="mkdir" />

  #### mkdir()

  > **mkdir**(`path`, `options?`): `Promise`\<`void`>

  Create a directory and any missing parents (like `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

  | Parameter  | Type                      |
  | ---------- | ------------------------- |
  | `path`     | `string`                  |
  | `options?` | [`FsOptions`](#fsoptions) |

  ##### Returns

  `Promise`\<`void`>

  <a id="read" />

  #### read()

  > **read**(`path`): `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  Read a guest file fully into memory (convenience over [readStream](#readstream-1)).

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `path`    | `string` |

  ##### Returns

  `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  <a id="readstream-1" />

  #### readStream()

  > **readStream**(`path`): `Promise`\<[`FileStream`](#filestream)>

  Open a streaming read of a guest file.

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `path`    | `string` |

  ##### Returns

  `Promise`\<[`FileStream`](#filestream)>

  <a id="remove" />

  #### remove()

  > **remove**(`path`, `options?`): `Promise`\<`void`>

  Remove a file or directory tree (like `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

  | Parameter  | Type                      |
  | ---------- | ------------------------- |
  | `path`     | `string`                  |
  | `options?` | [`FsOptions`](#fsoptions) |

  ##### Returns

  `Promise`\<`void`>

  <a id="uploaddir-1" />

  #### uploadDir()

  > **uploadDir**(`dirs`): `Promise`\<`void`>

  Upload a local directory's contents into a directory on the Sailbox.

  `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

  | Parameter       | Type                                                                |
  | --------------- | ------------------------------------------------------------------- |
  | `dirs`          | \{ `guestDir`: `string`; `localDir`: `string`; `user?`: `string`; } |
  | `dirs.guestDir` | `string`                                                            |
  | `dirs.localDir` | `string`                                                            |
  | `dirs.user?`    | `string`                                                            |

  ##### Returns

  `Promise`\<`void`>

  <a id="write-1" />

  #### write()

  > **write**(`path`, `data`, `options?`): `Promise`\<`void`>

  Write `data` to a guest file: [writeFiles](#writefiles-1) with one entry. Strings
  use UTF-8. Missing parent directories are created unless `createParents`
  is false. Use [writeStream](#writestream-1) to stream a large source.

  ##### Parameters

  | Parameter  | Type                                                                         |
  | ---------- | ---------------------------------------------------------------------------- |
  | `path`     | `string`                                                                     |
  | `data`     | `string` \| `Buffer`\<`ArrayBufferLike`> \| `Uint8Array`\<`ArrayBufferLike`> |
  | `options?` | [`WriteOptions`](#writeoptions)                                              |

  ##### Returns

  `Promise`\<`void`>

  <a id="writefiles-1" />

  #### writeFiles()

  > **writeFiles**(`files`, `options?`): `Promise`\<`void`>

  Write several complete files in one call. `files` maps each absolute
  guest path to its contents (strings use UTF-8). Each file is its own
  request, up to eight at a time, and every file gets the same options. A
  batch is not atomic across paths: the first failure stops the batch,
  files that already completed stay written, writes already in flight
  finish, and the error names the file that failed. A path may appear only
  once. Use [writeStream](#writestream-1) to stream a large source.

  ##### Parameters

  | Parameter  | Type                                                                   |
  | ---------- | ---------------------------------------------------------------------- |
  | `files`    | `Readonly`\<`Record`\<`string`, `Buffer` \| `Uint8Array` \| `string`>> |
  | `options?` | [`WriteOptions`](#writeoptions)                                        |

  ##### Returns

  `Promise`\<`void`>

  <a id="writestream-1" />

  #### writeStream()

  > **writeStream**(`path`, `options?`): `Promise`\<[`FileWriter`](#filewriter)>

  Open a streaming upload to a guest file.

  ##### Parameters

  | Parameter  | Type                            |
  | ---------- | ------------------------------- |
  | `path`     | `string`                        |
  | `options?` | [`WriteOptions`](#writeoptions) |

  ##### Returns

  `Promise`\<[`FileWriter`](#filewriter)>

  ***

  <a id="filewriter" />

  ## FileWriter

  A streaming write to a guest file. Push chunks with [write](#write), then
  confirm with [finish](#finish); only `finish` commits the write. A writer
  that goes away without finishing ([abort](#abort), an error path, or garbage
  collection) cancels the transfer instead; the guest file state is then
  unspecified.

  ### Methods

  <a id="asyncdispose-2" />

  #### \[asyncDispose]\()

  > **\[asyncDispose]**(): `Promise`\<`void`>

  `await using` support; same semantics as the synchronous form.

  ##### Returns

  `Promise`\<`void`>

  <a id="dispose-1" />

  #### \[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

  `void`

  <a id="abort" />

  #### abort()

  > **abort**(): `void`

  Abort the write: cancel the request so the server does not commit it.
  Idempotent. A later [finish](#finish) reports the abort instead of
  succeeding; the guest file state after an abort is unspecified.

  ##### Returns

  `void`

  <a id="finish" />

  #### finish()

  > **finish**(): `Promise`\<`void`>

  Confirm the write, creating an empty file if nothing was written.

  ##### Returns

  `Promise`\<`void`>

  <a id="towritable" />

  #### toWritable()

  > **toWritable**(): `Writable`

  Adapt to a Node `Writable`: `end()` runs [finish](#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](#write) resolves.

  ##### Returns

  `Writable`

  <a id="write" />

  #### write()

  > **write**(`data`): `Promise`\<`void`>

  Write bytes (a `string` is encoded as UTF-8). The SDK splits them into
  transport-sized chunks.

  ##### Parameters

  | Parameter | Type                                                                         |
  | --------- | ---------------------------------------------------------------------------- |
  | `data`    | `string` \| `Buffer`\<`ArrayBufferLike`> \| `Uint8Array`\<`ArrayBufferLike`> |

  ##### Returns

  `Promise`\<`void`>

  ***

  <a id="filestream" />

  ## FileStream

  An async-iterable download of a guest file. Chunks are `Buffer`s; 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](#close-1).

  ### Implements

  * `AsyncIterable`\<`Buffer`>

  ### Methods

  <a id="asyncdispose-1" />

  #### \[asyncDispose]\()

  > **\[asyncDispose]**(): `Promise`\<`void`>

  `await using` support.

  ##### Returns

  `Promise`\<`void`>

  <a id="asynciterator-1" />

  #### \[asyncIterator]\()

  > **\[asyncIterator]**(): `AsyncIterator`\<`Buffer`\<`ArrayBufferLike`>>

  ##### Returns

  `AsyncIterator`\<`Buffer`\<`ArrayBufferLike`>>

  ##### Implementation of

  `AsyncIterable.[asyncIterator]`

  <a id="bytes-1" />

  #### bytes()

  > **bytes**(): `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  Collect the whole file into a single `Buffer`.

  ##### Returns

  `Promise`\<`Buffer`\<`ArrayBufferLike`>>

  <a id="close-1" />

  #### close()

  > **close**(): `Promise`\<`void`>

  Release the underlying download stream (idempotent).

  ##### Returns

  `Promise`\<`void`>

  <a id="toreadable-1" />

  #### toReadable()

  > **toReadable**(): `Readable`

  Adapt to a Node `Readable`.

  ##### Returns

  `Readable`

  ***

  <a id="volume" />

  ## Volume

  A managed NFS volume that can be mounted into Sailboxes. Look one up (or
  mint it) with [Volume.find](#find-1), then pass it (or its [Volume.id](#id-2))
  in a Sailbox's `volumes` 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](https://join.slack.com/t/sailresearchcrew/shared_invite/zt-41pdcym9j-UU0Ey~A~r6n2H0DQVQsQHQ).

  ### Properties

  | Property                           | Modifier   | Type                    | Default value | Description                                                       |
  | ---------------------------------- | ---------- | ----------------------- | ------------- | ----------------------------------------------------------------- |
  | <a id="backend" /> `backend`       | `readonly` | `string`                | `undefined`   | Storage backend serving the volume.                               |
  | <a id="createdat-4" /> `createdAt` | `readonly` | `Date` \| `undefined`   | `undefined`   | Creation time, if reported.                                       |
  | <a id="id-2" /> `id`               | `readonly` | `string`                | `undefined`   | Stable volume id.                                                 |
  | <a id="mountpath" /> `mountPath`   | `readonly` | `string` \| `undefined` | `undefined`   | Guest mount path, when loaded via [Volume.fromMount](#frommount). |
  | <a id="name-4" /> `name`           | `readonly` | `string`                | `undefined`   | Volume name.                                                      |
  | <a id="status-5" /> `status`       | `readonly` | `string`                | `undefined`   | Lifecycle status.                                                 |
  | <a id="updatedat-3" /> `updatedAt` | `readonly` | `Date` \| `undefined`   | `undefined`   | Last-update time, if reported.                                    |

  ### Methods

  <a id="delete-2" />

  #### delete()

  > **delete**(`options?`): `Promise`\<`boolean`>

  Delete this volume. Resolves `true` if it was deleted, `false` if it was
  already gone (only possible with `allowMissing`).

  ##### Parameters

  | Parameter | Type                                          |
  | --------- | --------------------------------------------- |
  | `options` | [`DeleteVolumeOptions`](#deletevolumeoptions) |

  ##### Returns

  `Promise`\<`boolean`>

  <a id="find-1" />

  #### find()

  > `static` **find**(`name`, `options?`): `Promise`\<[`Volume`](#volume)>

  Look up an NFS volume by name, optionally minting it if missing.

  ##### Parameters

  | Parameter | Type                                      |
  | --------- | ----------------------------------------- |
  | `name`    | `string`                                  |
  | `options` | [`FindVolumeOptions`](#findvolumeoptions) |

  ##### Returns

  `Promise`\<[`Volume`](#volume)>

  <a id="frommount" />

  #### fromMount()

  > `static` **fromMount**(`path`): [`Volume`](#volume)

  Guest-side: load the volume handle for a path mounted into this
  Sailbox (reads the mount's metadata; only available inside a guest).

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `path`    | `string` |

  ##### Returns

  [`Volume`](#volume)

  <a id="list-4" />

  #### list()

  > `static` **list**(`options?`): `Promise`\<[`Volume`](#volume)\[]>

  List NFS volumes in the current org.

  ##### Parameters

  | Parameter | Type                                        |
  | --------- | ------------------------------------------- |
  | `options` | [`ListVolumesOptions`](#listvolumesoptions) |

  ##### Returns

  `Promise`\<[`Volume`](#volume)\[]>

  ***

  ## HTTP policies

  See [Credential injection](/sailboxes-credentials) for setup, examples, and cleanup. The entries below list the available TypeScript calls.

  <a id="secret" />

  ### Secret

  A value an HTTP policy can insert into matching HTTPS requests.

  Secrets belong to your organization. Sail never returns a stored value.
  Get and list calls return only the secret's name and timestamps.

  #### Properties

  | Property                           | Modifier   | Type     | Description                                         |
  | ---------------------------------- | ---------- | -------- | --------------------------------------------------- |
  | <a id="createdat-3" /> `createdAt` | `readonly` | `Date`   | When the secret was first set.                      |
  | <a id="name-3" /> `name`           | `readonly` | `string` | The secret's name, unique within your organization. |
  | <a id="updatedat-2" /> `updatedAt` | `readonly` | `Date`   | When the secret's value last changed.               |

  #### Methods

  <a id="delete-1" />

  ##### delete()

  > **delete**(): `Promise`\<`void`>

  Delete this secret.

  A secret cannot be deleted while an HTTP policy refers to it; throws
  [SecretInUseError](#secretinuseerror) until every referencing policy is deleted.
  Summaries from [HttpPolicy.list](#list-1) include the secret names they
  use.

  ###### Returns

  `Promise`\<`void`>

  <a id="deletebyname" />

  ##### deleteByName()

  > `static` **deleteByName**(`name`, `options?`): `Promise`\<`void`>

  Delete the named secret. Same contract as [Secret.delete](#delete-1).

  ###### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `name`    | `string`                          |
  | `options` | [`ClientOptions`](#clientoptions) |

  ###### Returns

  `Promise`\<`void`>

  <a id="get-2" />

  ##### get()

  > `static` **get**(`name`, `options?`): `Promise`\<[`Secret`](#secret)>

  Fetch one secret's name and timestamps. The value is never returned. Throws
  [NotFoundError](#notfounderror) when no secret has that name.

  ###### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `name`    | `string`                          |
  | `options` | [`ClientOptions`](#clientoptions) |

  ###### Returns

  `Promise`\<[`Secret`](#secret)>

  <a id="list-3" />

  ##### list()

  > `static` **list**(`options?`): `Promise`\<[`Secret`](#secret)\[]>

  List your organization's secret names and timestamps, sorted by name.

  ###### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `options` | [`ClientOptions`](#clientoptions) |

  ###### Returns

  `Promise`\<[`Secret`](#secret)\[]>

  <a id="set" />

  ##### set()

  > `static` **set**(`name`, `value`, `options?`): `Promise`\<[`Secret`](#secret)>

  Set (create or update) the named secret's value. An HTTP policy inserts
  it with `${secrets.NAME}`.

  After this call succeeds, the next matching request from any Sailbox
  whose attached HTTP policy uses this secret gets the new value.

  Names start with a letter or number and use letters, numbers,
  underscores, and dashes (up to 128 characters). Values cannot be empty.
  They can be up to 64 KiB and cannot contain ASCII control characters such
  as tabs or line breaks.

  ###### Parameters

  | Parameter | Type                              |
  | --------- | --------------------------------- |
  | `name`    | `string`                          |
  | `value`   | `string`                          |
  | `options` | [`ClientOptions`](#clientoptions) |

  ###### Returns

  `Promise`\<[`Secret`](#secret)>

  ***

  <a id="httppolicy" />

  ### HttpPolicy

  Rules that shape the HTTPS requests your Sailboxes send.

  A policy is a named document owned by your organization. Obtain one from
  [HttpPolicy.create](#create) or [HttpPolicy.get](#get); do not construct it
  directly. The document cannot change after creation, but
  [HttpPolicy.rename](#rename) can change its name.

  #### Properties

  | Property                           | Modifier   | Type                                          | Description                                                                          |
  | ---------------------------------- | ---------- | --------------------------------------------- | ------------------------------------------------------------------------------------ |
  | <a id="createdat-1" /> `createdAt` | `readonly` | `Date`                                        | When the policy was created.                                                         |
  | <a id="document" /> `document`     | `readonly` | [`HttpPolicyDocument`](#httppolicydocument-1) | The saved policy document: Sail's normalized form of the document given at creation. |
  | <a id="id-1" /> `id`               | `readonly` | `string`                                      | The policy's stable identifier.                                                      |
  | <a id="name-1" /> `name`           | `readonly` | `string`                                      | The policy's name (the only mutable field).                                          |
  | <a id="updatedat" /> `updatedAt`   | `readonly` | `Date`                                        | When the policy's name last changed.                                                 |

  #### Methods

  <a id="delete" />

  ##### delete()

  > **delete**(): `Promise`\<`void`>

  Delete the policy. A policy still attached to a Sailbox cannot be
  deleted; throws [HttpPolicyInUseError](#httppolicyinuseerror) until every Sailbox clears
  or replaces it.

  ###### Returns

  `Promise`\<`void`>

  <a id="rename" />

  ##### rename()

  > **rename**(`name`): `Promise`\<[`HttpPolicy`](#httppolicy)>

  Rename the policy and resolve the updated policy object. The document
  cannot change; create a new policy to change behavior. Names follow the
  same rules as [HttpPolicy.create](#create).

  ###### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `name`    | `string` |

  ###### Returns

  `Promise`\<[`HttpPolicy`](#httppolicy)>

  <a id="create" />

  ##### create()

  > `static` **create**(`name`, `document`, `options?`): `Promise`\<[`HttpPolicy`](#httppolicy)>

  Create a policy from `document`.

  Every `${secrets.NAME}` in the document must name a secret that already
  exists. An invalid document throws [InvalidArgumentError](#invalidargumenterror) naming
  the field to fix. Sail saves a normalized form of the document (for
  example, host names are lowercased and defaults are filled in), so
  reading the policy back can return a different shape with the same
  behavior.

  Policy names must contain visible text, use at most 128 characters, and
  cannot contain tabs, line breaks, or other control characters.

  Sail does not retry this call. If the connection ends before the result
  arrives, list policies before trying again; a second call can create a
  second policy.

  ###### Parameters

  | Parameter  | Type                                          |
  | ---------- | --------------------------------------------- |
  | `name`     | `string`                                      |
  | `document` | [`HttpPolicyDocument`](#httppolicydocument-1) |
  | `options`  | [`ClientOptions`](#clientoptions)             |

  ###### Returns

  `Promise`\<[`HttpPolicy`](#httppolicy)>

  <a id="get" />

  ##### get()

  > `static` **get**(`policyIdentifier`, `options?`): `Promise`\<[`HttpPolicy`](#httppolicy)>

  Fetch one policy by id, document included. Throws
  [NotFoundError](#notfounderror) when no policy has that id.

  ###### Parameters

  | Parameter          | Type                              |
  | ------------------ | --------------------------------- |
  | `policyIdentifier` | `string`                          |
  | `options`          | [`ClientOptions`](#clientoptions) |

  ###### Returns

  `Promise`\<[`HttpPolicy`](#httppolicy)>

  <a id="list-1" />

  ##### list()

  > `static` **list**(`options?`): `Promise`\<[`HttpPolicySummary`](#httppolicysummary)\[]>

  List your organization's policies as summaries, without documents.
  Fetch a policy's document with [HttpPolicy.get](#get).

  ###### Parameters

  | Parameter | Type                                                  |
  | --------- | ----------------------------------------------------- |
  | `options` | [`ListHttpPoliciesOptions`](#listhttppoliciesoptions) |

  ###### Returns

  `Promise`\<[`HttpPolicySummary`](#httppolicysummary)\[]>

  ***

  <a id="ingressauthheaders-2" />

  ## ingressAuthHeaders()

  > **ingressAuthHeaders**(): `Record`\<`string`, `string`>

  Guest-side: headers that authenticate this Sailbox as an ingress
  allowlist source (only available inside a Sailbox guest).

  ### Returns

  `Record`\<`string`, `string`>

  ***

  <a id="client" />

  ## 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](#sailbox), [App](#app),
  [Volume](#volume)) is built on top of it.

  Construct with [Client.fromEnv](#fromenv) or [Client.fromConfig](#fromconfig).

  ### Methods

  <a id="buildimagedefinition" />

  #### buildImageDefinition()

  > **buildImageDefinition**(`def`, `timeoutSeconds`, `options?`): `Promise`\<[`ImageSpec`](#imagespec)>

  Resolve an image definition and build it to ready, returning the
  content-addressed [ImageSpec](#imagespec) to create Sailboxes from. A bare
  Debian or devbox base image skips the build; `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](#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](#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

  | Parameter             | Type                                  |
  | --------------------- | ------------------------------------- |
  | `def`                 | [`ImageDefinition`](#imagedefinition) |
  | `timeoutSeconds`      | `number`                              |
  | `options`             | \{ `forceBuild?`: `boolean`; }        |
  | `options.forceBuild?` | `boolean`                             |

  ##### Returns

  `Promise`\<[`ImageSpec`](#imagespec)>

  <a id="buildspectoready" />

  #### buildSpecToReady()

  > **buildSpecToReady**(`spec`, `timeoutSeconds`, `options?`): `Promise`\<[`ImageBuild`](#imagebuild-1)>

  Build an already-resolved spec to ready (submit + poll), bounded by
  `timeoutSeconds`. `forceBuild` builds the image again even if a build
  already exists; see [Client.buildImageDefinition](#buildimagedefinition).

  ##### Parameters

  | Parameter             | Type                           |
  | --------------------- | ------------------------------ |
  | `spec`                | [`ImageSpec`](#imagespec)      |
  | `timeoutSeconds`      | `number`                       |
  | `options`             | \{ `forceBuild?`: `boolean`; } |
  | `options.forceBuild?` | `boolean`                      |

  ##### Returns

  `Promise`\<[`ImageBuild`](#imagebuild-1)>

  <a id="checkpointsailbox" />

  #### checkpointSailbox()

  > **checkpointSailbox**(`sailboxId`, `options?`): `Promise`\<[`SailboxCheckpoint`](#sailboxcheckpoint-1)>

  Take a checkpoint of a Sailbox. `name` sets the handle's display name;
  `ttlSeconds`, when given, overrides the server's default retention
  window.

  ##### Parameters

  | Parameter   | Type                                      |
  | ----------- | ----------------------------------------- |
  | `sailboxId` | `string`                                  |
  | `options`   | [`CheckpointOptions`](#checkpointoptions) |

  ##### Returns

  `Promise`\<[`SailboxCheckpoint`](#sailboxcheckpoint-1)>

  <a id="clearsailboxhttppolicy" />

  #### clearSailboxHttpPolicy()

  > **clearSailboxHttpPolicy**(`sailboxId`): `Promise`\<`void`>

  Clear a Sailbox's attached HTTP policy. The change applies to HTTPS
  connections the Sailbox opens after the call; connections already open
  keep the previous policy until they close. This also succeeds when no
  policy is attached.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="createfromcheckpoint" />

  #### createFromCheckpoint()

  > **createFromCheckpoint**(`params`): `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  Create a new Sailbox from a checkpoint.

  ##### Parameters

  | Parameter | Type                                              |
  | --------- | ------------------------------------------------- |
  | `params`  | [`FromCheckpointRequest`](#fromcheckpointrequest) |

  ##### Returns

  `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  <a id="createhttppolicy" />

  #### createHttpPolicy()

  > **createHttpPolicy**(`name`, `document`): `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  Create an HTTP policy from JSON-encoded text. The document cannot change
  after creation. Most callers should use [HttpPolicy.create](#create), which
  accepts an object and documents the name rules.

  ##### Parameters

  | Parameter  | Type     |
  | ---------- | -------- |
  | `name`     | `string` |
  | `document` | `string` |

  ##### Returns

  `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  <a id="createsailbox" />

  #### createSailbox()

  > **createSailbox**(`req`, `timeoutSeconds?`): `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  Create a Sailbox. `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

  | Parameter        | Type                                            | Default value |
  | ---------------- | ----------------------------------------------- | ------------- |
  | `req`            | [`CreateSailboxRequest`](#createsailboxrequest) | `undefined`   |
  | `timeoutSeconds` | `number`                                        | `600`         |

  ##### Returns

  `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  <a id="deletehttppolicy" />

  #### deleteHttpPolicy()

  > **deleteHttpPolicy**(`policyId`): `Promise`\<`void`>

  Delete an HTTP policy by id. While the policy is attached to a Sailbox,
  the call fails with a 409 [ApiError](#apierror) ([HttpPolicy.delete](#delete)
  maps that to [HttpPolicyInUseError](#httppolicyinuseerror)).

  ##### Parameters

  | Parameter  | Type     |
  | ---------- | -------- |
  | `policyId` | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="deletesecret" />

  #### deleteSecret()

  > **deleteSecret**(`name`): `Promise`\<`void`>

  Delete a secret by name. While an HTTP policy refers to it, the call
  fails with a 409 [ApiError](#apierror) ([Secret.delete](#delete-1) maps that to
  [SecretInUseError](#secretinuseerror)).

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `name`    | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="deletevolume" />

  #### deleteVolume()

  > **deleteVolume**(`volumeId`, `allowMissing?`): `Promise`\<[`VolumeInfo`](#volumeinfo) | `null`>

  Delete a volume by id. `allowMissing` tolerates an already-deleted
  volume, resolving `null` instead of throwing.

  ##### Parameters

  | Parameter      | Type      | Default value |
  | -------------- | --------- | ------------- |
  | `volumeId`     | `string`  | `undefined`   |
  | `allowMissing` | `boolean` | `false`       |

  ##### Returns

  `Promise`\<[`VolumeInfo`](#volumeinfo) | `null`>

  <a id="downloaddir" />

  #### downloadDir()

  > **downloadDir**(`sailboxId`, `dirs`): `Promise`\<`void`>

  Download a guest directory's contents into a local directory, named in
  `dirs`.

  ##### Parameters

  | Parameter       | Type                                             |
  | --------------- | ------------------------------------------------ |
  | `sailboxId`     | `string`                                         |
  | `dirs`          | \{ `guestDir`: `string`; `localDir`: `string`; } |
  | `dirs.guestDir` | `string`                                         |
  | `dirs.localDir` | `string`                                         |

  ##### Returns

  `Promise`\<`void`>

  <a id="enablessh" />

  #### enableSsh()

  > **enableSsh**(`sailboxId`, `options?`): `Promise`\<[`SshEndpoint`](#sshendpoint) | `null`>

  Enable SSH on a Sailbox: trust the org SSH CA, start `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](#timeouterror) if
  it is not within `timeoutSeconds`; with `wait: false`, skips the probe and
  resolves `null`.

  ##### Parameters

  | Parameter   | Type                                    |
  | ----------- | --------------------------------------- |
  | `sailboxId` | `string`                                |
  | `options`   | [`EnableSshOptions`](#enablesshoptions) |

  ##### Returns

  `Promise`\<[`SshEndpoint`](#sshendpoint) | `null`>

  <a id="exec" />

  #### exec()

  > **exec**(`sailboxId`, `command`, `options?`): `Promise`\<[`ExecProcess`](#execprocess)>

  Run a command in a Sailbox and return a handle to the live process. A
  `string` command is run via `/bin/sh -lc`; a `string[]` is exec'd directly.
  By default a stream you are consuming pauses the command when you fall
  behind, so nothing is lost until a cancel or the exec timeout ends the
  pauses, and a stream you are not consuming keeps only
  its most recent 1 MiB; `outputMode` and `outputBufferBytes` change that (see
  [ExecProcess](#execprocess) and [ExecOptions](#execoptions)).
  `cwd`/`background` apply to string commands (see [ExecOptions](#execoptions)).
  Stopping the command is the caller's job via [ExecProcess.cancel](#cancel).

  ##### Parameters

  | Parameter   | Type                             |
  | ----------- | -------------------------------- |
  | `sailboxId` | `string`                         |
  | `command`   | `string` \| readonly `string`\[] |
  | `options`   | [`ExecOptions`](#execoptions)    |

  ##### Returns

  `Promise`\<[`ExecProcess`](#execprocess)>

  <a id="exposelistener" />

  #### exposeListener()

  > **exposeListener**(`sailboxId`, `guestPort`, `protocol?`, `allowlist?`): `Promise`\<[`Listener`](#listener-1)>

  Expose a guest port at runtime. Re-exposing a port under the same
  protocol sets its `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

  | Parameter   | Type                                  | Default value |
  | ----------- | ------------------------------------- | ------------- |
  | `sailboxId` | `string`                              | `undefined`   |
  | `guestPort` | `number`                              | `undefined`   |
  | `protocol`  | [`IngressProtocol`](#ingressprotocol) | `"http"`      |
  | `allowlist` | readonly `string`\[]                  | `[]`          |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="findapp" />

  #### findApp()

  > **findApp**(`name`, `mintIfMissing?`): `Promise`\<[`AppInfo`](#appinfo)>

  Find an app by name; `mintIfMissing` creates it when absent.

  ##### Parameters

  | Parameter       | Type      | Default value |
  | --------------- | --------- | ------------- |
  | `name`          | `string`  | `undefined`   |
  | `mintIfMissing` | `boolean` | `false`       |

  ##### Returns

  `Promise`\<[`AppInfo`](#appinfo)>

  <a id="gethttppolicy" />

  #### getHttpPolicy()

  > **getHttpPolicy**(`policyId`): `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  Fetch one HTTP policy by id, including its document.

  ##### Parameters

  | Parameter  | Type     |
  | ---------- | -------- |
  | `policyId` | `string` |

  ##### Returns

  `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  <a id="getlistener" />

  #### getListener()

  > **getListener**(`sailboxId`, `guestPort`): `Promise`\<[`Listener`](#listener-1)>

  Fetch one listener by guest port without waking the Sailbox.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `guestPort` | `number` |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="getsailbox" />

  #### getSailbox()

  > **getSailbox**(`sailboxId`): `Promise`\<[`SailboxInfo`](#sailboxinfo)>

  Fetch one Sailbox by id.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<[`SailboxInfo`](#sailboxinfo)>

  <a id="getsecret" />

  #### getSecret()

  > **getSecret**(`name`): `Promise`\<[`SecretInfo`](#secretinfo)>

  Fetch one secret's name and timestamps, never its value.

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `name`    | `string` |

  ##### Returns

  `Promise`\<[`SecretInfo`](#secretinfo)>

  <a id="getvolume" />

  #### getVolume()

  > **getVolume**(`name`, `mintIfMissing?`): `Promise`\<[`VolumeInfo`](#volumeinfo)>

  Look up an NFS volume by name; `mintIfMissing` creates it when absent.

  ##### Parameters

  | Parameter       | Type      | Default value |
  | --------------- | --------- | ------------- |
  | `name`          | `string`  | `undefined`   |
  | `mintIfMissing` | `boolean` | `false`       |

  ##### Returns

  `Promise`\<[`VolumeInfo`](#volumeinfo)>

  <a id="ingressauthheaders" />

  #### ingressAuthHeaders()

  > **ingressAuthHeaders**(`sailboxId`): `Promise`\<`Record`\<`string`, `string`>>

  Ingress-identity headers for this Sailbox, as a name→value map.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<`Record`\<`string`, `string`>>

  <a id="listapps" />

  #### listApps()

  > **listApps**(): `Promise`\<[`AppInfo`](#appinfo)\[]>

  Every app the current org owns, newest first.

  ##### Returns

  `Promise`\<[`AppInfo`](#appinfo)\[]>

  <a id="listdir" />

  #### listDir()

  > **listDir**(`sailboxId`, `path`, `user?`): `Promise`\<[`DirEntry`](#direntry)\[]>

  List a directory's immediate entries as structured records.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `path`      | `string` |
  | `user?`     | `string` |

  ##### Returns

  `Promise`\<[`DirEntry`](#direntry)\[]>

  <a id="listhttppolicies" />

  #### listHttpPolicies()

  > **listHttpPolicies**(`params`): `Promise`\<[`HttpPolicyPage`](#httppolicypage)>

  List HTTP policies with paging and an optional id or name search.

  ##### Parameters

  | Parameter        | Type                                                             |
  | ---------------- | ---------------------------------------------------------------- |
  | `params`         | \{ `limit`: `number`; `offset`: `number`; `search?`: `string`; } |
  | `params.limit`   | `number`                                                         |
  | `params.offset`  | `number`                                                         |
  | `params.search?` | `string`                                                         |

  ##### Returns

  `Promise`\<[`HttpPolicyPage`](#httppolicypage)>

  <a id="listlisteners" />

  #### listListeners()

  > **listListeners**(`sailboxId`): `Promise`\<[`Listener`](#listener-1)\[]>

  List a Sailbox's listeners without waking it.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)\[]>

  <a id="listsailboxes" />

  #### listSailboxes()

  > **listSailboxes**(`params?`): `Promise`\<[`SailboxInfoPage`](#sailboxinfopage)>

  List one page of Sailboxes in the current org.

  ##### Parameters

  | Parameter | Type                                        |
  | --------- | ------------------------------------------- |
  | `params`  | [`ListSailboxesQuery`](#listsailboxesquery) |

  ##### Returns

  `Promise`\<[`SailboxInfoPage`](#sailboxinfopage)>

  <a id="listsecrets" />

  #### listSecrets()

  > **listSecrets**(): `Promise`\<[`SecretInfo`](#secretinfo)\[]>

  List the organization's secret names and timestamps.

  ##### Returns

  `Promise`\<[`SecretInfo`](#secretinfo)\[]>

  <a id="listvolumes" />

  #### listVolumes()

  > **listVolumes**(`maxObjects?`): `Promise`\<[`VolumeInfo`](#volumeinfo)\[]>

  List NFS volumes in the current org.

  ##### Parameters

  | Parameter     | Type     |
  | ------------- | -------- |
  | `maxObjects?` | `number` |

  ##### Returns

  `Promise`\<[`VolumeInfo`](#volumeinfo)\[]>

  <a id="makedir" />

  #### makeDir()

  > **makeDir**(`sailboxId`, `path`, `user?`): `Promise`\<`void`>

  Create a directory and any missing parents (like `mkdir -p`); a no-op if
  it already exists.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `path`      | `string` |
  | `user?`     | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="orgsshcapublickey" />

  #### orgSshCaPublicKey()

  > **orgSshCaPublicKey**(): `Promise`\<`string`>

  Fetch (creating on first use) the org SSH certificate authority public key.
  Used to preflight SSH before a Sailbox is provisioned.

  ##### Returns

  `Promise`\<`string`>

  <a id="pathexists" />

  #### pathExists()

  > **pathExists**(`sailboxId`, `path`, `user?`): `Promise`\<`boolean`>

  Whether `path` exists in the guest.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `path`      | `string` |
  | `user?`     | `string` |

  ##### Returns

  `Promise`\<`boolean`>

  <a id="pausesailbox" />

  #### pauseSailbox()

  > **pauseSailbox**(`sailboxId`): `Promise`\<`void`>

  Pause a Sailbox in memory.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="readstream" />

  #### readStream()

  > **readStream**(`sailboxId`, `path`): `Promise`\<[`FileStream`](#filestream)>

  Open a streaming read of a guest file.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `path`      | `string` |

  ##### Returns

  `Promise`\<[`FileStream`](#filestream)>

  <a id="removepath" />

  #### removePath()

  > **removePath**(`sailboxId`, `path`, `user?`): `Promise`\<`void`>

  Remove a file or directory tree (like `rm -rf`); a no-op if it is already
  absent.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `path`      | `string` |
  | `user?`     | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="renamehttppolicy" />

  #### renameHttpPolicy()

  > **renameHttpPolicy**(`policyId`, `name`): `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  Rename an HTTP policy. Its document stays unchanged. Names follow the
  same rules as [HttpPolicy.create](#create).

  ##### Parameters

  | Parameter  | Type     |
  | ---------- | -------- |
  | `policyId` | `string` |
  | `name`     | `string` |

  ##### Returns

  `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo)>

  <a id="resolveimage" />

  #### resolveImage()

  > **resolveImage**(`def`): `Promise`\<[`ImageSpec`](#imagespec)>

  Resolve an image definition into a content-addressed [ImageSpec](#imagespec):
  the SDK walks local directories (gitignore-style `ignore`), hashes every
  file, and uploads content the server does not already have.

  ##### Parameters

  | Parameter | Type                                  |
  | --------- | ------------------------------------- |
  | `def`     | [`ImageDefinition`](#imagedefinition) |

  ##### Returns

  `Promise`\<[`ImageSpec`](#imagespec)>

  <a id="resumesailbox" />

  #### resumeSailbox()

  > **resumeSailbox**(`sailboxId`): `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  Resume a paused or sleeping Sailbox.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<[`SailboxHandle`](#sailboxhandle)>

  <a id="sailboxhttppolicy" />

  #### sailboxHttpPolicy()

  > **sailboxHttpPolicy**(`sailboxId`): `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo) | `null`>

  The HTTP policy attached to a Sailbox, or `null` when none is attached.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<[`HttpPolicyInfo`](#httppolicyinfo) | `null`>

  <a id="setsailboxautosleep" />

  #### setSailboxAutoSleep()

  > **setSailboxAutoSleep**(`sailboxId`, `autoSleep`): `Promise`\<`void`>

  Replace when Sail may sleep a Sailbox on its own. Each call replaces the
  whole setting: switching to `{ automatic: false }` clears any minimum wait
  set earlier. Most callers use [Sailbox.setAutoSleep](#setautosleep).

  ##### Parameters

  | Parameter   | Type                        |
  | ----------- | --------------------------- |
  | `sailboxId` | `string`                    |
  | `autoSleep` | [`AutoSleep`](#autosleep-4) |

  ##### Returns

  `Promise`\<`void`>

  <a id="setsailboxhttppolicy" />

  #### setSailboxHttpPolicy()

  > **setSailboxHttpPolicy**(`sailboxId`, `policyId`): `Promise`\<`void`>

  Attach an HTTP policy to a Sailbox, replacing any previous one. The
  policy applies to HTTPS connections the Sailbox opens after the call;
  connections already open keep the previous policy until they close.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `policyId`  | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="setsecret" />

  #### setSecret()

  > **setSecret**(`name`, `value`): `Promise`\<[`SecretInfo`](#secretinfo)>

  Set (create or update) an organization secret. Sail never returns the
  stored value. After this resolves, the next matching request from a
  Sailbox whose attached HTTP policy uses the secret gets the new value.
  Names and values follow the same rules as [Secret.set](#set).

  ##### Parameters

  | Parameter | Type     |
  | --------- | -------- |
  | `name`    | `string` |
  | `value`   | `string` |

  ##### Returns

  `Promise`\<[`SecretInfo`](#secretinfo)>

  <a id="shell" />

  #### shell()

  > **shell**(`sailboxId`, `command?`, `options?`): `Promise`\<`number`>

  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).

  ##### Parameters

  | Parameter   | Type                            |
  | ----------- | ------------------------------- |
  | `sailboxId` | `string`                        |
  | `command?`  | `string`                        |
  | `options?`  | [`ShellOptions`](#shelloptions) |

  ##### Returns

  `Promise`\<`number`>

  <a id="sleepsailbox" />

  #### sleepSailbox()

  > **sleepSailbox**(`sailboxId`, `wakeAt?`): `Promise`\<`string` | `null`>

  Sleep a Sailbox to disk (wakes on traffic), optionally scheduling a
  wall-clock wake first. `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](#sleep), which takes and
  returns `Date`.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `wakeAt?`   | `string` |

  ##### Returns

  `Promise`\<`string` | `null`>

  <a id="terminatesailbox" />

  #### terminateSailbox()

  > **terminateSailbox**(`sailboxId`): `Promise`\<`void`>

  Terminate a Sailbox (idempotent).

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<`void`>

  <a id="unexposelistener" />

  #### unexposeListener()

  > **unexposeListener**(`sailboxId`, `guestPort`): `Promise`\<`void`>

  Remove a runtime ingress port.

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |
  | `guestPort` | `number` |

  ##### Returns

  `Promise`\<`void`>

  <a id="upgradesailbox" />

  #### upgradeSailbox()

  > **upgradeSailbox**(`sailboxId`): `Promise`\<[`UpgradeResult`](#upgraderesult)>

  Upgrade a Sailbox's runtime (now if running, else at next wake).

  ##### Parameters

  | Parameter   | Type     |
  | ----------- | -------- |
  | `sailboxId` | `string` |

  ##### Returns

  `Promise`\<[`UpgradeResult`](#upgraderesult)>

  <a id="uploaddir" />

  #### uploadDir()

  > **uploadDir**(`sailboxId`, `dirs`): `Promise`\<`void`>

  Upload a local directory's contents into a guest directory, named in
  `dirs`. `user` gives the uploaded entries to that user instead of the
  image's `USER`.

  ##### Parameters

  | Parameter       | Type                                                                |
  | --------------- | ------------------------------------------------------------------- |
  | `sailboxId`     | `string`                                                            |
  | `dirs`          | \{ `guestDir`: `string`; `localDir`: `string`; `user?`: `string`; } |
  | `dirs.guestDir` | `string`                                                            |
  | `dirs.localDir` | `string`                                                            |
  | `dirs.user?`    | `string`                                                            |

  ##### Returns

  `Promise`\<`void`>

  <a id="waitforlistener" />

  #### waitForListener()

  > **waitForListener**(`sailboxId`, `guestPort`, `timeoutSeconds`): `Promise`\<[`Listener`](#listener-1)>

  Block until the listener on `guestPort` is reachable end to end and
  return it, throwing [TimeoutError](#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` |

  ##### Returns

  `Promise`\<[`Listener`](#listener-1)>

  <a id="writefiles" />

  #### writeFiles()

  > **writeFiles**(`sailboxId`, `files`, `options?`): `Promise`\<`void`>

  Write several complete files in one call, up to eight at a time,
  stopping at the first failure.

  ##### Parameters

  | Parameter   | Type                                                                   |
  | ----------- | ---------------------------------------------------------------------- |
  | `sailboxId` | `string`                                                               |
  | `files`     | `Readonly`\<`Record`\<`string`, `Buffer` \| `Uint8Array` \| `string`>> |
  | `options`   | [`WriteOptions`](#writeoptions)                                        |

  ##### Returns

  `Promise`\<`void`>

  <a id="writestream" />

  #### writeStream()

  > **writeStream**(`sailboxId`, `path`, `options?`): `Promise`\<[`FileWriter`](#filewriter)>

  Open a streaming upload to a guest file.

  ##### Parameters

  | Parameter   | Type                            |
  | ----------- | ------------------------------- |
  | `sailboxId` | `string`                        |
  | `path`      | `string`                        |
  | `options`   | [`WriteOptions`](#writeoptions) |

  ##### Returns

  `Promise`\<[`FileWriter`](#filewriter)>

  <a id="fromconfig" />

  #### fromConfig()

  > `static` **fromConfig**(`config`): [`Client`](#client)

  Build a client from an explicit [ClientConfig](#clientconfig).

  ##### Parameters

  | Parameter | Type                            |
  | --------- | ------------------------------- |
  | `config`  | [`ClientConfig`](#clientconfig) |

  ##### Returns

  [`Client`](#client)

  <a id="fromenv" />

  #### fromEnv()

  > `static` **fromEnv**(): [`Client`](#client)

  Build a client from the environment (`SAIL_API_KEY`, ...).

  ##### Returns

  [`Client`](#client)

  ***

  <a id="defaultclient" />

  ## defaultClient()

  > **defaultClient**(): [`Client`](#client)

  The process-wide client used by the object-model statics ([Sailbox](#sailbox),
  [App](#app), [Volume](#volume)) when no explicit `client` is passed. Created
  lazily from the environment on first use.

  ### Returns

  [`Client`](#client)

  ***

  <a id="setdefaultclient" />

  ## setDefaultClient()

  > **setDefaultClient**(`client`): `void`

  Override (or clear, with `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`](#client) \| `undefined` |

  ### Returns

  `void`

  ***

  <a id="resolveconfig" />

  ## resolveConfig()

  > **resolveConfig**(): [`ResolvedConfig`](#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

  [`ResolvedConfig`](#resolvedconfig)

  ***

  <a id="issailerror" />

  ## isSailError()

  > **isSailError**(`err`): `err is SailError`

  Whether `err` is a [SailError](#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

  | Parameter | Type      |
  | --------- | --------- |
  | `err`     | `unknown` |

  ### Returns

  `err is SailError`

  ## Types

  Plain data types accepted by and returned from the calls above.

  <a id="addlocaldir-1" />

  ### AddLocalDir

  A tree of local files copied into the image.

  #### Properties

  | Property                            | Type                                     | Description                                |
  | ----------------------------------- | ---------------------------------------- | ------------------------------------------ |
  | <a id="files" /> `files?`           | [`AddLocalDirFile`](#addlocaldirfile)\[] | The files to place under `remotePath`.     |
  | <a id="remotepath" /> `remotePath?` | `string`                                 | Absolute guest path of the directory root. |

  ***

  <a id="addlocaldirfile" />

  ### AddLocalDirFile

  One file within an `addLocalDir` step.

  #### Properties

  | Property                                  | Type     | Description                                     |
  | ----------------------------------------- | -------- | ----------------------------------------------- |
  | <a id="contentsha256" /> `contentSha256?` | `string` | SHA-256 of the (already uploaded) file content. |
  | <a id="mode" /> `mode?`                   | `number` | Permission bits (low 9).                        |
  | <a id="relativepath" /> `relativePath?`   | `string` | Path relative to the directory root.            |

  ***

  <a id="addlocaldiroptions" />

  ### AddLocalDirOptions

  Options for [Image.addLocalDir](#addlocaldir).

  #### Properties

  | Property                            | Type                 | Description                                                          |
  | ----------------------------------- | -------------------- | -------------------------------------------------------------------- |
  | <a id="ignore" /> `ignore?`         | readonly `string`\[] | Gitignore-style patterns to skip (e.g. `"*.pyc"`, `"__pycache__/"`). |
  | <a id="ignorefile" /> `ignoreFile?` | `string`             | A gitignore-style file whose patterns to skip (e.g. `.gitignore`).   |

  ***

  <a id="addlocalfile-1" />

  ### AddLocalFile

  One local file copied into the image, referenced by content hash.

  #### Properties

  | Property                                    | Type     | Description                                                  |
  | ------------------------------------------- | -------- | ------------------------------------------------------------ |
  | <a id="contentsha256-1" /> `contentSha256?` | `string` | SHA-256 of the (already uploaded) file content.              |
  | <a id="mode-1" /> `mode?`                   | `number` | Permission bits (low 9); 0 means the builder default (0644). |
  | <a id="remotepath-1" /> `remotePath?`       | `string` | Absolute guest path to place the file at.                    |

  ***

  <a id="addlocalfileoptions" />

  ### AddLocalFileOptions

  Options for [Image.addLocalFile](#addlocalfile).

  #### Properties

  | Property                  | Type     | Description                                                      |
  | ------------------------- | -------- | ---------------------------------------------------------------- |
  | <a id="mode-2" /> `mode?` | `number` | Unix mode bits (low 9); omitted uses the builder default (0644). |

  ***

  <a id="appinfo" />

  ### AppInfo

  A Sail app.

  #### Properties

  | Property                           | Type     | Description               |
  | ---------------------------------- | -------- | ------------------------- |
  | <a id="createdat-5" /> `createdAt` | `string` | Creation time (RFC 3339). |
  | <a id="id-3" /> `id`               | `string` | Stable app id.            |
  | <a id="name-5" /> `name`           | `string` | App name.                 |

  ***

  <a id="autosleep-4" />

  ### AutoSleep

  > **AutoSleep** = [`AutomaticSleep`](#automaticsleep) | [`NeverSleep`](#neversleep)

  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.

  An explicit idle window replaces Sail's default and can make automatic sleep
  happen sooner or later. The window only controls when Sail may consider
  sleeping the Sailbox. Sail still sleeps it only when it sits fully idle: no
  busy process, no imminent timer, nothing a sleep would interrupt. Calling
  `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.

  ***

  <a id="automaticsleep" />

  ### AutomaticSleep

  Let Sail decide when to sleep a Sailbox, optionally after a minimum wait.

  #### Properties

  | Property                                                  | Modifier   | Type     | Description                                                                                                                                                                                                                                    |
  | --------------------------------------------------------- | ---------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="automatic" /> `automatic?`                         | `readonly` | `true`   | Sail decides when to sleep it.                                                                                                                                                                                                                 |
  | <a id="minsecondsbeforesleep" /> `minSecondsBeforeSleep?` | `readonly` | `number` | Use this idle window instead of Sail's default. Once it passes, Sail may sleep the Sailbox only when it is fully idle. Whole-second values from 1 through 3600 are accepted; 0 restores Sail's default, and other numeric values are rejected. |

  ***

  <a id="baseimage" />

  ### BaseImage

  > **BaseImage** = `"debian"` | `"devbox"`

  ***

  <a id="canceloptions" />

  ### CancelOptions

  Options for cancelling an exec.

  #### Properties

  | Property                  | Type      | Description                     |
  | ------------------------- | --------- | ------------------------------- |
  | <a id="force" /> `force?` | `boolean` | Send SIGKILL instead of SIGINT. |

  ***

  <a id="checkpointoptions" />

  ### CheckpointOptions

  Options for [Sailbox.checkpoint](#checkpoint).

  #### Properties

  | Property                            | Type     | Description                                                                                                                                                                                               |
  | ----------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="name-6" /> `name?`           | `string` | Display name for the checkpoint handle.                                                                                                                                                                   |
  | <a id="ttlseconds" /> `ttlSeconds?` | `number` | Retention override in whole seconds (must be positive). Set it when you keep a checkpoint to reuse as a template, so the handle does not expire while you still need it; omitted uses the server default. |

  ***

  <a id="clientconfig" />

  ### ClientConfig

  Explicit client configuration (an alternative to environment resolution).

  #### Extends

  * `Omit`\<`native.ClientConfig`, `"mode"`>

  #### Properties

  | Property                                  | Type     | Description                                                                                                                              | Inherited from       |
  | ----------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------- | -------------------- |
  | <a id="apikey" /> `apiKey`                | `string` | Bearer API key. Required.                                                                                                                | `Omit.apiKey`        |
  | <a id="apiurl" /> `apiUrl?`               | `string` | Override the Sail API URL.                                                                                                               | `Omit.apiUrl`        |
  | <a id="ingressurl" /> `ingressUrl?`       | `string` | Override the listener ingress base URL (what `SAILBOX_INGRESS_URL` sets from the environment), for custom or self-hosted Sailbox stacks. | `Omit.ingressUrl`    |
  | <a id="sailboxapiurl" /> `sailboxApiUrl?` | `string` | Override the Sailbox-API URL.                                                                                                            | `Omit.sailboxApiUrl` |

  ***

  <a id="clientoptions" />

  ### ClientOptions

  Options for statics that select which [Client](#client) to use.

  #### Extended by

  * [`FindAppOptions`](#findappoptions)
  * [`FindVolumeOptions`](#findvolumeoptions)
  * [`ListVolumesOptions`](#listvolumesoptions)
  * [`ListHttpPoliciesOptions`](#listhttppoliciesoptions)
  * [`CreateSailboxOptions`](#createsailboxoptions)
  * [`FromCheckpointOptions`](#fromcheckpointoptions)
  * [`ListSailboxesOptions`](#listsailboxesoptions)
  * [`ListSailboxesPageOptions`](#listsailboxespageoptions)

  #### Properties

  | Property                      | Type                | Description                                             |
  | ----------------------------- | ------------------- | ------------------------------------------------------- |
  | <a id="client-2" /> `client?` | [`Client`](#client) | Use a specific client instead of the default (env) one. |

  ***

  <a id="createsailboxoptions" />

  ### CreateSailboxOptions

  Options for [Sailbox.create](#create-1): the create request plus a per-attempt
  timeout and an optional explicit client. `image` defaults to the prebuilt
  Debian base.

  #### Extends

  * `Omit`\<[`CreateSailboxRequest`](#createsailboxrequest), `"image"` | `"appId"` | `"volumeMounts"` | `"ingressPorts"` | `"visibility"`>.[`ClientOptions`](#clientoptions)

  #### Properties

  | Property                                                        | Type                                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   | Overrides                       | Inherited from                                                                      |
  | --------------------------------------------------------------- | ----------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------- |
  | <a id="app-1" /> `app`                                          | `string` \| [`App`](#app)                                         | The owning app, or its id.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    | -                               | -                                                                                   |
  | <a id="autosleep-1" /> `autoSleep?`                             | [`AutoSleep`](#autosleep-4)                                       | When Sail may sleep this Sailbox on its own. Omit for the default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | -                               | [`CreateSailboxRequest`](#createsailboxrequest).[`autoSleep`](#autosleep-2)         |
  | <a id="client-3" /> `client?`                                   | [`Client`](#client)                                               | Use a specific client instead of the default (env) one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | -                               | [`ClientOptions`](#clientoptions).[`client`](#client-2)                             |
  | <a id="disklimitgib" /> `diskLimitGib?`                         | `number`                                                          | Disk limit in whole GiB within the size's range; the size's default when omitted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | -                               | `Omit.diskLimitGib`                                                                 |
  | <a id="image-1" /> `image?`                                     | [`ImageSpec`](#imagespec) \| [`Image`](#image)                    | Image spec, or an [Image](#image) builder (built and resolved at create). Defaults to the prebuilt Debian base, which needs no image build.                                                                                                                                                                                                                                                                                                                                                                                                                                                   | -                               | -                                                                                   |
  | <a id="imagebuildtimeoutseconds" /> `imageBuildTimeoutSeconds?` | `number`                                                          | Timeout in seconds for building a custom `Image` before create (1800).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        | `Omit.imageBuildTimeoutSeconds` | -                                                                                   |
  | <a id="ingressports" /> `ingressPorts?`                         | readonly (`number` \| [`IngressPortInput`](#ingressportinput))\[] | Guest ports to expose: a bare number is HTTP shorthand.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       | -                               | -                                                                                   |
  | <a id="memorylimitgib" /> `memoryLimitGib?`                     | `number`                                                          | Memory limit in whole GiB within the size's range; the size's default when omitted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | -                               | `Omit.memoryLimitGib`                                                               |
  | <a id="name-7" /> `name`                                        | `string`                                                          | The Sailbox name.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | -                               | `Omit.name`                                                                         |
  | <a id="networkpolicy-1" /> `networkPolicy?`                     | [`NetworkPolicy`](#networkpolicy-4)                               | The Sailbox's network policy. Omit for `"public"`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | -                               | [`CreateSailboxRequest`](#createsailboxrequest).[`networkPolicy`](#networkpolicy-2) |
  | <a id="size" /> `size?`                                         | [`SailboxSize`](#sailboxsize)                                     | Resource size; `"m"` when omitted.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            | -                               | [`CreateSailboxRequest`](#createsailboxrequest).[`size`](#size-1)                   |
  | <a id="timeoutseconds" /> `timeoutSeconds?`                     | `number`                                                          | 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`.                                                                                                                                                                                                                                                            | -                               | -                                                                                   |
  | <a id="visibility-1" /> `visibility?`                           | `"org"` \| `"private"`                                            | Who may operate the Sailbox, fixed for its life. `"org"` (the default) lets any credential in your org exec, copy files, SSH, or run lifecycle operations on it; `"private"` restricts all of that to you. An org admin can override a private Sailbox with a recorded reason for exec, files, setting a wake time, and the pause, sleep, resume, terminate, and upgrade operations. SSH, exposing or removing listeners, checkpoint, and restore stay creator-only. `"private"` requires an API key minted by your user. SSH is enabled after create with [Sailbox.enableSsh](#enablessh-1). | -                               | -                                                                                   |
  | <a id="volumes" /> `volumes?`                                   | `Readonly`\<`Record`\<`string`, `string` \| [`Volume`](#volume)>> | Shared volumes to mount, mapping an absolute guest path to a [Volume](#volume) or volume id. 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](https://join.slack.com/t/sailresearchcrew/shared_invite/zt-41pdcym9j-UU0Ey~A~r6n2H0DQVQsQHQ).                                                                                                                                                                                                                       | -                               | -                                                                                   |

  ***

  <a id="createsailboxrequest" />

  ### CreateSailboxRequest

  #### Extends

  * `Omit`\<`native.CreateSailboxRequest`, `"image"` | `"ingressPorts"` | `"size"` | `"volumeMounts"` | `"autoSleep"` | `"networkPolicy"` | `"visibility"` | `"networkAllowedHosts"`>

  #### Properties

  | Property                                                          | Type                                                | Description                                                                                                                                                                                                                                                           | Inherited from                  |
  | ----------------------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
  | <a id="appid-2" /> `appId`                                        | `string`                                            | Identifier of the owning app.                                                                                                                                                                                                                                         | `Omit.appId`                    |
  | <a id="autosleep-2" /> `autoSleep?`                               | [`AutoSleep`](#autosleep-4)                         | When Sail may sleep this Sailbox on its own. Omit for the default.                                                                                                                                                                                                    | -                               |
  | <a id="disklimitgib-1" /> `diskLimitGib?`                         | `number`                                            | Disk limit in whole GiB within the size's range; the size's default when omitted.                                                                                                                                                                                     | `Omit.diskLimitGib`             |
  | <a id="image-2" /> `image?`                                       | [`ImageSpec`](#imagespec)                           | Image to boot; defaults to a plain Debian base when omitted.                                                                                                                                                                                                          | -                               |
  | <a id="imagebuildtimeoutseconds-1" /> `imageBuildTimeoutSeconds?` | `number`                                            | Budget in seconds for rebuilding the image if Sail needs to rebuild it before the Sailbox is created; the default build budget applies when omitted.                                                                                                                  | `Omit.imageBuildTimeoutSeconds` |
  | <a id="ingressports-1" /> `ingressPorts?`                         | readonly [`IngressPortInput`](#ingressportinput)\[] | Guest ports to reserve for ingress.                                                                                                                                                                                                                                   | -                               |
  | <a id="memorylimitgib-1" /> `memoryLimitGib?`                     | `number`                                            | Memory limit in whole GiB within the size's range; the size's default when omitted.                                                                                                                                                                                   | `Omit.memoryLimitGib`           |
  | <a id="name-8" /> `name`                                          | `string`                                            | The Sailbox name.                                                                                                                                                                                                                                                     | `Omit.name`                     |
  | <a id="networkpolicy-2" /> `networkPolicy?`                       | [`NetworkPolicy`](#networkpolicy-4)                 | The Sailbox's network policy. Omit for `"public"`.                                                                                                                                                                                                                    | -                               |
  | <a id="size-1" /> `size?`                                         | [`SailboxSize`](#sailboxsize)                       | Resource size; `"m"` when omitted.                                                                                                                                                                                                                                    | -                               |
  | <a id="visibility-2" /> `visibility?`                             | `"org"` \| `"private"`                              | Who may operate the Sailbox: `"org"` (the default) lets any credential in your org exec, copy files, SSH, or run lifecycle operations on it; `"private"` restricts all of that to the creating user and requires a user-scoped API key. Fixed for the Sailbox's life. | -                               |
  | <a id="volumemounts-1" /> `volumeMounts?`                         | readonly [`VolumeMountInput`](#volumemountinput)\[] | NFS volumes to mount.                                                                                                                                                                                                                                                 | -                               |

  ***

  <a id="deletevolumeoptions" />

  ### DeleteVolumeOptions

  Options for [Volume.delete](#delete-2).

  #### Properties

  | Property                                | Type      | Description                                                 |
  | --------------------------------------- | --------- | ----------------------------------------------------------- |
  | <a id="allowmissing" /> `allowMissing?` | `boolean` | Tolerate a volume that is already gone instead of throwing. |

  ***

  <a id="direntry" />

  ### DirEntry

  One entry in a directory listing from `Sailbox.fs.ls`, with `type`
  narrowed to [DirEntryType](#direntrytype-1).

  #### Extends

  * `Omit`\<`native.DirEntry`, `"type"`>

  #### Properties

  | Property                               | Type                              | Description                                                                 | Inherited from      |
  | -------------------------------------- | --------------------------------- | --------------------------------------------------------------------------- | ------------------- |
  | <a id="mode-3" /> `mode`               | `number`                          | Unix permission bits, e.g. `0o644`. The file-type bits are not included.    | `Omit.mode`         |
  | <a id="modifiedtime" /> `modifiedTime` | `number`                          | Last-modified time as a Unix timestamp in seconds (with a fractional part). | `Omit.modifiedTime` |
  | <a id="name-9" /> `name`               | `string`                          | The entry's base name, with no directory prefix.                            | `Omit.name`         |
  | <a id="size-2" /> `size`               | `number`                          | Size in bytes as reported by the guest.                                     | `Omit.size`         |
  | <a id="type" /> `type`                 | [`DirEntryType`](#direntrytype-1) | -                                                                           | -                   |

  ***

  <a id="direntrytype-1" />

  ### DirEntryType

  > **DirEntryType** = `"file"` | `"directory"` | `"symlink"` | `"other"`

  The kind of a directory entry, reported for the entry itself: a symlink is
  `"symlink"` regardless of what it points at.

  ***

  <a id="dockerfilecontextdir" />

  ### DockerfileContextDir

  One directory of a Dockerfile build context.

  #### Properties

  | Property                                  | Type     | Description                                                       |
  | ----------------------------------------- | -------- | ----------------------------------------------------------------- |
  | <a id="mode-4" /> `mode?`                 | `number` | Directory mode permission bits; omitted means the default (0755). |
  | <a id="relativepath-1" /> `relativePath?` | `string` | Slash-separated path relative to the context root.                |

  ***

  <a id="dockerfilecontextsymlink" />

  ### DockerfileContextSymlink

  One symbolic link of a Dockerfile build context.

  #### Properties

  | Property                                  | Type     | Description                                                                           |
  | ----------------------------------------- | -------- | ------------------------------------------------------------------------------------- |
  | <a id="relativepath-2" /> `relativePath?` | `string` | Slash-separated path relative to the context root.                                    |
  | <a id="target" /> `target?`               | `string` | Raw link target, exactly as the link stores it; resolved only inside the built image. |

  ***

  <a id="dockerfilefromresolution" />

  ### DockerfileFromResolution

  What one external image reference in a Dockerfile resolved to when an
  image was built.

  #### Properties

  | Property                          | Type     | Description                                                         |
  | --------------------------------- | -------- | ------------------------------------------------------------------- |
  | <a id="digestref" /> `digestRef?` | `string` | The digest-pinned form of the same reference the build used.        |
  | <a id="reference" /> `reference?` | `string` | The reference as the Dockerfile's `FROM` or `COPY --from` names it. |

  ***

  <a id="dockerfileimage" />

  ### DockerfileImage

  Your own Dockerfile built into an image, with its resolved build context.
  A `RUN --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

  | Property                                      | Type                                                       | Description                                                                                                                                                                                                                                                                                                                              |
  | --------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="buildargs" /> `buildArgs?`             | `Record`\<`string`, `string`>                              | Values for the Dockerfile's `ARG` instructions, like `--build-arg`. Names may not start with the reserved `BUILDKIT_` prefix, and Docker's proxy names (`HTTP_PROXY`, `HTTPS_PROXY`, `FTP_PROXY`, `NO_PROXY`, `ALL_PROXY`, in any letter case) are rejected; a step that needs a proxy can set one inside its `RUN` command.             |
  | <a id="contextdirs" /> `contextDirs?`         | [`DockerfileContextDir`](#dockerfilecontextdir)\[]         | Every directory in the context with its mode, so `COPY` of an empty directory works and directory modes survive like they do in a docker build.                                                                                                                                                                                          |
  | <a id="contextfiles" /> `contextFiles?`       | [`AddLocalDirFile`](#addlocaldirfile)\[]                   | Content manifest of the build context the Dockerfile's `COPY` and `ADD` instructions read from; empty builds without a context.                                                                                                                                                                                                          |
  | <a id="contextsymlinks" /> `contextSymlinks?` | [`DockerfileContextSymlink`](#dockerfilecontextsymlink)\[] | Symbolic links in the context, carried as links the way a docker build context carries them.                                                                                                                                                                                                                                             |
  | <a id="dockerfile" /> `dockerfile?`           | `string`                                                   | Full Dockerfile text.                                                                                                                                                                                                                                                                                                                    |
  | <a id="pinnedfrom" /> `pinnedFrom?`           | [`DockerfileFromResolution`](#dockerfilefromresolution)\[] | The version each external image reference resolved to when this spec was built, filled in on the spec a completed build returns. A spec carrying these keeps naming the image its build produced, even after a forced build moves what the references mean for your organization; a forced build looks every reference up again instead. |

  ***

  <a id="dockerfilesourceinput" />

  ### DockerfileSourceInput

  A Dockerfile to build into the image, with its local build context.
  A `RUN --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

  | Property                             | Type                          | Description                                                                                                                                                                                                                                                                                                                  |
  | ------------------------------------ | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="buildargs-1" /> `buildArgs?`  | `Record`\<`string`, `string`> | Values for the Dockerfile's `ARG` instructions, like `--build-arg`. Names may not start with the reserved `BUILDKIT_` prefix, and Docker's proxy names (`HTTP_PROXY`, `HTTPS_PROXY`, `FTP_PROXY`, `NO_PROXY`, `ALL_PROXY`, in any letter case) are rejected; a step that needs a proxy can set one inside its `RUN` command. |
  | <a id="contextdir" /> `contextDir?`  | `string`                      | Local directory the Dockerfile's `COPY` and `ADD` instructions read from; if omitted, the build runs without a context.                                                                                                                                                                                                      |
  | <a id="dockerfile-1" /> `dockerfile` | `string`                      | Path to a Dockerfile on this machine, or with `isContents` its full contents.                                                                                                                                                                                                                                                |
  | <a id="ignore-1" /> `ignore?`        | `string`\[]                   | `.dockerignore`-style patterns to skip in the context directory, applied after the `.dockerignore` rules in effect so they take precedence on conflict.                                                                                                                                                                      |
  | <a id="iscontents" /> `isContents?`  | `boolean`                     | Read `dockerfile` as literal Dockerfile text instead of a path.                                                                                                                                                                                                                                                              |

  ***

  <a id="enablesshoptions" />

  ### EnableSshOptions

  Options for enabling SSH on a Sailbox.

  #### Properties

  | Property                                      | Type                 | Description                                                                                                                                                                                                 |
  | --------------------------------------------- | -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="allowlist" /> `allowlist?`             | readonly `string`\[] | Source addresses or ranges allowed to reach port 22, replacing any existing restriction. Left empty, a first enable opens the port to any source, and a re-enable leaves an existing restriction unchanged. |
  | <a id="timeoutseconds-1" /> `timeoutSeconds?` | `number`             | Give up waiting after this many seconds (default 60; `Infinity` waits indefinitely).                                                                                                                        |
  | <a id="wait-1" /> `wait?`                     | `boolean`            | Poll until the SSH route is ready (default true).                                                                                                                                                           |

  ***

  <a id="execoptions" />

  ### ExecOptions

  #### Extends

  * `Omit`\<`native.ExecStartOptions`, `"env"` | `"outputMode"` | `"pty"` | `"term"` | `"cols"` | `"rows"`>

  #### Properties

  | Property                                          | Type                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Inherited from           |
  | ------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ |
  | <a id="background" /> `background?`               | `boolean`                                  | Detach the command so it keeps running and the call returns immediately; output is discarded (shell commands only, incompatible with `openStdin`/`pty`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | `Omit.background`        |
  | <a id="cwd" /> `cwd?`                             | `string`                                   | Working directory to run the command in (shell commands only). Unset starts the command in the image's working directory, or `/` when the image does not set one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | `Omit.cwd`               |
  | <a id="env-1" /> `env?`                           | `Readonly`\<`Record`\<`string`, `string`>> | Extra environment for the command. Entries override the guest's defaults (including `LANG` and the `IS_SANDBOX=1` sandbox marker) and the image env, but a few reserved variables that identify the Sailbox (such as `SAILBOX_ID`) cannot be overridden.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | -                        |
  | <a id="idempotencykey" /> `idempotencyKey?`       | `string`                                   | Stable key so a reconnect reattaches to the same command. An exec has one live handle at a time: a second handle started with the same key takes over the stream, and the first stops receiving live output and resolves from a bounded recorded result. A first handle reconnecting after a dropped connection can race a handle that attached meanwhile, and either handle's result may come back incomplete; avoid overlapping same-key handles. The UTF-8 value can be up to 256 KiB.                                                                                                                                                                                                                                                                                        | `Omit.idempotencyKey`    |
  | <a id="openstdin" /> `openStdin?`                 | `boolean`                                  | Leave stdin open for `writeStdin`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | `Omit.openStdin`         |
  | <a id="outputbufferbytes" /> `outputBufferBytes?` | `number`                                   | Size of each stream's output buffer in bytes, 1 MiB by default. Must be between 64 KiB and 64 MiB.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | `Omit.outputBufferBytes` |
  | <a id="outputmode" /> `outputMode?`               | [`OutputMode`](#outputmode-1)              | What happens when a stream's output buffer fills; see [OutputMode](#outputmode-1). `"auto"` by default.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          | -                        |
  | <a id="pty" /> `pty?`                             | `boolean` \| [`PtyConfig`](#ptyconfig)     | Run the command under a pseudo-terminal: `true` for the default terminal, or a [PtyConfig](#ptyconfig) to set `term` and the initial window. `isatty()` is true, control bytes on stdin become signals, stdout and stderr merge onto one stream, and `resize` adjusts the window. Implies `openStdin`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           | -                        |
  | <a id="timeoutseconds-2" /> `timeoutSeconds?`     | `number`                                   | Wall-clock limit in seconds before the server kills the command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | `Omit.timeoutSeconds`    |
  | <a id="user" /> `user?`                           | `string`                                   | Run the command as this guest user: a user name or numeric uid, optionally with a group appended after a colon (`"alice"`, `"1000"`, `"alice:staff"`, the Docker `USER` syntax). A named user must exist in the Sailbox's `/etc/passwd`; a numeric uid need not. `HOME` (and `USER`/`LOGNAME` when a name resolves) default to the resolved account, with `env` entries still winning. When unset, commands run as the image's `USER` if the image sets one, root otherwise; pass `"0:0"` to force root (`"root"` is a user name like any other, resolved through the Sailbox's `/etc/passwd`). Sailboxes created before user support shipped must call `upgrade()` once first; until then such execs fail rather than run as root. The exact spelling `"0:0"` needs no upgrade. | `Omit.user`              |

  ***

  <a id="execresult" />

  ### ExecResult

  The result of a finished exec.

  `stdout` and `stderr` hold only each stream's buffer, its most recent
  output (`outputBufferBytes`, 1 MiB by default). To get every byte, consume
  the live stream right after `exec()` returns; see `ExecProcess` for how
  consuming a stream affects the command.

  #### Properties

  | Property                                     | Type      | Description                                                                                              |
  | -------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------- |
  | <a id="exitcode" /> `exitCode`               | `number`  | The command's exit code.                                                                                 |
  | <a id="stderr-1" /> `stderr`                 | `string`  | The most recent standard error, up to the exec's buffer size (1 MiB by default; see `stderrTruncated`).  |
  | <a id="stderrtruncated" /> `stderrTruncated` | `boolean` | The command wrote more stderr than `stderr` holds, so older bytes are missing.                           |
  | <a id="stdout-1" /> `stdout`                 | `string`  | The most recent standard output, up to the exec's buffer size (1 MiB by default; see `stdoutTruncated`). |
  | <a id="stdouttruncated" /> `stdoutTruncated` | `boolean` | The command wrote more stdout than `stdout` holds, so older bytes are missing.                           |
  | <a id="timedout" /> `timedOut`               | `boolean` | Whether the command was killed for exceeding its timeout.                                                |

  ***

  <a id="exposeoptions" />

  ### ExposeOptions

  Options for [Sailbox.expose](#expose).

  #### Properties

  | Property                            | Type                                  | Description                                                                                                                                                                                                                                                                                                                     |
  | ----------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="allowlist-1" /> `allowlist?` | readonly `string`\[]                  | Sources allowed to reach the port: an address or a range, or a Sail app name on an `http` listener. An app name cannot read as an address or a range, and cannot contain a `/`. An address must not carry an IPv6 zone, such as `fe80::1%eth0`, which names an interface on one machine rather than a source. Empty allows all. |
  | <a id="protocol" /> `protocol?`     | [`IngressProtocol`](#ingressprotocol) | Wire protocol to expose (default `"http"`).                                                                                                                                                                                                                                                                                     |

  ***

  <a id="findappoptions" />

  ### FindAppOptions

  Options for [App.find](#find).

  #### Extends

  * [`ClientOptions`](#clientoptions)

  #### Properties

  | Property                                  | Type                | Description                                             | Inherited from                                          |
  | ----------------------------------------- | ------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
  | <a id="client-4" /> `client?`             | [`Client`](#client) | Use a specific client instead of the default (env) one. | [`ClientOptions`](#clientoptions).[`client`](#client-2) |
  | <a id="mintifmissing" /> `mintIfMissing?` | `boolean`           | Create the app when it does not exist yet.              | -                                                       |

  ***

  <a id="findvolumeoptions" />

  ### FindVolumeOptions

  Options for [Volume.find](#find-1).

  #### Extends

  * [`ClientOptions`](#clientoptions)

  #### Properties

  | Property                                    | Type                | Description                                             | Inherited from                                          |
  | ------------------------------------------- | ------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
  | <a id="client-5" /> `client?`               | [`Client`](#client) | Use a specific client instead of the default (env) one. | [`ClientOptions`](#clientoptions).[`client`](#client-2) |
  | <a id="mintifmissing-1" /> `mintIfMissing?` | `boolean`           | Create the volume when it does not exist yet.           | -                                                       |

  ***

  <a id="fromcheckpointoptions" />

  ### FromCheckpointOptions

  Options for [Sailbox.fromCheckpoint](#fromcheckpoint).

  #### Extends

  * [`FromCheckpointRequest`](#fromcheckpointrequest).[`ClientOptions`](#clientoptions)

  #### Properties

  | Property                                      | Type                | Description                                                                                                                                                                                                                                                                                                                  | Inherited from                                                                          |
  | --------------------------------------------- | ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
  | <a id="checkpointid" /> `checkpointId`        | `string`            | The checkpoint to restore from.                                                                                                                                                                                                                                                                                              | [`FromCheckpointRequest`](#fromcheckpointrequest).[`checkpointId`](#checkpointid-1)     |
  | <a id="client-6" /> `client?`                 | [`Client`](#client) | Use a specific client instead of the default (env) one.                                                                                                                                                                                                                                                                      | [`ClientOptions`](#clientoptions).[`client`](#client-2)                                 |
  | <a id="name-10" /> `name`                     | `string`            | Name for the new Sailbox.                                                                                                                                                                                                                                                                                                    | [`FromCheckpointRequest`](#fromcheckpointrequest).[`name`](#name-11)                    |
  | <a id="timeoutseconds-3" /> `timeoutSeconds?` | `number`            | Whole seconds, positive when given. Bounds the call, since restoring a checkpoint can block for many minutes while the new Sailbox queues for capacity. A call that times out fails, and the restore may still finish in the background; the new Sailbox then shows up when you list Sailboxes. Unset waits without a bound. | [`FromCheckpointRequest`](#fromcheckpointrequest).[`timeoutSeconds`](#timeoutseconds-4) |

  ***

  <a id="fromcheckpointrequest" />

  ### FromCheckpointRequest

  The create-from-checkpoint request.

  #### Extended by

  * [`FromCheckpointOptions`](#fromcheckpointoptions)

  #### Properties

  | Property                                      | Type     | Description                                                                                                                                                                                                                                                                                                                  |
  | --------------------------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="checkpointid-1" /> `checkpointId`      | `string` | The checkpoint to restore from.                                                                                                                                                                                                                                                                                              |
  | <a id="name-11" /> `name`                     | `string` | Name for the new Sailbox.                                                                                                                                                                                                                                                                                                    |
  | <a id="timeoutseconds-4" /> `timeoutSeconds?` | `number` | Whole seconds, positive when given. Bounds the call, since restoring a checkpoint can block for many minutes while the new Sailbox queues for capacity. A call that times out fails, and the restore may still finish in the background; the new Sailbox then shows up when you list Sailboxes. Unset waits without a bound. |

  ***

  <a id="fromdockerfileoptions" />

  ### FromDockerfileOptions

  Options for [Image.fromDockerfile](#fromdockerfile).

  #### Properties

  | Property                                  | Type                                       | Description                                                                                                                                                                                                                                                                                                                  |
  | ----------------------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="architecture-1" /> `architecture?` | [`ImageArchitecture`](#imagearchitecture)  | Target CPU architecture the image is built for (default `amd64`).                                                                                                                                                                                                                                                            |
  | <a id="buildargs-2" /> `buildArgs?`       | `Readonly`\<`Record`\<`string`, `string`>> | Values for the Dockerfile's `ARG` instructions, like `--build-arg`. Names may not start with the reserved `BUILDKIT_` prefix, and Docker's proxy names (`HTTP_PROXY`, `HTTPS_PROXY`, `FTP_PROXY`, `NO_PROXY`, `ALL_PROXY`, in any letter case) are rejected; a step that needs a proxy can set one inside its `RUN` command. |
  | <a id="contextdir-1" /> `contextDir?`     | `string`                                   | Local directory the Dockerfile's `COPY` and `ADD` instructions read from; if omitted, the build runs without a context.                                                                                                                                                                                                      |
  | <a id="ignore-2" /> `ignore?`             | readonly `string`\[]                       | `.dockerignore`-style patterns to skip in the context directory, applied after the `.dockerignore` rules in effect so they take precedence on conflict.                                                                                                                                                                      |

  ***

  <a id="fromregistryoptions" />

  ### FromRegistryOptions

  Options for [Image.fromRegistry](#fromregistry).

  #### Properties

  | Property                                  | Type                                      | Description                                                                                                                     |
  | ----------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="architecture-2" /> `architecture?` | [`ImageArchitecture`](#imagearchitecture) | Require the image to have been built for this CPU architecture. Leave it unset to use the architecture the image was built for. |

  ***

  <a id="fsoptions" />

  ### FsOptions

  Options for the directory helpers ([SailboxFs.mkdir](#mkdir),
  [SailboxFs.remove](#remove), [SailboxFs.exists](#exists), [SailboxFs.ls](#ls)).

  #### Properties

  | Property                  | Type     | Description                                                    |             |                                                                                                                                                                                                                                                                                                             |
  | ------------------------- | -------- | -------------------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="user-1" /> `user?` | `string` | Run the operation as this user (Docker's `USER` syntax: \`name | uid\[:group | gid]`), with its permissions enforced by the guest kernel. Unset runs as root, so the helpers work on any path; `"0:0"`is always root. A`user`other than`"0:0"\` requires a Sailbox whose guest honors requested users; on older Sailboxes the operation fails until [Sailbox.upgrade](#upgrade) is called. |

  ***

  <a id="httpendpoint" />

  ### HttpEndpoint

  The routable HTTPS address of an `http` listener.

  #### Properties

  | Property               | Type     | Description                               |
  | ---------------------- | -------- | ----------------------------------------- |
  | <a id="kind" /> `kind` | `"http"` | -                                         |
  | <a id="url" /> `url`   | `string` | The HTTPS URL to reach the guest service. |

  ***

  <a id="httppolicyaddchange" />

  ### HttpPolicyAddChange

  > **HttpPolicyAddChange** = \{ `headers`: [`HttpPolicyValueMap`](#httppolicyvaluemap); `query?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); } | \{ `headers?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); `query`: [`HttpPolicyValueMap`](#httppolicyvaluemap); }

  Headers or query parameters to append to a request. At least one of
  `headers` or `query` is required, and the union encodes that, so an empty
  `add` is a compile error.

  ***

  <a id="httppolicydocument-1" />

  ### HttpPolicyDocument

  > **HttpPolicyDocument** = `object`

  A policy document: host patterns mapped to their rules.

  A key is an exact hostname (`api.example.com`), a single-label wildcard
  (`*.example.com`), or the catch-all `*`. Sail picks one host, most
  specific first, and host entries never combine.

  ```ts theme={null}
  const document: HttpPolicyDocument = {
    "api.example.com": {
      rules: [
        {
          match: { path: { prefix: "/v1/" } },
          request: {
            set: { headers: { authorization: "Bearer ${secrets.API_KEY}" } },
          },
        },
      ],
    },
  };
  ```

  Sail validates the document when you create the policy and identifies any
  field that needs to be fixed. See the
  [HTTP policy guide](/sailboxes-http-policies) for the accepted fields and
  examples.

  #### Index Signature

  \[`host`: `string`]: [`HttpPolicyHost`](#httppolicyhost)

  ***

  <a id="httppolicyforward" />

  ### HttpPolicyForward

  Send the request to a different HTTPS host. `host` is an exact hostname;
  `port` defaults to 443.

  #### Properties

  | Property                | Type     | Description                                          |
  | ----------------------- | -------- | ---------------------------------------------------- |
  | <a id="host" /> `host`  | `string` | Exact hostname, without a scheme, port, or wildcard. |
  | <a id="port" /> `port?` | `number` | HTTPS port. Defaults to 443.                         |

  ***

  <a id="httppolicyhost" />

  ### HttpPolicyHost

  The rules for one host, in order.

  #### Properties

  | Property                                | Type                                            | Description                                                                                                                                                                                                                                                                                                                                     |
  | --------------------------------------- | ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="missing_alpn" /> `missing_alpn?` | `"http/1.1"`                                    | How to treat an HTTPS connection that does not announce an HTTP version when it connects. By default such a connection passes through with the policy not applied. Set `"http/1.1"` to treat it as HTTP/1.1 so the rules apply. Allowed only on an exact host. Almost every HTTP client announces a version, so most policies do not need this. |
  | <a id="rules" /> `rules`                | readonly [`HttpPolicyRule`](#httppolicyrule)\[] | Rules for this host, in the order Sail tests them.                                                                                                                                                                                                                                                                                              |

  ***

  <a id="httppolicyinfo" />

  ### HttpPolicyInfo

  A policy's id, name, and document. Timestamps are RFC 3339 strings.

  #### Properties

  | Property                           | Type     | Description                                                                                       |
  | ---------------------------------- | -------- | ------------------------------------------------------------------------------------------------- |
  | <a id="createdat-6" /> `createdAt` | `string` | When the policy was created (RFC 3339).                                                           |
  | <a id="document-1" /> `document`   | `string` | The saved policy document as JSON text: Sail's normalized form of the document given at creation. |
  | <a id="id-4" /> `id`               | `string` | The policy's stable identifier.                                                                   |
  | <a id="name-12" /> `name`          | `string` | The policy's name (the only mutable field).                                                       |
  | <a id="updatedat-4" /> `updatedAt` | `string` | When the policy's name last changed (RFC 3339).                                                   |

  ***

  <a id="httppolicylike" />

  ### HttpPolicyLike

  > **HttpPolicyLike** = [`HttpPolicy`](#httppolicy) | [`HttpPolicySummary`](#httppolicysummary) | `string`

  A policy object, listing summary, or policy id accepted by
  [Sailbox.setHttpPolicy](#sethttppolicy).

  ***

  <a id="httppolicylistitem" />

  ### HttpPolicyListItem

  One HTTP policy returned by [Client.listHttpPolicies](#listhttppolicies).

  #### Properties

  | Property                                                 | Type        | Description                                                 |
  | -------------------------------------------------------- | ----------- | ----------------------------------------------------------- |
  | <a id="attachmentcount" /> `attachmentCount`             | `number`    | How many Sailboxes the policy is currently attached to.     |
  | <a id="createdat-7" /> `createdAt`                       | `string`    | When the policy was created, as an RFC 3339 string.         |
  | <a id="hostcount" /> `hostCount`                         | `number`    | How many hosts the document covers.                         |
  | <a id="id-5" /> `id`                                     | `string`    | The policy's stable identifier.                             |
  | <a id="name-13" /> `name`                                | `string`    | The policy's name.                                          |
  | <a id="referencedsecretnames" /> `referencedSecretNames` | `string`\[] | The secret names the document refers to.                    |
  | <a id="rulecount" /> `ruleCount`                         | `number`    | How many rules the document carries across every host.      |
  | <a id="updatedat-5" /> `updatedAt`                       | `string`    | When the policy's name last changed, as an RFC 3339 string. |

  ***

  <a id="httppolicymatcher" />

  ### HttpPolicyMatcher

  > **HttpPolicyMatcher** = `string` | \{ `equals`: `string`; } | \{ `prefix`: `string`; } | \{ `one_of`: readonly `string`\[]; }

  Match one exact string, a prefix, or one string from a list.
  A plain string is an exact match.

  ***

  <a id="httppolicynamevaluematcher" />

  ### HttpPolicyNameValueMatcher

  > **HttpPolicyNameValueMatcher** = \{ `name`: [`HttpPolicyMatcher`](#httppolicymatcher); `present?`: `true`; `value?`: [`HttpPolicyMatcher`](#httppolicymatcher); } | \{ `name?`: [`HttpPolicyMatcher`](#httppolicymatcher); `present?`: `true`; `value`: [`HttpPolicyMatcher`](#httppolicymatcher); } | \{ `name`: [`HttpPolicyMatcher`](#httppolicymatcher); `present`: `false`; `value?`: `never`; }

  Match a header or query parameter by name, value, or both. Every
  condition needs a `name` or a `value`; `present` defaults to `true`,
  meaning a header or parameter matching the condition must be present.
  Set `present` to `false` with `name` alone to require that name to be
  absent. The union
  encodes those rules, so a condition with neither field, or a `value`
  combined with `present: false`, is a compile error.

  ***

  <a id="httppolicypage" />

  ### HttpPolicyPage

  One page returned by [Client.listHttpPolicies](#listhttppolicies).

  #### Properties

  | Property                     | Type                                           | Description                                       |
  | ---------------------------- | ---------------------------------------------- | ------------------------------------------------- |
  | <a id="hasmore" /> `hasMore` | `boolean`                                      | Whether another page is available.                |
  | <a id="items" /> `items`     | [`HttpPolicyListItem`](#httppolicylistitem)\[] | The policies on this page.                        |
  | <a id="limit" /> `limit`     | `number`                                       | The requested page size.                          |
  | <a id="offset" /> `offset`   | `number`                                       | The requested zero-based offset.                  |
  | <a id="total" /> `total`     | `number`                                       | The number of matching policies across all pages. |

  ***

  <a id="httppolicyremovechange" />

  ### HttpPolicyRemoveChange

  > **HttpPolicyRemoveChange** = \{ `headers`: readonly `string`\[]; `query?`: readonly `string`\[]; } | \{ `headers?`: readonly `string`\[]; `query`: readonly `string`\[]; }

  Header and query parameter names to delete from a request. At least one
  of `headers` or `query` is required, and the union encodes that, so an
  empty `remove` is a compile error.

  ***

  <a id="httppolicyrequestchange" />

  ### HttpPolicyRequestChange

  > **HttpPolicyRequestChange** = \{ `add?`: [`HttpPolicyAddChange`](#httppolicyaddchange); `remove?`: [`HttpPolicyRemoveChange`](#httppolicyremovechange); `set`: [`HttpPolicySetChange`](#httppolicysetchange); } | \{ `add`: [`HttpPolicyAddChange`](#httppolicyaddchange); `remove?`: [`HttpPolicyRemoveChange`](#httppolicyremovechange); `set?`: [`HttpPolicySetChange`](#httppolicysetchange); } | \{ `add?`: [`HttpPolicyAddChange`](#httppolicyaddchange); `remove`: [`HttpPolicyRemoveChange`](#httppolicyremovechange); `set?`: [`HttpPolicySetChange`](#httppolicysetchange); }

  Change the outbound request before it is sent.

  `set` replaces or creates values, `add` appends, `remove` deletes. At
  least one operation is required, and the union encodes that, so an empty
  change is a compile error. Only `set.headers` and `set.query` may contain
  a `${secrets.NAME}` reference.

  ***

  <a id="httppolicyrequestmatch" />

  ### HttpPolicyRequestMatch

  > **HttpPolicyRequestMatch** = \{ `headers?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; `method`: [`HttpPolicyStringList`](#httppolicystringlist); `path?`: [`HttpPolicyMatcher`](#httppolicymatcher); `query?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; } | \{ `headers?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; `method?`: [`HttpPolicyStringList`](#httppolicystringlist); `path`: [`HttpPolicyMatcher`](#httppolicymatcher); `query?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; } | \{ `headers`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; `method?`: [`HttpPolicyStringList`](#httppolicystringlist); `path?`: [`HttpPolicyMatcher`](#httppolicymatcher); `query?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; } | \{ `headers?`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; `method?`: [`HttpPolicyStringList`](#httppolicystringlist); `path?`: [`HttpPolicyMatcher`](#httppolicymatcher); `query`: readonly [`HttpPolicyNameValueMatcher`](#httppolicynamevaluematcher)\[]; }

  The conditions a request must meet for a rule to apply. At least one
  condition is required, and the union encodes that, so an empty `match`
  is a compile error. `method` is one or more case-sensitive HTTP methods,
  such as `GET`; `path` matches the absolute request path; `headers` and
  `query` are condition lists in which every entry must match.

  ***

  <a id="httppolicyresponse" />

  ### HttpPolicyResponse

  Return a response without sending an HTTP request to the destination.

  #### Properties

  | Property                      | Type                                        | Description                                                                               |
  | ----------------------------- | ------------------------------------------- | ----------------------------------------------------------------------------------------- |
  | <a id="body-4" /> `body?`     | `string`                                    | Response body. Set a content-type header when needed. Not allowed with status 204 or 304. |
  | <a id="headers" /> `headers?` | [`HttpPolicyValueMap`](#httppolicyvaluemap) | Headers to return.                                                                        |
  | <a id="status-6" /> `status`  | `number`                                    | HTTP status code to return.                                                               |

  ***

  <a id="httppolicyrule" />

  ### HttpPolicyRule

  > **HttpPolicyRule** = \{ `forward?`: `never`; `match?`: [`HttpPolicyRequestMatch`](#httppolicyrequestmatch); `request?`: `never`; `respond`: [`HttpPolicyResponse`](#httppolicyresponse); } | \{ `forward?`: [`HttpPolicyForward`](#httppolicyforward); `match?`: [`HttpPolicyRequestMatch`](#httppolicyrequestmatch); `request?`: [`HttpPolicyRequestChange`](#httppolicyrequestchange); `respond?`: `never`; }

  One rule. `match` narrows which requests it covers; omitting it matches
  every request, which is only allowed on the last rule. The first matching
  rule decides the outcome, so order matters.

  A rule can return a response without sending the request (`respond`),
  forward the request to another HTTPS host (`forward`), change the request
  before it is sent (`request`), or send it unchanged. `forward` and
  `request` combine; `respond` cannot be combined with either, and the union
  encodes that, so a rule that mixes them is a compile error.

  ***

  <a id="httppolicysetchange" />

  ### HttpPolicySetChange

  > **HttpPolicySetChange** = \{ `headers?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); `path`: `string`; `query?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); } | \{ `headers`: [`HttpPolicyValueMap`](#httppolicyvaluemap); `path?`: `string`; `query?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); } | \{ `headers?`: [`HttpPolicyValueMap`](#httppolicyvaluemap); `path?`: `string`; `query`: [`HttpPolicyValueMap`](#httppolicyvaluemap); }

  Values to replace or create on a request. At least one of `path`,
  `headers`, or `query` is required, and the union encodes that, so an
  empty `set` is a compile error. `path` is a replacement absolute path.

  Values under `headers` and `query` are templates: `${secrets.NAME}` inserts
  a secret, and a literal dollar sign must be written `$$`. Stored secret
  references are allowed only under `headers` and `query`, never in `path`.

  ***

  <a id="httppolicystringlist" />

  ### HttpPolicyStringList

  > **HttpPolicyStringList** = `string` | readonly `string`\[]

  One string or a nonempty list of strings.

  ***

  <a id="httppolicysummary" />

  ### HttpPolicySummary

  A policy as returned by [HttpPolicy.list](#list-1), with usage counts but
  without the document. Fetch the full policy with [HttpPolicy.get](#get).

  #### Properties

  | Property                                                   | Type        | Description                                             |
  | ---------------------------------------------------------- | ----------- | ------------------------------------------------------- |
  | <a id="attachmentcount-1" /> `attachmentCount`             | `number`    | How many Sailboxes the policy is currently attached to. |
  | <a id="createdat-8" /> `createdAt`                         | `Date`      | When the policy was created.                            |
  | <a id="hostcount-1" /> `hostCount`                         | `number`    | How many hosts the document covers.                     |
  | <a id="id-6" /> `id`                                       | `string`    | The policy's stable identifier.                         |
  | <a id="name-14" /> `name`                                  | `string`    | The policy's name.                                      |
  | <a id="referencedsecretnames-1" /> `referencedSecretNames` | `string`\[] | The secret names the document refers to.                |
  | <a id="rulecount-1" /> `ruleCount`                         | `number`    | How many rules the document carries across every host.  |
  | <a id="updatedat-6" /> `updatedAt`                         | `Date`      | When the policy's name last changed.                    |

  ***

  <a id="httppolicyvaluemap" />

  ### HttpPolicyValueMap

  > **HttpPolicyValueMap** = `object`

  Header or query parameter names mapped to one or more values.

  #### Index Signature

  \[`name`: `string`]: [`HttpPolicyStringList`](#httppolicystringlist)

  ***

  <a id="imagearchitecture" />

  ### ImageArchitecture

  > **ImageArchitecture** = `"amd64"` | `"arm64"`

  ***

  <a id="imagebuild-1" />

  ### ImageBuild

  The state of a custom image build.

  #### Extends

  * `Omit`\<`native.ImageBuild`, `"status"`>

  #### Properties

  | Property                                    | Type                                                       | Description                                                                                                                                                                                                                                                                           | Inherited from        |
  | ------------------------------------------- | ---------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
  | <a id="dockerfilepins" /> `dockerfilePins?` | [`DockerfileFromResolution`](#dockerfilefromresolution)\[] | What each external image reference resolved to when the spec's source is a Dockerfile; absent otherwise. Carrying these in the spec's `pinnedFrom` keeps creating from the image this build produced, even after a forced build moves what the references mean for your organization. | `Omit.dockerfilePins` |
  | <a id="errormessage-1" /> `errorMessage?`   | `string`                                                   | Human-readable failure detail; present when `status` is `failed`.                                                                                                                                                                                                                     | `Omit.errorMessage`   |
  | <a id="imageid-1" /> `imageId`              | `string`                                                   | The content-addressed image id.                                                                                                                                                                                                                                                       | `Omit.imageId`        |
  | <a id="resolvedociref" /> `resolvedOciRef?` | `string`                                                   | The digest-pinned form of the spec's registry reference when the spec's source is an OCI image; absent otherwise. Creating from this reference instead of the submitted tag keeps naming the same registry content even if the tag has moved since.                                   | `Omit.resolvedOciRef` |
  | <a id="status-7" /> `status`                | [`ImageBuildStatus`](#imagebuildstatus-1)                  | -                                                                                                                                                                                                                                                                                     | -                     |

  ***

  <a id="imagebuildoptions" />

  ### ImageBuildOptions

  Options for [Image.build](#build).

  #### Properties

  | Property                                      | Type                | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
  | --------------------------------------------- | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="client-7" /> `client?`                 | [`Client`](#client) | Use a specific client instead of the default (env) one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | <a id="forcebuild" /> `forceBuild?`           | `boolean`           | Build the image again even if a build already exists, and wait 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](#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](#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. |
  | <a id="timeoutseconds-5" /> `timeoutSeconds?` | `number`            | Timeout in seconds bounding the whole pipeline, including hashing, uploads, the build, and any automatic retries (default 1800).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

  ***

  <a id="imagebuildstatus-1" />

  ### ImageBuildStatus

  > **ImageBuildStatus** = `"unknown"` | `"queued"` | `"building"` | `"ready"` | `"failed"`

  The status of a custom image build.

  ***

  <a id="imagebuildstep" />

  ### ImageBuildStep

  > **ImageBuildStep** = \{ `addLocalDir?`: `never`; `addLocalFile?`: `never`; `aptInstall`: [`PackageInstall`](#packageinstall); `pipInstall?`: `never`; `runCommand?`: `never`; } | \{ `addLocalDir?`: `never`; `addLocalFile?`: `never`; `aptInstall?`: `never`; `pipInstall`: [`PackageInstall`](#packageinstall); `runCommand?`: `never`; } | \{ `addLocalDir?`: `never`; `addLocalFile?`: `never`; `aptInstall?`: `never`; `pipInstall?`: `never`; `runCommand`: [`RunCommand`](#runcommand-2); } | \{ `addLocalDir?`: `never`; `addLocalFile`: [`AddLocalFile`](#addlocalfile-1); `aptInstall?`: `never`; `pipInstall?`: `never`; `runCommand?`: `never`; } | \{ `addLocalDir`: [`AddLocalDir`](#addlocaldir-1); `addLocalFile?`: `never`; `aptInstall?`: `never`; `pipInstall?`: `never`; `runCommand?`: `never`; }

  One build step: exactly one operation. Each union member `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).

  ***

  <a id="imagedefinition" />

  ### 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

  | Property                                  | Type                                              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | ----------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
  | <a id="architecture-3" /> `architecture?` | `string`                                          | Target CPU architecture: `amd64` or `arm64`. Unset means `amd64` with `base` and `dockerfile`, and with `ociRef` means whichever architecture the registry image was built for (`amd64` when it was built for both). Setting it with `ociRef` requires the image to provide that architecture.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
  | <a id="base" /> `base?`                   | `string`                                          | Base image to build on: `debian` or `devbox`. The devbox base is a prebuilt development environment that includes Docker, with the daemon started automatically when the Sailbox boots and kept running across sleeps. The daemon can take a few seconds to accept commands right after boot. If it stops, it is not restarted automatically. Mutually exclusive with `ociRef` and `dockerfile`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
  | <a id="dockerfile-2" /> `dockerfile?`     | [`DockerfileSourceInput`](#dockerfilesourceinput) | Your own Dockerfile built into the image; mutually exclusive with `base` and `ociRef`. Every image its `FROM` (and `COPY --from`) instructions name 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. A forced build looks the tags up again and builds what they point at now. The built image's `ENV`, `WORKDIR`, and `USER` become the Sailbox defaults for commands you run; its `ENTRYPOINT` and `CMD` are not run, because a Sailbox manages its own processes.                                                                                                                      |
  | <a id="env-2" /> `env?`                   | `Record`\<`string`, `string`>                     | Environment variables baked into the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
  | <a id="ociref" /> `ociRef?`               | `string`                                          | Your own image as the root filesystem: a reference to a Debian- or Ubuntu-based image whose first segment names a supported public registry (`docker.io`, `ghcr.io`, `public.ecr.aws`, or `quay.io`), with an optional `:tag` or `@sha256:<64 hex>` pin (no tag means the `latest` tag). A tag is pinned for your organization once an image has been built from it: later builds keep getting that version, even if the tag moves upstream. A forced build looks the tag up again and moves the pin for your whole organization. If forced builds of the same tag overlap, the last-requested one that succeeds decides what the tag means, no matter which build finishes first. A digest names exactly one image, so it never moves. The image's `ENV`, `WORKDIR`, and `USER` become the Sailbox defaults for commands you run; its `ENTRYPOINT` and `CMD` are not run, because a Sailbox manages its own processes. Mutually exclusive with `base` and `dockerfile`. |
  | <a id="steps" /> `steps?`                 | [`ImageDefinitionStep`](#imagedefinitionstep)\[]  | Ordered build steps.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

  ***

  <a id="imagedefinitionstep" />

  ### ImageDefinitionStep

  One image-definition step. Exactly one of the fields must be set.

  #### Properties

  | Property                                  | Type                                | Description                                 |
  | ----------------------------------------- | ----------------------------------- | ------------------------------------------- |
  | <a id="addlocaldir-2" /> `addLocalDir?`   | [`LocalDirInput`](#localdirinput)   | Bake a local directory tree into the image. |
  | <a id="addlocalfile-2" /> `addLocalFile?` | [`LocalFileInput`](#localfileinput) | Bake one local file into the image.         |
  | <a id="aptinstall-1" /> `aptInstall?`     | `string`\[]                         | Install system packages with apt.           |
  | <a id="pipinstall-1" /> `pipInstall?`     | `string`\[]                         | Install Python packages with pip.           |
  | <a id="runcommand-1" /> `runCommand?`     | `string`                            | Run a shell command during the build.       |

  ***

  <a id="imagespec" />

  ### ImageSpec

  A Sailbox image: a base or registry image plus ordered build steps.

  #### Extends

  * `Omit`\<`native.ImageSpec`, `"base"` | `"buildSteps"` | `"architecture"` | `"filesystem"`>

  #### Properties

  | Property                                  | Type                                      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | Inherited from    |
  | ----------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------- |
  | <a id="architecture-4" /> `architecture?` | [`ImageArchitecture`](#imagearchitecture) | Target CPU architecture. Unset means `amd64` with `base` and `dockerfile`, and with `ociRef` means whichever architecture the registry image was built for (`amd64` when it was built for both). Setting it with `ociRef` requires the image to provide that architecture.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | -                 |
  | <a id="base-1" /> `base?`                 | [`BaseImage`](#baseimage)                 | Base image to build on. The `devbox` base is a prebuilt development environment that includes Docker, with the daemon started automatically when the Sailbox boots and kept running across sleeps. The daemon can take a few seconds to accept commands right after boot. If it stops, it is not restarted automatically. Mutually exclusive with `ociRef` and `dockerfile`.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             | -                 |
  | <a id="buildsteps" /> `buildSteps?`       | [`ImageBuildStep`](#imagebuildstep)\[]    | Ordered build steps applied on top of the image source.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  | -                 |
  | <a id="dockerfile-3" /> `dockerfile?`     | [`DockerfileImage`](#dockerfileimage)     | Your own Dockerfile built into the image; mutually exclusive with `base` and `ociRef`. Every image its `FROM` (and `COPY --from`) instructions name 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. A forced build looks the tags up again and builds what they point at now. The built image's `ENV`, `WORKDIR`, and `USER` become the Sailbox defaults for commands you run; its `ENTRYPOINT` and `CMD` are not run, because a Sailbox manages its own processes.                                                                                                                      | `Omit.dockerfile` |
  | <a id="env-3" /> `env?`                   | `Record`\<`string`, `string`>             | Environment variables baked into the image.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | `Omit.env`        |
  | <a id="ociref-1" /> `ociRef?`             | `string`                                  | Your own image as the root filesystem: a reference to a Debian- or Ubuntu-based image whose first segment names a supported public registry (`docker.io`, `ghcr.io`, `public.ecr.aws`, or `quay.io`), with an optional `:tag` or `@sha256:<64 hex>` pin (no tag means the `latest` tag). A tag is pinned for your organization once an image has been built from it: later builds keep getting that version, even if the tag moves upstream. A forced build looks the tag up again and moves the pin for your whole organization. If forced builds of the same tag overlap, the last-requested one that succeeds decides what the tag means, no matter which build finishes first. A digest names exactly one image, so it never moves. The image's `ENV`, `WORKDIR`, and `USER` become the Sailbox defaults for commands you run; its `ENTRYPOINT` and `CMD` are not run, because a Sailbox manages its own processes. Mutually exclusive with `base` and `dockerfile`. | `Omit.ociRef`     |

  ***

  <a id="ingressportinput" />

  ### IngressPortInput

  A guest port to reserve for ingress at create time.

  #### Extends

  * `Omit`\<`native.IngressPortInput`, `"protocol"` | `"allowlist"`>

  #### Properties

  | Property                            | Type                                  | Description                                                                                                                                                                                                                                                                                                                     | Inherited from   |
  | ----------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------- |
  | <a id="allowlist-2" /> `allowlist?` | readonly `string`\[]                  | Sources allowed to reach the port: an address or a range, or a Sail app name on an `http` listener. An app name cannot read as an address or a range, and cannot contain a `/`. An address must not carry an IPv6 zone, such as `fe80::1%eth0`, which names an interface on one machine rather than a source. Empty allows all. | -                |
  | <a id="guestport" /> `guestPort`    | `number`                              | The in-guest port to expose (1-65535).                                                                                                                                                                                                                                                                                          | `Omit.guestPort` |
  | <a id="protocol-1" /> `protocol`    | [`IngressProtocol`](#ingressprotocol) | `http` or `tcp`.                                                                                                                                                                                                                                                                                                                | -                |

  ***

  <a id="ingressprotocol" />

  ### IngressProtocol

  > **IngressProtocol** = `"tcp"` | `"http"`

  The protocol you request when exposing a port.

  ***

  <a id="ingressscheme-1" />

  ### IngressScheme

  > **IngressScheme** = `"path"` | `"subdomain"`

  How a listener's URL is addressed under `ingressBase`.

  ***

  <a id="listhttppoliciesoptions" />

  ### ListHttpPoliciesOptions

  Options for [HttpPolicy.list](#list-1).

  #### Extends

  * [`ClientOptions`](#clientoptions)

  #### Properties

  | Property                      | Type                | Description                                             | Inherited from                                          |
  | ----------------------------- | ------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
  | <a id="client-8" /> `client?` | [`Client`](#client) | Use a specific client instead of the default (env) one. | [`ClientOptions`](#clientoptions).[`client`](#client-2) |
  | <a id="limit-1" /> `limit?`   | `number`            | Cap the total number of policies returned.              | -                                                       |
  | <a id="search" /> `search?`   | `string`            | Filter by id or name, case-insensitively.               | -                                                       |

  ***

  <a id="listsailboxesoptions" />

  ### ListSailboxesOptions

  Options for [Sailbox.list](#list-2): the server-side filters, a total-cap
  `limit`, and an optional `client`.

  #### Extends

  * `Omit`\<[`ListSailboxesQuery`](#listsailboxesquery), `"limit"` | `"offset"`>.[`ClientOptions`](#clientoptions)

  #### Properties

  | Property                      | Type                                          | Description                                                                                                                      | Inherited from                                                                |
  | ----------------------------- | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
  | <a id="appid-3" /> `appId?`   | `string`                                      | Filter to one app by its id.                                                                                                     | `Omit.appId`                                                                  |
  | <a id="client-9" /> `client?` | [`Client`](#client)                           | Use a specific client instead of the default (env) one.                                                                          | [`ClientOptions`](#clientoptions).[`client`](#client-2)                       |
  | <a id="limit-2" /> `limit?`   | `number`                                      | Cap on the total number of Sailboxes returned, bounding the fetch for large orgs; omit to fetch every match.                     | -                                                                             |
  | <a id="order" /> `order?`     | [`SailboxListOrder`](#sailboxlistorder)       | Result ordering; `"newest_active"` (most recently active first) when omitted; `"newest_created"` lists the newest-created first. | [`ListSailboxesPageOptions`](#listsailboxespageoptions).[`order`](#order-1)   |
  | <a id="search-1" /> `search?` | `string`                                      | Substring filter on the Sailbox name.                                                                                            | `Omit.search`                                                                 |
  | <a id="status-8" /> `status?` | [`SailboxStatusFilter`](#sailboxstatusfilter) | Filter by lifecycle status.                                                                                                      | [`ListSailboxesPageOptions`](#listsailboxespageoptions).[`status`](#status-9) |

  ***

  <a id="listsailboxespageoptions" />

  ### ListSailboxesPageOptions

  Options for [Sailbox.listPage](#listpage): the same filters as
  [ListSailboxesOptions](#listsailboxesoptions), plus `limit`/`offset` page selection and an
  optional `client`.

  #### Extends

  * [`ListSailboxesQuery`](#listsailboxesquery).[`ClientOptions`](#clientoptions)

  #### Properties

  | Property                       | Type                                          | Description                                                                                                                      | Inherited from                                                     |
  | ------------------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
  | <a id="appid-4" /> `appId?`    | `string`                                      | Filter to one app by its id.                                                                                                     | [`ListSailboxesQuery`](#listsailboxesquery).[`appId`](#appid-5)    |
  | <a id="client-10" /> `client?` | [`Client`](#client)                           | Use a specific client instead of the default (env) one.                                                                          | [`ClientOptions`](#clientoptions).[`client`](#client-2)            |
  | <a id="limit-3" /> `limit?`    | `number`                                      | Page size.                                                                                                                       | [`ListSailboxesQuery`](#listsailboxesquery).[`limit`](#limit-4)    |
  | <a id="offset-1" /> `offset?`  | `number`                                      | Page offset.                                                                                                                     | [`ListSailboxesQuery`](#listsailboxesquery).[`offset`](#offset-2)  |
  | <a id="order-1" /> `order?`    | [`SailboxListOrder`](#sailboxlistorder)       | Result ordering; `"newest_active"` (most recently active first) when omitted; `"newest_created"` lists the newest-created first. | [`ListSailboxesQuery`](#listsailboxesquery).[`order`](#order-2)    |
  | <a id="search-2" /> `search?`  | `string`                                      | Substring filter on the Sailbox name.                                                                                            | [`ListSailboxesQuery`](#listsailboxesquery).[`search`](#search-3)  |
  | <a id="status-9" /> `status?`  | [`SailboxStatusFilter`](#sailboxstatusfilter) | Filter by lifecycle status.                                                                                                      | [`ListSailboxesQuery`](#listsailboxesquery).[`status`](#status-10) |

  ***

  <a id="listsailboxesquery" />

  ### ListSailboxesQuery

  Filters for listing Sailboxes.

  #### Extends

  * `Omit`\<`native.ListSailboxesQuery`, `"status"` | `"order"`>

  #### Extended by

  * [`ListSailboxesPageOptions`](#listsailboxespageoptions)

  #### Properties

  | Property                       | Type                                          | Description                                                                                                                      | Inherited from |
  | ------------------------------ | --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -------------- |
  | <a id="appid-5" /> `appId?`    | `string`                                      | Filter to one app by its id.                                                                                                     | `Omit.appId`   |
  | <a id="limit-4" /> `limit?`    | `number`                                      | Page size.                                                                                                                       | `Omit.limit`   |
  | <a id="offset-2" /> `offset?`  | `number`                                      | Page offset.                                                                                                                     | `Omit.offset`  |
  | <a id="order-2" /> `order?`    | [`SailboxListOrder`](#sailboxlistorder)       | Result ordering; `"newest_active"` (most recently active first) when omitted; `"newest_created"` lists the newest-created first. | -              |
  | <a id="search-3" /> `search?`  | `string`                                      | Substring filter on the Sailbox name.                                                                                            | `Omit.search`  |
  | <a id="status-10" /> `status?` | [`SailboxStatusFilter`](#sailboxstatusfilter) | Filter by lifecycle status.                                                                                                      | -              |

  ***

  <a id="listvolumesoptions" />

  ### ListVolumesOptions

  Options for [Volume.list](#list-4).

  #### Extends

  * [`ClientOptions`](#clientoptions)

  #### Properties

  | Property                            | Type                | Description                                             | Inherited from                                          |
  | ----------------------------------- | ------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
  | <a id="client-11" /> `client?`      | [`Client`](#client) | Use a specific client instead of the default (env) one. | [`ClientOptions`](#clientoptions).[`client`](#client-2) |
  | <a id="maxobjects" /> `maxObjects?` | `number`            | Maximum number of volumes to return.                    | -                                                       |

  ***

  <a id="listener-1" />

  ### Listener

  An exposed guest port and how to reach it.

  #### Properties

  | Property                             | Type                                            | Description                                                        |
  | ------------------------------------ | ----------------------------------------------- | ------------------------------------------------------------------ |
  | <a id="endpoint" /> `endpoint?`      | [`ListenerEndpoint`](#listenerendpoint-1)       | How to reach the port; `undefined` until the listener is routable. |
  | <a id="guestport-1" /> `guestPort`   | `number`                                        | The in-guest port traffic is forwarded to.                         |
  | <a id="protocol-2" /> `protocol`     | [`Protocol`](#protocol-3)                       | Wire protocol exposed.                                             |
  | <a id="routestatus" /> `routeStatus` | [`ListenerRouteStatus`](#listenerroutestatus-1) | Status of the listener's ingress route.                            |

  ***

  <a id="listenerendpoint-1" />

  ### ListenerEndpoint

  > **ListenerEndpoint** = [`HttpEndpoint`](#httpendpoint) | [`TcpEndpoint`](#tcpendpoint)

  How to reach an exposed listener; discriminate on `kind`.

  ***

  <a id="listenerroutestatus-1" />

  ### ListenerRouteStatus

  > **ListenerRouteStatus** = `"unknown"` | `"pending"` | `"active"` | `"restoring"` | `"unavailable"` | `string` & `object`

  Status of a listener's ingress route (open: tolerates unknown values).

  ***

  <a id="localdirinput" />

  ### LocalDirInput

  A local directory tree to bake into the image (walked, hashed, and
  uploaded at resolve; symlinks skipped, file modes preserved).

  #### Properties

  | Property                              | Type        | Description                                                        |
  | ------------------------------------- | ----------- | ------------------------------------------------------------------ |
  | <a id="ignore-3" /> `ignore?`         | `string`\[] | Gitignore-style patterns to skip.                                  |
  | <a id="ignorefile-1" /> `ignoreFile?` | `string`    | A gitignore-style file whose patterns to skip (e.g. `.gitignore`). |
  | <a id="localpath" /> `localPath`      | `string`    | Path on this machine.                                              |
  | <a id="remotepath-2" /> `remotePath`  | `string`    | Absolute POSIX path of the directory root inside the image.        |

  ***

  <a id="localfileinput" />

  ### LocalFileInput

  One local file to bake into the image (hashed and uploaded at resolve).

  #### Properties

  | Property                             | Type     | Description                                                                       |
  | ------------------------------------ | -------- | --------------------------------------------------------------------------------- |
  | <a id="localpath-1" /> `localPath`   | `string` | Path on this machine.                                                             |
  | <a id="mode-5" /> `mode?`            | `number` | Permission bits (low 9); omitted uses the builder default (0644).                 |
  | <a id="remotepath-3" /> `remotePath` | `string` | Absolute POSIX path inside the image; a trailing `/` appends the source basename. |

  ***

  <a id="networkallowlist" />

  ### NetworkAllowlist

  Restrict the destinations a Sailbox can reach, chosen when it is created
  and fixed for its whole life.

  Each entry is a hostname, a `*.` wildcard hostname (one extra name part),
  an IPv4 address, or an IPv4 range in CIDR form such as `203.0.113.0/24`.
  Give at least one entry and at most 128; a list that breaks the entry rules
  is rejected before the Sailbox is created. Only connections the Sailbox
  opens are limited, so `ingressPorts` and SSH still work. The
  [network policy guide](https://docs.sailresearch.com/sailboxes-network-policy)
  has the entry rules and what each entry allows.

  #### Properties

  | Property                               | Modifier   | Type                 | Description                                           |
  | -------------------------------------- | ---------- | -------------------- | ----------------------------------------------------- |
  | <a id="allowedhosts" /> `allowedHosts` | `readonly` | readonly `string`\[] | The destinations the Sailbox may reach; at least one. |
  | <a id="mode-6" /> `mode`               | `readonly` | `"allowlist"`        | Always `"allowlist"`.                                 |

  ***

  <a id="networkpolicy-4" />

  ### NetworkPolicy

  > **NetworkPolicy** = `"public"` | `"no_network"` | [`NetworkAllowlist`](#networkallowlist)

  How a Sailbox may reach the network, chosen at creation and fixed for its
  life. `"public"` leaves network access open (the default); `"no_network"`
  cuts the Sailbox off from other hosts and the internet, so it cannot make
  outbound connections or expose inbound services and name resolution does not
  work. Running commands is unaffected (`exec` and the shell reach the Sailbox
  over a Sail-internal path, not its network), and mounted volumes and other
  platform features it was created with keep working. A [NetworkAllowlist](#networkallowlist)
  restricts outbound access to a list of destinations instead.

  ***

  <a id="networkpolicyinfo" />

  ### NetworkPolicyInfo

  A Sailbox's network policy as reported by [Sailbox.get](#get-1)/[Sailbox.list](#list-2). `mode` is the raw wire mode (`"no_network"` or `"allowlist"`);
  it is not narrowed to the [NetworkPolicy](#networkpolicy-4) create union, so a mode a
  newer backend adds is reported faithfully. `allowedHosts` carries the
  destinations in allowlist mode. Absent on a snapshot means public.

  The fields are `readonly`: the object a Sailbox returns is frozen, so this
  type matches the runtime and a caller cannot rewrite an audited policy.

  #### Properties

  | Property                                 | Modifier   | Type                 | Description                                                      |
  | ---------------------------------------- | ---------- | -------------------- | ---------------------------------------------------------------- |
  | <a id="allowedhosts-1" /> `allowedHosts` | `readonly` | readonly `string`\[] | Allowlist destinations when the mode uses them; empty otherwise. |
  | <a id="mode-7" /> `mode`                 | `readonly` | `string`             | The policy mode, for example `"no_network"`.                     |

  ***

  <a id="neversleep" />

  ### NeverSleep

  Stop Sail sleeping a Sailbox on its own. `minSecondsBeforeSleep` belongs to
  [AutomaticSleep](#automaticsleep), so it cannot be combined with this.

  #### Properties

  | Property                                                    | Modifier   | Type        | Description                                 |
  | ----------------------------------------------------------- | ---------- | ----------- | ------------------------------------------- |
  | <a id="automatic-1" /> `automatic`                          | `readonly` | `false`     | Stop Sail sleeping this Sailbox on its own. |
  | <a id="minsecondsbeforesleep-1" /> `minSecondsBeforeSleep?` | `readonly` | `undefined` | -                                           |

  ***

  <a id="outputmode-1" />

  ### OutputMode

  > **OutputMode** = `"auto"` | `"pipe"` | `"tail"`

  What happens when a stream's output buffer fills. Each stream has its own
  buffer, 1 MiB by default (`outputBufferBytes` in [ExecOptions](#execoptions)).
  Sending `cancel()`, and the exec timeout, end every pause: from then on
  each stream keeps only its most recent bytes, so a consumer more than a
  buffer behind skips. A command that ignores the cancel signal keeps running
  that way; `cancel({ force: true })` stops it. The command keeps its
  original timeout. If this handle attaches to a command launched earlier
  under the same `idempotencyKey`, this handle's pause deadline starts when
  the attachment succeeds, so it can release the pauses one full timeout
  after that; `cancel()` and `close()` release them at once.

  * `"auto"`, the default: a stream you are consuming pauses the command when
    its buffer fills and resumes as you read, like a pipe; a stream you are
    not consuming never pauses the command and keeps only its most recent
    bytes.
  * `"pipe"`: both streams pause the command when their buffer fills, until
    you consume them, so nothing is lost while you are late to start.
    Consume both streams, or the command stays paused on the one you ignore.
    Once a stream is released, it goes back to keeping only its most recent
    bytes. Not available with `pty`.
  * `"tail"`: the command never pauses for you. Each stream keeps only its
    most recent bytes, even while you are consuming it, so a slow consumer
    skips output without notice; `stdoutTruncated` and `stderrTruncated`
    say only that the result holds less than the command wrote. A pty
    command always behaves this way.

  ***

  <a id="packageinstall" />

  ### PackageInstall

  A set of packages to install (apt or pip).

  #### Properties

  | Property                        | Type        | Description    |
  | ------------------------------- | ----------- | -------------- |
  | <a id="packages" /> `packages?` | `string`\[] | Package names. |

  ***

  <a id="protocol-3" />

  ### Protocol

  > **Protocol** = `"tcp"` | `"http"` | `string` & `object`

  The protocol reported on a listener (open: tolerates unknown values).

  ***

  <a id="ptyconfig" />

  ### PtyConfig

  The pseudo-terminal a `pty` exec runs under. Every field has a default, so
  `{}` (or `pty: true`) is a usable terminal.

  #### Properties

  | Property                | Type     | Description                                     |
  | ----------------------- | -------- | ----------------------------------------------- |
  | <a id="cols" /> `cols?` | `number` | Initial width in columns (default 80).          |
  | <a id="rows" /> `rows?` | `number` | Initial height in rows (default 24).            |
  | <a id="term" /> `term?` | `string` | `$TERM` for the pty (default `xterm-256color`). |

  ***

  <a id="resolvedconfig" />

  ### ResolvedConfig

  The config resolved from the environment and `~/.sail`.

  #### Extends

  * `Omit`\<`native.ResolvedConfig`, `"ingressScheme"` | `"mode"`>

  #### Properties

  | Property                                   | Type                                | Description                                           | Inherited from       |
  | ------------------------------------------ | ----------------------------------- | ----------------------------------------------------- | -------------------- |
  | <a id="apikey-1" /> `apiKey?`              | `string`                            | The resolved API key; absent when none is configured. | `Omit.apiKey`        |
  | <a id="apiurl-1" /> `apiUrl`               | `string`                            | Sail API URL.                                         | `Omit.apiUrl`        |
  | <a id="ingressbase" /> `ingressBase`       | `string`                            | Base host/URL public listeners are addressed under.   | `Omit.ingressBase`   |
  | <a id="ingressscheme" /> `ingressScheme`   | [`IngressScheme`](#ingressscheme-1) | -                                                     | -                    |
  | <a id="sailboxapiurl-1" /> `sailboxApiUrl` | `string`                            | Sailbox-API URL.                                      | `Omit.sailboxApiUrl` |

  ***

  <a id="runcommand-2" />

  ### RunCommand

  A shell command to run during the build.

  #### Properties

  | Property                      | Type     | Description                               |
  | ----------------------------- | -------- | ----------------------------------------- |
  | <a id="command" /> `command?` | `string` | The command, run via the builder's shell. |

  ***

  <a id="runoptions" />

  ### RunOptions

  Options for [Sailbox.run](#run): the subset of [ExecOptions](#execoptions) that fits
  a buffered, run-to-completion command.

  #### Extends

  * `Pick`\<[`ExecOptions`](#execoptions), `"timeoutSeconds"` | `"cwd"` | `"env"` | `"user"` | `"idempotencyKey"` | `"outputBufferBytes"`>

  #### Properties

  | Property                                            | Type                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      | Inherited from                                |
  | --------------------------------------------------- | ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
  | <a id="check" /> `check?`                           | `boolean`                                  | Reject with `CommandFailedError` (carrying the completed result) when the command exits nonzero or times out, instead of resolving.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              | -                                             |
  | <a id="cwd-1" /> `cwd?`                             | `string`                                   | Working directory to run the command in (shell commands only). Unset starts the command in the image's working directory, or `/` when the image does not set one.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                | `Pick.cwd`                                    |
  | <a id="env-4" /> `env?`                             | `Readonly`\<`Record`\<`string`, `string`>> | Extra environment for the command. Entries override the guest's defaults (including `LANG` and the `IS_SANDBOX=1` sandbox marker) and the image env, but a few reserved variables that identify the Sailbox (such as `SAILBOX_ID`) cannot be overridden.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         | [`ExecOptions`](#execoptions).[`env`](#env-1) |
  | <a id="idempotencykey-1" /> `idempotencyKey?`       | `string`                                   | Stable key so a reconnect reattaches to the same command. An exec has one live handle at a time: a second handle started with the same key takes over the stream, and the first stops receiving live output and resolves from a bounded recorded result. A first handle reconnecting after a dropped connection can race a handle that attached meanwhile, and either handle's result may come back incomplete; avoid overlapping same-key handles. The UTF-8 value can be up to 256 KiB.                                                                                                                                                                                                                                                                                        | `Pick.idempotencyKey`                         |
  | <a id="outputbufferbytes-1" /> `outputBufferBytes?` | `number`                                   | Size of each stream's output buffer in bytes, 1 MiB by default. Must be between 64 KiB and 64 MiB.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               | `Pick.outputBufferBytes`                      |
  | <a id="signal" /> `signal?`                         | `AbortSignal`                              | Aborting rejects with the signal's reason and force-cancels the remote command (SIGKILL, like [ExecProcess.cancel](#cancel) with `force`), briefly retrying transient failures. Best effort: the kill is sent once the submission settles (an abort mid-submission cancels the command as soon as its launch is confirmed), and a kill that still fails leaves the command running.                                                                                                                                                                                                                                                                                                                                                                                              | -                                             |
  | <a id="timeoutseconds-6" /> `timeoutSeconds?`       | `number`                                   | Wall-clock limit in seconds before the server kills the command.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 | `Pick.timeoutSeconds`                         |
  | <a id="user-2" /> `user?`                           | `string`                                   | Run the command as this guest user: a user name or numeric uid, optionally with a group appended after a colon (`"alice"`, `"1000"`, `"alice:staff"`, the Docker `USER` syntax). A named user must exist in the Sailbox's `/etc/passwd`; a numeric uid need not. `HOME` (and `USER`/`LOGNAME` when a name resolves) default to the resolved account, with `env` entries still winning. When unset, commands run as the image's `USER` if the image sets one, root otherwise; pass `"0:0"` to force root (`"root"` is a user name like any other, resolved through the Sailbox's `/etc/passwd`). Sailboxes created before user support shipped must call `upgrade()` once first; until then such execs fail rather than run as root. The exact spelling `"0:0"` needs no upgrade. | `Pick.user`                                   |

  ***

  <a id="sailboxcheckpoint-1" />

  ### SailboxCheckpoint

  A durable checkpoint handle.

  #### Extends

  * `Omit`\<`native.SailboxCheckpoint`, `"status"` | `"expiresAt"`>

  #### Properties

  | Property                                                 | Type                                | Description                                                                                                                         | Inherited from              |
  | -------------------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | --------------------------- |
  | <a id="checkpointgeneration-1" /> `checkpointGeneration` | `number`                            | Checkpoint generation captured by this checkpoint.                                                                                  | `Omit.checkpointGeneration` |
  | <a id="checkpointid-2" /> `checkpointId`                 | `string`                            | The checkpoint id.                                                                                                                  | `Omit.checkpointId`         |
  | <a id="expiresat" /> `expiresAt?`                        | `Date`                              | When the checkpoint expires: seven days out unless a TTL asked for a different window. Starting a Sailbox from it after that fails. | -                           |
  | <a id="sailboxid-1" /> `sailboxId`                       | `string`                            | The Sailbox the checkpoint was taken from.                                                                                          | `Omit.sailboxId`            |
  | <a id="status-11" /> `status`                            | [`SailboxStatus`](#sailboxstatus-1) | -                                                                                                                                   | -                           |

  ***

  <a id="sailboxdeprecation-1" />

  ### SailboxDeprecation

  > **SailboxDeprecation** = `native.SailboxDeprecation`

  Actionable notice that a Sailbox's runtime should be upgraded: a `deadline`
  date and a `message` with upgrade instructions.

  ***

  <a id="sailboxhandle" />

  ### SailboxHandle

  Returned by create / resume / fromCheckpoint: the Sailbox's identity and
  lifecycle status.

  #### Properties

  | Property                           | Type                                | Description                                           |
  | ---------------------------------- | ----------------------------------- | ----------------------------------------------------- |
  | <a id="name-15" /> `name`          | `string`                            | The caller-supplied Sailbox name.                     |
  | <a id="sailboxid-2" /> `sailboxId` | `string`                            | The Sailbox's stable identifier.                      |
  | <a id="status-12" /> `status`      | [`SailboxStatus`](#sailboxstatus-1) | Lifecycle status at the time the operation completed. |

  ***

  <a id="sailboxinfo" />

  ### SailboxInfo

  A read snapshot of a Sailbox (get / list). Timestamps are RFC 3339 strings.

  #### Extends

  * `Omit`\<`native.SailboxInfo`, `"status"` | `"autoSleep"` | `"networkPolicy"`>

  #### Properties

  | Property                                                 | Modifier   | Type                                      | Description                                                                                                          | Inherited from              |
  | -------------------------------------------------------- | ---------- | ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | --------------------------- |
  | <a id="appid-6" /> `appId`                               | `public`   | `string`                                  | Identifier of the owning app.                                                                                        | `Omit.appId`                |
  | <a id="appname-2" /> `appName`                           | `public`   | `string`                                  | Name of the owning app.                                                                                              | `Omit.appName`              |
  | <a id="architecture-5" /> `architecture`                 | `public`   | `string`                                  | CPU architecture (for example `arm64`).                                                                              | `Omit.architecture`         |
  | <a id="autosleep-3" /> `autoSleep?`                      | `public`   | [`AutoSleep`](#autosleep-4)               | When Sail may sleep this Sailbox on its own.                                                                         | -                           |
  | <a id="checkpointgeneration-2" /> `checkpointGeneration` | `public`   | `number`                                  | Monotonic checkpoint generation counter.                                                                             | `Omit.checkpointGeneration` |
  | <a id="cpurequestedvcpu-1" /> `cpuRequestedVcpu`         | `public`   | `number`                                  | Requested CPU, in vCPUs.                                                                                             | `Omit.cpuRequestedVcpu`     |
  | <a id="cpuusedvcpu-1" /> `cpuUsedVcpu`                   | `public`   | `number`                                  | Current CPU usage, in vCPUs.                                                                                         | `Omit.cpuUsedVcpu`          |
  | <a id="createdat-9" /> `createdAt`                       | `public`   | `string`                                  | When the Sailbox was created (RFC 3339).                                                                             | `Omit.createdAt`            |
  | <a id="createdbyuserid-1" /> `createdByUserId?`          | `public`   | `string`                                  | The user whose credential created this Sailbox (for a restore, the user who ran it). Absent for service-key creates. | `Omit.createdByUserId`      |
  | <a id="deprecation-1" /> `deprecation?`                  | `public`   | `SailboxDeprecation`                      | Actionable runtime deprecation notice, when an upgrade is needed.                                                    | `Omit.deprecation`          |
  | <a id="diskrequestedbytes-1" /> `diskRequestedBytes`     | `public`   | `number`                                  | Requested disk, in bytes.                                                                                            | `Omit.diskRequestedBytes`   |
  | <a id="diskusedbytes-1" /> `diskUsedBytes`               | `public`   | `number`                                  | Current disk usage, in bytes.                                                                                        | `Omit.diskUsedBytes`        |
  | <a id="errormessage-2" /> `errorMessage?`                | `public`   | `string`                                  | Human-readable error detail when the Sailbox is in an error state.                                                   | `Omit.errorMessage`         |
  | <a id="guestschemaversion-1" /> `guestSchemaVersion?`    | `public`   | `number`                                  | The Sailbox runtime schema version the Sailbox last booted with.                                                     | `Omit.guestSchemaVersion`   |
  | <a id="imageid-2" /> `imageId`                           | `public`   | `string`                                  | Identifier of the image the Sailbox was created from.                                                                | `Omit.imageId`              |
  | <a id="lastcheckpointedat-1" /> `lastCheckpointedAt?`    | `public`   | `string`                                  | When the most recent checkpoint was taken, if any (RFC 3339).                                                        | `Omit.lastCheckpointedAt`   |
  | <a id="memorymib-1" /> `memoryMib`                       | `public`   | `number`                                  | Configured memory, in MiB.                                                                                           | `Omit.memoryMib`            |
  | <a id="memoryrequestedbytes-1" /> `memoryRequestedBytes` | `public`   | `number`                                  | Requested memory, in bytes.                                                                                          | `Omit.memoryRequestedBytes` |
  | <a id="memoryusedbytes-1" /> `memoryUsedBytes`           | `public`   | `number`                                  | Current memory usage, in bytes.                                                                                      | `Omit.memoryUsedBytes`      |
  | <a id="name-16" /> `name`                                | `public`   | `string`                                  | The Sailbox name.                                                                                                    | `Omit.name`                 |
  | <a id="networkpolicy-3" /> `networkPolicy?`              | `readonly` | [`NetworkPolicyInfo`](#networkpolicyinfo) | The Sailbox's network policy; absent means public. Frozen when read.                                                 | -                           |
  | <a id="sailboxid-3" /> `sailboxId`                       | `public`   | `string`                                  | The Sailbox id.                                                                                                      | `Omit.sailboxId`            |
  | <a id="startedat-1" /> `startedAt?`                      | `public`   | `string`                                  | When the Sailbox first started running, if it ever has (RFC 3339). A resume does not rewrite it.                     | `Omit.startedAt`            |
  | <a id="statedisksizegib-1" /> `stateDiskSizeGib`         | `public`   | `number`                                  | Configured state-disk size, in GiB.                                                                                  | `Omit.stateDiskSizeGib`     |
  | <a id="status-13" /> `status`                            | `public`   | [`SailboxStatus`](#sailboxstatus-1)       | -                                                                                                                    | -                           |
  | <a id="updatedat-7" /> `updatedAt`                       | `public`   | `string`                                  | When the Sailbox was last updated (RFC 3339).                                                                        | `Omit.updatedAt`            |
  | <a id="vcpucount-1" /> `vcpuCount`                       | `public`   | `number`                                  | Configured number of vCPUs.                                                                                          | `Omit.vcpuCount`            |
  | <a id="visibility-3" /> `visibility?`                    | `public`   | `string`                                  | `"private"` when access is restricted to the creator; absent/`"org"` is the default org-wide access.                 | `Omit.visibility`           |
  | <a id="volumemounts-2" /> `volumeMounts`                 | `public`   | `SailboxVolumeMount`\[]                   | Volumes attached to this Sailbox and the paths they are mounted at. Empty when the Sailbox has none.                 | `Omit.volumeMounts`         |

  ***

  <a id="sailboxinfopage" />

  ### SailboxInfoPage

  One page of list results plus the pagination envelope.

  #### Extends

  * `Omit`\<`native.SailboxInfoPage`, `"items"`>

  #### Properties

  | Property                       | Type                             | Description                                | Inherited from |
  | ------------------------------ | -------------------------------- | ------------------------------------------ | -------------- |
  | <a id="hasmore-1" /> `hasMore` | `boolean`                        | Whether more results exist past this page. | `Omit.hasMore` |
  | <a id="items-1" /> `items`     | [`SailboxInfo`](#sailboxinfo)\[] | -                                          | -              |
  | <a id="limit-5" /> `limit`     | `number`                         | The page size that was applied.            | `Omit.limit`   |
  | <a id="offset-3" /> `offset`   | `number`                         | The offset that was applied.               | `Omit.offset`  |
  | <a id="total-1" /> `total`     | `number`                         | Total matching Sailboxes across all pages. | `Omit.total`   |

  ***

  <a id="sailboxlistorder" />

  ### SailboxListOrder

  > **SailboxListOrder** = `"newest_active"` | `"newest_created"`

  Result ordering for a Sailbox list: most recently active first, or newest
  created first.

  ***

  <a id="sailboxpage" />

  ### SailboxPage

  One page of [Sailbox](#sailbox) instances plus the pagination envelope.

  #### Extends

  * `Omit`\<[`SailboxInfoPage`](#sailboxinfopage), `"items"`>

  #### Properties

  | Property                       | Type                     | Description                                | Inherited from |
  | ------------------------------ | ------------------------ | ------------------------------------------ | -------------- |
  | <a id="hasmore-2" /> `hasMore` | `boolean`                | Whether more results exist past this page. | `Omit.hasMore` |
  | <a id="items-2" /> `items`     | [`Sailbox`](#sailbox)\[] | -                                          | -              |
  | <a id="limit-6" /> `limit`     | `number`                 | The page size that was applied.            | `Omit.limit`   |
  | <a id="offset-4" /> `offset`   | `number`                 | The offset that was applied.               | `Omit.offset`  |
  | <a id="total-2" /> `total`     | `number`                 | Total matching Sailboxes across all pages. | `Omit.total`   |

  ***

  <a id="sailboxsize" />

  ### SailboxSize

  > **SailboxSize** = `"s"` | `"m"` | `"l"`

  Named resource size; each sets the vCPU count plus default memory/disk.

  ***

  <a id="sailboxstatus-1" />

  ### SailboxStatus

  > **SailboxStatus** = `"running"` | `"paused"` | `"sleeping"` | `"failed"` | `"terminated"` | `string` & `object`

  Lifecycle status of a Sailbox. Open: tolerates values added server-side.

  ***

  <a id="sailboxstatusfilter" />

  ### SailboxStatusFilter

  > **SailboxStatusFilter** = `"running"` | `"paused"` | `"sleeping"` | `"failed"` | `"terminated"`

  The closed set of statuses accepted as a list filter.

  ***

  <a id="secretinfo" />

  ### SecretInfo

  A secret's name and timestamps. Sail never returns the stored value, so no
  value field exists. Timestamps are RFC 3339 strings.

  #### Properties

  | Property                            | Type     | Description                                         |
  | ----------------------------------- | -------- | --------------------------------------------------- |
  | <a id="createdat-10" /> `createdAt` | `string` | When the secret was first set (RFC 3339).           |
  | <a id="name-17" /> `name`           | `string` | The secret's name, unique within your organization. |
  | <a id="updatedat-8" /> `updatedAt`  | `string` | When the secret's value last changed (RFC 3339).    |

  ***

  <a id="shelloptions" />

  ### ShellOptions

  Options for [Sailbox.shell](#shell-1).

  #### Properties

  | Property                                      | Type                                       | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |             |                                                                                                                                                                                                                                                                                                                           |
  | --------------------------------------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="cwd-2" /> `cwd?`                       | `string`                                   | Working directory for the session. Unset starts it in the image's working directory, or `/` when the image does not set one.                                                                                                                                                                                                                                                                                                                                                          |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="env-5" /> `env?`                       | `Readonly`\<`Record`\<`string`, `string`>> | Extra environment for the session, with the precedence and reserved names of [ExecOptions.env](#env-1).                                                                                                                                                                                                                                                                                                                                                                               |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="noforward" /> `noForward?`             | `boolean`                                  | While attached, the Sailbox's browser opens and localhost servers reach your machine, files dragged onto the terminal upload and paste as guest paths, and Ctrl+V forwards your clipboard. On devbox images the clipboard is two-way (pastes land on the Sailbox's clipboard, and what you copy inside the Sailbox comes back); other images upload a pasted image as a file and paste its path. Set `true` to turn all of it off, for example for an untrusted or automated session. |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="shell-2" /> `shell?`                   | `string`                                   | Login shell to run when no command is given (default: the guest's `$SHELL`, else `/bin/bash`). Ignored when a command is given.                                                                                                                                                                                                                                                                                                                                                       |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="term-1" /> `term?`                     | `string`                                   | `$TERM` for the remote pty (default: the local `$TERM`).                                                                                                                                                                                                                                                                                                                                                                                                                              |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="timeoutseconds-7" /> `timeoutSeconds?` | `number`                                   | Wall-clock limit for the session in seconds; omit for no limit.                                                                                                                                                                                                                                                                                                                                                                                                                       |             |                                                                                                                                                                                                                                                                                                                           |
  | <a id="user-3" /> `user?`                     | `string`                                   | Run the session as this user (Docker's `USER` syntax: \`name                                                                                                                                                                                                                                                                                                                                                                                                                          | uid\[:group | gid]`). Unset runs as the image's `USER`when the image sets one, root otherwise: the same identity [Sailbox.exec](#exec-1) uses.`"0:0"`is always root. A`user`other than`"0:0"\` requires a Sailbox whose guest honors requested users; on older Sailboxes the session fails until [Sailbox.upgrade](#upgrade) is called. |

  ***

  <a id="sshendpoint" />

  ### SshEndpoint

  The public TCP endpoint a Sailbox's SSH listener is reachable at.

  #### Properties

  | Property                 | Type     | Description       |
  | ------------------------ | -------- | ----------------- |
  | <a id="host-1" /> `host` | `string` | Hostname to dial. |
  | <a id="port-1" /> `port` | `number` | Port to dial.     |

  ***

  <a id="tcpendpoint" />

  ### TcpEndpoint

  The address to dial for a `tcp` listener.

  #### Properties

  | Property                 | Type     | Description       |
  | ------------------------ | -------- | ----------------- |
  | <a id="host-2" /> `host` | `string` | Hostname to dial. |
  | <a id="kind-1" /> `kind` | `"tcp"`  | -                 |
  | <a id="port-2" /> `port` | `number` | Port to dial.     |

  ***

  <a id="upgraderesult" />

  ### UpgradeResult

  The outcome of a Sailbox runtime upgrade.

  #### Extends

  * `Omit`\<`native.UpgradeResult`, `"status"`>

  #### Properties

  | Property                      | Type                                | Description                                                                                                                                                                                                 | Inherited from |
  | ----------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------- |
  | <a id="applied" /> `applied`  | `boolean`                           | True when no upgrade is left to apply, either because the Sailbox took one just now or because it was already current. False when the upgrade is recorded and takes effect the next time the Sailbox wakes. | `Omit.applied` |
  | <a id="status-14" /> `status` | [`SailboxStatus`](#sailboxstatus-1) | -                                                                                                                                                                                                           | -              |

  ***

  <a id="volumeinfo" />

  ### VolumeInfo

  A managed NFS volume. Timestamps are RFC 3339 strings.

  #### Properties

  | Property                             | Type     | Description                               |
  | ------------------------------------ | -------- | ----------------------------------------- |
  | <a id="backend-1" /> `backend`       | `string` | Storage backend serving the volume.       |
  | <a id="createdat-11" /> `createdAt?` | `string` | Creation time (RFC 3339), if reported.    |
  | <a id="name-18" /> `name`            | `string` | The volume name.                          |
  | <a id="status-15" /> `status`        | `string` | Lifecycle status.                         |
  | <a id="updatedat-9" /> `updatedAt?`  | `string` | Last-update time (RFC 3339), if reported. |
  | <a id="volumeid-1" /> `volumeId`     | `string` | The volume id.                            |

  ***

  <a id="volumemountinput" />

  ### VolumeMountInput

  An NFS volume to mount at create time.

  #### Properties

  | Property                           | Type     | Description                                     |
  | ---------------------------------- | -------- | ----------------------------------------------- |
  | <a id="mountpath-1" /> `mountPath` | `string` | Absolute guest path to mount at.                |
  | <a id="volumeid-2" /> `volumeId`   | `string` | The volume id (from `getVolume`/`listVolumes`). |

  ***

  <a id="waitforlisteneroptions" />

  ### WaitForListenerOptions

  Options for [Sailbox.waitForListener](#waitforlistener-1).

  #### Properties

  | Property                                      | Type          | Description                                                                                                                                                                                                                                                                     |
  | --------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="signal-1" /> `signal?`                 | `AbortSignal` | Aborting stops the wait and rejects with the signal's reason. An abandoned in-flight probe winds down on its own (by `timeoutSeconds` at the latest); it does not touch the listener. Because the wind-down relies on the timeout, `signal` requires a finite `timeoutSeconds`. |
  | <a id="timeoutseconds-8" /> `timeoutSeconds?` | `number`      | Give up waiting after this many seconds (default 60; `Infinity` waits indefinitely).                                                                                                                                                                                            |

  ***

  <a id="writeoptions" />

  ### WriteOptions

  Options for uploading a file.

  #### Properties

  | Property                                  | Type      | Description                                                                                                |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | ----------------------------------------- | --------- | ---------------------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="createparents" /> `createParents?` | `boolean` | Create missing parent directories.                                                                         |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | <a id="mode-8" /> `mode?`                 | `number`  | Unix mode bits for the written file (default `0o644`).                                                     |             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
  | <a id="user-4" /> `user?`                 | `string`  | Owner for the written file and any parent directories the write creates, in Docker's `USER` syntax: \`name | uid\[:group | gid]`. The write itself always runs as root, like `COPY --chown`, so it succeeds even where that owner could not write. Unset follows the image's `USER`when the image sets one, root otherwise: the same identity commands run as, so an uploaded file is usable by the code in the Sailbox. Pass`"0:0"`to force root ownership. Requires a Sailbox whose guest honors requested users; on older Sailboxes the write fails until [Sailbox.upgrade](#upgrade) is called, except with the exact spelling`"0:0"\`, which needs none. |

  ## Errors

  Errors thrown by this SDK surface. All of them extend [SailError](#sailerror), so an `instanceof SailError` check matches everything below.

  <a id="sailerror" />

  ### SailError

  Base class for every error surfaced by the SDK.

  #### Extends

  * `Error`

  #### Extended by

  * [`InvalidArgumentError`](#invalidargumenterror)
  * [`InternalError`](#internalerror)
  * [`NotFoundError`](#notfounderror)
  * [`PermissionDeniedError`](#permissiondeniederror)
  * [`FileNotFoundError`](#filenotfounderror)
  * [`BrokenPipeError`](#brokenpipeerror)
  * [`TimeoutError`](#timeouterror)
  * [`TransportError`](#transporterror)
  * [`ApiError`](#apierror)
  * [`SailboxCreationError`](#sailboxcreationerror)
  * [`ImageBuildError`](#imagebuilderror)
  * [`SailboxExecutionError`](#sailboxexecutionerror)

  #### Constructors

  <a id="constructor-15" />

  ##### Constructor

  > **new SailError**(`message`, `code?`, `details?`): [`SailError`](#sailerror)

  ###### Parameters

  | Parameter | Type               | Default value |
  | --------- | ------------------ | ------------- |
  | `message` | `string`           | `undefined`   |
  | `code`    | `string`           | `"SailError"` |
  | `details` | `SailErrorDetails` | `{}`          |

  ###### Returns

  [`SailError`](#sailerror)

  ###### Overrides

  `Error.constructor`

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | <a id="code-15" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      |
  | <a id="retryable-15" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. |

  ***

  <a id="apierror" />

  ### ApiError

  A non-2xx API response.

  #### Extends

  * [`SailError`](#sailerror)

  #### Extended by

  * [`SecretInUseError`](#secretinuseerror)
  * [`HttpPolicyInUseError`](#httppolicyinuseerror)

  #### Constructors

  <a id="constructor" />

  ##### Constructor

  > **new ApiError**(`message`, `details?`): [`ApiError`](#apierror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`ApiError`](#apierror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                         | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | -------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="body" /> `body?`          | `readonly` | `unknown` | Parsed response body from the failed request, when available.                                                                                                                                                                                                                                                                                 | -                                                      |
  | <a id="code" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |
  | <a id="status" /> `status?`      | `readonly` | `number`  | HTTP status code returned by the API, when the failure carries one.                                                                                                                                                                                                                                                                           | -                                                      |

  ***

  <a id="brokenpipeerror" />

  ### BrokenPipeError

  A stream (e.g. exec stdin) was closed and can no longer be written.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-1" />

  ##### Constructor

  > **new BrokenPipeError**(`message`, `details?`): [`BrokenPipeError`](#brokenpipeerror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`BrokenPipeError`](#brokenpipeerror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-1" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-1" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="commandfailederror" />

  ### CommandFailedError

  Thrown by [Sailbox.run](#run) with `check` when the command exits nonzero
  or times out. Carries the completed result as [result](#result).

  #### Extends

  * [`SailboxExecutionError`](#sailboxexecutionerror)

  #### Constructors

  <a id="constructor-2" />

  ##### Constructor

  > **new CommandFailedError**(`message`, `result`): [`CommandFailedError`](#commandfailederror)

  ###### Parameters

  | Parameter | Type                        |
  | --------- | --------------------------- |
  | `message` | `string`                    |
  | `result`  | [`ExecResult`](#execresult) |

  ###### Returns

  [`CommandFailedError`](#commandfailederror)

  ###### Overrides

  [`SailboxExecutionError`](#sailboxexecutionerror).[`constructor`](#constructor-12)

  #### Properties

  | Property                           | Modifier   | Type                        | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                                                 |
  | ---------------------------------- | ---------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
  | <a id="code-2" /> `code`           | `readonly` | `string`                    | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailboxExecutionError`](#sailboxexecutionerror).[`code`](#code-12)           |
  | <a id="result" /> `result`         | `readonly` | [`ExecResult`](#execresult) | -                                                                                                                                                                                                                                                                                                                                             | -                                                                              |
  | <a id="retryable-2" /> `retryable` | `readonly` | `boolean`                   | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailboxExecutionError`](#sailboxexecutionerror).[`retryable`](#retryable-12) |
  | <a id="rpcstatus" /> `rpcStatus`   | `readonly` | `string`                    | Transport status classifying the failure (for example `"unavailable"`), empty when the failure carries no status. Distinct from [code](#code-15), which stays the taxonomy discriminator on every SailError.                                                                                                                                  | [`SailboxExecutionError`](#sailboxexecutionerror).[`rpcStatus`](#rpcstatus-2)  |

  ***

  <a id="filenotfounderror" />

  ### FileNotFoundError

  A remote file path does not exist.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-3" />

  ##### Constructor

  > **new FileNotFoundError**(`message`, `details?`): [`FileNotFoundError`](#filenotfounderror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`FileNotFoundError`](#filenotfounderror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-3" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-3" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="httppolicyinuseerror" />

  ### HttpPolicyInUseError

  Deleting an HTTP policy that is still attached to a Sailbox. Clear or
  replace it on every Sailbox first, then delete it.

  #### Extends

  * [`ApiError`](#apierror)

  #### Constructors

  <a id="constructor-4" />

  ##### Constructor

  > **new HttpPolicyInUseError**(`message`, `details?`): [`HttpPolicyInUseError`](#httppolicyinuseerror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`HttpPolicyInUseError`](#httppolicyinuseerror)

  ###### Inherited from

  [`ApiError`](#apierror).[`constructor`](#constructor)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                    |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
  | <a id="body-1" /> `body?`          | `readonly` | `unknown` | Parsed response body from the failed request, when available.                                                                                                                                                                                                                                                                                 | [`ApiError`](#apierror).[`body`](#body)           |
  | <a id="code-4" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`ApiError`](#apierror).[`code`](#code)           |
  | <a id="retryable-4" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`ApiError`](#apierror).[`retryable`](#retryable) |
  | <a id="status-1" /> `status?`      | `readonly` | `number`  | HTTP status code returned by the API, when the failure carries one.                                                                                                                                                                                                                                                                           | [`ApiError`](#apierror).[`status`](#status)       |

  ***

  <a id="imagebuilderror" />

  ### ImageBuildError

  A custom image could not be built or its local content could not be uploaded.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-5" />

  ##### Constructor

  > **new ImageBuildError**(`message`, `details?`): [`ImageBuildError`](#imagebuilderror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`ImageBuildError`](#imagebuilderror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-5" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-5" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="internalerror" />

  ### InternalError

  An unexpected internal SDK failure.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-6" />

  ##### Constructor

  > **new InternalError**(`message`, `details?`): [`InternalError`](#internalerror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`InternalError`](#internalerror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-6" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-6" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="invalidargumenterror" />

  ### InvalidArgumentError

  Invalid arguments or configuration (bad request, missing/invalid API key).

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-7" />

  ##### Constructor

  > **new InvalidArgumentError**(`message`, `details?`): [`InvalidArgumentError`](#invalidargumenterror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`InvalidArgumentError`](#invalidargumenterror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-7" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-7" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="notfounderror" />

  ### NotFoundError

  The Sailbox, volume, or other resource does not exist (or is another org's).

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-8" />

  ##### Constructor

  > **new NotFoundError**(`message`, `details?`): [`NotFoundError`](#notfounderror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`NotFoundError`](#notfounderror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-8" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-8" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="permissiondeniederror" />

  ### PermissionDeniedError

  The credential is not permitted to perform the operation.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-9" />

  ##### Constructor

  > **new PermissionDeniedError**(`message`, `details?`): [`PermissionDeniedError`](#permissiondeniederror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`PermissionDeniedError`](#permissiondeniederror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                           | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ---------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-9" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-9" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="sailboxcreationerror" />

  ### SailboxCreationError

  A Sailbox could not be created (provisioning failed).

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-10" />

  ##### Constructor

  > **new SailboxCreationError**(`message`, `details?`): [`SailboxCreationError`](#sailboxcreationerror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`SailboxCreationError`](#sailboxcreationerror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="body-2" /> `body?`           | `readonly` | `unknown` | Parsed response body from the failed create request, when available.                                                                                                                                                                                                                                                                          | -                                                      |
  | <a id="code-10" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-10" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |
  | <a id="status-3" /> `status?`       | `readonly` | `number`  | HTTP status code returned by the create request, when the failure carries one.                                                                                                                                                                                                                                                                | -                                                      |

  ***

  <a id="sailboxexecrequestnotfounderror" />

  ### SailboxExecRequestNotFoundError

  The exec request could not be found (for example after the Sailbox
  moved machines).

  #### Extends

  * [`SailboxExecutionError`](#sailboxexecutionerror)

  #### Constructors

  <a id="constructor-11" />

  ##### Constructor

  > **new SailboxExecRequestNotFoundError**(`message`, `details?`): [`SailboxExecRequestNotFoundError`](#sailboxexecrequestnotfounderror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`SailboxExecRequestNotFoundError`](#sailboxexecrequestnotfounderror)

  ###### Overrides

  [`SailboxExecutionError`](#sailboxexecutionerror).[`constructor`](#constructor-12)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                                                 |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
  | <a id="code-11" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailboxExecutionError`](#sailboxexecutionerror).[`code`](#code-12)           |
  | <a id="retryable-11" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailboxExecutionError`](#sailboxexecutionerror).[`retryable`](#retryable-12) |
  | <a id="rpcstatus-1" /> `rpcStatus`  | `readonly` | `string`  | Transport status classifying the failure (for example `"unavailable"`), empty when the failure carries no status. Distinct from [code](#code-15), which stays the taxonomy discriminator on every SailError.                                                                                                                                  | [`SailboxExecutionError`](#sailboxexecutionerror).[`rpcStatus`](#rpcstatus-2)  |

  ***

  <a id="sailboxexecutionerror" />

  ### SailboxExecutionError

  Base class for failures during an exec.

  #### Extends

  * [`SailError`](#sailerror)

  #### Extended by

  * [`CommandFailedError`](#commandfailederror)
  * [`SailboxTerminatedError`](#sailboxterminatederror)
  * [`SailboxExecRequestNotFoundError`](#sailboxexecrequestnotfounderror)
  * [`SailboxHostLostError`](#sailboxhostlosterror)

  #### Constructors

  <a id="constructor-12" />

  ##### Constructor

  > **new SailboxExecutionError**(`message`, `code?`, `details?`): [`SailboxExecutionError`](#sailboxexecutionerror)

  ###### Parameters

  | Parameter | Type               | Default value             |
  | --------- | ------------------ | ------------------------- |
  | `message` | `string`           | `undefined`               |
  | `code`    | `string`           | `"SailboxExecutionError"` |
  | `details` | `SailErrorDetails` | `{}`                      |

  ###### Returns

  [`SailboxExecutionError`](#sailboxexecutionerror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-12" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-12" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |
  | <a id="rpcstatus-2" /> `rpcStatus`  | `readonly` | `string`  | Transport status classifying the failure (for example `"unavailable"`), empty when the failure carries no status. Distinct from [code](#code-15), which stays the taxonomy discriminator on every SailError.                                                                                                                                  | -                                                      |

  ***

  <a id="sailboxhostlosterror" />

  ### SailboxHostLostError

  The machine hosting the Sailbox was lost while an exec was in flight.

  #### Extends

  * [`SailboxExecutionError`](#sailboxexecutionerror)

  #### Constructors

  <a id="constructor-13" />

  ##### Constructor

  > **new SailboxHostLostError**(`message`, `details?`): [`SailboxHostLostError`](#sailboxhostlosterror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`SailboxHostLostError`](#sailboxhostlosterror)

  ###### Overrides

  [`SailboxExecutionError`](#sailboxexecutionerror).[`constructor`](#constructor-12)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                                                 |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
  | <a id="code-13" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailboxExecutionError`](#sailboxexecutionerror).[`code`](#code-12)           |
  | <a id="retryable-13" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailboxExecutionError`](#sailboxexecutionerror).[`retryable`](#retryable-12) |
  | <a id="rpcstatus-3" /> `rpcStatus`  | `readonly` | `string`  | Transport status classifying the failure (for example `"unavailable"`), empty when the failure carries no status. Distinct from [code](#code-15), which stays the taxonomy discriminator on every SailError.                                                                                                                                  | [`SailboxExecutionError`](#sailboxexecutionerror).[`rpcStatus`](#rpcstatus-2)  |

  ***

  <a id="sailboxterminatederror" />

  ### SailboxTerminatedError

  The Sailbox was terminated while an exec was in flight.

  #### Extends

  * [`SailboxExecutionError`](#sailboxexecutionerror)

  #### Constructors

  <a id="constructor-14" />

  ##### Constructor

  > **new SailboxTerminatedError**(`message`, `details?`): [`SailboxTerminatedError`](#sailboxterminatederror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`SailboxTerminatedError`](#sailboxterminatederror)

  ###### Overrides

  [`SailboxExecutionError`](#sailboxexecutionerror).[`constructor`](#constructor-12)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                                                 |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
  | <a id="code-14" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailboxExecutionError`](#sailboxexecutionerror).[`code`](#code-12)           |
  | <a id="retryable-14" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailboxExecutionError`](#sailboxexecutionerror).[`retryable`](#retryable-12) |
  | <a id="rpcstatus-4" /> `rpcStatus`  | `readonly` | `string`  | Transport status classifying the failure (for example `"unavailable"`), empty when the failure carries no status. Distinct from [code](#code-15), which stays the taxonomy discriminator on every SailError.                                                                                                                                  | [`SailboxExecutionError`](#sailboxexecutionerror).[`rpcStatus`](#rpcstatus-2)  |

  ***

  <a id="secretinuseerror" />

  ### SecretInUseError

  Deleting a secret that HTTP policies still refer to. Delete those
  policies first, then delete the secret.

  #### Extends

  * [`ApiError`](#apierror)

  #### Constructors

  <a id="constructor-16" />

  ##### Constructor

  > **new SecretInUseError**(`message`, `details?`): [`SecretInUseError`](#secretinuseerror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`SecretInUseError`](#secretinuseerror)

  ###### Inherited from

  [`ApiError`](#apierror).[`constructor`](#constructor)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                    |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
  | <a id="body-3" /> `body?`           | `readonly` | `unknown` | Parsed response body from the failed request, when available.                                                                                                                                                                                                                                                                                 | [`ApiError`](#apierror).[`body`](#body)           |
  | <a id="code-16" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`ApiError`](#apierror).[`code`](#code)           |
  | <a id="retryable-16" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`ApiError`](#apierror).[`retryable`](#retryable) |
  | <a id="status-4" /> `status?`       | `readonly` | `number`  | HTTP status code returned by the API, when the failure carries one.                                                                                                                                                                                                                                                                           | [`ApiError`](#apierror).[`status`](#status)       |

  ***

  <a id="timeouterror" />

  ### TimeoutError

  A request exceeded its timeout.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-17" />

  ##### Constructor

  > **new TimeoutError**(`message`, `details?`): [`TimeoutError`](#timeouterror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`TimeoutError`](#timeouterror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-17" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-17" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |

  ***

  <a id="transporterror" />

  ### TransportError

  A network/connection transport failure.

  #### Extends

  * [`SailError`](#sailerror)

  #### Constructors

  <a id="constructor-18" />

  ##### Constructor

  > **new TransportError**(`message`, `details?`): [`TransportError`](#transporterror)

  ###### Parameters

  | Parameter | Type               |
  | --------- | ------------------ |
  | `message` | `string`           |
  | `details` | `SailErrorDetails` |

  ###### Returns

  [`TransportError`](#transporterror)

  ###### Overrides

  [`SailError`](#sailerror).[`constructor`](#constructor-15)

  #### Properties

  | Property                            | Modifier   | Type      | Description                                                                                                                                                                                                                                                                                                                                   | Inherited from                                         |
  | ----------------------------------- | ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
  | <a id="code-18" /> `code`           | `readonly` | `string`  | Stable, language-neutral error code (e.g. `"NotFound"`).                                                                                                                                                                                                                                                                                      | [`SailError`](#sailerror).[`code`](#code-15)           |
  | <a id="retryable-18" /> `retryable` | `readonly` | `boolean` | Advisory: `true` when retrying the same call may succeed (a transport failure, HTTP 429 or a gateway 5xx, a transient exec failure). `false` when the failure is deterministic (bad argument, missing resource, permission). The SDK's built-in retry already covers the transient window for most calls; this classifies what leaks past it. | [`SailError`](#sailerror).[`retryable`](#retryable-15) |
</div>
