/** * stop.ts — `mma stop`. * * Stops the running daemon and waits for it to actually exit. * * WHY IT WAITS. The documented alternative was `pkill -f "mma serve"`, which * returns as soon as the signal is delivered. Every caller then had to guess how * long the port takes to free, and the common `pkill …; mma serve` one-liner * guessed zero — so the replacement daemon raced the predecessor for the port * and lost. A stop that has returned means the process is gone. * * WHY IT DOES NOT INTERRUPT WORK BY DEFAULT. The daemon's own SIGTERM handler * drains in-flight tasks, bounded by `server.limits.shutdownDrainMs`. `mma stop` * respects that: it allows the drain and reports what it is waiting for. * `--now` passes a short grace instead, which the daemon reads as the operator * being done waiting. `mma update` uses that short path, because the update * flow decided not to wait for running work. */ import { type DaemonControlDeps } from './daemon-control.js'; export interface StopDeps extends DaemonControlDeps { /** Skip the daemon's drain window and stop as soon as it will let go. */ now_?: boolean; json?: boolean; stdout?: (s: string) => boolean; stderr?: (s: string) => boolean; /** How long to allow the daemon's own drain. Overridden by `now_`. */ graceMs?: number; } export declare const StopExitCode: { readonly SUCCESS: 0; readonly ERR_NOT_STOPPED: 1; }; export declare function runStop(deps: StopDeps): Promise; //# sourceMappingURL=stop.d.ts.map