/**
 * Extension Hook System
 */
import type { ExtensionHookEvent, HookAgentContext as HookContext, AgentMessage, BeforeAgentStartContext } from './types/hooks.js';
import { ExtensionRegistryImpl as ExtensionRegistry } from './loader.js';
export interface HookRunnerOptions {
    catchErrors?: boolean;
    logger?: HookLogger;
}
export interface HookLogger {
    debug?: (message: string) => void;
    info: (message: string) => void;
    warn: (message: string) => void;
    error: (message: string) => void;
}
export declare class ExtensionHookRunner {
    private registry;
    private options;
    constructor(registry: ExtensionRegistry, options?: HookRunnerOptions);
    getRegistry(): ExtensionRegistry;
    runHooks<K extends ExtensionHookEvent>(event: K, eventData: unknown, context: HookContext): Promise<{
        success: boolean;
        results: unknown[];
    }>;
    runHooksWithResult<K extends ExtensionHookEvent>(event: K, eventData: BeforeAgentStartContext, context: HookContext): Promise<BeforeAgentStartContext>;
    runBeforeToolCall(toolName: string, params: Record<string, unknown>, context: HookContext): Promise<{
        allowed: boolean;
        params?: Record<string, unknown>;
        reason?: string;
    }>;
    runMessageSending(to: string, content: string, context: HookContext, opts?: {
        channel?: string;
    }): Promise<{
        send: boolean;
        content?: string;
        reason?: string;
    }>;
    runMessageSent(to: string, content: string, success: boolean, error: string | undefined, context: HookContext, opts?: {
        channel?: string;
    }): Promise<void>;
    runContextHook(messages: AgentMessage[], context?: HookContext): Promise<{
        messages: AgentMessage[];
        modified: boolean;
    }>;
    runInputHook(text: string, images: Array<{
        type: string;
        data: string;
        mimeType?: string;
    }> | undefined, source: string, context?: HookContext): Promise<{
        text: string;
        images: Array<{
            type: string;
            data: string;
            mimeType?: string;
        }> | undefined;
        action: 'continue' | 'handled';
        skipAgent: boolean;
        response?: string;
    }>;
    runVoidHook<K extends ExtensionHookEvent>(hookName: K, eventData: unknown, context: HookContext): Promise<void>;
    runModifyingHook<K extends ExtensionHookEvent, R = unknown>(hookName: K, eventData: unknown, context: HookContext, merge?: (current: R, next: R) => R): Promise<R | undefined>;
    runClaimingHook<K extends ExtensionHookEvent>(hookName: K, eventData: unknown, context: HookContext): Promise<{
        handled: boolean;
        result?: unknown;
    }>;
    runHooksByMode<K extends ExtensionHookEvent>(hookName: K, eventData: unknown, context: HookContext): Promise<{
        success: boolean;
        result?: unknown;
    }>;
}
export declare function createHookContext(overrides?: Partial<HookContext>): HookContext;
export declare function isHookEvent(value: string): value is ExtensionHookEvent;
export type { HookContext };
