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

@herbertgao/pi-bark

v0.2.0

Published

Send Bark notifications when Pi finishes or needs user input.

Readme

@herbertgao/pi-bark

Bark notifications for user-facing Pi sessions. It sends a notification when Pi fully settles and when Pi blocks on a user-facing dialog — an approval, a select, an input prompt, a custom panel, or an @juicesharp/rpiv-ask-user-question questionnaire. Requests follow Bark's official POST form API.

Install

pi install npm:@herbertgao/pi-bark

The extension is also included in @herbertgao/pi-extensions.

Configure

Create $PI_CODING_AGENT_DIR/bark.json (normally ~/.pi/agent/bark.json):

{
  "endpoint": "https://api.day.app/your-device-key",
  "machine": "MacBook Pro M1 Max",
  "locale": "zh-CN",
  "events": {
    "agentSettled": true,
    "needsInput": true
  },
  "params": {
    "group": "pi",
    "icon": "https://raw.githubusercontent.com/HerbertGao/pi-extensions/master/packages/pi-bark/assets/pi-icon.png"
  },
  "title": {
    "source": "session",
    "maxLength": 40
  },
  "minDurationMs": 30000,
  "timeoutMs": 4000
}

endpoint is required. locale accepts auto (default), zh-CN, zh-TW, or en; unsupported languages fall back to English. params accepts additional Bark POST parameters such as group, sound, icon, and level; dynamic title and body values always take precedence. Set "enabled": false to disable all notifications without removing the package. events.needsInput covers every blocking dialog; events.askUserQuestion is the older name and is still honored as an alias.

Session titles

The default title.source is "fixed", which keeps Pi's localized copy (✅ Pi 跑完了 / 🟡 Pi 等你回答) as the notification title. Set it to "session" to title the notification with the session instead — Pi's session name when one is set, otherwise the first user message, which is the label hosts such as Paseo already show for the session:

{ "title": { "source": "session", "maxLength": 40 } }

maxLength defaults to 40, counts Unicode code points without splitting emoji surrogate pairs, and includes the ellipsis. Non-finite values or values below 1 fall back to the default. With "session", the event state moves to the first line of the body:

title:  Please reply with exactly the single wo…
body:   ✅ 已完成 · 用时 2m14s
        💻 MacBook Pro M1 Max
        📁 /Users/herbertgao/VSCodeProject/pi

The title is resolved when the notification is sent, so a session that is renamed or that has only just received its first message still gets the right one.

Short runs

minDurationMs defaults to 0 (always notify). Raise it to skip the settle notification when the run finished faster, so one-line replies stop producing notification noise:

{ "minDurationMs": 30000 }

minDurationMs never suppresses needs-input notifications. Input notifications wait 400ms so an unsupported, cancelled, or quickly answered UI call does not send a stale alert. Pending alerts are cancelled when the prompt, run, or session ends. Questionnaire fallback events use a 1.5s de-duplication window because they have no shared dialog ID; separate fallback-only prompts inside that window may be merged. Native dialogs are tracked independently.

Completion notifications await the Bark request before Pi finishes settling, including during session switching or exit. This can delay those operations up to timeoutMs (default 4 seconds). Errors and timeouts are ignored; delivery is best-effort, with no persistent queue or retries.

The notification body uses 💻 for the configured machine name and 📁 for Pi's full working directory. Questionnaire text is intentionally not sent because it may contain sensitive context. Only sessions with a user-facing UI notify, so nested pi-subagents sessions do not create duplicate pushes.

The bundled assets/pi-icon.png is a 512×512 rasterization of Pi's official square badge from the Pi Press Kit, suitable for Bark's iOS 15+ icon parameter.

Keep bark.json private because the endpoint normally contains the Bark device key. Restart Pi or run /reload after changing it.

License

MIT