withruntime 0.8.3 → 0.9.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 (92) hide show
  1. package/COMPATIBILITY.md +145 -0
  2. package/E2B.md +23 -13
  3. package/README.md +8 -5
  4. package/README.src.md +8 -5
  5. package/compatibility-lock.json +281 -0
  6. package/dist/ai-harness/index.js +2 -2
  7. package/dist/api-defaults.d.ts +17 -0
  8. package/dist/api-defaults.js +22 -0
  9. package/dist/blaxel/preview.d.ts +1 -1
  10. package/dist/blaxel/preview.js +1 -1
  11. package/dist/blaxel/process.d.ts +1 -1
  12. package/dist/blaxel/process.js +11 -2
  13. package/dist/cli-words.d.ts +27 -0
  14. package/dist/cli-words.js +135 -0
  15. package/dist/cli.js +162 -31
  16. package/dist/client.d.ts +4 -1
  17. package/dist/client.js +8 -2
  18. package/dist/cloudflare/index.d.ts +294 -0
  19. package/dist/cloudflare/index.js +554 -0
  20. package/dist/cloudflare/worker.d.ts +415 -0
  21. package/dist/cloudflare/worker.js +297 -0
  22. package/dist/codesandbox/guest-service.d.ts +31 -0
  23. package/dist/codesandbox/guest-service.js +453 -0
  24. package/dist/codesandbox/index.d.ts +386 -0
  25. package/dist/codesandbox/index.js +1313 -0
  26. package/dist/compat/core.d.ts +39 -0
  27. package/dist/compat/core.js +199 -0
  28. package/dist/compat/files.d.ts +26 -0
  29. package/dist/compat/files.js +115 -0
  30. package/dist/compat/shell.d.ts +4 -0
  31. package/dist/compat/shell.js +165 -0
  32. package/dist/daytona/context.js +2 -1
  33. package/dist/daytona/process.d.ts +1 -1
  34. package/dist/daytona/process.js +27 -4
  35. package/dist/e2b/code-interpreter.d.ts +4 -5
  36. package/dist/e2b/code-interpreter.js +54 -56
  37. package/dist/e2b/commands.d.ts +5 -4
  38. package/dist/e2b/commands.js +37 -29
  39. package/dist/e2b/errors.js +1 -1
  40. package/dist/e2b/filesystem.d.ts +8 -6
  41. package/dist/e2b/filesystem.js +127 -28
  42. package/dist/e2b/sandbox.d.ts +4 -3
  43. package/dist/e2b/sandbox.js +10 -10
  44. package/dist/errors.d.ts +8 -0
  45. package/dist/errors.js +15 -2
  46. package/dist/freestyle/index.d.ts +301 -0
  47. package/dist/freestyle/index.js +310 -0
  48. package/dist/index.d.ts +1 -0
  49. package/dist/mcp.js +2 -2
  50. package/dist/modal/index.d.ts +205 -0
  51. package/dist/modal/index.js +485 -0
  52. package/dist/network-cli.js +1 -1
  53. package/dist/openai-agents/index.js +9 -26
  54. package/dist/products/audit.d.ts +3 -0
  55. package/dist/products/index.d.ts +2 -0
  56. package/dist/products/index.js +2 -0
  57. package/dist/products/interpreter.d.ts +11 -4
  58. package/dist/products/interpreter.js +33 -9
  59. package/dist/products/jobs.d.ts +1 -1
  60. package/dist/products/jobs.js +5 -4
  61. package/dist/products/limits.d.ts +10 -0
  62. package/dist/products/previews.d.ts +10 -2
  63. package/dist/products/previews.js +3 -2
  64. package/dist/products/tailscale.d.ts +57 -0
  65. package/dist/products/tailscale.js +17 -0
  66. package/dist/products/watch.d.ts +25 -4
  67. package/dist/products/watch.js +75 -14
  68. package/dist/runloop/index.d.ts +340 -0
  69. package/dist/runloop/index.js +438 -0
  70. package/dist/runloop/pagination.d.ts +46 -0
  71. package/dist/runloop/pagination.js +82 -0
  72. package/dist/runloop/snapshots.d.ts +52 -0
  73. package/dist/runloop/snapshots.js +244 -0
  74. package/dist/sandbox.d.ts +40 -9
  75. package/dist/sandbox.js +273 -76
  76. package/dist/snapshots.d.ts +11 -1
  77. package/dist/snapshots.js +11 -1
  78. package/dist/sprites/index.d.ts +251 -0
  79. package/dist/sprites/index.js +552 -0
  80. package/dist/tar.d.ts +8 -1
  81. package/dist/tar.js +185 -35
  82. package/dist/tools/index.js +2 -1
  83. package/dist/transport.d.ts +20 -2
  84. package/dist/transport.js +48 -11
  85. package/dist/types.d.ts +52 -3
  86. package/dist/vercel/command.js +12 -1
  87. package/dist/vercel/errors.d.ts +2 -2
  88. package/dist/vercel/errors.js +12 -1
  89. package/dist/vercel/filesystem.d.ts +21 -18
  90. package/dist/vercel/filesystem.js +95 -48
  91. package/dist/vercel/sandbox.js +5 -5
  92. package/package.json +45 -3
