import type { ExtensionRegistryImpl } from '../../extensions/loader.js'; import { type SessionTimelineItem } from '../../session/transcript-outline.js'; import { type Config } from '../../config/schema.js'; import type { ExportFormat } from '../../session/types.js'; import type { ChatSendOptions, HistoryMessage, TuiBackend, TuiCompactionResult, TuiComposerHistoryItem, TuiEvent, TuiModelChoice, TuiShareRequest, TuiShareResult, TuiSessionStats, TuiSessionItem, TuiTranscriptTreeEntry, TuiAgentInfo, TuiWorkspaceFileSearchEntry, TuiWorkflowRunStartRequest, TuiWorkflowRunStartResult, TuiStartupProjectResult } from '../tui-backend.js'; import type { SessionInfo } from '../tui-types.js'; interface EmbeddedBackendOptions { config?: Config; extensionRegistry?: ExtensionRegistryImpl; implicitTrustedWorkspace?: string; isWorkspaceTrusted?: (workspaceDir: string) => boolean | null | undefined; } /** * 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 agentLoading; private config; private workspace; private sessionIndex; private sessionIndexReady; private workflowRunService; private running; private chatAbort; onEvent?: (evt: TuiEvent) => void; onConnected?: () => void; onDisconnected?: (reason: string) => void; constructor(opts?: EmbeddedBackendOptions); get connectionLabel(): string; getComposerInputHistory(): Promise; recordComposerInputHistory(text: string): Promise; start(): void; private ensureAgent; private createAgent; private refreshXopcCloudModels; stop(): void; getActiveSignal(): AbortSignal | undefined; private getWorkflowRunService; private activeConfig; private isWorkspaceTrusted; getStartupResources(sessionKey: string): Promise; refreshWorkspaceTrust(): void; startWorkflowRun(opts: TuiWorkflowRunStartRequest): Promise; resolveStartupProject(opts: { workspacePath: string; sessionKey: string; agentId: string; autoCreate?: boolean; }): Promise; searchWorkspaceFiles(sessionKey: string, query: string, options?: { limit?: number; }): Promise; getReviewContext(sessionKey: string): Promise; sendChat(opts: ChatSendOptions): Promise<{ runId: string; }>; abortChat(_opts: { sessionKey: string; runId: string; }): Promise<{ ok: boolean; }>; submitChatInput(opts: { sessionKey: string; message: string; delivery: 'next' | 'steer'; }): Promise<{ ok: boolean; effectiveDelivery?: 'next' | 'steer'; }>; getChatInputState(sessionKey: string): Promise<{ sessionKey: string; revision: number; inputs: { id: string; status: string; }[]; }>; loadHistory(opts: { sessionKey: string; limit?: number; }): Promise<{ messages: HistoryMessage[]; }>; loadHistoryWindow(opts: { sessionKey: string; rowNumber: number; before?: number; after?: number; }): Promise<{ messages: import("../../session/client-history.js").ClientHistoryMessage[]; startRowNumber: number; endRowNumber: number; totalRows: number; }>; loadTranscriptTree(sessionKey: string): Promise; loadTimeline(sessionKey: string): Promise; getSessionStats(sessionKey: string): Promise; listSessions(): Promise; listAgents(): Promise; setTuiDefaultAgent(agentId: string): Promise<{ agentId: string; }>; renameSession(sessionKey: string, name: string): Promise<{ ok: boolean; }>; deleteSession(sessionKey: string): Promise<{ ok: boolean; }>; getSessionInfo(sessionKey: string): Promise; listModels(): Promise; refreshModels(): Promise; resetSession(sessionKey: string): Promise; patchSession(sessionKey: string, patch: Record): Promise; compactSession(sessionKey: string, options?: { force?: boolean; instructions?: string; }): Promise; exportSession(sessionKey: string, format: ExportFormat): Promise; importSession(targetSessionKey: string, jsonContent: string): Promise<{ sessionKey: string; rowCount: number; }>; createShare(_sessionKey: string, request: TuiShareRequest, _options?: { agentId?: string; }): Promise; btwQuery(sessionKey: string, question: string): Promise<{ text: string; error?: string; }>; forkSession(sourceSessionKey: string, targetSessionKey: string): Promise<{ sessionKey: string; rowCount: number; }>; forkSessionAt(sourceSessionKey: string, targetSessionKey: string, entryId: string): Promise<{ sessionKey: string; rowCount: number; }>; setTranscriptLabel(sessionKey: string, entryId: string, label: string | undefined): Promise<{ ok: boolean; }>; appendCustomEntry(sessionKey: string, customType: string, data?: unknown): Promise<{ ok: boolean; }>; appendCustomMessage(sessionKey: string, message: { customType: string; content?: string | unknown[]; display?: boolean; details?: unknown; }): Promise<{ ok: boolean; }>; appendBashExecution(sessionKey: string, entry: { command: string; output?: string; exitCode?: number | null; signal?: string | null; excludeFromContext?: boolean; truncated?: boolean; fullOutputPath?: string; }): Promise<{ ok: boolean; }>; private processOutbound; } export {};