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

@hashline/sdk

v0.1.0

Published

TypeScript SDK for the Hashline agent audit ledger.

Readme

@hashline/sdk

TypeScript SDK for the Hashline agent audit ledger — append-only, hash-chained, tamper-evident logging for AI agent workloads.

Status: v0.1 (Milestone 9). Wire-compatible with the v1 HTTP API described in spec.md.

Install

npm install @hashline/sdk

Quick start

import { Client } from "@hashline/sdk";

const client = new Client({
  apiKey: process.env.HASHLINE_API_KEY,
  // baseUrl defaults to the hosted API; override for local dev:
  // baseUrl: "http://localhost:8787/v1",
});

// Single event — the run is auto-created on first ingest.
await client.event({
  run_id: "run_01HXYZ...",
  type: "tool_call",
  actor: { type: "agent", id: "agent_search" },
  payload: { name: "web_search", arguments: { q: "..." }, call_id: "c1" },
});

// Batch (up to 500 events, same run, atomic).
await client.batch("run_01HXYZ...", [
  { type: "prompt",     actor: { type: "agent", id: "a" }, payload: { model: "m", content: "..." } },
  { type: "completion", actor: { type: "agent", id: "a" }, payload: { model: "m", content: "..." } },
]);

Behavior

  • Auto-retry on 408, 429, and 5xx with exponential backoff + full jitter. Retry-After is honored when the server sends it. Network errors (DNS/TCP/TLS/abort) are also retried.
  • No-op mode. Construct with { enabled: false } (or set the env var HASHLINE_DISABLED=1) and every method returns null without any network I/O. Useful for local dev, CI, and opt-out flags.
  • Validation. Obvious wire-format mistakes (missing run_id, missing actor, batch > 500, conflicting run_id inside a batch) throw ValidationError before any request is sent.
  • Typed errors. Non-2xx responses throw APIError with status, requestId, and the parsed RFC 7807 problem body. Transport failures throw NetworkError.
  • Tenant isolation. Per spec §9.3, cross-tenant access returns 404 — the SDK propagates this as a non-retryable APIError with status: 404.

Security notes

  • The SDK does NOT scrub PII or secrets from payloads. Scrub upstream.
  • API keys must never be used from browsers; this SDK is for backend/server use.
  • Keys are Bearer-auth over TLS; rotate via the dashboard / control plane.

Running the example

The example script in examples/basic.ts runs against a local dev Worker:

HASHLINE_API_KEY=al_test_... \
HASHLINE_BASE_URL=http://localhost:8787/v1 \
npx tsx examples/basic.ts

It emits a small agent run (run_startedtool_call/tool_result batch → run_ended) and then calls POST /v1/runs/:id/verify, asserting the chain reports valid: true.

Development

npm install
npm run typecheck
npm test
npm run build

License

Apache-2.0.