/// <reference types="node" />
import { OAuthTraceEvent } from './trace-events';
export type FailureBranchId = 'URL_NOT_DISPLAYED' | 'BROWSER_NOT_OPENED' | 'CALLBACK_NEVER_OBSERVED' | 'BINARY_ERROR_EXIT' | 'TOKEN_FILE_MISSING_POST_EXIT' | 'TIMEOUT' | 'SESSION_CANCELLED' | 'TOKEN_EXCHANGE_REJECTED' | 'PASTE_INVALID' | 'GEMINI_PLUS_MISSING_CRED' | 'AGY_RESPONSIBILITY_DECLINED' | 'UNKNOWN';
export interface DiagnosisResult {
    branchId: FailureBranchId;
    data: Record<string, unknown>;
}
/**
 * Pure function: read a recorder snapshot and decide which failure branch fits best.
 * No side effects, no console writes.
 */
export declare function diagnoseFailure(snapshot: OAuthTraceEvent[]): DiagnosisResult;
export interface FormatErrorOptions {
    verbose: boolean;
    platform: NodeJS.Platform;
    callbackPort: number | null;
    provider: string;
}
/**
 * Map a diagnosed branch to user-facing message lines (ASCII only, no emojis).
 * Always ends with a concrete next-step command.
 */
export declare function formatErrorMessage(result: DiagnosisResult, opts: FormatErrorOptions): string[];
//# sourceMappingURL=diagnose-failure.d.ts.map