UNPKG

@bloopai/debugger-mcp

Version:

An MCP server that provides interactive debugging capabilities to AI coding agents

155 lines (154 loc) 4.08 kB
/** * Represents the state of a debug session */ export declare enum SessionState { INITIALIZING = "initializing", CONFIGURED = "configured", RUNNING = "running", STOPPED = "stopped", TERMINATED = "terminated" } /** * Information about a debug session */ export interface SessionInfo { id: string; targetType: string; targetPath: string; state: SessionState; startTime: Date; } /** * Result of setting a breakpoint */ export interface BreakpointResult { breakpointId: string; verified: boolean; line: number; message?: string; } /** * Represents a breakpoint in a debug session */ export interface Breakpoint { id: string; filePath: string; line: number; verified: boolean; condition?: string; message?: string; } /** * Result of evaluating an expression */ export interface EvaluationResult { result: string; type?: string; variablesReference?: number; namedVariables?: number; indexedVariables?: number; } /** * Represents a source file in a debug session (sanitized model) */ export interface ModelSource { name?: string; path?: string; sourceReference?: number; adapterData?: unknown; } /** * Represents a stack frame in a call stack (sanitized model) */ export interface ModelStackFrame { id: number; name: string; source?: ModelSource; line: number; column: number; instructionPointerReference?: string; threadId?: number; } /** * Represents a thread in a debug session (sanitized model) */ export interface ModelThread { id: number; name: string; } /** * Represents a variable in the debug session */ export interface Variable { name: string; value: string; type?: string; variablesReference: number; namedVariables?: number; indexedVariables?: number; } /** * Listener for session state changes */ export type StateChangeListener = (sessionId: string, newState: SessionState, oldState: SessionState) => void; /** * Error codes specific to the debugger */ export declare enum DebuggerErrorCode { SESSION_NOT_FOUND = "SESSION_NOT_FOUND", INVALID_STATE = "INVALID_STATE", BREAKPOINT_ERROR = "BREAKPOINT_ERROR", EVALUATION_ERROR = "EVALUATION_ERROR", ADAPTER_ERROR = "ADAPTER_ERROR", TIMEOUT = "TIMEOUT" } /** * Base class for debugger errors */ export declare class DebuggerError extends Error { code: DebuggerErrorCode; constructor(message: string, code: DebuggerErrorCode); } /** * Error thrown when a session is not found */ export declare class SessionNotFoundError extends DebuggerError { constructor(sessionId: string); } /** * Error thrown when a session is in an invalid state for an operation */ export declare class InvalidStateError extends DebuggerError { constructor(sessionId: string, currentState: SessionState, expectedStates: SessionState[]); } /** * Error thrown when a breakpoint operation fails */ export declare class BreakpointError extends DebuggerError { filePath: string; line: number; constructor(message: string, filePath: string, line: number); } /** * Error thrown when an expression evaluation fails */ export declare class EvaluationError extends DebuggerError { expression: string; constructor(message: string, expression: string); } /** * Wrapper class for DebugSession from ergonomic-debugger-client * to hold additional metadata like targetType, targetPath, and startTime. */ import { DebugSession, DAPSessionHandler, LoggerInterface, SessionStatus } from '@bloopai/ergonomic-debugger-client'; export declare class WrappedDebugSession { readonly originalSession: DebugSession; readonly id: string; readonly targetType: string; readonly targetPath: string; readonly startTime: Date; private readonly logger; constructor(mcpSessionId: string, originalSession: DebugSession, targetType: string, targetPath: string, startTime: Date, logger: LoggerInterface); get dapSessionHandler(): DAPSessionHandler; get status(): SessionStatus; }