export interface PidLivenessStatus { state: "alive" | "missing" | "dead"; pid: number | null; stalePid: number | null; stalePidRemoved: boolean; } export type PlatformWorkerProcessKind = "claude" | "cursor"; export type KnownProcessType = "daemon" | "platform-worker-claude" | "platform-worker-cursor"; export interface KnownProcessPidFile { type: KnownProcessType; pidPath: string; } /** Write the current process PID to the given file path. */ export declare function writePid(pidPath: string): void; /** Read a PID from file, returning null if missing or invalid. */ export declare function readPid(pidPath: string): number | null; /** Check whether a process with the given PID is still running. */ export declare function isProcessAlive(pid: number): boolean; /** Resolve process liveness from a PID file with optional stale cleanup. */ export declare function getPidLiveness(pidPath: string, removeStale: boolean): PidLivenessStatus; /** Remove a PID file, ignoring errors if it doesn't exist. */ export declare function removePid(pidPath: string): void; /** * Remove a PID file only when it still belongs to the expected PID. * Returns true only when a matching PID file was removed. */ export declare function removePidIfMatches(pidPath: string, expectedPid: number): boolean; /** Derive the PID file path from the database path. */ export declare function getPidPath(dbPath: string): string; /** Derive the platform worker PID path from the database path and worker kind. */ export declare function getPlatformWorkerPidPath(dbPath: string, kind: PlatformWorkerProcessKind): string; /** Derive known process PID files associated with the database path. */ export declare function getKnownProcessPidFiles(dbPath: string): KnownProcessPidFile[]; //# sourceMappingURL=pid.d.ts.map