@josephyoung/pi-ask-user-question
Native ask_user_question extension for Pi Coding Agent
Package details
Install @josephyoung/pi-ask-user-question from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@josephyoung/pi-ask-user-question- Package
@josephyoung/pi-ask-user-question- Version
1.0.1- Published
- Sep 3, 2026
- Downloads
- 116/mo · 17/wk
- Author
- yangkyo821
- License
- MIT
- Types
- extension
- Size
- 197.4 KB
- Dependencies
- 1 dependency · 3 peers
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
pi-ask-user-question
Native ask_user_question extension for Pi Coding Agent. Simple single questions use Pi's built-in dialogs; grouped forms and advanced fields use one atomic ctx.ui.custom() form.
Install
pi install npm:@josephyoung/pi-ask-user-question
To install directly from GitHub instead, use pi install git:github.com/josephyoung/pi-ask-user-question.
The package supports @earendil-works/pi-coding-agent versions >=0.82.1 <0.83.0.
Tool behavior
- Simple text and static single-choice questions use Pi primitives; grouped and advanced questions use the native TUI form.
- Multiple choice, date, tree selection, remote options, and every grouped form route to
ctx.ui.custom(). - Grouped answers are submitted atomically and return a durable
formId. confirm:trueconfirms one or more Submitted Forms. It supports a complete review card, return-to-modify revisions, restart recovery, and a visible continuation into a new Agent turn. Ordinary yes/no decisions use a normal choice question.- Text fields support isolated Field Assist generation and polishing. The child session uses the current Pi model with reusable persisted provider authentication, without loading tools, extensions, skills, prompts, themes, or project context.
- Namespaced, versioned custom field kinds can be added through the public Question capability registry; capability state is serialized into Submitted Form snapshots and restores read-only when unavailable.
- Remote sources support GET/POST, params, search, pagination, mapping, relative endpoints, user-owned authentication, and field-local retry.
Remote credentials stay outside model-visible tool calls. Put origin/path rules in
$PI_CODING_AGENT_DIR/ask-user-question.auth.json; each configured header or
cookie value is the name of an environment variable read at request time.
{
"version": 1,
"rules": [{
"origin": "https://oa.example.com",
"pathPrefix": "/api/",
"headers": { "Authorization": "OA_AUTHORIZATION" },
"cookies": { "session": "OA_SESSION" }
}]
}
- Cancellation returns
{ "status": "cancelled" }; Agent abort is a structured terminal lifecycle error.
Relative remote endpoints require dataSourceBaseUrl in the tool call. This is request context, not Pi or project configuration.
Verify
npm run typecheck
npm run test:unit
npm run test:acceptance
npm test
The acceptance suite creates temporary project and Pi-state directories, installs a snapshot of this package through a real Git URL, launches the system pi executable in a PTY, and removes all temporary resources afterward. See E2E test requirements for the required automated and manual scenarios, including the remote pagination mock API.