Versions in this module Expand all Collapse all v0 v0.2.0 Jul 14, 2026 v0.1.0 Jun 22, 2026 Changes in this version + const PermissionRuleMatcherKey + const ResolvedToolMetadataKey + func AttachPermissionMatcherMetadata(metadata map[string]any, resolvedTool Tool, matcher func(string) bool) map[string]any + func BuildPermissionMatcher(ctx context.Context, resolvedTool Tool, input map[string]any) (func(string) bool, error) + func ExecutesInPlanMode(t Tool, input map[string]any) bool + func IsValidToolName(name string) bool + func PermissionMatcherFromMetadata(metadata map[string]any) func(string) bool + func RequiresUserInteraction(t Tool) bool + type CallInput struct + Parsed map[string]any + Raw string + SessionID types.SessionID + ToolContext *ToolUseContext + ToolUseID string + TurnID types.TurnID + func (i CallInput) ToolContextValue() ToolUseContext + type CallResult struct + Content string + ContentType ContentType + ContextModifier ContextModifier + Data any + Error error + Metadata *ResultMetadata + NewMessages []types.Message + ProgressUpdates []types.ToolProgress + func NewErrorResult(err error) CallResult + func NewJSONResult(data any) CallResult + func NewTextResult(content string) CallResult + func (r CallResult) GetContent() string + func (r CallResult) GetData() any + func (r CallResult) IsError() bool + func (r CallResult) IsSuccess() bool + func (r CallResult) String() string + type ContentType string + const ContentTypeBinary + const ContentTypeJSON + const ContentTypeMixed + const ContentTypeStream + const ContentTypeText + type ContextModifier func(ToolUseContext) ToolUseContext + type Definition struct + Aliases []string + AlwaysLoad bool + Category string + Description string + DisplayName string + InputSchema schema.JSONSchema + IsConcurrencySafe bool + IsDestructive bool + IsMCP bool + IsReadOnly bool + MaxResultSize int + Metadata map[string]any + Name string + Prompt string + RequiresPermission bool + SearchHint string + ShouldDefer bool + func (d Definition) Validate() error + type PermissionMatcherTool interface + PreparePermissionMatcher func(ctx context.Context, input map[string]any) (func(ruleContent string) bool, error) + type PlanModeExecutableTool interface + ExecutesInPlanMode func(input map[string]any) bool + type RequiresUserInteractionTool interface + RequiresUserInteraction func() bool + type ResultMetadata struct + Additional map[string]any + ContentReplacement *types.ContentReplacementState + ExecutionDuration int64 + type Tool interface + BackfillInput func(ctx context.Context, input map[string]any) map[string]any + Call func(ctx context.Context, input CallInput, permissionCheck types.CanUseToolFn) (CallResult, error) + CheckPermissions func(ctx context.Context, input map[string]any, toolCtx ToolUseContext) types.PermissionResult + Definition func() Definition + Description func(ctx context.Context) (string, error) + FormatResult func(data any) string + IsConcurrencySafe func(input map[string]any) bool + IsEnabled func() bool + IsReadOnly func(input map[string]any) bool + ValidateInput func(ctx context.Context, input map[string]any) (map[string]any, error) + func ToolFromMetadata(metadata map[string]any) Tool + type ToolSurface struct + Aliases []string + Category string + Description string + DisplayName string + InputSchema schema.JSONSchema + IsConcurrencySafe bool + IsDestructive bool + IsReadOnly bool + MaxResultSize int + Metadata map[string]any + Name string + Prompt string + RequiresPermission bool + SearchHint string + func FromJSON(data []byte) (*ToolSurface, error) + func NewToolSurfaceFromDefinition(def Definition) ToolSurface + func (s ToolSurface) IsEnabled() bool + func (s ToolSurface) MatchesName(name string) bool + func (s ToolSurface) ToJSON() ([]byte, error) + func (s ToolSurface) ToMap() map[string]any + type ToolUseContext struct + AdditionalWorkingDirectories map[string]string + CanUseTool types.CanUseToolFn + EnableSandbox bool + ExecutionMode string + IsAutoModeAvailable bool + IsBypassPermissionsModeAvailable bool + Metadata map[string]any + PermissionMode types.PermissionMode + PrePlanMode types.PermissionMode + RequestPrompt types.PromptFn + SessionID types.SessionID + ToolUseID string + TurnID types.TurnID + WorkingDirectory string + Workspace *workspace.Context + func NewToolUseContext(sessionID types.SessionID, turnID types.TurnID, toolUseID string, ...) ToolUseContext + type Toolset interface + Name func() string + Tools func(ctx context.Context) []Tool