Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecutePost ¶
Types ¶
type PreExecutionResult ¶
type PreExecutionResult struct {
Stop *ToolHookStop
UpdatedInput map[string]any
Metadata map[string]any
ExtraMessages []types.Message
}
func ExecutePre ¶
func ExecutePre(ctx context.Context, hooks []ToolHook, input ToolHookInput) PreExecutionResult
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry stores tool hooks and exposes stable pre/post stage views.
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) ByStage ¶
func (r *Registry) ByStage(stage ToolHookStage) []ToolHook
type ToolHook ¶
type ToolHook struct {
Stage ToolHookStage
Priority int
ID string
Execute func(ctx context.Context, input ToolHookInput) ToolHookResult
}
ToolHook is a single pre- or post-tool-use hook.
type ToolHookInput ¶
type ToolHookInput struct {
ToolName string
ToolUseID string
Input map[string]any
ToolCtx tool.ToolUseContext
}
ToolHookInput is the data passed to a hook.
type ToolHookResult ¶
type ToolHookResult struct {
Stop *ToolHookStop
UpdatedInput map[string]any
Metadata map[string]any
ExtraMessages []types.Message
}
ToolHookResult is the outcome of a single hook invocation.
type ToolHookStage ¶
type ToolHookStage string
ToolHookStage identifies when a hook fires.
const ( ToolHookStagePre ToolHookStage = "pre" ToolHookStagePost ToolHookStage = "post" )
type ToolHookStop ¶
ToolHookStop carries the information emitted when a hook stops execution.
Click to show internal directories.
Click to hide internal directories.