@anton-kochev/answer
v0.2.0
Published
Interactive Q&A extraction and answer submission for pi assistant responses.
Maintainers
Readme
answer
Interactive Q&A extraction for pi assistant responses.
answer adds an /answer command that turns questions from the last assistant response into an interactive answer form, then submits the compiled answers back to the agent.
It demonstrates the prompt-generator pattern with custom TUI:
/answergets the last assistant message.- A spinner is shown while questions are extracted as structured JSON.
- A custom TUI lets you navigate questions and write answers.
- When done, the compiled answers are submitted as a new user message.
Install
pi install npm:@anton-kochev/answerInside a pithos container this extension is preinstalled — /answer works out of the box with no install step.
For local development from this repository:
pi install ./answer
pi install ./answer -l # project-localTemporary test run:
pi -e ./answerUsage
After an assistant response that contains questions, run:
/answerKeys in the TUI:
Tab: go to next questionShift+Tab: go to previous questionUp/Down: focus and navigate options when a question has themSpace/Enter: select the focused option (singleormultiple, depending on the question)- Long free-text answers wrap across multiple lines
Shift+Enter/Alt+Enter: insert a newline in the free-text answerLeft/Right: move within the free-text answerEnter: save and go next when options are not focused; on the last question, submit if completeCtrl+S: submit when all questions are answered or have selected optionsEsc: cancel
Notes
This package imports pi runtime packages as peer dependencies:
@earendil-works/pi-ai@earendil-works/pi-coding-agent@earendil-works/pi-tuitypebox
Do not bundle those dependencies; pi provides them at runtime.
