Versions in this module Expand all Collapse all v1 v1.53.0 Apr 28, 2026 Changes in this version + const ApprovalDecisionAllow + const ApprovalDecisionCanceled + const ApprovalDecisionDeny + const ApprovalSourceContextCanceled + const ApprovalSourcePreToolUseHookAllow + const ApprovalSourcePreToolUseHookDeny + const ApprovalSourceReadOnlyHint + const ApprovalSourceSessionPermissionsAllow + const ApprovalSourceSessionPermissionsDeny + const ApprovalSourceTeamPermissionsAllow + const ApprovalSourceTeamPermissionsDeny + const ApprovalSourceUserApproved + const ApprovalSourceUserApprovedSession + const ApprovalSourceUserApprovedTool + const ApprovalSourceUserRejected + const ApprovalSourceYolo + func NewHooksInput(sess *session.Session, toolCall tools.ToolCall) *hooks.Input + func NewPostToolHooksInput(sess *session.Session, toolCall tools.ToolCall, res *tools.ToolCallResult) *hooks.Input + func ParseToolInput(arguments string) map[string]any + func ResolveModelOverride(calls []tools.ToolCall, agentTools []tools.Tool) string + type CallOutcome struct + Canceled bool + StopMessage string + StopRun bool + type Dispatcher struct + AgentFor func(*session.Session) *agent.Agent + Handlers map[string]ToolHandler + Hooks HookDispatcher + Permissions func(*session.Session) []NamedChecker + Resume <-chan ResumeRequest + Tracer trace.Tracer + func (d *Dispatcher) Process(ctx context.Context, sess *session.Session, calls []tools.ToolCall, ...) (stopRun bool, stopMessage string) + type Emitter interface + EmitHookBlocked func(toolCall tools.ToolCall, tool tools.Tool, message, agentName string) + EmitMessageAdded func(sessionID string, msg *session.Message, agentName string) + EmitToolCall func(toolCall tools.ToolCall, tool tools.Tool, agentName string) + EmitToolCallConfirmation func(toolCall tools.ToolCall, tool tools.Tool, agentName string) + EmitToolCallResponse func(toolCallID string, tool tools.Tool, result *tools.ToolCallResult, ...) + type HookDispatcher interface + Dispatch func(ctx context.Context, a *agent.Agent, event hooks.EventType, in *hooks.Input) *hooks.Result + NotifyApprovalDecision func(ctx context.Context, sess *session.Session, a *agent.Agent, tc tools.ToolCall, ...) + NotifyUserInput func(ctx context.Context, sessionID, label string) + type LoopDetector struct + func NewLoopDetector(threshold int, exemptTools ...string) *LoopDetector + func (d *LoopDetector) Consecutive() int + func (d *LoopDetector) Record(calls []tools.ToolCall) bool + func (d *LoopDetector) Reset() + type NamedChecker struct + Checker *permissions.Checker + Source string + type PermissionDecision struct + Outcome PermissionOutcome + Reason PermissionReason + Source string + func Decide(yoloApproved bool, checkers []NamedChecker, toolName string, ...) PermissionDecision + type PermissionOutcome int + const OutcomeAllow + const OutcomeAsk + const OutcomeDeny + type PermissionReason int + const ReasonChecker + const ReasonDefault + const ReasonReadOnlyHint + const ReasonYolo + type ResumeRequest struct + Reason string + ToolName string + Type ResumeType + type ResumeType string + const ResumeTypeApprove + const ResumeTypeApproveSession + const ResumeTypeApproveTool + const ResumeTypeReject + type ToolHandler func(ctx context.Context, sess *session.Session, tc tools.ToolCall) (*tools.ToolCallResult, error)