@evelandhq/sandbox-bwrap 0.2.0 → 0.3.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.
package/dist/backend.js CHANGED
@@ -7,7 +7,7 @@ import { createBwrapOptionsHash, resolveBwrapSandboxOptions } from "./options.js
7
7
  import { resolveBwrapCacheRoot, resolveSessionPath, resolveTemplatePath, WORKSPACE_ROOT, } from "./paths.js";
8
8
  import { createNodeProcessRunner, describeMissingPrereqs, isBwrapAvailable } from "./process.js";
9
9
  import { createBwrapSession } from "./session.js";
10
- import { cloneDirectoryAtomically, createBwrapCacheLease, registerActiveCachePath, touchCacheMetadata, } from "./cache.js";
10
+ import { cloneDirectoryAtomically, createBwrapCacheLease, registerActiveCachePath, removeCacheMetadata, touchCacheMetadata, } from "./cache.js";
11
11
  const EVE_MODEL_SKILL_ROOT = "$HOME/.agents/skills";
12
12
  /**
13
13
  * Stable backend name. Participates in eve's template/session cache-key
@@ -186,6 +186,23 @@ export function createBwrapSandboxBackend(input = {}) {
186
186
  async shutdown() {
187
187
  await session.killAll();
188
188
  },
189
+ // eve (>=0.47) calls this when authored code runs
190
+ // `ctx.getSandbox().delete()`: the sandbox and its disposable state are
191
+ // gone for good, and the next access reprovisions from the template.
192
+ // For bwrap the disposable state is the session workspace directory and
193
+ // its metadata sidecar; the template it was cloned from is shared and
194
+ // must survive.
195
+ async delete(deleteOptions) {
196
+ deleteOptions?.abortSignal?.throwIfAborted();
197
+ await session.killAll();
198
+ generations.delete(sessionPath);
199
+ await rm(sessionPath, { force: true, recursive: true });
200
+ await removeCacheMetadata({
201
+ cacheRoot: resolveBwrapCacheRoot(runtimeContext.appRoot, options.cacheDir),
202
+ kind: "session",
203
+ id: basename(sessionPath),
204
+ });
205
+ },
189
206
  };
190
207
  },
191
208
  };
package/dist/cache.d.ts CHANGED
@@ -73,3 +73,13 @@ export declare function touchCacheMetadata(input: {
73
73
  templateRevision?: string | null;
74
74
  now?: Date;
75
75
  }): Promise<BwrapCacheMetadata>;
76
+ /**
77
+ * Removes one cache entry's metadata sidecar. Deleting a session removes its
78
+ * workspace directory too, and a metadata file without a directory would read
79
+ * as an orphan to `pruneBwrapCache` — remove both together.
80
+ */
81
+ export declare function removeCacheMetadata(input: {
82
+ cacheRoot: string;
83
+ kind: BwrapCacheEntryKind;
84
+ id: string;
85
+ }): Promise<void>;
package/dist/cache.js CHANGED
@@ -281,3 +281,11 @@ export async function touchCacheMetadata(input) {
281
281
  }
282
282
  return metadata;
283
283
  }
284
+ /**
285
+ * Removes one cache entry's metadata sidecar. Deleting a session removes its
286
+ * workspace directory too, and a metadata file without a directory would read
287
+ * as an orphan to `pruneBwrapCache` — remove both together.
288
+ */
289
+ export async function removeCacheMetadata(input) {
290
+ await rm(metadataPath(input.cacheRoot, input.kind, input.id), { force: true });
291
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evelandhq/sandbox-bwrap",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
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.37.0",
43
+ "eve": "0.47.2",
44
44
  "eve-floor": "npm:eve@0.27.13",
45
45
  "oxfmt": "0.58.0",
46
46
  "oxlint": "1.73.0",