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-afk-mode

v0.1.0

Published

Pi extension: /afk keeps the agent working until every remaining item is blocked on a human decision. Pauses while async pi-subagents run.

Downloads

172

Readme

pi-afk-mode

A Pi extension for walking away. /afk keeps the agent working until every remaining item is genuinely blocked on a decision only you can make.

pi install npm:pi-afk-mode

How it works

  • /afk (or /afk on|off) toggles AFK mode. Switching it on while the agent is idle starts it working immediately.
  • Every time the agent finishes a turn and settles, it gets a nudge: finish open tasks, verify with tests/builds, review the diff, tidy up, pick up the next unblocked item.
  • The agent is only left alone after it calls the afk_blocked tool with a concrete list of { work, decision } pairs. Nudging pauses; the status bar shows afk: blocked on you.
  • Typing anything resets that: you're back, or you just answered. Nudging resumes after your turn.
  • The mode is stored in the session, so /resume picks it up. /new starts clean.

Guardrails

  • Nudge cap: 25 nudges per /afk on (status bar shows afk 7/25). Toggle /afk to reset. Costs are bounded even if the agent never declares itself blocked.
  • Abort / error: no nudge after an aborted turn (you pressed Escape, you're at the keyboard) or an errored turn (don't loop on failures).
  • Async subagents: if pi-subagents has queued or running async children for this session, the agent is not nudged. Their completion wakes the session; the next settle nudges as usual. Detected by reading the same status.json files pi-subagents uses for its own outstanding-work check, so no dependency and no configuration. Without pi-subagents installed the check is a no-op.

The nudge

The user is AFK. Continue productive work autonomously: finish open tasks, verify with tests/builds, review your own diff, tidy up, then pick up the next unblocked item.

Only when EVERY remaining item genuinely requires a human decision, call the afk_blocked tool listing each blocker and the exact decision needed. Do not stop or ask questions otherwise — no one is reading.

It is sent as a visible custom message (customType: "afk-nudge"), so it shows in the transcript and the model can see it is not you.

Known limits

  • A crashed subagent that leaves a stale running status behind suppresses nudges until pi-subagents reconciles it.
  • If the model stops without calling afk_blocked and without making progress, you pay for up to 25 idle turns. Lower MAX_NUDGES in afk.ts if that bothers you.

Development

npm install
npm run typecheck
npm test          # node --test, no framework
pi -e ./afk.ts    # try it in a session

MIT