withruntime 0.8.4 → 0.10.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 (132) hide show
  1. package/BLAXEL.md +4 -4
  2. package/COMPATIBILITY.md +145 -0
  3. package/DAYTONA.md +13 -7
  4. package/E2B.md +34 -20
  5. package/README.md +22 -11
  6. package/README.src.md +22 -11
  7. package/VERCEL.md +13 -3
  8. package/compatibility-lock.json +357 -0
  9. package/dist/ai-harness/index.js +2 -2
  10. package/dist/api-defaults.d.ts +17 -0
  11. package/dist/api-defaults.js +22 -0
  12. package/dist/blaxel/errors.js +1 -1
  13. package/dist/blaxel/lookup.d.ts +3 -2
  14. package/dist/blaxel/lookup.js +3 -2
  15. package/dist/blaxel/pagination.d.ts +2 -2
  16. package/dist/blaxel/pagination.js +45 -17
  17. package/dist/blaxel/preview.d.ts +3 -2
  18. package/dist/blaxel/preview.js +16 -14
  19. package/dist/blaxel/process.d.ts +1 -1
  20. package/dist/blaxel/process.js +66 -11
  21. package/dist/blaxel/sandbox.d.ts +2 -0
  22. package/dist/blaxel/sandbox.js +2 -0
  23. package/dist/blaxel/snapshot.js +3 -5
  24. package/dist/cli-words.d.ts +27 -0
  25. package/dist/cli-words.js +135 -0
  26. package/dist/cli.d.ts +2 -0
  27. package/dist/cli.js +351 -85
  28. package/dist/client.d.ts +33 -4
  29. package/dist/client.js +47 -12
  30. package/dist/cloudflare/identity.d.ts +7 -0
  31. package/dist/cloudflare/identity.js +13 -0
  32. package/dist/cloudflare/index.d.ts +303 -0
  33. package/dist/cloudflare/index.js +592 -0
  34. package/dist/cloudflare/worker.d.ts +419 -0
  35. package/dist/cloudflare/worker.js +447 -0
  36. package/dist/codesandbox/guest-service.d.ts +31 -0
  37. package/dist/codesandbox/guest-service.js +490 -0
  38. package/dist/codesandbox/index.d.ts +386 -0
  39. package/dist/codesandbox/index.js +1347 -0
  40. package/dist/compat/core.d.ts +40 -0
  41. package/dist/compat/core.js +238 -0
  42. package/dist/compat/files.d.ts +26 -0
  43. package/dist/compat/files.js +133 -0
  44. package/dist/compat/shell.d.ts +4 -0
  45. package/dist/compat/shell.js +165 -0
  46. package/dist/credentials.d.ts +6 -1
  47. package/dist/credentials.js +107 -38
  48. package/dist/daytona/context.js +2 -1
  49. package/dist/daytona/daytona.js +11 -4
  50. package/dist/daytona/filesystem.d.ts +17 -4
  51. package/dist/daytona/filesystem.js +121 -38
  52. package/dist/daytona/index.d.ts +1 -1
  53. package/dist/daytona/process.d.ts +1 -1
  54. package/dist/daytona/process.js +27 -4
  55. package/dist/daytona/sandbox.d.ts +1 -1
  56. package/dist/daytona/sandbox.js +16 -7
  57. package/dist/e2b/client.js +1 -1
  58. package/dist/e2b/code-interpreter.d.ts +4 -5
  59. package/dist/e2b/code-interpreter.js +54 -56
  60. package/dist/e2b/commands.d.ts +35 -12
  61. package/dist/e2b/commands.js +169 -73
  62. package/dist/e2b/errors.js +1 -1
  63. package/dist/e2b/filesystem.d.ts +8 -6
  64. package/dist/e2b/filesystem.js +127 -28
  65. package/dist/e2b/index.d.ts +1 -0
  66. package/dist/e2b/index.js +1 -0
  67. package/dist/e2b/pty.d.ts +24 -0
  68. package/dist/e2b/pty.js +80 -0
  69. package/dist/e2b/sandbox.d.ts +6 -4
  70. package/dist/e2b/sandbox.js +59 -25
  71. package/dist/errors.d.ts +8 -0
  72. package/dist/errors.js +15 -2
  73. package/dist/file-source.d.ts +16 -0
  74. package/dist/file-source.js +162 -0
  75. package/dist/freestyle/index.d.ts +309 -0
  76. package/dist/freestyle/index.js +343 -0
  77. package/dist/index.d.ts +3 -1
  78. package/dist/login.js +16 -10
  79. package/dist/mcp.js +2 -2
  80. package/dist/modal/index.d.ts +205 -0
  81. package/dist/modal/index.js +486 -0
  82. package/dist/network-cli.js +112 -44
  83. package/dist/openai-agents/index.js +18 -71
  84. package/dist/page.d.ts +1 -1
  85. package/dist/page.js +2 -2
  86. package/dist/products/audit.d.ts +3 -0
  87. package/dist/products/index.d.ts +14 -0
  88. package/dist/products/index.js +12 -0
  89. package/dist/products/interpreter.d.ts +11 -4
  90. package/dist/products/interpreter.js +33 -9
  91. package/dist/products/jobs.js +3 -2
  92. package/dist/products/limits.d.ts +10 -0
  93. package/dist/products/observability.d.ts +44 -0
  94. package/dist/products/observability.js +6 -0
  95. package/dist/products/previews.d.ts +18 -4
  96. package/dist/products/previews.js +14 -5
  97. package/dist/products/tailscale.d.ts +57 -0
  98. package/dist/products/tailscale.js +17 -0
  99. package/dist/products/volumes.d.ts +42 -0
  100. package/dist/products/volumes.js +36 -0
  101. package/dist/products/watch.d.ts +25 -4
  102. package/dist/products/watch.js +132 -18
  103. package/dist/proxy.js +3 -1
  104. package/dist/runloop/index.d.ts +326 -0
  105. package/dist/runloop/index.js +535 -0
  106. package/dist/runloop/pagination.d.ts +46 -0
  107. package/dist/runloop/pagination.js +82 -0
  108. package/dist/runloop/snapshots.d.ts +52 -0
  109. package/dist/runloop/snapshots.js +244 -0
  110. package/dist/sandbox.d.ts +76 -16
  111. package/dist/sandbox.js +696 -135
  112. package/dist/snapshots.d.ts +20 -5
  113. package/dist/snapshots.js +11 -1
  114. package/dist/sprites/index.d.ts +251 -0
  115. package/dist/sprites/index.js +588 -0
  116. package/dist/tar.d.ts +10 -1
  117. package/dist/tar.js +311 -35
  118. package/dist/tools/index.js +2 -1
  119. package/dist/transport.d.ts +23 -8
  120. package/dist/transport.js +247 -127
  121. package/dist/types.d.ts +52 -3
  122. package/dist/vercel/command.d.ts +1 -1
  123. package/dist/vercel/command.js +15 -3
  124. package/dist/vercel/errors.d.ts +2 -2
  125. package/dist/vercel/errors.js +19 -2
  126. package/dist/vercel/filesystem.d.ts +21 -18
  127. package/dist/vercel/filesystem.js +95 -48
  128. package/dist/vercel/sandbox.d.ts +8 -8
  129. package/dist/vercel/sandbox.js +159 -64
  130. package/dist/vercel/snapshot.d.ts +3 -2
  131. package/dist/vercel/snapshot.js +9 -5
  132. package/package.json +46 -3
