/** * Graceful shutdown handler for MAMA OS. * * Extracted from cli/commands/start.ts (Task 12 Part B). * Contains the ordered teardown logic, signal handlers, * uncaught error handlers, keep-alive interval, and force * exit timer. */ import type { AgentLoop } from '../../agent/index.js'; import type { SessionStore } from '../../gateways/session-store.js'; import type { Stoppable } from './server-start.js'; import type { PluginLoader } from '../../gateways/plugin-loader.js'; import type { MetricsStore } from '../../observability/metrics-store.js'; import type { CronScheduler, CronWorker, TokenKeepAlive } from '../../scheduler/index.js'; import type { HeartbeatScheduler } from '../../scheduler/heartbeat.js'; import type { SQLiteDatabase } from '../../sqlite.js'; export interface ShutdownDeps { metricsInterval: ReturnType | null; healthWarningInterval: ReturnType | null; scheduler: CronScheduler; cronWorker: CronWorker; heartbeatScheduler: HeartbeatScheduler; tokenKeepAlive: TokenKeepAlive; gateways: Stoppable[]; pluginLoader: PluginLoader; agentLoop: AgentLoop; memoryAgentLoop: AgentLoop | null; sessionStore: SessionStore; db: SQLiteDatabase; metricsStore: MetricsStore | null; metricsCleanup: { stop: () => void; } | null; } /** * Install graceful shutdown handlers and keep-alive interval. * * Registers SIGINT, SIGTERM, SIGHUP, uncaughtException, and * unhandledRejection handlers, plus the keep-alive setInterval * that keeps the Node.js event loop active. */ export declare function installShutdownHandlers(deps: ShutdownDeps): void; //# sourceMappingURL=shutdown.d.ts.map