@debugmcp/mcp-debugger
Version:
Run-time step-through debugging for LLM agents.
79 lines • 3.35 kB
JavaScript
// ===== Supporting Types =====
/**
* Adapter state enumeration
*/
export var AdapterState;
(function (AdapterState) {
AdapterState["UNINITIALIZED"] = "uninitialized";
AdapterState["INITIALIZING"] = "initializing";
AdapterState["READY"] = "ready";
AdapterState["CONNECTED"] = "connected";
AdapterState["DEBUGGING"] = "debugging";
AdapterState["DISCONNECTED"] = "disconnected";
AdapterState["ERROR"] = "error";
})(AdapterState || (AdapterState = {}));
/**
* Debug features enumeration (from DAP spec)
*/
export var DebugFeature;
(function (DebugFeature) {
DebugFeature["CONDITIONAL_BREAKPOINTS"] = "conditionalBreakpoints";
DebugFeature["FUNCTION_BREAKPOINTS"] = "functionBreakpoints";
DebugFeature["EXCEPTION_BREAKPOINTS"] = "exceptionBreakpoints";
DebugFeature["VARIABLE_PAGING"] = "variablePaging";
DebugFeature["EVALUATE_FOR_HOVERS"] = "evaluateForHovers";
DebugFeature["SET_VARIABLE"] = "setVariable";
DebugFeature["SET_EXPRESSION"] = "setExpression";
DebugFeature["DATA_BREAKPOINTS"] = "dataBreakpoints";
DebugFeature["DISASSEMBLE_REQUEST"] = "disassembleRequest";
DebugFeature["TERMINATE_THREADS_REQUEST"] = "terminateThreadsRequest";
DebugFeature["DELAYED_STACK_TRACE_LOADING"] = "delayedStackTraceLoading";
DebugFeature["LOADED_SOURCES_REQUEST"] = "loadedSourcesRequest";
DebugFeature["LOG_POINTS"] = "logPoints";
DebugFeature["TERMINATE_REQUEST"] = "terminateRequest";
DebugFeature["RESTART_REQUEST"] = "restartRequest";
DebugFeature["EXCEPTION_OPTIONS"] = "exceptionOptions";
DebugFeature["EXCEPTION_INFO_REQUEST"] = "exceptionInfoRequest";
DebugFeature["STEP_BACK"] = "stepBack";
DebugFeature["REVERSE_DEBUGGING"] = "reverseDebugging";
DebugFeature["STEP_IN_TARGETS_REQUEST"] = "stepInTargetsRequest";
})(DebugFeature || (DebugFeature = {}));
// ===== Error Handling =====
/**
* Base adapter error class
*/
export class AdapterError extends Error {
code;
recoverable;
constructor(message, code, recoverable = false) {
super(message);
this.code = code;
this.recoverable = recoverable;
this.name = 'AdapterError';
}
}
/**
* Adapter error codes
*/
export var AdapterErrorCode;
(function (AdapterErrorCode) {
// Environment errors
AdapterErrorCode["ENVIRONMENT_INVALID"] = "ENVIRONMENT_INVALID";
AdapterErrorCode["EXECUTABLE_NOT_FOUND"] = "EXECUTABLE_NOT_FOUND";
AdapterErrorCode["ADAPTER_NOT_INSTALLED"] = "ADAPTER_NOT_INSTALLED";
AdapterErrorCode["INCOMPATIBLE_VERSION"] = "INCOMPATIBLE_VERSION";
// Connection errors
AdapterErrorCode["CONNECTION_FAILED"] = "CONNECTION_FAILED";
AdapterErrorCode["CONNECTION_TIMEOUT"] = "CONNECTION_TIMEOUT";
AdapterErrorCode["CONNECTION_LOST"] = "CONNECTION_LOST";
// Protocol errors
AdapterErrorCode["INVALID_RESPONSE"] = "INVALID_RESPONSE";
AdapterErrorCode["UNSUPPORTED_OPERATION"] = "UNSUPPORTED_OPERATION";
// Runtime errors
AdapterErrorCode["DEBUGGER_ERROR"] = "DEBUGGER_ERROR";
AdapterErrorCode["SCRIPT_NOT_FOUND"] = "SCRIPT_NOT_FOUND";
AdapterErrorCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
// Generic errors
AdapterErrorCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
})(AdapterErrorCode || (AdapterErrorCode = {}));
//# sourceMappingURL=debug-adapter-interface.js.map