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

@ai-gui/plugin-evidence

v0.29.2

Published

Host-owned query provenance fences for AIGUI: show which queries produced the numbers.

Readme

@ai-gui/plugin-evidence

Query-provenance blocks for AIGUI: show which statements produced the numbers in an answer.

The point is the ownership. The host writes this fence, not the model. A model that can invent a number can invent the query said to have produced it, so evidence written by the model is not evidence — it is more of the same claim. This plugin renders a fence the application appends from what it actually executed.

Install

pnpm add @ai-gui/plugin-evidence

Usage

import { AIRenderer } from "@ai-gui/react"
import { evidence, evidencePromptSpec, serializeEvidenceFence } from "@ai-gui/plugin-evidence"

<AIRenderer text={answer} plugins={[evidence({ title: "Data provenance" })]} />

Two halves, both required:

1. Tell the model to keep its hands off the fence. Append evidencePromptSpec() to the system prompt:

Never emit an ```evidence fence. The application appends it from the queries it really ran.
State numbers you obtained from tool results; do not describe the queries yourself.

2. Append the fence server-side from the log of what ran:

const fence = serializeEvidenceFence({
  queries: executed.map(q => ({
    query: q.sql, source: q.database, rows: q.rowCount, ms: q.elapsedMs,
    ok: q.ok, error: q.error,
  })),
})
return answer + "\n\n" + fence

The fence

Fenced JSON, so a partially streamed block is detectably incomplete rather than half-rendered:

```evidence
{"queries":[
  {"query":"SELECT count(*) FROM orders","source":"shop","rows":1,"ms":6,"ok":true},
  {"query":"SELECT * FROM missing","ok":false,"error":"no such table"}
]}
```

| field | meaning | |---|---| | query | the statement that ran (required) | | label | human name, e.g. the tool or the question it answered | | source | where it ran — a database or warehouse name | | rows / ms | rows returned, wall-clock duration | | ok / error | false renders the entry as failed, with the reason |

Failed statements are shown, not hidden. A question that took four tries to answer is a different kind of answer than one that took a single query, and the reader deserves to see which they are looking at.

Options

| option | default | | |---|---|---| | title | "Data provenance" | heading on the disclosure | | defaultOpen | false | most readers want the number, not the SQL — until they don't |

The block is a <details>, collapsed by default: provenance should be one click away, not in the way.

Styling

evidenceCss is a plain string of the default styles; the markup carries data-aigui-evidence* attributes, so you can ignore it and write your own. Colours use color-mix against currentColor, so the block follows the surrounding theme instead of forcing a light card onto a dark page.

Streaming

Rendering is complete-gated. While the fence is still arriving, a placeholder shows; the block renders once the closing fence lands. A provenance list that grows a row at a time reads, mid-stream, like a list that is already finished — and a reader who looks away at the wrong moment sees three queries where there were five.

License

MIT