@@ -0,0 +1,326 @@
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, options?: RequestOptions): 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, options?: RequestOptions): 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, options?: RequestOptions): 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, params?: {
274
+ force?: string;
275
+ } | RequestOptions, options?: RequestOptions): Promise<DevboxView>;
276
+ executeSync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxExecutionDetailView>;
277
+ executeAsync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
278
+ executeAndAwaitCompletion(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
279
+ readFileContents(id: string, body: {
280
+ file_path: string;
281
+ }, options?: RequestOptions): Promise<string>;
282
+ writeFileContents(id: string, body: {
283
+ file_path: string;
284
+ contents: string;
285
+ }, options?: RequestOptions): Promise<DevboxExecutionDetailView>;
286
+ snapshotDisk(id: string, body?: DevboxSnapshotDiskParams, options?: RequestOptions): Promise<DevboxSnapshotView>;
287
+ snapshotDisk(id: string, options?: RequestOptions): Promise<DevboxSnapshotView>;
288
+ snapshotDiskAsync(_id: string, _body?: DevboxSnapshotDiskParams | RequestOptions, _options?: RequestOptions): Promise<never>;
289
+ deleteDiskSnapshot(id: string, options?: RequestOptions): Promise<unknown>;
290
+ listDiskSnapshots(query?: DiskSnapshotListParams, options?: RequestOptions): ReturnType<DiskSnapshots["list"]>;
291
+ listDiskSnapshots(options?: RequestOptions): ReturnType<DiskSnapshots["list"]>;
292
+ }
293
+ export declare class Executions {
294
+ private readonly runtime;
295
+ constructor(runtime: Runtime);
296
+ executeSync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxExecutionDetailView>;
297
+ executeAsync(id: string, body: DevboxExecuteParams, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
298
+ retrieve(id: string, execution: string, query?: {
299
+ last_n?: string;
300
+ } | RequestOptions, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
301
+ awaitCompleted(id: string, execution: string, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
302
+ kill(id: string, execution: string, body?: {
303
+ kill_process_group?: boolean | null;
304
+ } | RequestOptions, options?: RequestOptions): Promise<DevboxAsyncExecutionDetailView>;
305
+ sendStdIn(id: string, execution: string, body?: {
306
+ text?: string | null;
307
+ signal?: "EOF" | "INTERRUPT" | null;
308
+ } | RequestOptions, options?: RequestOptions): Promise<{
309
+ devbox_id: string;
310
+ execution_id: string;
311
+ success: boolean;
312
+ }>;
313
+ streamStdoutUpdates(id: string, execution: string, query?: {
314
+ offset?: string;
315
+ }, options?: RequestOptions): AsyncGenerator<{
316
+ output: string;
317
+ offset: number;
318
+ }, void, unknown>;
319
+ streamStderrUpdates(id: string, execution: string, query?: {
320
+ offset?: string;
321
+ }, options?: RequestOptions): AsyncGenerator<{
322
+ output: string;
323
+ offset: number;
324
+ }, void, unknown>;
325
+ private stream;
326
+ }