export type P2pRelayFailureCode = 'p2p_unavailable' | 'p2p_timeout' | 'p2p_not_connected' | 'p2p_datachannel_closed' | 'p2p_no_route' | 'p2p_daemon_offline' | 'mesh_logic_or_provider_failure';
export interface P2pRelayFailureContext {
    command?: string;
    targetDaemonId?: string;
}
export interface P2pRelayFailureClassification {
    code: P2pRelayFailureCode;
    reason: string;
    transport: 'p2p' | 'unknown';
    recoverable: boolean;
    retryRecommended: boolean;
    nextAction: string;
    noFallbackReason: string;
}
export interface P2pRelayFailurePayload extends P2pRelayFailureClassification {
    success: false;
    error: string;
    command?: string;
    targetDaemonId?: string;
}
export declare function classifyP2pRelayFailure(error: unknown, _context?: P2pRelayFailureContext): P2pRelayFailureClassification;
export declare function isP2pRelayTransportFailure(error: unknown): boolean;
export declare function buildP2pRelayFailurePayload(error: unknown, context?: P2pRelayFailureContext): P2pRelayFailurePayload;
export declare class P2pRelayFailureError extends Error {
    code: P2pRelayFailureCode;
    reason: string;
    transport: 'p2p' | 'unknown';
    recoverable: boolean;
    retryRecommended: boolean;
    nextAction: string;
    noFallbackReason: string;
    command?: string;
    targetDaemonId?: string;
    constructor(message: string, context?: P2pRelayFailureContext);
}
