@solarisdk/runloop-compat 0.0.0-stage → 0.1.1

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 (58) hide show
  1. package/COMPAT.md +112 -0
  2. package/LICENSE +17 -0
  3. package/LICENSE-RUNLOOP +7 -0
  4. package/NOTICE +14 -0
  5. package/README.md +46 -2
  6. package/dist/blueprint-types.d.ts +522 -0
  7. package/dist/blueprint-types.d.ts.map +1 -0
  8. package/dist/blueprint-types.js +4 -0
  9. package/dist/blueprint-types.js.map +1 -0
  10. package/dist/blueprints.d.ts +71 -0
  11. package/dist/blueprints.d.ts.map +1 -0
  12. package/dist/blueprints.js +233 -0
  13. package/dist/blueprints.js.map +1 -0
  14. package/dist/client.d.ts +290 -0
  15. package/dist/client.d.ts.map +1 -0
  16. package/dist/client.js +924 -0
  17. package/dist/client.js.map +1 -0
  18. package/dist/context.d.ts +42 -0
  19. package/dist/context.d.ts.map +1 -0
  20. package/dist/context.js +198 -0
  21. package/dist/context.js.map +1 -0
  22. package/dist/dockerfile.d.ts +36 -0
  23. package/dist/dockerfile.d.ts.map +1 -0
  24. package/dist/dockerfile.js +338 -0
  25. package/dist/dockerfile.js.map +1 -0
  26. package/dist/errors.d.ts +67 -0
  27. package/dist/errors.d.ts.map +1 -0
  28. package/dist/errors.js +171 -0
  29. package/dist/errors.js.map +1 -0
  30. package/dist/image-ref.d.ts +35 -0
  31. package/dist/image-ref.d.ts.map +1 -0
  32. package/dist/image-ref.js +97 -0
  33. package/dist/image-ref.js.map +1 -0
  34. package/dist/index.d.ts +16 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +20 -0
  37. package/dist/index.js.map +1 -0
  38. package/dist/mapping.d.ts +49 -0
  39. package/dist/mapping.d.ts.map +1 -0
  40. package/dist/mapping.js +206 -0
  41. package/dist/mapping.js.map +1 -0
  42. package/dist/sdk.d.ts +182 -0
  43. package/dist/sdk.d.ts.map +1 -0
  44. package/dist/sdk.js +356 -0
  45. package/dist/sdk.js.map +1 -0
  46. package/dist/secrets.d.ts +41 -0
  47. package/dist/secrets.d.ts.map +1 -0
  48. package/dist/secrets.js +58 -0
  49. package/dist/secrets.js.map +1 -0
  50. package/dist/shared-types.d.ts +440 -0
  51. package/dist/shared-types.d.ts.map +1 -0
  52. package/dist/shared-types.js +4 -0
  53. package/dist/shared-types.js.map +1 -0
  54. package/dist/types.d.ts +920 -0
  55. package/dist/types.d.ts.map +1 -0
  56. package/dist/types.js +4 -0
  57. package/dist/types.js.map +1 -0
  58. package/package.json +48 -4
