userinput

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package userinput provides types for the item/tool/requestUserInput protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	Answers []string
}

Answer contains the user's response(s) to a question.

type Callback

type Callback func(ctx context.Context, req *Request) (*Response, error)

Callback is invoked when the CLI sends an item/tool/requestUserInput request.

type Question

type Question struct {
	ID       string
	Header   string
	Question string
	IsOther  bool
	IsSecret bool
	Options  []QuestionOption // nil means free text input
}

Question represents a single question posed to the user.

type QuestionOption

type QuestionOption struct {
	Label       string
	Description string
}

QuestionOption represents a selectable choice within a question.

type Request

type Request struct {
	ItemID    string
	ThreadID  string
	TurnID    string
	Questions []Question
}

Request represents the full user input request from the CLI.

type Response

type Response struct {
	Answers map[string]*Answer
}

Response contains the answers to all questions keyed by question ID.

Jump to

Keyboard shortcuts

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