import type { SessionState } from './session.js'; /** * Default bound on waiting for the extension to confirm a usable session before * a request gives up. Generous enough for a user to approve a first-time pair, * but finite — an unbounded wait was the "timed out waiting for the browser * bridge" hang (the client-side guard masking an indefinite `await`). */ export declare const SESSION_READY_TIMEOUT_MS = 30000; /** * Thrown when the extension is connected but never confirms a session within the * timeout — instead of hanging forever on `await sessionReady`. Distinguishes * "approval pending" (a pair code is waiting for the user) from "no session" * (signed out / no `ready` frame), so callers get an actionable error rather than * one opaque timeout. Realizes the 0.5.2 intent ("surface the pair code … instead * of hanging on a missing session") at the send path. */ export declare class FetchproxySessionNotReadyError extends Error { readonly reason: 'pair-required' | 'not-ready'; readonly pairCode: string | null; readonly mcpId: string; readonly hint: string; constructor(info: { mcpId: string; pairCode: string | null; }); } /** * Await a session-ready promise, but reject with a * {@link FetchproxySessionNotReadyError} if it hasn't settled within * `timeoutMs` — converting an indefinite hang into a bounded, differentiated * error. A genuine rejection of `ready` (e.g. extension disconnected) propagates * unchanged. `timeoutMs <= 0` opts out of the bound. */ export declare function awaitSessionReady(ready: Promise, opts: { mcpId: string; pendingPairCode: () => string | null; timeoutMs?: number; }): Promise;