Documentation
¶
Index ¶
- Constants
- func IsComputerUseTool(toolName string) bool
- func ScaleAPIToScreen(apiX, apiY, apiWidth, apiHeight, screenWidth, screenHeight int) (int, int)
- func ScaleScreenToAPI(screenX, screenY, screenWidth, screenHeight, apiWidth, apiHeight int) (int, int)
- type A2AQueryAgentResult
- type A2AQueryAgentTool
- func (t *A2AQueryAgentTool) Definition() sdk.ChatCompletionTool
- func (t *A2AQueryAgentTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *A2AQueryAgentTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *A2AQueryAgentTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *A2AQueryAgentTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *A2AQueryAgentTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *A2AQueryAgentTool) IsEnabled() bool
- func (t *A2AQueryAgentTool) ShouldAlwaysExpand() bool
- func (t *A2AQueryAgentTool) ShouldCollapseArg(key string) bool
- func (t *A2AQueryAgentTool) Validate(args map[string]any) error
- type A2AQueryTaskResult
- type A2AQueryTaskTool
- func (t *A2AQueryTaskTool) Definition() sdk.ChatCompletionTool
- func (t *A2AQueryTaskTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *A2AQueryTaskTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *A2AQueryTaskTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *A2AQueryTaskTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *A2AQueryTaskTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *A2AQueryTaskTool) IsEnabled() bool
- func (t *A2AQueryTaskTool) ShouldAlwaysExpand() bool
- func (t *A2AQueryTaskTool) ShouldCollapseArg(key string) bool
- func (t *A2AQueryTaskTool) Validate(args map[string]any) error
- type A2ASubmitTaskResult
- type A2ASubmitTaskTool
- func (t *A2ASubmitTaskTool) Definition() sdk.ChatCompletionTool
- func (t *A2ASubmitTaskTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *A2ASubmitTaskTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *A2ASubmitTaskTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *A2ASubmitTaskTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *A2ASubmitTaskTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *A2ASubmitTaskTool) IsEnabled() bool
- func (t *A2ASubmitTaskTool) ShouldAlwaysExpand() bool
- func (t *A2ASubmitTaskTool) ShouldCollapseArg(key string) bool
- func (t *A2ASubmitTaskTool) Validate(args map[string]any) error
- type ActivateAppTool
- func (t *ActivateAppTool) Definition() sdk.ChatCompletionTool
- func (t *ActivateAppTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *ActivateAppTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *ActivateAppTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *ActivateAppTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *ActivateAppTool) IsEnabled() bool
- func (t *ActivateAppTool) ShouldAlwaysExpand() bool
- func (t *ActivateAppTool) ShouldCollapseArg(key string) bool
- func (t *ActivateAppTool) Validate(args map[string]any) error
- type BashOutputTool
- func (t *BashOutputTool) Definition() sdk.ChatCompletionTool
- func (t *BashOutputTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *BashOutputTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *BashOutputTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *BashOutputTool) IsEnabled() bool
- 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) (*domain.ToolExecutionResult, error)
- func (t *BashTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *BashTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *BashTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *BashTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *BashTool) IsEnabled() bool
- func (t *BashTool) ShouldAlwaysExpand() bool
- func (t *BashTool) ShouldCollapseArg(key string) bool
- func (t *BashTool) Validate(args map[string]any) error
- type DeleteResult
- type DeleteTool
- func (t *DeleteTool) Definition() sdk.ChatCompletionTool
- func (t *DeleteTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *DeleteTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *DeleteTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *DeleteTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *DeleteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *DeleteTool) IsEnabled() bool
- 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) (*domain.ToolExecutionResult, error)
- func (t *EditTool) FormatArgumentsForApproval(args map[string]any) string
- func (t *EditTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *EditTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *EditTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *EditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *EditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
- func (t *EditTool) IsEnabled() bool
- func (t *EditTool) ShouldAlwaysExpand() bool
- func (t *EditTool) ShouldCollapseArg(key string) bool
- func (t *EditTool) Validate(args map[string]any) error
- type FileReadResult
- type GetFocusedAppTool
- func (t *GetFocusedAppTool) Definition() sdk.ChatCompletionTool
- func (t *GetFocusedAppTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *GetFocusedAppTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *GetFocusedAppTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *GetFocusedAppTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *GetFocusedAppTool) IsEnabled() bool
- func (t *GetFocusedAppTool) ShouldAlwaysExpand() bool
- func (t *GetFocusedAppTool) ShouldCollapseArg(key string) bool
- func (t *GetFocusedAppTool) Validate(args map[string]any) error
- type GetLatestScreenshotTool
- func (t *GetLatestScreenshotTool) Definition() sdk.ChatCompletionTool
- func (t *GetLatestScreenshotTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *GetLatestScreenshotTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *GetLatestScreenshotTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *GetLatestScreenshotTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *GetLatestScreenshotTool) IsEnabled() bool
- func (t *GetLatestScreenshotTool) ShouldAlwaysExpand() bool
- func (t *GetLatestScreenshotTool) ShouldCollapseArg(key string) bool
- func (t *GetLatestScreenshotTool) Validate(args map[string]any) error
- type GithubTool
- func (t *GithubTool) Definition() sdk.ChatCompletionTool
- func (t *GithubTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *GithubTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *GithubTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *GithubTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *GithubTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *GithubTool) IsEnabled() bool
- func (t *GithubTool) ShouldAlwaysExpand() bool
- func (t *GithubTool) ShouldCollapseArg(key string) bool
- func (t *GithubTool) 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) (*domain.ToolExecutionResult, error)
- func (t *GrepTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *GrepTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *GrepTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *GrepTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *GrepTool) IsEnabled() bool
- func (t *GrepTool) ShouldAlwaysExpand() bool
- func (t *GrepTool) ShouldCollapseArg(key string) bool
- func (t *GrepTool) Validate(args map[string]any) error
- type KeyboardTypeTool
- func (t *KeyboardTypeTool) Definition() sdk.ChatCompletionTool
- func (t *KeyboardTypeTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *KeyboardTypeTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *KeyboardTypeTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *KeyboardTypeTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *KeyboardTypeTool) IsEnabled() bool
- func (t *KeyboardTypeTool) ShouldAlwaysExpand() bool
- func (t *KeyboardTypeTool) ShouldCollapseArg(key string) bool
- func (t *KeyboardTypeTool) 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) (*domain.ToolExecutionResult, error)
- func (t *KillShellTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *KillShellTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *KillShellTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *KillShellTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *KillShellTool) IsEnabled() bool
- 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) (*domain.ToolExecutionResult, error)
- func (t *ListShellsTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *ListShellsTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *ListShellsTool) IsEnabled() bool
- func (t *ListShellsTool) ShouldAlwaysExpand() bool
- func (t *ListShellsTool) ShouldCollapseArg(key string) bool
- func (t *ListShellsTool) Validate(args map[string]any) error
- type MCPTool
- func (t *MCPTool) Definition() sdk.ChatCompletionTool
- func (t *MCPTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *MCPTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *MCPTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *MCPTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *MCPTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *MCPTool) IsEnabled() bool
- func (t *MCPTool) ShouldAlwaysExpand() bool
- func (t *MCPTool) ShouldCollapseArg(key string) bool
- func (t *MCPTool) Validate(args map[string]any) error
- type MouseClickTool
- func (t *MouseClickTool) Definition() sdk.ChatCompletionTool
- func (t *MouseClickTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *MouseClickTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *MouseClickTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *MouseClickTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *MouseClickTool) IsEnabled() bool
- func (t *MouseClickTool) ShouldAlwaysExpand() bool
- func (t *MouseClickTool) ShouldCollapseArg(key string) bool
- func (t *MouseClickTool) Validate(args map[string]any) error
- type MouseMoveTool
- func (t *MouseMoveTool) Definition() sdk.ChatCompletionTool
- func (t *MouseMoveTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *MouseMoveTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *MouseMoveTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *MouseMoveTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *MouseMoveTool) IsEnabled() bool
- func (t *MouseMoveTool) ShouldAlwaysExpand() bool
- func (t *MouseMoveTool) ShouldCollapseArg(key string) bool
- func (t *MouseMoveTool) Validate(args map[string]any) error
- type MouseScrollTool
- func (t *MouseScrollTool) Definition() sdk.ChatCompletionTool
- func (t *MouseScrollTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *MouseScrollTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *MouseScrollTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *MouseScrollTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *MouseScrollTool) IsEnabled() bool
- func (t *MouseScrollTool) ShouldAlwaysExpand() bool
- func (t *MouseScrollTool) ShouldCollapseArg(argName string) bool
- func (t *MouseScrollTool) Validate(args map[string]any) error
- type MultiEditTool
- func (t *MultiEditTool) Definition() sdk.ChatCompletionTool
- func (t *MultiEditTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *MultiEditTool) FormatArgumentsForApproval(args map[string]any) string
- func (t *MultiEditTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *MultiEditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *MultiEditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
- func (t *MultiEditTool) IsEnabled() bool
- func (t *MultiEditTool) ShouldAlwaysExpand() bool
- func (t *MultiEditTool) ShouldCollapseArg(key string) bool
- func (t *MultiEditTool) Validate(args map[string]any) error
- type ParameterExtractor
- type ReadTool
- func (t *ReadTool) Definition() sdk.ChatCompletionTool
- func (t *ReadTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *ReadTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *ReadTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *ReadTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *ReadTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *ReadTool) IsEnabled() bool
- 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) GetBackgroundShellService() domain.BackgroundShellService
- func (r *Registry) GetTaskTracker() domain.TaskTracker
- func (r *Registry) GetTool(name string) (domain.Tool, error)
- func (r *Registry) GetToolDefinitions() []sdk.ChatCompletionTool
- func (r *Registry) IsReadToolUsed() bool
- func (r *Registry) IsToolEnabled(name string) bool
- func (r *Registry) ListAvailableTools() []string
- func (r *Registry) RegisterMCPServerTools(serverName string, tools []domain.MCPDiscoveredTool) int
- func (r *Registry) SetReadToolUsed()
- func (r *Registry) SetScreenshotProvider(provider domain.ScreenshotProvider)
- func (r *Registry) SetScreenshotServer(provider domain.ScreenshotProvider)
- func (r *Registry) UnregisterMCPServerTools(serverName string) int
- type RequestPlanApprovalTool
- func (t *RequestPlanApprovalTool) Definition() sdk.ChatCompletionTool
- func (t *RequestPlanApprovalTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *RequestPlanApprovalTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *RequestPlanApprovalTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *RequestPlanApprovalTool) IsEnabled() bool
- func (t *RequestPlanApprovalTool) ShouldAlwaysExpand() bool
- func (t *RequestPlanApprovalTool) ShouldCollapseArg(key string) bool
- func (t *RequestPlanApprovalTool) Validate(args map[string]any) error
- type SearchOptions
- type TodoWriteTool
- func (t *TodoWriteTool) Definition() sdk.ChatCompletionTool
- func (t *TodoWriteTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *TodoWriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *TodoWriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *TodoWriteTool) IsEnabled() bool
- func (t *TodoWriteTool) ShouldAlwaysExpand() bool
- func (t *TodoWriteTool) ShouldCollapseArg(key string) bool
- func (t *TodoWriteTool) Validate(args map[string]any) error
- type ToolExecutionError
- type TreeResult
- type TreeTool
- func (t *TreeTool) Definition() sdk.ChatCompletionTool
- func (t *TreeTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- func (t *TreeTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *TreeTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *TreeTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *TreeTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *TreeTool) IsEnabled() bool
- func (t *TreeTool) ShouldAlwaysExpand() bool
- func (t *TreeTool) ShouldCollapseArg(key string) bool
- func (t *TreeTool) 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) (*domain.ToolExecutionResult, error)
- func (t *WebFetchTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *WebFetchTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *WebFetchTool) IsEnabled() bool
- 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) (*domain.ToolExecutionResult, error)
- func (t *WebSearchTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *WebSearchTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *WebSearchTool) IsEnabled() bool
- 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) (*domain.ToolExecutionResult, error)
- func (t *WriteTool) FormatArgumentsForApproval(args map[string]any) string
- func (t *WriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
- func (t *WriteTool) FormatForUI(result *domain.ToolExecutionResult) string
- func (t *WriteTool) FormatPreview(result *domain.ToolExecutionResult) string
- func (t *WriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
- func (t *WriteTool) IsEnabled() bool
- func (t *WriteTool) ShouldAlwaysExpand() bool
- func (t *WriteTool) ShouldCollapseArg(key string) bool
- func (t *WriteTool) Validate(args map[string]any) error
Constants ¶
const ( ErrorNotAbsolutePath = "NOT_ABSOLUTE_PATH" 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 ( ToolName = "Write" DefaultFormat = "text" JSONFormat = "json" )
Variables ¶
This section is empty.
Functions ¶
func IsComputerUseTool ¶
IsComputerUseTool returns true if the given tool name is a computer use tool Computer use tools operate directly on the computer (mouse, keyboard, screenshot) and bypass the standard approval flow
func ScaleAPIToScreen ¶
ScaleAPIToScreen converts coordinates from API space (Claude's screenshot) to screen space (actual display) using Anthropic's proportional scaling approach.
This implementation follows the official Anthropic computer-use-demo strategy: - Simple proportional scaling with separate X/Y factors - No letterboxing - screenshots are force-resized to exact dimensions - Handles aspect ratio mismatches automatically through independent scaling
Parameters:
- apiX, apiY: Coordinates from Claude's response (in screenshot space)
- apiWidth, apiHeight: Target screenshot dimensions (e.g., 1024x768)
- screenWidth, screenHeight: Actual logical screen dimensions
Returns:
- screenX, screenY: Coordinates in actual screen space for mouse operations
Example:
API screenshot: 1024x768 Actual screen: 2048x1536 API coordinate (512, 384) → Screen coordinate (1024, 768)
func ScaleScreenToAPI ¶
func ScaleScreenToAPI(screenX, screenY, screenWidth, screenHeight, apiWidth, apiHeight int) (int, int)
ScaleScreenToAPI converts coordinates from screen space to API space. This is the inverse of ScaleAPIToScreen and is used when capturing screenshots.
Parameters:
- screenX, screenY: Coordinates in actual screen space
- screenWidth, screenHeight: Actual logical screen dimensions
- apiWidth, apiHeight: Target screenshot dimensions
Returns:
- apiX, apiY: Coordinates in API/screenshot space
Types ¶
type A2AQueryAgentResult ¶
type A2AQueryAgentTool ¶
type A2AQueryAgentTool struct {
// contains filtered or unexported fields
}
func NewA2AQueryAgentTool ¶
func NewA2AQueryAgentTool(cfg *config.Config) *A2AQueryAgentTool
func (*A2AQueryAgentTool) Definition ¶
func (t *A2AQueryAgentTool) Definition() sdk.ChatCompletionTool
func (*A2AQueryAgentTool) Execute ¶
func (t *A2AQueryAgentTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
func (*A2AQueryAgentTool) FormatForLLM ¶
func (t *A2AQueryAgentTool) FormatForLLM(result *domain.ToolExecutionResult) string
func (*A2AQueryAgentTool) FormatForUI ¶
func (t *A2AQueryAgentTool) FormatForUI(result *domain.ToolExecutionResult) string
func (*A2AQueryAgentTool) FormatPreview ¶
func (t *A2AQueryAgentTool) FormatPreview(result *domain.ToolExecutionResult) string
func (*A2AQueryAgentTool) FormatResult ¶
func (t *A2AQueryAgentTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
func (*A2AQueryAgentTool) IsEnabled ¶
func (t *A2AQueryAgentTool) IsEnabled() bool
func (*A2AQueryAgentTool) ShouldAlwaysExpand ¶
func (t *A2AQueryAgentTool) ShouldAlwaysExpand() bool
func (*A2AQueryAgentTool) ShouldCollapseArg ¶
func (t *A2AQueryAgentTool) ShouldCollapseArg(key string) bool
type A2AQueryTaskResult ¶
type A2AQueryTaskTool ¶
type A2AQueryTaskTool struct {
// contains filtered or unexported fields
}
func NewA2AQueryTaskTool ¶
func NewA2AQueryTaskTool(cfg *config.Config, taskTracker domain.TaskTracker) *A2AQueryTaskTool
func (*A2AQueryTaskTool) Definition ¶
func (t *A2AQueryTaskTool) Definition() sdk.ChatCompletionTool
func (*A2AQueryTaskTool) Execute ¶
func (t *A2AQueryTaskTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
func (*A2AQueryTaskTool) FormatForLLM ¶
func (t *A2AQueryTaskTool) FormatForLLM(result *domain.ToolExecutionResult) string
func (*A2AQueryTaskTool) FormatForUI ¶
func (t *A2AQueryTaskTool) FormatForUI(result *domain.ToolExecutionResult) string
func (*A2AQueryTaskTool) FormatPreview ¶
func (t *A2AQueryTaskTool) FormatPreview(result *domain.ToolExecutionResult) string
func (*A2AQueryTaskTool) FormatResult ¶
func (t *A2AQueryTaskTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
func (*A2AQueryTaskTool) IsEnabled ¶
func (t *A2AQueryTaskTool) IsEnabled() bool
func (*A2AQueryTaskTool) ShouldAlwaysExpand ¶
func (t *A2AQueryTaskTool) ShouldAlwaysExpand() bool
func (*A2AQueryTaskTool) ShouldCollapseArg ¶
func (t *A2AQueryTaskTool) ShouldCollapseArg(key string) bool
type A2ASubmitTaskResult ¶
type A2ASubmitTaskResult struct {
TaskID string `json:"task_id"`
ContextID string `json:"context_id,omitempty"`
AgentURL string `json:"agent_url"`
State string `json:"state"`
Message string `json:"message"`
TaskResult string `json:"task_result,omitempty"`
Success bool `json:"success"`
Task *adk.Task `json:"task,omitempty"`
}
A2ASubmitTaskResult represents the result of an A2A task operation
type A2ASubmitTaskTool ¶
type A2ASubmitTaskTool struct {
// contains filtered or unexported fields
}
A2ASubmitTaskTool handles A2A task submission and management
func NewA2ASubmitTaskTool ¶
func NewA2ASubmitTaskTool(cfg *config.Config, taskTracker domain.TaskTracker) *A2ASubmitTaskTool
NewA2ASubmitTaskTool creates a new A2A task tool
func NewA2ASubmitTaskToolWithClient ¶
func NewA2ASubmitTaskToolWithClient(cfg *config.Config, taskTracker domain.TaskTracker, client client.A2AClient) *A2ASubmitTaskTool
NewA2ASubmitTaskToolWithClient creates a new A2A task tool with an injected client (for testing)
func (*A2ASubmitTaskTool) Definition ¶
func (t *A2ASubmitTaskTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*A2ASubmitTaskTool) Execute ¶
func (t *A2ASubmitTaskTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the tool with given arguments
func (*A2ASubmitTaskTool) FormatForLLM ¶
func (t *A2ASubmitTaskTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*A2ASubmitTaskTool) FormatForUI ¶
func (t *A2ASubmitTaskTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*A2ASubmitTaskTool) FormatPreview ¶
func (t *A2ASubmitTaskTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*A2ASubmitTaskTool) FormatResult ¶
func (t *A2ASubmitTaskTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*A2ASubmitTaskTool) IsEnabled ¶
func (t *A2ASubmitTaskTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled
func (*A2ASubmitTaskTool) ShouldAlwaysExpand ¶
func (t *A2ASubmitTaskTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*A2ASubmitTaskTool) ShouldCollapseArg ¶
func (t *A2ASubmitTaskTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type ActivateAppTool ¶
type ActivateAppTool struct {
// contains filtered or unexported fields
}
ActivateAppTool switches focus to a specific application
func NewActivateAppTool ¶
func NewActivateAppTool(config domain.ConfigService) *ActivateAppTool
NewActivateAppTool creates a new ActivateApp tool
func (*ActivateAppTool) Definition ¶
func (t *ActivateAppTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for ActivateApp
func (*ActivateAppTool) Execute ¶
func (t *ActivateAppTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute executes the ActivateApp tool
func (*ActivateAppTool) FormatForLLM ¶
func (t *ActivateAppTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*ActivateAppTool) FormatPreview ¶
func (t *ActivateAppTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*ActivateAppTool) FormatResult ¶
func (t *ActivateAppTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*ActivateAppTool) IsEnabled ¶
func (t *ActivateAppTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*ActivateAppTool) ShouldAlwaysExpand ¶
func (t *ActivateAppTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ActivateAppTool) ShouldCollapseArg ¶
func (t *ActivateAppTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
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 domain.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) (*domain.ToolExecutionResult, error)
Execute retrieves output from a background shell
func (*BashOutputTool) FormatForLLM ¶
func (t *BashOutputTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*BashOutputTool) FormatForUI ¶
func (t *BashOutputTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*BashOutputTool) FormatPreview ¶
func (t *BashOutputTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*BashOutputTool) FormatResult ¶
func (t *BashOutputTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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 domain.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
func (*BashTool) Execute ¶
func (t *BashTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the bash tool with given arguments
func (*BashTool) FormatForLLM ¶
func (t *BashTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*BashTool) FormatForUI ¶
func (t *BashTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*BashTool) FormatPreview ¶
func (t *BashTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*BashTool) FormatResult ¶
func (t *BashTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
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 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) (*domain.ToolExecutionResult, error)
Execute runs the delete tool with given arguments
func (*DeleteTool) FormatForLLM ¶
func (t *DeleteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*DeleteTool) FormatForUI ¶
func (t *DeleteTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*DeleteTool) FormatPreview ¶
func (t *DeleteTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*DeleteTool) FormatResult ¶
func (t *DeleteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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) (*domain.ToolExecutionResult, error)
Execute runs the edit tool with given arguments
func (*EditTool) FormatArgumentsForApproval ¶
FormatArgumentsForApproval formats arguments for approval display with diff preview
func (*EditTool) FormatForLLM ¶
func (t *EditTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*EditTool) FormatForUI ¶
func (t *EditTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*EditTool) FormatPreview ¶
func (t *EditTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*EditTool) FormatResult ¶
func (t *EditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*EditTool) GetDiffInfo ¶
func (t *EditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
GetDiffInfo implements the DiffFormatter interface
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 GetFocusedAppTool ¶
type GetFocusedAppTool struct {
// contains filtered or unexported fields
}
GetFocusedAppTool gets the currently focused application
func NewGetFocusedAppTool ¶
func NewGetFocusedAppTool(config domain.ConfigService) *GetFocusedAppTool
NewGetFocusedAppTool creates a new GetFocusedApp tool
func (*GetFocusedAppTool) Definition ¶
func (t *GetFocusedAppTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for GetFocusedApp
func (*GetFocusedAppTool) Execute ¶
func (t *GetFocusedAppTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute executes the GetFocusedApp tool
func (*GetFocusedAppTool) FormatForLLM ¶
func (t *GetFocusedAppTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*GetFocusedAppTool) FormatPreview ¶
func (t *GetFocusedAppTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview formats the result for display preview
func (*GetFocusedAppTool) FormatResult ¶
func (t *GetFocusedAppTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*GetFocusedAppTool) IsEnabled ¶
func (t *GetFocusedAppTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*GetFocusedAppTool) ShouldAlwaysExpand ¶
func (t *GetFocusedAppTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GetFocusedAppTool) ShouldCollapseArg ¶
func (t *GetFocusedAppTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type GetLatestScreenshotTool ¶
type GetLatestScreenshotTool struct {
// contains filtered or unexported fields
}
GetLatestScreenshotTool retrieves the latest screenshot from the circular buffer This tool is used when screenshot streaming is enabled to avoid redundant captures
func NewGetLatestScreenshotTool ¶
func NewGetLatestScreenshotTool(cfg *config.Config, provider domain.ScreenshotProvider) *GetLatestScreenshotTool
NewGetLatestScreenshotTool creates a new tool that reads from the screenshot buffer
func (*GetLatestScreenshotTool) Definition ¶
func (t *GetLatestScreenshotTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*GetLatestScreenshotTool) Execute ¶
func (t *GetLatestScreenshotTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute retrieves the latest screenshot from the buffer
func (*GetLatestScreenshotTool) FormatForLLM ¶
func (t *GetLatestScreenshotTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*GetLatestScreenshotTool) FormatPreview ¶
func (t *GetLatestScreenshotTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GetLatestScreenshotTool) FormatResult ¶
func (t *GetLatestScreenshotTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*GetLatestScreenshotTool) IsEnabled ¶
func (t *GetLatestScreenshotTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled
func (*GetLatestScreenshotTool) ShouldAlwaysExpand ¶
func (t *GetLatestScreenshotTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GetLatestScreenshotTool) ShouldCollapseArg ¶
func (t *GetLatestScreenshotTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type GithubTool ¶
type GithubTool struct {
// contains filtered or unexported fields
}
GithubTool handles GitHub API operations
func NewGithubTool ¶
func NewGithubTool(cfg *config.Config, imageService domain.ImageService) *GithubTool
NewGithubTool creates a new GitHub tool
func (*GithubTool) Definition ¶
func (t *GithubTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*GithubTool) Execute ¶
func (t *GithubTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the GitHub tool with given arguments
func (*GithubTool) FormatForLLM ¶
func (t *GithubTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*GithubTool) FormatForUI ¶
func (t *GithubTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*GithubTool) FormatPreview ¶
func (t *GithubTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GithubTool) FormatResult ¶
func (t *GithubTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*GithubTool) IsEnabled ¶
func (t *GithubTool) IsEnabled() bool
IsEnabled returns whether the GitHub tool is enabled
func (*GithubTool) ShouldAlwaysExpand ¶
func (t *GithubTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GithubTool) ShouldCollapseArg ¶
func (t *GithubTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
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) (*domain.ToolExecutionResult, error)
Execute runs the grep tool with given arguments
func (*GrepTool) FormatForLLM ¶
func (t *GrepTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*GrepTool) FormatForUI ¶
func (t *GrepTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*GrepTool) FormatPreview ¶
func (t *GrepTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GrepTool) FormatResult ¶
func (t *GrepTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
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 KeyboardTypeTool ¶
type KeyboardTypeTool struct {
// contains filtered or unexported fields
}
KeyboardTypeTool types text or sends key combinations
func NewKeyboardTypeTool ¶
func NewKeyboardTypeTool(cfg *config.Config, rateLimiter domain.RateLimiter, displayProvider display.Provider) *KeyboardTypeTool
NewKeyboardTypeTool creates a new keyboard type tool
func (*KeyboardTypeTool) Definition ¶
func (t *KeyboardTypeTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*KeyboardTypeTool) Execute ¶
func (t *KeyboardTypeTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the keyboard type tool with given arguments
func (*KeyboardTypeTool) FormatForLLM ¶
func (t *KeyboardTypeTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*KeyboardTypeTool) FormatPreview ¶
func (t *KeyboardTypeTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*KeyboardTypeTool) FormatResult ¶
func (t *KeyboardTypeTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*KeyboardTypeTool) IsEnabled ¶
func (t *KeyboardTypeTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled
func (*KeyboardTypeTool) ShouldAlwaysExpand ¶
func (t *KeyboardTypeTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*KeyboardTypeTool) ShouldCollapseArg ¶
func (t *KeyboardTypeTool) 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 domain.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) (*domain.ToolExecutionResult, error)
Execute cancels a background shell
func (*KillShellTool) FormatForLLM ¶
func (t *KillShellTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*KillShellTool) FormatForUI ¶
func (t *KillShellTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*KillShellTool) FormatPreview ¶
func (t *KillShellTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*KillShellTool) FormatResult ¶
func (t *KillShellTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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 domain.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) (*domain.ToolExecutionResult, error)
Execute lists all background shells
func (*ListShellsTool) FormatPreview ¶
func (t *ListShellsTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview
func (*ListShellsTool) FormatResult ¶
func (t *ListShellsTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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 MCPTool ¶
type MCPTool struct {
// contains filtered or unexported fields
}
MCPTool wraps an MCP server tool to implement the domain.Tool interface
func NewMCPTool ¶
func NewMCPTool( serverName, toolName, description string, inputSchema any, clientManager domain.MCPClient, mcpConfig *config.MCPConfig, ) *MCPTool
NewMCPTool creates a new MCP tool wrapper
func (*MCPTool) Definition ¶
func (t *MCPTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*MCPTool) Execute ¶
func (t *MCPTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the MCP tool with given arguments
func (*MCPTool) FormatForLLM ¶
func (t *MCPTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*MCPTool) FormatForUI ¶
func (t *MCPTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*MCPTool) FormatPreview ¶
func (t *MCPTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MCPTool) FormatResult ¶
func (t *MCPTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MCPTool) ShouldAlwaysExpand ¶
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MCPTool) ShouldCollapseArg ¶
ShouldCollapseArg determines if an argument should be collapsed in display
type MouseClickTool ¶
type MouseClickTool struct {
// contains filtered or unexported fields
}
MouseClickTool performs mouse clicks
func NewMouseClickTool ¶
func NewMouseClickTool(cfg *config.Config, rateLimiter domain.RateLimiter, displayProvider display.Provider, stateManager domain.StateManager) *MouseClickTool
NewMouseClickTool creates a new mouse click tool
func (*MouseClickTool) Definition ¶
func (t *MouseClickTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*MouseClickTool) Execute ¶
func (t *MouseClickTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the mouse click tool with given arguments
func (*MouseClickTool) FormatForLLM ¶
func (t *MouseClickTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*MouseClickTool) FormatPreview ¶
func (t *MouseClickTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MouseClickTool) FormatResult ¶
func (t *MouseClickTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MouseClickTool) IsEnabled ¶
func (t *MouseClickTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled
func (*MouseClickTool) ShouldAlwaysExpand ¶
func (t *MouseClickTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MouseClickTool) ShouldCollapseArg ¶
func (t *MouseClickTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type MouseMoveTool ¶
type MouseMoveTool struct {
// contains filtered or unexported fields
}
MouseMoveTool moves the mouse cursor to specified coordinates
func NewMouseMoveTool ¶
func NewMouseMoveTool(cfg *config.Config, rateLimiter domain.RateLimiter, displayProvider display.Provider, stateManager domain.StateManager) *MouseMoveTool
NewMouseMoveTool creates a new mouse move tool
func (*MouseMoveTool) Definition ¶
func (t *MouseMoveTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*MouseMoveTool) Execute ¶
func (t *MouseMoveTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the mouse move tool with given arguments
func (*MouseMoveTool) FormatForLLM ¶
func (t *MouseMoveTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*MouseMoveTool) FormatPreview ¶
func (t *MouseMoveTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MouseMoveTool) FormatResult ¶
func (t *MouseMoveTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MouseMoveTool) IsEnabled ¶
func (t *MouseMoveTool) IsEnabled() bool
IsEnabled returns whether this tool is enabled
func (*MouseMoveTool) ShouldAlwaysExpand ¶
func (t *MouseMoveTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MouseMoveTool) ShouldCollapseArg ¶
func (t *MouseMoveTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type MouseScrollTool ¶
type MouseScrollTool struct {
// contains filtered or unexported fields
}
MouseScrollTool scrolls the mouse wheel
func NewMouseScrollTool ¶
func NewMouseScrollTool(cfg *config.Config, rateLimiter domain.RateLimiter, displayProvider display.Provider) *MouseScrollTool
NewMouseScrollTool creates a new mouse scroll tool
func (*MouseScrollTool) Definition ¶
func (t *MouseScrollTool) Definition() sdk.ChatCompletionTool
Definition returns the tool definition for the LLM
func (*MouseScrollTool) Execute ¶
func (t *MouseScrollTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the mouse scroll tool with given arguments
func (*MouseScrollTool) FormatForLLM ¶
func (t *MouseScrollTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*MouseScrollTool) FormatPreview ¶
func (t *MouseScrollTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview formats a short preview of tool execution
func (*MouseScrollTool) FormatResult ¶
func (t *MouseScrollTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats the result based on the requested format type
func (*MouseScrollTool) IsEnabled ¶
func (t *MouseScrollTool) IsEnabled() bool
IsEnabled returns whether the tool is enabled
func (*MouseScrollTool) ShouldAlwaysExpand ¶
func (t *MouseScrollTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MouseScrollTool) ShouldCollapseArg ¶
func (t *MouseScrollTool) ShouldCollapseArg(argName string) bool
ShouldCollapseArg determines if an argument should be collapsed in UI
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) (*domain.ToolExecutionResult, error)
Execute runs the multi-edit tool with given arguments
func (*MultiEditTool) FormatArgumentsForApproval ¶
func (t *MultiEditTool) FormatArgumentsForApproval(args map[string]any) string
FormatArgumentsForApproval formats arguments for approval display with diff preview
func (*MultiEditTool) FormatForLLM ¶
func (t *MultiEditTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*MultiEditTool) FormatForUI ¶
func (t *MultiEditTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*MultiEditTool) FormatPreview ¶
func (t *MultiEditTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MultiEditTool) FormatResult ¶
func (t *MultiEditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MultiEditTool) GetDiffInfo ¶
func (t *MultiEditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
GetDiffInfo implements the DiffFormatter interface
func (*MultiEditTool) IsEnabled ¶
func (t *MultiEditTool) IsEnabled() bool
IsEnabled returns whether the multi-edit tool is enabled
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 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) (*domain.ToolExecutionResult, error)
Execute runs the read tool with given arguments
func (*ReadTool) FormatForLLM ¶
func (t *ReadTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*ReadTool) FormatForUI ¶
func (t *ReadTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*ReadTool) FormatPreview ¶
func (t *ReadTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*ReadTool) FormatResult ¶
func (t *ReadTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
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
}
ReadToolTracker interface for tracking read tool usage
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages all available tools
func NewRegistry ¶
func NewRegistry(cfg domain.ConfigService, imageService domain.ImageService, mcpManager domain.MCPManager, shellService domain.BackgroundShellService, stateManager domain.StateManager, screenshotProvider domain.ScreenshotProvider) *Registry
NewRegistry creates a new tool registry with self-contained tools
func (*Registry) GetBackgroundShellService ¶
func (r *Registry) GetBackgroundShellService() domain.BackgroundShellService
GetBackgroundShellService returns the background shell service instance
func (*Registry) GetTaskTracker ¶
func (r *Registry) GetTaskTracker() domain.TaskTracker
GetTaskTracker returns the task tracker instance
func (*Registry) GetToolDefinitions ¶
func (r *Registry) GetToolDefinitions() []sdk.ChatCompletionTool
GetToolDefinitions returns definitions for all enabled tools
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) ListAvailableTools ¶
ListAvailableTools returns names of all available and enabled tools
func (*Registry) RegisterMCPServerTools ¶
func (r *Registry) RegisterMCPServerTools(serverName string, tools []domain.MCPDiscoveredTool) int
RegisterMCPServerTools dynamically registers tools from an MCP server
func (*Registry) SetReadToolUsed ¶
func (r *Registry) SetReadToolUsed()
SetReadToolUsed marks that the Read tool has been used
func (*Registry) SetScreenshotProvider ¶
func (r *Registry) SetScreenshotProvider(provider domain.ScreenshotProvider)
SetScreenshotProvider updates the screenshot provider for tools that need it
func (*Registry) SetScreenshotServer ¶
func (r *Registry) SetScreenshotServer(provider domain.ScreenshotProvider)
SetScreenshotServer dynamically registers the GetLatestScreenshot tool This should be called after the screenshot server is started
func (*Registry) UnregisterMCPServerTools ¶
UnregisterMCPServerTools removes all tools from a specific MCP server
type RequestPlanApprovalTool ¶
type RequestPlanApprovalTool struct {
// contains filtered or unexported fields
}
RequestPlanApprovalTool handles requesting plan approval from the user
func NewRequestPlanApprovalTool ¶
func NewRequestPlanApprovalTool(cfg *config.Config) *RequestPlanApprovalTool
NewRequestPlanApprovalTool creates a new RequestPlanApproval tool
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) (*domain.ToolExecutionResult, error)
Execute runs the RequestPlanApproval tool with given arguments
func (*RequestPlanApprovalTool) FormatForLLM ¶
func (t *RequestPlanApprovalTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*RequestPlanApprovalTool) FormatForUI ¶
func (t *RequestPlanApprovalTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*RequestPlanApprovalTool) FormatPreview ¶
func (t *RequestPlanApprovalTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*RequestPlanApprovalTool) FormatResult ¶
func (t *RequestPlanApprovalTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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
type SearchOptions ¶
type SearchOptions struct {
CaseInsensitive bool
ShowLineNumbers bool
ContextBefore int
ContextAfter int
Multiline bool
GlobPattern string
FileType string
HeadLimit int
}
SearchOptions holds configuration for the search operation
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) (*domain.ToolExecutionResult, error)
Execute runs the TodoWrite tool with given arguments
func (*TodoWriteTool) FormatForLLM ¶
func (t *TodoWriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TodoWriteTool) FormatForUI ¶
func (t *TodoWriteTool) FormatForUI(result *domain.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 *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TodoWriteTool) FormatResult ¶
func (t *TodoWriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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 ToolExecutionError ¶
type ToolExecutionError struct {
Message string
}
ToolExecutionError represents an error during tool execution
func (*ToolExecutionError) Error ¶
func (e *ToolExecutionError) Error() string
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) (*domain.ToolExecutionResult, error)
Execute runs the tree tool with given arguments
func (*TreeTool) FormatForLLM ¶
func (t *TreeTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TreeTool) FormatForUI ¶
func (t *TreeTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*TreeTool) FormatPreview ¶
func (t *TreeTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TreeTool) FormatResult ¶
func (t *TreeTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
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 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) (*domain.ToolExecutionResult, error)
Execute runs the fetch tool with given arguments
func (*WebFetchTool) FormatForLLM ¶
func (t *WebFetchTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebFetchTool) FormatForUI ¶
func (t *WebFetchTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebFetchTool) FormatPreview ¶
func (t *WebFetchTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebFetchTool) FormatResult ¶
func (t *WebFetchTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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) (*domain.ToolExecutionResult, error)
Execute runs the web search tool with given arguments
func (*WebSearchTool) FormatForLLM ¶
func (t *WebSearchTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebSearchTool) FormatForUI ¶
func (t *WebSearchTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebSearchTool) FormatPreview ¶
func (t *WebSearchTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebSearchTool) FormatResult ¶
func (t *WebSearchTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.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) 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) (*domain.ToolExecutionResult, error)
Execute runs the write tool with given arguments
func (*WriteTool) FormatArgumentsForApproval ¶
FormatArgumentsForApproval formats arguments for approval display with content preview
func (*WriteTool) FormatForLLM ¶
func (t *WriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with expanded tree structure
func (*WriteTool) FormatForUI ¶
func (t *WriteTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WriteTool) FormatPreview ¶
func (t *WriteTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WriteTool) FormatResult ¶
func (t *WriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
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
¶
- a2a_query_agent.go
- a2a_query_task.go
- a2a_task.go
- activate_app.go
- bash.go
- bash_output.go
- coordinate_scaler.go
- delete.go
- edit.go
- get_focused_app.go
- get_latest_screenshot.go
- github.go
- grep.go
- keyboard_type.go
- kill_shell.go
- list_shells.go
- mcp_tool.go
- mouse_click.go
- mouse_move.go
- mouse_scroll.go
- multiedit.go
- params.go
- read.go
- registry.go
- request_plan_approval.go
- todowrite.go
- tree.go
- web_fetch.go
- web_search.go
- write.go