@claxedo/sandbox-manager 0.10.1 → 0.10.3
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.
- package/README.md +100 -30
- package/dist/checkpoint-manager.mjs +19 -0
- package/dist/contract.d.ts +40 -17
- package/dist/driver-billing.d.ts +23 -0
- package/dist/driver-catalog.mjs +57 -3
- package/dist/driver-ensure-input.d.ts +22 -0
- package/dist/drivers/agent37-client.d.ts +87 -0
- package/dist/drivers/agent37.d.ts +25 -0
- package/dist/drivers/agent37.mjs +888 -0
- package/dist/drivers/boat-client.d.ts +4 -4
- package/dist/drivers/boat-machine.d.ts +80 -0
- package/dist/drivers/boat-preparation.test-support.d.ts +2 -0
- package/dist/drivers/boat-template.mjs +196 -92
- package/dist/drivers/boat.d.ts +0 -17
- package/dist/drivers/boat.mjs +200 -108
- package/dist/drivers/cloudflare.d.ts +5 -9
- package/dist/drivers/cloudflare.mjs +71 -7
- package/dist/drivers/docker.mjs +57 -2
- package/dist/drivers/local-brokering.d.ts +12 -0
- package/dist/drivers/local-brokering.mjs +99 -24
- package/dist/drivers/modal.mjs +57 -2
- package/dist/drivers/transient-error.d.ts +0 -1
- package/dist/drivers/vercel.mjs +61 -3
- package/dist/egress-policy.d.ts +33 -32
- package/dist/egress-warnings.d.ts +4 -6
- package/dist/hosted-network-policy.d.ts +10 -64
- package/dist/hosted-network-policy.mjs +1 -1
- package/dist/image-name.d.ts +0 -1
- package/dist/image-name.mjs +5 -0
- package/dist/image.d.ts +1 -0
- package/dist/image.mjs +6 -0
- package/dist/index.mjs +180 -112
- package/dist/json.d.ts +1 -10
- package/dist/lease-failure.d.ts +20 -1
- package/dist/lease-types.d.ts +1 -10
- package/dist/runtime-env.d.ts +6 -0
- package/dist/runtime-env.mjs +5 -0
- package/dist/runtime-version.d.ts +25 -7
- package/dist/runtime-version.mjs +13 -2
- package/dist/start-admission.d.ts +32 -0
- package/dist/start-telemetry.d.ts +5 -3
- package/package.json +12 -4
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SandboxDriver, SandboxEnsureResult, SandboxManagerInput } from "./contract";
|
|
2
|
+
import type { EgressWarnings } from "./egress-warnings";
|
|
3
|
+
export type SandboxStartRefusal = Extract<SandboxEnsureResult, {
|
|
4
|
+
status: "unavailable";
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* The composition's standing answers to a start's input, decided BEFORE a
|
|
8
|
+
* lease is touched: none of them is a provisioning failure, so none may burn a
|
|
9
|
+
* lease epoch or enter retry backoff, and each repeats until the composition
|
|
10
|
+
* or the input changes.
|
|
11
|
+
*
|
|
12
|
+
* Egress: a caller that hands over a restricted policy is stating that this
|
|
13
|
+
* sandbox must not reach the open internet. That is honoured where the driver
|
|
14
|
+
* can honour it. Where it cannot, the start is refused, unless the start
|
|
15
|
+
* allows uncontained egress: then the sandbox runs with the policy withheld
|
|
16
|
+
* (`ensureHostInput` never hands it down) and the gap is reported here, once
|
|
17
|
+
* per driver per isolate. `sandbox_egress_policy_unenforceable` is refused too,
|
|
18
|
+
* and deliberately so: that driver DOES enforce egress, it just cannot express
|
|
19
|
+
* this policy's encoding, and degrading an enforcing driver to "unrestricted"
|
|
20
|
+
* would weaken the path that does enforce.
|
|
21
|
+
*
|
|
22
|
+
* Identity: caller env restating the identity the driver's target reports,
|
|
23
|
+
* which `recordTarget` persists, would boot the runtime bound to a hostId the
|
|
24
|
+
* lease never authorized; the driver rejects it again at compose time for
|
|
25
|
+
* callers that reach it directly.
|
|
26
|
+
*/
|
|
27
|
+
export declare function refusedStart(input: {
|
|
28
|
+
driver: SandboxDriver;
|
|
29
|
+
workspaceId: string;
|
|
30
|
+
start: SandboxManagerInput;
|
|
31
|
+
egressWarnings: EgressWarnings;
|
|
32
|
+
}): SandboxStartRefusal | undefined;
|
|
@@ -16,14 +16,16 @@ export declare function createSandboxStartRecorder(options: {
|
|
|
16
16
|
* lease as it ends, so a poller reading the lease mid-boot sees how far the
|
|
17
17
|
* start has come. `opened` writes the epoch's `lease_decision` before the
|
|
18
18
|
* driver runs, so a stop that lands mid-boot finds the boot it ends on the
|
|
19
|
-
* row. A serving lease is not starting
|
|
20
|
-
*
|
|
21
|
-
*
|
|
19
|
+
* row. A serving lease is not starting, unless the step is a person's
|
|
20
|
+
* update, which is a start of its own on the same epoch. An epoch acquired
|
|
21
|
+
* with a start it continues has that start and no phase yet; one acquired
|
|
22
|
+
* without begins its own here.
|
|
22
23
|
*/
|
|
23
24
|
observe(lease: SandboxLease, input: {
|
|
24
25
|
bootMode: SandboxBootMode;
|
|
25
26
|
enteredAt: number;
|
|
26
27
|
labels: Record<string, string>;
|
|
28
|
+
update?: true;
|
|
27
29
|
}): {
|
|
28
30
|
opened: () => Promise<void>;
|
|
29
31
|
end: (phase: SandboxStartPhase) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
|
-
"description": "Sandbox lifecycle manager with epoch-based leases and pluggable drivers for Modal, Vercel Sandbox, Cloudflare, Boat, and Docker",
|
|
3
|
+
"description": "Sandbox lifecycle manager with epoch-based leases and pluggable drivers for Modal, Vercel Sandbox, Cloudflare, Boat, Agent37, and Docker",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"cloudflare",
|
|
16
16
|
"docker",
|
|
17
17
|
"boat",
|
|
18
|
+
"agent37",
|
|
18
19
|
"agents"
|
|
19
20
|
],
|
|
20
21
|
"main": "./dist/index.mjs",
|
|
@@ -62,6 +63,13 @@
|
|
|
62
63
|
"import": "./dist/driver-catalog.mjs",
|
|
63
64
|
"default": "./dist/driver-catalog.mjs"
|
|
64
65
|
},
|
|
66
|
+
"./drivers/agent37": {
|
|
67
|
+
"development": "./src/drivers/agent37.ts",
|
|
68
|
+
"bun": "./src/drivers/agent37.ts",
|
|
69
|
+
"types": "./dist/drivers/agent37.d.ts",
|
|
70
|
+
"import": "./dist/drivers/agent37.mjs",
|
|
71
|
+
"default": "./dist/drivers/agent37.mjs"
|
|
72
|
+
},
|
|
65
73
|
"./drivers/boat": {
|
|
66
74
|
"development": "./src/drivers/boat.ts",
|
|
67
75
|
"bun": "./src/drivers/boat.ts",
|
|
@@ -163,7 +171,7 @@
|
|
|
163
171
|
"access": "public"
|
|
164
172
|
},
|
|
165
173
|
"name": "@claxedo/sandbox-manager",
|
|
166
|
-
"version": "0.10.
|
|
174
|
+
"version": "0.10.3",
|
|
167
175
|
"scripts": {
|
|
168
176
|
"build": "bun scripts/build.ts",
|
|
169
177
|
"prepublishOnly": "npm run build",
|
|
@@ -172,8 +180,8 @@
|
|
|
172
180
|
"test": "mkdir -p .artifacts/unit && node ../../script/test-deadline.mjs bun test src --reporter=junit --reporter-outfile=.artifacts/unit/junit.xml"
|
|
173
181
|
},
|
|
174
182
|
"dependencies": {
|
|
175
|
-
"@claxedo/helpers": "0.2.
|
|
176
|
-
"@claxedo/sandbox-contract": "0.10.
|
|
183
|
+
"@claxedo/helpers": "0.2.3",
|
|
184
|
+
"@claxedo/sandbox-contract": "0.10.3",
|
|
177
185
|
"@vercel/sandbox": "3.3.0",
|
|
178
186
|
"modal": "0.10.1"
|
|
179
187
|
},
|