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

@xzzpig/pi-terminal-notifications

v0.1.1

Published

Desktop notifications and Herdr blocked-state integration for Pi ask flows.

Downloads

349

Readme

@xzzpig/pi-terminal-notifications

@xzzpig/pi-terminal-notifications sends a desktop notification when Pi settles or needs input, and mirrors pending input to Herdr through herdr:blocked.

It observes three public cross-extension APIs:

  • @eko24ive/pi-ask lifecycle events.
  • @xzzpig/pi-permission-system UI prompt, direct decision, and forwarded decision events. Forwarded requests are correlated with the parent response by requestId.

The extension is observational. A notification or event listener failure never blocks Pi, a permission decision, or an agent loop.

Install

Install the published package:

pi install npm:@xzzpig/pi-terminal-notifications

From a checkout of this monorepo:

pi install ./packages/pi-terminal-notifications

From the Git monorepo, load only this extension:

{
  "packages": [
    {
      "source": "git:github.com/xzzpig/pi-extensions@main",
      "extensions": ["packages/pi-terminal-notifications/extensions/index.ts"]
    }
  ]
}

Notification Protocols

The extension emits exactly one notification sequence per event. It resolves TERM_PROGRAM against built-in mappings, then falls back to osc99 when the variable is unset or no mapping matches.

| TERM_PROGRAM | Default protocol | | ------------------ | ---------------- | | ghostty | osc9 | | iTerm.app | osc9 | | WezTerm | osc9 | | kitty | osc99 | | vscode | osc99 | | WarpTerminal | osc777 | | missing or unknown | osc99 |

The defaults follow the documented notification protocols of iTerm2, WezTerm, Ghostty, and kitty. The VS Code and Warp mappings match the Herdr terminal notification profiles maintained in the accompanying NixOS configuration.

All payload text is stripped of terminal control characters, OSC separators, and excessive whitespace before it is written. This prevents application text from escaping the selected notification protocol.

Configuration

The optional global configuration file is:

~/.pi/agent/extensions/pi-terminal-notifications/config.json

Start from config/config.example.json. Its termPrograms object extends or overrides the built-in mappings; fallback changes the protocol used for an unknown terminal.

{
  "fallback": "osc99",
  "termPrograms": {
    "WezTerm": "osc777",
    "MyTerminal": "osc9"
  }
}

Valid protocol names are osc9, osc99, and osc777. Invalid, unreadable, or missing configuration safely uses the built-in defaults. The JSON schema is available at config/config.schema.json.

Permission And Herdr Lifecycle

A pi-ask or visible permission prompt marks Herdr as blocked. The state is cleared only after all active asks and prompts finish. For a direct permission ask, the local permissions:decision event resolves the prompt.

For a permission ask forwarded from a child session, the parent UI emits permissions:ui_prompt with a non-null forwarding context. After the parent successfully persists its response, pi-permission-system emits exactly one permissions:forwarded_decision with the same requestId; this extension uses that event to resolve the parent-side blocked state. The child later emits its own permissions:decision when its original gate consumes the response. The extension does not read private forwarding files, and session shutdown clears any remaining state.

Terminal control sequences are written only in Pi TUI mode. Herdr lifecycle state is still maintained in other modes.

Development

From the repository root:

pnpm --filter @xzzpig/pi-terminal-notifications run typecheck
pnpm --filter @xzzpig/pi-terminal-notifications test