@claxedo/sandbox-manager 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +233 -26
  2. package/dist/checkpoint-manager.d.ts +29 -4
  3. package/dist/checkpoint-manager.mjs +133 -24
  4. package/dist/command.d.ts +9 -2
  5. package/dist/command.mjs +8 -8
  6. package/dist/contract.d.ts +687 -0
  7. package/dist/driver-billing.d.ts +29 -0
  8. package/dist/driver-catalog.d.ts +42 -7
  9. package/dist/driver-catalog.mjs +115 -161
  10. package/dist/drivers/boat-client.d.ts +95 -0
  11. package/dist/drivers/boat-named-snapshots.d.ts +31 -0
  12. package/dist/drivers/boat-template.d.ts +49 -0
  13. package/dist/drivers/boat-template.mjs +1196 -0
  14. package/dist/drivers/boat.d.ts +64 -0
  15. package/dist/drivers/boat.mjs +990 -0
  16. package/dist/drivers/cloudflare.d.ts +3 -3
  17. package/dist/drivers/cloudflare.mjs +208 -147
  18. package/dist/drivers/docker.d.ts +4 -3
  19. package/dist/drivers/docker.mjs +154 -126
  20. package/dist/drivers/local-brokering.d.ts +14 -0
  21. package/dist/drivers/local-brokering.mjs +1029 -0
  22. package/dist/drivers/modal.d.ts +2 -2
  23. package/dist/drivers/modal.mjs +121 -111
  24. package/dist/drivers/transient-error.d.ts +2 -0
  25. package/dist/drivers/vercel.d.ts +3 -2
  26. package/dist/drivers/vercel.mjs +151 -115
  27. package/dist/egress-policy.d.ts +134 -0
  28. package/dist/egress-warnings.d.ts +22 -0
  29. package/dist/garbage-collect.d.ts +14 -0
  30. package/dist/hosted-network-policy.d.ts +9 -2
  31. package/dist/hosted-network-policy.mjs +218 -1
  32. package/dist/image-name.d.ts +12 -2
  33. package/dist/image-name.mjs +14 -5
  34. package/dist/image.d.ts +1 -20
  35. package/dist/image.mjs +11 -88
  36. package/dist/index.d.ts +8 -578
  37. package/dist/index.mjs +1379 -320
  38. package/dist/lease-failure.d.ts +173 -0
  39. package/dist/lease-lifecycle.d.ts +65 -0
  40. package/dist/lease-retry-wait.d.ts +8 -0
  41. package/dist/lease-start.d.ts +21 -0
  42. package/dist/lease-types.d.ts +4 -3
  43. package/dist/manager.d.ts +2 -0
  44. package/dist/runtime-env.d.ts +4 -2
  45. package/dist/runtime-env.mjs +37 -2
  46. package/dist/runtime-snapshot.d.ts +49 -0
  47. package/dist/runtime-version.d.ts +9 -0
  48. package/dist/runtime-version.mjs +2 -0
  49. package/dist/service-url-exposure.d.ts +0 -1
  50. package/dist/service-url-exposure.mjs +0 -9
  51. package/dist/start-fresh.d.ts +17 -0
  52. package/dist/start-telemetry.d.ts +37 -0
  53. package/dist/stores/memory.d.ts +1 -1
  54. package/dist/stores/memory.mjs +63 -52
  55. package/package.json +26 -42
  56. package/dist/daytona-allow-list.d.ts +0 -16
  57. package/dist/daytona-allow-list.mjs +0 -11
  58. package/dist/drivers/box.d.ts +0 -52
  59. package/dist/drivers/box.mjs +0 -574
  60. package/dist/drivers/daytona.d.ts +0 -163
  61. package/dist/drivers/daytona.mjs +0 -683
  62. package/dist/drivers/exe.d.ts +0 -26
  63. package/dist/drivers/exe.mjs +0 -492
  64. package/dist/drivers/fetch-bridge.d.ts +0 -10
  65. package/dist/drivers/fetch-bridge.mjs +0 -126
  66. package/dist/lease-policy.d.ts +0 -52
  67. package/dist/lease-policy.mjs +0 -290
@@ -0,0 +1,64 @@
1
+ import { type SandboxDriver, type SandboxDriverEnsureInput } from "../contract";
2
+ import { type WorkspaceRuntimeControlEnv } from "../runtime-env";
3
+ import { type BoatFetch } from "./boat-client";
4
+ export type { BoatFetch };
5
+ /**
6
+ * A named snapshot of a machine that already holds `image`'s trees, stub and
7
+ * env, and Boat's record of the files the runtime opens first; another Boat
8
+ * account creates a sandbox from it with the share code.
9
+ */
10
+ export type BoatRuntimeTemplate = {
11
+ image: string;
12
+ shareCode: string;
13
+ };
14
+ export declare function formatBoatRuntimeTemplate(template: BoatRuntimeTemplate): string;
15
+ export declare function parseBoatRuntimeTemplate(setting: string): BoatRuntimeTemplate;
16
+ export type BoatSandboxDriverOptions = {
17
+ apiKey: string;
18
+ baseUrl?: string;
19
+ image: string;
20
+ runtimePort?: number;
21
+ runtimeCommand?: string;
22
+ workspaceDir?: string;
23
+ nativeHarness?: string;
24
+ controlEnv?: WorkspaceRuntimeControlEnv;
25
+ /** Container name used for the runtime container inside the sandbox. */
26
+ containerName?: string;
27
+ /**
28
+ * Optional `docker login` before the pull, for a private runtime registry.
29
+ * Omit for public images.
30
+ */
31
+ registryAuth?: {
32
+ server: string;
33
+ username: string;
34
+ password: string;
35
+ };
36
+ /** Creates a sandbox that boots the template's image from the template instead of pulling and seeding the image. */
37
+ runtimeTemplate?: BoatRuntimeTemplate;
38
+ env?: (input: SandboxDriverEnsureInput, host: {
39
+ id: string;
40
+ }) => Record<string, string> | Promise<Record<string, string>>;
41
+ provisionTimeoutMs?: number;
42
+ /** The first and the longest wait between two reads of a sandbox's state, where Boat offers no wait. */
43
+ statePollMs?: {
44
+ firstMs: number;
45
+ maxMs: number;
46
+ };
47
+ healthTimeoutMs?: number;
48
+ healthIntervalMs?: number;
49
+ operationTimeoutMs?: number;
50
+ fetchImpl?: BoatFetch;
51
+ };
52
+ /**
53
+ * Turns a booted machine into one any workspace can start from: it keeps what
54
+ * every machine of the image shares (the image's trees, stub archive and env,
55
+ * and Boat's ~/.ascii/playbook.json) and removes what this machine's boot made
56
+ * (the runtime container and Boat's record and image archive of it, the
57
+ * workspace, the runtime's state, the boot's env). Nothing the runtime wrote
58
+ * into the image's trees was found there (Boat, 2026-10-16: the trees held only
59
+ * the image's own entries after two boots); what else differs on the machine
60
+ * is Boat's own, and a machine created from the template gets its own
61
+ * machine-id, SSH host keys, hostname and no hosted port.
62
+ */
63
+ export declare function boatTemplateResetCommand(): string;
64
+ export declare function createBoatSandboxDriver(options: BoatSandboxDriverOptions): SandboxDriver;