@ai-manifests/aap-manifest
v1.0.0
Published
TypeScript reference implementation of the Agent Acknowledgment Protocol (AAP)
Readme
aap-ref-lib-ts
TypeScript reference implementation of the Agent Acknowledgment Protocol (AAP) — typed acknowledgment events, the §7.2 reference weighting function, and a simple reputation derivation.
Install
npm install @ai-manifests/aap-manifestWhat's in the box
| Module | Spec | Purpose |
|--------|------|---------|
| entries | §3, §4 | AcknowledgmentEvent and its parts; the AckType vocabulary |
| weighting | §7.2 | computeWeight, typeWeight, DEFAULT_TYPE_WEIGHTS |
| reputation | §7.1 | computeReputation — derive a subject's score from events |
| store | §9.3 / §9.4 | InMemoryAcknowledgmentStore — dup-id rejection, withdrawal handling |
Usage
import {
computeWeight,
computeReputation,
InMemoryAcknowledgmentStore,
type AcknowledgmentEvent,
} from '@ai-manifests/aap-manifest';
const ev: AcknowledgmentEvent = {
aapVersion: '1.0',
id: 'urn:uuid:5f8a3c2e-…',
issuedAt: '2026-05-20T14:32:00Z',
type: 'ENDORSEMENT',
issuer: { did: 'did:tutus:0xacme', keyId: 'did:tutus:0xacme#k' },
subject: { did: 'did:web:example.com:agents:code-reviewer' },
signature: { alg: 'EdDSA', value: '…' },
};
// Reference weight (value_weight applies only when settlement is verified).
const { weight, components } = computeWeight(ev, { issuerTrust: 0.8 });
const store = new InMemoryAcknowledgmentStore();
store.append(ev); // throws on duplicate id (§9.3)
const rep = store.reputation('did:web:example.com:agents:code-reviewer');Reference weight (spec §7.2)
weight = type_weight × issuer_trust × value_weight × witness_factor × time_decayvalue_weight = 1 + log10(1 + usdEquivalent)is applied only when the settlement reference is verified (§6.3); otherwise it is 1.witness_factor = 1 + 0.25 × min(independentWitnesses, 4).time_decay = exp(−Δt/τ), τ = 18 months; omitnowfor no decay.- A
WITHDRAWALzeroes the weight (positive-only vocabulary, §9.1).
This is the informative AAP reference. The normative aggregation —
issuer-diversity penalty, recursive-trust bound, mandatory settlement
verification, confidence — lives in AAR §9 and ships in
@ai-manifests/aar-manifest.
How It Composes
aap-manifest constructs and weights acknowledgment events (this library)
aar-manifest stores, chains, federates, and aggregates them
aap-validate validates events against the schema + anti-abuse rulesBuild & test
npm install
npm run build
npm test