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 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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