/**
 * Cross-process advisory file lock for soul writes.
 *
 * The in-process commit queue (git.ts enqueueCommit) serializes writes within
 * ONE process, but LISA runs as several processes against the same
 * ~/.lisa/soul/: the web server, the CLI/REPL, and — crucially — the
 * heartbeat/idle runners launched by launchd/cron on their own clock. Two of
 * those writing concurrently can:
 *   - lose a desire-progress append (read-modify-write race), or
 *   - collide on .git/index.lock (one commit fails).
 *
 * withFileLock implements a portable advisory mutex via exclusive file
 * creation (`open(..., "wx")` succeeds only if the file doesn't exist). It
 * self-heals from a crashed holder via a staleness timeout + a best-effort
 * liveness check on the recorded pid.
 */
export interface FileLockOpts {
    /** Treat a held lock as abandoned after this many ms (crashed holder). */
    staleMs?: number;
    /** Give up acquiring after this many ms. */
    timeoutMs?: number;
    /** Poll interval while waiting for the lock. */
    pollMs?: number;
}
/**
 * Run `fn` while holding an exclusive lock at `lockPath`. Releases the lock
 * (deletes the file) when `fn` settles, success or failure.
 */
export declare function withFileLock<T>(lockPath: string, fn: () => Promise<T>, opts?: FileLockOpts): Promise<T>;
/** The canonical soul write-lock path. */
export declare const SOUL_LOCK_PATH: string;
/**
 * Run `fn` while holding the soul write-lock. Use this around any
 * read-modify-write of soul state (e.g. desire-progress appends) so a
 * concurrent heartbeat/idle/chat process can't interleave and lose data.
 */
export declare function withSoulLock<T>(fn: () => Promise<T>, opts?: FileLockOpts): Promise<T>;
//# sourceMappingURL=lock.d.ts.map