{"_id":"@bentway/anthropic","_rev":"5-eefb985ae7094045d6fd981a1250013c","name":"@bentway/anthropic","dist-tags":{"latest":"0.5.1"},"versions":{"0.1.0":{"name":"@bentway/anthropic","version":"0.1.0","keywords":["bentway","llm","agent","anthropic","claude","port"],"author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"license":"Apache-2.0","_id":"@bentway/anthropic@0.1.0","maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"homepage":"https://github.com/bentway-dev/bentway#readme","bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"dist":{"shasum":"d1a211ac45f8f19444462a49f5bcc1a9cfd41948","tarball":"https://registry.npmjs.org/@bentway/anthropic/-/anthropic-0.1.0.tgz","fileCount":13,"integrity":"sha512-OSwUFp0eKLrQ7qLOTC05amGl/bkib8bItLAIO0pF4ce+U3TsgmvG6yC73IFHVUmB1F+LLGpudX349otCg/EX0Q==","signatures":[{"sig":"MEYCIQDes+GufAkrzMb3L3PVAJ6QrzolcG4pcIQt8QXgTQuwuQIhAPwtfQqDtWI2xuFPMTsCZ0ekS9WOtrmpkEafYfyPPu+7","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":46248},"type":"module","_from":"file:/tmp/bw-boot/bentway-anthropic-0.1.0.tgz","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.mts","default":"./src/index.mjs"}},"scripts":{"test":"bash scripts/check-file-sizes.sh && bash scripts/check-api-report.sh","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"},"_resolved":"/tmp/bw-boot/bentway-anthropic-0.1.0.tgz","_integrity":"sha512-OSwUFp0eKLrQ7qLOTC05amGl/bkib8bItLAIO0pF4ce+U3TsgmvG6yC73IFHVUmB1F+LLGpudX349otCg/EX0Q==","repository":{"url":"git+https://github.com/bentway-dev/bentway.git","type":"git","directory":"packages/anthropic"},"_npmVersion":"10.9.4","description":"Anthropic /v1/messages completion port for the bentway kernel","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","dependencies":{"@bentway/core":"0.1.0","@bentway/stream-json":"0.1.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/anthropic_0.1.0_1782164833549_0.5434315099144171","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@bentway/anthropic","version":"0.2.0","keywords":["bentway","llm","agent","anthropic","claude","port"],"author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"license":"Apache-2.0","_id":"@bentway/anthropic@0.2.0","maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"homepage":"https://github.com/bentway-dev/bentway#readme","bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"dist":{"shasum":"8f6dc79606b028f5ada2b9b78005dd39bee0c1fd","tarball":"https://registry.npmjs.org/@bentway/anthropic/-/anthropic-0.2.0.tgz","fileCount":13,"integrity":"sha512-Qp0rpOgB+1V6J1qmasvMky6/hejFJe2i/heQYEycWG0+jOZb8vm14C2AgE4Qcn5RMbKCepQBj4eIHbna3IADxA==","signatures":[{"sig":"MEYCIQC4pd7uReGOunXP1X4p2qVIQo/4iY2+cUHY29wVCF56zgIhANAYE1yjvE+Sy+wizYt17aTzmE1ddEhE2aGWhiulf4l0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bentway%2fanthropic@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46248},"type":"module","_from":"file:/tmp/bw-out/bentway-anthropic-0.2.0.tgz","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.mts","default":"./src/index.mjs"}},"scripts":{"test":"bash scripts/check-file-sizes.sh && bash scripts/check-api-report.sh","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c09e71d1-b3cb-4277-8242-6c72ccacd924"}},"_resolved":"/tmp/bw-out/bentway-anthropic-0.2.0.tgz","_integrity":"sha512-Qp0rpOgB+1V6J1qmasvMky6/hejFJe2i/heQYEycWG0+jOZb8vm14C2AgE4Qcn5RMbKCepQBj4eIHbna3IADxA==","repository":{"url":"git+https://github.com/bentway-dev/bentway.git","type":"git","directory":"packages/anthropic"},"_npmVersion":"11.17.0","description":"Anthropic /v1/messages completion port for the bentway kernel","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@bentway/core":"0.2.0","@bentway/stream-json":"0.2.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/anthropic_0.2.0_1782181164550_0.8295027385348326","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@bentway/anthropic","version":"0.3.0","keywords":["bentway","llm","agent","anthropic","claude","port"],"author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"license":"Apache-2.0","_id":"@bentway/anthropic@0.3.0","maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"homepage":"https://github.com/bentway-dev/bentway#readme","bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"dist":{"shasum":"b82ff02e7e182ce6e14ebbbbf9639056f5d0033b","tarball":"https://registry.npmjs.org/@bentway/anthropic/-/anthropic-0.3.0.tgz","fileCount":13,"integrity":"sha512-VuJm9CHYpoeTo9FphFGEO+pX4nmPmwzgfP64g/g8oQsSHr0wgEb7ncoBw//9G1VYaLk085D0OM+2RqirYE/fUg==","signatures":[{"sig":"MEQCIH6ylVz9K/P+Ex84gOHeYQTt1e1sBFOpUtWXIUKgvNajAiBe5FhC0Q6jd3MqnkP0L3dcv44ftZQDWEHvN5tPzuiaBw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bentway%2fanthropic@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46248},"type":"module","_from":"file:/tmp/bw-out/bentway-anthropic-0.3.0.tgz","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.mts","default":"./src/index.mjs"}},"scripts":{"test":"bash scripts/check-file-sizes.sh && bash scripts/check-api-report.sh","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c09e71d1-b3cb-4277-8242-6c72ccacd924"}},"_resolved":"/tmp/bw-out/bentway-anthropic-0.3.0.tgz","_integrity":"sha512-VuJm9CHYpoeTo9FphFGEO+pX4nmPmwzgfP64g/g8oQsSHr0wgEb7ncoBw//9G1VYaLk085D0OM+2RqirYE/fUg==","repository":{"url":"git+https://github.com/bentway-dev/bentway.git","type":"git","directory":"packages/anthropic"},"_npmVersion":"11.17.0","description":"Anthropic /v1/messages completion port for the bentway kernel","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@bentway/core":"0.3.0","@bentway/stream-json":"0.3.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/anthropic_0.3.0_1782187511912_0.11830427350178652","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@bentway/anthropic","version":"0.4.0","keywords":["bentway","llm","agent","anthropic","claude","port"],"author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"license":"Apache-2.0","_id":"@bentway/anthropic@0.4.0","maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"homepage":"https://github.com/bentway-dev/bentway#readme","bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"dist":{"shasum":"1e3f564e49a62aeffb76b9dcba27bc05cf283e75","tarball":"https://registry.npmjs.org/@bentway/anthropic/-/anthropic-0.4.0.tgz","fileCount":13,"integrity":"sha512-dNnWON4v8MTdCp+o2O2NwI5tpwx964GmROkPMGkWUDr1C3VTGIZlDB9WuDCltniBOUDdtobTsM39Thw2nhfnDg==","signatures":[{"sig":"MEYCIQCNpZyZcGsgV+UZ1lWQcrNkB54q3xle0ejxZdi4A/U0hgIhAJXnnLj3+MDOGINOCO+qCzbQ+5eKk46PUtn6t+Qv1H6y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bentway%2fanthropic@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46248},"type":"module","_from":"file:/tmp/bw-out/bentway-anthropic-0.4.0.tgz","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.mts","default":"./src/index.mjs"}},"scripts":{"test":"bash scripts/check-file-sizes.sh && bash scripts/check-api-report.sh","build":"tsc","typecheck":"tsc --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c09e71d1-b3cb-4277-8242-6c72ccacd924"}},"_resolved":"/tmp/bw-out/bentway-anthropic-0.4.0.tgz","_integrity":"sha512-dNnWON4v8MTdCp+o2O2NwI5tpwx964GmROkPMGkWUDr1C3VTGIZlDB9WuDCltniBOUDdtobTsM39Thw2nhfnDg==","repository":{"url":"git+https://github.com/bentway-dev/bentway.git","type":"git","directory":"packages/anthropic"},"_npmVersion":"11.17.0","description":"Anthropic /v1/messages completion port for the bentway kernel","directories":{},"sideEffects":false,"_nodeVersion":"22.22.3","dependencies":{"@bentway/core":"0.4.0","@bentway/stream-json":"0.4.0"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.7.0","@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/anthropic_0.4.0_1782243843825_0.4770905344269347","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@bentway/anthropic","version":"0.5.1","description":"Anthropic /v1/messages completion port for the bentway kernel","keywords":["bentway","llm","agent","anthropic","claude","port"],"homepage":"https://github.com/bentway-dev/bentway#readme","bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"license":"Apache-2.0","author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"repository":{"type":"git","url":"git+https://github.com/bentway-dev/bentway.git","directory":"packages/anthropic"},"type":"module","exports":{".":{"types":"./dist/index.d.mts","default":"./src/index.mjs"}},"engines":{"node":">=22"},"sideEffects":false,"publishConfig":{"access":"public","provenance":true},"dependencies":{"@bentway/core":"0.5.1","@bentway/stream-json":"0.5.1"},"devDependencies":{"@types/node":"^22.0.0","typescript":"^5.7.0"},"scripts":{"build":"tsc","typecheck":"tsc --noEmit","test":"bash scripts/check-file-sizes.sh && bash scripts/check-api-report.sh"},"_id":"@bentway/anthropic@0.5.1","_integrity":"sha512-F4CEN9Qm6oyKnw7zNyp5Cv/X6e8QoINCJI1YIzKFfwUx/mzmg7u7v5fl1eMkc7zmU3FqLIHDek/WugDWXKpVSQ==","_resolved":"/tmp/bw-out/bentway-anthropic-0.5.1.tgz","_from":"file:/tmp/bw-out/bentway-anthropic-0.5.1.tgz","_nodeVersion":"22.23.1","_npmVersion":"11.18.0","dist":{"integrity":"sha512-F4CEN9Qm6oyKnw7zNyp5Cv/X6e8QoINCJI1YIzKFfwUx/mzmg7u7v5fl1eMkc7zmU3FqLIHDek/WugDWXKpVSQ==","shasum":"0303bad4dd323a51db89f62bc68e57c46cf53453","tarball":"https://registry.npmjs.org/@bentway/anthropic/-/anthropic-0.5.1.tgz","fileCount":13,"unpackedSize":46248,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bentway%2fanthropic@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIH8P5Yoh3gK1H8ibeOos0uomPaVxU0w6iv3Ko4yt8aBUAiEAxvXR1dCRugMiKFLA8jsmSc6hJ+wV0I8OAnWI7EqYVos="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:c09e71d1-b3cb-4277-8242-6c72ccacd924"}},"directories":{},"maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/anthropic_0.5.1_1783013209072_0.6037891373504667"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-22T21:47:13.408Z","modified":"2026-07-02T17:26:49.593Z","0.1.0":"2026-06-22T21:47:13.673Z","0.2.0":"2026-06-23T02:19:24.680Z","0.3.0":"2026-06-23T04:05:12.064Z","0.4.0":"2026-06-23T19:44:03.995Z","0.5.1":"2026-07-02T17:26:49.247Z"},"bugs":{"url":"https://github.com/bentway-dev/bentway/issues"},"author":{"name":"Nathan Sentjens","email":"nate@bentway.dev"},"license":"Apache-2.0","homepage":"https://github.com/bentway-dev/bentway#readme","keywords":["bentway","llm","agent","anthropic","claude","port"],"repository":{"type":"git","url":"git+https://github.com/bentway-dev/bentway.git","directory":"packages/anthropic"},"description":"Anthropic /v1/messages completion port for the bentway kernel","maintainers":[{"name":"nsentjens","email":"fluffy-stats6r@icloud.com"}],"readme":"# @bentway/anthropic\n\nAnthropic /v1/messages completion port for the bentway kernel.\n\nPart of [Bentway](https://github.com/bentway-dev/bentway), a runtime-agnostic\nagent execution kernel.\n\n## Install\n\n```\nnpm install @bentway/anthropic @bentway/core @bentway/stream-json\n```\n\n## Usage\n\n`complete()` POSTs the /v1/messages endpoint, accumulates the SSE stream,\nand resolves to the neutral `PortResult` shape the turn loop reads\ndirectly. Expected transport failures resolve to the neutral error shape\ninstead of throwing.\n\n```js\nimport {\n  complete,\n  selectThinkingConfig,\n  makeAnthropicSerializeRequest,\n  computeAnthropicTotalCostUsd,\n} from '@bentway/anthropic';\n\nconst { thinking, output_config } = selectThinkingConfig({\n  model: 'claude-opus-4-8',\n  max_tokens: 4096,\n});\n\nconst serializeRequest = makeAnthropicSerializeRequest({\n  apiKey: process.env.ANTHROPIC_API_KEY,\n  baseUrl: 'https://api.anthropic.com',\n  model: 'claude-opus-4-8',\n  max_tokens: 4096,\n  system: 'You are helpful.',\n  runtimeTools: { tools: [] },\n  thinking,\n  output_config,\n});\n\n// Inject `complete` and `serializeRequest` into runTurnLoop from\n// @bentway/core, plus `computeAnthropicTotalCostUsd` as the cost function.\n```\n\nThe package also exports `accumulateAnthropicStream` (the pure SSE folder)\nand `convertRuntimeToolsToAnthropicTools` for downstream reuse and testing.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}