@tangle-network/sandbox 1.0.236 → 1.0.238

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.
Files changed (68) hide show
  1. package/dist/agent/index.d.ts +4 -4
  2. package/dist/agent/index.js +5 -5
  3. package/dist/agent/preview.d.ts +1 -1
  4. package/dist/agent/preview.js +2 -2
  5. package/dist/{agent-execution-preparation-BJChICex.js → agent-execution-preparation-CjKTjmJ9.js} +3 -3
  6. package/dist/{agent-execution-preparation-receipt-BIFxqyr5.js → agent-execution-preparation-receipt-AihkqLnd.js} +4 -4
  7. package/dist/{agent-run-outcome-CEf6hJYp.d.ts → agent-run-outcome-DrhA0Z4S.d.ts} +2 -2
  8. package/dist/{api-request-DXF7sotx.js → api-request-wjUrfDvm.js} +1 -1
  9. package/dist/auth/index.d.ts +2 -2
  10. package/dist/auth/index.js +2 -2
  11. package/dist/{browser-interactive-control-controller-CcUjQEfa.d.ts → browser-interactive-control-controller-9RauUsHw.d.ts} +1 -1
  12. package/dist/{browser-interactive-control-controller-DL5Cz1_6.js → browser-interactive-control-controller-BDVXcCnz.js} +14 -14
  13. package/dist/{chunked-upload-BlvgxPWx.js → chunked-upload-B1kuuezC.js} +1 -1
  14. package/dist/{chunked-upload-file-DOeLpMO0.js → chunked-upload-file-DtAW52iW.js} +1 -1
  15. package/dist/cli-auth-bundle-BinY89CX.js +2 -0
  16. package/dist/{cli-auth-bundle-C6DtK7GX-mBUPER0R.js → cli-auth-bundle-C6DtK7GX-DoqlFTT-.js} +1 -1
  17. package/dist/{client-OYkwBKG2.d.ts → client-DsXWyLrM.d.ts} +79 -114
  18. package/dist/{client-BiKIhMtW.js → client-eoEoMzDD.js} +20 -117
  19. package/dist/collaboration/index.d.ts +1 -1
  20. package/dist/collaboration/index.js +1 -1
  21. package/dist/{collaboration-CpKTrw6R.js → collaboration-jvzPekSe.js} +2 -2
  22. package/dist/core.d.ts +7 -7
  23. package/dist/core.js +6 -6
  24. package/dist/{errors-nXGKGVFe.js → errors-DQEu-Q7s.js} +20 -21
  25. package/dist/{file-download-BjkrYzy_.js → file-download-CihyMYH-.js} +2 -2
  26. package/dist/{harness-DMaNgn0S.js → harness-C5lXV9e5.js} +5 -5
  27. package/dist/{index-C8YpXh5N.d.ts → index-B_1aVs2B.d.ts} +14 -88
  28. package/dist/index.d.ts +13 -12
  29. package/dist/index.js +13 -13
  30. package/dist/intelligence/index.d.ts +13 -6
  31. package/dist/intelligence/index.js +61 -9
  32. package/dist/interactive-control.d.ts +1 -1
  33. package/dist/interactive-control.js +1 -1
  34. package/dist/{interactive-controller-CJ7BBRpv.d.ts → interactive-controller-C2vOFe0u.d.ts} +3 -3
  35. package/dist/{interactive-controller-Blf5CLeI.js → interactive-controller-CDqa41yU.js} +7 -7
  36. package/dist/{lines-CSGBHEjR.js → lines-Bsp1TFBM.js} +1 -1
  37. package/dist/{lines-CCJZUrBP.d.ts → lines-CxWFuuJ3.d.ts} +1 -1
  38. package/dist/lines.d.ts +1 -1
  39. package/dist/lines.js +1 -1
  40. package/dist/{local-cli-auth-CO0byocv.js → local-cli-auth-DrNihS9-.js} +1 -1
  41. package/dist/{mcp-local-oIc-ZtHF.js → mcp-local-CbzPG05W.js} +2 -2
  42. package/dist/{preview-zpWYtsDJ.d.ts → preview-DFFaAZdF.d.ts} +3 -3
  43. package/dist/{profile-schema-C1KpT-wS.js → profile-schema-C0n0VgmA.js} +468 -36
  44. package/dist/{public-templates-DCFFPDEB.d.ts → public-templates-xqtPv6pg.d.ts} +2 -2
  45. package/dist/public-templates.d.ts +1 -1
  46. package/dist/public-templates.js +1 -1
  47. package/dist/{raw-evidence-archive-Cz4j8VMw.js → raw-evidence-archive-DLNEUdij.js} +3 -15
  48. package/dist/raw-evidence-export-C0ieFpi2.d.ts +354 -0
  49. package/dist/raw-evidence-export-C6Xdl3nC.js +19 -0
  50. package/dist/runtime.d.ts +5 -5
  51. package/dist/runtime.js +5 -5
  52. package/dist/{sandbox-C1Ffpg9v.js → sandbox-nYoBbiu1.js} +116 -155
  53. package/dist/{select-seat-B4Y-7vIq.js → select-seat-BHHUFoKh.js} +5 -5
  54. package/dist/select-seat-command.d.ts +2 -2
  55. package/dist/select-seat-command.js +2 -2
  56. package/dist/session-gateway/index.js +1 -1
  57. package/dist/tangle/index.d.ts +1 -1
  58. package/dist/tangle/index.js +1 -1
  59. package/dist/{tangle-CL6wrVuO.js → tangle-BaGQdAZk.js} +3 -3
  60. package/dist/{terminal-stream-types-eE97lZ-5.d.ts → terminal-stream-types-D7dMd-NV.d.ts} +40 -26
  61. package/dist/{types-B5GAxo6l.d.ts → types-ImZuAuFG.d.ts} +299 -1521
  62. package/package.json +7 -7
  63. package/dist/cli-auth-bundle-BLAtE6Dc.js +0 -2
  64. /package/dist/{cli-auth-bundle-B91fSxkR.d.ts → cli-auth-bundle-eUl7Sa1x.d.ts} +0 -0
  65. /package/dist/{direct-http2-Bgb2lHte.js → direct-http2-zLxsvF44.js} +0 -0
  66. /package/dist/{index-o31uwAkX.d.ts → index-BTXyTVq4.d.ts} +0 -0
  67. /package/dist/{index-C-_HY5NY.d.ts → index-ClusTWYM.d.ts} +0 -0
  68. /package/dist/{sha2-vu4U-x2L.js → sha2-BIoWepwn.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { Ct as InteractionRequest, Dt as AgentProfileConfidential, Et as AgentProfileCapabilities, It as ProxySecretReceipt, Nt as AgentProfileValidationResult, Pt as ReasoningEffort, Rt as PlanContinuation, Tt as AgentProfile, Z as BatchBackendInput, a as TerminalStreamOptions, g as TerminalReadyInfo, i as TerminalStreamHandlers, nt as SandboxSizePreset, q as SandboxCreateReceipt, rt as AgentRuntimeAttachments, s as TerminalStreamToken, t as TerminalAttachTimings, yt as AgentExactRunControlRef } from "./terminal-stream-types-eE97lZ-5.js";
2
- import { t as CliAuthReference } from "./cli-auth-bundle-B91fSxkR.js";
1
+ import { $ as BatchBackendInput, B as SandboxErrorMetadata, Bt as PlanContinuation, Ct as AgentRuntimeAttachments, Dt as AgentProfile, Ft as AgentProfileValidationResult, It as ReasoningEffort, Ot as AgentProfileCapabilities, Rt as ProxySecretReceipt, Tt as InteractionRequest, Y as SandboxCreateReceipt, a as TerminalStreamOptions, bt as AgentExactRunControlRef, g as TerminalReadyInfo, i as TerminalStreamHandlers, it as SandboxSizePreset, kt as AgentProfileConfidential, s as TerminalStreamToken, t as TerminalAttachTimings } from "./terminal-stream-types-D7dMd-NV.js";
2
+ import { t as CliAuthReference } from "./cli-auth-bundle-eUl7Sa1x.js";
3
3
  import { z } from "zod";
4
4
  //#region ../../../packages/runtime-contracts/dist/backend-types.d.ts
5
5
  /** This distribution's backend vocabulary. Gemini is only a backing transport, not a direct backend. */
@@ -108,347 +108,6 @@ type InteractionResolutionAcknowledgement = z.infer<typeof interactionResolution
108
108
  //#region ../../../packages/runtime-contracts/dist/model-key-proxy.d.ts
109
109
  declare function baseProxyToken(token: string): string;
110
110
  //#endregion
111
- //#region ../../../packages/runtime-contracts/dist/raw-evidence-export.d.ts
112
- /** Wire contract for bounded native evidence archives, per session and box-wide. */
113
- interface RawEvidencePayloadFile {
114
- /** Safe relative path below the exported directory; never an absolute native path. */
115
- path: string;
116
- sizeBytes: number;
117
- sha256: `sha256:${string}`;
118
- }
119
- interface RawEvidenceRecordsFile extends RawEvidencePayloadFile {
120
- format: "ndjson";
121
- /** Number of complete records, in original order. */
122
- records: number;
123
- }
124
- interface RawEvidenceNativeMetadata {
125
- sourceId?: string;
126
- rootScope: "session-home" | "workspace-session";
127
- path: string;
128
- kind: "file" | "directory" | "symlink";
129
- mode: number;
130
- uid: number;
131
- gid: number;
132
- mtimeMs: number;
133
- ctimeMs: number;
134
- sizeBytes: number;
135
- }
136
- type RawEvidenceNativeFile = RawEvidenceNativeMetadata & {
137
- sha256?: string;
138
- linkTarget?: string; /** Replaces contentBase64 for regular files. Symlinks remain metadata only. */
139
- content?: RawEvidencePayloadFile;
140
- /**
141
- * The request's `omitContent` names this file's directory: the file has
142
- * its metadata and no `content` or `sha256`, and its bytes stay on the box.
143
- */
144
- contentOmitted?: true;
145
- };
146
- interface RawEvidenceArchiveAttempt {
147
- executionId: string;
148
- ordinal: number;
149
- providerSessionId: string;
150
- nativeSessionIds: string[];
151
- processIds: string[];
152
- outcome: "succeeded" | "failed" | "cancelled" | "unknown";
153
- missingReasons: string[];
154
- }
155
- interface RawEvidenceArchiveEventMetadata {
156
- executionId: string;
157
- sessionId: string;
158
- status: "active" | "completed" | "failed" | "cancelled";
159
- startedAt: number;
160
- completedAt?: number;
161
- eventCount: number;
162
- lastEventId: string;
163
- }
164
- /** Payload references replace only inline content and aggregate record arrays. */
165
- interface RawEvidenceArchiveManifest {
166
- schema: "tangle.raw-evidence-archive.v1";
167
- status: "captured" | "partial";
168
- sessionId: string;
169
- backendType: string;
170
- nativeSessionId: string | null;
171
- proofStatus: "verified" | "unverified";
172
- containerId?: string;
173
- sidecarImageDigest: string;
174
- sidecarBundleRevision: string;
175
- sidecarBundleChecksum?: string;
176
- nativeRoots: Array<{
177
- sourceId?: string;
178
- rootScope: "session-home" | "workspace-session";
179
- path: string;
180
- }>;
181
- /**
182
- * The request's `omitContent` prefixes, present only when it named some.
183
- * A prefix that covers or enters the harness's native session store is
184
- * refused with 400, so the session store always keeps its bytes.
185
- */
186
- omitContent?: string[];
187
- files: RawEvidenceNativeFile[];
188
- excluded: Array<RawEvidenceNativeMetadata & {
189
- reason: "credential";
190
- }>;
191
- skipped: Array<{
192
- sourceId?: string;
193
- rootScope: "session-home" | "workspace-session";
194
- path: string;
195
- reason: string;
196
- }>;
197
- inventory: Record<string, number>;
198
- /** NDJSON rows carry the processIo record fields, with content: RawEvidencePayloadFile in place of contentBase64. */
199
- processIo: RawEvidenceRecordsFile;
200
- /** NDJSON rows have exactly the fields of processTerminals entries. */
201
- processTerminals: RawEvidenceRecordsFile;
202
- processSources: Array<{
203
- sourceId: string;
204
- sizeBytes: number;
205
- sha256: string; /** Exact source spool bytes; replaces contentBase64. */
206
- content: RawEvidencePayloadFile;
207
- }>;
208
- events: Array<{
209
- metadata: RawEvidenceArchiveEventMetadata; /** Canonical reconstructed BufferedEvent rows, in original event order. */
210
- frames: RawEvidenceRecordsFile;
211
- }>;
212
- attempts: RawEvidenceArchiveAttempt[];
213
- evidenceSources: Array<{
214
- executionId: string;
215
- sourceId: string;
216
- backendType: string;
217
- runtimeHome: string;
218
- credentialPaths: string[];
219
- }>;
220
- completeness: {
221
- nativeStore: boolean;
222
- processIo: boolean;
223
- events: boolean;
224
- };
225
- coverageComplete: boolean;
226
- missingReasons: string[];
227
- }
228
- /** One store file of a native session copy (harness session contract). */
229
- interface NativeSessionCopyFile extends RawEvidencePayloadFile {
230
- /** The store root the file belongs to, relative to the runtime HOME, e.g. `.pi/agent/sessions`. */
231
- store: string;
232
- /** The file's own path relative to the runtime HOME, e.g. `.pi/agent/sessions/<ts>_<id>.jsonl`. */
233
- storePath: string;
234
- /** A `@tangle-network/harness-sessions` SessionFormatId. */
235
- format: string;
236
- /** byte-prefix: append-only JSONL cut at its last complete line; atomic-file: a whole file read twice the same; sqlite-backup: VACUUM INTO. */
237
- method: "byte-prefix" | "atomic-file" | "sqlite-backup";
238
- /** The source was larger than the per-file bound; this is its prefix. */
239
- truncated: boolean;
240
- /** Source size when copied. */
241
- sourceBytes: number;
242
- }
243
- /**
244
- * One execution attempt's native session. `snapshot` was taken while the
245
- * harness ran; `settled` after its process exited, whatever the outcome.
246
- * Consumers find sessions here, never by matching paths in `files`.
247
- */
248
- interface NativeSessionCopy {
249
- harness: string;
250
- /** Format of the session files found (the first, when a harness has several stores). */
251
- format: string | null;
252
- executionId: string;
253
- attempt: number;
254
- nativeSessionId: string;
255
- copy: "snapshot" | "settled";
256
- capturedAt: string;
257
- /** Null fields are not observed at the copy point; the archive's process records carry them. */
258
- process: {
259
- pid: number | null;
260
- exitedAt: string | null;
261
- exitCode: number | null;
262
- signal: string | null;
263
- outcome: "succeeded" | "failed" | "cancelled" | "unknown";
264
- };
265
- files: NativeSessionCopyFile[];
266
- /**
267
- * Store files of a settled copy whose bytes the sidecar released because a
268
- * newer settled copy of the same store file holds them. Each is also named
269
- * in missingReasons as `settled_copy_superseded:<storePath>`.
270
- */
271
- superseded?: NativeSessionCopySuperseded[];
272
- complete: boolean;
273
- /** native_session_id_unobserved | native_session_files_missing | over_bound:<path> | settled_copy_superseded:<path> | ... */
274
- missingReasons: string[];
275
- }
276
- /** A settled store file released in favour of a newer copy of the same file. */
277
- interface NativeSessionCopySuperseded {
278
- storePath: string;
279
- /** The released payload's digest and size, as settled. */
280
- sha256: string;
281
- sizeBytes: number;
282
- /**
283
- * The settled copy that held the newer copy when this one was released.
284
- * That copy may itself be released later; following the chain ends at the
285
- * copy that holds the store file's bytes.
286
- */
287
- supersededBy: {
288
- executionId: string;
289
- attempt: number;
290
- };
291
- }
292
- /** v1 plus the per-attempt native session copies. Served when the caller asks for a copy. */
293
- interface RawEvidenceArchiveManifestV2 extends Omit<RawEvidenceArchiveManifest, "schema"> {
294
- schema: "tangle.raw-evidence-archive.v2";
295
- nativeSessions: NativeSessionCopy[];
296
- /**
297
- * Present when the caller asked for `home=skip`: `nativeRoots`, `files`,
298
- * `excluded`, `skipped` and `inventory` are empty because the HOME walk was
299
- * not taken, and the harness runtime was left running.
300
- */
301
- homeWalk?: "skipped";
302
- }
303
- /**
304
- * v2 as served to a caller that asked for `parts=native`: the manifest and the
305
- * native session copies, nothing else. The event log and the process stream
306
- * were left out by request, so `processIo` and `processTerminals` are absent,
307
- * `processSources` and `events` are empty, the HOME walk is skipped, `status`
308
- * is `partial`, and `missingReasons` names `events_not_requested` and
309
- * `process_io_not_requested`. Each copy's own `complete` says whether that
310
- * session was copied whole.
311
- */
312
- interface RawEvidenceArchiveManifestNative extends Omit<RawEvidenceArchiveManifestV2, "processIo" | "processTerminals" | "homeWalk"> {
313
- parts: "native";
314
- homeWalk: "skipped";
315
- }
316
- interface RawEvidenceUnavailable {
317
- status: "unavailable";
318
- sessionId: string;
319
- backendType: string;
320
- reason: string;
321
- }
322
- interface RawEvidenceExportOptions {
323
- /** Bound all uncompressed archive member bytes, including metadata and records. */
324
- maxBytes: number;
325
- /**
326
- * Request native session copies (manifest v2). `latest` returns the
327
- * settled copy when one exists, otherwise a fresh snapshot; `settled`
328
- * fails with 409 not_settled while the harness still runs.
329
- */
330
- copy?: "latest" | "settled";
331
- /** Restrict native session copies to one sidecar execution. */
332
- executionId?: string;
333
- /**
334
- * `native` asks for the native session copies alone (requires `copy`): no
335
- * event log, process stream or HOME walk, so `maxBytes` bounds the copies
336
- * and the manifest. The result's manifest is a
337
- * {@link RawEvidenceArchiveManifestNative}. A sidecar older than the option
338
- * ignores it and serves the full archive, within the same bounds.
339
- */
340
- parts?: "native";
341
- /**
342
- * Session-HOME-relative directory prefixes, each ending in `/` (for
343
- * example `.codex/plugins/cache/`). The HOME walk names each file below
344
- * one with its metadata and `contentOmitted: true`, and never reads its
345
- * bytes. Use it for directories a harness downloads again, so their bytes
346
- * do not cross the network. At most 64 prefixes of at most 512 characters;
347
- * not with `parts`. A prefix that covers or enters the harness's native
348
- * session store is refused. A sidecar older than the option ignores it and
349
- * sends every file's bytes, so keep `maxBytes` sized for the whole HOME
350
- * until every sidecar serves the option.
351
- */
352
- omitContent?: readonly string[];
353
- /** Bound all archive file entries, including empty files. */
354
- maxFiles: number;
355
- /** Compressed transport bound; defaults to maxBytes plus bounded tar overhead. */
356
- maxArchiveBytes?: number;
357
- signal?: AbortSignal;
358
- }
359
- /**
360
- * The declared native stores of one runtime HOME, copied box-wide. Only the
361
- * files its harness contract's store globs match are read; nothing else in
362
- * the HOME is opened, listed or named.
363
- */
364
- interface NativeStoreHomeCopy {
365
- harness: string;
366
- /** The HOME's absolute path inside the box. */
367
- runtimeHome: string;
368
- copy: "snapshot";
369
- capturedAt: string;
370
- /** An active execution or an interactive owner held the HOME when it was copied. */
371
- live: boolean;
372
- files: NativeSessionCopyFile[];
373
- /** Store files the globs matched that the credential predicate names; never copied. */
374
- excluded: Array<{
375
- storePath: string;
376
- reason: "credential";
377
- }>;
378
- complete: boolean;
379
- /** home_live | over_bound:<path> | store_entries_capped:<root> | store_file_unreadable:<path> | ... */
380
- missingReasons: string[];
381
- }
382
- /**
383
- * Every native session store on one box, found by walking the runtime HOME
384
- * roots rather than the session store, so it also serves a box whose session
385
- * listing is empty (a snapshot-restored box whose records expired).
386
- */
387
- interface RawEvidenceBoxArchiveManifest {
388
- schema: "tangle.raw-evidence-archive.box.v1";
389
- scope: "box";
390
- status: "captured" | "partial";
391
- proofStatus: "verified" | "unverified";
392
- containerId?: string;
393
- sidecarBundleChecksum?: string;
394
- sidecarImageDigest: string;
395
- sidecarBundleRevision: string;
396
- /** Every HOME root walked, with the number of HOMEs it held. */
397
- roots: Array<{
398
- harness: string;
399
- path: string;
400
- kind: "shared" | "isolated";
401
- homes: number;
402
- }>;
403
- homes: NativeStoreHomeCopy[];
404
- /** Settled copies, each with the HOME it was taken from; they outlive a reaped HOME. */
405
- nativeSessions: Array<NativeSessionCopy & {
406
- runtimeHome: string | null;
407
- }>;
408
- coverageComplete: boolean;
409
- missingReasons: string[];
410
- }
411
- interface RawEvidenceBoxUnavailable {
412
- status: "unavailable";
413
- scope: "box";
414
- reason: string;
415
- }
416
- interface RawEvidenceBoxExportOptions {
417
- /** Bound all uncompressed archive member bytes, including the manifest. */
418
- maxBytes: number;
419
- /** Bound all archive file entries, including empty files. */
420
- maxFiles: number;
421
- /** Compressed transport bound; defaults to maxBytes plus bounded tar overhead. */
422
- maxArchiveBytes?: number;
423
- signal?: AbortSignal;
424
- }
425
- type RawEvidenceBoxDirectoryExport = RawEvidenceBoxUnavailable | {
426
- status: "captured" | "partial";
427
- directory: string;
428
- manifestPath: string;
429
- manifestSha256: `sha256:${string}`;
430
- transfer: {
431
- sizeBytes: number;
432
- sha256: string;
433
- };
434
- manifest: RawEvidenceBoxArchiveManifest;
435
- coverageComplete: boolean;
436
- missingReasons: string[];
437
- };
438
- type RawEvidenceDirectoryExport = RawEvidenceUnavailable | {
439
- status: "captured" | "partial";
440
- directory: string;
441
- manifestPath: string;
442
- manifestSha256: `sha256:${string}`;
443
- transfer: {
444
- sizeBytes: number;
445
- sha256: string;
446
- }; /** Bounded metadata only. No inline payload or aggregate frame contents. */
447
- manifest: RawEvidenceArchiveManifest | RawEvidenceArchiveManifestV2 | RawEvidenceArchiveManifestNative;
448
- coverageComplete: boolean;
449
- missingReasons: string[];
450
- };
451
- //#endregion
452
111
  //#region ../../../packages/runtime-contracts/dist/runtime-environment.d.ts
453
112
  /** Names only: the caller must keep a separate source and pass values to resume({ env }). */
454
113
  declare const sandboxEnvRecoverySchema: z.ZodObject<{
@@ -2607,9 +2266,7 @@ interface JsonRecord {
2607
2266
  }
2608
2267
  //#endregion
2609
2268
  //#region src/types/client.d.ts
2610
- /**
2611
- * HTTP client interface for making requests.
2612
- */
2269
+ /** HTTP request transport; SDK_TIMEOUTS owns default deadlines. */
2613
2270
  interface HttpClient {
2614
2271
  fetch(path: string, options?: RequestInit, fetchOptions?: {
2615
2272
  timeoutMs?: number;
@@ -3139,33 +2796,23 @@ interface SearchMatch {
3139
2796
  }
3140
2797
  //#endregion
3141
2798
  //#region src/types/files.d.ts
3142
- /**
3143
- * Detailed file/directory information.
3144
- */
3145
2799
  type FileInfo = Omit<FsEntryInfo, "modTime" | "accessTime"> & {
3146
- /** Last modification time. */modTime: Date; /** Last access time. */
2800
+ modTime: Date;
3147
2801
  accessTime: Date;
3148
2802
  };
3149
- /** File metadata returned by the recursive workspace tree endpoint. */
3150
2803
  type FileTreeFile = FileTreeResponse["data"]["files"][number];
3151
- /** Options for recursively scanning a workspace tree. */
3152
2804
  interface FileTreeOptions {
3153
2805
  sessionId?: string;
3154
2806
  maxDepth?: number;
3155
2807
  }
3156
- /** Recursive workspace tree with scan statistics. */
3157
2808
  type FileTreeResult = FileTreeResponse["data"];
3158
- /** Options for measuring aggregate workspace storage usage. */
3159
2809
  interface FileUsageOptions {
3160
2810
  /** Task session id for session-specific workspace isolation. */
3161
2811
  sessionId?: string;
3162
2812
  }
3163
2813
  /**
3164
- * Aggregate apparent storage usage for a customer workspace.
3165
- *
3166
- * Hidden files, dependency trees, caches, and build output are included.
3167
- * Runtime-owned `.sidecar` directories are excluded, and symlinks are counted
3168
- * by their own metadata without following their targets.
2814
+ * Apparent workspace bytes include hidden files, dependencies, caches and build
2815
+ * output. Excludes runtime .sidecar roots; counts symlinks without following them.
3169
2816
  */
3170
2817
  interface FileUsageResult {
3171
2818
  /** Observational snapshot only; never a quota or billing authority. */
@@ -3178,15 +2825,12 @@ interface FileUsageResult {
3178
2825
  };
3179
2826
  /** Scanned root, relative to the workspace when applicable. */
3180
2827
  root: string;
3181
- /** Sum of regular-file and symlink apparent sizes. */
3182
2828
  sizeBytes: number;
3183
- /** Number of regular files and symlinks. */
3184
2829
  fileCount: number;
3185
2830
  /** Number of customer-owned directories, excluding the root. */
3186
2831
  directoryCount: number;
3187
2832
  /** Latest observed modification time as Unix milliseconds. */
3188
2833
  lastModifiedMs: number;
3189
- /** Time spent scanning the workspace. */
3190
2834
  scanDurationMs: number;
3191
2835
  /** False when limits or unreadable entries prevented a complete result. */
3192
2836
  complete: boolean;
@@ -3232,20 +2876,16 @@ interface FileUsageResult {
3232
2876
  availableBytes: number;
3233
2877
  };
3234
2878
  }
3235
- /** File content and metadata returned by a batch read. */
3236
2879
  type FileReadResult = FileReadResult$1;
3237
- /** One file that could not be read during a partial-success batch. */
3238
2880
  interface FileReadError {
3239
2881
  path: string;
3240
2882
  error: string;
3241
2883
  code?: string;
3242
2884
  }
3243
- /** Options for reading files in a batch. */
3244
2885
  interface FileReadBatchOptions {
3245
2886
  encoding?: "utf8" | "base64";
3246
2887
  sessionId?: string;
3247
2888
  }
3248
- /** Partial-success result from a batch file read. */
3249
2889
  interface FileReadBatchResult {
3250
2890
  files: FileReadResult[];
3251
2891
  errors: FileReadError[];
@@ -3255,109 +2895,84 @@ interface FileReadBatchResult {
3255
2895
  failed: number;
3256
2896
  };
3257
2897
  }
3258
- /** Metadata returned after a successful file write. */
3259
2898
  type FileWriteResult = FileWriteResult$1 & {
3260
2899
  encoding?: "utf8" | "base64";
3261
2900
  };
3262
- /** Metadata returned after a successful file or directory rename. */
3263
2901
  type FileRenameResult = FileRenameResult$1;
3264
- /**
3265
- * Options for uploading files.
3266
- */
3267
2902
  interface UploadOptions {
3268
2903
  /** Overwrite if file exists (default: true) */
3269
2904
  overwrite?: boolean;
3270
2905
  /** Set file permissions (Unix mode, e.g., 0o644) */
3271
2906
  permissions?: number;
3272
- /** Progress callback for large files */
3273
2907
  onProgress?: (progress: UploadProgress) => void;
3274
2908
  }
3275
- /**
3276
- * Upload progress information.
3277
- */
3278
2909
  interface UploadProgress {
3279
- /** Bytes uploaded so far */
3280
2910
  bytesUploaded: number;
3281
- /** Total bytes to upload */
3282
2911
  totalBytes: number;
3283
- /** Percentage complete (0-100) */
3284
2912
  percentage: number;
3285
2913
  }
3286
- /** A caller-supplied part codec. The SDK ships gzip (Web-standard
3287
- * CompressionStream, zero deps, every runtime); zstd beats it on ratio and
3288
- * speed but needs native/WASM support, so Node consumers inject
3289
- * `node:zlib`'s zstd and browsers stay gzip. Returning null degrades the
3290
- * part to the next codec in the preference chain. */
3291
- type ChunkCodec = (bytes: Uint8Array<ArrayBuffer>) => Promise<Uint8Array<ArrayBuffer> | null>;
3292
2914
  /**
3293
- * Options for {@link FileSystem.uploadData}.
2915
+ * Optional part codec; null tries the next preference. Gzip is built in via
2916
+ * CompressionStream; native/WASM zstd may be supplied where negotiated.
3294
2917
  */
2918
+ type ChunkCodec = (bytes: Uint8Array<ArrayBuffer>) => Promise<Uint8Array<ArrayBuffer> | null>;
3295
2919
  interface ChunkedUploadOptions {
3296
2920
  /** Unix mode bits applied to the file after upload, e.g. 0o644. */
3297
2921
  mode?: number;
3298
- /** Progress callback fired after each part completes. On the rare
3299
- * checksum-mismatch recovery (one automatic full re-upload),
3300
- * `bytesUploaded` restarts from 0 for the second pass. */
2922
+ /**
2923
+ * Reports completed parts; one full checksum-mismatch recovery restarts
2924
+ * bytesUploaded at zero.
2925
+ */
3301
2926
  onProgress?: (progress: UploadProgress) => void;
3302
- /** Cancel the upload. A pending upload session is best-effort deleted
3303
- * server-side when the signal fires mid-flow. */
2927
+ /** Cancel and best-effort delete its pending server upload session. */
3304
2928
  signal?: AbortSignal;
3305
2929
  /** Delay between part PUTs (ms) to pace bursts. 0 disables pacing (default). */
3306
2930
  paceMs?: number;
3307
- /** Concurrent part uploads. Parts are indexed and verified at commit, so
3308
- * out-of-order completion is safe; the default 4 (max 8) keeps one session
3309
- * polite to the server's staging budget. */
2931
+ /**
2932
+ * Concurrent parts; indexed commit verifies out-of-order completion. Chunked-upload
2933
+ * transport owns default/maximum concurrency.
2934
+ */
3310
2935
  concurrency?: number;
3311
- /** Per-part compression on the wire (staged bytes and the commit SHA stay
3312
- * raw). `"auto"` (default) probes part 0 and skips compression when the
3313
- * payload is incompressible; `true` always compresses; `false` never.
3314
- * gzip (Web-standard CompressionStream) is the universal floor; supply a
3315
- * zstd codec via {@link codecs} when the runtime negotiated it.
3316
- * Runtimes without `CompressionStream` degrade to raw parts. */
2936
+ /**
2937
+ * Compress wire parts, leaving staged bytes/commit SHA raw. Auto (default) probes
2938
+ * part zero; true always compresses; false sends raw. Gzip is built in; negotiated
2939
+ * zstd uses codecs. Without CompressionStream, falls back to raw.
2940
+ */
3317
2941
  compression?: boolean | "auto";
3318
- /** Optional extra part codecs, keyed by wire encoding. The SDK ships gzip
3319
- * everywhere; zstd beats it on ratio and speed but needs native/WASM
3320
- * support — Node consumers wire `node:zlib`'s zstd, browsers stay gzip.
3321
- * A codec is used only when the runtime's init response negotiated it. */
2942
+ /** Inject zstd only when runtime init negotiates it; see ChunkCodec. */
3322
2943
  codecs?: {
3323
2944
  zstd?: ChunkCodec;
3324
2945
  };
3325
- /** Fires once, immediately after the session is initialized — persist the
3326
- * uploadId to make an interrupted upload resumable
3327
- * (`keepSessionOnFailure` + `resumeChunkedUpload`). */
2946
+ /**
2947
+ * Called once after init; persist uploadId to resume with
2948
+ * keepSessionOnFailure/resumeChunkedUpload.
2949
+ */
3328
2950
  onSession?: (session: {
3329
2951
  uploadId: string;
3330
2952
  partSize: number;
3331
2953
  totalParts: number;
3332
2954
  expiresAt?: string;
3333
2955
  }) => void;
3334
- /** On failure, KEEP the session and its staged parts (the idle GC reclaims
3335
- * them eventually) and throw {@link ChunkedUploadInterruptedError}
3336
- * carrying the uploadId, instead of deleting the session. Default false
3337
- * (a failed upload cleans up after itself). */
2956
+ /**
2957
+ * Preserve staged parts and throw ChunkedUploadInterruptedError with uploadId. Idle
2958
+ * GC still applies; default false deletes failed sessions.
2959
+ */
3338
2960
  keepSessionOnFailure?: boolean;
3339
2961
  /** Max retries per part on a transient error before failing loud. Default 6. */
3340
2962
  maxRetries?: number;
3341
2963
  }
3342
- /**
3343
- * Result of a successful {@link FileSystem.uploadData} call — the
3344
- * upload-session commit response.
3345
- */
2964
+ /** Committed upload-session result. */
3346
2965
  interface ChunkedUploadResult {
3347
- /** The path the runtime wrote the assembled payload to. */
3348
2966
  path: string;
3349
- /** Total assembled size in bytes. */
3350
2967
  size: number;
3351
2968
  /** Server-computed content hash of the assembled payload. */
3352
2969
  hash: string;
3353
- /** Bytes actually sent on the wire across every part attempt — with
3354
- * compression on, `wireBytes < size` is the savings; on the rare
3355
- * checksum-mismatch retry it includes both passes. */
2970
+ /**
2971
+ * Wire bytes include retries and checksum-recovery passes; compare size for
2972
+ * compression savings.
2973
+ */
3356
2974
  wireBytes?: number;
3357
2975
  }
3358
- /**
3359
- * Options for downloading files.
3360
- */
3361
2976
  interface DownloadOptions {
3362
2977
  /** Overwrite local file if exists (default: true) */
3363
2978
  overwrite?: boolean;
@@ -3369,11 +2984,11 @@ interface DownloadOptions {
3369
2984
  expectedSha256?: string;
3370
2985
  /** Cancel the request and remove its incomplete local file. */
3371
2986
  signal?: AbortSignal;
3372
- /** Progress callback for large files */
3373
2987
  onProgress?: (progress: DownloadProgress) => void;
3374
- /** Concurrent range requests for large downloads. Engages only when the
3375
- * path answers a Range probe with 206 (the sidecar does); otherwise the
3376
- * single streaming path serves the download unchanged. Default 1. */
2988
+ /**
2989
+ * Parallel ranges only after a 206 probe; otherwise streams once. Default one
2990
+ * request.
2991
+ */
3377
2992
  parallel?: number;
3378
2993
  }
3379
2994
  /** Exact bytes retained by a completed download. */
@@ -3381,20 +2996,11 @@ interface DownloadResult {
3381
2996
  sizeBytes: number;
3382
2997
  sha256: string;
3383
2998
  }
3384
- /**
3385
- * Download progress information.
3386
- */
3387
2999
  interface DownloadProgress {
3388
- /** Bytes downloaded so far */
3389
3000
  bytesDownloaded: number;
3390
- /** Total bytes to download */
3391
3001
  totalBytes: number;
3392
- /** Percentage complete (0-100) */
3393
3002
  percentage: number;
3394
3003
  }
3395
- /**
3396
- * Options for listing directories.
3397
- */
3398
3004
  interface ListOptions {
3399
3005
  /** Include hidden files (starting with .) */
3400
3006
  all?: boolean;
@@ -3403,80 +3009,22 @@ interface ListOptions {
3403
3009
  /** Task session id for session-specific workspace isolation. */
3404
3010
  sessionId?: string;
3405
3011
  }
3406
- /**
3407
- * Options for creating directories.
3408
- */
3409
3012
  interface MkdirOptions {
3410
3013
  /** Create parent directories as needed (like mkdir -p) */
3411
3014
  recursive?: boolean;
3412
3015
  /** Set directory permissions (Unix mode, e.g., 0o755) */
3413
3016
  mode?: number;
3414
3017
  }
3415
- /**
3416
- * Options for deleting files/directories.
3417
- */
3418
3018
  interface DeleteOptions {
3419
3019
  /** Recursively delete directories (like rm -rf) */
3420
3020
  recursive?: boolean;
3421
3021
  /** Agent session whose workspace and change history receive the deletion. */
3422
3022
  sessionId?: string;
3423
3023
  }
3424
- /** Options for {@link FileSystem.rename}. */
3425
3024
  interface RenameOptions {
3426
3025
  /** Agent session whose workspace and change history receive the rename. */
3427
3026
  sessionId?: string;
3428
3027
  }
3429
- /**
3430
- * File system operations for sandboxes. Access via `sandbox.fs`.
3431
- *
3432
- * Beyond basic read/write: binary upload/download, directory operations,
3433
- * progress reporting for large files.
3434
- *
3435
- * @example Upload and download files
3436
- * ```typescript
3437
- * // Upload a local file
3438
- * await box.fs.upload("./model.bin", "/workspace/models/model.bin");
3439
- *
3440
- * // Download a file
3441
- * await box.fs.download("/workspace/results.zip", "./local/results.zip");
3442
- *
3443
- * // With progress reporting
3444
- * await box.fs.upload("./large-file.bin", "/workspace/data.bin", {
3445
- * onProgress: (p) => console.log(`${p.percentage}%`),
3446
- * });
3447
- * ```
3448
- *
3449
- * @example Directory operations
3450
- * ```typescript
3451
- * // Upload entire directory
3452
- * await box.fs.uploadDir("./local/project", "/workspace/project");
3453
- *
3454
- * // Download entire directory
3455
- * await box.fs.downloadDir("/workspace/output", "./local/output");
3456
- *
3457
- * // List directory contents
3458
- * const files = await box.fs.list("/workspace");
3459
- * for (const f of files) {
3460
- * console.log(`${f.name} - ${f.size} bytes`);
3461
- * }
3462
- * ```
3463
- *
3464
- * @example File management
3465
- * ```typescript
3466
- * // Check if file exists
3467
- * if (await box.fs.exists("/workspace/config.json")) {
3468
- * const info = await box.fs.stat("/workspace/config.json");
3469
- * console.log(`Size: ${info.size}, Modified: ${info.modTime}`);
3470
- * }
3471
- *
3472
- * // Create directory
3473
- * await box.fs.mkdir("/workspace/output/images", { recursive: true });
3474
- *
3475
- * // Delete file or directory
3476
- * await box.fs.delete("/workspace/temp", { recursive: true });
3477
- * ```
3478
- */
3479
- /** One file in a {@link FileSystem.writeMany} batch. */
3480
3028
  interface WriteManyFile {
3481
3029
  /** Destination path. Relative paths resolve from the workspace root. */
3482
3030
  path: string;
@@ -3484,51 +3032,37 @@ interface WriteManyFile {
3484
3032
  content: string;
3485
3033
  /** Unix mode bits applied after write, e.g. 0o755. */
3486
3034
  mode?: number;
3487
- /** Encoding of `content` on the wire. */
3488
3035
  encoding?: "utf8" | "base64";
3489
3036
  /**
3490
- * Only write when the current content SHA-256 matches this value.
3491
- * Use the hash returned by a prior {@link FileWriteResult} or
3492
- * {@link FileReadResult}. The SDK detects an old sidecar only after the write
3493
- * if it does not echo this precondition in `preconditionsApplied`, so the
3494
- * write may already have occurred before `CapabilityError` is thrown.
3037
+ * Require current SHA-256 from FileReadResult/FileWriteResult. Old sidecars may
3038
+ * write before CapabilityError if preconditionsApplied fails to echo this guard.
3495
3039
  */
3496
3040
  ifHash?: string;
3497
3041
  /**
3498
- * Only write when the path does not exist.
3499
- * The SDK detects an old sidecar only after the write if it does not echo
3500
- * this precondition in `preconditionsApplied`, so the write may already have
3501
- * occurred before `CapabilityError` is thrown.
3042
+ * Require absence. Old sidecars may write before CapabilityError if
3043
+ * preconditionsApplied fails to echo this guard.
3502
3044
  */
3503
3045
  ifAbsent?: boolean;
3504
3046
  }
3505
- /** Options for {@link FileSystem.write}. */
3506
3047
  interface WriteFileOptions {
3507
3048
  /** Unix mode bits applied after write, e.g. 0o755. */
3508
3049
  mode?: number;
3509
- /** Encoding of `content` on the wire. */
3510
3050
  encoding?: "utf8" | "base64";
3511
3051
  /** Agent session whose workspace and change history receive the write. */
3512
3052
  sessionId?: string;
3513
3053
  /** Trace id of the turn this call belongs to; see {@link ExecOptions.traceId}. */
3514
3054
  traceId?: string;
3515
3055
  /**
3516
- * Only write when the current content SHA-256 matches this value.
3517
- * Use the hash returned by a prior {@link FileWriteResult} or
3518
- * {@link FileReadResult}. The SDK detects an old sidecar only after the write
3519
- * if it does not echo this precondition in `preconditionsApplied`, so the
3520
- * write may already have occurred before `CapabilityError` is thrown.
3056
+ * Require current SHA-256 from FileReadResult/FileWriteResult. Old sidecars may
3057
+ * write before CapabilityError if preconditionsApplied fails to echo this guard.
3521
3058
  */
3522
3059
  ifHash?: string;
3523
3060
  /**
3524
- * Only write when the path does not exist.
3525
- * The SDK detects an old sidecar only after the write if it does not echo
3526
- * this precondition in `preconditionsApplied`, so the write may already have
3527
- * occurred before `CapabilityError` is thrown.
3061
+ * Require absence. Old sidecars may write before CapabilityError if
3062
+ * preconditionsApplied fails to echo this guard.
3528
3063
  */
3529
3064
  ifAbsent?: boolean;
3530
3065
  }
3531
- /** Options for {@link FileSystem.writeMany}. */
3532
3066
  interface WriteManyOptions {
3533
3067
  /** Delay between batch requests or sequential writes. Default 0. */
3534
3068
  paceMs?: number;
@@ -3540,45 +3074,23 @@ interface FileSystem {
3540
3074
  supportsWriteMode?: true;
3541
3075
  /** True when download enforces bounds and cancellation and returns a digest receipt. */
3542
3076
  supportsBoundedDownload?: true;
3543
- /**
3544
- * Read a file's contents as a string.
3545
- * For binary files, use download() instead.
3546
- *
3547
- * @param path - Path to file (relative to workspace)
3548
- * @returns File contents as UTF-8 string
3549
- * @throws NotFoundError if file doesn't exist
3550
- */
3077
+ /** Read UTF-8; use download for binary data. Missing paths throw NotFoundError. */
3551
3078
  read(path: string): Promise<string>;
3552
3079
  /** Read up to any number of files with content metadata and per-file errors. */
3553
3080
  readBatch(paths: string[], options?: FileReadBatchOptions): Promise<FileReadBatchResult>;
3554
3081
  /** Recursively scan the workspace and return file metadata. */
3555
3082
  tree(path: string, options?: FileTreeOptions): Promise<FileTreeResult>;
3556
3083
  /**
3557
- * Measure complete aggregate workspace usage without returning a file list.
3558
- * Unlike {@link FileSystem.tree}, this includes hidden files, dependencies,
3559
- * caches, and build output. Check `complete` before using the result for
3560
- * accounting or quota decisions.
3084
+ * Aggregate usage includes hidden files/dependencies/caches/build output. Check
3085
+ * complete before accounting or quota decisions.
3561
3086
  */
3562
3087
  usage(path: string, options?: FileUsageOptions): Promise<FileUsageResult>;
3563
- /**
3564
- * Write string content to a file.
3565
- * For binary files, use upload() instead.
3566
- * Creates parent directories as needed.
3567
- *
3568
- * @param path - Path to file (relative to workspace)
3569
- * @param content - Content to write
3570
- */
3088
+ /** Write text, creating parents; use upload for binary content. */
3571
3089
  write(path: string, content: string, options?: WriteFileOptions): Promise<FileWriteResult>;
3572
3090
  /**
3573
- * Write many files through bounded runtime batch requests.
3574
- *
3575
- * For materializing a large file corpus (skills, tool scripts, config) into
3576
- * the sandbox without one network round trip per file. The SDK splits large
3577
- * corpora by runtime count and gateway wire limits. Batch writes are not
3578
- * atomic. A per-file failure throws after the runtime reports all
3579
- * results for that request, so sibling files can already be written. Relative
3580
- * paths resolve from the workspace root. Pass `mode: 0o755` on executable
3581
- * files.
3091
+ * Bounded batches respect runtime count/gateway wire limits and are not atomic:
3092
+ * sibling writes may finish before a per-file failure throws. Relative paths use
3093
+ * workspace root; mode sets executable permissions.
3582
3094
  *
3583
3095
  * @example
3584
3096
  * ```typescript
@@ -3589,21 +3101,11 @@ interface FileSystem {
3589
3101
  * ```
3590
3102
  */
3591
3103
  writeMany(files: WriteManyFile[], options?: WriteManyOptions): Promise<void>;
3592
- /**
3593
- * Search for text patterns in files using ripgrep.
3594
- * @see SearchOptions for available options
3595
- */
3104
+ /** Ripgrep search; see SearchOptions. */
3596
3105
  search(query: string, options?: SearchOptions): AsyncIterable<SearchMatch>;
3597
3106
  /**
3598
- * Upload a local file to the sandbox.
3599
- * Uses checksum-verified chunked upload through gateway or direct connections.
3600
- * Creates parent directories as needed.
3601
- * The upload session limit also applies to local files.
3602
- *
3603
- * @param localPath - Path to local file
3604
- * @param remotePath - Destination path in sandbox
3605
- * @param options - Upload options (overwrite, permissions, progress)
3606
- * @throws Error if local file doesn't exist
3107
+ * Checksum-verified chunked upload via gateway/direct transport, creating parents
3108
+ * and enforcing session limits. Missing local files throw.
3607
3109
  *
3608
3110
  * @example
3609
3111
  * ```typescript
@@ -3617,24 +3119,10 @@ interface FileSystem {
3617
3119
  */
3618
3120
  upload(localPath: string, remotePath: string, options?: UploadOptions): Promise<void>;
3619
3121
  /**
3620
- * Upload in-memory binary or text data to the sandbox over the chunked
3621
- * upload-session protocol, without touching the local filesystem.
3622
- *
3623
- * Browser/Worker-safe (no `node:` APIs) — this is the sanctioned path for
3624
- * delivering payloads over ~1 MiB from a browser tab, a Worker, or any
3625
- * runtime without `node:fs`, where {@link FileSystem.upload}'s local-file
3626
- * read isn't available. Binary-safe: accepts a `Blob`, `ArrayBuffer`,
3627
- * `ArrayBufferView`, or UTF-8 `string`. The upload is chunked into
3628
- * server-sized parts transparently — callers see one call and one
3629
- * awaited result — and verified end-to-end with a whole-payload SHA-256
3630
- * at commit. Works identically whether the sandbox is reached through
3631
- * the gateway proxy or a direct sidecar connection.
3632
- *
3633
- * @param remotePath - Destination path in the sandbox.
3634
- * @param data - Payload to upload. Strings encode as UTF-8.
3635
- * @param options - Chunking, retry, progress, and cancellation options.
3636
- * @throws {SandboxError} `PAYLOAD_TOO_LARGE` immediately, before any
3637
- * request, if the payload exceeds the chunked-upload session cap.
3122
+ * Browser/Worker-safe chunked upload without local filesystem access, over
3123
+ * gateway/direct transport. Strings use UTF-8; commit verifies whole-payload
3124
+ * SHA-256. Exceeding the session cap throws SandboxError PAYLOAD_TOO_LARGE before
3125
+ * any request.
3638
3126
  *
3639
3127
  * @example
3640
3128
  * ```typescript
@@ -3646,14 +3134,8 @@ interface FileSystem {
3646
3134
  */
3647
3135
  uploadData(remotePath: string, data: Blob | ArrayBuffer | ArrayBufferView | string, options?: ChunkedUploadOptions): Promise<ChunkedUploadResult>;
3648
3136
  /**
3649
- * Download a file from the sandbox.
3650
- * Handles binary files correctly.
3651
- * Creates local parent directories as needed.
3652
- *
3653
- * @param remotePath - Path to file in sandbox
3654
- * @param localPath - Local destination path
3655
- * @param options - Download options (overwrite, progress)
3656
- * @throws NotFoundError if remote file doesn't exist
3137
+ * Binary-safe download creating local parents. Missing remote files throw
3138
+ * NotFoundError.
3657
3139
  *
3658
3140
  * @example
3659
3141
  * ```typescript
@@ -3662,13 +3144,7 @@ interface FileSystem {
3662
3144
  */
3663
3145
  download(remotePath: string, localPath: string, options?: DownloadOptions): Promise<DownloadResult>;
3664
3146
  /**
3665
- * Upload a local directory to the sandbox.
3666
- * Uses tar for efficient transfer.
3667
- * Preserves directory structure and file permissions.
3668
- *
3669
- * @param localDir - Path to local directory
3670
- * @param remoteDir - Destination directory in sandbox
3671
- * @throws Error if local directory doesn't exist
3147
+ * Tar upload preserves structure/permissions; missing local directories throw.
3672
3148
  *
3673
3149
  * @example
3674
3150
  * ```typescript
@@ -3677,18 +3153,15 @@ interface FileSystem {
3677
3153
  */
3678
3154
  uploadDir(localDir: string, remoteDir: string): Promise<void>;
3679
3155
  /**
3680
- * Stream a directory's tar.gz bytes to a local file without extracting it.
3681
- * Includes hidden files. Uses the same bounded, cancellable transport and
3682
- * SHA-256 receipt as download(). Bounds apply to compressed bytes only.
3683
- * The caller must validate members and expanded size before extraction.
3684
- * This reads a live directory, not a transactional filesystem snapshot.
3156
+ * Stream live-directory tar.gz, including hidden files, with download
3157
+ * bounds/cancellation/SHA receipt. Bounds cover compressed bytes only; validate
3158
+ * members and expanded size before extraction.
3685
3159
  */
3686
3160
  downloadArchive(remoteDir: string, localPath: string, options?: DownloadOptions): Promise<DownloadResult>;
3687
3161
  /**
3688
- * Open a directory's tar.gz bytes as a stream, for runtimes without a local
3689
- * filesystem such as Cloudflare Workers and browsers. Includes hidden files.
3690
- * The caller owns the stream: read it to the end or cancel it. Like
3691
- * downloadArchive(), this reads a live directory, not a snapshot.
3162
+ * Browser/Worker tar.gz stream includes hidden files from a live directory, not a
3163
+ * snapshot. Read to completion or cancel.
3164
+ *
3692
3165
  * @example
3693
3166
  * ```typescript
3694
3167
  * const archive = await box.fs.openArchive("/home/agent");
@@ -3699,15 +3172,9 @@ interface FileSystem {
3699
3172
  signal?: AbortSignal;
3700
3173
  }): Promise<ReadableStream<Uint8Array>>;
3701
3174
  /**
3702
- * Download a directory from the sandbox.
3703
- * Uses streaming tar transfer and the host tar program for extraction.
3704
- * Download options bound compressed bytes only. Use downloadArchive() for
3705
- * member validation, expanded-size bounds, or atomic directory publication.
3706
- * Preserves directory structure and file permissions.
3707
- *
3708
- * @param remoteDir - Directory path in sandbox
3709
- * @param localDir - Local destination directory
3710
- * @throws NotFoundError if remote directory doesn't exist
3175
+ * Streaming tar and host extraction preserve structure/permissions. Bounds cover
3176
+ * compressed bytes only; use downloadArchive for member validation, expanded limits
3177
+ * or atomic publication. Missing remote directories throw NotFoundError.
3711
3178
  *
3712
3179
  * @example
3713
3180
  * ```typescript
@@ -3716,12 +3183,7 @@ interface FileSystem {
3716
3183
  */
3717
3184
  downloadDir(remoteDir: string, localDir: string, options?: Omit<DownloadOptions, "overwrite">): Promise<void>;
3718
3185
  /**
3719
- * List directory contents with metadata.
3720
- *
3721
- * @param path - Directory path (relative to workspace)
3722
- * @param options - List options (all, long)
3723
- * @returns Array of file/directory info
3724
- * @throws NotFoundError if directory doesn't exist
3186
+ * List metadata; missing directories throw NotFoundError.
3725
3187
  *
3726
3188
  * @example
3727
3189
  * ```typescript
@@ -3734,11 +3196,7 @@ interface FileSystem {
3734
3196
  */
3735
3197
  list(path: string, options?: ListOptions): Promise<FileInfo[]>;
3736
3198
  /**
3737
- * Get detailed information about a file or directory.
3738
- *
3739
- * @param path - Path to file/directory
3740
- * @returns File/directory metadata
3741
- * @throws NotFoundError if path doesn't exist
3199
+ * Read metadata; missing paths throw NotFoundError.
3742
3200
  *
3743
3201
  * @example
3744
3202
  * ```typescript
@@ -3748,12 +3206,8 @@ interface FileSystem {
3748
3206
  */
3749
3207
  stat(path: string): Promise<FileInfo>;
3750
3208
  /**
3751
- * Delete a file or directory.
3752
- *
3753
- * @param path - Path to delete
3754
- * @param options - Delete options (recursive for directories)
3755
- * @throws NotFoundError if path doesn't exist
3756
- * @throws Error if deleting non-empty directory without recursive
3209
+ * Delete a path; missing paths throw NotFoundError, nonempty directories require
3210
+ * recursive.
3757
3211
  *
3758
3212
  * @example
3759
3213
  * ```typescript
@@ -3766,16 +3220,9 @@ interface FileSystem {
3766
3220
  */
3767
3221
  delete(path: string, options?: DeleteOptions): Promise<void>;
3768
3222
  /**
3769
- * Rename a file or directory inside the sandbox without transferring its contents.
3770
- * An existing regular file or symbolic link at the destination is replaced atomically.
3771
- * Replacing a non-empty directory fails, as does moving across filesystems.
3772
- *
3773
- * @param sourcePath - Current path
3774
- * @param destinationPath - New path
3775
- * @param options - Session workspace options
3776
- * @returns The resolved source and destination paths
3777
- * @throws NotFoundError if the source or destination parent does not exist
3778
- * @throws Error if the destination is a non-empty directory or the paths span filesystems
3223
+ * Rename in place; regular-file/symlink destinations replace atomically. Missing
3224
+ * source/parent throws NotFoundError; nonempty-directory replacement and
3225
+ * cross-filesystem moves fail.
3779
3226
  *
3780
3227
  * @example
3781
3228
  * ```typescript
@@ -3787,10 +3234,7 @@ interface FileSystem {
3787
3234
  */
3788
3235
  rename(sourcePath: string, destinationPath: string, options?: RenameOptions): Promise<FileRenameResult>;
3789
3236
  /**
3790
- * Create a directory.
3791
- *
3792
- * @param path - Directory path to create
3793
- * @param options - Options (recursive to create parents)
3237
+ * Create directories; recursive creates missing parents.
3794
3238
  *
3795
3239
  * @example
3796
3240
  * ```typescript
@@ -3800,10 +3244,7 @@ interface FileSystem {
3800
3244
  */
3801
3245
  mkdir(path: string, options?: MkdirOptions): Promise<void>;
3802
3246
  /**
3803
- * Check if a path exists.
3804
- *
3805
- * @param path - Path to check
3806
- * @returns true if path exists, false otherwise
3247
+ * Test existence.
3807
3248
  *
3808
3249
  * @example
3809
3250
  * ```typescript
@@ -4200,59 +3641,24 @@ interface NetworkManager {
4200
3641
  //#endregion
4201
3642
  //#region src/types/storage.d.ts
4202
3643
  /**
4203
- * S3-compatible storage provider configuration (BYOS3 - Bring Your Own S3).
4204
- *
4205
- * Allows customers to store snapshots in their own S3-compatible storage.
4206
- * Supports AWS S3, Google Cloud Storage (GCS), and Cloudflare R2.
4207
- *
4208
- * @example AWS S3
4209
- * ```typescript
4210
- * const storage: StorageConfig = {
4211
- * type: "s3",
4212
- * bucket: "my-snapshots",
4213
- * region: "us-east-1",
4214
- * credentials: {
4215
- * accessKeyId: "AKIA...",
4216
- * secretAccessKey: "...",
4217
- * },
4218
- * };
4219
- * ```
4220
- *
4221
- * @example Cloudflare R2
3644
+ * Customer S3-compatible snapshot storage (AWS S3, GCS HMAC or R2).
3645
+ * @example
4222
3646
  * ```typescript
4223
3647
  * const storage: StorageConfig = {
4224
3648
  * type: "r2",
4225
3649
  * bucket: "my-snapshots",
4226
3650
  * endpoint: "https://<account>.r2.cloudflarestorage.com",
4227
- * credentials: {
4228
- * accessKeyId: "...",
4229
- * secretAccessKey: "...",
4230
- * },
4231
- * };
4232
- * ```
4233
- *
4234
- * @example Google Cloud Storage
4235
- * ```typescript
4236
- * const storage: StorageConfig = {
4237
- * type: "gcs",
4238
- * bucket: "my-snapshots",
4239
- * credentials: {
4240
- * accessKeyId: "...", // HMAC key
4241
- * secretAccessKey: "...",
4242
- * },
3651
+ * credentials: { accessKeyId: "...", secretAccessKey: "..." },
4243
3652
  * };
4244
3653
  * ```
4245
3654
  */
4246
3655
  interface StorageConfig {
4247
- /** Storage provider type */
4248
3656
  type: "s3" | "gcs" | "r2";
4249
- /** Bucket name */
4250
3657
  bucket: string;
4251
3658
  /** Custom endpoint URL (required for R2, optional for S3/GCS) */
4252
3659
  endpoint?: string;
4253
3660
  /** Region (e.g., us-east-1) */
4254
3661
  region?: string;
4255
- /** Access credentials */
4256
3662
  credentials: {
4257
3663
  accessKeyId: string;
4258
3664
  secretAccessKey: string;
@@ -4261,14 +3667,10 @@ interface StorageConfig {
4261
3667
  prefix?: string;
4262
3668
  }
4263
3669
  /**
4264
- * Live whole-sandbox resource usage, read from the container cgroup.
4265
- *
4266
- * Memory is point-in-time (`memoryCurrentMb`) plus a high-water mark
4267
- * (`memoryPeakMb`). CPU is a cumulative counter in microseconds; compute
4268
- * utilization from two samples: `cpu% = Δcpu_usec / (Δwall_ms * 10)`.
3670
+ * Live cgroup usage. CPU utilization from samples: ΔcpuUsageUsec / (Δwall_ms * 10).
3671
+ * Memory current/peak are instantaneous/high-water values.
4269
3672
  */
4270
3673
  interface SandboxResourceUsage {
4271
- /** Cgroup version (1 or 2). */
4272
3674
  cgroupVersion: number;
4273
3675
  /** Current resident memory, MB. */
4274
3676
  memoryCurrentMb: number;
@@ -4282,14 +3684,9 @@ interface SandboxResourceUsage {
4282
3684
  sampledAtMs: number;
4283
3685
  }
4284
3686
  /**
4285
- * Returned by `box.capabilities()` — what the DEPLOYED sidecar image can do,
4286
- * as compiled capability facts, not SDK method presence. A newer SDK against
4287
- * an older deployment reads this before relying on a feature; a missing
4288
- * optional flag means "unknown to this image", never "false".
4289
- *
4290
- * Every field is sourced from the plain-JSON response body of
4291
- * `GET /capabilities`. Nothing here is header-derived, so the platform
4292
- * proxy's SSE header-stripping cannot affect this document.
3687
+ * Capabilities compiled into the deployed image, read from GET /capabilities JSON,
3688
+ * independent of SDK method presence or proxy headers. Missing optional flags mean
3689
+ * unknown, not false.
4293
3690
  */
4294
3691
  interface SandboxRuntimeCapabilities {
4295
3692
  /** Named native subscription references supported by the deployed Sidecar. */
@@ -4302,7 +3699,6 @@ interface SandboxRuntimeCapabilities {
4302
3699
  nativeSessionCaptureVersion?: number;
4303
3700
  /** Dispatch providers covered by the serving Sidecar capture boundary. */
4304
3701
  nativeSessionCaptureHarnesses?: BackendType[];
4305
- /** Version of the capability-document shape. This SDK understands 1. */
4306
3702
  schema: 1;
4307
3703
  /** `@tangle-network/agent-interface` contract compiled into the image. */
4308
3704
  agentInterface: string;
@@ -4324,26 +3720,23 @@ interface SandboxRuntimeCapabilities {
4324
3720
  eventReplay: boolean;
4325
3721
  };
4326
3722
  interactions: {
4327
- /** This sidecar image contains the OpenCode native before-tool approval
4328
- * hook. Require OpenCode and permission interactions before using it. */
4329
- exactBeforeToolApproval?: boolean;
4330
- /** Every acknowledged interaction resolution is recorded: repeating a
4331
- * response replays the recorded resolution, and a different answer for
4332
- * a recorded resolution raises a 409 `StateError`. The deployment
4333
- * refuses with 503 rather than acknowledge a resolution it cannot
4334
- * record. */
3723
+ /** Native OpenCode before-tool approval; require OpenCode and permission interactions. */exactBeforeToolApproval?: boolean;
3724
+ /**
3725
+ * Recorded resolutions replay on repetition, conflict on changed answers (409
3726
+ * StateError), and fail closed (503) if recording fails.
3727
+ */
4335
3728
  responseDedupe: boolean;
4336
3729
  };
4337
3730
  /** Native TUI lifecycle and control operations exposed by the deployment. */
4338
3731
  interactiveAgent?: {
4339
- /** Start one native TUI for the requested session. */start: boolean; /** Read durable TUI state. */
4340
- status: boolean; /** Attach to the existing native TUI. */
3732
+ start: boolean;
3733
+ status: boolean;
4341
3734
  attach: boolean; /** Fence concurrent TUI writers with an exact control claim. */
4342
- control: boolean; /** Reattach after a client disconnect. */
4343
- reattach: boolean; /** Send a prompt to the existing TUI. */
4344
- sendPrompt: boolean; /** Send terminal input to the existing TUI. */
4345
- input: boolean; /** Resize the existing TUI. */
4346
- resize: boolean; /** Stop the exact TUI session. */
3735
+ control: boolean;
3736
+ reattach: boolean;
3737
+ sendPrompt: boolean;
3738
+ input: boolean;
3739
+ resize: boolean;
4347
3740
  stop: boolean; /** Start Claude Code with the CLI's subscription login in its private HOME. */
4348
3741
  claudeSubscription?: boolean;
4349
3742
  };
@@ -4375,136 +3768,66 @@ interface SandboxShapePreset {
4375
3768
  }
4376
3769
  //#endregion
4377
3770
  //#region src/types/lifecycle.d.ts
4378
- /**
4379
- * Configuration for initializing the Sandbox client.
4380
- *
4381
- * @example
4382
- * ```typescript
4383
- * const client = new Sandbox({
4384
- * apiKey: "sk-tan-...",
4385
- * baseUrl: "https://your-sandbox-api.example.com",
4386
- * timeoutMs: 60000,
4387
- * });
4388
- * ```
4389
- */
3771
+ /** Configure the HTTP client; runnable setup examples are in the SDK README. */
4390
3772
  interface SandboxConfig {
4391
- /** API key for authentication */
4392
3773
  apiKey: string;
4393
- /**
4394
- * Platform API base URL, for the agent-profile catalog that fleets resolve
4395
- * saved profiles from. Defaults to `https://id.tangle.tools`.
4396
- */
3774
+ /** Platform profile-catalog URL; defaults to https://id.tangle.tools. */
4397
3775
  platformUrl?: string;
4398
- /** Base URL for the Sandbox API */
4399
3776
  baseUrl: string;
4400
3777
  /**
4401
- * Every call's deadline in ms (default `SDK_TIMEOUTS.default`, 30 s), direct runtime calls
4402
- * included, unless `SDK_TIMEOUTS` names the call. A JSON or error body is bounded until read;
4403
- * a successful SSE or binary stream until its headers arrive.
3778
+ * Request deadline in ms, including direct calls, unless SDK_TIMEOUTS names the
3779
+ * operation. JSON/error bodies remain bounded through consumption; successful SSE/binary
3780
+ * streams through headers.
4404
3781
  */
4405
3782
  timeoutMs?: number;
4406
3783
  /** Client lifetime cancellation, composed with each request's own signal. */
4407
3784
  signal?: AbortSignal;
4408
3785
  /**
4409
- * Permit the SDK to read CLI auth files from the host home directory
4410
- * (`~/.codex/auth.json`, `~/.claude/.credentials.json`,
4411
- * `~/.claude/settings.json`) and ship them to a `localhost` /
4412
- * `127.0.0.1` / `::1` `baseUrl` when creating a `codex` or
4413
- * `claude-code` backend without explicit credentials.
4414
- *
4415
- * Default `false`. Without this flag, any process bound to a
4416
- * localhost port (your sandbox-api or anything else) can impersonate
4417
- * the API and silently harvest those credentials. Set this to `true`
4418
- * only when the localhost endpoint is one you control. For non-local
4419
- * `baseUrl`s the flag is ignored — the SDK never reads home-dir auth
4420
- * files for remote endpoints.
3786
+ * Default false. True permits reading ~/.codex/auth.json, ~/.claude/.credentials.json
3787
+ * and ~/.claude/settings.json for credential-free Codex/Claude creates against
3788
+ * localhost, 127.0.0.1 or ::1. Enable only for a trusted local endpoint: any listener
3789
+ * could otherwise harvest those credentials. Remote endpoints never read host auth
3790
+ * files.
4421
3791
  */
4422
3792
  trustLocalCliAuth?: boolean;
4423
3793
  /**
4424
- * Receives the SDK's own timing spans, so a call's wall time can be split
4425
- * into what the SDK, the network and the server each spent:
4426
- *
4427
- * - `sdk.ensureRunning`: the status check before a runtime call; `desc` is
4428
- * `cached` when no status read was needed.
4429
- * - `sdk.refresh`: one status read; `desc` is why it was sent, the value of
4430
- * the `x-tangle-refresh-reason` request header.
4431
- * - `sdk.request`: one HTTP request, with `socket` (`new` or `reused`) and
4432
- * `phases` (dns, connect, tls, ttfb, body) where the runtime exposes them
4433
- * (Node).
4434
- *
4435
- * A hook that throws is ignored. With no hook the SDK measures nothing.
3794
+ * SDK timing spans: sdk.ensureRunning (cached status), sdk.refresh (refresh reason),
3795
+ * sdk.request (new/reused socket and available dns/connect/tls/ttfb/body phases).
3796
+ * Throwing hooks are ignored; absent hooks incur no measurement.
4436
3797
  */
4437
3798
  onTiming?: SdkTimingHook;
4438
3799
  /**
4439
- * Send runtime calls straight to the sandbox's cell edge instead of through
4440
- * the API and the orchestrator. Default `true` on servers and `false` in a
4441
- * browser (a `document` or `WorkerGlobalScope` global, so Node tests under
4442
- * jsdom count too): box hosts carry no CORS contract, so a browser reads the
4443
- * runtime, event streams included, through the Sandbox API proxy.
4444
- * Exec-family calls (spawn,
4445
- * exec, terminal commands) go to `connection.execHost` on its exec grant;
4446
- * files, processes, agent reads and event streams, and terminal sockets go
4447
- * to `connection.runtimeUrl` on `connection.authToken`. Agent calls that
4448
- * write (a prompt, a session message, a session create) stay on the API,
4449
- * which prepares them. A call the cell provably never received goes to the
4450
- * API, which resumes a stopped sandbox; after a failure that may follow
4451
- * delivery, only a call safe to apply twice (a read, a `PUT`, a `DELETE`)
4452
- * goes again. `false` sends every runtime call through the API.
3800
+ * Direct cell runtime calls; default true on servers, false in browsers (document or
3801
+ * WorkerGlobalScope, including jsdom), which use the API CORS proxy. Exec uses
3802
+ * execHost/execToken; reads, files, processes, events and terminal sockets use
3803
+ * runtimeUrl/authToken. Agent writes stay on the API for preparation. Undelivered calls
3804
+ * fall back to the API for resume; after possible delivery only replay-safe
3805
+ * reads/PUT/DELETE retry. False routes every call through the API.
4453
3806
  */
4454
3807
  directExec?: boolean;
4455
3808
  }
4456
- /**
4457
- * Status of a sandbox instance.
4458
- *
4459
- * Lifecycle: `pending` -> `provisioning` -> `running` -> `stopped` -> (deleted)
4460
- *
4461
- * - `pending` - Sandbox created but not yet provisioning
4462
- * - `provisioning` - Container and resources being allocated
4463
- * - `running` - Sandbox is active and accepting commands
4464
- * - `stopped` - Sandbox is paused (can be resumed)
4465
- * - `failed` - Sandbox encountered an error
4466
- * - `expired` - Sandbox exceeded its lifetime limit
4467
- * - `deleted` - Sandbox has been deleted
4468
- */
4469
3809
  type SandboxStatus = "pending" | "provisioning" | "running" | "stopped" | "failed" | "expired" | "deleted";
4470
- /**
4471
- * Resource limits for a sandbox.
4472
- */
4473
3810
  interface SandboxResources {
4474
- /** Number of CPU cores */
4475
3811
  cpuCores?: number;
4476
- /** Memory in megabytes */
4477
3812
  memoryMB?: number;
4478
- /** Disk space in gigabytes */
4479
3813
  diskGB?: number;
4480
3814
  /** Accelerator request for GPU-class workloads. */
4481
3815
  accelerator?: SandboxAccelerator;
4482
3816
  /**
4483
- * These numbers are a RECOMMENDATION chosen on the end user's behalf (a
4484
- * workflow profile's tier, a capability default), not a size the caller
4485
- * asked for. Over-ceiling advisory resources are CLAMPED to the account's
4486
- * ceiling; over-ceiling explicit resources are REFUSED with
4487
- * `RESOURCES_EXCEED_LIMIT`.
4488
- *
4489
- * Leave unset for anything a user actually requested — the default is
4490
- * honour-or-refuse, so you are told when a size cannot be served instead of
4491
- * silently receiving a fraction of it.
3817
+ * Advisory resources are chosen for the user and clamped to account ceilings. Explicit
3818
+ * requests (default) are honored or refused with RESOURCES_EXCEED_LIMIT; leave unset for
3819
+ * user-requested sizes.
4492
3820
  */
4493
3821
  advisory?: boolean;
4494
3822
  /**
4495
- * The subset of fields that are advisory while the rest stay explicit. Use
4496
- * it when only SOME of these numbers were chosen on the user's behalf — a
4497
- * CLI whose size flags carry defaults sends all three on every create, and
4498
- * without this one typed flag would turn the two untouched defaults into
4499
- * explicit requests and refuse a size the user never named.
3823
+ * Mark only defaulted resource fields advisory; other fields remain explicit, so a user
3824
+ * override does not turn unrelated defaults into explicit requests.
4500
3825
  */
4501
3826
  advisoryFields?: ReadonlyArray<"cpuCores" | "memoryMB" | "diskGB">;
4502
3827
  }
4503
3828
  /**
4504
- * `GET /v1/shapes`: the named sizes, which one is the platform's default, and
4505
- * the largest shape this account can be granted on the serving deployment.
4506
- * The ceiling is the one the create path refuses above, so a request sized
4507
- * at or below it is never refused with `RESOURCES_EXCEED_LIMIT`.
3829
+ * GET /v1/shapes returns available presets, the default and the serving account ceiling
3830
+ * enforced by create.
4508
3831
  */
4509
3832
  interface SandboxShapesInfo {
4510
3833
  presets: SandboxShapePreset[];
@@ -4515,19 +3838,15 @@ interface SandboxShapesInfo {
4515
3838
  diskGB: number;
4516
3839
  };
4517
3840
  }
4518
- /** @deprecated Use CreateSandboxOptions.proxySecrets for authored proxy policy. */
4519
3841
  /**
4520
- * Create a managed sandbox, or use bare for exec/lifecycle without the runtime.
4521
- * Git seeds a repository; environment selects an image. Storage and fromSnapshot
4522
- * restore a durable workspace. Field docs below own each option's semantics;
4523
- * the exported quickstart examples provide complete runnable create flows.
3842
+ * Create a managed sandbox, or bare exec/lifecycle sandbox. Runnable flows live in the
3843
+ * exported quickstart examples.
4524
3844
  */
4525
3845
  interface CreateSandboxOptions {
4526
3846
  /**
4527
- * How this create retries. With `capacity: false`, a 503 `CAPACITY_EXHAUSTED` ends the create at once with that
4528
- * error instead of being asked again on the deploy-window budget (up to 150 s, see client-create-retry.ts). For a
4529
- * caller that defers the work itself when no host has room: each refused re-POST also counts toward the cell's
4530
- * create failure streak. Omitted, a create retries as before.
3847
+ * capacity:false returns CAPACITY_EXHAUSTED immediately for caller-managed deferral;
3848
+ * omitted preserves client-create-retry.ts policy. Re-POSTs count toward the serving
3849
+ * cell failure streak.
4531
3850
  */
4532
3851
  retry?: {
4533
3852
  capacity?: boolean;
@@ -4539,230 +3858,96 @@ interface CreateSandboxOptions {
4539
3858
  /** Internal-owned ephemeral workspaces only; incompatible with capture or retained paths. */
4540
3859
  sessionCapture?: "discard";
4541
3860
  /**
4542
- * Optional environment or container image override.
4543
- * Omit this field to use the server's default image.
4544
- *
4545
- * Pass a named environment returned by `client.environments.list()`, a
4546
- * container image reference such as `"python:3.12-slim"`, or an image ID
4547
- * returned by the SDK image builder.
4548
- *
4549
- * Firecracker custom images require an immutable `repository@sha256:...`
4550
- * reference whose verified rootfs artifact the platform operator has installed.
4551
- * Use `driver: { type: "docker", runtimeBackend: "firecracker" }` on the
4552
- * public routing pool. Missing artifacts return `FIRECRACKER_IMAGE_UNAVAILABLE`;
4553
- * mutable image tags and `fromSnapshot` remain unsupported on Firecracker.
4554
- *
4555
- * @example
4556
- * ```typescript
4557
- * environment: "python:3.12-slim"
4558
- * ```
3861
+ * Omit for the server image, or use a catalog environment, container reference or built
3862
+ * image ID. Firecracker requires an operator-installed verified rootfs addressed by
3863
+ * immutable repository@sha256 and driver {type:"docker",runtimeBackend:"firecracker"}.
3864
+ * Missing artifacts return FIRECRACKER_IMAGE_UNAVAILABLE; mutable tags/fromSnapshot are
3865
+ * unsupported there.
4559
3866
  */
4560
3867
  environment?: string;
4561
- /**
4562
- * Create a bare sandbox without the managed runtime.
4563
- *
4564
- * Bare sandboxes only have:
4565
- * - `exec()` - Execute commands
4566
- * - `stop()` / `resume()` - Lifecycle control
4567
- * - `delete()` - Cleanup
4568
- *
4569
- * Use bare mode when you need a clean container without the managed
4570
- * runtime integration.
4571
- *
4572
- * @default false
4573
- */
3868
+ /** Bare exec/stop/resume/delete without the managed runtime. Default false. */
4574
3869
  bare?: boolean;
4575
3870
  /**
4576
- * Start the managed sandbox runtime without configuring an AI agent.
4577
- *
4578
- * Files, exact process execution, lifecycle controls, and telemetry remain
4579
- * available. No model credentials or default backend are provisioned.
4580
- * Use this for CI jobs, evaluators, and other process-driven workloads.
4581
- *
4582
- * @default true
3871
+ * Default true. False keeps files, exact process execution, lifecycle and telemetry but
3872
+ * provisions no model credentials or backend.
4583
3873
  */
4584
3874
  agent?: boolean;
4585
- /**
4586
- * Infrastructure driver selection.
4587
- * Controls how the sandbox is provisioned and isolated.
4588
- *
4589
- * @example Firecracker with CRIU
4590
- * ```typescript
4591
- * driver: { type: "firecracker", enableCriu: true }
4592
- * ```
4593
- */
3875
+ /** Infrastructure driver and isolation selection; see DriverConfig. */
4594
3876
  driver?: DriverConfig;
4595
- /**
4596
- * AI coding agent backend configuration.
4597
- * Determines which agent runs inside the sandbox.
4598
- *
4599
- * @example OpenCode with profile
4600
- * ```typescript
4601
- * backend: {
4602
- * type: "opencode",
4603
- * profile: { name: "with-web-search" },
4604
- * }
4605
- * ```
4606
- */
3877
+ /** Coding agent and profile configuration; see BackendConfig. */
4607
3878
  backend?: BackendConfig;
4608
3879
  /**
4609
- * Confidential execution requirements for this sandbox.
4610
- *
4611
- * This is equivalent to setting `backend.profile.confidential` on an inline
4612
- * AgentProfile. Tangle-backed creation translates it into blueprint TEE
4613
- * fields; operators that cannot satisfy the requested TEE fail closed.
3880
+ * Equivalent to inline backend.profile.confidential. Tangle maps requirements to
3881
+ * blueprint TEE fields; an unsatisfied requirement fails closed.
4614
3882
  */
4615
3883
  confidential?: AgentProfileConfidential;
4616
3884
  /**
4617
- * Egress firewall policy for controlling outbound internet access.
4618
- *
4619
- * When omitted on a team sandbox, the team's default egress policy is
4620
- * inherited. When omitted on a personal sandbox, the platform default
4621
- * (`{ mode: "open" }`) is used.
4622
- *
4623
- * @see {@link EgressPolicy}
3885
+ * Outbound policy; omitted inherits the team policy for team sandboxes, otherwise the
3886
+ * platform default. See EgressPolicy.
4624
3887
  */
4625
3888
  egressPolicy?: EgressPolicy;
4626
- /**
4627
- * Git repository to clone at sandbox creation.
4628
- *
4629
- * The repository is cloned during provisioning, before the sandbox
4630
- * becomes ready. This is more efficient than cloning after start.
4631
- *
4632
- * @example { url: "https://github.com/user/repo.git", ref: "main" }
4633
- */
3889
+ /** Clone during provisioning before readiness; see GitConfig. */
4634
3890
  git?: GitConfig;
4635
3891
  /**
4636
- * Initial working directory below the realized workspace root.
4637
- *
4638
- * Use a relative POSIX path. When `git` is set, `.` means the repository
4639
- * root. Otherwise, `.` means the sandbox workspace root.
3892
+ * Relative POSIX path below the realized workspace; . selects the cloned repo root, or
3893
+ * workspace root without git.
4640
3894
  */
4641
3895
  cwd?: string;
4642
- /** Human-readable name for the sandbox */
4643
3896
  name?: string;
4644
- /** Resource limits (CPU cores, memory, disk) */
4645
3897
  resources?: SandboxResources;
4646
3898
  /**
4647
- * Attach an on-demand GPU worker during sandbox creation.
4648
- *
4649
- * Requires `resources.accelerator` so the workload shape and the lease
4650
- * spend caps are both explicit. Docker and Firecracker sandboxes use the
4651
- * same lease path; the GPU is a temporary external worker, not host
4652
- * placement.
3899
+ * Temporary external GPU worker, independent of Docker/Firecracker placement. Requires
3900
+ * resources.accelerator and explicit lease spend caps.
4653
3901
  */
4654
3902
  gpuLease?: CreateGpuLeaseOptions;
4655
- /** Environment variables injected into the sandbox */
4656
3903
  env?: Record<string, string>;
4657
3904
  /**
4658
- * Opt named withheld public env keys into cold reclamation after the platform's
4659
- * idle bound and uploaded snapshot. The caller must keep a separate source and
4660
- * supply their values to resume({ env }); no automatic credential recovery is
4661
- * promised. Omit to retain the existing conservative policy. Hub/model keys
4662
- * retain their separate recovery rules.
3905
+ * Permit cold reclamation for named withheld env keys after the platform idle bound and
3906
+ * uploaded snapshot. Keep a separate credential source and supply values to
3907
+ * resume({env}); Hub/model recovery remains separate. Omitted retains conservative
3908
+ * policy.
4663
3909
  */
4664
3910
  envRecovery?: SandboxEnvRecovery;
4665
3911
  /**
4666
- * Maximum continuous runtime in seconds for each create or resume interval.
4667
- *
4668
- * On expiry the sandbox is SUSPENDED, not deleted: the container stops and
4669
- * the workspace is preserved, with a best-effort pre-suspend snapshot when
4670
- * the platform has snapshots enabled. It can be resumed for as long as it
4671
- * stays suspended. Resume starts a new runtime interval with the same limit;
4672
- * reads, connections, and activity do not extend that interval.
4673
- * Once the cold window also elapses (6 hours by default)
4674
- * the container is reclaimed, and bringing the preserved workspace back is
4675
- * a re-provision against the same ref rather than a resume. Drivers with a
4676
- * create/delete-only lifecycle (`driver: "tangle"`) skip the suspend
4677
- * entirely and keep running.
4678
- *
4679
- * `create()` substitutes no default: omit the field and it is not sent, so
4680
- * the sandbox falls back to the platform's global hard TTL — 365 days
4681
- * unless an operator changed it. Omitting this therefore leaves the sandbox
4682
- * effectively uncapped on age; it does not impose a short cap. Other entry
4683
- * points do supply a value of their own — the `tangle sandbox create` CLI
4684
- * and fleet machines both default to 3600 — so those paths never reach the
4685
- * global fallback.
3912
+ * Runtime interval in seconds; create/resume starts a new interval, activity does not
3913
+ * extend it. Expiry suspends and preserves the workspace, with a best-effort snapshot
3914
+ * when enabled. After the platform cold window, resume re-provisions the same ref.
3915
+ * Create/delete-only Tangle drivers keep running. Omitted sends no value: Platform
3916
+ * lifecycle policy owns the fallback; CLI/fleet defaults are independent.
4686
3917
  */
4687
3918
  maxLifetimeSeconds?: number;
4688
3919
  /**
4689
- * Idle timeout in seconds.
4690
- *
4691
- * After this much inactivity the sandbox is suspended, with the same
4692
- * suspend semantics and the same driver caveat as `maxLifetimeSeconds`.
4693
- *
4694
- * `create()` substitutes no default: omit the field and it is not sent, so
4695
- * the sandbox falls back to the platform's global idle timeout — 30 minutes
4696
- * unless an operator changed it. The `tangle sandbox create` CLI supplies
4697
- * its own default of 900.
3920
+ * Inactivity before suspension, with maxLifetimeSeconds semantics and driver caveat.
3921
+ * Omitted sends no value: Platform owns the fallback; CLI defaults are independent.
4698
3922
  */
4699
3923
  idleTimeoutSeconds?: number;
4700
3924
  /**
4701
- * Stopped-container grace in seconds before durable cold reclamation.
4702
- * Must be an integer from 1 through 9007199254740. Omit to use the
4703
- * platform cold window (6 hours by default). The lifecycle sweep removes
4704
- * compute only after the grace and a confirmed, uploaded workspace snapshot;
4705
- * the sandbox record and snapshot remain available to resume().
4706
- *
4707
- * Withheld credentials still require a recovery source. Use envRecovery for
4708
- * keys the caller can supply again on cold resume. This does not shorten
4709
- * idle suspension or the separate deleteAfterStoppedSeconds retention.
3925
+ * Positive integer seconds, representable as milliseconds, before cold compute
3926
+ * reclamation. Platform owns the default window. Reclamation requires an uploaded
3927
+ * snapshot; record/snapshot remain resumable. Withheld credentials still need
3928
+ * envRecovery or a separate recovery source. Independent of idle suspension and parked
3929
+ * deletion retention.
4710
3930
  */
4711
3931
  coldTimeoutSeconds?: number;
4712
3932
  /**
4713
- * Retention after stop, in seconds. After the sandbox has sat
4714
- * stopped/suspended continuously for this long, the platform deletes it —
4715
- * the same full teardown `delete()` performs (records, volumes, billing
4716
- * settlement, quota release).
4717
- *
4718
- * `create()` substitutes no default: omit the field and it is not sent, and
4719
- * the platform's own default retention of 30 days parked applies: the
4720
- * sandbox is kept at least that long, and the platform may reclaim it once
4721
- * it has stayed parked past that point. Set this field to hold a sandbox
4722
- * longer than the default, or to release it sooner — an explicit value is
4723
- * the only way to pin the outcome. The parked-retention sweeps do not remove
4724
- * a sandbox before the retention that applies to it has elapsed, and a resume
4725
- * restarts the clock. This bounds those sweeps only: an explicit `delete()`,
4726
- * and platform policy such as billing enforcement, are unaffected.
4727
- *
4728
- * Minimum 300 and maximum 9007199254740; the server rejects a smaller,
4729
- * larger, or non-integer value. The maximum is the largest whole number
4730
- * of seconds the platform can store as milliseconds without losing
4731
- * precision, so it is a bound on the storage, not a policy limit.
3933
+ * Continuous parked retention before full delete, including records, volumes, settlement
3934
+ * and quota release. Resume restarts the clock; explicit delete and billing enforcement
3935
+ * remain independent. Omitted uses Platform lifecycle policy; explicit values pin
3936
+ * retention and must meet its bounds and safe millisecond precision.
4732
3937
  */
4733
3938
  deleteAfterStoppedSeconds?: number;
4734
- /**
4735
- * Enable SSH access to the sandbox.
4736
- * Use `sandbox.ssh()` to get connection credentials.
4737
- * @default false
4738
- */
3939
+ /** Enable SSH; obtain credentials with sandbox.ssh(). Default false. */
4739
3940
  sshEnabled?: boolean;
4740
- /** Custom SSH public keys for access (optional) */
4741
3941
  sshPublicKeys?: string[];
4742
3942
  /** Stored SSH key IDs or names to authorize at creation time */
4743
3943
  sshKeyIds?: string[];
4744
- /**
4745
- * Enable web terminal access.
4746
- * Provides a browser-based terminal via websocket.
4747
- * @default false
4748
- */
3944
+ /** Enable the browser WebSocket terminal. Default false. */
4749
3945
  webTerminalEnabled?: boolean;
4750
- /**
4751
- * Customer-provided S3-compatible storage for snapshots (BYOS3).
4752
- *
4753
- * When configured, snapshots are stored in your own bucket
4754
- * instead of Tangle's managed storage.
4755
- */
3946
+ /** Customer snapshot bucket instead of managed storage; see StorageConfig. */
4756
3947
  storage?: StorageConfig;
4757
3948
  /**
4758
- * Run as a throwaway sandbox: the home directory is NOT persisted across restarts.
4759
- *
4760
- * By default an egress-enabled sandbox is provisioned a persistent home
4761
- * volume (so a stop/resume workspace keeps its state). Set `ephemeral: true` for
4762
- * a one-shot run — a benchmark case, a CI job, any box that produces output and
4763
- * is deleted — to skip that volume and run on a writable scratch home. Egress
4764
- * still works; you only lose the home directory on restart, which a throwaway box
4765
- * never relies on. Independent of `storage`/snapshots (durability stays opt-in).
3949
+ * Use writable scratch home instead of the persistent egress home volume; home state is
3950
+ * lost across restarts. Egress still works. Independent of storage/snapshots.
4766
3951
  */
4767
3952
  ephemeral?: boolean;
4768
3953
  /** Snapshot ID to restore from when creating the sandbox */
@@ -4770,261 +3955,110 @@ interface CreateSandboxOptions {
4770
3955
  /** Source sandbox ID that owns the snapshot (required when fromSnapshot is set) */
4771
3956
  fromSandboxId?: string;
4772
3957
  /**
4773
- * Apply a saved template at create time. Templates seed the
4774
- * sandbox with a snapshot, default environment, and config defaults
4775
- * so a team can publish a golden-path starting point once and have
4776
- * every member spin up the same baseline.
4777
- *
4778
- * The template must either be personal (owned by the caller) or
4779
- * belong to a team the caller is an active member of. Explicit
4780
- * fields on this call win over template defaults — so you can layer
4781
- * a one-off override on top of the golden path without forking the
4782
- * template itself.
4783
- *
4784
- * @example
4785
- * ```typescript
4786
- * const box = await client.create({
4787
- * templateId: "tpl_abc123",
4788
- * teamId: "team_...", // optional; sandbox is shared with the team
4789
- * });
4790
- * ```
3958
+ * Personal or active-team template seeds snapshot, image and config; explicit call
3959
+ * fields override defaults. Explicit templateId/teamId select the saved template and sharing scope.
4791
3960
  */
4792
3961
  templateId?: string;
4793
- /**
4794
- * Create from a published public template by id or slug.
4795
- * The API resolves the latest published version unless
4796
- * `publicTemplateVersionId` is also provided.
4797
- */
3962
+ /** Published template ID/slug; latest version unless publicTemplateVersionId pins one. */
4798
3963
  publicTemplateId?: string;
4799
3964
  /** Pin sandbox creation to a specific published public-template version. */
4800
3965
  publicTemplateVersionId?: string;
4801
3966
  /**
4802
- * Stored names or `"all"`: a bare name selects box delivery (value in the
4803
- * box env under the name) unless the store's saved policy binds it to the
4804
- * proxy. Proxy custody declarations are `proxySecrets`.
3967
+ * Stored names or all: bare names deliver box env unless saved policy selects proxy
3968
+ * custody; author proxy declarations with proxySecrets.
4805
3969
  */
4806
3970
  secrets?: Array<string> | "all";
4807
3971
  /** Canonical profile declaration, forwarded unchanged to the trusted lifecycle owner. */
4808
3972
  proxySecrets?: AgentProfile["proxySecrets"];
4809
3973
  /**
4810
- * Confidential environment variables for the **Tangle (on-chain) driver**,
4811
- * delivered OFF-chain via the operator's 2-phase secret provisioning
4812
- * endpoint after the create job completes. Requires the client to be
4813
- * configured with `operatorApiUrl`.
4814
- *
4815
- * Unlike {@link CreateSandboxOptions.env}, these values never appear in the
4816
- * job calldata: the client mints an EIP-191-authenticated operator session
4817
- * signed by the same key that submitted the job, and the operator injects
4818
- * the secrets only after verifying that key owns the sandbox.
4819
- *
4820
- * @example
4821
- * ```typescript
4822
- * const box = await client.create({
4823
- * tangleSecrets: { ANTHROPIC_API_KEY: process.env.ANTHROPIC_API_KEY },
4824
- * });
4825
- * ```
3974
+ * On-chain Tangle driver secrets, delivered off-chain after create via operatorApiUrl.
3975
+ * Never job calldata: an EIP-191 operator session signed by the submitting key proves
3976
+ * sandbox ownership before injection.
4826
3977
  */
4827
3978
  tangleSecrets?: Record<string, string>;
4828
- /** Custom metadata to store with the sandbox */
4829
3979
  /** Relative workspace paths retained by the platform with the run sessions. */
4830
3980
  retain?: {
4831
3981
  paths: string[];
4832
3982
  };
4833
3983
  metadata?: Record<string, unknown>;
4834
3984
  /**
4835
- * Share this sandbox with a team. The caller must be an active
4836
- * member of the team — the API rejects requests from non-members
4837
- * before provisioning. When omitted the sandbox is personal
4838
- * (accessible only to the creator).
3985
+ * Require active team membership, checked before provisioning; omitted creates a
3986
+ * personal sandbox.
4839
3987
  */
4840
3988
  teamId?: string;
4841
3989
  /**
4842
- * Sidecar capabilities to enable at boot. Each capability boots an
4843
- * additional subsystem inside the sandbox; absent capabilities incur
4844
- * zero startup cost.
4845
- *
4846
- * Currently supported:
4847
- * - `"computer_use"` — boots Xvfb, dbus, AT-SPI, and an MCP server
4848
- * exposing mouse/keyboard/screenshot via the Anthropic + OpenAI
4849
- * Responses computer-use surface. Required if you plan to call
4850
- * {@link SandboxInstance.getMcpAccessToken | `getMcpAccessToken`}
4851
- * with `capabilities: ["computer_use"]`.
4852
- *
4853
- * The capability is enforced at two layers:
4854
- * 1. The sidecar refuses to start if a capability's binaries are
4855
- * missing (`computer_use` needs the mounted Nix profile with
4856
- * Xvfb, dbus, xdotool, and scrot available at runtime).
4857
- * 2. The MCP token endpoint refuses to mint a `cap: ["computer_use"]`
4858
- * JWT for a sandbox that wasn't created with that capability.
4859
- *
4860
- * **Sizing note:** `computer_use` boots an always-on Xvfb + dbus
4861
- * stack costing roughly **~100 MB resident memory** inside the
4862
- * container. Billing is by reserved capacity (not measured RSS), so
4863
- * this comes out of your sandbox's RAM envelope rather than adding
4864
- * a separate line item. On a 1 GB sandbox that is ~10% of your
4865
- * workload's headroom; bump `resources.memoryMB` to 1.5–2 GB if
4866
- * the agent will run anything memory-hungry alongside it.
4867
- *
4868
- * @example
4869
- * ```typescript
4870
- * const box = await client.create({
4871
- * capabilities: ["computer_use"],
4872
- * });
4873
- * const { token } = await box.getMcpAccessToken({
4874
- * capabilities: ["computer_use"],
4875
- * });
4876
- * ```
3990
+ * Boot selected subsystems; omitted capabilities incur no startup cost. computer_use
3991
+ * requires its installed Xvfb/dbus/AT-SPI/MCP binaries and a matching getMcpAccessToken
3992
+ * capability; both sidecar startup and token mint fail closed otherwise. Desktop
3993
+ * services share reserved sandbox memory; size resources.memoryMB for the workload. See
3994
+ * SDK README computer-use example.
4877
3995
  */
4878
3996
  capabilities?: ReadonlyArray<"computer_use">;
4879
3997
  /**
4880
- * Privacy controls for the sandbox. Two independent layers:
4881
- *
4882
- * - **`egress`** — what happens when the sandbox sends a request to a
4883
- * model vendor (Anthropic, OpenAI, your own router, etc.):
4884
- * - `"redact"` — PII spans are masked before the request leaves
4885
- * the sandbox. Emails, JWTs, API keys, credit cards (Luhn-
4886
- * validated), SSNs, phone numbers, IPv4 addresses are caught
4887
- * today; names / postal addresses / DOBs land when the OPF
4888
- * model service is enabled. The agent receives normal
4889
- * responses; the vendor sees masked input.
4890
- * - `"block"` — PII presence fails the egress request closed.
4891
- * For high-compliance flows that prefer fail-closed to leak.
4892
- * - `"off"` — no egress filtering. Default for free tier; opt-in
4893
- * for tasks that genuinely need raw PII (form-filling,
4894
- * customer-support agents reading customer details).
4895
- *
4896
- * - **`logs`** — whether infrastructure logs / telemetry / Sentry
4897
- * redact PII before recording. This is OUR side, not the model
4898
- * vendor's, and there's basically never a reason to leak PII into
4899
- * our own logs. Default `"on"`.
4900
- *
4901
- * Note: privacy controls operate at the boundary between the
4902
- * sandbox and external systems. They do NOT redact contents inside
4903
- * the sandbox workspace itself — files / code / database fixtures
4904
- * the customer puts there are the customer's data and stay
4905
- * unmodified. Snapshots preserve those contents verbatim.
4906
- *
4907
- * @example
4908
- * ```typescript
4909
- * const box = await client.create({
4910
- * privacy: { egress: "redact", logs: "on" },
4911
- * });
4912
- * ```
3998
+ * Independent external-boundary controls. Egress redact masks recognized PII before
3999
+ * model-vendor requests; block refuses requests containing it; off allows raw content.
4000
+ * The serving privacy policy owns defaults and detector coverage. Logs controls
4001
+ * infrastructure telemetry/Sentry redaction (default on). Workspace files and snapshots
4002
+ * retain customer contents unchanged.
4913
4003
  */
4914
4004
  privacy?: {
4915
4005
  egress?: "redact" | "block" | "off";
4916
4006
  logs?: "on" | "off";
4917
4007
  };
4918
4008
  /**
4919
- * Require HIPAA placement: the sandbox is created only in a
4920
- * HIPAA-designated cell. It can only narrow what the platform decides
4921
- * from your verified credential. A team or app with an accepted BAA in
4922
- * Platform is always placed in a HIPAA cell, with or without this; a
4923
- * credential without that entitlement is refused with
4924
- * {@link CompliancePlacementError} (`COMPLIANCE_NOT_ENTITLED`, 403). A
4925
- * HIPAA create that no designated cell can take now is refused with
4926
- * the same class (`COMPLIANCE_CELL_UNAVAILABLE`, 503) and is never
4927
- * placed in another cell. The created sandbox's `compliance` echo stays
4928
- * server-derived.
4009
+ * Narrow placement to HIPAA cells; accepted Platform BAA credentials already require
4010
+ * this. Unentitled credentials fail COMPLIANCE_NOT_ENTITLED (403); unavailable HIPAA
4011
+ * capacity fails COMPLIANCE_CELL_UNAVAILABLE (503), never another cell.
4012
+ * CompliancePlacementError reports either; compliance echoes remain server-derived.
4929
4013
  */
4930
4014
  compliance?: {
4931
4015
  hipaa: true;
4932
4016
  } | ["hipaa"];
4933
4017
  /**
4934
- * Stable idempotency key for this logical create. Sent as the
4935
- * `Idempotency-Key` header so the API derives a deterministic sandbox
4936
- * identity from (owner, key): a retried create resolves to the SAME
4937
- * provisioning sandbox and joins the in-flight provision instead of
4938
- * starting a fresh cold start per retry. When omitted, the SDK
4939
- * generates one per `create()` call and reuses it across its own
4940
- * timeout-driven retries.
4018
+ * Owner/key identifies one create, joins in-flight provisioning and replays the same
4019
+ * sandbox. Omitted generates one key per create call, reused across its timeout retries.
4941
4020
  */
4942
4021
  idempotencyKey?: string;
4943
4022
  /**
4944
- * Platform user id whose wallet funds managed model usage for this sandbox.
4945
- *
4946
- * Use only from a trusted first-party service acting for an authenticated
4947
- * user. The Sandbox API honors this field only when the caller's exact
4948
- * verified API key ID is allow-listed; otherwise strict deployments reject
4949
- * the create.
4950
- * It never grants the caller permission to charge arbitrary users.
4951
- *
4952
- * This option applies to the HTTP Sandbox API client. Direct Tangle job
4953
- * creation does not support delegated billing.
4023
+ * Managed-model payer for trusted first-party delegation only. API requires the exact
4024
+ * verified key ID allowlist; strict deployments reject other callers. Grants no
4025
+ * arbitrary-user billing authority. HTTP client only; direct Tangle jobs do not delegate
4026
+ * billing.
4954
4027
  */
4955
4028
  billingOwnerId?: string;
4956
4029
  /**
4957
- * What pays this sandbox's compute. `"referral_credit"` spends the
4958
- * account's referral Sandbox-compute credit only: it runs on spare capacity,
4959
- * never falls back to the wallet, and stops with `scoped_credit_exhausted`
4960
- * when the credit runs out or `scoped_credit_held` while its campaign is on
4961
- * hold. Fixed for the sandbox's life. Personal sandboxes only. Defaults to
4962
- * the wallet.
4030
+ * Lifetime-fixed compute funding, default wallet. referral_credit is personal-only spare
4031
+ * capacity, never wallet fallback; exhaustion stops with scoped_credit_exhausted and
4032
+ * campaign hold with scoped_credit_held.
4963
4033
  */
4964
4034
  funding?: "wallet" | "referral_credit";
4965
4035
  /**
4966
- * Place this sandbox only on spare capacity.
4967
- *
4968
- * For first-party delegated creates only: the Sandbox API accepts it only
4969
- * together with `billingOwnerId` from an allow-listed first-party service
4970
- * key, and refuses every other create with 403 `CAPACITY_CLASS_FORBIDDEN`.
4971
- * It restricts placement and is not a priority: no host outside the spare
4972
- * pool takes the sandbox, and the create is refused with 503
4973
- * `SPARE_CAPACITY_UNAVAILABLE` when no spare pool admits it. It also skips
4974
- * the warm pool. The class is fixed at create; resume keeps it.
4036
+ * Lifetime-fixed spare placement, retained on resume, without warm-pool use or priority
4037
+ * promotion. Requires an allowlisted delegated billingOwnerId create; others fail
4038
+ * CAPACITY_CLASS_FORBIDDEN (403). No admitted spare capacity fails
4039
+ * SPARE_CAPACITY_UNAVAILABLE (503), never general placement.
4975
4040
  */
4976
4041
  capacityClass?: "spare_only";
4977
4042
  /**
4978
- * Auto-split inline file mounts out of an inline `backend.profile` object
4979
- * at create time, send the lean profile (mount refs stripped) in the
4980
- * create request, then write the deferred files back once the sandbox is
4981
- * running.
4982
- *
4983
- * When `true` (the default), a profile with sizeable inline mounts (e.g.
4984
- * skills, tool scripts) does not bloat the create POST; the SDK
4985
- * materializes those files via {@link FileSystem.writeMany} /
4986
- * {@link FileSystem.uploadData} after the sandbox reaches `running`. A batch
4987
- * write answered 502, 503 or 504, or lost with its connection, is sent again
4988
- * for up to 10 seconds before create() raises `PartialFailureError`. Only
4989
- * applies to an inline `AgentProfile` object on `backend.profile`; a
4990
- * named-profile string is never split. Set `false` to send the full profile
4991
- * in the create request without a post-create materialization step.
4992
- *
4993
- * @default true
4043
+ * Default true: strip large inline backend.profile mount refs from create, then
4044
+ * materialize files after running via writeMany/uploadData. Transient 502/503/504 or
4045
+ * connection loss follows shared write retry policy before PartialFailureError. Named
4046
+ * profiles are unchanged. False sends all mounts in create.
4994
4047
  */
4995
4048
  autoMaterializeProfileFiles?: boolean;
4996
4049
  /**
4997
- * Auto-defer an inline `backend.profile`'s static corpus so it is delivered
4998
- * once instead of on every turn. At create time the SDK strips inline
4999
- * `resources.skills` from the create request (keeping the create body under
5000
- * its wire cap), then primes the running sandbox with the full profile and
5001
- * references it by hash (`backend.profileSha256`) on subsequent turns. The
5002
- * handle still holds the full profile, so a cache miss transparently resends
5003
- * it.
5004
- *
5005
- * When `false`, the full profile, including skills, travels with the create
5006
- * request and every turn. This applies only to an inline `AgentProfile`
5007
- * object on `backend.profile` and is independent of
5008
- * {@link autoMaterializeProfileFiles}.
5009
- *
5010
- * A turn only substitutes the hash reference when the outgoing profile's
5011
- * content still matches what was primed: mutate the profile (or pass a
5012
- * changed per-turn `backend.profile`) and that turn sends the full profile
5013
- * inline again, so the runtime always runs the profile you passed.
5014
- *
5015
- * @default true
4050
+ * Default true: prime inline backend.profile skills once and use profileSha256 on later
4051
+ * turns; a cache miss resends the full retained profile. Mutated profiles or per-turn
4052
+ * overrides send their actual content. False sends all skills on create/every turn.
4053
+ * Independent of autoMaterializeProfileFiles.
5016
4054
  */
5017
4055
  autoDeferProfile?: boolean;
5018
4056
  }
5019
- /**
5020
- * Per-call overrides for {@link Sandbox.create}.
5021
- */
4057
+ /** Per-create request controls. */
5022
4058
  interface CreateRequestOptions {
5023
4059
  /**
5024
- * Time budget for the whole create-and-reach-running flow, in
5025
- * milliseconds. Cold provisions routinely take ~25–40s, so this
5026
- * defaults high (120000). If the initial POST rides the deadline the
5027
- * SDK polls the sandbox to `running` rather than re-POSTing.
4060
+ * Whole create-to-running budget in ms; SDK_TIMEOUTS.create owns the default. A POST
4061
+ * reaching the deadline is reconciled by polling, not a new create.
5028
4062
  */
5029
4063
  timeoutMs?: number;
5030
4064
  /** Abort the create + poll early. */
@@ -5121,13 +4155,8 @@ declare class TerminalStream {
5121
4155
  }
5122
4156
  //#endregion
5123
4157
  //#region src/types/sandbox-info.d.ts
5124
- /**
5125
- * SSH connection credentials.
5126
- */
5127
4158
  interface SSHCredentials {
5128
- /** Username for SSH authentication */
5129
4159
  username: string;
5130
- /** SSH server port */
5131
4160
  port: number;
5132
4161
  /** ProxyCommand for sandbox API tunnel-based SSH. */
5133
4162
  proxyCommand: string;
@@ -5140,7 +4169,6 @@ interface SSHCommandDescriptor {
5140
4169
  interface SandboxConnection {
5141
4170
  /** Owning host runtime origin; distinct from the regional controller URL. */
5142
4171
  hostUrl?: string;
5143
- /** Sandbox runtime API URL for programmatic access */
5144
4172
  runtimeUrl?: string;
5145
4173
  /** Cell exec origin. Direct requests select this sandbox by header. */
5146
4174
  execHost?: string;
@@ -5153,47 +4181,38 @@ interface SandboxConnection {
5153
4181
  authTokenExpiresAt?: string;
5154
4182
  /** Public inbound edge attachment state for `runtimeUrl`. */
5155
4183
  edgeStatus?: "pending" | "ready" | "failed" | "skipped";
5156
- /** Timestamp when the public edge reached this sandbox. */
5157
4184
  edgeReadyAt?: string;
5158
- /** Last public edge attachment error message. */
5159
4185
  edgeError?: string;
5160
- /** SSH connection info if `sshEnabled` was true during creation */
4186
+ /** Present when creation enabled SSH. */
5161
4187
  ssh?: SSHCredentials;
5162
- /** Web terminal URL if `webTerminalEnabled` was true during creation */
4188
+ /** Present when creation enabled the web terminal. */
5163
4189
  webTerminalUrl?: string;
5164
4190
  }
5165
- /** One server-attributed startup operation. Nested operations overlap; use parent links
5166
- * rather than summing every duration. */
4191
+ /**
4192
+ * Server-attributed startup steps may overlap; follow parent links instead of summing
4193
+ * durations.
4194
+ */
5167
4195
  interface StartupOperation {
5168
4196
  /** `<service>.<phase>` operation name. */
5169
4197
  operation: string;
5170
- /** Service that performed the step, when attributed. */
5171
4198
  service?: string;
5172
4199
  /** Terminal status of the step (e.g. `completed`, `skipped`, `error`). */
5173
4200
  status?: string;
5174
- /** Wall-clock duration of the step in milliseconds, when measured. */
5175
4201
  durationMs?: number;
5176
4202
  /** Containing operation name; absent for a top-level operation. */
5177
4203
  parent?: string;
5178
4204
  /** PII-scrubbed step detail (counts, ids, error codes). */
5179
4205
  metadata?: Record<string, unknown>;
5180
4206
  }
5181
- /** Server startup operations and their operation-name → duration map, exposed by
5182
- * SandboxInstance.startupDiagnostics. */
4207
+ /** Startup steps and operation-name duration map from SandboxInstance.startupDiagnostics. */
5183
4208
  interface StartupDiagnostics {
5184
- /** Ordered startup steps exactly as the platform emitted them. */
5185
4209
  operations: StartupOperation[];
5186
4210
  /** Derived map of operation name → measured duration in milliseconds. */
5187
4211
  phases: Record<string, number>;
5188
4212
  }
5189
- /**
5190
- * Full sandbox information returned from the API.
5191
- */
5192
4213
  interface SandboxInfo {
5193
4214
  readonly proxySecretReceipt?: ProxySecretReceipt;
5194
- /** Unique sandbox identifier */
5195
4215
  id: string;
5196
- /** Human-readable name */
5197
4216
  name?: string;
5198
4217
  /** Control-plane identity of the currently published filesystem contents. */
5199
4218
  filesystemIncarnationId?: string;
@@ -5201,66 +4220,52 @@ interface SandboxInfo {
5201
4220
  filesystemIncarnationProvenance?: "fresh" | "restored" | "unknown";
5202
4221
  /** Whether this incarnation is safe for consumers to treat as authoritative. */
5203
4222
  filesystemIncarnationReadiness?: "transitioning" | "ready";
5204
- /** Current status */
5205
4223
  status: SandboxStatus;
5206
- /** Connection information */
5207
4224
  connection?: SandboxConnection;
5208
- /** Custom metadata */
5209
4225
  metadata?: Record<string, unknown>;
5210
4226
  /** Verified current container identity, available on create and get. */
5211
4227
  captureProof?: SandboxCreateReceipt["captureProof"];
5212
- /** Verified Platform compliance attribution, read-only. Only {hipaa:true} is emitted;
5213
- * create options may narrow placement but cannot grant compliance. */
4228
+ /** Server-derived compliance; create can narrow placement, never grant it. */
5214
4229
  readonly compliance?: {
5215
4230
  readonly hipaa: true;
5216
4231
  };
5217
- /** When the sandbox was created */
5218
4232
  createdAt: Date;
5219
- /** When the sandbox started running */
5220
4233
  startedAt?: Date;
5221
- /** Last activity timestamp */
5222
4234
  lastActivityAt?: Date;
5223
4235
  /**
5224
- * Under `status: "stopped"`: `suspending` while the stop's final snapshot is
5225
- * still being committed, `suspended` once it is. Absent otherwise.
4236
+ * While stopped, suspending commits the final snapshot; suspended confirms it. Absent
4237
+ * otherwise.
5226
4238
  */
5227
4239
  lifecycleState?: "suspending" | "suspended";
5228
4240
  /** When the sandbox entered its current stop. */
5229
4241
  suspendedAt?: Date;
5230
- /** When the sandbox will expire */
5231
4242
  expiresAt?: Date;
5232
- /** Error message if status is 'failed' */
5233
4243
  error?: string;
5234
- /** GPU lease attached during sandbox creation, when requested. */
5235
4244
  gpuLease?: GpuLease;
5236
- /** Actual granted cgroup/volume shape, read from billing. Omitted means unknown, not a
5237
- * default allocation; older rows report their ledger repair value. */
4245
+ /**
4246
+ * Billing-derived granted shape; absent means unknown, older rows report ledger repair
4247
+ * values.
4248
+ */
5238
4249
  resources?: SandboxShape;
5239
4250
  /** Create-only startup details; see SandboxInstance.startupDiagnostics. */
5240
4251
  startupDiagnostics?: StartupDiagnostics;
5241
- /** Create-only platform verdict; absence means unknown, never created. See
5242
- * SandboxInstance.createReceipt. */
4252
+ /**
4253
+ * Create-only verdict; absence is unknown, never created. See
4254
+ * SandboxInstance.createReceipt.
4255
+ */
5243
4256
  createReceipt?: SandboxCreateReceipt;
5244
- /** Resolved egress policy */
5245
4257
  egressPolicy?: EgressPolicy;
5246
- /** Source of the egress policy */
5247
4258
  egressPolicySource?: "sandbox" | "team" | "platform";
5248
4259
  }
5249
- /** Basic health reported by the runtime inside a sandbox. */
5250
4260
  interface SandboxRuntimeHealth extends SandboxRuntimeHealthFields {}
5251
- /** Public preview link associated with a listening runtime port. */
5252
4261
  interface SandboxPortPreviewLink extends SandboxPortPreviewLinkFields {}
5253
- /** One process listening on a port inside a sandbox. */
5254
4262
  interface SandboxPortBinding extends SandboxPortBindingFields {
5255
4263
  previewLink?: SandboxPortPreviewLink;
5256
4264
  }
5257
- /** Options for creating an interactive terminal. */
5258
4265
  interface SandboxTerminalCreateOptions extends TerminalCreateRequestSdk {}
5259
4266
  /** Runtime request context used to attribute terminal events to an agent session. */
5260
4267
  interface SandboxTerminalRequestOptions extends TerminalInputQuerySdk {}
5261
- /** Interactive terminal metadata returned by the runtime. */
5262
4268
  interface SandboxTerminalInfo extends SandboxTerminalInfoWireSdk {
5263
- /** WebSocket path for terminal input/output. */
5264
4269
  streamUrl?: NonNullable<SandboxTerminalInfoWireSdk["streamUrl"]>;
5265
4270
  }
5266
4271
  /** Interactive terminal operations. Input/output flows over `streamUrl`. */
@@ -5271,9 +4276,7 @@ interface SandboxTerminalManager {
5271
4276
  list(): Promise<SandboxTerminalInfo[]>;
5272
4277
  get(sessionId: string): Promise<SandboxTerminalInfo | null>;
5273
4278
  }
5274
- /** Options for `box.terminals.attach()`. */
5275
4279
  interface SandboxTerminalAttachOptions {
5276
- /** Initial PTY geometry reported in the attach init frame. */
5277
4280
  cols?: number;
5278
4281
  rows?: number;
5279
4282
  /** Command to run when the connection id has no live PTY (default: shell). */
@@ -5284,8 +4287,10 @@ interface SandboxTerminalAttachOptions {
5284
4287
  * immediately after acknowledgement. */
5285
4288
  handlers?: TerminalStreamHandlers;
5286
4289
  }
5287
- /** REST terminals plus secured WebSocket attach (API key in Node, scoped token in
5288
- * browsers). Reused IDs reattach and replay history; new IDs start a shell or command. */
4290
+ /**
4291
+ * REST terminals and WebSocket attach: API key in Node, scoped token in browsers. Reused
4292
+ * IDs replay the existing PTY; new IDs start a shell/command.
4293
+ */
5289
4294
  interface SandboxTerminals extends SandboxTerminalManager {
5290
4295
  attach(connectionId: string, options?: SandboxTerminalAttachOptions): Promise<TerminalStream>;
5291
4296
  }
@@ -5301,64 +4306,37 @@ interface TeeAttestationReport {
5301
4306
  /** Unix timestamp when the report was generated. */
5302
4307
  timestamp: number;
5303
4308
  }
5304
- /**
5305
- * Response from a sandbox TEE attestation request.
5306
- */
5307
4309
  interface TeeAttestationResponse {
5308
- /** Sandbox identifier the attestation belongs to. */
5309
4310
  sandbox_id: string;
5310
- /** Raw TEE attestation report. */
5311
4311
  attestation: TeeAttestationReport;
5312
4312
  /** Caller nonce used for this report, when supplied. */
5313
4313
  attestationNonce?: string;
5314
4314
  }
5315
- /**
5316
- * TEE-bound public key used for sealed-secret encryption.
5317
- */
5318
4315
  interface TeePublicKey {
5319
4316
  /** Key agreement/encryption algorithm, e.g. `x25519-hkdf-sha256`. */
5320
4317
  algorithm: string;
5321
- /** Raw public key bytes. */
5322
4318
  public_key_bytes: number[];
5323
4319
  /** Attestation report binding this key to the enclave. */
5324
4320
  attestation: TeeAttestationReport;
5325
4321
  }
5326
- /**
5327
- * Response from a sandbox TEE public-key request.
5328
- */
5329
4322
  interface TeePublicKeyResponse {
5330
- /** Sandbox identifier the public key belongs to. */
5331
4323
  sandbox_id: string;
5332
- /** TEE-bound public key and its attestation proof. */
5333
4324
  public_key: TeePublicKey;
5334
4325
  }
5335
- /**
5336
- * Options for requesting fresh TEE attestation evidence.
5337
- */
5338
4326
  interface TeeAttestationOptions {
5339
4327
  /** Hex-encoded 32–64 byte caller nonce; supported backends bind it into report data to
5340
4328
  * prevent replay. */
5341
4329
  attestationNonce?: string;
5342
4330
  }
5343
- /**
5344
- * Options for listing sandboxes.
5345
- */
5346
4331
  interface ListSandboxOptions {
5347
- /** Filter by status */
5348
4332
  status?: SandboxStatus | SandboxStatus[];
5349
- /** Filter personal/team visibility scope */
5350
4333
  scope?: "personal" | "team" | "all" | `team:${string}`;
5351
- /** Maximum number of results */
5352
4334
  limit?: number;
5353
- /** Offset for pagination */
5354
4335
  offset?: number;
5355
4336
  /** Only sandboxes created with this `metadata.run` (the caller's run id). */
5356
4337
  run?: string;
5357
4338
  }
5358
- /**
5359
- * One compute generation of a sandbox created for a caller run
5360
- * (`metadata.run`). Deleted sandboxes keep theirs.
5361
- */
4339
+ /** Compute generation for metadata.run; retained after deletion. */
5362
4340
  interface SandboxRunGeneration {
5363
4341
  sandboxId: string;
5364
4342
  /** The sandbox's own compute generation id, not the caller run. */
@@ -6436,42 +5414,28 @@ interface ProcessManager {
6436
5414
  }
6437
5415
  //#endregion
6438
5416
  //#region src/types/provisioning.d.ts
6439
- /**
6440
- * Provisioning step identifier for progress reporting.
6441
- */
5417
+ /** Provisioning progress step. */
6442
5418
  type ProvisionStep = "match" | "networking" | "git" | "host-select" | "storage" | "image-check" | "image-pull" | "image-build" | "container-create" | "container-start" | "health-check" | "runtime-ready" | "workspace";
6443
5419
  /**
6444
- * Provisioning progress event emitted during sandbox creation.
6445
- *
6446
- * Subscribe via `box.watchProvisioning()` or pass `onProgress` to `box.waitFor()`.
6447
- *
5420
+ * Progress from watchProvisioning() or waitFor({onProgress}).
6448
5421
  * @example
6449
5422
  * ```typescript
6450
5423
  * for await (const event of box.watchProvisioning()) {
6451
- * console.log(`[${event.step}] ${event.status} — ${event.message}`);
6452
- * if (event.percent !== undefined) {
6453
- * updateProgressBar(event.percent);
6454
- * }
5424
+ * console.log(event.step, event.status, event.message);
6455
5425
  * }
6456
5426
  * ```
6457
5427
  */
6458
5428
  interface ProvisionEvent {
6459
- /** The provisioning step (e.g., "image-pull", "container-start") */
6460
5429
  step: ProvisionStep;
6461
- /** Status of this step */
6462
5430
  status: ProvisionStatus;
6463
- /** Human-readable progress message */
6464
5431
  message?: string;
6465
5432
  /** Overall progress percentage (0-100) */
6466
5433
  percent?: number;
6467
- /** Additional detail for the step */
6468
5434
  detail?: Record<string, unknown>;
6469
5435
  /** ISO timestamp */
6470
5436
  timestamp: string;
6471
5437
  }
6472
- /**
6473
- * Terminal provisioning event indicating success or failure.
6474
- */
5438
+ /** Terminal provisioning result. */
6475
5439
  type ProvisionResult = {
6476
5440
  type: "complete";
6477
5441
  containerId: string;
@@ -6481,43 +5445,26 @@ type ProvisionResult = {
6481
5445
  error: string;
6482
5446
  timestamp: string;
6483
5447
  };
6484
- /**
6485
- * Options for `waitFor()`.
6486
- */
6487
5448
  interface WaitForOptions {
6488
5449
  /** Timeout in milliseconds (default: 120000) */
6489
5450
  timeoutMs?: number;
6490
5451
  /** Poll interval in milliseconds when SSE is unavailable (default: 2000) */
6491
5452
  pollIntervalMs?: number;
6492
- /** AbortSignal for cancellation */
6493
5453
  signal?: AbortSignal;
6494
- /**
6495
- * Callback invoked with real-time provisioning progress events.
6496
- * When provided and the sandbox is provisioning, `waitFor()` uses SSE
6497
- * instead of polling for faster, more granular updates.
6498
- */
5454
+ /** Uses SSE provisioning progress rather than polling while provisioning. */
6499
5455
  onProgress?: (event: ProvisionEvent) => void;
6500
5456
  }
6501
- /**
6502
- * Options for resuming a stopped sandbox.
6503
- */
6504
5457
  interface ResumeOptions {
6505
5458
  /** Timeout in milliseconds for the resume request */
6506
5459
  timeoutMs?: number;
6507
- /** AbortSignal for cancellation */
6508
5460
  signal?: AbortSignal;
6509
5461
  /**
6510
- * Public env values the platform does not store at rest, such as a per-run
6511
- * coordination token or a secret passed at create. Pass the keys a
6512
- * `ResumeEnvRequiredError` named. They are used only when the resume
6513
- * builds a new runtime; a sandbox whose stopped runtime still exists keeps
6514
- * its own values.
5462
+ * Values the platform does not persist at rest, for ResumeEnvRequiredError keys;
5463
+ * used only when rebuilding a runtime. A
5464
+ * retained stopped runtime keeps its existing env.
6515
5465
  */
6516
5466
  env?: Record<string, string>;
6517
5467
  }
6518
- /**
6519
- * Usage information for the account.
6520
- */
6521
5468
  interface UsageInfo {
6522
5469
  /** Total compute minutes used today */
6523
5470
  computeMinutes: number;
@@ -6527,9 +5474,7 @@ interface UsageInfo {
6527
5474
  gpuCostUsd: number;
6528
5475
  /** Provider GPU lease cost basis today in USD */
6529
5476
  gpuProviderCostUsd: number;
6530
- /** Number of currently active sandboxes */
6531
5477
  activeSandboxes: number;
6532
- /** Total sandboxes created (lifetime) */
6533
5478
  totalSandboxes: number;
6534
5479
  /** Period start date (current day UTC) */
6535
5480
  periodStart: Date;
@@ -6547,40 +5492,20 @@ interface SandboxIdentity {
6547
5492
  /** Whether this key may select a funded platform payer on sandbox create. */
6548
5493
  billingDelegationAuthorized: boolean;
6549
5494
  }
6550
- /**
6551
- * Subscription and billing information for the account.
6552
- */
6553
5495
  interface SubscriptionInfo {
6554
- /** Current plan tier */
6555
5496
  plan: "free" | "pro" | "enterprise";
6556
- /** Subscription status */
6557
5497
  status: "active" | "canceled" | "past_due";
6558
5498
  /**
6559
- * Available credit balance in USD.
6560
- *
6561
- * **May be negative** for overage-enabled plans (pro/enterprise):
6562
- * overage charges can push the stored balance below zero. Free-tier
6563
- * plans floor at 0 at the charge path — free users top up their
6564
- * prepaid balance via Stripe Checkout (`POST /v1/billing/topup`,
6565
- * issue #874) when they hit zero rather than going into the red.
6566
- *
6567
- * Freshness semantics differ by deployment backend: the
6568
- * Cloudflare/D1 backend includes real-time projected cost of
6569
- * currently-running sandboxes; the Node/Redis backend returns the
6570
- * last-deducted stored balance and reflects running sandboxes only
6571
- * once their usage is recorded. Consumers should not assume this
6572
- * value is non-negative — use `>= 0` checks rather than truthiness.
5499
+ * USD balance may be negative on overage-enabled plans; free plans floor spending at
5500
+ * zero and require top-up. D1 includes projected running cost; Node/Redis reflects
5501
+ * running usage when recorded. Do not assume nonnegative values or use truthiness.
6573
5502
  */
6574
5503
  creditsAvailableUsd: number;
6575
- /** Credits used in USD */
6576
5504
  creditsUsedUsd: number;
6577
- /** Monthly included balance in USD */
6578
5505
  monthlyBalanceUsd: number;
6579
5506
  /** Max concurrent sandboxes (0 = unlimited) */
6580
5507
  maxConcurrentSandboxes: number;
6581
- /** Whether overage billing is allowed */
6582
5508
  overageAllowed: boolean;
6583
- /** Resource limits */
6584
5509
  limits: {
6585
5510
  maxCpuCores: number;
6586
5511
  maxRamGB: number;
@@ -6622,11 +5547,7 @@ interface SecretsManager {
6622
5547
  }
6623
5548
  //#endregion
6624
5549
  //#region src/types/snapshots.d.ts
6625
- /**
6626
- * Options for creating a snapshot.
6627
- */
6628
5550
  interface SnapshotOptions {
6629
- /** Tags to apply to the snapshot */
6630
5551
  tags?: string[];
6631
5552
  /**
6632
5553
  * Path-scoped capture is unsupported and rejected. Create a whole-workspace
@@ -6635,78 +5556,32 @@ interface SnapshotOptions {
6635
5556
  paths?: never;
6636
5557
  /** Customer-provided storage for BYOS3 (calls the runtime directly) */
6637
5558
  storage?: StorageConfig;
6638
- /**
6639
- * Retry identity for this snapshot. A retry with the same key and the same
6640
- * options replays the stored result instead of taking a second snapshot; the
6641
- * same key with different options is refused.
6642
- *
6643
- * Rejected together with `storage`: the BYOS3 path calls the runtime
6644
- * directly and keeps no operation ledger, so the key would guard nothing.
6645
- */
5559
+ /** Same key and options replay; changed options are refused. Unsupported with customer storage. */
6646
5560
  idempotencyKey?: string;
6647
- /**
6648
- * `false` answers as soon as the capture is durably accepted and returns a
6649
- * {@link SandboxOperation} whose result names the snapshot. Writes made
6650
- * before the call are in it; writes made after it returns may or may not
6651
- * be — wait for the operation when nothing later may land in it. Default
6652
- * `true`. Not supported with `storage`.
6653
- */
5561
+ /** `false` returns a durably accepted operation; pre-call writes are included, later writes may land until capture finishes. Default true; unsupported with storage. */
6654
5562
  wait?: boolean;
6655
5563
  }
6656
- /**
6657
- * How a keyed snapshot resolved.
6658
- *
6659
- * `created` ran this snapshot. `replayed` returned the acknowledgement an
6660
- * earlier request under the same key and options already stored. Absent when
6661
- * the request carried no key.
6662
- */
5564
+ /** `created` captured; `replayed` reused the same keyed request. Absent without a key. */
6663
5565
  interface SnapshotIdempotency {
6664
5566
  outcome: "created" | "replayed";
6665
5567
  requestDigest: string;
6666
5568
  }
6667
- /**
6668
- * Where a managed snapshot's copy stands.
6669
- *
6670
- * - `pending`: written to its sandbox's host and uploading to object storage.
6671
- * A restore on another host waits for the upload, and is refused if the
6672
- * upload cannot complete.
6673
- * - `synced`: in object storage; any host can restore it.
6674
- * - `failed`: the last upload attempt failed. The host still holds the
6675
- * snapshot and the next sync retries the upload.
6676
- */
5569
+ /** pending: host copy uploading; remote restores wait or fail. synced: remotely restorable. failed: host copy retained for retry. */
6677
5570
  type SnapshotRemoteSync = "pending" | "synced" | "failed";
6678
- /**
6679
- * Result of a snapshot operation.
6680
- */
6681
5571
  interface SnapshotResult {
6682
- /** Unique snapshot identifier */
6683
5572
  snapshotId: string;
6684
- /** When the snapshot was created */
6685
5573
  createdAt: Date;
6686
- /** Size in bytes */
6687
5574
  sizeBytes?: number;
6688
- /** Tags applied to the snapshot */
6689
5575
  tags: string[];
6690
- /**
6691
- * Upload state when the create answered. Absent for a replayed keyed
6692
- * create or a customer-storage snapshot. `listSnapshots()` reports the
6693
- * current state.
6694
- */
5576
+ /** Upload state at creation; absent for keyed replays and customer storage. listSnapshots reads current state. */
6695
5577
  remoteSync?: SnapshotRemoteSync;
6696
- /** Present only for a keyed snapshot. */
6697
5578
  idempotency?: SnapshotIdempotency;
6698
- /**
6699
- * Provenance receipt: which agent profile was materialized into the sandbox
6700
- * when this snapshot was taken. Answers "what configuration produced this
6701
- * state?" - the reproducibility, auditing, and self-improvement primitive.
6702
- * Absent when the sandbox ran without a profile (bare sandbox).
6703
- */
5579
+ /** Materialized agent profile at capture; absent for bare sandboxes. */
6704
5580
  provenance?: SnapshotProvenance;
6705
5581
  }
6706
5582
  interface SnapshotProvenance {
6707
- /** The profile the sandbox was created with. */
6708
5583
  base: {
6709
- /** Profile name (e.g. "gtm", "code-reviewer") or null if inline. */name: string | null; /** Content hash of the profile the SDK materialized. */
5584
+ /** Profile name (e.g. "gtm", "code-reviewer") or null if inline. */name: string | null;
6710
5585
  sha256: string;
6711
5586
  };
6712
5587
  /** The profile active at snapshot time (same as base unless updated). */
@@ -6714,14 +5589,12 @@ interface SnapshotProvenance {
6714
5589
  name: string | null;
6715
5590
  sha256: string;
6716
5591
  };
6717
- /** When the profile was materialized into the sandbox. */
6718
5592
  materializedAt: string;
6719
5593
  }
6720
5594
  /** A verb that can finish in the background (`wait: false`). */
6721
5595
  type SandboxOperationKind = "stop" | "snapshot" | "delete";
6722
5596
  /** `accepted` and `running` are open; `succeeded` and `failed` are terminal. */
6723
5597
  type SandboxOperationState = "accepted" | "running" | "succeeded" | "failed";
6724
- /** An operation as last read from the API. */
6725
5598
  interface SandboxOperationInfo {
6726
5599
  /** Empty for a verb the API finished synchronously. */
6727
5600
  id: string;
@@ -6734,16 +5607,14 @@ interface SandboxOperationInfo {
6734
5607
  completedAt?: Date;
6735
5608
  /** Where to poll it; empty for a verb that finished synchronously. */
6736
5609
  statusUrl: string;
6737
- /** Present once succeeded. */
6738
5610
  result?: {
6739
- /** stop: where the final workspace generation was durable when it finished. */durability?: "local" | "remote"; /** snapshot: the snapshot it took. */
6740
- snapshot?: SnapshotResult; /** stop: the sandbox record when it finished, in the API's shape. */
5611
+ /** stop: where the final workspace generation was durable when it finished. */durability?: "local" | "remote";
5612
+ snapshot?: SnapshotResult;
6741
5613
  sandbox?: Record<string, unknown>; /** delete: the delete and its product cleanup finished. */
6742
5614
  deleted?: true; /** delete: the authoritative physical-removal read when requested. */
6743
5615
  removal?: SandboxRemovalState; /** delete the API served synchronously: what that delete attested. */
6744
5616
  outcome?: SandboxDeleteOutcome;
6745
5617
  };
6746
- /** Present once failed. */
6747
5618
  error?: {
6748
5619
  code: string;
6749
5620
  message: string;
@@ -6751,12 +5622,7 @@ interface SandboxOperationInfo {
6751
5622
  }
6752
5623
  /** Options for a stop. */
6753
5624
  interface StopOptions {
6754
- /**
6755
- * `false` answers as soon as the stop is durably accepted and returns a
6756
- * {@link SandboxOperation}; the stop finishes in the background, billing
6757
- * runs until the runtime actually stops, and a resume issued meanwhile
6758
- * waits for it. Default `true`: resolve once the sandbox is stopped.
6759
- */
5625
+ /** `false` returns durable acceptance; billing continues until stopped and resume waits. Default true waits for stop. */
6760
5626
  wait?: boolean;
6761
5627
  /** Seal native sessions and retained workspace paths from the confirmed stopped generation before answering. Requires wait=true. */
6762
5628
  retain?: {
@@ -6767,63 +5633,34 @@ interface StopOptions {
6767
5633
  /** Retry identity: a retry with the same key answers the same operation. */
6768
5634
  idempotencyKey?: string;
6769
5635
  }
6770
- /**
6771
- * Outcome of deleting a snapshot.
6772
- *
6773
- * - `deleted`: this call removed the snapshot.
6774
- * - `already_absent`: it was not there; the caller's intent already holds.
6775
- * - `unknown`: the API did not report which, so neither is claimed. An API
6776
- * deployed before this field existed answers `unknown` rather than throwing.
6777
- */
5636
+ /** deleted: removed now; already_absent: already gone; unknown: no recognized attestation, including older APIs. */
6778
5637
  type SnapshotDeleteOutcome = "deleted" | "already_absent" | "unknown";
6779
5638
  interface SnapshotDeleteAcknowledgement {
6780
5639
  snapshotId: string;
6781
5640
  outcome: SnapshotDeleteOutcome;
6782
- /**
6783
- * How long the platform held this delete while the snapshot's resume
6784
- * generation finished copying to remote storage, in milliseconds: from the
6785
- * first request to the start of the one that succeeded, so the final
6786
- * request's own time is not counted. Absent when the delete was not held.
6787
- */
5641
+ /** HTTP receipt, separate from whether its body attests deletion. */
5642
+ response?: Pick<SandboxErrorMetadata, "requestId" | "traceId" | "method" | "endpoint"> & {
5643
+ status: number;
5644
+ receivedAt: string;
5645
+ parseState: "object" | "array" | "primitive" | "null" | "invalid-json" | "body-read-failed";
5646
+ attestation: {
5647
+ outcome: SnapshotDeleteOutcome | "missing" | "unrecognized";
5648
+ deleted?: boolean;
5649
+ success?: boolean;
5650
+ };
5651
+ };
5652
+ /** Retention wait in ms, from the first request to the final request start; absent when unheld. */
6788
5653
  retainedMs?: number;
6789
5654
  }
6790
- /**
6791
- * Outcome of deleting a sandbox, which is how a forked child is destroyed.
6792
- *
6793
- * - `destroyed`: this call removed the sandbox.
6794
- * - `already_absent`: the runtime had already lost it; the caller's intent
6795
- * already holds and the product-plane rows were finalized.
6796
- * - `unknown`: the API did not report which, so neither is claimed. An API
6797
- * deployed before this field existed answers `unknown` rather than throwing.
6798
- */
5655
+ /** destroyed: removed now; already_absent: runtime absent and product rows finalized; unknown: unattested, including older APIs. */
6799
5656
  type SandboxDeleteOutcome = "destroyed" | "already_absent" | "unknown";
6800
- /**
6801
- * Where the runtime's removal stands after a delete.
6802
- *
6803
- * - `pending`: the sandbox is dead and billed and will not come back; its
6804
- * container, volume and network are reclaimed behind the answer.
6805
- * - `complete`: the caller asked for `until: "removed"` and the reclaim
6806
- * finished inside the wait.
6807
- */
5657
+ /** pending: dead and billed, reclaim asynchronous. complete: requested removal proof finished. */
6808
5658
  type SandboxRemovalState = "pending" | "complete";
6809
5659
  interface SandboxDeleteOptions {
6810
- /** AbortSignal for cancellation */
6811
5660
  signal?: AbortSignal;
6812
- /**
6813
- * Wait for the runtime's removal proof instead of the acknowledgement. The
6814
- * default answers as soon as the sandbox is dead and billed; `"removed"`
6815
- * polls the accepted operation until the container and its volume are
6816
- * reclaimed. A synchronous API can report `removal: "pending"`.
6817
- */
5661
+ /** Default acknowledges death and billing; removed waits for container/volume reclaim. Synchronous APIs may still report pending. */
6818
5662
  until?: "removed";
6819
- /**
6820
- * `false` answers as soon as the delete is durably accepted and returns a
6821
- * {@link SandboxOperation}; the runtime keeps running and billing until
6822
- * the delete kills it, and `await op.wait()` resolves only once the delete
6823
- * and its product cleanup have finished. Not combinable with `until`.
6824
- * An API that serves the delete synchronously returns an operation that is
6825
- * already `succeeded`. Default `true`: the acknowledgement above.
6826
- */
5663
+ /** `false` returns durable acceptance; billing continues until killed, op.wait includes product cleanup. Synchronous replies yield succeeded operations. Default true; incompatible with until. */
6827
5664
  wait?: boolean;
6828
5665
  /** Retry identity for `wait: false`: a retry with the same key answers the same operation. */
6829
5666
  idempotencyKey?: string;
@@ -6831,23 +5668,12 @@ interface SandboxDeleteOptions {
6831
5668
  interface SandboxDeleteAcknowledgement {
6832
5669
  sandboxId: string;
6833
5670
  outcome: SandboxDeleteOutcome;
6834
- /**
6835
- * Present when the API answered on a tombstone. Absent for an API deployed
6836
- * before the field existed, or when the runtime was removed inline.
6837
- */
5671
+ /** Tombstone removal state; absent on older APIs or inline removal. */
6838
5672
  removal?: SandboxRemovalState;
6839
5673
  }
6840
- /**
6841
- * Which sandboxes {@link Sandbox.deleteMatching} removes: the caller's own
6842
- * sandboxes whose metadata matches every entry.
6843
- */
5674
+ /** Delete caller-owned sandboxes matching every metadata prefix. */
6844
5675
  interface DeleteMatchingSandboxesFilter {
6845
- /**
6846
- * Metadata key to required value prefix, 1 to 8 entries. A sandbox matches
6847
- * when each named key holds a string that starts with its prefix, for
6848
- * example `{ retainedIdempotencyKey: "runtime:<runId>:" }` for every
6849
- * sandbox one Agent Runtime run created.
6850
- */
5676
+ /** Required metadata prefixes, 1–8 entries; every value must start with its prefix. */
6851
5677
  metadataPrefix: Record<string, string>;
6852
5678
  }
6853
5679
  interface DeleteMatchingSandboxesOptions {
@@ -6855,30 +5681,15 @@ interface DeleteMatchingSandboxesOptions {
6855
5681
  cascade?: boolean;
6856
5682
  /** Hold each delete until the runtime's removal proof, as {@link SandboxDeleteOptions.until}. */
6857
5683
  until?: "removed";
6858
- /** AbortSignal for cancellation */
6859
5684
  signal?: AbortSignal;
6860
- /**
6861
- * Timeout for each request. The API deletes a bounded batch per request,
6862
- * so the default is 120 s, or 300 s with `until: "removed"`.
6863
- */
5685
+ /** Per-request timeout: default 120 s, or 300 s with removed. */
6864
5686
  timeoutMs?: number;
6865
5687
  }
6866
- /**
6867
- * What happened to one matched sandbox.
6868
- *
6869
- * - `destroyed`: this call removed it.
6870
- * - `already_absent`: it was gone when the delete reached it.
6871
- * - `failed`: the delete was refused; `status`, `code` and `error` say why,
6872
- * and the sandbox may still exist.
6873
- */
5688
+ /** destroyed: removed; already_absent: already gone; failed: refused, with status/code/error. */
6874
5689
  type DeleteMatchingSandboxOutcome = "destroyed" | "already_absent" | "failed";
6875
5690
  interface DeleteMatchingSandboxResult {
6876
5691
  id: string;
6877
- /**
6878
- * True when the sandbox is confirmed gone: `destroyed` or `already_absent`.
6879
- * With `until: "removed"`, a destroyed sandbox also needs its removal proof:
6880
- * one whose wait ran out reports `removal: "pending"` and `confirmed: false`.
6881
- */
5692
+ /** True for confirmed destroyed/absent; removed additionally requires completed physical-removal proof. */
6882
5693
  confirmed: boolean;
6883
5694
  outcome: DeleteMatchingSandboxOutcome;
6884
5695
  removal?: SandboxRemovalState;
@@ -6894,44 +5705,20 @@ interface DeleteMatchingSandboxResult {
6894
5705
  children?: string[];
6895
5706
  }
6896
5707
  interface DeleteMatchingSandboxesResult {
6897
- /**
6898
- * True only when every orchestrator was listed and every matching sandbox
6899
- * is confirmed gone. This is the teardown verdict; read `sandboxes` for
6900
- * the per-sandbox evidence.
6901
- *
6902
- * It covers the sandboxes the call listed. Stop creating matching sandboxes
6903
- * before calling, and call again once in-flight creates have settled: a
6904
- * create that registers after the listing, or retries with the same
6905
- * idempotency key, can leave a match behind a `true`.
6906
- */
5708
+ /** True only after complete listing and confirmed removal of every listed match. Stop concurrent creates first; this does not cover later registrations. */
6907
5709
  complete: boolean;
6908
5710
  /** False when an orchestrator could not be listed, so a match may be missing. */
6909
5711
  listingComplete: boolean;
6910
- /**
6911
- * Matching sandboxes not yet attempted when the call stopped. Nonzero only
6912
- * when the call reached its request bound; call again for them.
6913
- */
5712
+ /** Matches not attempted before the request bound; retry to finish them. */
6914
5713
  remaining: number;
6915
- /** The latest result for each sandbox this call attempted. */
6916
5714
  sandboxes: DeleteMatchingSandboxResult[];
6917
5715
  }
6918
- /**
6919
- * Whether the operation bound to an idempotency key is decided.
6920
- *
6921
- * - `found`: the key is decided; `state` says how.
6922
- * - `not_found`: nothing claimed this key.
6923
- * - `conflict`: an exact-body lookup found a different request body.
6924
- * - `unknown`: a request claimed the key and its result is still undecided, or
6925
- * the API is too old to answer. Reconcile against real state before retrying.
6926
- */
5716
+ /** found: decided; not_found: unclaimed; conflict: body differs; unknown: claimed but undecided or unsupported. Reconcile before retrying. */
6927
5717
  interface WorkspaceOperationLookup {
6928
5718
  outcome: "found" | "not_found" | "conflict" | "unknown";
6929
5719
  kind: "checkpoint" | "fork";
6930
5720
  state?: "pending" | "succeeded" | "failed";
6931
- /**
6932
- * Digest used for the lookup. Exact conflicts use `existingRequestDigest`
6933
- * for the stored digest. Absent only when key-only lookup finds no record.
6934
- */
5721
+ /** Lookup digest; absent only on an empty key-only lookup. Conflicts expose the stored digest separately. */
6935
5722
  requestDigest?: string;
6936
5723
  existingRequestDigest?: string;
6937
5724
  result?: Record<string, unknown>;
@@ -6946,24 +5733,15 @@ interface RestoreSnapshotOptions {
6946
5733
  destinationPath?: string;
6947
5734
  snapshotId?: string;
6948
5735
  }
6949
- /**
6950
- * Metadata about an existing snapshot.
6951
- */
6952
5736
  interface SnapshotInfo {
6953
- /** Unique snapshot identifier */
6954
5737
  snapshotId: string;
6955
- /** Sandbox this snapshot belongs to */
6956
5738
  sandboxId: string;
6957
- /** When the snapshot was created */
6958
5739
  createdAt: Date;
6959
- /** Tags applied to the snapshot */
6960
5740
  tags: string[];
6961
- /** Paths included in the snapshot */
6962
5741
  paths: string[];
6963
- /** Size in bytes */
6964
5742
  sizeBytes?: number;
6965
5743
  /** Upload state, when the API reports it. */
6966
5744
  remoteSync?: SnapshotRemoteSync;
6967
5745
  }
6968
5746
  //#endregion
6969
- export { CreateSandboxFleetOptions as $, RawEvidenceBoxDirectoryExport as $a, SessionExecutionStatus as $i, FileReadError as $n, ForkCounts as $r, SandboxFleetWorkspaceRestoreResult as $t, SandboxIdentity as A, ProvisionStatus as Aa, SandboxTraceEvent as Ai, SandboxShape as An, DriverInfo as Ar, SandboxFleetDriverTimings as At, ProcessSignal as B, ProcessStatus as Ba, CreateSessionOptions as Bi, EgressDenial as Bn, HostAgentDriverConfig as Br, SandboxFleetParent as Bt, WorkspaceOperationLookup as C, RouterRoutingOptions as Ca, IntelligenceReportWindow as Ci, TerminalStream as Cn, PublishPublicTemplateVersionOptions as Cr, SandboxFleetAgentSpec as Ct, ProvisionResult as D, RolloutScorer as Da, SandboxEvent as Di, SandboxResources as Dn, CreateGpuLeaseOptions as Dr, SandboxFleetDispatchFailureClass as Dt, ProvisionEvent as E, RolloutChildResult as Ea, PromptResult as Ei, SandboxConfig as En, AttachGpuLeaseOptions as Er, SandboxFleetCostEstimate as Et, EnsureDevServerOptions as F, GpuLeaseStatus as Fa, CommitTaskSessionOptions as Fi, EgressManager as Fn, GpuLeaseExecOptions as Fr, SandboxFleetMachineRecord as Ft, GitBranch as G, ExecResult as Ga, ListMessagesOptions as Gi, ChunkedUploadResult as Gn, ManagedProcessOptions as Gr, SandboxFleetToken as Gt, PreviewLinkInfo as H, CodeExecutionResult as Ha, DispatchPromptOptions as Hi, GitAuth as Hn, NonHostAgentDriverConfig as Hr, SandboxFleetPolicy as Ht, ExactProcessSpawnOptions as I, WorkspaceImagePublishInput as Ia, CompletedTurnPayload as Ii, NetworkConfig as In, GpuLeaseExecResult as Ir, SandboxFleetMachineSpec as It, GitStatus as J, SandboxEnvRecoveryView as Ja, SendSessionMessageRequest as Ji, DownloadProgress as Jn, ManagedProcessRecord as Jr, SandboxFleetTraceExport as Jt, GitCommit as K, WriteFileRequest as Ka, PublicProfileConflict as Ki, DeleteOptions as Kn, ManagedProcessResumeOptions as Kr, SandboxFleetTraceBundle as Kt, Process as L, WorkspaceImagePublishResult as La, CompletedTurnResult as Li, NetworkManager as Ln, GpuLeaseManager as Lr, SandboxFleetManifest as Lt, UsageInfo as M, GpuLeaseProviderName as Ma, SandboxTraceOptions as Mi, SandboxResourceUsage as Mn, GpuLease as Mr, SandboxFleetIntelligenceEnvelope as Mt, WaitForOptions as N, GpuLeaseProviderState as Na, TokenUsage as Ni, SandboxRuntimeCapabilities as Nn, GpuLeaseBilling as Nr, SandboxFleetMachine as Nt, ProvisionStep as O, RolloutStatus as Oa, SandboxIntelligenceEnvelope as Oi, SandboxShapesInfo as On, DockerDriverConfig as Or, SandboxFleetDispatchResponse as Ot, DevServerInfo as P, GpuLeaseProviderStatus as Pa, TurnBackendConfig as Pi, StorageConfig as Pn, GpuLeaseCommandResult as Pr, SandboxFleetMachineMeteredUsage as Pt, AttachSandboxFleetMachineOptions as Q, RawEvidenceBoxArchiveManifest as Qa, SessionExecutionInfo as Qi, FileReadBatchResult as Qn, BranchOptions as Qr, SandboxFleetWorkspaceReconcileResult as Qt, ProcessLogEntry as R, ProcessInfo as Ra, ConversationTurnOptions as Ri, SandboxEgressUsage as Rn, GpuLeaseProviders as Rr, SandboxFleetManifestMachine as Rt, StopOptions as S, McpServerConfig as Sa, IntelligenceReportSubjectType as Si, TeePublicKeyResponse as Sn, PublishPublicTemplateOptions as Sr, SandboxFleetAgent as St, SshKeysManager as T, SecretInfo as Ta, PromptOptions as Ti, CreateSandboxOptions as Tn, AcceleratorKind as Tr, SandboxFleetArtifactSpec as Tt, PreviewLinkManager as U, CodeLanguage as Ua, DispatchedSession as Ui, GitConfig as Un, CodeExecutionOptions as Ur, SandboxFleetProfileRef as Ut, ProcessSpawnOptions as V, SessionStatus as Va, CreateTaskSessionOptions as Vi, MAX_EGRESS_DENIALS_LIMIT as Vn, HostAgentRuntimeBackend as Vr, SandboxFleetPlacement as Vt, PreviewLinkWaitOptions as W, CodeResultPart as Wa, DriveTurnOptions as Wi, ChunkedUploadOptions as Wn, ManagedProcessJobs as Wr, SandboxFleetSpend as Wt, FleetDriveTurnRequest as X, RawEvidenceArchiveManifest as Xa, SessionBackendCredentials as Xi, FileInfo as Xn, HttpClient as Xr, SandboxFleetUsage as Xt, FleetDriveTurnOutcome as Y, NativeStoreHomeCopy as Ya, SentSessionMessage as Yi, DownloadResult as Yn, ManagedProcessSpec as Yr, SandboxFleetTraceOptions as Yt, TokenRefreshHandler as Z, RawEvidenceArchiveManifestNative as Za, SessionEventStreamOptions as Zi, FileReadBatchOptions as Zn, SdkTimingHook as Zr, SandboxFleetWorkspace as Zt, SnapshotInfo as _, BackendInfo as _a, DurablePlanSnapshot as _i, StartupOperation as _n, EffectiveBackendSource as _o, SearchMatch as _r, ListSandboxFleetOptions as _t, DeleteMatchingSandboxesResult as a, SessionMessage as aa, WaitForRolloutOptions as ai, SandboxInfo as an, RawEvidenceRecordsFile as ao, FileTreeResult as ar, FleetAgentRunStatus as at, SnapshotRemoteSync as b, BackendRuntimeConfigUpdate as ba, IntelligenceReportBudget as bi, TeeAttestationResponse as bn, PublicTemplateInfo as br, ReconcileSandboxFleetsOptions as bt, SandboxDeleteOptions as c, SessionResultOptions as ca, AgentApprovalRequirement as ci, SandboxRunGeneration as cn, InteractionResolutionAcknowledgement as co, FileWriteResult as cr, FleetDispatchResultBufferOptions as ct, SandboxOperationKind as d, TaskSessionFileChange as da, AgentToolInvocation as di, SandboxTerminalCreateOptions as dn, declaredSecretBaseToken as do, RenameOptions as dr, FleetExecDispatchResult as dt, SessionFailureReason as ea, ForkIdempotency as ei, SandboxFleetWorkspaceSnapshotResult as en, RawEvidenceBoxExportOptions as eo, FileReadResult as er, CreateSandboxFleetTokenOptions as et, SandboxOperationState as f, TaskSessionInfo as fa, CreateIntelligenceReportOptions as fi, SandboxTerminalInfo as fn, parseDeclaredSecretsEnv as fo, UploadOptions as fr, FleetMachineId as ft, SnapshotIdempotency as g, BackendConfig as ga, DurablePlanFollowUpResume as gi, StartupDiagnostics as gn, EffectiveBackendProfile as go, WriteManyOptions as gr, FleetRunOptions as gt, SnapshotDeleteOutcome as h, BackendCapabilities as ha, DurablePlanDecisionResult as hi, SandboxTerminals as hn, EffectiveBackend as ho, WriteManyFile as hr, FleetRunEvent as ht, DeleteMatchingSandboxesOptions as i, SessionListOptions as ia, RolloutStartResult as ii, SandboxConnection as in, RawEvidencePayloadFile as io, FileTreeOptions as ir, FleetAgentResult as it, SubscriptionInfo as j, GPU_LEASE_PROVIDER_NAMES as ja, SandboxTraceExport as ji, SandboxShapePreset as jn, DriverType as jr, SandboxFleetInfo as jt, ResumeOptions as k, RolloutTurnPart as ka, SandboxTraceBundle as ki, SandboxStatus as kn, DriverConfig as kr, SandboxFleetDriverCapability as kt, SandboxDeleteOutcome as l, TaskSessionChanges as la, AgentQuestionRequest as li, SandboxRuntimeHealth as ln, DECLARED_SECRET_HOSTS_ENV_VAR as lo, ListOptions as lr, FleetDispatchStreamOptions as lt, SnapshotDeleteAcknowledgement as m, TurnDriveResult as ma, DurablePlanDecisionOptions as mi, SandboxTerminalRequestOptions as mn, BackendType as mo, WriteFileOptions as mr, FleetPromptDispatchResult as mt, DeleteMatchingSandboxResult as n, SessionInfo as na, Rollout as ni, SSHCommandDescriptor as nn, RawEvidenceExportOptions as no, FileSystem as nr, FleetAgentId as nt, RestoreSnapshotOptions as o, SessionMessageAdmission as oa, BatchBackend as oi, SandboxPortBinding as on, RawEvidenceUnavailable as oo, FileUsageOptions as or, FleetDispatchCancelResult as ot, SandboxRemovalState as p, TaskSessionProfile as pa, DurablePlan as pi, SandboxTerminalManager as pn, ALL_BACKEND_TYPES as po, UploadProgress as pr, FleetPromptDispatchOptions as pt, GitDiff as q, SandboxEnvRecovery as qa, SendSessionMessageOptions as qi, DownloadOptions as qn, ManagedProcessState as qr, SandboxFleetTraceEvent as qt, DeleteMatchingSandboxesFilter as r, SessionInterruptOptions as ra, RolloutOptions as ri, SSHCredentials as rn, RawEvidenceNativeFile as ro, FileTreeFile as rr, FleetAgentPlacement as rt, SandboxDeleteAcknowledgement as s, SessionMessageInputPart as sa, BatchRunOptions as si, SandboxPortPreviewLink as sn, baseProxyToken as so, FileUsageResult as sr, FleetDispatchResultBuffer as st, DeleteMatchingSandboxOutcome as t, SessionForkOptions as ta, ForkLookupOptions as ti, ListSandboxOptions as tn, RawEvidenceDirectoryExport as to, FileRenameResult as tr, CreateSandboxFleetWithCoordinatorOptions as tt, SandboxOperationInfo as u, TaskSessionCommitResult as ua, AgentRunStatus as ui, SandboxTerminalAttachOptions as un, assertDeclaredSecretsHeld as uo, MkdirOptions as ur, FleetExecDispatchOptions as ut, SnapshotOptions as v, BackendManager as va, EventStreamOptions as vi, TeeAttestationOptions as vn, parseBackendType as vo, SearchOptions as vr, ReapExpiredSandboxFleetsOptions as vt, SecretsManager as w, SecretBindingOptions as wa, PromptInputPart as wi, CreateRequestOptions as wn, SandboxEnvironment as wr, SandboxFleetArtifact as wt, SnapshotResult as x, BackendStatus as xa, IntelligenceReportCompareTo as xi, TeePublicKey as xn, PublicTemplateVersionInfo as xr, ReconcileSandboxFleetsResult as xt, SnapshotProvenance as y, BackendMcpServerStatus as ya, IntelligenceReport as yi, TeeAttestationReport as yn, ExecOptions as yr, ReapExpiredSandboxFleetsResult as yt, ProcessManager as z, ProcessListOptions as za, ConversationTurnResult as zi, EgressPolicy as zn, GpuLeaseProvidersOptions as zr, SandboxFleetOperationsSummary as zt };
5747
+ export { CreateSandboxFleetOptions as $, declaredSecretBaseToken as $a, SessionExecutionStatus as $i, FileReadError as $n, ForkCounts as $r, SandboxFleetWorkspaceRestoreResult as $t, SandboxIdentity as A, ProvisionStatus as Aa, SandboxTraceEvent as Ai, SandboxShape as An, DriverInfo as Ar, SandboxFleetDriverTimings as At, ProcessSignal as B, ProcessStatus as Ba, CreateSessionOptions as Bi, EgressDenial as Bn, HostAgentDriverConfig as Br, SandboxFleetParent as Bt, WorkspaceOperationLookup as C, RouterRoutingOptions as Ca, IntelligenceReportWindow as Ci, TerminalStream as Cn, PublishPublicTemplateVersionOptions as Cr, SandboxFleetAgentSpec as Ct, ProvisionResult as D, RolloutScorer as Da, SandboxEvent as Di, SandboxResources as Dn, CreateGpuLeaseOptions as Dr, SandboxFleetDispatchFailureClass as Dt, ProvisionEvent as E, RolloutChildResult as Ea, PromptResult as Ei, SandboxConfig as En, AttachGpuLeaseOptions as Er, SandboxFleetCostEstimate as Et, EnsureDevServerOptions as F, GpuLeaseStatus as Fa, CommitTaskSessionOptions as Fi, EgressManager as Fn, GpuLeaseExecOptions as Fr, SandboxFleetMachineRecord as Ft, GitBranch as G, ExecResult as Ga, ListMessagesOptions as Gi, ChunkedUploadResult as Gn, ManagedProcessOptions as Gr, SandboxFleetToken as Gt, PreviewLinkInfo as H, CodeExecutionResult as Ha, DispatchPromptOptions as Hi, GitAuth as Hn, NonHostAgentDriverConfig as Hr, SandboxFleetPolicy as Ht, ExactProcessSpawnOptions as I, WorkspaceImagePublishInput as Ia, CompletedTurnPayload as Ii, NetworkConfig as In, GpuLeaseExecResult as Ir, SandboxFleetMachineSpec as It, GitStatus as J, SandboxEnvRecoveryView as Ja, SendSessionMessageRequest as Ji, DownloadProgress as Jn, ManagedProcessRecord as Jr, SandboxFleetTraceExport as Jt, GitCommit as K, WriteFileRequest as Ka, PublicProfileConflict as Ki, DeleteOptions as Kn, ManagedProcessResumeOptions as Kr, SandboxFleetTraceBundle as Kt, Process as L, WorkspaceImagePublishResult as La, CompletedTurnResult as Li, NetworkManager as Ln, GpuLeaseManager as Lr, SandboxFleetManifest as Lt, UsageInfo as M, GpuLeaseProviderName as Ma, SandboxTraceOptions as Mi, SandboxResourceUsage as Mn, GpuLease as Mr, SandboxFleetIntelligenceEnvelope as Mt, WaitForOptions as N, GpuLeaseProviderState as Na, TokenUsage as Ni, SandboxRuntimeCapabilities as Nn, GpuLeaseBilling as Nr, SandboxFleetMachine as Nt, ProvisionStep as O, RolloutStatus as Oa, SandboxIntelligenceEnvelope as Oi, SandboxShapesInfo as On, DockerDriverConfig as Or, SandboxFleetDispatchResponse as Ot, DevServerInfo as P, GpuLeaseProviderStatus as Pa, TurnBackendConfig as Pi, StorageConfig as Pn, GpuLeaseCommandResult as Pr, SandboxFleetMachineMeteredUsage as Pt, AttachSandboxFleetMachineOptions as Q, assertDeclaredSecretsHeld as Qa, SessionExecutionInfo as Qi, FileReadBatchResult as Qn, BranchOptions as Qr, SandboxFleetWorkspaceReconcileResult as Qt, ProcessLogEntry as R, ProcessInfo as Ra, ConversationTurnOptions as Ri, SandboxEgressUsage as Rn, GpuLeaseProviders as Rr, SandboxFleetManifestMachine as Rt, StopOptions as S, McpServerConfig as Sa, IntelligenceReportSubjectType as Si, TeePublicKeyResponse as Sn, PublishPublicTemplateOptions as Sr, SandboxFleetAgent as St, SshKeysManager as T, SecretInfo as Ta, PromptOptions as Ti, CreateSandboxOptions as Tn, AcceleratorKind as Tr, SandboxFleetArtifactSpec as Tt, PreviewLinkManager as U, CodeLanguage as Ua, DispatchedSession as Ui, GitConfig as Un, CodeExecutionOptions as Ur, SandboxFleetProfileRef as Ut, ProcessSpawnOptions as V, SessionStatus as Va, CreateTaskSessionOptions as Vi, MAX_EGRESS_DENIALS_LIMIT as Vn, HostAgentRuntimeBackend as Vr, SandboxFleetPlacement as Vt, PreviewLinkWaitOptions as W, CodeResultPart as Wa, DriveTurnOptions as Wi, ChunkedUploadOptions as Wn, ManagedProcessJobs as Wr, SandboxFleetSpend as Wt, FleetDriveTurnRequest as X, InteractionResolutionAcknowledgement as Xa, SessionBackendCredentials as Xi, FileInfo as Xn, HttpClient as Xr, SandboxFleetUsage as Xt, FleetDriveTurnOutcome as Y, baseProxyToken as Ya, SentSessionMessage as Yi, DownloadResult as Yn, ManagedProcessSpec as Yr, SandboxFleetTraceOptions as Yt, TokenRefreshHandler as Z, DECLARED_SECRET_HOSTS_ENV_VAR as Za, SessionEventStreamOptions as Zi, FileReadBatchOptions as Zn, SdkTimingHook as Zr, SandboxFleetWorkspace as Zt, SnapshotInfo as _, BackendInfo as _a, DurablePlanSnapshot as _i, StartupOperation as _n, SearchMatch as _r, ListSandboxFleetOptions as _t, DeleteMatchingSandboxesResult as a, SessionMessage as aa, WaitForRolloutOptions as ai, SandboxInfo as an, EffectiveBackendSource as ao, FileTreeResult as ar, FleetAgentRunStatus as at, SnapshotRemoteSync as b, BackendRuntimeConfigUpdate as ba, IntelligenceReportBudget as bi, TeeAttestationResponse as bn, PublicTemplateInfo as br, ReconcileSandboxFleetsOptions as bt, SandboxDeleteOptions as c, SessionResultOptions as ca, AgentApprovalRequirement as ci, SandboxRunGeneration as cn, FileWriteResult as cr, FleetDispatchResultBufferOptions as ct, SandboxOperationKind as d, TaskSessionFileChange as da, AgentToolInvocation as di, SandboxTerminalCreateOptions as dn, RenameOptions as dr, FleetExecDispatchResult as dt, SessionFailureReason as ea, ForkIdempotency as ei, SandboxFleetWorkspaceSnapshotResult as en, parseDeclaredSecretsEnv as eo, FileReadResult as er, CreateSandboxFleetTokenOptions as et, SandboxOperationState as f, TaskSessionInfo as fa, CreateIntelligenceReportOptions as fi, SandboxTerminalInfo as fn, UploadOptions as fr, FleetMachineId as ft, SnapshotIdempotency as g, BackendConfig as ga, DurablePlanFollowUpResume as gi, StartupDiagnostics as gn, WriteManyOptions as gr, FleetRunOptions as gt, SnapshotDeleteOutcome as h, BackendCapabilities as ha, DurablePlanDecisionResult as hi, SandboxTerminals as hn, WriteManyFile as hr, FleetRunEvent as ht, DeleteMatchingSandboxesOptions as i, SessionListOptions as ia, RolloutStartResult as ii, SandboxConnection as in, EffectiveBackendProfile as io, FileTreeOptions as ir, FleetAgentResult as it, SubscriptionInfo as j, GPU_LEASE_PROVIDER_NAMES as ja, SandboxTraceExport as ji, SandboxShapePreset as jn, DriverType as jr, SandboxFleetInfo as jt, ResumeOptions as k, RolloutTurnPart as ka, SandboxTraceBundle as ki, SandboxStatus as kn, DriverConfig as kr, SandboxFleetDriverCapability as kt, SandboxDeleteOutcome as l, TaskSessionChanges as la, AgentQuestionRequest as li, SandboxRuntimeHealth as ln, ListOptions as lr, FleetDispatchStreamOptions as lt, SnapshotDeleteAcknowledgement as m, TurnDriveResult as ma, DurablePlanDecisionOptions as mi, SandboxTerminalRequestOptions as mn, WriteFileOptions as mr, FleetPromptDispatchResult as mt, DeleteMatchingSandboxResult as n, SessionInfo as na, Rollout as ni, SSHCommandDescriptor as nn, BackendType as no, FileSystem as nr, FleetAgentId as nt, RestoreSnapshotOptions as o, SessionMessageAdmission as oa, BatchBackend as oi, SandboxPortBinding as on, parseBackendType as oo, FileUsageOptions as or, FleetDispatchCancelResult as ot, SandboxRemovalState as p, TaskSessionProfile as pa, DurablePlan as pi, SandboxTerminalManager as pn, UploadProgress as pr, FleetPromptDispatchOptions as pt, GitDiff as q, SandboxEnvRecovery as qa, SendSessionMessageOptions as qi, DownloadOptions as qn, ManagedProcessState as qr, SandboxFleetTraceEvent as qt, DeleteMatchingSandboxesFilter as r, SessionInterruptOptions as ra, RolloutOptions as ri, SSHCredentials as rn, EffectiveBackend as ro, FileTreeFile as rr, FleetAgentPlacement as rt, SandboxDeleteAcknowledgement as s, SessionMessageInputPart as sa, BatchRunOptions as si, SandboxPortPreviewLink as sn, FileUsageResult as sr, FleetDispatchResultBuffer as st, DeleteMatchingSandboxOutcome as t, SessionForkOptions as ta, ForkLookupOptions as ti, ListSandboxOptions as tn, ALL_BACKEND_TYPES as to, FileRenameResult as tr, CreateSandboxFleetWithCoordinatorOptions as tt, SandboxOperationInfo as u, TaskSessionCommitResult as ua, AgentRunStatus as ui, SandboxTerminalAttachOptions as un, MkdirOptions as ur, FleetExecDispatchOptions as ut, SnapshotOptions as v, BackendManager as va, EventStreamOptions as vi, TeeAttestationOptions as vn, SearchOptions as vr, ReapExpiredSandboxFleetsOptions as vt, SecretsManager as w, SecretBindingOptions as wa, PromptInputPart as wi, CreateRequestOptions as wn, SandboxEnvironment as wr, SandboxFleetArtifact as wt, SnapshotResult as x, BackendStatus as xa, IntelligenceReportCompareTo as xi, TeePublicKey as xn, PublicTemplateVersionInfo as xr, ReconcileSandboxFleetsResult as xt, SnapshotProvenance as y, BackendMcpServerStatus as ya, IntelligenceReport as yi, TeeAttestationReport as yn, ExecOptions as yr, ReapExpiredSandboxFleetsResult as yt, ProcessManager as z, ProcessListOptions as za, ConversationTurnResult as zi, EgressPolicy as zn, GpuLeaseProvidersOptions as zr, SandboxFleetOperationsSummary as zt };