{"_id":"@eda-holding-inc/sdk","name":"@eda-holding-inc/sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@eda-holding-inc/sdk","version":"0.1.0","description":"The approval & audit layer for AI agents — gate any tool call with eda.check(). Deterministic policies, human approvals, AI risk scoring, and a full audit log.","type":"module","license":"MIT","homepage":"https://edahq.com","repository":{"type":"git","url":"git+https://github.com/SentinelCollective/eda.git","directory":"packages/sdk"},"keywords":["ai","agents","approval","guardrails","audit","mcp","tool-calling","human-in-the-loop","ai-safety"],"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"sideEffects":false,"engines":{"node":">=18"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.3.5","typescript":"^5.7.2","vitest":"^2.1.8","@eda/config":"0.0.0"},"scripts":{"build":"tsup src/index.ts --format esm,cjs --dts --clean","dev":"tsup src/index.ts --format esm,cjs --dts --watch","typecheck":"tsc --noEmit","test":"vitest run"},"_id":"@eda-holding-inc/sdk@0.1.0","bugs":{"url":"https://github.com/SentinelCollective/eda/issues"},"_integrity":"sha512-gITCZAepv32cy59Slhbo2jYEsSYGdUzfNo7DiobkIcbJkeB801hlpFljIuil1Wt5+0zlmZBiuosBYhILxpLTdA==","_resolved":"/private/var/folders/hl/9vmv_wv55d9d4ksd33r8m94w0000gn/T/7844fe8ba55746a269895e2135185aea/eda-holding-inc-sdk-0.1.0.tgz","_from":"file:eda-holding-inc-sdk-0.1.0.tgz","_nodeVersion":"24.16.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-gITCZAepv32cy59Slhbo2jYEsSYGdUzfNo7DiobkIcbJkeB801hlpFljIuil1Wt5+0zlmZBiuosBYhILxpLTdA==","shasum":"a710c7d8bff248ec96fae81db578624d0d8f763d","tarball":"https://registry.npmjs.org/@eda-holding-inc/sdk/-/sdk-0.1.0.tgz","fileCount":7,"unpackedSize":87557,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD/zaFZS5Avbk6vtd1EcY/lsiBmjzl2N+Ft2qkuhxGzHwIhAIE1rdoEBpfcjGMvymPBvglg3SiDs1LeNZCYI0g5WevG"}]},"_npmUser":{"name":"mrdemisse","email":"naol@sentinelhq.world"},"directories":{},"maintainers":[{"name":"mrdemisse","email":"naol@sentinelhq.world"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sdk_0.1.0_1783082201007_0.6015488945024003"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-03T12:36:40.824Z","0.1.0":"2026-07-03T12:36:41.152Z","modified":"2026-07-03T12:36:41.420Z"},"maintainers":[{"name":"mrdemisse","email":"naol@sentinelhq.world"}],"description":"The approval & audit layer for AI agents — gate any tool call with eda.check(). Deterministic policies, human approvals, AI risk scoring, and a full audit log.","homepage":"https://edahq.com","keywords":["ai","agents","approval","guardrails","audit","mcp","tool-calling","human-in-the-loop","ai-safety"],"repository":{"type":"git","url":"git+https://github.com/SentinelCollective/eda.git","directory":"packages/sdk"},"bugs":{"url":"https://github.com/SentinelCollective/eda/issues"},"license":"MIT","readme":"# @eda-holding-inc/sdk\n\n**The approval & audit layer for AI agents.** One check in front of every tool\ncall — deterministic policies, human approvals, AI risk scoring, and a full\naudit log. No agent touches a refund, a database, or a production API unless\nit passes through you.\n\n```bash\nnpm install @eda-holding-inc/sdk\n# or: curl -fsSL https://cdn.edahq.com/install.sh | sh   (SDK + CLI)\n```\n\n## Quickstart\n\n```ts\nimport { Eda } from \"@eda-holding-inc/sdk\";\n\nconst eda = new Eda({ apiKey: process.env.EDA_API_KEY! });\n\nconst decision = await eda.check({\n  agent: \"support-agent\",\n  action: \"refund_customer\",\n  params: { amount: 120, customerId: \"cus_8842\" },\n});\n\nif (decision.status === \"approved\") {\n  await stripe.refunds.create(/* ... */);\n}\n```\n\nGet an API key at [app.edahq.com](https://app.edahq.com/dashboard/api-keys).\nEvery check is evaluated against the policies you define in your dashboard —\nallow, block, or route to a human — and lands in your audit log.\n\n## The good parts\n\n```ts\n// Wait through a human approval (the agent blocks until someone decides)\nconst result = await eda.checkAndWait(\n  { agent: \"ops-bot\", action: \"deploy_production\" },\n  { timeoutMs: 10 * 60_000, onPoll: (s) => console.log(s.status) },\n);\n\n// Or guard a function — it only runs when approved\nawait eda.guard(\n  { agent: \"support-agent\", action: \"refund_customer\", params: { amount: 5000 } },\n  () => stripe.refunds.create(/* ... */),\n);\n\n// Or protect it permanently\nconst safeRefund = eda.protect(refund, (amount, id) => ({\n  agent: \"support-agent\",\n  action: \"refund_customer\",\n  params: { amount, id },\n}));\n```\n\n### Client options\n\n```ts\nconst eda = new Eda({\n  apiKey: \"eda_live_…\",         // or EDA_API_KEY env\n  agent: \"support-agent\",       // default agent for all checks\n  timeoutMs: 10_000,\n  retry: { attempts: 3 },       // retries 5xx/network with backoff + jitter\n  failMode: \"closed\",           // \"open\" → approve locally if Eda is unreachable\n  dryRun: false,                // true → log-only rollout mode\n  cache: { enabled: true },     // cache identical decisions (TTL)\n  localRules: [                 // client-side rules, zero network calls\n    rule().action(\"delete_*\").block(),\n  ],\n  redactParams: true,           // strips passwords/tokens/cards before sending\n  onDecision: (d, req) => log(d, req),\n});\n```\n\n### Framework adapters (zero dependencies, structural typing)\n\n```ts\nimport {\n  gateTool,             // wrap any async tool function\n  gateAiSdkTools,       // Vercel AI SDK `tools` map\n  guardOpenAiToolCall,  // OpenAI function-calling loops\n  guardAnthropicToolUse,// Anthropic tool_use blocks\n  gateLangChainTool,    // LangChain tools\n  gateMcpHandler,       // MCP servers — gate every tools/call\n} from \"@eda-holding-inc/sdk\";\n\n// Vercel AI SDK\nconst tools = gateAiSdkTools(eda, { sendEmail, refundCustomer }, { agent: \"mail-bot\" });\n\n// MCP server\nserver.setRequestHandler(\n  CallToolRequestSchema,\n  gateMcpHandler(eda, \"github\", originalHandler),\n);\n```\n\nDenied calls resolve to a clear message (`\"Action denied by Eda: …\"`) that\nfeeds straight back to the model, or throw `EdaDeniedError` — your choice.\n\n### Typed errors\n\n`EdaAuthError` (401) · `EdaQuotaError` (402) · `EdaForbiddenError` (403) ·\n`EdaRateLimitError` (429) · `EdaTimeoutError` · `EdaNetworkError` ·\n`EdaDeniedError` · `EdaPendingTimeoutError`\n\n### AI-assisted setup\n\n```bash\nnpx @eda-holding-inc/cli init      # or `eda init` after the installer\n```\n\n`eda init` scans your codebase, shows you exactly where Eda belongs, and — with\nyour approval — writes the integration itself, runs a smoke test, and hands\nyou back a gated codebase. Pay-per-token, no subscription.\n\n---\n\nRuns everywhere `fetch` exists: Node ≥ 18, Bun, Deno, Cloudflare Workers,\nVercel Edge, browsers. ESM + CJS. Zero dependencies.\n\nBuilt by [Eda Holding, Inc.](https://edahq.com/company) ·\n[Terms](https://edahq.com/legal/terms) · [Privacy](https://edahq.com/legal/privacy)\n","readmeFilename":"README.md","_rev":"1-130c6f92413d036374e9bddb8c41b596"}