import type { PlatformAdapter } from '../../../platform/index.js'; import type { CommandResult } from './command-context.js'; export interface RestartDeps { /** Directory holding daemon.pid and the .restart trigger (STORE_DIR in production). */ storeDir: string; /** Read the daemon's pid from its pidfile, or null if absent/unparseable. */ readPid: (pidFile: string) => number | null; /** Whether a process with the given pid is alive. */ isAlive: (pid: number) => boolean; /** Create/refresh the .restart trigger file. */ touch: (file: string) => void; } export interface RestartOutcome { ok: boolean; messageKey: 'triggered' | 'noDaemon'; } /** * Decide and perform a server restart: only writes the .restart trigger when a live daemon * is present to act on it. Pure but for the injected side effects, so it is unit-testable. */ export declare function triggerServerRestart(deps: RestartDeps): RestartOutcome; export declare function handleRestartCmd(_channel: string, _adapter: PlatformAdapter, _trimmedMessage: string): Promise;