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

@witness-ai/opencode

v0.3.0

Published

OpenCode plugin for witness session capture and background distillation.

Readme

@witness-ai/opencode

OpenCode plugin for witness. It reconciles OpenCode's local session database on startup and when a session goes idle, and starts witness distillation only through the CLI's laptop-friendly auto-start gate.

Supported platforms

| Operating system | Architecture | Installed binary package | | --- | --- | --- | | macOS | Apple Silicon (darwin/arm64) | @witness-ai/opencode-darwin-arm64 | | Linux | x86-64 (linux/x64) | @witness-ai/opencode-linux-x64 |

These are the only platforms supported by the npm distribution. macOS Intel, Linux ARM, and Windows are not supported. The CLI exits with a clear supported-platform message on those systems.

Install

Add the npm plugin to your OpenCode config. OpenCode installs the package automatically with Bun on startup, and the plugin auto-registers mcp.witness if you have not already defined one:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@witness-ai/opencode"]
}

To test a prerelease, pin the plugin entry to the beta version instead of the unversioned package name:

{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@witness-ai/opencode@beta"]
}

Optional: install it globally if you also want a witness CLI on your shell PATH:

npm install -g @witness-ai/opencode

Optional: run the CLI ad hoc without a global install:

npm exec --yes --package=@witness-ai/opencode -- witness doctor

The main package includes the plugin, CLI wrapper, and prompts. npm installs one optional platform package containing the matching witness binary; it does not download binaries for other operating systems or architectures. The first embedding-model download is about 470MB into the witness data directory (assets/e5-small). npm install only installs the packages; the OpenCode plugin starts the model download when OpenCode next starts. Keep OpenCode running until the first download finishes. If OpenCode stops early, the plugin stops its downloader and retries later with bounded backoff. Set WITNESS_BIN to override the platform package binary.

After the download completes, verify the model, OpenCode runner, archive, and queue:

npm exec --yes --package=@witness-ai/opencode@beta -- witness doctor
npm exec --yes --package=@witness-ai/opencode@beta -- witness distill status

By default the model is downloaded from Hugging Face. A custom WITNESS_MODEL_BASE_URL must serve the same paths (onnx/model.onnx and tokenizer.json) and also set WITNESS_MODEL_SHA256 plus WITNESS_TOKENIZER_SHA256.

Automatic distillation is batched by default: sessions are reconciled on startup and idle, while model work starts at most once every 10 minutes, drains the current queue, then exits so the embed model is not resident. Edit witness config.toml if you want manual-only behavior:

auto_distill = false

If you want to force a different binary, set WITNESS_BIN before starting OpenCode:

export WITNESS_BIN=/absolute/path/to/witness

If you already have your own mcp.witness entry, the plugin leaves it alone. The npm CLI deliberately does not support witness install / witness uninstall; those are source-checkout workflows, not the npm one.