/** * Bridge Lock — Read, write, and clear the `.memoire/bridge.json` lock file. * * The lock file records the PID and port of a running `memi connect` bridge so * that other engine instances (pull, sync, compose…) can reuse it rather than * starting a new server on a different port. * * Responsibilities extracted from: * - MemoireEngine._readBridgeLock() (core.ts) * - memi connect write/cleanup logic (commands/connect.ts) */ export interface BridgeLock { pid: number; port: number; startedAt: string; } /** * Path to the bridge lock file inside the project's `.memoire/` directory. */ export declare function bridgeLockPath(projectRoot: string): string; /** * Read `.memoire/bridge.json`. * * Returns the lock data if the owning process is still alive. * Returns `null` if the file is absent, malformed, or the PID is stale. * Automatically deletes stale lock files before returning null. */ export declare function readBridgeLock(projectRoot: string): Promise; /** * Write `.memoire/bridge.json` with the current bridge PID and port. * Creates the `.memoire/` directory if it doesn't exist. */ export declare function writeBridgeLock(projectRoot: string, port: number, pid?: number): Promise; /** * Delete `.memoire/bridge.json`. * Safe to call even when the file doesn't exist (errors are swallowed). */ export declare function clearBridgeLock(projectRoot: string): Promise;