@vercel/sandbox 2.0.0-beta.13 → 2.0.0-beta.18

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 (79) hide show
  1. package/dist/api-client/api-client.cjs +3 -15
  2. package/dist/api-client/api-client.cjs.map +1 -1
  3. package/dist/api-client/api-client.d.cts +5510 -76
  4. package/dist/api-client/api-client.d.ts +5510 -76
  5. package/dist/api-client/api-client.js +4 -16
  6. package/dist/api-client/api-client.js.map +1 -1
  7. package/dist/api-client/base-client.cjs +2 -1
  8. package/dist/api-client/base-client.cjs.map +1 -1
  9. package/dist/api-client/base-client.js +2 -1
  10. package/dist/api-client/base-client.js.map +1 -1
  11. package/dist/api-client/index.d.ts +1 -1
  12. package/dist/api-client/index.js +1 -1
  13. package/dist/api-client/validators.cjs +60 -16
  14. package/dist/api-client/validators.cjs.map +1 -1
  15. package/dist/api-client/validators.d.cts +25546 -130
  16. package/dist/api-client/validators.d.ts +25546 -130
  17. package/dist/api-client/validators.js +55 -16
  18. package/dist/api-client/validators.js.map +1 -1
  19. package/dist/auth/api.cjs +1 -1
  20. package/dist/auth/api.cjs.map +1 -1
  21. package/dist/auth/api.js +1 -1
  22. package/dist/auth/api.js.map +1 -1
  23. package/dist/auth/file.d.cts +3 -3
  24. package/dist/auth/file.d.ts +3 -3
  25. package/dist/auth/index.cjs +0 -1
  26. package/dist/auth/index.d.cts +2 -2
  27. package/dist/auth/index.d.ts +2 -2
  28. package/dist/auth/index.js +2 -2
  29. package/dist/auth/project.cjs +124 -26
  30. package/dist/auth/project.cjs.map +1 -1
  31. package/dist/auth/project.d.cts +9 -13
  32. package/dist/auth/project.d.ts +9 -13
  33. package/dist/auth/project.js +125 -26
  34. package/dist/auth/project.js.map +1 -1
  35. package/dist/filesystem.cjs +499 -0
  36. package/dist/filesystem.cjs.map +1 -0
  37. package/dist/filesystem.d.cts +258 -0
  38. package/dist/filesystem.d.ts +258 -0
  39. package/dist/filesystem.js +497 -0
  40. package/dist/filesystem.js.map +1 -0
  41. package/dist/index.cjs +2 -0
  42. package/dist/index.d.cts +4 -3
  43. package/dist/index.d.ts +4 -3
  44. package/dist/index.js +2 -1
  45. package/dist/network-policy.d.cts +58 -2
  46. package/dist/network-policy.d.ts +58 -2
  47. package/dist/sandbox.cjs +138 -22
  48. package/dist/sandbox.cjs.map +1 -1
  49. package/dist/sandbox.d.cts +2069 -22
  50. package/dist/sandbox.d.ts +2069 -22
  51. package/dist/sandbox.js +138 -22
  52. package/dist/sandbox.js.map +1 -1
  53. package/dist/session.cjs +10 -7
  54. package/dist/session.cjs.map +1 -1
  55. package/dist/session.d.cts +7 -5
  56. package/dist/session.d.ts +7 -5
  57. package/dist/session.js +10 -7
  58. package/dist/session.js.map +1 -1
  59. package/dist/snapshot.cjs +63 -10
  60. package/dist/snapshot.cjs.map +1 -1
  61. package/dist/snapshot.d.cts +41 -9
  62. package/dist/snapshot.d.ts +41 -9
  63. package/dist/snapshot.js +62 -10
  64. package/dist/snapshot.js.map +1 -1
  65. package/dist/utils/network-policy.cjs +23 -39
  66. package/dist/utils/network-policy.cjs.map +1 -1
  67. package/dist/utils/network-policy.js +23 -39
  68. package/dist/utils/network-policy.js.map +1 -1
  69. package/dist/utils/paginator.cjs +41 -0
  70. package/dist/utils/paginator.cjs.map +1 -0
  71. package/dist/utils/paginator.d.cts +16 -0
  72. package/dist/utils/paginator.d.ts +16 -0
  73. package/dist/utils/paginator.js +40 -0
  74. package/dist/utils/paginator.js.map +1 -0
  75. package/dist/version.cjs +1 -1
  76. package/dist/version.cjs.map +1 -1
  77. package/dist/version.js +1 -1
  78. package/dist/version.js.map +1 -1
  79. package/package.json +1 -1
package/dist/sandbox.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { SandboxMetaData, SandboxRouteData, SessionMetaData } from "./api-client/validators.js";
2
- import { NetworkPolicy } from "./network-policy.js";
1
+ import { Paginator } from "./utils/paginator.js";
2
+ import { SandboxMetaData, SandboxRouteData, SessionMetaData, SnapshotMetadata } from "./api-client/validators.js";
3
+ import { NetworkPolicy, NetworkPolicyKeyValueMatcher, NetworkPolicyMatch, NetworkPolicyMatcher } from "./network-policy.js";
3
4
  import { WithPrivate } from "./utils/types.js";
4
5
  import { RUNTIMES } from "./constants.js";
5
6
  import { APIClient, WithFetchOptions } from "./api-client/api-client.js";
@@ -9,6 +10,7 @@ import { Command, CommandFinished } from "./command.js";
9
10
  import { Snapshot } from "./snapshot.js";
10
11
  import { SandboxSnapshot } from "./utils/sandbox-snapshot.js";
11
12
  import { RunCommandParams, Session } from "./session.js";
13
+ import { FileSystem } from "./filesystem.js";
12
14
  import { WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE } from "@workflow/serde";
13
15
  import * as zod0 from "zod";
14
16
 
@@ -136,6 +138,23 @@ interface GetSandboxParams {
136
138
  */
137
139
  onResume?: (sandbox: Sandbox) => Promise<void>;
138
140
  }
141
+ /**
142
+ * Extends both {@link BaseCreateSandboxParams} and {@link GetSandboxParams}
143
+ * (minus `name`, which is required on get but optional here) so that any
144
+ * new parameter added to either flow is picked up automatically. The
145
+ * structural overlap on `signal` / `onResume` is intentional — both
146
+ * interfaces declare them with identical optional types.
147
+ * @inline
148
+ */
149
+ interface GetOrCreateSandboxParams extends BaseCreateSandboxParams, Omit<GetSandboxParams, "name"> {
150
+ /**
151
+ * Called once after a sandbox is freshly created (not when an existing
152
+ * sandbox is retrieved). Use this for one-time setup such as seeding
153
+ * files or warming caches. The returned promise is awaited before
154
+ * {@link Sandbox.getOrCreate} resolves.
155
+ */
156
+ onCreate?: (sandbox: Sandbox) => Promise<void>;
157
+ }
139
158
  /**
140
159
  * Serialized representation of a Sandbox for @workflow/serde.
141
160
  * Fields `metadata` and `routes` are the original wire format from main.
@@ -171,6 +190,16 @@ declare class Sandbox {
171
190
  * Hook that will be executed when a new session is created during resume.
172
191
  */
173
192
  private readonly onResume?;
