export interface KnownSession {
    agentId: string;
    name: string;
    hostname: string;
    workDir: string;
    version: string;
    entra: boolean;
    lastSeen: number;
}
export interface PersistedState {
    version: 1;
    serverSecret: string;
    sessionOwners: Record<string, {
        oid: string;
        email: string;
        updatedAt: number;
    }>;
    sessionAuth: Record<string, {
        passwordHash: string;
        passwordSalt: string;
    }>;
    authAttempts: Record<string, {
        failures: number;
        lockedUntil: number | null;
    }>;
    knownSessions: Record<string, KnownSession>;
}
export declare function loadPersistedState(): PersistedState | null;
/** Synchronous save — used ONLY for SIGINT/SIGTERM shutdown handlers.
 *  Uses a distinct temp file suffix to avoid colliding with async saves. */
export declare function savePersistedState(state: PersistedState): void;
/** Async save — used for debounced runtime persistence (non-blocking). */
export declare function savePersistedStateAsync(state: PersistedState): Promise<void>;
export declare function clearPersistedState(): void;
export declare function setStateCollector(fn: () => PersistedState): void;
export declare function markDirty(): void;
/** Sync flush — for shutdown handlers only. */
export declare function flushState(): void;
/** Async flush — for debounced runtime persistence (non-blocking).
 *  Serializes writes so concurrent calls don't overlap, and preserves
 *  the dirty flag if a mutation arrives during an in-flight save. */
export declare function flushStateAsync(): Promise<void>;
