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

@gamaraan/desktop-notify

v0.1.0

Published

Cross-platform terminal and desktop notifications for pi coding-agent.

Readme

@gamaraan/desktop-notify

A self-contained pi extension that surfaces completion, error, and model-requested notifications through terminal protocols and best-effort native desktop toasts.

Features

  • Kitty OSC 99, OSC 9, and BEL terminal output.
  • tmux passthrough, Zellij BEL fallback, and cmux surface routing.
  • Linux notify-sendgdbus, macOS /usr/bin/osascript, native Windows powershell.exe WinRT toast, and WSL Windows-host routing with Linux fallback.
  • Completion/error delivery at agent_settled, so retries and queued follow-ups produce one final notification.
  • Side-effect-free programmatic client at @gamaraan/desktop-notify/client.
  • Optional LLM-callable notify tool, disabled by default.
  • No helper installation, shell lookup, raw stdin listener, or terminal probe.

Desktop delivery is deliberately best-effort. In-band output is emitted first; missing binaries, locked-down desktops, unavailable session buses, and child launch failures are silent.

Install

pi install npm:@gamaraan/desktop-notify

From a checkout, add the package or src/index.ts to the pi extension list. Restart pi after changing extension configuration.

Configuration

Flags take precedence over environment variables, which take precedence over built-in defaults:

| Flag | Environment | Default | Meaning | | --- | --- | --- | --- | | --notify-completion on\|off | PI_NOTIFY_COMPLETION | on | Final successful settlement | | --notify-error on\|off | PI_NOTIFY_ERROR | on | Final error settlement | | --notify-tool on\|off | PI_NOTIFY_TOOL | off | Register the model tool |

Global and desktop controls:

| Variable | Effect | | --- | --- | | PI_NOTIFICATIONS=off\|0\|false | Suppress all terminal and desktop output | | PI_NO_DESKTOP_NOTIFY=1 | Keep terminal output, suppress desktop fan-out | | PI_NOTIFY_PLATFORM=auto\|linux\|macos\|windows\|wsl\|off | Select or disable desktop strategy | | PI_NOTIFY_OSC99_RICH=1 | Opt into structured Kitty OSC 99 metadata |

Every notification requires a TTY. Print, JSON, and RPC contexts are silent. The extension never automatically produces a waiting-for-input notification; ask-tool owns that future EventBus request.

EventBus integration

Sibling extensions remain standalone and do not import this package. When both are loaded, they may broadcast a string or documented object:

pi.events.emit("desktop-notify:request", {
  title: "Ask",
  body: "Waiting for input",
  type: "ask",
});

Without a listener this is a no-op. Keep the existing ctx.ui.notify behavior; EventBus delivery is additive and best-effort. Do not use a dynamic-import recipe or make desktop-notify a required dependency.

Client API

import { notify, isAvailable } from "@gamaraan/desktop-notify/client";

if (isAvailable()) notify({ title: "Build", body: "Complete" });

The client imports no pi registration APIs. It validates plain objects, bounds fields, and sanitizes terminal-bound text before dispatch.

Native delivery limitations

  • Linux needs a session D-Bus address or $XDG_RUNTIME_DIR/bus and either notify-send or gdbus on PATH.
  • macOS uses only the built-in /usr/bin/osascript.
  • Windows uses one static, base64-fed PowerShell WinRT command. Delivery can be unavailable on locked-down, Server Core, or hosts without an interactive notification identity; no third-party PowerShell module is installed.
  • WSL prefers a resolved powershell.exe host path and otherwise tries Linux D-Bus. A mocked CI test proves routing, not native toast delivery.

Before a release, run the manual smoke checklist in AGENTS.md on available Linux, macOS, Windows, and WSL hosts. Record OS, terminal, multiplexer, and result in release notes.

Development

bun install --frozen-lockfile
bun run typecheck
bun test
bun run verify:package

Tests use an injected runtime and never spawn real notifiers. See AGENTS.md for architecture, guardrails, parity notes, CI, and future improvements. The detailed implementation blueprint is IMPLEMENTATION_PLAN.md.

License

MIT. See LICENSE. Notification behavior is ported from Oh My Pi, which is itself a pi fork; their copyright notices are retained.