Documentation
¶
Overview ¶
Package tools registers workspace, shell, MCP, and agent tool implementations.
Package tools defines the model-callable workspace tools and their execution registry.
Index ¶
- func CanonicalToolName(name string) string
- func ClaudeToolAliases() map[string]string
- func ContextWithSessionID(ctx context.Context, sessionID string) context.Context
- func NewMCPToolName(serverName, toolName string) string
- func SessionIDFromContext(ctx context.Context) string
- func SuggestedPermissionRule(name string, input string) string
- func ToolAllowedInPlanMode(name string, permission Permission) bool
- func ToolVisibleInPlanMode(name string, permission Permission) bool
- type AgentTool
- type ApplyPatchTool
- type ApprovalTokenTool
- type AskUserQuestionTool
- type BashOutputTool
- type BashTool
- type BranchFreshnessTool
- type BriefTool
- type CommandTool
- type ConfigTool
- type CronCreateTool
- type CronDeleteTool
- type CronListTool
- type EditFileTool
- type EnterPlanModeTool
- type EnterWorktreeTool
- type ExitPlanModeTool
- type ExitWorktreeTool
- type GetMCPPromptTool
- type GitBlameTool
- type GitDiffTool
- type GitLogTool
- type GitShowTool
- type GitStatusTool
- type GlobTool
- type GrepTool
- type KillBashTool
- type LSPTool
- type LSTool
- type ListMCPPromptsTool
- type ListMCPResourceTemplatesTool
- type ListMCPResourcesTool
- type MCPAuthTool
- type MCPDispatchTool
- type MCPTool
- type MultiEditTool
- type NotebookEditTool
- type NotebookReadTool
- type NudgeTool
- type Permission
- type PermissionCheckTool
- type PermissionDecision
- type PermissionResponse
- type PolicyEvaluateTool
- type PowerShellTool
- type Prompter
- func (p *Prompter) Authorize(name string, required Permission, input json.RawMessage) error
- func (p *Prompter) AuthorizeDecision(name string, required Permission, input json.RawMessage) (PermissionDecision, error)
- func (p *Prompter) Decide(name string, required Permission, input json.RawMessage) PermissionDecision
- type ProvisionalStatusTool
- type REPLTool
- type ReadFileTool
- type ReadMCPResourceTool
- type RecoveryAttemptTool
- type RecoveryRecipeTool
- type RecoveryStatusTool
- type Registry
- func (r *Registry) DeferredInfos() []ToolInfo
- func (r *Registry) Definitions() []anthropic.ToolDefinition
- func (r *Registry) DefinitionsForModel(loaded []string) []anthropic.ToolDefinition
- func (r *Registry) DefinitionsForPlanMode() []anthropic.ToolDefinition
- func (r *Registry) DefinitionsForPlanModeWithLoaded(loaded []string) []anthropic.ToolDefinition
- func (r *Registry) Execute(ctx context.Context, name string, input json.RawMessage, prompter *Prompter) (string, error)
- func (r *Registry) Has(name string) bool
- func (r *Registry) Info(name string) (ToolInfo, bool)
- func (r *Registry) Infos() []ToolInfo
- func (r *Registry) Register(tool Tool)
- func (r *Registry) UpdateBuiltinScope(workspace string, opts RegistryOptions)
- type RegistryOptions
- type RemoteTriggerTool
- type ReportBackpressureTool
- type ReportSchemaTool
- type RetrieveContextTool
- type RoadmapPinpointTool
- type RunTaskPacketTool
- type SendUserMessageTool
- type SkillTool
- type SleepTool
- type StructuredOutputTool
- type TaskCreateTool
- type TaskGetTool
- type TaskHeartbeatTool
- type TaskLaneBoardTool
- type TaskListTool
- type TaskOutputTool
- type TaskStatusTool
- type TaskStopTool
- type TaskSuperviseTool
- type TaskUpdateTool
- type TeamCreateTool
- type TeamDeleteTool
- type TeamGetTool
- type TeamListTool
- type TestingPermissionTool
- type TodoReadTool
- type TodoWriteTool
- type Tool
- type ToolInfo
- type ToolSearchTool
- type UserQuestion
- type UserQuestionOption
- type UserQuestionRequest
- type WebFetchTool
- type WebSearchTool
- type WorkerAwaitReadyTool
- type WorkerCreateTool
- type WorkerGetTool
- type WorkerListTool
- type WorkerObserveCompletionTool
- type WorkerObserveTool
- type WorkerResolveTrustTool
- type WorkerRestartTool
- type WorkerSendPromptTool
- type WorkerStartupTimeoutTool
- type WorkerTerminateTool
- type WriteFileTool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanonicalToolName ¶
CanonicalToolName normalizes a model-supplied tool name or known alias into the canonical registry name used for permission and execution checks.
func ClaudeToolAliases ¶
ClaudeToolAliases returns the Claude-style display aliases accepted by the tool registry, keyed by alias and mapped to Codog's canonical tool names.
func ContextWithSessionID ¶
func NewMCPToolName ¶
NewMCPToolName returns the canonical registry name for a tool exposed by an MCP server.
func SessionIDFromContext ¶
func SuggestedPermissionRule ¶
SuggestedPermissionRule returns a session-scoped allow rule narrowed to the current invocation when its input exposes a stable command, path, or query.
func ToolAllowedInPlanMode ¶
func ToolAllowedInPlanMode(name string, permission Permission) bool
ToolAllowedInPlanMode reports whether a tool may execute while plan mode is active.
func ToolVisibleInPlanMode ¶
func ToolVisibleInPlanMode(name string, permission Permission) bool
ToolVisibleInPlanMode reports whether a tool should be advertised while plan mode is active.
Types ¶
type AgentTool ¶
type AgentTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
Definitions []agentdefs.Definition
PluginDirs []string
}
func (AgentTool) Definition ¶
func (AgentTool) Definition() anthropic.ToolDefinition
func (AgentTool) Permission ¶
func (AgentTool) Permission() Permission
type ApplyPatchTool ¶
func (ApplyPatchTool) Definition ¶
func (ApplyPatchTool) Definition() anthropic.ToolDefinition
func (ApplyPatchTool) Execute ¶
func (t ApplyPatchTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ApplyPatchTool) Permission ¶
func (ApplyPatchTool) Permission() Permission
type ApprovalTokenTool ¶
type ApprovalTokenTool struct {
ConfigHome string
}
func (ApprovalTokenTool) Definition ¶
func (ApprovalTokenTool) Definition() anthropic.ToolDefinition
func (ApprovalTokenTool) Execute ¶
func (t ApprovalTokenTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ApprovalTokenTool) Permission ¶
func (ApprovalTokenTool) Permission() Permission
type AskUserQuestionTool ¶
type AskUserQuestionTool struct {
In io.Reader
Out io.Writer
OnRequest func(UserQuestionRequest)
}
func (AskUserQuestionTool) Definition ¶
func (AskUserQuestionTool) Definition() anthropic.ToolDefinition
func (AskUserQuestionTool) Execute ¶
func (t AskUserQuestionTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (AskUserQuestionTool) Permission ¶
func (AskUserQuestionTool) Permission() Permission
type BashOutputTool ¶
func (BashOutputTool) Definition ¶
func (BashOutputTool) Definition() anthropic.ToolDefinition
func (BashOutputTool) Execute ¶
func (t BashOutputTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (BashOutputTool) Permission ¶
func (BashOutputTool) Permission() Permission
type BashTool ¶
type BashTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
DefaultShell string
PowerShell string
SandboxStrategy string
Sandbox config.SandboxConfig
}
func (BashTool) Definition ¶
func (BashTool) Definition() anthropic.ToolDefinition
func (BashTool) Permission ¶
func (BashTool) Permission() Permission
type BranchFreshnessTool ¶
type BranchFreshnessTool struct {
Workspace string
}
func (BranchFreshnessTool) Definition ¶
func (BranchFreshnessTool) Definition() anthropic.ToolDefinition
func (BranchFreshnessTool) Execute ¶
func (t BranchFreshnessTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (BranchFreshnessTool) Permission ¶
func (BranchFreshnessTool) Permission() Permission
type BriefTool ¶
func (BriefTool) Definition ¶
func (BriefTool) Definition() anthropic.ToolDefinition
func (BriefTool) Permission ¶
func (BriefTool) Permission() Permission
type CommandTool ¶
type CommandTool struct {
Name string
Description string
Schema map[string]any
Required Permission
Command string
Args []string
Workspace string
ConfigEnv map[string]string
}
CommandTool adapts a local executable into a model-callable tool. Tools without an explicit permission default to danger-full-access because they run arbitrary host executables.
func (CommandTool) Definition ¶
func (t CommandTool) Definition() anthropic.ToolDefinition
func (CommandTool) Execute ¶
func (t CommandTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (CommandTool) Permission ¶
func (t CommandTool) Permission() Permission
type ConfigTool ¶
func (ConfigTool) Definition ¶
func (ConfigTool) Definition() anthropic.ToolDefinition
func (ConfigTool) Execute ¶
func (t ConfigTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ConfigTool) Permission ¶
func (ConfigTool) Permission() Permission
type CronCreateTool ¶
type CronCreateTool struct {
ConfigHome string
}
func (CronCreateTool) Definition ¶
func (CronCreateTool) Definition() anthropic.ToolDefinition
func (CronCreateTool) Execute ¶
func (t CronCreateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (CronCreateTool) Permission ¶
func (CronCreateTool) Permission() Permission
type CronDeleteTool ¶
type CronDeleteTool struct {
ConfigHome string
}
func (CronDeleteTool) Definition ¶
func (CronDeleteTool) Definition() anthropic.ToolDefinition
func (CronDeleteTool) Execute ¶
func (t CronDeleteTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (CronDeleteTool) Permission ¶
func (CronDeleteTool) Permission() Permission
type CronListTool ¶
type CronListTool struct {
ConfigHome string
}
func (CronListTool) Definition ¶
func (CronListTool) Definition() anthropic.ToolDefinition
func (CronListTool) Execute ¶
func (t CronListTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (CronListTool) Permission ¶
func (CronListTool) Permission() Permission
type EditFileTool ¶
func (EditFileTool) Definition ¶
func (EditFileTool) Definition() anthropic.ToolDefinition
func (EditFileTool) Execute ¶
func (t EditFileTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (EditFileTool) Permission ¶
func (EditFileTool) Permission() Permission
type EnterPlanModeTool ¶
type EnterPlanModeTool struct {
Workspace string
}
func (EnterPlanModeTool) Definition ¶
func (EnterPlanModeTool) Definition() anthropic.ToolDefinition
func (EnterPlanModeTool) Execute ¶
func (t EnterPlanModeTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (EnterPlanModeTool) Permission ¶
func (EnterPlanModeTool) Permission() Permission
type EnterWorktreeTool ¶
type EnterWorktreeTool struct {
Workspace string
}
func (EnterWorktreeTool) Definition ¶
func (EnterWorktreeTool) Definition() anthropic.ToolDefinition
func (EnterWorktreeTool) Execute ¶
func (t EnterWorktreeTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (EnterWorktreeTool) Permission ¶
func (EnterWorktreeTool) Permission() Permission
type ExitPlanModeTool ¶
type ExitPlanModeTool struct {
Workspace string
}
func (ExitPlanModeTool) Definition ¶
func (ExitPlanModeTool) Definition() anthropic.ToolDefinition
func (ExitPlanModeTool) Execute ¶
func (t ExitPlanModeTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ExitPlanModeTool) Permission ¶
func (ExitPlanModeTool) Permission() Permission
type ExitWorktreeTool ¶
type ExitWorktreeTool struct {
Workspace string
}
func (ExitWorktreeTool) Definition ¶
func (ExitWorktreeTool) Definition() anthropic.ToolDefinition
func (ExitWorktreeTool) Execute ¶
func (t ExitWorktreeTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ExitWorktreeTool) Permission ¶
func (ExitWorktreeTool) Permission() Permission
type GetMCPPromptTool ¶
type GetMCPPromptTool struct {
Servers map[string]config.MCPServerConfig
}
GetMCPPromptTool renders one prompt exposed by a configured MCP server.
func (GetMCPPromptTool) Definition ¶
func (t GetMCPPromptTool) Definition() anthropic.ToolDefinition
func (GetMCPPromptTool) Execute ¶
func (t GetMCPPromptTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (GetMCPPromptTool) Permission ¶
func (GetMCPPromptTool) Permission() Permission
type GitBlameTool ¶
type GitBlameTool struct {
Workspace string
}
func (GitBlameTool) Definition ¶
func (GitBlameTool) Definition() anthropic.ToolDefinition
func (GitBlameTool) Execute ¶
func (t GitBlameTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (GitBlameTool) Permission ¶
func (GitBlameTool) Permission() Permission
type GitDiffTool ¶
type GitDiffTool struct {
Workspace string
}
func (GitDiffTool) Definition ¶
func (GitDiffTool) Definition() anthropic.ToolDefinition
func (GitDiffTool) Execute ¶
func (t GitDiffTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (GitDiffTool) Permission ¶
func (GitDiffTool) Permission() Permission
type GitLogTool ¶
type GitLogTool struct {
Workspace string
}
func (GitLogTool) Definition ¶
func (GitLogTool) Definition() anthropic.ToolDefinition
func (GitLogTool) Execute ¶
func (t GitLogTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (GitLogTool) Permission ¶
func (GitLogTool) Permission() Permission
type GitShowTool ¶
type GitShowTool struct {
Workspace string
}
func (GitShowTool) Definition ¶
func (GitShowTool) Definition() anthropic.ToolDefinition
func (GitShowTool) Execute ¶
func (t GitShowTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (GitShowTool) Permission ¶
func (GitShowTool) Permission() Permission
type GitStatusTool ¶
type GitStatusTool struct {
Workspace string
}
func (GitStatusTool) Definition ¶
func (GitStatusTool) Definition() anthropic.ToolDefinition
func (GitStatusTool) Execute ¶
func (t GitStatusTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (GitStatusTool) Permission ¶
func (GitStatusTool) Permission() Permission
type GlobTool ¶
func (GlobTool) Definition ¶
func (GlobTool) Definition() anthropic.ToolDefinition
func (GlobTool) Permission ¶
func (GlobTool) Permission() Permission
type GrepTool ¶
func (GrepTool) Definition ¶
func (GrepTool) Definition() anthropic.ToolDefinition
func (GrepTool) Permission ¶
func (GrepTool) Permission() Permission
type KillBashTool ¶
func (KillBashTool) Definition ¶
func (KillBashTool) Definition() anthropic.ToolDefinition
func (KillBashTool) Execute ¶
func (t KillBashTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (KillBashTool) Permission ¶
func (KillBashTool) Permission() Permission
type LSPTool ¶
func (LSPTool) Definition ¶
func (LSPTool) Definition() anthropic.ToolDefinition
func (LSPTool) Permission ¶
func (LSPTool) Permission() Permission
type LSTool ¶
func (LSTool) Definition ¶
func (LSTool) Definition() anthropic.ToolDefinition
func (LSTool) Permission ¶
func (LSTool) Permission() Permission
type ListMCPPromptsTool ¶
type ListMCPPromptsTool struct {
Servers map[string]config.MCPServerConfig
}
ListMCPPromptsTool lists prompts exposed by configured MCP servers.
func (ListMCPPromptsTool) Definition ¶
func (t ListMCPPromptsTool) Definition() anthropic.ToolDefinition
func (ListMCPPromptsTool) Execute ¶
func (t ListMCPPromptsTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ListMCPPromptsTool) Permission ¶
func (ListMCPPromptsTool) Permission() Permission
type ListMCPResourceTemplatesTool ¶
type ListMCPResourceTemplatesTool struct {
Servers map[string]config.MCPServerConfig
}
ListMCPResourceTemplatesTool lists resource templates exposed by configured MCP servers.
func (ListMCPResourceTemplatesTool) Definition ¶
func (t ListMCPResourceTemplatesTool) Definition() anthropic.ToolDefinition
func (ListMCPResourceTemplatesTool) Execute ¶
func (t ListMCPResourceTemplatesTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ListMCPResourceTemplatesTool) Permission ¶
func (ListMCPResourceTemplatesTool) Permission() Permission
type ListMCPResourcesTool ¶
type ListMCPResourcesTool struct {
Servers map[string]config.MCPServerConfig
}
ListMCPResourcesTool lists resources exposed by configured MCP servers.
func (ListMCPResourcesTool) Definition ¶
func (t ListMCPResourcesTool) Definition() anthropic.ToolDefinition
func (ListMCPResourcesTool) Execute ¶
func (t ListMCPResourcesTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ListMCPResourcesTool) Permission ¶
func (ListMCPResourcesTool) Permission() Permission
type MCPAuthTool ¶
type MCPAuthTool struct {
Servers map[string]config.MCPServerConfig
ConfigHome string
OAuthProfile string
}
MCPAuthTool reports, refreshes, or clears authentication readiness for a configured MCP server.
func (MCPAuthTool) Definition ¶
func (MCPAuthTool) Definition() anthropic.ToolDefinition
func (MCPAuthTool) Execute ¶
func (t MCPAuthTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (MCPAuthTool) Permission ¶
func (MCPAuthTool) Permission() Permission
type MCPDispatchTool ¶
type MCPDispatchTool struct {
Servers map[string]config.MCPServerConfig
}
MCPDispatchTool calls a named tool on one configured MCP server.
func (MCPDispatchTool) Definition ¶
func (MCPDispatchTool) Definition() anthropic.ToolDefinition
func (MCPDispatchTool) Execute ¶
func (t MCPDispatchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (MCPDispatchTool) Permission ¶
func (MCPDispatchTool) Permission() Permission
type MCPTool ¶
type MCPTool struct {
Name string
Description string
Schema map[string]any
Required Permission
ServerName string
Server config.MCPServerConfig
RemoteName string
}
MCPTool adapts a remote MCP tool into Codog's local tool contract.
func (MCPTool) Definition ¶
func (t MCPTool) Definition() anthropic.ToolDefinition
func (MCPTool) Permission ¶
func (t MCPTool) Permission() Permission
type MultiEditTool ¶
func (MultiEditTool) Definition ¶
func (MultiEditTool) Definition() anthropic.ToolDefinition
func (MultiEditTool) Execute ¶
func (t MultiEditTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (MultiEditTool) Permission ¶
func (MultiEditTool) Permission() Permission
type NotebookEditTool ¶
func (NotebookEditTool) Definition ¶
func (NotebookEditTool) Definition() anthropic.ToolDefinition
func (NotebookEditTool) Execute ¶
func (t NotebookEditTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (NotebookEditTool) Permission ¶
func (NotebookEditTool) Permission() Permission
type NotebookReadTool ¶
func (NotebookReadTool) Definition ¶
func (NotebookReadTool) Definition() anthropic.ToolDefinition
func (NotebookReadTool) Execute ¶
func (t NotebookReadTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (NotebookReadTool) Permission ¶
func (NotebookReadTool) Permission() Permission
type NudgeTool ¶
type NudgeTool struct {
ConfigHome string
}
func (NudgeTool) Definition ¶
func (NudgeTool) Definition() anthropic.ToolDefinition
func (NudgeTool) Permission ¶
func (NudgeTool) Permission() Permission
type Permission ¶
type Permission string
Permission is the minimum host access level required to run a tool.
const ( // PermissionReadOnly allows inspection-only tools. PermissionReadOnly Permission = "read-only" // PermissionWorkspace allows writes inside the configured workspace. PermissionWorkspace Permission = "workspace-write" // PermissionDanger allows unrestricted host actions. PermissionDanger Permission = "danger-full-access" // PermissionPrompt requires a user approval decision before execution. PermissionPrompt Permission = "prompt" // PermissionAllow marks tools that are explicitly allow-listed. PermissionAllow Permission = "allow" )
type PermissionCheckTool ¶
type PermissionCheckTool struct{}
func (PermissionCheckTool) Definition ¶
func (PermissionCheckTool) Definition() anthropic.ToolDefinition
func (PermissionCheckTool) Execute ¶
func (PermissionCheckTool) Execute(_ context.Context, _ json.RawMessage) (string, error)
func (PermissionCheckTool) Permission ¶
func (PermissionCheckTool) Permission() Permission
type PermissionDecision ¶
type PermissionDecision struct {
ToolName string
Required Permission
Mode Permission
Input string
Allowed bool
WouldPrompt bool
Reason string
Message string
Feedback string
Rule string
}
PermissionDecision captures the resolved permission outcome for one proposed tool invocation.
type PermissionResponse ¶
type PermissionResponse struct {
Decision string `json:"decision"`
Feedback string `json:"feedback,omitempty"`
Rule string `json:"rule,omitempty"`
}
PermissionResponse is an interactive answer to a permission request. Decision accepts allow_once, allow_always, or deny. Feedback is passed back to the model, and Rule narrows an allow_always answer to the current tool.
type PolicyEvaluateTool ¶
type PolicyEvaluateTool struct{}
func (PolicyEvaluateTool) Definition ¶
func (PolicyEvaluateTool) Definition() anthropic.ToolDefinition
func (PolicyEvaluateTool) Execute ¶
func (PolicyEvaluateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (PolicyEvaluateTool) Permission ¶
func (PolicyEvaluateTool) Permission() Permission
type PowerShellTool ¶
type PowerShellTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
}
func (PowerShellTool) Definition ¶
func (PowerShellTool) Definition() anthropic.ToolDefinition
func (PowerShellTool) Execute ¶
func (t PowerShellTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (PowerShellTool) Permission ¶
func (PowerShellTool) Permission() Permission
type Prompter ¶
type Prompter struct {
Mode Permission
AllowRules []string
DenyRules []string
AskRules []string
DeniedTools []string
Workspace string
AdditionalDirs []string
DefaultShell string
In io.Reader
Err io.Writer
OnRequest func(PermissionDecision)
OnDecision func(PermissionDecision)
}
Prompter decides whether a tool invocation may run under the active permission mode and records the decision for callers that need audit data.
func ReadOnlyPrompter ¶
ReadOnlyPrompter derives a prompter that only allows read-only tools.
func (*Prompter) Authorize ¶
func (p *Prompter) Authorize(name string, required Permission, input json.RawMessage) error
func (*Prompter) AuthorizeDecision ¶
func (p *Prompter) AuthorizeDecision(name string, required Permission, input json.RawMessage) (PermissionDecision, error)
AuthorizeDecision authorizes one invocation and returns the resolved decision so callers can preserve user feedback in the model-visible result.
func (*Prompter) Decide ¶
func (p *Prompter) Decide(name string, required Permission, input json.RawMessage) PermissionDecision
type ProvisionalStatusTool ¶
type ProvisionalStatusTool struct {
ConfigHome string
}
func (ProvisionalStatusTool) Definition ¶
func (ProvisionalStatusTool) Definition() anthropic.ToolDefinition
func (ProvisionalStatusTool) Execute ¶
func (t ProvisionalStatusTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ProvisionalStatusTool) Permission ¶
func (ProvisionalStatusTool) Permission() Permission
type REPLTool ¶
func (REPLTool) Definition ¶
func (REPLTool) Definition() anthropic.ToolDefinition
func (REPLTool) Permission ¶
func (REPLTool) Permission() Permission
type ReadFileTool ¶
func (ReadFileTool) Definition ¶
func (ReadFileTool) Definition() anthropic.ToolDefinition
func (ReadFileTool) Execute ¶
func (t ReadFileTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ReadFileTool) Permission ¶
func (ReadFileTool) Permission() Permission
type ReadMCPResourceTool ¶
type ReadMCPResourceTool struct {
Servers map[string]config.MCPServerConfig
}
ReadMCPResourceTool reads one resource URI from a configured MCP server.
func (ReadMCPResourceTool) Definition ¶
func (t ReadMCPResourceTool) Definition() anthropic.ToolDefinition
func (ReadMCPResourceTool) Execute ¶
func (t ReadMCPResourceTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (ReadMCPResourceTool) Permission ¶
func (ReadMCPResourceTool) Permission() Permission
type RecoveryAttemptTool ¶
type RecoveryAttemptTool struct {
ConfigHome string
}
func (RecoveryAttemptTool) Definition ¶
func (RecoveryAttemptTool) Definition() anthropic.ToolDefinition
func (RecoveryAttemptTool) Execute ¶
func (t RecoveryAttemptTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (RecoveryAttemptTool) Permission ¶
func (RecoveryAttemptTool) Permission() Permission
type RecoveryRecipeTool ¶
type RecoveryRecipeTool struct {
ConfigHome string
}
func (RecoveryRecipeTool) Definition ¶
func (RecoveryRecipeTool) Definition() anthropic.ToolDefinition
func (RecoveryRecipeTool) Execute ¶
func (RecoveryRecipeTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (RecoveryRecipeTool) Permission ¶
func (RecoveryRecipeTool) Permission() Permission
type RecoveryStatusTool ¶
type RecoveryStatusTool struct {
ConfigHome string
}
func (RecoveryStatusTool) Definition ¶
func (RecoveryStatusTool) Definition() anthropic.ToolDefinition
func (RecoveryStatusTool) Execute ¶
func (t RecoveryStatusTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (RecoveryStatusTool) Permission ¶
func (RecoveryStatusTool) Permission() Permission
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry holds all tools available for a model turn.
func NewRegistry ¶
NewRegistry constructs the default tool registry for a workspace.
func NewRegistryWithOptions ¶
func NewRegistryWithOptions(workspace string, opts RegistryOptions) *Registry
NewRegistryWithOptions constructs the default tool registry and wires optional integrations such as MCP servers, sandbox defaults, config state, and plugin execution settings.
func (*Registry) DeferredInfos ¶
DeferredInfos returns searchable model tools whose schemas are not present in the initial request.
func (*Registry) Definitions ¶
func (r *Registry) Definitions() []anthropic.ToolDefinition
Definitions returns sorted model-facing definitions for every registered tool.
func (*Registry) DefinitionsForModel ¶
func (r *Registry) DefinitionsForModel(loaded []string) []anthropic.ToolDefinition
DefinitionsForModel returns the eager tool surface plus deferred tools that tool_search loaded during the current model turn.
func (*Registry) DefinitionsForPlanMode ¶
func (r *Registry) DefinitionsForPlanMode() []anthropic.ToolDefinition
DefinitionsForPlanMode returns the subset of tool definitions visible while the model is planning rather than executing workspace changes.
func (*Registry) DefinitionsForPlanModeWithLoaded ¶
func (r *Registry) DefinitionsForPlanModeWithLoaded(loaded []string) []anthropic.ToolDefinition
DefinitionsForPlanModeWithLoaded applies model deferral and plan-mode access rules to the advertised tool surface.
func (*Registry) Has ¶
Has reports whether a tool name or supported alias resolves to a registered tool.
func (*Registry) Register ¶
Register adds or replaces a tool by the name declared in its definition.
func (*Registry) UpdateBuiltinScope ¶
func (r *Registry) UpdateBuiltinScope(workspace string, opts RegistryOptions)
UpdateBuiltinScope re-registers built-in tools with a new workspace or execution configuration while preserving the registry object.
type RegistryOptions ¶
type RegistryOptions struct {
SandboxStrategy string
Sandbox config.SandboxConfig
AdditionalDirs []string
ConfigHome string
ConfigEnv map[string]string
Executable string
DefaultShell string
TrustedRoots []string
RespectGitignore bool
OAuthProfile string
MCPServers map[string]config.MCPServerConfig
PowerShell string
RAGBaseURL string
RAGTimeout time.Duration
RAGTopKMax int
QuestionIn io.Reader
QuestionOut io.Writer
AgentDefinitions []agentdefs.Definition
PluginDirs []string
}
RegistryOptions controls optional tool integrations and execution defaults.
type RemoteTriggerTool ¶
type RemoteTriggerTool struct{}
func (RemoteTriggerTool) Definition ¶
func (RemoteTriggerTool) Definition() anthropic.ToolDefinition
func (RemoteTriggerTool) Execute ¶
func (RemoteTriggerTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (RemoteTriggerTool) Permission ¶
func (RemoteTriggerTool) Permission() Permission
type ReportBackpressureTool ¶
type ReportBackpressureTool struct {
ConfigHome string
}
func (ReportBackpressureTool) Definition ¶
func (ReportBackpressureTool) Definition() anthropic.ToolDefinition
func (ReportBackpressureTool) Execute ¶
func (t ReportBackpressureTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ReportBackpressureTool) Permission ¶
func (ReportBackpressureTool) Permission() Permission
type ReportSchemaTool ¶
type ReportSchemaTool struct{}
func (ReportSchemaTool) Definition ¶
func (ReportSchemaTool) Definition() anthropic.ToolDefinition
func (ReportSchemaTool) Execute ¶
func (ReportSchemaTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ReportSchemaTool) Permission ¶
func (ReportSchemaTool) Permission() Permission
type RetrieveContextTool ¶
RetrieveContextTool queries an external workspace RAG service.
func (RetrieveContextTool) Definition ¶
func (RetrieveContextTool) Definition() anthropic.ToolDefinition
func (RetrieveContextTool) Execute ¶
func (t RetrieveContextTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (RetrieveContextTool) Permission ¶
func (RetrieveContextTool) Permission() Permission
type RoadmapPinpointTool ¶
type RoadmapPinpointTool struct {
ConfigHome string
}
func (RoadmapPinpointTool) Definition ¶
func (RoadmapPinpointTool) Definition() anthropic.ToolDefinition
func (RoadmapPinpointTool) Execute ¶
func (t RoadmapPinpointTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (RoadmapPinpointTool) Permission ¶
func (RoadmapPinpointTool) Permission() Permission
type RunTaskPacketTool ¶
type RunTaskPacketTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
}
func (RunTaskPacketTool) Definition ¶
func (RunTaskPacketTool) Definition() anthropic.ToolDefinition
func (RunTaskPacketTool) Execute ¶
func (t RunTaskPacketTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (RunTaskPacketTool) Permission ¶
func (RunTaskPacketTool) Permission() Permission
type SendUserMessageTool ¶
func (SendUserMessageTool) Definition ¶
func (SendUserMessageTool) Definition() anthropic.ToolDefinition
func (SendUserMessageTool) Execute ¶
func (t SendUserMessageTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (SendUserMessageTool) Permission ¶
func (SendUserMessageTool) Permission() Permission
type SkillTool ¶
func (SkillTool) Definition ¶
func (SkillTool) Definition() anthropic.ToolDefinition
func (SkillTool) Permission ¶
func (SkillTool) Permission() Permission
type SleepTool ¶
type SleepTool struct{}
func (SleepTool) Definition ¶
func (SleepTool) Definition() anthropic.ToolDefinition
func (SleepTool) Permission ¶
func (SleepTool) Permission() Permission
type StructuredOutputTool ¶
type StructuredOutputTool struct{}
func (StructuredOutputTool) Definition ¶
func (StructuredOutputTool) Definition() anthropic.ToolDefinition
func (StructuredOutputTool) Execute ¶
func (StructuredOutputTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (StructuredOutputTool) Permission ¶
func (StructuredOutputTool) Permission() Permission
type TaskCreateTool ¶
type TaskCreateTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
}
func (TaskCreateTool) Definition ¶
func (TaskCreateTool) Definition() anthropic.ToolDefinition
func (TaskCreateTool) Execute ¶
func (t TaskCreateTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (TaskCreateTool) Permission ¶
func (TaskCreateTool) Permission() Permission
type TaskGetTool ¶
func (TaskGetTool) Definition ¶
func (TaskGetTool) Definition() anthropic.ToolDefinition
func (TaskGetTool) Execute ¶
func (t TaskGetTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskGetTool) Permission ¶
func (TaskGetTool) Permission() Permission
type TaskHeartbeatTool ¶
func (TaskHeartbeatTool) Definition ¶
func (TaskHeartbeatTool) Definition() anthropic.ToolDefinition
func (TaskHeartbeatTool) Execute ¶
func (t TaskHeartbeatTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskHeartbeatTool) Permission ¶
func (TaskHeartbeatTool) Permission() Permission
type TaskLaneBoardTool ¶
func (TaskLaneBoardTool) Definition ¶
func (TaskLaneBoardTool) Definition() anthropic.ToolDefinition
func (TaskLaneBoardTool) Execute ¶
func (t TaskLaneBoardTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskLaneBoardTool) Permission ¶
func (TaskLaneBoardTool) Permission() Permission
type TaskListTool ¶
func (TaskListTool) Definition ¶
func (TaskListTool) Definition() anthropic.ToolDefinition
func (TaskListTool) Execute ¶
func (t TaskListTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskListTool) Permission ¶
func (TaskListTool) Permission() Permission
type TaskOutputTool ¶
func (TaskOutputTool) Definition ¶
func (TaskOutputTool) Definition() anthropic.ToolDefinition
func (TaskOutputTool) Execute ¶
func (t TaskOutputTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskOutputTool) Permission ¶
func (TaskOutputTool) Permission() Permission
type TaskStatusTool ¶
func (TaskStatusTool) Definition ¶
func (TaskStatusTool) Definition() anthropic.ToolDefinition
func (TaskStatusTool) Execute ¶
func (t TaskStatusTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskStatusTool) Permission ¶
func (TaskStatusTool) Permission() Permission
type TaskStopTool ¶
func (TaskStopTool) Definition ¶
func (TaskStopTool) Definition() anthropic.ToolDefinition
func (TaskStopTool) Execute ¶
func (t TaskStopTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskStopTool) Permission ¶
func (TaskStopTool) Permission() Permission
type TaskSuperviseTool ¶
func (TaskSuperviseTool) Definition ¶
func (TaskSuperviseTool) Definition() anthropic.ToolDefinition
func (TaskSuperviseTool) Execute ¶
func (t TaskSuperviseTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskSuperviseTool) Permission ¶
func (TaskSuperviseTool) Permission() Permission
type TaskUpdateTool ¶
func (TaskUpdateTool) Definition ¶
func (TaskUpdateTool) Definition() anthropic.ToolDefinition
func (TaskUpdateTool) Execute ¶
func (t TaskUpdateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TaskUpdateTool) Permission ¶
func (TaskUpdateTool) Permission() Permission
type TeamCreateTool ¶
type TeamCreateTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
}
func (TeamCreateTool) Definition ¶
func (TeamCreateTool) Definition() anthropic.ToolDefinition
func (TeamCreateTool) Execute ¶
func (t TeamCreateTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (TeamCreateTool) Permission ¶
func (TeamCreateTool) Permission() Permission
type TeamDeleteTool ¶
type TeamDeleteTool struct {
ConfigHome string
}
func (TeamDeleteTool) Definition ¶
func (TeamDeleteTool) Definition() anthropic.ToolDefinition
func (TeamDeleteTool) Execute ¶
func (t TeamDeleteTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TeamDeleteTool) Permission ¶
func (TeamDeleteTool) Permission() Permission
type TeamGetTool ¶
func (TeamGetTool) Definition ¶
func (TeamGetTool) Definition() anthropic.ToolDefinition
func (TeamGetTool) Execute ¶
func (t TeamGetTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TeamGetTool) Permission ¶
func (TeamGetTool) Permission() Permission
type TeamListTool ¶
func (TeamListTool) Definition ¶
func (TeamListTool) Definition() anthropic.ToolDefinition
func (TeamListTool) Execute ¶
func (t TeamListTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TeamListTool) Permission ¶
func (TeamListTool) Permission() Permission
type TestingPermissionTool ¶
type TestingPermissionTool = PermissionCheckTool
TestingPermissionTool is a compatibility alias for older transcripts and archived Claude-style tool names.
type TodoReadTool ¶
type TodoReadTool struct {
Workspace string
}
func (TodoReadTool) Definition ¶
func (TodoReadTool) Definition() anthropic.ToolDefinition
func (TodoReadTool) Execute ¶
func (t TodoReadTool) Execute(_ context.Context, _ json.RawMessage) (string, error)
func (TodoReadTool) Permission ¶
func (TodoReadTool) Permission() Permission
type TodoWriteTool ¶
type TodoWriteTool struct {
Workspace string
}
func (TodoWriteTool) Definition ¶
func (TodoWriteTool) Definition() anthropic.ToolDefinition
func (TodoWriteTool) Execute ¶
func (t TodoWriteTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (TodoWriteTool) Permission ¶
func (TodoWriteTool) Permission() Permission
type Tool ¶
type Tool interface {
Definition() anthropic.ToolDefinition
Permission() Permission
Execute(context.Context, json.RawMessage) (string, error)
}
Tool is the runtime contract implemented by every model-callable tool.
type ToolInfo ¶
type ToolInfo struct {
Name string `json:"name"`
Description string `json:"description"`
Permission Permission `json:"permission"`
InputSchema map[string]any `json:"input_schema"`
}
ToolInfo is the JSON-safe metadata view of one registered tool.
type ToolSearchTool ¶
type ToolSearchTool struct {
Registry *Registry
}
func (ToolSearchTool) Definition ¶
func (ToolSearchTool) Definition() anthropic.ToolDefinition
func (ToolSearchTool) Execute ¶
func (t ToolSearchTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (ToolSearchTool) Permission ¶
func (ToolSearchTool) Permission() Permission
type UserQuestion ¶
type UserQuestion struct {
Question string `json:"question"`
Header string `json:"header"`
Options []UserQuestionOption `json:"options"`
MultiSelect bool `json:"multiSelect"`
}
UserQuestion is one question in the Claude-compatible multi-question request shape.
type UserQuestionOption ¶
type UserQuestionOption struct {
Label string `json:"label"`
Description string `json:"description"`
Preview string `json:"preview,omitempty"`
}
UserQuestionOption is one labeled answer with optional supporting preview.
type UserQuestionRequest ¶
type UserQuestionRequest struct {
Question string
Choices []string
Default string
Questions []UserQuestion
}
UserQuestionRequest is the normalized question presented by AskUserQuestionTool before it waits for an answer.
type WebFetchTool ¶
type WebFetchTool struct{}
func (WebFetchTool) Definition ¶
func (WebFetchTool) Definition() anthropic.ToolDefinition
func (WebFetchTool) Execute ¶
func (WebFetchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WebFetchTool) Permission ¶
func (WebFetchTool) Permission() Permission
type WebSearchTool ¶
type WebSearchTool struct{}
func (WebSearchTool) Definition ¶
func (WebSearchTool) Definition() anthropic.ToolDefinition
func (WebSearchTool) Execute ¶
func (WebSearchTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WebSearchTool) Permission ¶
func (WebSearchTool) Permission() Permission
type WorkerAwaitReadyTool ¶
func (WorkerAwaitReadyTool) Definition ¶
func (WorkerAwaitReadyTool) Definition() anthropic.ToolDefinition
func (WorkerAwaitReadyTool) Execute ¶
func (t WorkerAwaitReadyTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerAwaitReadyTool) Permission ¶
func (WorkerAwaitReadyTool) Permission() Permission
type WorkerCreateTool ¶
func (WorkerCreateTool) Definition ¶
func (WorkerCreateTool) Definition() anthropic.ToolDefinition
func (WorkerCreateTool) Execute ¶
func (t WorkerCreateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerCreateTool) Permission ¶
func (WorkerCreateTool) Permission() Permission
type WorkerGetTool ¶
func (WorkerGetTool) Definition ¶
func (WorkerGetTool) Definition() anthropic.ToolDefinition
func (WorkerGetTool) Execute ¶
func (t WorkerGetTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerGetTool) Permission ¶
func (WorkerGetTool) Permission() Permission
type WorkerListTool ¶
func (WorkerListTool) Definition ¶
func (WorkerListTool) Definition() anthropic.ToolDefinition
func (WorkerListTool) Execute ¶
func (t WorkerListTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerListTool) Permission ¶
func (WorkerListTool) Permission() Permission
type WorkerObserveCompletionTool ¶
func (WorkerObserveCompletionTool) Definition ¶
func (WorkerObserveCompletionTool) Definition() anthropic.ToolDefinition
func (WorkerObserveCompletionTool) Execute ¶
func (t WorkerObserveCompletionTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerObserveCompletionTool) Permission ¶
func (WorkerObserveCompletionTool) Permission() Permission
type WorkerObserveTool ¶
func (WorkerObserveTool) Definition ¶
func (WorkerObserveTool) Definition() anthropic.ToolDefinition
func (WorkerObserveTool) Execute ¶
func (t WorkerObserveTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerObserveTool) Permission ¶
func (WorkerObserveTool) Permission() Permission
type WorkerResolveTrustTool ¶
func (WorkerResolveTrustTool) Definition ¶
func (WorkerResolveTrustTool) Definition() anthropic.ToolDefinition
func (WorkerResolveTrustTool) Execute ¶
func (t WorkerResolveTrustTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerResolveTrustTool) Permission ¶
func (WorkerResolveTrustTool) Permission() Permission
type WorkerRestartTool ¶
func (WorkerRestartTool) Definition ¶
func (WorkerRestartTool) Definition() anthropic.ToolDefinition
func (WorkerRestartTool) Execute ¶
func (t WorkerRestartTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerRestartTool) Permission ¶
func (WorkerRestartTool) Permission() Permission
type WorkerSendPromptTool ¶
type WorkerSendPromptTool struct {
Workspace string
ConfigHome string
ConfigEnv map[string]string
Executable string
}
func (WorkerSendPromptTool) Definition ¶
func (WorkerSendPromptTool) Definition() anthropic.ToolDefinition
func (WorkerSendPromptTool) Execute ¶
func (t WorkerSendPromptTool) Execute(ctx context.Context, input json.RawMessage) (string, error)
func (WorkerSendPromptTool) Permission ¶
func (WorkerSendPromptTool) Permission() Permission
type WorkerStartupTimeoutTool ¶
func (WorkerStartupTimeoutTool) Definition ¶
func (WorkerStartupTimeoutTool) Definition() anthropic.ToolDefinition
func (WorkerStartupTimeoutTool) Execute ¶
func (t WorkerStartupTimeoutTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerStartupTimeoutTool) Permission ¶
func (WorkerStartupTimeoutTool) Permission() Permission
type WorkerTerminateTool ¶
func (WorkerTerminateTool) Definition ¶
func (WorkerTerminateTool) Definition() anthropic.ToolDefinition
func (WorkerTerminateTool) Execute ¶
func (t WorkerTerminateTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WorkerTerminateTool) Permission ¶
func (WorkerTerminateTool) Permission() Permission
type WriteFileTool ¶
func (WriteFileTool) Definition ¶
func (WriteFileTool) Definition() anthropic.ToolDefinition
func (WriteFileTool) Execute ¶
func (t WriteFileTool) Execute(_ context.Context, input json.RawMessage) (string, error)
func (WriteFileTool) Permission ¶
func (WriteFileTool) Permission() Permission