/** * Browser connection error helpers. * * Simplified — no more token/extension/CDP classification. * The daemon architecture has a single failure mode: daemon not reachable or extension not connected. */ import { BrowserConnectError, type BrowserConnectKind } from '../errors.js'; /** * Unified browser error classification. * * All transient error detection lives here — daemon-client, pipeline executor, * and page retry logic all use this single system instead of maintaining * separate pattern lists. */ /** Error category — determines which layer should retry. */ export type BrowserErrorKind = 'extension-transient' | 'target-navigation' | 'non-retryable'; /** How the caller should handle the error. */ export interface RetryAdvice { /** Error category — callers use this to decide whether *they* should retry. */ kind: BrowserErrorKind; /** Whether the error is transient and worth retrying. */ retryable: boolean; /** Suggested delay before retry (ms). */ delayMs: number; } /** * Classify a browser error and return retry advice. * * Single source of truth for "is this error transient?" across all layers. */ export declare function classifyBrowserError(err: unknown): RetryAdvice; /** * Check if an error is a transient browser error worth retrying. * Convenience wrapper around classifyBrowserError(). */ export declare function isTransientBrowserError(err: unknown): boolean; export type ConnectFailureKind = BrowserConnectKind; export declare function formatBrowserConnectError(kind: ConnectFailureKind, detail?: string): BrowserConnectError;