{"_id":"@acoyfellow/lab","_rev":"3-bec133f56fa937843cfd9eacbc2e499e","name":"@acoyfellow/lab","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@acoyfellow/lab","version":"0.0.1","license":"MIT","_id":"@acoyfellow/lab@0.0.1","maintainers":[{"name":"acoyfellow","email":"Coeyman@gmail.com"}],"dist":{"shasum":"9656debcb4626126e97f12503dded83a54a09a0b","tarball":"https://registry.npmjs.org/@acoyfellow/lab/-/lab-0.0.1.tgz","fileCount":20,"integrity":"sha512-FsOrR3TOCZQ7CqdP2nET9Azzno7dKJkwnqdpzp7n5CvoT7YxRZZIjndchQ14laVgFGbDkdhKhL5PFW+086Sq7A==","signatures":[{"sig":"MEQCIGoX9xPYN+3Asg4UL5zLfspC35LXMf87ZxJ/TNM+vcsjAiAvudMYjlLIrVgOeO/8IcZnXaYpGj0z9Uu5//TsJ78yDQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27556},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./effect":{"types":"./dist/effect.d.ts","import":"./dist/effect.js"}},"gitHead":"21022161ac345e2bf2a19fde8001f8bb08f867b7","scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"tsc -p tsconfig.json"},"_npmUser":{"name":"acoyfellow","email":"Coeyman@gmail.com"},"_npmVersion":"11.6.2","description":"Typed HTTP client for the lab Cloudflare Worker (sandboxed isolates, chains, traces)","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"devDependencies":{"effect":"4.0.0-beta.40","typescript":"^5.9.3"},"peerDependencies":{"effect":">=4.0.0-beta.0 <5"},"peerDependenciesMeta":{"effect":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/lab_0.0.1_1774533149485_0.7309620465343363","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@acoyfellow/lab","version":"0.0.2","license":"MIT","_id":"@acoyfellow/lab@0.0.2","maintainers":[{"name":"acoyfellow","email":"Coeyman@gmail.com"}],"dist":{"shasum":"66c84a7270d9135b1db5f2cc04954a491aa078f4","tarball":"https://registry.npmjs.org/@acoyfellow/lab/-/lab-0.0.2.tgz","fileCount":20,"integrity":"sha512-uob7AP3oQL744uL8/iTdgkdDpW+1KDWSgfJjlqspmmoRu88sTniqXSKmLOVRPim3YmWmt6vaja8EVFq2EquU3Q==","signatures":[{"sig":"MEUCIQCs8XMjTCqY3TuiaHEhnXRrmHs7hnbkURx6UuZE40C2lwIgH+QfZ7M0jLTe+dPA4nGA3JtNTbPm5STUMcl79P2z910=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26886},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./effect":{"types":"./dist/effect.d.ts","import":"./dist/effect.js"}},"gitHead":"1c63d547fed232bc89fdce6518b4ee2dbad61e8f","scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"tsc -p tsconfig.json"},"_npmUser":{"name":"acoyfellow","email":"Coeyman@gmail.com"},"_npmVersion":"11.6.2","description":"Typed HTTP client for the lab Cloudflare Worker (sandboxed isolates, chains, traces)","directories":{},"sideEffects":false,"_nodeVersion":"25.2.1","_hasShrinkwrap":false,"devDependencies":{"effect":"4.0.0-beta.40","typescript":"^5.9.3"},"peerDependencies":{"effect":">=4.0.0-beta.0 <5"},"peerDependenciesMeta":{"effect":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/lab_0.0.2_1774731528041_0.9122592012709398","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@acoyfellow/lab","version":"0.0.3","description":"Typed HTTP client for the Lab public app API (sandboxed isolates, chains, saved results)","license":"MIT","type":"module","sideEffects":false,"engines":{"node":">=18"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./effect":{"types":"./dist/effect.d.ts","import":"./dist/effect.js"}},"peerDependencies":{"effect":">=4.0.0-beta.0 <5"},"peerDependenciesMeta":{"effect":{"optional":true}},"scripts":{"build":"tsc -p tsconfig.json","prepublishOnly":"tsc -p tsconfig.json"},"devDependencies":{"effect":"4.0.0-beta.51","typescript":"^5.9.3"},"_id":"@acoyfellow/lab@0.0.3","gitHead":"f0afeb4e3f8a0a06587ae8d54331e7c7401cd2ca","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-wIYtFO1sXJxLBlZ5PRcUpxTOSFFKAA5d6k5oKJjt82vusUBStR1W8nuIRKBLEXcQJuyYDXhfjtqkIUm6YntzCw==","shasum":"e1bc7347ec7594a176f36cde9ff113135a2b9764","tarball":"https://registry.npmjs.org/@acoyfellow/lab/-/lab-0.0.3.tgz","fileCount":23,"unpackedSize":81942,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDoAzapJp1NIhU2XtXJJvUBoseulzmZ5Rxt9Cgoe6rliAiEAlX4DSfPu7MHney26Ll/Nu68BFqFhCsOZ3OjlCxBt14w="}]},"_npmUser":{"name":"acoyfellow","email":"Coeyman@gmail.com"},"directories":{},"maintainers":[{"name":"acoyfellow","email":"Coeyman@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lab_0.0.3_1778095309049_0.7781954456240769"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-26T13:52:29.409Z","modified":"2026-05-06T19:21:49.284Z","0.0.1":"2026-03-26T13:52:29.608Z","0.0.2":"2026-03-28T20:58:48.196Z","0.0.3":"2026-05-06T19:21:49.170Z"},"license":"MIT","description":"Typed HTTP client for the Lab public app API (sandboxed isolates, chains, saved results)","maintainers":[{"name":"acoyfellow","email":"Coeyman@gmail.com"}],"readme":"# `@acoyfellow/lab`\n\nTyped client and local run spine for [Lab](https://github.com/acoyfellow/lab): repo runs, receipts, sandboxed isolates, capability chains, and saved results.\n\n> **0.0.3** — early feedback. API may change.\n\n## Stable 0.0.1 Boundary\n\nThe repo-run spine treats this package surface as the stable 0.0.1 contract:\n\n| Export | Purpose |\n|--------|---------|\n| `createLabRun` | Run a command against local or Artifacts repo state and write durable evidence |\n| `createRunReceipt` | Build a versioned `lab.run.receipt.v1` receipt |\n| `createSnapshotBranch` | Snapshot dirty local Git state onto a `lab/run-*` branch |\n| `getLabRun` | Read one `.lab/runs/<id>` record |\n| `listLabRuns` | List recent local run receipts |\n| `replayLabRun` | Re-run a previous command with lineage |\n| `resolveRunRepo` | Resolve local or Artifacts repo refs to a working copy |\n| `redactLabSecrets` | Redact `cfut_*` and `art_v1_*` credentials from durable evidence |\n| `LAB_RUN_RECEIPT_SCHEMA_VERSION` | Current receipt schema version, `lab.run.receipt.v1` |\n| `LAB_RUN_STABLE_API` | Machine-readable list of stable repo-run exports |\n\nEverything outside that table remains usable, but not part of the repo-run 0.0.1 compatibility promise yet.\n\n## Install\n\n```bash\nnpm install @acoyfellow/lab\n```\n\nRequires Node 18+ or any runtime with global `fetch` (Cloudflare Workers, Deno, Bun).\n\n## Usage\n\n### Repo Runs\n\n```ts\nimport { createLabRun, listLabRuns } from \"@acoyfellow/lab\";\n\nconst run = await createLabRun({\n  repo: { type: \"local\", path: process.cwd() },\n  snapshot: { mode: \"branch\", prefix: \"lab/run\" },\n  executor: { type: \"local\" },\n  command: [\"sh\", \"-lc\", \"bun test\"],\n});\n\nconsole.log(run.receipt);\nconsole.log(await listLabRuns({ root: process.cwd() }));\n```\n\n### Hosted API\n\n```ts\nimport { createLabClient } from \"@acoyfellow/lab\";\n\nconst lab = createLabClient({\n  baseUrl: \"https://your-lab.example\",\n});\n\nconst r = await lab.runChain([\n  { body: \"return [1, 2, 3]\", capabilities: [] },\n  { body: \"return input.map(n => n * 2)\", capabilities: [] },\n]);\n\nconsole.log(r.result);  // [2, 4, 6]\n```\n\n`baseUrl` is the public app origin for Lab — either your deployed app hostname or your own self-hosted origin. See [Self-host](https://github.com/acoyfellow/lab#self-host).\n\n## API\n\n| Method | HTTP route |\n|--------|------|\n| `createLabRun(input)` | local package API |\n| `listLabRuns({ root })` | local package API |\n| `getLabRun(id, { root })` | local package API |\n| `runSandbox({ body, capabilities? })` | `POST /run` |\n| `runKv({ body, capabilities? })` | `POST /run/kv` |\n| `runChain(steps)` | `POST /run/chain` |\n| `runSpawn({ body, capabilities, depth? })` | `POST /run/spawn` |\n| `runGenerate({ prompt, capabilities })` | `POST /run/generate` |\n| `seed()` | `POST /seed` |\n| `getResult(id)` | `GET /results/:id.json` |\n\n`GET /results/:id` is the human viewer on the public app. Agents and scripts should read `GET /results/:id.json`.\n\nUse `body` for guest JavaScript. `code` is a legacy alias. Default template: `guest@v1`.\n\n**Effect client:** `import { createLabEffectClient } from \"@acoyfellow/lab/effect\"` — same methods, returns `Effect` instead of `Promise`. Peer dependency: `effect@4.0.0-beta.40`.\n\n**Agent discovery:** `import { fetchLabCatalog } from \"@acoyfellow/lab\"` for capability hints and execute paths.\n\n## Errors\n\nNon-2xx responses with JSON bodies are parsed and returned (not thrown). Only non-JSON responses throw.\n\n## Local dev\n\nWith `bun dev` running in the [Lab](https://github.com/acoyfellow/lab) repo:\n\n```ts\ncreateLabClient({ baseUrl: \"http://localhost:5173\" });\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}