{"_id":"@ai-manifests/acb-manifest","_rev":"2-d422f101f2b6a6febbdedb192d7116d4","name":"@ai-manifests/acb-manifest","dist-tags":{"latest":"1.0.0"},"versions":{"0.3.0":{"name":"@ai-manifests/acb-manifest","version":"0.3.0","author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","_id":"@ai-manifests/acb-manifest@0.3.0","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://adp-manifest.dev","dist":{"shasum":"414c02cf21d9a04a2732c23b0b827fd4e70c0cea","tarball":"https://registry.npmjs.org/@ai-manifests/acb-manifest/-/acb-manifest-0.3.0.tgz","fileCount":16,"integrity":"sha512-XJJPFfWDVtFkOtNDCscguhiMmyzTj24HGN346L8G13LwNkNoecC3nUsVBW5OV9xyl6IFKK2kDb79pQkWaWrnBQ==","signatures":[{"sig":"MEUCIQCExL/JHSJ8+TIx0522rMj1EAzLU337QAX7r4Or9QDnggIgNbMruJjj5VabYwBPhSH2MwcwkLx0XLEzZp+YawgEM5g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":44924},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"gitHead":"fc365959c36ab0ed00fe9027fe16649c9204d74e","scripts":{"test":"vitest run","build":"tsc"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"https://git.marketally.com/ai-manifests/acb-ref-lib-ts","type":"git"},"_npmVersion":"10.8.2","description":"TypeScript reference implementation of the Agent Cognitive Budget Protocol (ACB)","directories":{},"_nodeVersion":"20.19.4","_hasShrinkwrap":false,"devDependencies":{"vitest":"^3.0.0","typescript":"^5.5.0"},"_npmOperationalInternal":{"tmp":"tmp/acb-manifest_0.3.0_1777236791775_0.0872351403057181","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@ai-manifests/acb-manifest","version":"1.0.0","description":"TypeScript reference implementation of the Agent Cognitive Budget Protocol (ACB)","author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"scripts":{"build":"tsc","test":"vitest run"},"license":"Apache-2.0","homepage":"https://adp-manifest.dev","repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/acb-ref-lib-ts"},"devDependencies":{"typescript":"^5.5.0","vitest":"^3.0.0"},"_id":"@ai-manifests/acb-manifest@1.0.0","gitHead":"4e9eda2726aa91547cabd82bd509405e5f3af746","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-PToFu1xzg0wH0R798JGbrgspWs3/AjXqUZXPzhh6Lvz26s//KW2/pYZim8rnSXiVj0A+XBkn6vGYoyi4OExvKw==","shasum":"6ed6f52671e2c51f6e6cb5c4cdee5d5d8ae646a7","tarball":"https://registry.npmjs.org/@ai-manifests/acb-manifest/-/acb-manifest-1.0.0.tgz","fileCount":16,"unpackedSize":45462,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCphNivcaw82p2KrdX3rnWrC2qKFfv7IODZgOOAKHxvvgIgIAl8iCKAmsiksv23Yj1S+tltAUDoBEr2oO+wFiWYw5k="}]},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"directories":{},"maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/acb-manifest_1.0.0_1780369347754_0.6414736910816119"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-26T20:53:11.686Z","modified":"2026-06-02T03:02:28.095Z","0.3.0":"2026-04-26T20:53:11.916Z","1.0.0":"2026-06-02T03:02:27.971Z"},"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","homepage":"https://adp-manifest.dev","repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/acb-ref-lib-ts"},"description":"TypeScript reference implementation of the Agent Cognitive Budget Protocol (ACB)","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"readme":"# acb-manifest\n\n[![npm](https://img.shields.io/npm/v/@ai-manifests/acb-manifest.svg?label=npm)](https://www.npmjs.com/package/@ai-manifests/acb-manifest)\n[![Downloads](https://img.shields.io/npm/dm/@ai-manifests/acb-manifest.svg)](https://www.npmjs.com/package/@ai-manifests/acb-manifest)\n[![Node](https://img.shields.io/badge/node-20%2B-blue.svg)](https://nodejs.org/)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Spec](https://img.shields.io/badge/spec-acb--manifest.dev-informational)](https://acb-manifest.dev)\n\nA TypeScript reference implementation of the **Agent Cognitive Budget (ACB)** protocol — the metabolic-budget layer for deliberative multi-agent systems. ACB provides append-only journal entries, pricing models, habit-memory discounts, and settlement distribution that mirror the brain's resource allocation for routine vs. contested decisions.\n\nThis library is one of several reference implementations ([C#](https://github.com/ai-manifests/acb-ref-lib-csharp), [Python](https://github.com/ai-manifests/acb-ref-lib-py)) of the same spec. The spec itself is at [adp-manifest.dev](https://adp-manifest.dev) and is the source of truth; this library implements what the spec says.\n\nZero runtime dependencies. Pure TypeScript, ESM.\n\n## Install\n\n```bash\nnpm install @ai-manifests/acb-manifest\n```\n\n## Quick example\n\n```ts\nimport {\n  InMemoryBudgetStore,\n  computeDisagreementMagnitude,\n  selectRoutine,\n  computeExpensiveDraw,\n  buildSettlementRecord,\n  Routine,\n  TerminationState,\n  type BudgetCommitted,\n  type Tally,\n} from '@ai-manifests/acb-manifest';\n\nconst initialTally: Tally = { approveWeight: 0.71, rejectWeight: 0.64, abstainWeight: 0.18 };\nconst magnitude = computeDisagreementMagnitude(initialTally);  // ≈ 0.948 (contested)\n\nconst routine = selectRoutine(pricingProfile, initialTally, /*roundCount*/ 1, TerminationState.Converged);\n// routine === Routine.Expensive (unlock threshold exceeded)\n\nconst draw = computeExpensiveDraw(pricingProfile, /*participants*/ 3, /*rounds*/ 1, /*habitDiscount*/ 0.80);\n// draw = 200 × 3 × 1.5^1 × (1 − 0.80) = 180 EU\n```\n\n## API\n\nAll exports are re-exported from the package root.\n\n### Entry types\n\n`AcbEntry`, `BudgetCommitted`, `BudgetCancelled`, `SettlementRecorded`\n\n### Value types\n\n`Denomination`, `PricingProfile`, `SettlementProfile`, `SettlementMode`, `BudgetConstraints`, `SubstrateDistribution`, `EpistemicDistribution`, `ContributionBreakdown`, `Tally`, `HistoricalDeliberation`, `ParticipantContribution`, `SubstrateReport`, `SettlementInputs`, `BudgetState`\n\n### Enums\n\n`Routine`, `TerminationState`, `SettlementMode`\n\n### Pricing\n\n- `computeDisagreementMagnitude(tally)` — `1 − |approve − reject| / (approve + reject)`, in [0, 1]\n- `selectRoutine(pricing, tally, roundCount, termination)` — returns `Routine.Cheap` when the decision is an agreed-on routine; `Routine.Expensive` when contested\n- `computeCheapDraw(pricing, participantCount, habitDiscount?)` — cheap-routine draw\n- `computeExpensiveDraw(pricing, participantCount, roundCount, habitDiscount?)` — expensive-routine draw with round multiplier\n- `computeDraw(pricing, tally, participantCount, roundCount, termination, habitDiscount?)` — convenience wrapper that picks a routine and computes the draw\n- `computeHabitDiscount(history)` — habit-memory discount function, capped at `MAX_HABIT_DISCOUNT` (0.80)\n- `MAX_HABIT_DISCOUNT` — exported constant\n\n### Settlement\n\n- `distributeSubstrate(pool, reports)` — substrate pool distribution proportional to reported cycles\n- `distributeEpistemic(pool, contributions)` — default-v0 epistemic scoring with the four equal-weight bonuses (base, falsification, load-bearing, outcome correctness) plus dissent-quality penalty\n- `buildSettlementRecord(inputs)` — builds a complete `SettlementRecorded` entry from contributions and substrate reports\n\n### Store\n\n- `InMemoryBudgetStore` — thread-safe in-memory budget store suitable for tests and prototypes\n- `BudgetStore` — interface for custom backends\n\n## Testing\n\n```bash\nnpm test\n```\n\n## Spec\n\nThis library implements the Agent Cognitive Budget protocol specification. Read the spec at [adp-manifest.dev](https://adp-manifest.dev). If the spec and this library disagree, the spec is correct and this is a bug.\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE) for the full license text and [`NOTICE`](NOTICE) for attribution.\n","readmeFilename":"README.md"}