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

@sjawhar/pi-legion-envoy

v0.5.0

Published

Tracked Oh My Pi extension for Envoy messaging. It shares the Envoy HTTP client, tool contract, envelope parsing, and subject helpers with the other Legion adapters while keeping OMP's direct NATS subscriptions and Pi steering delivery local (inbound mess

Readme

Pi Envoy Extension

Tracked Oh My Pi extension for Envoy messaging. It shares the Envoy HTTP client, tool contract, envelope parsing, and subject helpers with the other Legion adapters while keeping OMP's direct NATS subscriptions and Pi steering delivery local (inbound messages steer an in-flight turn instead of queueing behind it).

Normal topic subscriptions are direct NATS subscriptions owned by this extension. A role claim is different: the listener arbitrates the core-NATS role lane for the current live holder, then sends a receipt-backed request with the original role topic to the holder's direct agent subject. The agent pump replies after accepting the envelope; without a receipt within two seconds the listener emits a delivery_failed exception. Role messages are live only; they are not retained for a later claimant.

envoy_list() shows the union of the local subscriptions and the listener's persisted interest registry. Each reported interest identifies whether it is live, registry, or both, so temporary registration drift does not hide the extension's actual delivery state.

Session identity

Run /whoami to copy the active session ID to the clipboard. OMP copies through its host clipboard API, which sends OSC 52 first for tmux and SSH sessions. The notification shows the session ID even if the copy fails.

For tmux to accept OSC 52 clipboard writes, enable clipboard support in the tmux server:

set -g set-clipboard on

Development install

This package declares two OMP extension entries in package.json: extensions/envoy.ts (Envoy messaging, subscriptions, and steering delivery) and extensions/legion.ts (the Legion lifecycle: root bootstrap, worker spawning, budgets, and daemon capabilities). Loading the package directory with OMP's --extension flag — as the Legion daemon does when it launches trees and workers — loads both.

For local development of the messaging extension alone, link the entry into OMP:

ln -sfn "$PWD/packages/pi-envoy/extensions/envoy.ts" \
  ~/.omp/agent/extensions/envoy.ts

The repository root package.json likewise loads only extensions/envoy.ts for dev sessions inside this repo: the Legion extension is meant to be loaded by the daemon with its environment prepared, not by ambient dev sessions.

Published package

Released installs come from npm as @sjawhar/pi-legion-envoy. The tarball is self-contained: it ships only dist/envoy.js — bundling every dependency except the OMP host package — and the repo skills/ tree staged beside it at dist/skills so resources_discover serves the Legion skills from the installed package. The published manifest exposes only dist/envoy.js — matching the repository root — while the committed manifest keeps the TypeScript entries for repo checkouts; extensions/legion.ts is daemon infrastructure and is not packed at all.

.github/workflows/release-pi-envoy.yaml performs that manifest rewrite around bun pm pack and restores the committed file before tagging. Packing with the committed source manifest is refused by scripts/prepack.sh, because such a tarball would point OMP at extension files it does not contain.

Dispatch

Every OMP session — Legion sessions included — gets the dispatch MCP tool the way OpenCode sessions do: the shared @legion/envoy-client shim mounts as a stdio MCP server, and it serves when dispatch.enabled is true in the shared envoy.json (~/.config/opencode/envoy.json, shallow-merged with <cwd>/.opencode/envoy.json) or DISPATCH_MCP_URL is set explicitly. The server URL comes from dispatch.serverUrl (default http://localhost:8766). Dispatch is how any agent — an interactive session or a headless Legion role — raises a durable question to the human: the thread lands as a GitHub issue in the session cwd's repo (or an explicit repo), carries the session's provenance, and shows up on the Dispatch dashboard. The dispatch skill (shipped in skills/) says when to use it. Replies route back to the asking session, which is auto-subscribed to the thread's GitHub topic; a Legion role's session survives kill/resume because Legion resurrection resumes the same OMP session file, so the reply still lands. Lifecycle and scope decisions still go through hub to the owning architect — Dispatch is for durable questions to the human, not for coordination between roles.

No manual mount is needed: the package-root .mcp.json ships the server with the package, so any session that loads it (installed plugin, --extension, the Legion daemon's repo checkout) discovers dispatch automatically. The committed manifest runs ./bin/dispatch-mcp-shim.ts from source; the release workflow points the published tarball at the self-contained ./dist/bin/dispatch-mcp-shim.js. A same-named dispatch entry in ~/.omp/agent/mcp.json would override the package mount — remove machine-local entries rather than maintaining both.

The shim forwards newline-delimited JSON-RPC from stdin to the dispatch server's Streamable HTTP /mcp endpoint with a cached GitHub bearer from the user's gh shim. The bearer refreshes before expiry and retries once immediately after a 401 response.