external

package
v0.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PreToolUse  []Rule `json:"preToolUse,omitempty"`
	PostToolUse []Rule `json:"postToolUse,omitempty"`
}

func Load

func Load(paths ...string) (*Config, error)

func (*Config) PostHooks

func (c *Config) PostHooks(workDir string, gate *Gate) []hook.PostToolUse

func (*Config) PreHooks

func (c *Config) PreHooks(workDir string, gate *Gate) []hook.PreToolUse

type Gate

type Gate struct {
	Confirm func(ctx context.Context, message string) (bool, error)
	Message string
	// contains filtered or unexported fields
}

Gate defers a yes/no decision (e.g. "trust this workspace's hooks?") until the first hook actually fires, then remembers it for the session.

func (*Gate) Allowed

func (g *Gate) Allowed(ctx context.Context) bool

type Rule

type Rule struct {
	Matcher string `json:"matcher,omitempty"`
	Command string `json:"command"`
	Timeout int    `json:"timeout,omitempty"`
}

Jump to

Keyboard shortcuts

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