hook

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 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
}

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.

IMPORTANT: the return value unconditionally REPLACES the upstream result — returning ("", nil) clears the result. To pass through unchanged, return the input `result` verbatim. To signal an error, return a non-nil error (the result will be replaced with "error: <msg>").

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