userinput

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: GPL-3.0 Imports: 1 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

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