agent

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserInput

func GetUserInput(ctx context.Context, cfg *api.AppConfig) (*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 InitVars added in v0.3.0

func InitVars(app *api.AppConfig) (*api.Vars, error)

func LaunchEditor

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

func LoadHistory added in v0.3.0

func LoadHistory(base string, maxHistory, maxSpan int) ([]*api.Message, error)

func NewFileMemStore added in v0.3.0

func NewFileMemStore(app *api.AppConfig) api.MemStore

func OnceValue

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

func PlayAudio

func PlayAudio(data string) error

func PrintInput

func PrintInput(ctx context.Context, cfg *api.AppConfig, input *api.UserInput)

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 RunAgent added in v0.3.0

func RunAgent(ctx context.Context, app *api.AppConfig) error

func RunSwarm

func RunSwarm(ctx context.Context, cfg *api.AppConfig, input *api.UserInput) error

func SaveOutput

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

func SimpleEditor

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

func SpeakOutput added in v0.3.0

func SpeakOutput(ctx context.Context, cfg *api.AppConfig, output *api.Output)

func StoreHistory added in v0.3.0

func StoreHistory(base string, messages []*api.Message) 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)

type FileMemStore added in v0.3.0

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

func (*FileMemStore) Get added in v0.7.0

func (r *FileMemStore) Get(id string) (*api.Message, error)

func (*FileMemStore) Load added in v0.3.0

func (r *FileMemStore) Load(opt *api.MemOption) ([]*api.Message, error)

func (*FileMemStore) Save added in v0.3.0

func (r *FileMemStore) Save(messages []*api.Message) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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