Versions in this module Expand all Collapse all v0 v0.8.1 Nov 27, 2026 v0.8.0 Nov 21, 2026 Changes in this version + const AbandonGrace + const DefaultTimeout + const DefaultTimeoutSeconds + const HaltExitCode + const SessionEndBudget + var AllEvents = []Event + func EnvAdditions(in Input) []string + func ParseToolInput(raw []byte) json.RawMessage + func ShellExecutor(ctx context.Context, command, cwd string, stdin []byte, env []string) ([]byte, []byte, int, error) + type Aggregated struct + Context string + Decision Decision + Diagnostics []string + Halt bool + Reason string + Results []HookResult + StopReason string + UpdatedInput json.RawMessage + UpdatedOutput *string + func Aggregate(results []HookResult, originalInput json.RawMessage) Aggregated + type Config map[Event][]Hook + func NormalizeConfig(raw Config) (Config, error) + type Decision int + const DecisionAllow + const DecisionDeny + const DecisionNone + func (d Decision) String() string + type Event string + const Interrupt + const PermissionRequest + const PermissionResult + const PostCompact + const PostToolUse + const PostToolUseFailure + const PreCompact + const PreToolUse + const SessionEnd + const SessionStart + const StopFailure + const TurnEnd + const TurnStart + func NormalizeEvent(name string) (Event, bool) + func (e Event) IsToolEvent() bool + func (e Event) String() string + type Executor func(ctx context.Context, command, cwd string, stdin []byte, env []string) (stdout, stderr []byte, exitCode int, err error) + type Hook struct + Command string + Matcher string + Name string + Timeout int + type HookResult struct + Command string + Context string + Decision Decision + Diagnostic string + Event Event + Halt bool + Matcher string + Name string + Reason string + StopReason string + UpdatedInput json.RawMessage + UpdatedOutput *string + type Input struct + CWD string + Decision string + Error string + Event Event + HookEventName string + LastAssistantMessage string + Reason string + SessionID string + Source string + ToolInput json.RawMessage + ToolName string + ToolResponse string + ToolUseID string + Trigger string + type Runner struct + AbandonGraceOverride time.Duration + DefaultTimeoutOverride time.Duration + EnvScrub []string + func NewRunner(cfg Config, exec Executor) (*Runner, error) + func (r *Runner) Has(event Event) bool + func (r *Runner) Run(ctx context.Context, event Event, in Input) Aggregated