import type { ExtensionRegistryImpl } from '../../extensions/extension-registry-impl.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, TuiChatInputState } 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; private readonly chatInputStates; private readonly drafts; private readonly inputStateRevisions; onEvent?: (evt: TuiEvent) => void; onConnected?: () => void; onDisconnected?: (reason: string) => void; constructor(opts?: EmbeddedBackendOptions); get connectionLabel(): string; getComposerInputHistory(): Promise; getComposerDraftDirectory(): 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(conversationId: string): Promise; refreshWorkspaceTrust(): void; startWorkflowRun(opts: TuiWorkflowRunStartRequest): Promise; resolveStartupProject(opts: { workspacePath: string; conversationId: string; agentId: string; autoCreate?: boolean; }): Promise; searchWorkspaceFiles(conversationId: string, query: string, options?: { limit?: number; }): Promise; getReviewContext(conversationId: string): Promise; sendChat(opts: ChatSendOptions): Promise<{ runId: string; }>; abortChat(_opts: { conversationId: string; runId: string; }): Promise<{ ok: boolean; }>; submitChatInput(opts: { conversationId: string; message: string; delivery: 'next' | 'steer'; }): Promise<{ ok: boolean; effectiveDelivery?: 'next' | 'steer'; state?: TuiChatInputState; }>; getChatInputState(conversationId: string): Promise; updateChatInput(opts: { conversationId: string; inputId: string; version: number; content: string; }): Promise<{ ok: boolean; state?: TuiChatInputState; }>; removeChatInput(opts: { conversationId: string; inputId: string; version: number; }): Promise<{ ok: boolean; state?: TuiChatInputState; }>; private appendPendingChatInput; private consumePendingChatInput; private publishChatInputState; private sequenceInputState; private replaceEmbeddedQueue; loadHistory(opts: { conversationId: string; limit?: number; }): Promise<{ messages: HistoryMessage[]; }>; loadHistoryWindow(opts: { conversationId: string; rowNumber: number; before?: number; after?: number; }): Promise<{ messages: import("../../session/client-history.js").ClientHistoryMessage[]; startRowNumber: number; endRowNumber: number; totalRows: number; }>; loadTranscriptTree(conversationId: string): Promise; loadTimeline(conversationId: string): Promise; getSessionStats(conversationId: string): Promise; listSessions(): Promise; listAgents(): Promise; setTuiDefaultAgent(agentId: string): Promise<{ agentId: string; }>; renameSession(conversationId: string, name: string): Promise<{ ok: boolean; }>; deleteSession(conversationId: string): Promise<{ ok: boolean; }>; createConversation(agentId: string, conversationId?: string): Promise; private materializeDraft; getSessionInfo(conversationId: string): Promise; listModels(): Promise; refreshModels(): Promise; resetSession(conversationId: string): Promise; patchSession(conversationId: string, patch: Record): Promise; compactSession(conversationId: string, options?: { force?: boolean; instructions?: string; }): Promise; exportSession(conversationId: string, format: ExportFormat): Promise; importSession(targetConversationId: string, jsonContent: string): Promise<{ conversationId: string; rowCount: number; }>; createShare(_conversationId: string, request: TuiShareRequest, _options?: { agentId?: string; }): Promise; btwQuery(conversationId: string, question: string): Promise<{ text: string; error?: string; }>; forkSession(sourceConversationId: string, targetConversationId: string): Promise<{ conversationId: string; rowCount: number; }>; forkSessionAt(sourceConversationId: string, targetConversationId: string, entryId: string): Promise<{ conversationId: string; rowCount: number; }>; setTranscriptLabel(conversationId: string, entryId: string, label: string | undefined): Promise<{ ok: boolean; }>; appendCustomEntry(conversationId: string, customType: string, data?: unknown): Promise<{ ok: boolean; }>; appendCustomMessage(conversationId: string, message: { customType: string; content?: string | unknown[]; display?: boolean; details?: unknown; }): Promise<{ ok: boolean; }>; appendBashExecution(conversationId: string, entry: { command: string; output?: string; exitCode?: number | null; signal?: string | null; excludeFromContext?: boolean; truncated?: boolean; fullOutputPath?: string; }): Promise<{ ok: boolean; }>; private processOutbound; } export {};