/**
 * Module: evt-registry
 *
 * PubChan registry for managing dialog event streams.
 * Maps dialog IDs to PubChans for real-time event streaming during dialog driving.
 */
import { PubChan, SubChan } from '@longrun-ai/kernel/evt';
import type { DialogEvent, DialogEventBase, TypedDialogEvent } from '@longrun-ai/kernel/types/dialog';
import { Dialog, DialogID } from './dialog';
export interface DialogEventRegistry {
    getPubChan(dialogId: DialogID): PubChan<TypedDialogEvent>;
    createSubChan(dialogId: DialogID): SubChan<TypedDialogEvent>;
    removePubChan(dialogId: DialogID): void;
    postEvent(dlg: Dialog, event: DialogEvent & Partial<DialogEventBase>): void;
    postEventById(dialogId: DialogID, event: DialogEvent): void;
    createTypedEvent(dialogId: DialogID, event: DialogEvent): TypedDialogEvent;
}
declare class DialogEventRegistryImpl implements DialogEventRegistry {
    private pubChans;
    private readonly log;
    private globalDialogEventBroadcaster;
    setGlobalDialogEventBroadcaster(fn: ((evt: TypedDialogEvent) => void) | null): void;
    private broadcastGlobalEvent;
    private emitDialogTouched;
    private dispatchGloballyIfNeeded;
    /**
     * Get or create a PubChan for a specific dialog ID
     */
    getPubChan(dialogId: DialogID): PubChan<TypedDialogEvent>;
    /**
     * Create a SubChan for a specific dialog ID
     */
    createSubChan(dialogId: DialogID): SubChan<TypedDialogEvent>;
    /**
     * Remove PubChan for a dialog
     */
    removePubChan(dialogId: DialogID): void;
    /**
     * Create a TypedDialogEvent with common metadata (dialog info and timestamp)
     */
    createTypedEvent(dialogId: DialogID, event: DialogEvent): TypedDialogEvent;
    /**
     * Post an event to the appropriate PubChan with proper hierarchy information
     */
    postEvent(dlg: Dialog, event: DialogEvent): void;
    postEventById(dialogId: DialogID, event: DialogEvent): void;
    /**
     * End-of-stream for a specific dialog
     */
    endStream(dialogId: DialogID): void;
    /**
     * Clean up all PubChans (for server shutdown)
     */
    cleanup(): void;
}
export declare const dialogEventRegistry: DialogEventRegistryImpl;
export declare function setGlobalDialogEventBroadcaster(fn: ((evt: TypedDialogEvent) => void) | null): void;
export declare function postDialogEvent(dlg: Dialog, event: DialogEvent): void;
/**
 * Post an event to a specific dialog's PubChan by ID.
 * Useful for posting sideDialog events when only the sideDialog ID is available.
 */
export declare function postDialogEventById(dialogId: DialogID, event: DialogEvent): void;
export declare function createEvent<T extends DialogEvent['type']>(type: T): Extract<DialogEvent, {
    type: T;
}>;
export {};
