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-hail

v0.1.1

Published

A pi coding-agent extension that connects a pi session to the local hail daemon so a paired phone can watch it and drive it.

Readme

pi-hail

A pi coding-agent extension that connects each interactive pi session to the local hail daemon — so a pi you start on your Mac appears on your paired phone, streams its events there, and can take a prompt typed from the phone as if you'd typed it yourself. The extension owns only the pane it starts on, stays silent when no daemon is listening, and soft-locks each side against the other so the person and the phone never fight over the same turn.

Install

Add the extension to ~/.pi/agent/settings.json:

{
  "extensions": ["npm:pi-hail"]
}

The extension loads on every pi session but is inert unless it owns an interactive TUI pane and the hail daemon is running. A missing or slow daemon never blocks pi.

Wire protocol (C4 summary)

One long-lived newline-delimited JSON (NDJSON) connection per pi process, to the daemon's Unix control socket at $XDG_RUNTIME_DIR/hail/daemon.sock (falling back to $TMPDIR/hail/daemon.sock on macOS). One JSON object per line.

Register (first line, extension → daemon):

{ "cmd": "session.register", "args": { "sessionId": "...", "project": "...", "work": "...", "dir": "/abs/dir", "piVersion": "...", "extensionVersion": "0.1.0" } }

Daemon replies with { "ok": true, "data": { "hostId", "daemonVersion", "accepted", "have" } } on success, or { "ok": false, "error": "version_mismatch: ..." } on a version mismatch (C6) — in which case the extension shows one notice and goes inert.

Then, one object per line, both directions:

  • extension → daemon: { "event": <pi rpc event verbatim> } · { "turn": "start" | "end" } · { "lock": "held" | "released" } · { "exit": { "code": n } } · { "refused": { "requestId", "reason": "turn_running" } }
  • daemon → extension: { "prompt": { "text", "from", "requestId" } } · { "presence": { "phones": [ ... ] } } · { "answer": { "requestId", "value" } } · { "ctl": "stop" }

The extension refuses a phone prompt while the local turn runs; while a phone-originated turn runs, it holds local terminal input behind a visible notice and replays it when the phone's turn ends.

Tests

node --test src/*.test.ts

Integration test (real daemon)

src/integration.test.ts runs pi-hail's socket client against the real hail daemon binary over the C4 control socket. It is opt-in and skipped by the default npm test, because it boots the actual hail binary and writes a host identity into the macOS login Keychain.

It stays off the live identity by using hail's disposable-service override (HAIL_KEYCHAIN_SERVICE, default tools.hail.itest — never the production tools.hail, which it refuses), deletes those items in teardown, and isolates the socket/state/config under a temp XDG_* (it does not override HOME, which on darwin breaks the security CLI). Run it on a clean host or a scratch account.

# 1. Build the daemon from a hail checkout on main:
(cd /path/to/hail && go build -o /tmp/hail ./cmd/hail)
# 2. Run the opt-in integration test (HAIL_KEYCHAIN_SERVICE defaults to a scratch service):
HAIL_INTEGRATION=1 HAIL_BIN=/tmp/hail npm --workspace packages/pi-hail run test:integration

It asserts the extension→daemon direction: the session.register handshake and the turn/event/exit stream. The phone→extension {prompt} round-trip is covered by the unit tests against a fake socket (a real one needs a sealed inbound relay frame from a paired peer).