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

agent-justice-protocol

v0.1.0

Published

Forensic investigation, dispute resolution, and risk assessment for the agent economy — TypeScript reference implementation

Readme

Agent Justice Protocol — TypeScript

License: Apache 2.0 Node 18+ Zero Dependencies

Forensic investigation, dispute resolution, and risk assessment for the agent economy — TypeScript reference implementation. The accountability layer (Layer 4) of the Agent Trust Stack.

Port of the Python reference implementation — 9 source modules, 115 tests, strict TypeScript.

Quick Start

npm install agent-justice-protocol
import {
  ForensicInvestigation, IncidentReport, AgentReference,
  EvidenceRecord, JusticeStore,
} from "agent-justice-protocol";

// Investigate an incident
const report = new IncidentReport({
  reporter: new AgentReference({ agentId: "agent-monitor-01" }),
  incidentType: "service_failure",
  severity: "high",
  description: "Agent failed to deliver contracted output",
  subjects: [new AgentReference({ agentId: "agent-suspect-42" })],
});
const investigation = new ForensicInvestigation(report);
investigation.addEvidence(new EvidenceRecord({
  evidenceType: "interaction_log",
  provenanceTier: 2,
  sourceAgentId: "agent-monitor-01",
  content: { action: "request_sent", status: "timeout" },
}));
const finding = investigation.produceFinding();

// Store results
const store = new JusticeStore();
store.appendFinding(finding);

Three Modules

| Module | Purpose | Key Classes | |--------|---------|-------------| | Forensics Engine | Investigate incidents: collect evidence, reconstruct timelines, flag causal indicators | ForensicInvestigation, IncidentReport, EvidenceRequest, PrivacyGuard | | Dispute Resolution | File claims, exchange evidence (commit-reveal), arbitrate with peer panels | Dispute, DisputeClaim, ArbitratorPool, renderDecision | | Risk Assessment | Score agent risk, compute actuarial outputs for insurance underwriting | RiskEngine, RiskProfile, populationRiskSummary |

Architecture

src/
├── schema.ts        — Constants, helpers, all data structures (AgentReference, EvidenceRecord,
│                      ForensicFinding, DisputeClaim, ArbitrationDecision, RiskProfile)
├── evidence.ts      — Evidence request scoping, filtering, redaction manifests
├── forensics.ts     — Five-phase investigation engine, timeline reconstruction, causal indicators
├── privacy.ts       — Anti-fishing enforcement (Rules 5/5a), per-initiator/per-respondent tracking
├── dispute.ts       — Dispute lifecycle, commit-reveal protocol, settlement offers
├── arbitration.ts   — Arbitrator pool, eligibility, weighted panel selection, vote aggregation
├── remediation.ts   — Remediation orders, compliance tracking
├── risk.ts          — Risk scoring engine, actuarial outputs, population analytics
├── store.ts         — Append-only JSONL store for all record types
└── index.ts         — Barrel exports

Build & Test

npm install
npm run build
npm test

Key Features

  • Evidence-first: Every dispute must be grounded in a forensic investigation
  • Provenance-tiered: Evidence weight scales with quality (Tier 1 cryptographic > Tier 4 self-reported)
  • Privacy-protected: Anti-fishing rules prevent weaponization of investigations (Rules 5/5a)
  • Commit-reveal: Blind evidence exchange prevents strategic adaptation
  • Three resolution tiers: Automated (<$1K), peer arbitration ($1K-$50K), human escalation (>$50K)
  • Actuarial outputs: Expected loss rate, loss severity distribution, premium basis
  • Identity-agnostic: Works with CoC, ERC-8004, A2A, W3C VC/DID, or bare URIs
  • Zero runtime dependencies — only node:crypto and node:fs
  • Strict TypeScript with declaration files and source maps

Security Disclaimer (VAM-SEC v1.0)

This software is provided as a reference implementation of the Agent Justice Protocol specification. It is intended for research, development, and integration testing.

This software does not provide legal advice, legal representation, or legally binding arbitration. Dispute decisions are structured data outputs, not legal judgments.

No warranties. See LICENSE for full terms.

License

Apache 2.0