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 { ConnectionWait, ConnectionWaitSnapshot } from '@xopcai/gateway-contract'; export type ConnectionAction = { waitId: string; expectedTranscriptId: string; expectedVersion: number; idempotencyKey: string; expectedObjectiveRevision?: number; confirmUnchangedScope?: boolean; action: 'install_complete' | 'connect' | 'reopen' | 'check' | 'skip' | 'cancel' | 'select_account' | 'confirm_scope' | 'replace_source'; needKey?: string; accountId?: string; candidateRef?: 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 readonly checks; private readonly pendingAuthUrls; private timer?; private polling; start(): void; stop(): void; poll(): Promise; constructor(deps: { getConfig: () => Config; saveConfig: (config: Config) => Promise<{ saved: boolean; error?: string; }>; drain: (conversationId: string) => void; adapter?: ComposioSessionsAdapter; checkTimeoutMs?: number; }); private get adapter(); cancelObjective(target: ConnectionWait): void; continueObjective(target: ConnectionWait, idempotencyKey: string): Promise; private markChecking; /** Readiness checks never execute the objective; late results cannot advance a newer wait. */ private boundedCheck; snapshot(conversationId: string): ConnectionWaitSnapshot; private view; private ensureInstallation; private checkCapabilities; private syncConnections; preflight(input: SessionInput): Promise; act(conversationId: string, action: ConnectionAction): Promise<{ snapshot: ConnectionWaitSnapshot; authorizationUrl?: string; }>; }