193
+ /**
194
+ * A `node:fs/promises`-compatible API for interacting with the sandbox filesystem.
195
+ *
196
+ * @example
197
+ * const content = await sandbox.fs.readFile('/etc/hostname', 'utf8');
198
+ * await sandbox.fs.writeFile('/tmp/hello.txt', 'Hello, world!');
199
+ * const files = await sandbox.fs.readdir('/tmp');
200
+ * const stats = await sandbox.fs.stat('/tmp/hello.txt');
201
+ */
202
+ readonly fs: FileSystem;
174
203
  /**
175
204
  * Lazily resolve credentials and construct an API client.
176
205
  * @internal
@@ -278,21 +307,30 @@ declare class Sandbox {
278
307
  * Allow to get a list of sandboxes for a team narrowed to the given params.
279
308
  * It returns both the sandboxes and the pagination metadata to allow getting
280
309
  * the next page of results.
281
- */
282
- static list(params?: Partial<Parameters<APIClient["listSandboxes"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<{
310
+ *
311
+ * The returned object is async-iterable to auto-paginate through all pages:
312
+ *
313
+ * ```ts
314
+ * const result = await Sandbox.list({ namePrefix: "ci-" });
315
+ * for await (const sandbox of result) { ... }
316
+ * // or: await result.toArray();
317
+ * // or: for await (const page of result.pages()) { ... }
318
+ * ```
319
+ */
320
+ static list(params?: Partial<Parameters<APIClient["listSandboxes"]>[0]> & Partial<Credentials> & WithFetchOptions): Promise<Paginator<{
283
321
  sandboxes: {
284
322
  status: "aborted" | "pending" | "running" | "stopping" | "stopped" | "failed" | "snapshotting";
285
- name: string;
286
- persistent: boolean;
287
323
  createdAt: number;
288
324
  updatedAt: number;
325
+ name: string;
326
+ persistent: boolean;
289
327
  currentSessionId: string;
290
- tags?: Record<string, string> | undefined;
291
- region?: string | undefined;
292
- vcpus?: number | undefined;
293
328
  memory?: number | undefined;
329
+ vcpus?: number | undefined;
330
+ region?: string | undefined;
294
331
  runtime?: string | undefined;
295
332
  timeout?: number | undefined;
333
+ cwd?: string | undefined;
296
334
  networkPolicy?: zod0.objectInputType<{
297
335
  mode: zod0.ZodLiteral<"allow-all">;
298
336
  }, zod0.ZodTypeAny, "passthrough"> | zod0.objectInputType<{
@@ -306,22 +344,516 @@ declare class Sandbox {
306
344
  domain: zod0.ZodString;
307
345
  headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
308
346
  headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
347
+ match: zod0.ZodOptional<zod0.ZodObject<{
348
+ path: zod0.ZodOptional<zod0.ZodObject<{
349
+ exact: zod0.ZodOptional<zod0.ZodString>;
350
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
351
+ regex: zod0.ZodOptional<zod0.ZodString>;
352
+ }, "strip", zod0.ZodTypeAny, {
353
+ exact?: string | undefined;
354
+ startsWith?: string | undefined;
355
+ regex?: string | undefined;
356
+ }, {
357
+ exact?: string | undefined;
358
+ startsWith?: string | undefined;
359
+ regex?: string | undefined;
360
+ }>>;
361
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
362
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
363
+ key: zod0.ZodOptional<zod0.ZodObject<{
364
+ exact: zod0.ZodOptional<zod0.ZodString>;
365
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
366
+ regex: zod0.ZodOptional<zod0.ZodString>;
367
+ }, "strip", zod0.ZodTypeAny, {
368
+ exact?: string | undefined;
369
+ startsWith?: string | undefined;
370
+ regex?: string | undefined;
371
+ }, {
372
+ exact?: string | undefined;
373
+ startsWith?: string | undefined;
374
+ regex?: string | undefined;
375
+ }>>;
376
+ value: zod0.ZodOptional<zod0.ZodObject<{
377
+ exact: zod0.ZodOptional<zod0.ZodString>;
378
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
379
+ regex: zod0.ZodOptional<zod0.ZodString>;
380
+ }, "strip", zod0.ZodTypeAny, {
381
+ exact?: string | undefined;
382
+ startsWith?: string | undefined;
383
+ regex?: string | undefined;
384
+ }, {
385
+ exact?: string | undefined;
386
+ startsWith?: string | undefined;
387
+ regex?: string | undefined;
388
+ }>>;
389
+ }, "strip", zod0.ZodTypeAny, {
390
+ value?: {
391
+ exact?: string | undefined;
392
+ startsWith?: string | undefined;
393
+ regex?: string | undefined;
394
+ } | undefined;
395
+ key?: {
396
+ exact?: string | undefined;
397
+ startsWith?: string | undefined;
398
+ regex?: string | undefined;
399
+ } | undefined;
400
+ }, {
401
+ value?: {
402
+ exact?: string | undefined;
403
+ startsWith?: string | undefined;
404
+ regex?: string | undefined;
405
+ } | undefined;
406
+ key?: {
407
+ exact?: string | undefined;
408
+ startsWith?: string | undefined;
409
+ regex?: string | undefined;
410
+ } | undefined;
411
+ }>, "many">>;
412
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
413
+ key: zod0.ZodOptional<zod0.ZodObject<{
414
+ exact: zod0.ZodOptional<zod0.ZodString>;
415
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
416
+ regex: zod0.ZodOptional<zod0.ZodString>;
417
+ }, "strip", zod0.ZodTypeAny, {
418
+ exact?: string | undefined;
419
+ startsWith?: string | undefined;
420
+ regex?: string | undefined;
421
+ }, {
422
+ exact?: string | undefined;
423
+ startsWith?: string | undefined;
424
+ regex?: string | undefined;
425
+ }>>;
426
+ value: zod0.ZodOptional<zod0.ZodObject<{
427
+ exact: zod0.ZodOptional<zod0.ZodString>;
428
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
429
+ regex: zod0.ZodOptional<zod0.ZodString>;
430
+ }, "strip", zod0.ZodTypeAny, {
431
+ exact?: string | undefined;
432
+ startsWith?: string | undefined;
433
+ regex?: string | undefined;
434
+ }, {
435
+ exact?: string | undefined;
436
+ startsWith?: string | undefined;
437
+ regex?: string | undefined;
438
+ }>>;
439
+ }, "strip", zod0.ZodTypeAny, {
440
+ value?: {
441
+ exact?: string | undefined;
442
+ startsWith?: string | undefined;
443
+ regex?: string | undefined;
444
+ } | undefined;
445
+ key?: {
446
+ exact?: string | undefined;
447
+ startsWith?: string | undefined;
448
+ regex?: string | undefined;
449
+ } | undefined;
450
+ }, {
451
+ value?: {
452
+ exact?: string | undefined;
453
+ startsWith?: string | undefined;
454
+ regex?: string | undefined;
455
+ } | undefined;
456
+ key?: {
457
+ exact?: string | undefined;
458
+ startsWith?: string | undefined;
459
+ regex?: string | undefined;
460
+ } | undefined;
461
+ }>, "many">>;
462
+ }, "strip", zod0.ZodTypeAny, {
463
+ path?: {
464
+ exact?: string | undefined;
465
+ startsWith?: string | undefined;
466
+ regex?: string | undefined;
467
+ } | undefined;
468
+ headers?: {
469
+ value?: {
470
+ exact?: string | undefined;
471
+ startsWith?: string | undefined;
472
+ regex?: string | undefined;
473
+ } | undefined;
474
+ key?: {
475
+ exact?: string | undefined;
476
+ startsWith?: string | undefined;
477
+ regex?: string | undefined;
478
+ } | undefined;
479
+ }[] | undefined;
480
+ method?: string[] | undefined;
481
+ queryString?: {
482
+ value?: {
483
+ exact?: string | undefined;
484
+ startsWith?: string | undefined;
485
+ regex?: string | undefined;
486
+ } | undefined;
487
+ key?: {
488
+ exact?: string | undefined;
489
+ startsWith?: string | undefined;
490
+ regex?: string | undefined;
491
+ } | undefined;
492
+ }[] | undefined;
493
+ }, {
494
+ path?: {
495
+ exact?: string | undefined;
496
+ startsWith?: string | undefined;
497
+ regex?: string | undefined;
498
+ } | undefined;
499
+ headers?: {
500
+ value?: {
501
+ exact?: string | undefined;
502
+ startsWith?: string | undefined;
503
+ regex?: string | undefined;
504
+ } | undefined;
505
+ key?: {
506
+ exact?: string | undefined;
507
+ startsWith?: string | undefined;
508
+ regex?: string | undefined;
509
+ } | undefined;
510
+ }[] | undefined;
511
+ method?: string[] | undefined;
512
+ queryString?: {
513
+ value?: {
514
+ exact?: string | undefined;
515
+ startsWith?: string | undefined;
516
+ regex?: string | undefined;
517
+ } | undefined;
518
+ key?: {
519
+ exact?: string | undefined;
520
+ startsWith?: string | undefined;
521
+ regex?: string | undefined;
522
+ } | undefined;
523
+ }[] | undefined;
524
+ }>>;
309
525
  }, "strip", zod0.ZodTypeAny, {
310
526
  domain: string;
527
+ match?: {
528
+ path?: {
529
+ exact?: string | undefined;
530
+ startsWith?: string | undefined;
531
+ regex?: string | undefined;
532
+ } | undefined;
533
+ headers?: {
534
+ value?: {
535
+ exact?: string | undefined;
536
+ startsWith?: string | undefined;
537
+ regex?: string | undefined;
538
+ } | undefined;
539
+ key?: {
540
+ exact?: string | undefined;
541
+ startsWith?: string | undefined;
542
+ regex?: string | undefined;
543
+ } | undefined;
544
+ }[] | undefined;
545
+ method?: string[] | undefined;
546
+ queryString?: {
547
+ value?: {
548
+ exact?: string | undefined;
549
+ startsWith?: string | undefined;
550
+ regex?: string | undefined;
551
+ } | undefined;
552
+ key?: {
553
+ exact?: string | undefined;
554
+ startsWith?: string | undefined;
555
+ regex?: string | undefined;
556
+ } | undefined;
557
+ }[] | undefined;
558
+ } | undefined;
311
559
  headers?: Record<string, string> | undefined;
312
560
  headerNames?: string[] | undefined;
313
561
  }, {
314
562
  domain: string;
563
+ match?: {
564
+ path?: {
565
+ exact?: string | undefined;
566
+ startsWith?: string | undefined;
567
+ regex?: string | undefined;
568
+ } | undefined;
569
+ headers?: {
570
+ value?: {
571
+ exact?: string | undefined;
572
+ startsWith?: string | undefined;
573
+ regex?: string | undefined;
574
+ } | undefined;
575
+ key?: {
576
+ exact?: string | undefined;
577
+ startsWith?: string | undefined;
578
+ regex?: string | undefined;
579
+ } | undefined;
580
+ }[] | undefined;
581
+ method?: string[] | undefined;
582
+ queryString?: {
583
+ value?: {
584
+ exact?: string | undefined;
585
+ startsWith?: string | undefined;
586
+ regex?: string | undefined;
587
+ } | undefined;
588
+ key?: {
589
+ exact?: string | undefined;
590
+ startsWith?: string | undefined;
591
+ regex?: string | undefined;
592
+ } | undefined;
593
+ }[] | undefined;
594
+ } | undefined;
315
595
  headers?: Record<string, string> | undefined;
316
596
  headerNames?: string[] | undefined;
317
597
  }>, "many">>;
598
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
599
+ domain: zod0.ZodString;
600
+ forwardURL: zod0.ZodString;
601
+ match: zod0.ZodOptional<zod0.ZodObject<{
602
+ path: zod0.ZodOptional<zod0.ZodObject<{
603
+ exact: zod0.ZodOptional<zod0.ZodString>;
604
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
605
+ regex: zod0.ZodOptional<zod0.ZodString>;
606
+ }, "strip", zod0.ZodTypeAny, {
607
+ exact?: string | undefined;
608
+ startsWith?: string | undefined;
609
+ regex?: string | undefined;
610
+ }, {
611
+ exact?: string | undefined;
612
+ startsWith?: string | undefined;
613
+ regex?: string | undefined;
614
+ }>>;
615
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
616
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
617
+ key: zod0.ZodOptional<zod0.ZodObject<{
618
+ exact: zod0.ZodOptional<zod0.ZodString>;
619
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
620
+ regex: zod0.ZodOptional<zod0.ZodString>;
621
+ }, "strip", zod0.ZodTypeAny, {
622
+ exact?: string | undefined;
623
+ startsWith?: string | undefined;
624
+ regex?: string | undefined;
625
+ }, {
626
+ exact?: string | undefined;
627
+ startsWith?: string | undefined;
628
+ regex?: string | undefined;
629
+ }>>;
630
+ value: zod0.ZodOptional<zod0.ZodObject<{
631
+ exact: zod0.ZodOptional<zod0.ZodString>;
632
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
633
+ regex: zod0.ZodOptional<zod0.ZodString>;
634
+ }, "strip", zod0.ZodTypeAny, {
635
+ exact?: string | undefined;
636
+ startsWith?: string | undefined;
637
+ regex?: string | undefined;
638
+ }, {
639
+ exact?: string | undefined;
640
+ startsWith?: string | undefined;
641
+ regex?: string | undefined;
642
+ }>>;
643
+ }, "strip", zod0.ZodTypeAny, {
644
+ value?: {
645
+ exact?: string | undefined;
646
+ startsWith?: string | undefined;
647
+ regex?: string | undefined;
648
+ } | undefined;
649
+ key?: {
650
+ exact?: string | undefined;
651
+ startsWith?: string | undefined;
652
+ regex?: string | undefined;
653
+ } | undefined;
654
+ }, {
655
+ value?: {
656
+ exact?: string | undefined;
657
+ startsWith?: string | undefined;
658
+ regex?: string | undefined;
659
+ } | undefined;
660
+ key?: {
661
+ exact?: string | undefined;
662
+ startsWith?: string | undefined;
663
+ regex?: string | undefined;
664
+ } | undefined;
665
+ }>, "many">>;
666
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
667
+ key: zod0.ZodOptional<zod0.ZodObject<{
668
+ exact: zod0.ZodOptional<zod0.ZodString>;
669
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
670
+ regex: zod0.ZodOptional<zod0.ZodString>;
671
+ }, "strip", zod0.ZodTypeAny, {
672
+ exact?: string | undefined;
673
+ startsWith?: string | undefined;
674
+ regex?: string | undefined;
675
+ }, {
676
+ exact?: string | undefined;
677
+ startsWith?: string | undefined;
678
+ regex?: string | undefined;
679
+ }>>;
680
+ value: zod0.ZodOptional<zod0.ZodObject<{
681
+ exact: zod0.ZodOptional<zod0.ZodString>;
682
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
683
+ regex: zod0.ZodOptional<zod0.ZodString>;
684
+ }, "strip", zod0.ZodTypeAny, {
685
+ exact?: string | undefined;
686
+ startsWith?: string | undefined;
687
+ regex?: string | undefined;
688
+ }, {
689
+ exact?: string | undefined;
690
+ startsWith?: string | undefined;
691
+ regex?: string | undefined;
692
+ }>>;
693
+ }, "strip", zod0.ZodTypeAny, {
694
+ value?: {
695
+ exact?: string | undefined;
696
+ startsWith?: string | undefined;
697
+ regex?: string | undefined;
698
+ } | undefined;
699
+ key?: {
700
+ exact?: string | undefined;
701
+ startsWith?: string | undefined;
702
+ regex?: string | undefined;
703
+ } | undefined;
704
+ }, {
705
+ value?: {
706
+ exact?: string | undefined;
707
+ startsWith?: string | undefined;
708
+ regex?: string | undefined;
709
+ } | undefined;
710
+ key?: {
711
+ exact?: string | undefined;
712
+ startsWith?: string | undefined;
713
+ regex?: string | undefined;
714
+ } | undefined;
715
+ }>, "many">>;
716
+ }, "strip", zod0.ZodTypeAny, {
717
+ path?: {
718
+ exact?: string | undefined;
719
+ startsWith?: string | undefined;
720
+ regex?: string | undefined;
721
+ } | undefined;
722
+ headers?: {
723
+ value?: {
724
+ exact?: string | undefined;
725
+ startsWith?: string | undefined;
726
+ regex?: string | undefined;
727
+ } | undefined;
728
+ key?: {
729
+ exact?: string | undefined;
730
+ startsWith?: string | undefined;
731
+ regex?: string | undefined;
732
+ } | undefined;
733
+ }[] | undefined;
734
+ method?: string[] | undefined;
735
+ queryString?: {
736
+ value?: {
737
+ exact?: string | undefined;
738
+ startsWith?: string | undefined;
739
+ regex?: string | undefined;
740
+ } | undefined;
741
+ key?: {
742
+ exact?: string | undefined;
743
+ startsWith?: string | undefined;
744
+ regex?: string | undefined;
745
+ } | undefined;
746
+ }[] | undefined;
747
+ }, {
748
+ path?: {
749
+ exact?: string | undefined;
750
+ startsWith?: string | undefined;
751
+ regex?: string | undefined;
752
+ } | undefined;
753
+ headers?: {
754
+ value?: {
755
+ exact?: string | undefined;
756
+ startsWith?: string | undefined;
757
+ regex?: string | undefined;
758
+ } | undefined;
759
+ key?: {
760
+ exact?: string | undefined;
761
+ startsWith?: string | undefined;
762
+ regex?: string | undefined;
763
+ } | undefined;
764
+ }[] | undefined;
765
+ method?: string[] | undefined;
766
+ queryString?: {
767
+ value?: {
768
+ exact?: string | undefined;
769
+ startsWith?: string | undefined;
770
+ regex?: string | undefined;
771
+ } | undefined;
772
+ key?: {
773
+ exact?: string | undefined;
774
+ startsWith?: string | undefined;
775
+ regex?: string | undefined;
776
+ } | undefined;
777
+ }[] | undefined;
778
+ }>>;
779
+ }, "strip", zod0.ZodTypeAny, {
780
+ domain: string;
781
+ forwardURL: string;
782
+ match?: {
783
+ path?: {
784
+ exact?: string | undefined;
785
+ startsWith?: string | undefined;
786
+ regex?: string | undefined;
787
+ } | undefined;
788
+ headers?: {
789
+ value?: {
790
+ exact?: string | undefined;
791
+ startsWith?: string | undefined;
792
+ regex?: string | undefined;
793
+ } | undefined;
794
+ key?: {
795
+ exact?: string | undefined;
796
+ startsWith?: string | undefined;
797
+ regex?: string | undefined;
798
+ } | undefined;
799
+ }[] | undefined;
800
+ method?: string[] | undefined;
801
+ queryString?: {
802
+ value?: {
803
+ exact?: string | undefined;
804
+ startsWith?: string | undefined;
805
+ regex?: string | undefined;
806
+ } | undefined;
807
+ key?: {
808
+ exact?: string | undefined;
809
+ startsWith?: string | undefined;
810
+ regex?: string | undefined;
811
+ } | undefined;
812
+ }[] | undefined;
813
+ } | undefined;
814
+ }, {
815
+ domain: string;
816
+ forwardURL: string;
817
+ match?: {
818
+ path?: {
819
+ exact?: string | undefined;
820
+ startsWith?: string | undefined;
821
+ regex?: string | undefined;
822
+ } | undefined;
823
+ headers?: {
824
+ value?: {
825
+ exact?: string | undefined;
826
+ startsWith?: string | undefined;
827
+ regex?: string | undefined;
828
+ } | undefined;
829
+ key?: {
830
+ exact?: string | undefined;
831
+ startsWith?: string | undefined;
832
+ regex?: string | undefined;
833
+ } | undefined;
834
+ }[] | undefined;
835
+ method?: string[] | undefined;
836
+ queryString?: {
837
+ value?: {
838
+ exact?: string | undefined;
839
+ startsWith?: string | undefined;
840
+ regex?: string | undefined;
841
+ } | undefined;
842
+ key?: {
843
+ exact?: string | undefined;
844
+ startsWith?: string | undefined;
845
+ regex?: string | undefined;
846
+ } | undefined;
847
+ }[] | undefined;
848
+ } | undefined;
849
+ }>, "many">>;
318
850
  }, zod0.ZodTypeAny, "passthrough"> | undefined;
