@evolvingmachines/sail 0.0.0-stage → 0.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,964 @@
1
+ /** Optional detail on a capability refusal. */
2
+ interface SandboxFeatureUnsupportedOptions {
3
+ /** Providers that do support the feature, e.g. `["modal"]`. */
4
+ alternatives?: readonly string[];
5
+ }
6
+ /**
7
+ * A capability this provider lacks: `feature` is the canonical dotted key (`files.watchDir`, `network.update`,
8
+ * `resources.gpu`; one key per refusal, identical across providers), `provider` the provider type, `reason` the
9
+ * exact sentence. `unsupported` and `code` are the capability-refusal marker (see markFeatureUnsupported).
10
+ */
11
+ declare class SandboxFeatureUnsupportedError extends Error {
12
+ readonly feature: string;
13
+ readonly provider: string;
14
+ readonly reason?: string;
15
+ readonly code: "feature_unsupported";
16
+ readonly unsupported: true;
17
+ readonly alternatives?: string[];
18
+ constructor(feature: string, provider: string, reason?: string, options?: SandboxFeatureUnsupportedOptions);
19
+ }
20
+ /** A path the sandbox does not have — never an empty success. */
21
+ declare class SandboxPathNotFoundError extends Error {
22
+ readonly path: string;
23
+ readonly provider: string;
24
+ constructor(path: string, provider: string);
25
+ }
26
+ /** An inspect refused because the sandbox is not running; `state` is the provider's own word (`paused`, `exited with code 137`). */
27
+ declare class SandboxNotRunningError extends Error {
28
+ readonly sandboxId: string;
29
+ readonly provider: string;
30
+ readonly state: string;
31
+ constructor(sandboxId: string, provider: string, state: string);
32
+ }
33
+ /**
34
+ * True for a capability refusal: a SandboxFeatureUnsupportedError from ANY package's copy, or a provider class that
35
+ * carries the marker (`unsupported === true` and a string `feature`; see markFeatureUnsupported).
36
+ */
37
+ declare function isSandboxFeatureUnsupportedError(err: unknown): err is SandboxFeatureUnsupportedError;
38
+ /** True for a SandboxPathNotFoundError from ANY package's copy. */
39
+ declare function isSandboxPathNotFoundError(err: unknown): err is SandboxPathNotFoundError;
40
+ /** True for a SandboxNotRunningError from ANY package's copy. */
41
+ declare function isSandboxNotRunningError(err: unknown): err is SandboxNotRunningError;
42
+
43
+ /** True when the box could list with neither GNU find's -printf nor stat(1): the image lacks the tools, not the path. */
44
+ declare function listingToolsMissing(stderr: string): boolean;
45
+
46
+ /**
47
+ * GENERATED — DO NOT EDIT. `npm run generate:image-version` (repo root)
48
+ * rewrites this file from the evolve-all image build inputs under
49
+ * assets/docker/ (see assets/docker/image-digest.ts for the derivation).
50
+ * The value is content-addressed: same inputs → same tag, any input
51
+ * change → a new tag. The coherence test in
52
+ * packages/daytona/tests/unit/daytona-image-version.test.ts fails the
53
+ * suite whenever this checked-in copy is stale.
54
+ */
55
+ declare const EVOLVE_IMAGE_VERSION = "c-09256e558937";
56
+
57
+ /**
58
+ * A Harbor task's own image on Sail, for `evolve run --local`: Harbor's Sail
59
+ * environment (harbor environments/sail.py, v0.27.0, _SailDirect) boots each
60
+ * trial from Image.from_dockerfile(environment/Dockerfile,
61
+ * context_dir=environment/) or Image.from_registry(docker_image). Sail keys a
62
+ * build by its content, so an unchanged task reuses it. Building takes Sail's
63
+ * SDK; the box is then created over HTTP like every other Sailbox, from the
64
+ * spec the build returned.
65
+ */
66
+ /** What `evolve run --local` asks Sail to build for one task. */
67
+ interface SailTaskImageSpec {
68
+ /** Harbor's environment_content_hash of environment/ (32 hex). */
69
+ key: string;
70
+ /** environment/, the build context. */
71
+ contextDir: string;
72
+ /** environment/Dockerfile; absent when the task boots `dockerImage` as is. */
73
+ dockerfile?: {
74
+ path: string;
75
+ };
76
+ /** [environment] docker_image. */
77
+ dockerImage?: string;
78
+ /** Build again even when Sail holds this build (Harbor's force_build). */
79
+ forceBuild?: boolean;
80
+ /** Harbor's build_timeout_sec times environment_build_timeout_multiplier. */
81
+ timeoutMs: number;
82
+ /** The run was stopped: wait no longer. */
83
+ signal?: AbortSignal;
84
+ log?: (line: string) => void;
85
+ }
86
+ interface SailTaskImage {
87
+ /** What create({ image }) boots: a name for the built spec this provider keeps, or the registry image itself. */
88
+ image: string;
89
+ /** Unknown until a box runs: Sail starts commands in the image's own WORKDIR. */
90
+ workdir: null;
91
+ }
92
+ /** A Dockerfile image as Sail's create takes it (ImageSpec.dockerfile, snake_case). */
93
+ type SailDockerfileImageSpec = {
94
+ dockerfile: Record<string, unknown>;
95
+ };
96
+ /** A failed build, as Harbor's result names it: sail.py lets the SDK's own error through. */
97
+ declare class ImageBuildError extends Error {
98
+ constructor(message: string);
99
+ }
100
+
101
+ /**
102
+ * Sail Sandbox Provider (Sailboxes, sailresearch.com)
103
+ *
104
+ * Every runtime operation rides Sail's public HTTPS API
105
+ * (https://sailbox-api.sailresearch.com/v1, OpenAPI "Sail Sailbox API"
106
+ * 2026-10-04; docs.sailresearch.com/sailboxes-http-api). The one thing that API
107
+ * cannot do is BUILD an image ("Building an image ... takes an SDK" —
108
+ * ImageSpec description), so image builds alone go through Sail's own SDK
109
+ * (`@sailresearch/sdk`, loaded lazily): a create that names an image Sail has
110
+ * not built yet answers 409, the provider builds it once for the
111
+ * organization, and the create runs again. `prepareImage()` is that same
112
+ * build, ahead of time.
113
+ *
114
+ * Why not the SDK for everything: its core is a native (napi) module whose
115
+ * package declares node >= 22 (./sdk-loader.ts makes it load on older Node),
116
+ * and plain fetch keeps every wire decision (idempotency keys, listing
117
+ * completeness, egress mapping) visible and unit-testable here. The SDK is
118
+ * only on the build path, which is rare (once per image version per org).
119
+ *
120
+ * Sail facts this adapter is built around (all from the docs/OpenAPI above):
121
+ * - Every Sailbox belongs to an APP; create needs its id (`POST /apps/find`
122
+ * on api.sailresearch.com, mint_if_missing). One app per provider config.
123
+ * - Sail has no metadata/labels. The SDK's metadata rides one create-time
124
+ * environment variable (EVOLVE_SANDBOX_METADATA, JSON) because `env` is
125
+ * returned by both retrieve AND list — so list() can filter on it without
126
+ * touching each box. Values are not secret on Sail (the docs say so), and
127
+ * neither is sandbox metadata anywhere else. For the same reason the
128
+ * create-time `envs` (model keys, run tokens) are NEVER stored on the box:
129
+ * they ride every exec's `env` from this process's memory.
130
+ * - Lifetime is absolute (`max_lifetime_seconds`). There is no idle KILL —
131
+ * Sail's idle behavior is auto-SLEEP, which keeps the box — so an
132
+ * `idleTimeoutMs` is refused typed, never mapped onto sleep.
133
+ * - Sail never runs an image's ENTRYPOINT/CMD and takes no create-time argv,
134
+ * so `bootCommand` is refused typed (the boot is already inert).
135
+ * - Commands take `user`, `cwd` and `env` per exec, so no su wrapper is
136
+ * needed; files are written as root and handed to the sandbox user, the
137
+ * same ownership the other providers produce.
138
+ * - Egress: hostnames, `*.domain` wildcards, IPv4 addresses and IPv4 CIDRs,
139
+ * mixed freely; no IPv6 entries, no ports. Switchable on a running box.
140
+ * Sail's own API host stays reachable under every allowlist (the docs:
141
+ * "so a Sailbox can always call Sail about itself") — only no_network
142
+ * removes it, and no_network also cuts inbound.
143
+ * - No GPUs. vCPU 1–64 (integer; Sail rounds up to a power of two, and 64
144
+ * is public beta), memory limit up to 256 GiB with a floor that follows
145
+ * the vCPU count, disk 8–1024 GiB. Billing follows OBSERVED usage, so a
146
+ * limit raised to Sail's floor costs nothing extra.
147
+ * - Images: Debian- or Ubuntu-based only (an Alpine build is refused typed,
148
+ * feature `image.baseDistro`). Public registries pull anonymously; a
149
+ * PRIVATE image (ECR, GHCR, Artifact Registry, ...) needs a registry login
150
+ * (`registryLogins`), sent with the build and with each create and never
151
+ * stored by Sail or by this adapter.
152
+ */
153
+
154
+ /** Sailbox API base (docs: sailboxes-http-api). */
155
+ declare const SAIL_SAILBOX_API_URL = "https://sailbox-api.sailresearch.com/v1";
156
+ /** Apps live on the main API host; the same key works on both (same page). */
157
+ declare const SAIL_API_URL = "https://api.sailresearch.com/v1";
158
+ /** The one create-time env var that carries the SDK's metadata (see header). */
159
+ declare const SAIL_METADATA_ENV = "EVOLVE_SANDBOX_METADATA";
160
+ /** Sail caps one env value at 4096 characters (CreateSailboxRequest.env). */
161
+ declare const SAIL_MAX_ENV_VALUE_CHARS = 4096;
162
+ /** `GET /sailboxes` serves at most 100 per page (docs: "limit (up to 100)"). */
163
+ declare const SAIL_MAX_PAGE_SIZE = 100;
164
+ /** Page ceiling for one enumeration: 10,000 Sailboxes, then INCOMPLETE. */
165
+ declare const SAIL_MAX_LIST_PAGES = 100;
166
+ /**
167
+ * Sail's documented create limits (CreateSailboxRequest: "Virtual CPUs, 1 to
168
+ * 64, rounded up to a power of two"; 64-vCPU Sailboxes are public beta,
169
+ * live-accepted 2026-11-30).
170
+ */
171
+ declare const SAIL_MAX_VCPUS = 64;
172
+ /** The vCPU count of a create that names none (the image limit, 8 by default). */
173
+ declare const SAIL_DEFAULT_VCPUS = 8;
174
+ declare const SAIL_MAX_MEMORY_GIB = 256;
175
+ declare const SAIL_MIN_DISK_GIB = 8;
176
+ declare const SAIL_MAX_DISK_GIB = 1024;
177
+ /** Wire form of the image a create names. */
178
+ type SailImageSpec = {
179
+ base: string;
180
+ } | {
181
+ oci: {
182
+ ref: string;
183
+ };
184
+ };
185
+ declare class SailImageError extends Error {
186
+ constructor(message: string);
187
+ }
188
+ /**
189
+ * Resolve a provider-neutral image name to the reference Sail pulls, written
190
+ * out in full the way Sail requires ("written out in full" — ImageSpec.oci.ref).
191
+ * `python:3.12` → `docker.io/library/python:3.12`, `org/img:tag` →
192
+ * `docker.io/org/img:tag`. A registry Sail cannot pull from is refused here,
193
+ * offline, instead of as a failed build later. Whether the image is public or
194
+ * needs a login is Sail's to find out: a private one without a matching
195
+ * `registryLogins` entry fails at its build.
196
+ */
197
+ declare function resolveImageRef(image: string): SailImageSpec;
198
+ /** How a registry login authenticates (Sail's RegistryLogin.kind). */
199
+ type SailRegistryLoginKind = "basic" | "aws_access_key" | "gcp_service_account";
200
+ /**
201
+ * A login Sail uses to pull a private image (docs: sailboxes-images "Private
202
+ * images"). It is sent with the image build and with every create of a box
203
+ * from that image, used by Sail only to pull, and never stored in the image.
204
+ *
205
+ * - `basic` (default): a registry username and a password or token. An ECR
206
+ * 12-hour token from `aws ecr get-login-password` is `basic` with username
207
+ * `AWS` — no long-lived IAM key leaves your machine. The token EXPIRES after
208
+ * 12 hours: in a list it stops working for builds and creates after that,
209
+ * so a long-lived process passes the function form (SailRegistryLoginsOption),
210
+ * which mints a fresh one each time.
211
+ * - `aws_access_key`: an IAM access key id (`username`) and secret access key.
212
+ * - `gcp_service_account`: a service account JSON key (`password`), no username.
213
+ *
214
+ * Give exactly one of `password` (the value, sent only with the request it
215
+ * rides) and `secretName` (an organization secret stored on Sail).
216
+ */
217
+ interface SailRegistryLogin {
218
+ /**
219
+ * The references the login applies to: a registry host, optionally followed
220
+ * by a repository path (`ghcr.io/acme`). The longest matching prefix wins.
221
+ * Omitted or empty: the image being pulled, whatever its host.
222
+ */
223
+ prefix?: string;
224
+ kind?: SailRegistryLoginKind;
225
+ username?: string;
226
+ password?: string;
227
+ secretName?: string;
228
+ }
229
+ /**
230
+ * Logins for a provider: a fixed list, or a function asked once per build and
231
+ * once per create with the full image ref (so a short-lived token, such as an
232
+ * ECR one, is minted fresh each time instead of expiring in a long process).
233
+ */
234
+ type SailRegistryLoginsOption = SailRegistryLogin[] | ((imageRef: string) => SailRegistryLogin[] | Promise<SailRegistryLogin[]>);
235
+ /** Sail takes at most 20 logins per request (CreateSailboxRequest.registry_logins). */
236
+ declare const SAIL_MAX_REGISTRY_LOGINS = 20;
237
+ /** A registry login Sail cannot use as written. An input error, not a capability refusal. */
238
+ declare class SailRegistryLoginError extends Error {
239
+ constructor(message: string);
240
+ }
241
+ /** Sail's wire shape of one login (OpenAPI RegistryLogin). */
242
+ interface SailRegistryLoginWire {
243
+ prefix?: string;
244
+ kind: "REGISTRY_LOGIN_KIND_BASIC" | "REGISTRY_LOGIN_KIND_AWS_ACCESS_KEY" | "REGISTRY_LOGIN_KIND_GCP_SERVICE_ACCOUNT";
245
+ username?: string;
246
+ secret_value?: string;
247
+ secret_name?: string;
248
+ }
249
+ /**
250
+ * The logins that apply to one image ref, checked and in wire form. Only
251
+ * logins whose prefix covers the ref are sent, so a credential for one
252
+ * registry never rides a pull from another.
253
+ */
254
+ declare function registryLoginsFor(ref: string, logins: SailRegistryLogin[] | undefined): SailRegistryLoginWire[];
255
+ /** The one login a single-image build pulls with: the longest matching prefix (Sail's rule). */
256
+ declare function pickLogin(ref: string, logins: SailRegistryLoginWire[]): SailRegistryLoginWire | undefined;
257
+ /** A create-time sizing Sail cannot enforce (GPUs, out-of-range limits). */
258
+ declare class SailResourcesError extends Error {
259
+ constructor(message: string);
260
+ }
261
+ /** Sail's only idle behavior is SLEEP, which keeps the box; it has no idle kill. */
262
+ declare class SailIdleTimeoutError extends Error {
263
+ constructor();
264
+ }
265
+ /** Sail takes no create-time argv and never runs an image's ENTRYPOINT/CMD. */
266
+ declare class SailBootCommandError extends Error {
267
+ constructor();
268
+ }
269
+ type SailNetworkPolicyReason = "ipv6-unsupported" | "port-unsupported" | "invalid-entry" | "open-with-allowlist" | "no-network-conflict";
270
+ /** An egress policy entry Sail's allowlist grammar cannot express. */
271
+ declare class SailNetworkPolicyError extends Error {
272
+ readonly reason: SailNetworkPolicyReason;
273
+ readonly destination?: string;
274
+ constructor(reason: SailNetworkPolicyReason, message: string, destination?: string);
275
+ }
276
+ /** Metadata that does not fit Sail's one env value. */
277
+ declare class SailMetadataError extends Error {
278
+ constructor(message: string);
279
+ }
280
+ /** A create Sail accepted and could not bring up (`status: failed`, still HTTP 200). */
281
+ declare class SailCreateFailedError extends Error {
282
+ readonly sailboxId?: string;
283
+ readonly status: string;
284
+ constructor(status: string, message: string, sailboxId?: string);
285
+ }
286
+ /**
287
+ * A command Sail reports as timed out though it was given no timeoutMs. A timed
288
+ * command that runs out of time is exit 124 instead (timedExitCode). Named like
289
+ * E2B's so callers match one name.
290
+ */
291
+ declare class SailCommandTimeoutError extends Error {
292
+ constructor(command: string, timeoutMs: number);
293
+ }
294
+ /** Any non-2xx answer from Sail, with its documented error envelope. */
295
+ declare class SailApiError extends Error {
296
+ readonly status: number;
297
+ readonly type?: string;
298
+ readonly code?: string | null;
299
+ readonly retryAfterSec?: number;
300
+ constructor(status: number, message: string, details?: {
301
+ type?: string;
302
+ code?: string | null;
303
+ retryAfterSec?: number;
304
+ });
305
+ }
306
+ interface SailSizing {
307
+ vcpu_count?: number;
308
+ memory_limit_gib?: number;
309
+ state_disk_limit_gib?: number;
310
+ }
311
+ /** Sail's memory floor for a vCPU count: 2 GiB at 1, 8 at 2–4, 16 at 5–8 (CreateSailboxRequest). */
312
+ declare function sailMemoryFloorGib(vcpus: number): number;
313
+ /**
314
+ * cpu cores / memory GiB / disk GiB → Sail limits. Sail sizes in whole units,
315
+ * so fractions round UP (never a box smaller than declared). A request under
316
+ * Sail's own floor (memory for the vCPU count, 8 GiB disk) is raised to it:
317
+ * these are LIMITS and Sail bills observed usage, so the raise grants
318
+ * headroom without cost and never runs the task smaller than declared. A
319
+ * request ABOVE what Sail offers, and any GPU, is refused typed.
320
+ */
321
+ declare function mapResources(resources?: {
322
+ cpu?: number;
323
+ memory?: number;
324
+ disk?: number;
325
+ gpu?: number;
326
+ gpuTypes?: string[];
327
+ }): SailSizing;
328
+ /** Sail's egress document (EgressPolicyDocument), the subset this adapter writes. */
329
+ interface SailEgressDocument {
330
+ allowlist?: string[];
331
+ no_network?: true;
332
+ }
333
+ /**
334
+ * Evolve's provider-neutral policy → Sail's inline egress document. ONE mapper
335
+ * for create and for updateNetwork(), so a switch can never grant what the
336
+ * create would have refused (types.ts updateNetwork law).
337
+ *
338
+ * - open (or none) → `{}`, Sail's "every destination" document
339
+ * - blocked, no allowlist → `{ allowlist: [] }`: nothing but Sail's own API
340
+ * - blocked with noNetwork → `{ no_network: true }`: not even that (Harbor sail.py:724-725)
341
+ * - blocked with allowlist → exactly those destinations
342
+ */
343
+ declare function mapNetworkPolicy(network?: SandboxNetworkPolicy): SailEgressDocument;
344
+ /** SDK metadata → the one env value that carries it (see header). */
345
+ declare function encodeMetadata(metadata: Record<string, string>): string;
346
+ /** The metadata a Sailbox carries, or {} when it carries none (or something unreadable). */
347
+ declare function decodeMetadata(env: Record<string, string> | undefined): Record<string, string>;
348
+ interface SandboxCommandResult {
349
+ exitCode: number;
350
+ stdout: string;
351
+ stderr: string;
352
+ }
353
+ interface SandboxCommandHandle {
354
+ readonly processId: string;
355
+ wait(): Promise<SandboxCommandResult>;
356
+ kill(): Promise<boolean>;
357
+ }
358
+ interface ProcessInfo {
359
+ processId: string;
360
+ cmd: string;
361
+ args: string[];
362
+ envs: Record<string, string>;
363
+ cwd?: string;
364
+ tag?: string;
365
+ }
366
+ interface SandboxRunOptions {
367
+ timeoutMs?: number;
368
+ envs?: Record<string, string>;
369
+ cwd?: string;
370
+ onStdout?: (data: string) => void;
371
+ onStderr?: (data: string) => void;
372
+ /** The most characters of each stream the result holds: past it, the first and last half, with a line between that says how much is missing. The callbacks get every chunk. */
373
+ maxOutput?: number;
374
+ }
375
+ interface SandboxSpawnOptions extends SandboxRunOptions {
376
+ stdin?: boolean;
377
+ }
378
+ interface SandboxNetworkPolicy {
379
+ outbound: "open" | "blocked";
380
+ allowedDestinations?: string[];
381
+ noNetwork?: boolean;
382
+ }
383
+ interface SandboxCreateOptions {
384
+ image?: string;
385
+ envs?: Record<string, string>;
386
+ metadata?: Record<string, string>;
387
+ timeoutMs?: number;
388
+ idleTimeoutMs?: number;
389
+ bootCommand?: string[];
390
+ workingDirectory?: string;
391
+ resources?: {
392
+ cpu?: number;
393
+ memory?: number;
394
+ disk?: number;
395
+ gpu?: number;
396
+ gpuTypes?: string[];
397
+ };
398
+ network?: SandboxNetworkPolicy;
399
+ phaseNetworkPolicies?: SandboxNetworkPolicy[];
400
+ user?: string;
401
+ homeDir?: string;
402
+ homeOwner?: string;
403
+ /**
404
+ * Start the Sailbox from a Sail checkpoint (SandboxSnapshot.snapshotId),
405
+ * `POST /sailboxes/from_checkpoint`. The copy keeps the source's image,
406
+ * size, metadata and (unless `network` is given) egress policy, so
407
+ * `image`, `resources` and `metadata` are refused with it.
408
+ */
409
+ fromSnapshot?: string;
410
+ }
411
+ /** What a snapshot holds: the disk only, or disk and memory (running processes carry on). */
412
+ type SandboxSnapshotKind = "filesystem" | "memory";
413
+ /** How long a checkpoint stays usable when `ttlMs` is not given: 7 days (Sail's own default too). */
414
+ declare const SAIL_SNAPSHOT_DEFAULT_TTL_MS: number;
415
+ interface SandboxSnapshotOptions {
416
+ /** Default "filesystem" (`include_memory: false`); "memory" keeps memory and background processes. */
417
+ kind?: SandboxSnapshotKind;
418
+ /** Checkpoint lifetime in ms (`ttl_seconds`, whole seconds). Default SAIL_SNAPSHOT_DEFAULT_TTL_MS. */
419
+ ttlMs?: number;
420
+ }
421
+ interface SandboxSnapshot {
422
+ snapshotId: string;
423
+ provider: string;
424
+ kind: SandboxSnapshotKind;
425
+ sourceSandboxId: string;
426
+ createdAt: string;
427
+ expiresAt: string | null;
428
+ }
429
+ interface SandboxForkOptions {
430
+ /** Lifetime of the copy in ms (`max_lifetime_seconds`). Default: the provider's default timeout. */
431
+ timeoutMs?: number;
432
+ }
433
+ interface SandboxListOptions {
434
+ state?: ("running" | "paused")[];
435
+ metadata?: Record<string, string>;
436
+ limit?: number;
437
+ }
438
+ interface FileInfo {
439
+ name: string;
440
+ path: string;
441
+ type: "file" | "dir" | "symlink" | "other";
442
+ size: number;
443
+ mtime: string;
444
+ mode: string;
445
+ owner: string;
446
+ group: string;
447
+ target?: string;
448
+ }
449
+ interface FileRange {
450
+ offset: number;
451
+ length: number;
452
+ }
453
+ interface FilesystemEvent {
454
+ path: string;
455
+ type: "create" | "write" | "remove" | "rename";
456
+ }
457
+ interface WatchOptions {
458
+ recursive?: boolean;
459
+ }
460
+ interface WatchHandle {
461
+ stop(): Promise<void>;
462
+ }
463
+ interface SandboxMetrics {
464
+ cpuPct: number;
465
+ memUsedMb: number;
466
+ memTotalMb: number;
467
+ diskUsedMb?: number;
468
+ sampledAt: string;
469
+ source: string;
470
+ }
471
+ interface SandboxInspectOptions {
472
+ user?: string;
473
+ }
474
+ interface SandboxListPage {
475
+ sandboxes: SandboxInfo[];
476
+ complete: boolean;
477
+ pagesFetched: number;
478
+ error?: string;
479
+ }
480
+ interface SandboxInfo {
481
+ sandboxId: string;
482
+ image: string;
483
+ name?: string;
484
+ metadata: Record<string, string>;
485
+ startedAt: string;
486
+ endAt?: string;
487
+ }
488
+ interface SandboxCommands {
489
+ run(command: string, options?: SandboxRunOptions): Promise<SandboxCommandResult>;
490
+ spawn(command: string, options?: SandboxSpawnOptions): Promise<SandboxCommandHandle>;
491
+ list(): Promise<ProcessInfo[]>;
492
+ kill(processId: string): Promise<boolean>;
493
+ }
494
+ interface SandboxFiles {
495
+ read(path: string): Promise<string | Uint8Array>;
496
+ write(path: string, content: string | Buffer | ArrayBuffer | Uint8Array): Promise<void>;
497
+ writeBatch(files: Array<{
498
+ path: string;
499
+ data: string | Buffer | ArrayBuffer | Uint8Array;
500
+ }>): Promise<void>;
501
+ makeDir(path: string): Promise<void>;
502
+ writeFromPath(sandboxPath: string, localPath: string): Promise<void>;
503
+ exists(path: string): Promise<boolean>;
504
+ list(path: string): Promise<FileInfo[]>;
505
+ remove(path: string): Promise<void>;
506
+ rename(oldPath: string, newPath: string): Promise<void>;
507
+ stat(path: string): Promise<FileInfo>;
508
+ readRange(path: string, range: FileRange): Promise<Uint8Array>;
509
+ watchDir(path: string, onEvent: (event: FilesystemEvent) => void | Promise<void>, options?: WatchOptions): Promise<WatchHandle>;
510
+ }
511
+ interface SandboxInstance {
512
+ readonly sandboxId: string;
513
+ readonly commands: SandboxCommands;
514
+ readonly files: SandboxFiles;
515
+ getHost(port: number): Promise<string>;
516
+ kill(): Promise<void>;
517
+ pause(): Promise<void>;
518
+ isRunning(): Promise<boolean>;
519
+ getInfo(): Promise<SandboxInfo>;
520
+ metrics(): Promise<SandboxMetrics | null>;
521
+ updateNetwork(network: SandboxNetworkPolicy): Promise<void>;
522
+ snapshot(options?: SandboxSnapshotOptions): Promise<SandboxSnapshot>;
523
+ fork(options?: SandboxForkOptions): Promise<SandboxInstance>;
524
+ }
525
+ /** What createDockerHost() takes (the SDK contract's DockerHostOptions). */
526
+ type DockerHostOptions = Pick<SandboxCreateOptions, "image" | "metadata" | "timeoutMs" | "resources" | "network" | "phaseNetworkPolicies">;
527
+ interface SandboxProvider {
528
+ readonly providerType: string;
529
+ readonly name?: string;
530
+ readonly supportsBootCommand?: boolean;
531
+ readonly supportsRegistryLogins?: boolean;
532
+ create(options: SandboxCreateOptions): Promise<SandboxInstance>;
533
+ connect(sandboxId: string, timeoutMs?: number): Promise<SandboxInstance>;
534
+ inspect(sandboxId: string, options?: SandboxInspectOptions): Promise<SandboxInstance>;
535
+ list(options?: SandboxListOptions): Promise<SandboxInfo[]>;
536
+ listAll(options?: SandboxListOptions): Promise<SandboxListPage>;
537
+ prepareImage(image?: string): Promise<void>;
538
+ deleteSnapshot(snapshotId: string): Promise<boolean>;
539
+ /** A sandbox with its own Docker daemon, commands as root; wait until `docker info` answers. */
540
+ createDockerHost(options: DockerHostOptions): Promise<SandboxInstance>;
541
+ }
542
+ type FetchLike = (input: string, init?: RequestInit & {
543
+ duplex?: "half";
544
+ }) => Promise<Response>;
545
+ /**
546
+ * Builds an image through Sail's SDK; injected in tests, lazily imported
547
+ * otherwise. `registryLogins` are the logins that apply to `ref` (wire form),
548
+ * empty for a public image.
549
+ */
550
+ type SailImageBuilder = (ref: string, apiKey: string, options: {
551
+ force?: boolean;
552
+ registryLogins?: SailRegistryLoginWire[];
553
+ }) => Promise<void>;
554
+ interface SailRequest {
555
+ method: "GET" | "POST" | "PUT" | "DELETE";
556
+ path: string;
557
+ host?: "sailbox" | "api";
558
+ query?: Record<string, string | number | boolean | undefined>;
559
+ json?: unknown;
560
+ body?: RequestInit["body"] | Uint8Array;
561
+ headers?: Record<string, string>;
562
+ timeoutMs?: number;
563
+ /** Retry 429-with-Retry-After and 5xx. Only for requests that are safe to repeat. */
564
+ retry?: boolean;
565
+ /** Read the error envelope but let these statuses through to the caller. */
566
+ allow?: number[];
567
+ }
568
+ declare class SailHttp {
569
+ #private;
570
+ private readonly sailboxApiUrl;
571
+ private readonly apiUrl;
572
+ private readonly fetchImpl;
573
+ constructor(apiKey: string, sailboxApiUrl: string, apiUrl: string, fetchImpl: FetchLike);
574
+ private url;
575
+ /** One request; non-2xx (outside `allow`) throws SailApiError with Sail's own message. */
576
+ request(req: SailRequest): Promise<Response>;
577
+ json<T>(req: SailRequest): Promise<T>;
578
+ }
579
+ interface ExecOutcome {
580
+ exitCode: number;
581
+ stdout: string;
582
+ stderr: string;
583
+ timedOut: boolean;
584
+ }
585
+ /** The body one exec sends; `user`/`cwd`/`env` are Sail's own per-exec fields. */
586
+ interface ExecBody {
587
+ command: string | string[];
588
+ timeout?: number;
589
+ cwd?: string;
590
+ env?: Record<string, string>;
591
+ user?: string;
592
+ open_stdin?: boolean;
593
+ idempotency_key?: string;
594
+ }
595
+ /**
596
+ * One exec, streamed. `onStarted` fires with Sail's exec id as soon as the
597
+ * `started` event arrives. A stream that drops before `exit` is finished
598
+ * through `POST .../exec/{id}/wait` (docs: "If the connection drops before
599
+ * exit, call wait") — its output tail is bounded, which is the documented
600
+ * trade.
601
+ */
602
+ declare function runExec(http: SailHttp, sailboxId: string, body: ExecBody, handlers?: {
603
+ onStarted?: (execId: string) => void;
604
+ onStdout?: (text: string) => void;
605
+ onStderr?: (text: string) => void;
606
+ /** Raw bytes instead of text (binary reads). */
607
+ onStdoutBytes?: (bytes: Uint8Array) => void;
608
+ maxOutput?: number;
609
+ }): Promise<ExecOutcome>;
610
+ /** Context every command/file operation shares: the box, its user and default cwd. */
611
+ interface SailBoxContext {
612
+ http: SailHttp;
613
+ sailboxId: string;
614
+ user: string;
615
+ workingDirectory?: string;
616
+ /**
617
+ * The create-time envs, applied to every command by exec `env` rather than
618
+ * stored on the Sailbox: Sail returns a box's create `env` in plain text to
619
+ * anyone in the org (and the SDK puts model keys and run tokens there).
620
+ * Per-command envs override them.
621
+ */
622
+ envs?: Record<string, string>;
623
+ }
624
+ declare class SailCommands implements SandboxCommands {
625
+ private readonly box;
626
+ /** Bytes already written to each open stdin, by exec id (offsets make retries safe). */
627
+ private readonly stdinOffsets;
628
+ constructor(box: SailBoxContext);
629
+ private body;
630
+ run(command: string, options?: SandboxRunOptions): Promise<SandboxCommandResult>;
631
+ /**
632
+ * Background process: the exec's stream stays open while it runs (Sail sends
633
+ * a heartbeat every 30 s), and the handle's processId is Sail's exec id —
634
+ * which is what kill() cancels and sendStdin() addresses.
635
+ */
636
+ spawn(command: string, options?: SandboxSpawnOptions): Promise<SandboxCommandHandle>;
637
+ list(): Promise<ProcessInfo[]>;
638
+ /**
639
+ * A Sail exec id (what spawn() hands out) is cancelled through Sail, forcibly;
640
+ * a numeric PID (what list() reports) is signalled in the box.
641
+ */
642
+ kill(processId: string): Promise<boolean>;
643
+ /** Write to a spawn({ stdin: true }) process's standard input. */
644
+ sendStdin(processId: string, data: string | Uint8Array): Promise<void>;
645
+ /** Close a spawn({ stdin: true }) process's standard input (EOF). */
646
+ closeStdin(processId: string): Promise<void>;
647
+ private writeStdin;
648
+ }
649
+ declare function parseFindRecords(output: string, dir: string | null): FileInfo[];
650
+ declare class SailFiles implements SandboxFiles {
651
+ private readonly box;
652
+ constructor(box: SailBoxContext);
653
+ private get base();
654
+ /** A root-owned bookkeeping command; returns the outcome without throwing on a non-zero exit. */
655
+ /** `sh` for the listing scripts, which are POSIX: an Alpine image has no bash. */
656
+ private rootExec;
657
+ private mustRootExec;
658
+ /** Hand a path to the sandbox user, as the other providers' writes do. No-op for root. */
659
+ private chownToUser;
660
+ read(path: string): Promise<string | Uint8Array>;
661
+ /** PUT one file as root (parents created), without the ownership hand-off. */
662
+ private put;
663
+ write(path: string, content: string | Buffer | ArrayBuffer | Uint8Array): Promise<void>;
664
+ writeBatch(files: Array<{
665
+ path: string;
666
+ data: string | Buffer | ArrayBuffer | Uint8Array;
667
+ }>): Promise<void>;
668
+ makeDir(path: string): Promise<void>;
669
+ /** Streams the local file as the request body: peak memory is one chunk, never the file. */
670
+ writeFromPath(sandboxPath: string, localPath: string): Promise<void>;
671
+ exists(path: string): Promise<boolean>;
672
+ list(path: string): Promise<FileInfo[]>;
673
+ /** The entry itself, a symlink never followed (find without -L). */
674
+ stat(path: string): Promise<FileInfo>;
675
+ /**
676
+ * Exactly the bytes asked for, through a minted download URL: Sail serves it
677
+ * with byte ranges (206), so the file never crosses the wire whole.
678
+ */
679
+ readRange(path: string, range: FileRange): Promise<Uint8Array>;
680
+ remove(path: string): Promise<void>;
681
+ rename(oldPath: string, newPath: string): Promise<void>;
682
+ /** Sail has no filesystem watch API; callers poll list(), as on Daytona. */
683
+ watchDir(_path: string, _onEvent: (event: FilesystemEvent) => void | Promise<void>, _options?: WatchOptions): Promise<WatchHandle>;
684
+ /** A signed HTTPS URL that serves one file with no API key (up to 7 days). */
685
+ downloadUrl(path: string, expiresInSeconds?: number): Promise<string>;
686
+ }
687
+ /** The subset of Sail's Sailbox object this adapter reads (OpenAPI schema "Sailbox"). */
688
+ interface SailboxRecord {
689
+ sailbox_id: string;
690
+ name?: string;
691
+ app_id?: string;
692
+ image_id?: string;
693
+ status: string;
694
+ vcpu_count?: number;
695
+ memory_mib?: number;
696
+ cpu_used_vcpu?: number;
697
+ memory_used_bytes?: number;
698
+ disk_used_bytes?: number;
699
+ env?: Record<string, string>;
700
+ started_at?: string | null;
701
+ error_message?: string | null;
702
+ }
703
+ /** What fork() needs from the provider: start a copy from a checkpoint (the same path as create({ fromSnapshot })). */
704
+ type SailStartFromCheckpoint = (checkpointId: string, timeoutMs: number | undefined, box: {
705
+ user: string;
706
+ workingDirectory?: string;
707
+ envs?: Record<string, string>;
708
+ }) => Promise<SandboxInstance>;
709
+ declare class SailSandboxImpl implements SandboxInstance {
710
+ private readonly http;
711
+ readonly sandboxId: string;
712
+ private readonly user;
713
+ private readonly workingDirectory?;
714
+ private readonly envs?;
715
+ private readonly startFromCheckpoint?;
716
+ readonly commands: SailCommands;
717
+ readonly files: SailFiles;
718
+ constructor(http: SailHttp, sandboxId: string, user: string, workingDirectory?: string | undefined, envs?: Record<string, string> | undefined, startFromCheckpoint?: SailStartFromCheckpoint | undefined);
719
+ private get base();
720
+ private retrieve;
721
+ /** Publishes the port as an HTTPS listener (idempotent: publishing again replaces it) and returns its host. */
722
+ getHost(port: number): Promise<string>;
723
+ kill(): Promise<void>;
724
+ pause(): Promise<void>;
725
+ isRunning(): Promise<boolean>;
726
+ getInfo(): Promise<SandboxInfo>;
727
+ /**
728
+ * Sail's latest observed usage, from the Sailbox record. Sail reports zeros
729
+ * when it has no recent sample, which is answered as null (no sample yet),
730
+ * not as an idle box. The record carries no sample time, so `sampledAt` is
731
+ * when Sail answered.
732
+ */
733
+ metrics(): Promise<SandboxMetrics | null>;
734
+ updateNetwork(network: SandboxNetworkPolicy): Promise<void>;
735
+ /** One checkpoint, under one idempotency key so a retried request cannot take two. */
736
+ private checkpoint;
737
+ /**
738
+ * Sail checkpoint (`POST /sailboxes/{id}/checkpoint`): "Saves the Sailbox's
739
+ * filesystem and, by default, memory as a checkpoint you can start new
740
+ * Sailboxes from ... The Sailbox is left as it was". `kind` maps to
741
+ * `include_memory`; the expiry is always sent (`ttl_seconds`, default 7
742
+ * days), since Sail reads 0 or an absent value as its own default.
743
+ */
744
+ snapshot(options?: SandboxSnapshotOptions): Promise<SandboxSnapshot>;
745
+ /**
746
+ * A running copy: a memory checkpoint that lives an hour, a Sailbox started
747
+ * from it, then the checkpoint deleted ("Sailboxes already started from it
748
+ * keep running"). A checkpoint that cannot be deleted still expires within
749
+ * the hour. The copy runs as this box's user with its envs.
750
+ */
751
+ fork(options?: SandboxForkOptions): Promise<SandboxInstance>;
752
+ }
753
+ interface SailConfig {
754
+ /** Sail API key. Default: SAIL_API_KEY. */
755
+ apiKey?: string;
756
+ /** Sailbox API base. Default https://sailbox-api.sailresearch.com/v1. */
757
+ sailboxApiUrl?: string;
758
+ /** Main API base (apps). Default https://api.sailresearch.com/v1. */
759
+ apiUrl?: string;
760
+ /** The Sail app every Sailbox this provider creates belongs to. Default "evolve-sandbox". */
761
+ appName?: string;
762
+ /** Default image (provider-neutral name or registry ref). Default 'evolve-all-<EVOLVE_IMAGE_VERSION>'. */
763
+ imageName?: string;
764
+ /** Lifetime when create() names none. Default 1 hour. */
765
+ defaultTimeoutMs?: number;
766
+ /**
767
+ * Sail's automatic sleep for idle boxes. Omitted: Sail's own default (on).
768
+ * `false` keeps every box awake until it ends; a number is the idle window
769
+ * in seconds (0–3600) before Sail may sleep it. Sleep keeps memory and disk
770
+ * and wakes on the next command, so it changes cost, not results.
771
+ */
772
+ autoSleep?: boolean | number;
773
+ /**
774
+ * Logins for PRIVATE images (see SailRegistryLogin): a list, or a function
775
+ * asked with the full image ref before each build and each create, so a
776
+ * short-lived token (an ECR one) is minted fresh. Only the logins whose
777
+ * prefix covers the image are sent to Sail. Public images need none.
778
+ */
779
+ registryLogins?: SailRegistryLoginsOption;
780
+ /** @internal Tests inject fetch. */
781
+ fetch?: FetchLike;
782
+ /** @internal Tests inject the image builder. */
783
+ buildImage?: SailImageBuilder;
784
+ /** @internal Tests inject the Dockerfile builder of `evolve run --local`. */
785
+ buildDockerfileImage?: (spec: SailTaskImageSpec, apiKey: string) => Promise<SailDockerfileImageSpec>;
786
+ }
787
+ /**
788
+ * The slice of `@sailresearch/sdk` (0.21.x) the builder calls, typed here
789
+ * because the SDK is an OPTIONAL dependency (native module, engines node >= 22)
790
+ * that an npm install on older Node skips — so its own types cannot be a
791
+ * compile-time import. ./sdk-loader.ts fetches it on the first build then.
792
+ * Registry logins (`Secret`, the `fromRegistry` login options, `fromAwsEcr`,
793
+ * `fromGcpArtifactRegistry`) arrived after 0.17; a private build on an older
794
+ * SDK is refused by name rather than sent anonymously.
795
+ */
796
+ interface SailSdkBuildable {
797
+ build(options: {
798
+ client?: unknown;
799
+ forceBuild?: boolean;
800
+ timeoutSeconds?: number;
801
+ }): Promise<unknown>;
802
+ }
803
+ interface SailSdkModule {
804
+ Client: {
805
+ fromConfig(config: {
806
+ apiKey: string;
807
+ }): unknown;
808
+ };
809
+ Image: {
810
+ fromRegistry(ref: string, options?: {
811
+ username?: string;
812
+ password?: unknown;
813
+ }): SailSdkBuildable;
814
+ fromAwsEcr?(ref: string, options: {
815
+ accessKeyId: string;
816
+ secretAccessKey: unknown;
817
+ }): SailSdkBuildable;
818
+ fromGcpArtifactRegistry?(ref: string, options: {
819
+ keyJson: unknown;
820
+ }): SailSdkBuildable;
821
+ };
822
+ Secret?: {
823
+ named(name: string): unknown;
824
+ ephemeral(value: string): unknown;
825
+ };
826
+ }
827
+ /** Why no image can be built here, asked before a run starts; null when it can: Sail builds through its SDK, which is fetched when npm left it out. */
828
+ declare function sailBuilderMissing(): Promise<string | null>;
829
+ /** The SDK image definition for one registry ref, pulled with `login` when one applies. */
830
+ declare function sdkImageFor(sdk: SailSdkModule, ref: string, login: SailRegistryLoginWire | undefined): SailSdkBuildable;
831
+ /**
832
+ * Sail refuses an image that is not Debian- or Ubuntu-based at its build
833
+ * ("unsupported base distro: alpine; the image must be Debian- or
834
+ * Ubuntu-based", live 2026-11-30, no box created). That is a capability
835
+ * refusal, typed the same on every provider (REFUSAL-SPEC image.baseDistro);
836
+ * any other build failure passes through unchanged.
837
+ */
838
+ declare function baseDistroRefusal(err: unknown): SandboxFeatureUnsupportedError | undefined;
839
+ declare class SailProvider implements SandboxProvider {
840
+ #private;
841
+ readonly providerType: "sail";
842
+ readonly name = "Sail";
843
+ /** Sail takes no create-time argv (see SailBootCommandError). */
844
+ readonly supportsBootCommand = false;
845
+ /** Private images pull with `registryLogins` (hosts feature-detect this). */
846
+ readonly supportsRegistryLogins = true;
847
+ private readonly http;
848
+ private readonly appName;
849
+ private readonly imageName;
850
+ private readonly defaultTimeoutMs;
851
+ private readonly autoSleep?;
852
+ private readonly buildImage;
853
+ private readonly buildDockerfileImage;
854
+ private appId;
855
+ /** Images built by this process, so a 409 is answered by one build, not one per create. */
856
+ private readonly builds;
857
+ /** Task images buildTaskImage built from a Dockerfile, by name: create({ image: name }) boots one; `build` builds it again. */
858
+ private readonly taskImages;
859
+ /**
860
+ * Create-time user, cwd and envs, reapplied on connect() in this process.
861
+ * In-memory, like Modal's user map: a connect() from another process gets
862
+ * the default user and NO create-time envs (they were never stored on Sail,
863
+ * on purpose — see create()), so pass them per command there.
864
+ */
865
+ private readonly boxes;
866
+ constructor(config?: SailConfig);
867
+ /** The checked, wire-form logins that apply to one image (none for a Sail base image). */
868
+ private loginsFor;
869
+ /** The app id, found or minted once per provider (`POST /apps/find`). */
870
+ private getAppId;
871
+ private autoSleepParam;
872
+ /**
873
+ * Build the image once per process (SDK), shared by every create that hit
874
+ * 409 on it. A distro Sail cannot build is refused typed (image.baseDistro).
875
+ */
876
+ private ensureBuilt;
877
+ /**
878
+ * A task's image for `evolve run --local` (Harbor's Sail environment
879
+ * start): the Dockerfile built with its context, or the registry image
880
+ * built as create() would. create({ image }) with the returned name boots it.
881
+ */
882
+ buildTaskImage(spec: SailTaskImageSpec): Promise<SailTaskImage>;
883
+ prepareImage(image?: string): Promise<void>;
884
+ create(options: SandboxCreateOptions): Promise<SandboxInstance>;
885
+ /** Sail's devbox base runs systemd, which starts Docker at boot (SDK ImageSpec.base). */
886
+ createDockerHost(options: DockerHostOptions): Promise<SandboxInstance>;
887
+ /**
888
+ * create({ fromSnapshot }): `POST /sailboxes/from_checkpoint`. The request
889
+ * takes only a lifetime and a name; the copy keeps the source's image,
890
+ * size, stored metadata and egress policy. So `image`, `resources` and
891
+ * `metadata` are refused rather than dropped, and a `network` policy is
892
+ * applied right after the copy starts (the copy runs the source's policy
893
+ * until then; for a sealed copy, snapshot a sealed source).
894
+ */
895
+ private createFromCheckpoint;
896
+ /** The from_checkpoint call itself, shared by create({ fromSnapshot }) and fork(). */
897
+ private startFromCheckpoint;
898
+ private boxFor;
899
+ /** `DELETE /sailbox-checkpoints/{id}`; copies already started from it keep running. */
900
+ deleteSnapshot(snapshotId: string): Promise<boolean>;
901
+ /** create → on 409 for an unbuilt image, build it (SDK) and create again under a fresh key. */
902
+ private createWithBuild;
903
+ /**
904
+ * One LOGICAL create, under ONE idempotency key for every attempt: a retry
905
+ * that repeats key and byte-identical body gets Sail's first answer back
906
+ * instead of running again (docs: Retrying safely). A 429 with Retry-After
907
+ * never ran and is simply retried. A 5xx or a dropped connection is the case
908
+ * Sail's docs flag — "the error can arrive after the Sailbox exists, and a
909
+ * retry can leave you with two" — so the box is looked up by its unique name
910
+ * before anything is sent again, and once more before giving up, so a box
911
+ * that did come up is returned rather than orphaned.
912
+ */
913
+ private createOnce;
914
+ private findByName;
915
+ private retrieve;
916
+ /** Attach, resuming a paused box. A box that is gone refuses typed. */
917
+ connect(sandboxId: string, _timeoutMs?: number): Promise<SandboxInstance>;
918
+ /**
919
+ * Attach for reads only: never resumes a paused box. A SLEEPING box counts as
920
+ * running — Sail wakes it on the next request by itself, which is its idle
921
+ * state, not a stop anyone asked for.
922
+ */
923
+ inspect(sandboxId: string, options?: SandboxInspectOptions): Promise<SandboxInstance>;
924
+ list(options?: SandboxListOptions): Promise<SandboxInfo[]>;
925
+ listAll(options?: SandboxListOptions): Promise<SandboxListPage>;
926
+ }
927
+ /** One page of `GET /sailboxes`, as collectSailboxes consumes it. */
928
+ type SailListPageFetcher = (offset: number) => Promise<{
929
+ data: SailboxRecord[];
930
+ has_more: boolean;
931
+ }>;
932
+ /**
933
+ * Walk `GET /sailboxes` to exhaustion; never throws. A limit that stopped the
934
+ * walk while more Sailboxes existed, a failed page, or the page ceiling all
935
+ * answer `complete: false` with what was seen (types.ts listAll law).
936
+ */
937
+ declare function collectSailboxes(fetchPage: SailListPageFetcher, options?: SandboxListOptions): Promise<SandboxListPage>;
938
+ /**
939
+ * Create a Sail sandbox provider.
940
+ *
941
+ * ```ts
942
+ * import { Evolve, createSailProvider } from "@evolvingmachines/evolve";
943
+ * const kit = new Evolve()
944
+ * .withAgent({ agentType: "claude" })
945
+ * .withSandbox(createSailProvider({ apiKey: process.env.SAIL_API_KEY }));
946
+ * ```
947
+ */
948
+ declare function createSailProvider(config?: SailConfig): SailProvider;
949
+ declare const _testResolveImageRef: typeof resolveImageRef;
950
+ declare const _testRegistryLoginsFor: typeof registryLoginsFor;
951
+ declare const _testPickLogin: typeof pickLogin;
952
+ declare const _testSdkImageFor: typeof sdkImageFor;
953
+ declare const _testBaseDistroRefusal: typeof baseDistroRefusal;
954
+ declare const _testFindRefusesPrintf: typeof listingToolsMissing;
955
+ declare const _testMapResources: typeof mapResources;
956
+ declare const _testMapNetworkPolicy: typeof mapNetworkPolicy;
957
+ declare const _testEncodeMetadata: typeof encodeMetadata;
958
+ declare const _testDecodeMetadata: typeof decodeMetadata;
959
+ declare const _testCollectSailboxes: typeof collectSailboxes;
960
+ declare const _testParseFindRecords: typeof parseFindRecords;
961
+ declare const _testRunExec: typeof runExec;
962
+ type _testSailSandboxImpl = SailSandboxImpl;
963
+
964
+ export { type DockerHostOptions, EVOLVE_IMAGE_VERSION, type FileInfo, type FileRange, type FilesystemEvent, ImageBuildError, type ProcessInfo, SAIL_API_URL, SAIL_DEFAULT_VCPUS, SAIL_MAX_DISK_GIB, SAIL_MAX_ENV_VALUE_CHARS, SAIL_MAX_LIST_PAGES, SAIL_MAX_MEMORY_GIB, SAIL_MAX_PAGE_SIZE, SAIL_MAX_REGISTRY_LOGINS, SAIL_MAX_VCPUS, SAIL_METADATA_ENV, SAIL_MIN_DISK_GIB, SAIL_SAILBOX_API_URL, SAIL_SNAPSHOT_DEFAULT_TTL_MS, SailApiError, SailBootCommandError, SailCommandTimeoutError, SailCommands, type SailConfig, SailCreateFailedError, type SailEgressDocument, SailFiles, SailHttp, SailIdleTimeoutError, type SailImageBuilder, SailImageError, type SailImageSpec, type SailListPageFetcher, SailMetadataError, SailNetworkPolicyError, type SailNetworkPolicyReason, SailProvider, type SailRegistryLogin, SailRegistryLoginError, type SailRegistryLoginKind, type SailRegistryLoginWire, type SailRegistryLoginsOption, SailResourcesError, type SailSizing, type SailTaskImage, type SailTaskImageSpec, type SailboxRecord, type SandboxCommandHandle, type SandboxCommandResult, type SandboxCommands, type SandboxCreateOptions, SandboxFeatureUnsupportedError, type SandboxFiles, type SandboxForkOptions, type SandboxInfo, type SandboxInspectOptions, type SandboxInstance, type SandboxListOptions, type SandboxListPage, type SandboxMetrics, type SandboxNetworkPolicy, SandboxNotRunningError, SandboxPathNotFoundError, type SandboxProvider, type SandboxRunOptions, type SandboxSnapshot, type SandboxSnapshotKind, type SandboxSnapshotOptions, type SandboxSpawnOptions, type WatchHandle, type WatchOptions, _testBaseDistroRefusal, _testCollectSailboxes, _testDecodeMetadata, _testEncodeMetadata, _testFindRefusesPrintf, _testMapNetworkPolicy, _testMapResources, _testParseFindRecords, _testPickLogin, _testRegistryLoginsFor, _testResolveImageRef, _testRunExec, type _testSailSandboxImpl, _testSdkImageFor, createSailProvider, isSandboxFeatureUnsupportedError, isSandboxNotRunningError, isSandboxPathNotFoundError, sailBuilderMissing, sailMemoryFloorGib };