/** * PM2 only receives an exit code plus a signal. For signal exits Node reports * a null code, which PM2 normalizes to 0 before applying `stop_exit_codes`. * Therefore 0 cannot safely mean "intentional shutdown" for a PM2-managed * process: SIGKILL would be mistaken for a clean stop and never restarted. */ export declare const PM2_GRACEFUL_EXIT_CODE = 90; export declare const PM2_GRACEFUL_EXIT_CODE_ENV = "BOTMUX_PM2_GRACEFUL_EXIT_CODE"; export declare function pm2ManagedExitConfig(): { stopExitCodes: number[]; env: Record; }; /** Keep direct/foreground launches on the conventional successful exit code. */ export declare function gracefulProcessExitCode(env?: NodeJS.ProcessEnv): number; /** * Strip the graceful-exit sentinel from an env destined for a child/spawned * process, returning a fresh shallow copy (never mutates the input). Only the * two PM2-managed cores (daemon.ts, dashboard.ts) may see this marker; * anything they fork/spawn that inherits it — a worker, a CLI child, a plugin * PM2 app, a local terminal — could re-launch a foreground `botmux` and then * exit 90 on a clean stop, which a supervisor misreads as a crash. Boundaries * that copy raw `process.env` (pm2Env, spawnDetached) call this; boundaries * with a key deny-list (redactChildEnv, workerForkEnv) list the key there * instead. Always returns a new object so callers can safely mutate the result * (e.g. delete other keys) without touching process.env. */ export declare function stripPm2GracefulExitMarker(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv; //# sourceMappingURL=pm2-graceful-exit.d.ts.map