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

@tduyng/pi-ask

v0.0.5

Published

Ask the user up to 4 questions and wait for the answer. One tool, 202 tokens a request.

Readme

@tduyng/pi-ask

ask_user puts a decision in front of a person: up to four questions, each with options and an optional stated guess, answered in a dialog and returned as a tool result in the same turn.

A model that hits a decision only a person can settle does one of two things. It guesses and writes the guess in prose, where it reads like a decision. Or it stops and asks in prose, which costs a request and usually gets "go ahead" because the question arrived without the options.

The guess field

guess takes one line of reasoning, so the model has to commit before it asks. That field does two jobs:

  • The dialog highlights that answer, which makes the common case one keystroke.
  • With no UI attached, such as in a subagent, a script or pi -p, the tool returns a plain message: proceed on each guess and record it as an assumption. The turn never waits for a person who is not there. An RPC session does attach a UI, and a client that does not answer a select prompt leaves the first option chosen, so a /mode rpc run can come back with an answer no person gave.

Asking

One tool, up to four questions, each with question, optional options and optional guess.

ask_user({questions: [
  {question: "Which auth path?", options: ["session cookie", "bearer token"], guess: "session cookie, since the rest of the app uses it"}
]})

A question with options opens a select dialog with an extra "Other: type my answer" row. A question without options opens a text field.

The transcript keeps two ways of not answering apart: (cancelled) for a dialog closed unanswered, (skipped) for a typed answer left blank.

When to use it

When the answer changes the design and the model would need correcting anyway, or when a guess belongs on the record before code is written. Not for confirmation, and not for something the request already settled.

Install

pi install npm:@tduyng/pi-ask

Local checkout: pi install /path/to/dotfiles/pi/agent/extensions/pi-ask

The schema costs 202 tokens a request. There are no hooks, no prompt text and no session entries.

Limits

  • Four questions per call. A fifth means the model should ask a narrower one.
  • Options are single select. Two questions model a multiple choice.
  • The dialog blocks the turn until it is answered or cancelled.