import { type AugmentConfig } from "../config.js"; import type { DaemonInfo } from "../types.js"; export interface RestartSnapshot { pid: number; endpoint: string; memoryRoot: string; stateDir?: string; } export interface RestartResult { /** Daemon that was stopped, if one was recorded / running. */ previous?: RestartSnapshot; /** Healthy daemon after restart (new or freshly started). */ current: RestartSnapshot; /** True when no prior daemon was stopped (cold start only). */ startedFresh: boolean; } /** True when the OS still has a process with this pid (signal 0 probe). */ export declare function isPidAlive(pid: number): boolean; /** * Ask a recorded daemon process to exit and wait until it is no longer healthy * (or the pid is gone). Does not start a replacement. */ export declare function stopRecordedDaemon(config: AugmentConfig, options?: { timeoutMs?: number; }): Promise; /** * Stop the shared daemon for the resolved config (if any) and start a fresh one * that reloads memoryRoot / stateDir / gitAutocommit from config + env. */ export declare function restartDaemon(config?: AugmentConfig): Promise; /** * After the HTTP response is flushed: close this process's daemon resources, * spawn a replacement, exit. Used by POST /daemon/restart. */ export declare function scheduleSelfRestart(close: () => Promise): void;