{"_id":"@blacklake-systems/sdk","_rev":"9-f62c03c4e085853558c65bc24ae12ea3","name":"@blacklake-systems/sdk","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@blacklake-systems/sdk","version":"0.1.0","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.0","maintainers":[{"name":"james-blacklake","email":"james@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"9621113b70d63cc9b025011fde0b102b82611deb","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.0.tgz","fileCount":7,"integrity":"sha512-gZAdHx81MhKjgfuOhVPBbajfmHqFsa6YbgRuydWRkwZQO4R5CLFn92Ee2jgb5EeAjDWlmj3Um6u0bD+H29S0+g==","signatures":[{"sig":"MEQCIFRjPSge9TUxfsTBub4fqteeR7UvKqQdSL2D31/sa8TxAiBXzoOls57YirwKQawQKc5Mb1Pharr4ADfqO4p4Q/b/pg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27521},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"10c87f1da20bf003ee83f8738f569b8b1b18d483","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"james-blacklake","email":"james@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for the BlackLake Control Plane — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.0_1775572877388_0.014930438408157443","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"},"0.1.1":{"name":"@blacklake-systems/sdk","version":"0.1.1","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.1","maintainers":[{"name":"james-blacklake","email":"james@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"3fe78df41449b9c68a0ac2eff72480a5dce9efcd","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.1.tgz","fileCount":7,"integrity":"sha512-rJ2s40YqTLxRg/04300+1L41okA98LBoG9OUYUVC3s9R61Q27bRl4TTN9nsWt+NspoXPDupZr006Yp0mwshTfA==","signatures":[{"sig":"MEUCIQDKKafdMekH7R+CcfHr4bj5RrSoXTgOUL9m4zABRwdA9AIgaRkksZeKrbZ7PQRjzUDC9F3OrCR9m4TY5HpyEUMdM/8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28069},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"42fb72a5c782e14e42fd1d48c7419fdc9b5463e9","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"james-blacklake","email":"james@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for the BlackLake Control Plane — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.1_1775579681204_0.9398293260571542","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"},"0.1.2":{"name":"@blacklake-systems/sdk","version":"0.1.2","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.2","maintainers":[{"name":"james-blacklake","email":"james@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"ee387cbb6ae05caf190cb6d59928c456f9b8073e","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.2.tgz","fileCount":7,"integrity":"sha512-WcIVYVDbTfhCktYUpdY8BhgccklfCjely00b0ob32Kgam357w3vw37FUWJa+LNQnOfBCHu3riGn8M+yny868kw==","signatures":[{"sig":"MEYCIQD+YGotUFSJGGjsuDDsAVPWtd05I6b7RZfPS1qlcT2LDAIhAMoHWAY9U1e/KrNhkIKzK+yC7/0JUpcXxHHOKCnxReIC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31822},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a7a80669e1e60ef6c03b65d235efb4c7633bbe39","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"james-blacklake","email":"james@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for the BlackLake Control Plane — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.2_1775583243090_0.43908990435563133","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"},"0.1.3":{"name":"@blacklake-systems/sdk","version":"0.1.3","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.3","maintainers":[{"name":"james-blacklake","email":"james@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"d57dcd6a8b4574f464ec0a1c5b13389d45091caa","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.3.tgz","fileCount":7,"integrity":"sha512-STsnVX2NeN4+kz7G/ilGB4GaWKeo5h/Xip4t2GF6ThAHIeCe3KPsS50O7Qk6wHycsBLliaZLx3Q4o1KWi2a93w==","signatures":[{"sig":"MEUCIQDsW93fkw/xFfEU611WqJBbTgQbNBu0IGfRyq0z2BC9CwIgE9wQb1Ip21xhip28Ts/mr9BL87C5nguMim22ukKFMws=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31961},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"a7a80669e1e60ef6c03b65d235efb4c7633bbe39","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"james-blacklake","email":"james@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for the BlackLake Control Plane — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.3_1775583797764_0.18184104469847018","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"},"0.1.4":{"name":"@blacklake-systems/sdk","version":"0.1.4","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.4","maintainers":[{"name":"james-blacklake","email":"james@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"291bf1282c4425eead354bb520b8ce53f22a0285","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.4.tgz","fileCount":7,"integrity":"sha512-XGKZ7SckyDmwH7dEHisZOesYUTv/i/TXS/8u860FTbg3xlDeY1UQ7tFuXZZGcjrJ2ChAES48e9qGCIMlALQ9jw==","signatures":[{"sig":"MEUCIA/LIFnkd3dQ8y+wk/oO3Pgk3kmAmy/V1MaxsHoHTANZAiEA/+q/d6aA2TZjDaBKAvRlwjhkRQaYDnkMvQIWDFW2l4Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47008},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"6e130cbd854effc87f2be3e1e97aa497605f0e1c","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"james-blacklake","email":"james@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for the BlackLake Control Plane — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.4_1775646339026_0.2593092499924923","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"},"0.1.5":{"name":"@blacklake-systems/sdk","version":"0.1.5","keywords":["blacklake","agent","governance","control-plane","sdk"],"license":"MIT","_id":"@blacklake-systems/sdk@0.1.5","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"homepage":"https://blacklake.systems/product","bugs":{"url":"https://blacklake.systems/support"},"dist":{"shasum":"f7bb8a5145496cf95eab07de0b3795df87751589","tarball":"https://registry.npmjs.org/@blacklake-systems/sdk/-/sdk-0.1.5.tgz","fileCount":7,"integrity":"sha512-tct1Z9wigpwNRYXFYKD4y3qyBCdLPKxTXT6ANhxG/VBAJ/mCchspJVSBHMj4eGFLjf9T9BqA13pZs0z4I/Grzw==","signatures":[{"sig":"MEUCIQDl/LjG8f+HWRdMh67AuFFWwXuI48wSl0owNmsR9MBA7gIgJHUep7xJrqgPYHdWgebeYleEGWEdO7RegMpy7iz/wIE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46988},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"2c58dd7bdf34711448a1a89a236193612d396832","scripts":{"build":"tsc","prepublishOnly":"tsc"},"_npmUser":{"name":"blacklake-team","email":"team@blacklake.systems"},"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"_npmVersion":"10.9.4","description":"TypeScript SDK for BlackLake Surface — agent governance infrastructure","directories":{},"_nodeVersion":"22.22.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/sdk_0.1.5_1775928855337_0.8730777452047906","host":"s3://npm-registry-packages-npm-production"},"deprecated":"Renamed to @blacklake-systems/surface-sdk"}},"time":{"created":"2026-04-07T14:41:17.251Z","modified":"2026-04-12T09:21:57.262Z","0.1.0":"2026-04-07T14:41:17.544Z","0.1.1":"2026-04-07T16:34:41.344Z","0.1.2":"2026-04-07T17:34:03.232Z","0.1.3":"2026-04-07T17:43:17.903Z","0.1.4":"2026-04-08T11:05:39.163Z","0.1.5":"2026-04-11T17:34:15.467Z"},"bugs":{"url":"https://blacklake.systems/support"},"license":"MIT","homepage":"https://blacklake.systems/product","keywords":["blacklake","agent","governance","control-plane","sdk"],"repository":{"url":"git+https://github.com/blacklake-systems/control-plane.git","type":"git","directory":"packages/sdk"},"description":"TypeScript SDK for BlackLake Surface — agent governance infrastructure","maintainers":[{"name":"blacklake-team","email":"team@blacklake.systems"}],"readme":"# @blacklake-systems/sdk\n\nTypeScript SDK for [BlackLake Surface](https://blacklake.systems/product) — agent governance infrastructure.\n\n## Install\n\n```bash\nnpm install @blacklake-systems/sdk\n```\n\n## Quick Start\n\n```typescript\nimport { BlackLake } from '@blacklake-systems/sdk';\n\nconst bl = new BlackLake({\n  apiKey: process.env.BLACKLAKE_API_KEY!,\n});\n\n// Evaluate governance before executing a tool call\nconst result = await bl.govern({\n  agent: 'expense-bot',\n  tool: 'payments.send',\n  action: { amount: 4200, vendor: 'Acme Corp' },\n});\n\nif (result.decision === 'allow') {\n  // proceed with tool call\n}\n```\n\nSign up at [console.blacklake.systems](https://console.blacklake.systems) to get your API key. The console also provides a dashboard for managing agents, tools, policies, and reviewing the audit trail.\n\n## API Reference\n\n### `new BlackLake(config)`\n\n| Option | Type | Default | Description |\n|--------|------|---------|-------------|\n| `apiKey` | `string` | — | Your BlackLake API key (required) |\n| `baseUrl` | `string` | `https://api.blacklake.systems` | API base URL. Override only for local development (e.g. `http://localhost:3100`). |\n\n### `bl.govern(request)`\n\nEvaluate whether an agent is allowed to invoke a tool.\n\n```typescript\nconst result = await bl.govern({\n  agent: 'expense-bot',       // agent name\n  tool: 'payments.send',      // tool name\n  action: { amount: 4200 },   // optional: tool invocation payload\n  context: { ip: '10.0.0.1' } // optional: request metadata\n});\n\n// result.decision: 'allow' | 'deny' | 'approval_required' | 'default_deny'\n// result.evaluation_id: string\n// result.policy_id: string | null\n// result.reason: string\n// result.evaluated_at: string (ISO 8601)\n// result.approval_id: string | undefined (set when decision === 'approval_required')\n```\n\n### `bl.agents`\n\n```typescript\nawait bl.agents.create({ name, environment, risk_classification, description?, approval_mode? });\nawait bl.agents.list({ environment?, status? });\nawait bl.agents.get(id);\nawait bl.agents.update(id, { name?, description?, environment?, risk_classification?, status?, approval_mode? });\nawait bl.agents.suspend(id);\nawait bl.agents.activate(id);\nawait bl.agents.bindTool(agentId, toolId);\nawait bl.agents.listTools(agentId);   // returns ToolBinding[] — each item has { binding_id, binding_created_at, tool: Tool }\nawait bl.agents.unbindTool(agentId, toolId);\n```\n\n### `bl.tools`\n\n```typescript\nawait bl.tools.create({ name, risk_classification, description? });\nawait bl.tools.list();\nawait bl.tools.get(id);\n```\n\n### `bl.policies`\n\n```typescript\nawait bl.policies.create({ name, priority, outcome, agent_selector?, tool_selector?, enabled? });\nawait bl.policies.list();\nawait bl.policies.get(id);\nawait bl.policies.update(id, { name?, priority?, outcome?, agent_selector?, tool_selector?, enabled? });\nawait bl.policies.delete(id);\n```\n\n### `bl.evaluations`\n\n```typescript\nawait bl.evaluations.list({ agent_id?, tool_id?, outcome?, limit?, offset? });\nawait bl.evaluations.get(id);\n```\n\n### `bl.organisation`\n\n```typescript\nawait bl.organisation.get();                  // fetch the current organisation (derived from the API key)\nawait bl.organisation.delete(confirmation);   // permanently delete the organisation; pass the organisation's exact name as confirmation\n```\n\n### `bl.apiKeys`\n\n```typescript\nawait bl.apiKeys.list();              // returns { keys: ApiKey[] } — each item has { id, name, key_suffix, created_at, revoked_at }\nawait bl.apiKeys.create('prod-key');  // returns { id, name, key, created_at, warning } — the raw key is shown ONCE; store it securely\nawait bl.apiKeys.revoke(id);          // sets revoked_at on the key; the API rejects revoking the key in use\n```\n\n### `bl.approvals`\n\n```typescript\nawait bl.approvals.list({ status?, agent_id?, tool_id?, limit?, offset? });  // returns PaginatedResponse<Approval>\nawait bl.approvals.get(id);\nawait bl.approvals.status(id);                                               // returns ApprovalStatusResponse — lightweight poll target\nawait bl.approvals.approve(id, { decided_by, reason });\nawait bl.approvals.reject(id, { decided_by, reason });\nawait bl.approvals.wait(id, { interval?, timeout? });                        // polls status until approved/rejected/expired; throws BlackLakeError on timeout\n```\n\n`wait()` defaults to polling every 2 000 ms with a 5-minute total timeout. Returns the fully-populated `Approval` once the status leaves `'pending'`.\n\n### `bl.webhooks`\n\n```typescript\nawait bl.webhooks.list();                                          // returns { webhooks: Webhook[] }\nawait bl.webhooks.create({ url, events, enabled? });              // returns CreatedWebhook — the raw signing secret is shown ONCE; store it securely\nawait bl.webhooks.get(id);\nawait bl.webhooks.update(id, { url?, events?, enabled? });\nawait bl.webhooks.delete(id);\nawait bl.webhooks.listDeliveries(id, { limit?, offset? });        // returns PaginatedResponse<WebhookDelivery>\n```\n\nWebhooks fire on `'approval.created'`, `'approval.approved'`, and `'approval.rejected'`. Each request is signed with HMAC-SHA256; the signature is sent in the `X-BlackLake-Signature` header.\n\n### Error Handling\n\n```typescript\nimport { BlackLake, BlackLakeError } from '@blacklake-systems/sdk';\n\ntry {\n  await bl.govern({ agent: 'unknown', tool: 'unknown' });\n} catch (err) {\n  if (err instanceof BlackLakeError) {\n    console.error(err.status, err.code, err.message);\n  }\n}\n```\n\n## Documentation\n\nFull documentation at [blacklake.systems/docs](https://blacklake.systems/docs).\n","readmeFilename":"README.md"}