@tduyng/pi-ask
Ask the user up to 4 questions and wait for the answer. One tool, 202 tokens a request.
Package details
Install @tduyng/pi-ask from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@tduyng/pi-ask- Package
@tduyng/pi-ask- Version
0.0.4- Published
- Nov 5, 2026
- Downloads
- 482/mo · 482/wk
- Author
- tienduy-nguyen
- License
- Apache-2.0
- Types
- extension
- Size
- 15.6 KB
- Dependencies
- 1 dependency · 1 peer
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
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.
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.