@@ -0,0 +1,920 @@
1
+ import type * as Shared from './shared-types.js';
2
+ /** Cursor-pagination params shared by the list calls (mirrors Runloop's pagination.d.ts). */
3
+ export interface CursorIDPageParams {
4
+ starting_after?: string;
5
+ limit?: number;
6
+ }
7
+ export type DevboxesCursorIDPageParams = CursorIDPageParams;
8
+ export type DiskSnapshotsCursorIDPageParams = CursorIDPageParams;
9
+ /** Anything `uploadFile` accepts as file content. */
10
+ export type Uploadable = Blob | Response | Uint8Array | ArrayBuffer | string;
11
+ export interface DevboxAsyncExecutionDetailView {
12
+ /**
13
+ * Devbox id where command was executed.
14
+ */
15
+ devbox_id: string;
16
+ /**
17
+ * Ephemeral id of the execution in progress.
18
+ */
19
+ execution_id: string;
20
+ /**
21
+ * Current status of the execution.
22
+ */
23
+ status: 'queued' | 'running' | 'completed';
24
+ /**
25
+ * Exit code of command execution. This field will remain unset until the execution
26
+ * has completed.
27
+ */
28
+ exit_status?: number | null;
29
+ /**
30
+ * Shell name.
31
+ */
32
+ shell_name?: string | null;
33
+ /**
34
+ * Standard error generated by command. This field will remain unset until the
35
+ * execution has completed.
36
+ */
37
+ stderr?: string | null;
38
+ /**
39
+ * Indicates whether the stderr was truncated due to size limits.
40
+ */
41
+ stderr_truncated?: boolean | null;
42
+ /**
43
+ * Standard out generated by command. This field will remain unset until the
44
+ * execution has completed.
45
+ */
46
+ stdout?: string | null;
47
+ /**
48
+ * Indicates whether the stdout was truncated due to size limits.
49
+ */
50
+ stdout_truncated?: boolean | null;
51
+ }
52
+ export interface DevboxEvictionEventView {
53
+ /**
54
+ * The ID of the Devbox with a pending eviction.
55
+ */
56
+ devbox_id: string;
57
+ /**
58
+ * Unix timestamp (milliseconds) after which the Devbox will be suspended. Advisory
59
+ * and best-effort.
60
+ */
61
+ eviction_deadline_ms: number;
62
+ }
63
+ export interface DevboxExecutionDetailView {
64
+ /**
65
+ * Devbox id where command was executed.
66
+ */
67
+ devbox_id: string;
68
+ /**
69
+ * Exit status of command execution.
70
+ */
71
+ exit_status: number;
72
+ /**
73
+ * Standard error generated by command.
74
+ */
75
+ stderr: string;
76
+ /**
77
+ * Standard out generated by command.
78
+ */
79
+ stdout: string;
80
+ /**
81
+ * Shell name.
82
+ */
83
+ shell_name?: string | null;
84
+ }
85
+ export interface DevboxKillExecutionRequest {
86
+ /**
87
+ * Whether to kill the entire process group (default: false). If true, kills all
88
+ * processes in the same process group as the target process.
89
+ */
90
+ kill_process_group?: boolean | null;
91
+ }
92
+ export interface DevboxListView {
93
+ /**
94
+ * List of devboxes matching filter.
95
+ */
96
+ devboxes: Array<DevboxView>;
97
+ has_more: boolean;
98
+ total_count?: number | null;
99
+ }
100
+ export interface DevboxResourceUsageView {
101
+ /**
102
+ * The devbox ID.
103
+ */
104
+ id: string;
105
+ /**
106
+ * Disk usage in GB-seconds (total_elapsed_seconds multiplied by disk size in GB).
107
+ * Disk is billed for elapsed time since storage is consumed even when suspended.
108
+ */
109
+ disk_gb_seconds: number;
110
+ /**
111
+ * Memory usage in GB-seconds (total_active_seconds multiplied by memory in GB).
112
+ */
113
+ memory_gb_seconds: number;
114
+ /**
115
+ * The devbox creation time in milliseconds since epoch.
116
+ */
117
+ start_time_ms: number;
118
+ /**
119
+ * The current status of the devbox.
120
+ */
121
+ status: string;
122
+ /**
123
+ * Total time in seconds the devbox was actively running (excludes time spent
124
+ * suspended).
125
+ */
126
+ total_active_seconds: number;
127
+ /**
128
+ * Total elapsed time in seconds from devbox creation to now (or end time if
129
+ * terminated). Includes all time regardless of devbox state.
130
+ */
131
+ total_elapsed_seconds: number;
132
+ /**
133
+ * vCPU usage in vCPU-seconds (total_active_seconds multiplied by the number of
134
+ * vCPUs).
135
+ */
136
+ vcpu_seconds: number;
137
+ /**
138
+ * The devbox end time in milliseconds since epoch, or null if still running.
139
+ */
140
+ end_time_ms?: number | null;
141
+ }
142
+ export interface DevboxSendStdInRequest {
143
+ /**
144
+ * Signal to send to std in of the running execution.
145
+ */
146
+ signal?: 'EOF' | 'INTERRUPT' | null;
147
+ /**
148
+ * Text to send to std in of the running execution.
149
+ */
150
+ text?: string | null;
151
+ }
152
+ export interface DevboxSendStdInResult {
153
+ /**
154
+ * Devbox id where command is executing.
155
+ */
156
+ devbox_id: string;
157
+ /**
158
+ * Execution id that received the stdin.
159
+ */
160
+ execution_id: string;
161
+ /**
162
+ * Whether the stdin was successfully sent.
163
+ */
164
+ success: boolean;
165
+ }
166
+ export interface DevboxSnapshotListView {
167
+ has_more: boolean;
168
+ /**
169
+ * List of snapshots matching filter.
170
+ */
171
+ snapshots: Array<DevboxSnapshotView>;
172
+ total_count?: number | null;
173
+ }
174
+ /**
175
+ * View of a Devbox disk snapshot.
176
+ *
177
+ * @category Snapshot Types
178
+ */
179
+ export interface DevboxSnapshotView {
180
+ /**
181
+ * The unique identifier of the snapshot.
182
+ */
183
+ id: string;
184
+ /**
185
+ * Creation time of the Snapshot (Unix timestamp milliseconds).
186
+ */
187
+ create_time_ms: number;
188
+ /**
189
+ * User defined metadata associated with the snapshot.
190
+ */
191
+ metadata: {
192
+ [key: string]: string;
193
+ };
194
+ /**
195
+ * The source Devbox ID this snapshot was created from.
196
+ */
197
+ source_devbox_id: string;
198
+ /**
199
+ * (Optional) The commit message of the snapshot (max 1000 characters).
200
+ */
201
+ commit_message?: string | null;
202
+ /**
203
+ * (Optional) The custom name of the snapshot.
204
+ */
205
+ name?: string | null;
206
+ /**
207
+ * (Optional) The size of the snapshot in bytes, relative to the base blueprint.
208
+ */
209
+ size_bytes?: number | null;
210
+ /**
211
+ * (Optional) The source Blueprint ID this snapshot was created from.
212
+ */
213
+ source_blueprint_id?: string | null;
214
+ }
215
+ /**
216
+ * A Devbox represents a virtual development environment. It is an isolated sandbox
217
+ * that can be given to agents and used to run arbitrary code such as AI generated
218
+ * code.
219
+ *
220
+ * @category Devbox Types
221
+ */
222
+ export interface DevboxView {
223
+ /**
224
+ * The ID of the Devbox.
225
+ */
226
+ id: string;
227
+ /**
228
+ * A list of capability groups this devbox has access to.
229
+ */
230
+ capabilities: Array<'unknown' | 'docker_in_docker'>;
231
+ /**
232
+ * Creation time of the Devbox (Unix timestamp milliseconds).
233
+ */
234
+ create_time_ms: number;
235
+ /**
236
+ * The time the Devbox finished execution (Unix timestamp milliseconds). Present if
237
+ * the Devbox is in a terminal state.
238
+ */
239
+ end_time_ms: number | null;
240
+ /**
241
+ * The launch parameters used to create the Devbox.
242
+ */
243
+ launch_parameters: Shared.LaunchParameters;
244
+ /**
245
+ * The user defined Devbox metadata.
246
+ */
247
+ metadata: {
248
+ [key: string]: string;
249
+ };
250
+ /**
251
+ * A list of state transitions in order with durations
252
+ */
253
+ state_transitions: Array<DevboxView.StateTransition>;
254
+ /**
255
+ * The current status of the Devbox.
256
+ */
257
+ status: 'scheduled' | 'queued' | 'provisioning' | 'initializing' | 'running' | 'suspending' | 'suspended' | 'resuming' | 'failure' | 'shutdown';
258
+ /**
259
+ * The Blueprint ID used in creation of the Devbox, if the devbox was created from
260
+ * a Blueprint.
261
+ */
262
+ blueprint_id?: string | null;
263
+ /**
264
+ * The category of failure experienced by the Devbox.
265
+ *
266
+ * out_of_memory: The Devbox ran out of memory at runtime. Use launch parameters to
267
+ * request a larger resource size. out_of_disk: The Devbox ran out of disk at
268
+ * runtime. Please reach out to support for us to better support your use case.
269
+ * execution_failed: The Devbox failed at runtime. Please use the dashboard to look
270
+ * at the logs of the failure. health_check_failed: The Devbox failed its health
271
+ * checks. This may indicate resource utilization is close to the maximum. Consider
272
+ * requesting a larger resource size.
273
+ */
274
+ failure_reason?: 'out_of_memory' | 'out_of_disk' | 'execution_failed' | 'health_check_failed' | null;
275
+ /**
276
+ * Gateway specifications configured for this devbox. Map key is the environment
277
+ * variable prefix (e.g., 'GWS_ANTHROPIC').
278
+ */
279
+ gateway_specs?: {
280
+ [key: string]: DevboxView.GatewaySpecs;
281
+ } | null;
282
+ /**
283
+ * The ID of the initiator that created the Devbox.
284
+ */
285
+ initiator_id?: string | null;
286
+ /**
287
+ * The type of initiator that created the Devbox.
288
+ */
289
+ initiator_type?: 'unknown' | 'api' | 'reflex';
290
+ /**
291
+ * [Beta] MCP specifications configured for this devbox. Map key is the environment
292
+ * variable name for the MCP token envelope. Each spec links an MCP config to a
293
+ * secret for MCP server access through the MCP hub.
294
+ */
295
+ mcp_specs?: {
296
+ [key: string]: DevboxView.McpSpecs;
297
+ } | null;
298
+ /**
299
+ * The name of the Devbox.
300
+ */
301
+ name?: string | null;
302
+ /**
303
+ * The reason that caused the transition of the Devbox to the shutown state.
304
+ *
305
+ * api_shutdown: The Devbox shutdown due to API request. entrypoint_exit: The
306
+ * Devbox entrypoint program completed. idle: The Devbox shutdown due to configured
307
+ * action on idle configuration. ttl_expired: The Devbox shutdown due to TTL
308
+ * expiration.
309
+ */
310
+ shutdown_reason?: 'api_shutdown' | 'keep_alive_timeout' | 'entrypoint_exit' | 'idle' | 'ttl_expired' | null;
311
+ /**
312
+ * The Snapshot ID used in creation of the Devbox, if the devbox was created from a
313
+ * Snapshot.
314
+ */
315
+ snapshot_id?: string | null;
316
+ /**
317
+ * A V2 tunnel provides secure HTTP access to services running on a Devbox. Tunnels
318
+ * allow external clients to reach web servers, APIs, or other HTTP services
319
+ * running inside a Devbox without requiring direct network access. Each tunnel is
320
+ * uniquely identified by an encrypted tunnel_key and can be configured for either
321
+ * open (public) or authenticated access. Usage:
322
+ * https://{port}-{tunnel_key}.tunnel.runloop.ai. Authenticated tunnels should pass
323
+ * auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
324
+ */
325
+ tunnel?: TunnelView | null;
326
+ }
327
+ export declare namespace DevboxView {
328
+ interface StateTransition {
329
+ /**
330
+ * The failure that caused this state transition, if applicable.
331
+ */
332
+ failure_reason?: string | null;
333
+ /**
334
+ * The status of the Devbox.
335
+ *
336
+ * scheduled: Deprecated. The Devbox is waiting for infrastructure allocation to
337
+ * start. Use queued. queued: The Devbox is waiting for infrastructure allocation
338
+ * to start. provisioning: Runloop is allocating and booting the necessary
339
+ * infrastructure resources. initializing: Runloop defined boot scripts are running
340
+ * to enable the environment for interaction. running: The Devbox is ready for
341
+ * interaction. suspending: The Devbox disk is being snapshotted as part of
342
+ * suspension. suspended: The Devbox disk is saved and no more active compute is
343
+ * being used for the Devbox. resuming: The Devbox disk is being loaded as part of
344
+ * booting a suspended Devbox. failure: The Devbox failed as part of booting or
345
+ * running user requested actions. shutdown: The Devbox was successfully shutdown
346
+ * and no more active compute is being used.
347
+ */
348
+ status?: 'scheduled' | 'queued' | 'provisioning' | 'initializing' | 'running' | 'suspending' | 'suspended' | 'resuming' | 'failure' | 'shutdown';
349
+ /**
350
+ * The time the status change occurred
351
+ */
352
+ transition_time_ms?: unknown;
353
+ }
354
+ interface GatewaySpecs {
355
+ /**
356
+ * The ID of the gateway config (e.g., gwc_123abc).
357
+ */
358
+ gateway_config_id: string;
359
+ /**
360
+ * The ID of the secret containing the credential.
361
+ */
362
+ secret_id: string;
363
+ }
364
+ interface McpSpecs {
365
+ /**
366
+ * The ID of the MCP config (e.g., mcp_123abc).
367
+ */
368
+ mcp_config_id: string;
369
+ /**
370
+ * The ID of the secret containing the credential.
371
+ */
372
+ secret_id: string;
373
+ }
374
+ }
375
+ export interface GatewayTokenView {
376
+ /**
377
+ * The token to send to the gateway as a Bearer token in the Authorization header.
378
+ * Only accepted for requests originating from the bound Devbox.
379
+ */
380
+ token: string;
381
+ /**
382
+ * How the gateway applies the credential to proxied requests.
383
+ */
384
+ auth_mechanism: Shared.AuthMechanism;
385
+ /**
386
+ * The Devbox the token is bound to.
387
+ */
388
+ devbox_id: string;
389
+ /**
390
+ * The target API endpoint the gateway proxies to.
391
+ */
392
+ endpoint: string;
393
+ /**
394
+ * The ID of the gateway config the token proxies through.
395
+ */
396
+ gateway_config_id: string;
397
+ /**
398
+ * The gateway URL to send requests to. Matches the value of the
399
+ * &#123;prefix&#125;\_URL environment variable inside the Devbox.
400
+ */
401
+ url: string;
402
+ }
403
+ export interface McpTokenView {
404
+ /**
405
+ * The token to send to the MCP hub as a Bearer token in the Authorization header.
406
+ * Only accepted for requests originating from the bound Devbox.
407
+ */
408
+ token: string;
409
+ /**
410
+ * Glob patterns for the tools the token permits.
411
+ */
412
+ allowed_tools: Array<string>;
413
+ /**
414
+ * The Devbox the token is bound to.
415
+ */
416
+ devbox_id: string;
417
+ /**
418
+ * The upstream MCP server endpoint the hub proxies to.
419
+ */
420
+ endpoint: string;
421
+ /**
422
+ * The ID of the MCP config the token grants access to.
423
+ */
424
+ mcp_config_id: string;
425
+ /**
426
+ * The MCP hub URL the token authenticates against. Matches the RL_MCP_URL
427
+ * environment variable inside the Devbox.
428
+ */
429
+ url: string;
430
+ }
431
+ /**
432
+ * An ephemeral PTY tunnel providing authenticated terminal access to a Devbox.
433
+ * These tunnels are not stored on the Devbox and are generated fresh on each
434
+ * request. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai with
435
+ * X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
436
+ */
437
+ export interface PtyTunnelView {
438
+ /**
439
+ * Bearer token for tunnel authentication. Always required for PTY tunnels. Pass as
440
+ * X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
441
+ */
442
+ auth_token: string;
443
+ /**
444
+ * The encrypted tunnel key used to construct the tunnel URL. URL format:
445
+ * https://{port}-{tunnel_key}.tunnel.runloop.{domain}
446
+ */
447
+ tunnel_key: string;
448
+ }
449
+ /**
450
+ * A V2 tunnel provides secure HTTP access to services running on a Devbox. Tunnels
451
+ * allow external clients to reach web servers, APIs, or other HTTP services
452
+ * running inside a Devbox without requiring direct network access. Each tunnel is
453
+ * uniquely identified by an encrypted tunnel_key and can be configured for either
454
+ * open (public) or authenticated access. Usage:
455
+ * https://{port}-{tunnel_key}.tunnel.runloop.ai. Authenticated tunnels should pass
456
+ * auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
457
+ */
458
+ export interface TunnelView {
459
+ /**
460
+ * The authentication mode for the tunnel.
461
+ */
462
+ auth_mode: 'open' | 'authenticated';
463
+ /**
464
+ * Creation time of the tunnel (Unix timestamp milliseconds).
465
+ */
466
+ create_time_ms: number;
467
+ /**
468
+ * When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
469
+ * policies, resetting the idle timer.
470
+ */
471
+ http_keep_alive: boolean;
472
+ /**
473
+ * The encrypted tunnel key used to construct the tunnel URL. URL format:
474
+ * https://{port}-{tunnel_key}.tunnel.runloop.{domain}
475
+ */
476
+ tunnel_key: string;
477
+ /**
478
+ * When true, HTTP traffic to a suspended devbox will automatically trigger a
479
+ * resume.
480
+ */
481
+ wake_on_http: boolean;
482
+ /**
483
+ * Bearer token for tunnel authentication. Only present when auth_mode is
484
+ * 'authenticated'. Pass as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
485
+ */
486
+ auth_token?: string | null;
487
+ }
488
+ export interface DevboxCreateSSHKeyResponse {
489
+ /**
490
+ * The ID of the Devbox.
491
+ */
492
+ id: string;
493
+ /**
494
+ * The ssh private key, in PEM format.
495
+ */
496
+ ssh_private_key: string;
497
+ /**
498
+ * The Linux user to use for SSH connections to this Devbox.
499
+ */
500
+ ssh_user: string;
501
+ /**
502
+ * The host url of the Devbox that can be used for SSH.
503
+ */
504
+ url: string;
505
+ }
506
+ export type DevboxDeleteDiskSnapshotResponse = unknown;
507
+ export type DevboxKeepAliveResponse = unknown;
508
+ export type DevboxReadFileContentsResponse = string;
509
+ export type DevboxRemoveTunnelResponse = unknown;
510
+ export type DevboxUploadFileResponse = unknown;
511
+ /**
512
+ * Parameters for creating a new Devbox.
513
+ *
514
+ * @category Devbox Types
515
+ */
516
+ export interface DevboxCreateParams {
517
+ /**
518
+ * Blueprint ID to use for the Devbox. If none set, the Devbox will be created with
519
+ * the default Runloop Devbox image. Only one of (Snapshot ID, Blueprint ID,
520
+ * Blueprint name) should be specified.
521
+ */
522
+ blueprint_id?: string | null;
523
+ /**
524
+ * Name of Blueprint to use for the Devbox. When set, this will load the latest
525
+ * successfully built Blueprint with the given name. Only one of (Snapshot ID,
526
+ * Blueprint ID, Blueprint name) should be specified.
527
+ */
528
+ blueprint_name?: string | null;
529
+ /**
530
+ * A list of code mounts to be included in the Devbox. Use mounts instead.
531
+ */
532
+ code_mounts?: Array<Shared.CodeMountParameters> | null;
533
+ /**
534
+ * (Optional) When specified, the Devbox will run this script as its main
535
+ * executable. The devbox lifecycle will be bound to entrypoint, shutting down when
536
+ * the process is complete.
537
+ */
538
+ entrypoint?: string | null;
539
+ /**
540
+ * (Optional) Environment variables used to configure your Devbox.
541
+ */
542
+ environment_variables?: {
543
+ [key: string]: string;
544
+ } | null;
545
+ /**
546
+ * Map of paths and file contents to write before setup. Use mounts instead.
547
+ */
548
+ file_mounts?: {
549
+ [key: string]: string;
550
+ } | null;
551
+ /**
552
+ * (Optional) Agent gateway specifications for credential proxying. Map key is the
553
+ * environment variable prefix (e.g., 'GWS_ANTHROPIC'). The agent gateway will
554
+ * proxy requests to external APIs using the specified credential without exposing
555
+ * the real API key. Example: {'GWS_ANTHROPIC': {'gateway': 'anthropic', 'secret':
556
+ * 'my_claude_key'}}
557
+ */
558
+ gateways?: {
559
+ [key: string]: DevboxCreateParams.Gateways;
560
+ } | null;
561
+ /**
562
+ * LaunchParameters enable you to customize the resources available to your Devbox
563
+ * as well as the environment set up that should be completed before the Devbox is
564
+ * marked as 'running'.
565
+ */
566
+ launch_parameters?: Shared.LaunchParameters | null;
567
+ /**
568
+ * [Beta] (Optional) MCP specifications for MCP server access. Map key is the
569
+ * environment variable name for the MCP token envelope. Each spec links an MCP
570
+ * config to a secret. The devbox will also receive RL_MCP_URL for the MCP hub
571
+ * endpoint. Example: {'MCP_SECRET': {'mcp_config': 'github-readonly', 'secret':
572
+ * 'MY_GITHUB_TOKEN'}}
573
+ */
574
+ mcp?: {
575
+ [key: string]: DevboxCreateParams.Mcp;
576
+ } | null;
577
+ /**
578
+ * User defined metadata to attach to the devbox for organization.
579
+ */
580
+ metadata?: {
581
+ [key: string]: string;
582
+ } | null;
583
+ /**
584
+ * A list of mounts to be included in the Devbox.
585
+ */
586
+ mounts?: Array<Shared.Mount> | null;
587
+ /**
588
+ * (Optional) A user specified name to give the Devbox.
589
+ */
590
+ name?: string | null;
591
+ /**
592
+ * (Optional) Map of environment variable names to secret names. The secret values
593
+ * will be securely injected as environment variables in the Devbox. Example:
594
+ * {"DB_PASS": "DATABASE_PASSWORD"} sets environment variable 'DB_PASS' to the
595
+ * value of secret 'DATABASE_PASSWORD'.
596
+ */
597
+ secrets?: {
598
+ [key: string]: string;
599
+ } | null;
600
+ /**
601
+ * Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID,
602
+ * Blueprint name) should be specified.
603
+ */
604
+ snapshot_id?: string | null;
605
+ /**
606
+ * Configuration for creating a V2 tunnel. When specified at Devbox creation, a
607
+ * tunnel will be automatically provisioned.
608
+ */
609
+ tunnel?: DevboxCreateParams.Tunnel | null;
610
+ }
611
+ export declare namespace DevboxCreateParams {
612
+ /**
613
+ * GatewaySpec links an agent gateway configuration to a secret for credential
614
+ * proxying in a devbox. The agent gateway will proxy requests to external APIs
615
+ * using the specified credential without exposing the real API key.
616
+ */
617
+ interface Gateways {
618
+ /**
619
+ * The gateway config to use. Can be a gateway config ID (gwc_xxx) or name. A name
620
+ * binds the most recently created config with that name.
621
+ */
622
+ gateway: string;
623
+ /**
624
+ * The secret containing the credential. Can be a secret ID or name.
625
+ */
626
+ secret: string;
627
+ }
628
+ /**
629
+ * [Beta] McpSpec links an MCP configuration to a secret for MCP server access in a
630
+ * devbox. The MCP hub will proxy requests to upstream MCP servers using the
631
+ * specified credential, with tool-level access control based on the MCP config's
632
+ * allowed_tools.
633
+ */
634
+ interface Mcp {
635
+ /**
636
+ * The MCP config to use. Can be an MCP config ID (mcp_xxx) or name. A name binds
637
+ * the most recently created config with that name.
638
+ */
639
+ mcp_config: string;
640
+ /**
641
+ * The secret containing the MCP server credential. Can be a secret ID or name.
642
+ */
643
+ secret: string;
644
+ }
645
+ /**
646
+ * Configuration for creating a V2 tunnel. When specified at Devbox creation, a
647
+ * tunnel will be automatically provisioned.
648
+ */
649
+ interface Tunnel {
650
+ /**
651
+ * Authentication mode for the tunnel. Defaults to open if omitted: the hostname is
652
+ * a public capability and does not require a tunnel bearer token.
653
+ */
654
+ auth_mode?: 'open' | 'authenticated' | null;
655
+ /**
656
+ * When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
657
+ * policies, resetting the idle timer. Defaults to true if not specified.
658
+ */
659
+ http_keep_alive?: boolean | null;
660
+ /**
661
+ * When true, HTTP traffic to a suspended devbox will automatically trigger a
662
+ * resume. Defaults to false if not specified. Prefer
663
+ * lifecycle.resume_triggers.http on launch_parameters for new integrations. If
664
+ * both are set, lifecycle.resume_triggers.http takes precedence.
665
+ */
666
+ wake_on_http?: boolean | null;
667
+ }
668
+ }
669
+ export interface DevboxUpdateParams {
670
+ /**
671
+ * User defined metadata to replace the Devbox metadata. Omit to leave unchanged or
672
+ * set to an empty map to clear it.
673
+ */
674
+ metadata?: {
675
+ [key: string]: string;
676
+ } | null;
677
+ /**
678
+ * A user specified name to give the Devbox. Omit to leave unchanged or set to an
679
+ * empty string to clear it.
680
+ */
681
+ name?: string | null;
682
+ }
683
+ export interface DevboxListParams extends DevboxesCursorIDPageParams {
684
+ /**
685
+ * If true (default), includes total_count in the response. Set to false to skip
686
+ * the count query for better performance on large datasets.
687
+ */
688
+ include_total_count?: boolean;
689
+ /**
690
+ * Filter by status
691
+ */
692
+ status?: 'scheduled' | 'queued' | 'provisioning' | 'initializing' | 'running' | 'suspending' | 'suspended' | 'resuming' | 'failure' | 'shutdown';
693
+ }
694
+ export interface DevboxCreateGatewayTokenParams {
695
+ /**
696
+ * The gateway config to use. Can be a gateway config ID (gwc_xxx) or name.
697
+ */
698
+ gateway: string;
699
+ /**
700
+ * The secret containing the credential. Can be a secret ID or name.
701
+ */
702
+ secret: string;
703
+ }
704
+ export interface DevboxCreateMcpTokenParams {
705
+ /**
706
+ * The MCP config to use. Can be an MCP config ID (mcp_xxx) or name.
707
+ */
708
+ mcp_config: string;
709
+ /**
710
+ * The secret containing the MCP server credential. Can be a secret ID or name.
711
+ */
712
+ secret: string;
713
+ }
714
+ export interface DevboxDownloadFileParams {
715
+ /**
716
+ * The path on the Devbox filesystem to read the file from. Path is relative to
717
+ * user home directory.
718
+ */
719
+ path: string;
720
+ }
721
+ export interface DevboxEnableTunnelParams {
722
+ /**
723
+ * Authentication mode for the tunnel. Defaults to open if omitted: the hostname is
724
+ * a public capability and does not require a tunnel bearer token.
725
+ */
726
+ auth_mode?: 'open' | 'authenticated' | null;
727
+ /**
728
+ * When true, HTTP traffic through the tunnel counts as activity for idle lifecycle
729
+ * policies, resetting the idle timer. Defaults to true if not specified.
730
+ */
731
+ http_keep_alive?: boolean | null;
732
+ /**
733
+ * When true, HTTP traffic to a suspended devbox will automatically trigger a
734
+ * resume. Defaults to false if not specified. Prefer
735
+ * lifecycle.resume_triggers.http on launch_parameters for new integrations. If
736
+ * both are set, lifecycle.resume_triggers.http takes precedence.
737
+ */
738
+ wake_on_http?: boolean | null;
739
+ }
740
+ /**
741
+ * Parameters for executing a command on a Devbox.
742
+ *
743
+ * @category Devbox Types
744
+ */
745
+ export interface DevboxExecuteParams {
746
+ /**
747
+ * Body param: The command to execute via the Devbox shell. By default, commands
748
+ * are run from the user home directory unless shell_name is specified. If
749
+ * shell_name is specified the command is run from the directory based on the
750
+ * recent state of the persistent shell.
751
+ */
752
+ command: string;
753
+ /**
754
+ * Body param: The command ID in UUIDv7 string format for idempotency and tracking
755
+ */
756
+ command_id?: string;
757
+ /**
758
+ * Query param: Last n lines of standard error / standard out to return
759
+ * (default: 100)
760
+ */
761
+ last_n?: string;
762
+ /**
763
+ * Body param: Timeout in seconds to wait for command completion, up to 25 seconds.
764
+ * Defaults to 25 seconds. Operation is not killed.
765
+ */
766
+ optimistic_timeout?: number | null;
767
+ /**
768
+ * Body param: The name of the persistent shell to create or use if already
769
+ * created. When using a persistent shell, the command will run from the directory
770
+ * at the end of the previous command and environment variables will be preserved.
771
+ */
772
+ shell_name?: string | null;
773
+ }
774
+ export interface DevboxExecuteAsyncParams {
775
+ /**
776
+ * The command to execute via the Devbox shell. By default, commands are run from
777
+ * the user home directory unless shell_name is specified. If shell_name is
778
+ * specified the command is run from the directory based on the recent state of the
779
+ * persistent shell.
780
+ */
781
+ command: string;
782
+ /**
783
+ * Whether to attach stdin streaming for async commands. Not valid for execute_sync
784
+ * endpoint. Defaults to false if not specified.
785
+ */
786
+ attach_stdin?: boolean | null;
787
+ /**
788
+ * The name of the persistent shell to create or use if already created. When using
789
+ * a persistent shell, the command will run from the directory at the end of the
790
+ * previous command and environment variables will be preserved.
791
+ */
792
+ shell_name?: string | null;
793
+ }
794
+ export interface DevboxExecuteSyncParams {
795
+ /**
796
+ * The command to execute via the Devbox shell. By default, commands are run from
797
+ * the user home directory unless shell_name is specified. If shell_name is
798
+ * specified the command is run from the directory based on the recent state of the
799
+ * persistent shell.
800
+ */
801
+ command: string;
802
+ /**
803
+ * Whether to attach stdin streaming for async commands. Not valid for execute_sync
804
+ * endpoint. Defaults to false if not specified.
805
+ */
806
+ attach_stdin?: boolean | null;
807
+ /**
808
+ * The name of the persistent shell to create or use if already created. When using
809
+ * a persistent shell, the command will run from the directory at the end of the
810
+ * previous command and environment variables will be preserved.
811
+ */
812
+ shell_name?: string | null;
813
+ }
814
+ export interface DevboxListDiskSnapshotsParams extends DiskSnapshotsCursorIDPageParams {
815
+ /**
816
+ * Devbox ID to filter by.
817
+ */
818
+ devbox_id?: string;
819
+ /**
820
+ * If true (default), includes total_count in the response. Set to false to skip
821
+ * the count query for better performance on large datasets.
822
+ */
823
+ include_total_count?: boolean;
824
+ /**
825
+ * Filter snapshots by metadata key-value pair. Can be used multiple times for
826
+ * different keys.
827
+ */
828
+ 'metadata[key]'?: string;
829
+ /**
830
+ * Filter snapshots by metadata key with multiple possible values (OR condition).
831
+ */
832
+ 'metadata[key][in]'?: string;
833
+ /**
834
+ * Source Blueprint ID to filter snapshots by.
835
+ */
836
+ source_blueprint_id?: string;
837
+ }
838
+ export interface DevboxReadFileContentsParams {
839
+ /**
840
+ * The path on the Devbox filesystem to read the file from. Path is relative to
841
+ * user home directory.
842
+ */
843
+ file_path: string;
844
+ }
845
+ export interface DevboxShutdownParams {
846
+ /**
847
+ * If true, force shutdown even if snapshots are in progress. Defaults to false.
848
+ */
849
+ force?: string;
850
+ }
851
+ export interface DevboxSnapshotDiskParams {
852
+ /**
853
+ * (Optional) Commit message associated with the snapshot (max 1000 characters)
854
+ */
855
+ commit_message?: string | null;
856
+ /**
857
+ * (Optional) Metadata used to describe the snapshot
858
+ */
859
+ metadata?: {
860
+ [key: string]: string;
861
+ } | null;
862
+ /**
863
+ * (Optional) A user specified name to give the snapshot
864
+ */
865
+ name?: string | null;
866
+ }
867
+ export interface DevboxSnapshotDiskAsyncParams {
868
+ /**
869
+ * (Optional) Commit message associated with the snapshot (max 1000 characters)
870
+ */
871
+ commit_message?: string | null;
872
+ /**
873
+ * (Optional) Metadata used to describe the snapshot
874
+ */
875
+ metadata?: {
876
+ [key: string]: string;
877
+ } | null;
878
+ /**
879
+ * (Optional) A user specified name to give the snapshot
880
+ */
881
+ name?: string | null;
882
+ }
883
+ export interface DevboxUploadFileParams {
884
+ /**
885
+ * The path to write the file to on the Devbox. Path is relative to user home
886
+ * directory.
887
+ */
888
+ path: string;
889
+ file?: Uploadable;
890
+ }
891
+ export interface DevboxWaitForCommandParams {
892
+ /**
893
+ * Body param: The command execution statuses to wait for. At least one status must
894
+ * be provided. The command will be returned as soon as it reaches any of the
895
+ * provided statuses.
896
+ */
897
+ statuses: Array<'queued' | 'running' | 'completed'>;
898
+ /**
899
+ * Query param: Last n lines of standard error / standard out to return
900
+ * (default: 100)
901
+ */
902
+ last_n?: string;
903
+ /**
904
+ * Body param: (Optional) Timeout in seconds to wait for the status, up to 25
905
+ * seconds. Defaults to 25 seconds.
906
+ */
907
+ timeout_seconds?: number | null;
908
+ }
909
+ export interface DevboxWriteFileContentsParams {
910
+ /**
911
+ * The UTF-8 string contents to write to the file.
912
+ */
913
+ contents: string;
914
+ /**
915
+ * The path to write the file to on the Devbox. Path is relative to user home
916
+ * directory.
917
+ */
918
+ file_path: string;
919
+ }
920
+ //# sourceMappingURL=types.d.ts.map