{"_id":"@ai-manifests/adp-agent-anchor","_rev":"5-867f48965bf884b35b907befe32aa13b","name":"@ai-manifests/adp-agent-anchor","dist-tags":{"latest":"0.7.0"},"versions":{"0.1.0":{"name":"@ai-manifests/adp-agent-anchor","version":"0.1.0","keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"license":"CC0-1.0","_id":"@ai-manifests/adp-agent-anchor@0.1.0","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://adp-manifest.dev","dist":{"shasum":"c23425424cc32a4da3080145d84a997271a45d3a","tarball":"https://registry.npmjs.org/@ai-manifests/adp-agent-anchor/-/adp-agent-anchor-0.1.0.tgz","fileCount":22,"integrity":"sha512-Lxhh4SALkLV88305qXc2cc9+oN7XWMrtQi1czUxbwglGzPCj5WyEbJuxsCs+z7JyZ9/+elwSrp7TdNnHwBKH7Q==","signatures":[{"sig":"MEQCID4lk4MDRTqgFgDhoNp9S7SRYhfAxrvawENtUrolQX6NAiB22yvOhg2MkuG8KyGWa2gTDV13gCgqfN9jiIb1c6rWjQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":51623},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"62285258a50b36bb4e5122346201ba5491fe6c39","scripts":{"test":"vitest run","build":"tsc -b","clean":"rm -rf dist tsconfig.tsbuildinfo"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"https://git.marketally.com/ai-manifests/adp-agent","type":"git","directory":"packages/agent-anchor"},"_npmVersion":"10.8.2","description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@cityofzion/neon-js":"^5.8.1","@ai-manifests/adp-agent":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adp-agent-anchor_0.1.0_1776119928011_0.17073246519247998","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@ai-manifests/adp-agent-anchor","version":"0.2.0","keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"author":{"name":"David H. Friedel Jr. — MarketAlly"},"license":"Apache-2.0","_id":"@ai-manifests/adp-agent-anchor@0.2.0","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://adp-manifest.dev","dist":{"shasum":"aeecb10712d788c719d9555158340f5d046407e1","tarball":"https://registry.npmjs.org/@ai-manifests/adp-agent-anchor/-/adp-agent-anchor-0.2.0.tgz","fileCount":25,"integrity":"sha512-KN1Yuh5LJGOUfdI0ks50P0FXKdap0GKbWSeTPsJstDLGyZVUYkcfh6D/4ZMXTmirlgAmvg92ryYPxLt1iIVLFg==","signatures":[{"sig":"MEQCIAYLeu9pPHDzwKpHqb1SqUbu+NLXxrlQpN1ZlT+lcuWCAiBMsGxu6XyLDEPpdRbNw0tZlZmrIsmGr0JW3KP9UaBStw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65375},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4ae965a8ff7c09346a61d915f93ab57ab1344425","scripts":{"test":"vitest run","build":"tsc -b","clean":"rm -rf dist tsconfig.tsbuildinfo"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"https://git.marketally.com/ai-manifests/adp-agent","type":"git","directory":"packages/agent-anchor"},"_npmVersion":"10.8.2","description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@cityofzion/neon-js":"^5.8.1","@ai-manifests/adp-agent":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adp-agent-anchor_0.2.0_1776150226732_0.6570282723429477","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@ai-manifests/adp-agent-anchor","version":"0.2.1","keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"author":{"name":"David H. Friedel Jr. — MarketAlly"},"license":"Apache-2.0","_id":"@ai-manifests/adp-agent-anchor@0.2.1","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://adp-manifest.dev","dist":{"shasum":"b937ac1c25015d758cc2d0e1d9a021606ed198b6","tarball":"https://registry.npmjs.org/@ai-manifests/adp-agent-anchor/-/adp-agent-anchor-0.2.1.tgz","fileCount":25,"integrity":"sha512-yn8m9oFdxT81rWn7yV8vMq/XIcAIil4eshtqNJn5dC3oVFOWLDv7ogj+G9/uIu1Xu8kXmBV7Fmgx8h/6tPytVw==","signatures":[{"sig":"MEYCIQCCe5AxNYgi9WFfnqIgMVvJoVGKSBhwaCqlgHeDNVvfvgIhAJtcDnCcuRG9A8s87uwSiv0CX+VhYXkBOgRD6ftUgPqa","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":65908},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"4ae965a8ff7c09346a61d915f93ab57ab1344425","scripts":{"test":"vitest run","build":"tsc -b","clean":"rm -rf dist tsconfig.tsbuildinfo"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"https://git.marketally.com/ai-manifests/adp-agent","type":"git","directory":"packages/agent-anchor"},"_npmVersion":"10.8.2","description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@cityofzion/neon-js":"^5.8.1","@ai-manifests/adp-agent":"^0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adp-agent-anchor_0.2.1_1776150439821_0.799458730255824","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@ai-manifests/adp-agent-anchor","version":"0.3.0","keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","_id":"@ai-manifests/adp-agent-anchor@0.3.0","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"homepage":"https://adp-manifest.dev","dist":{"shasum":"51f415e93ba7d9772126940fad5d434b0ee2cdaa","tarball":"https://registry.npmjs.org/@ai-manifests/adp-agent-anchor/-/adp-agent-anchor-0.3.0.tgz","fileCount":25,"integrity":"sha512-/OkvxnW645EOV2zUgfY4B8flYQqSfS1l6kkbhB9wqeDjDbv8btLt2Cap5tBCx5TfQ6ErHqiVkvpifAx70y4JOA==","signatures":[{"sig":"MEUCIQCPZT2HdQJimZgnboEwojGvHArqp8TpNh/eSgQf09TZjgIgS2toLPgkN67qCuf5E/kW0RYVCRacWVYVFyI69BFDPZI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":66786},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"b975fa1e6d1eaa04e80798d67d65dba3ef6b325c","scripts":{"test":"vitest run","build":"tsc -b","clean":"rm -rf dist tsconfig.tsbuildinfo"},"_npmUser":{"name":"logikonline","email":"dave@marketally.com"},"repository":{"url":"https://git.marketally.com/ai-manifests/adp-agent","type":"git","directory":"packages/agent-anchor"},"_npmVersion":"10.8.2","description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","directories":{},"_nodeVersion":"20.19.4","dependencies":{"@cityofzion/neon-js":"^5.8.1","@ai-manifests/adp-agent":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.0.0"},"_npmOperationalInternal":{"tmp":"tmp/adp-agent-anchor_0.3.0_1777236987030_0.6298021895460091","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"@ai-manifests/adp-agent-anchor","version":"0.7.0","description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"type":"module","publishConfig":{"access":"public"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsc -b","clean":"rm -rf dist tsconfig.tsbuildinfo","test":"vitest run"},"keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"license":"Apache-2.0","homepage":"https://adp-manifest.dev","repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/adp-agent","directory":"packages/agent-anchor"},"dependencies":{"@cityofzion/neon-js":"^5.8.1"},"peerDependencies":{"@ai-manifests/adp-agent":">=0.6.0 <1.0.0"},"devDependencies":{"@ai-manifests/adp-agent":">=0.6.0 <1.0.0","@types/node":"^22.0.0"},"_id":"@ai-manifests/adp-agent-anchor@0.7.0","gitHead":"1a08a9079c8293c33f0aefcd3f410cc4530be23b","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-SlwNcr+Y+Lzz6XFi6ydO5Q4MPx6277J/0Xp1vYYFyD4aA7xOdZwxYUCQpi5q4NGknx2wr3EE7BTySBrByK/mjA==","shasum":"241f56fd4275c724424d219a5312ae77d15deec7","tarball":"https://registry.npmjs.org/@ai-manifests/adp-agent-anchor/-/adp-agent-anchor-0.7.0.tgz","fileCount":25,"unpackedSize":69582,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDEB7gU+EE841IEd0LDCb4FBhjAjKCGpsqUkki9QhueGwIgdHgTCSYuc/mmhZQxsnq+mraBAA7vxgIrqdYNEm+KjhU="}]},"_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/adp-agent-anchor_0.7.0_1780369368630_0.7329688211710264"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-13T22:38:47.926Z","modified":"2026-06-02T03:02:48.903Z","0.1.0":"2026-04-13T22:38:48.174Z","0.2.0":"2026-04-14T07:03:46.879Z","0.2.1":"2026-04-14T07:07:19.990Z","0.3.0":"2026-04-26T20:56:27.163Z","0.7.0":"2026-06-02T03:02:48.768Z"},"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","homepage":"https://adp-manifest.dev","keywords":["adp","calibration-anchor","neo3","blockchain","tamper-evidence"],"repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/adp-agent","directory":"packages/agent-anchor"},"description":"Neo3 blockchain anchor for ADP calibration snapshots. Optional extension to @ai-manifests/adp-agent that periodically commits signed calibration snapshots to a Neo3-compatible chain.","maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"readme":"# @ai-manifests/adp-agent-anchor\n\n[![npm](https://img.shields.io/npm/v/@ai-manifests/adp-agent-anchor.svg?label=npm)](https://www.npmjs.com/package/@ai-manifests/adp-agent-anchor)\n[![Downloads](https://img.shields.io/npm/dm/@ai-manifests/adp-agent-anchor.svg)](https://www.npmjs.com/package/@ai-manifests/adp-agent-anchor)\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-adp--manifest.dev-informational)](https://adp-manifest.dev)\n\nOptional Neo3 blockchain anchor for [`@ai-manifests/adp-agent`](https://www.npmjs.com/package/@ai-manifests/adp-agent). Commits signed calibration snapshots to a Neo3-compatible chain on a schedule for third-party tamper evidence.\n\n```bash\nnpm install @ai-manifests/adp-agent @ai-manifests/adp-agent-anchor\n```\n\n## Why it's optional\n\nThe always-on [signed calibration snapshot](https://adj-manifest.dev) at `/.well-known/adp-calibration.json` (ADJ §7.4) is the primary trust mechanism — peers and registries verify against it with one HTTPS fetch plus a signature check, no chain required. The chain anchor is a **strictly optional** overlay that adds:\n\n1. **Third-party verification** without routing through the registry\n2. **Evidence that survives agent disappearance** — the anchored record stays on-chain even if the agent's HTTPS endpoint goes offline\n3. **Anti-rewrite defense** — on-chain records are mechanically detectable if an agent later rewrites its journal\n\nFor a federation with a trusted registry, these properties are nice-to-have. For a federation where participants don't fully trust each other or the registry, they're load-bearing.\n\n## Supported targets\n\nAll four targets use the same `Neo3BlockchainStore` client and the same `CalibrationStore.cs` smart contract — only the RPC URL, contract hash, and signing wallet change.\n\n| Target | Use case |\n|---|---|\n| `mock` | Unit tests (in-memory, no network) |\n| `neo-express` | Local dev chain (Neo Express) |\n| `neo-custom` | Operator's existing private Neo3 chain |\n| `neo-testnet` | Public Neo N3 testnet (free faucet GAS) |\n| `neo-mainnet` | Public Neo N3 mainnet (real GAS, real immutability) |\n\n## Usage\n\n```ts\nimport { AdpAgent } from '@ai-manifests/adp-agent';\nimport { createAnchorStore, CalibrationAnchorScheduler } from '@ai-manifests/adp-agent-anchor';\n\nconst agent = new AdpAgent(config);\n\nif (config.calibrationAnchor?.enabled) {\n  const store = createAnchorStore(config.calibrationAnchor);\n  if (store) {\n    const scheduler = new CalibrationAnchorScheduler(\n      config,\n      store,\n      () => agent.getJournal().listDeliberationsSince(new Date(0), 10000).flatMap(r => r.entries),\n      config.calibrationAnchor.publishIntervalSeconds ?? 3600,\n    );\n    agent.afterStart(() => scheduler.start());\n    agent.beforeStop(() => scheduler.stop());\n  }\n}\n\nawait agent.start();\n```\n\n## Config\n\nThe `calibrationAnchor` field on `AgentConfig` (defined in `adp-agent`) controls the anchor:\n\n```json\n{\n  \"calibrationAnchor\": {\n    \"enabled\": true,\n    \"target\": \"neo-custom\",\n    \"rpcUrl\": \"http://10.0.0.127:50012\",\n    \"contractHash\": \"0x52743c2e73b597f0822308d45b2ff0a9c9271964\",\n    \"networkMagic\": 366497916,\n    \"publishIntervalSeconds\": 900\n  }\n}\n```\n\nThe `privateKey` field should **never** go in the config file. Pass it via the `ADP_ANCHOR_PRIVATE_KEY` environment variable instead, or via your preferred secrets store.\n\n## API\n\n- **`createAnchorStore(config)`** — builds a `BlockchainCalibrationStore` from the config's `target`. Returns `MockBlockchainStore` for `'mock'`, `Neo3BlockchainStore` for any `neo-*` target, or `null` if required config fields are missing.\n\n- **`CalibrationAnchorScheduler(self, store, readJournal, intervalSeconds?)`** — periodic publisher. Reads the journal via the `readJournal` callback (passed in so the scheduler is unit-testable), builds the current signed snapshot for each declared decision class, and publishes to the chain every `intervalSeconds` (default 3600). Exposes `.start()`, `.stop()`, `.publishNow()`, and `.status()`.\n\n- **`Neo3BlockchainStore(options)`** — low-level RPC client. `options.rpcUrl`, `options.contractHash`, `options.privateKey`, `options.networkMagic`, `options.publishTimeoutSeconds`. Implements `BlockchainCalibrationStore`.\n\n- **`MockBlockchainStore`** — in-memory implementation for tests. Same interface.\n\n- **`BlockchainCalibrationStore`** — the interface both implementations conform to. If you have a non-Neo3 chain, implement this yourself.\n\n## Smart contract\n\nThe companion smart contract is `CalibrationStore.cs` — a C# Neo3 contract compiled with `nccs` (Neo.Compiler.CSharp). Deploy once per chain; capture the contract hash into `config.calibrationAnchor.contractHash`.\n\nThe contract has two public operations:\n\n- `setCalibration(agentId, domain, valueInt, sampleSize, journalHash)` — writes a calibration record (no witness check; authentication is off-chain via the ADJ signed snapshot)\n- `getCalibration(agentId, domain) → [agentId, domain, valueInt, sampleSize, timestamp, journalHash] | null`\n\nValue is scaled to an integer in [0, 10000] for 4-decimal precision.\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE) for the full text.\n","readmeFilename":"README.md"}