{"_id":"@agenticprimitives/rate-control-cloudflare","_rev":"5-98cccadae6830f65d453b98fa3acdb75","name":"@agenticprimitives/rate-control-cloudflare","dist-tags":{"latest":"0.0.0-alpha.5"},"versions":{"0.0.0-alpha.1":{"name":"@agenticprimitives/rate-control-cloudflare","version":"0.0.0-alpha.1","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter"],"license":"MIT","_id":"@agenticprimitives/rate-control-cloudflare@0.0.0-alpha.1","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/rate-control-cloudflare","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"2efa3e5d4115819f23c5ad3acd31587ec71d70b2","tarball":"https://registry.npmjs.org/@agenticprimitives/rate-control-cloudflare/-/rate-control-cloudflare-0.0.0-alpha.1.tgz","fileCount":20,"integrity":"sha512-KkjHG728it2sZiRAEYC702xXTQ/S9oXV7f/ip00QVqoRF03Ye5POIMGcW8QYklKsVZEd3bDdDVFqEaUAdb8wBg==","signatures":[{"sig":"MEUCIQDn4ZOlkDKXFSYW8OlbKQF+nEOiWhgW88J4QUYnaPTqYQIgXSOEvZVgNv/JB+g8QcmHC/cXsWXBJtZgm8hfo3OXJIQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31538},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-rate-control-cloudflare-0.0.0-alpha.1.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"richcanvas","email":"richardpedersen3@gmail.com"},"_resolved":"/tmp/58101dcd99071f84ba20d3cae333b727/agenticprimitives-rate-control-cloudflare-0.0.0-alpha.1.tgz","_integrity":"sha512-KkjHG728it2sZiRAEYC702xXTQ/S9oXV7f/ip00QVqoRF03Ye5POIMGcW8QYklKsVZEd3bDdDVFqEaUAdb8wBg==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"_npmVersion":"11.16.0","description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@agenticprimitives/rate-control":"0.0.0-alpha.1"},"peerDependencies":{"@agenticprimitives/rate-control":"0.0.0-alpha.1"},"_npmOperationalInternal":{"tmp":"tmp/rate-control-cloudflare_0.0.0-alpha.1_1782902670391_0.5615848483229564","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.2":{"name":"@agenticprimitives/rate-control-cloudflare","version":"0.0.0-alpha.2","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter"],"license":"MIT","_id":"@agenticprimitives/rate-control-cloudflare@0.0.0-alpha.2","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/rate-control-cloudflare","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"72c85766ad719012ee431595762477ab22b61914","tarball":"https://registry.npmjs.org/@agenticprimitives/rate-control-cloudflare/-/rate-control-cloudflare-0.0.0-alpha.2.tgz","fileCount":20,"integrity":"sha512-px5yyxe41dJu999b+T9b/IWvxQ6zn7DkPMGrBkeBSYKjwN9Jy2z8Zfx8sM7mqbgehusT6iA/duZG3hPNP8ly1g==","signatures":[{"sig":"MEQCIAV+ZwSzwPYodaSwPeORhXhljkvan8M+h+8BqLYAp6OmAiAeUi2V5bh58emLFqV39+ZKNpPc8Nm/b7v+fvrMY8ztXw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31538},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-rate-control-cloudflare-0.0.0-alpha.2.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:edbc75cd-4d1c-4112-b1d2-69077b98edc5"}},"_resolved":"/tmp/e21d2878b6f446a1362eea194f95eb73/agenticprimitives-rate-control-cloudflare-0.0.0-alpha.2.tgz","_integrity":"sha512-px5yyxe41dJu999b+T9b/IWvxQ6zn7DkPMGrBkeBSYKjwN9Jy2z8Zfx8sM7mqbgehusT6iA/duZG3hPNP8ly1g==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"_npmVersion":"11.16.0","description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","directories":{},"_nodeVersion":"24.18.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@agenticprimitives/rate-control":"0.0.0-alpha.2"},"peerDependencies":{"@agenticprimitives/rate-control":"0.0.0-alpha.2"},"_npmOperationalInternal":{"tmp":"tmp/rate-control-cloudflare_0.0.0-alpha.2_1785727534799_0.18646038380019303","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.3":{"name":"@agenticprimitives/rate-control-cloudflare","version":"0.0.0-alpha.3","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter"],"license":"MIT","_id":"@agenticprimitives/rate-control-cloudflare@0.0.0-alpha.3","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/rate-control-cloudflare","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"32304fe2e158dd948e790fa1b0a67f733742ac23","tarball":"https://registry.npmjs.org/@agenticprimitives/rate-control-cloudflare/-/rate-control-cloudflare-0.0.0-alpha.3.tgz","fileCount":20,"integrity":"sha512-a10b7rcYbc9HfiyWgWuEYhV782W/4BFM4AbI2iOGzv7DBCvORpW4Jel5xRM4CLMPSHzAsarbZoG7D8ZlZWihYw==","signatures":[{"sig":"MEUCIBi16VLNxmTpB+BTLGwPW6fV/QkyDW0duHopS6bLoBtBAiEAmP09e3CPZ89zuUPhvyllfW0oOvB+A/Nx+ILntRpy9T4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31538},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-rate-control-cloudflare-0.0.0-alpha.3.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:edbc75cd-4d1c-4112-b1d2-69077b98edc5"}},"_resolved":"/tmp/5dc79ab48b3a549cb6c35bd3440f0c5b/agenticprimitives-rate-control-cloudflare-0.0.0-alpha.3.tgz","_integrity":"sha512-a10b7rcYbc9HfiyWgWuEYhV782W/4BFM4AbI2iOGzv7DBCvORpW4Jel5xRM4CLMPSHzAsarbZoG7D8ZlZWihYw==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"_npmVersion":"11.19.0","description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@agenticprimitives/rate-control":"0.0.0-alpha.3"},"peerDependencies":{"@agenticprimitives/rate-control":"0.0.0-alpha.3"},"_npmOperationalInternal":{"tmp":"tmp/rate-control-cloudflare_0.0.0-alpha.3_1789164140927_0.18743988641498976","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.4":{"name":"@agenticprimitives/rate-control-cloudflare","version":"0.0.0-alpha.4","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter"],"license":"MIT","_id":"@agenticprimitives/rate-control-cloudflare@0.0.0-alpha.4","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"homepage":"https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/rate-control-cloudflare","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"ed2fc8ae635db282bf6ced47c6d14d3b8b1a7ec9","tarball":"https://registry.npmjs.org/@agenticprimitives/rate-control-cloudflare/-/rate-control-cloudflare-0.0.0-alpha.4.tgz","fileCount":20,"integrity":"sha512-ii8QuAnRc5aR7Vb9UN0r1FYI67uAztZSsBIGid1WiCAnJUCvJ1H/8PqblX/Eo1XYWovpK0qeGeond65quLGQAg==","signatures":[{"sig":"MEUCIQDiBgTLK+u9CGbebacrDKSgtEOvKOMJUG8b80Fj7zauNwIgd8HGaku/IvDbYAGmf677HQuhoOCLRwdC1aHlXd452HQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31538},"main":"./dist/index.js","type":"module","_from":"file:agenticprimitives-rate-control-cloudflare-0.0.0-alpha.4.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:edbc75cd-4d1c-4112-b1d2-69077b98edc5"}},"_resolved":"/tmp/5ba65b0ba735e7ab8b54f1d948a7b475/agenticprimitives-rate-control-cloudflare-0.0.0-alpha.4.tgz","_integrity":"sha512-ii8QuAnRc5aR7Vb9UN0r1FYI67uAztZSsBIGid1WiCAnJUCvJ1H/8PqblX/Eo1XYWovpK0qeGeond65quLGQAg==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"_npmVersion":"11.19.0","description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","directories":{},"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@agenticprimitives/rate-control":"0.0.0-alpha.4"},"peerDependencies":{"@agenticprimitives/rate-control":"0.0.0-alpha.4"},"_npmOperationalInternal":{"tmp":"tmp/rate-control-cloudflare_0.0.0-alpha.4_1789230558795_0.20009521177215261","host":"s3://npm-registry-packages-npm-production"}},"0.0.0-alpha.5":{"_id":"@agenticprimitives/rate-control-cloudflare@0.0.0-alpha.5","bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"dist":{"shasum":"3cbd43d45a0c56904cce7ab5e24eabe8e1ee4bce","tarball":"https://registry.npmjs.org/@agenticprimitives/rate-control-cloudflare/-/rate-control-cloudflare-0.0.0-alpha.5.tgz","fileCount":20,"integrity":"sha512-zlBdueMJBwRwCC29PafUC2JLOUXTN4dJmrvpp2Hek8t44NZ7oBWvYx9bQrjLPseOUnCmhVTyHdf+hWT/M8suzA==","signatures":[{"sig":"MEQCIFEKnt9vcoQ1dzsrKk/Pmo6bJAXAhq3W6ElQD4awnBXyAiAWlQUNqRyEgmhJ/EL7mtYf/nsknVThxsV52EirLc5ZrA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB0dMybW+9in3DwfbD6RlHFPc6/u8SM4lrmy/ImN1BO0AiB40Jl9ZF21kY60SBW3AVkyu+bsRyuinACJCga29t05sA=="}],"unpackedSize":32021},"main":"./dist/index.js","name":"@agenticprimitives/rate-control-cloudflare","type":"module","_from":"file:agenticprimitives-rate-control-cloudflare-0.0.0-alpha.5.tgz","types":"./dist/index.d.ts","author":{"url":"https://agenticprimitives.dev","name":"Agentic Trust Labs"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"license":"MIT","scripts":{"test":"vitest run","build":"tsc -p tsconfig.build.json","clean":"rm -rf dist","test:unit":"vitest run test/unit --passWithNoTests","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"version":"0.0.0-alpha.5","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:edbc75cd-4d1c-4112-b1d2-69077b98edc5"}},"homepage":"https://agenticprimitives.dev","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter","agentic-primitives","agenticprimitives","ai-agents","agent-authority","agentic-trust"],"_resolved":"/tmp/3422f02fbb713de2c86dc7bc161a6bfd/agenticprimitives-rate-control-cloudflare-0.0.0-alpha.5.tgz","_integrity":"sha512-zlBdueMJBwRwCC29PafUC2JLOUXTN4dJmrvpp2Hek8t44NZ7oBWvYx9bQrjLPseOUnCmhVTyHdf+hWT/M8suzA==","repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"_npmVersion":"11.19.0","description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","directories":{},"maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"_nodeVersion":"24.20.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.1.8","@agenticprimitives/rate-control":"0.0.0-alpha.5"},"peerDependencies":{"@agenticprimitives/rate-control":"0.0.0-alpha.5"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rate-control-cloudflare_0.0.0-alpha.5_1789814978823_0.5563294654650075"}}},"time":{"created":"2026-07-01T10:44:30.223Z","modified":"2026-09-19T10:49:39.208Z","0.0.0-alpha.1":"2026-07-01T10:44:30.533Z","0.0.0-alpha.2":"2026-08-03T03:25:34.932Z","0.0.0-alpha.3":"2026-09-11T22:02:21.076Z","0.0.0-alpha.4":"2026-09-12T16:29:18.932Z","0.0.0-alpha.5":"2026-09-19T10:49:38.901Z"},"bugs":{"url":"https://github.com/agentictrustlabs/agenticprimitives/issues"},"license":"MIT","homepage":"https://agenticprimitives.dev","keywords":["agentic","primitives","rate-control","cloudflare","durable-object","adapter","agentic-primitives","agenticprimitives","ai-agents","agent-authority","agentic-trust"],"repository":{"url":"git+https://github.com/agentictrustlabs/agenticprimitives.git","type":"git","directory":"packages/rate-control-cloudflare"},"description":"Cloudflare adapter for @agenticprimitives/rate-control: the SmartAgentBudgetDO Durable Object (the authoritative per-Smart-Agent hard-budget store, sharded by chainId+sponsorAgent) + a HardBudgetStore client that routes reserve/commit/release to the right","maintainers":[{"name":"richcanvas","email":"richardpedersen3@gmail.com"}],"readme":"# @agenticprimitives/rate-control-cloudflare\n\n> Part of **[Agentic Primitives](https://agenticprimitives.dev)** — the open-source trust substrate for agentic applications: identity that can sign, authority checked at act time, evidence the owner carries. [Developer kit](https://github.com/agentictrustlabs/agentic-primitives) · [All packages](https://agenticprimitives.dev/developers)\n\nThe Cloudflare adapter for [`@agenticprimitives/rate-control`](../rate-control) (spec 290 §7-§8): the\nauthoritative **Stage-3 hard-budget** store as a Durable Object + a `HardBudgetStore` client. The hard\nbudget protects off-chain infra/sponsorship cost (KMS / paymaster / LLM / provider / edge); it is\n**additive to** on-chain enforcers, never the authority for value movement (§9 / ADR-0041).\n\n## API\n- **`SmartAgentBudgetDO`** — the Durable Object class. Export it from your Worker + add a\n  `[[durable_objects.bindings]]` entry + a migration. One DO instance per Smart Agent shard\n  (`eip155:<chainId>:<sponsorAgent>`); reserve/commit/release run inside `ctx.storage.transaction`.\n- **`createDurableObjectBudgetStore({ namespace, chainId, limitUnits })`** — a `HardBudgetStore` the origin\n  consumes after authority: `reserve({ sponsorAgent, capabilityId, estimatedUnits, idempotencyKey })` →\n  `{ allowed, reservationId? }`; `commit(reservationId, actualUnits)`; `release(reservationId)`.\n- Pure helpers (`evaluateReserve`/`applyCommit`/`applyRelease`/`reservedTotal`) for testing/custom hosts.\n\n## Usage (origin Worker, post-authority)\n```ts\nimport { createDurableObjectBudgetStore } from '@agenticprimitives/rate-control-cloudflare';\nconst budget = createDurableObjectBudgetStore({ namespace: env.SA_BUDGET, chainId: 84532, limitUnits: 1000 });\n\nconst r = await budget.reserve({ sponsorAgent: verified.principal, capabilityId, estimatedUnits: 1, idempotencyKey: requestId });\nif (!r.allowed) return new Response('budget exhausted', { status: 429 });\ntry { const out = await runOp(); await budget.commit(r.reservationId!, out.actualUnits); return out; }\ncatch (e) { await budget.release(r.reservationId!); throw e; }\n```\n\n`wrangler.toml` (the deployed Worker — app config, ADR-0021):\n```toml\n[[durable_objects.bindings]]\nname = \"SA_BUDGET\"\nclass_name = \"SmartAgentBudgetDO\"\n[[migrations]]\ntag = \"v1\"\nnew_classes = [\"SmartAgentBudgetDO\"]\n```\n\nReserve **before** spend, commit on success (charge actuals), release on failure (a 429/deny restores the\nbudget). Idempotent by `idempotencyKey` — a retried reserve never double-charges.\n","readmeFilename":"README.md","author":{"url":"https://agenticprimitives.dev","name":"Agentic Trust Labs"}}