@debugmcp/mcp-debugger
Version:
Run-time step-through debugging for LLM agents.
67 lines (66 loc) • 1.93 kB
TypeScript
/**
* Generic adapter process management for DAP proxy
* Language-agnostic version that can spawn any debug adapter
*/
import { ChildProcess } from 'child_process';
import { IProcessSpawner, ILogger, IFileSystem, AdapterSpawnResult } from './dap-proxy-interfaces.js';
/**
* Configuration for spawning any debug adapter
*/
export interface GenericAdapterConfig {
command: string;
args: string[];
host: string;
port: number;
logDir: string;
cwd?: string;
env?: NodeJS.ProcessEnv;
}
/**
* Generic adapter manager that can spawn any debug adapter process
*/
export declare class GenericAdapterManager {
private processSpawner;
private logger;
private fileSystem;
constructor(processSpawner: IProcessSpawner, logger: ILogger, fileSystem: IFileSystem);
/**
* Ensure the log directory exists
*/
ensureLogDirectory(logDir: string): Promise<void>;
/**
* Spawn a generic debug adapter process
*/
spawn(config: GenericAdapterConfig): Promise<AdapterSpawnResult>;
/**
* Set up process event handlers
*/
private setupProcessHandlers;
/**
* Gracefully shutdown an adapter process
*/
shutdown(process: ChildProcess | null): Promise<void>;
}
/**
* Python-specific adapter manager for backward compatibility
*/
export declare class DebugpyAdapterManager extends GenericAdapterManager {
/**
* Build the command and arguments for spawning debugpy adapter
*/
buildSpawnCommand(executablePath: string, host: string, port: number, logDir: string): {
command: string;
args: string[];
};
/**
* Spawn the debugpy adapter process (backward compatibility)
*/
spawnDebugpy(config: {
pythonPath: string;
host: string;
port: number;
logDir: string;
cwd?: string;
env?: NodeJS.ProcessEnv;
}): Promise<AdapterSpawnResult>;
}