events

package
v1.164.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 2 Imported by: 1 module, 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 events defines the shared contracts for hook configuration and execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() iter.Seq[Contract]

All iterates over public event contracts in configuration order.

Types

type Contract

type Contract struct {
	Name               string
	ToolMatched        bool
	CanBlock           bool
	FailClosed         bool
	Rewrite            Rewrite
	Decision           bool
	PermissionApproval bool
	Metadata           bool
	Context            bool
	Instructions       bool
	Summary            bool
	// Control events let a hook select the next agent via a route transition.
	Control bool
}

Contract describes an event's configuration shape and runtime capabilities.

func Lookup

func Lookup(name string) (Contract, bool)

Lookup returns a contract by its public event name.

func (Contract) Permission

func (c Contract) Permission() bool

Permission reports whether permission_decision is meaningful on this event.

func (Contract) Sequential

func (c Contract) Sequential() bool

Sequential reports whether each hook must receive the preceding rewrite.

type Rewrite

type Rewrite uint8

Rewrite identifies the payload a sequential hook pipeline can replace.

const (
	RewriteNone Rewrite = iota
	RewriteToolInput
	RewriteMessages
	RewriteToolResponse
)

Jump to

Keyboard shortcuts

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