{"_id":"@ai-manifests/aap-manifest","name":"@ai-manifests/aap-manifest","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@ai-manifests/aap-manifest","version":"1.0.0","description":"TypeScript reference implementation of the Agent Acknowledgment Protocol (AAP)","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://aap-manifest.dev","repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/aap-ref-lib-ts"},"devDependencies":{"typescript":"^5.5.0","vitest":"^3.0.0"},"_id":"@ai-manifests/aap-manifest@1.0.0","gitHead":"4166f1df62ec9a8362c204d956963464dc97692d","_nodeVersion":"20.19.4","_npmVersion":"10.8.2","dist":{"integrity":"sha512-4RJYeRHgNSc2+idFL5lyOGW0Om2kRRL4bfahYQBD7+OF6YdEj4fxKw3guzadmD36K1yBT5RSPX1GCuGdV5IxCg==","shasum":"7a624e0508b4fc4a68feac9c8fb0ca1950019e78","tarball":"https://registry.npmjs.org/@ai-manifests/aap-manifest/-/aap-manifest-1.0.0.tgz","fileCount":14,"unpackedSize":32597,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQChruDeTyweLvfNgOrZhFCse69/4w4DsEBedhRfeeGwGAIgOOuddUB1CqkcJ4RrZ5E3Mm4fHsB/DMnXyW6vwS2BDEY="}]},"_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/aap-manifest_1.0.0_1780369350550_0.5960474475851651"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-02T03:02:30.449Z","1.0.0":"2026-06-02T03:02:30.695Z","modified":"2026-06-02T03:02:30.920Z"},"maintainers":[{"name":"logikonline","email":"dave@marketally.com"}],"description":"TypeScript reference implementation of the Agent Acknowledgment Protocol (AAP)","homepage":"https://aap-manifest.dev","repository":{"type":"git","url":"https://git.marketally.com/ai-manifests/aap-ref-lib-ts"},"author":{"name":"David H. Friedel Jr. — MarketAlly Pte Ltd"},"license":"Apache-2.0","readme":"# aap-ref-lib-ts\n\n[![npm](https://img.shields.io/npm/v/@ai-manifests/aap-manifest.svg?label=npm)](https://www.npmjs.com/package/@ai-manifests/aap-manifest)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](LICENSE)\n[![Spec](https://img.shields.io/badge/spec-aap--manifest.dev-informational)](https://aap-manifest.dev)\n\nTypeScript reference implementation of the [Agent Acknowledgment Protocol\n(AAP)](https://aap-manifest.dev) — typed acknowledgment events, the §7.2\nreference weighting function, and a simple reputation derivation.\n\n## Install\n\n```bash\nnpm install @ai-manifests/aap-manifest\n```\n\n## What's in the box\n\n| Module | Spec | Purpose |\n|--------|------|---------|\n| `entries` | §3, §4 | `AcknowledgmentEvent` and its parts; the `AckType` vocabulary |\n| `weighting` | §7.2 | `computeWeight`, `typeWeight`, `DEFAULT_TYPE_WEIGHTS` |\n| `reputation` | §7.1 | `computeReputation` — derive a subject's score from events |\n| `store` | §9.3 / §9.4 | `InMemoryAcknowledgmentStore` — dup-id rejection, withdrawal handling |\n\n## Usage\n\n```typescript\nimport {\n  computeWeight,\n  computeReputation,\n  InMemoryAcknowledgmentStore,\n  type AcknowledgmentEvent,\n} from '@ai-manifests/aap-manifest';\n\nconst ev: AcknowledgmentEvent = {\n  aapVersion: '1.0',\n  id: 'urn:uuid:5f8a3c2e-…',\n  issuedAt: '2026-05-20T14:32:00Z',\n  type: 'ENDORSEMENT',\n  issuer: { did: 'did:tutus:0xacme', keyId: 'did:tutus:0xacme#k' },\n  subject: { did: 'did:web:example.com:agents:code-reviewer' },\n  signature: { alg: 'EdDSA', value: '…' },\n};\n\n// Reference weight (value_weight applies only when settlement is verified).\nconst { weight, components } = computeWeight(ev, { issuerTrust: 0.8 });\n\nconst store = new InMemoryAcknowledgmentStore();\nstore.append(ev);                               // throws on duplicate id (§9.3)\nconst rep = store.reputation('did:web:example.com:agents:code-reviewer');\n```\n\n## Reference weight (spec §7.2)\n\n```\nweight = type_weight × issuer_trust × value_weight × witness_factor × time_decay\n```\n\n- `value_weight = 1 + log10(1 + usdEquivalent)` is applied **only when the\n  settlement reference is verified** (§6.3); otherwise it is 1.\n- `witness_factor = 1 + 0.25 × min(independentWitnesses, 4)`.\n- `time_decay = exp(−Δt/τ)`, τ = 18 months; omit `now` for no decay.\n- A `WITHDRAWAL` zeroes the weight (positive-only vocabulary, §9.1).\n\nThis is the **informative** AAP reference. The **normative** aggregation —\nissuer-diversity penalty, recursive-trust bound, mandatory settlement\nverification, confidence — lives in AAR §9 and ships in\n[`@ai-manifests/aar-manifest`](https://git.marketally.com/ai-manifests/aar-ref-lib-ts).\n\n## How It Composes\n\n```\naap-manifest   constructs and weights acknowledgment events  (this library)\naar-manifest   stores, chains, federates, and aggregates them\naap-validate   validates events against the schema + anti-abuse rules\n```\n\n## Build & test\n\n```bash\nnpm install\nnpm run build\nnpm test\n```\n\n## License\n\nApache-2.0 — see [`LICENSE`](LICENSE) and [`NOTICE`](NOTICE).\n","readmeFilename":"README.md","_rev":"1-98071112a1b4f6faba33838224035e40"}