import type { McpServer } from '@agentclientprotocol/sdk'; import type { AcpRuntime } from './runtime.js'; import type { RuntimeSession } from './session.js'; export interface OpenOrCreateRuntimeSessionOptions { runtime: Pick; sessionId?: string | null; cwd?: string; mcpServers?: McpServer[]; /** Defaults to true. When false, loadSession failures are always rethrown. */ fallbackOnMissing?: boolean; onStatus?: (message: string) => void; } export interface OpenOrCreateRuntimeSessionResult { session: RuntimeSession; resumed: boolean; requestedSessionId: string | null; } /** * Resume a saved ACP session when possible, falling back to a fresh session only * when the saved id is clearly stale or missing. Transport, timeout, auth, and * service failures are rethrown so callers do not silently discard live recovery. */ export declare function openOrCreateRuntimeSession(options: OpenOrCreateRuntimeSessionOptions): Promise; export declare function isMissingAcpSessionError(error: unknown, depth?: number, seen?: WeakSet): boolean;