agent

package
v0.60.1 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// read from clipboard
	ClipinRedirect = "{"

	// read from clipboard and wait, allowing multiple copy
	// until Ctrl-D is entered
	ClipinRedirect2 = "{{"

	// write to clipboard, overwriting its content
	ClipoutRedirect = "}"

	// append to clipboard
	ClipoutRedirect2 = "}}"
)

clipboard redirection

View Source
const DefaultEditor = "vi"
View Source
const StdinRedirect = "-"

Variables

This section is empty.

Functions

func Cat

func Cat(a, b, sep string) string

func GetUserInput

func GetUserInput(cfg *api.InputConfig, msg string) (*api.UserInput, error)

GetUserInput collects user input for the agent. It prefers a direct message from the command line flag (--message), otherwise, it determines the input source (stdin, clipboard, editor) and collects input accordingly. It also attaches any provided files or template file if provided.

func LaunchEditor

func LaunchEditor(editor string, content string) (string, error)

func OnceValue

func OnceValue[T any](f func() T) func() T

func ParseSpecialChars

func ParseSpecialChars(args []string) *api.InputConfig

parse special char sequence for stdin/clipboard they can: + be at the end of the args + be in any order + be multiple instances

func PlayAudio

func PlayAudio(data string) error

func PrintInput

func PrintInput(ctx context.Context, input string)

PrintInput prints the user input

func PrintOutput

func PrintOutput(ctx context.Context, format string, output *api.Output) error

func ProcessBashScript

func ProcessBashScript(ctx context.Context, cfg *api.AppConfig, script string) error

func ReadStdin

func ReadStdin() (string, error)

func Run

func Run(argv []string) error

func RunSwarm

func RunSwarm(cfg *api.App, user *api.User, argv []string) error

func SaveOutput

func SaveOutput(filename string, message *api.Output) error

func SetupAppConfig added in v0.12.1

func SetupAppConfig(app *api.App) error

func SimpleEditor

func SimpleEditor(title, content string) (string, bool, error)

func Validate added in v0.12.1

func Validate(app *api.AppConfig) error

Types

type Editor

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

func NewEditor

func NewEditor(editor string) *Editor

func (*Editor) Launch

func (e *Editor) Launch(content string) (string, error)

Jump to

Keyboard shortcuts

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