export declare const AUTH_DIR: string; export declare const AUTH_FILE: string; export interface StoredAuth { access_token: string; refresh_token: string; user_id: string; email: string; expires_at?: number; api_key?: string; session_key?: string; } export declare function loadAuth(): StoredAuth | null; export declare const saveAuth: (auth: StoredAuth) => void; export declare const clearAuth: () => void; /** Compare and change inside the same process-shared lock, preserving unrelated fields. */ export declare function updateAuth(expected: StoredAuth | null, changes: Partial | null): { updated: boolean; current: StoredAuth | null; }; /** Network refresh uses a separate async lock; logout never waits for an HTTP request. */ export declare function withSessionRefresh(operation: () => Promise): Promise;