export interface LockData { pid?: number; port: number; profileDir: string; browserPath: string; mode: "session" | "attach"; appName?: string; pending?: boolean; timestamp?: number; fingerprint?: { launchTimestamp: number; userAgent?: string; cdpVersion?: string; }; } export declare function getLockFilePath(appName?: string): string; export declare function getMutexFilePath(appName?: string): string; declare function acquireMutex(appName?: string): Promise<() => Promise>; export declare function writeLockSafe(data: LockData, appName?: string): Promise; export declare function writeLock(data: LockData, appName?: string): Promise; export declare function readLock(appName?: string): LockData | null; export declare function clearLock(appName?: string): void; /** * Safe variant: only clears the lock if it was written by THIS process (process.pid). * Prevents a second MCP server instance from wiping the first instance's browser lock * during its retry loop, which would allow a race condition where two browsers spawn. */ export declare function clearLockIfOwned(appName?: string): void; export declare function isProcessRunning(pid: number): boolean; /** * Two-factor lock validation: PID alive AND port accepting TCP connections. * Prevents PID-reuse false-positives after a crash. */ export declare function isLockValid(lock: LockData): Promise; export declare function isLockPending(lock: LockData): boolean; export { acquireMutex };