eve 0.12.0 → 0.12.2

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 (126) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/src/chunks/{use-eve-agent-D9ZhQhyV.js → use-eve-agent-DEm_Jg4k.js} +18 -4
  3. package/dist/src/chunks/{use-eve-agent-DFI0POM9.js → use-eve-agent-DsXOQMFZ.js} +18 -4
  4. package/dist/src/cli/commands/init.js +1 -1
  5. package/dist/src/cli/dev/tui/command-typeahead.d.ts +1 -1
  6. package/dist/src/cli/dev/tui/command-typeahead.js +1 -1
  7. package/dist/src/cli/dev/tui/prompt-command-handler.js +1 -1
  8. package/dist/src/cli/dev/tui/runner.d.ts +6 -2
  9. package/dist/src/cli/dev/tui/runner.js +1 -1
  10. package/dist/src/cli/dev/tui/setup-commands.d.ts +6 -2
  11. package/dist/src/cli/dev/tui/setup-commands.js +2 -2
  12. package/dist/src/cli/dev/tui/setup-issues.d.ts +16 -2
  13. package/dist/src/cli/dev/tui/setup-issues.js +1 -1
  14. package/dist/src/cli/dev/tui/setup-panel.js +2 -2
  15. package/dist/src/cli/dev/tui/target.d.ts +21 -0
  16. package/dist/src/cli/dev/tui/target.js +1 -0
  17. package/dist/src/cli/dev/tui/terminal-renderer.js +3 -3
  18. package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.d.ts +2 -0
  19. package/dist/src/cli/dev/tui/test/fake-setup-flow-renderer.js +1 -0
  20. package/dist/src/cli/dev/tui/theme.d.ts +3 -1
  21. package/dist/src/cli/dev/tui/theme.js +1 -1
  22. package/dist/src/cli/dev/tui/tui.d.ts +4 -14
  23. package/dist/src/cli/dev/tui/tui.js +1 -1
  24. package/dist/src/cli/dev/url.js +1 -1
  25. package/dist/src/cli/run.d.ts +0 -12
  26. package/dist/src/cli/run.js +2 -2
  27. package/dist/src/client/client.js +1 -1
  28. package/dist/src/client/index.d.ts +1 -1
  29. package/dist/src/client/open-stream.d.ts +2 -0
  30. package/dist/src/client/open-stream.js +1 -1
  31. package/dist/src/client/session.d.ts +2 -1
  32. package/dist/src/client/session.js +1 -1
  33. package/dist/src/client/types.d.ts +9 -0
  34. package/dist/src/compiled/.vendor-stamp.json +1 -1
  35. package/dist/src/compiled/@vercel/sandbox/_async-retry.d.ts +8 -0
  36. package/dist/src/compiled/@vercel/sandbox/_workflow-serde.d.ts +5 -0
  37. package/dist/src/compiled/@vercel/sandbox/api-client/api-client.d.ts +1442 -0
  38. package/dist/src/compiled/@vercel/sandbox/api-client/api-error.d.ts +29 -0
  39. package/dist/src/compiled/@vercel/sandbox/api-client/base-client.d.ts +39 -0
  40. package/dist/src/compiled/@vercel/sandbox/api-client/file-writer.d.ts +66 -0
  41. package/dist/src/compiled/@vercel/sandbox/api-client/index.d.ts +2 -0
  42. package/dist/src/compiled/@vercel/sandbox/api-client/validators.d.ts +878 -0
  43. package/dist/src/compiled/@vercel/sandbox/api-client/with-retry.d.ts +10 -0
  44. package/dist/src/compiled/@vercel/sandbox/auth/error.d.ts +15 -0
  45. package/dist/src/compiled/@vercel/sandbox/auth/file.d.ts +18 -0
  46. package/dist/src/compiled/@vercel/sandbox/auth/index.d.ts +6 -0
  47. package/dist/src/compiled/@vercel/sandbox/auth/oauth.d.ts +111 -0
  48. package/dist/src/compiled/@vercel/sandbox/auth/poll-for-token.d.ts +28 -0
  49. package/dist/src/compiled/@vercel/sandbox/auth/project.d.ts +40 -0
  50. package/dist/src/compiled/@vercel/sandbox/command.d.ts +290 -0
  51. package/dist/src/compiled/@vercel/sandbox/constants.d.ts +5 -0
  52. package/dist/src/compiled/@vercel/sandbox/filesystem.d.ts +258 -0
  53. package/dist/src/compiled/@vercel/sandbox/index.d.ts +10 -129
  54. package/dist/src/compiled/@vercel/sandbox/proxy.d.ts +55 -0
  55. package/dist/src/compiled/@vercel/sandbox/sandbox.d.ts +1058 -0
  56. package/dist/src/compiled/@vercel/sandbox/session.d.ts +432 -0
  57. package/dist/src/compiled/@vercel/sandbox/snapshot.d.ts +229 -0
  58. package/dist/src/compiled/@vercel/sandbox/utils/get-credentials.d.ts +21 -0
  59. package/dist/src/compiled/@vercel/sandbox/utils/paginator.d.ts +16 -0
  60. package/dist/src/compiled/@vercel/sandbox/utils/resolveSignal.d.ts +15 -0
  61. package/dist/src/compiled/@vercel/sandbox/utils/sandbox-snapshot.d.ts +11 -0
  62. package/dist/src/compiled/@vercel/sandbox/utils/types.d.ts +11 -0
  63. package/dist/src/compiled/chat/_workflow-serde.d.ts +3 -0
  64. package/dist/src/compiled/chat/index.d.ts +1 -1
  65. package/dist/src/evals/cli/eval-client.d.ts +12 -16
  66. package/dist/src/evals/cli/eval-client.js +1 -1
  67. package/dist/src/evals/cli/eval.js +1 -1
  68. package/dist/src/execution/sandbox/bindings/vercel-base-runtime.d.ts +3 -3
  69. package/dist/src/execution/sandbox/bindings/vercel-create-sdk.d.ts +8 -13
  70. package/dist/src/execution/sandbox/bindings/vercel-credentials.d.ts +3 -3
  71. package/dist/src/execution/sandbox/bindings/vercel-lookup.d.ts +4 -5
  72. package/dist/src/execution/sandbox/bindings/vercel-read-stream.d.ts +5 -0
  73. package/dist/src/execution/sandbox/bindings/vercel-read-stream.js +1 -0
  74. package/dist/src/execution/sandbox/bindings/vercel-sdk-types.d.ts +6 -0
  75. package/dist/src/execution/sandbox/bindings/vercel-sdk-types.js +1 -0
  76. package/dist/src/execution/sandbox/bindings/vercel.d.ts +4 -4
  77. package/dist/src/execution/sandbox/bindings/vercel.js +1 -1
  78. package/dist/src/harness/compaction.d.ts +2 -3
  79. package/dist/src/harness/compaction.js +1 -1
  80. package/dist/src/harness/tool-loop.js +1 -1
  81. package/dist/src/internal/application/package.js +1 -1
  82. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -1
  83. package/dist/src/internal/nitro/host/start-development-server.js +2 -2
  84. package/dist/src/public/sandbox/vercel-sandbox.d.ts +12 -9
  85. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -1
  86. package/dist/src/services/dev-client/client-options.d.ts +9 -4
  87. package/dist/src/services/dev-client/client-options.js +1 -1
  88. package/dist/src/services/dev-client/credential-gate.d.ts +19 -0
  89. package/dist/src/services/dev-client/credential-gate.js +1 -0
  90. package/dist/src/services/dev-client/local-host.d.ts +4 -0
  91. package/dist/src/services/dev-client/local-host.js +1 -0
  92. package/dist/src/services/dev-client/request-headers.d.ts +38 -56
  93. package/dist/src/services/dev-client/request-headers.js +1 -1
  94. package/dist/src/services/dev-client/runtime-artifacts.js +1 -1
  95. package/dist/src/services/dev-client/vercel-auth-error.d.ts +2 -0
  96. package/dist/src/services/dev-client/vercel-auth-error.js +2 -2
  97. package/dist/src/services/dev-client.js +1 -1
  98. package/dist/src/setup/cli/option-row.d.ts +11 -5
  99. package/dist/src/setup/cli/option-row.js +1 -1
  100. package/dist/src/setup/cli/prompt-ui.d.ts +6 -6
  101. package/dist/src/setup/cli/prompt-ui.js +2 -2
  102. package/dist/src/setup/flows/model.d.ts +2 -0
  103. package/dist/src/setup/flows/model.js +1 -1
  104. package/dist/src/setup/project-resolution.d.ts +13 -0
  105. package/dist/src/setup/project-resolution.js +1 -1
  106. package/dist/src/setup/scaffold/create/project.js +1 -1
  107. package/dist/src/setup/scaffold/index.d.ts +1 -1
  108. package/dist/src/setup/scaffold/index.js +1 -1
  109. package/dist/src/setup/scaffold/update/channels.d.ts +8 -1
  110. package/dist/src/setup/scaffold/update/channels.js +2 -2
  111. package/dist/src/setup/vercel-deployment.d.ts +53 -0
  112. package/dist/src/setup/vercel-deployment.js +1 -0
  113. package/dist/src/setup/vercel-project.js +1 -1
  114. package/dist/src/setup/verified-remote-client.d.ts +23 -0
  115. package/dist/src/setup/verified-remote-client.js +1 -0
  116. package/dist/src/shared/sandbox-network-policy.d.ts +2 -2
  117. package/dist/src/svelte/index.js +1 -1
  118. package/dist/src/svelte/use-eve-agent.js +1 -1
  119. package/dist/src/vue/index.js +1 -1
  120. package/dist/src/vue/use-eve-agent.js +1 -1
  121. package/docs/evals/targets.mdx +7 -5
  122. package/docs/guides/client/overview.mdx +3 -0
  123. package/docs/guides/dev-tui.md +5 -5
  124. package/package.json +1 -1
  125. package/dist/src/harness/tool-result-pruning.d.ts +0 -8
  126. package/dist/src/harness/tool-result-pruning.js +0 -1
