npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ai-manifests/adp-agent

v0.3.0

Published

Reference implementation of the Agent Deliberation Protocol (ADP). Protocol runtime for agents that deliberate, sign proposals, journal outcomes, and publish signed calibration snapshots.

Readme

@ai-manifests/adp-agent

npm Downloads Node License Spec

Reference implementation of the Agent Deliberation Protocol. Build a federation-ready agent with:

npm install @ai-manifests/adp-agent

Minimal use

import { AdpAgent, type AgentConfig } from '@ai-manifests/adp-agent';

const config: AgentConfig = {
  agentId: 'did:adp:my-agent-v1',
  port: 3000,
  domain: 'my-agent.example.com',
  decisionClasses: ['code.correctness'],
  authorities: { 'code.correctness': 0.7 },
  stakeMagnitude: 'medium',
  defaultVote: 'approve',
  defaultConfidence: 0.65,
  dissentConditions: ['if any test marked critical regresses'],
  falsificationResponses: {},
  journalDir: './journal',
};

const agent = new AdpAgent(config);
await agent.start();

That's all. The library handles:

  • Manifest endpoint at /.well-known/adp-manifest.json
  • Signed calibration snapshots at /.well-known/adp-calibration.json (ADJ §7.4)
  • Deliberation API (POST /api/deliberate, POST /api/propose, POST /api/respond-falsification)
  • Outcome recording (POST /api/record-outcome)
  • ADJ query contract (/adj/v0/calibration, /adj/v0/deliberation/:id, /adj/v0/deliberations, /adj/v0/outcome/:id, /adj/v0/entries)
  • ACB budget endpoints (POST /api/budget) — when acbDefaults is configured
  • MCP tool server at /mcp — agents can call each other's ADP/ADJ operations as MCP tools
  • Health check at /healthz
  • Ed25519 proposal signing, Brier-score calibration, journal append/query

You only write the evaluator — the thing that produces votes. See adp-agent-template for the full pattern.

AdpAgent class

class AdpAgent {
  constructor(config: AgentConfig, options?: AdpAgentOptions);

  // Lifecycle
  start(port?: number): Promise<Server>;
  stop(): Promise<void>;
  afterStart(fn: () => void | Promise<void>): this;
  beforeStop(fn: () => void | Promise<void>): this;

  // Access
  getApp(): Express;             // Mount your own routes on top
  getJournal(): JournalStore;    // For admin/testing
  getConfig(): Readonly<AgentConfig>;
}

interface AdpAgentOptions {
  journal?: JournalStore;        // Defaults to JsonlJournal(config.journalDir)
  app?: Express;                 // Defaults to a fresh express() instance
  skipBodyParser?: boolean;      // Skip default express.json() middleware
}

Custom journal

Default is JSONL. For production, use SQLite:

import { SqliteJournal } from '@ai-manifests/adp-agent/journal-sqlite';
import { AdpAgent } from '@ai-manifests/adp-agent';

const journal = new SqliteJournal('/var/lib/adp/journal.db');
const agent = new AdpAgent(config, { journal });

better-sqlite3 is an optional peer dependency — install it explicitly when using SqliteJournal:

npm install better-sqlite3

Or bring your own JournalStore implementation (Postgres, event-sourced log, whatever). The interface is:

interface JournalStore {
  append(entry: JournalEntry): void;
  appendBatch(entries: JournalEntry[]): void;
  getDeliberation(deliberationId: string): JournalEntry[];
  getOutcome(deliberationId: string): JournalEntry | null;
  getCalibration(agentId: string, domain: string): CalibrationScore;
  listDeliberationsSince(since: Date, limit: number): DeliberationRecord[];
}

Public exports

All exports live on the default entry point. Deep imports are not supported.

  • Class: AdpAgent
  • Types: AgentConfig, AgentManifest, Proposal, JournalEntry, AcbBudget, CalibrationAnchorConfig, and every other protocol type
  • Journal: JournalStore, JsonlJournal, DeliberationRecord (plus SqliteJournal via the @ai-manifests/adp-agent/journal-sqlite subpath)
  • Protocol primitives: computeWeight, computeTally, determineTermination, computeCalibration, generateId
  • Deliberation: PeerDeliberation, HttpTransport, DeliberationResult, PeerTransport
  • Signing: generateKeyPair, signProposal, verifyProposal, canonicalize
  • Calibration snapshot (ADJ §7.4): buildSnapshot, buildSignedEnvelope, signSnapshot, verifySnapshot, computeJournalHash, extractScoringPairs
  • Calibration verifier: verifyPeerCalibration, applyDivergencePenalty
  • ACB: computeDisagreementMagnitude, selectRoutine, computeCheapDraw, computeExpensiveDraw, computeHabitDiscount, buildSettlementRecord, buildBudgetCommittedEntry, budgetFromDefaults, ContributionTracker, distributeEpistemic, distributeSubstrate, DEFAULT_PRICING, DEFAULT_SETTLEMENT, MAX_HABIT_DISCOUNT
  • Evaluator: evaluate
  • MCP: createMcpServer, mountMcpEndpoints
  • Middleware: createAuthMiddleware, createJournalValidator, createRateLimiter, authHeaders, validateEntry

Optional: chain anchoring

For third-party tamper evidence, install the optional anchor package:

npm install @ai-manifests/adp-agent-anchor

See adp-agent-anchor README for wiring.

License

Apache-2.0 — see LICENSE for the full text.