Documentation
¶
Index ¶
- Variables
- func AddBulkTodos(todos []struct{ ... }) string
- func AddTodo(title, description, priority string) string
- func AnalyzeImage(imagePath string, analysisPrompt string, analysisMode string) (string, error)
- func ArchiveCompleted() string
- func AskUser(question string) (string, error)
- func ClearLastVisionUsage()
- func ClearTodos() string
- func EditFile(ctx context.Context, filePath, oldString, newString string) (string, error)
- func ExecuteShellCommand(ctx context.Context, command string) (string, error)
- func ExecuteShellCommandWithSafety(ctx context.Context, command string, interactiveMode bool, sessionID string) (string, error)
- func FetchURL(url string, cfg *configuration.Manager) (string, error)
- func FindTodoIDByTitle(title string) (string, bool)
- func GetActiveTodosCompact() string
- func GetCommandRiskLevel(command string) string
- func GetCompletedTasks() []string
- func GetNextTodo() string
- func GetTaskSummary() string
- func GetTodoListMarkdown() string
- func GetVisionCacheStats() map[string]interface{}
- func GetVisionModelForProvider(providerType api.ClientType) string
- func HasVisionCapability() bool
- func IsFileDeletionCommand(command string) bool
- func ListAllTodos() string
- func ListTodos() string
- func ReadFile(ctx context.Context, filePath string) (string, error)
- func ReadFileWithRange(ctx context.Context, filePath string, startLine, endLine int) (string, error)
- func UpdateTodoStatus(id, status string) string
- func UpdateTodoStatusBulk(updates []struct{ ... }) string
- func ValidateBuild() (string, error)
- func WebSearch(query string, cfg *configuration.Manager) (string, error)
- func WriteFile(ctx context.Context, filePath, content string) (string, error)
- type DestructiveCommand
- type RollbackResult
- type TodoItem
- type TodoManager
- type UIElement
- type ViewHistoryResult
- type VisionAnalysis
- type VisionProcessor
- type VisionUsageInfo
Constants ¶
This section is empty.
Variables ¶
var DestructiveCommands = []DestructiveCommand{
{Pattern: `^\s*rm\s+-rf?\s+`, Description: "Recursive file deletion", RiskLevel: "high"},
{Pattern: `^\s*rm\s+-fr\s+`, Description: "Recursive file deletion", RiskLevel: "high"},
{Pattern: `^\s*rm\s+.*\*`, Description: "Wildcard file deletion", RiskLevel: "high"},
{Pattern: `^\s*rmdir\s+.*/`, Description: "Directory deletion", RiskLevel: "high"},
{Pattern: `^\s*dd\s+`, Description: "Disk/device manipulation", RiskLevel: "high"},
{Pattern: `^\s*mv\s+.*\s+/dev/null`, Description: "Redirect to /dev/null", RiskLevel: "high"},
{Pattern: `^\s*>\s+.*`, Description: "File truncation/overwrite", RiskLevel: "high"},
{Pattern: `^\s*git\s+checkout\s+`, Description: "Git checkout (potential data loss)", RiskLevel: "medium"},
{Pattern: `^\s*git\s+reset\s+--hard`, Description: "Hard git reset", RiskLevel: "medium"},
{Pattern: `^\s*git\s+clean\s+-fd`, Description: "Git clean with force", RiskLevel: "medium"},
{Pattern: `^\s*chmod\s+[0-7]{3,4}\s+`, Description: "File permission changes", RiskLevel: "medium"},
{Pattern: `^\s*chown\s+`, Description: "File ownership changes", RiskLevel: "medium"},
{Pattern: `^\s*kill\s+`, Description: "Process termination", RiskLevel: "low"},
{Pattern: `^\s*pkill\s+`, Description: "Process termination by name", RiskLevel: "low"},
{Pattern: `^\s*reboot\s+`, Description: "System reboot", RiskLevel: "low"},
{Pattern: `^\s*shutdown\s+`, Description: "System shutdown", RiskLevel: "low"},
}
DestructiveCommands is a list of patterns that match potentially destructive commands
Functions ¶
func AddBulkTodos ¶
AddBulkTodos adds multiple todo items at once
func AnalyzeImage ¶
AnalyzeImage is the tool function called by the agent for image analysis
func ArchiveCompleted ¶
func ArchiveCompleted() string
ArchiveCompleted removes completed todos from active memory to reduce context bloat
func ClearLastVisionUsage ¶
func ClearLastVisionUsage()
ClearLastVisionUsage clears the stored vision usage information
func ExecuteShellCommand ¶
ExecuteShellCommand executes a shell command with safety checks
func ExecuteShellCommandWithSafety ¶ added in v0.7.0
func ExecuteShellCommandWithSafety(ctx context.Context, command string, interactiveMode bool, sessionID string) (string, error)
ExecuteShellCommandWithSafety executes a shell command with configurable safety checks
func FetchURL ¶
func FetchURL(url string, cfg *configuration.Manager) (string, error)
FetchURL fetches content from a specific URL using the webcontent fetcher. This provides direct URL access as an agent tool.
func FindTodoIDByTitle ¶ added in v0.8.3
FindTodoIDByTitle performs a case-insensitive exact title match and returns the ID if found.
func GetActiveTodosCompact ¶
func GetActiveTodosCompact() string
GetActiveTodosCompact returns minimal format focused on current work
func GetCommandRiskLevel ¶ added in v0.7.0
GetCommandRiskLevel returns the risk level of a command
func GetCompletedTasks ¶
func GetCompletedTasks() []string
GetCompletedTasks returns a list of completed task descriptions for session continuity
func GetNextTodo ¶
func GetNextTodo() string
GetNextTodo returns the next logical todo based on current state
func GetTaskSummary ¶
func GetTaskSummary() string
GetTaskSummary generates a markdown summary of completed work
func GetTodoListMarkdown ¶ added in v0.6.0
func GetTodoListMarkdown() string
GetTodoListMarkdown returns a markdown-formatted todo list for UI display
func GetVisionCacheStats ¶
func GetVisionCacheStats() map[string]interface{}
GetVisionCacheStats returns statistics about vision result caching
func GetVisionModelForProvider ¶ added in v0.8.3
func GetVisionModelForProvider(providerType api.ClientType) string
GetVisionModelForProvider returns the appropriate vision model for a given provider
func HasVisionCapability ¶
func HasVisionCapability() bool
HasVisionCapability checks if vision processing is available
func IsFileDeletionCommand ¶ added in v0.7.0
IsFileDeletionCommand checks if a command will delete files
func ListAllTodos ¶
func ListAllTodos() string
ListAllTodos returns verbose format when full context is needed
func ListTodos ¶
func ListTodos() string
ListTodos returns a markdown-formatted list of all todos for UI display
func ReadFileWithRange ¶
func UpdateTodoStatus ¶
UpdateTodoStatus updates the status of a todo item
func UpdateTodoStatusBulk ¶
UpdateTodoStatusBulk updates multiple todos at once to reduce tool calls
func ValidateBuild ¶ added in v0.6.0
ValidateBuild runs project-specific build validation commands
Types ¶
type DestructiveCommand ¶ added in v0.7.0
type DestructiveCommand struct { Pattern string Description string RiskLevel string // "high", "medium", "low" }
DestructiveCommand represents a potentially destructive command
func IsDestructiveCommand ¶ added in v0.7.0
func IsDestructiveCommand(command string) (*DestructiveCommand, bool)
IsDestructiveCommand checks if a command is potentially destructive
type RollbackResult ¶ added in v0.8.3
RollbackResult captures the output, metadata, and success state for rollback operations.
func RollbackChanges ¶ added in v0.8.3
func RollbackChanges(revisionID string, filePath string, confirm bool) (RollbackResult, error)
RollbackChanges previews or performs a rollback for a revision or file.
type TodoItem ¶
type TodoItem struct { ID string `json:"id"` Title string `json:"title"` Description string `json:"description,omitempty"` Status string `json:"status"` // pending, in_progress, completed, cancelled Priority string `json:"priority,omitempty"` // high, medium, low CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
TodoItem represents a single todo item
type TodoManager ¶
type TodoManager struct {
// contains filtered or unexported fields
}
TodoManager manages the todo list for the current session
type UIElement ¶
type UIElement struct { Type string `json:"type"` // button, input, text, etc. Description string `json:"description"` // what it looks like Position string `json:"position"` // approximate location Issues string `json:"issues,omitempty"` // any problems noted }
UIElement represents a UI element detected in an image
type ViewHistoryResult ¶ added in v0.8.3
ViewHistoryResult captures the output and metadata for history views.
func ViewHistory ¶ added in v0.8.3
func ViewHistory(limit int, fileFilter string, since *time.Time, showContent bool) (ViewHistoryResult, error)
ViewHistory returns a formatted history view based on the provided filters.
type VisionAnalysis ¶
type VisionAnalysis struct { ImagePath string `json:"image_path"` Description string `json:"description"` Elements []UIElement `json:"elements,omitempty"` Issues []string `json:"issues,omitempty"` Suggestions []string `json:"suggestions,omitempty"` }
VisionAnalysis represents the result of vision model analysis
type VisionProcessor ¶
type VisionProcessor struct {
// contains filtered or unexported fields
}
VisionProcessor handles image analysis using vision-capable models
func NewVisionProcessorWithMode ¶
func NewVisionProcessorWithMode(debug bool, mode string) (*VisionProcessor, error)
NewVisionProcessorWithMode creates a vision processor optimized for specific analysis mode
func NewVisionProcessorWithProvider ¶ added in v0.8.3
func NewVisionProcessorWithProvider(debug bool, providerType api.ClientType) (*VisionProcessor, error)
NewVisionProcessorWithProvider creates a vision processor using the specified provider
func (*VisionProcessor) ProcessImagesInText ¶
func (vp *VisionProcessor) ProcessImagesInText(text string) (string, []VisionAnalysis, error)
ProcessImagesInText detects images in text and processes them with vision models
type VisionUsageInfo ¶
type VisionUsageInfo struct { PromptTokens int `json:"prompt_tokens"` CompletionTokens int `json:"completion_tokens"` TotalTokens int `json:"total_tokens"` EstimatedCost float64 `json:"estimated_cost"` }
VisionUsageInfo contains token usage and cost information from vision model calls
func GetLastVisionUsage ¶
func GetLastVisionUsage() *VisionUsageInfo
GetLastVisionUsage returns the usage information from the last vision model call