langsmith 0.5.19 → 0.6.0

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 (161) hide show
  1. package/dist/client.cjs +460 -22
  2. package/dist/client.d.ts +165 -1
  3. package/dist/client.js +464 -26
  4. package/dist/evaluation/_runner.cjs +4 -7
  5. package/dist/evaluation/_runner.js +2 -5
  6. package/dist/evaluation/evaluate_comparative.cjs +10 -10
  7. package/dist/evaluation/evaluate_comparative.js +1 -1
  8. package/dist/evaluation/evaluator.cjs +2 -2
  9. package/dist/evaluation/evaluator.js +1 -1
  10. package/dist/experimental/anthropic/context.cjs +419 -49
  11. package/dist/experimental/anthropic/context.js +420 -50
  12. package/dist/experimental/anthropic/index.cjs +78 -10
  13. package/dist/experimental/anthropic/index.js +80 -12
  14. package/dist/experimental/anthropic/messages.cjs +53 -0
  15. package/dist/experimental/anthropic/messages.d.ts +6 -0
  16. package/dist/experimental/anthropic/messages.js +52 -0
  17. package/dist/experimental/anthropic/transcripts.cjs +144 -0
  18. package/dist/experimental/anthropic/transcripts.d.ts +22 -0
  19. package/dist/experimental/anthropic/transcripts.js +141 -0
  20. package/dist/experimental/anthropic/types.d.ts +1 -0
  21. package/dist/experimental/anthropic/usage.cjs +19 -20
  22. package/dist/experimental/anthropic/usage.d.ts +2 -1
  23. package/dist/experimental/anthropic/usage.js +18 -20
  24. package/dist/experimental/opencode/index.cjs +36 -0
  25. package/dist/experimental/opencode/index.d.ts +3 -0
  26. package/dist/experimental/opencode/index.js +32 -0
  27. package/dist/experimental/opencode/tracer.cjs +389 -0
  28. package/dist/experimental/opencode/tracer.d.ts +30 -0
  29. package/dist/experimental/opencode/tracer.js +385 -0
  30. package/dist/experimental/otel/setup.cjs +1 -1
  31. package/dist/experimental/otel/setup.js +1 -1
  32. package/dist/experimental/sandbox/client.cjs +308 -409
  33. package/dist/experimental/sandbox/client.d.ts +136 -157
  34. package/dist/experimental/sandbox/client.js +310 -411
  35. package/dist/experimental/sandbox/errors.cjs +1 -2
  36. package/dist/experimental/sandbox/errors.d.ts +1 -2
  37. package/dist/experimental/sandbox/errors.js +1 -2
  38. package/dist/experimental/sandbox/helpers.cjs +8 -98
  39. package/dist/experimental/sandbox/helpers.d.ts +0 -29
  40. package/dist/experimental/sandbox/helpers.js +9 -95
  41. package/dist/experimental/sandbox/index.cjs +6 -1
  42. package/dist/experimental/sandbox/index.d.ts +7 -2
  43. package/dist/experimental/sandbox/index.js +6 -1
  44. package/dist/experimental/sandbox/sandbox.cjs +71 -13
  45. package/dist/experimental/sandbox/sandbox.d.ts +39 -9
  46. package/dist/experimental/sandbox/sandbox.js +71 -13
  47. package/dist/experimental/sandbox/types.d.ts +147 -137
  48. package/dist/experimental/vercel/index.cjs +1 -1
  49. package/dist/experimental/vercel/index.js +1 -1
  50. package/dist/experimental/vercel/middleware.cjs +2 -1
  51. package/dist/experimental/vercel/middleware.js +2 -1
  52. package/dist/index.cjs +1 -1
  53. package/dist/index.d.ts +1 -1
  54. package/dist/index.js +1 -1
  55. package/dist/run_trees.cjs +8 -7
  56. package/dist/run_trees.d.ts +7 -0
  57. package/dist/run_trees.js +7 -6
  58. package/dist/schemas.d.ts +58 -0
  59. package/dist/singletons/otel.cjs +3 -2
  60. package/dist/singletons/otel.js +4 -3
  61. package/dist/singletons/traceable.cjs +1 -3
  62. package/dist/singletons/traceable.js +1 -3
  63. package/dist/traceable.cjs +2 -5
  64. package/dist/traceable.js +2 -5
  65. package/dist/utils/_git.cjs +2 -2
  66. package/dist/utils/_git.js +2 -2
  67. package/dist/utils/_uuid.cjs +2 -2
  68. package/dist/utils/_uuid.js +1 -1
  69. package/dist/utils/env.cjs +35 -2
  70. package/dist/utils/env.d.ts +9 -0
  71. package/dist/utils/env.js +34 -2
  72. package/dist/utils/error.cjs +9 -2
  73. package/dist/utils/error.d.ts +1 -0
  74. package/dist/utils/error.js +8 -2
  75. package/dist/utils/fast-safe-stringify/index.cjs +203 -0
  76. package/dist/utils/fast-safe-stringify/index.d.ts +46 -0
  77. package/dist/utils/fast-safe-stringify/index.js +202 -0
  78. package/dist/utils/jestlike/index.cjs +5 -5
  79. package/dist/utils/jestlike/index.js +1 -1
  80. package/dist/utils/jestlike/reporter.cjs +1 -1
  81. package/dist/utils/jestlike/reporter.js +1 -1
  82. package/dist/utils/jestlike/vendor/chain.cjs +2 -3
  83. package/dist/utils/jestlike/vendor/chain.js +2 -3
  84. package/dist/utils/jestlike/vendor/evaluatedBy.cjs +3 -3
  85. package/dist/utils/jestlike/vendor/evaluatedBy.js +1 -1
  86. package/dist/utils/prompts.cjs +7 -2
  87. package/dist/utils/prompts.d.ts +6 -1
  88. package/dist/utils/prompts.js +6 -1
  89. package/dist/utils/serialize_worker.cjs +388 -0
  90. package/dist/utils/serialize_worker.d.ts +66 -0
  91. package/dist/utils/serialize_worker.js +382 -0
  92. package/dist/utils/uuid/src/index.cjs +24 -0
  93. package/dist/utils/uuid/src/index.d.ts +10 -0
  94. package/dist/utils/uuid/src/index.js +9 -0
  95. package/dist/utils/uuid/src/max.cjs +3 -0
  96. package/dist/utils/uuid/src/max.d.ts +2 -0
  97. package/dist/utils/uuid/src/max.js +1 -0
  98. package/dist/utils/uuid/src/nil.cjs +3 -0
  99. package/dist/utils/uuid/src/nil.d.ts +2 -0
  100. package/dist/utils/uuid/src/nil.js +1 -0
  101. package/dist/utils/uuid/src/parse.cjs +23 -0
  102. package/dist/utils/uuid/src/parse.d.ts +3 -0
  103. package/dist/utils/uuid/src/parse.js +18 -0
  104. package/dist/utils/uuid/src/regex.cjs +3 -0
  105. package/dist/utils/uuid/src/regex.d.ts +2 -0
  106. package/dist/utils/uuid/src/regex.js +1 -0
  107. package/dist/utils/uuid/src/rng.cjs +10 -0
  108. package/dist/utils/uuid/src/rng.d.ts +1 -0
  109. package/dist/utils/uuid/src/rng.js +7 -0
  110. package/dist/utils/uuid/src/sha1.cjs +75 -0
  111. package/dist/utils/uuid/src/sha1.d.ts +2 -0
  112. package/dist/utils/uuid/src/sha1.js +73 -0
  113. package/dist/utils/uuid/src/stringify.cjs +55 -0
  114. package/dist/utils/uuid/src/stringify.d.ts +3 -0
  115. package/dist/utils/uuid/src/stringify.js +49 -0
  116. package/dist/utils/uuid/src/types.cjs +2 -0
  117. package/dist/utils/uuid/src/types.d.ts +22 -0
  118. package/dist/utils/uuid/src/types.js +1 -0
  119. package/dist/utils/uuid/src/v35.cjs +52 -0
  120. package/dist/utils/uuid/src/v35.d.ts +7 -0
  121. package/dist/utils/uuid/src/v35.js +44 -0
  122. package/dist/utils/uuid/src/v4.cjs +40 -0
  123. package/dist/utils/uuid/src/v4.d.ts +4 -0
  124. package/dist/utils/uuid/src/v4.js +35 -0
  125. package/dist/utils/uuid/src/v5.cjs +50 -0
  126. package/dist/utils/uuid/src/v5.d.ts +9 -0
  127. package/dist/utils/uuid/src/v5.js +9 -0
  128. package/dist/utils/uuid/src/v7.cjs +88 -0
  129. package/dist/utils/uuid/src/v7.d.ts +9 -0
  130. package/dist/utils/uuid/src/v7.js +82 -0
  131. package/dist/utils/uuid/src/validate.cjs +10 -0
  132. package/dist/utils/uuid/src/validate.d.ts +2 -0
  133. package/dist/utils/uuid/src/validate.js +5 -0
  134. package/dist/utils/uuid/src/version.cjs +13 -0
  135. package/dist/utils/uuid/src/version.d.ts +2 -0
  136. package/dist/utils/uuid/src/version.js +8 -0
  137. package/dist/utils/worker_threads.browser.cjs +16 -0
  138. package/dist/utils/worker_threads.browser.d.ts +14 -0
  139. package/dist/utils/worker_threads.browser.js +13 -0
  140. package/dist/utils/worker_threads.cjs +16 -0
  141. package/dist/utils/worker_threads.d.ts +13 -0
  142. package/dist/utils/worker_threads.js +13 -0
  143. package/dist/uuid.cjs +2 -2
  144. package/dist/uuid.js +1 -1
  145. package/dist/vitest/utils/esm.mjs +4 -4
  146. package/dist/wrappers/gemini.cjs +1 -1
  147. package/dist/wrappers/gemini.js +1 -1
  148. package/dist/wrappers/openai.cjs +2 -6
  149. package/dist/wrappers/openai.js +2 -6
  150. package/dist/wrappers/openai_agents.cjs +849 -0
  151. package/dist/wrappers/openai_agents.d.ts +92 -0
  152. package/dist/wrappers/openai_agents.js +845 -0
  153. package/experimental/opencode.cjs +1 -0
  154. package/experimental/opencode.d.cts +1 -0
  155. package/experimental/opencode.d.ts +1 -0
  156. package/experimental/opencode.js +1 -0
  157. package/package.json +47 -25
  158. package/wrappers/openai_agents.cjs +1 -0
  159. package/wrappers/openai_agents.d.cts +1 -0
  160. package/wrappers/openai_agents.d.ts +1 -0
  161. package/wrappers/openai_agents.js +1 -0
