{"_id":"@blacklake-systems/depth-sdk","_rev":"6-f93aebade2e235968492814879c7ddb6","name":"@blacklake-systems/depth-sdk","dist-tags":{"latest":"0.2.2"},"versions":{"0.1.0":{"name":"@blacklake-systems/depth-sdk","version":"0.1.0","license":"MIT","_id":"@blacklake-systems/depth-sdk@0.1.0","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"dist":{"shasum":"0d30a217c6521d26d7f030816a7da148cb5a2618","tarball":"https://registry.npmjs.org/@blacklake-systems/depth-sdk/-/depth-sdk-0.1.0.tgz","fileCount":65,"integrity":"sha512-TfuRtuL9BjA1F82Gq6f38vymb7wB1t0AEArVYCRHPtMuZLcwK0YY4wREGX1RwWTTj1Fvwt0ukmnH7A7/GebZKg==","signatures":[{"sig":"MEYCIQDofwHE6Bo/XdEcypjo3PhVt4csrk1/S+3vhbP45sTIUgIhAKUsPTrBFCWio51L+iNsAhKi4knUmlJ7YVOuP779lbSL","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":105643},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"3340cd97312df7928184623659b8b82e10c40f32","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"blacklake-team","email":"team@blacklake.systems"},"deprecated":"Use the unified package: npm i blacklake. (If this warning appears while installing \"blacklake\" itself, ignore it — this is an internal dep.)","_npmVersion":"10.9.4","description":"Durable execution engine for AI agent workflows","directories":{},"_nodeVersion":"22.22.0","dependencies":{"drizzle-orm":"^0.39.3","better-sqlite3":"^11.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/depth-sdk_0.1.0_1775990977223_0.12778527757567848","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@blacklake-systems/depth-sdk","version":"0.2.0","license":"MIT","_id":"@blacklake-systems/depth-sdk@0.2.0","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"dist":{"shasum":"6c5bfdb50f86f387b495adbdf3a2a42ae5c69cf0","tarball":"https://registry.npmjs.org/@blacklake-systems/depth-sdk/-/depth-sdk-0.2.0.tgz","fileCount":77,"integrity":"sha512-o+tyFFV9RIXCjkBbvbW+2+JJxX8noYLO0qfifHhOtnjGayAb1tW11GkGNhwA9vrmHFqzqD9wXvHI7ZxamKv4kw==","signatures":[{"sig":"MEYCIQCo74N2ySAKtAgrNph87A/JuonTxQGqUBh0FlVXatKv/AIhANlv5U2yen0d0YKtetkWc5meD3LBCjZSTTHMOx/jkwZe","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":151966},"main":"./dist/index.js","type":"module","_from":"file:blacklake-systems-depth-sdk-0.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"blacklake-team","email":"team@blacklake.systems"},"_resolved":"/private/var/folders/8c/y62dgrt959g_27z2kzzpgt440000gp/T/2c17fb47aa5ab05eef7cad530d7b5edf/blacklake-systems-depth-sdk-0.2.0.tgz","_integrity":"sha512-o+tyFFV9RIXCjkBbvbW+2+JJxX8noYLO0qfifHhOtnjGayAb1tW11GkGNhwA9vrmHFqzqD9wXvHI7ZxamKv4kw==","deprecated":"Use the unified package: npm i blacklake. (If this warning appears while installing \"blacklake\" itself, ignore it — this is an internal dep.)","_npmVersion":"10.9.4","description":"Durable execution engine for AI agent workflows","directories":{},"_nodeVersion":"22.22.0","dependencies":{"drizzle-orm":"^0.39.3","better-sqlite3":"^11.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/depth-sdk_0.2.0_1777112408186_0.34386765133895825","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@blacklake-systems/depth-sdk","version":"0.2.1","license":"MIT","_id":"@blacklake-systems/depth-sdk@0.2.1","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"dist":{"shasum":"507f16c1867b8e6e3d28fa99c02988afd8110542","tarball":"https://registry.npmjs.org/@blacklake-systems/depth-sdk/-/depth-sdk-0.2.1.tgz","fileCount":78,"integrity":"sha512-x4XwPOnJubLr1BYDDAkTrFFXuoPOVnMt8u2tv9p0DkT6azMZ1HtqVeZJxe2fYTD5zqZKLemU00KVgueFqq/e8A==","signatures":[{"sig":"MEYCIQC/DQvUdC5eI+dA2WUlWDBHJ4VTRImEBELRxQEBV6QnlQIhAPVafKl0oS5MYaoeUv4Mfk+660gvkWkhqZ1RnoNG4yT6","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":155286},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"415b8892c93fdbbd573876944b35aa1083ce1e71","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"blacklake-team","email":"team@blacklake.systems"},"deprecated":"Use the unified package: npm i blacklake. (If this warning appears while installing \"blacklake\" itself, ignore it — this is an internal dep.)","_npmVersion":"10.9.4","description":"BlackLake Depth — durable execution engine for AI agent workflows. Pairs with Surface (cloud or self-hosted).","directories":{},"_nodeVersion":"22.22.0","dependencies":{"drizzle-orm":"^0.39.3","better-sqlite3":"^11.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.1.1","typescript":"^5.8.3","@types/node":"^22.14.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/depth-sdk_0.2.1_1777474290369_0.6668228211423244","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@blacklake-systems/depth-sdk","version":"0.2.2","license":"MIT","_id":"@blacklake-systems/depth-sdk@0.2.2","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"dist":{"shasum":"8179f2e224373166fd20303e30e190457b5ae616","tarball":"https://registry.npmjs.org/@blacklake-systems/depth-sdk/-/depth-sdk-0.2.2.tgz","fileCount":87,"integrity":"sha512-yrWdE52C09DoRQ+HTdlGOW2Z8hrU36Nye7d+h7xgMfzH8W7HaMjtMg+1rGr4dlEqYrNE0GtMlwXdgRdC06EWvg==","signatures":[{"sig":"MEUCIBH8JJxp8hsZHnX7QWcuAn58jmGCzJc7sH8pV2ioUGj1AiEAq0cSwSk/6mqGOcNPKS3TvNwqimGKpbEzWZn/IlP5Lqw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":194442},"main":"./dist/index.js","type":"module","_from":"file:blacklake-systems-depth-sdk-0.2.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc"},"_npmUser":{"name":"blacklake-team","email":"team@blacklake.systems"},"_resolved":"/private/var/folders/8c/y62dgrt959g_27z2kzzpgt440000gp/T/3c8f31187e164a046ce50c8803be9cde/blacklake-systems-depth-sdk-0.2.2.tgz","_integrity":"sha512-yrWdE52C09DoRQ+HTdlGOW2Z8hrU36Nye7d+h7xgMfzH8W7HaMjtMg+1rGr4dlEqYrNE0GtMlwXdgRdC06EWvg==","deprecated":"Use the unified package: npm i blacklake. (Internal dep; ignore this warning when installing blacklake.)","_npmVersion":"10.9.4","description":"BlackLake Depth — durable workflow runtime for AI agent workflows. Runs under Surface governance.","directories":{},"_nodeVersion":"22.22.0","dependencies":{"drizzle-orm":"^0.45.2","better-sqlite3":"^11.0.0"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^22.14.0","@types/better-sqlite3":"^7.6.13"},"_npmOperationalInternal":{"tmp":"tmp/depth-sdk_0.2.2_1778864312665_0.9238928575484868","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-04-12T10:49:37.113Z","modified":"2026-05-15T17:02:09.264Z","0.1.0":"2026-04-12T10:49:37.354Z","0.2.0":"2026-04-25T10:20:08.356Z","0.2.1":"2026-04-29T14:51:30.522Z","0.2.2":"2026-05-15T16:58:32.810Z"},"license":"MIT","description":"BlackLake Depth — durable workflow runtime for AI agent workflows. Runs under Surface governance.","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"readme":"# @blacklake-systems/depth-sdk\n\n> **⚠️ Deprecated.** This package is now part of the unified [`blacklake`](https://www.npmjs.com/package/blacklake) npm package. Install `blacklake` and `import { workflow, step } from 'blacklake'`. See the [migration doc](https://www.blacklake.systems/docs/migration-from-old-packages) for sed-style search-and-replace examples. This package will continue to ship as a thin re-export through the next two minor versions.\n\nDurable workflows for [BlackLake](https://www.blacklake.systems) — long-running AI work as TypeScript async functions, persisting each step to a local SQLite database so runs can resume from where they left off after a crash or restart. Now part of the unified `blacklake` package.\n\nBlackLake is AI control infrastructure and analytics. Surface evaluates tool calls against your policies and budgets before they execute, routes approvals, records cost, and signs receipts. Run Surface at [console.blacklake.systems](https://console.blacklake.systems) or locally via `npx blacklake serve`; run Depth workflows from the npm package and connect them to whichever Surface control plane you use.\n\n## Install\n\n```bash\nnpm install @blacklake-systems/depth-sdk\n```\n\n## Quick Start\n\nSign up at [console.blacklake.systems](https://console.blacklake.systems) for hosted Surface when you need shared controls, then write a workflow:\n\n```typescript\nimport { workflow, step } from '@blacklake-systems/depth-sdk';\n\nexport default workflow('expense-report', async (ctx) => {\n  const summary = await step(ctx, 'summarise', async () => {\n    return await ctx.llm('anthropic:claude-sonnet-4-6', {\n      prompt: 'Summarise this month\\'s expenses.',\n    });\n  });\n\n  await step(ctx, 'file-report', async () => {\n    // tool calls route through Surface for governance automatically\n    await ctx.tool('filesystem.writeFile', {\n      path: './report.md',\n      content: summary,\n    });\n  });\n\n  return { summary };\n});\n```\n\nRun it with the CLI:\n\n```bash\nnpx @blacklake-systems/depth-cli run workflow.ts\n```\n\nOr connect the workflow to hosted Surface at console.blacklake.systems.\n\n## Local Surface\n\nIf you prefer to run Surface locally, start it first:\n\n```bash\nnpx @blacklake-systems/surface-cli\n```\n\nDepth detects Surface at `localhost:3100` automatically — no additional configuration needed.\n\n## Surface Integration\n\nWhen Surface is reachable, Depth automatically:\n\n- Routes tool calls through Surface's governance engine\n- Creates approvals in Surface's console for human review\n- Tracks costs in Surface's usage dashboard\n\nWhen Surface is not reachable, tool calls execute directly.\n\n## API Reference\n\n### `workflow(name, fn)`\n\nDefine a durable workflow.\n\n```typescript\nimport { workflow } from '@blacklake-systems/depth-sdk';\n\nexport default workflow('my-workflow', async (ctx, input: { topic: string }) => {\n  // ctx.llm, ctx.tool, and step() are available here\n  return { result: 'done' };\n});\n```\n\n### `step(ctx, name, fn)`\n\nWrap a unit of work in a durable step. The return value is persisted; on replay the function is skipped and the stored value is returned.\n\n```typescript\nimport { step } from '@blacklake-systems/depth-sdk';\n\nconst result = await step(ctx, 'step-name', async () => {\n  return await someExpensiveOperation();\n});\n```\n\n### `ctx.llm(model, options)`\n\nCall a language model. Supported prefixes: `anthropic:`, `openai:`, `ollama:`.\n\n```typescript\nconst text = await ctx.llm('anthropic:claude-sonnet-4-6', {\n  prompt: 'Write a haiku about durable execution.',\n});\n```\n\n### `ctx.tool(name, args)`\n\nInvoke a tool. When Surface is running, the call is governed before execution.\n\n```typescript\nawait ctx.tool('filesystem.writeFile', { path: './out.md', content: text });\n```\n\n## Documentation\n\nFull documentation at [blacklake.systems/docs](https://blacklake.systems/docs).\n","readmeFilename":"README.md"}