/** A crashed holder's lock is reaped after this long. Holders finish in ~1s. */ export declare const SESSION_LOCK_STALE_MS = 15000; /** * Default acquire wait. Exceeds both the refresh HTTP timeout (a live holder * finishes within it) and the stale threshold (a dead holder gets reaped). */ export declare const SESSION_LOCK_WAIT_MS = 20000; /** * Take the session lock. Returns the acquisition's OWNER NONCE on success, null * on timeout. Ownership is per-acquisition state (returned to the caller, * passed back to release) — never module state, which two concurrent in-process * acquisitions would overwrite, letting the older one delete the newer one's * live lock. */ export declare function acquireSessionLock(waitMs?: number): Promise; export declare function releaseSessionLock(ownerNonce: string): void; /** * Run `fn` holding the session lock — NEVER without it. On acquire timeout this * throws instead of running `fn` unlocked: an unlocked session write could race * an in-flight token rotation, which is the exact corruption this lock exists to * prevent. The wait is bounded (no deadlock), crashed holders are reaped at the * stale threshold, and the only way to time out in practice is an unwritable * config dir — where the session write itself would fail anyway, so failing * loudly here loses nothing and says why. */ export declare function withSessionLock(fn: () => T | Promise, waitMs?: number): Promise; //# sourceMappingURL=session-lock.d.ts.map