/**
 * Minimal cross-process advisory lock (PERM-006).
 *
 * The grant store and the escalation pending-file are mutated by BOTH the
 * MCP server and the settings server via a load → mutate → atomic-rename
 * cycle. The atomic rename prevents torn reads, but does NOT prevent a
 * lost-update race: two processes can each `load`, each mutate their own
 * copy, and the second `rename` clobbers the first writer's record.
 *
 * This helper serializes those cycles with a sibling `${target}.lock`
 * directory. We use `mkdirSync` (not an `O_EXCL` file open) because directory
 * creation is atomic on every platform and leaves no ambiguity about whether
 * the lock was acquired. A stale lock (holder crashed mid-cycle) is broken
 * once it is older than STALE_MS so the system can never deadlock.
 *
 * No external dependency — `proper-lockfile`/`flock` would be heavier than the
 * guarantee we need here (single-host, two cooperating Node processes, sub-ms
 * critical sections).
 */
/**
 * Run `fn` while holding a cross-process advisory lock on `target`. The lock is
 * always released, even if `fn` throws. If the lock cannot be acquired within
 * the timeout, `fn` still runs (best-effort) — we prefer a rare lost update to
 * a hung server.
 */
export declare function withFileLock<T>(target: string, fn: () => T): T;
//# sourceMappingURL=file-lock.d.ts.map