@@ -1,12 +1,12 @@
1
1
  /**
2
2
  * Main SandboxClient class for interacting with the sandbox server API.
3
3
  */
4
- import type { CreatePoolOptions, CreateSandboxOptions, CreateTemplateOptions, CreateVolumeOptions, Pool, ResourceStatus, SandboxClientConfig, SandboxTemplate, UpdatePoolOptions, UpdateSandboxOptions, UpdateTemplateOptions, UpdateVolumeOptions, Volume, WaitForSandboxOptions } from "./types.js";
4
+ import type { CaptureSnapshotOptions, CreateSandboxOptions, CreateSnapshotOptions, ListSnapshotsOptions, ResourceStatus, SandboxClientConfig, Snapshot, StartSandboxOptions, UpdateSandboxOptions, WaitForSandboxOptions, WaitForSnapshotOptions } from "./types.js";
5
5
  import { Sandbox } from "./sandbox.js";
6
6
  /**
7
7
  * Client for interacting with the Sandbox Server API.
8
8
  *
9
- * This client provides a simple interface for managing sandboxes and templates.
9
+ * This client provides a simple interface for managing sandboxes and snapshots.
10
10
  *
11
11
  * @example
12
12
  * ```typescript
@@ -21,8 +21,13 @@ import { Sandbox } from "./sandbox.js";
21
21
  * apiKey: "your-api-key",
22
22
  * });
23
23
  *
24
- * // Create a sandbox and run commands
25
- * const sandbox = await client.createSandbox("python-sandbox");
24
+ * // Build a snapshot, then create a sandbox from it
25
+ * const snapshot = await client.createSnapshot(
26
+ * "python",
27
+ * "python:3.12-slim",
28
+ * 1_073_741_824 // 1 GiB
29
+ * );
30
+ * const sandbox = await client.createSandbox(snapshot.id);
26
31
  * try {
27
32
  * const result = await sandbox.run("python --version");
28
33
  * console.log(result.stdout);
@@ -40,164 +45,37 @@ export declare class SandboxClient {
40
45
  private _caller;
41
46
  constructor(config?: SandboxClientConfig);
42
47
  /**
43
- * Create a new persistent volume.
44
- *
45
- * Creates a persistent storage volume that can be referenced in templates.
46
- *
47
- * @param name - Volume name.
48
- * @param options - Creation options including size and optional timeout.
49
- * @returns Created Volume.
50
- * @throws SandboxCreationError if volume provisioning fails.
51
- * @throws ResourceTimeoutError if volume doesn't become ready within timeout.
52
- */
53
- createVolume(name: string, options: CreateVolumeOptions): Promise<Volume>;
54
- /**
55
- * Get a volume by name.
56
- *
57
- * @param name - Volume name.
58
- * @returns Volume.
59
- * @throws LangSmithResourceNotFoundError if volume not found.
60
- */
61
- getVolume(name: string): Promise<Volume>;
62
- /**
63
- * List all volumes.
64
- *
65
- * @returns List of Volumes.
66
- */
67
- listVolumes(): Promise<Volume[]>;
68
- /**
69
- * Delete a volume.
70
- *
71
- * @param name - Volume name.
72
- * @throws LangSmithResourceNotFoundError if volume not found.
73
- * @throws ResourceInUseError if volume is referenced by templates.
74
- */
75
- deleteVolume(name: string): Promise<void>;
76
- /**
77
- * Update a volume's name and/or size.
78
- *
79
- * You can update the display name, size, or both in a single request.
80
- * Only storage size increases are allowed (storage backend limitation).
81
- *
82
- * @param name - Current volume name.
83
- * @param options - Update options.
84
- * @returns Updated Volume.
85
- * @throws LangSmithResourceNotFoundError if volume not found.
86
- * @throws ValidationError if storage decrease attempted.
87
- * @throws LangSmithResourceNameConflictError if newName is already in use.
88
- */
89
- updateVolume(name: string, options: UpdateVolumeOptions): Promise<Volume>;
90
- /**
91
- * Create a new SandboxTemplate.
92
- *
93
- * Only the container image, resource limits, and volume mounts can be
94
- * configured. All other container details are handled by the server.
95
- *
96
- * @param name - Template name.
97
- * @param options - Creation options including image and resource limits.
98
- * @returns Created SandboxTemplate.
99
- */
100
- createTemplate(name: string, options: CreateTemplateOptions): Promise<SandboxTemplate>;
101
- /**
102
- * Get a SandboxTemplate by name.
103
- *
104
- * @param name - Template name.
105
- * @returns SandboxTemplate.
106
- * @throws LangSmithResourceNotFoundError if template not found.
107
- */
108
- getTemplate(name: string): Promise<SandboxTemplate>;
109
- /**
110
- * List all SandboxTemplates.
111
- *
112
- * @returns List of SandboxTemplates.
113
- */
114
- listTemplates(): Promise<SandboxTemplate[]>;
115
- /**
116
- * Update a template.
117
- *
118
- * @param name - Current template name.
119
- * @param options - Update options (e.g., newName).
120
- * @returns Updated SandboxTemplate.
121
- * @throws LangSmithResourceNotFoundError if template not found.
122
- * @throws LangSmithResourceNameConflictError if newName is already in use.
123
- */
124
- updateTemplate(name: string, options: UpdateTemplateOptions): Promise<SandboxTemplate>;
125
- /**
126
- * Delete a SandboxTemplate.
127
- *
128
- * @param name - Template name.
129
- * @throws LangSmithResourceNotFoundError if template not found.
130
- * @throws ResourceInUseError if template is referenced by sandboxes or pools.
131
- */
132
- deleteTemplate(name: string): Promise<void>;
133
- /**
134
- * Create a new Sandbox Pool.
135
- *
136
- * Pools pre-provision sandboxes from a template for faster startup.
137
- *
138
- * @param name - Pool name (lowercase letters, numbers, hyphens; max 63 chars).
139
- * @param options - Creation options including templateName, replicas, and optional timeout.
140
- * @returns Created Pool.
141
- * @throws LangSmithResourceNotFoundError if template not found.
142
- * @throws ValidationError if template has volumes attached.
143
- * @throws ResourceAlreadyExistsError if pool with this name already exists.
144
- * @throws ResourceTimeoutError if pool doesn't reach ready state within timeout.
145
- * @throws QuotaExceededError if organization quota is exceeded.
146
- */
147
- createPool(name: string, options: CreatePoolOptions): Promise<Pool>;
148
- /**
149
- * Get a Pool by name.
150
- *
151
- * @param name - Pool name.
152
- * @returns Pool.
153
- * @throws LangSmithResourceNotFoundError if pool not found.
154
- */
155
- getPool(name: string): Promise<Pool>;
156
- /**
157
- * List all Pools.
158
- *
159
- * @returns List of Pools.
160
- */
161
- listPools(): Promise<Pool[]>;
162
- /**
163
- * Update a Pool's name and/or replica count.
164
- *
165
- * You can update the display name, replica count, or both.
166
- * The template reference cannot be changed after creation.
167
- *
168
- * @param name - Current pool name.
169
- * @param options - Update options.
170
- * @returns Updated Pool.
171
- * @throws LangSmithResourceNotFoundError if pool not found.
172
- * @throws ValidationError if template was deleted.
173
- * @throws LangSmithResourceNameConflictError if newName is already in use.
174
- * @throws QuotaExceededError if quota exceeded when scaling up.
175
- */
176
- updatePool(name: string, options: UpdatePoolOptions): Promise<Pool>;
177
- /**
178
- * Delete a Pool.
179
- *
180
- * This will terminate all sandboxes in the pool.
181
- *
182
- * @param name - Pool name.
183
- * @throws LangSmithResourceNotFoundError if pool not found.
184
- */
185
- deletePool(name: string): Promise<void>;
186
- /**
187
- * Create a new Sandbox.
48
+ * Create a new Sandbox from a snapshot.
188
49
  *
189
50
  * Remember to call `sandbox.delete()` when done to clean up resources.
190
51
  *
191
- * @param templateName - Name of the SandboxTemplate to use.
192
- * @param options - Creation options.
52
+ * Exactly one of `snapshotId` (positional) or `options.snapshotName` must
53
+ * be provided. When `snapshotName` is used, the server resolves it to a
54
+ * snapshot owned by the caller's tenant.
55
+ *
56
+ * @param snapshotId - ID of the snapshot to boot from. Create one with
57
+ * `createSnapshot()` or `captureSnapshot()`, or pass an existing snapshot ID.
58
+ * Pass `undefined` when booting by name via `options.snapshotName`.
59
+ * @param options - Creation options. Use `options.snapshotName` to boot
60
+ * by snapshot name instead of ID.
193
61
  * @returns Created Sandbox.
194
62
  * @throws ResourceTimeoutError if timeout waiting for sandbox to be ready.
195
63
  * @throws SandboxCreationError if sandbox creation fails.
196
- * @throws LangSmithValidationError if TTL values are invalid.
64
+ * @throws LangSmithValidationError if TTL values are invalid, or if neither
65
+ * (or both) of `snapshotId` / `options.snapshotName` are provided.
197
66
  *
198
67
  * @example
199
68
  * ```typescript
200
- * const sandbox = await client.createSandbox("python-sandbox");
69
+ * const snapshot = await client.createSnapshot(
70
+ * "python",
71
+ * "python:3.12-slim",
72
+ * 1_073_741_824
73
+ * );
74
+ * const sandbox = await client.createSandbox(snapshot.id);
75
+ * // Or, resolve by snapshot name:
76
+ * const sandbox = await client.createSandbox(undefined, {
77
+ * snapshotName: "python",
78
+ * });
201
79
  * try {
202
80
  * const result = await sandbox.run("echo hello");
203
81
  * console.log(result.stdout);
@@ -206,7 +84,7 @@ export declare class SandboxClient {
206
84
  * }
207
85
  * ```
208
86
  */
