import type { DomindsRuntimeMode, WebSocketMessage } from '@longrun-ai/kernel/types';
import { type LanguageCode } from '@longrun-ai/kernel/types/language';
import type { Server as HttpServer } from 'http';
import type { Server as HttpsServer } from 'https';
import { WebSocket, WebSocketServer } from 'ws';
import { Dialog } from '../dialog';
import type { AuthConfig } from './auth';
export declare function resolveUserMessageLanguageCodeForTest(args: {
    ws: WebSocket;
    raw: unknown;
    fallbackDialog?: Dialog;
}): LanguageCode;
export declare function shouldQueueUserSupplementAtGenerationBoundary(args: {
    latestGenerating: boolean;
    inMemoryGenerating: boolean;
    isLocked: boolean;
}): boolean;
type UserMessageIngressPrompt = {
    content: string;
    msgId: string;
    grammar: 'markdown';
    userLanguageCode?: LanguageCode;
};
export declare function wrapCriticalUserInterjectionPromptAtIngress(dialog: Dialog, prompt: UserMessageIngressPrompt): UserMessageIngressPrompt;
/**
 * Handle incoming WebSocket messages
 */
export declare function handleWebSocketMessage(ws: WebSocket, packet: WebSocketMessage): Promise<void>;
/**
 * Setup WebSocket server with dialog handling
 */
export declare function setupWebSocketServer(httpServers: HttpServer | HttpsServer | readonly (HttpServer | HttpsServer)[], clients: Set<WebSocket>, auth: AuthConfig, serverWorkLanguage: LanguageCode, mode: DomindsRuntimeMode): readonly WebSocketServer[];
/**
 * Clean up all event channels and subscriptions
 */
export declare function cleanupEventSystems(): void;
export {};
