hookconfig

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package hookconfig parses and validates command hook files shared by Package validation and the runtime hook bridge.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Description string                 `json:"description,omitempty"`
	Hooks       map[string][]HookGroup `json:"hooks"`
}

Config is the supported Open Plugin / Claude Code command-hook subset.

func Parse

func Parse(path string, data []byte) (Config, error)

Parse validates data and returns its typed hook configuration. Pig rejects unsupported declarations instead of silently dropping them at runtime.

type HookAction

type HookAction struct {
	Type    string `json:"type"`
	Command string `json:"command"`
}

HookAction is one supported command action.

type HookGroup

type HookGroup struct {
	Matcher string       `json:"matcher,omitempty"`
	Hooks   []HookAction `json:"hooks"`
}

HookGroup applies actions when its optional matcher accepts the event value.

Jump to

Keyboard shortcuts

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