Documentation
¶
Index ¶
- type EventType
- type Payload
- type Result
- type Runner
- func (r *Runner) Middleware() agentcore.ToolMiddleware
- func (r *Runner) RunNotification(_ context.Context, message string)
- func (r *Runner) RunPostToolUse(_ context.Context, toolName string, args, output json.RawMessage, isError bool)
- func (r *Runner) RunPreToolUse(ctx context.Context, toolName string, args json.RawMessage) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Payload ¶
type Payload struct {
Event EventType `json:"event"`
Tool string `json:"tool,omitempty"`
Args json.RawMessage `json:"args,omitempty"`
Output json.RawMessage `json:"output,omitempty"`
IsError bool `json:"is_error,omitempty"`
Message string `json:"message,omitempty"`
}
Payload is the JSON written to the hook command's stdin.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner manages and executes hooks.
func (*Runner) Middleware ¶
func (r *Runner) Middleware() agentcore.ToolMiddleware
Middleware returns a ToolMiddleware that runs PreToolUse and PostToolUse hooks around each tool execution.
func (*Runner) RunNotification ¶
RunNotification fires matching Notification hooks asynchronously. Uses a detached context so hooks survive parent cancellation.
func (*Runner) RunPostToolUse ¶
func (r *Runner) RunPostToolUse(_ context.Context, toolName string, args, output json.RawMessage, isError bool)
RunPostToolUse fires matching PostToolUse hooks asynchronously. Uses a detached context so hooks survive parent cancellation.
func (*Runner) RunPreToolUse ¶
RunPreToolUse executes all matching PreToolUse hooks. A blocking hook that exits non-zero or returns {"blocked":true} returns an error.
Click to show internal directories.
Click to hide internal directories.