import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiEvent, TuiModelChoice, TuiSessionItem } from '../tui-backend.js';
import type { SessionInfo } from '../tui-types.js';
interface GatewaySSEOptions {
    url: string;
    token?: string;
}
/**
 * TUI backend that communicates with a running xopc gateway via HTTP + SSE.
 *
 * - Agent streaming: `POST /api/agent` with `Accept: text/event-stream`
 * - Broadcast events: `GET /api/events` via long-lived SSE
 * - REST calls for sessions, models, etc.
 */
export declare class GatewaySseBackend implements TuiBackend {
    private readonly baseUrl;
    private readonly token;
    private eventAbort;
    private chatAbort;
    onEvent?: (evt: TuiEvent) => void;
    onConnected?: () => void;
    onDisconnected?: (reason: string) => void;
    onGap?: (info: {
        expected: number;
        received: number;
    }) => void;
    constructor(opts: GatewaySSEOptions);
    get connectionLabel(): string;
    start(): void;
    stop(): void;
    sendChat(opts: ChatSendOptions): Promise<{
        runId: string;
    }>;
    abortChat(opts: {
        sessionKey: string;
        runId: string;
    }): Promise<{
        ok: boolean;
    }>;
    steerChat(opts: {
        sessionKey: string;
        message: string;
    }): Promise<{
        ok: boolean;
    }>;
    loadHistory(opts: {
        sessionKey: string;
        limit?: number;
    }): Promise<{
        messages: HistoryMessage[];
    }>;
    listSessions(): Promise<TuiSessionItem[]>;
    getSessionInfo(sessionKey: string): Promise<SessionInfo>;
    listModels(): Promise<TuiModelChoice[]>;
    resetSession(sessionKey: string): Promise<void>;
    compactSession(sessionKey: string, options?: {
        force?: boolean;
    }): Promise<{
        compacted: boolean;
        summary?: string;
    }>;
    patchSession(sessionKey: string, patch: Record<string, unknown>): Promise<void>;
    renameSession(sessionKey: string, name: string): Promise<{
        ok: boolean;
    }>;
    deleteSession(sessionKey: string): Promise<{
        ok: boolean;
    }>;
    private startEventStream;
    private scheduleReconnect;
}
export {};
