import type { BaseMessageFields, UsageMetadata } from '@langchain/core/messages';
import type { MultiAgentGraph, StandardGraph } from '@/graphs';
import type { Logger } from 'winston';
import type * as t from '@/types';
export declare class HandlerRegistry {
    private handlers;
    register(eventType: string, handler: t.EventHandler): void;
    getHandler(eventType: string): t.EventHandler | undefined;
}
export declare class ModelEndHandler implements t.EventHandler {
    collectedUsage?: UsageMetadata[];
    constructor(collectedUsage?: UsageMetadata[]);
    handle(event: string, data: t.ModelEndData, metadata?: Record<string, unknown>, graph?: StandardGraph | MultiAgentGraph): Promise<void>;
}
export declare class ToolEndHandler implements t.EventHandler {
    private callback?;
    private logger?;
    constructor(callback?: t.ToolEndCallback, logger?: Logger);
    /**
     * Handles on_tool_end events from the for-await stream consumer.
     *
     * This handler is now purely a consumer callback — tool completion
     * (ON_RUN_STEP_COMPLETED dispatch + session context storage) is handled
     * in graph context by ToolNode directly, eliminating the race between
     * the stream consumer and graph execution.
     */
    handle(event: string, data: t.StreamEventData | undefined, metadata?: Record<string, unknown>, graph?: StandardGraph | MultiAgentGraph): Promise<void>;
}
export declare class TestLLMStreamHandler implements t.EventHandler {
    handle(event: string, data: t.StreamEventData | undefined): void;
}
export declare class TestChatStreamHandler implements t.EventHandler {
    handle(event: string, data: t.StreamEventData | undefined): void;
}
export declare class LLMStreamHandler implements t.EventHandler {
    handle(event: string, data: t.StreamEventData | undefined, metadata?: Record<string, unknown>): void;
}
export declare const createMetadataAggregator: (_collected?: Record<string, NonNullable<BaseMessageFields["response_metadata"]>>[]) => t.MetadataAggregatorResult;
