import { EventEmitter } from 'events';
export interface WSMessage {
    type: string;
    payload?: any;
    timestamp?: string;
    id?: string;
    agentId?: string;
    correlationId?: string;
}
export declare class AgentWSClient extends EventEmitter {
    private ws;
    private reconnectTimer;
    private forcedReconnectTimer;
    private heartbeatTimer;
    private pingTimer;
    private socketHealthTimer;
    private lastInboundActivityAt;
    private reconnectDelay;
    private maxReconnectDelay;
    private connected;
    private agentId;
    private serverConfig;
    private rotateEndpointOnReconnect;
    private lastAttemptedWsUrl;
    private forceImmediateWsUrl;
    private skipNextEndpointRotation;
    private connectionEventQueuePath;
    private connectionEventQueue;
    private readonly maxConnectionEventQueue;
    private flushingConnectionEvents;
    private wsConnectEpoch;
    private lastForcedReconnectAt;
    private endpointBackoffUntil;
    private currentConnectedWsUrl;
    private lastPreferredRecoveryAttemptAt;
    constructor();
    private resolveConnectionEventQueuePath;
    private loadConnectionEventQueue;
    private persistConnectionEventQueue;
    private queueConnectionEvent;
    private flushConnectionEventQueue;
    private markInboundActivity;
    private normalizeEndpointUrl;
    private pruneEndpointBackoff;
    private markEndpointFailure;
    private clearEndpointFailure;
    private startSocketHealthMonitor;
    private stopSocketHealthMonitor;
    private getWsCandidates;
    private getPreferredWsCandidate;
    private maybeRecoverPreferredEndpoint;
    private selectWsUrlForConnect;
    connect(): void;
    private applyTlsMismatchFallback;
    private register;
    private handleMessage;
    send(message: WSMessage): void;
    sendMetrics(type: string, data: any): void;
    private metricsBatch;
    private metricsBatchEnabled;
    private metricsBatchSize;
    private metricsBatchTimer;
    private startMetricsBatchFlush;
    private stopMetricsBatchFlush;
    private flushMetricsBatch;
    private startHeartbeat;
    private stopHeartbeat;
    private scheduleReconnect;
    isConnected(): boolean;
    getCurrentWsUrl(): string;
    getAgentId(): string | null;
    getServerConfig(): any;
    disconnect(): void;
    /**
     * Reconnect the WebSocket using the current config.server.wsUrl.
     * Call this after updating config.server.wsUrl at runtime (e.g. after
     * WireGuard tunnel is established) to route traffic through the tunnel.
     */
    setPreferredWsUrl(targetWsUrl: string): void;
    reconnect(targetWsUrl?: string): void;
}
//# sourceMappingURL=client.d.ts.map