Versions in this module Expand all Collapse all v0 v0.14.0 Nov 17, 2026 v0.13.0 Nov 9, 2026 v0.12.0 Nov 3, 2026 Changes in this version + func FormatList(config Config, diagnostics []Diagnostic) string + func IsValidEvent(event Event) bool + func WriteConfig(path string, config Config) error + type AppendCompletedInput struct + DurationMs int + Event Event + HookID string + Matcher string + Results []AuditResult + Status AuditStatus + ToolCallID string + type AppendStartedInput struct + Commands []AuditCommand + Event Event + HookID string + Matcher string + ToolCallID string + type AuditCommand = Command + type AuditEvent struct + Commands []AuditCommand + CreatedAt string + DurationMs int + Event Event + HookID string + Matcher string + Results []AuditResult + Sequence int + Status AuditStatus + ToolCallID string + Type string + type AuditResult struct + ExitCode int + Stderr string + Stdout string + type AuditStatus string + const AuditBlocked + const AuditCompleted + const AuditError + type AuditStore struct + func NewAuditStore(options AuditStoreOptions) (*AuditStore, error) + func (store *AuditStore) AppendCompleted(input AppendCompletedInput) (AuditEvent, error) + func (store *AuditStore) AppendStarted(input AppendStartedInput) (AuditEvent, error) + func (store *AuditStore) ReadEvents() ([]AuditEvent, error) + type AuditStoreOptions struct + AuditPath string + Now func() time.Time + type Command struct + Args []string + Command string + type Config struct + Enabled bool + Hooks []Definition + type ConfigSource string + const SourceProject + const SourceUser + type ConfigStore struct + func NewConfigStore(options StoreOptions) (*ConfigStore, error) + func (store *ConfigStore) List() (Config, error) + func (store *ConfigStore) Remove(hookID string) (bool, error) + func (store *ConfigStore) SetEnabled(hookID string, enabled bool) (bool, error) + func (store *ConfigStore) Upsert(hook Definition) (Definition, error) + type Definition struct + Args []string + Command string + Description string + Enabled bool + Event Event + ID string + Matcher string + Name string + func Select(config Config, input SelectInput) []Definition + type Diagnostic struct + FieldPath string + HookID string + Kind DiagnosticKind + Message string + Path string + Source ConfigSource + type DiagnosticKind string + const DiagnosticDuplicate + const DiagnosticIO + const DiagnosticJSON + const DiagnosticSchema + type DispatchInput struct + Event Event + Payload any + ToolCallID string + ToolName string + type DispatchOutcome struct + Blocked bool + BlockedBy string + Messages []string + Ran int + Reason string + type Dispatcher struct + func NewDispatcher(options DispatcherOptions) *Dispatcher + func (dispatcher *Dispatcher) Dispatch(ctx context.Context, input DispatchInput) DispatchOutcome + type DispatcherOptions struct + Audit *AuditStore + Config Config + Cwd string + Env []string + Execution *execution.Runner + Timeout time.Duration + type Event string + const EventAfterTool + const EventBeforeTool + const EventSessionEnd + const EventSessionStart + const EventSpecialistStart + const EventSpecialistStop + func KnownEvents() []Event + type LoadOptions struct + Cwd string + Env map[string]string + ExcludeProject bool + ProjectConfigPath string + UserConfigPath string + type LoadResult struct + Config Config + Diagnostics []Diagnostic + Paths Paths + func LoadConfig(options LoadOptions) (LoadResult, error) + type Paths struct + AuditPath string + ProjectConfigPath string + UserConfigPath string + func ResolvePaths(options ResolvePathOptions) (Paths, error) + type ResolvePathOptions struct + Cwd string + Env map[string]string + type SelectInput struct + Event Event + ToolName string + type StoreOptions struct + ConfigPath string