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

@pcguest/atb-sdk

v1.18.1

Published

ATB bundle reader and verifier SDK

Readme

@pcguest/atb-sdk

The ATB TypeScript SDK creates and reads ATB bundles, verifies local hash chains, and lets Node.js callers iterate canonical bundle events.

It targets Node.js 18 or newer because file-backed bundles, encryption, and the optional loopback Agent transport use Node APIs. It is not a browser SDK.

Installation

npm install @pcguest/atb-sdk

Quickstart

import {
  AI_REQUEST_RECEIVED_EVENT_TYPE,
  Bundle,
} from "@pcguest/atb-sdk";

const bundle = new Bundle();
bundle.append(AI_REQUEST_RECEIVED_EVENT_TYPE, {
  request_id: "req-001",
  actor_id_hash: "sha256:actor-001",
  purpose_tag: "rag_answer",
});
bundle.save("run.atb/bundle.atb");

const received = Bundle.load("run.atb/bundle.atb");
const result = received.verify();

for (const record of received.records) {
  console.log(record.event.type);
}

console.log(result.signatures);

Acquisition provenance

Events produced by the Go importers (atb import chatlog, atb import otel) carry an optional top-level acquisition field describing how the evidence was acquired. The SDK preserves it through parseEvent, canonical preparation, and Bundle.load().verify(), and exposes it as record.event.acquisition (typed as Acquisition). Acquisition is provenance metadata — it records how evidence entered ATB, not who produced it, and does not establish truth, authority, or integrity.

Generated event catalogue

src/eventTypes_generated.ts is produced by go generate ./internal/event/... from schemas/event.v1.json. It is a generate-gate artefact (make check-generated), not a hand-maintained public module. Do not edit it. Import event constants from the published package entry (@pcguest/atb-sdk).

Supported event types

| Event type constant name | Event type string | | --- | --- | | BUNDLE_MANIFEST_EVENT_TYPE | atb.bundle.manifest | | BUNDLE_ANCHOR_EVENT_TYPE | atb.bundle.anchor | | BUNDLE_SIGNATURE_EVENT_TYPE | atb.bundle.signature | | AI_REQUEST_RECEIVED_EVENT_TYPE | ai.request.received | | AI_RESPONSE_SENT_EVENT_TYPE | ai.response.sent | | AI_POLICY_DECISION_EVENT_TYPE | ai.policy.decision | | AI_RETRIEVAL_EXECUTED_EVENT_TYPE | ai.retrieval.executed | | AI_MODEL_INVOKED_EVENT_TYPE | ai.model.invoked | | AI_MODEL_OUTPUT_EVENT_TYPE | ai.model.output | | AI_ACTION_PRECOMMIT_EVENT_TYPE | ai.action.precommit | | AI_ACTION_EXECUTED_EVENT_TYPE | ai.action.executed | | AI_ACTION_COMMITTED_EVENT_TYPE | ai.action.committed | | AI_HUMAN_APPROVAL_EVENT_TYPE | ai.human.approval | | AI_JOB_SCHEDULED_EVENT_TYPE | ai.job.scheduled | | AI_JOB_STARTED_EVENT_TYPE | ai.job.started | | AI_JOB_STEP_EVENT_TYPE | ai.job.step | | AI_JOB_COMPLETED_EVENT_TYPE | ai.job.completed | | DATA_EXPORT_PRECOMMIT_EVENT_TYPE | data.export.precommit | | DATA_EXPORT_EXECUTED_EVENT_TYPE | data.export.executed |

Profile support

Bundle.verify() checks local hash-chain integrity and supported signature records. To evaluate ATB obligation profiles, incident findings, anchors, and the full verify.report.v1 contract, hand the same file to the Go CLI:

atb verify --bundle run.atb/bundle.atb --profile atb.profile.rag_answer

Bundle.load() rejects records above 16 MiB and defaults to 512 MiB and one million records per bundle. Pass { maxBytes, maxRecords } as the second argument to choose lower limits for untrusted inputs.

Optional reviewer identity evidence

Oversight gates accept advanced, digest-only identity context:

import type { ActionGateInput } from "@pcguest/atb-sdk";

const action: ActionGateInput = {
  actionType: "deploy",
  targetResourceId: "production/api",
  intendedEffect: "release candidate",
  actionParameters: { version: "2026.06" },
  identityEvidence: {
    identityProvider: "https://idp.example",
    subject: "reviewer@example",
    authContext: "mfa",
    assertionType: "jwt",
    assertionDigest: "sha256:...",
  },
};

Retain and verify the original assertion in your IdP/JWKS/PKI workflow. ATB hash-chains the supplied digest but does not authenticate the subject.

Optional Mortise custody

Mortise is a separate service; the SDK remains fully local without it:

import { readFile } from "node:fs/promises";
import { MortiseClient } from "@pcguest/atb-sdk";

const client = new MortiseClient("https://mortise.example", {
  token: process.env.ATB_MORTISE_TOKEN,
});
const bundle = new Uint8Array(await readFile("run.atb/bundle.atb"));
const verification = await client.verifyBundle(bundle); // does not persist
const receipt = await client.ingestBundle(bundle);       // custody + receipt
await client.verifyReceipt(receipt);
await client.receiptsByHash(receipt.bundle_hash);

The client rejects credential-bearing or non-HTTP(S) URLs, disables redirects, caps responses at 1 MiB, and validates the frozen custos.receipt.v1 wire identifier.

Vercel AI SDK integration

For Vercel AI SDK middleware guidance, see docs/integrations/.

Licence

MIT.