hook

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hooks

type Hooks struct {
	PreToolUse  []PreToolUse
	PostToolUse []PostToolUse
}

Hooks holds the registered hook functions for an agent.

type PostToolUse

type PostToolUse func(ctx context.Context, call tool.ToolCall, result string) (string, error)

PostToolUse is called after a tool executes. Receives the call and result. Return a modified result to transform it, or return the same result to pass through.

type PreToolUse

type PreToolUse func(ctx context.Context, call tool.ToolCall) (string, error)

PreToolUse is called before a tool executes. Return a non-empty result to skip execution and use that result. Return an error to abort with that error as the result. Return ("", nil) to proceed normally.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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