/** * Returns true iff a process with `pid` is alive. Cross-platform via * `process.kill(pid, 0)` which is the standard liveness check — sends * the null signal which is just a permission probe. */ export declare function isProcessAlive(pid: number): boolean; /** * Read the PID file. Returns the integer PID, or null when: * - file missing * - file empty / unparseable * - PID parses but the named process is dead (stale file) * * When a stale file is detected, it's removed as a side-effect so the * caller doesn't have to clean it up. */ export declare function readBotPid(workspace?: string): number | null; /** * Write the current process's PID to the file. Replaces any prior * content. Logs a warning if a stale PID file pointed at a different * still-alive PID — that means another bot is running in this * workspace, which is unsupported. The new bot still proceeds (we * don't refuse to start) but the user gets a visible hint. * * Returns the path written, for the caller's log line. */ export declare function writeBotPid(workspace?: string): string; /** * Remove the PID file if it points at the current process. Idempotent: * if the file is missing or points at someone else, we leave it alone. * Caller is the bot's own exit handler. */ export declare function clearBotPid(workspace?: string): void; /** * Send SIGTERM to the bot listed in the PID file. Returns: * "signaled" — PID was alive, signal sent (cross-platform). Caller * may want to give it a moment before exiting. * "not-running" — no PID file or PID is dead/orphaned. * "error" — signal failed (e.g. permission denied). * * On Windows the same `process.kill(pid, "SIGTERM")` call dispatches a * native terminate — Node's runtime maps it to TerminateProcess. The * bot's SIGTERM handler runs as expected on POSIX; on Windows the * process exits abruptly but cleanly enough for the migration purpose. */ export declare function signalBotRestart(workspace?: string): { kind: "signaled" | "not-running" | "error"; pid?: number; message?: string; };