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

v0.1.0

Published

Configurable external notifications for Pi agent lifecycle events

Readme

pi-notifications

面向 Pi coding agent 的可配置外部通知扩展。

English

功能

  • ask_user_question 或旧版 ask_user 工具等待输入前发送系统通知。
  • 每次 Pi agent 运行结束后发送完成通知,包含工具是否报错和已完成的 turn 数。
  • 使用 Node 的 argv API 执行 adapter,不经过 shell,通知文本不会被重新解析为命令语法。
  • 运行时探测配置的命令。命令缺失或首次执行失败时,在当前会话明确提示一次,随后停用本次运行的外部通知。
  • 通知失败不会阻塞 Pi 的 agent 生命周期或工具执行。
  • 所有运行时文案均通过 pi-extensions-i18n 国际化。

安装

pi install npm:pi-notifications

然后重新加载 Pi:

/reload

本包会自动安装共享的 i18n 依赖。默认 adapter 要求 terminal-notifier 位于 PATH 中。

配置

可选配置文件路径:

<Pi agent 目录>/extensions/pi-notifications/config.json

<Pi agent 目录> 是 Pi 当前配置的 agent 目录(通常为 ~/.pi/agent)。可以从 config.example.json 开始。配置字段如下:

  • enabled:设为 false 可关闭外部通知。
  • adapter.command:可执行文件名或路径。
  • adapter.args:argv 参数数组;每个参数中的 {title}{subtitle}{message} 会被替换。
  • timeoutMs:单次 adapter 执行的最长时间。

例如,直接使用另一个通知命令:

{
  "enabled": true,
  "adapter": {
    "command": "notify-send",
    "args": ["{title}", "{message}"]
  },
  "timeoutMs": 3000
}

配置在扩展加载时读取。使用 /config:notifications 打开常规 TUI 配置菜单,输入 reset 恢复默认值;保存后执行 /reload。配置文件不存在时使用默认的 terminal-notifier 配置;配置格式损坏时会在 Pi 中明确提示并使用默认配置。

默认 adapter

默认 argv 等价于:

terminal-notifier -title <title> -subtitle <subtitle> -message <message> -sound default -timeout 5

请使用适合当前操作系统的包管理器安装它,或配置其他通知可执行文件。本包不假定某个特定操作系统 daemon 存在。

国际化

运行时文案通过 pi-extensions-i18n 提供 zh-CNen-US。使用 /config:languagePI_EXTENSIONS_LOCALE 设置共享语言。

许可证

MIT