config.go

 1package hooks
 2
 3// Config defines hook system configuration.
 4type Config struct {
 5	// Enabled controls whether hooks are executed.
 6	Enabled bool
 7
 8	// TimeoutSeconds is the maximum time a hook can run.
 9	TimeoutSeconds int
10
11	// Directories are additional directories to search for hooks.
12	// Defaults to [".crush/hooks"] if empty.
13	Directories []string
14
15	// Inline hooks defined directly in configuration.
16	// Map key is the hook type (e.g., "pre-tool-use").
17	Inline map[string][]InlineHook
18
19	// Disabled is a list of hook paths to skip.
20	// Paths are relative to the hooks directory.
21	// Example: ["pre-tool-use/02-slow-check.sh"]
22	Disabled []string
23
24	// Environment variables to pass to hooks.
25	Environment map[string]string
26}
27
28// InlineHook is a hook defined inline in the config.
29type InlineHook struct {
30	// Name is the name of the hook (used as filename).
31	Name string
32
33	// Script is the bash script content.
34	Script string
35}