Documentation
¶
Overview ¶
Package questions is Orb's shared human-question capability and native tool.
Index ¶
Constants ¶
View Source
const Kind = "questions"
View Source
const ToolName = "ask_user_question"
Variables ¶
This section is empty.
Functions ¶
func Extension ¶
func Extension(draw Draw) extensions.Factory
Types ¶
type Draw ¶ added in v0.19.4
type Draw struct {
Panel Panel
Text func(text string, oneLine bool) extensions.Component
}
Draw is how a terminal draws questions: the panel it asks them in, and their lines in the transcript. A host without a terminal leaves it zero: its controller (an app, a Bridge peer) answers them from the presentation.
type Panel ¶
type Panel func(request Request, theme extensions.Theme, height func() int, invalidate func(), done func(Result)) extensions.Component
Panel draws questions in a terminal and calls done with their answers.
type Request ¶
type Request struct {
Questions []Question `json:"questions"`
}
func (Request) ValidateReply ¶
type Result ¶
type Result struct {
Answers []Answer `json:"answers,omitempty"`
Cancelled bool `json:"cancelled,omitempty"`
}
func Ask ¶
func Ask(ctx context.Context, request Request, input extensions.InputHandler, panel Panel) (Result, error)
Ask uses the runtime's execution-bound input seam; it owns no queue or history. A terminal asks in panel, when one is given.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package panel is how a terminal asks the questions plugin's questions: one tab per question, choices and a line of your own, then a review, in the local dialog and the remote conversation view alike.
|
Package panel is how a terminal asks the questions plugin's questions: one tab per question, choices and a line of your own, then a review, in the local dialog and the remote conversation view alike. |
Click to show internal directories.
Click to hide internal directories.