export type FleetProcessEntry = { name: string; /** Stable PM2 registry identity. Required for generation-safe compensation. */ pmId?: number; pid: number; online: boolean; status?: string; autorestart?: boolean | string; stopExitCodes?: unknown[]; exitCode?: number; }; export interface FleetShutdownRuntime { signal(pid: number): void; /** Optional one-shot initial dispatch. Used when each daemon owns an exact * authenticated IPC endpoint: all requests are delivered concurrently inside * one bounded helper. Individual refusals must return normally and remain * live so the standard fresh compensation path can restore exited peers. */ signalInitial?(entries: FleetProcessEntry[]): void; /** Checked before declaring the quiet fleet successful. A missing exact IPC * ACK remains a transaction failure even if that process later crashes; the * helper then enters the same fresh compensation path as a live refuser. */ assertSignalAuthorityComplete?(): void; isAlive(pid: number): boolean; now(): number; sleep(ms: number): void; /** Under the caller's cross-process fleet lock, conditionally start only the * exact PM2 rows confirmed offline, within the remaining `timeoutMs`. */ startOffline(entries: FleetProcessEntry[], timeoutMs: number): void; /** Return a fresh PM2 projection, completing or failing within `timeoutMs`. */ list(timeoutMs: number): FleetProcessEntry[]; /** Must cover PM2 restart_delay so an old autorestart policy cannot publish * a successor immediately after the original PID disappears. */ successorSettleMs?: number; pollMs?: number; } export declare function isFleetEntryProvenFreeOfAutorestartTimer(entry: FleetProcessEntry): boolean; /** Being timer-free is sufficient for initial admission and compensation, but * not proof that a signalled generation completed its shutdown transaction. * PM2 can mark an abrupt exit `errored` after max_restarts and suppress a * successor even though exit_code=0 is not the daemon's graceful sentinel. */ export declare function isFleetEntryProvenTerminalAfterSignal(entry: FleetProcessEntry): boolean; /** Signal every observed generation in parallel. Success requires a bounded * quiet window with no online successor for any target name. If one generation * refuses, restore only names proven truly offline and never touch a live * refuser or an already-auto-restarted healthy successor. */ export declare function signalAndAwaitFleet(entries: FleetProcessEntry[], operation: 'restart' | 'stop', timeoutMs: number, runtime: FleetShutdownRuntime): void; //# sourceMappingURL=fleet-shutdown.d.ts.map