@vanillagreen/pi-questions
v1.5.0
Published
Pi extension for structured multi-tab inline questions and bridge-driven replies.
Downloads
392
Maintainers
Readme
pi-questions

Structured inline questions for Pi. Multi-tab categories, built-in free-text fallback answers, and bridge-driven replies.
Highlights
questiontool for multiple-choice question tabs with a bottomSomething elsefree-text fallback row by default.- Editor-area UI by default; optional floating overlay.
- OpenCode-style question UI: tab hints and highlighted active rows.
- Compact answered tool output lists every category answer and expands inline to show each question with the selected choice marked.
- Wrapped option labels stay readable in narrow panes.
pi-session-bridgeintegration lets external clients list, answer, and reject pending questions.- When the bridge is loaded, question opened/answered/rejected lifecycle points publish structured
question.*activity broker events without adding chat messages. - Optional Answers as user message setting (off by default) mirrors each answered question into the conversation as a steer-delivered user message for observer extensions such as pi-automode.
pi-qolnotification hook fires before prompts open.
Install
Via npm:
pi install npm:@vanillagreen/pi-questionsVia vstack:
cargo install --git https://github.com/vanillagreencom/vstack.git vstack
vstack add vanillagreencom/vstack --pi-extension pi-questions --harness pi -yRestart Pi after installation.
Payload
{
"id": "que_example",
"header": "Choose next action",
"questions": [
{
"header": "Issue Missing",
"question": "How should I proceed?",
"options": [
{ "label": "Use current branch", "description": "Continue without a tracker issue." },
{ "label": "Stop here", "description": "Wait for operator guidance." }
],
"multiple": false,
"customLabel": "Something else"
}
]
}Result:
{ "requestId": "que_example", "answers": [["Stop here"]] }Cancelled:
{ "requestId": "que_example", "cancelled": true }Every tab includes a bottom free-text fallback row by default, labelled Something else unless customLabel overrides it. Agents no longer need to set allowCustom for a basic escape hatch; the legacy flag is still accepted for compatibility, and allowCustom: false does not disable the fallback. customPlaceholder customizes the input hint.
When the user types fallback text, the result uses the same answer shape as fixed options:
{ "requestId": "que_example", "answers": [["Use issue ABC-123 instead"]] }Do not include a final Confirm, Submit, Review, or Done question tab in the payload; the UI adds its own submit tab when needed.
Settings
Open /extensions:settings; settings appear under the Questions tab.
Project settings in .pi/settings.json apply only after Pi marks the workspace trusted; before trust, vstack Pi extensions read user/global settings only.
| Setting | What it does |
| --- | --- |
| Question UI mode | editor replaces the input area; overlay uses a floating popup. |
| Overlay popup width | Overlay mode only. |
| Overlay popup max height | Overlay mode only. Number or percentage string. |
| Visible option rows | Rows shown before scrolling. |
| Default question header | Fallback title when a request has no header. |
| Bridge replies enabled | Allow pi-session-bridge to answer/reject pending questions. |
| Answers as user message | Off by default. Mirror each answered question into the conversation as a steer-delivered user message. See Answers as user messages. |
Glyph style: each package exposes glyphStyle (unicode default, ascii for terminal-safe chrome). @vanillagreen/pi-tool-renderer.globalGlyphStyleOverride=ascii forces ASCII chrome across vstack Pi extensions while leaving tool/model/user content unchanged.
Answers as user messages
Off by default. Enable Answers as user message in /extensions:settings to have every answered question also delivered to the agent as one steer user message, with the question quoted and the chosen answers below:
> Which path?
Use current branchMulti-question requests emit one block per tab, prefixed with the tab header (> Path: Which path?); a tab with nothing selected shows (no selection); cancelled or dismissed questions send nothing. Enable this when observer extensions such as pi-automode need to read decisions from the conversation stream — they classify user messages but ignore tool output for security reasons. On Pi cores without sendUserMessage steer delivery, the setting silently falls back to tool output only.
Bridge control
Requires pi-session-bridge. From any shell:
pi-bridge questions
pi-bridge answer --request-id que_example --answers '[["Stop here"]]'
pi-bridge reject --request-id que_example