Documentation
¶
Index ¶
- Constants
- func AutoCommit(path, toolName, description string) error
- func BackupFile(path string) (string, error)
- func DecodeFileContent(data []byte) (string, error)
- func DetectCredentials(content string) string
- func FormatAuditSummary() string
- func IsBinaryContent(data []byte) bool
- func IsBinaryData(data []byte) bool
- func IsDestructiveCommand(command string) bool
- func IsGitRepo() bool
- func IsPlanMode() bool
- func IsPowerShellAvailable() bool
- func IsSafeGitCommit(command string) bool
- func IsSensitivePath(path string) string
- func IsSuspicious(command string) bool
- func LastAutoCommitHash() string
- func ListBackups(path string) []string
- func RecordFileDelete(toolName, path string)
- func RecordFileEdit(toolName, path string, linesChanged int)
- func RecordFileWrite(toolName, path string, bytes int)
- func ResolvePath(path string) (string, error)
- func RestoreFromBackup(path string) error
- func RevertLastAutoCommit() error
- func SegmentCommand(cmd string) []string
- func StripBOM(data []byte) []byte
- func ToolTimeout(toolName string) time.Duration
- func TruncateOutput(s string) string
- func UndoLatest() (string, error)
- func ValidateToolInput(toolName string, input json.RawMessage) error
- func WithContainerExecutor(ctx context.Context, ce ContainerExecutor) context.Context
- func WithToolContext(ctx context.Context, tc *ToolContext) context.Context
- type AgentTool
- type AgenticFetchTool
- func (AgenticFetchTool) Aliases() []string
- func (AgenticFetchTool) Description() string
- func (AgenticFetchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (AgenticFetchTool) Name() string
- func (AgenticFetchTool) Parameters() map[string]interface{}
- func (AgenticFetchTool) RiskLevel() string
- type AliasedTool
- type AskUserQuestionTool
- type AuditEntry
- type AuditLog
- type BashTool
- type BriefTool
- type CodeSearchResult
- type CodeSearchTool
- func (CodeSearchTool) Aliases() []string
- func (CodeSearchTool) Description() string
- func (CodeSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (CodeSearchTool) Name() string
- func (CodeSearchTool) Parameters() map[string]interface{}
- func (CodeSearchTool) RiskLevel() string
- type ConfigTool
- type ContainerExecutor
- type CoreMemoryAppendTool
- type CoreMemoryReplaceTool
- type CoreMemoryRethinkTool
- type CronCreateTool
- type CronDeleteTool
- type CronJob
- type CronListTool
- type CronScheduler
- type DebuggerTool
- type DevEnvTool
- type DiagnosticsTool
- type DownloadTool
- type EnterPlanModeTool
- type EnterWorktreeTool
- type ExitPlanModeTool
- type ExitWorktreeTool
- type FileEditTool
- type FileReadTool
- type FileWriteTool
- func (FileWriteTool) Aliases() []string
- func (FileWriteTool) Description() string
- func (FileWriteTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (FileWriteTool) Name() string
- func (FileWriteTool) Parameters() map[string]interface{}
- func (FileWriteTool) RiskLevel() string
- type GitConfig
- type GitState
- type GlobTool
- type GrepTool
- type LSPTool
- type LSTool
- type ListMcpResourcesTool
- type MCPAuthManager
- type MCPAuthState
- type MCPTool
- type McpAuthTool
- type MultiAgentTool
- type MultiEditTool
- func (MultiEditTool) Aliases() []string
- func (MultiEditTool) Description() string
- func (MultiEditTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (MultiEditTool) Name() string
- func (MultiEditTool) Parameters() map[string]interface{}
- func (MultiEditTool) RiskLevel() string
- type NotebookEditTool
- type PathProtector
- type PowerShellTool
- func (PowerShellTool) Aliases() []string
- func (PowerShellTool) Description() string
- func (PowerShellTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (PowerShellTool) Name() string
- func (PowerShellTool) Parameters() map[string]interface{}
- func (PowerShellTool) RiskLevel() string
- type ReadMcpResourceTool
- type Registry
- type RiskLevelProvider
- type SkillTool
- type SleepTool
- type Task
- type TaskCreateTool
- type TaskDependency
- type TaskGetTool
- type TaskListTool
- type TaskOutputTool
- type TaskStatus
- type TaskStopTool
- type TaskStore
- func (s *TaskStore) CompactCompleted() string
- func (s *TaskStore) Create(subject, description, activeForm string, metadata map[string]any) *Task
- func (s *TaskStore) CreateWithParent(subject, description, activeForm string, metadata map[string]any, ...) *Task
- func (s *TaskStore) Delete(id string) bool
- func (s *TaskStore) Get(id string) (*Task, bool)
- func (s *TaskStore) GetReadyWork() []*Task
- func (s *TaskStore) List() []*Task
- func (s *TaskStore) Reset()
- func (s *TaskStore) Update(id string, fn func(*Task)) bool
- type TaskUpdateTool
- type TodoWriteTool
- type Tool
- type ToolContext
- type ToolSearchTool
- func (ToolSearchTool) Aliases() []string
- func (ToolSearchTool) Description() string
- func (ToolSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (ToolSearchTool) Name() string
- func (ToolSearchTool) Parameters() map[string]interface{}
- func (ToolSearchTool) RiskLevel() string
- type VerifyPlanExecutionTool
- func (VerifyPlanExecutionTool) Aliases() []string
- func (VerifyPlanExecutionTool) Description() string
- func (VerifyPlanExecutionTool) Execute(_ context.Context, input json.RawMessage) (string, error)
- func (VerifyPlanExecutionTool) Name() string
- func (VerifyPlanExecutionTool) Parameters() map[string]interface{}
- type WebFetchTool
- type WebSearchTool
- func (WebSearchTool) Aliases() []string
- func (WebSearchTool) Description() string
- func (WebSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
- func (WebSearchTool) Name() string
- func (WebSearchTool) Parameters() map[string]interface{}
- func (WebSearchTool) RiskLevel() string
- type WorkflowDef
- type WorkflowStep
- type WorkflowTool
Constants ¶
const BinaryIndicator = "[binary file — not displaying]"
BinaryIndicator is the message returned instead of binary content.
Variables ¶
This section is empty.
Functions ¶
func AutoCommit ¶
AutoCommit stages the file at path and creates a commit with a conventional hawk message. toolName and description are used to build the commit message.
func BackupFile ¶
BackupFile creates a backup of a file before modification. Returns the backup path, or empty string if backup wasn't needed.
func DecodeFileContent ¶
DecodeFileContent reads file bytes and returns clean UTF-8 string. Strips BOM, detects binary (null bytes in first 8KB), handles common encodings.
func DetectCredentials ¶
DetectCredentials returns a non-empty description of the first credential pattern found in content, or "" if none match.
func FormatAuditSummary ¶
func FormatAuditSummary() string
FormatAuditSummary produces a human-readable summary of today's modifications.
func IsBinaryContent ¶
IsBinaryContent returns true when data contains at least one null byte in the first binaryProbeSize bytes, indicating likely binary content.
func IsBinaryData ¶
IsBinaryData checks for null bytes in the first 8KB.
func IsDestructiveCommand ¶
IsDestructiveCommand returns true when the command contains a pattern that is considered destructive. This is a superset intended for pre-execution gating — it catches broader patterns than bash.go's dangerousSubstrings (e.g. "rm -rf ." is already caught; this also catches bare "rm -rf").
func IsGitRepo ¶
func IsGitRepo() bool
IsGitRepo returns true when the current working directory is inside a git repository.
func IsPowerShellAvailable ¶
func IsPowerShellAvailable() bool
IsPowerShellAvailable returns whether a PowerShell runtime is available.
func IsSafeGitCommit ¶
IsSafeGitCommit checks if a git commit command is safe. Git commits with simple quoted messages are considered safe.
func IsSensitivePath ¶
IsSensitivePath returns a non-empty reason when path points to a file that should be blocked for security. The path is cleaned and, when possible, resolved through symlinks before checking.
func IsSuspicious ¶
IsSuspicious returns true if the command needs a permission prompt. This is fail-closed: anything we can't confidently classify as safe gets flagged.
func LastAutoCommitHash ¶
func LastAutoCommitHash() string
LastAutoCommitHash returns the hash of the most recent hawk auto-commit, or "" if none has been made in this process.
func ListBackups ¶
ListBackups returns all backups for a file.
func RecordFileDelete ¶
func RecordFileDelete(toolName, path string)
RecordFileDelete logs a file deletion.
func RecordFileEdit ¶
RecordFileEdit logs a file edit operation.
func RecordFileWrite ¶
RecordFileWrite logs a file write/create operation.
func ResolvePath ¶
ResolvePath returns the absolute, symlink-resolved path. If resolution fails it falls back to filepath.Abs.
func RestoreFromBackup ¶
RestoreFromBackup restores the most recent backup of a file.
func RevertLastAutoCommit ¶
func RevertLastAutoCommit() error
RevertLastAutoCommit reverts the most recent auto-commit, but only if the current HEAD message starts with "hawk:".
func SegmentCommand ¶
SegmentCommand splits a command string on &&, ||, ;, and | (respecting quotes) into individual segments for independent analysis.
func ToolTimeout ¶
ToolTimeout returns the default timeout for a given tool name. Callers may still override with an explicit per-invocation value.
func TruncateOutput ¶
TruncateOutput trims output to maxOutputBytes and appends an indicator.
func UndoLatest ¶
UndoLatest finds the most recent backup across all files and restores it. Returns the restored file path for display, or an error if no backups exist.
func ValidateToolInput ¶
func ValidateToolInput(toolName string, input json.RawMessage) error
ValidateToolInput checks that required parameters are present and have correct types. It inspects the tool's Parameters() schema for "required" fields and verifies they exist in the provided input JSON.
func WithContainerExecutor ¶
func WithContainerExecutor(ctx context.Context, ce ContainerExecutor) context.Context
WithContainerExecutor injects a container executor into the context. When present, BashTool routes all commands through it instead of local shell.
func WithToolContext ¶
func WithToolContext(ctx context.Context, tc *ToolContext) context.Context
WithToolContext attaches a ToolContext to a context.
Types ¶
type AgentTool ¶
type AgentTool struct{}
func (AgentTool) Description ¶
func (AgentTool) Parameters ¶
type AgenticFetchTool ¶
type AgenticFetchTool struct{}
AgenticFetchTool spawns a sub-agent to fetch, process, and summarize web content.
func (AgenticFetchTool) Aliases ¶
func (AgenticFetchTool) Aliases() []string
func (AgenticFetchTool) Description ¶
func (AgenticFetchTool) Description() string
func (AgenticFetchTool) Execute ¶
func (AgenticFetchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (AgenticFetchTool) Name ¶
func (AgenticFetchTool) Name() string
func (AgenticFetchTool) Parameters ¶
func (AgenticFetchTool) Parameters() map[string]interface{}
func (AgenticFetchTool) RiskLevel ¶
func (AgenticFetchTool) RiskLevel() string
type AliasedTool ¶
type AliasedTool interface {
Aliases() []string
}
AliasedTool can be implemented by tools that need backward-compatible wire names.
type AskUserQuestionTool ¶
type AskUserQuestionTool struct{}
func (AskUserQuestionTool) Aliases ¶
func (AskUserQuestionTool) Aliases() []string
func (AskUserQuestionTool) Description ¶
func (AskUserQuestionTool) Description() string
func (AskUserQuestionTool) Execute ¶
func (AskUserQuestionTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (AskUserQuestionTool) Name ¶
func (AskUserQuestionTool) Name() string
func (AskUserQuestionTool) Parameters ¶
func (AskUserQuestionTool) Parameters() map[string]interface{}
type AuditEntry ¶
type AuditEntry struct {
Timestamp time.Time `json:"timestamp"`
Tool string `json:"tool"`
Action string `json:"action"` // "create", "edit", "write", "delete"
Path string `json:"path"`
BackupRef string `json:"backup_ref,omitempty"`
LinesChanged int `json:"lines_changed,omitempty"`
BytesWritten int `json:"bytes_written,omitempty"`
}
AuditEntry records a file modification event.
func TodayEntries ¶
func TodayEntries() ([]AuditEntry, error)
TodayEntries reads today's audit entries.
type AuditLog ¶
type AuditLog struct {
// contains filtered or unexported fields
}
AuditLog tracks all file modifications for accountability.
func (*AuditLog) Record ¶
func (a *AuditLog) Record(entry AuditEntry)
Record logs a file modification event.
type BashTool ¶
type BashTool struct{}
func (BashTool) Description ¶
func (BashTool) Parameters ¶
type BriefTool ¶
type BriefTool struct{}
BriefTool (SendUserMessage) sends a message the user will read. Text outside this tool is visible in the detail view; the answer lives here.
func (BriefTool) Description ¶
func (BriefTool) Parameters ¶
type CodeSearchResult ¶
type CodeSearchResult struct {
Path string
StartLine int
EndLine int
Content string
Symbol string
Language string
Score float64
}
CodeSearchResult is returned by CodeSearchFn.
type CodeSearchTool ¶
type CodeSearchTool struct{}
CodeSearchTool searches the codebase semantically.
func (CodeSearchTool) Aliases ¶
func (CodeSearchTool) Aliases() []string
func (CodeSearchTool) Description ¶
func (CodeSearchTool) Description() string
func (CodeSearchTool) Execute ¶
func (CodeSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (CodeSearchTool) Name ¶
func (CodeSearchTool) Name() string
func (CodeSearchTool) Parameters ¶
func (CodeSearchTool) Parameters() map[string]interface{}
func (CodeSearchTool) RiskLevel ¶
func (CodeSearchTool) RiskLevel() string
type ConfigTool ¶
type ConfigTool struct{}
ConfigTool reads/writes hawk settings.
func (ConfigTool) Aliases ¶
func (ConfigTool) Aliases() []string
func (ConfigTool) Description ¶
func (ConfigTool) Description() string
func (ConfigTool) Execute ¶
func (ConfigTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ConfigTool) Name ¶
func (ConfigTool) Name() string
func (ConfigTool) Parameters ¶
func (ConfigTool) Parameters() map[string]interface{}
type ContainerExecutor ¶
type ContainerExecutor interface {
Exec(ctx context.Context, command string, timeout time.Duration) (string, error)
Running() bool
}
ContainerExecutor allows BashTool to route commands through a container instead of local execution. When set via context, all commands run inside the container (Docker-first mode, like herm).
func ContainerExecutorFromContext ¶
func ContainerExecutorFromContext(ctx context.Context) ContainerExecutor
ContainerExecutorFromContext extracts the container executor, if any.
type CoreMemoryAppendTool ¶
type CoreMemoryAppendTool struct{}
CoreMemoryAppendTool appends content to a memory block identified by label.
func (CoreMemoryAppendTool) Description ¶
func (CoreMemoryAppendTool) Description() string
func (CoreMemoryAppendTool) Execute ¶
func (CoreMemoryAppendTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (CoreMemoryAppendTool) Name ¶
func (CoreMemoryAppendTool) Name() string
func (CoreMemoryAppendTool) Parameters ¶
func (CoreMemoryAppendTool) Parameters() map[string]interface{}
type CoreMemoryReplaceTool ¶
type CoreMemoryReplaceTool struct{}
CoreMemoryReplaceTool finds and replaces content within a memory block.
func (CoreMemoryReplaceTool) Description ¶
func (CoreMemoryReplaceTool) Description() string
func (CoreMemoryReplaceTool) Execute ¶
func (CoreMemoryReplaceTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (CoreMemoryReplaceTool) Name ¶
func (CoreMemoryReplaceTool) Name() string
func (CoreMemoryReplaceTool) Parameters ¶
func (CoreMemoryReplaceTool) Parameters() map[string]interface{}
type CoreMemoryRethinkTool ¶
type CoreMemoryRethinkTool struct{}
CoreMemoryRethinkTool completely rewrites a memory block.
func (CoreMemoryRethinkTool) Description ¶
func (CoreMemoryRethinkTool) Description() string
func (CoreMemoryRethinkTool) Execute ¶
func (CoreMemoryRethinkTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (CoreMemoryRethinkTool) Name ¶
func (CoreMemoryRethinkTool) Name() string
func (CoreMemoryRethinkTool) Parameters ¶
func (CoreMemoryRethinkTool) Parameters() map[string]interface{}
type CronCreateTool ¶
type CronCreateTool struct{}
CronCreateTool schedules a prompt to run on a cron schedule.
func (CronCreateTool) Aliases ¶
func (CronCreateTool) Aliases() []string
func (CronCreateTool) Description ¶
func (CronCreateTool) Description() string
func (CronCreateTool) Execute ¶
func (CronCreateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (CronCreateTool) Name ¶
func (CronCreateTool) Name() string
func (CronCreateTool) Parameters ¶
func (CronCreateTool) Parameters() map[string]interface{}
type CronDeleteTool ¶
type CronDeleteTool struct{}
CronDeleteTool removes a scheduled job.
func (CronDeleteTool) Aliases ¶
func (CronDeleteTool) Aliases() []string
func (CronDeleteTool) Description ¶
func (CronDeleteTool) Description() string
func (CronDeleteTool) Execute ¶
func (CronDeleteTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (CronDeleteTool) Name ¶
func (CronDeleteTool) Name() string
func (CronDeleteTool) Parameters ¶
func (CronDeleteTool) Parameters() map[string]interface{}
type CronJob ¶
type CronJob struct {
ID string `json:"id"`
Schedule string `json:"schedule"`
Prompt string `json:"prompt"`
Recurring bool `json:"recurring"`
Durable bool `json:"durable"`
CreatedAt time.Time `json:"createdAt"`
LastRun time.Time `json:"lastRun,omitempty"`
NextRun time.Time `json:"nextRun"`
Runs int `json:"runs"`
// contains filtered or unexported fields
}
CronJob represents a scheduled recurring or one-shot task.
type CronListTool ¶
type CronListTool struct{}
CronListTool lists all scheduled jobs.
func (CronListTool) Aliases ¶
func (CronListTool) Aliases() []string
func (CronListTool) Description ¶
func (CronListTool) Description() string
func (CronListTool) Execute ¶
func (CronListTool) Execute(_ context.Context, _ json.RawMessage) (string, error)
func (CronListTool) Name ¶
func (CronListTool) Name() string
func (CronListTool) Parameters ¶
func (CronListTool) Parameters() map[string]interface{}
type CronScheduler ¶
type CronScheduler struct {
// contains filtered or unexported fields
}
CronScheduler manages scheduled tasks.
func GetCronScheduler ¶
func GetCronScheduler() *CronScheduler
func (*CronScheduler) Create ¶
func (s *CronScheduler) Create(schedule, prompt string, recurring, durable bool) (*CronJob, error)
func (*CronScheduler) Delete ¶
func (s *CronScheduler) Delete(id string) bool
func (*CronScheduler) List ¶
func (s *CronScheduler) List() []*CronJob
type DebuggerTool ¶
type DebuggerTool struct{}
DebuggerTool provides debugging capabilities via language-specific debuggers (Delve for Go, pdb for Python, node --inspect for Node).
func (DebuggerTool) Aliases ¶
func (DebuggerTool) Aliases() []string
func (DebuggerTool) Description ¶
func (DebuggerTool) Description() string
func (DebuggerTool) Execute ¶
func (DebuggerTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (DebuggerTool) Name ¶
func (DebuggerTool) Name() string
func (DebuggerTool) Parameters ¶
func (DebuggerTool) Parameters() map[string]interface{}
type DevEnvTool ¶
type DevEnvTool struct{}
DevEnvTool allows the agent to read, write, and build Docker environments dynamically. When the agent needs a tool that isn't installed, it can modify the Dockerfile and rebuild the container on-the-fly (inspired by herm).
func (DevEnvTool) Aliases ¶
func (DevEnvTool) Aliases() []string
func (DevEnvTool) Description ¶
func (DevEnvTool) Description() string
func (DevEnvTool) Execute ¶
func (DevEnvTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (DevEnvTool) Name ¶
func (DevEnvTool) Name() string
func (DevEnvTool) Parameters ¶
func (DevEnvTool) Parameters() map[string]interface{}
func (DevEnvTool) RiskLevel ¶
func (DevEnvTool) RiskLevel() string
type DiagnosticsTool ¶
type DiagnosticsTool struct{}
DiagnosticsTool runs lint/type/compile diagnostics for a file or project.
func (DiagnosticsTool) Aliases ¶
func (DiagnosticsTool) Aliases() []string
func (DiagnosticsTool) Description ¶
func (DiagnosticsTool) Description() string
func (DiagnosticsTool) Execute ¶
func (DiagnosticsTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (DiagnosticsTool) Name ¶
func (DiagnosticsTool) Name() string
func (DiagnosticsTool) Parameters ¶
func (DiagnosticsTool) Parameters() map[string]interface{}
type DownloadTool ¶
type DownloadTool struct{}
DownloadTool downloads a file from a URL to a local path.
func (DownloadTool) Aliases ¶
func (DownloadTool) Aliases() []string
func (DownloadTool) Description ¶
func (DownloadTool) Description() string
func (DownloadTool) Execute ¶
func (DownloadTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (DownloadTool) Name ¶
func (DownloadTool) Name() string
func (DownloadTool) Parameters ¶
func (DownloadTool) Parameters() map[string]interface{}
func (DownloadTool) RiskLevel ¶
func (DownloadTool) RiskLevel() string
type EnterPlanModeTool ¶
type EnterPlanModeTool struct{}
func (EnterPlanModeTool) Aliases ¶
func (EnterPlanModeTool) Aliases() []string
func (EnterPlanModeTool) Description ¶
func (EnterPlanModeTool) Description() string
func (EnterPlanModeTool) Execute ¶
func (EnterPlanModeTool) Execute(_ context.Context, _ json.RawMessage) (string, error)
func (EnterPlanModeTool) Name ¶
func (EnterPlanModeTool) Name() string
func (EnterPlanModeTool) Parameters ¶
func (EnterPlanModeTool) Parameters() map[string]interface{}
type EnterWorktreeTool ¶
type EnterWorktreeTool struct{}
EnterWorktreeTool switches to a git worktree.
func (EnterWorktreeTool) Aliases ¶
func (EnterWorktreeTool) Aliases() []string
func (EnterWorktreeTool) Description ¶
func (EnterWorktreeTool) Description() string
func (EnterWorktreeTool) Execute ¶
func (EnterWorktreeTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (EnterWorktreeTool) Name ¶
func (EnterWorktreeTool) Name() string
func (EnterWorktreeTool) Parameters ¶
func (EnterWorktreeTool) Parameters() map[string]interface{}
type ExitPlanModeTool ¶
type ExitPlanModeTool struct{}
func (ExitPlanModeTool) Aliases ¶
func (ExitPlanModeTool) Aliases() []string
func (ExitPlanModeTool) Description ¶
func (ExitPlanModeTool) Description() string
func (ExitPlanModeTool) Execute ¶
func (ExitPlanModeTool) Execute(_ context.Context, _ json.RawMessage) (string, error)
func (ExitPlanModeTool) Name ¶
func (ExitPlanModeTool) Name() string
func (ExitPlanModeTool) Parameters ¶
func (ExitPlanModeTool) Parameters() map[string]interface{}
type ExitWorktreeTool ¶
type ExitWorktreeTool struct{}
ExitWorktreeTool returns to the main repository from a worktree.
func (ExitWorktreeTool) Aliases ¶
func (ExitWorktreeTool) Aliases() []string
func (ExitWorktreeTool) Description ¶
func (ExitWorktreeTool) Description() string
func (ExitWorktreeTool) Execute ¶
func (ExitWorktreeTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ExitWorktreeTool) Name ¶
func (ExitWorktreeTool) Name() string
func (ExitWorktreeTool) Parameters ¶
func (ExitWorktreeTool) Parameters() map[string]interface{}
type FileEditTool ¶
type FileEditTool struct{}
func (FileEditTool) Aliases ¶
func (FileEditTool) Aliases() []string
func (FileEditTool) Description ¶
func (FileEditTool) Description() string
func (FileEditTool) Execute ¶
func (FileEditTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (FileEditTool) Name ¶
func (FileEditTool) Name() string
func (FileEditTool) Parameters ¶
func (FileEditTool) Parameters() map[string]interface{}
func (FileEditTool) RiskLevel ¶
func (FileEditTool) RiskLevel() string
type FileReadTool ¶
type FileReadTool struct{}
func (FileReadTool) Aliases ¶
func (FileReadTool) Aliases() []string
func (FileReadTool) Description ¶
func (FileReadTool) Description() string
func (FileReadTool) Execute ¶
func (FileReadTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (FileReadTool) Name ¶
func (FileReadTool) Name() string
func (FileReadTool) Parameters ¶
func (FileReadTool) Parameters() map[string]interface{}
func (FileReadTool) RiskLevel ¶
func (FileReadTool) RiskLevel() string
type FileWriteTool ¶
type FileWriteTool struct{}
func (FileWriteTool) Aliases ¶
func (FileWriteTool) Aliases() []string
func (FileWriteTool) Description ¶
func (FileWriteTool) Description() string
func (FileWriteTool) Execute ¶
func (FileWriteTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (FileWriteTool) Name ¶
func (FileWriteTool) Name() string
func (FileWriteTool) Parameters ¶
func (FileWriteTool) Parameters() map[string]interface{}
func (FileWriteTool) RiskLevel ¶
func (FileWriteTool) RiskLevel() string
type GitConfig ¶
GitConfig represents a parsed .git/config file. Keys are stored as "section.key" or "section.subsection.key".
func ParseGitConfig ¶
ParseGitConfig reads and parses a git config file without spawning git. It handles: [section], [section "subsection"], key = value, and comments.
type GitState ¶
GitState holds parsed git repository state read directly from the filesystem without spawning a git subprocess.
func ReadGitState ¶
ReadGitState reads .git/HEAD and refs to determine the current branch and commit hash without spawning a git subprocess.
type GlobTool ¶
type GlobTool struct{}
func (GlobTool) Description ¶
func (GlobTool) Parameters ¶
type GrepTool ¶
type GrepTool struct{}
func (GrepTool) Description ¶
func (GrepTool) Parameters ¶
type LSPTool ¶
type LSPTool struct{}
func (LSPTool) Description ¶
func (LSPTool) Parameters ¶
type LSTool ¶
type LSTool struct{}
func (LSTool) Description ¶
func (LSTool) Parameters ¶
type ListMcpResourcesTool ¶
type ListMcpResourcesTool struct{}
func (ListMcpResourcesTool) Aliases ¶
func (ListMcpResourcesTool) Aliases() []string
func (ListMcpResourcesTool) Description ¶
func (ListMcpResourcesTool) Description() string
func (ListMcpResourcesTool) Execute ¶
func (ListMcpResourcesTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ListMcpResourcesTool) Name ¶
func (ListMcpResourcesTool) Name() string
func (ListMcpResourcesTool) Parameters ¶
func (ListMcpResourcesTool) Parameters() map[string]interface{}
type MCPAuthManager ¶
type MCPAuthManager struct {
// contains filtered or unexported fields
}
MCPAuthManager handles OAuth flows for MCP servers.
func GetMCPAuthManager ¶
func GetMCPAuthManager() *MCPAuthManager
func (*MCPAuthManager) GetState ¶
func (m *MCPAuthManager) GetState(serverName string) (*MCPAuthState, bool)
func (*MCPAuthManager) SetAuthenticated ¶
func (m *MCPAuthManager) SetAuthenticated(serverName string)
func (*MCPAuthManager) StartAuth ¶
func (m *MCPAuthManager) StartAuth(serverName, serverURL string) (*MCPAuthState, error)
type MCPAuthState ¶
type MCPAuthState struct {
ServerName string `json:"serverName"`
AuthURL string `json:"authUrl,omitempty"`
Status string `json:"status"` // "pending", "authenticated", "error"
Error string `json:"error,omitempty"`
}
MCPAuthState tracks OAuth state for an MCP server.
type MCPTool ¶
type MCPTool struct {
// contains filtered or unexported fields
}
MCPTool wraps an MCP server tool as a hawk tool.
func (*MCPTool) Description ¶
func (*MCPTool) Parameters ¶
type McpAuthTool ¶
type McpAuthTool struct{}
McpAuthTool initiates OAuth authentication for an MCP server.
func (McpAuthTool) Aliases ¶
func (McpAuthTool) Aliases() []string
func (McpAuthTool) Description ¶
func (McpAuthTool) Description() string
func (McpAuthTool) Execute ¶
func (McpAuthTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (McpAuthTool) Name ¶
func (McpAuthTool) Name() string
func (McpAuthTool) Parameters ¶
func (McpAuthTool) Parameters() map[string]interface{}
type MultiAgentTool ¶
type MultiAgentTool struct{}
MultiAgentTool spawns multiple sub-agents in parallel.
func (MultiAgentTool) Aliases ¶
func (MultiAgentTool) Aliases() []string
func (MultiAgentTool) Description ¶
func (MultiAgentTool) Description() string
func (MultiAgentTool) Execute ¶
func (MultiAgentTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (MultiAgentTool) Name ¶
func (MultiAgentTool) Name() string
func (MultiAgentTool) Parameters ¶
func (MultiAgentTool) Parameters() map[string]interface{}
type MultiEditTool ¶
type MultiEditTool struct{}
MultiEditTool applies multiple edits to a single file in one call.
func (MultiEditTool) Aliases ¶
func (MultiEditTool) Aliases() []string
func (MultiEditTool) Description ¶
func (MultiEditTool) Description() string
func (MultiEditTool) Execute ¶
func (MultiEditTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (MultiEditTool) Name ¶
func (MultiEditTool) Name() string
func (MultiEditTool) Parameters ¶
func (MultiEditTool) Parameters() map[string]interface{}
func (MultiEditTool) RiskLevel ¶
func (MultiEditTool) RiskLevel() string
type NotebookEditTool ¶
type NotebookEditTool struct{}
NotebookEditTool edits Jupyter notebook cells.
func (NotebookEditTool) Aliases ¶
func (NotebookEditTool) Aliases() []string
func (NotebookEditTool) Description ¶
func (NotebookEditTool) Description() string
func (NotebookEditTool) Execute ¶
func (NotebookEditTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (NotebookEditTool) Name ¶
func (NotebookEditTool) Name() string
func (NotebookEditTool) Parameters ¶
func (NotebookEditTool) Parameters() map[string]interface{}
type PathProtector ¶
PathProtector checks whether a file path is protected (read-only). engine.ProtectedPaths implements this interface.
type PowerShellTool ¶
type PowerShellTool struct{}
PowerShellTool executes PowerShell commands (Windows/cross-platform pwsh).
func (PowerShellTool) Aliases ¶
func (PowerShellTool) Aliases() []string
func (PowerShellTool) Description ¶
func (PowerShellTool) Description() string
func (PowerShellTool) Execute ¶
func (PowerShellTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (PowerShellTool) Name ¶
func (PowerShellTool) Name() string
func (PowerShellTool) Parameters ¶
func (PowerShellTool) Parameters() map[string]interface{}
func (PowerShellTool) RiskLevel ¶
func (PowerShellTool) RiskLevel() string
type ReadMcpResourceTool ¶
type ReadMcpResourceTool struct{}
func (ReadMcpResourceTool) Aliases ¶
func (ReadMcpResourceTool) Aliases() []string
func (ReadMcpResourceTool) Description ¶
func (ReadMcpResourceTool) Description() string
func (ReadMcpResourceTool) Execute ¶
func (ReadMcpResourceTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ReadMcpResourceTool) Name ¶
func (ReadMcpResourceTool) Name() string
func (ReadMcpResourceTool) Parameters ¶
func (ReadMcpResourceTool) Parameters() map[string]interface{}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all registered tools.
func NewRegistry ¶
NewRegistry creates a registry with the given tools.
func (*Registry) EyrieTools ¶
EyrieTools converts all tools to eyrie tool definitions for the API.
func (*Registry) Filter ¶
Filter returns a new Registry containing only tools whose names are in the allowlist.
func (*Registry) PrimaryTools ¶
PrimaryTools returns the model-visible tools registered in this registry.
type RiskLevelProvider ¶
type RiskLevelProvider interface {
RiskLevel() string // "low", "medium", "high"
}
RiskLevelProvider can be implemented by tools to declare their risk level. Tools that don't implement it default to "medium".
type SkillTool ¶
type SkillTool struct{}
func (SkillTool) Description ¶
func (SkillTool) Parameters ¶
type SleepTool ¶
type SleepTool struct{}
SleepTool pauses execution for a specified duration.
func (SleepTool) Description ¶
func (SleepTool) Parameters ¶
type Task ¶
type Task struct {
ID string `json:"id"`
ParentID string `json:"parentId,omitempty"`
Subject string `json:"subject"`
Description string `json:"description"`
ActiveForm string `json:"activeForm,omitempty"`
Status TaskStatus `json:"status"`
Owner string `json:"owner,omitempty"`
Dependencies []TaskDependency `json:"dependencies"`
Metadata map[string]any `json:"metadata,omitempty"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
}
Task represents a structured task in the task list.
type TaskCreateTool ¶
type TaskCreateTool struct{}
TaskCreateTool creates a new task in the task list.
func (TaskCreateTool) Aliases ¶
func (TaskCreateTool) Aliases() []string
func (TaskCreateTool) Description ¶
func (TaskCreateTool) Description() string
func (TaskCreateTool) Execute ¶
func (TaskCreateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskCreateTool) Name ¶
func (TaskCreateTool) Name() string
func (TaskCreateTool) Parameters ¶
func (TaskCreateTool) Parameters() map[string]interface{}
type TaskDependency ¶
type TaskDependency struct {
TargetID string `json:"targetId"`
Type string `json:"type"` // "blocks", "related", "parent-child"
}
TaskDependency represents a typed dependency between tasks.
type TaskGetTool ¶
type TaskGetTool struct{}
TaskGetTool retrieves a task by ID.
func (TaskGetTool) Aliases ¶
func (TaskGetTool) Aliases() []string
func (TaskGetTool) Description ¶
func (TaskGetTool) Description() string
func (TaskGetTool) Execute ¶
func (TaskGetTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskGetTool) Name ¶
func (TaskGetTool) Name() string
func (TaskGetTool) Parameters ¶
func (TaskGetTool) Parameters() map[string]interface{}
type TaskListTool ¶
type TaskListTool struct{}
TaskListTool lists all tasks.
func (TaskListTool) Aliases ¶
func (TaskListTool) Aliases() []string
func (TaskListTool) Description ¶
func (TaskListTool) Description() string
func (TaskListTool) Execute ¶
func (TaskListTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskListTool) Name ¶
func (TaskListTool) Name() string
func (TaskListTool) Parameters ¶
func (TaskListTool) Parameters() map[string]interface{}
type TaskOutputTool ¶
type TaskOutputTool struct{}
func (TaskOutputTool) Aliases ¶
func (TaskOutputTool) Aliases() []string
func (TaskOutputTool) Description ¶
func (TaskOutputTool) Description() string
func (TaskOutputTool) Execute ¶
func (TaskOutputTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskOutputTool) Name ¶
func (TaskOutputTool) Name() string
func (TaskOutputTool) Parameters ¶
func (TaskOutputTool) Parameters() map[string]interface{}
type TaskStatus ¶
type TaskStatus string
TaskStatus represents the state of a task.
const ( TaskStatusPending TaskStatus = "pending" TaskStatusInProgress TaskStatus = "in_progress" TaskStatusCompleted TaskStatus = "completed" )
type TaskStopTool ¶
type TaskStopTool struct{}
func (TaskStopTool) Aliases ¶
func (TaskStopTool) Aliases() []string
func (TaskStopTool) Description ¶
func (TaskStopTool) Description() string
func (TaskStopTool) Execute ¶
func (TaskStopTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskStopTool) Name ¶
func (TaskStopTool) Name() string
func (TaskStopTool) Parameters ¶
func (TaskStopTool) Parameters() map[string]interface{}
type TaskStore ¶
type TaskStore struct {
// contains filtered or unexported fields
}
TaskStore is a thread-safe in-memory store for tasks.
func (*TaskStore) CompactCompleted ¶
CompactCompleted removes completed tasks and returns a summary.
func (*TaskStore) CreateWithParent ¶
func (*TaskStore) GetReadyWork ¶
GetReadyWork returns pending tasks with no open blocking dependencies.
type TaskUpdateTool ¶
type TaskUpdateTool struct{}
TaskUpdateTool updates task fields.
func (TaskUpdateTool) Aliases ¶
func (TaskUpdateTool) Aliases() []string
func (TaskUpdateTool) Description ¶
func (TaskUpdateTool) Description() string
func (TaskUpdateTool) Execute ¶
func (TaskUpdateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskUpdateTool) Name ¶
func (TaskUpdateTool) Name() string
func (TaskUpdateTool) Parameters ¶
func (TaskUpdateTool) Parameters() map[string]interface{}
type TodoWriteTool ¶
type TodoWriteTool struct{}
func (TodoWriteTool) Aliases ¶
func (TodoWriteTool) Aliases() []string
func (TodoWriteTool) Description ¶
func (TodoWriteTool) Description() string
func (TodoWriteTool) Execute ¶
func (TodoWriteTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TodoWriteTool) Name ¶
func (TodoWriteTool) Name() string
func (TodoWriteTool) Parameters ¶
func (TodoWriteTool) Parameters() map[string]interface{}
type Tool ¶
type Tool interface {
Name() string
Description() string
Parameters() map[string]interface{}
Execute(ctx context.Context, input json.RawMessage) (string, error)
}
Tool is the interface every hawk tool implements.
type ToolContext ¶
type ToolContext struct {
AgentSpawnFn func(ctx context.Context, prompt string) (string, error)
AskUserFn func(question string) (string, error)
CodeSearchFn func(ctx context.Context, query string, limit int) ([]CodeSearchResult, error)
RefreshCodeIndexFn func(ctx context.Context) error
AvailableTools []Tool
AllowedDirectories []string
SandboxMode sandbox.Mode
AutoCommit bool
Protected PathProtector
YaadBridge *memory.YaadBridge
}
ToolContext carries session-level functions for tools that need them.
func GetToolContext ¶
func GetToolContext(ctx context.Context) *ToolContext
GetToolContext retrieves the ToolContext from a context.
type ToolSearchTool ¶
type ToolSearchTool struct{}
func (ToolSearchTool) Aliases ¶
func (ToolSearchTool) Aliases() []string
func (ToolSearchTool) Description ¶
func (ToolSearchTool) Description() string
func (ToolSearchTool) Execute ¶
func (ToolSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ToolSearchTool) Name ¶
func (ToolSearchTool) Name() string
func (ToolSearchTool) Parameters ¶
func (ToolSearchTool) Parameters() map[string]interface{}
func (ToolSearchTool) RiskLevel ¶
func (ToolSearchTool) RiskLevel() string
type VerifyPlanExecutionTool ¶
type VerifyPlanExecutionTool struct{}
VerifyPlanExecutionTool checks whether a plan's steps have been executed correctly.
func (VerifyPlanExecutionTool) Aliases ¶
func (VerifyPlanExecutionTool) Aliases() []string
func (VerifyPlanExecutionTool) Description ¶
func (VerifyPlanExecutionTool) Description() string
func (VerifyPlanExecutionTool) Execute ¶
func (VerifyPlanExecutionTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (VerifyPlanExecutionTool) Name ¶
func (VerifyPlanExecutionTool) Name() string
func (VerifyPlanExecutionTool) Parameters ¶
func (VerifyPlanExecutionTool) Parameters() map[string]interface{}
type WebFetchTool ¶
type WebFetchTool struct{}
func (WebFetchTool) Aliases ¶
func (WebFetchTool) Aliases() []string
func (WebFetchTool) Description ¶
func (WebFetchTool) Description() string
func (WebFetchTool) Execute ¶
func (WebFetchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WebFetchTool) Name ¶
func (WebFetchTool) Name() string
func (WebFetchTool) Parameters ¶
func (WebFetchTool) Parameters() map[string]interface{}
type WebSearchTool ¶
type WebSearchTool struct{}
func (WebSearchTool) Aliases ¶
func (WebSearchTool) Aliases() []string
func (WebSearchTool) Description ¶
func (WebSearchTool) Description() string
func (WebSearchTool) Execute ¶
func (WebSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WebSearchTool) Name ¶
func (WebSearchTool) Name() string
func (WebSearchTool) Parameters ¶
func (WebSearchTool) Parameters() map[string]interface{}
func (WebSearchTool) RiskLevel ¶
func (WebSearchTool) RiskLevel() string
type WorkflowDef ¶
type WorkflowDef struct {
Name string `yaml:"name" json:"name"`
Description string `yaml:"description" json:"description"`
Steps []WorkflowStep `yaml:"steps" json:"steps"`
}
WorkflowDef defines a scripted workflow loaded from .hawk/workflows/.
func ListWorkflows ¶
func ListWorkflows() []WorkflowDef
ListWorkflows discovers available workflows.
type WorkflowStep ¶
type WorkflowStep struct {
Name string `yaml:"name" json:"name"`
Prompt string `yaml:"prompt" json:"prompt"`
Tool string `yaml:"tool" json:"tool"`
Input string `yaml:"input" json:"input"`
OnError string `yaml:"on_error" json:"on_error"`
}
WorkflowStep is a single step in a workflow.
type WorkflowTool ¶
type WorkflowTool struct{}
WorkflowTool executes scripted workflows from .hawk/workflows/.
func (WorkflowTool) Aliases ¶
func (WorkflowTool) Aliases() []string
func (WorkflowTool) Description ¶
func (WorkflowTool) Description() string
func (WorkflowTool) Execute ¶
func (WorkflowTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WorkflowTool) Name ¶
func (WorkflowTool) Name() string
func (WorkflowTool) Parameters ¶
func (WorkflowTool) Parameters() map[string]interface{}
Source Files
¶
- agent.go
- agentic_fetch.go
- ask_user.go
- audit.go
- backup.go
- bash.go
- code_search.go
- core_memory.go
- cron.go
- debugger.go
- devenv.go
- diagnostics.go
- download.go
- encoding.go
- extra.go
- file_edit.go
- file_read.go
- file_read_media.go
- file_write.go
- git_commit.go
- git_config.go
- git_fs.go
- glob.go
- grep.go
- ls.go
- lsp.go
- mcp_auth.go
- mcp_resources.go
- mcp_tool.go
- multiedit.go
- path_guard.go
- plan.go
- powershell.go
- safety.go
- skill.go
- sleep.go
- task_create.go
- task_tools.go
- todo.go
- tool.go
- tool_search.go
- validate_input.go
- verify_plan.go
- web_fetch.go
- web_search.go
- workflow.go
- worktree.go