Documentation
¶
Index ¶
- Constants
- func CheckpointSaver(mgr *checkpoint.Manager) func(filePath, oldContent, newContent, toolCall string) error
- func FormatToolInline(name, detail string) string
- func RegisterBuiltinTools(registry *Registry, policy permission.PermissionPolicy, workingDir string) error
- func RelativizePath(path, workingDir string) string
- func SetPreWriteHook(fn func(filePath, oldContent, newContent, toolCall string) error)
- func StartCommandResultText(result string, isError bool) string
- func StripHTML(s string) string
- func SwarmTaskCreateResultMarkdown(result string) string
- func SwarmTaskCreateSubject(rawArgs string) string
- func TeamCreateResultText(result string) string
- func TodoDir(workspace string) string
- func TodoFilePath(workspace string) string
- func ToolDef(t Tool) provider.ToolDefinition
- type AllowedPathChecker
- type AskUserAnswer
- type AskUserChoice
- type AskUserHandler
- type AskUserQuestion
- type AskUserRequest
- type AskUserResponse
- type AskUserTool
- func (t *AskUserTool) Description() string
- func (t *AskUserTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
- func (t *AskUserTool) HasHandler() bool
- func (t *AskUserTool) Name() string
- func (t *AskUserTool) Parameters() json.RawMessage
- func (t *AskUserTool) SetHandler(handler AskUserHandler)
- type BackgroundTaskProvider
- type Cloner
- type CommandGate
- type CommandJob
- type CommandJobManager
- func (m *CommandJobManager) AutoBackground(cmd *exec.Cmd, command string, initialStdout, initialStderr string) string
- func (m *CommandJobManager) List() []CommandJobSnapshot
- func (m *CommandJobManager) Read(id string, tailLines, sinceLine int) (CommandJobSnapshot, error)
- func (m *CommandJobManager) Start(ctx context.Context, command string, timeout time.Duration) (*CommandJobSnapshot, error)
- func (m *CommandJobManager) Stop(id string) (CommandJobSnapshot, error)
- func (m *CommandJobManager) Wait(ctx context.Context, id string, wait time.Duration, tailLines, sinceLine int) (CommandJobSnapshot, error)
- func (m *CommandJobManager) Write(id, input string, appendNewline bool) (CommandJobSnapshot, error)
- type CommandJobSnapshot
- type CommandJobStatus
- type ConfigAccess
- type ConfigTool
- type CronCreateTool
- type CronDeleteTool
- type CronListTool
- type EditFile
- type EnterPlanModeTool
- type EnterWorktree
- type ExitPlanModeTool
- type ExitWorktree
- type GateBehavior
- type GateResult
- type GetMCPPromptTool
- type GitAdd
- type GitBlame
- type GitBranchList
- type GitCommit
- type GitDiff
- type GitLog
- type GitRemote
- type GitShow
- type GitStash
- type GitStashList
- type GitStatus
- type Glob
- type Grep
- type ListAgentsTool
- type ListCommandsTool
- type ListDir
- type ListMCPCapabilitiesTool
- type MCPPromptMessage
- type MCPPromptResult
- type MCPResourceContent
- type MCPResourceResult
- type MCPRuntime
- type MCPServerSnapshot
- type ModeSwitcher
- type MultiEditFile
- type MultiFileEdit
- func (t MultiFileEdit) Description() string
- func (t MultiFileEdit) Execute(ctx context.Context, input json.RawMessage) (Result, error)
- func (t MultiFileEdit) Name() string
- func (t MultiFileEdit) Parameters() json.RawMessage
- func (t MultiFileEdit) PreviewChanges(input json.RawMessage) ([]PlannedFileEdit, error)
- type MultiFileEditContent
- type MultiFileEditFileResult
- type MultiFileRead
- type NotebookEdit
- type PlannedFileEdit
- type ReadCommandOutputTool
- type ReadFile
- type ReadMCPResourceTool
- type Registry
- func (r *Registry) Clone() *Registry
- func (r *Registry) Get(name string) (Tool, bool)
- func (r *Registry) List() []Tool
- func (r *Registry) Register(t Tool) error
- func (r *Registry) ToDefinitions() []provider.ToolDefinition
- func (r *Registry) ToolNames() []string
- func (r *Registry) Unregister(name string) bool
- type Result
- type ResultImage
- type RunCommand
- type SaveMemoryTool
- type SearchFiles
- type SendMessageTool
- type SkillExecutionEvent
- type SkillExecutionMode
- type SkillLookup
- type SkillTool
- type SleepTool
- type SpawnAgentTool
- type StartCommandTool
- type StopCommandTool
- type SwarmTaskClaimTool
- type SwarmTaskCompleteTool
- type SwarmTaskCreateTool
- type SwarmTaskListTool
- type TaskCreateTool
- type TaskGetTool
- type TaskListTool
- type TaskOutputTool
- type TaskStopTool
- type TaskUpdateTool
- type TeamCreateTool
- type TeamDeleteTool
- type TeammateListTool
- type TeammateResultsTool
- type TeammateShutdownTool
- type TeammateSpawnTool
- type Todo
- type TodoWrite
- type Tool
- type ToolPresentation
- type ToolResultPresentation
- type WaitAgentTool
- type WaitCommandTool
- type WebFetch
- type WebSearch
- type WriteCommandInputTool
- type WriteFile
Constants ¶
const ( AskUserKindSingle = "single" AskUserKindMulti = "multi" AskUserKindText = "text" AskUserStatusSubmitted = "submitted" AskUserStatusCancelled = "cancelled" AskUserCompletionUnanswered = "unanswered" AskUserCompletionPartial = "partial" AskUserCompletionAnswered = "answered" AskUserAnswerModeNone = "none" AskUserAnswerModeFreeformOnly = "freeform_only" AskUserAnswerModeSelectionOnly = "selection_only" AskUserAnswerModeSelectionAndFreeform = "selection_and_freeform" )
Variables ¶
This section is empty.
Functions ¶
func CheckpointSaver ¶ added in v1.1.50
func CheckpointSaver(mgr *checkpoint.Manager) func(filePath, oldContent, newContent, toolCall string) error
CheckpointSaver returns a pre-write hook that saves checkpoints to the given manager. This is the standard hook used by TUI/daemon/ACP modes. Checkpoint saving is in-memory only; errors are logged but do not abort writes.
func FormatToolInline ¶ added in v1.1.49
FormatToolInline combines DisplayName and Detail into a single display string, matching the TUI format: "Read /tmp/test.go" or "go test ./...".
func RegisterBuiltinTools ¶
func RegisterBuiltinTools(registry *Registry, policy permission.PermissionPolicy, workingDir string) error
RegisterBuiltinTools registers all built-in tools. If policy is nil, no sandbox path checking is enforced (permissive mode).
func RelativizePath ¶ added in v1.1.49
RelativizePath tries to make an absolute path relative to workingDir.
func SetPreWriteHook ¶ added in v1.1.50
SetPreWriteHook sets a global hook called before file writes. The hook receives (filePath, oldContent, newContent, toolName) and is used to save undo checkpoints. If the hook returns an error, the write is aborted.
func StartCommandResultText ¶ added in v1.3.22
StartCommandResultText normalizes start_command results to a simple status label.
func SwarmTaskCreateResultMarkdown ¶ added in v1.3.22
SwarmTaskCreateResultMarkdown extracts the markdown description from a swarm_task_create result.
func SwarmTaskCreateSubject ¶ added in v1.3.22
SwarmTaskCreateSubject returns the human-facing task subject for swarm_task_create.
func TeamCreateResultText ¶ added in v1.3.22
TeamCreateResultText extracts the created team name from a team_create result.
func TodoFilePath ¶ added in v1.1.7
func ToolDef ¶
func ToolDef(t Tool) provider.ToolDefinition
ToolDef creates a provider.ToolDefinition from a Tool.
Types ¶
type AllowedPathChecker ¶
AllowedPathChecker is a function that checks if a path is allowed by sandbox policy.
type AskUserAnswer ¶ added in v1.1.12
type AskUserAnswer struct {
ID string `json:"id"`
Title string `json:"title"`
Kind string `json:"kind"`
CompletionStatus string `json:"completion_status"`
AnswerMode string `json:"answer_mode"`
Answered bool `json:"answered"`
SelectedChoiceIDs []string `json:"selected_choice_ids,omitempty"`
SelectedChoices []string `json:"selected_choices,omitempty"`
FreeformText string `json:"freeform_text,omitempty"`
}
type AskUserChoice ¶ added in v1.1.12
type AskUserHandler ¶ added in v1.1.12
type AskUserHandler func(context.Context, AskUserRequest) (AskUserResponse, error)
type AskUserQuestion ¶ added in v1.1.12
type AskUserRequest ¶ added in v1.1.12
type AskUserRequest struct {
Title string `json:"title,omitempty"`
Questions []AskUserQuestion `json:"questions"`
}
type AskUserResponse ¶ added in v1.1.12
type AskUserResponse struct {
Status string `json:"status"`
Title string `json:"title,omitempty"`
QuestionCount int `json:"question_count"`
AnsweredCount int `json:"answered_count"`
Answers []AskUserAnswer `json:"answers"`
}
type AskUserTool ¶ added in v1.1.12
type AskUserTool struct {
// contains filtered or unexported fields
}
func NewAskUserTool ¶ added in v1.1.12
func NewAskUserTool() *AskUserTool
func (*AskUserTool) Description ¶ added in v1.1.12
func (t *AskUserTool) Description() string
func (*AskUserTool) Execute ¶ added in v1.1.12
func (t *AskUserTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (*AskUserTool) HasHandler ¶ added in v1.1.15
func (t *AskUserTool) HasHandler() bool
func (*AskUserTool) Name ¶ added in v1.1.12
func (t *AskUserTool) Name() string
func (*AskUserTool) Parameters ¶ added in v1.1.12
func (t *AskUserTool) Parameters() json.RawMessage
func (*AskUserTool) SetHandler ¶ added in v1.1.12
func (t *AskUserTool) SetHandler(handler AskUserHandler)
type BackgroundTaskProvider ¶ added in v1.1.45
BackgroundTaskProvider retrieves output from background tasks (subagents, shell jobs).
type Cloner ¶ added in v1.2.7
type Cloner interface {
Clone() Tool
}
Cloner is an optional interface that tools can implement to provide a deep copy. Tools that hold mutable state (e.g., WorkingDir) MUST implement Clone so that each agent gets its own independent tool instances. Tools without mutable state can safely skip this interface — they will be shared between agents.
This is critical for correctness in concurrent scenarios (sub-agents, swarm teammates using different worktrees). Without cloning, syncToolWorkingDir would mutate a shared WorkingDir field, causing tool executions to land in the wrong directory.
type CommandGate ¶ added in v1.1.45
type CommandGate struct {
// contains filtered or unexported fields
}
CommandGate performs safety checks on shell commands before execution. Inspired by Claude Code's bashSecurity.ts architecture:
Layer 1: Pre-checks — control chars, injection patterns, parser differentials Layer 2: Catastrophic block — patterns with zero legitimate use Layer 3: Destructive warning — informational, doesn't block
The gate runs regardless of autopilot mode. In supervised mode, "ask" results prompt the user. In autopilot mode, "ask" results still block execution unless an explicit override is configured.
func NewCommandGate ¶ added in v1.1.45
func NewCommandGate() *CommandGate
NewCommandGate creates the command safety gate with all rules.
func (*CommandGate) Check ¶ added in v1.1.45
func (g *CommandGate) Check(cmd string) GateResult
Check evaluates a command against all safety rules. Returns a GateResult with Behavior = Allow, Ask, or Block.
func (*CommandGate) IsDestructive ¶ added in v1.1.45
func (g *CommandGate) IsDestructive(cmd string) bool
IsDestructive returns true if the command matches any block or ask rule.
type CommandJob ¶
type CommandJobManager ¶
type CommandJobManager struct {
// contains filtered or unexported fields
}
func NewCommandJobManager ¶
func NewCommandJobManager(workingDir string) *CommandJobManager
func (*CommandJobManager) AutoBackground ¶ added in v1.1.45
func (m *CommandJobManager) AutoBackground(cmd *exec.Cmd, command string, initialStdout, initialStderr string) string
AutoBackground adopts an already-running command process into a background job. The caller loses ownership of cmd — the job manager will Wait for it and capture output. initialStdout/initialStderr is output already captured before the migration.
func (*CommandJobManager) List ¶
func (m *CommandJobManager) List() []CommandJobSnapshot
func (*CommandJobManager) Read ¶
func (m *CommandJobManager) Read(id string, tailLines, sinceLine int) (CommandJobSnapshot, error)
func (*CommandJobManager) Start ¶
func (m *CommandJobManager) Start(ctx context.Context, command string, timeout time.Duration) (*CommandJobSnapshot, error)
func (*CommandJobManager) Stop ¶
func (m *CommandJobManager) Stop(id string) (CommandJobSnapshot, error)
func (*CommandJobManager) Wait ¶
func (m *CommandJobManager) Wait(ctx context.Context, id string, wait time.Duration, tailLines, sinceLine int) (CommandJobSnapshot, error)
func (*CommandJobManager) Write ¶ added in v1.0.23
func (m *CommandJobManager) Write(id, input string, appendNewline bool) (CommandJobSnapshot, error)
type CommandJobSnapshot ¶
type CommandJobStatus ¶
type CommandJobStatus string
const ( CommandJobRunning CommandJobStatus = "running" CommandJobCompleted CommandJobStatus = "completed" CommandJobFailed CommandJobStatus = "failed" CommandJobCancelled CommandJobStatus = "cancelled" CommandJobTimedOut CommandJobStatus = "timed_out" )
type ConfigAccess ¶ added in v1.1.45
type ConfigAccess interface {
Get(key string) (string, bool)
Set(key, value string) error
List() map[string]string
}
ConfigAccess provides read/write access to runtime configuration.
type ConfigTool ¶ added in v1.1.45
type ConfigTool struct {
Access ConfigAccess
}
ConfigTool reads or writes a configuration setting. When value is provided, it writes; otherwise it reads.
func (ConfigTool) Description ¶ added in v1.1.45
func (t ConfigTool) Description() string
func (ConfigTool) Execute ¶ added in v1.1.45
func (t ConfigTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (ConfigTool) Name ¶ added in v1.1.45
func (t ConfigTool) Name() string
func (ConfigTool) Parameters ¶ added in v1.1.45
func (t ConfigTool) Parameters() json.RawMessage
type CronCreateTool ¶ added in v1.1.45
CronCreateTool creates a new scheduled job.
func (CronCreateTool) Description ¶ added in v1.1.45
func (t CronCreateTool) Description() string
func (CronCreateTool) Execute ¶ added in v1.1.45
func (t CronCreateTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (CronCreateTool) Name ¶ added in v1.1.45
func (t CronCreateTool) Name() string
func (CronCreateTool) Parameters ¶ added in v1.1.45
func (t CronCreateTool) Parameters() json.RawMessage
type CronDeleteTool ¶ added in v1.1.45
CronDeleteTool deletes a scheduled job.
func (CronDeleteTool) Description ¶ added in v1.1.45
func (t CronDeleteTool) Description() string
func (CronDeleteTool) Execute ¶ added in v1.1.45
func (t CronDeleteTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (CronDeleteTool) Name ¶ added in v1.1.45
func (t CronDeleteTool) Name() string
func (CronDeleteTool) Parameters ¶ added in v1.1.45
func (t CronDeleteTool) Parameters() json.RawMessage
type CronListTool ¶ added in v1.1.45
CronListTool lists all scheduled jobs.
func (CronListTool) Description ¶ added in v1.1.45
func (t CronListTool) Description() string
func (CronListTool) Execute ¶ added in v1.1.45
func (t CronListTool) Execute(_ context.Context, _ json.RawMessage) (Result, error)
func (CronListTool) Name ¶ added in v1.1.45
func (t CronListTool) Name() string
func (CronListTool) Parameters ¶ added in v1.1.45
func (t CronListTool) Parameters() json.RawMessage
type EditFile ¶
type EditFile struct {
SandboxCheck AllowedPathChecker
}
EditFile implements the edit_file tool for find-and-replace editing.
func (EditFile) Description ¶
func (EditFile) Parameters ¶
func (t EditFile) Parameters() json.RawMessage
type EnterPlanModeTool ¶ added in v1.1.45
type EnterPlanModeTool struct {
Switcher ModeSwitcher
}
func (EnterPlanModeTool) Description ¶ added in v1.1.45
func (t EnterPlanModeTool) Description() string
func (EnterPlanModeTool) Execute ¶ added in v1.1.45
func (t EnterPlanModeTool) Execute(_ context.Context, _ json.RawMessage) (Result, error)
func (EnterPlanModeTool) Name ¶ added in v1.1.45
func (t EnterPlanModeTool) Name() string
func (EnterPlanModeTool) Parameters ¶ added in v1.1.45
func (t EnterPlanModeTool) Parameters() json.RawMessage
type EnterWorktree ¶ added in v1.1.45
type EnterWorktree struct {
WorkingDir string
}
EnterWorktree creates a new git worktree for isolated work.
func (EnterWorktree) Clone ¶ added in v1.2.7
func (t EnterWorktree) Clone() Tool
Clone returns an independent copy of EnterWorktree for use by a different agent.
func (EnterWorktree) Description ¶ added in v1.1.45
func (t EnterWorktree) Description() string
func (EnterWorktree) Execute ¶ added in v1.1.45
func (t EnterWorktree) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (EnterWorktree) Name ¶ added in v1.1.45
func (t EnterWorktree) Name() string
func (EnterWorktree) Parameters ¶ added in v1.1.45
func (t EnterWorktree) Parameters() json.RawMessage
type ExitPlanModeTool ¶ added in v1.1.45
type ExitPlanModeTool struct {
Switcher ModeSwitcher
DefaultMode permission.PermissionMode
}
func (ExitPlanModeTool) Description ¶ added in v1.1.45
func (t ExitPlanModeTool) Description() string
func (ExitPlanModeTool) Execute ¶ added in v1.1.45
func (t ExitPlanModeTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (ExitPlanModeTool) Name ¶ added in v1.1.45
func (t ExitPlanModeTool) Name() string
func (ExitPlanModeTool) Parameters ¶ added in v1.1.45
func (t ExitPlanModeTool) Parameters() json.RawMessage
type ExitWorktree ¶ added in v1.1.45
type ExitWorktree struct {
WorkingDir string
}
ExitWorktree exits and optionally removes a git worktree.
func (ExitWorktree) Clone ¶ added in v1.2.7
func (t ExitWorktree) Clone() Tool
Clone returns an independent copy of ExitWorktree for use by a different agent.
func (ExitWorktree) Description ¶ added in v1.1.45
func (t ExitWorktree) Description() string
func (ExitWorktree) Execute ¶ added in v1.1.45
func (t ExitWorktree) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ExitWorktree) Name ¶ added in v1.1.45
func (t ExitWorktree) Name() string
func (ExitWorktree) Parameters ¶ added in v1.1.45
func (t ExitWorktree) Parameters() json.RawMessage
type GateBehavior ¶ added in v1.1.45
type GateBehavior int
const ( Allow GateBehavior = iota Ask Block )
type GateResult ¶ added in v1.1.45
type GateResult struct {
Behavior GateBehavior
CleanedCmd string // sanitized command (may differ from original)
Reason string // human-readable explanation
Warnings []string // informational warnings (shown but don't affect flow)
}
GateResult is the outcome of a command gate check.
func (GateResult) Allowed ¶ added in v1.1.45
func (r GateResult) Allowed() bool
Allowed returns true if the command can execute without confirmation.
func (GateResult) IsBlocked ¶ added in v1.1.45
func (r GateResult) IsBlocked() bool
IsBlocked returns true if the command must never execute.
func (GateResult) NeedsConfirmation ¶ added in v1.1.45
func (r GateResult) NeedsConfirmation() bool
NeedsConfirmation returns true if the command requires user approval.
type GetMCPPromptTool ¶
type GetMCPPromptTool struct {
Runtime MCPRuntime
}
func (GetMCPPromptTool) Description ¶
func (t GetMCPPromptTool) Description() string
func (GetMCPPromptTool) Execute ¶
func (t GetMCPPromptTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (GetMCPPromptTool) Name ¶
func (t GetMCPPromptTool) Name() string
func (GetMCPPromptTool) Parameters ¶
func (t GetMCPPromptTool) Parameters() json.RawMessage
type GitAdd ¶ added in v1.1.45
type GitAdd struct {
WorkingDir string
}
GitAdd implements the git_add tool.
func (GitAdd) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitAdd) Description ¶ added in v1.1.45
func (GitAdd) Parameters ¶ added in v1.1.45
func (t GitAdd) Parameters() json.RawMessage
type GitBlame ¶ added in v1.1.45
type GitBlame struct{ WorkingDir string }
GitBlame implements the git_blame tool.
func (GitBlame) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitBlame) Description ¶ added in v1.1.45
func (GitBlame) Parameters ¶ added in v1.1.45
func (t GitBlame) Parameters() json.RawMessage
type GitBranchList ¶ added in v1.1.45
type GitBranchList struct{ WorkingDir string }
GitBranchList implements the git_branch_list tool.
func (GitBranchList) Clone ¶ added in v1.2.7
func (t GitBranchList) Clone() Tool
Clone returns an independent copy of this tool for use by a different agent.
func (GitBranchList) Description ¶ added in v1.1.45
func (t GitBranchList) Description() string
func (GitBranchList) Execute ¶ added in v1.1.45
func (t GitBranchList) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (GitBranchList) Name ¶ added in v1.1.45
func (t GitBranchList) Name() string
func (GitBranchList) Parameters ¶ added in v1.1.45
func (t GitBranchList) Parameters() json.RawMessage
type GitCommit ¶ added in v1.1.45
type GitCommit struct{ WorkingDir string }
GitCommit implements the git_commit tool.
func (GitCommit) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitCommit) Description ¶ added in v1.1.45
func (GitCommit) Parameters ¶ added in v1.1.45
func (t GitCommit) Parameters() json.RawMessage
type GitDiff ¶
type GitDiff struct{ WorkingDir string }
GitDiff implements the git_diff tool.
func (GitDiff) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitDiff) Description ¶
func (GitDiff) Parameters ¶
func (t GitDiff) Parameters() json.RawMessage
type GitLog ¶
type GitLog struct{ WorkingDir string }
GitLog implements the git_log tool.
func (GitLog) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitLog) Description ¶
func (GitLog) Parameters ¶
func (t GitLog) Parameters() json.RawMessage
type GitRemote ¶ added in v1.1.45
type GitRemote struct{ WorkingDir string }
GitRemote implements the git_remote tool.
func (GitRemote) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitRemote) Description ¶ added in v1.1.45
func (GitRemote) Parameters ¶ added in v1.1.45
func (t GitRemote) Parameters() json.RawMessage
type GitShow ¶ added in v1.1.45
type GitShow struct{ WorkingDir string }
GitShow implements the git_show tool.
func (GitShow) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitShow) Description ¶ added in v1.1.45
func (GitShow) Parameters ¶ added in v1.1.45
func (t GitShow) Parameters() json.RawMessage
type GitStash ¶ added in v1.1.45
type GitStash struct{ WorkingDir string }
GitStash implements the git_stash tool for push/pop/apply/drop operations.
func (GitStash) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitStash) Description ¶ added in v1.1.45
func (GitStash) Parameters ¶ added in v1.1.45
func (t GitStash) Parameters() json.RawMessage
type GitStashList ¶ added in v1.1.45
type GitStashList struct{ WorkingDir string }
GitStashList implements the git_stash_list tool.
func (GitStashList) Clone ¶ added in v1.2.7
func (t GitStashList) Clone() Tool
Clone returns an independent copy of this tool for use by a different agent.
func (GitStashList) Description ¶ added in v1.1.45
func (t GitStashList) Description() string
func (GitStashList) Execute ¶ added in v1.1.45
func (t GitStashList) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (GitStashList) Name ¶ added in v1.1.45
func (t GitStashList) Name() string
func (GitStashList) Parameters ¶ added in v1.1.45
func (t GitStashList) Parameters() json.RawMessage
type GitStatus ¶
type GitStatus struct{ WorkingDir string }
GitStatus implements the git_status tool.
func (GitStatus) Clone ¶ added in v1.2.7
Clone returns an independent copy of this tool for use by a different agent.
func (GitStatus) Description ¶
func (GitStatus) Parameters ¶
func (t GitStatus) Parameters() json.RawMessage
type Glob ¶
type Glob struct {
SandboxCheck AllowedPathChecker
}
Glob implements the glob tool for file path matching.
func (Glob) Description ¶
func (Glob) Parameters ¶
func (t Glob) Parameters() json.RawMessage
type Grep ¶ added in v1.1.45
type Grep struct {
SandboxCheck AllowedPathChecker
}
Grep implements a powerful file content search tool (ripgrep wrapper with Go fallback).
func (Grep) Description ¶ added in v1.1.45
func (Grep) Parameters ¶ added in v1.1.45
func (t Grep) Parameters() json.RawMessage
type ListAgentsTool ¶
ListAgentsTool implements the list_agents tool.
func (ListAgentsTool) Description ¶
func (t ListAgentsTool) Description() string
func (ListAgentsTool) Execute ¶
func (t ListAgentsTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ListAgentsTool) Name ¶
func (t ListAgentsTool) Name() string
func (ListAgentsTool) Parameters ¶
func (t ListAgentsTool) Parameters() json.RawMessage
type ListCommandsTool ¶
type ListCommandsTool struct {
Manager *CommandJobManager
}
func (ListCommandsTool) Description ¶
func (t ListCommandsTool) Description() string
func (ListCommandsTool) Execute ¶
func (t ListCommandsTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ListCommandsTool) Name ¶
func (t ListCommandsTool) Name() string
func (ListCommandsTool) Parameters ¶
func (t ListCommandsTool) Parameters() json.RawMessage
type ListDir ¶
type ListDir struct {
SandboxCheck AllowedPathChecker
}
ListDir implements the list_directory tool.
func (ListDir) Description ¶
func (ListDir) Parameters ¶
func (t ListDir) Parameters() json.RawMessage
type ListMCPCapabilitiesTool ¶
type ListMCPCapabilitiesTool struct {
Runtime MCPRuntime
}
func (ListMCPCapabilitiesTool) Description ¶
func (t ListMCPCapabilitiesTool) Description() string
func (ListMCPCapabilitiesTool) Execute ¶
func (t ListMCPCapabilitiesTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ListMCPCapabilitiesTool) Name ¶
func (t ListMCPCapabilitiesTool) Name() string
func (ListMCPCapabilitiesTool) Parameters ¶
func (t ListMCPCapabilitiesTool) Parameters() json.RawMessage
type MCPPromptMessage ¶
type MCPPromptResult ¶
type MCPPromptResult struct {
Description string
Messages []MCPPromptMessage
}
type MCPResourceContent ¶
type MCPResourceResult ¶
type MCPResourceResult struct {
Contents []MCPResourceContent
}
type MCPRuntime ¶
type MCPRuntime interface {
SnapshotMCP() []MCPServerSnapshot
GetPrompt(ctx context.Context, server, name string, args map[string]interface{}) (*MCPPromptResult, error)
ReadResource(ctx context.Context, server, uri string) (*MCPResourceResult, error)
}
type MCPServerSnapshot ¶
type ModeSwitcher ¶ added in v1.1.45
type ModeSwitcher interface {
SetMode(mode permission.PermissionMode)
// RememberMode saves the given mode as the "previous" mode so it
// can be restored by a later mode switch. Returns the mode that
// was previously remembered (SupervisedMode if none).
RememberMode(mode permission.PermissionMode) permission.PermissionMode
// RestoreMode returns the remembered mode, or the given fallback.
RestoreMode(fallback permission.PermissionMode) permission.PermissionMode
}
ModeSwitcher switches the agent's permission mode and remembers the previous mode so that exit_plan_mode can restore it.
type MultiEditFile ¶ added in v1.1.45
type MultiEditFile struct {
SandboxCheck AllowedPathChecker
}
MultiEditFile applies multiple find-and-replace edits to a single file in one call.
func (MultiEditFile) Description ¶ added in v1.1.45
func (t MultiEditFile) Description() string
func (MultiEditFile) Execute ¶ added in v1.1.45
func (t MultiEditFile) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (MultiEditFile) Name ¶ added in v1.1.45
func (t MultiEditFile) Name() string
func (MultiEditFile) Parameters ¶ added in v1.1.45
func (t MultiEditFile) Parameters() json.RawMessage
type MultiFileEdit ¶ added in v1.3.8
type MultiFileEdit struct {
SandboxCheck AllowedPathChecker
}
func (MultiFileEdit) Description ¶ added in v1.3.8
func (t MultiFileEdit) Description() string
func (MultiFileEdit) Execute ¶ added in v1.3.8
func (t MultiFileEdit) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (MultiFileEdit) Name ¶ added in v1.3.8
func (t MultiFileEdit) Name() string
func (MultiFileEdit) Parameters ¶ added in v1.3.8
func (t MultiFileEdit) Parameters() json.RawMessage
func (MultiFileEdit) PreviewChanges ¶ added in v1.3.8
func (t MultiFileEdit) PreviewChanges(input json.RawMessage) ([]PlannedFileEdit, error)
type MultiFileEditContent ¶ added in v1.3.8
type MultiFileEditContent struct {
Summary string `json:"summary"`
Mode string `json:"mode"`
Applied bool `json:"applied"`
PlannedFiles int `json:"planned_files"`
WrittenFiles int `json:"written_files"`
FailedFiles int `json:"failed_files"`
SkippedFiles int `json:"skipped_files"`
WrittenPaths []string `json:"written_paths"`
FailedPaths []string `json:"failed_paths"`
SkippedPaths []string `json:"skipped_paths"`
Results []MultiFileEditFileResult `json:"results"`
}
type MultiFileEditFileResult ¶ added in v1.3.8
type MultiFileRead ¶ added in v1.3.8
type MultiFileRead struct {
SandboxCheck AllowedPathChecker
}
func (MultiFileRead) Description ¶ added in v1.3.8
func (t MultiFileRead) Description() string
func (MultiFileRead) Execute ¶ added in v1.3.8
func (t MultiFileRead) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (MultiFileRead) Name ¶ added in v1.3.8
func (t MultiFileRead) Name() string
func (MultiFileRead) Parameters ¶ added in v1.3.8
func (t MultiFileRead) Parameters() json.RawMessage
type NotebookEdit ¶ added in v1.1.45
type NotebookEdit struct {
SandboxCheck AllowedPathChecker
}
NotebookEdit edits Jupyter Notebook (.ipynb) cells.
func (NotebookEdit) Description ¶ added in v1.1.45
func (t NotebookEdit) Description() string
func (NotebookEdit) Execute ¶ added in v1.1.45
func (t NotebookEdit) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (NotebookEdit) Name ¶ added in v1.1.45
func (t NotebookEdit) Name() string
func (NotebookEdit) Parameters ¶ added in v1.1.45
func (t NotebookEdit) Parameters() json.RawMessage
type PlannedFileEdit ¶ added in v1.3.8
type ReadCommandOutputTool ¶
type ReadCommandOutputTool struct {
Manager *CommandJobManager
}
func (ReadCommandOutputTool) Description ¶
func (t ReadCommandOutputTool) Description() string
func (ReadCommandOutputTool) Execute ¶
func (t ReadCommandOutputTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ReadCommandOutputTool) Name ¶
func (t ReadCommandOutputTool) Name() string
func (ReadCommandOutputTool) Parameters ¶
func (t ReadCommandOutputTool) Parameters() json.RawMessage
type ReadFile ¶
type ReadFile struct {
SandboxCheck AllowedPathChecker
}
ReadFile implements the read_file tool.
func (ReadFile) Description ¶
func (ReadFile) Parameters ¶
func (t ReadFile) Parameters() json.RawMessage
type ReadMCPResourceTool ¶
type ReadMCPResourceTool struct {
Runtime MCPRuntime
}
func (ReadMCPResourceTool) Description ¶
func (t ReadMCPResourceTool) Description() string
func (ReadMCPResourceTool) Execute ¶
func (t ReadMCPResourceTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (ReadMCPResourceTool) Name ¶
func (t ReadMCPResourceTool) Name() string
func (ReadMCPResourceTool) Parameters ¶
func (t ReadMCPResourceTool) Parameters() json.RawMessage
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages the set of available tools.
func (*Registry) Clone ¶ added in v1.2.7
Clone creates a deep copy of the registry. Tools implementing the Cloner interface are individually cloned; others are shared (they are stateless). This is used when creating sub-agents and swarm teammates so each agent has its own independent tool instances with separate WorkingDir fields.
func (*Registry) Register ¶
Register adds a tool to the registry. Returns error if name is already taken.
func (*Registry) ToDefinitions ¶
func (r *Registry) ToDefinitions() []provider.ToolDefinition
ToDefinitions converts all tools to provider.ToolDefinition for the LLM.
func (*Registry) Unregister ¶
Unregister removes a tool by name.
type Result ¶
type Result struct {
Content string `json:"content"`
IsError bool `json:"is_error"`
Images []ResultImage `json:"images,omitempty"`
// SuggestedWorkingDir is an optional hint from a tool that the agent's
// working directory should change. When non-empty, the agent loop will
// update its WorkingDir to this value so subsequent tool calls (e.g.
// run_command, read_file) operate in the new directory automatically.
SuggestedWorkingDir string `json:"suggested_working_dir,omitempty"`
// FollowUpMessages are additional messages injected after the tool_result.
// Used by inline skills to inject skill instructions as a user message,
// forcing the model to process and act on them.
FollowUpMessages []provider.Message `json:"follow_up_messages,omitempty"`
}
Result is the output returned to the LLM. IsError: true means the tool execution had a user-visible error (shown to LLM). The Go error return is for system-level failures only (panic recovery, etc).
type ResultImage ¶ added in v1.1.34
type ResultImage struct {
MIME string `json:"mime"` // "image/png", "image/jpeg", etc.
Base64 string `json:"base64"` // base64-encoded image data
Width int `json:"width"` // original pixel width (0 if unknown)
Height int `json:"height"` // original pixel height (0 if unknown)
SourcePath string `json:"source_path"` // file path the image was read from
}
ResultImage carries a single image within a tool Result.
type RunCommand ¶
type RunCommand struct {
// WorkingDir is the fixed working directory set by the agent.
// LLM-provided working_dir is ignored to prevent sandbox escape.
WorkingDir string
// JobManager is used to auto-background long-running commands.
JobManager *CommandJobManager
// Policy provides the current permission mode. When set and the mode
// is Bypass or Autopilot, "Ask" gate results are automatically downgraded
// to Allow (with a warning log) instead of blocking execution.
Policy permission.PermissionPolicy
}
RunCommand implements the run_command tool for executing shell commands.
func (RunCommand) Clone ¶ added in v1.2.7
func (t RunCommand) Clone() Tool
Clone returns an independent copy of this tool for use by a different agent.
func (RunCommand) Description ¶
func (t RunCommand) Description() string
func (RunCommand) Execute ¶
func (t RunCommand) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (RunCommand) Name ¶
func (t RunCommand) Name() string
func (RunCommand) Parameters ¶
func (t RunCommand) Parameters() json.RawMessage
type SaveMemoryTool ¶
type SaveMemoryTool struct {
// contains filtered or unexported fields
}
SaveMemoryTool lets the agent save experiences to persistent memory.
func NewSaveMemoryTool ¶
func NewSaveMemoryTool(globalMem, projectMem *memory.AutoMemory) *SaveMemoryTool
NewSaveMemoryTool creates a save_memory tool with global and project memory.
func (*SaveMemoryTool) Description ¶
func (t *SaveMemoryTool) Description() string
func (*SaveMemoryTool) Execute ¶
func (t *SaveMemoryTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (*SaveMemoryTool) Name ¶
func (t *SaveMemoryTool) Name() string
func (*SaveMemoryTool) Parameters ¶
func (t *SaveMemoryTool) Parameters() json.RawMessage
func (*SaveMemoryTool) SetAfterSave ¶ added in v1.3.47
func (t *SaveMemoryTool) SetAfterSave(fn func())
SetAfterSave configures a callback that runs after memory is persisted. Callers can use this to refresh any in-memory prompt state that includes auto memory from disk.
type SearchFiles ¶
type SearchFiles struct {
SandboxCheck AllowedPathChecker
}
SearchFiles implements the search_files tool (grep-like content search).
func (SearchFiles) Description ¶
func (t SearchFiles) Description() string
func (SearchFiles) Execute ¶
func (t SearchFiles) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (SearchFiles) Name ¶
func (t SearchFiles) Name() string
func (SearchFiles) Parameters ¶
func (t SearchFiles) Parameters() json.RawMessage
type SendMessageTool ¶ added in v1.1.45
SendMessageTool sends a message to one or all running sub-agents or swarm teammates.
func (SendMessageTool) Description ¶ added in v1.1.45
func (t SendMessageTool) Description() string
func (SendMessageTool) Execute ¶ added in v1.1.45
func (t SendMessageTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (SendMessageTool) Name ¶ added in v1.1.45
func (t SendMessageTool) Name() string
func (SendMessageTool) Parameters ¶ added in v1.1.45
func (t SendMessageTool) Parameters() json.RawMessage
type SkillExecutionEvent ¶ added in v1.1.43
type SkillExecutionMode ¶ added in v1.1.43
type SkillExecutionMode string
const ( SkillExecutionModeInline SkillExecutionMode = "inline" SkillExecutionModeFork SkillExecutionMode = "fork" SkillExecutionModeMCP SkillExecutionMode = "mcp" )
type SkillTool ¶
type SkillTool struct {
Skills SkillLookup
Runtime MCPRuntime
Provider provider.Provider
Tools *Registry
AgentFactory subagent.AgentFactory
WorkingDir string // working directory to propagate to sub-agent
OnUsage func(provider.TokenUsage)
OnSkillUsed func(ref string) // optional callback when a skill is loaded by the agent
OnSkillCompleted func(event SkillExecutionEvent) // optional callback when execution finishes
}
func (SkillTool) Clone ¶ added in v1.2.7
Clone returns an independent copy of SkillTool for use by a different agent. Skills, Runtime, Provider, Tools, AgentFactory, and callbacks are shared. Only WorkingDir is agent-specific.
func (SkillTool) Description ¶
func (SkillTool) Parameters ¶
func (t SkillTool) Parameters() json.RawMessage
type SleepTool ¶ added in v1.1.45
type SleepTool struct{}
SleepTool pauses execution for a specified duration.
func (SleepTool) Description ¶ added in v1.1.45
func (SleepTool) Parameters ¶ added in v1.1.45
func (t SleepTool) Parameters() json.RawMessage
type SpawnAgentTool ¶
type SpawnAgentTool struct {
Manager *subagent.Manager
Provider provider.Provider
Tools *Registry
AgentFactory subagent.AgentFactory
WorkingDir string // working directory to propagate to sub-agent
OnUsage func(provider.TokenUsage)
}
SpawnAgentTool implements the spawn_agent tool.
func (SpawnAgentTool) Clone ¶ added in v1.2.7
func (t SpawnAgentTool) Clone() Tool
Clone returns an independent copy of SpawnAgentTool for use by a different agent. Manager, Provider, AgentFactory, and Tools are intentionally shared across agents (they coordinate sub-agent lifecycle). Only WorkingDir is agent-specific.
func (SpawnAgentTool) Description ¶
func (t SpawnAgentTool) Description() string
func (SpawnAgentTool) Execute ¶
func (t SpawnAgentTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (SpawnAgentTool) Name ¶
func (t SpawnAgentTool) Name() string
func (SpawnAgentTool) Parameters ¶
func (t SpawnAgentTool) Parameters() json.RawMessage
type StartCommandTool ¶
type StartCommandTool struct {
Manager *CommandJobManager
Policy permission.PermissionPolicy
}
func (StartCommandTool) Description ¶
func (t StartCommandTool) Description() string
func (StartCommandTool) Execute ¶
func (t StartCommandTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (StartCommandTool) Name ¶
func (t StartCommandTool) Name() string
func (StartCommandTool) Parameters ¶
func (t StartCommandTool) Parameters() json.RawMessage
type StopCommandTool ¶
type StopCommandTool struct {
Manager *CommandJobManager
}
func (StopCommandTool) Description ¶
func (t StopCommandTool) Description() string
func (StopCommandTool) Execute ¶
func (t StopCommandTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (StopCommandTool) Name ¶
func (t StopCommandTool) Name() string
func (StopCommandTool) Parameters ¶
func (t StopCommandTool) Parameters() json.RawMessage
type SwarmTaskClaimTool ¶ added in v1.1.45
func (SwarmTaskClaimTool) Description ¶ added in v1.1.45
func (t SwarmTaskClaimTool) Description() string
func (SwarmTaskClaimTool) Execute ¶ added in v1.1.45
func (t SwarmTaskClaimTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (SwarmTaskClaimTool) Name ¶ added in v1.1.45
func (t SwarmTaskClaimTool) Name() string
func (SwarmTaskClaimTool) Parameters ¶ added in v1.1.45
func (t SwarmTaskClaimTool) Parameters() json.RawMessage
type SwarmTaskCompleteTool ¶ added in v1.1.45
func (SwarmTaskCompleteTool) Description ¶ added in v1.1.45
func (t SwarmTaskCompleteTool) Description() string
func (SwarmTaskCompleteTool) Execute ¶ added in v1.1.45
func (t SwarmTaskCompleteTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (SwarmTaskCompleteTool) Name ¶ added in v1.1.45
func (t SwarmTaskCompleteTool) Name() string
func (SwarmTaskCompleteTool) Parameters ¶ added in v1.1.45
func (t SwarmTaskCompleteTool) Parameters() json.RawMessage
type SwarmTaskCreateTool ¶ added in v1.1.45
func (SwarmTaskCreateTool) Description ¶ added in v1.1.45
func (t SwarmTaskCreateTool) Description() string
func (SwarmTaskCreateTool) Execute ¶ added in v1.1.45
func (t SwarmTaskCreateTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (SwarmTaskCreateTool) Name ¶ added in v1.1.45
func (t SwarmTaskCreateTool) Name() string
func (SwarmTaskCreateTool) Parameters ¶ added in v1.1.45
func (t SwarmTaskCreateTool) Parameters() json.RawMessage
type SwarmTaskListTool ¶ added in v1.1.45
func (SwarmTaskListTool) Description ¶ added in v1.1.45
func (t SwarmTaskListTool) Description() string
func (SwarmTaskListTool) Execute ¶ added in v1.1.45
func (t SwarmTaskListTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (SwarmTaskListTool) Name ¶ added in v1.1.45
func (t SwarmTaskListTool) Name() string
func (SwarmTaskListTool) Parameters ¶ added in v1.1.45
func (t SwarmTaskListTool) Parameters() json.RawMessage
type TaskCreateTool ¶ added in v1.1.45
func (TaskCreateTool) Description ¶ added in v1.1.45
func (t TaskCreateTool) Description() string
func (TaskCreateTool) Execute ¶ added in v1.1.45
func (t TaskCreateTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TaskCreateTool) Name ¶ added in v1.1.45
func (t TaskCreateTool) Name() string
func (TaskCreateTool) Parameters ¶ added in v1.1.45
func (t TaskCreateTool) Parameters() json.RawMessage
type TaskGetTool ¶ added in v1.1.45
func (TaskGetTool) Description ¶ added in v1.1.45
func (t TaskGetTool) Description() string
func (TaskGetTool) Execute ¶ added in v1.1.45
func (t TaskGetTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TaskGetTool) Name ¶ added in v1.1.45
func (t TaskGetTool) Name() string
func (TaskGetTool) Parameters ¶ added in v1.1.45
func (t TaskGetTool) Parameters() json.RawMessage
type TaskListTool ¶ added in v1.1.45
func (TaskListTool) Description ¶ added in v1.1.45
func (t TaskListTool) Description() string
func (TaskListTool) Execute ¶ added in v1.1.45
func (t TaskListTool) Execute(_ context.Context, _ json.RawMessage) (Result, error)
func (TaskListTool) Name ¶ added in v1.1.45
func (t TaskListTool) Name() string
func (TaskListTool) Parameters ¶ added in v1.1.45
func (t TaskListTool) Parameters() json.RawMessage
type TaskOutputTool ¶ added in v1.1.45
type TaskOutputTool struct {
Provider BackgroundTaskProvider
}
TaskOutputTool retrieves the output of a background task by ID.
func (TaskOutputTool) Description ¶ added in v1.1.45
func (t TaskOutputTool) Description() string
func (TaskOutputTool) Execute ¶ added in v1.1.45
func (t TaskOutputTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TaskOutputTool) Name ¶ added in v1.1.45
func (t TaskOutputTool) Name() string
func (TaskOutputTool) Parameters ¶ added in v1.1.45
func (t TaskOutputTool) Parameters() json.RawMessage
type TaskStopTool ¶ added in v1.1.45
func (TaskStopTool) Description ¶ added in v1.1.45
func (t TaskStopTool) Description() string
func (TaskStopTool) Execute ¶ added in v1.1.45
func (t TaskStopTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TaskStopTool) Name ¶ added in v1.1.45
func (t TaskStopTool) Name() string
func (TaskStopTool) Parameters ¶ added in v1.1.45
func (t TaskStopTool) Parameters() json.RawMessage
type TaskUpdateTool ¶ added in v1.1.45
func (TaskUpdateTool) Description ¶ added in v1.1.45
func (t TaskUpdateTool) Description() string
func (TaskUpdateTool) Execute ¶ added in v1.1.45
func (t TaskUpdateTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TaskUpdateTool) Name ¶ added in v1.1.45
func (t TaskUpdateTool) Name() string
func (TaskUpdateTool) Parameters ¶ added in v1.1.45
func (t TaskUpdateTool) Parameters() json.RawMessage
type TeamCreateTool ¶ added in v1.1.45
func (TeamCreateTool) Description ¶ added in v1.1.45
func (t TeamCreateTool) Description() string
func (TeamCreateTool) Execute ¶ added in v1.1.45
func (t TeamCreateTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeamCreateTool) Name ¶ added in v1.1.45
func (t TeamCreateTool) Name() string
func (TeamCreateTool) Parameters ¶ added in v1.1.45
func (t TeamCreateTool) Parameters() json.RawMessage
type TeamDeleteTool ¶ added in v1.1.45
func (TeamDeleteTool) Description ¶ added in v1.1.45
func (t TeamDeleteTool) Description() string
func (TeamDeleteTool) Execute ¶ added in v1.1.45
func (t TeamDeleteTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeamDeleteTool) Name ¶ added in v1.1.45
func (t TeamDeleteTool) Name() string
func (TeamDeleteTool) Parameters ¶ added in v1.1.45
func (t TeamDeleteTool) Parameters() json.RawMessage
type TeammateListTool ¶ added in v1.1.45
func (TeammateListTool) Description ¶ added in v1.1.45
func (t TeammateListTool) Description() string
func (TeammateListTool) Execute ¶ added in v1.1.45
func (t TeammateListTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeammateListTool) Name ¶ added in v1.1.45
func (t TeammateListTool) Name() string
func (TeammateListTool) Parameters ¶ added in v1.1.45
func (t TeammateListTool) Parameters() json.RawMessage
type TeammateResultsTool ¶ added in v1.1.45
func (TeammateResultsTool) Description ¶ added in v1.1.45
func (t TeammateResultsTool) Description() string
func (TeammateResultsTool) Execute ¶ added in v1.1.45
func (t TeammateResultsTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeammateResultsTool) Name ¶ added in v1.1.45
func (t TeammateResultsTool) Name() string
func (TeammateResultsTool) Parameters ¶ added in v1.1.45
func (t TeammateResultsTool) Parameters() json.RawMessage
type TeammateShutdownTool ¶ added in v1.1.45
func (TeammateShutdownTool) Description ¶ added in v1.1.45
func (t TeammateShutdownTool) Description() string
func (TeammateShutdownTool) Execute ¶ added in v1.1.45
func (t TeammateShutdownTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeammateShutdownTool) Name ¶ added in v1.1.45
func (t TeammateShutdownTool) Name() string
func (TeammateShutdownTool) Parameters ¶ added in v1.1.45
func (t TeammateShutdownTool) Parameters() json.RawMessage
type TeammateSpawnTool ¶ added in v1.1.45
func (TeammateSpawnTool) Description ¶ added in v1.1.45
func (t TeammateSpawnTool) Description() string
func (TeammateSpawnTool) Execute ¶ added in v1.1.45
func (t TeammateSpawnTool) Execute(_ context.Context, input json.RawMessage) (Result, error)
func (TeammateSpawnTool) Name ¶ added in v1.1.45
func (t TeammateSpawnTool) Name() string
func (TeammateSpawnTool) Parameters ¶ added in v1.1.45
func (t TeammateSpawnTool) Parameters() json.RawMessage
type Todo ¶
type Todo struct {
ID string `json:"id"`
Content string `json:"content"`
Status string `json:"status"` // "pending", "in_progress", "done"
}
Todo represents a single todo item.
type TodoWrite ¶
type TodoWrite struct {
// contains filtered or unexported fields
}
TodoWrite implements the todo_write tool — manages a persistent todo list.
func NewTodoWrite ¶
NewTodoWrite creates a TodoWrite tool. dir defaults to ~/.ggcode.
func NewWorkspaceTodoWrite ¶ added in v1.1.7
func (*TodoWrite) Description ¶
func (*TodoWrite) Parameters ¶
func (t *TodoWrite) Parameters() json.RawMessage
type Tool ¶
type Tool interface {
// Name returns the unique tool identifier (e.g., "read_file").
Name() string
// Description returns a human-readable description shown to the LLM.
Description() string
// Parameters returns a JSON Schema object describing the tool's input.
// Must be a valid JSON object with "type": "object" at minimum.
Parameters() json.RawMessage
// Execute runs the tool with the given input and returns the result.
Execute(ctx context.Context, input json.RawMessage) (Result, error)
}
Tool is the interface every tool (built-in, MCP-adapted, or plugin) must implement.
func NewLSPTools ¶ added in v1.1.25
func NewLSPTools(workingDir string, readSandbox, writeSandbox AllowedPathChecker) []Tool
type ToolPresentation ¶ added in v1.1.49
type ToolPresentation struct {
DisplayName string // e.g. "Read", "Edit", "go test ./..."
Detail string // e.g. "/tmp/test.go", ""
}
ToolPresentation holds the human-readable display info for a tool call.
func DescribeTool ¶ added in v1.1.49
func DescribeTool(toolName, rawArgs string) ToolPresentation
DescribeTool returns a human-readable presentation for a tool call. It picks the key argument(s) for each tool and formats them compactly. This is the shared implementation used by TUI, daemon, IM, and ACP.
type ToolResultPresentation ¶ added in v1.3.24
type ToolResultPresentation struct {
Summary string // compact always-visible summary
Payload string // optional expanded detail payload
PayloadMode string // "", "text", "task_fields", "task_list"
}
ToolResultPresentation holds shared semantic fields for a rendered tool result.
func DescribeTaskToolResult ¶ added in v1.3.24
func DescribeTaskToolResult(toolName, rawArgs, result string, isError bool) (ToolResultPresentation, bool)
DescribeTaskToolResult returns shared summary/payload semantics for task_* tools.
func DescribeToolResult ¶ added in v1.3.27
func DescribeToolResult(toolName, rawArgs, result string, isError bool) (ToolResultPresentation, bool)
DescribeToolResult returns shared summary/payload semantics for structured tool results.
type WaitAgentTool ¶
WaitAgentTool implements the wait_agent tool.
func (WaitAgentTool) Description ¶
func (t WaitAgentTool) Description() string
func (WaitAgentTool) Execute ¶
func (t WaitAgentTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (WaitAgentTool) Name ¶
func (t WaitAgentTool) Name() string
func (WaitAgentTool) Parameters ¶
func (t WaitAgentTool) Parameters() json.RawMessage
type WaitCommandTool ¶
type WaitCommandTool struct {
Manager *CommandJobManager
}
func (WaitCommandTool) Description ¶
func (t WaitCommandTool) Description() string
func (WaitCommandTool) Execute ¶
func (t WaitCommandTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (WaitCommandTool) Name ¶
func (t WaitCommandTool) Name() string
func (WaitCommandTool) Parameters ¶
func (t WaitCommandTool) Parameters() json.RawMessage
type WebFetch ¶
type WebFetch struct {
// AllowPrivate disables SSRF protection. Only use for testing.
AllowPrivate bool
}
WebFetch implements the web_fetch tool — fetches a URL and returns text content.
func (WebFetch) Description ¶
func (WebFetch) Parameters ¶
func (t WebFetch) Parameters() json.RawMessage
type WebSearch ¶
type WebSearch struct{}
WebSearch implements the web_search tool — searches using DuckDuckGo HTML.
func (WebSearch) Description ¶
func (WebSearch) Parameters ¶
func (t WebSearch) Parameters() json.RawMessage
type WriteCommandInputTool ¶ added in v1.0.23
type WriteCommandInputTool struct {
Manager *CommandJobManager
}
func (WriteCommandInputTool) Description ¶ added in v1.0.23
func (t WriteCommandInputTool) Description() string
func (WriteCommandInputTool) Execute ¶ added in v1.0.23
func (t WriteCommandInputTool) Execute(ctx context.Context, input json.RawMessage) (Result, error)
func (WriteCommandInputTool) Name ¶ added in v1.0.23
func (t WriteCommandInputTool) Name() string
func (WriteCommandInputTool) Parameters ¶ added in v1.0.23
func (t WriteCommandInputTool) Parameters() json.RawMessage
type WriteFile ¶
type WriteFile struct {
SandboxCheck AllowedPathChecker
}
WriteFile implements the write_file tool.
func (WriteFile) Description ¶
func (WriteFile) Parameters ¶
func (t WriteFile) Parameters() json.RawMessage
Source Files
¶
- ask_user.go
- atomic_write.go
- builtin.go
- command_gate.go
- command_job_tools.go
- command_jobs.go
- config_tool.go
- cron_tools.go
- edit_file.go
- edit_match.go
- file_batch_helpers.go
- git_add.go
- git_blame.go
- git_branch.go
- git_commit.go
- git_diff.go
- git_helpers.go
- git_log.go
- git_remote.go
- git_show.go
- git_stash.go
- git_stash_list.go
- git_status.go
- glob.go
- grep.go
- labels.go
- list_agents.go
- list_dir.go
- lsp.go
- mcp_runtime.go
- multi_edit.go
- multi_file_tools.go
- notebook_edit.go
- plan_mode_tools.go
- read_file.go
- read_file_range.go
- run_command.go
- run_command_unix.go
- save_memory.go
- search_files.go
- send_message.go
- skill.go
- sleep.go
- spawn_agent.go
- swarm_task_tools.go
- task_tools.go
- team_tools.go
- todo_write.go
- tool.go
- wait_agent.go
- web_fetch.go
- web_search.go
- worktree_tools.go
- write_file.go