ui

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateTyping modelState = iota
	StateAsking
	StateExecuting
	StateWaitingForConfirmation
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Agent

type Agent interface {
	Iterate(context.Context, string) (agent.AgentResponse, error)
	Reset()
	LogUsage() string
}

Agent represents the interface for interacting with an AI agent.

type Config

type Config struct {
	Agent    Agent
	Executer Executer
}

Config holds the configuration for initializing the Model.

type Executer

type Executer interface {
	Run(context.Context, string) executer.ExecuterResponse
	Validate(string) error
}

Executer represents the interface for executing commands.

type Model

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

Model represents the application state.

func InitialModel

func InitialModel(cfg Config) Model

InitialModel creates and returns a new instance of Model with default values.

func (Model) Init

func (m Model) Init() tea.Cmd

Init initializes the Model.

func (Model) Update

func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update handles all the application logic and state transitions.

func (Model) View

func (m Model) View() string

View renders the current state of the application.

Jump to

Keyboard shortcuts

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