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

pi-zed-bridge-daemon

v0.1.0

Published

Zed-side companion daemon for the Pi coding agent bridge: LSP channel + HTTP bridge for diff review and editor context.

Readme

pi-zed-bridge-daemon

The Zed-side half of Pi Zed Bridge: a zero-dependency Node process that Zed runs (via the pi-zed-bridge Zed extension) once per workspace as a pseudo language server. While Zed believes it is talking plain LSP over stdio, the daemon additionally:

  • runs an authenticated loopback HTTP bridge for the Pi extension — same wire contract as the VS Code bridge,
  • streams editor context (open buffers, active file) over SSE derived from textDocument/didOpen|didChange|didClose,
  • shows approve/reject prompts in Zed via window/showMessageRequest,
  • materializes each proposed edit into before/after temp files and opens them in Zed's native diff view via zed --diff,
  • registers on a shared bootstrap port (127.0.0.1:45731) so Pi can discover the bridge for its cwd (multi-workspace, heartbeat TTL 30s, owner-death takeover).

Usage

# Normal way: install the Zed extension; it spawns:
node …/node_modules/pi-zed-bridge-daemon/src/main.mjs --lsp --root <worktree>

# Manual/test way (no approval prompts, no context):
node src/main.mjs --root ./

stdout is reserved for LSP frames in --lsp mode — all logs go to stderr (visible in Zed's LSP log).

Endpoints (bearer-token auth, loopback only)

| Route | Purpose | |---|---| | POST /openDiff {requestId, filePath, beforeText, afterText} | Opens the Zed diff + prompt; responds with the decision when made | | POST /closeDiff {requestId, decision} | Settles/cleans a diff from the Pi side | | GET /context/stream | SSE editor-context snapshots | | POST /diagnostics | Returns available: false + empty sets (Zed does not expose diagnostics) | | GET /health | Liveness |

Env vars

| Var | Effect | |---|---| | PI_ZED_BRIDGE_DRY_RUN=1 | Never spawn zed (tests/CI) | | PI_ZED_BRIDGE_ZED_BIN=<path> | Explicit zed CLI path override | | PI_ZED_BRIDGE_SERVER_PORT / PI_ZED_BRIDGE_AUTH_TOKEN | Set for the Pi process by users running standalone daemons manually |

Files

src/main.mjs        entrypoint / wiring / signal handling
src/lsp.mjs         minimal LSP server: sync notifications, prompt queue
src/bridge.mjs      Pi-facing HTTP bridge (openDiff/closeDiff/health/SSE/diagnostics)
src/bootstrap.mjs   shared registry on :45731 + resolver + takeover
src/approvals.mjs   pending-edit coordination (Zed prompt ⇄ Pi HTTP)
src/contextStore.mjs open-file tracking + snapshot + subscribers
src/diffTemp.mjs    temp before/after materialization + sweeper
src/zedCli.mjs      `zed --diff` spawning
src/contract.mjs    ports/paths/env keys (mirror of ../shared/bridge-contract.cjs)

Tests

npm test                        # headless suite incl. a fake-Zed LSP client
node test/live-rehearsal.mjs    # manual: opens a REAL Zed diff window