hook

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decision added in v0.7.0

type Decision string
const (
	DecisionAllow Decision = "allow"
	DecisionAsk   Decision = "ask"
	DecisionDeny  Decision = "deny"
)

func NormalizeDecision added in v0.7.0

func NormalizeDecision(value string) (Decision, bool)

type Event added in v0.7.0

type Event struct {
	SessionID      string
	Agent          string
	HookName       HookName
	ToolName       string
	ToolInput      map[string]any
	ToolResponse   map[string]any
	ToolUseID      string
	CWD            string
	PermissionMode string
	DurationMs     *int64
	Error          string
	IsInterrupt    *bool
}

type HookName added in v0.7.0

type HookName string
const (
	HookSessionStart      HookName = "SessionStart"
	HookPreToolUse        HookName = "PreToolUse"
	HookPostToolUse       HookName = "PostToolUse"
	HookPostToolUseFailed HookName = "PostToolUseFailure"
	HookSessionEnd        HookName = "SessionEnd"
	HookUserPromptSubmit  HookName = "UserPromptSubmit"
)

func (HookName) CanBlock added in v0.7.0

func (h HookName) CanBlock() bool

func (HookName) String added in v0.7.0

func (h HookName) String() string

type Result added in v0.7.0

type Result struct {
	Decision     Decision
	Reason       string
	ReasonCode   string
	RequestID    string
	EventID      string
	Mode         string
	Epoch        string
	UpdatedInput map[string]any
	// contains filtered or unexported fields
}

func WithMetadata added in v0.7.0

func WithMetadata(result Result, metadata any) Result

func (Result) Allowed added in v0.7.0

func (r Result) Allowed() bool

func (Result) Blocking added in v0.7.0

func (r Result) Blocking() bool

func (Result) ClaudeReason added in v0.7.0

func (r Result) ClaudeReason() string

func (Result) Metadata added in v0.7.0

func (r Result) Metadata() any

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL