Help us shape the future of Go! Take the 2026 Go Developer Survey

questions

package
v0.17.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: MIT Imports: 12 Imported by: 0

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() extensions.Factory

Types

type Answer

type Answer struct {
	ID       string   `json:"id"`
	Selected []string `json:"selected"`
	Custom   string   `json:"custom,omitempty"`
}

type Option

type Option struct {
	Label       string `json:"label"`
	Description string `json:"description,omitempty"`
	Preview     string `json:"preview,omitempty"`
}

type Panel

type Panel struct {
	// contains filtered or unexported fields
}

Panel is shared by the local dialog and the remote conversation view.

func NewPanel

func NewPanel(request Request, theme extensions.Theme, height func() int, invalidate func(), done func(Result)) *Panel

func (*Panel) HandleInput

func (p *Panel) HandleInput(key tui.KeyEvent)

func (*Panel) HandleMouse

func (p *Panel) HandleMouse(event tui.MouseEvent) bool

func (*Panel) Render

func (p *Panel) Render(width int) []string

func (*Panel) SetFocused

func (p *Panel) SetFocused(f bool)

func (*Panel) WantsMouseMotion

func (p *Panel) WantsMouseMotion() bool

type Question

type Question struct {
	ID          string   `json:"id"`
	Question    string   `json:"question"`
	Header      string   `json:"header,omitempty"`
	Options     []Option `json:"options,omitempty"`
	MultiSelect bool     `json:"multi_select,omitempty"`
}

type Request

type Request struct {
	Questions []Question `json:"questions"`
}

func (Request) Summary

func (request Request) Summary() string

func (Request) Validate

func (r Request) Validate() error

func (Request) ValidateReply

func (r Request) ValidateReply(raw string) error

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) (Result, error)

Ask uses the runtime's execution-bound input seam; it owns no queue or history.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL