@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.
63 lines (62 loc) • 1.54 kB
TypeScript
import { EventEmitter } from "events";
/**
* CDP (Chrome DevTools Protocol) message types
*/
export interface CDPRequest {
id: number;
method: string;
params?: Record<string, any>;
}
export interface CDPResponse {
id: number;
result?: any;
error?: {
code: number;
message: string;
data?: any;
};
}
export interface CDPEvent {
method: string;
params?: Record<string, any>;
}
/**
* Inspector client for connecting to Node.js Inspector Protocol via WebSocket
* Implements CDP (Chrome DevTools Protocol) message handling
*/
export declare class InspectorClient extends EventEmitter {
private wsUrl;
private ws;
private messageId;
private pendingRequests;
private connected;
constructor(wsUrl: string);
/**
* Connect to the Inspector Protocol WebSocket endpoint
*/
connect(): Promise<void>;
private attemptConnect;
/**
* Handle incoming CDP messages
*/
private handleMessage;
/**
* Send a CDP command and wait for response
* @param method CDP method name
* @param params Optional parameters
* @param timeout Timeout in milliseconds (default: 5000)
*/
send(method: string, params?: Record<string, any>, timeout?: number): Promise<any>;
/**
* Check if the client is connected
*/
isConnected(): boolean;
/**
* Disconnect from the Inspector Protocol
*/
disconnect(): Promise<void>;
/**
* Clean up resources
*/
private cleanup;
}