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

avtc-claude-pi-bridge

v1.0.1

Published

Run pi extensions unmodified inside Claude Code plugins: a Node engine that emulates the pi extension API, and a hooks library that maps Claude Code events to it.

Readme

avtc-claude-pi-bridge

Run pi extensions unmodified inside Claude Code plugins — a Node engine that emulates pi's extension API, a hooks library that maps Claude Code's events to it, a generator for the plugin's wiring, and test kits.

Features

  • Unmodified extensions — the engine bundles each hosted extension from its sources at its start and gives it stand-ins for pi's packages; pi itself is not needed on the machine.
  • pi's extension API — tools, commands, skills, session and tool events, messages, session entries, compaction, the model of the main loop, session switching.
  • pi's UI at the host — widgets and status segments in a band above the prompt, components and settings in panes, select, confirm and input as the host's questions, a choice with a time limit in a pane that counts down.
  • Subagents — the agents the extensions bring are agent types of the plugin's; each agent's conversation gets extensions of its own, with model routing and a tool policy.
  • Isolated conversations — the main conversation and each subagent's run in a worker of their own.
  • Adapters — stand-ins for avtc-pi-subagent, avtc-pi-ui-components, avtc-pi-notification and avtc-pi-settings-ui.
  • Generated wiring — pi-bridge-sync writes the plugin's hooks module, its state contract and a stub for each hosted skill, and checks them.
  • Test kits — a coverage check of the pi API the extensions use, a fake host for scenario tests under Node, and playEngine for specs under claude plugin test.
  • Says when it cannot serve — a missing Node or a stopped engine is one line above the prompt; every hook passes meanwhile, and the engine is started again by itself.

Requirements

  • Claude Code 2.1.330 or newer. The bridge is developed and checked in the terminal.
  • Node.js 22.19 or newer on PATH. Without it the plugin stays unavailable and says so.

Installation

In the plugin's folder:

npm install --save-exact avtc-claude-pi-bridge
  • Real files. Claude Code loads no hooks file that a link leads out of the plugin's folder to. So the bridge must lie in the plugin's node_modules as files: a file: dependency or npm link of the bridge does not load, and claude plugin validate says cannot import … no such file under <plugin>. A development layout copies what the bridge ships into the plugin's node_modules, as scripts/link-example.mjs does for the example.
  • At the top of node_modules: typebox 1.3.27. The extensions' bundles load it from there. It is a dependency of the bridge, so npm puts it there unless another version takes the place. No package of pi's is installed: the bundles get stand-ins for them, pi's terminal library among them.
  • esbuild comes with the bridge and bundles the extensions each time the engine starts.

Usage

examples/ holds a small pi extension and the plugin that hosts it; examples/README.md has the steps to try it.

The plugin's folder

| Path | Who writes it | |---|---| | .claude-plugin/plugin.json | the author | | engine.config.json | the author | | package.json | the author | | hooks/hooks.json, hooks/register.ts | pi-bridge-sync | | types/index.d.ts | pi-bridge-sync | | skills/<name>/SKILL.md | pi-bridge-sync, one for each skill the hosted packages bring | | plugin-test/*.test.ts | the author: the specs for claude plugin test |

package.json names the pi extension packages and the bridge as dependencies, each with an exact version.

.claude-plugin/plugin.json carries the plugin's name, the same one engine.config.json gives, and "types": "./types/index.d.ts".

engine.config.json says what the engine hosts. The smallest one:

{
  "plugin": "hello",
  "extensions": ["hello-pi-ext"],
  "skills": { "hello-pi-ext": "skills" },
  "compactionLine": "hello: compacting context."
}

The generated files

npx pi-bridge-sync [<plugin folder>]
npx pi-bridge-sync --check [<plugin folder>]

The folder is the working directory when none is given. pi-bridge-sync writes the hooks module from the bridge's template with the plugin's values in it, the contract of what the plugin keeps in the session, and a stub for each hosted skill. A stub has the skill's name, description and argument hint; the engine gives the text the model reads. A stub of a skill the packages bring no more is removed.

--check writes nothing and exits with 1 when a file is not as it would be generated, or when plugin.json does not fit the config.

Commit the generated files, and keep them out of a formatter: the check compares them byte for byte. Run pi-bridge-sync again after a change of engine.config.json, of a hosted skill's frontmatter, or of the bridge's version.

Names at the host

| pi | Claude Code | |---|---| | the tool hello_greet | mcp__<plugin>__hello_greet | | the command /hello | /hello | | the command /hello:settings | /hello-settings | | the skill /skill:hello-tour | /<plugin>:hello-tour | | the agent reviewer | the agent type <plugin>:reviewer |

Emulation

What a hosted extension gets of pi's API, how each part shows in Claude Code, what the person sees when the plugin is unavailable or an extension fails to load, and the known limits: see EMULATION.md.

Configuration

  • What the engine hosts (engine.config.json: the extensions, the adapters, the variables, the skills) — see CONFIGURATION.md.
  • Subagents' models and tools (pi-bridge/settings.json) — see CONFIGURATION.md.
  • An extension's own settings, and where the bridge keeps its files — see CONFIGURATION.md.

Testing

A coverage check, scenario tests on a fake host, and specs for claude plugin test: see TESTING.md.

Commands

| Command | Description | |---|---| | pi-bridge-sync [--check] [<plugin folder>] | Write, or check, the plugin's generated files | | pi-bridge-coverage [--allow <file>] [<plugin folder>] | List the members of pi's API the hosted extensions use, and fail for one the bridge does not emulate |

Versions

The bridge has a version and a protocol number (1). The hooks library and the engine of a session must be of the same version and protocol; a plugin whose two halves differ is unavailable and says both.

Development

The layout, the gates and the release runbook are in DEVELOPMENT.md.

Full suite

Check out the full suite of related extensions, avtc-pi — deterministic feature development, subagent delegation, working-memory, behavioral learning, parallel-work guardrails, durable decisions, notifications, and more.

Developed with Z.ai — get 10% off your subscription via this referral link.

License

MIT