{"_id":"@designteam/adapter-anthropic-api","_rev":"2-110b32f0ab66e71c7762e467b32e89f0","name":"@designteam/adapter-anthropic-api","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@designteam/adapter-anthropic-api","version":"0.1.0","license":"MIT","_id":"@designteam/adapter-anthropic-api@0.1.0","maintainers":[{"name":"pablostanley","email":"pablostanley1@gmail.com"}],"homepage":"https://designteam.app","bugs":{"url":"https://github.com/pablostanley/designteam-app/issues"},"dist":{"shasum":"e3be51b641a132c562677ba65e796a7aa698e558","tarball":"https://registry.npmjs.org/@designteam/adapter-anthropic-api/-/adapter-anthropic-api-0.1.0.tgz","fileCount":8,"integrity":"sha512-ZbXuHfSmqH8v5EDNzSN9Xqcbb3fEHIEE5V7X7FQ2N++6ofAgr6QiSUyjsrmG+r9Cyawc7K7wVogRN+t6inQfDA==","signatures":[{"sig":"MEQCIEdIUeCsDxPK7OcBtysK7fVm8iq7ijqvPmyG3S3PWLSrAiBpXjKZOb/lNZHFpaz41yt1ZkIYYKXBNbkzXiDwhImN1w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@designteam%2fadapter-anthropic-api@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":40958},"main":"./dist/index.cjs","type":"module","_from":"file:designteam-adapter-anthropic-api-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"dev":"tsup --watch","lint":"tsc --noEmit","test":"vitest run","build":"tsup"},"_npmUser":{"name":"pablostanley","email":"pablostanley1@gmail.com"},"_resolved":"/tmp/1dc733332ffaa8010854c42b972db9ae/designteam-adapter-anthropic-api-0.1.0.tgz","_integrity":"sha512-ZbXuHfSmqH8v5EDNzSN9Xqcbb3fEHIEE5V7X7FQ2N++6ofAgr6QiSUyjsrmG+r9Cyawc7K7wVogRN+t6inQfDA==","repository":{"url":"git+https://github.com/pablostanley/designteam-app.git","type":"git","directory":"packages/adapter-anthropic-api"},"_npmVersion":"11.11.0","description":"Design Team adapter that dispatches tasks directly to the Anthropic Messages API. The autonomous-mode adapter — no Claude Code, no human required. Reports token cost for budget tracking.","directories":{},"_nodeVersion":"24.14.1","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","vitest":"^4.1.2","typescript":"^5.0.0"},"peerDependencies":{"@designteam/core":"0.3.1","@designteam/adapter-utils":"0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/adapter-anthropic-api_0.1.0_1776617241987_0.34263489227813015","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@designteam/adapter-anthropic-api","version":"0.1.1","description":"Design Team adapter that dispatches tasks directly to the Anthropic Messages API. The autonomous-mode adapter — no Claude Code, no human required. Reports token cost for budget tracking.","license":"MIT","homepage":"https://designteam.app","repository":{"type":"git","url":"git+https://github.com/pablostanley/designteam-app.git","directory":"packages/adapter-anthropic-api"},"bugs":{"url":"https://github.com/pablostanley/designteam-app/issues"},"type":"module","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"}},"devDependencies":{"tsup":"^8.0.0","typescript":"^5.0.0","vitest":"^4.1.2"},"peerDependencies":{"@designteam/adapter-utils":"0.1.0","@designteam/core":"0.3.1"},"scripts":{"build":"tsup","dev":"tsup --watch","test":"vitest run","lint":"tsc --noEmit"},"_id":"@designteam/adapter-anthropic-api@0.1.1","_integrity":"sha512-lbkjHUR5j+S735ydP86N58h0ZG4NT+YQu6r+gF6UmrMhMeEHnr6/c8r7DOrk7Iy50XNs4pz9HaM7bN/wr3z3GA==","_resolved":"/tmp/3ccab7f153aaa95382d1605b79e17830/designteam-adapter-anthropic-api-0.1.1.tgz","_from":"file:designteam-adapter-anthropic-api-0.1.1.tgz","_nodeVersion":"24.14.1","_npmVersion":"11.11.0","dist":{"integrity":"sha512-lbkjHUR5j+S735ydP86N58h0ZG4NT+YQu6r+gF6UmrMhMeEHnr6/c8r7DOrk7Iy50XNs4pz9HaM7bN/wr3z3GA==","shasum":"646f2ce6d51b25582574f17e7a0ca621eef3d301","tarball":"https://registry.npmjs.org/@designteam/adapter-anthropic-api/-/adapter-anthropic-api-0.1.1.tgz","fileCount":8,"unpackedSize":42212,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@designteam%2fadapter-anthropic-api@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID9Tc81GLTri4sxBiNZMuznkA9x7lbXvlnqaZTDVyQwFAiEA98aSlOVuslPjODsV8nte2/cATBeyOzNqUhpfvRnrGv4="}]},"_npmUser":{"name":"pablostanley","email":"pablostanley1@gmail.com"},"directories":{},"maintainers":[{"name":"pablostanley","email":"pablostanley1@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-anthropic-api_0.1.1_1776625407872_0.7089689343315748"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-19T16:47:21.843Z","modified":"2026-04-19T19:03:28.305Z","0.1.0":"2026-04-19T16:47:22.123Z","0.1.1":"2026-04-19T19:03:27.997Z"},"bugs":{"url":"https://github.com/pablostanley/designteam-app/issues"},"license":"MIT","homepage":"https://designteam.app","repository":{"type":"git","url":"git+https://github.com/pablostanley/designteam-app.git","directory":"packages/adapter-anthropic-api"},"description":"Design Team adapter that dispatches tasks directly to the Anthropic Messages API. The autonomous-mode adapter — no Claude Code, no human required. Reports token cost for budget tracking.","maintainers":[{"name":"pablostanley","email":"pablostanley1@gmail.com"}],"readme":"# @designteam/adapter-anthropic-api\n\n[Design Team](https://designteam.app) adapter that dispatches tasks\ndirectly to the Anthropic Messages API. The **autonomous-mode** adapter\n— no Claude Code, no human in the loop. Runs in any Node process with\nan API key.\n\nReports token usage via `reportCost()` so the CLI's budget hard-stop\ncan trip before you burn through your allowance.\n\nSee the monorepo root's `adapter-plugin.md` for the full adapter spec.\n\n## Install\n\n```sh\npnpm add @designteam/adapter-anthropic-api\n```\n\n## Usage\n\n```ts\nimport { registerAdapter } from '@designteam/adapter-utils'\nimport { createAnthropicApiAdapter } from '@designteam/adapter-anthropic-api'\n\nregisterAdapter(createAnthropicApiAdapter({\n  apiKey: process.env.ANTHROPIC_API_KEY,  // or omit — it's the default\n  model: 'claude-sonnet-4-6',             // default\n  maxTokens: 4096,                        // default\n  temperature: 1.0,                       // default\n}))\n```\n\nThe Design Team CLI auto-registers this adapter when `ANTHROPIC_API_KEY`\nis set in the environment. Run it via:\n\n```sh\ndesignteam run <plan-id> <task-id> --adapter=@designteam/adapter-anthropic-api\n```\n\n## What the model sees\n\nSame prompt shape as `@designteam/adapter-claude-cli` — agent identity +\npersonality + mood + per-agent memory + team memory + user profile +\ntask brief. See that package's README for the full rendered example.\n\n## Cost reporting\n\nWhen the API response includes a `usage` block, `reportCost()` returns:\n\n```ts\n{\n  model: 'anthropic:claude-sonnet-4-6',\n  inputTokens: <count>,\n  outputTokens: <count>,\n  usdCents: <cents, rounded up>,\n}\n```\n\nDefault pricing covers Sonnet 4.6, Opus 4.7, and Haiku 4.5 at published\nrates (April 2026). Override via the `pricing` option for contract rates\nor newer models:\n\n```ts\ncreateAnthropicApiAdapter({\n  pricing: {\n    'claude-sonnet-4-6': { inputCentsPerMTok: 300, outputCentsPerMTok: 1500 },\n    'claude-opus-4-7':   { inputCentsPerMTok: 1500, outputCentsPerMTok: 7500 },\n  },\n})\n```\n\n**Unknown models:** if the response's model isn't in the pricing table\n(default or override), `reportCost()` returns a report with `usdCents`\n**omitted** rather than falling back to a default rate. An unknown model\ngenuinely means \"we don't know the rate\" — silently billing at e.g.\nSonnet rates for an Opus-tier model would defeat the budget hard-stop.\nHosts can detect `usdCents === undefined` and estimate, warn, or refuse.\n\nThe Design Team CLI's runner calls `reportCost()` after each successful\ntask and appends to `.designteam/budget.jsonl`. Set a cap with\n`designteam budget set --usd=N` and the next `designteam run` refuses\nif the period's spend has hit it.\n\n## Outcome mapping\n\n| API response | Adapter outcome | Host transition |\n|---|---|---|\n| 2xx with `content[].text` | `done` (summary = first 800 chars of text) | `progress --done` |\n| 2xx with empty content | `error` (`no text content`) | release checkout, log |\n| non-2xx | `error` (message includes status + body) | release checkout, log |\n| `ctx.signal.aborted` | `cancelled` reason `signal.aborted` | `progress --cancel` |\n| exceeds `timeoutMs` | `cancelled` reason `timeout` | `progress --cancel` |\n\n## Options\n\n```ts\ninterface AnthropicApiAdapterOptions {\n  apiKey?: string             // default process.env.ANTHROPIC_API_KEY\n  model?: string              // default 'claude-sonnet-4-6'\n  maxTokens?: number          // default 4096\n  temperature?: number        // default 1.0\n  id?: string                 // default '@designteam/adapter-anthropic-api'\n  pricing?: Record<string, { inputCentsPerMTok; outputCentsPerMTok }>\n  baseUrl?: string            // default 'https://api.anthropic.com'\n  fetchImpl?: typeof fetch    // for tests / custom transports\n  timeoutMs?: number          // default 15 minutes\n}\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}