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

@fabric-harness/agent-registry

v0.5.0

Published

Vertical-neutral agent governance contracts: registration, enrollment, capability grants, budgets, decision boundary, and identity bindings.

Readme

@fabric-harness/agent-registry

Vertical-neutral agent governance contracts, extracted per the Fabric Agent Contracts Reconciliation ADR (techfabric vault) from the family's origin vertical packages. This package knows nothing about the applications that integrate with it — no vertical vocabulary, no product names, CI-guarded in both src/ and test/. Origin-equivalence tests live in each vertical's own repository beside its re-export shim.

What lives here:

  • registry — agent definitions, hash-pinned versions with hard model budgets (resolveAgentRunTokenBudget), tenant registrations, capability grants with the read/propose/execute separation, runs, execution principals, and scopeMatches/isActionAllowedByScopes for <namespace>.* scope patterns over action IDs.
  • enrollment — the external-runtime onboarding state machine (invites with hashed tokens, request/approve with request-hash + envelope-hash fencing, encrypted credential reveals, operator dispatches/admissions, mutation fences) and approvalIsSubset — approval can only narrow, never widen. Runtime kind generic-mcp is the channel-hosted ACP agent kind.
  • decisions — ActionRoute routing vocabulary with app-owned approvals (approvalRequestId) and Host-owned approvals (approvalOwner: 'host', actionInvocationId), per-action PolicyDecision/PolicyHint, the clampRoute autonomy ceiling, the ApprovalRequest entity, decision events, SignalPendingStep, and the D16 decision boundary: validateExternalDecision (pure — refusals, expiry, verification floor, capability, receipt pins) returning the decision record + SignalOutboxIntent the vertical action persists atomically with its pending→terminal compare-and-set, and createSignalOutboxReconciler (idempotent delivery with CAS checkpointing; receiving workflows dedupe on approvalRequestId). No neutral code records a decision and then performs an uncheckpointed inline signal.
  • identity — revocable external identity bindings (nostr, slack, email, …) between surface identities and Fabric principals.
  • evidence / skills / envelope / ports / kinds — outcome-evidence and skill-contract factories, the X-Fabric-Signature: v1= signed envelope, neutral ports, namespaced kind primitives.

Event-handler runtime (@fabric-harness/agent-registry/event-handler)

createEventHandler({ verify, store, handlers, classify }) returns a (request: Request) => Promise<Response> handler for signed platform events. It is written against Web-standard APIs (Request, Response, TextDecoder and WebCrypto). An import scan in the package tests refuses Node imports and Node globals in this package's own sources; it allows zod without scanning it, and no test runs the module inside workerd, so Cloudflare Workers support without nodejs_compat is the intent rather than a tested result.

import {
  createEventHandler,
  createInMemoryKeyValueStore,
  createProcessedEventStore,
  fabricEnvelopeVerifier,
} from '@fabric-harness/agent-registry/event-handler';

const handle = createEventHandler({
  verify: fabricEnvelopeVerifier(env.FABRIC_EVENT_SECRET),
  store: createProcessedEventStore(env.PROCESSED_EVENTS ?? createInMemoryKeyValueStore()),
  handlers: {
    'example.updated': async (envelope) => {
      // Do the work. Return nothing for completed, or { kind: 'retry' | 'dead_letter' | 'ignored' }.
    },
  },
  classify: (error) => (error instanceof ValidationError ? { kind: 'dead_letter' } : { kind: 'retry' }),
});
  • Checks before any store access or handler: method (405), body size (413, default 1,000,000 bytes, refused while the body streams), UTF-8 (400), X-Fabric-Signature and X-Fabric-Timestamp over the body text exactly as received (401, 300 seconds skew by default), then the agentEventEnvelopeSchema shape (400). A leading byte-order mark is kept in the verified text, so a body changed by adding one fails verification. A verifier that throws, including on a clock that returns a non-finite time, returns 503, since the signature could not be checked.
  • Options are checked when the handler is built: maxBodyBytes must be a positive integer, retryAfterSeconds a number from 0 to 86,400, and fabricEnvelopeVerifier's maxSkewSeconds a finite number, 0 or more. Anything else throws.
  • Outcomes and statuses come from eventOutcomeResponse: completed and ignored return 200, retry returns 503 with Retry-After, dead_letter returns 422. Retry-After is a whole number of seconds, rounded up and capped at MAX_RETRY_AFTER_SECONDS (86,400); an invalid value falls back to the configured default, then to 30. The body is {"outcome": "<kind>"}.
  • Dispatch: an event type with no handler in the table is ignored without touching the store, so a handler added later can still take a redelivery. Handlers, classify and onOutcome receive the plain parsed envelope. A handler that returns undefined has completed; one that returns null or any other value that is not an outcome gets retry. Every outcome is copied into a new object before use, so only a recognized outcome can produce a response or a marker. An outcome is recognized by its kind; an optional field of the wrong type (a non-string reason, a non-numeric retryAfterSeconds) is dropped and the kind still applies. A returned value that is not an outcome is retry and does not reach classify. A handler that throws is passed to classify; when classify is absent, throws, or returns anything but retry or dead_letter, the outcome is retry, so a handler failure is not reported as success.
  • Observer: onOutcome runs after the response is built, and a throw or a rejected promise from it is ignored.
  • Processed events: createProcessedEventStore(kv, { ttlSeconds, prefix }) keeps one marker per tenant and event id (tenantId and eventId from the envelope) for 7 days by default. Other envelope fields are not part of the scope, so a redelivery whose payload was re-rendered still matches. The key is the prefix followed by the lowercase hex of SHA-256 over the UTF-8 bytes of JSON.stringify([tenantId, eventId]): always the prefix length plus 64 characters, so it fits the 512-byte key limit of Workers KV whatever the ids hold, and two identities share a key only on a SHA-256 collision. The prefix may be at most 448 UTF-8 bytes (MAX_PROCESSED_EVENT_PREFIX_BYTES); a longer one throws when the store is built. The store is anything with get, put(key, value, { expirationTtl }) and delete (the shape of a Cloudflare KV namespace). The tenant and event id are copied before any handler runs, and both marker operations use that copy. An event is marked only after its handler returns completed, ignored or dead_letter; a retry leaves it unmarked. A redelivery of a marked event returns 200 without running the handler.
  • Store failures: a failed read returns 503 and does not run the handler. A failed write after the handler ran also returns 503, which asks the sender to redeliver. The handler runs again only if no marker is visible at that time, so a store that wrote the marker but reported failure suppresses the redelivery. Handlers must be idempotent.
  • Known limit: the marker is written after the handler finishes, so two concurrent deliveries of the same event can both run the handler.

Scope rule (CI-guarded): nothing here names a vertical's domain. Verticals attach scope via zod .extend() and factory literals in their own packages, which keeps persisted wire shapes byte-identical through the extraction.

Layering: channel adapters (@fabric-harness/channels/*) carry candidate identities and never authorize; only a vertical's governed decision-ingress action — composed from createDecisionIngress — resolves bindings, checks capabilities, and signals durable workflows.