@salesforce/b2c-tooling-sdk 1.1.0 → 1.3.0
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/dist/cjs/operations/code/watch.js +98 -75
- package/dist/cjs/operations/code/watch.js.map +1 -1
- package/dist/cjs/operations/debug/dap-adapter.d.ts +72 -0
- package/dist/cjs/operations/debug/dap-adapter.js +505 -0
- package/dist/cjs/operations/debug/dap-adapter.js.map +1 -0
- package/dist/cjs/operations/debug/debug-session.d.ts +51 -0
- package/dist/cjs/operations/debug/debug-session.js +219 -0
- package/dist/cjs/operations/debug/debug-session.js.map +1 -0
- package/dist/cjs/operations/debug/index.d.ts +17 -0
- package/dist/cjs/operations/debug/index.js +19 -0
- package/dist/cjs/operations/debug/index.js.map +1 -0
- package/dist/cjs/operations/debug/sdapi-client.d.ts +44 -0
- package/dist/cjs/operations/debug/sdapi-client.js +169 -0
- package/dist/cjs/operations/debug/sdapi-client.js.map +1 -0
- package/dist/cjs/operations/debug/source-mapping.d.ts +13 -0
- package/dist/cjs/operations/debug/source-mapping.js +57 -0
- package/dist/cjs/operations/debug/source-mapping.js.map +1 -0
- package/dist/cjs/operations/debug/types.d.ts +95 -0
- package/dist/cjs/operations/debug/types.js +2 -0
- package/dist/cjs/operations/debug/types.js.map +1 -0
- package/dist/cjs/operations/debug/variable-store.d.ts +35 -0
- package/dist/cjs/operations/debug/variable-store.js +52 -0
- package/dist/cjs/operations/debug/variable-store.js.map +1 -0
- package/dist/cjs/skills/agents.d.ts +1 -0
- package/dist/cjs/skills/agents.js +45 -4
- package/dist/cjs/skills/agents.js.map +1 -1
- package/dist/cjs/skills/installer.js +1 -0
- package/dist/cjs/skills/installer.js.map +1 -1
- package/dist/cjs/skills/types.d.ts +3 -1
- package/dist/esm/operations/code/watch.js +98 -75
- package/dist/esm/operations/code/watch.js.map +1 -1
- package/dist/esm/operations/debug/dap-adapter.d.ts +72 -0
- package/dist/esm/operations/debug/dap-adapter.js +505 -0
- package/dist/esm/operations/debug/dap-adapter.js.map +1 -0
- package/dist/esm/operations/debug/debug-session.d.ts +51 -0
- package/dist/esm/operations/debug/debug-session.js +219 -0
- package/dist/esm/operations/debug/debug-session.js.map +1 -0
- package/dist/esm/operations/debug/index.d.ts +17 -0
- package/dist/esm/operations/debug/index.js +19 -0
- package/dist/esm/operations/debug/index.js.map +1 -0
- package/dist/esm/operations/debug/sdapi-client.d.ts +44 -0
- package/dist/esm/operations/debug/sdapi-client.js +169 -0
- package/dist/esm/operations/debug/sdapi-client.js.map +1 -0
- package/dist/esm/operations/debug/source-mapping.d.ts +13 -0
- package/dist/esm/operations/debug/source-mapping.js +57 -0
- package/dist/esm/operations/debug/source-mapping.js.map +1 -0
- package/dist/esm/operations/debug/types.d.ts +95 -0
- package/dist/esm/operations/debug/types.js +2 -0
- package/dist/esm/operations/debug/types.js.map +1 -0
- package/dist/esm/operations/debug/variable-store.d.ts +35 -0
- package/dist/esm/operations/debug/variable-store.js +52 -0
- package/dist/esm/operations/debug/variable-store.js.map +1 -0
- package/dist/esm/skills/agents.d.ts +1 -0
- package/dist/esm/skills/agents.js +45 -4
- package/dist/esm/skills/agents.js.map +1 -1
- package/dist/esm/skills/installer.js +1 -0
- package/dist/esm/skills/installer.js.map +1 -1
- package/dist/esm/skills/types.d.ts +3 -1
- package/package.json +14 -3
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2
|
|
4
|
+
* For full license text, see the license.txt file in the repo root or http://www.apache.org/licenses/LICENSE-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* DAP (Debug Adapter Protocol) adapter for B2C Commerce Script Debugger.
|
|
8
|
+
*
|
|
9
|
+
* Extends `@vscode/debugadapter`'s LoggingDebugSession and maps DAP requests
|
|
10
|
+
* to SDAPI operations. Works over stdio (CLI) or inline (VSCode extension).
|
|
11
|
+
*
|
|
12
|
+
* @module operations/debug/dap-adapter
|
|
13
|
+
*/
|
|
14
|
+
import { LoggingDebugSession, InitializedEvent, StoppedEvent, TerminatedEvent, ThreadEvent, OutputEvent, Thread, StackFrame as DAPStackFrame, Scope, Variable, Breakpoint as DAPBreakpoint, Source, } from '@vscode/debugadapter';
|
|
15
|
+
import { DebugSessionManager } from './debug-session.js';
|
|
16
|
+
import { SdapiError } from './sdapi-client.js';
|
|
17
|
+
import { createSourceMapper } from './source-mapping.js';
|
|
18
|
+
import { VariableStore } from './variable-store.js';
|
|
19
|
+
/** Frame IDs encode threadId and frameIndex: threadId * 10000 + frameIndex */
|
|
20
|
+
const FRAME_ID_MULTIPLIER = 10000;
|
|
21
|
+
function encodeFrameId(threadId, frameIndex) {
|
|
22
|
+
return threadId * FRAME_ID_MULTIPLIER + frameIndex;
|
|
23
|
+
}
|
|
24
|
+
function decodeFrameId(frameId) {
|
|
25
|
+
return {
|
|
26
|
+
threadId: Math.floor(frameId / FRAME_ID_MULTIPLIER),
|
|
27
|
+
frameIndex: frameId % FRAME_ID_MULTIPLIER,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Primitive SDAPI types that should not get a variablesReference for expansion.
|
|
32
|
+
*/
|
|
33
|
+
const PRIMITIVE_TYPES = new Set(['string', 'number', 'boolean', 'undefined', 'null', 'String', 'Number', 'Boolean']);
|
|
34
|
+
/**
|
|
35
|
+
* B2C Script Debug Adapter.
|
|
36
|
+
*
|
|
37
|
+
* Can be used in two modes:
|
|
38
|
+
* 1. **Pre-configured**: Pass a `DebugSessionConfig` to the constructor (for inline VSCode use)
|
|
39
|
+
* 2. **Launch-configured**: Config comes from DAP launch request arguments (for CLI stdio use)
|
|
40
|
+
*/
|
|
41
|
+
export class B2CScriptDebugAdapter extends LoggingDebugSession {
|
|
42
|
+
session;
|
|
43
|
+
sourceMapper;
|
|
44
|
+
variableStore = new VariableStore();
|
|
45
|
+
preConfig;
|
|
46
|
+
externalCallbacks;
|
|
47
|
+
/** Breakpoints keyed by server script_path (merged across all files) */
|
|
48
|
+
breakpointsBySource = new Map();
|
|
49
|
+
/** Logpoint messages keyed by "script_path:line_number" */
|
|
50
|
+
logpoints = new Map();
|
|
51
|
+
constructor(config, callbacks = {}) {
|
|
52
|
+
super();
|
|
53
|
+
this.preConfig = config;
|
|
54
|
+
this.externalCallbacks = callbacks;
|
|
55
|
+
// SDAPI uses 1-based lines (same as DAP default)
|
|
56
|
+
this.setDebuggerLinesStartAt1(true);
|
|
57
|
+
this.setDebuggerColumnsStartAt1(true);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Override shutdown to prevent the base class from calling process.exit().
|
|
61
|
+
* Process lifecycle is managed by the CLI command, not the adapter.
|
|
62
|
+
*/
|
|
63
|
+
shutdown() {
|
|
64
|
+
// No-op — base class would call process.exit() after a timeout
|
|
65
|
+
}
|
|
66
|
+
// -----------------------------------------------------------------------
|
|
67
|
+
// Lifecycle
|
|
68
|
+
// -----------------------------------------------------------------------
|
|
69
|
+
initializeRequest(response, _args) {
|
|
70
|
+
response.body = {
|
|
71
|
+
...response.body,
|
|
72
|
+
supportsConditionalBreakpoints: true,
|
|
73
|
+
supportsEvaluateForHovers: true,
|
|
74
|
+
supportTerminateDebuggee: true,
|
|
75
|
+
supportsConfigurationDoneRequest: true,
|
|
76
|
+
supportsTerminateRequest: true,
|
|
77
|
+
supportsLogPoints: true,
|
|
78
|
+
};
|
|
79
|
+
this.sendResponse(response);
|
|
80
|
+
// InitializedEvent is deferred to launchRequest — the SDAPI requires a
|
|
81
|
+
// client to exist before breakpoints can be set, and DAP clients send
|
|
82
|
+
// setBreakpoints immediately after receiving InitializedEvent.
|
|
83
|
+
}
|
|
84
|
+
async launchRequest(response, args) {
|
|
85
|
+
try {
|
|
86
|
+
const config = this.resolveConfig(args);
|
|
87
|
+
this.sourceMapper = createSourceMapper(config.cartridgeRoots);
|
|
88
|
+
this.session = new DebugSessionManager(config, {
|
|
89
|
+
onConnected: (hostname) => {
|
|
90
|
+
this.sendEvent(new OutputEvent(`Connected to ${hostname}\n`, 'console'));
|
|
91
|
+
this.externalCallbacks.onConnected?.(hostname);
|
|
92
|
+
},
|
|
93
|
+
onDisconnected: () => {
|
|
94
|
+
this.sendEvent(new OutputEvent('Debugger disconnected\n', 'console'));
|
|
95
|
+
this.externalCallbacks.onDisconnected?.();
|
|
96
|
+
},
|
|
97
|
+
onThreadStopped: (thread) => {
|
|
98
|
+
this.handleThreadStopped(thread);
|
|
99
|
+
this.externalCallbacks.onThreadStopped?.(thread);
|
|
100
|
+
},
|
|
101
|
+
onThreadContinued: (threadId) => {
|
|
102
|
+
this.handleThreadContinued(threadId);
|
|
103
|
+
this.externalCallbacks.onThreadContinued?.(threadId);
|
|
104
|
+
},
|
|
105
|
+
onThreadExited: (threadId) => {
|
|
106
|
+
this.handleThreadExited(threadId);
|
|
107
|
+
this.externalCallbacks.onThreadExited?.(threadId);
|
|
108
|
+
},
|
|
109
|
+
onDebuggerDisabled: () => {
|
|
110
|
+
this.sendEvent(new OutputEvent('Debugger was disabled externally\n', 'important'));
|
|
111
|
+
this.sendEvent(new TerminatedEvent());
|
|
112
|
+
this.externalCallbacks.onDebuggerDisabled?.();
|
|
113
|
+
},
|
|
114
|
+
onError: (error) => {
|
|
115
|
+
this.sendEvent(new OutputEvent(`Debug error: ${error.message}\n`, 'stderr'));
|
|
116
|
+
this.externalCallbacks.onError?.(error);
|
|
117
|
+
},
|
|
118
|
+
});
|
|
119
|
+
await this.session.connect();
|
|
120
|
+
this.sendResponse(response);
|
|
121
|
+
// Signal ready for configuration now that the SDAPI client exists
|
|
122
|
+
this.sendEvent(new InitializedEvent());
|
|
123
|
+
}
|
|
124
|
+
catch (error) {
|
|
125
|
+
const msg = this.friendlyErrorMessage(error);
|
|
126
|
+
this.sendEvent(new OutputEvent(`Failed to connect: ${msg}\n`, 'important'));
|
|
127
|
+
this.sendErrorResponse(response, 1001, `Failed to connect: ${msg}`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
configurationDoneRequest(response, _args) {
|
|
131
|
+
this.sendResponse(response);
|
|
132
|
+
}
|
|
133
|
+
async disconnectRequest(response, _args) {
|
|
134
|
+
try {
|
|
135
|
+
await this.session?.disconnect();
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
// Best-effort cleanup
|
|
139
|
+
}
|
|
140
|
+
this.sendResponse(response);
|
|
141
|
+
}
|
|
142
|
+
async terminateRequest(response, _args) {
|
|
143
|
+
try {
|
|
144
|
+
await this.session?.disconnect();
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// Best-effort cleanup
|
|
148
|
+
}
|
|
149
|
+
this.sendEvent(new TerminatedEvent());
|
|
150
|
+
this.sendResponse(response);
|
|
151
|
+
}
|
|
152
|
+
// -----------------------------------------------------------------------
|
|
153
|
+
// Breakpoints
|
|
154
|
+
// -----------------------------------------------------------------------
|
|
155
|
+
async setBreakPointsRequest(response, args) {
|
|
156
|
+
if (!this.session || !this.sourceMapper) {
|
|
157
|
+
response.body = { breakpoints: [] };
|
|
158
|
+
this.sendResponse(response);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const sourcePath = args.source.path ?? '';
|
|
162
|
+
const serverPath = this.sourceMapper.toServerPath(sourcePath);
|
|
163
|
+
if (!serverPath) {
|
|
164
|
+
// Can't map this source — return unverified breakpoints
|
|
165
|
+
const unverified = (args.breakpoints ?? []).map((bp) => {
|
|
166
|
+
const dapBp = new DAPBreakpoint(false, bp.line);
|
|
167
|
+
dapBp.setId(this.allocateBreakpointId());
|
|
168
|
+
return dapBp;
|
|
169
|
+
});
|
|
170
|
+
response.body = { breakpoints: unverified };
|
|
171
|
+
this.sendResponse(response);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
// Clear logpoints for this source before rebuilding
|
|
175
|
+
for (const key of this.logpoints.keys()) {
|
|
176
|
+
if (key.startsWith(`${serverPath}:`)) {
|
|
177
|
+
this.logpoints.delete(key);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// Update our local map for this source file
|
|
181
|
+
const inputs = (args.breakpoints ?? []).map((bp) => {
|
|
182
|
+
if (bp.logMessage) {
|
|
183
|
+
this.logpoints.set(`${serverPath}:${bp.line}`, bp.logMessage);
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
line_number: bp.line,
|
|
187
|
+
script_path: serverPath,
|
|
188
|
+
...(bp.condition ? { condition: bp.condition } : {}),
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
if (inputs.length > 0) {
|
|
192
|
+
this.breakpointsBySource.set(serverPath, inputs);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
this.breakpointsBySource.delete(serverPath);
|
|
196
|
+
}
|
|
197
|
+
// Merge all breakpoints and send to server
|
|
198
|
+
const allBreakpoints = [...this.breakpointsBySource.values()].flat();
|
|
199
|
+
try {
|
|
200
|
+
const serverBps = await this.session.setBreakpoints(allBreakpoints);
|
|
201
|
+
const verified = serverBps.filter((bp) => bp.script_path === serverPath).length;
|
|
202
|
+
this.sendEvent(new OutputEvent(`Set ${verified}/${inputs.length} breakpoint(s) in ${serverPath}\n`, 'console'));
|
|
203
|
+
// Match server-returned breakpoints back to this file's breakpoints
|
|
204
|
+
const fileBps = serverBps.filter((bp) => bp.script_path === serverPath);
|
|
205
|
+
const result = inputs.map((input) => {
|
|
206
|
+
const match = fileBps.find((sbp) => sbp.line_number === input.line_number);
|
|
207
|
+
if (match) {
|
|
208
|
+
const bp = new DAPBreakpoint(true, match.line_number);
|
|
209
|
+
bp.setId(match.id);
|
|
210
|
+
return bp;
|
|
211
|
+
}
|
|
212
|
+
return new DAPBreakpoint(false, input.line_number);
|
|
213
|
+
});
|
|
214
|
+
response.body = { breakpoints: result };
|
|
215
|
+
}
|
|
216
|
+
catch (error) {
|
|
217
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
218
|
+
this.sendEvent(new OutputEvent(`Breakpoint error: ${msg}\n`, 'stderr'));
|
|
219
|
+
response.body = { breakpoints: inputs.map((i) => new DAPBreakpoint(false, i.line_number)) };
|
|
220
|
+
}
|
|
221
|
+
this.sendResponse(response);
|
|
222
|
+
}
|
|
223
|
+
// -----------------------------------------------------------------------
|
|
224
|
+
// Threads
|
|
225
|
+
// -----------------------------------------------------------------------
|
|
226
|
+
threadsRequest(response) {
|
|
227
|
+
const threads = this.session?.getKnownThreads() ?? [];
|
|
228
|
+
// Always return at least a "main" thread so the UI has something
|
|
229
|
+
if (threads.length === 0) {
|
|
230
|
+
response.body = { threads: [new Thread(0, 'Main Thread')] };
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
response.body = {
|
|
234
|
+
threads: threads.map((t) => new Thread(t.id, `Thread ${t.id}`)),
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
this.sendResponse(response);
|
|
238
|
+
}
|
|
239
|
+
// -----------------------------------------------------------------------
|
|
240
|
+
// Stack trace
|
|
241
|
+
// -----------------------------------------------------------------------
|
|
242
|
+
async stackTraceRequest(response, args) {
|
|
243
|
+
if (!this.session || !this.sourceMapper) {
|
|
244
|
+
response.body = { stackFrames: [], totalFrames: 0 };
|
|
245
|
+
this.sendResponse(response);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
try {
|
|
249
|
+
const thread = await this.session.client.getThread(args.threadId);
|
|
250
|
+
const frames = (thread.call_stack ?? []).map((frame) => {
|
|
251
|
+
const loc = frame.location;
|
|
252
|
+
const localPath = this.sourceMapper.toLocalPath(loc.script_path);
|
|
253
|
+
const source = localPath
|
|
254
|
+
? new Source(loc.script_path.split('/').pop() ?? loc.script_path, localPath)
|
|
255
|
+
: new Source(loc.script_path);
|
|
256
|
+
return new DAPStackFrame(encodeFrameId(args.threadId, frame.index), loc.function_name || '<anonymous>', source, loc.line_number, 0);
|
|
257
|
+
});
|
|
258
|
+
response.body = { stackFrames: frames, totalFrames: frames.length };
|
|
259
|
+
}
|
|
260
|
+
catch {
|
|
261
|
+
response.body = { stackFrames: [], totalFrames: 0 };
|
|
262
|
+
}
|
|
263
|
+
this.sendResponse(response);
|
|
264
|
+
}
|
|
265
|
+
// -----------------------------------------------------------------------
|
|
266
|
+
// Scopes & variables
|
|
267
|
+
// -----------------------------------------------------------------------
|
|
268
|
+
scopesRequest(response, args) {
|
|
269
|
+
const { threadId, frameIndex } = decodeFrameId(args.frameId);
|
|
270
|
+
const localRef = this.variableStore.getOrCreateReference(threadId, frameIndex, '', 'local');
|
|
271
|
+
const closureRef = this.variableStore.getOrCreateReference(threadId, frameIndex, '', 'closure');
|
|
272
|
+
const globalRef = this.variableStore.getOrCreateReference(threadId, frameIndex, '', 'global');
|
|
273
|
+
response.body = {
|
|
274
|
+
scopes: [
|
|
275
|
+
new Scope('Local', localRef, false),
|
|
276
|
+
new Scope('Closure', closureRef, false),
|
|
277
|
+
new Scope('Global', globalRef, true),
|
|
278
|
+
],
|
|
279
|
+
};
|
|
280
|
+
this.sendResponse(response);
|
|
281
|
+
}
|
|
282
|
+
async variablesRequest(response, args) {
|
|
283
|
+
if (!this.session) {
|
|
284
|
+
response.body = { variables: [] };
|
|
285
|
+
this.sendResponse(response);
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
const ref = this.variableStore.resolve(args.variablesReference);
|
|
289
|
+
if (!ref) {
|
|
290
|
+
response.body = { variables: [] };
|
|
291
|
+
this.sendResponse(response);
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
try {
|
|
295
|
+
let members;
|
|
296
|
+
if (ref.scope && !ref.objectPath) {
|
|
297
|
+
// Scope request: get all variables, filter by scope
|
|
298
|
+
const result = await this.session.client.getVariables(ref.threadId, ref.frameIndex);
|
|
299
|
+
members = result.object_members.filter((m) => m.scope === ref.scope);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
// Object member request: navigate to object_path
|
|
303
|
+
const result = await this.session.client.getMembers(ref.threadId, ref.frameIndex, ref.objectPath || undefined);
|
|
304
|
+
members = result.object_members;
|
|
305
|
+
}
|
|
306
|
+
const variables = members
|
|
307
|
+
.filter((m) => m.name !== 'arguments')
|
|
308
|
+
.map((m) => this.memberToVariable(m, ref.threadId, ref.frameIndex, ref.objectPath));
|
|
309
|
+
response.body = { variables };
|
|
310
|
+
}
|
|
311
|
+
catch {
|
|
312
|
+
response.body = { variables: [] };
|
|
313
|
+
}
|
|
314
|
+
this.sendResponse(response);
|
|
315
|
+
}
|
|
316
|
+
// -----------------------------------------------------------------------
|
|
317
|
+
// Evaluation
|
|
318
|
+
// -----------------------------------------------------------------------
|
|
319
|
+
async evaluateRequest(response, args) {
|
|
320
|
+
if (!this.session || args.frameId === undefined) {
|
|
321
|
+
this.sendErrorResponse(response, 1002, 'No active debug session or frame');
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
const { threadId, frameIndex } = decodeFrameId(args.frameId);
|
|
325
|
+
try {
|
|
326
|
+
const result = await this.session.client.evaluate(threadId, frameIndex, args.expression);
|
|
327
|
+
// Try to make the result expandable by checking if it has members
|
|
328
|
+
let variablesReference = 0;
|
|
329
|
+
try {
|
|
330
|
+
const members = await this.session.client.getMembers(threadId, frameIndex, args.expression);
|
|
331
|
+
if (members.object_members.length > 0) {
|
|
332
|
+
variablesReference = this.variableStore.getOrCreateReference(threadId, frameIndex, args.expression);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
catch {
|
|
336
|
+
// Not expandable — leave variablesReference as 0
|
|
337
|
+
}
|
|
338
|
+
response.body = {
|
|
339
|
+
result: result.result,
|
|
340
|
+
variablesReference,
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
catch (error) {
|
|
344
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
345
|
+
response.body = { result: msg, variablesReference: 0 };
|
|
346
|
+
}
|
|
347
|
+
this.sendResponse(response);
|
|
348
|
+
}
|
|
349
|
+
// -----------------------------------------------------------------------
|
|
350
|
+
// Execution control
|
|
351
|
+
// -----------------------------------------------------------------------
|
|
352
|
+
async continueRequest(response, args) {
|
|
353
|
+
this.variableStore.clear();
|
|
354
|
+
try {
|
|
355
|
+
await this.session?.resume(args.threadId);
|
|
356
|
+
this.sendEvent(new OutputEvent(`Thread ${args.threadId} continued\n`, 'console'));
|
|
357
|
+
response.body = { allThreadsContinued: false };
|
|
358
|
+
}
|
|
359
|
+
catch (error) {
|
|
360
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
361
|
+
this.sendEvent(new OutputEvent(`Continue error: ${msg}\n`, 'stderr'));
|
|
362
|
+
}
|
|
363
|
+
this.sendResponse(response);
|
|
364
|
+
}
|
|
365
|
+
async nextRequest(response, args) {
|
|
366
|
+
this.variableStore.clear();
|
|
367
|
+
try {
|
|
368
|
+
await this.session?.stepOver(args.threadId);
|
|
369
|
+
}
|
|
370
|
+
catch (error) {
|
|
371
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
372
|
+
this.sendEvent(new OutputEvent(`Step over error: ${msg}\n`, 'stderr'));
|
|
373
|
+
}
|
|
374
|
+
this.sendResponse(response);
|
|
375
|
+
}
|
|
376
|
+
async stepInRequest(response, args) {
|
|
377
|
+
this.variableStore.clear();
|
|
378
|
+
try {
|
|
379
|
+
await this.session?.stepInto(args.threadId);
|
|
380
|
+
}
|
|
381
|
+
catch (error) {
|
|
382
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
383
|
+
this.sendEvent(new OutputEvent(`Step in error: ${msg}\n`, 'stderr'));
|
|
384
|
+
}
|
|
385
|
+
this.sendResponse(response);
|
|
386
|
+
}
|
|
387
|
+
async stepOutRequest(response, args) {
|
|
388
|
+
this.variableStore.clear();
|
|
389
|
+
try {
|
|
390
|
+
await this.session?.stepOut(args.threadId);
|
|
391
|
+
}
|
|
392
|
+
catch (error) {
|
|
393
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
394
|
+
this.sendEvent(new OutputEvent(`Step out error: ${msg}\n`, 'stderr'));
|
|
395
|
+
}
|
|
396
|
+
this.sendResponse(response);
|
|
397
|
+
}
|
|
398
|
+
// -----------------------------------------------------------------------
|
|
399
|
+
// Thread event handlers (called by DebugSessionManager)
|
|
400
|
+
// -----------------------------------------------------------------------
|
|
401
|
+
handleThreadStopped(thread) {
|
|
402
|
+
this.variableStore.clear();
|
|
403
|
+
const topFrame = thread.call_stack?.[0];
|
|
404
|
+
// Check if this is a logpoint hit
|
|
405
|
+
if (topFrame) {
|
|
406
|
+
const loc = topFrame.location;
|
|
407
|
+
const logMessage = this.logpoints.get(`${loc.script_path}:${loc.line_number}`);
|
|
408
|
+
if (logMessage) {
|
|
409
|
+
void this.handleLogpoint(thread.id, topFrame.index, logMessage);
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
if (topFrame) {
|
|
414
|
+
const loc = topFrame.location;
|
|
415
|
+
const fn = loc.function_name || '<anonymous>';
|
|
416
|
+
const localPath = this.sourceMapper?.toLocalPath(loc.script_path);
|
|
417
|
+
const displayPath = localPath ?? `${loc.script_path} (unmapped cartridge)`;
|
|
418
|
+
this.sendEvent(new OutputEvent(`Thread ${thread.id} halted at ${displayPath}:${loc.line_number} (${fn})\n`, 'console'));
|
|
419
|
+
}
|
|
420
|
+
this.sendEvent(new StoppedEvent('breakpoint', thread.id));
|
|
421
|
+
}
|
|
422
|
+
async handleLogpoint(threadId, frameIndex, logMessage) {
|
|
423
|
+
// Interpolate {expression} placeholders by evaluating each on the server
|
|
424
|
+
let output = logMessage;
|
|
425
|
+
const placeholders = logMessage.match(/\{[^}]+\}/g);
|
|
426
|
+
if (placeholders && this.session) {
|
|
427
|
+
for (const placeholder of placeholders) {
|
|
428
|
+
const expr = placeholder.slice(1, -1);
|
|
429
|
+
try {
|
|
430
|
+
const result = await this.session.client.evaluate(threadId, frameIndex, expr);
|
|
431
|
+
output = output.replace(placeholder, result.result);
|
|
432
|
+
}
|
|
433
|
+
catch {
|
|
434
|
+
output = output.replace(placeholder, `<${expr}: error>`);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
this.sendEvent(new OutputEvent(output + '\n', 'console'));
|
|
439
|
+
// Auto-resume — logpoints don't stop
|
|
440
|
+
try {
|
|
441
|
+
await this.session?.resume(threadId);
|
|
442
|
+
}
|
|
443
|
+
catch {
|
|
444
|
+
// If resume fails, fall through to a normal stop
|
|
445
|
+
this.sendEvent(new StoppedEvent('breakpoint', threadId));
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
handleThreadContinued(_threadId) {
|
|
449
|
+
this.variableStore.clear();
|
|
450
|
+
// ContinuedEvent is optional — the client infers it from step/continue responses
|
|
451
|
+
}
|
|
452
|
+
handleThreadExited(threadId) {
|
|
453
|
+
this.sendEvent(new ThreadEvent('exited', threadId));
|
|
454
|
+
}
|
|
455
|
+
// -----------------------------------------------------------------------
|
|
456
|
+
// Helpers
|
|
457
|
+
// -----------------------------------------------------------------------
|
|
458
|
+
resolveConfig(args) {
|
|
459
|
+
if (this.preConfig)
|
|
460
|
+
return this.preConfig;
|
|
461
|
+
const hostname = args.hostname;
|
|
462
|
+
const username = args.username;
|
|
463
|
+
const password = args.password;
|
|
464
|
+
if (!hostname || !username || !password) {
|
|
465
|
+
throw new Error('hostname, username, and password are required for the debug session');
|
|
466
|
+
}
|
|
467
|
+
// Cartridge roots will be populated by the CLI command before creating the adapter
|
|
468
|
+
return {
|
|
469
|
+
hostname,
|
|
470
|
+
username,
|
|
471
|
+
password,
|
|
472
|
+
clientId: args.clientId,
|
|
473
|
+
cartridgeRoots: [],
|
|
474
|
+
pollInterval: args.pollInterval,
|
|
475
|
+
keepaliveInterval: args.keepaliveInterval,
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
memberToVariable(member, threadId, frameIndex, parentPath) {
|
|
479
|
+
const isPrimitive = PRIMITIVE_TYPES.has(member.type);
|
|
480
|
+
let childRef = 0;
|
|
481
|
+
if (!isPrimitive) {
|
|
482
|
+
// Build the object path for drilling down
|
|
483
|
+
const childPath = parentPath ? `${parentPath}.${member.name}` : member.name;
|
|
484
|
+
childRef = this.variableStore.getOrCreateReference(threadId, frameIndex, childPath);
|
|
485
|
+
}
|
|
486
|
+
const displayValue = member.value.length > 200 ? member.value.slice(0, 200) + '...' : member.value;
|
|
487
|
+
return new Variable(member.name, displayValue, childRef);
|
|
488
|
+
}
|
|
489
|
+
friendlyErrorMessage(error) {
|
|
490
|
+
if (error instanceof SdapiError) {
|
|
491
|
+
if (error.status === 401) {
|
|
492
|
+
return 'Authentication failed — check that username and password (access key) are correct in your configuration (dw.json).';
|
|
493
|
+
}
|
|
494
|
+
if (error.status === 412) {
|
|
495
|
+
return 'Script debugger is not enabled on this instance. Enable it in Business Manager > Administration > Development Configuration.';
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
return error instanceof Error ? error.message : String(error);
|
|
499
|
+
}
|
|
500
|
+
_nextBreakpointId = 1;
|
|
501
|
+
allocateBreakpointId() {
|
|
502
|
+
return this._nextBreakpointId++;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
//# sourceMappingURL=dap-adapter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dap-adapter.js","sourceRoot":"","sources":["../../../../src/operations/debug/dap-adapter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;;;;;;;GAOG;AACH,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,WAAW,EACX,WAAW,EACX,MAAM,EACN,UAAU,IAAI,aAAa,EAC3B,KAAK,EACL,QAAQ,EACR,UAAU,IAAI,aAAa,EAC3B,MAAM,GACP,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAC,mBAAmB,EAAC,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAC,kBAAkB,EAAoB,MAAM,qBAAqB,CAAC;AAC1E,O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AC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;IAEO,iBAAiB,GAAG,CAAC,CAAC;IACtB,oBAAoB;QAC1B,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { SdapiClient } from './sdapi-client.js';
|
|
2
|
+
import type { BreakpointInput, DebugSessionCallbacks, DebugSessionConfig, SdapiBreakpoint, SdapiScriptThread } from './types.js';
|
|
3
|
+
export declare class DebugSessionManager {
|
|
4
|
+
readonly client: SdapiClient;
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly callbacks;
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private pollTimer?;
|
|
9
|
+
private keepaliveTimer?;
|
|
10
|
+
/** Last known thread states keyed by thread id */
|
|
11
|
+
private knownThreads;
|
|
12
|
+
private connected;
|
|
13
|
+
constructor(config: DebugSessionConfig, callbacks?: DebugSessionCallbacks);
|
|
14
|
+
/**
|
|
15
|
+
* Connect to the debugger: enable the client, start polling and keepalive.
|
|
16
|
+
*/
|
|
17
|
+
connect(): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Disconnect: stop timers, delete client.
|
|
20
|
+
*/
|
|
21
|
+
disconnect(): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Set breakpoints (replaces all current breakpoints).
|
|
24
|
+
*/
|
|
25
|
+
setBreakpoints(breakpoints: BreakpointInput[]): Promise<SdapiBreakpoint[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Resume a halted thread.
|
|
28
|
+
*/
|
|
29
|
+
resume(threadId: number): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Step over (next line).
|
|
32
|
+
*/
|
|
33
|
+
stepOver(threadId: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Step into function.
|
|
36
|
+
*/
|
|
37
|
+
stepInto(threadId: number): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Step out of function.
|
|
40
|
+
*/
|
|
41
|
+
stepOut(threadId: number): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current list of known threads (from last poll).
|
|
44
|
+
*/
|
|
45
|
+
getKnownThreads(): SdapiScriptThread[];
|
|
46
|
+
private stopTimers;
|
|
47
|
+
private keepalive;
|
|
48
|
+
private haltLocationChanged;
|
|
49
|
+
private logThreadHalted;
|
|
50
|
+
private pollThreads;
|
|
51
|
+
}
|