import type { Config } from '../config/schema.js'; import type { SessionInput } from '../storage/sqlite/session-input-repository.js'; import { ComposioSessionsAdapter } from './composio-sessions.js'; import { type PluginMcpRecovery } from './plugin-mcp-recovery.js'; import type { ConnectionWaitSnapshot } from '@xopcai/gateway-contract'; export type ConnectionAction = { waitId: string; expectedTranscriptId: string; expectedVersion: number; idempotencyKey: string; action: 'install_complete' | 'connect' | 'check' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source' | 'submit_callback'; needKey?: string; accountId?: string; candidateRef?: string; callbackUrl?: string; instanceId?: string; }; /** Authorization lives at click time. Chat history contains only immutable explanations. */ export declare class ConnectionRecoveryService { private readonly deps; private readonly busy; private timer?; private deliveryTimer?; private polling; start(): void; stop(): void; poll(): Promise; constructor(deps: { getConfig: () => Config; saveConfig: (config: Config) => Promise<{ saved: boolean; error?: string; }>; drain: (conversationId: string) => void; onPersonalRequestDelivered?: (conversationId: string, requestId: string) => void; adapter?: ComposioSessionsAdapter; pluginMcp?: PluginMcpRecovery; }); private get adapter(); private get pluginMcp(); snapshot(conversationId: string): ConnectionWaitSnapshot; private view; private ensureInstallation; private checkCapabilities; private syncConnections; private syncPluginMcpNeeds; preflight(input: SessionInput): Promise; act(conversationId: string, action: ConnectionAction): Promise<{ snapshot: ConnectionWaitSnapshot; authorizationUrl?: string; }>; }