Versions in this module Expand all Collapse all v0 v0.1.0 Apr 3, 2026 Changes in this version + type AskPermissionFunc func(toolName string, input string) bool + type CheckResult int + const ResultAllow + const ResultDeny + const ResultNeedAsk + type ExecuteResult struct + Result *Result + ToolUseID string + type HookRunner interface + RunPostToolUse func(ctx context.Context, toolName, toolOutput string, isError bool) + RunPreToolUse func(ctx context.Context, toolName, toolInput string) (bool, error) + type PermissionChecker interface + Check func(toolName string, isReadOnly bool) (CheckResult, string) + type PermissionMode string + const ModeAcceptEdits + const ModeBypass + const ModeDefault + const ModeInteractive + const ModePlan + type Registry struct + func NewRegistry() *Registry + func (r *Registry) All() []Tool + func (r *Registry) ExecuteBatch(ctx context.Context, calls []*provider.ToolCall, checker PermissionChecker, ...) []ExecuteResult + func (r *Registry) ExecuteTool(ctx context.Context, call *provider.ToolCall) *Result + func (r *Registry) ExecuteWithPermission(ctx context.Context, call *provider.ToolCall, checker PermissionChecker, ...) *Result + func (r *Registry) Get(name string) (Tool, bool) + func (r *Registry) Register(t Tool) + func (r *Registry) ToolDefs() []provider.ToolDef + type Result struct + Content string + IsError bool + type SimplePermissionChecker struct + Mode PermissionMode + func (c *SimplePermissionChecker) Check(toolName string, isReadOnly bool) (CheckResult, string) + type Tool interface + Description func() string + Execute func(ctx context.Context, input json.RawMessage) (*Result, error) + InputSchema func() map[string]any + IsReadOnly func() bool + Name func() string