{"_id":"@agentrewind/codec-anthropic","_rev":"4-ae4e0e69788faf1798d822dcdced98a1","name":"@agentrewind/codec-anthropic","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.0":{"name":"@agentrewind/codec-anthropic","version":"0.1.0","keywords":["anthropic","claude","llm","agents","replay"],"_id":"@agentrewind/codec-anthropic@0.1.0","maintainers":[{"name":"faizancodes","email":"faizanahmed80113@gmail.com"}],"homepage":"https://github.com/faizancodes/agent-rewind#readme","bugs":{"url":"https://github.com/faizancodes/agent-rewind/issues"},"dist":{"shasum":"ecd1ec55a3b23bc6a09ca48ed77a1c5ec1701405","tarball":"https://registry.npmjs.org/@agentrewind/codec-anthropic/-/codec-anthropic-0.1.0.tgz","fileCount":4,"integrity":"sha512-fxj4duNNlMvr653dKUugxXsCMmNGT0L1D4tkmo4PfkG2Avl4N/yfxDcB0F3HWIsT0l0TfKlM4aNRI9JfmaHGPg==","signatures":[{"sig":"MEUCIDyRHHt1PIwgdcSAR1ikhAHIJ+fHZCTT880r2NBSYb4lAiEAlNf6ySbABF4cphc71f3405hl8OHYGsjNRulfNnZe/nw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8807},"main":"./dist/index.js","type":"module","_from":"file:agentrewind-codec-anthropic-0.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --target node20 --tsconfig ../../tsconfig.base.json"},"_npmUser":{"name":"faizancodes","email":"faizanahmed80113@gmail.com"},"_resolved":"/private/var/folders/lx/9cfxw6t518v6pm64gzxsbrkm0000gn/T/08252641cb5a262a44a7275a1ea56638/agentrewind-codec-anthropic-0.1.0.tgz","_integrity":"sha512-fxj4duNNlMvr653dKUugxXsCMmNGT0L1D4tkmo4PfkG2Avl4N/yfxDcB0F3HWIsT0l0TfKlM4aNRI9JfmaHGPg==","repository":{"url":"git+https://github.com/faizancodes/agent-rewind.git","type":"git"},"_npmVersion":"10.9.7","description":"Anthropic Messages API codec for AgentRewind.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@agentrewind/core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@anthropic-ai/sdk":"^0.100.1"},"peerDependencies":{"@anthropic-ai/sdk":"*"},"_npmOperationalInternal":{"tmp":"tmp/codec-anthropic_0.1.0_1780220631148_0.5263964479552719","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@agentrewind/codec-anthropic","version":"0.1.1","keywords":["anthropic","claude","llm","agents","replay"],"_id":"@agentrewind/codec-anthropic@0.1.1","maintainers":[{"name":"faizancodes","email":"faizanahmed80113@gmail.com"}],"homepage":"https://github.com/faizancodes/agent-rewind#readme","bugs":{"url":"https://github.com/faizancodes/agent-rewind/issues"},"dist":{"shasum":"f80744f434394e5c3fa7340e8b37b29f614e2185","tarball":"https://registry.npmjs.org/@agentrewind/codec-anthropic/-/codec-anthropic-0.1.1.tgz","fileCount":4,"integrity":"sha512-z1VuT9JMseT+peiSGer0kRu5foP8vxn9BbMrgUdGFe1zPa53MvuKDQ0RxrqetaUHBnCIS6t/iNTqIqoCn9ScDg==","signatures":[{"sig":"MEUCIBrFN1Fx1wa0A8qZJgxouho4WuTt7zV4qvJUo9kX4sO+AiEAzEjRWAZtXn/Z5rv9W78qD0JiSO5D8VSIwTLXzHDHwEE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8744},"main":"./dist/index.js","type":"module","_from":"file:agentrewind-codec-anthropic-0.1.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --target node20 --tsconfig ../../tsconfig.base.json"},"_npmUser":{"name":"faizancodes","email":"faizanahmed80113@gmail.com"},"_resolved":"/private/var/folders/lx/9cfxw6t518v6pm64gzxsbrkm0000gn/T/c8c3e230762157ea0be86f8364deca20/agentrewind-codec-anthropic-0.1.1.tgz","_integrity":"sha512-z1VuT9JMseT+peiSGer0kRu5foP8vxn9BbMrgUdGFe1zPa53MvuKDQ0RxrqetaUHBnCIS6t/iNTqIqoCn9ScDg==","repository":{"url":"git+https://github.com/faizancodes/agent-rewind.git","type":"git"},"_npmVersion":"10.9.7","description":"Anthropic Messages API codec for AgentRewind.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@agentrewind/core":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@anthropic-ai/sdk":"^0.100.1"},"peerDependencies":{"@anthropic-ai/sdk":"*"},"_npmOperationalInternal":{"tmp":"tmp/codec-anthropic_0.1.1_1780222204446_0.1060851846988271","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@agentrewind/codec-anthropic","version":"0.1.2","keywords":["anthropic","claude","llm","agents","replay"],"_id":"@agentrewind/codec-anthropic@0.1.2","maintainers":[{"name":"faizancodes","email":"faizanahmed80113@gmail.com"}],"homepage":"https://github.com/faizancodes/agent-rewind#readme","bugs":{"url":"https://github.com/faizancodes/agent-rewind/issues"},"dist":{"shasum":"f535d7a583fed0a9ad326ec6dc5c9a7b0424c75d","tarball":"https://registry.npmjs.org/@agentrewind/codec-anthropic/-/codec-anthropic-0.1.2.tgz","fileCount":4,"integrity":"sha512-kK3Ldf6UzjEUaVMPDoX5YOzTfmSjV0UAPkTxAfjUuFNOiXj2xsI4XujirctyGtnZa26rePMmYmEsx0QUlKZeQA==","signatures":[{"sig":"MEUCIQDfZpab+A4+T0irz9ODtK9yKVrX8QYFm2vcy1gTMswO9wIgd8IKF82rHBX0Pk+72a+OS4cjde8JaTFdUbHQBf9XeXM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8979},"main":"./dist/index.js","type":"module","_from":"file:agentrewind-codec-anthropic-0.1.2.tgz","types":"./dist/index.d.ts","engines":{"node":">=20"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"build":"tsup src/index.ts --format esm --dts --target node20 --tsconfig ../../tsconfig.base.json"},"_npmUser":{"name":"faizancodes","email":"faizanahmed80113@gmail.com"},"_resolved":"/private/var/folders/lx/9cfxw6t518v6pm64gzxsbrkm0000gn/T/61c882a395b86a67c8e80425301ad590/agentrewind-codec-anthropic-0.1.2.tgz","_integrity":"sha512-kK3Ldf6UzjEUaVMPDoX5YOzTfmSjV0UAPkTxAfjUuFNOiXj2xsI4XujirctyGtnZa26rePMmYmEsx0QUlKZeQA==","repository":{"url":"git+https://github.com/faizancodes/agent-rewind.git","type":"git"},"_npmVersion":"10.9.7","description":"Anthropic Messages API codec for AgentRewind.","directories":{},"_nodeVersion":"22.22.2","dependencies":{"@agentrewind/core":"0.1.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@anthropic-ai/sdk":"^0.100.1"},"peerDependencies":{"@anthropic-ai/sdk":"*"},"_npmOperationalInternal":{"tmp":"tmp/codec-anthropic_0.1.2_1780347990588_0.08759137469776546","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@agentrewind/codec-anthropic","version":"0.1.4","description":"Anthropic Messages API codec for AgentRewind.","type":"module","keywords":["anthropic","claude","llm","agents","replay"],"engines":{"node":">=20"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"publishConfig":{"access":"public"},"peerDependencies":{"@anthropic-ai/sdk":"*"},"dependencies":{"@agentrewind/core":"0.1.4"},"devDependencies":{"@anthropic-ai/sdk":"^0.100.1"},"repository":{"type":"git","url":"git+https://github.com/faizancodes/agent-rewind.git"},"homepage":"https://github.com/faizancodes/agent-rewind#readme","bugs":{"url":"https://github.com/faizancodes/agent-rewind/issues"},"scripts":{"build":"tsup src/index.ts --format esm --dts --target node20 --tsconfig ../../tsconfig.base.json"},"_id":"@agentrewind/codec-anthropic@0.1.4","_integrity":"sha512-7BK2a0ZcHroObIJ8m4DAC4vU5Wcz/rumWa2Bnvl0OqgYPkSZsc2s8zmesynoeDWF37BwZMK1nKu9ZWHy84GcOw==","_resolved":"/private/var/folders/lx/9cfxw6t518v6pm64gzxsbrkm0000gn/T/b7c1d944928ccdf8305c558e6714709b/agentrewind-codec-anthropic-0.1.4.tgz","_from":"file:agentrewind-codec-anthropic-0.1.4.tgz","_nodeVersion":"22.22.2","_npmVersion":"10.9.7","dist":{"integrity":"sha512-7BK2a0ZcHroObIJ8m4DAC4vU5Wcz/rumWa2Bnvl0OqgYPkSZsc2s8zmesynoeDWF37BwZMK1nKu9ZWHy84GcOw==","shasum":"f5b26b2d2d6e4c9809549b9352eaadb9345f2f1c","tarball":"https://registry.npmjs.org/@agentrewind/codec-anthropic/-/codec-anthropic-0.1.4.tgz","fileCount":4,"unpackedSize":8979,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDg9vWSw5CeawoNSzFLfZan7bXVYoVQpDepCOqN3IZKcQIgAtUTjYm6n3yk5Hh0qqLX6bv8W3j9VvKVuBfuzSuRcOs="}]},"_npmUser":{"name":"faizancodes","email":"faizanahmed80113@gmail.com"},"directories":{},"maintainers":[{"name":"faizancodes","email":"faizanahmed80113@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/codec-anthropic_0.1.4_1780376746167_0.5089630630348831"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-31T09:43:51.033Z","modified":"2026-06-02T05:05:46.437Z","0.1.0":"2026-05-31T09:43:51.294Z","0.1.1":"2026-05-31T10:10:04.608Z","0.1.2":"2026-06-01T21:06:30.741Z","0.1.4":"2026-06-02T05:05:46.314Z"},"bugs":{"url":"https://github.com/faizancodes/agent-rewind/issues"},"homepage":"https://github.com/faizancodes/agent-rewind#readme","keywords":["anthropic","claude","llm","agents","replay"],"repository":{"type":"git","url":"git+https://github.com/faizancodes/agent-rewind.git"},"description":"Anthropic Messages API codec for AgentRewind.","maintainers":[{"name":"faizancodes","email":"faizanahmed80113@gmail.com"}],"readme":"# @agentrewind/codec-anthropic\n\nAnthropic Messages API codec for AgentRewind.\n\nUse this package when your agent calls the Anthropic TypeScript SDK through the\nMessages API.\n\n## Install\n\nMost users get this codec through the SDK:\n\n```sh\nnpm install @agentrewind/sdk\n```\n\nUse this package directly only when a library needs granular dependency\nboundaries.\n\n## Supported Client Shape\n\nThe codec wraps:\n\n- `client.messages.create(request)`\n- `client.messages.stream(request)`\n\n## Recording\n\n```ts\nimport { AgentRewind, Anthropic, anthropicCodec, assertProviderClient, defineHarness } from \"@agentrewind/sdk\";\nimport type { AnthropicMessage, AnthropicRawMessageStreamEvent } from \"@agentrewind/sdk\";\n\nconst client = new Anthropic({\n  apiKey: process.env.ANTHROPIC_API_KEY\n});\n\nconst codec = anthropicCodec();\nassertProviderClient(client, codec);\n\nconst harness = defineHarness(async (ctx) => {\n  const message = await ctx.model.create<AnthropicMessage>(\n    {\n      model: \"claude-opus-4-8\",\n      max_tokens: 256,\n      system: \"Answer with operational detail.\",\n      messages: [{ role: \"user\", content: `Request ${ctx.uuid()}` }]\n    },\n    { site: \"draft-answer\" }\n  );\n\n  return message.content;\n});\n\nconst recorded = await AgentRewind.recordRun(\n  {\n    id: \"anthropic-demo\",\n    store: \".rewind\",\n    model: client,\n    codec\n  },\n  harness\n);\n```\n\n## Replay\n\nStrict replay needs no live model client:\n\n```ts\nconst replayed = await AgentRewind.replayRun(\n  recorded.path,\n  { codec: anthropicCodec() },\n  harness\n);\n```\n\n## Streaming\n\n`ctx.model.stream()` calls `client.messages.stream()` under the hood:\n\n```ts\nassertProviderClient(client, codec, [\"stream\"]);\n```\n\n```ts\nawait session.run(async (ctx) => {\n  for await (const event of ctx.model.stream<AnthropicRawMessageStreamEvent>(\n    {\n      model: \"claude-opus-4-8\",\n      max_tokens: 256,\n      messages: [{ role: \"user\", content: \"Stream one sentence.\" }]\n    },\n    { site: \"stream-answer\" }\n  )) {\n    console.log(event.type);\n  }\n});\n```\n\n## Notes\n\n- `metadata` is treated as volatile and stripped from strict request\n  fingerprints.\n- Anthropic input token usage includes regular, cache creation, and cache read\n  input tokens.\n- The codec preserves raw responses in the normalized response for local replay\n  fidelity.\n- This package targets Anthropic Messages. It does not wrap transport-level\n  `fetch`.\n","readmeFilename":"README.md"}