import type { ExtensionRegistryImpl } from '../../extensions/loader.js';
import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiEvent, TuiModelChoice, TuiSessionItem } from '../tui-backend.js';
import type { SessionInfo } from '../tui-types.js';
/**
 * TUI backend that runs the agent in-process (no gateway required).
 *
 * Wraps `AgentService` directly and emits TuiEvents by observing the
 * `MessageBus` output stream.
 */
export declare class EmbeddedBackend implements TuiBackend {
    private readonly opts?;
    private bus;
    private agent;
    private running;
    private chatAbort;
    onEvent?: (evt: TuiEvent) => void;
    onConnected?: () => void;
    onDisconnected?: (reason: string) => void;
    constructor(opts?: {
        extensionRegistry?: ExtensionRegistryImpl;
    });
    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[]>;
    renameSession(sessionKey: string, name: string): Promise<{
        ok: boolean;
    }>;
    deleteSession(sessionKey: string): Promise<{
        ok: boolean;
    }>;
    getSessionInfo(sessionKey: string): Promise<SessionInfo>;
    listModels(): Promise<TuiModelChoice[]>;
    resetSession(sessionKey: string): Promise<void>;
    patchSession(_sessionKey: string, _patch: Record<string, unknown>): Promise<void>;
    compactSession(sessionKey: string, options?: {
        force?: boolean;
    }): Promise<{
        compacted: boolean;
        summary?: string;
    }>;
    private processOutbound;
}
