import type { HarnessHooks, RunContext, StepResult, ToolCallRecord, HarnessStreamPart, Session, TurnUsage } from '../types/index.js'; import type { SessionEndMetadata } from '../types/telemetry.js'; import type { ModelMessage } from 'ai'; type HookErrorHandler = (hookName: string, error: Error) => void; export declare class HookRunner { private hooks; private errorHandler; constructor(hooks?: HarnessHooks, errorHandler?: HookErrorHandler); /** Check if a specific hook is configured. */ has(hookName: string): boolean; run(hookName: K, ...args: NonNullable extends (...args: infer P) => any ? P : never): Promise; onStart(context: RunContext): Promise; onEnd(context: RunContext, result: { success: boolean; error?: Error; }): Promise; onStepStart(context: RunContext, step: number): Promise; onStepEnd(context: RunContext, step: number, result: StepResult): Promise; onTokensUpdate(context: RunContext, turn: TurnUsage): Promise; onToolCall(context: RunContext, call: ToolCallRecord): Promise; onToolResult(context: RunContext, call: ToolCallRecord): Promise; onToolError(context: RunContext, call: ToolCallRecord, error: Error): Promise; onAgentStart(context: RunContext, agentId: string): Promise; onAgentEnd(context: RunContext, agentId: string): Promise; onHandoff(context: RunContext, from: string, to: string, reason: string): Promise; onError(context: RunContext, error: Error): Promise; onMessage(context: RunContext, message: ModelMessage): Promise; onStreamPart(context: RunContext, part: HarnessStreamPart): Promise; onSessionEnd(session: Session, metadata: SessionEndMetadata): Promise; merge(additionalHooks: HarnessHooks): void; setHooks(hooks: HarnessHooks): void; getHooks(): HarnessHooks; } export declare function createHookRunner(hooks?: HarnessHooks, errorHandler?: HookErrorHandler): HookRunner; export {};