/** * Degraded connection reason */ export type DegradedReason = 'key_expired' | 'key_revoked' | 'key_disabled' | 'auth_failed'; /** * Degraded connection info from server */ export interface DegradedConnectionInfo { isDegraded: true; reason: DegradedReason; agentId?: string; message: string; canReceiveReprovision: boolean; } /** * Reprovision available message from server */ export interface ReprovisionAvailableMessage { type: 'reprovision_available'; expiresAt: string; timestamp: string; } /** * Initialize degraded mode handler */ export declare function initDegradedModeHandler(callbacks: { onCredentialsUpdated?: (newKey: string) => void; onStateChanged?: (isDegraded: boolean, reason?: DegradedReason) => void; }): void; /** * Handle degraded connection notification from server */ export declare function handleDegradedConnection(info: DegradedConnectionInfo): void; /** * Handle reprovision available notification */ export declare function handleReprovisionAvailable(expiresAt: string): void; /** * Claim reprovision token and get new credentials * Called when the agent has received a reprovision token (e.g., via CLI or config) */ export declare function claimReprovisionToken(token: string): Promise; /** * Check if currently in degraded mode */ export declare function isDegradedMode(): boolean; /** * Get current degraded state */ export declare function getDegradedState(): { isDegraded: boolean; reason?: DegradedReason; agentId?: string; reprovisionAvailable: boolean; reprovisionExpiresAt?: string; }; /** * Manually set agent ID (used when server doesn't provide it) */ export declare function setAgentId(agentId: string): void; /** * Cleanup handler */ export declare function cleanupDegradedModeHandler(): void; //# sourceMappingURL=degraded-mode-handler.d.ts.map