209
- createSandbox(templateName: string, options?: CreateSandboxOptions): Promise<Sandbox>;
87
+ createSandbox(snapshotId?: string, options?: CreateSandboxOptions): Promise<Sandbox>;
210
88
  /**
211
89
  * Get a Sandbox by name.
212
90
  *
@@ -216,7 +94,9 @@ export declare class SandboxClient {
216
94
  * @returns Sandbox.
217
95
  * @throws LangSmithResourceNotFoundError if sandbox not found.
218
96
  */
219
- getSandbox(name: string): Promise<Sandbox>;
97
+ getSandbox(name: string, options?: {
98
+ signal?: AbortSignal;
99
+ }): Promise<Sandbox>;
220
100
  /**
221
101
  * List all Sandboxes.
222
102
  *
@@ -258,7 +138,9 @@ export declare class SandboxClient {
258
138
  * @returns ResourceStatus with status and optional status_message.
259
139
  * @throws LangSmithResourceNotFoundError if sandbox not found.
260
140
  */
261
- getSandboxStatus(name: string): Promise<ResourceStatus>;
141
+ getSandboxStatus(name: string, options?: {
142
+ signal?: AbortSignal;
143
+ }): Promise<ResourceStatus>;
262
144
  /**
263
145
  * Wait for a sandbox to become ready.
264
146
  *
@@ -274,10 +156,107 @@ export declare class SandboxClient {
274
156
  *
275
157
  * @example
276
158
  * ```typescript
277
- * const sandbox = await client.createSandbox("python-sandbox", { waitForReady: false });
159
+ * const sandbox = await client.createSandbox(snapshot.id, { waitForReady: false });
278
160
  * // ... do other work ...
279
161
  * const readySandbox = await client.waitForSandbox(sandbox.name);
280
162
  * ```
281
163
  */
