import type pino from "pino";
import type { SessionInboundMessage, SessionOutboundMessage } from "../server/messages.js";
import { type TerminalStreamFrame } from "@kong-link/protocol/binary-frames/index";
import type { TerminalManager } from "./terminal-manager.js";
export interface TerminalSessionControllerOptions {
    terminalManager: TerminalManager | null;
    emit: (msg: SessionOutboundMessage) => void;
    emitBinary: (frame: Uint8Array) => void;
    hasBinaryChannel: () => boolean;
    isPathWithinRoot: (rootPath: string, candidatePath: string) => boolean;
    sessionLogger: pino.Logger;
    clientSupportsWrapReflow?: () => boolean;
}
export interface TerminalSessionControllerMetrics {
    directorySubscriptionCount: number;
    streamSubscriptionCount: number;
}
export declare class TerminalSessionController {
    private readonly terminalManager;
    private readonly emit;
    private readonly emitBinary;
    private readonly hasBinaryChannel;
    private readonly isPathWithinRoot;
    private readonly sessionLogger;
    private readonly clientSupportsWrapReflow;
    private readonly subscribedDirectories;
    private unsubscribeTerminalsChanged;
    private readonly exitSubscriptions;
    private readonly activeStreams;
    private readonly idToSlot;
    private nextSlot;
    constructor(options: TerminalSessionControllerOptions);
    start(): void;
    getMetrics(): TerminalSessionControllerMetrics;
    dispatch(msg: SessionInboundMessage): Promise<void> | undefined;
    handleBinaryFrame(frame: TerminalStreamFrame): void;
    killTerminalForClose(terminalId: string): {
        terminalId: string;
        success: boolean;
    };
    killTerminalsUnderPath(rootPath: string): Promise<void>;
    dispose(): void;
    private ensureExitSubscription;
    private handleTerminalExited;
    private emitTerminalsChangedSnapshot;
    private toTerminalInfo;
    private handleTerminalsChanged;
    private handleSubscribeTerminalsRequest;
    private handleUnsubscribeTerminalsRequest;
    private emitTerminalsSnapshotForRoot;
    private handleListTerminalsRequest;
    private getAllTerminalSessions;
    private handleCreateTerminalRequest;
    private handleRenameTerminalRequest;
    private handleSubscribeTerminalRequest;
    private handleUnsubscribeTerminalRequest;
    private handleTerminalInput;
    private killTracked;
    private handleKillTerminalRequest;
    private handleCaptureTerminalRequest;
    private bindActiveStream;
    private trySendSnapshot;
    private emitLegacySnapshot;
    private emitRestoreSnapshot;
    private replayTerminalOutputAfterSnapshot;
    private allocateSlot;
    private detachStream;
}
//# sourceMappingURL=terminal-session-controller.d.ts.map