Documentation
¶
Index ¶
- Constants
- type BashResult
- type BashTool
- func (t *BashTool) Definition() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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 GithubTool
- func (t *GithubTool) Definition() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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 MultiEditTool
- func (t *MultiEditTool) Definition() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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) GetTool(name string) (domain.Tool, error)
- func (r *Registry) GetToolDefinitions() []domain.ToolDefinition
- func (r *Registry) IsReadToolUsed() bool
- func (r *Registry) IsToolEnabled(name string) bool
- func (r *Registry) ListAvailableTools() []string
- func (r *Registry) SetReadToolUsed()
- type SearchOptions
- type TodoWriteTool
- func (t *TodoWriteTool) Definition() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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() domain.ToolDefinition
- 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() domain.ToolDefinition
- func (t *WriteTool) Enabled() bool
- func (t *WriteTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
- 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 ¶
This section is empty.
Types ¶
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 ¶
NewBashTool creates a new bash tool
func (*BashTool) Definition ¶
func (t *BashTool) Definition() domain.ToolDefinition
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 ¶ added in v0.33.4
func (t *BashTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*BashTool) FormatForUI ¶ added in v0.33.4
func (t *BashTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*BashTool) FormatPreview ¶ added in v0.33.4
func (t *BashTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*BashTool) FormatResult ¶ added in v0.33.4
func (t *BashTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*BashTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*BashTool) ShouldCollapseArg ¶ added in v0.33.4
ShouldCollapseArg determines if an argument should be collapsed in display
type DeleteResult ¶ added in v0.18.2
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 ¶ added in v0.18.2
type DeleteTool struct {
// contains filtered or unexported fields
}
DeleteTool handles file and directory deletion operations
func NewDeleteTool ¶ added in v0.18.2
func NewDeleteTool(cfg *config.Config) *DeleteTool
NewDeleteTool creates a new delete tool
func (*DeleteTool) Definition ¶ added in v0.18.2
func (t *DeleteTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*DeleteTool) Execute ¶ added in v0.18.2
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 ¶ added in v0.33.4
func (t *DeleteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*DeleteTool) FormatForUI ¶ added in v0.33.4
func (t *DeleteTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*DeleteTool) FormatPreview ¶ added in v0.33.4
func (t *DeleteTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*DeleteTool) FormatResult ¶ added in v0.33.4
func (t *DeleteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*DeleteTool) IsEnabled ¶ added in v0.18.2
func (t *DeleteTool) IsEnabled() bool
IsEnabled returns whether the delete tool is enabled
func (*DeleteTool) ShouldAlwaysExpand ¶ added in v0.36.0
func (t *DeleteTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*DeleteTool) ShouldCollapseArg ¶ added in v0.33.4
func (t *DeleteTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type EditOperation ¶ added in v0.22.0
EditOperation represents a single edit operation
type EditTool ¶ added in v0.21.0
type EditTool struct {
// contains filtered or unexported fields
}
EditTool handles exact string replacements in files with strict safety rules
func NewEditTool ¶ added in v0.21.0
NewEditTool creates a new edit tool
func NewEditToolWithRegistry ¶ added in v0.21.0
func NewEditToolWithRegistry(cfg *config.Config, registry ReadToolTracker) *EditTool
NewEditToolWithRegistry creates a new edit tool with a registry for read tracking
func (*EditTool) Definition ¶ added in v0.21.0
func (t *EditTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*EditTool) Execute ¶ added in v0.21.0
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 ¶ added in v0.33.5
FormatArgumentsForApproval formats arguments for approval display with diff preview
func (*EditTool) FormatForLLM ¶ added in v0.33.4
func (t *EditTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*EditTool) FormatForUI ¶ added in v0.33.4
func (t *EditTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*EditTool) FormatPreview ¶ added in v0.33.4
func (t *EditTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*EditTool) FormatResult ¶ added in v0.33.4
func (t *EditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*EditTool) GetDiffInfo ¶ added in v0.38.0
func (t *EditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
GetDiffInfo implements the DiffFormatter interface
func (*EditTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*EditTool) ShouldCollapseArg ¶ added in v0.33.4
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 GithubTool ¶ added in v0.32.0
type GithubTool struct {
// contains filtered or unexported fields
}
GithubTool handles GitHub API operations
func NewGithubTool ¶ added in v0.32.0
func NewGithubTool(cfg *config.Config) *GithubTool
NewGithubTool creates a new GitHub tool
func (*GithubTool) Definition ¶ added in v0.32.0
func (t *GithubTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*GithubTool) Execute ¶ added in v0.32.0
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 ¶ added in v0.33.4
func (t *GithubTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*GithubTool) FormatForUI ¶ added in v0.33.4
func (t *GithubTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*GithubTool) FormatPreview ¶ added in v0.33.4
func (t *GithubTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GithubTool) FormatResult ¶ added in v0.33.4
func (t *GithubTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*GithubTool) IsEnabled ¶ added in v0.32.0
func (t *GithubTool) IsEnabled() bool
IsEnabled returns whether the GitHub tool is enabled
func (*GithubTool) ShouldAlwaysExpand ¶ added in v0.36.0
func (t *GithubTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GithubTool) ShouldCollapseArg ¶ added in v0.33.4
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 ¶ added in v0.19.0
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 ¶ added in v0.19.0
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 ¶ added in v0.19.0
type GrepTool struct {
// contains filtered or unexported fields
}
GrepTool handles search operations with ripgrep fallback to Go implementation
func NewGrepTool ¶ added in v0.19.0
NewGrepTool creates a new grep tool
func (*GrepTool) Definition ¶ added in v0.19.0
func (t *GrepTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*GrepTool) Execute ¶ added in v0.19.0
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 ¶ added in v0.33.4
func (t *GrepTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*GrepTool) FormatForUI ¶ added in v0.33.4
func (t *GrepTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*GrepTool) FormatPreview ¶ added in v0.33.4
func (t *GrepTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*GrepTool) FormatResult ¶ added in v0.33.4
func (t *GrepTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*GrepTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*GrepTool) ShouldCollapseArg ¶ added in v0.33.4
ShouldCollapseArg determines if an argument should be collapsed in display
type MultiEditTool ¶ added in v0.22.0
type MultiEditTool struct {
// contains filtered or unexported fields
}
MultiEditTool handles multiple exact string replacements in a single file atomically
func NewMultiEditTool ¶ added in v0.22.0
func NewMultiEditTool(cfg *config.Config) *MultiEditTool
NewMultiEditTool creates a new multi-edit tool
func NewMultiEditToolWithRegistry ¶ added in v0.22.0
func NewMultiEditToolWithRegistry(cfg *config.Config, registry ReadToolTracker) *MultiEditTool
NewMultiEditToolWithRegistry creates a new multi-edit tool with a registry for read tracking
func (*MultiEditTool) Definition ¶ added in v0.22.0
func (t *MultiEditTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*MultiEditTool) Execute ¶ added in v0.22.0
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 ¶ added in v0.33.5
func (t *MultiEditTool) FormatArgumentsForApproval(args map[string]any) string
FormatArgumentsForApproval formats arguments for approval display with diff preview
func (*MultiEditTool) FormatForLLM ¶ added in v0.33.4
func (t *MultiEditTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*MultiEditTool) FormatForUI ¶ added in v0.33.4
func (t *MultiEditTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*MultiEditTool) FormatPreview ¶ added in v0.33.4
func (t *MultiEditTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*MultiEditTool) FormatResult ¶ added in v0.33.4
func (t *MultiEditTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*MultiEditTool) GetDiffInfo ¶ added in v0.38.0
func (t *MultiEditTool) GetDiffInfo(args map[string]any) *components.DiffInfo
GetDiffInfo implements the DiffFormatter interface
func (*MultiEditTool) IsEnabled ¶ added in v0.22.0
func (t *MultiEditTool) IsEnabled() bool
IsEnabled returns whether the multi-edit tool is enabled
func (*MultiEditTool) ShouldAlwaysExpand ¶ added in v0.36.0
func (t *MultiEditTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*MultiEditTool) ShouldCollapseArg ¶ added in v0.33.4
func (t *MultiEditTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg delegates to the formatter's collapse logic
type ParameterExtractor ¶ added in v0.38.0
type ParameterExtractor struct{}
ParameterExtractor handles centralized parameter extraction and validation
func NewParameterExtractor ¶ added in v0.38.0
func NewParameterExtractor() *ParameterExtractor
NewParameterExtractor creates a new ParameterExtractor
func (*ParameterExtractor) ExtractWriteParams ¶ added in v0.38.0
func (p *ParameterExtractor) ExtractWriteParams(params map[string]interface{}) (*WriteParams, error)
ExtractWriteParams extracts and validates write operation parameters
func (*ParameterExtractor) ToWriteRequest ¶ added in v0.38.0
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() domain.ToolDefinition
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 ¶ added in v0.33.4
func (t *ReadTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*ReadTool) FormatForUI ¶ added in v0.33.4
func (t *ReadTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*ReadTool) FormatPreview ¶ added in v0.33.4
func (t *ReadTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*ReadTool) FormatResult ¶ added in v0.33.4
func (t *ReadTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*ReadTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*ReadTool) ShouldCollapseArg ¶ added in v0.33.4
ShouldCollapseArg determines if an argument should be collapsed in display
type ReadToolTracker ¶ added in v0.21.0
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 ¶
NewRegistry creates a new tool registry with self-contained tools
func (*Registry) GetToolDefinitions ¶
func (r *Registry) GetToolDefinitions() []domain.ToolDefinition
GetToolDefinitions returns definitions for all enabled tools
func (*Registry) IsReadToolUsed ¶ added in v0.21.0
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) SetReadToolUsed ¶ added in v0.21.0
func (r *Registry) SetReadToolUsed()
SetReadToolUsed marks that the Read tool has been used
type SearchOptions ¶ added in v0.19.0
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 ¶ added in v0.20.0
type TodoWriteTool struct {
// contains filtered or unexported fields
}
TodoWriteTool handles structured task list management for coding sessions
func NewTodoWriteTool ¶ added in v0.20.0
func NewTodoWriteTool(cfg *config.Config) *TodoWriteTool
NewTodoWriteTool creates a new TodoWrite tool
func (*TodoWriteTool) Definition ¶ added in v0.20.0
func (t *TodoWriteTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*TodoWriteTool) Execute ¶ added in v0.20.0
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 ¶ added in v0.33.4
func (t *TodoWriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TodoWriteTool) FormatForUI ¶ added in v0.33.4
func (t *TodoWriteTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*TodoWriteTool) FormatPreview ¶ added in v0.33.4
func (t *TodoWriteTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TodoWriteTool) FormatResult ¶ added in v0.33.4
func (t *TodoWriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*TodoWriteTool) IsEnabled ¶ added in v0.20.0
func (t *TodoWriteTool) IsEnabled() bool
IsEnabled returns whether the TodoWrite tool is enabled
func (*TodoWriteTool) ShouldAlwaysExpand ¶ added in v0.36.0
func (t *TodoWriteTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TodoWriteTool) ShouldCollapseArg ¶ added in v0.33.4
func (t *TodoWriteTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type ToolExecutionError ¶ added in v0.32.0
type ToolExecutionError struct {
Message string
}
ToolExecutionError represents an error during tool execution
func (*ToolExecutionError) Error ¶ added in v0.32.0
func (e *ToolExecutionError) Error() string
type TreeResult ¶ added in v0.16.0
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 ¶ added in v0.16.0
type TreeTool struct {
// contains filtered or unexported fields
}
TreeTool handles directory tree visualization operations
func NewTreeTool ¶ added in v0.16.0
NewTreeTool creates a new tree tool
func (*TreeTool) Definition ¶ added in v0.16.0
func (t *TreeTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*TreeTool) Execute ¶ added in v0.16.0
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 ¶ added in v0.33.4
func (t *TreeTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*TreeTool) FormatForUI ¶ added in v0.33.4
func (t *TreeTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*TreeTool) FormatPreview ¶ added in v0.33.4
func (t *TreeTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*TreeTool) FormatResult ¶ added in v0.33.4
func (t *TreeTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*TreeTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*TreeTool) ShouldCollapseArg ¶ added in v0.33.4
ShouldCollapseArg determines if an argument should be collapsed in display
type WebFetchTool ¶ added in v0.24.1
type WebFetchTool struct {
// contains filtered or unexported fields
}
WebFetchTool handles content fetching operations
func NewWebFetchTool ¶ added in v0.24.1
func NewWebFetchTool(cfg *config.Config) *WebFetchTool
NewWebFetchTool creates a new fetch tool
func (*WebFetchTool) Definition ¶ added in v0.24.1
func (t *WebFetchTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*WebFetchTool) Execute ¶ added in v0.24.1
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 ¶ added in v0.33.4
func (t *WebFetchTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebFetchTool) FormatForUI ¶ added in v0.33.4
func (t *WebFetchTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebFetchTool) FormatPreview ¶ added in v0.33.4
func (t *WebFetchTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebFetchTool) FormatResult ¶ added in v0.33.4
func (t *WebFetchTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*WebFetchTool) IsEnabled ¶ added in v0.24.1
func (t *WebFetchTool) IsEnabled() bool
IsEnabled returns whether the fetch tool is enabled
func (*WebFetchTool) ShouldAlwaysExpand ¶ added in v0.36.0
func (t *WebFetchTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WebFetchTool) ShouldCollapseArg ¶ added in v0.33.4
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() domain.ToolDefinition
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 ¶ added in v0.33.4
func (t *WebSearchTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption with detailed information
func (*WebSearchTool) FormatForUI ¶ added in v0.33.4
func (t *WebSearchTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WebSearchTool) FormatPreview ¶ added in v0.33.4
func (t *WebSearchTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WebSearchTool) FormatResult ¶ added in v0.33.4
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 ¶ added in v0.36.0
func (t *WebSearchTool) ShouldAlwaysExpand() bool
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WebSearchTool) ShouldCollapseArg ¶ added in v0.33.4
func (t *WebSearchTool) ShouldCollapseArg(key string) bool
ShouldCollapseArg determines if an argument should be collapsed in display
type WriteParams ¶ added in v0.38.0
WriteParams represents extracted parameters for write operations
type WriteTool ¶ added in v0.17.0
type WriteTool struct {
// contains filtered or unexported fields
}
WriteTool implements a refactored WriteTool with clean architecture
func NewWriteTool ¶ added in v0.17.0
NewWriteTool creates a new write tool with clean architecture
func (*WriteTool) Definition ¶ added in v0.17.0
func (t *WriteTool) Definition() domain.ToolDefinition
Definition returns the tool definition for the LLM
func (*WriteTool) Execute ¶ added in v0.17.0
func (t *WriteTool) Execute(ctx context.Context, args map[string]any) (*domain.ToolExecutionResult, error)
Execute runs the write tool with given arguments
func (*WriteTool) FormatForLLM ¶ added in v0.33.4
func (t *WriteTool) FormatForLLM(result *domain.ToolExecutionResult) string
FormatForLLM formats the result for LLM consumption
func (*WriteTool) FormatForUI ¶ added in v0.33.4
func (t *WriteTool) FormatForUI(result *domain.ToolExecutionResult) string
FormatForUI formats the result for UI display
func (*WriteTool) FormatPreview ¶ added in v0.33.4
func (t *WriteTool) FormatPreview(result *domain.ToolExecutionResult) string
FormatPreview returns a short preview of the result for UI display
func (*WriteTool) FormatResult ¶ added in v0.33.4
func (t *WriteTool) FormatResult(result *domain.ToolExecutionResult, formatType domain.FormatterType) string
FormatResult formats tool execution results for different contexts
func (*WriteTool) IsEnabled ¶ added in v0.17.0
IsEnabled returns whether the tool is enabled (interface compliance)
func (*WriteTool) ShouldAlwaysExpand ¶ added in v0.36.0
ShouldAlwaysExpand determines if tool results should always be expanded in UI
func (*WriteTool) ShouldCollapseArg ¶ added in v0.33.4
ShouldCollapseArg determines if an argument should be collapsed in display