Documentation
¶
Index ¶
- Constants
- func BuildGoalFromContextPrompt(tail []ai.Message) string
- func EstimateTokens(msgs []ai.Message) int
- func GoalFromContextMessages(msgs []ai.Message, n int) ([]ai.Message, error)
- type Agent
- func (a *Agent) AddSubUsage(model string, u ai.Usage)
- func (a *Agent) AddUsage(u ai.Usage)
- func (a *Agent) AllTools() []tools.Tool
- func (a *Agent) AppendUser(content string)
- func (a *Agent) Experimental() []string
- func (a *Agent) FollowupTask(ctx context.Context, id, text string, ev Events) (string, error)
- func (a *Agent) LaunchBackground(t *BackgroundTask, worktreePath string)
- func (a *Agent) LoadTodosJSON(s string)
- func (a *Agent) ManualCompact(ctx context.Context, ev Events) error
- func (a *Agent) MessagesSnapshot() []ai.Message
- func (a *Agent) RegisterBackground(description, prompt string, o SubModel) *BackgroundTask
- func (a *Agent) ResetUsage()
- func (a *Agent) RestoreTask(t BackgroundTask)
- func (a *Agent) SessionIDValue() string
- func (a *Agent) SetCacheKey(key string)
- func (a *Agent) SetMCPTools(ts []tools.Tool)
- func (a *Agent) SetOnTodos(fn func(items []Todo))
- func (a *Agent) SetSessionID(id string)
- func (a *Agent) SetSubUsage(m map[string]ai.Usage)
- func (a *Agent) SetUsage(u ai.Usage)
- func (a *Agent) StartBackground(description, prompt string, o SubModel) *BackgroundTask
- func (a *Agent) StartWait(spec WaitTaskSpec) (*waitTask, error)
- func (a *Agent) Steer(text string)
- func (a *Agent) SteerImages(text string, parts []ai.ContentPart)
- func (a *Agent) SteerTask(id, text string) error
- func (a *Agent) SubUsage() map[string]ai.Usage
- func (a *Agent) Tasks() *taskRegistry
- func (a *Agent) TodosJSON() string
- func (a *Agent) TotalUsage() ai.Usage
- func (a *Agent) Turn(ctx context.Context, input string, ev Events) (string, error)
- func (a *Agent) TurnAuthored(ctx context.Context, input string, ev Events) (string, error)
- func (a *Agent) TurnParts(ctx context.Context, input string, parts []ai.ContentPart, ev Events) (string, error)
- func (a *Agent) TurnRunning() bool
- func (a *Agent) TurnWithImages(ctx context.Context, input string, parts []ai.ContentPart, ev Events) (string, error)
- func (a *Agent) Usage() ai.Usage
- func (a *Agent) WaitingOnSubagents() bool
- func (a *Agent) Waits() *waitRegistry
- func (a *Agent) Workflows() *workflow.Manager
- type BackgroundTask
- type CompactInfo
- type Events
- type JournaledEvent
- type Option
- type SubModel
- type TaskStatus
- type Todo
- type WaitStatus
- type WaitTaskSpec
Constants ¶
View Source
const (
FeatureWorkflows = "workflows"
)
View Source
const GoalFromContextDefaultWindow = 8
Variables ¶
This section is empty.
Functions ¶
func EstimateTokens ¶
Types ¶
type Agent ¶
type Agent struct {
Client ai.Client
Model string
ModelName string
Provider string
MaxTokens int
Effort string
Temperature *float64
TopP *float64
Tools []tools.Tool
Messages []ai.Message
ContextLimit int
CompactClient ai.Client
CompactModel string
CompactThreshold float64
TaskDefault SubModel
ResolveModel func(model, provider string) (SubModel, error)
MaxTurns int
WorktreeSubagents bool
Todos []Todo
BrowserDisabled bool
ComputerDisabled bool
OnOrphanedSteer func(text string)
// contains filtered or unexported fields
}
func (*Agent) AppendUser ¶
func (*Agent) Experimental ¶
func (*Agent) FollowupTask ¶
func (*Agent) LaunchBackground ¶
func (a *Agent) LaunchBackground(t *BackgroundTask, worktreePath string)
func (*Agent) LoadTodosJSON ¶
func (*Agent) MessagesSnapshot ¶
func (*Agent) RegisterBackground ¶
func (a *Agent) RegisterBackground(description, prompt string, o SubModel) *BackgroundTask
func (*Agent) ResetUsage ¶
func (a *Agent) ResetUsage()
func (*Agent) RestoreTask ¶
func (a *Agent) RestoreTask(t BackgroundTask)
func (*Agent) SessionIDValue ¶
func (*Agent) SetCacheKey ¶
func (*Agent) SetMCPTools ¶
func (*Agent) SetOnTodos ¶
func (*Agent) SetSessionID ¶
func (*Agent) StartBackground ¶
func (a *Agent) StartBackground(description, prompt string, o SubModel) *BackgroundTask
func (*Agent) StartWait ¶
func (a *Agent) StartWait(spec WaitTaskSpec) (*waitTask, error)
func (*Agent) SteerImages ¶
func (a *Agent) SteerImages(text string, parts []ai.ContentPart)
func (*Agent) TotalUsage ¶
func (*Agent) TurnAuthored ¶
func (*Agent) TurnRunning ¶
func (*Agent) TurnWithImages ¶
func (*Agent) WaitingOnSubagents ¶
type BackgroundTask ¶
type BackgroundTask struct {
ID string
Description string
Prompt string
Status TaskStatus
Report string
StartedAt time.Time
EndedAt time.Time
Restored bool
Done chan struct{}
SubMessages []ai.Message
SubUsage ai.Usage
SubSubUsage map[string]ai.Usage
SubModel string
// contains filtered or unexported fields
}
type CompactInfo ¶
type Events ¶
type Events struct {
OnText func(delta string)
OnThink func(delta string)
OnToolStart func(id, name, args string)
OnToolEnd func(id, name, result string)
OnToolCall func(id, name, args string)
OnToolOutput func(id, outputSoFar string)
OnSteer func(text string)
OnCompact func(took, kept int)
OnCompacted func(summary string, cutoff int, info CompactInfo)
OnCompactStart func(took, estTokens int)
OnUsage func(u ai.Usage)
OnRetry func(ev ai.RetryEvent)
OnDecay func(n int)
}
type JournaledEvent ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskRunning TaskStatus = "running" TaskDone TaskStatus = "done" TaskError TaskStatus = "error" TaskCancelled TaskStatus = "cancelled" )
type WaitStatus ¶
type WaitStatus string
const ( WaitRunning WaitStatus = "running" WaitMet WaitStatus = "condition met" WaitTimeout WaitStatus = "timed out" WaitFailed WaitStatus = "command failing" WaitKilled WaitStatus = "cancelled" )
Click to show internal directories.
Click to hide internal directories.