@@ -0,0 +1,340 @@
1
+ import { PagePromise, DevboxViewsCursorIDPage } from "./pagination.js";
2
+ import type { Runtime } from "../client.js";
3
+ import { Sandbox } from "../sandbox.js";
4
+ import { DiskSnapshots, type DevboxSnapshotDiskParams, type DevboxSnapshotView, type DiskSnapshotListParams } from "./snapshots.js";
5
+ export { DiskSnapshots, type DevboxSnapshotDiskParams, type DevboxSnapshotView, type DevboxSnapshotAsyncStatusView, type DiskSnapshotListParams, } from "./snapshots.js";
6
+ export { PagePromise, DevboxSnapshotViewsDiskSnapshotsCursorIDPage, DevboxViewsCursorIDPage, } from "./pagination.js";
7
+ import { CompatibilityError, type ClientOptions } from "../compat/core.js";
8
+ export { CompatibilityError };
9
+ export declare class LongPollAbortError extends Error {
10
+ readonly lastResult: unknown;
11
+ constructor(message: string, lastResult: unknown);
12
+ }
13
+ export declare class PollingTimeoutError extends Error {
14
+ readonly lastResult: unknown;
15
+ constructor(message: string, lastResult: unknown);
16
+ }
17
+ export declare class MaxAttemptsExceededError extends Error {
18
+ readonly lastResult: unknown;
19
+ constructor(message: string, lastResult: unknown);
20
+ }
21
+ export interface LaunchParameters {
22
+ architecture?: "x86_64" | "arm64" | null;
23
+ custom_cpu_cores?: number | null;
24
+ custom_gb_memory?: number | null;
25
+ custom_disk_size?: number | null;
26
+ resource_size_request?: "X_SMALL" | "SMALL" | "MEDIUM" | "LARGE" | "X_LARGE" | "XX_LARGE" | "CUSTOM_SIZE" | null;
27
+ keep_alive_time_seconds?: number | null;
28
+ launch_commands?: string[] | null;
29
+ }
30
+ export interface DevboxCreateParams {
31
+ name?: string | null;
32
+ metadata?: Record<string, string> | null;
33
+ environment_variables?: Record<string, string> | null;
34
+ file_mounts?: Record<string, string> | null;
35
+ blueprint_id?: string | null;
36
+ blueprint_name?: string | null;
37
+ snapshot_id?: string | null;
38
+ launch_parameters?: LaunchParameters | null;
39
+ }
40
+ export interface DevboxExecuteParams {
41
+ command: string;
42
+ shell_name?: string | null;
43
+ attach_stdin?: boolean | null;
44
+ }
45
+ export interface DevboxExecutionDetailView {
46
+ devbox_id: string;
47
+ exit_status: number | null;
48
+ stdout: string;
49
+ stderr: string;
50
+ stdout_truncated: boolean;
51
+ stderr_truncated: boolean;
52
+ }
53
+ export interface DevboxAsyncExecutionDetailView extends Partial<DevboxExecutionDetailView> {
54
+ devbox_id: string;
55
+ execution_id: string;
56
+ status: "queued" | "running" | "completed";
57
+ }
58
+ export type RequestOptions = {
59
+ signal?: AbortSignal;
60
+ timeout?: number;
61
+ idempotencyKey?: string;
62
+ };
63
+ export type LongPollRequestOptions = RequestOptions & {
64
+ longPoll?: {
65
+ timeoutMs?: number;
66
+ };
67
+ polling?: {
68
+ timeoutMs?: number;
69
+ maxAttempts?: number;
70
+ initialDelayMs?: number;
71
+ pollingIntervalMs?: number;
72
+ };
73
+ };
74
+ declare function view(sandbox: Sandbox): {
75
+ id: string;
76
+ name: string | null;
77
+ metadata: {
78
+ [k: string]: string;
79
+ };
80
+ status: string;
81
+ create_time_ms: number;
82
+ end_time_ms: number | null;
83
+ capabilities: never[];
84
+ state_transitions: never[];
85
+ launch_parameters: {
86
+ custom_cpu_cores: number;
87
+ custom_gb_memory: number;
88
+ custom_disk_size: number;
89
+ keep_alive_time_seconds: number;
90
+ resource_size_request: "CUSTOM_SIZE";
91
+ };
92
+ };
93
+ export type DevboxView = ReturnType<typeof view>;
94
+ export interface DevboxListParams {
95
+ name?: string;
96
+ limit?: number;
97
+ starting_after?: string;
98
+ metadata?: Record<string, string>;
99
+ include_total_count?: boolean;
100
+ status?: "scheduled" | "queued" | "provisioning" | "initializing" | "running" | "suspending" | "suspended" | "resuming" | "failure" | "shutdown";
101
+ }
102
+ export declare class Runloop {
103
+ readonly devboxes: Devboxes;
104
+ constructor(options?: ClientOptions & {
105
+ bearerToken?: string;
106
+ baseURL?: string;
107
+ });
108
+ }
109
+ export default Runloop;
110
+ export declare class Devboxes {
111
+ private readonly runtime;
112
+ readonly executions: Executions;
113
+ readonly diskSnapshots: DiskSnapshots;
114
+ private readonly transitions;
115
+ private transition;
116
+ constructor(runtime: Runtime);
117
+ create(input?: DevboxCreateParams, options?: RequestOptions): Promise<{
118
+ id: string;
119
+ name: string | null;
120
+ metadata: {
121
+ [k: string]: string;
122
+ };
123
+ status: string;
124
+ create_time_ms: number;
125
+ end_time_ms: number | null;
126
+ capabilities: never[];
127
+ state_transitions: never[];
128
+ launch_parameters: {
129
+ custom_cpu_cores: number;
130
+ custom_gb_memory: number;
131
+ custom_disk_size: number;
132
+ keep_alive_time_seconds: number;
133
+ resource_size_request: "CUSTOM_SIZE";
134
+ };
135
+ }>;
136
+ createAndAwaitRunning(input?: DevboxCreateParams, options?: RequestOptions): Promise<{
137
+ id: string;
138
+ name: string | null;
139
+ metadata: {
140
+ [k: string]: string;
141
+ };
142
+ status: string;
143
+ create_time_ms: number;
144
+ end_time_ms: number | null;
145
+ capabilities: never[];
146
+ state_transitions: never[];
147
+ launch_parameters: {
148
+ custom_cpu_cores: number;
149
+ custom_gb_memory: number;
150
+ custom_disk_size: number;
151
+ keep_alive_time_seconds: number;
152
+ resource_size_request: "CUSTOM_SIZE";
153
+ };
154
+ }>;
155
+ retrieve(id: string): Promise<{
156
+ id: string;
157
+ name: string | null;
158
+ metadata: {
159
+ [k: string]: string;
160
+ };
161
+ status: string;
162
+ create_time_ms: number;
163
+ end_time_ms: number | null;
164
+ capabilities: never[];
165
+ state_transitions: never[];
166
+ launch_parameters: {
167
+ custom_cpu_cores: number;
168
+ custom_gb_memory: number;
169
+ custom_disk_size: number;
170
+ keep_alive_time_seconds: number;
171
+ resource_size_request: "CUSTOM_SIZE";
172
+ };
173
+ }>;
174
+ awaitRunning(id: string, options?: LongPollRequestOptions): Promise<{
175
+ id: string;
176
+ name: string | null;
177
+ metadata: {
178
+ [k: string]: string;
179
+ };
180
+ status: string;
181
+ create_time_ms: number;
182
+ end_time_ms: number | null;
183
+ capabilities: never[];
184
+ state_transitions: never[];
185
+ launch_parameters: {
186
+ custom_cpu_cores: number;
187
+ custom_gb_memory: number;
188
+ custom_disk_size: number;
189
+ keep_alive_time_seconds: number;
190
+ resource_size_request: "CUSTOM_SIZE";
191
+ };
192
+ }>;
193
+ awaitDevboxRunning(id: string, options?: LongPollRequestOptions): Promise<{
194
+ id: string;
195
+ name: string | null;
196
+ metadata: {
197
+ [k: string]: string;
198
+ };
199
+ status: string;
200
+ create_time_ms: number;
201
+ end_time_ms: number | null;
202
+ capabilities: never[];
203
+ state_transitions: never[];
204
+ launch_parameters: {
205
+ custom_cpu_cores: number;
206
+ custom_gb_memory: number;
207
+ custom_disk_size: number;
208
+ keep_alive_time_seconds: number;
209
+ resource_size_request: "CUSTOM_SIZE";
210
+ };
211
+ }>;
212
+ awaitSuspended(id: string, options?: LongPollRequestOptions): Promise<{
213
+ id: string;
214
+ name: string | null;
215
+ metadata: {
216
+ [k: string]: string;
217
+ };
218
+ status: string;
219
+ create_time_ms: number;
220
+ end_time_ms: number | null;
221
+ capabilities: never[];
222
+ state_transitions: never[];
223
+ launch_parameters: {
224
+ custom_cpu_cores: number;
225
+ custom_gb_memory: number;
226
+ custom_disk_size: number;
227
+ keep_alive_time_seconds: number;
228
+ resource_size_request: "CUSTOM_SIZE";
229
+ };
230
+ }>;
231
+ private waitForStatus;
232
+ list(query?: DevboxListParams, options?: RequestOptions): PagePromise<DevboxView, DevboxViewsCursorIDPage<DevboxView>>;
233
+ list(options?: RequestOptions): PagePromise<DevboxView, DevboxViewsCursorIDPage<DevboxView>>;
234
+ private listPage;
235
+ suspend(id: string): Promise<{
236
+ id: string;
237
+ name: string | null;
238
+ metadata: {
239
+ [k: string]: string;
240
+ };
241
+ status: string;
242
+ create_time_ms: number;
243
+ end_time_ms: number | null;
244
+ capabilities: never[];
245
+ state_transitions: never[];
246
+ launch_parameters: {
247
+ custom_cpu_cores: number;
248
+ custom_gb_memory: number;
249
+ custom_disk_size: number;
250
+ keep_alive_time_seconds: number;
251
+ resource_size_request: "CUSTOM_SIZE";
252
+ };
253
+ }>;
254
+ resume(id: string): Promise<{
255
+ id: string;
256
+ name: string | null;
257
+ metadata: {
258
+ [k: string]: string;
259
+ };
260
+ status: string;
261
+ create_time_ms: number;
262
+ end_time_ms: number | null;
263
+ capabilities: never[];
264
+ state_transitions: never[];
265
+ launch_parameters: {
266
+ custom_cpu_cores: number;
267
+ custom_gb_memory: number;
268
+ custom_disk_size: number;
269
+ keep_alive_time_seconds: number;
270
+ resource_size_request: "CUSTOM_SIZE";
271
+ };
272
+ }>;
273
+ shutdown(id: string): Promise<{
274
+ id: string;
275
+ name: string | null;
276
+ metadata: {
277
+ [k: string]: string;
278
+ };
279
+ status: string;
280
+ create_time_ms: number;
281
+ end_time_ms: number | null;
282
+ capabilities: never[];
283
+ state_transitions: never[];
284
+ launch_parameters: {
285
+ custom_cpu_cores: number;
286
+ custom_gb_memory: number;
287
+ custom_disk_size: number;
288
+ keep_alive_time_seconds: number;
289
+ resource_size_request: "CUSTOM_SIZE";
290
+ };
291
+ }>;
292
+ executeSync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxExecutionDetailView>;
293
+ executeAsync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
294
+ executeAndAwaitCompletion(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
295
+ readFileContents(id: string, body: {
296
+ file_path: string;
297
+ }): Promise<string>;
298
+ writeFileContents(id: string, body: {
299
+ file_path: string;
300
+ contents: string;
301
+ }): Promise<DevboxExecutionDetailView>;
302
+ snapshotDisk(id: string, body?: DevboxSnapshotDiskParams, options?: RequestOptions): Promise<DevboxSnapshotView>;
303
+ snapshotDisk(id: string, options?: RequestOptions): Promise<DevboxSnapshotView>;
304
+ snapshotDiskAsync(_id: string, _body?: DevboxSnapshotDiskParams | RequestOptions, _options?: RequestOptions): Promise<never>;
305
+ deleteDiskSnapshot(id: string, options?: RequestOptions): Promise<unknown>;
306
+ listDiskSnapshots(query?: DiskSnapshotListParams, options?: RequestOptions): ReturnType<DiskSnapshots["list"]>;
307
+ listDiskSnapshots(options?: RequestOptions): ReturnType<DiskSnapshots["list"]>;
308
+ }
309
+ export declare class Executions {
310
+ private readonly runtime;
311
+ constructor(runtime: Runtime);
312
+ executeSync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxExecutionDetailView>;
313
+ executeAsync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
314
+ retrieve(id: string, execution: string): Promise<DevboxAsyncExecutionDetailView>;
315
+ awaitCompleted(id: string, execution: string, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
316
+ kill(id: string, execution: string, body?: {
317
+ kill_process_group?: boolean | null;
318
+ }): Promise<DevboxAsyncExecutionDetailView>;
319
+ sendStdIn(id: string, execution: string, body?: {
320
+ text?: string | null;
321
+ signal?: "EOF" | "INTERRUPT" | null;
322
+ }): Promise<{
323
+ devbox_id: string;
324
+ execution_id: string;
325
+ success: boolean;
326
+ }>;
327
+ streamStdoutUpdates(id: string, execution: string, query?: {
328
+ offset?: string;
329
+ }, options?: RequestOptions): AsyncGenerator<{
330
+ output: string;
331
+ offset: number;
332
+ }, void, unknown>;
333
+ streamStderrUpdates(id: string, execution: string, query?: {
334
+ offset?: string;
335
+ }, options?: RequestOptions): AsyncGenerator<{
336
+ output: string;
337
+ offset: number;
338
+ }, void, unknown>;
339
+ private stream;
340
+ }