282
164
  waitForSandbox(name: string, options?: WaitForSandboxOptions): Promise<Sandbox>;
165
+ /**
166
+ * Start a stopped sandbox and wait until ready.
167
+ *
168
+ * @param name - Sandbox name.
169
+ * @param options - Options with timeout.
170
+ * @returns Sandbox in "ready" status.
171
+ */
172
+ startSandbox(name: string, options?: StartSandboxOptions): Promise<Sandbox>;
173
+ /**
174
+ * Stop a running sandbox (preserves sandbox files for later restart).
175
+ *
176
+ * @param name - Sandbox name.
177
+ */
178
+ stopSandbox(name: string): Promise<void>;
179
+ /**
180
+ * Build a snapshot from a Docker image.
181
+ *
182
+ * Blocks until the snapshot is ready (polls with 2s interval).
183
+ *
184
+ * @param name - Snapshot name.
185
+ * @param dockerImage - Docker image to build from (e.g., "python:3.12-slim").
186
+ * @param fsCapacityBytes - Filesystem capacity in bytes.
187
+ * @param options - Additional options (registry credentials, timeout).
188
+ * @returns Snapshot in "ready" status.
189
+ */
190
+ createSnapshot(name: string, dockerImage: string, fsCapacityBytes: number, options?: CreateSnapshotOptions): Promise<Snapshot>;
191
+ /**
192
+ * Capture a snapshot from a running sandbox.
193
+ *
194
+ * Blocks until the snapshot is ready (polls with 2s interval).
195
+ *
196
+ * @param sandboxName - Name of the sandbox to capture from.
197
+ * @param name - Snapshot name.
198
+ * @param options - Capture options (timeout).
199
+ * @returns Snapshot in "ready" status.
200
+ */
201
+ captureSnapshot(sandboxName: string, name: string, options?: CaptureSnapshotOptions): Promise<Snapshot>;
202
+ /**
203
+ * Get a snapshot by ID.
204
+ *
205
+ * @param snapshotId - Snapshot UUID.
206
+ * @returns Snapshot.
207
+ */
208
+ getSnapshot(snapshotId: string, options?: {
209
+ signal?: AbortSignal;
210
+ }): Promise<Snapshot>;
211
+ /**
212
+ * List snapshots, optionally filtered and paginated server-side.
213
+ *
214
+ * The backend always paginates this endpoint. When `limit` is omitted the
215
+ * server applies a default page size (currently 50), so a single call is
216
+ * not guaranteed to return every snapshot visible to the tenant. To iterate
217
+ * through all results, repeat the call with increasing `offset` values (or
218
+ * an explicit `limit`) until fewer than `limit` snapshots come back.
219
+ *
220
+ * @param options - Optional filter/pagination options.
221
+ * - `nameContains`: case-insensitive substring match on snapshot name.
222
+ * - `limit`: page size; must be between 1 and 500 (inclusive). Defaults
223
+ * to 50 server-side when omitted.
224
+ * - `offset`: number of snapshots to skip; must be `>= 0`.
225
+ *
226
+ * Values outside those ranges are rejected by the server.
227
+ * @returns A single page of Snapshots matching the provided filters.
228
+ *
229
+ * @example
230
+ * ```typescript
231
+ * const firstPage = await client.listSnapshots();
232
+ * const page = await client.listSnapshots({
233
+ * nameContains: "python",
234
+ * limit: 100,
235
+ * offset: 0,
236
+ * });
237
+ * ```
238
+ */
239
+ listSnapshots(options?: ListSnapshotsOptions): Promise<Snapshot[]>;
240
+ /**
241
+ * Delete a snapshot.
242
+ *
243
+ * @param snapshotId - Snapshot UUID.
244
+ */
245
+ deleteSnapshot(snapshotId: string): Promise<void>;
246
+ /**
247
+ * Poll until a snapshot reaches "ready" or "failed" status.
248
+ *
249
+ * @param snapshotId - Snapshot UUID.
250
+ * @param options - Polling options (timeout, pollInterval).
251
+ * @returns Snapshot in "ready" status.
252
+ */
253
+ waitForSnapshot(snapshotId: string, options?: WaitForSnapshotOptions): Promise<Snapshot>;
254
+ /**
255
+ * Returns a string representation of the SandboxClient instance.
256
+ * This method is called when the object is converted to a string
257
+ * or logged, ensuring sensitive information like API keys is not exposed.
258
+ *
259
+ * @returns A string representation of the SandboxClient.
260
+ */
261
+ toString(): string;
283
262
  }