@@ -0,0 +1,1058 @@
1
+ import { Paginator } from "./utils/paginator.js";
2
+ import { SandboxMetaData, SandboxRouteData, SessionMetaData, SnapshotMetadata } from "./api-client/validators.js";
3
+ import { NetworkPolicy, NetworkPolicyKeyValueMatcher, NetworkPolicyMatch, NetworkPolicyMatcher } from "./network-policy.js";
4
+ import { WithPrivate } from "./utils/types.js";
5
+ import { RUNTIMES } from "./constants.js";
6
+ import { APIClient, WithFetchOptions } from "./api-client/api-client.js";
7
+ import "./api-client/index.js";
8
+ import { Credentials } from "./utils/get-credentials.js";
9
+ import { Command, CommandFinished } from "./command.js";
10
+ import { Snapshot } from "./snapshot.js";
11
+ import { SandboxSnapshot } from "./utils/sandbox-snapshot.js";
12
+ import { RunCommandParams, Session } from "./session.js";
13
+ import { FileSystem } from "./filesystem.js";
14
+ import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "./_workflow-serde.js";
15
+
16
+ //#region src/sandbox.d.ts
17
+ /** @inline */
18
+ interface BaseCreateSandboxParams {
19
+ /**
20
+ * The name of the sandbox. If omitted, a random name will be generated.
21
+ */
22
+ name?: string;
23
+ /**
24
+ * The source of the sandbox.
25
+ *
26
+ * Omit this parameter start a sandbox without a source.
27
+ *
28
+ * For git sources:
29
+ * - `depth`: Creates shallow clones with limited commit history (minimum: 1)
30
+ * - `revision`: Clones and checks out a specific commit, branch, or tag
31
+ */
32
+ source?: {
33
+ type: "git";
34
+ url: string;
35
+ depth?: number;
36
+ revision?: string;
37
+ } | {
38
+ type: "git";
39
+ url: string;
40
+ username: string;
41
+ password: string;
42
+ depth?: number;
43
+ revision?: string;
44
+ } | {
45
+ type: "tarball";
46
+ url: string;
47
+ };
48
+ /**
49
+ * Array of port numbers to expose from the sandbox. Sandboxes can
50
+ * expose up to 4 ports.
51
+ */
52
+ ports?: number[];
53
+ /**
54
+ * Timeout in milliseconds before the sandbox auto-terminates.
55
+ */
56
+ timeout?: number;
57
+ /**
58
+ * Resources to allocate to the sandbox.
59
+ *
60
+ * Your sandbox will get the amount of vCPUs you specify here and
61
+ * 2048 MB of memory per vCPU.
62
+ */
63
+ resources?: {
64
+ vcpus: number;
65
+ };
66
+ /**
67
+ * The runtime of the sandbox, currently only `node24`, `node22`, `node26` and `python3.13` are supported.
68
+ * If not specified, the default runtime `node24` will be used.
69
+ */
70
+ runtime?: RUNTIMES | (string & {});
71
+ /**
72
+ * Network policy to define network restrictions for the sandbox.
73
+ * Defaults to full internet access if not specified.
74
+ */
75
+ networkPolicy?: NetworkPolicy;
76
+ /**
77
+ * Default environment variables for the sandbox.
78
+ * These are inherited by all commands unless overridden with
79
+ * the `env` option in `runCommand`.
80
+ *
81
+ * @example
82
+ * const sandbox = await Sandbox.create({
83
+ * env: { NODE_ENV: "production", API_KEY: "secret" },
84
+ * });
85
+ * // All commands will have NODE_ENV and API_KEY set
86
+ * await sandbox.runCommand("node", ["app.js"]);
87
+ */
88
+ env?: Record<string, string>;
89
+ /**
90
+ * Key-value tags to associate with the sandbox. Maximum 5 tags.
91
+ * @example { env: "staging", team: "infra" }
92
+ */
93
+ tags?: Record<string, string>;
94
+ /**
95
+ * An AbortSignal to cancel sandbox creation.
96
+ */
97
+ signal?: AbortSignal;
98
+ /**
99
+ * Enable or disable automatic restore of the filesystem between sessions.
100
+ */
101
+ persistent?: boolean;
102
+ /**
103
+ * Default snapshot expiration in milliseconds.
104
+ * When set, snapshots created for this sandbox will expire after this duration.
105
+ * Use `0` for no expiration.
106
+ */
107
+ snapshotExpiration?: number;
108
+ /**
109
+ * Retention policy that keeps only the N most recent snapshots of this
110
+ * sandbox. Older snapshots are evicted when a new one is created.
111
+ */
112
+ keepLastSnapshots?: {
113
+ /**
114
+ * Number of snapshots to keep (1-10).
115
+ */
116
+ count: number;
117
+ /**
118
+ * Expiration in milliseconds applied to kept snapshots.
119
+ * Use `0` for no expiration. Falls back to `snapshotExpiration` when omitted.
120
+ */
121
+ expiration?: number;
122
+ /**
123
+ * When `true` (the default), evicted snapshots are deleted immediately;
124
+ * when `false`, they keep the default expiration.
125
+ */
126
+ deleteEvicted?: boolean;
127
+ };
128
+ /**
129
+ * Called when the sandbox session is resumed (e.g., after a snapshot restore).
130
+ * Use this to re-warm caches, restore transient state, or run other setup logic.
131
+ */
132
+ onResume?: (sandbox: Sandbox) => Promise<void>;
133
+ }
134
+ type CreateSandboxParams = BaseCreateSandboxParams | (Omit<BaseCreateSandboxParams, "runtime" | "source"> & {
135
+ source: {
136
+ type: "snapshot";
137
+ snapshotId: string;
138
+ };
139
+ });
140
+ /**
141
+ * Parameters for {@link Sandbox.fork}.
142
+ *
143
+ * The fork inherits the source sandbox's current filesystem snapshot and copies
144
+ * as many config fields from the source as the server exposes. Any field set
145
+ * here acts as an override of the copied value.
146
+ *
147
+ * `env` is not copied (encrypted server-side); pass it explicitly to set
148
+ * environment variables on the fork. `runtime` is not exposed: when the
149
+ * source has a snapshot, it is inherited; otherwise it is copied from the
150
+ * source sandbox.
151
+ * @inline
152
+ */
153
+ type ForkSandboxParams = Omit<BaseCreateSandboxParams, "source" | "runtime"> & {
154
+ /**
155
+ * Name of the source sandbox to fork from.
156
+ */
157
+ sourceSandbox: string;
158
+ };
159
+ /** @inline */
160
+ interface GetSandboxParams {
161
+ /**
162
+ * The name of the sandbox.
163
+ */
164
+ name: string;
165
+ /**
166
+ * Whether to resume an existing session. Defaults to true.
167
+ */
168
+ resume?: boolean;
169
+ /**
170
+ * An AbortSignal to cancel the operation.
171
+ */
172
+ signal?: AbortSignal;
173
+ /**
174
+ * Called when the sandbox session is resumed (e.g., after a snapshot restore).
175
+ * Use this to re-warm caches, restore transient state, or run other setup logic.
176
+ */
177
+ onResume?: (sandbox: Sandbox) => Promise<void>;
178
+ }
179
+ /**
180
+ * Extends both {@link BaseCreateSandboxParams} and {@link GetSandboxParams}
181
+ * (minus `name`, which is required on get but optional here) so that any
182
+ * new parameter added to either flow is picked up automatically. The
183
+ * structural overlap on `signal` / `onResume` is intentional — both
184
+ * interfaces declare them with identical optional types.
185
+ * @inline
186
+ */
187
+ interface GetOrCreateSandboxParams extends BaseCreateSandboxParams, Omit<GetSandboxParams, "name"> {
188
+ /**
189
+ * Called once after a sandbox is freshly created (not when an existing
190
+ * sandbox is retrieved). Use this for one-time setup such as seeding
191
+ * files or warming caches. The returned promise is awaited before
192
+ * {@link Sandbox.getOrCreate} resolves.
193
+ */
194
+ onCreate?: (sandbox: Sandbox) => Promise<void>;
195
+ }
196
+ /**
197
+ * Serialized representation of a Sandbox for @workflow/serde.
198
+ * Fields `metadata` and `routes` are the original wire format from main.
199
+ * Fields `sandboxMetadata` and `projectId` are added for named-sandboxes.
200
+ */
201
+ interface SerializedSandbox {
202
+ metadata: SandboxSnapshot;
203
+ routes: SandboxRouteData[];
204
+ sandboxMetadata?: SandboxMetaData;
205
+ projectId?: string;
206
+ }
207
+ /**
208
+ * A Sandbox is a persistent, isolated Linux MicroVMs to run commands in.
209
+ * Use {@link Sandbox.create} or {@link Sandbox.get} to construct.
210
+ * @hideconstructor
211
+ */
212
+ declare class Sandbox {
213
+ private _client;
214
+ private readonly projectId;
215
+ /**
216
+ * In-flight resume promise, used to deduplicate concurrent resume calls.
217
+ */
218
+ private resumePromise;
219
+ /**
220
+ * Internal Session instance for the current VM.
221
+ */
222
+ private session;
223
+ /**
224
+ * Internal metadata about the sandbox.
225
+ */
226
+ private sandbox;
227
+ /**
228
+ * Hook that will be executed when a new session is created during resume.
229
+ */
230
+ private readonly onResume?;
231
+ /**
232
+ * A `node:fs/promises`-compatible API for interacting with the sandbox filesystem.
233
+ *
234
+ * @example
235
+ * const content = await sandbox.fs.readFile('/etc/hostname', 'utf8');
236
+ * await sandbox.fs.writeFile('/tmp/hello.txt', 'Hello, world!');
237
+ * const files = await sandbox.fs.readdir('/tmp');
238
+ * const stats = await sandbox.fs.stat('/tmp/hello.txt');
239
+ */
240
+ readonly fs: FileSystem;
241
+ /**
242
+ * Lazily resolve credentials and construct an API client.
243
+ * @internal
244
+ */
245
+ private ensureClient;
246
+ /**
247
+ * The name of this sandbox.
248
+ */
249
+ get name(): string;
250
+ /**
251
+ * Routes from ports to subdomains.
252
+ * @hidden
253
+ */
254
+ get routes(): SandboxRouteData[];
255
+ /**
256
+ * Whether the sandbox persists the state.
257
+ */
258
+ get persistent(): boolean;
259
+ /**
260
+ * The region this sandbox runs in.
261
+ */
262
+ get region(): string | undefined;
263
+ /**
264
+ * Number of virtual CPUs allocated.
265
+ */
266
+ get vcpus(): number | undefined;
267
+ /**
268
+ * Memory allocated in MB.
269
+ */
270
+ get memory(): number | undefined;
271
+ /** Runtime identifier (e.g. "node24", "python3.13"). */
272
+ get runtime(): string | undefined;
273
+ /**
274
+ * Cumulative egress bytes across all sessions.
275
+ */
276
+ get totalEgressBytes(): number | undefined;
277
+ /**
278
+ * Cumulative ingress bytes across all sessions.
279
+ */
280
+ get totalIngressBytes(): number | undefined;
281
+ /**
282
+ * Cumulative active CPU duration in milliseconds across all sessions.
283
+ */
284
+ get totalActiveCpuDurationMs(): number | undefined;
285
+ /**
286
+ * Cumulative wall-clock duration in milliseconds across all sessions.
287
+ */
288
+ get totalDurationMs(): number | undefined;
289
+ /**
290
+ * When this sandbox was last updated.
291
+ */
292
+ get updatedAt(): Date;
293
+ /**
294
+ * When the sandbox status was last updated.
295
+ */
296
+ get statusUpdatedAt(): Date | undefined;
297
+ /**
298
+ * When this sandbox was created.
299
+ */
300
+ get createdAt(): Date;
301
+ /**
302
+ * Interactive port.
303
+ */
304
+ get interactivePort(): number | undefined;
305
+ /**
306
+ * The default working directory of the current session (e.g.
307
+ * `/vercel/sandbox`).
308
+ */
309
+ get cwd(): string;
310
+ /**
311
+ * The status of the current session.
312
+ */
313
+ get status(): SessionMetaData["status"];
314
+ /**
315
+ * The default timeout of this sandbox in milliseconds.
316
+ */
317
+ get timeout(): number | undefined;
318
+ /**
319
+ * Key-value tags attached to the sandbox.
320
+ */
321
+ get tags(): Record<string, string> | undefined;
322
+ /**
323
+ * The default network policy of this sandbox.
324
+ */
325
+ get networkPolicy(): NetworkPolicy | undefined;
326
+ /**
327
+ * If the session was created from a snapshot, the ID of that snapshot.
328
+ */
329
+ get sourceSnapshotId(): string | undefined;
330
+ /**
331
+ * The current snapshot ID of this sandbox, if any.
332
+ */
333
+ get currentSnapshotId(): string | undefined;
334
+ /**
335
+ * The default snapshot expiration in milliseconds, if set.
336
+ */
337
+ get snapshotExpiration(): number | undefined;
338
+ /**
339
+ * The snapshot retention policy (`keep-last-snapshots`) currently configured
340
+ * on this sandbox, if any.
341
+ */
342
+ get keepLastSnapshots(): {
343
+ count: number;
344
+ expiration?: number;
345
+ deleteEvicted?: boolean;
346
+ } | undefined;
347
+ /**
348
+ * The amount of CPU used by the session. Only reported once the VM is stopped.
349
+ */
350
+ get activeCpuUsageMs(): number | undefined;
351
+ /**
352
+ * The amount of network data used by the session. Only reported once the VM is stopped.
353
+ */
354
+ get networkTransfer(): {
355
+ ingress: number;
356
+ egress: number;
357
+ } | undefined;
358
+ /**
359
+ * Allow to get a list of sandboxes for a team narrowed to the given params.
360
+ * It returns both the sandboxes and the pagination metadata to allow getting
361
+ * the next page of results.
362
+ *
363
+ * The returned object is async-iterable to auto-paginate through all pages:
364
+ *
365
+ * ```ts
366
+ * const result = await Sandbox.list({ namePrefix: "ci-" });
367
+ * for await (const sandbox of result) { ... }
368
+ * // or: await result.toArray();
369
+ * // or: for await (const page of result.pages()) { ... }
370
+ * ```
371
+ */
372
+ static list(params?: Partial<Parameters<APIClient["listSandboxes"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<Paginator<{
373
+ sandboxes: {
374
+ name: string;
375
+ persistent: boolean;
376
+ createdAt: number;
377
+ updatedAt: number;
378
+ currentSessionId: string;
379
+ status: "failed" | "aborted" | "pending" | "running" | "stopping" | "stopped" | "snapshotting";
380
+ region?: string | undefined;
381
+ vcpus?: number | undefined;
382
+ memory?: number | undefined;
383
+ runtime?: string | undefined;
384
+ timeout?: number | undefined;
385
+ networkPolicy?: {
386
+ [x: string]: unknown;
387
+ mode: "allow-all";
388
+ } | {
389
+ [x: string]: unknown;
390
+ mode: "deny-all";
391
+ } | {
392
+ [x: string]: unknown;
393
+ mode: "custom";
394
+ allowedDomains?: string[] | undefined;
395
+ allowedCIDRs?: string[] | undefined;
396
+ deniedCIDRs?: string[] | undefined;
397
+ injectionRules?: {
398
+ domain: string;
399
+ headers?: Record<string, string> | undefined;
400
+ headerNames?: string[] | undefined;
401
+ match?: {
402
+ path?: {
403
+ exact?: string | undefined;
404
+ startsWith?: string | undefined;
405
+ regex?: string | undefined;
406
+ } | undefined;
407
+ method?: string[] | undefined;
408
+ queryString?: {
409
+ key?: {
410
+ exact?: string | undefined;
411
+ startsWith?: string | undefined;
412
+ regex?: string | undefined;
413
+ } | undefined;
414
+ value?: {
415
+ exact?: string | undefined;
416
+ startsWith?: string | undefined;
417
+ regex?: string | undefined;
418
+ } | undefined;
419
+ }[] | undefined;
420
+ headers?: {
421
+ key?: {
422
+ exact?: string | undefined;
423
+ startsWith?: string | undefined;
424
+ regex?: string | undefined;
425
+ } | undefined;
426
+ value?: {
427
+ exact?: string | undefined;
428
+ startsWith?: string | undefined;
429
+ regex?: string | undefined;
430
+ } | undefined;
431
+ }[] | undefined;
432
+ } | undefined;
433
+ }[] | undefined;
434
+ forwardRules?: {
435
+ domain: string;
436
+ forwardURL: string;
437
+ match?: {
438
+ path?: {
439
+ exact?: string | undefined;
440
+ startsWith?: string | undefined;
441
+ regex?: string | undefined;
442
+ } | undefined;
443
+ method?: string[] | undefined;
444
+ queryString?: {
445
+ key?: {
446
+ exact?: string | undefined;
447
+ startsWith?: string | undefined;
448
+ regex?: string | undefined;
449
+ } | undefined;
450
+ value?: {
451
+ exact?: string | undefined;
452
+ startsWith?: string | undefined;
453
+ regex?: string | undefined;
454
+ } | undefined;
455
+ }[] | undefined;
456
+ headers?: {
457
+ key?: {
458
+ exact?: string | undefined;
459
+ startsWith?: string | undefined;
460
+ regex?: string | undefined;
461
+ } | undefined;
462
+ value?: {
463
+ exact?: string | undefined;
464
+ startsWith?: string | undefined;
465
+ regex?: string | undefined;
466
+ } | undefined;
467
+ }[] | undefined;
468
+ } | undefined;
469
+ }[] | undefined;
470
+ } | undefined;
471
+ totalEgressBytes?: number | undefined;
472
+ totalIngressBytes?: number | undefined;
473
+ totalActiveCpuDurationMs?: number | undefined;
474
+ totalDurationMs?: number | undefined;
475
+ currentSnapshotId?: string | undefined;
476
+ statusUpdatedAt?: number | undefined;
477
+ cwd?: string | undefined;
478
+ tags?: Record<string, string> | undefined;
479
+ snapshotExpiration?: number | undefined;
480
+ keepLastSnapshots?: {
481
+ count: number;
482
+ expiration?: number | undefined;
483
+ deleteEvicted?: boolean | undefined;
484
+ } | undefined;
485
+ }[];
486
+ pagination: {
487
+ count: number;
488
+ next: string | null;
489
+ };
490
+ }, "sandboxes">>;
491
+ /**
492
+ * Serialize a Sandbox instance to plain data for @workflow/serde.
493
+ *
494
+ * @param instance - The Sandbox instance to serialize
495
+ * @returns A plain object containing sandbox metadata and routes
496
+ */
497
+ static [WORKFLOW_SERIALIZE](instance: Sandbox): SerializedSandbox;
498
+ /**
499
+ * Deserialize a Sandbox from serialized snapshot data.
500
+ *
501
+ * The deserialized instance uses the serialized metadata synchronously and
502
+ * lazily creates an API client only when methods perform API requests.
503
+ *
504
+ * @param data - The serialized sandbox data
505
+ * @returns The reconstructed Sandbox instance
506
+ */
507
+ static [WORKFLOW_DESERIALIZE](data: SerializedSandbox): Sandbox;
508
+ /**
509
+ * Create a new sandbox.
510
+ *
511
+ * @param params - Creation parameters and optional credentials.
512
+ * @returns A promise resolving to the created {@link Sandbox}.
513
+ * @example
514
+ * <caption>Create a sandbox with default options</caption>
515
+ * const sandbox = await Sandbox.create();
516
+ *
517
+ * @example
518
+ * <caption>Create a sandbox and drop it in the end of the block</caption>
519
+ * async function fn() {
520
+ * await using const sandbox = await Sandbox.create();
521
+ * // Sandbox automatically stopped at the end of the lexical scope
522
+ * }
523
+ */
524
+ static create(params?: WithPrivate<CreateSandboxParams | (CreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox & AsyncDisposable>;
525
+ /**
526
+ * Fork an existing sandbox into a new one. Any field passed in `params`
527
+ * overrides the source value.
528
+ *
529
+ * If the source sandbox has no current snapshot, falls back to creating a
530
+ * fresh sandbox with the same copied config plus the source's `runtime`.
531
+ *
532
+ * `env` is not copied (encrypted server-side); pass it explicitly to set
533
+ * environment variables on the fork.
534
+ *
535
+ * @param params - Fork parameters and optional credentials.
536
+ * `sourceSandbox` is the name of the source sandbox; everything else
537
+ * acts as an override.
538
+ * @returns A promise resolving to the new {@link Sandbox}.
539
+ *
540
+ * @example
541
+ * <caption>Fork with all config copied from the source</caption>
542
+ * const fork = await Sandbox.fork({ sourceSandbox: "prod-agent" });
543
+ *
544
+ * @example
545
+ * <caption>Fork with an explicit new name and overridden vcpus</caption>
546
+ * const fork = await Sandbox.fork({
547
+ * sourceSandbox: "prod-agent",
548
+ * name: "forked-prod-agent",
549
+ * resources: { vcpus: 4 },
550
+ * });
551
+ */
552
+ static fork(params: WithPrivate<ForkSandboxParams | (ForkSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox & AsyncDisposable>;
553
+ /**
554
+ * Retrieve an existing sandbox and resume its session.
555
+ *
556
+ * @param params - Get parameters and optional credentials.
557
+ * @returns A promise resolving to the {@link Sandbox}.
558
+ */
559
+ static get(params: WithPrivate<GetSandboxParams | (GetSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
560
+ /**
561
+ * Retrieve an existing named sandbox, or create a new one if none exists.
562
+ *
563
+ * If `name` is omitted, this always creates a new sandbox and fires
564
+ * `onCreate`. If `name` is provided, it first tries {@link Sandbox.get};
565
+ * on `not_found` it creates a new sandbox with that name; on
566
+ * `snapshot_not_found` it deletes the stale named sandbox and creates
567
+ * a fresh one with the same name.
568
+ *
569
+ * @param params - Get/create parameters plus an optional `onCreate` hook.
570
+ * @returns A promise resolving to the {@link Sandbox}.
571
+ *
572
+ * @example
573
+ * <caption>Idempotent named sandbox with one-time setup</caption>
574
+ * const sandbox = await Sandbox.getOrCreate({
575
+ * name: "my-workspace",
576
+ * onCreate: async (sbx) => {
577
+ * await sbx.writeFiles([
578
+ * { path: "README.md", content: Buffer.from("# Hello") },
579
+ * ]);
580
+ * },
581
+ * });
582
+ *
583
+ * @example
584
+ * <caption>Unnamed — always creates</caption>
585
+ * const sandbox = await Sandbox.getOrCreate({
586
+ * onCreate: async (sbx) => {
587
+ * await sbx.runCommand("npm", ["install"]);
588
+ * },
589
+ * });
590
+ */
591
+ static getOrCreate(params?: WithPrivate<GetOrCreateSandboxParams | (GetOrCreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
592
+ /**
593
+ * Create a new Sandbox instance.
594
+ *
595
+ * @param params.client - Optional API client. If not provided, will be lazily created using global credentials.
596
+ * @param params.routes - Port-to-subdomain mappings for exposed ports
597
+ * @param params.sandbox - Sandbox snapshot metadata
598
+ */
599
+ constructor({
600
+ client,
601
+ routes,
602
+ session,
603
+ sandbox,
604
+ projectId,
605
+ onResume
606
+ }: {
607
+ client?: APIClient;
608
+ routes: SandboxRouteData[];
609
+ session?: SessionMetaData;
610
+ sandbox: SandboxMetaData;
611
+ projectId?: string;
612
+ onResume?: (sandbox: Sandbox) => Promise<void>;
613
+ });
614
+ /**
615
+ * Get the current session (the running VM) for this sandbox.
616
+ *
617
+ * @returns The {@link Session} instance.
618
+ */
619
+ currentSession(): Session;
620
+ /**
621
+ * Resume this sandbox by creating a new session via `getSandbox`.
622
+ */
623
+ private resume;
624
+ private doResume;
625
+ /**
626
+ * Poll until the current session reaches a terminal state, then resume.
627
+ */
628
+ private waitForStopAndResume;
629
+ /**
630
+ * Execute `fn`, and if the session is stopped/stopping/snapshotting, resume and retry.
631
+ */
632
+ private withResume;
633
+ /**
634
+ * Start executing a command in this sandbox.
635
+ *
636
+ * @param command - The command to execute.
637
+ * @param args - Arguments to pass to the command.
638
+ * @param opts - Optional parameters.
639
+ * @param opts.signal - An AbortSignal to cancel the command execution.
640
+ * @param opts.timeoutMs - Maximum time in milliseconds to wait for the
641
+ * command to complete. On expiry the process is killed with SIGKILL.
642
+ * @returns A {@link CommandFinished} result once execution is done.
643
+ */
644
+ runCommand(command: string, args?: string[], opts?: {
645
+ signal?: AbortSignal;
646
+ timeoutMs?: number;
647
+ }): Promise<CommandFinished>;
648
+ /**
649
+ * Start executing a command in detached mode.
650
+ *
651
+ * @param params - The command parameters.
652
+ * @returns A {@link Command} instance for the running command.
653
+ */
654
+ runCommand(params: RunCommandParams & {
655
+ detached: true;
656
+ }): Promise<Command>;
657
+ /**
658
+ * Start executing a command in this sandbox.
659
+ *
660
+ * @param params - The command parameters.
661
+ * @returns A {@link CommandFinished} result once execution is done.
662
+ */
663
+ runCommand(params: RunCommandParams): Promise<CommandFinished>;
664
+ /**
665
+ * Internal helper to start a command in the sandbox.
666
+ *
667
+ * @param params - Command execution parameters.
668
+ * @returns A {@link Command} or {@link CommandFinished}, depending on `detached`.
669
+ * @internal
670
+ */
671
+ getCommand(cmdId: string, opts?: {
672
+ signal?: AbortSignal;
673
+ }): Promise<Command>;
674
+ /**
675
+ * Create a directory in the filesystem of this sandbox.
676
+ *
677
+ * @param path - Path of the directory to create
678
+ * @param opts - Optional parameters.
679
+ * @param opts.signal - An AbortSignal to cancel the operation.
680
+ */
681
+ mkDir(path: string, opts?: {
682
+ signal?: AbortSignal;
683
+ }): Promise<void>;
684
+ /**
685
+ * Open an interactive shell session, resuming the sandbox if needed.
686
+ *
687
+ * @param opts - Optional parameters.
688
+ * @param opts.signal - An AbortSignal to cancel the operation.
689
+ * @returns The WebSocket URL and token used to connect to the PTY.
690
+ */
691
+ openInteractive(opts?: {
692
+ signal?: AbortSignal;
693
+ }): Promise<{
694
+ url: string;
695
+ token: string;
696
+ }>;
697
+ /**
698
+ * Read a file from the filesystem of this sandbox as a stream.
699
+ *
700
+ * @param file - File to read, with path and optional cwd
701
+ * @param opts - Optional parameters.
702
+ * @param opts.signal - An AbortSignal to cancel the operation.
703
+ * @returns A promise that resolves to a ReadableStream containing the file contents, or null if file not found
704
+ */
705
+ readFile(file: {
706
+ path: string;
707
+ cwd?: string;
708
+ }, opts?: {
709
+ signal?: AbortSignal;
710
+ }): Promise<NodeJS.ReadableStream | null>;
711
+ /**
712
+ * Read a file from the filesystem of this sandbox as a Buffer.
713
+ *
714
+ * @param file - File to read, with path and optional cwd
715
+ * @param opts - Optional parameters.
716
+ * @param opts.signal - An AbortSignal to cancel the operation.
717
+ * @returns A promise that resolves to the file contents as a Buffer, or null if file not found
718
+ */
719
+ readFileToBuffer(file: {
720
+ path: string;
721
+ cwd?: string;
722
+ }, opts?: {
723
+ signal?: AbortSignal;
724
+ }): Promise<Buffer | null>;
725
+ /**
726
+ * Download a file from the sandbox to the local filesystem.
727
+ *
728
+ * @param src - Source file on the sandbox, with path and optional cwd
729
+ * @param dst - Destination file on the local machine, with path and optional cwd
730
+ * @param opts - Optional parameters.
731
+ * @param opts.mkdirRecursive - If true, create parent directories for the destination if they don't exist.
732
+ * @param opts.signal - An AbortSignal to cancel the operation.
733
+ * @returns The absolute path to the written file, or null if the source file was not found
734
+ */
735
+ downloadFile(src: {
736
+ path: string;
737
+ cwd?: string;
738
+ }, dst: {
739
+ path: string;
740
+ cwd?: string;
741
+ }, opts?: {
742
+ mkdirRecursive?: boolean;
743
+ signal?: AbortSignal;
744
+ }): Promise<string | null>;
745
+ /**
746
+ * Write files to the filesystem of this sandbox.
747
+ * Defaults to writing to /vercel/sandbox unless an absolute path is specified.
748
+ * Writes files using the `vercel-sandbox` user.
749
+ *
750
+ * @param files - Array of files with path, content, and optional mode (permissions)
751
+ * @param opts - Optional parameters.
752
+ * @param opts.signal - An AbortSignal to cancel the operation.
753
+ * @returns A promise that resolves when the files are written
754
+ *
755
+ * @example
756
+ * // Write an executable script
757
+ * await sandbox.writeFiles([
758
+ * { path: "/usr/local/bin/myscript", content: "#!/bin/bash\necho hello", mode: 0o755 }
759
+ * ]);
760
+ */
761
+ writeFiles(files: {
762
+ path: string;
763
+ content: string | Uint8Array;
764
+ mode?: number;
765
+ }[], opts?: {
766
+ signal?: AbortSignal;
767
+ }): Promise<void>;
768
+ /**
769
+ * Get the public domain of a port of this sandbox.
770
+ *
771
+ * @param p - Port number to resolve
772
+ * @returns A full domain (e.g. `https://subdomain.vercel.run`)
773
+ * @throws If the port has no associated route
774
+ */
775
+ domain(p: number): string;
776
+ /**
777
+ * Stop the sandbox.
778
+ *
779
+ * @param opts - Optional parameters.
780
+ * @param opts.signal - An AbortSignal to cancel the operation.
781
+ * @returns The final session state after stopping, with optional snapshot metadata.
782
+ */
783
+ stop(opts?: {
784
+ signal?: AbortSignal;
785
+ }): Promise<SandboxSnapshot & {
786
+ snapshot?: SnapshotMetadata;
787
+ }>;
788
+ /**
789
+ * Update the network policy for this sandbox.
790
+ *
791
+ * @deprecated Use {@link Sandbox.update} instead.
792
+ *
793
+ * @param networkPolicy - The new network policy to apply.
794
+ * @param opts - Optional parameters.
795
+ * @param opts.signal - An AbortSignal to cancel the operation.
796
+ * @returns A promise that resolves when the network policy is updated.
797
+ *
798
+ * @example
799
+ * // Restrict to specific domains
800
+ * await sandbox.updateNetworkPolicy({
801
+ * allow: ["*.npmjs.org", "github.com"],
802
+ * });
803
+ *
804
+ * @example
805
+ * // Inject credentials with per-domain transformers
806
+ * await sandbox.updateNetworkPolicy({
807
+ * allow: {
808
+ * "ai-gateway.vercel.sh": [{
809
+ * transform: [{
810
+ * headers: { authorization: "Bearer ..." }
811
+ * }]
812
+ * }],
813
+ * "*": []
814
+ * }
815
+ * });
816
+ *
817
+ * @example
818
+ * // Deny all network access
819
+ * await sandbox.updateNetworkPolicy("deny-all");
820
+ */
821
+ updateNetworkPolicy(networkPolicy: NetworkPolicy, opts?: {
822
+ signal?: AbortSignal;
823
+ }): Promise<NetworkPolicy>;
824
+ /**
825
+ * Extend the timeout of the sandbox by the specified duration.
826
+ *
827
+ * This allows you to extend the lifetime of a sandbox up until the maximum
828
+ * execution timeout for your plan.
829
+ *
830
+ * @param duration - The duration in milliseconds to extend the timeout by
831
+ * @param opts - Optional parameters.
832
+ * @param opts.signal - An AbortSignal to cancel the operation.
833
+ * @returns A promise that resolves when the timeout is extended
834
+ *
835
+ * @example
836
+ * const sandbox = await Sandbox.create({ timeout: ms('10m') });
837
+ * // Extends timeout by 5 minutes, to a total of 15 minutes.
838
+ * await sandbox.extendTimeout(ms('5m'));
839
+ */
840
+ extendTimeout(duration: number, opts?: {
841
+ signal?: AbortSignal;
842
+ }): Promise<void>;
843
+ /**
844
+ * Create a snapshot from this currently running sandbox. New sandboxes can
845
+ * then be created from this snapshot using {@link Sandbox.createFromSnapshot}.
846
+ *
847
+ * Note: this sandbox will be stopped as part of the snapshot creation process.
848
+ *
849
+ * @param opts - Optional parameters.
850
+ * @param opts.expiration - Optional expiration time in milliseconds. Use 0 for no expiration at all.
851
+ * @param opts.signal - An AbortSignal to cancel the operation.
852
+ * @returns A promise that resolves to the Snapshot instance
853
+ */
854
+ snapshot(opts?: {
855
+ expiration?: number;
856
+ signal?: AbortSignal;
857
+ }): Promise<Snapshot>;
858
+ /**
859
+ * Update the sandbox configuration.
860
+ *
861
+ * When `ports` is provided, it is treated as the full desired port list:
862
+ * any currently exposed port omitted from the array will be deregistered.
863
+ *
864
+ * @param params - Fields to update.
865
+ * @param opts - Optional abort signal.
866
+ */
867
+ update(params: {
868
+ persistent?: boolean;
869
+ resources?: {
870
+ vcpus?: number;
871
+ };
872
+ timeout?: number;
873
+ networkPolicy?: NetworkPolicy;
874
+ tags?: Record<string, string>;
875
+ ports?: number[];
876
+ snapshotExpiration?: number;
877
+ keepLastSnapshots?: {
878
+ count: number;
879
+ expiration?: number;
880
+ deleteEvicted?: boolean;
881
+ } | null;
882
+ currentSnapshotId?: string;
883
+ }, opts?: {
884
+ signal?: AbortSignal;
885
+ }): Promise<void>;
886
+ /**
887
+ * Delete this sandbox.
888
+ *
889
+ * After deletion the instance becomes inert — all further API calls will
890
+ * throw immediately.
891
+ */
892
+ delete(opts?: {
893
+ signal?: AbortSignal;
894
+ }): Promise<void>;
895
+ /**
896
+ * List sessions (VMs) that have been created for this sandbox.
897
+ *
898
+ * @param params - Optional pagination parameters.
899
+ * @returns The list of sessions and pagination metadata.
900
+ */
901
+ listSessions(params?: {
902
+ limit?: number;
903
+ cursor?: string;
904
+ sortOrder?: "asc" | "desc";
905
+ signal?: AbortSignal;
906
+ }): Promise<Paginator<{
907
+ sessions: {
908
+ [x: string]: unknown;
909
+ id: string;
910
+ memory: number;
911
+ vcpus: number;
912
+ region: string;
913
+ runtime: string;
914
+ timeout: number;
915
+ status: "failed" | "aborted" | "pending" | "running" | "stopping" | "stopped" | "snapshotting";
916
+ requestedAt: number;
917
+ createdAt: number;
918
+ cwd: string;
919
+ updatedAt: number;
920
+ startedAt?: number | undefined;
921
+ requestedStopAt?: number | undefined;
922
+ stoppedAt?: number | undefined;
923
+ abortedAt?: number | undefined;
924
+ duration?: number | undefined;
925
+ sourceSnapshotId?: string | undefined;
926
+ snapshottedAt?: number | undefined;
927
+ interactivePort?: number | undefined;
928
+ networkPolicy?: {
929
+ [x: string]: unknown;
930
+ mode: "allow-all";
931
+ } | {
932
+ [x: string]: unknown;
933
+ mode: "deny-all";
934
+ } | {
935
+ [x: string]: unknown;
936
+ mode: "custom";
937
+ allowedDomains?: string[] | undefined;
938
+ allowedCIDRs?: string[] | undefined;
939
+ deniedCIDRs?: string[] | undefined;
940
+ injectionRules?: {
941
+ domain: string;
942
+ headers?: Record<string, string> | undefined;
943
+ headerNames?: string[] | undefined;
944
+ match?: {
945
+ path?: {
946
+ exact?: string | undefined;
947
+ startsWith?: string | undefined;
948
+ regex?: string | undefined;
949
+ } | undefined;
950
+ method?: string[] | undefined;
951
+ queryString?: {
952
+ key?: {
953
+ exact?: string | undefined;
954
+ startsWith?: string | undefined;
955
+ regex?: string | undefined;
956
+ } | undefined;
957
+ value?: {
958
+ exact?: string | undefined;
959
+ startsWith?: string | undefined;
960
+ regex?: string | undefined;
961
+ } | undefined;
962
+ }[] | undefined;
963
+ headers?: {
964
+ key?: {
965
+ exact?: string | undefined;
966
+ startsWith?: string | undefined;
967
+ regex?: string | undefined;
968
+ } | undefined;
969
+ value?: {
970
+ exact?: string | undefined;
971
+ startsWith?: string | undefined;
972
+ regex?: string | undefined;
973
+ } | undefined;
974
+ }[] | undefined;
975
+ } | undefined;
976
+ }[] | undefined;
977
+ forwardRules?: {
978
+ domain: string;
979
+ forwardURL: string;
980
+ match?: {
981
+ path?: {
982
+ exact?: string | undefined;
983
+ startsWith?: string | undefined;
984
+ regex?: string | undefined;
985
+ } | undefined;
986
+ method?: string[] | undefined;
987
+ queryString?: {
988
+ key?: {
989
+ exact?: string | undefined;
990
+ startsWith?: string | undefined;
991
+ regex?: string | undefined;
992
+ } | undefined;
993
+ value?: {
994
+ exact?: string | undefined;
995
+ startsWith?: string | undefined;
996
+ regex?: string | undefined;
997
+ } | undefined;
998
+ }[] | undefined;
999
+ headers?: {
1000
+ key?: {
1001
+ exact?: string | undefined;
1002
+ startsWith?: string | undefined;
1003
+ regex?: string | undefined;
1004
+ } | undefined;
1005
+ value?: {
1006
+ exact?: string | undefined;
1007
+ startsWith?: string | undefined;
1008
+ regex?: string | undefined;
1009
+ } | undefined;
1010
+ }[] | undefined;
1011
+ } | undefined;
1012
+ }[] | undefined;
1013
+ } | undefined;
1014
+ activeCpuDurationMs?: number | undefined;
1015
+ networkTransfer?: {
1016
+ ingress: number;
1017
+ egress: number;
1018
+ } | undefined;
1019
+ }[];
1020
+ pagination: {
1021
+ count: number;
1022
+ next: string | null;
1023
+ };
1024
+ }, "sessions">>;
1025
+ /**
1026
+ * List snapshots that belong to this sandbox.
1027
+ *
1028
+ * @param params - Optional pagination parameters.
1029
+ * @returns The list of snapshots and pagination metadata.
1030
+ */
1031
+ listSnapshots(params?: {
1032
+ limit?: number;
1033
+ cursor?: string;
1034
+ sortOrder?: "asc" | "desc";
1035
+ signal?: AbortSignal;
1036
+ }): Promise<Paginator<{
1037
+ snapshots: {
1038
+ id: string;
1039
+ sourceSessionId: string;
1040
+ region: string;
1041
+ status: "created" | "deleted" | "failed";
1042
+ sizeBytes: number;
1043
+ createdAt: number;
1044
+ updatedAt: number;
1045
+ expiresAt?: number | undefined;
1046
+ lastUsedAt?: number | undefined;
1047
+ creationMethod?: string | undefined;
1048
+ parentId?: string | undefined;
1049
+ }[];
1050
+ pagination: {
1051
+ count: number;
1052
+ next: string | null;
1053
+ };
1054
+ }, "snapshots">>;
1055
+ }
1056
+ //#endregion
1057
+ export { Sandbox, SerializedSandbox };
1058
+ //# sourceMappingURL=sandbox.d.ts.map