Documentation
¶
Overview ¶
Package hooks provides pre/post tool-use hook parsing and execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
Executor runs pre/post tool-use hooks.
func NewExecutor ¶
NewExecutor creates an Executor for the given hooks and workspace directory.
func (*Executor) RunPostToolUse ¶
RunPostToolUse runs all matching PostToolUse hooks.
func (*Executor) RunPreToolUse ¶
RunPreToolUse runs all matching PreToolUse hooks. Returns the first blocking result, or an approve result if all pass.
type Hook ¶
type Hook struct {
Event string // "PreToolUse", "PostToolUse", "PreCommit"
Tool string // tool name or "*"
Command string // shell command with {{variables}}
Timeout int // seconds, default 30
}
Hook represents a parsed hook definition ready for execution.
func ParseFromGrimoire ¶
ParseFromGrimoire converts grimoire HookEntry items into Hook structs.
type HookResult ¶
HookResult holds the outcome of running a hook.
Click to show internal directories.
Click to hide internal directories.