askuser

package
v0.64.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 9 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const HorizontalMargin = 4

Variables

This section is empty.

Functions

func NewInput added in v0.57.1

func NewInput() textinput.Model

Types

type Answer added in v0.57.1

type Answer struct {
	Question string
	Answer   string
}

type Card added in v0.57.1

type Card struct {
	Active bool
	// contains filtered or unexported fields
}

func (*Card) Clone added in v0.57.1

func (c *Card) Clone() *Card

func (*Card) IsActive added in v0.57.1

func (c *Card) IsActive() bool

func (*Card) Render added in v0.57.1

func (c *Card) Render(width int) string

type Request

type Request struct {
	Context       context.Context
	Questionnaire agentcore.AskUserRequest
	ResponseChan  chan agentcore.AskUserResult
}

type Requester

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

func NewRequester

func NewRequester() *Requester

func (*Requester) GetRequestChan

func (r *Requester) GetRequestChan() <-chan *Request

func (*Requester) IsPending

func (r *Requester) IsPending(req *Request) bool

func (*Requester) RequestUser

func (r *Requester) RequestUser(ctx context.Context, questionnaire agentcore.AskUserRequest) (agentcore.AskUserResult, error)

func (*Requester) Respond

func (r *Requester) Respond(req *Request, result agentcore.AskUserResult)

type State added in v0.57.1

type State struct {
	Requester *Requester
	Request   *Request
	Index     int
	Selected  int
	Answers   []string
	Input     textinput.Model
	Editing   bool
	Resolved  []Answer
	Cancelled bool
	Completed bool
}

func NewResolvedState added in v0.57.1

func NewResolvedState(request agentcore.AskUserRequest, result agentcore.AskUserResult) *State

func NewState added in v0.57.1

func NewState(requester *Requester) State

func (State) Active added in v0.57.1

func (s State) Active() bool

func (*State) Answer added in v0.57.1

func (s *State) Answer(value string) bool

func (*State) Begin added in v0.57.1

func (s *State) Begin(request *Request)

func (*State) Card added in v0.57.1

func (s *State) Card() *Card

func (*State) Clear added in v0.57.1

func (s *State) Clear()

func (State) Clone added in v0.57.1

func (s State) Clone() *State

func (*State) Move added in v0.57.1

func (s *State) Move(delta int)

func (State) Render added in v0.57.1

func (s State) Render(width int) string

func (*State) Resolve added in v0.57.1

func (s *State) Resolve(requester *Requester, cancelled bool)

func (*State) SyncInputFocus added in v0.57.1

func (s *State) SyncInputFocus()

func (State) Visible added in v0.57.1

func (s State) Visible() bool

Jump to

Keyboard shortcuts

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