@ai-capabilities-suite/mcp-debugger-core
Version:
Core debugging engine for Node.js and TypeScript applications. Provides Inspector Protocol integration, breakpoint management, variable inspection, execution control, profiling, hang detection, and source map support.
42 lines (41 loc) • 1.23 kB
TypeScript
/**
* Graceful Shutdown Handler
* Handles SIGTERM and SIGINT signals to ensure clean shutdown
*/
export interface ShutdownHandler {
/**
* Register a cleanup function to be called during shutdown
* @param name Identifier for the cleanup function
* @param fn Async cleanup function
*/
registerCleanup(name: string, fn: () => Promise<void>): void;
/**
* Unregister a cleanup function
* @param name Identifier for the cleanup function
*/
unregisterCleanup(name: string): void;
/**
* Initialize shutdown handlers for SIGTERM and SIGINT
*/
initialize(): void;
/**
* Trigger graceful shutdown manually
*/
shutdown(): Promise<void>;
/**
* Check if shutdown is in progress
*/
isShuttingDown(): boolean;
}
export declare class GracefulShutdownHandler implements ShutdownHandler {
private cleanupFunctions;
private shuttingDown;
private shutdownTimeout;
private initialized;
constructor(shutdownTimeout?: number);
registerCleanup(name: string, fn: () => Promise<void>): void;
unregisterCleanup(name: string): void;
initialize(): void;
shutdown(): Promise<void>;
isShuttingDown(): boolean;
}