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

@bedrockgovernance/attest

v0.1.0

Published

Capture what an AI model was asked and what it produced, at the moment of generation, and record it as an immutable entry in the Bedrock advice ledger.

Readme

@bedrockgovernance/attest

Record what an AI model was asked and what it produced, at the moment of generation, as an immutable entry in the Bedrock advice ledger.

@bedrockgovernance/attest captures a generation, the event of a model producing text that helps shape a piece of financial advice, and notarises it into the firm's ledger. Where CRM integrations ingest the finished advice document after it exists, attestation captures the model call at its source: the system prompt, the conversation, the retrieved context, the guardrails, and the output, hashed and chained at the instant they are used.

The client has no runtime dependencies. The optional AI SDK middleware lives in a separate entry point (@bedrockgovernance/attest/ai-sdk), so importing the core never pulls in the AI SDK.

License: Apache 2.0

Install

npm install @bedrockgovernance/attest

Quickstart

Attest explicitly

Hand Bedrock the generation bundle yourself:

import { Bedrock } from '@bedrockgovernance/attest';

const bedrock = new Bedrock({ apiKey: process.env.BEDROCK_API_KEY! });

const { generationId } = await bedrock.attest({
  // A stable id you already hold that scopes this drafting
  // conversation, e.g. a chat or thread id. Reuse it on every
  // generation in the same conversation so they group together.
  correlationId: chatId,
  clientReference: 'CLI-41269355',
  adviser: { name: 'Jane Smith', fcaRef: 'JXS01234' },
  model: { provider: 'anthropic', name: 'claude-opus-4-8' },
  instructions,
  input,
  retrievedContext,
  output: { content: draft, finishReason: 'stop' },
});

Only correlationId, model, input and output are required. input is what the model saw for this call: a single prompt string, or the role-tagged messages sent. instructions (the system prompt) is optional but worth including whenever your call has one. Everything else is optional too, included when your pipeline has it.

Attest automatically with the AI SDK

Wrap your model once and every generateText / streamText call is notarised, with no change to your generation code:

import { wrapLanguageModel } from 'ai';
import { anthropic } from '@ai-sdk/anthropic';
import { attestMiddleware } from '@bedrockgovernance/attest/ai-sdk';

const model = wrapLanguageModel({
  model: anthropic('claude-opus-4-8'),
  middleware: attestMiddleware({ bedrock, correlationId: chatId, adviser }),
});

The middleware posts the attestation in the background after the model responds, so it never adds latency to the call. Attestation failures are surfaced through an optional onError callback and never affect the model result. When onError is omitted the middleware will log a console warning by default so background attestation failures are discoverable unless you handle them explicitly.

Grouping generations

A single piece of advice is rarely one model call, and the calls are often exploratory chat turns rather than drafts of the final document. correlationId is how you group them: pass a stable id you already own (a chat, thread, or case id) on every attest() call that belongs to the same conversation. It does not need to be globally unique, only stable across the conversation. Bedrock stitches conversations into a piece of advice on the platform side, so the id does not have to survive to review time.

API

  • new Bedrock({ apiKey, baseUrl?, fetch? }) — construct a client. The apiKey is sent as the x-bedrock-key header. baseUrl defaults to the production API; fetch defaults to the global fetch (Node 18+).
  • bedrock.attest(generation) — validate the bundle and record it via POST /v1/generations. Resolves to { generationId, correlationId, outputHash, recordedAt }.
  • attestMiddleware(options) (from @bedrockgovernance/attest/ai-sdk) — an AI SDK LanguageModelV2Middleware that attests every call.
  • validateGeneration(generation) — the same local validation attest runs, exported for reuse.

Errors: BedrockValidationError (invalid bundle or config, thrown before any request), BedrockApiError (non-2xx response, carrying status, code and requestId), and their base BedrockError.

License

Apache 2.0. See SECURITY.md for vulnerability reporting.