agent

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserInput

func GetUserInput(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 LaunchEditor

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

func LoadHistory added in v0.0.3

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

func OnceValue

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

func PrintInput

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

PrintInput prints the user input

func PrintOutput

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

func ProcessBashScript

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

func RunAgent

func RunAgent(cfg *api.AppConfig) error

func RunSwarm

func RunSwarm(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

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

func StoreHistory added in v0.0.3

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.0.3

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

func NewFileMemStore added in v0.0.3

func NewFileMemStore(app *api.AppConfig) *FileMemStore

func (*FileMemStore) Load added in v0.0.3

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

func (*FileMemStore) Save added in v0.0.3

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

Jump to

Keyboard shortcuts

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