{"_id":"@aprovan/sandbox-bashkit","name":"@aprovan/sandbox-bashkit","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aprovan/sandbox-bashkit","version":"0.1.0","type":"module","description":"Run Aprovan sandboxes in-process on WASM: the @utdk/sandbox driver backed by bashkit's bash interpreter and virtual filesystem — no container, no credential, works in Node and the browser","keywords":["aprovan","sandbox","bashkit","wasm","utdk"],"license":"MIT","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"dependencies":{"@everruns/bashkit-wasm":"^0.14.4","@utdk/sandbox":"^0.2.0"},"devDependencies":{"@types/node":"^25.5.0","typescript":"^5.7.3","vitest":"2.1.5"},"engines":{"node":">=20.0.0"},"scripts":{"build":"tsc -p tsconfig.json","check-types":"tsc -p tsconfig.json --noEmit","typecheck":"tsc -p tsconfig.json --noEmit","clean":"rm -rf dist","test":"vitest run"},"_id":"@aprovan/sandbox-bashkit@0.1.0","_integrity":"sha512-xi28l4ttmb8tfMO6GSJgnoJNr6Ixy0SOa3CLn2f4Mx8iXqiszBN6VGuuu0NAsNT7AFCnMv9K86um0+aqDeWK6w==","_resolved":"/private/var/folders/pg/bzc309f16d19bj6yvj14wr0h0000gn/T/tmp.G8oiMT2HYm/20c0c3a2c00bbcd9de7edbe9f8a5e25b/aprovan-sandbox-bashkit-0.1.0.tgz","_from":"file:aprovan-sandbox-bashkit-0.1.0.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-xi28l4ttmb8tfMO6GSJgnoJNr6Ixy0SOa3CLn2f4Mx8iXqiszBN6VGuuu0NAsNT7AFCnMv9K86um0+aqDeWK6w==","shasum":"229eff3943472a089ca77576b1128792bbc45451","tarball":"https://registry.npmjs.org/@aprovan/sandbox-bashkit/-/sandbox-bashkit-0.1.0.tgz","fileCount":12,"unpackedSize":61475,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHY/SaKgn18/UjuqBtOgQGc04qSdjUeTCf7Bvdj61xoeAiBDgXTIvMsozC4Ba67jNh1C42g/cCIQS0XtviO9rt3CRA=="}]},"_npmUser":{"name":"jacobsampson","email":"jacob.samps@gmail.com"},"directories":{},"maintainers":[{"name":"jacobsampson","email":"jacob.samps@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sandbox-bashkit_0.1.0_1785698198634_0.8914280340654426"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-02T19:16:38.515Z","0.1.0":"2026-08-02T19:16:38.789Z","modified":"2026-08-02T19:16:38.974Z"},"maintainers":[{"name":"jacobsampson","email":"jacob.samps@gmail.com"}],"description":"Run Aprovan sandboxes in-process on WASM: the @utdk/sandbox driver backed by bashkit's bash interpreter and virtual filesystem — no container, no credential, works in Node and the browser","keywords":["aprovan","sandbox","bashkit","wasm","utdk"],"license":"MIT","readme":"# @aprovan/sandbox-bashkit\n\nAprovan sandboxes on a WASM bash interpreter. A first-party implementation of\nthe `@utdk/sandbox` driver contract, backed by\n[`@everruns/bashkit-wasm`](https://github.com/everruns/bashkit): each sandbox\nis one `Bash` instance with a private virtual filesystem, running **in the\ncalling process** — no container, no host registration, no credential.\n\n## Where it sits among the providers\n\n| | machine (`@aprovan/sandbox-host`) | fly / cloudflare | **bashkit** |\n| --- | --- | --- | --- |\n| Toolchain | whatever the machine has | container image | bash + text tools (`grep`, `sed`, `awk`, `find`, `jq`, …) |\n| Isolation | a directory boundary | hardware | total — the \"filesystem\" is a data structure this instance owns |\n| Credential | host registration | vendor account | **none** |\n| Persistence | real disk | varies | process memory (`persist: false`) |\n\nThat credentiallessness is why the `sandbox` interface's compat entry marks it\n`credentialless`: it is the zero-config default a workspace resolves to when\nnothing is bound and nothing is connected — the free, conservative answer.\nAnything that needs `node`, `git`, or the network binds a vendor or registers\na machine instead.\n\n## Driver surface\n\n`createBashkitClient()` returns the standard `SandboxDriver`:\n\n```\ncreate / get / list / destroy\nexec                        { id, command, cwd?, env?, stdin?, timeoutMs? }\nreadFile / writeFile / deleteFile\nlistFiles                   → [{ path, hash (sha256), size }]\n```\n\n`listFiles` hashes with the same sha256-of-UTF-8 identity the workspace FS\nstore uses, so the `sandboxes` core service's manifest diff works unchanged.\nTwo honest limitations, both surfaced loudly rather than papered over:\n\n- **No wall clock.** The WASM build has no timer, so `timeoutMs` is accepted\n  and unenforced; runaway scripts are cut by the interpreter's fuel budgets\n  and come back as exit code 124.\n- **Text only.** The VFS stores strings; a base64 (binary) `writeFile` is\n  refused with a 400 instead of being decoded into corruption.\n\nThere is no `git` binary and no network inside the box — by design. A repo\narrives the way everything does: over HTTP into the workspace VFS, then into\nthe sandbox as a mount (see `apps/workspace/tests/sandbox-bashkit.test.ts`\nfor the end-to-end flow against a real GitHub repo).\n\n## Browser validation\n\nThe package is browser-safe: the only `node:*` imports are dynamic and behind\na runtime check that never passes in a browser, and the wasm is\nsingle-threaded — no SharedArrayBuffer, no COOP/COEP headers. The repo has no\nbrowser test runner, so validation is a standalone page rather than a new\nframework:\n\n```bash\npnpm --filter @aprovan/sandbox-bashkit build\ncd packages/sandbox-bashkit\nnpx serve ..    # any static server that follows symlinks works\n# open http://localhost:3000/sandbox-bashkit/demo/\n```\n\n[`demo/index.html`](./demo/index.html) drives the real driver — create,\nwriteFile, a `tr` pipeline via exec, and a hashed `listFiles` manifest — and\nprints PASS/FAIL. It resolves `@everruns/bashkit-wasm` and `@utdk/sandbox`\nthrough an import map into `node_modules`, so it must be served from the\npackage's parent directory (pnpm's symlinked layout is followed by every\ncommon static server).\n\n## Tests\n\n```bash\npnpm --filter @aprovan/sandbox-bashkit test\n```\n\nRuns the driver against the real interpreter — no mocks; the interpreter is\ncheap enough that faking it would test less than running it.\n","readmeFilename":"README.md","_rev":"1-3fb6becd8384ba1a25db8441748ef5e7"}