Documentation
¶
Overview ¶
Package ask lets a tool pose a multiple-choice question to the user and block until they pick. Mirrors the approval gate: the TUI surfaces an interactive picker, headless runs auto-resolve so nothing ever hangs.
Pattern: the ask_user tool builds a Question -> Asker.Ask surfaces it -> the user picks an option or types their own -> the chosen Answer flows back.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Answer ¶
Answer is the user's pick. Index points at the chosen Option, or -1 when the user typed custom text or dismissed. Text holds the chosen label or the custom string.
type Asker ¶
Asker surfaces a Question and blocks until the user answers. TUI shows a picker; headless returns the recommended option without prompting.
type Option ¶
Option is one selectable choice. Recommended marks the model's suggested pick so the UI can highlight it and headless runs can auto-select it.
type Question ¶
type Question struct {
Header string // short chip, e.g. "3D engine"
Prompt string // full question text
Options []Option
AllowCustom bool
}
Question is a single prompt with its choices. AllowCustom adds an escape hatch so the user can answer with free text instead of any listed option.