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

@fareground/agent-id

v0.2.0

Published

TypeScript implementation of the agent-id standard (amp/0.2): self-certifying agent identities, signed cards, delegation, revocation, proof of possession, and key rotation. Zero runtime dependencies.

Readme

@fareground/agent-id (TypeScript)

Standalone TypeScript implementation of the agent-id standard (amp/0.2) — the second independent implementation, proving the wire format is implementation-independent. It reproduces every golden vector in ../spec/vectors.json byte-for-byte against the Python reference.

  • Zero runtime dependencies. Crypto is WebCrypto (crypto.subtle): Ed25519, X25519, SHA-256 — available in Node 20+ and modern browsers.
  • Full v0.2 wire surface: canonical JSON, domain-separated signing input (all 7 contexts), amp:key: addresses, did:amp + DID documents, signed AgentCards (unknown fields preserved-and-signed), delegation chains with scope intersection, revocation + key revocation + freshness-aware registry, audience-bound challenge-response, and pre-rotation key rotation with fork detection.
  • Criticality: cards and delegations may carry a critical list of field names; verification fails on a critical field this implementation does not understand, unless the caller declares it understood.

Build & conformance

cd js
npm install          # dev deps only (typescript, @types/node)
npm test             # tsc + full suite (conformance, round-trip, negative)
npm run conformance  # golden-vector conformance only

The conformance runner is data-driven over ../spec/vectors.json: unknown vector sections or artifact kinds are skipped with a log line, so the Python side can add cases without breaking this runner.

API sketch

Everything is exported from @fareground/agent-id (see src/index.ts). Crypto operations are async (WebCrypto).

import {
  KeyPair, addressFromSigningKey,
  AgentCard, Delegation, DelegationChain, Revocation, KeyRevocation,
  RevocationRegistry, Challenge, ChallengeStore,
  Inception, KeyRotation, RotationChain, RotationRegistry, keyCommitment,
  addressToDid, didDocument, resolve,
} from "@fareground/agent-id";

const keys = await KeyPair.generate();
const address = addressFromSigningKey(keys.public_.signing);

// Signed, self-certifying card
const card = await AgentCard.create({ keys, address, name: "my-agent" });
await card.verify();

// Delegation chain, scopes = intersection of all links
const grant = await Delegation.grant({
  issuerKeys: keys, issuerAddress: address,
  subjectAddress: worker, scopes: ["read"], ttlSeconds: 3600,
});
const scopes = await new DelegationChain([grant]).verify(worker);

// Proof of possession (audience-bound)
const store = new ChallengeStore();
const challenge = store.issue("https://verifier.example");
const response = await challenge.respond(keys, address);
await response.verify(store.consume(response.challengeId)!, "https://verifier.example");

// Key rotation (pre-rotation commitments; forks refuse to advance)
const inception = await Inception.create(keys, await keyCommitment(nextKeys.public_.signing));
const state = await new RotationChain(inception).resolve();

Wire-level primitives are exported too: canonicalJson, signingInput, signPayload / verifyByAddress, base58Encode/Decode, canonicalTimestamp.

Parity notes vs the Python reference

  • Serialization surface is toJSON() / fromJSON() (instead of pydantic-style model_dump / model_validate); wire bytes are identical.
  • The passphrase-sealed key-file format (spec §9, scrypt + ChaCha20-Poly1305) is not implemented here — it is explicitly a local-storage recommendation, not a wire construction. The 64-byte raw form (signing || agreement) is.
  • Registry snapshot persistence (snapshot()/restore()) is not ported; registries here are in-memory. Nothing interoperable depends on it.