/** * File-based locking for state.json. * * Uses atomic mkdir() as the lock primitive (works across platforms). * Includes stale-lock detection: if the lock is older than STALE_MS * and the holding PID is dead, it's forcibly removed. * * Lock directory is passed in via setLockDir() from state.ts after initStateDir(). */ /** Called by state.ts after initStateDir() to set the lock directory. */ export declare function setLockDir(dir: string): void; /** * Execute `fn` while holding the state lock. * Handles stale lock cleanup and retries with backoff. */ export declare function withStateLock(fn: () => Promise): Promise;