@evelandhq/sandbox-bwrap 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -11
- package/dist/backend.js +10 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -54,18 +54,24 @@ This package requires `eve` `>=0.27.0 <1.0.0`.
|
|
|
54
54
|
The range is deliberately wide. eve's 0.x releases use caret-incompatible minor bumps,
|
|
55
55
|
so a package that pins a narrow window has to republish for every eve minor — which is
|
|
56
56
|
churn for consumers, not safety, when the surface actually consumed is one small
|
|
57
|
-
interface (`SandboxBackend` from `eve/sandbox`) that
|
|
58
|
-
|
|
57
|
+
interface (`SandboxBackend` from `eve/sandbox`) that changes rarely. Rather than
|
|
58
|
+
re-declaring the window, CI keeps the claim honest from both ends:
|
|
59
59
|
`src/eve-compatibility.test.ts` typechecks the backend against the range's exact floor
|
|
60
60
|
(0.27.13) and the newest verified release on every run, and a scheduled workflow re-runs
|
|
61
61
|
the suite against `eve@latest` so a breaking eve minor shows up as a red build here
|
|
62
|
-
instead of a bug report from your deployment.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
instead of a bug report from your deployment. That is not theoretical: eve 0.32.0 added a
|
|
63
|
+
required `stop()` to the backend handle. This package implements it; 0.1.0 does not, and
|
|
64
|
+
pairing that release with eve `>=0.32.0` resolves cleanly and then fails at runtime the
|
|
65
|
+
first time authored code calls `ctx.getSandbox().stop()`.
|
|
66
|
+
|
|
67
|
+
The backend implements both handle lifecycle methods by killing every process the session
|
|
68
|
+
has spawned that has not yet exited: `shutdown()`, which eve calls at server teardown and
|
|
69
|
+
which requires that nothing be left running afterwards, and `stop()`, which authored code
|
|
70
|
+
triggers mid-run through `ctx.getSandbox().stop()`. Backends with provider-side compute
|
|
71
|
+
distinguish the two — a container to pause, a VM to snapshot; bwrap has no such resource,
|
|
72
|
+
because the processes are the compute. Neither method touches the session's workspace
|
|
73
|
+
directory — it is durable state, and remains available when the session reattaches or the
|
|
74
|
+
next callback reopens it.
|
|
69
75
|
|
|
70
76
|
### Options
|
|
71
77
|
|
|
@@ -103,8 +109,8 @@ reattach when a session resumes. Each session key gets a directory that is reuse
|
|
|
103
109
|
the lifetime of the session; each template is cached per (template key, options hash), with
|
|
104
110
|
an optional release revision in the options hash,
|
|
105
111
|
and reused across sessions. This backend intentionally does not prune either — its
|
|
106
|
-
`shutdown()`
|
|
107
|
-
disk, so reattach is instant and stateless from the agent's perspective. On a long-lived
|
|
112
|
+
`stop()` and `shutdown()` methods only kill the session's live processes and leave the
|
|
113
|
+
workspace on disk, so reattach is instant and stateless from the agent's perspective. On a long-lived
|
|
108
114
|
host, this means the cache will grow with the number of durable sessions and unique
|
|
109
115
|
templates, consuming disk space indefinitely. On eveland deployments this cache lives at
|
|
110
116
|
`EVELAND_SANDBOX_CACHE_DIR` (one subdirectory per project), outside every release
|
package/dist/backend.js
CHANGED
|
@@ -118,6 +118,16 @@ export function createBwrapSandboxBackend(input = {}) {
|
|
|
118
118
|
async captureState() {
|
|
119
119
|
return { backendName: BWRAP_BACKEND_NAME, metadata: {}, sessionKey };
|
|
120
120
|
},
|
|
121
|
+
// eve (>=0.32) calls this when authored code runs
|
|
122
|
+
// `ctx.getSandbox().stop()` mid-run: stop the compute, keep the durable
|
|
123
|
+
// session. Backends with provider-side compute distinguish this from
|
|
124
|
+
// shutdown() — a container to pause, a VM to snapshot. bwrap has no such
|
|
125
|
+
// resource: the processes are the compute and the workspace directory is
|
|
126
|
+
// the session, so stopping is killing the processes, and the next
|
|
127
|
+
// create() reopens the same workspace.
|
|
128
|
+
async stop() {
|
|
129
|
+
await session.killAll();
|
|
130
|
+
},
|
|
121
131
|
// eve calls this when the server is shutting down: nothing may be left
|
|
122
132
|
// running afterwards. The workspace directory IS the durable state, so
|
|
123
133
|
// it stays on disk and the session reattaches on the next start.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evelandhq/sandbox-bwrap",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "bubblewrap SandboxBackend for eve agents — real exec sandboxing without Docker or KVM",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/node": "^26.0.1",
|
|
42
42
|
"ai": "^7.0.44",
|
|
43
|
-
"eve": "0.
|
|
43
|
+
"eve": "0.33.2",
|
|
44
44
|
"eve-floor": "npm:eve@0.27.13",
|
|
45
45
|
"oxfmt": "0.58.0",
|
|
46
46
|
"oxlint": "1.73.0",
|