Skip to main content

Module tool_hooks

Module tool_hooks 

Source
Expand description

Tool Execution Hooks System

This module provides a hook system for tool execution, allowing pre and post execution checks and modifications.

§Hook Types

  • PreExecute: Before tool execution, can block or modify params
  • PostExecute: After tool execution, can modify result

§Usage

// Create a hook registry
let registry = HookRegistry::new();

// Register hooks
registry.register(Box::new(CodeQualityHook::new("pre")));

// Execute with hooks
let result = registry.execute_with_hooks(tool, params);

Structs§

HookRegistry
Hook registry for managing multiple hooks

Enums§

HookResult
Hook execution result

Traits§

ToolHook
Tool execution hook trait

Functions§

global_hook_registry
Get the global hook registry
set_global_hook_registry
Set the global hook registry