events

package
v1.138.1 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

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
}

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