export interface PresenceLock { pid?: number; slug?: string; ts?: number; } /** Path to the loop's live-presence lock for a workspace. */ export declare function presenceLockPath(cwd: string): string; /** Read + parse the presence lock; null on absent / unreadable / bad JSON. */ export declare function readPresenceLock(cwd: string): PresenceLock | null; export interface ForeignOwnerOpts { now?: number; selfPid?: number; freshMs?: number; isAlive?: (pid: number, selfPid: number) => boolean; } /** * Given a parsed ws-presence.lock, return the pid of a DIFFERENT, still-alive * loop that currently owns this workspace's live presence — or null when the * caller should proceed (no lock, our own pid, a dead pid, or a stale ts). * Freshness defaults to 90s (the loop refreshes ts every ~25s heartbeat, so this * tolerates a few missed beats while still ignoring a crashed loop's stale lock). */ export declare function foreignLoopOwner(lock: PresenceLock | null | undefined, opts?: ForeignOwnerOpts): number | null;