851
+ tags?: Record<string, string> | undefined;
319
852
  totalEgressBytes?: number | undefined;
320
853
  totalIngressBytes?: number | undefined;
321
854
  totalActiveCpuDurationMs?: number | undefined;
322
855
  totalDurationMs?: number | undefined;
323
856
  currentSnapshotId?: string | undefined;
324
- cwd?: string | undefined;
325
857
  statusUpdatedAt?: number | undefined;
326
858
  snapshotExpiration?: number | undefined;
327
859
  }[];
@@ -329,7 +861,7 @@ declare class Sandbox {
329
861
  count: number;
330
862
  next: string | null;
331
863
  };
332
- }>;
864
+ }, "sandboxes">>;
333
865
  /**
334
866
  * Serialize a Sandbox instance to plain data for @workflow/serde.
335
867
  *
@@ -371,6 +903,38 @@ declare class Sandbox {
371
903
  * @returns A promise resolving to the {@link Sandbox}.
372
904
  */
373
905
  static get(params: WithPrivate<GetSandboxParams | (GetSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
906
+ /**
907
+ * Retrieve an existing named sandbox, or create a new one if none exists.
908
+ *
909
+ * If `name` is omitted, this always creates a new sandbox and fires
910
+ * `onCreate`. If `name` is provided, it first tries {@link Sandbox.get};
911
+ * on `not_found` it creates a new sandbox with that name; on
912
+ * `snapshot_not_found` it deletes the stale named sandbox and creates
913
+ * a fresh one with the same name.
914
+ *
915
+ * @param params - Get/create parameters plus an optional `onCreate` hook.
916
+ * @returns A promise resolving to the {@link Sandbox}.
917
+ *
918
+ * @example
919
+ * <caption>Idempotent named sandbox with one-time setup</caption>
920
+ * const sandbox = await Sandbox.getOrCreate({
921
+ * name: "my-workspace",
922
+ * onCreate: async (sbx) => {
923
+ * await sbx.writeFiles([
924
+ * { path: "README.md", content: Buffer.from("# Hello") },
925
+ * ]);
926
+ * },
927
+ * });
928
+ *
929
+ * @example
930
+ * <caption>Unnamed — always creates</caption>
931
+ * const sandbox = await Sandbox.getOrCreate({
932
+ * onCreate: async (sbx) => {
933
+ * await sbx.runCommand("npm", ["install"]);
934
+ * },
935
+ * });
936
+ */
937
+ static getOrCreate(params?: WithPrivate<GetOrCreateSandboxParams | (GetOrCreateSandboxParams & Credentials)> & WithFetchOptions): Promise<Sandbox>;
374
938
  /**
375
939
  * Create a new Sandbox instance.
376
940
  *
@@ -544,13 +1108,13 @@ declare class Sandbox {
544
1108
  *
545
1109
  * @param opts - Optional parameters.
546
1110
  * @param opts.signal - An AbortSignal to cancel the operation.
547
- * @param opts.blocking - If true, poll until the sandbox has fully stopped and return the final state.
548
- * @returns The sandbox at the time the stop was acknowledged, or after fully stopped if `blocking` is true.
1111
+ * @returns The final session state after stopping, with optional snapshot metadata.
549
1112
  */
550
1113
  stop(opts?: {
551
1114
  signal?: AbortSignal;
552
- blocking?: boolean;
553
- }): Promise<SandboxSnapshot>;
1115
+ }): Promise<SandboxSnapshot & {
1116
+ snapshot?: SnapshotMetadata;
1117
+ }>;
554
1118
  /**
555
1119
  * Update the network policy for this sandbox.
556
1120
  *
@@ -636,6 +1200,7 @@ declare class Sandbox {
636
1200
  networkPolicy?: NetworkPolicy;
637
1201
  tags?: Record<string, string>;
638
1202
  snapshotExpiration?: number;
1203
+ currentSnapshotId?: string;
639
1204
  }, opts?: {
640
1205
  signal?: AbortSignal;
641
1206
  }): Promise<void>;
@@ -659,7 +1224,7 @@ declare class Sandbox {
659
1224
  cursor?: string;
660
1225
  sortOrder?: "asc" | "desc";
661
1226
  signal?: AbortSignal;
662
- }): Promise<{
1227
+ }): Promise<Paginator<{
663
1228
  pagination: {
664
1229
  count: number;
665
1230
  next: string | null;
@@ -684,7 +1249,7 @@ declare class Sandbox {
684
1249
  cwd: zod0.ZodString;
685
1250
  updatedAt: zod0.ZodNumber;
686
1251
  interactivePort: zod0.ZodOptional<zod0.ZodNumber>;
687
- networkPolicy: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodObject<{
1252
+ networkPolicy: zod0.ZodOptional<zod0.ZodUnion<[zod0.ZodUnion<[zod0.ZodObject<{
688
1253
  mode: zod0.ZodLiteral<"allow-all">;
689
1254
  }, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
690
1255
  mode: zod0.ZodLiteral<"allow-all">;
@@ -696,7 +1261,7 @@ declare class Sandbox {
696
1261
  mode: zod0.ZodLiteral<"deny-all">;
697
1262
  }, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
698
1263
  mode: zod0.ZodLiteral<"deny-all">;
699
- }, zod0.ZodTypeAny, "passthrough">>, zod0.ZodObject<{
1264
+ }, zod0.ZodTypeAny, "passthrough">>]>, zod0.ZodObject<{
700
1265
  mode: zod0.ZodLiteral<"custom">;
701
1266
  allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
702
1267
  allowedCIDRs: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
@@ -705,15 +1270,509 @@ declare class Sandbox {
705
1270
  domain: zod0.ZodString;
706
1271
  headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
707
1272
  headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1273
+ match: zod0.ZodOptional<zod0.ZodObject<{
1274
+ path: zod0.ZodOptional<zod0.ZodObject<{
1275
+ exact: zod0.ZodOptional<zod0.ZodString>;
1276
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1277
+ regex: zod0.ZodOptional<zod0.ZodString>;
1278
+ }, "strip", zod0.ZodTypeAny, {
1279
+ exact?: string | undefined;
1280
+ startsWith?: string | undefined;
1281
+ regex?: string | undefined;
1282
+ }, {
1283
+ exact?: string | undefined;
1284
+ startsWith?: string | undefined;
1285
+ regex?: string | undefined;
1286
+ }>>;
1287
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1288
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1289
+ key: zod0.ZodOptional<zod0.ZodObject<{
1290
+ exact: zod0.ZodOptional<zod0.ZodString>;
1291
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1292
+ regex: zod0.ZodOptional<zod0.ZodString>;
1293
+ }, "strip", zod0.ZodTypeAny, {
1294
+ exact?: string | undefined;
1295
+ startsWith?: string | undefined;
1296
+ regex?: string | undefined;
1297
+ }, {
1298
+ exact?: string | undefined;
1299
+ startsWith?: string | undefined;
1300
+ regex?: string | undefined;
1301
+ }>>;
1302
+ value: zod0.ZodOptional<zod0.ZodObject<{
1303
+ exact: zod0.ZodOptional<zod0.ZodString>;
1304
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1305
+ regex: zod0.ZodOptional<zod0.ZodString>;
1306
+ }, "strip", zod0.ZodTypeAny, {
1307
+ exact?: string | undefined;
1308
+ startsWith?: string | undefined;
1309
+ regex?: string | undefined;
1310
+ }, {
1311
+ exact?: string | undefined;
1312
+ startsWith?: string | undefined;
1313
+ regex?: string | undefined;
1314
+ }>>;
1315
+ }, "strip", zod0.ZodTypeAny, {
1316
+ value?: {
1317
+ exact?: string | undefined;
1318
+ startsWith?: string | undefined;
1319
+ regex?: string | undefined;
1320
+ } | undefined;
1321
+ key?: {
1322
+ exact?: string | undefined;
1323
+ startsWith?: string | undefined;
1324
+ regex?: string | undefined;
1325
+ } | undefined;
1326
+ }, {
1327
+ value?: {
1328
+ exact?: string | undefined;
1329
+ startsWith?: string | undefined;
1330
+ regex?: string | undefined;
1331
+ } | undefined;
1332
+ key?: {
1333
+ exact?: string | undefined;
1334
+ startsWith?: string | undefined;
1335
+ regex?: string | undefined;
1336
+ } | undefined;
1337
+ }>, "many">>;
1338
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1339
+ key: zod0.ZodOptional<zod0.ZodObject<{
1340
+ exact: zod0.ZodOptional<zod0.ZodString>;
1341
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1342
+ regex: zod0.ZodOptional<zod0.ZodString>;
1343
+ }, "strip", zod0.ZodTypeAny, {
1344
+ exact?: string | undefined;
1345
+ startsWith?: string | undefined;
1346
+ regex?: string | undefined;
1347
+ }, {
1348
+ exact?: string | undefined;
1349
+ startsWith?: string | undefined;
1350
+ regex?: string | undefined;
1351
+ }>>;
1352
+ value: zod0.ZodOptional<zod0.ZodObject<{
1353
+ exact: zod0.ZodOptional<zod0.ZodString>;
1354
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1355
+ regex: zod0.ZodOptional<zod0.ZodString>;
1356
+ }, "strip", zod0.ZodTypeAny, {
1357
+ exact?: string | undefined;
1358
+ startsWith?: string | undefined;
1359
+ regex?: string | undefined;
1360
+ }, {
1361
+ exact?: string | undefined;
1362
+ startsWith?: string | undefined;
1363
+ regex?: string | undefined;
1364
+ }>>;
1365
+ }, "strip", zod0.ZodTypeAny, {
1366
+ value?: {
1367
+ exact?: string | undefined;
1368
+ startsWith?: string | undefined;
1369
+ regex?: string | undefined;
1370
+ } | undefined;
1371
+ key?: {
1372
+ exact?: string | undefined;
1373
+ startsWith?: string | undefined;
1374
+ regex?: string | undefined;
1375
+ } | undefined;
1376
+ }, {
1377
+ value?: {
1378
+ exact?: string | undefined;
1379
+ startsWith?: string | undefined;
1380
+ regex?: string | undefined;
1381
+ } | undefined;
1382
+ key?: {
1383
+ exact?: string | undefined;
1384
+ startsWith?: string | undefined;
1385
+ regex?: string | undefined;
1386
+ } | undefined;
1387
+ }>, "many">>;
1388
+ }, "strip", zod0.ZodTypeAny, {
1389
+ path?: {
1390
+ exact?: string | undefined;
1391
+ startsWith?: string | undefined;
1392
+ regex?: string | undefined;
1393
+ } | undefined;
1394
+ headers?: {
1395
+ value?: {
1396
+ exact?: string | undefined;
1397
+ startsWith?: string | undefined;
1398
+ regex?: string | undefined;
1399
+ } | undefined;
1400
+ key?: {
1401
+ exact?: string | undefined;
1402
+ startsWith?: string | undefined;
1403
+ regex?: string | undefined;
1404
+ } | undefined;
1405
+ }[] | undefined;
1406
+ method?: string[] | undefined;
1407
+ queryString?: {
1408
+ value?: {
1409
+ exact?: string | undefined;
1410
+ startsWith?: string | undefined;
1411
+ regex?: string | undefined;
1412
+ } | undefined;
1413
+ key?: {
1414
+ exact?: string | undefined;
1415
+ startsWith?: string | undefined;
1416
+ regex?: string | undefined;
1417
+ } | undefined;
1418
+ }[] | undefined;
1419
+ }, {
1420
+ path?: {
1421
+ exact?: string | undefined;
1422
+ startsWith?: string | undefined;
1423
+ regex?: string | undefined;
1424
+ } | undefined;
1425
+ headers?: {
1426
+ value?: {
1427
+ exact?: string | undefined;
1428
+ startsWith?: string | undefined;
1429
+ regex?: string | undefined;
1430
+ } | undefined;
1431
+ key?: {
1432
+ exact?: string | undefined;
1433
+ startsWith?: string | undefined;
1434
+ regex?: string | undefined;
1435
+ } | undefined;
1436
+ }[] | undefined;
1437
+ method?: string[] | undefined;
1438
+ queryString?: {
1439
+ value?: {
1440
+ exact?: string | undefined;
1441
+ startsWith?: string | undefined;
1442
+ regex?: string | undefined;
1443
+ } | undefined;
1444
+ key?: {
1445
+ exact?: string | undefined;
1446
+ startsWith?: string | undefined;
1447
+ regex?: string | undefined;
1448
+ } | undefined;
1449
+ }[] | undefined;
1450
+ }>>;
708
1451
  }, "strip", zod0.ZodTypeAny, {
709
1452
  domain: string;
1453
+ match?: {
1454
+ path?: {
1455
+ exact?: string | undefined;
1456
+ startsWith?: string | undefined;
1457
+ regex?: string | undefined;
1458
+ } | undefined;
1459
+ headers?: {
1460
+ value?: {
1461
+ exact?: string | undefined;
1462
+ startsWith?: string | undefined;
1463
+ regex?: string | undefined;
1464
+ } | undefined;
1465
+ key?: {
1466
+ exact?: string | undefined;
1467
+ startsWith?: string | undefined;
1468
+ regex?: string | undefined;
1469
+ } | undefined;
1470
+ }[] | undefined;
1471
+ method?: string[] | undefined;
1472
+ queryString?: {
1473
+ value?: {
1474
+ exact?: string | undefined;
1475
+ startsWith?: string | undefined;
1476
+ regex?: string | undefined;
1477
+ } | undefined;
1478
+ key?: {
1479
+ exact?: string | undefined;
1480
+ startsWith?: string | undefined;
1481
+ regex?: string | undefined;
1482
+ } | undefined;
1483
+ }[] | undefined;
1484
+ } | undefined;
710
1485
  headers?: Record<string, string> | undefined;
711
1486
  headerNames?: string[] | undefined;
712
1487
  }, {
713
1488
  domain: string;
1489
+ match?: {
1490
+ path?: {
1491
+ exact?: string | undefined;
1492
+ startsWith?: string | undefined;
1493
+ regex?: string | undefined;
1494
+ } | undefined;
1495
+ headers?: {
1496
+ value?: {
1497
+ exact?: string | undefined;
1498
+ startsWith?: string | undefined;
1499
+ regex?: string | undefined;
1500
+ } | undefined;
1501
+ key?: {
1502
+ exact?: string | undefined;
1503
+ startsWith?: string | undefined;
1504
+ regex?: string | undefined;
1505
+ } | undefined;
1506
+ }[] | undefined;
1507
+ method?: string[] | undefined;
1508
+ queryString?: {
1509
+ value?: {
1510
+ exact?: string | undefined;
1511
+ startsWith?: string | undefined;
1512
+ regex?: string | undefined;
1513
+ } | undefined;
1514
+ key?: {
1515
+ exact?: string | undefined;
1516
+ startsWith?: string | undefined;
1517
+ regex?: string | undefined;
1518
+ } | undefined;
1519
+ }[] | undefined;
1520
+ } | undefined;
714
1521
  headers?: Record<string, string> | undefined;
715
1522
  headerNames?: string[] | undefined;
716
1523
  }>, "many">>;
1524
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1525
+ domain: zod0.ZodString;
1526
+ forwardURL: zod0.ZodString;
1527
+ match: zod0.ZodOptional<zod0.ZodObject<{
1528
+ path: zod0.ZodOptional<zod0.ZodObject<{
1529
+ exact: zod0.ZodOptional<zod0.ZodString>;
1530
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1531
+ regex: zod0.ZodOptional<zod0.ZodString>;
1532
+ }, "strip", zod0.ZodTypeAny, {
1533
+ exact?: string | undefined;
1534
+ startsWith?: string | undefined;
1535
+ regex?: string | undefined;
1536
+ }, {
1537
+ exact?: string | undefined;
1538
+ startsWith?: string | undefined;
1539
+ regex?: string | undefined;
1540
+ }>>;
1541
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1542
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1543
+ key: zod0.ZodOptional<zod0.ZodObject<{
1544
+ exact: zod0.ZodOptional<zod0.ZodString>;
1545
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1546
+ regex: zod0.ZodOptional<zod0.ZodString>;
1547
+ }, "strip", zod0.ZodTypeAny, {
1548
+ exact?: string | undefined;
1549
+ startsWith?: string | undefined;
1550
+ regex?: string | undefined;
1551
+ }, {
1552
+ exact?: string | undefined;
1553
+ startsWith?: string | undefined;
1554
+ regex?: string | undefined;
1555
+ }>>;
1556
+ value: zod0.ZodOptional<zod0.ZodObject<{
1557
+ exact: zod0.ZodOptional<zod0.ZodString>;
1558
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1559
+ regex: zod0.ZodOptional<zod0.ZodString>;
1560
+ }, "strip", zod0.ZodTypeAny, {
1561
+ exact?: string | undefined;
1562
+ startsWith?: string | undefined;
1563
+ regex?: string | undefined;
1564
+ }, {
1565
+ exact?: string | undefined;
1566
+ startsWith?: string | undefined;
1567
+ regex?: string | undefined;
1568
+ }>>;
1569
+ }, "strip", zod0.ZodTypeAny, {
1570
+ value?: {
1571
+ exact?: string | undefined;
1572
+ startsWith?: string | undefined;
1573
+ regex?: string | undefined;
1574
+ } | undefined;
1575
+ key?: {
1576
+ exact?: string | undefined;
1577
+ startsWith?: string | undefined;
1578
+ regex?: string | undefined;
1579
+ } | undefined;
1580
+ }, {
1581
+ value?: {
1582
+ exact?: string | undefined;
1583
+ startsWith?: string | undefined;
1584
+ regex?: string | undefined;
1585
+ } | undefined;
1586
+ key?: {
1587
+ exact?: string | undefined;
1588
+ startsWith?: string | undefined;
1589
+ regex?: string | undefined;
1590
+ } | undefined;
1591
+ }>, "many">>;
1592
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1593
+ key: zod0.ZodOptional<zod0.ZodObject<{
1594
+ exact: zod0.ZodOptional<zod0.ZodString>;
1595
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1596
+ regex: zod0.ZodOptional<zod0.ZodString>;
1597
+ }, "strip", zod0.ZodTypeAny, {
1598
+ exact?: string | undefined;
1599
+ startsWith?: string | undefined;
1600
+ regex?: string | undefined;
1601
+ }, {
1602
+ exact?: string | undefined;
1603
+ startsWith?: string | undefined;
1604
+ regex?: string | undefined;
1605
+ }>>;
1606
+ value: zod0.ZodOptional<zod0.ZodObject<{
1607
+ exact: zod0.ZodOptional<zod0.ZodString>;
1608
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1609
+ regex: zod0.ZodOptional<zod0.ZodString>;
1610
+ }, "strip", zod0.ZodTypeAny, {
1611
+ exact?: string | undefined;
1612
+ startsWith?: string | undefined;
1613
+ regex?: string | undefined;
1614
+ }, {
1615
+ exact?: string | undefined;
1616
+ startsWith?: string | undefined;
1617
+ regex?: string | undefined;
1618
+ }>>;
1619
+ }, "strip", zod0.ZodTypeAny, {
1620
+ value?: {
1621
+ exact?: string | undefined;
1622
+ startsWith?: string | undefined;
1623
+ regex?: string | undefined;
1624
+ } | undefined;
1625
+ key?: {
1626
+ exact?: string | undefined;
1627
+ startsWith?: string | undefined;
1628
+ regex?: string | undefined;
1629
+ } | undefined;
1630
+ }, {
1631
+ value?: {
1632
+ exact?: string | undefined;
1633
+ startsWith?: string | undefined;
1634
+ regex?: string | undefined;
1635
+ } | undefined;
1636
+ key?: {
1637
+ exact?: string | undefined;
1638
+ startsWith?: string | undefined;
1639
+ regex?: string | undefined;
1640
+ } | undefined;
1641
+ }>, "many">>;
1642
+ }, "strip", zod0.ZodTypeAny, {
1643
+ path?: {
1644
+ exact?: string | undefined;
1645
+ startsWith?: string | undefined;
1646
+ regex?: string | undefined;
1647
+ } | undefined;
1648
+ headers?: {
1649
+ value?: {
1650
+ exact?: string | undefined;
1651
+ startsWith?: string | undefined;
1652
+ regex?: string | undefined;
1653
+ } | undefined;
1654
+ key?: {
1655
+ exact?: string | undefined;
1656
+ startsWith?: string | undefined;
1657
+ regex?: string | undefined;
1658
+ } | undefined;
1659
+ }[] | undefined;
1660
+ method?: string[] | undefined;
1661
+ queryString?: {
1662
+ value?: {
1663
+ exact?: string | undefined;
1664
+ startsWith?: string | undefined;
1665
+ regex?: string | undefined;
1666
+ } | undefined;
1667
+ key?: {
1668
+ exact?: string | undefined;
1669
+ startsWith?: string | undefined;
1670
+ regex?: string | undefined;
1671
+ } | undefined;
1672
+ }[] | undefined;
1673
+ }, {
1674
+ path?: {
1675
+ exact?: string | undefined;
1676
+ startsWith?: string | undefined;
1677
+ regex?: string | undefined;
1678
+ } | undefined;
1679
+ headers?: {
1680
+ value?: {
1681
+ exact?: string | undefined;
1682
+ startsWith?: string | undefined;
1683
+ regex?: string | undefined;
1684
+ } | undefined;
1685
+ key?: {
1686
+ exact?: string | undefined;
1687
+ startsWith?: string | undefined;
1688
+ regex?: string | undefined;
1689
+ } | undefined;
1690
+ }[] | undefined;
1691
+ method?: string[] | undefined;
1692
+ queryString?: {
1693
+ value?: {
1694
+ exact?: string | undefined;
1695
+ startsWith?: string | undefined;
1696
+ regex?: string | undefined;
1697
+ } | undefined;
1698
+ key?: {
1699
+ exact?: string | undefined;
1700
+ startsWith?: string | undefined;
1701
+ regex?: string | undefined;
1702
+ } | undefined;
1703
+ }[] | undefined;
1704
+ }>>;
1705
+ }, "strip", zod0.ZodTypeAny, {
1706
+ domain: string;
1707
+ forwardURL: string;
1708
+ match?: {
1709
+ path?: {
1710
+ exact?: string | undefined;
1711
+ startsWith?: string | undefined;
1712
+ regex?: string | undefined;
1713
+ } | undefined;
1714
+ headers?: {
1715
+ value?: {
1716
+ exact?: string | undefined;
1717
+ startsWith?: string | undefined;
1718
+ regex?: string | undefined;
1719
+ } | undefined;
1720
+ key?: {
1721
+ exact?: string | undefined;
1722
+ startsWith?: string | undefined;
1723
+ regex?: string | undefined;
1724
+ } | undefined;
1725
+ }[] | undefined;
1726
+ method?: string[] | undefined;
1727
+ queryString?: {
1728
+ value?: {
1729
+ exact?: string | undefined;
1730
+ startsWith?: string | undefined;
1731
+ regex?: string | undefined;
1732
+ } | undefined;
1733
+ key?: {
1734
+ exact?: string | undefined;
1735
+ startsWith?: string | undefined;
1736
+ regex?: string | undefined;
1737
+ } | undefined;
1738
+ }[] | undefined;
1739
+ } | undefined;
1740
+ }, {
1741
+ domain: string;
1742
+ forwardURL: string;
1743
+ match?: {
1744
+ path?: {
1745
+ exact?: string | undefined;
1746
+ startsWith?: string | undefined;
1747
+ regex?: string | undefined;
1748
+ } | undefined;
1749
+ headers?: {
1750
+ value?: {
1751
+ exact?: string | undefined;
1752
+ startsWith?: string | undefined;
1753
+ regex?: string | undefined;
1754
+ } | undefined;
1755
+ key?: {
1756
+ exact?: string | undefined;
1757
+ startsWith?: string | undefined;
1758
+ regex?: string | undefined;
1759
+ } | undefined;
1760
+ }[] | undefined;
1761
+ method?: string[] | undefined;
1762
+ queryString?: {
1763
+ value?: {
1764
+ exact?: string | undefined;
1765
+ startsWith?: string | undefined;
1766
+ regex?: string | undefined;
1767
+ } | undefined;
1768
+ key?: {
1769
+ exact?: string | undefined;
1770
+ startsWith?: string | undefined;
1771
+ regex?: string | undefined;
1772
+ } | undefined;
1773
+ }[] | undefined;
1774
+ } | undefined;
1775
+ }>, "many">>;
717
1776
  }, "passthrough", zod0.ZodTypeAny, zod0.objectOutputType<{
718
1777
  mode: zod0.ZodLiteral<"custom">;
719
1778
  allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
@@ -723,15 +1782,509 @@ declare class Sandbox {
723
1782
  domain: zod0.ZodString;
724
1783
  headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
725
1784
  headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1785
+ match: zod0.ZodOptional<zod0.ZodObject<{
1786
+ path: zod0.ZodOptional<zod0.ZodObject<{
1787
+ exact: zod0.ZodOptional<zod0.ZodString>;
1788
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1789
+ regex: zod0.ZodOptional<zod0.ZodString>;
1790
+ }, "strip", zod0.ZodTypeAny, {
1791
+ exact?: string | undefined;
1792
+ startsWith?: string | undefined;
1793
+ regex?: string | undefined;
1794
+ }, {
1795
+ exact?: string | undefined;
1796
+ startsWith?: string | undefined;
1797
+ regex?: string | undefined;
1798
+ }>>;
1799
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
1800
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1801
+ key: zod0.ZodOptional<zod0.ZodObject<{
1802
+ exact: zod0.ZodOptional<zod0.ZodString>;
1803
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1804
+ regex: zod0.ZodOptional<zod0.ZodString>;
1805
+ }, "strip", zod0.ZodTypeAny, {
1806
+ exact?: string | undefined;
1807
+ startsWith?: string | undefined;
1808
+ regex?: string | undefined;
1809
+ }, {
1810
+ exact?: string | undefined;
1811
+ startsWith?: string | undefined;
1812
+ regex?: string | undefined;
1813
+ }>>;
1814
+ value: zod0.ZodOptional<zod0.ZodObject<{
1815
+ exact: zod0.ZodOptional<zod0.ZodString>;
1816
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1817
+ regex: zod0.ZodOptional<zod0.ZodString>;
1818
+ }, "strip", zod0.ZodTypeAny, {
1819
+ exact?: string | undefined;
1820
+ startsWith?: string | undefined;
1821
+ regex?: string | undefined;
1822
+ }, {
1823
+ exact?: string | undefined;
1824
+ startsWith?: string | undefined;
1825
+ regex?: string | undefined;
1826
+ }>>;
1827
+ }, "strip", zod0.ZodTypeAny, {
1828
+ value?: {
1829
+ exact?: string | undefined;
1830
+ startsWith?: string | undefined;
1831
+ regex?: string | undefined;
1832
+ } | undefined;
1833
+ key?: {
1834
+ exact?: string | undefined;
1835
+ startsWith?: string | undefined;
1836
+ regex?: string | undefined;
1837
+ } | undefined;
1838
+ }, {
1839
+ value?: {
1840
+ exact?: string | undefined;
1841
+ startsWith?: string | undefined;
1842
+ regex?: string | undefined;
1843
+ } | undefined;
1844
+ key?: {
1845
+ exact?: string | undefined;
1846
+ startsWith?: string | undefined;
1847
+ regex?: string | undefined;
1848
+ } | undefined;
1849
+ }>, "many">>;
1850
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
1851
+ key: zod0.ZodOptional<zod0.ZodObject<{
1852
+ exact: zod0.ZodOptional<zod0.ZodString>;
1853
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1854
+ regex: zod0.ZodOptional<zod0.ZodString>;
1855
+ }, "strip", zod0.ZodTypeAny, {
1856
+ exact?: string | undefined;
1857
+ startsWith?: string | undefined;
1858
+ regex?: string | undefined;
1859
+ }, {
1860
+ exact?: string | undefined;
1861
+ startsWith?: string | undefined;
1862
+ regex?: string | undefined;
1863
+ }>>;
1864
+ value: zod0.ZodOptional<zod0.ZodObject<{
1865
+ exact: zod0.ZodOptional<zod0.ZodString>;
1866
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
1867
+ regex: zod0.ZodOptional<zod0.ZodString>;
1868
+ }, "strip", zod0.ZodTypeAny, {
1869
+ exact?: string | undefined;
1870
+ startsWith?: string | undefined;
1871
+ regex?: string | undefined;
1872
+ }, {
1873
+ exact?: string | undefined;
1874
+ startsWith?: string | undefined;
1875
+ regex?: string | undefined;
1876
+ }>>;
1877
+ }, "strip", zod0.ZodTypeAny, {
1878
+ value?: {
1879
+ exact?: string | undefined;
1880
+ startsWith?: string | undefined;
1881
+ regex?: string | undefined;
1882
+ } | undefined;
1883
+ key?: {
1884
+ exact?: string | undefined;
1885
+ startsWith?: string | undefined;
1886
+ regex?: string | undefined;
1887
+ } | undefined;
1888
+ }, {
1889
+ value?: {
1890
+ exact?: string | undefined;
1891
+ startsWith?: string | undefined;
1892
+ regex?: string | undefined;
1893
+ } | undefined;
1894
+ key?: {
1895
+ exact?: string | undefined;
1896
+ startsWith?: string | undefined;
1897
+ regex?: string | undefined;
1898
+ } | undefined;
1899
+ }>, "many">>;
1900
+ }, "strip", zod0.ZodTypeAny, {
1901
+ path?: {
1902
+ exact?: string | undefined;
1903
+ startsWith?: string | undefined;
1904
+ regex?: string | undefined;
1905
+ } | undefined;
1906
+ headers?: {
1907
+ value?: {
1908
+ exact?: string | undefined;
1909
+ startsWith?: string | undefined;
1910
+ regex?: string | undefined;
1911
+ } | undefined;
1912
+ key?: {
1913
+ exact?: string | undefined;
1914
+ startsWith?: string | undefined;
1915
+ regex?: string | undefined;
1916
+ } | undefined;
1917
+ }[] | undefined;
1918
+ method?: string[] | undefined;
1919
+ queryString?: {
1920
+ value?: {
1921
+ exact?: string | undefined;
1922
+ startsWith?: string | undefined;
1923
+ regex?: string | undefined;
1924
+ } | undefined;
1925
+ key?: {
1926
+ exact?: string | undefined;
1927
+ startsWith?: string | undefined;
1928
+ regex?: string | undefined;
1929
+ } | undefined;
1930
+ }[] | undefined;
1931
+ }, {
1932
+ path?: {
1933
+ exact?: string | undefined;
1934
+ startsWith?: string | undefined;
1935
+ regex?: string | undefined;
1936
+ } | undefined;
1937
+ headers?: {
1938
+ value?: {
1939
+ exact?: string | undefined;
1940
+ startsWith?: string | undefined;
1941
+ regex?: string | undefined;
1942
+ } | undefined;
1943
+ key?: {
1944
+ exact?: string | undefined;
1945
+ startsWith?: string | undefined;
1946
+ regex?: string | undefined;
1947
+ } | undefined;
1948
+ }[] | undefined;
1949
+ method?: string[] | undefined;
1950
+ queryString?: {
1951
+ value?: {
1952
+ exact?: string | undefined;
1953
+ startsWith?: string | undefined;
1954
+ regex?: string | undefined;
1955
+ } | undefined;
1956
+ key?: {
1957
+ exact?: string | undefined;
1958
+ startsWith?: string | undefined;
1959
+ regex?: string | undefined;
1960
+ } | undefined;
1961
+ }[] | undefined;
1962
+ }>>;
726
1963
  }, "strip", zod0.ZodTypeAny, {
727
1964
  domain: string;
1965
+ match?: {
1966
+ path?: {
1967
+ exact?: string | undefined;
1968
+ startsWith?: string | undefined;
1969
+ regex?: string | undefined;
1970
+ } | undefined;
1971
+ headers?: {
1972
+ value?: {
1973
+ exact?: string | undefined;
1974
+ startsWith?: string | undefined;
1975
+ regex?: string | undefined;
1976
+ } | undefined;
1977
+ key?: {
1978
+ exact?: string | undefined;
1979
+ startsWith?: string | undefined;
1980
+ regex?: string | undefined;
1981
+ } | undefined;
1982
+ }[] | undefined;
1983
+ method?: string[] | undefined;
1984
+ queryString?: {
1985
+ value?: {
1986
+ exact?: string | undefined;
1987
+ startsWith?: string | undefined;
1988
+ regex?: string | undefined;
1989
+ } | undefined;
1990
+ key?: {
1991
+ exact?: string | undefined;
1992
+ startsWith?: string | undefined;
1993
+ regex?: string | undefined;
1994
+ } | undefined;
1995
+ }[] | undefined;
1996
+ } | undefined;
728
1997
  headers?: Record<string, string> | undefined;
729
1998
  headerNames?: string[] | undefined;
730
1999
  }, {
731
2000
  domain: string;
2001
+ match?: {
2002
+ path?: {
2003
+ exact?: string | undefined;
2004
+ startsWith?: string | undefined;
2005
+ regex?: string | undefined;
2006
+ } | undefined;
2007
+ headers?: {
2008
+ value?: {
2009
+ exact?: string | undefined;
2010
+ startsWith?: string | undefined;
2011
+ regex?: string | undefined;
2012
+ } | undefined;
2013
+ key?: {
2014
+ exact?: string | undefined;
2015
+ startsWith?: string | undefined;
2016
+ regex?: string | undefined;
2017
+ } | undefined;
2018
+ }[] | undefined;
2019
+ method?: string[] | undefined;
2020
+ queryString?: {
2021
+ value?: {
2022
+ exact?: string | undefined;
2023
+ startsWith?: string | undefined;
2024
+ regex?: string | undefined;
2025
+ } | undefined;
2026
+ key?: {
2027
+ exact?: string | undefined;
2028
+ startsWith?: string | undefined;
2029
+ regex?: string | undefined;
2030
+ } | undefined;
2031
+ }[] | undefined;
2032
+ } | undefined;
732
2033
  headers?: Record<string, string> | undefined;
733
2034
  headerNames?: string[] | undefined;
734
2035
  }>, "many">>;
2036
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2037
+ domain: zod0.ZodString;
2038
+ forwardURL: zod0.ZodString;
2039
+ match: zod0.ZodOptional<zod0.ZodObject<{
2040
+ path: zod0.ZodOptional<zod0.ZodObject<{
2041
+ exact: zod0.ZodOptional<zod0.ZodString>;
2042
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2043
+ regex: zod0.ZodOptional<zod0.ZodString>;
2044
+ }, "strip", zod0.ZodTypeAny, {
2045
+ exact?: string | undefined;
2046
+ startsWith?: string | undefined;
2047
+ regex?: string | undefined;
2048
+ }, {
2049
+ exact?: string | undefined;
2050
+ startsWith?: string | undefined;
2051
+ regex?: string | undefined;
2052
+ }>>;
2053
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2054
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2055
+ key: zod0.ZodOptional<zod0.ZodObject<{
2056
+ exact: zod0.ZodOptional<zod0.ZodString>;
2057
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2058
+ regex: zod0.ZodOptional<zod0.ZodString>;
2059
+ }, "strip", zod0.ZodTypeAny, {
2060
+ exact?: string | undefined;
2061
+ startsWith?: string | undefined;
2062
+ regex?: string | undefined;
2063
+ }, {
2064
+ exact?: string | undefined;
2065
+ startsWith?: string | undefined;
2066
+ regex?: string | undefined;
2067
+ }>>;
2068
+ value: zod0.ZodOptional<zod0.ZodObject<{
2069
+ exact: zod0.ZodOptional<zod0.ZodString>;
2070
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2071
+ regex: zod0.ZodOptional<zod0.ZodString>;
2072
+ }, "strip", zod0.ZodTypeAny, {
2073
+ exact?: string | undefined;
2074
+ startsWith?: string | undefined;
2075
+ regex?: string | undefined;
2076
+ }, {
2077
+ exact?: string | undefined;
2078
+ startsWith?: string | undefined;
2079
+ regex?: string | undefined;
2080
+ }>>;
2081
+ }, "strip", zod0.ZodTypeAny, {
2082
+ value?: {
2083
+ exact?: string | undefined;
2084
+ startsWith?: string | undefined;
2085
+ regex?: string | undefined;
2086
+ } | undefined;
2087
+ key?: {
2088
+ exact?: string | undefined;
2089
+ startsWith?: string | undefined;
2090
+ regex?: string | undefined;
2091
+ } | undefined;
2092
+ }, {
2093
+ value?: {
2094
+ exact?: string | undefined;
2095
+ startsWith?: string | undefined;
2096
+ regex?: string | undefined;
2097
+ } | undefined;
2098
+ key?: {
2099
+ exact?: string | undefined;
2100
+ startsWith?: string | undefined;
2101
+ regex?: string | undefined;
2102
+ } | undefined;
2103
+ }>, "many">>;
2104
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2105
+ key: zod0.ZodOptional<zod0.ZodObject<{
2106
+ exact: zod0.ZodOptional<zod0.ZodString>;
2107
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2108
+ regex: zod0.ZodOptional<zod0.ZodString>;
2109
+ }, "strip", zod0.ZodTypeAny, {
2110
+ exact?: string | undefined;
2111
+ startsWith?: string | undefined;
2112
+ regex?: string | undefined;
2113
+ }, {
2114
+ exact?: string | undefined;
2115
+ startsWith?: string | undefined;
2116
+ regex?: string | undefined;
2117
+ }>>;
2118
+ value: zod0.ZodOptional<zod0.ZodObject<{
2119
+ exact: zod0.ZodOptional<zod0.ZodString>;
2120
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2121
+ regex: zod0.ZodOptional<zod0.ZodString>;
2122
+ }, "strip", zod0.ZodTypeAny, {
2123
+ exact?: string | undefined;
2124
+ startsWith?: string | undefined;
2125
+ regex?: string | undefined;
2126
+ }, {
2127
+ exact?: string | undefined;
2128
+ startsWith?: string | undefined;
2129
+ regex?: string | undefined;
2130
+ }>>;
2131
+ }, "strip", zod0.ZodTypeAny, {
2132
+ value?: {
2133
+ exact?: string | undefined;
2134
+ startsWith?: string | undefined;
2135
+ regex?: string | undefined;
2136
+ } | undefined;
2137
+ key?: {
2138
+ exact?: string | undefined;
2139
+ startsWith?: string | undefined;
2140
+ regex?: string | undefined;
2141
+ } | undefined;
2142
+ }, {
2143
+ value?: {
2144
+ exact?: string | undefined;
2145
+ startsWith?: string | undefined;
2146
+ regex?: string | undefined;
2147
+ } | undefined;
2148
+ key?: {
2149
+ exact?: string | undefined;
2150
+ startsWith?: string | undefined;
2151
+ regex?: string | undefined;
2152
+ } | undefined;
2153
+ }>, "many">>;
2154
+ }, "strip", zod0.ZodTypeAny, {
2155
+ path?: {
2156
+ exact?: string | undefined;
2157
+ startsWith?: string | undefined;
2158
+ regex?: string | undefined;
2159
+ } | undefined;
2160
+ headers?: {
2161
+ value?: {
2162
+ exact?: string | undefined;
2163
+ startsWith?: string | undefined;
2164
+ regex?: string | undefined;
2165
+ } | undefined;
2166
+ key?: {
2167
+ exact?: string | undefined;
2168
+ startsWith?: string | undefined;
2169
+ regex?: string | undefined;
2170
+ } | undefined;
2171
+ }[] | undefined;
2172
+ method?: string[] | undefined;
2173
+ queryString?: {
2174
+ value?: {
2175
+ exact?: string | undefined;
2176
+ startsWith?: string | undefined;
2177
+ regex?: string | undefined;
2178
+ } | undefined;
2179
+ key?: {
2180
+ exact?: string | undefined;
2181
+ startsWith?: string | undefined;
2182
+ regex?: string | undefined;
2183
+ } | undefined;
2184
+ }[] | undefined;
2185
+ }, {
2186
+ path?: {
2187
+ exact?: string | undefined;
2188
+ startsWith?: string | undefined;
2189
+ regex?: string | undefined;
2190
+ } | undefined;
2191
+ headers?: {
2192
+ value?: {
2193
+ exact?: string | undefined;
2194
+ startsWith?: string | undefined;
2195
+ regex?: string | undefined;
2196
+ } | undefined;
2197
+ key?: {
2198
+ exact?: string | undefined;
2199
+ startsWith?: string | undefined;
2200
+ regex?: string | undefined;
2201
+ } | undefined;
2202
+ }[] | undefined;
2203
+ method?: string[] | undefined;
2204
+ queryString?: {
2205
+ value?: {
2206
+ exact?: string | undefined;
2207
+ startsWith?: string | undefined;
2208
+ regex?: string | undefined;
2209
+ } | undefined;
2210
+ key?: {
2211
+ exact?: string | undefined;
2212
+ startsWith?: string | undefined;
2213
+ regex?: string | undefined;
2214
+ } | undefined;
2215
+ }[] | undefined;
2216
+ }>>;
2217
+ }, "strip", zod0.ZodTypeAny, {
2218
+ domain: string;
2219
+ forwardURL: string;
2220
+ match?: {
2221
+ path?: {
2222
+ exact?: string | undefined;
2223
+ startsWith?: string | undefined;
2224
+ regex?: string | undefined;
2225
+ } | undefined;
2226
+ headers?: {
2227
+ value?: {
2228
+ exact?: string | undefined;
2229
+ startsWith?: string | undefined;
2230
+ regex?: string | undefined;
2231
+ } | undefined;
2232
+ key?: {
2233
+ exact?: string | undefined;
2234
+ startsWith?: string | undefined;
2235
+ regex?: string | undefined;
2236
+ } | undefined;
2237
+ }[] | undefined;
2238
+ method?: string[] | undefined;
2239
+ queryString?: {
2240
+ value?: {
2241
+ exact?: string | undefined;
2242
+ startsWith?: string | undefined;
2243
+ regex?: string | undefined;
2244
+ } | undefined;
2245
+ key?: {
2246
+ exact?: string | undefined;
2247
+ startsWith?: string | undefined;
2248
+ regex?: string | undefined;
2249
+ } | undefined;
2250
+ }[] | undefined;
2251
+ } | undefined;
2252
+ }, {
2253
+ domain: string;
2254
+ forwardURL: string;
2255
+ match?: {
2256
+ path?: {
2257
+ exact?: string | undefined;
2258
+ startsWith?: string | undefined;
2259
+ regex?: string | undefined;
2260
+ } | undefined;
2261
+ headers?: {
2262
+ value?: {
2263
+ exact?: string | undefined;
2264
+ startsWith?: string | undefined;
2265
+ regex?: string | undefined;
2266
+ } | undefined;
2267
+ key?: {
2268
+ exact?: string | undefined;
2269
+ startsWith?: string | undefined;
2270
+ regex?: string | undefined;
2271
+ } | undefined;
2272
+ }[] | undefined;
2273
+ method?: string[] | undefined;
2274
+ queryString?: {
2275
+ value?: {
2276
+ exact?: string | undefined;
2277
+ startsWith?: string | undefined;
2278
+ regex?: string | undefined;
2279
+ } | undefined;
2280
+ key?: {
2281
+ exact?: string | undefined;
2282
+ startsWith?: string | undefined;
2283
+ regex?: string | undefined;
2284
+ } | undefined;
2285
+ }[] | undefined;
2286
+ } | undefined;
2287
+ }>, "many">>;
735
2288
  }, zod0.ZodTypeAny, "passthrough">, zod0.objectInputType<{
736
2289
  mode: zod0.ZodLiteral<"custom">;
737
2290
  allowedDomains: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
@@ -741,15 +2294,509 @@ declare class Sandbox {
741
2294
  domain: zod0.ZodString;
742
2295
  headers: zod0.ZodOptional<zod0.ZodRecord<zod0.ZodString, zod0.ZodString>>;
743
2296
  headerNames: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2297
+ match: zod0.ZodOptional<zod0.ZodObject<{
2298
+ path: zod0.ZodOptional<zod0.ZodObject<{
2299
+ exact: zod0.ZodOptional<zod0.ZodString>;
2300
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2301
+ regex: zod0.ZodOptional<zod0.ZodString>;
2302
+ }, "strip", zod0.ZodTypeAny, {
2303
+ exact?: string | undefined;
2304
+ startsWith?: string | undefined;
2305
+ regex?: string | undefined;
2306
+ }, {
2307
+ exact?: string | undefined;
2308
+ startsWith?: string | undefined;
2309
+ regex?: string | undefined;
2310
+ }>>;
2311
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2312
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2313
+ key: zod0.ZodOptional<zod0.ZodObject<{
2314
+ exact: zod0.ZodOptional<zod0.ZodString>;
2315
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2316
+ regex: zod0.ZodOptional<zod0.ZodString>;
2317
+ }, "strip", zod0.ZodTypeAny, {
2318
+ exact?: string | undefined;
2319
+ startsWith?: string | undefined;
2320
+ regex?: string | undefined;
2321
+ }, {
2322
+ exact?: string | undefined;
2323
+ startsWith?: string | undefined;
2324
+ regex?: string | undefined;
2325
+ }>>;
2326
+ value: zod0.ZodOptional<zod0.ZodObject<{
2327
+ exact: zod0.ZodOptional<zod0.ZodString>;
2328
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2329
+ regex: zod0.ZodOptional<zod0.ZodString>;
2330
+ }, "strip", zod0.ZodTypeAny, {
2331
+ exact?: string | undefined;
2332
+ startsWith?: string | undefined;
2333
+ regex?: string | undefined;
2334
+ }, {
2335
+ exact?: string | undefined;
2336
+ startsWith?: string | undefined;
2337
+ regex?: string | undefined;
2338
+ }>>;
2339
+ }, "strip", zod0.ZodTypeAny, {
2340
+ value?: {
2341
+ exact?: string | undefined;
2342
+ startsWith?: string | undefined;
2343
+ regex?: string | undefined;
2344
+ } | undefined;
2345
+ key?: {
2346
+ exact?: string | undefined;
2347
+ startsWith?: string | undefined;
2348
+ regex?: string | undefined;
2349
+ } | undefined;
2350
+ }, {
2351
+ value?: {
2352
+ exact?: string | undefined;
2353
+ startsWith?: string | undefined;
2354
+ regex?: string | undefined;
2355
+ } | undefined;
2356
+ key?: {
2357
+ exact?: string | undefined;
2358
+ startsWith?: string | undefined;
2359
+ regex?: string | undefined;
2360
+ } | undefined;
2361
+ }>, "many">>;
2362
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2363
+ key: zod0.ZodOptional<zod0.ZodObject<{
2364
+ exact: zod0.ZodOptional<zod0.ZodString>;
2365
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2366
+ regex: zod0.ZodOptional<zod0.ZodString>;
2367
+ }, "strip", zod0.ZodTypeAny, {
2368
+ exact?: string | undefined;
2369
+ startsWith?: string | undefined;
2370
+ regex?: string | undefined;
2371
+ }, {
2372
+ exact?: string | undefined;
2373
+ startsWith?: string | undefined;
2374
+ regex?: string | undefined;
2375
+ }>>;
2376
+ value: zod0.ZodOptional<zod0.ZodObject<{
2377
+ exact: zod0.ZodOptional<zod0.ZodString>;
2378
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2379
+ regex: zod0.ZodOptional<zod0.ZodString>;
2380
+ }, "strip", zod0.ZodTypeAny, {
2381
+ exact?: string | undefined;
2382
+ startsWith?: string | undefined;
2383
+ regex?: string | undefined;
2384
+ }, {
2385
+ exact?: string | undefined;
2386
+ startsWith?: string | undefined;
2387
+ regex?: string | undefined;
2388
+ }>>;
2389
+ }, "strip", zod0.ZodTypeAny, {
2390
+ value?: {
2391
+ exact?: string | undefined;
2392
+ startsWith?: string | undefined;
2393
+ regex?: string | undefined;
2394
+ } | undefined;
2395
+ key?: {
2396
+ exact?: string | undefined;
2397
+ startsWith?: string | undefined;
2398
+ regex?: string | undefined;
2399
+ } | undefined;
2400
+ }, {
2401
+ value?: {
2402
+ exact?: string | undefined;
2403
+ startsWith?: string | undefined;
2404
+ regex?: string | undefined;
2405
+ } | undefined;
2406
+ key?: {
2407
+ exact?: string | undefined;
2408
+ startsWith?: string | undefined;
2409
+ regex?: string | undefined;
2410
+ } | undefined;
2411
+ }>, "many">>;
2412
+ }, "strip", zod0.ZodTypeAny, {
2413
+ path?: {
2414
+ exact?: string | undefined;
2415
+ startsWith?: string | undefined;
2416
+ regex?: string | undefined;
2417
+ } | undefined;
2418
+ headers?: {
2419
+ value?: {
2420
+ exact?: string | undefined;
2421
+ startsWith?: string | undefined;
2422
+ regex?: string | undefined;
2423
+ } | undefined;
2424
+ key?: {
2425
+ exact?: string | undefined;
2426
+ startsWith?: string | undefined;
2427
+ regex?: string | undefined;
2428
+ } | undefined;
2429
+ }[] | undefined;
2430
+ method?: string[] | undefined;
2431
+ queryString?: {
2432
+ value?: {
2433
+ exact?: string | undefined;
2434
+ startsWith?: string | undefined;
2435
+ regex?: string | undefined;
2436
+ } | undefined;
2437
+ key?: {
2438
+ exact?: string | undefined;
2439
+ startsWith?: string | undefined;
2440
+ regex?: string | undefined;
2441
+ } | undefined;
2442
+ }[] | undefined;
2443
+ }, {
2444
+ path?: {
2445
+ exact?: string | undefined;
2446
+ startsWith?: string | undefined;
2447
+ regex?: string | undefined;
2448
+ } | undefined;
2449
+ headers?: {
2450
+ value?: {
2451
+ exact?: string | undefined;
2452
+ startsWith?: string | undefined;
2453
+ regex?: string | undefined;
2454
+ } | undefined;
2455
+ key?: {
2456
+ exact?: string | undefined;
2457
+ startsWith?: string | undefined;
2458
+ regex?: string | undefined;
2459
+ } | undefined;
2460
+ }[] | undefined;
2461
+ method?: string[] | undefined;
2462
+ queryString?: {
2463
+ value?: {
2464
+ exact?: string | undefined;
2465
+ startsWith?: string | undefined;
2466
+ regex?: string | undefined;
2467
+ } | undefined;
2468
+ key?: {
2469
+ exact?: string | undefined;
2470
+ startsWith?: string | undefined;
2471
+ regex?: string | undefined;
2472
+ } | undefined;
2473
+ }[] | undefined;
2474
+ }>>;
744
2475
  }, "strip", zod0.ZodTypeAny, {
745
2476
  domain: string;
2477
+ match?: {
2478
+ path?: {
2479
+ exact?: string | undefined;
2480
+ startsWith?: string | undefined;
2481
+ regex?: string | undefined;
2482
+ } | undefined;
2483
+ headers?: {
2484
+ value?: {
2485
+ exact?: string | undefined;
2486
+ startsWith?: string | undefined;
2487
+ regex?: string | undefined;
2488
+ } | undefined;
2489
+ key?: {
2490
+ exact?: string | undefined;
2491
+ startsWith?: string | undefined;
2492
+ regex?: string | undefined;
2493
+ } | undefined;
2494
+ }[] | undefined;
2495
+ method?: string[] | undefined;
2496
+ queryString?: {
2497
+ value?: {
2498
+ exact?: string | undefined;
2499
+ startsWith?: string | undefined;
2500
+ regex?: string | undefined;
2501
+ } | undefined;
2502
+ key?: {
2503
+ exact?: string | undefined;
2504
+ startsWith?: string | undefined;
2505
+ regex?: string | undefined;
2506
+ } | undefined;
2507
+ }[] | undefined;
2508
+ } | undefined;
746
2509
  headers?: Record<string, string> | undefined;
747
2510
  headerNames?: string[] | undefined;
748
2511
  }, {
749
2512
  domain: string;
2513
+ match?: {
2514
+ path?: {
2515
+ exact?: string | undefined;
2516
+ startsWith?: string | undefined;
2517
+ regex?: string | undefined;
2518
+ } | undefined;
2519
+ headers?: {
2520
+ value?: {
2521
+ exact?: string | undefined;
2522
+ startsWith?: string | undefined;
2523
+ regex?: string | undefined;
2524
+ } | undefined;
2525
+ key?: {
2526
+ exact?: string | undefined;
2527
+ startsWith?: string | undefined;
2528
+ regex?: string | undefined;
2529
+ } | undefined;
2530
+ }[] | undefined;
2531
+ method?: string[] | undefined;
2532
+ queryString?: {
2533
+ value?: {
2534
+ exact?: string | undefined;
2535
+ startsWith?: string | undefined;
2536
+ regex?: string | undefined;
2537
+ } | undefined;
2538
+ key?: {
2539
+ exact?: string | undefined;
2540
+ startsWith?: string | undefined;
2541
+ regex?: string | undefined;
2542
+ } | undefined;
2543
+ }[] | undefined;
2544
+ } | undefined;
750
2545
  headers?: Record<string, string> | undefined;
751
2546
  headerNames?: string[] | undefined;
752
2547
  }>, "many">>;
2548
+ forwardRules: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2549
+ domain: zod0.ZodString;
2550
+ forwardURL: zod0.ZodString;
2551
+ match: zod0.ZodOptional<zod0.ZodObject<{
2552
+ path: zod0.ZodOptional<zod0.ZodObject<{
2553
+ exact: zod0.ZodOptional<zod0.ZodString>;
2554
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2555
+ regex: zod0.ZodOptional<zod0.ZodString>;
2556
+ }, "strip", zod0.ZodTypeAny, {
2557
+ exact?: string | undefined;
2558
+ startsWith?: string | undefined;
2559
+ regex?: string | undefined;
2560
+ }, {
2561
+ exact?: string | undefined;
2562
+ startsWith?: string | undefined;
2563
+ regex?: string | undefined;
2564
+ }>>;
2565
+ method: zod0.ZodOptional<zod0.ZodArray<zod0.ZodString, "many">>;
2566
+ queryString: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2567
+ key: zod0.ZodOptional<zod0.ZodObject<{
2568
+ exact: zod0.ZodOptional<zod0.ZodString>;
2569
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2570
+ regex: zod0.ZodOptional<zod0.ZodString>;
2571
+ }, "strip", zod0.ZodTypeAny, {
2572
+ exact?: string | undefined;
2573
+ startsWith?: string | undefined;
2574
+ regex?: string | undefined;
2575
+ }, {
2576
+ exact?: string | undefined;
2577
+ startsWith?: string | undefined;
2578
+ regex?: string | undefined;
2579
+ }>>;
2580
+ value: zod0.ZodOptional<zod0.ZodObject<{
2581
+ exact: zod0.ZodOptional<zod0.ZodString>;
2582
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2583
+ regex: zod0.ZodOptional<zod0.ZodString>;
2584
+ }, "strip", zod0.ZodTypeAny, {
2585
+ exact?: string | undefined;
2586
+ startsWith?: string | undefined;
2587
+ regex?: string | undefined;
2588
+ }, {
2589
+ exact?: string | undefined;
2590
+ startsWith?: string | undefined;
2591
+ regex?: string | undefined;
2592
+ }>>;
2593
+ }, "strip", zod0.ZodTypeAny, {
2594
+ value?: {
2595
+ exact?: string | undefined;
2596
+ startsWith?: string | undefined;
2597
+ regex?: string | undefined;
2598
+ } | undefined;
2599
+ key?: {
2600
+ exact?: string | undefined;
2601
+ startsWith?: string | undefined;
2602
+ regex?: string | undefined;
2603
+ } | undefined;
2604
+ }, {
2605
+ value?: {
2606
+ exact?: string | undefined;
2607
+ startsWith?: string | undefined;
2608
+ regex?: string | undefined;
2609
+ } | undefined;
2610
+ key?: {
2611
+ exact?: string | undefined;
2612
+ startsWith?: string | undefined;
2613
+ regex?: string | undefined;
2614
+ } | undefined;
2615
+ }>, "many">>;
2616
+ headers: zod0.ZodOptional<zod0.ZodArray<zod0.ZodObject<{
2617
+ key: zod0.ZodOptional<zod0.ZodObject<{
2618
+ exact: zod0.ZodOptional<zod0.ZodString>;
2619
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2620
+ regex: zod0.ZodOptional<zod0.ZodString>;
2621
+ }, "strip", zod0.ZodTypeAny, {
2622
+ exact?: string | undefined;
2623
+ startsWith?: string | undefined;
2624
+ regex?: string | undefined;
2625
+ }, {
2626
+ exact?: string | undefined;
2627
+ startsWith?: string | undefined;
2628
+ regex?: string | undefined;
2629
+ }>>;
2630
+ value: zod0.ZodOptional<zod0.ZodObject<{
2631
+ exact: zod0.ZodOptional<zod0.ZodString>;
2632
+ startsWith: zod0.ZodOptional<zod0.ZodString>;
2633
+ regex: zod0.ZodOptional<zod0.ZodString>;
2634
+ }, "strip", zod0.ZodTypeAny, {
2635
+ exact?: string | undefined;
2636
+ startsWith?: string | undefined;
2637
+ regex?: string | undefined;
2638
+ }, {
2639
+ exact?: string | undefined;
2640
+ startsWith?: string | undefined;
2641
+ regex?: string | undefined;
2642
+ }>>;
2643
+ }, "strip", zod0.ZodTypeAny, {
2644
+ value?: {
2645
+ exact?: string | undefined;
2646
+ startsWith?: string | undefined;
2647
+ regex?: string | undefined;
2648
+ } | undefined;
2649
+ key?: {
2650
+ exact?: string | undefined;
2651
+ startsWith?: string | undefined;
2652
+ regex?: string | undefined;
2653
+ } | undefined;
2654
+ }, {
2655
+ value?: {
2656
+ exact?: string | undefined;
2657
+ startsWith?: string | undefined;
2658
+ regex?: string | undefined;
2659
+ } | undefined;
2660
+ key?: {
2661
+ exact?: string | undefined;
2662
+ startsWith?: string | undefined;
2663
+ regex?: string | undefined;
2664
+ } | undefined;
2665
+ }>, "many">>;
2666
+ }, "strip", zod0.ZodTypeAny, {
2667
+ path?: {
2668
+ exact?: string | undefined;
2669
+ startsWith?: string | undefined;
2670
+ regex?: string | undefined;
2671
+ } | undefined;
2672
+ headers?: {
2673
+ value?: {
2674
+ exact?: string | undefined;
2675
+ startsWith?: string | undefined;
2676
+ regex?: string | undefined;
2677
+ } | undefined;
2678
+ key?: {
2679
+ exact?: string | undefined;
2680
+ startsWith?: string | undefined;
2681
+ regex?: string | undefined;
2682
+ } | undefined;
2683
+ }[] | undefined;
2684
+ method?: string[] | undefined;
2685
+ queryString?: {
2686
+ value?: {
2687
+ exact?: string | undefined;
2688
+ startsWith?: string | undefined;
2689
+ regex?: string | undefined;
2690
+ } | undefined;
2691
+ key?: {
2692
+ exact?: string | undefined;
2693
+ startsWith?: string | undefined;
2694
+ regex?: string | undefined;
2695
+ } | undefined;
2696
+ }[] | undefined;
2697
+ }, {
2698
+ path?: {
2699
+ exact?: string | undefined;
2700
+ startsWith?: string | undefined;
2701
+ regex?: string | undefined;
2702
+ } | undefined;
2703
+ headers?: {
2704
+ value?: {
2705
+ exact?: string | undefined;
2706
+ startsWith?: string | undefined;
2707
+ regex?: string | undefined;
2708
+ } | undefined;
2709
+ key?: {
2710
+ exact?: string | undefined;
2711
+ startsWith?: string | undefined;
2712
+ regex?: string | undefined;
2713
+ } | undefined;
2714
+ }[] | undefined;
2715
+ method?: string[] | undefined;
2716
+ queryString?: {
2717
+ value?: {
2718
+ exact?: string | undefined;
2719
+ startsWith?: string | undefined;
2720
+ regex?: string | undefined;
2721
+ } | undefined;
2722
+ key?: {
2723
+ exact?: string | undefined;
2724
+ startsWith?: string | undefined;
2725
+ regex?: string | undefined;
2726
+ } | undefined;
2727
+ }[] | undefined;
2728
+ }>>;
2729
+ }, "strip", zod0.ZodTypeAny, {
2730
+ domain: string;
2731
+ forwardURL: string;
2732
+ match?: {
2733
+ path?: {
2734
+ exact?: string | undefined;
2735
+ startsWith?: string | undefined;
2736
+ regex?: string | undefined;
2737
+ } | undefined;
2738
+ headers?: {
2739
+ value?: {
2740
+ exact?: string | undefined;
2741
+ startsWith?: string | undefined;
2742
+ regex?: string | undefined;
2743
+ } | undefined;
2744
+ key?: {
2745
+ exact?: string | undefined;
2746
+ startsWith?: string | undefined;
2747
+ regex?: string | undefined;
2748
+ } | undefined;
2749
+ }[] | undefined;
2750
+ method?: string[] | undefined;
2751
+ queryString?: {
2752
+ value?: {
2753
+ exact?: string | undefined;
2754
+ startsWith?: string | undefined;
2755
+ regex?: string | undefined;
2756
+ } | undefined;
2757
+ key?: {
2758
+ exact?: string | undefined;
2759
+ startsWith?: string | undefined;
2760
+ regex?: string | undefined;
2761
+ } | undefined;
2762
+ }[] | undefined;
2763
+ } | undefined;
2764
+ }, {
2765
+ domain: string;
2766
+ forwardURL: string;
2767
+ match?: {
2768
+ path?: {
2769
+ exact?: string | undefined;
2770
+ startsWith?: string | undefined;
2771
+ regex?: string | undefined;
2772
+ } | undefined;
2773
+ headers?: {
2774
+ value?: {
2775
+ exact?: string | undefined;
2776
+ startsWith?: string | undefined;
2777
+ regex?: string | undefined;
2778
+ } | undefined;
2779
+ key?: {
2780
+ exact?: string | undefined;
2781
+ startsWith?: string | undefined;
2782
+ regex?: string | undefined;
2783
+ } | undefined;
2784
+ }[] | undefined;
2785
+ method?: string[] | undefined;
2786
+ queryString?: {
2787
+ value?: {
2788
+ exact?: string | undefined;
2789
+ startsWith?: string | undefined;
2790
+ regex?: string | undefined;
2791
+ } | undefined;
2792
+ key?: {
2793
+ exact?: string | undefined;
2794
+ startsWith?: string | undefined;
2795
+ regex?: string | undefined;
2796
+ } | undefined;
2797
+ }[] | undefined;
2798
+ } | undefined;
2799
+ }>, "many">>;
753
2800
  }, zod0.ZodTypeAny, "passthrough">>]>>;
754
2801
  activeCpuDurationMs: zod0.ZodOptional<zod0.ZodNumber>;
755
2802
  networkTransfer: zod0.ZodOptional<zod0.ZodObject<{
@@ -763,7 +2810,7 @@ declare class Sandbox {
763
2810
  egress: number;
764
2811
  }>>;
765
2812
  }, zod0.ZodTypeAny, "passthrough">[];
766
- }>;
2813
+ }, "sessions">>;
767
2814
  /**
768
2815
  * List snapshots that belong to this sandbox.
769
2816
  *
@@ -775,22 +2822,22 @@ declare class Sandbox {
775
2822
  cursor?: string;
776
2823
  sortOrder?: "asc" | "desc";
777
2824
  signal?: AbortSignal;
778
- }): Promise<{
2825
+ }): Promise<Paginator<{
779
2826
  pagination: {
780
2827
  count: number;
781
2828
  next: string | null;
782
2829
  };
783
2830
  snapshots: {
784
2831
  status: "failed" | "created" | "deleted";
2832
+ id: string;
785
2833
  region: string;
786
2834
  createdAt: number;
787
2835
  updatedAt: number;
788
- id: string;
789
2836
  sourceSessionId: string;
790
2837
  sizeBytes: number;
791
2838
  expiresAt?: number | undefined;
792
2839
  }[];
793
- }>;
2840
+ }, "snapshots">>;
794
2841
  }
795
2842
  //#endregion
796
2843
  export { Sandbox, SerializedSandbox };