hook

package
v0.11.7 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 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
	UserPromptSubmit []UserPromptSubmit
	SessionStart     []SessionStart
	SessionEnd       []SessionEnd
	SubagentStop     []SubagentStop
	PreCompact       []PreCompact
}

type PostToolUse

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

type PreCompact added in v0.11.2

type PreCompact func(ctx context.Context) error

PreCompact runs before proactive compaction; an error skips the compaction. Reactive overflow compaction is never blocked.

type PreToolUse

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

type SessionEnd added in v0.11.2

type SessionEnd func(ctx context.Context)

SessionEnd runs when the session closes.

type SessionStart added in v0.11.2

type SessionStart func(ctx context.Context) (string, error)

SessionStart runs once before an agent's first turn. A non-empty return value is injected as hidden context.

type SubagentStop added in v0.11.2

type SubagentStop func(ctx context.Context, agentType, result string)

SubagentStop observes a completed subagent run.

type UserPromptSubmit added in v0.11.2

type UserPromptSubmit func(ctx context.Context, prompt string) (string, error)

UserPromptSubmit runs before a turn starts. A non-empty return value is injected as additional hidden context; an error blocks the turn.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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