Documentation
¶
Index ¶
- Constants
- func NewPaneInspector() ...
- func ToolNames() []string
- type AgentSubResult
- type AgentTaskSpec
- type AgentTool
- func (t *AgentTool) Definition() sdk.ChatCompletionTool
- func (t *AgentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *AgentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *AgentTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *AgentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *AgentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *AgentTool) IsEnabled() bool
- func (t *AgentTool) Manifest() agentdomain.ToolManifest
- func (t *AgentTool) ShouldAlwaysExpand() bool
- func (t *AgentTool) ShouldCollapseArg(string) bool
- func (t *AgentTool) Validate(args map[string]any) error
- type AgentToolResult
- type ApproveSubagentTool
- func (t *ApproveSubagentTool) Definition() sdk.ChatCompletionTool
- func (t *ApproveSubagentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ApproveSubagentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ApproveSubagentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ApproveSubagentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ApproveSubagentTool) IsEnabled() bool
- func (t *ApproveSubagentTool) Manifest() agentdomain.ToolManifest
- func (t *ApproveSubagentTool) ShouldAlwaysExpand() bool
- func (t *ApproveSubagentTool) ShouldCollapseArg(key string) bool
- func (t *ApproveSubagentTool) Validate(args map[string]any) error
- type AskUserQuestionTool
- func (t *AskUserQuestionTool) Definition() sdk.ChatCompletionTool
- func (t *AskUserQuestionTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *AskUserQuestionTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *AskUserQuestionTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *AskUserQuestionTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *AskUserQuestionTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *AskUserQuestionTool) IsEnabled() bool
- func (t *AskUserQuestionTool) Manifest() agentdomain.ToolManifest
- func (t *AskUserQuestionTool) ShouldAlwaysExpand() bool
- func (t *AskUserQuestionTool) ShouldCollapseArg(key string) bool
- func (t *AskUserQuestionTool) Validate(args map[string]any) error
- type BaseFormatter
- func (f BaseFormatter) FormatAsJSON(data any) string
- func (f BaseFormatter) FormatDuration(result *agentdomain.ToolExecutionResult) string
- func (f BaseFormatter) FormatExpanded(result *agentdomain.ToolExecutionResult, dataContent string) string
- func (f BaseFormatter) FormatStatusIcon(success bool) string
- func (f BaseFormatter) FormatToolCall(args map[string]any, expanded bool) string
- func (f BaseFormatter) GetDomainFromURL(url string) string
- func (f BaseFormatter) GetFileName(path string) string
- func (f BaseFormatter) ShouldCollapseArg(key string) bool
- func (f BaseFormatter) TruncateText(text string, maxLength int) string
- type BashOutputTool
- func (t *BashOutputTool) Definition() sdk.ChatCompletionTool
- func (t *BashOutputTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *BashOutputTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *BashOutputTool) IsEnabled() bool
- func (t *BashOutputTool) Manifest() agentdomain.ToolManifest
- func (t *BashOutputTool) ShouldAlwaysExpand() bool
- func (t *BashOutputTool) ShouldCollapseArg(key string) bool
- func (t *BashOutputTool) Validate(args map[string]any) error
- type BashResult
- type BashTool
- func (t *BashTool) Definition() sdk.ChatCompletionTool
- func (t *BashTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *BashTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *BashTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *BashTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *BashTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *BashTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
- func (t *BashTool) IsEnabled() bool
- func (t *BashTool) Manifest() agentdomain.ToolManifest
- func (t *BashTool) ShouldAlwaysExpand() bool
- func (t *BashTool) ShouldCollapseArg(key string) bool
- func (t *BashTool) Validate(args map[string]any) error
- type CloseSubagentTool
- func (t *CloseSubagentTool) Definition() sdk.ChatCompletionTool
- func (t *CloseSubagentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *CloseSubagentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *CloseSubagentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *CloseSubagentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *CloseSubagentTool) IsEnabled() bool
- func (t *CloseSubagentTool) Manifest() agentdomain.ToolManifest
- func (t *CloseSubagentTool) ShouldAlwaysExpand() bool
- func (t *CloseSubagentTool) ShouldCollapseArg(key string) bool
- func (t *CloseSubagentTool) Validate(args map[string]any) error
- type CreateAvatarTool
- func (t *CreateAvatarTool) Definition() sdk.ChatCompletionTool
- func (t *CreateAvatarTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *CreateAvatarTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *CreateAvatarTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *CreateAvatarTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *CreateAvatarTool) IsEnabled() bool
- func (t *CreateAvatarTool) Manifest() agentdomain.ToolManifest
- func (t *CreateAvatarTool) ShouldAlwaysExpand() bool
- func (t *CreateAvatarTool) ShouldCollapseArg(key string) bool
- func (t *CreateAvatarTool) Validate(args map[string]any) error
- type CustomFormatter
- type DeleteResult
- type DeleteTool
- func (t *DeleteTool) Definition() sdk.ChatCompletionTool
- func (t *DeleteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *DeleteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *DeleteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *DeleteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *DeleteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *DeleteTool) IsEnabled() bool
- func (t *DeleteTool) Manifest() agentdomain.ToolManifest
- func (t *DeleteTool) ShouldAlwaysExpand() bool
- func (t *DeleteTool) ShouldCollapseArg(key string) bool
- func (t *DeleteTool) Validate(args map[string]any) error
- type EditOperation
- type EditTool
- func (t *EditTool) Definition() sdk.ChatCompletionTool
- func (t *EditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *EditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *EditTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *EditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *EditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *EditTool) IsEnabled() bool
- func (t *EditTool) Manifest() agentdomain.ToolManifest
- func (t *EditTool) ShouldAlwaysExpand() bool
- func (t *EditTool) ShouldCollapseArg(key string) bool
- func (t *EditTool) Validate(args map[string]any) error
- type FileReadResult
- type GetSubagentResultTool
- func (t *GetSubagentResultTool) Definition() sdk.ChatCompletionTool
- func (t *GetSubagentResultTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *GetSubagentResultTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *GetSubagentResultTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *GetSubagentResultTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *GetSubagentResultTool) IsEnabled() bool
- func (t *GetSubagentResultTool) Manifest() agentdomain.ToolManifest
- func (t *GetSubagentResultTool) ShouldAlwaysExpand() bool
- func (t *GetSubagentResultTool) ShouldCollapseArg(key string) bool
- func (t *GetSubagentResultTool) Validate(args map[string]any) error
- type GoogleSearchItem
- type GoogleSearchResponse
- type GrepCount
- type GrepMatch
- type GrepResult
- type GrepTool
- func (t *GrepTool) Definition() sdk.ChatCompletionTool
- func (t *GrepTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *GrepTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *GrepTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *GrepTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *GrepTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *GrepTool) IsEnabled() bool
- func (t *GrepTool) Manifest() agentdomain.ToolManifest
- func (t *GrepTool) ShouldAlwaysExpand() bool
- func (t *GrepTool) ShouldCollapseArg(key string) bool
- func (t *GrepTool) Validate(args map[string]any) error
- type ImageDecodeTool
- func (t *ImageDecodeTool) Definition() sdk.ChatCompletionTool
- func (t *ImageDecodeTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ImageDecodeTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ImageDecodeTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ImageDecodeTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ImageDecodeTool) IsEnabled() bool
- func (t *ImageDecodeTool) Manifest() agentdomain.ToolManifest
- func (t *ImageDecodeTool) ShouldAlwaysExpand() bool
- func (t *ImageDecodeTool) ShouldCollapseArg(key string) bool
- func (t *ImageDecodeTool) Validate(args map[string]any) error
- type ImageEditTool
- func (t *ImageEditTool) Definition() sdk.ChatCompletionTool
- func (t *ImageEditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ImageEditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ImageEditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ImageEditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ImageEditTool) IsEnabled() bool
- func (t *ImageEditTool) Manifest() agentdomain.ToolManifest
- func (t *ImageEditTool) ShouldAlwaysExpand() bool
- func (t *ImageEditTool) ShouldCollapseArg(key string) bool
- func (t *ImageEditTool) Validate(args map[string]any) error
- type ImageGenerationTool
- func (t *ImageGenerationTool) Definition() sdk.ChatCompletionTool
- func (t *ImageGenerationTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ImageGenerationTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ImageGenerationTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ImageGenerationTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ImageGenerationTool) IsEnabled() bool
- func (t *ImageGenerationTool) Manifest() agentdomain.ToolManifest
- func (t *ImageGenerationTool) ShouldAlwaysExpand() bool
- func (t *ImageGenerationTool) ShouldCollapseArg(key string) bool
- func (t *ImageGenerationTool) Validate(args map[string]any) error
- type ImageVariationTool
- func (t *ImageVariationTool) Definition() sdk.ChatCompletionTool
- func (t *ImageVariationTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ImageVariationTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ImageVariationTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ImageVariationTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ImageVariationTool) IsEnabled() bool
- func (t *ImageVariationTool) Manifest() agentdomain.ToolManifest
- func (t *ImageVariationTool) ShouldAlwaysExpand() bool
- func (t *ImageVariationTool) ShouldCollapseArg(key string) bool
- func (t *ImageVariationTool) Validate(args map[string]any) error
- type KillShellTool
- func (t *KillShellTool) Definition() sdk.ChatCompletionTool
- func (t *KillShellTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *KillShellTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *KillShellTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *KillShellTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *KillShellTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *KillShellTool) IsEnabled() bool
- func (t *KillShellTool) Manifest() agentdomain.ToolManifest
- func (t *KillShellTool) ShouldAlwaysExpand() bool
- func (t *KillShellTool) ShouldCollapseArg(key string) bool
- func (t *KillShellTool) Validate(args map[string]any) error
- type ListShellsTool
- func (t *ListShellsTool) Definition() sdk.ChatCompletionTool
- func (t *ListShellsTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ListShellsTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ListShellsTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ListShellsTool) IsEnabled() bool
- func (t *ListShellsTool) Manifest() agentdomain.ToolManifest
- func (t *ListShellsTool) ShouldAlwaysExpand() bool
- func (t *ListShellsTool) ShouldCollapseArg(key string) bool
- func (t *ListShellsTool) Validate(args map[string]any) error
- type ListSubagentsTool
- func (t *ListSubagentsTool) Definition() sdk.ChatCompletionTool
- func (t *ListSubagentsTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ListSubagentsTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ListSubagentsTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ListSubagentsTool) IsEnabled() bool
- func (t *ListSubagentsTool) Manifest() agentdomain.ToolManifest
- func (t *ListSubagentsTool) ShouldAlwaysExpand() bool
- func (t *ListSubagentsTool) ShouldCollapseArg(key string) bool
- func (t *ListSubagentsTool) Validate(args map[string]any) error
- type MemoryTool
- func (t *MemoryTool) Definition() sdk.ChatCompletionTool
- func (t *MemoryTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *MemoryTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *MemoryTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *MemoryTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *MemoryTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *MemoryTool) IsEnabled() bool
- func (t *MemoryTool) Manifest() agentdomain.ToolManifest
- func (t *MemoryTool) ShouldAlwaysExpand() bool
- func (t *MemoryTool) ShouldCollapseArg(key string) bool
- func (t *MemoryTool) Validate(args map[string]any) error
- type MemoryToolResult
- type MultiEditTool
- func (t *MultiEditTool) Definition() sdk.ChatCompletionTool
- func (t *MultiEditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *MultiEditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *MultiEditTool) IsEnabled() bool
- func (t *MultiEditTool) Manifest() agentdomain.ToolManifest
- func (t *MultiEditTool) ShouldAlwaysExpand() bool
- func (t *MultiEditTool) ShouldCollapseArg(key string) bool
- func (t *MultiEditTool) Validate(args map[string]any) error
- type ParameterExtractor
- type ReadSubagentScreenTool
- func (t *ReadSubagentScreenTool) Definition() sdk.ChatCompletionTool
- func (t *ReadSubagentScreenTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ReadSubagentScreenTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ReadSubagentScreenTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ReadSubagentScreenTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ReadSubagentScreenTool) IsEnabled() bool
- func (t *ReadSubagentScreenTool) Manifest() agentdomain.ToolManifest
- func (t *ReadSubagentScreenTool) ShouldAlwaysExpand() bool
- func (t *ReadSubagentScreenTool) ShouldCollapseArg(key string) bool
- func (t *ReadSubagentScreenTool) Validate(args map[string]any) error
- type ReadTool
- func (t *ReadTool) Definition() sdk.ChatCompletionTool
- func (t *ReadTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ReadTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ReadTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *ReadTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ReadTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ReadTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
- func (t *ReadTool) IsEnabled() bool
- func (t *ReadTool) Manifest() agentdomain.ToolManifest
- func (t *ReadTool) ShouldAlwaysExpand() bool
- func (t *ReadTool) ShouldCollapseArg(key string) bool
- func (t *ReadTool) Validate(args map[string]any) error
- type ReadToolTracker
- type Registry
- func (r *Registry) FrameSource(name string) (agentdomain.FrameSource, bool)
- func (r *Registry) FrameSourceNames() []string
- func (r *Registry) GetBackgroundShellService() scheddomain.BackgroundShellService
- func (r *Registry) GetTool(name string) (agentdomain.Tool, error)
- func (r *Registry) GetToolDefinitions() []sdk.ChatCompletionTool
- func (r *Registry) IsReadToolUsed() bool
- func (r *Registry) IsToolEnabled(name string) bool
- func (r *Registry) LastReadInfo(path string) (time.Time, int64, bool)
- func (r *Registry) ListAvailableTools() []string
- func (r *Registry) LoadMarkdownAgents()
- func (r *Registry) Manifest(name string) agentdomain.ToolManifest
- func (r *Registry) MarkdownSubagents() []agentdomain.SubagentInfo
- func (r *Registry) RecordFileRead(path string, modTime time.Time, size int64)
- func (r *Registry) RegisterFrameSource(name string, src agentdomain.FrameSource)
- func (r *Registry) RegisterTools(tools map[string]agentdomain.Tool)
- func (r *Registry) SetMemoryBackend(backend memory.MemoryBackend)
- func (r *Registry) SetReadToolUsed()
- func (r *Registry) UnregisterToolsWithPrefix(prefix string) int
- type RequestApprovalTool
- func (t *RequestApprovalTool) Definition() sdk.ChatCompletionTool
- func (t *RequestApprovalTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *RequestApprovalTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *RequestApprovalTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *RequestApprovalTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *RequestApprovalTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *RequestApprovalTool) IsEnabled() bool
- func (t *RequestApprovalTool) Manifest() agentdomain.ToolManifest
- func (t *RequestApprovalTool) ShouldAlwaysExpand() bool
- func (t *RequestApprovalTool) ShouldCollapseArg(key string) bool
- func (t *RequestApprovalTool) Validate(args map[string]any) error
- type RequestPlanApprovalTool
- func (t *RequestPlanApprovalTool) Definition() sdk.ChatCompletionTool
- func (t *RequestPlanApprovalTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *RequestPlanApprovalTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *RequestPlanApprovalTool) IsEnabled() bool
- func (t *RequestPlanApprovalTool) Manifest() agentdomain.ToolManifest
- func (t *RequestPlanApprovalTool) ShouldAlwaysExpand() bool
- func (t *RequestPlanApprovalTool) ShouldCollapseArg(key string) bool
- func (t *RequestPlanApprovalTool) Validate(args map[string]any) error
- type ScheduleTool
- func (t *ScheduleTool) Definition() sdk.ChatCompletionTool
- func (t *ScheduleTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *ScheduleTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *ScheduleTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *ScheduleTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *ScheduleTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *ScheduleTool) IsEnabled() bool
- func (t *ScheduleTool) Manifest() agentdomain.ToolManifest
- func (t *ScheduleTool) ShouldAlwaysExpand() bool
- func (t *ScheduleTool) ShouldCollapseArg(key string) bool
- func (t *ScheduleTool) Validate(args map[string]any) error
- type ScheduleToolResult
- type SearchOptions
- type SendSubagentInputTool
- func (t *SendSubagentInputTool) Definition() sdk.ChatCompletionTool
- func (t *SendSubagentInputTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *SendSubagentInputTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *SendSubagentInputTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *SendSubagentInputTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *SendSubagentInputTool) IsEnabled() bool
- func (t *SendSubagentInputTool) Manifest() agentdomain.ToolManifest
- func (t *SendSubagentInputTool) ShouldAlwaysExpand() bool
- func (t *SendSubagentInputTool) ShouldCollapseArg(key string) bool
- func (t *SendSubagentInputTool) Validate(args map[string]any) error
- type TextToMusicTool
- func (t *TextToMusicTool) Definition() sdk.ChatCompletionTool
- func (t *TextToMusicTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TextToMusicTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TextToMusicTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TextToMusicTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TextToMusicTool) IsEnabled() bool
- func (t *TextToMusicTool) Manifest() agentdomain.ToolManifest
- func (t *TextToMusicTool) ShouldAlwaysExpand() bool
- func (t *TextToMusicTool) ShouldCollapseArg(key string) bool
- func (t *TextToMusicTool) Validate(args map[string]any) error
- type TextToSFXTool
- func (t *TextToSFXTool) Definition() sdk.ChatCompletionTool
- func (t *TextToSFXTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TextToSFXTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TextToSFXTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TextToSFXTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TextToSFXTool) IsEnabled() bool
- func (t *TextToSFXTool) Manifest() agentdomain.ToolManifest
- func (t *TextToSFXTool) ShouldAlwaysExpand() bool
- func (t *TextToSFXTool) ShouldCollapseArg(key string) bool
- func (t *TextToSFXTool) Validate(args map[string]any) error
- type TextToSpeechTool
- func (t *TextToSpeechTool) Definition() sdk.ChatCompletionTool
- func (t *TextToSpeechTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TextToSpeechTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TextToSpeechTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TextToSpeechTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TextToSpeechTool) IsEnabled() bool
- func (t *TextToSpeechTool) Manifest() agentdomain.ToolManifest
- func (t *TextToSpeechTool) ShouldAlwaysExpand() bool
- func (t *TextToSpeechTool) ShouldCollapseArg(key string) bool
- func (t *TextToSpeechTool) Validate(args map[string]any) error
- type TextToVideoTool
- func (t *TextToVideoTool) Definition() sdk.ChatCompletionTool
- func (t *TextToVideoTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TextToVideoTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TextToVideoTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TextToVideoTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TextToVideoTool) IsEnabled() bool
- func (t *TextToVideoTool) Manifest() agentdomain.ToolManifest
- func (t *TextToVideoTool) ShouldAlwaysExpand() bool
- func (t *TextToVideoTool) ShouldCollapseArg(key string) bool
- func (t *TextToVideoTool) Validate(args map[string]any) error
- type TodoWriteTool
- func (t *TodoWriteTool) Definition() sdk.ChatCompletionTool
- func (t *TodoWriteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TodoWriteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TodoWriteTool) IsEnabled() bool
- func (t *TodoWriteTool) Manifest() agentdomain.ToolManifest
- func (t *TodoWriteTool) ShouldAlwaysExpand() bool
- func (t *TodoWriteTool) ShouldCollapseArg(key string) bool
- func (t *TodoWriteTool) Validate(args map[string]any) error
- type TreeResult
- type TreeTool
- func (t *TreeTool) Definition() sdk.ChatCompletionTool
- func (t *TreeTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *TreeTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *TreeTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *TreeTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *TreeTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *TreeTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
- func (t *TreeTool) IsEnabled() bool
- func (t *TreeTool) Manifest() agentdomain.ToolManifest
- func (t *TreeTool) ShouldAlwaysExpand() bool
- func (t *TreeTool) ShouldCollapseArg(key string) bool
- func (t *TreeTool) Validate(args map[string]any) error
- type WaitTool
- func (t *WaitTool) Definition() sdk.ChatCompletionTool
- func (t *WaitTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *WaitTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *WaitTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *WaitTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *WaitTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *WaitTool) IsEnabled() bool
- func (t *WaitTool) Manifest() agentdomain.ToolManifest
- func (t *WaitTool) ShouldAlwaysExpand() bool
- func (t *WaitTool) ShouldCollapseArg(key string) bool
- func (t *WaitTool) Validate(args map[string]any) error
- type WebFetchTool
- func (t *WebFetchTool) Definition() sdk.ChatCompletionTool
- func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *WebFetchTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *WebFetchTool) IsEnabled() bool
- func (t *WebFetchTool) Manifest() agentdomain.ToolManifest
- func (t *WebFetchTool) ShouldAlwaysExpand() bool
- func (t *WebFetchTool) ShouldCollapseArg(key string) bool
- func (t *WebFetchTool) Validate(args map[string]any) error
- type WebSearchTool
- func (t *WebSearchTool) Definition() sdk.ChatCompletionTool
- func (t *WebSearchTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *WebSearchTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *WebSearchTool) IsEnabled() bool
- func (t *WebSearchTool) Manifest() agentdomain.ToolManifest
- func (t *WebSearchTool) ShouldAlwaysExpand() bool
- func (t *WebSearchTool) ShouldCollapseArg(key string) bool
- func (t *WebSearchTool) Validate(args map[string]any) error
- type WriteParams
- type WriteTool
- func (t *WriteTool) Definition() sdk.ChatCompletionTool
- func (t *WriteTool) Enabled() bool
- func (t *WriteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
- func (t *WriteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
- func (t *WriteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
- func (t *WriteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
- func (t *WriteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
- func (t *WriteTool) IsEnabled() bool
- func (t *WriteTool) Manifest() agentdomain.ToolManifest
- func (t *WriteTool) ShouldAlwaysExpand() bool
- func (t *WriteTool) ShouldCollapseArg(key string) bool
- func (t *WriteTool) Validate(args map[string]any) error
Constants ¶
const ( OperationRead = "read" OperationWrite = "write" OperationDelete = "delete" MemoryTypeUser = "user" MemoryTypeFeedback = "feedback" MemoryTypeProject = "project" MemoryTypeReference = "reference" )
const ( ErrorNotFound = "NOT_FOUND" ErrorFileEmpty = "FILE_EMPTY" ErrorPDFParseError = "PDF_PARSE_ERROR" ErrorUnreadableBinary = "UNREADABLE_BINARY" )
Error constants for consistent error handling
const ( DefaultOffset = 1 DefaultLimit = 2000 MaxLineLength = 2000 EmptyFileReminder = "The file exists but is empty." )
Constants for defaults and limits
const ( ToolAgent = "Agent" ToolApproveSubagent = "ApproveSubagent" ToolAskUserQuestion = "AskUserQuestion" ToolBash = "Bash" ToolBashOutput = "BashOutput" ToolCloseSubagent = "CloseSubagent" ToolCreateAvatar = "CreateAvatar" ToolDelete = "Delete" ToolEdit = "Edit" ToolGetSubagentResult = "GetSubagentResult" ToolGrep = "Grep" ToolImageDecode = "ImageDecode" ToolImageEdit = "ImageEdit" ToolImageGeneration = "ImageGeneration" ToolImageVariation = "ImageVariation" ToolKillShell = "KillShell" ToolListShells = "ListShells" ToolListSubagents = "ListSubagents" ToolMemory = "Memory" ToolMultiEdit = "MultiEdit" ToolRead = "Read" ToolReadSubagentScreen = "ReadSubagentScreen" ToolRequestApproval = "RequestApproval" ToolRequestPlanApproval = "RequestPlanApproval" ToolSchedule = "Schedule" ToolSendSubagentInput = "SendSubagentInput" ToolTextToMusic = "TextToMusic" ToolTextToSFX = "TextToSFX" ToolTextToSpeech = "TextToSpeech" ToolTextToVideo = "TextToVideo" ToolTodoWrite = "TodoWrite" ToolTree = "Tree" ToolWait = "Wait" ToolWebFetch = "WebFetch" ToolWebSearch = "WebSearch" ToolWrite = "Write" )
Names of the agent's built-in tools, as their manifests declare them.
const ( DefaultFormat = "text" JSONFormat = "json" )
const SubagentToolsEnv = "INFER_SUBAGENT_TOOLS"
SubagentToolsEnv carries a named subagent's tool allowlist to the spawned subagent, which enforces it in LLMToolService.isToolEnabled - that single check gates both what is advertised to the model and what ExecuteTool accepts.
Variables ¶
This section is empty.
Functions ¶
func NewPaneInspector ¶
func NewPaneInspector() func(ctx context.Context, paneID, sessionID string) scheddomain.PaneObservation
NewPaneInspector returns a pane inspector (a func yielding a scheddomain.PaneObservation) backed by the subagent result file, the approval sidecar, and the tmux pane's liveness. The interactive subagent monitor (interactiveSubagentJob) calls it to watch interactive subagents for completion and pending approvals. It NEVER returns pane content as the delivered message - the pane is rendered TUI chrome (input box, status bar), which is noise in the main conversation; only the result file's last assistant message is delivered. The Screen snapshot it returns is used ONLY for the monitor's idle-by-stability check, never delivered.
Types ¶
type AgentSubResult ¶
type AgentSubResult struct {
Label string `json:"label"`
SessionID string `json:"session_id"`
Success bool `json:"success"`
Result string `json:"result,omitempty"`
Error string `json:"error,omitempty"`
}
AgentSubResult is the per-subagent outcome reported back to the LLM.
type AgentTaskSpec ¶
type AgentTaskSpec struct {
Label string
Description string
Model string
Files []string
SystemPrompt string
// Agent, when set, names a Markdown-defined agent (see mdagent.go) whose
// system prompt, model and tool allowlist replace the per-task overrides.
Agent string
// Tools is the resolved allowlist passed to the subagent via
// SubagentToolsEnv; nil means inherit the parent's tools.
Tools []string
// Mode is the subagent's capability, resolved from the `type` argument:
// ReadOnly -> AgentModeReadOnly (Explore-like, no approval), ReadWrite ->
// AgentModeStandard (can mutate, approval applies).
Mode agentdomain.AgentMode
}
AgentTaskSpec is one delegated unit of work within an Agent tool call.
type AgentTool ¶
type AgentTool struct {
// contains filtered or unexported fields
}
AgentTool spawns local subagents (each an `infer headless` subprocess) in parallel and folds their results back into the main context. It is the lightweight, no-A2A-server complement to the A2A tools.
func NewAgentTool ¶
func NewAgentTool(cfg *config.Config, tracker scheddomain.SubagentTracker, submitter scheddomain.JobSubmitter) *AgentTool
NewAgentTool creates the Agent tool. tracker is the session's SubagentTracker (the data store the subagent control tools read); submitter is the job supervisor that monitors async/interactive subagents to completion.
func (*AgentTool) Definition ¶
func (t *AgentTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*AgentTool) Execute ¶
func (t *AgentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the tool with the given arguments.
func (*AgentTool) FormatForLLM ¶
func (t *AgentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM renders a structured detail block for the assistant.
func (*AgentTool) FormatForUI ¶
func (t *AgentTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI renders the tool call header with a single-line preview.
func (*AgentTool) FormatPreview ¶
func (t *AgentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a compact one-line preview.
func (*AgentTool) FormatResult ¶
func (t *AgentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*AgentTool) IsEnabled ¶
IsEnabled reports whether the tool is enabled (and below the depth limit).
func (*AgentTool) Manifest ¶
func (t *AgentTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*AgentTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand keeps the result block collapsed by default.
func (*AgentTool) ShouldCollapseArg ¶
ShouldCollapseArg keeps the Agent tool's arguments visible rather than collapsing them to "...". The task description is the one thing a user needs to see when approving an Agent call - and unlike Write/Edit there is no diff or preview below the summary to fall back on - so it must show in the approval prompt and the tool-call line. Long values are truncated by the surrounding view's width budget.
type AgentToolResult ¶
type AgentToolResult struct {
Mode string `json:"mode"`
Wait bool `json:"wait"`
Dispatched int `json:"dispatched"`
Subagents []AgentSubResult `json:"subagents,omitempty"`
Message string `json:"message,omitempty"`
}
AgentToolResult is the structured payload of an Agent tool call.
type ApproveSubagentTool ¶
type ApproveSubagentTool struct {
// contains filtered or unexported fields
}
ApproveSubagentTool relays the user's approve/reject decision to an interactive subagent that is blocked on a tool-approval prompt (the parent is notified with a "[Subagent Awaiting Approval: ...]" message). approve presses Enter on the pane's default-focused [Approve] button; reject presses Escape. The tool is always approval-gated so the human confirms the relay in the MAIN chat.
func NewApproveSubagentTool ¶
func NewApproveSubagentTool(cfg *config.Config, tracker scheddomain.SubagentTracker) *ApproveSubagentTool
NewApproveSubagentTool creates a new ApproveSubagent tool over the session's SubagentTracker.
func (*ApproveSubagentTool) Definition ¶
func (t *ApproveSubagentTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*ApproveSubagentTool) Execute ¶
func (t *ApproveSubagentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute relays the decision to the named subagent's pane.
func (*ApproveSubagentTool) FormatForLLM ¶
func (t *ApproveSubagentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*ApproveSubagentTool) FormatPreview ¶
func (t *ApproveSubagentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*ApproveSubagentTool) FormatResult ¶
func (t *ApproveSubagentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*ApproveSubagentTool) IsEnabled ¶
func (t *ApproveSubagentTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*ApproveSubagentTool) Manifest ¶
func (t *ApproveSubagentTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*ApproveSubagentTool) ShouldAlwaysExpand ¶
func (t *ApproveSubagentTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*ApproveSubagentTool) ShouldCollapseArg ¶
func (t *ApproveSubagentTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type AskUserQuestionTool ¶
type AskUserQuestionTool struct {
// contains filtered or unexported fields
}
AskUserQuestionTool presents the user with a small interactive form of 1-4 multiple-choice questions and returns the chosen answers to the agent. In plan mode the answers fold into the plan before RequestPlanApproval.
It is read-only (no approval gate) and only reaches the user when a UserQuestionBroker is in the execution context: the chat TUI, `!!` direct execution, or a headless host (ag-ui/json formats) answering over stdin. Without a broker (text format, no host) the tool degrades gracefully instead of blocking.
func NewAskUserQuestionTool ¶
func NewAskUserQuestionTool(cfg *config.Config) *AskUserQuestionTool
NewAskUserQuestionTool creates a new AskUserQuestion tool.
func (*AskUserQuestionTool) Definition ¶
func (t *AskUserQuestionTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*AskUserQuestionTool) Execute ¶
func (t *AskUserQuestionTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute presents the questions to the user and returns their answers. The tool blocks (in its own goroutine) until the user submits, dismisses, or the session is cancelled. When no interactive user is reachable it returns a graceful result telling the model to proceed with assumptions.
func (*AskUserQuestionTool) FormatForLLM ¶
func (t *AskUserQuestionTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*AskUserQuestionTool) FormatForUI ¶
func (t *AskUserQuestionTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display.
func (*AskUserQuestionTool) FormatPreview ¶
func (t *AskUserQuestionTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*AskUserQuestionTool) FormatResult ¶
func (t *AskUserQuestionTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*AskUserQuestionTool) IsEnabled ¶
func (t *AskUserQuestionTool) IsEnabled() bool
IsEnabled returns whether the AskUserQuestion tool is enabled.
func (*AskUserQuestionTool) Manifest ¶
func (t *AskUserQuestionTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*AskUserQuestionTool) ShouldAlwaysExpand ¶
func (t *AskUserQuestionTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand keeps the collected answers expanded in the conversation by default - the Q&A is the whole point of the tool, so it shouldn't be hidden behind a collapsed one-liner.
func (*AskUserQuestionTool) ShouldCollapseArg ¶
func (t *AskUserQuestionTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display.
type BaseFormatter ¶
type BaseFormatter struct {
// contains filtered or unexported fields
}
BaseFormatter provides common formatting functionality that tools can embed
func NewBaseFormatter ¶
func NewBaseFormatter(toolName string) BaseFormatter
NewBaseFormatter creates a new base formatter for a tool
func (BaseFormatter) FormatAsJSON ¶
func (f BaseFormatter) FormatAsJSON(data any) string
FormatAsJSON formats data as JSON if possible, falls back to string representation
func (BaseFormatter) FormatDuration ¶
func (f BaseFormatter) FormatDuration(result *agentdomain.ToolExecutionResult) string
FormatDuration formats a duration for display in a human-friendly way
func (BaseFormatter) FormatExpanded ¶
func (f BaseFormatter) FormatExpanded(result *agentdomain.ToolExecutionResult, dataContent string) string
FormatExpanded renders the full expanded result as a single native lipgloss/tree, replacing the hand-drawn ├─/└─ connectors that used to live across three methods. dataContent is the tool-specific result body (may be ""). Output is plain: the UI wraps and themes it (services.themeTreeLines); LLM / headless consume it as-is.
func (BaseFormatter) FormatStatusIcon ¶
func (f BaseFormatter) FormatStatusIcon(success bool) string
FormatStatusIcon returns just the status icon
func (BaseFormatter) FormatToolCall ¶
func (f BaseFormatter) FormatToolCall(args map[string]any, expanded bool) string
FormatToolCall formats a tool call for consistent display
func (BaseFormatter) GetDomainFromURL ¶
func (f BaseFormatter) GetDomainFromURL(url string) string
GetDomainFromURL extracts domain from URL
func (BaseFormatter) GetFileName ¶
func (f BaseFormatter) GetFileName(path string) string
GetFileName extracts filename from a path
func (BaseFormatter) ShouldCollapseArg ¶
func (f BaseFormatter) ShouldCollapseArg(key string) bool
ShouldCollapseArg provides default collapse behavior (can be overridden by tools)
func (BaseFormatter) TruncateText ¶
func (f BaseFormatter) TruncateText(text string, maxLength int) string
TruncateText truncates text to specified length with ellipsis
type BashOutputTool ¶
type BashOutputTool struct {
// contains filtered or unexported fields
}
BashOutputTool retrieves output from background bash shells
func NewBashOutputTool ¶
func NewBashOutputTool(cfg *config.Config, shellService scheddomain.BackgroundShellService) *BashOutputTool
NewBashOutputTool creates a new BashOutput tool
func (*BashOutputTool) Definition ¶
func (t *BashOutputTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the SDK
func (*BashOutputTool) Execute ¶
func (t *BashOutputTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute retrieves output from a background shell
func (*BashOutputTool) FormatForLLM ¶
func (t *BashOutputTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*BashOutputTool) FormatForUI ¶
func (t *BashOutputTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*BashOutputTool) FormatPreview ¶
func (t *BashOutputTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*BashOutputTool) FormatResult ¶
func (t *BashOutputTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*BashOutputTool) IsEnabled ¶
func (t *BashOutputTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*BashOutputTool) Manifest ¶
func (t *BashOutputTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*BashOutputTool) ShouldAlwaysExpand ¶
func (t *BashOutputTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*BashOutputTool) ShouldCollapseArg ¶
func (t *BashOutputTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if a specific argument should be collapsed in UI
type BashResult ¶
type BashResult struct {
Command string `json:"command"`
Output string `json:"output"`
Error string `json:"error,omitempty"`
ExitCode int `json:"exit_code"`
Duration string `json:"duration"`
}
BashResult represents the internal result of a bash command execution
type BashTool ¶
type BashTool struct {
// contains filtered or unexported fields
}
BashTool handles bash command execution with security validation
func NewBashTool ¶
func NewBashTool(cfg *config.Config, backgroundShellService scheddomain.BackgroundShellService) *BashTool
NewBashTool creates a new bash tool
func (*BashTool) Definition ¶
func (t *BashTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM. The command parameter is intentionally not constrained by an enum: the set of auto-approved commands is per-mode (and may be ".*"), so it cannot be expressed as a fixed schema. The effective allow-list for the active mode is surfaced in the system prompt instead; off-list commands still execute via approval (chat) or are rejected with a reason (agent mode).
func (*BashTool) Execute ¶
func (t *BashTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the bash tool with given arguments
func (*BashTool) FormatForLLM ¶
func (t *BashTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*BashTool) FormatForUI ¶
func (t *BashTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*BashTool) FormatPreview ¶
func (t *BashTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*BashTool) FormatResult ¶
func (t *BashTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*BashTool) FormatResultBody ¶
func (t *BashTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
FormatResultBody returns the command's primary output for the collapsed preview and the full-on-failure view. Unlike FormatPreview it never truncates, and on a non-zero exit it surfaces the exit code and error so failures are fully visible.
func (*BashTool) Manifest ¶
func (t *BashTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*BashTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*BashTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type CloseSubagentTool ¶
type CloseSubagentTool struct {
// contains filtered or unexported fields
}
CloseSubagentTool closes a subagent. For an interactive subagent it harvests its last assistant message (result file) and kills the tmux pane; for a headless one it cancels the running subprocess. The subagent analogue of KillShell.
func NewCloseSubagentTool ¶
func NewCloseSubagentTool(cfg *config.Config, tracker scheddomain.SubagentTracker, stopJob scheddomain.JobStopper) *CloseSubagentTool
NewCloseSubagentTool creates a new CloseSubagent tool over the session's SubagentTracker. stopJob ends the supervised monitor of a closed interactive subagent (may be nil, e.g. when the supervisor is unavailable, in which case the tool falls back to killing the pane directly).
func (*CloseSubagentTool) Definition ¶
func (t *CloseSubagentTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*CloseSubagentTool) Execute ¶
func (t *CloseSubagentTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute closes the named subagent.
func (*CloseSubagentTool) FormatForLLM ¶
func (t *CloseSubagentTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*CloseSubagentTool) FormatPreview ¶
func (t *CloseSubagentTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*CloseSubagentTool) FormatResult ¶
func (t *CloseSubagentTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*CloseSubagentTool) IsEnabled ¶
func (t *CloseSubagentTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*CloseSubagentTool) Manifest ¶
func (t *CloseSubagentTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*CloseSubagentTool) ShouldAlwaysExpand ¶
func (t *CloseSubagentTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*CloseSubagentTool) ShouldCollapseArg ¶
func (t *CloseSubagentTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type CreateAvatarTool ¶
type CreateAvatarTool struct {
// contains filtered or unexported fields
}
CreateAvatarTool builds a library avatar (~/.infer/avatars/<name>/) from a photo, generating extra angles with the ImageEdit model - the agent-side twin of `infer avatars create`, over the same avatars.Create. The photo is confined to the working directory and the session's artifacts directory.
func NewCreateAvatarTool ¶
func NewCreateAvatarTool(cfg *config.Config, imageService agentdomain.ImageService) *CreateAvatarTool
NewCreateAvatarTool creates a new CreateAvatar tool.
func (*CreateAvatarTool) Definition ¶
func (t *CreateAvatarTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for CreateAvatar
func (*CreateAvatarTool) Execute ¶
func (t *CreateAvatarTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the CreateAvatar tool
func (*CreateAvatarTool) FormatForLLM ¶
func (t *CreateAvatarTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*CreateAvatarTool) FormatPreview ¶
func (t *CreateAvatarTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*CreateAvatarTool) FormatResult ¶
func (t *CreateAvatarTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*CreateAvatarTool) IsEnabled ¶
func (t *CreateAvatarTool) IsEnabled() bool
IsEnabled reports whether the feature is enabled: TextToVideo and its separate create_avatar opt-in.
func (*CreateAvatarTool) Manifest ¶
func (t *CreateAvatarTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*CreateAvatarTool) ShouldAlwaysExpand ¶
func (t *CreateAvatarTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*CreateAvatarTool) ShouldCollapseArg ¶
func (t *CreateAvatarTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type CustomFormatter ¶
type CustomFormatter struct {
BaseFormatter
// contains filtered or unexported fields
}
CustomFormatter extends BaseFormatter with customizable collapse behavior
func NewCustomFormatter ¶
func NewCustomFormatter(toolName string, collapseFunc func(string) bool) CustomFormatter
NewCustomFormatter creates a formatter with custom collapse logic
func (CustomFormatter) FormatExpanded ¶
func (f CustomFormatter) FormatExpanded(result *agentdomain.ToolExecutionResult, dataContent string) string
FormatExpanded renders the expanded tree using the custom collapse behavior.
func (CustomFormatter) FormatToolCall ¶
func (f CustomFormatter) FormatToolCall(args map[string]any, expanded bool) string
FormatToolCall overrides BaseFormatter to use custom collapse logic
func (CustomFormatter) ShouldCollapseArg ¶
func (f CustomFormatter) ShouldCollapseArg(key string) bool
ShouldCollapseArg uses the custom collapse function if provided
type DeleteResult ¶
type DeleteResult struct {
Path string `json:"path"`
DeletedFiles []string `json:"deleted_files"`
DeletedDirs []string `json:"deleted_dirs"`
TotalFilesDeleted int `json:"total_files_deleted"`
TotalDirsDeleted int `json:"total_dirs_deleted"`
WildcardExpanded bool `json:"wildcard_expanded"`
Errors []string `json:"errors,omitempty"`
}
DeleteResult represents the result of a delete operation
type DeleteTool ¶
type DeleteTool struct {
// contains filtered or unexported fields
}
DeleteTool handles file and directory deletion operations
func NewDeleteTool ¶
func NewDeleteTool(cfg *config.Config) *DeleteTool
NewDeleteTool creates a new delete tool
func (*DeleteTool) Definition ¶
func (t *DeleteTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*DeleteTool) Execute ¶
func (t *DeleteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the delete tool with given arguments
func (*DeleteTool) FormatForLLM ¶
func (t *DeleteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*DeleteTool) FormatForUI ¶
func (t *DeleteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*DeleteTool) FormatPreview ¶
func (t *DeleteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*DeleteTool) FormatResult ¶
func (t *DeleteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*DeleteTool) IsEnabled ¶
func (t *DeleteTool) IsEnabled() bool
IsEnabled returns whether the delete tool is enabled
func (*DeleteTool) Manifest ¶
func (t *DeleteTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*DeleteTool) ShouldAlwaysExpand ¶
func (t *DeleteTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*DeleteTool) ShouldCollapseArg ¶
func (t *DeleteTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type EditOperation ¶
EditOperation represents a single edit operation
type EditTool ¶
type EditTool struct {
// contains filtered or unexported fields
}
EditTool handles exact string replacements in files with strict safety rules
func NewEditTool ¶
NewEditTool creates a new edit tool
func NewEditToolWithRegistry ¶
func NewEditToolWithRegistry(cfg *config.Config, registry ReadToolTracker) *EditTool
NewEditToolWithRegistry creates a new edit tool with a registry for read tracking
func (*EditTool) Definition ¶
func (t *EditTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*EditTool) Execute ¶
func (t *EditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the edit tool with given arguments
func (*EditTool) FormatForLLM ¶
func (t *EditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*EditTool) FormatForUI ¶
func (t *EditTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*EditTool) FormatPreview ¶
func (t *EditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*EditTool) FormatResult ¶
func (t *EditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*EditTool) Manifest ¶
func (t *EditTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*EditTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*EditTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type FileReadResult ¶
type FileReadResult struct {
FilePath string `json:"file_path"`
Content string `json:"content"`
Size int64 `json:"size"`
StartLine int `json:"start_line,omitempty"`
EndLine int `json:"end_line,omitempty"`
Error string `json:"error,omitempty"`
}
FileReadResult represents the internal result of a file read operation
type GetSubagentResultTool ¶
type GetSubagentResultTool struct {
// contains filtered or unexported fields
}
GetSubagentResultTool returns the latest output of an interactive subagent by returning the subagent chat's last assistant message (from its result file). It is the subagent analogue of BashOutput.
func NewGetSubagentResultTool ¶
func NewGetSubagentResultTool(cfg *config.Config, tracker scheddomain.SubagentTracker) *GetSubagentResultTool
NewGetSubagentResultTool creates a new GetSubagentResult tool over the session's SubagentTracker.
func (*GetSubagentResultTool) Definition ¶
func (t *GetSubagentResultTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*GetSubagentResultTool) Execute ¶
func (t *GetSubagentResultTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute returns the latest output of the named subagent.
func (*GetSubagentResultTool) FormatForLLM ¶
func (t *GetSubagentResultTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*GetSubagentResultTool) FormatPreview ¶
func (t *GetSubagentResultTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*GetSubagentResultTool) FormatResult ¶
func (t *GetSubagentResultTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*GetSubagentResultTool) IsEnabled ¶
func (t *GetSubagentResultTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*GetSubagentResultTool) Manifest ¶
func (t *GetSubagentResultTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*GetSubagentResultTool) ShouldAlwaysExpand ¶
func (t *GetSubagentResultTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*GetSubagentResultTool) ShouldCollapseArg ¶
func (t *GetSubagentResultTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type GoogleSearchItem ¶
type GoogleSearchItem struct {
Title string `json:"title"`
Link string `json:"link"`
Snippet string `json:"snippet"`
}
GoogleSearchItem represents a single search result from Google API
type GoogleSearchResponse ¶
type GoogleSearchResponse struct {
Items []GoogleSearchItem `json:"items"`
}
GoogleSearchResponse represents the response from Google Custom Search API
type GrepMatch ¶
type GrepMatch struct {
File string `json:"file"`
Line int `json:"line"`
Text string `json:"text"`
}
GrepMatch represents a single match with line content
type GrepResult ¶
type GrepResult struct {
Pattern string `json:"pattern"`
OutputMode string `json:"output_mode"`
Files []string `json:"files,omitempty"`
Matches []GrepMatch `json:"matches,omitempty"`
Counts []GrepCount `json:"counts,omitempty"`
Total int `json:"total"`
Truncated bool `json:"truncated"`
Duration string `json:"duration"`
Error string `json:"error,omitempty"`
}
GrepResult represents the result of a grep operation
type GrepTool ¶
type GrepTool struct {
// contains filtered or unexported fields
}
GrepTool handles search operations with ripgrep fallback to Go implementation
func NewGrepTool ¶
NewGrepTool creates a new grep tool
func (*GrepTool) Definition ¶
func (t *GrepTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*GrepTool) Execute ¶
func (t *GrepTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the grep tool with given arguments
func (*GrepTool) FormatForLLM ¶
func (t *GrepTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*GrepTool) FormatForUI ¶
func (t *GrepTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*GrepTool) FormatPreview ¶
func (t *GrepTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GrepTool) FormatResult ¶
func (t *GrepTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*GrepTool) Manifest ¶
func (t *GrepTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*GrepTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GrepTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type ImageDecodeTool ¶
type ImageDecodeTool struct {
// contains filtered or unexported fields
}
ImageDecodeTool describes a local image file as text (scene summary + classified element list) via the configured vision annotator, making text-only session models effectively vision-capable on demand.
func NewImageDecodeTool ¶
func NewImageDecodeTool(cfg *config.Config, imageService agentdomain.ImageService, annotator agentdomain.ImageAnnotator) *ImageDecodeTool
NewImageDecodeTool creates a new ImageDecode tool
func (*ImageDecodeTool) Definition ¶
func (t *ImageDecodeTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*ImageDecodeTool) Execute ¶
func (t *ImageDecodeTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute returns the image as an attachment (vision models see it natively) and, when an annotator is configured, a text description for models that cannot.
func (*ImageDecodeTool) FormatForLLM ¶
func (t *ImageDecodeTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*ImageDecodeTool) FormatPreview ¶
func (t *ImageDecodeTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*ImageDecodeTool) FormatResult ¶
func (t *ImageDecodeTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*ImageDecodeTool) IsEnabled ¶
func (t *ImageDecodeTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled: reading images needs no annotator, only the text description does.
func (*ImageDecodeTool) Manifest ¶
func (t *ImageDecodeTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*ImageDecodeTool) ShouldAlwaysExpand ¶
func (t *ImageDecodeTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ImageDecodeTool) ShouldCollapseArg ¶
func (t *ImageDecodeTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type ImageEditTool ¶
type ImageEditTool struct {
// contains filtered or unexported fields
}
ImageEditTool edits an existing image with the configured image model and saves the result to a local PNG. The chat model calls it with a local image path and a plain prompt; the request goes straight to /v1/images/edits, independent of the model selected for the session.
func NewImageEditTool ¶
func NewImageEditTool(cfg *config.Config, imageService agentdomain.ImageService) *ImageEditTool
NewImageEditTool creates a new ImageEdit tool
func (*ImageEditTool) Definition ¶
func (t *ImageEditTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for ImageEdit
func (*ImageEditTool) Execute ¶
func (t *ImageEditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the ImageEdit tool
func (*ImageEditTool) FormatForLLM ¶
func (t *ImageEditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*ImageEditTool) FormatPreview ¶
func (t *ImageEditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*ImageEditTool) FormatResult ¶
func (t *ImageEditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*ImageEditTool) IsEnabled ¶
func (t *ImageEditTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*ImageEditTool) Manifest ¶
func (t *ImageEditTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*ImageEditTool) ShouldAlwaysExpand ¶
func (t *ImageEditTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ImageEditTool) ShouldCollapseArg ¶
func (t *ImageEditTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type ImageGenerationTool ¶
type ImageGenerationTool struct {
// contains filtered or unexported fields
}
ImageGenerationTool generates an image with the configured image model and saves it to a local PNG. The chat model calls it with a plain prompt; the request goes straight to /v1/images/generations, independent of the model selected for the session.
func NewImageGenerationTool ¶
func NewImageGenerationTool(cfg *config.Config, imageService agentdomain.ImageService) *ImageGenerationTool
NewImageGenerationTool creates a new ImageGeneration tool
func (*ImageGenerationTool) Definition ¶
func (t *ImageGenerationTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for ImageGeneration
func (*ImageGenerationTool) Execute ¶
func (t *ImageGenerationTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the ImageGeneration tool
func (*ImageGenerationTool) FormatForLLM ¶
func (t *ImageGenerationTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*ImageGenerationTool) FormatPreview ¶
func (t *ImageGenerationTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*ImageGenerationTool) FormatResult ¶
func (t *ImageGenerationTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*ImageGenerationTool) IsEnabled ¶
func (t *ImageGenerationTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*ImageGenerationTool) Manifest ¶
func (t *ImageGenerationTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*ImageGenerationTool) ShouldAlwaysExpand ¶
func (t *ImageGenerationTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ImageGenerationTool) ShouldCollapseArg ¶
func (t *ImageGenerationTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type ImageVariationTool ¶
type ImageVariationTool struct {
// contains filtered or unexported fields
}
ImageVariationTool creates a variation of an existing image with the configured image model and saves the result to a local PNG. The chat model calls it with a local image path; the request goes straight to /v1/images/edits, independent of the model selected for the session.
func NewImageVariationTool ¶
func NewImageVariationTool(cfg *config.Config, imageService agentdomain.ImageService) *ImageVariationTool
NewImageVariationTool creates a new ImageVariation tool
func (*ImageVariationTool) Definition ¶
func (t *ImageVariationTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for ImageVariation
func (*ImageVariationTool) Execute ¶
func (t *ImageVariationTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the ImageVariation tool
func (*ImageVariationTool) FormatForLLM ¶
func (t *ImageVariationTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*ImageVariationTool) FormatPreview ¶
func (t *ImageVariationTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*ImageVariationTool) FormatResult ¶
func (t *ImageVariationTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*ImageVariationTool) IsEnabled ¶
func (t *ImageVariationTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*ImageVariationTool) Manifest ¶
func (t *ImageVariationTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*ImageVariationTool) ShouldAlwaysExpand ¶
func (t *ImageVariationTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ImageVariationTool) ShouldCollapseArg ¶
func (t *ImageVariationTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type KillShellTool ¶
type KillShellTool struct {
// contains filtered or unexported fields
}
KillShellTool cancels a running background shell
func NewKillShellTool ¶
func NewKillShellTool(cfg *config.Config, shellService scheddomain.BackgroundShellService) *KillShellTool
NewKillShellTool creates a new KillShell tool
func (*KillShellTool) Definition ¶
func (t *KillShellTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the SDK
func (*KillShellTool) Execute ¶
func (t *KillShellTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute cancels a background shell
func (*KillShellTool) FormatForLLM ¶
func (t *KillShellTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*KillShellTool) FormatForUI ¶
func (t *KillShellTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*KillShellTool) FormatPreview ¶
func (t *KillShellTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*KillShellTool) FormatResult ¶
func (t *KillShellTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*KillShellTool) IsEnabled ¶
func (t *KillShellTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*KillShellTool) Manifest ¶
func (t *KillShellTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*KillShellTool) ShouldAlwaysExpand ¶
func (t *KillShellTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*KillShellTool) ShouldCollapseArg ¶
func (t *KillShellTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if a specific argument should be collapsed in UI
type ListShellsTool ¶
type ListShellsTool struct {
// contains filtered or unexported fields
}
ListShellsTool implements listing of background shells
func NewListShellsTool ¶
func NewListShellsTool(cfg *config.Config, shellService scheddomain.BackgroundShellService) *ListShellsTool
NewListShellsTool creates a new ListShells tool
func (*ListShellsTool) Definition ¶
func (t *ListShellsTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*ListShellsTool) Execute ¶
func (t *ListShellsTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute lists all background shells
func (*ListShellsTool) FormatPreview ¶
func (t *ListShellsTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview
func (*ListShellsTool) FormatResult ¶
func (t *ListShellsTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result for display
func (*ListShellsTool) IsEnabled ¶
func (t *ListShellsTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*ListShellsTool) Manifest ¶
func (t *ListShellsTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*ListShellsTool) ShouldAlwaysExpand ¶
func (t *ListShellsTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded
func (*ListShellsTool) ShouldCollapseArg ¶
func (t *ListShellsTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed
type ListSubagentsTool ¶
type ListSubagentsTool struct {
// contains filtered or unexported fields
}
ListSubagentsTool lists local subagents spawned by the Agent tool. For interactive (tmux-pane) subagents it reports the pane's live status so the main agent can tell which have finished. It is the subagent analogue of ListShells.
func NewListSubagentsTool ¶
func NewListSubagentsTool(cfg *config.Config, tracker scheddomain.SubagentTracker) *ListSubagentsTool
NewListSubagentsTool creates a new ListSubagents tool over the session's SubagentTracker.
func (*ListSubagentsTool) Definition ¶
func (t *ListSubagentsTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*ListSubagentsTool) Execute ¶
func (t *ListSubagentsTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute lists all tracked subagents.
func (*ListSubagentsTool) FormatPreview ¶
func (t *ListSubagentsTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview.
func (*ListSubagentsTool) FormatResult ¶
func (t *ListSubagentsTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result for display.
func (*ListSubagentsTool) IsEnabled ¶
func (t *ListSubagentsTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*ListSubagentsTool) Manifest ¶
func (t *ListSubagentsTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*ListSubagentsTool) ShouldAlwaysExpand ¶
func (t *ListSubagentsTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*ListSubagentsTool) ShouldCollapseArg ¶
func (t *ListSubagentsTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type MemoryTool ¶
type MemoryTool struct {
// contains filtered or unexported fields
}
MemoryTool implements persistent, cross-session agent memory as a directory of individual fact-files catalogued by an index (MEMORY.md). Each fact is one Markdown file with YAML frontmatter; the tool keeps the index in sync.
func NewMemoryTool ¶
func NewMemoryTool(cfg *config.Config, backend memory.MemoryBackend, proj project.Identity) *MemoryTool
NewMemoryTool creates a new memory tool. backend syncs the memory directory to a remote after a write/delete (nil-safe: a nil backend, or the local no-op backend, means no remote sync). This is the chat push path - post_session would push after every message, so the tool triggers the push instead. proj is the detected project the process runs in (zero value = global scope); it decides where project-scoped facts are filed.
func (*MemoryTool) Definition ¶
func (t *MemoryTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*MemoryTool) Execute ¶
func (t *MemoryTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the memory tool with the given arguments.
func (*MemoryTool) FormatForLLM ¶
func (t *MemoryTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with expanded structure.
func (*MemoryTool) FormatForUI ¶
func (t *MemoryTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display.
func (*MemoryTool) FormatPreview ¶
func (t *MemoryTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*MemoryTool) FormatResult ¶
func (t *MemoryTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*MemoryTool) IsEnabled ¶
func (t *MemoryTool) IsEnabled() bool
IsEnabled returns whether the memory tool is enabled.
func (*MemoryTool) Manifest ¶
func (t *MemoryTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*MemoryTool) ShouldAlwaysExpand ¶
func (t *MemoryTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI.
func (*MemoryTool) ShouldCollapseArg ¶
func (t *MemoryTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display.
type MemoryToolResult ¶
type MemoryToolResult struct {
Operation string `json:"operation"`
Name string `json:"name,omitempty"`
Type string `json:"type,omitempty"`
Project string `json:"project,omitempty"`
Description string `json:"description,omitempty"`
Path string `json:"path,omitempty"`
Content string `json:"content,omitempty"`
Message string `json:"message,omitempty"`
Size int64 `json:"size,omitempty"`
Indexed bool `json:"indexed,omitempty"`
}
MemoryToolResult represents the result of a memory tool operation.
type MultiEditTool ¶
type MultiEditTool struct {
// contains filtered or unexported fields
}
MultiEditTool handles multiple exact string replacements in a single file atomically
func NewMultiEditTool ¶
func NewMultiEditTool(cfg *config.Config) *MultiEditTool
NewMultiEditTool creates a new multi-edit tool
func NewMultiEditToolWithRegistry ¶
func NewMultiEditToolWithRegistry(cfg *config.Config, registry ReadToolTracker) *MultiEditTool
NewMultiEditToolWithRegistry creates a new multi-edit tool with a registry for read tracking
func (*MultiEditTool) Definition ¶
func (t *MultiEditTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*MultiEditTool) Execute ¶
func (t *MultiEditTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the multi-edit tool with given arguments
func (*MultiEditTool) FormatForLLM ¶
func (t *MultiEditTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*MultiEditTool) FormatForUI ¶
func (t *MultiEditTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*MultiEditTool) FormatPreview ¶
func (t *MultiEditTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MultiEditTool) FormatResult ¶
func (t *MultiEditTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MultiEditTool) IsEnabled ¶
func (t *MultiEditTool) IsEnabled() bool
IsEnabled returns whether the multi-edit tool is enabled
func (*MultiEditTool) Manifest ¶
func (t *MultiEditTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*MultiEditTool) ShouldAlwaysExpand ¶
func (t *MultiEditTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MultiEditTool) ShouldCollapseArg ¶
func (t *MultiEditTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg delegates to the formatter's collapse logic
type ParameterExtractor ¶
type ParameterExtractor struct{}
ParameterExtractor handles centralized parameter extraction and validation
func NewParameterExtractor ¶
func NewParameterExtractor() *ParameterExtractor
NewParameterExtractor creates a new ParameterExtractor
func (*ParameterExtractor) ExtractWriteParams ¶
func (p *ParameterExtractor) ExtractWriteParams(params map[string]any) (*WriteParams, error)
ExtractWriteParams extracts and validates write operation parameters
func (*ParameterExtractor) ToWriteRequest ¶
func (p *ParameterExtractor) ToWriteRequest(params *WriteParams) filewriter.WriteRequest
ToWriteRequest converts WriteParams to a filewriter.WriteRequest
type ReadSubagentScreenTool ¶
type ReadSubagentScreenTool struct {
// contains filtered or unexported fields
}
ReadSubagentScreenTool returns the raw terminal screen of an interactive subagent's tmux pane - the rendered TUI, chrome included. Unlike GetSubagentResult (which returns the clean last assistant message and refuses while the subagent is running) this is for inspecting/driving the live TUI (e.g. TUI testing), so it works regardless of the subagent's status. Read-only.
func NewReadSubagentScreenTool ¶
func NewReadSubagentScreenTool(cfg *config.Config, tracker scheddomain.SubagentTracker) *ReadSubagentScreenTool
NewReadSubagentScreenTool creates a new ReadSubagentScreen tool over the session's SubagentTracker.
func (*ReadSubagentScreenTool) Definition ¶
func (t *ReadSubagentScreenTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*ReadSubagentScreenTool) Execute ¶
func (t *ReadSubagentScreenTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute captures the named subagent's terminal screen.
func (*ReadSubagentScreenTool) FormatForLLM ¶
func (t *ReadSubagentScreenTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*ReadSubagentScreenTool) FormatPreview ¶
func (t *ReadSubagentScreenTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*ReadSubagentScreenTool) FormatResult ¶
func (t *ReadSubagentScreenTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*ReadSubagentScreenTool) IsEnabled ¶
func (t *ReadSubagentScreenTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*ReadSubagentScreenTool) Manifest ¶
func (t *ReadSubagentScreenTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*ReadSubagentScreenTool) ShouldAlwaysExpand ¶
func (t *ReadSubagentScreenTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*ReadSubagentScreenTool) ShouldCollapseArg ¶
func (t *ReadSubagentScreenTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type ReadTool ¶
type ReadTool struct {
// contains filtered or unexported fields
}
ReadTool handles file reading operations with deterministic behavior
func NewReadTool ¶
NewReadTool creates a new read tool
func (*ReadTool) Definition ¶
func (t *ReadTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*ReadTool) Execute ¶
func (t *ReadTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the read tool with given arguments
func (*ReadTool) FormatForLLM ¶
func (t *ReadTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*ReadTool) FormatForUI ¶
func (t *ReadTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*ReadTool) FormatPreview ¶
func (t *ReadTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*ReadTool) FormatResult ¶
func (t *ReadTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*ReadTool) FormatResultBody ¶
func (t *ReadTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
FormatResultBody returns the file content for the collapsed preview.
func (*ReadTool) Manifest ¶
func (t *ReadTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*ReadTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ReadTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type ReadToolTracker ¶
type ReadToolTracker interface {
IsReadToolUsed() bool
// RecordFileRead snapshots a file's modtime/size at the moment it was read (or written by us).
RecordFileRead(path string, modTime time.Time, size int64)
// LastReadInfo returns the snapshot recorded for path, and whether one exists.
LastReadInfo(path string) (modTime time.Time, size int64, known bool)
}
ReadToolTracker interface for tracking read tool usage and per-file read freshness.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry(cfg *config.Config, imageService agentdomain.ImageService, speechService agentdomain.SpeechService, musicService agentdomain.MusicService, sfxService agentdomain.SoundEffectService, videoService agentdomain.VideoService, shellService scheddomain.BackgroundShellService, annotator agentdomain.ImageAnnotator, jobs scheddomain.BackgroundTaskRegistry, stores *storage.Stores) *Registry
NewRegistry creates a new tool registry with self-contained tools. jobs is the unified BackgroundTaskRegistry the container owns, so all tools observe the same tracker the agent's wait loop does. A nil jobs leaves out the subagent tools. stores provides the storage backends for the Schedule and RequestPlanApproval tools; it may be nil when storage failed to initialize, in which case those tools fail at execution with a clear error.
func (*Registry) FrameSource ¶
func (r *Registry) FrameSource(name string) (agentdomain.FrameSource, bool)
FrameSource returns the named frame source.
func (*Registry) FrameSourceNames ¶
FrameSourceNames returns the registered source names, sorted.
func (*Registry) GetBackgroundShellService ¶
func (r *Registry) GetBackgroundShellService() scheddomain.BackgroundShellService
GetBackgroundShellService returns the background shell service instance
func (*Registry) GetTool ¶
func (r *Registry) GetTool(name string) (agentdomain.Tool, error)
GetTool retrieves a tool by name
func (*Registry) GetToolDefinitions ¶
func (r *Registry) GetToolDefinitions() []sdk.ChatCompletionTool
GetToolDefinitions returns definitions for all enabled tools, sorted by name. The order must be deterministic: it feeds both the outbound tools array and the system-prompt roster, and providers serialize tools into the cached prompt prefix — a map-order shuffle would invalidate the KV cache on every turn despite the byte-stable system prompt.
func (*Registry) IsReadToolUsed ¶
IsReadToolUsed returns whether the Read tool has been used
func (*Registry) IsToolEnabled ¶
IsToolEnabled checks if a specific tool is enabled
func (*Registry) LastReadInfo ¶
LastReadInfo returns the snapshot recorded for path (by absolute path) and whether one exists.
func (*Registry) ListAvailableTools ¶
ListAvailableTools returns names of all available and enabled tools
func (*Registry) LoadMarkdownAgents ¶
func (r *Registry) LoadMarkdownAgents()
LoadMarkdownAgents loads the Markdown subagent definitions (.infer/agents/*.md) once per session and installs them into the Agent tool, so its tool description lists them and tool-name validation runs against the tools this session registered so far. Tools registered after it, such as MCP's, are unknown to the agents.
func (*Registry) Manifest ¶
func (r *Registry) Manifest(name string) agentdomain.ToolManifest
Manifest returns the named tool's manifest, including its configured require_approval: a registered tool answers for itself, an agent tool that is not enabled falls back to its embedded manifest, and any other tool, such as an MCP tool, gets the default policy.
func (*Registry) MarkdownSubagents ¶
func (r *Registry) MarkdownSubagents() []agentdomain.SubagentInfo
MarkdownSubagents returns the Markdown-defined subagent presets loaded this session (.infer/agents/*.md, project then user home), for the /agents listing.
func (*Registry) RecordFileRead ¶
RecordFileRead snapshots a file's modtime/size, keyed by its absolute path. Called when the Read tool reads a file and refreshed after Edit/MultiEdit/Write so the agent's own writes do not look like external modifications.
func (*Registry) RegisterFrameSource ¶
func (r *Registry) RegisterFrameSource(name string, src agentdomain.FrameSource)
RegisterFrameSource adds (or replaces) a named frame source. The GetLatestFrame tool is registered statically and reports itself enabled as soon as at least one source exists, so late registration (e.g. chat starting the screenshot server) needs no re-registration machinery.
func (*Registry) RegisterTools ¶
func (r *Registry) RegisterTools(tools map[string]agentdomain.Tool)
RegisterTools installs capability tools constructed outside this package (A2A, browser use, computer use, MCP). The agent core consumes them through the agentdomain.Tool contract only; a tool that brings its own manifest also brings its policy.
func (*Registry) SetMemoryBackend ¶
func (r *Registry) SetMemoryBackend(backend memory.MemoryBackend)
SetMemoryBackend wires the memory sync backend into the Memory tool so a write/delete pushes to the remote. The container calls this after constructing the shared backend; it re-registers the Memory tool so the backend takes effect. A nil backend (or the local no-op backend) means no remote sync.
func (*Registry) SetReadToolUsed ¶
func (r *Registry) SetReadToolUsed()
SetReadToolUsed marks that the Read tool has been used. Tool calls in one assistant turn execute concurrently, so this must be safe under parallel use.
func (*Registry) UnregisterToolsWithPrefix ¶
UnregisterToolsWithPrefix removes every tool whose name starts with prefix, e.g. all tools of an MCP server that disconnected.
type RequestApprovalTool ¶
type RequestApprovalTool struct {
// contains filtered or unexported fields
}
RequestApprovalTool lets the agent ask the user to override a judge-rejected tool call: it presents the rejected call, the judge's reason and the agent's justification through the regular approval box and returns the decision, with a one-shot bypass on approval. The escalation gate is chat-only; headless runs see a nil gate and degrade with a "no approver reachable" result.
func NewRequestApprovalTool ¶
func NewRequestApprovalTool(cfg *config.Config) *RequestApprovalTool
NewRequestApprovalTool creates a new RequestApproval tool.
func (*RequestApprovalTool) Definition ¶
func (t *RequestApprovalTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*RequestApprovalTool) Execute ¶
func (t *RequestApprovalTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute escalates one judge-rejected call to the user and returns the decision. It blocks (in its own goroutine) until the user answers, dismisses, or the session is cancelled.
func (*RequestApprovalTool) FormatForLLM ¶
func (t *RequestApprovalTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*RequestApprovalTool) FormatForUI ¶
func (t *RequestApprovalTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display.
func (*RequestApprovalTool) FormatPreview ¶
func (t *RequestApprovalTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*RequestApprovalTool) FormatResult ¶
func (t *RequestApprovalTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*RequestApprovalTool) IsEnabled ¶
func (t *RequestApprovalTool) IsEnabled() bool
IsEnabled is always true: every mode advertises the same tool list so a mode switch never invalidates the provider prompt cache. Outside judge mode no rejection is tracked, so Execute answers "not_rejected".
func (*RequestApprovalTool) Manifest ¶
func (t *RequestApprovalTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*RequestApprovalTool) ShouldAlwaysExpand ¶
func (t *RequestApprovalTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand keeps the escalation outcome expanded in the conversation by default - the decision (and any user answer) is the whole point of the tool.
func (*RequestApprovalTool) ShouldCollapseArg ¶
func (t *RequestApprovalTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display.
type RequestPlanApprovalTool ¶
type RequestPlanApprovalTool struct {
// contains filtered or unexported fields
}
RequestPlanApprovalTool handles requesting plan approval from the user. On execute it persists the plan to the injected PlanStorage so users have an auditable record of every plan the agent produced - even when they reject it.
func NewRequestPlanApprovalTool ¶
func NewRequestPlanApprovalTool(cfg *config.Config, planStore storage.PlanStorage) *RequestPlanApprovalTool
NewRequestPlanApprovalTool creates a new RequestPlanApproval tool. planStore may be nil when storage failed to initialize; Execute then fails with a clear error.
func (*RequestPlanApprovalTool) Definition ¶
func (t *RequestPlanApprovalTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*RequestPlanApprovalTool) Execute ¶
func (t *RequestPlanApprovalTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the RequestPlanApproval tool with given arguments. It persists the plan to PlanStorage and returns the plan content plus an infer://plans/<id> URI so downstream consumers can surface both to the user and the LLM.
func (*RequestPlanApprovalTool) FormatForLLM ¶
func (t *RequestPlanApprovalTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*RequestPlanApprovalTool) FormatForUI ¶
func (t *RequestPlanApprovalTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*RequestPlanApprovalTool) FormatPreview ¶
func (t *RequestPlanApprovalTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*RequestPlanApprovalTool) FormatResult ¶
func (t *RequestPlanApprovalTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*RequestPlanApprovalTool) IsEnabled ¶
func (t *RequestPlanApprovalTool) IsEnabled() bool
IsEnabled returns whether the RequestPlanApproval tool is enabled
func (*RequestPlanApprovalTool) Manifest ¶
func (t *RequestPlanApprovalTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*RequestPlanApprovalTool) ShouldAlwaysExpand ¶
func (t *RequestPlanApprovalTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*RequestPlanApprovalTool) ShouldCollapseArg ¶
func (t *RequestPlanApprovalTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
func (*RequestPlanApprovalTool) Validate ¶
func (t *RequestPlanApprovalTool) Validate(args map[string]any) error
Validate checks if the RequestPlanApproval tool arguments are valid. The title is rejected up front when it contains path separators or ".." so we never even attempt to slug a malicious title.
type ScheduleTool ¶
type ScheduleTool struct {
// contains filtered or unexported fields
}
ScheduleTool lets the LLM create, inspect, and remove recurring jobs that are executed by the daemon's scheduler. Jobs are persisted through the injected storage backend; the daemon hot-reloads by polling it.
func NewScheduleTool ¶
func NewScheduleTool(cfg *config.Config, store storage.ScheduledJobStorage) *ScheduleTool
NewScheduleTool creates a new Schedule tool. store may be nil when storage failed to initialize; Execute then fails with a clear error.
func (*ScheduleTool) Definition ¶
func (t *ScheduleTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*ScheduleTool) Execute ¶
func (t *ScheduleTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the Schedule tool with the given arguments.
func (*ScheduleTool) FormatForLLM ¶
func (t *ScheduleTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM renders a structured detail block for the assistant.
func (*ScheduleTool) FormatForUI ¶
func (t *ScheduleTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI renders the tool call header with a single-line preview.
func (*ScheduleTool) FormatPreview ¶
func (t *ScheduleTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a compact one-line preview.
func (*ScheduleTool) FormatResult ¶
func (t *ScheduleTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*ScheduleTool) IsEnabled ¶
func (t *ScheduleTool) IsEnabled() bool
IsEnabled returns whether the Schedule tool is enabled.
func (*ScheduleTool) Manifest ¶
func (t *ScheduleTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*ScheduleTool) ShouldAlwaysExpand ¶
func (t *ScheduleTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand keeps the result block expanded by default.
func (*ScheduleTool) ShouldCollapseArg ¶
func (t *ScheduleTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg controls per-arg collapsing in the chat UI.
type ScheduleToolResult ¶
type ScheduleToolResult struct {
Operation string `json:"operation"`
Job *scheddomain.ScheduledJob `json:"job,omitempty"`
Jobs []*scheddomain.ScheduledJob `json:"jobs,omitempty"`
Message string `json:"message,omitempty"`
}
ScheduleToolResult is the structured payload returned to the LLM.
type SearchOptions ¶
type SearchOptions struct {
ShowLineNumbers bool
ContextBefore int
ContextAfter int
Multiline bool
GlobPattern string
FileType string
HeadLimit int
}
SearchOptions holds configuration for the search operation
type SendSubagentInputTool ¶
type SendSubagentInputTool struct {
// contains filtered or unexported fields
}
SendSubagentInputTool types text and/or named keys into an interactive subagent's tmux pane - to re-prompt it or drive its TUI. When it submits a prompt (submit=true) it re-arms the completion watcher so the main agent is notified when the subagent finishes the resulting turn (no polling).
func NewSendSubagentInputTool ¶
func NewSendSubagentInputTool(cfg *config.Config, tracker scheddomain.SubagentTracker) *SendSubagentInputTool
NewSendSubagentInputTool creates a new SendSubagentInput tool over the session's SubagentTracker.
func (*SendSubagentInputTool) Definition ¶
func (t *SendSubagentInputTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*SendSubagentInputTool) Execute ¶
func (t *SendSubagentInputTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute sends the input to the named subagent's pane.
func (*SendSubagentInputTool) FormatForLLM ¶
func (t *SendSubagentInputTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption.
func (*SendSubagentInputTool) FormatPreview ¶
func (t *SendSubagentInputTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*SendSubagentInputTool) FormatResult ¶
func (t *SendSubagentInputTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*SendSubagentInputTool) IsEnabled ¶
func (t *SendSubagentInputTool) IsEnabled() bool
IsEnabled reports whether the tool is enabled.
func (*SendSubagentInputTool) Manifest ¶
func (t *SendSubagentInputTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*SendSubagentInputTool) ShouldAlwaysExpand ¶
func (t *SendSubagentInputTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand returns whether results should always be expanded.
func (*SendSubagentInputTool) ShouldCollapseArg ¶
func (t *SendSubagentInputTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg returns whether an argument should be collapsed.
type TextToMusicTool ¶
type TextToMusicTool struct {
// contains filtered or unexported fields
}
TextToMusicTool composes music from a text prompt through the gateway's Music API and saves it as an MP3 file.
func NewTextToMusicTool ¶
func NewTextToMusicTool(cfg *config.Config, music agentdomain.MusicService) *TextToMusicTool
NewTextToMusicTool creates a new TextToMusic tool.
func (*TextToMusicTool) Definition ¶
func (t *TextToMusicTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for TextToMusic
func (*TextToMusicTool) Execute ¶
func (t *TextToMusicTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the TextToMusic tool
func (*TextToMusicTool) FormatForLLM ¶
func (t *TextToMusicTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*TextToMusicTool) FormatPreview ¶
func (t *TextToMusicTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*TextToMusicTool) FormatResult ¶
func (t *TextToMusicTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*TextToMusicTool) IsEnabled ¶
func (t *TextToMusicTool) IsEnabled() bool
IsEnabled reports whether the feature is enabled.
func (*TextToMusicTool) Manifest ¶
func (t *TextToMusicTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TextToMusicTool) ShouldAlwaysExpand ¶
func (t *TextToMusicTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TextToMusicTool) ShouldCollapseArg ¶
func (t *TextToMusicTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type TextToSFXTool ¶
type TextToSFXTool struct {
// contains filtered or unexported fields
}
TextToSFXTool generates a short sound effect or ambience clip from a text prompt through the gateway's SFX API and saves it as an MP3 file.
func NewTextToSFXTool ¶
func NewTextToSFXTool(cfg *config.Config, sfx agentdomain.SoundEffectService) *TextToSFXTool
NewTextToSFXTool creates a new TextToSFX tool.
func (*TextToSFXTool) Definition ¶
func (t *TextToSFXTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for TextToSFX
func (*TextToSFXTool) Execute ¶
func (t *TextToSFXTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the TextToSFX tool
func (*TextToSFXTool) FormatForLLM ¶
func (t *TextToSFXTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*TextToSFXTool) FormatPreview ¶
func (t *TextToSFXTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*TextToSFXTool) FormatResult ¶
func (t *TextToSFXTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*TextToSFXTool) IsEnabled ¶
func (t *TextToSFXTool) IsEnabled() bool
IsEnabled reports whether the feature is enabled.
func (*TextToSFXTool) Manifest ¶
func (t *TextToSFXTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TextToSFXTool) ShouldAlwaysExpand ¶
func (t *TextToSFXTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TextToSFXTool) ShouldCollapseArg ¶
func (t *TextToSFXTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type TextToSpeechTool ¶
type TextToSpeechTool struct {
// contains filtered or unexported fields
}
TextToSpeechTool synthesizes speech with the configured local engine and saves it to a WAV file, optionally cloning a supplied voice sample.
func NewTextToSpeechTool ¶
func NewTextToSpeechTool(cfg *config.Config, synth voiceSynthesizer) *TextToSpeechTool
NewTextToSpeechTool creates a new TextToSpeech tool.
func (*TextToSpeechTool) Definition ¶
func (t *TextToSpeechTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for TextToSpeech
func (*TextToSpeechTool) Execute ¶
func (t *TextToSpeechTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the TextToSpeech tool
func (*TextToSpeechTool) FormatForLLM ¶
func (t *TextToSpeechTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*TextToSpeechTool) FormatPreview ¶
func (t *TextToSpeechTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*TextToSpeechTool) FormatResult ¶
func (t *TextToSpeechTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*TextToSpeechTool) IsEnabled ¶
func (t *TextToSpeechTool) IsEnabled() bool
IsEnabled reports whether the feature is enabled with a supported engine.
func (*TextToSpeechTool) Manifest ¶
func (t *TextToSpeechTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TextToSpeechTool) ShouldAlwaysExpand ¶
func (t *TextToSpeechTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TextToSpeechTool) ShouldCollapseArg ¶
func (t *TextToSpeechTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type TextToVideoTool ¶
type TextToVideoTool struct {
// contains filtered or unexported fields
}
TextToVideoTool renders a video clip from a text prompt through the gateway's Videos API and saves it as an MP4 file; with a portrait and an audio clip it renders a lip-synced talking clip.
func NewTextToVideoTool ¶
func NewTextToVideoTool(cfg *config.Config, video agentdomain.VideoService) *TextToVideoTool
NewTextToVideoTool creates a new TextToVideo tool.
func (*TextToVideoTool) Definition ¶
func (t *TextToVideoTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for TextToVideo
func (*TextToVideoTool) Execute ¶
func (t *TextToVideoTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute executes the TextToVideo tool
func (*TextToVideoTool) FormatForLLM ¶
func (t *TextToVideoTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*TextToVideoTool) FormatPreview ¶
func (t *TextToVideoTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*TextToVideoTool) FormatResult ¶
func (t *TextToVideoTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*TextToVideoTool) IsEnabled ¶
func (t *TextToVideoTool) IsEnabled() bool
IsEnabled reports whether the feature is enabled.
func (*TextToVideoTool) Manifest ¶
func (t *TextToVideoTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TextToVideoTool) ShouldAlwaysExpand ¶
func (t *TextToVideoTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TextToVideoTool) ShouldCollapseArg ¶
func (t *TextToVideoTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type TodoWriteTool ¶
type TodoWriteTool struct {
// contains filtered or unexported fields
}
TodoWriteTool handles structured task list management for coding sessions
func NewTodoWriteTool ¶
func NewTodoWriteTool(cfg *config.Config) *TodoWriteTool
NewTodoWriteTool creates a new TodoWrite tool
func (*TodoWriteTool) Definition ¶
func (t *TodoWriteTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*TodoWriteTool) Execute ¶
func (t *TodoWriteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the TodoWrite tool with given arguments
func (*TodoWriteTool) FormatForLLM ¶
func (t *TodoWriteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TodoWriteTool) FormatForUI ¶
func (t *TodoWriteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display Returns minimal format as todo updates are shown in the dedicated todo component
func (*TodoWriteTool) FormatPreview ¶
func (t *TodoWriteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TodoWriteTool) FormatResult ¶
func (t *TodoWriteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*TodoWriteTool) IsEnabled ¶
func (t *TodoWriteTool) IsEnabled() bool
IsEnabled returns whether the TodoWrite tool is enabled
func (*TodoWriteTool) Manifest ¶
func (t *TodoWriteTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TodoWriteTool) ShouldAlwaysExpand ¶
func (t *TodoWriteTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI Returns false since todos are shown in the dedicated todo component
func (*TodoWriteTool) ShouldCollapseArg ¶
func (t *TodoWriteTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type TreeResult ¶
type TreeResult struct {
Path string `json:"path"`
Output string `json:"output"`
TotalFiles int `json:"total_files"`
TotalDirs int `json:"total_dirs"`
MaxDepth int `json:"max_depth"`
MaxFiles int `json:"max_files"`
ShowHidden bool `json:"show_hidden"`
Format string `json:"format"`
UsingNativeTree bool `json:"using_native_tree"`
Truncated bool `json:"truncated"`
}
TreeResult represents the internal result of a tree operation
type TreeTool ¶
type TreeTool struct {
// contains filtered or unexported fields
}
TreeTool handles directory tree visualization operations
func NewTreeTool ¶
NewTreeTool creates a new tree tool
func (*TreeTool) Definition ¶
func (t *TreeTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*TreeTool) Execute ¶
func (t *TreeTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the tree tool with given arguments
func (*TreeTool) FormatForLLM ¶
func (t *TreeTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TreeTool) FormatForUI ¶
func (t *TreeTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*TreeTool) FormatPreview ¶
func (t *TreeTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TreeTool) FormatResult ¶
func (t *TreeTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*TreeTool) FormatResultBody ¶
func (t *TreeTool) FormatResultBody(result *agentdomain.ToolExecutionResult) string
FormatResultBody returns the rendered directory tree for the collapsed preview.
func (*TreeTool) Manifest ¶
func (t *TreeTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*TreeTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TreeTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type WaitTool ¶
type WaitTool struct {
// contains filtered or unexported fields
}
WaitTool blocks inside a single tool execution until a condition is met (shells exit, file event, or check command succeeds), then returns once with the outcome. Waiting costs zero chat completions.
func NewWaitTool ¶
func NewWaitTool(cfg *config.Config, shellService scheddomain.BackgroundShellService) *WaitTool
NewWaitTool creates a new Wait tool.
func (*WaitTool) Definition ¶
func (t *WaitTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM.
func (*WaitTool) Execute ¶
func (t *WaitTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the Wait tool with given arguments.
func (*WaitTool) FormatForLLM ¶
func (t *WaitTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption. Condition details (last output, exit codes, shell states) are included even on failure so the model can see why the wait ended and decide what to do next.
func (*WaitTool) FormatForUI ¶
func (t *WaitTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display.
func (*WaitTool) FormatPreview ¶
func (t *WaitTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display.
func (*WaitTool) FormatResult ¶
func (t *WaitTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts.
func (*WaitTool) Manifest ¶
func (t *WaitTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest.
func (*WaitTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI.
func (*WaitTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display.
type WebFetchTool ¶
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool handles content fetching operations
func NewWebFetchTool ¶
func NewWebFetchTool(cfg *config.Config) *WebFetchTool
NewWebFetchTool creates a new fetch tool
func (*WebFetchTool) Definition ¶
func (t *WebFetchTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*WebFetchTool) Execute ¶
func (t *WebFetchTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the fetch tool with given arguments
func (*WebFetchTool) FormatForLLM ¶
func (t *WebFetchTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebFetchTool) FormatForUI ¶
func (t *WebFetchTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebFetchTool) FormatPreview ¶
func (t *WebFetchTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebFetchTool) FormatResult ¶
func (t *WebFetchTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*WebFetchTool) IsEnabled ¶
func (t *WebFetchTool) IsEnabled() bool
IsEnabled returns whether the fetch tool is enabled
func (*WebFetchTool) Manifest ¶
func (t *WebFetchTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*WebFetchTool) ShouldAlwaysExpand ¶
func (t *WebFetchTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WebFetchTool) ShouldCollapseArg ¶
func (t *WebFetchTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type WebSearchTool ¶
type WebSearchTool struct {
// contains filtered or unexported fields
}
WebSearchTool handles web search operations
func NewWebSearchTool ¶
func NewWebSearchTool(cfg *config.Config) *WebSearchTool
NewWebSearchTool creates a new web search tool
func (*WebSearchTool) Definition ¶
func (t *WebSearchTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*WebSearchTool) Execute ¶
func (t *WebSearchTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the web search tool with given arguments
func (*WebSearchTool) FormatForLLM ¶
func (t *WebSearchTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebSearchTool) FormatForUI ¶
func (t *WebSearchTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebSearchTool) FormatPreview ¶
func (t *WebSearchTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebSearchTool) FormatResult ¶
func (t *WebSearchTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*WebSearchTool) IsEnabled ¶
func (t *WebSearchTool) IsEnabled() bool
IsEnabled returns whether the web search tool is enabled
func (*WebSearchTool) Manifest ¶
func (t *WebSearchTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*WebSearchTool) ShouldAlwaysExpand ¶
func (t *WebSearchTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WebSearchTool) ShouldCollapseArg ¶
func (t *WebSearchTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type WriteParams ¶
WriteParams represents extracted parameters for write operations
type WriteTool ¶
type WriteTool struct {
// contains filtered or unexported fields
}
WriteTool implements a refactored WriteTool with clean architecture
func NewWriteTool ¶
NewWriteTool creates a new write tool with clean architecture
func (*WriteTool) Definition ¶
func (t *WriteTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*WriteTool) Execute ¶
func (t *WriteTool) Execute(ctx context.Context, args map[string]any) (*agentdomain.ToolExecutionResult, error)
Execute runs the write tool with given arguments
func (*WriteTool) FormatForLLM ¶
func (t *WriteTool) FormatForLLM(result *agentdomain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with expanded tree structure
func (*WriteTool) FormatForUI ¶
func (t *WriteTool) FormatForUI(result *agentdomain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WriteTool) FormatPreview ¶
func (t *WriteTool) FormatPreview(result *agentdomain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WriteTool) FormatResult ¶
func (t *WriteTool) FormatResult(result *agentdomain.ToolExecutionResult, formatType agentdomain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*WriteTool) Manifest ¶
func (t *WriteTool) Manifest() agentdomain.ToolManifest
Manifest returns the tool's manifest with its configured require_approval.
func (*WriteTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WriteTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
Source Files
¶
- agent.go
- approve_subagent.go
- ask_user_question.go
- bash.go
- bash_output.go
- close_subagent.go
- create_avatar.go
- delete.go
- edit.go
- flexmatch.go
- format_helpers.go
- formatter.go
- get_subagent_result.go
- grep.go
- image_decode.go
- image_edit.go
- image_generation.go
- image_variation.go
- kill_shell.go
- list_shells.go
- list_subagents.go
- mdagent.go
- memory.go
- multiedit.go
- params.go
- read.go
- read_subagent_screen.go
- registry.go
- request_approval.go
- request_plan_approval.go
- schedule.go
- send_subagent_input.go
- subagent_jobs.go
- text_to_music.go
- text_to_sfx.go
- text_to_speech.go
- text_to_video.go
- tmux.go
- todowrite.go
- tool_manifests.go
- tree.go
- tree_compact.go
- wait.go
- web_fetch.go
- web_search.go
- write.go