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

@tian.zuo/pi-ask-user

v0.1.0

Published

Ask the user one or more fully described multiple-choice questions from the pi coding agent.

Readme

@tian.zuo/pi-ask-user

Let the model ask you a multiple-choice question from pi.

pi install npm:@tian.zuo/pi-ask-user

Registers an ask_user tool. The model can supply 1–5 questions with 2–5 options each. Questions and option descriptions wrap across as many lines as needed instead of being truncated. Every question accepts one selection and also gets a free-form Other option. A model-supplied Other-style option is refused rather than shown twice: the duplicate would otherwise reach the user with nothing reporting it back.

Interactive controls:

  • / — switch questions while preserving answers
  • / — move between options
  • Space — select an option
  • Enter — move to the next question or submit the completed form
  • Esc — go back from the custom-answer editor or dismiss the form

The public schema uses questions[]. Calls saved by versions through 0.1.2 with top-level question and options are upgraded automatically when resumed.

While it waits for your answer, the tool reports the input requirement on pi's shared event bus (pi.events). This is pi's in-process mechanism for tool ↔ integration communication: an integration subscribes with pi.events.on(...), aggregates active requests into its own agent state, and bridges that state to its client.

The canonical event is agent:input_required. Its versioned payload has a stable id so consumers can handle duplicate and concurrent requests safely:

{
  version: 1,
  id: string,        // ask_user tool-call ID
  source: "ask_user",
  active: boolean,   // true before waiting, false in finally
  label: string      // normalized question, always present
}

The same payload is temporarily also emitted as herdr:blocked for compatibility with version 6 of Herdr's shipped pi integration. New consumers should subscribe to agent:input_required; the producer reports why it is waiting, while clients such as Herdr own final status precedence and notification behavior.

Pi core has no native "blocked" status (only working while a tool call is in flight vs idle), and can't distinguish an autonomous long-running tool from one waiting on a human. Emitting is best-effort, balanced active→inactive via try/finally, and a harmless no-op when nothing listens. No event is emitted in non-UI modes.

See the collection repository for full documentation.