dap-mcp-server 0.1.11 → 0.1.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -7
- package/SKILL.md +37 -186
- package/build/adapters/builtin.js +27 -3
- package/build/adapters/builtin.js.map +1 -1
- package/build/adapters/detect.d.ts +12 -0
- package/build/adapters/detect.js +91 -0
- package/build/adapters/detect.js.map +1 -1
- package/build/adapters/registry.js +35 -12
- package/build/adapters/registry.js.map +1 -1
- package/build/dap/dap-client.d.ts +71 -4
- package/build/dap/dap-client.js +324 -53
- package/build/dap/dap-client.js.map +1 -1
- package/build/dap/types.d.ts +17 -0
- package/build/diagnostics/doctor.d.ts +64 -0
- package/build/diagnostics/doctor.js +209 -0
- package/build/diagnostics/doctor.js.map +1 -0
- package/build/server.js +337 -83
- package/build/server.js.map +1 -1
- package/build/session/inspect.d.ts +6 -2
- package/build/session/inspect.js +38 -9
- package/build/session/inspect.js.map +1 -1
- package/build/session/run.js +10 -9
- package/build/session/run.js.map +1 -1
- package/build/session/session.d.ts +16 -0
- package/build/session/session.js +73 -10
- package/build/session/session.js.map +1 -1
- package/integrations/claude/dap-debugging/.claude-plugin/plugin.json +9 -0
- package/integrations/claude/dap-debugging/.mcp.json +8 -0
- package/integrations/claude/dap-debugging/skills/dap-debugging/SKILL.md +49 -0
- package/package.json +8 -3
- package/.forgejo/workflows/publish.yml +0 -63
- package/CLAUDE.md +0 -71
- package/TODO.md +0 -32
- package/docs/plans/2026-03-05-dap-wrapper-mcp-design.md +0 -326
- package/docs/plans/2026-03-05-dap-wrapper-mcp-implementation.md +0 -2815
- package/src/adapters/builtin.ts +0 -50
- package/src/adapters/detect.test.ts +0 -36
- package/src/adapters/detect.ts +0 -36
- package/src/adapters/registry.test.ts +0 -73
- package/src/adapters/registry.ts +0 -86
- package/src/dap/dap-client.test.ts +0 -87
- package/src/dap/dap-client.ts +0 -238
- package/src/dap/protocol.test.ts +0 -82
- package/src/dap/protocol.ts +0 -78
- package/src/dap/ring-buffer.test.ts +0 -82
- package/src/dap/ring-buffer.ts +0 -64
- package/src/dap/types.ts +0 -98
- package/src/index.ts +0 -30
- package/src/integration/debug-lifecycle.test.ts +0 -131
- package/src/server.ts +0 -1062
- package/src/session/inspect.test.ts +0 -126
- package/src/session/inspect.ts +0 -147
- package/src/session/run.test.ts +0 -74
- package/src/session/run.ts +0 -136
- package/src/session/session-manager.test.ts +0 -74
- package/src/session/session-manager.ts +0 -67
- package/src/session/session.test.ts +0 -126
- package/src/session/session.ts +0 -474
- package/src/test-fixtures/crash-adapter.js +0 -23
- package/src/test-fixtures/mock-adapter.js +0 -164
- package/src/test-fixtures/no-stop-adapter.js +0 -77
- package/src/test-fixtures/silent-adapter.js +0 -24
- package/tsconfig.json +0 -16
|
@@ -24,21 +24,88 @@ import { DebugProtocol } from "@vscode/debugprotocol";
|
|
|
24
24
|
export declare class DAPClientError extends Error {
|
|
25
25
|
constructor(message: string);
|
|
26
26
|
}
|
|
27
|
+
export interface DAPClientOptions {
|
|
28
|
+
/** "stdio" (default) or "tcp". */
|
|
29
|
+
transport?: "stdio" | "tcp";
|
|
30
|
+
/**
|
|
31
|
+
* Regex with one capture group that matches the TCP port the adapter is
|
|
32
|
+
* listening on. Required when transport is "tcp". The regex is applied to
|
|
33
|
+
* the cumulative adapter stdout text.
|
|
34
|
+
*/
|
|
35
|
+
portMatcher?: string;
|
|
36
|
+
/** Timeout waiting for the adapter to announce its TCP port, in ms. */
|
|
37
|
+
tcpConnectTimeout?: number;
|
|
38
|
+
}
|
|
27
39
|
export declare class DAPClient extends EventEmitter {
|
|
28
40
|
private runtime;
|
|
29
41
|
private executable;
|
|
30
42
|
private args;
|
|
43
|
+
private transport;
|
|
44
|
+
private portMatcher?;
|
|
45
|
+
private tcpConnectTimeout;
|
|
31
46
|
private process?;
|
|
32
|
-
private
|
|
33
|
-
|
|
34
|
-
private
|
|
47
|
+
private conns;
|
|
48
|
+
/** Index into `conns` of the connection that handles user-sent requests. */
|
|
49
|
+
private activeIdx;
|
|
50
|
+
/** TCP target host (set during spawn for tcp mode). */
|
|
51
|
+
private tcpHost?;
|
|
52
|
+
/** TCP target port (set during spawn for tcp mode). */
|
|
53
|
+
private tcpPort?;
|
|
54
|
+
/**
|
|
55
|
+
* While a startDebugging handler is bootstrapping a new child session
|
|
56
|
+
* (initialize + launch), user-issued `sendRequest` calls await this so they
|
|
57
|
+
* don't race the in-progress handshake.
|
|
58
|
+
*/
|
|
59
|
+
private transitionLock?;
|
|
60
|
+
/**
|
|
61
|
+
* Last setBreakpoints arguments per source path. Replayed onto new child
|
|
62
|
+
* sessions when startDebugging causes the active connection to change —
|
|
63
|
+
* adapters like vscode-js-debug spawn a child for the actual debuggee
|
|
64
|
+
* AFTER the parent has accepted setBreakpoints, so the child wouldn't know
|
|
65
|
+
* about them otherwise.
|
|
66
|
+
*/
|
|
67
|
+
private bpHistory;
|
|
68
|
+
private excBpHistory?;
|
|
69
|
+
private configurationDoneSent;
|
|
35
70
|
private stderrOutput;
|
|
71
|
+
private stdoutPreamble;
|
|
36
72
|
private _exited;
|
|
37
73
|
private _exitCode?;
|
|
38
|
-
constructor(runtime: string, executable: string, args?: string[]);
|
|
74
|
+
constructor(runtime: string, executable: string, args?: string[], options?: DAPClientOptions);
|
|
39
75
|
spawn(): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* Record session-shaping requests so we can replay them on child sessions.
|
|
78
|
+
* `setBreakpoints` and `setExceptionBreakpoints` need to be re-sent because
|
|
79
|
+
* each DAP session has its own breakpoint state. `configurationDone` is
|
|
80
|
+
* tracked so we know whether the parent has already finished its
|
|
81
|
+
* configuration phase — if so, child sessions need the same signal.
|
|
82
|
+
*/
|
|
83
|
+
private trackOutgoing;
|
|
84
|
+
/** Build a Conn around a writable/readable stream pair. */
|
|
85
|
+
private makeConn;
|
|
86
|
+
/** Open a fresh TCP connection to the adapter's DAP server. */
|
|
87
|
+
private openTcpConnection;
|
|
88
|
+
private onConnClose;
|
|
40
89
|
sendRequest(command: string, args?: Record<string, unknown>, timeout?: number): Promise<DebugProtocol.Response>;
|
|
90
|
+
/** Internal: send a request on a specific connection. */
|
|
91
|
+
private sendRequestOn;
|
|
41
92
|
private handleMessage;
|
|
93
|
+
/** Reply to a reverse request, on the connection that sent it. */
|
|
94
|
+
private replyToReverseRequest;
|
|
95
|
+
/**
|
|
96
|
+
* Handle a `startDebugging` reverse request from an active session.
|
|
97
|
+
*
|
|
98
|
+
* Per the DAP startDebugging protocol, the client should open a new DAP
|
|
99
|
+
* session for the supplied configuration and run the launch/attach
|
|
100
|
+
* handshake against the SAME adapter. For TCP-server adapters like
|
|
101
|
+
* vscode-js-debug, we open a fresh TCP connection to the same port, run
|
|
102
|
+
* initialize + launch (or attach) using the request's configuration, and
|
|
103
|
+
* make that new connection the active one for subsequent user requests.
|
|
104
|
+
*
|
|
105
|
+
* The `transitionLock` prevents user `sendRequest` calls from racing the
|
|
106
|
+
* handshake.
|
|
107
|
+
*/
|
|
108
|
+
private handleStartDebugging;
|
|
42
109
|
get exited(): boolean;
|
|
43
110
|
get stderr(): string;
|
|
44
111
|
dispose(): Promise<void>;
|
package/build/dap/dap-client.js
CHANGED
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
*/
|
|
22
22
|
import { spawn } from "node:child_process";
|
|
23
23
|
import { EventEmitter } from "node:events";
|
|
24
|
+
import { createConnection } from "node:net";
|
|
24
25
|
import { encodeMessage, MessageParser } from "./protocol.js";
|
|
25
26
|
export class DAPClientError extends Error {
|
|
26
27
|
constructor(message) {
|
|
@@ -32,18 +33,50 @@ export class DAPClient extends EventEmitter {
|
|
|
32
33
|
runtime;
|
|
33
34
|
executable;
|
|
34
35
|
args;
|
|
36
|
+
transport;
|
|
37
|
+
portMatcher;
|
|
38
|
+
tcpConnectTimeout;
|
|
35
39
|
process;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
conns = [];
|
|
41
|
+
/** Index into `conns` of the connection that handles user-sent requests. */
|
|
42
|
+
activeIdx = -1;
|
|
43
|
+
/** TCP target host (set during spawn for tcp mode). */
|
|
44
|
+
tcpHost;
|
|
45
|
+
/** TCP target port (set during spawn for tcp mode). */
|
|
46
|
+
tcpPort;
|
|
47
|
+
/**
|
|
48
|
+
* While a startDebugging handler is bootstrapping a new child session
|
|
49
|
+
* (initialize + launch), user-issued `sendRequest` calls await this so they
|
|
50
|
+
* don't race the in-progress handshake.
|
|
51
|
+
*/
|
|
52
|
+
transitionLock;
|
|
53
|
+
/**
|
|
54
|
+
* Last setBreakpoints arguments per source path. Replayed onto new child
|
|
55
|
+
* sessions when startDebugging causes the active connection to change —
|
|
56
|
+
* adapters like vscode-js-debug spawn a child for the actual debuggee
|
|
57
|
+
* AFTER the parent has accepted setBreakpoints, so the child wouldn't know
|
|
58
|
+
* about them otherwise.
|
|
59
|
+
*/
|
|
60
|
+
bpHistory = new Map();
|
|
61
|
+
excBpHistory;
|
|
62
|
+
configurationDoneSent = false;
|
|
39
63
|
stderrOutput = [];
|
|
64
|
+
stdoutPreamble = "";
|
|
40
65
|
_exited = false;
|
|
41
66
|
_exitCode;
|
|
42
|
-
constructor(runtime, executable, args = []) {
|
|
67
|
+
constructor(runtime, executable, args = [], options = {}) {
|
|
43
68
|
super();
|
|
44
69
|
this.runtime = runtime;
|
|
45
70
|
this.executable = executable;
|
|
46
71
|
this.args = args;
|
|
72
|
+
this.transport = options.transport ?? "stdio";
|
|
73
|
+
if (this.transport === "tcp") {
|
|
74
|
+
if (!options.portMatcher) {
|
|
75
|
+
throw new DAPClientError("portMatcher is required when transport is 'tcp'");
|
|
76
|
+
}
|
|
77
|
+
this.portMatcher = new RegExp(options.portMatcher);
|
|
78
|
+
}
|
|
79
|
+
this.tcpConnectTimeout = options.tcpConnectTimeout ?? 10000;
|
|
47
80
|
}
|
|
48
81
|
async spawn() {
|
|
49
82
|
return new Promise((resolve, reject) => {
|
|
@@ -58,10 +91,6 @@ export class DAPClient extends EventEmitter {
|
|
|
58
91
|
// Detached child must be unref'd so the parent Node process can exit
|
|
59
92
|
// even if the adapter is still running (cleanup happens via dispose()).
|
|
60
93
|
this.process.unref();
|
|
61
|
-
this.parser = new MessageParser((msg) => this.handleMessage(msg));
|
|
62
|
-
this.process.stdout.on("data", (data) => {
|
|
63
|
-
this.parser.feed(data);
|
|
64
|
-
});
|
|
65
94
|
this.process.stderr.on("data", (data) => {
|
|
66
95
|
this.stderrOutput.push(data.toString());
|
|
67
96
|
});
|
|
@@ -75,38 +104,172 @@ export class DAPClient extends EventEmitter {
|
|
|
75
104
|
this.process.on("exit", (code, signal) => {
|
|
76
105
|
this._exited = true;
|
|
77
106
|
this._exitCode = code ?? undefined;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
107
|
+
// Reject pending across all connections.
|
|
108
|
+
for (const conn of this.conns) {
|
|
109
|
+
for (const [, req] of conn.pending) {
|
|
110
|
+
if (req.timer)
|
|
111
|
+
clearTimeout(req.timer);
|
|
112
|
+
req.reject(new DAPClientError(`Adapter exited (code=${code}, signal=${signal}). stderr: ${this.stderrOutput.join("")}`));
|
|
113
|
+
}
|
|
114
|
+
conn.pending.clear();
|
|
82
115
|
}
|
|
83
|
-
this.pending.clear();
|
|
84
116
|
this.emit("exit", code, signal);
|
|
85
117
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
118
|
+
if (this.transport === "stdio") {
|
|
119
|
+
// DAP messages flow over the adapter's stdin/stdout. Single connection
|
|
120
|
+
// (no startDebugging support over stdio).
|
|
121
|
+
const conn = this.makeConn("parent", this.process.stdin, this.process.stdout);
|
|
122
|
+
this.conns.push(conn);
|
|
123
|
+
this.activeIdx = 0;
|
|
124
|
+
// Resolve once the process is spawned (use flag to prevent double-resolve)
|
|
125
|
+
let resolved = false;
|
|
126
|
+
this.process.stdout.once("readable", () => {
|
|
127
|
+
if (!resolved) {
|
|
128
|
+
resolved = true;
|
|
129
|
+
resolve();
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
setTimeout(() => {
|
|
133
|
+
if (!resolved) {
|
|
134
|
+
resolved = true;
|
|
135
|
+
resolve();
|
|
136
|
+
}
|
|
137
|
+
}, 100);
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// TCP transport: read the adapter's stdout banner to discover the
|
|
141
|
+
// port, then connect via TCP and route DAP messages over the socket.
|
|
142
|
+
let portFound = false;
|
|
143
|
+
const connectTimer = setTimeout(() => {
|
|
144
|
+
if (!portFound) {
|
|
145
|
+
reject(new DAPClientError(`Timed out waiting for adapter to announce TCP port. ` +
|
|
146
|
+
`Pattern: ${this.portMatcher.source}. ` +
|
|
147
|
+
`Stdout so far: ${this.stdoutPreamble.slice(0, 500)}`));
|
|
148
|
+
}
|
|
149
|
+
}, this.tcpConnectTimeout);
|
|
150
|
+
this.process.stdout.on("data", (data) => {
|
|
151
|
+
this.stdoutPreamble += data.toString();
|
|
152
|
+
if (portFound)
|
|
153
|
+
return;
|
|
154
|
+
const m = this.portMatcher.exec(this.stdoutPreamble);
|
|
155
|
+
if (m) {
|
|
156
|
+
portFound = true;
|
|
157
|
+
clearTimeout(connectTimer);
|
|
158
|
+
const port = Number(m[1]);
|
|
159
|
+
if (!Number.isFinite(port) || port <= 0) {
|
|
160
|
+
reject(new DAPClientError(`Invalid port matched from adapter stdout: '${m[1]}'`));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
this.tcpHost = "127.0.0.1";
|
|
164
|
+
this.tcpPort = port;
|
|
165
|
+
this.openTcpConnection("parent")
|
|
166
|
+
.then((conn) => {
|
|
167
|
+
this.conns.push(conn);
|
|
168
|
+
this.activeIdx = 0;
|
|
169
|
+
resolve();
|
|
170
|
+
})
|
|
171
|
+
.catch(reject);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Record session-shaping requests so we can replay them on child sessions.
|
|
179
|
+
* `setBreakpoints` and `setExceptionBreakpoints` need to be re-sent because
|
|
180
|
+
* each DAP session has its own breakpoint state. `configurationDone` is
|
|
181
|
+
* tracked so we know whether the parent has already finished its
|
|
182
|
+
* configuration phase — if so, child sessions need the same signal.
|
|
183
|
+
*/
|
|
184
|
+
trackOutgoing(command, args) {
|
|
185
|
+
if (command === "setBreakpoints" && args) {
|
|
186
|
+
const src = args.source?.path;
|
|
187
|
+
if (src) {
|
|
188
|
+
this.bpHistory.set(src, args);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
else if (command === "setExceptionBreakpoints" && args) {
|
|
192
|
+
this.excBpHistory = args;
|
|
193
|
+
}
|
|
194
|
+
else if (command === "configurationDone") {
|
|
195
|
+
this.configurationDoneSent = true;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/** Build a Conn around a writable/readable stream pair. */
|
|
199
|
+
makeConn(kind, writeStream, dataStream) {
|
|
200
|
+
const conn = {
|
|
201
|
+
kind,
|
|
202
|
+
writeStream,
|
|
203
|
+
parser: new MessageParser((msg) => this.handleMessage(msg, conn)),
|
|
204
|
+
pending: new Map(),
|
|
205
|
+
seq: 1,
|
|
206
|
+
closed: false,
|
|
207
|
+
};
|
|
208
|
+
dataStream.on("data", (data) => conn.parser.feed(data));
|
|
209
|
+
return conn;
|
|
210
|
+
}
|
|
211
|
+
/** Open a fresh TCP connection to the adapter's DAP server. */
|
|
212
|
+
openTcpConnection(kind) {
|
|
213
|
+
return new Promise((resolve, reject) => {
|
|
214
|
+
if (this.tcpHost === undefined || this.tcpPort === undefined) {
|
|
215
|
+
reject(new DAPClientError("TCP target host/port not set"));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const sock = createConnection({ host: this.tcpHost, port: this.tcpPort }, () => {
|
|
219
|
+
const conn = this.makeConn(kind, sock, sock);
|
|
220
|
+
conn.socket = sock;
|
|
221
|
+
sock.on("close", () => this.onConnClose(conn));
|
|
222
|
+
sock.on("error", (err) => {
|
|
223
|
+
this.stderrOutput.push(`socket error (${kind}): ${err.message}\n`);
|
|
224
|
+
});
|
|
225
|
+
resolve(conn);
|
|
226
|
+
});
|
|
227
|
+
sock.once("error", (err) => {
|
|
228
|
+
reject(new DAPClientError(`Failed to connect to adapter TCP port ${this.tcpPort}: ${err.message}`));
|
|
93
229
|
});
|
|
94
|
-
setTimeout(() => {
|
|
95
|
-
if (!resolved) {
|
|
96
|
-
resolved = true;
|
|
97
|
-
resolve();
|
|
98
|
-
}
|
|
99
|
-
}, 100);
|
|
100
230
|
});
|
|
101
231
|
}
|
|
232
|
+
onConnClose(conn) {
|
|
233
|
+
if (conn.closed)
|
|
234
|
+
return;
|
|
235
|
+
conn.closed = true;
|
|
236
|
+
for (const [, req] of conn.pending) {
|
|
237
|
+
if (req.timer)
|
|
238
|
+
clearTimeout(req.timer);
|
|
239
|
+
req.reject(new DAPClientError(`DAP ${conn.kind} connection closed before response. stderr: ${this.stderrOutput.join("")}`));
|
|
240
|
+
}
|
|
241
|
+
conn.pending.clear();
|
|
242
|
+
// If the active connection just closed, fall back to the most recent
|
|
243
|
+
// non-closed one. If none remain, leave activeIdx pointing at the closed
|
|
244
|
+
// conn — sendRequest will fail with "transport is not writable".
|
|
245
|
+
if (this.conns[this.activeIdx] === conn) {
|
|
246
|
+
for (let i = this.conns.length - 1; i >= 0; i--) {
|
|
247
|
+
if (!this.conns[i].closed) {
|
|
248
|
+
this.activeIdx = i;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
102
254
|
async sendRequest(command, args, timeout = 10000) {
|
|
103
255
|
if (this._exited) {
|
|
104
256
|
throw new DAPClientError(`Adapter has exited (code=${this._exitCode}). stderr: ${this.stderrOutput.join("")}`);
|
|
105
257
|
}
|
|
106
|
-
|
|
107
|
-
|
|
258
|
+
// Wait for any in-progress session transition (e.g. handleStartDebugging
|
|
259
|
+
// setting up a child session) before sending. Otherwise the request would
|
|
260
|
+
// race the handshake or land on a half-initialized child connection.
|
|
261
|
+
if (this.transitionLock) {
|
|
262
|
+
await this.transitionLock;
|
|
263
|
+
}
|
|
264
|
+
return this.sendRequestOn(this.conns[this.activeIdx], command, args, timeout);
|
|
265
|
+
}
|
|
266
|
+
/** Internal: send a request on a specific connection. */
|
|
267
|
+
sendRequestOn(conn, command, args, timeout) {
|
|
268
|
+
if (!conn || conn.closed || !conn.writeStream.writable) {
|
|
269
|
+
throw new DAPClientError("Adapter transport is not writable");
|
|
108
270
|
}
|
|
109
|
-
|
|
271
|
+
this.trackOutgoing(command, args);
|
|
272
|
+
const seq = conn.seq++;
|
|
110
273
|
const request = {
|
|
111
274
|
seq,
|
|
112
275
|
type: "request",
|
|
@@ -117,41 +280,40 @@ export class DAPClient extends EventEmitter {
|
|
|
117
280
|
const pending = { resolve, reject };
|
|
118
281
|
if (timeout > 0) {
|
|
119
282
|
pending.timer = setTimeout(() => {
|
|
120
|
-
|
|
283
|
+
conn.pending.delete(seq);
|
|
121
284
|
reject(new DAPClientError(`Request '${command}' timeout after ${timeout}ms`));
|
|
122
285
|
}, timeout);
|
|
123
286
|
}
|
|
124
|
-
|
|
287
|
+
conn.pending.set(seq, pending);
|
|
125
288
|
try {
|
|
126
|
-
|
|
289
|
+
conn.writeStream.write(encodeMessage(request), (err) => {
|
|
127
290
|
if (err) {
|
|
128
|
-
|
|
129
|
-
const p = this.pending.get(seq);
|
|
291
|
+
const p = conn.pending.get(seq);
|
|
130
292
|
if (p) {
|
|
131
293
|
if (p.timer)
|
|
132
294
|
clearTimeout(p.timer);
|
|
133
|
-
|
|
295
|
+
conn.pending.delete(seq);
|
|
134
296
|
p.reject(new DAPClientError(`Write to adapter failed: ${err.message}`));
|
|
135
297
|
}
|
|
136
298
|
}
|
|
137
299
|
});
|
|
138
300
|
}
|
|
139
301
|
catch (err) {
|
|
140
|
-
|
|
302
|
+
conn.pending.delete(seq);
|
|
141
303
|
if (pending.timer)
|
|
142
304
|
clearTimeout(pending.timer);
|
|
143
305
|
reject(new DAPClientError(`Write to adapter failed: ${err.message}`));
|
|
144
306
|
}
|
|
145
307
|
});
|
|
146
308
|
}
|
|
147
|
-
handleMessage(msg) {
|
|
309
|
+
handleMessage(msg, conn) {
|
|
148
310
|
if (msg.type === "response") {
|
|
149
311
|
const response = msg;
|
|
150
|
-
const pending =
|
|
312
|
+
const pending = conn.pending.get(response.request_seq);
|
|
151
313
|
if (pending) {
|
|
152
314
|
if (pending.timer)
|
|
153
315
|
clearTimeout(pending.timer);
|
|
154
|
-
|
|
316
|
+
conn.pending.delete(response.request_seq);
|
|
155
317
|
if (response.success) {
|
|
156
318
|
pending.resolve(response);
|
|
157
319
|
}
|
|
@@ -161,23 +323,21 @@ export class DAPClient extends EventEmitter {
|
|
|
161
323
|
}
|
|
162
324
|
}
|
|
163
325
|
else if (msg.type === "request") {
|
|
164
|
-
// Reverse request from the adapter (e.g. runInTerminal).
|
|
165
|
-
// We reject all reverse requests — the MCP server has no terminal.
|
|
166
326
|
const req = msg;
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
327
|
+
if (req.command === "startDebugging" && this.transport === "tcp") {
|
|
328
|
+
// The active session is asking us to open a child session for a
|
|
329
|
+
// newly-spawned target (vscode-js-debug does this for every node
|
|
330
|
+
// process it attaches to). Handle natively rather than rejecting.
|
|
331
|
+
this.handleStartDebugging(req, conn).catch((err) => {
|
|
332
|
+
this.stderrOutput.push(`startDebugging handler failed: ${err.message}\n`);
|
|
333
|
+
});
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
// Reject other reverse requests — the MCP server has no terminal etc.
|
|
337
|
+
this.replyToReverseRequest(conn, req, {
|
|
172
338
|
success: false,
|
|
173
339
|
message: `Reverse request '${req.command}' is not supported by this client`,
|
|
174
|
-
};
|
|
175
|
-
try {
|
|
176
|
-
this.process?.stdin?.write(encodeMessage(errorResponse));
|
|
177
|
-
}
|
|
178
|
-
catch {
|
|
179
|
-
// ignore — process may have exited
|
|
180
|
-
}
|
|
340
|
+
});
|
|
181
341
|
}
|
|
182
342
|
else if (msg.type === "event") {
|
|
183
343
|
const event = msg;
|
|
@@ -185,6 +345,109 @@ export class DAPClient extends EventEmitter {
|
|
|
185
345
|
this.emit("event", event);
|
|
186
346
|
}
|
|
187
347
|
}
|
|
348
|
+
/** Reply to a reverse request, on the connection that sent it. */
|
|
349
|
+
replyToReverseRequest(conn, req, result) {
|
|
350
|
+
const response = {
|
|
351
|
+
seq: conn.seq++,
|
|
352
|
+
type: "response",
|
|
353
|
+
request_seq: req.seq,
|
|
354
|
+
command: req.command,
|
|
355
|
+
success: result.success,
|
|
356
|
+
message: result.message,
|
|
357
|
+
body: result.body,
|
|
358
|
+
};
|
|
359
|
+
try {
|
|
360
|
+
conn.writeStream.write(encodeMessage(response));
|
|
361
|
+
}
|
|
362
|
+
catch {
|
|
363
|
+
// ignore — transport may have closed
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Handle a `startDebugging` reverse request from an active session.
|
|
368
|
+
*
|
|
369
|
+
* Per the DAP startDebugging protocol, the client should open a new DAP
|
|
370
|
+
* session for the supplied configuration and run the launch/attach
|
|
371
|
+
* handshake against the SAME adapter. For TCP-server adapters like
|
|
372
|
+
* vscode-js-debug, we open a fresh TCP connection to the same port, run
|
|
373
|
+
* initialize + launch (or attach) using the request's configuration, and
|
|
374
|
+
* make that new connection the active one for subsequent user requests.
|
|
375
|
+
*
|
|
376
|
+
* The `transitionLock` prevents user `sendRequest` calls from racing the
|
|
377
|
+
* handshake.
|
|
378
|
+
*/
|
|
379
|
+
async handleStartDebugging(req, fromConn) {
|
|
380
|
+
let resolveLock;
|
|
381
|
+
this.transitionLock = new Promise((r) => { resolveLock = r; });
|
|
382
|
+
try {
|
|
383
|
+
const argsObj = (req.arguments ?? {});
|
|
384
|
+
const childConfig = argsObj.configuration ?? {};
|
|
385
|
+
const childRequest = argsObj.request ?? "launch";
|
|
386
|
+
const childConn = await this.openTcpConnection("child");
|
|
387
|
+
this.conns.push(childConn);
|
|
388
|
+
const newIdx = this.conns.length - 1;
|
|
389
|
+
// Make it active so the silent handshake calls below go to the child.
|
|
390
|
+
this.activeIdx = newIdx;
|
|
391
|
+
// Run initialize on the child. The adapterID is taken from the supplied
|
|
392
|
+
// configuration when present (vscode-js-debug uses "pwa-node").
|
|
393
|
+
await this.sendRequestOn(childConn, "initialize", {
|
|
394
|
+
adapterID: childConfig.type ?? "child",
|
|
395
|
+
clientID: "dap-mcp-server",
|
|
396
|
+
clientName: "DAP MCP Server",
|
|
397
|
+
linesStartAt1: true,
|
|
398
|
+
columnsStartAt1: true,
|
|
399
|
+
pathFormat: "path",
|
|
400
|
+
}, 10000);
|
|
401
|
+
// Run launch/attach with the provided configuration. The configuration
|
|
402
|
+
// typically carries adapter-specific fields like __pendingTargetId that
|
|
403
|
+
// bind the new session to a specific target. Fire-and-forget — the
|
|
404
|
+
// adapter blocks the response until configurationDone, which we issue
|
|
405
|
+
// ourselves below after replaying breakpoints.
|
|
406
|
+
const childLaunchPromise = this.sendRequestOn(childConn, childRequest, childConfig, 30000);
|
|
407
|
+
childLaunchPromise.catch(() => { });
|
|
408
|
+
// Replay configuration state established on the previous active
|
|
409
|
+
// connection so the new child session honors the same breakpoints.
|
|
410
|
+
// Without this, vscode-js-debug-style adapters (where the parent
|
|
411
|
+
// accepts setBreakpoints but the child is what actually runs the
|
|
412
|
+
// debuggee) would never pause at user-set breakpoints.
|
|
413
|
+
for (const args of this.bpHistory.values()) {
|
|
414
|
+
try {
|
|
415
|
+
await this.sendRequestOn(childConn, "setBreakpoints", args, 10000);
|
|
416
|
+
}
|
|
417
|
+
catch {
|
|
418
|
+
// Best-effort replay — keep going.
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
if (this.excBpHistory) {
|
|
422
|
+
try {
|
|
423
|
+
await this.sendRequestOn(childConn, "setExceptionBreakpoints", this.excBpHistory, 10000);
|
|
424
|
+
}
|
|
425
|
+
catch {
|
|
426
|
+
// ignore
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
if (this.configurationDoneSent) {
|
|
430
|
+
try {
|
|
431
|
+
await this.sendRequestOn(childConn, "configurationDone", undefined, 10000);
|
|
432
|
+
}
|
|
433
|
+
catch {
|
|
434
|
+
// ignore
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
// Acknowledge the reverse request so the parent can proceed.
|
|
438
|
+
this.replyToReverseRequest(fromConn, req, { success: true });
|
|
439
|
+
}
|
|
440
|
+
catch (err) {
|
|
441
|
+
this.replyToReverseRequest(fromConn, req, {
|
|
442
|
+
success: false,
|
|
443
|
+
message: `Failed to start child debug session: ${err.message}`,
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
finally {
|
|
447
|
+
resolveLock?.();
|
|
448
|
+
this.transitionLock = undefined;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
188
451
|
get exited() {
|
|
189
452
|
return this._exited;
|
|
190
453
|
}
|
|
@@ -192,6 +455,14 @@ export class DAPClient extends EventEmitter {
|
|
|
192
455
|
return this.stderrOutput.join("");
|
|
193
456
|
}
|
|
194
457
|
async dispose() {
|
|
458
|
+
for (const conn of this.conns) {
|
|
459
|
+
if (conn.socket && !conn.socket.destroyed) {
|
|
460
|
+
try {
|
|
461
|
+
conn.socket.destroy();
|
|
462
|
+
}
|
|
463
|
+
catch { /* ignore */ }
|
|
464
|
+
}
|
|
465
|
+
}
|
|
195
466
|
if (this.process && !this._exited) {
|
|
196
467
|
this.process.stdin?.end();
|
|
197
468
|
this.process.kill("SIGTERM");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dap-client.js","sourceRoot":"","sources":["../../src/dap/dap-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,KAAK,EAAgB,MAAM,o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ED
|
@@ -69,6 +69,23 @@ export interface AdapterConfig {
|
|
|
69
69
|
args?: string[];
|
|
70
70
|
launchDefaults?: Record<string, unknown>;
|
|
71
71
|
installHint?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Transport mode for the adapter:
|
|
74
|
+
* - "stdio" (default): DAP messages flow over the adapter's stdin/stdout.
|
|
75
|
+
* - "tcp": the adapter is a TCP DAP server. After spawning, the client reads
|
|
76
|
+
* the listening address from the adapter's stdout (matched with
|
|
77
|
+
* `portMatcher`) and connects to it via a TCP socket. DAP messages then
|
|
78
|
+
* flow over that socket. Use this for adapters like `dlv dap` or
|
|
79
|
+
* vscode-js-debug's `dapDebugServer.js` that don't speak DAP on stdio.
|
|
80
|
+
*/
|
|
81
|
+
transport?: "stdio" | "tcp";
|
|
82
|
+
/**
|
|
83
|
+
* Regular expression with a single capture group that yields the TCP port the
|
|
84
|
+
* adapter is listening on. Matched against the adapter's stdout output.
|
|
85
|
+
* Required (and only used) when `transport` is "tcp".
|
|
86
|
+
* Example for delve: "DAP server listening at:\\s*\\S+:(\\d+)"
|
|
87
|
+
*/
|
|
88
|
+
portMatcher?: string;
|
|
72
89
|
}
|
|
73
90
|
export interface OutputEntry {
|
|
74
91
|
/** Monotonic per-session sequence number assigned at push time. Survives ring-buffer eviction. */
|