Package: @hexos/runtime

Optional lifecycle hooks for tool execution.

Providers call these hooks before and after tool execution, enabling instrumentation, logging, or custom behavior injection.

interface ProviderHooks {
    onToolCall?: (toolName: string, args: unknown) => void | Promise<void>;
    onToolResult?: (toolName: string, result: unknown) => void | Promise<void>;
}

onToolCall

(toolName: string, args: unknown) => void | Promise

onToolResult

(toolName: string, result: unknown) => void | Promise