hook

package
v0.0.0-...-f56615f Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package hook runs trusted lifecycle commands without invoking a shell.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResolveCommand

func ResolveCommand(workspace string, command []string) string

ResolveCommand is used by diagnostics and tests to show the exact executable without executing it.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func New

func New(workspace string, definitions map[string][]config.Hook) (*Manager, error)

func (*Manager) Empty

func (m *Manager) Empty() bool

func (*Manager) Run

func (m *Manager) Run(ctx context.Context, event agent.HookEvent, input agent.HookInput) (agent.HookOutput, error)

Run implements agent.Hook. Each hook receives one JSON object on stdin and may return a partial agent.HookOutput object on stdout. A non-zero exit blocks the lifecycle operation, while an empty stdout means no modification.

func (*Manager) Session

func (m *Manager) Session(ctx context.Context, event string) error

Jump to

Keyboard shortcuts

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