@mcp-abap-adt/compact 18.0.0 → 19.0.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/README.md +73 -27
- package/bin/mcp-abap-adt-compact.js +7 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/dist/launcher.d.ts +10 -22
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +29 -151
- package/dist/launcher.js.map +1 -1
- package/docs/AVAILABLE_TOOLS.md +307 -139
- package/package.json +7 -7
- package/dist/debug/group.d.ts +0 -21
- package/dist/debug/group.d.ts.map +0 -1
- package/dist/debug/group.js +0 -39
- package/dist/debug/group.js.map +0 -1
- package/dist/debug/handleHandlerDebugStart.d.ts +0 -137
- package/dist/debug/handleHandlerDebugStart.d.ts.map +0 -1
- package/dist/debug/handleHandlerDebugStart.js +0 -71
- package/dist/debug/handleHandlerDebugStart.js.map +0 -1
- package/dist/debug/handleHandlerDebugStep.d.ts +0 -49
- package/dist/debug/handleHandlerDebugStep.d.ts.map +0 -1
- package/dist/debug/handleHandlerDebugStep.js +0 -118
- package/dist/debug/handleHandlerDebugStep.js.map +0 -1
- package/dist/debug/handleHandlerDebugView.d.ts +0 -36
- package/dist/debug/handleHandlerDebugView.d.ts.map +0 -1
- package/dist/debug/handleHandlerDebugView.js +0 -72
- package/dist/debug/handleHandlerDebugView.js.map +0 -1
- package/dist/debug/handleHandlerDebugWait.d.ts +0 -29
- package/dist/debug/handleHandlerDebugWait.d.ts.map +0 -1
- package/dist/debug/handleHandlerDebugWait.js +0 -39
- package/dist/debug/handleHandlerDebugWait.js.map +0 -1
- package/dist/debug/shared.d.ts +0 -23
- package/dist/debug/shared.d.ts.map +0 -1
- package/dist/debug/shared.js +0 -45
- package/dist/debug/shared.js.map +0 -1
- package/dist/group.d.ts +0 -6
- package/dist/group.d.ts.map +0 -1
- package/dist/group.js +0 -35
- package/dist/group.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/compact",
|
|
3
3
|
"mcpName": "io.github.fr0ster/mcp-abap-adt-compact",
|
|
4
|
-
"version": "
|
|
5
|
-
"description": "The compact MCP server for SAP ABAP ADT: one tool per operation with the object in the arguments \u2014
|
|
4
|
+
"version": "19.0.0",
|
|
5
|
+
"description": "The compact MCP server for SAP ABAP ADT: one tool per operation with the object in the arguments \u2014 28 tools instead of 370, for a host that cannot build a retrieval pipeline of its own. Connects over HTTP, RFC or SNC, configured as @mcp-abap-adt/core; RFC and SNC need the SAP NW RFC SDK at install time.",
|
|
6
6
|
"license": "AGPL-3.0-only",
|
|
7
7
|
"author": "Oleksii Kyslytsia <oleksij.kyslytsja@gmail.com>",
|
|
8
8
|
"repository": {
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"scripts": {
|
|
52
52
|
"prebuild": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\"",
|
|
53
53
|
"build": "npx tsc -p tsconfig.json",
|
|
54
|
-
"test": "
|
|
54
|
+
"test": "npm --prefix .. test -- --roots compact/src",
|
|
55
55
|
"lint:check": "npx biome check src",
|
|
56
56
|
"prepublishOnly": "npm run build",
|
|
57
57
|
"start": "node ./bin/mcp-abap-adt-compact.js",
|
|
58
58
|
"docs:tools": "node ./tools/generate-docs.js"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mcp-abap-adt/compact-modify": "^
|
|
62
|
-
"@mcp-abap-adt/compact-readonly": "^
|
|
63
|
-
"@mcp-abap-adt/core": "^
|
|
64
|
-
"@mcp-abap-adt/lib": "^
|
|
61
|
+
"@mcp-abap-adt/compact-modify": "^19.0.0",
|
|
62
|
+
"@mcp-abap-adt/compact-readonly-entries": "^19.0.0",
|
|
63
|
+
"@mcp-abap-adt/core": "^19.0.0",
|
|
64
|
+
"@mcp-abap-adt/lib": "^19.0.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"typescript": "^6.0.2",
|
package/dist/debug/group.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The compact debugger: four verb tools, served with `--exposition=…,debug`.
|
|
3
|
-
*
|
|
4
|
-
* One debug session per instance holds either ABAP or AMDP, never both. The kind is
|
|
5
|
-
* fixed by the start; the other three verbs read it from the instance.
|
|
6
|
-
*
|
|
7
|
-
* It is a stateful group: the launcher hands the same instance state to it as to
|
|
8
|
-
* the object-oriented debug set, so a handle belongs to the server instance.
|
|
9
|
-
*/
|
|
10
|
-
import { BaseHandlerGroup, type HandlerEntry } from '@mcp-abap-adt/lib/handlers';
|
|
11
|
-
/**
|
|
12
|
-
* The four verbs, each paired with its handler by `defineTool`: the compiler
|
|
13
|
-
* checks that a handler takes what its schema declares. Every registration path
|
|
14
|
-
* hands a `(context, args)` handler the call's context.
|
|
15
|
-
*/
|
|
16
|
-
export declare function compactDebugEntries(): HandlerEntry[];
|
|
17
|
-
export declare class CompactDebugHandlersGroup extends BaseHandlerGroup {
|
|
18
|
-
protected groupName: string;
|
|
19
|
-
getHandlers(): HandlerEntry[];
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=group.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../../src/debug/group.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EACL,gBAAgB,EAEhB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AAkBpC;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,YAAY,EAAE,CAOpD;AAED,qBAAa,yBAA0B,SAAQ,gBAAgB;IAC7D,SAAS,CAAC,SAAS,SAA0B;IAE7C,WAAW,IAAI,YAAY,EAAE;CAG9B"}
|
package/dist/debug/group.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompactDebugHandlersGroup = void 0;
|
|
4
|
-
exports.compactDebugEntries = compactDebugEntries;
|
|
5
|
-
/**
|
|
6
|
-
* The compact debugger: four verb tools, served with `--exposition=…,debug`.
|
|
7
|
-
*
|
|
8
|
-
* One debug session per instance holds either ABAP or AMDP, never both. The kind is
|
|
9
|
-
* fixed by the start; the other three verbs read it from the instance.
|
|
10
|
-
*
|
|
11
|
-
* It is a stateful group: the launcher hands the same instance state to it as to
|
|
12
|
-
* the object-oriented debug set, so a handle belongs to the server instance.
|
|
13
|
-
*/
|
|
14
|
-
const handlers_1 = require("@mcp-abap-adt/lib/handlers");
|
|
15
|
-
const handleHandlerDebugStart_1 = require("./handleHandlerDebugStart");
|
|
16
|
-
const handleHandlerDebugStep_1 = require("./handleHandlerDebugStep");
|
|
17
|
-
const handleHandlerDebugView_1 = require("./handleHandlerDebugView");
|
|
18
|
-
const handleHandlerDebugWait_1 = require("./handleHandlerDebugWait");
|
|
19
|
-
/**
|
|
20
|
-
* The four verbs, each paired with its handler by `defineTool`: the compiler
|
|
21
|
-
* checks that a handler takes what its schema declares. Every registration path
|
|
22
|
-
* hands a `(context, args)` handler the call's context.
|
|
23
|
-
*/
|
|
24
|
-
function compactDebugEntries() {
|
|
25
|
-
return [
|
|
26
|
-
(0, handlers_1.defineTool)(handleHandlerDebugStart_1.TOOL_DEFINITION, handleHandlerDebugStart_1.handleHandlerDebugStart),
|
|
27
|
-
(0, handlers_1.defineTool)(handleHandlerDebugWait_1.TOOL_DEFINITION, handleHandlerDebugWait_1.handleHandlerDebugWait),
|
|
28
|
-
(0, handlers_1.defineTool)(handleHandlerDebugView_1.TOOL_DEFINITION, handleHandlerDebugView_1.handleHandlerDebugView),
|
|
29
|
-
(0, handlers_1.defineTool)(handleHandlerDebugStep_1.TOOL_DEFINITION, handleHandlerDebugStep_1.handleHandlerDebugStep),
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
class CompactDebugHandlersGroup extends handlers_1.BaseHandlerGroup {
|
|
33
|
-
groupName = 'CompactDebugHandlers';
|
|
34
|
-
getHandlers() {
|
|
35
|
-
return compactDebugEntries();
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.CompactDebugHandlersGroup = CompactDebugHandlersGroup;
|
|
39
|
-
//# sourceMappingURL=group.js.map
|
package/dist/debug/group.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"group.js","sourceRoot":"","sources":["../../src/debug/group.ts"],"names":[],"mappings":";;;AAoCA,kDAOC;AA3CD;;;;;;;;GAQG;AACH,yDAIoC;AACpC,uEAGmC;AACnC,qEAGkC;AAClC,qEAGkC;AAClC,qEAGkC;AAElC;;;;GAIG;AACH,SAAgB,mBAAmB;IACjC,OAAO;QACL,IAAA,qBAAU,EAAC,yCAAsB,EAAE,iDAAuB,CAAC;QAC3D,IAAA,qBAAU,EAAC,wCAAqB,EAAE,+CAAsB,CAAC;QACzD,IAAA,qBAAU,EAAC,wCAAqB,EAAE,+CAAsB,CAAC;QACzD,IAAA,qBAAU,EAAC,wCAAqB,EAAE,+CAAsB,CAAC;KAC1D,CAAC;AACJ,CAAC;AAED,MAAa,yBAA0B,SAAQ,2BAAgB;IACnD,SAAS,GAAG,sBAAsB,CAAC;IAE7C,WAAW;QACT,OAAO,mBAAmB,EAAE,CAAC;IAC/B,CAAC;CACF;AAND,8DAMC"}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { ArgsOf, HandlerContext } from '@mcp-abap-adt/lib/handlers';
|
|
2
|
-
export declare const TOOL_DEFINITION: {
|
|
3
|
-
readonly name: "HandlerDebugStart";
|
|
4
|
-
readonly available_in: readonly ["onprem", "cloud"];
|
|
5
|
-
readonly description: `Debugger start. kind: abap (line, exception, statement or message breakpoints) or amdp (lines in SQLScript methods). Arms the breakpoints, listens (abap) or opens an AMDP session, and optionally runs a class or report in the background. request_user, debugging_mode and settings apply to abap only. take_over: abap \u2014 ${string}; amdp \u2014 ends an AMDP session of this user left behind. Without take_over, abap is refused before anything is placed while another debugger listens for that user. abap: ${string} abap: the breakpoints are one set, shared by every IDE of the same SAP user (in user mode, debugging the same request user; in terminal mode, whatever its ids), and each change replaces that set as a whole. amdp: catches every request of the connected SAP user, not only programs run by this server.`;
|
|
6
|
-
readonly inputSchema: {
|
|
7
|
-
readonly type: "object";
|
|
8
|
-
readonly properties: {
|
|
9
|
-
readonly detail: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly enum: readonly ["terse", "full", "raw"];
|
|
12
|
-
readonly default: "terse";
|
|
13
|
-
readonly description: "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).";
|
|
14
|
-
};
|
|
15
|
-
readonly run: {
|
|
16
|
-
readonly type: "object";
|
|
17
|
-
readonly description: "A class (as a console application) or a report started in the background once listening; its outcome is reported as the end of the session.";
|
|
18
|
-
readonly properties: {
|
|
19
|
-
readonly kind: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly enum: readonly ["class", "program"];
|
|
22
|
-
};
|
|
23
|
-
readonly name: {
|
|
24
|
-
readonly type: "string";
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
readonly required: readonly ["kind", "name"];
|
|
28
|
-
};
|
|
29
|
-
readonly settings: {
|
|
30
|
-
readonly type: "object";
|
|
31
|
-
readonly description: "Debugger settings, applied after each attach; a field left out keeps its value.";
|
|
32
|
-
readonly properties: {
|
|
33
|
-
readonly system_debugging: {
|
|
34
|
-
readonly type: "boolean";
|
|
35
|
-
readonly description: "Steps into system programs and stops at breakpoints there.";
|
|
36
|
-
};
|
|
37
|
-
readonly update_debugging: {
|
|
38
|
-
readonly type: "boolean";
|
|
39
|
-
readonly description: "Debugs update tasks.";
|
|
40
|
-
};
|
|
41
|
-
readonly create_exception_object: {
|
|
42
|
-
readonly type: "boolean";
|
|
43
|
-
readonly description: "Creates the exception object even where a CATCH does not ask for it.";
|
|
44
|
-
};
|
|
45
|
-
readonly background_rfc: {
|
|
46
|
-
readonly type: "boolean";
|
|
47
|
-
readonly description: "Debugs background RFC calls.";
|
|
48
|
-
};
|
|
49
|
-
readonly shared_object_debugging: {
|
|
50
|
-
readonly type: "boolean";
|
|
51
|
-
readonly description: "Debugs shared objects.";
|
|
52
|
-
};
|
|
53
|
-
};
|
|
54
|
-
};
|
|
55
|
-
readonly debugging_mode: {
|
|
56
|
-
readonly type: "string";
|
|
57
|
-
readonly enum: readonly ["user", "terminal"];
|
|
58
|
-
readonly description: "user (when omitted) catches the requests of the request user; terminal catches the requests that carry this debug session's ids and needs no configuration: the run it starts carries them, so without run it catches only requests carrying the same ids.";
|
|
59
|
-
};
|
|
60
|
-
readonly request_user: {
|
|
61
|
-
readonly type: "string";
|
|
62
|
-
readonly description: "User mode: the SAP user whose requests are caught; the connected user when omitted. Debugging another user's requests needs the debug authorization for that user. Not taken in terminal mode.";
|
|
63
|
-
};
|
|
64
|
-
readonly kind: {
|
|
65
|
-
readonly type: "string";
|
|
66
|
-
readonly enum: readonly ["abap", "amdp"];
|
|
67
|
-
readonly description: "abap debugs ABAP code; amdp debugs SQLScript methods of a class.";
|
|
68
|
-
};
|
|
69
|
-
readonly breakpoints: {
|
|
70
|
-
readonly minItems: 1;
|
|
71
|
-
readonly description: "abap: a line, an exception class, an ABAP statement or a message; a line breakpoint may carry a condition. amdp: object_name (the class) and line of each.";
|
|
72
|
-
readonly type: "array";
|
|
73
|
-
readonly items: {
|
|
74
|
-
readonly type: "object";
|
|
75
|
-
readonly properties: {
|
|
76
|
-
readonly exception_class: {
|
|
77
|
-
readonly type: "string";
|
|
78
|
-
readonly description: "Stops where an exception of this class is raised.";
|
|
79
|
-
};
|
|
80
|
-
readonly statement: {
|
|
81
|
-
readonly type: "string";
|
|
82
|
-
readonly description: "Stops at every ABAP statement of this keyword.";
|
|
83
|
-
};
|
|
84
|
-
readonly message: {
|
|
85
|
-
readonly type: "object";
|
|
86
|
-
readonly description: "Stops where this message is sent: message class, number, type.";
|
|
87
|
-
readonly properties: {
|
|
88
|
-
readonly id: {
|
|
89
|
-
readonly type: "string";
|
|
90
|
-
};
|
|
91
|
-
readonly number: {
|
|
92
|
-
readonly type: "string";
|
|
93
|
-
};
|
|
94
|
-
readonly type: {
|
|
95
|
-
readonly type: "string";
|
|
96
|
-
};
|
|
97
|
-
};
|
|
98
|
-
readonly required: readonly ["id", "number", "type"];
|
|
99
|
-
};
|
|
100
|
-
readonly condition: {
|
|
101
|
-
readonly type: "string";
|
|
102
|
-
readonly description: "A line breakpoint only: stops only when this ABAP condition holds.";
|
|
103
|
-
};
|
|
104
|
-
readonly object_type: {
|
|
105
|
-
readonly type: "string";
|
|
106
|
-
readonly description: "For a line: CLAS, PROG, INCL or FUNC.";
|
|
107
|
-
};
|
|
108
|
-
readonly object_name: {
|
|
109
|
-
readonly type: "string";
|
|
110
|
-
readonly description: "For a line: the object holding it.";
|
|
111
|
-
};
|
|
112
|
-
readonly line: {
|
|
113
|
-
readonly type: "integer";
|
|
114
|
-
readonly description: "For a line: the line in the object source.";
|
|
115
|
-
};
|
|
116
|
-
readonly include: {
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
readonly description: "For a class: definitions, implementations, macros or testclasses; the main source when omitted.";
|
|
119
|
-
};
|
|
120
|
-
readonly parent_name: {
|
|
121
|
-
readonly type: "string";
|
|
122
|
-
readonly description: "For a function module: its function group.";
|
|
123
|
-
};
|
|
124
|
-
};
|
|
125
|
-
};
|
|
126
|
-
};
|
|
127
|
-
readonly take_over: {
|
|
128
|
-
readonly type: "boolean";
|
|
129
|
-
readonly default: false;
|
|
130
|
-
readonly description: "abap: takes over from another debugger listening for this user instead of refusing; the breakpoints of this SAP user (in user mode, for the same request user) are replaced. amdp: ends an AMDP session of this user left behind instead of refusing.";
|
|
131
|
-
};
|
|
132
|
-
};
|
|
133
|
-
readonly required: readonly ["kind", "breakpoints"];
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
export declare function handleHandlerDebugStart(context: HandlerContext, args: ArgsOf<typeof TOOL_DEFINITION.inputSchema>): Promise<import("../../../dist/lib/answer").McpResult>;
|
|
137
|
-
//# sourceMappingURL=handleHandlerDebugStart.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugStart.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStart.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BlB,CAAC;AAEX,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDAoDjD"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOOL_DEFINITION = void 0;
|
|
4
|
-
exports.handleHandlerDebugStart = handleHandlerDebugStart;
|
|
5
|
-
const compact_shared_1 = require("@mcp-abap-adt/lib/compact-shared");
|
|
6
|
-
const debugger_1 = require("@mcp-abap-adt/lib/debugger");
|
|
7
|
-
const shared_1 = require("./shared");
|
|
8
|
-
exports.TOOL_DEFINITION = {
|
|
9
|
-
name: 'HandlerDebugStart',
|
|
10
|
-
available_in: ['onprem', 'cloud'],
|
|
11
|
-
description: `Debugger start. kind: abap (line, exception, statement or message breakpoints) or amdp (lines in SQLScript methods). Arms the breakpoints, listens (abap) or opens an AMDP session, and optionally runs a class or report in the background. request_user, debugging_mode and settings apply to abap only. take_over: abap — ${debugger_1.TAKE_OVER_SENTENCE.replace(/\.$/, '')}; amdp — ends an AMDP session of this user left behind. Without take_over, abap is refused before anything is placed while another debugger listens for that user. abap: ${debugger_1.USER_MODE_SENTENCE.replace(/^In/, 'in')} abap: ${debugger_1.SHARED_SET_FACT} amdp: ${debugger_1.AMDP_CATCH_FACT}`,
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
kind: {
|
|
16
|
-
type: 'string',
|
|
17
|
-
enum: ['abap', 'amdp'],
|
|
18
|
-
description: 'abap debugs ABAP code; amdp debugs SQLScript methods of a class.',
|
|
19
|
-
},
|
|
20
|
-
breakpoints: {
|
|
21
|
-
...debugger_1.BREAKPOINTS_PROPERTY.breakpoints,
|
|
22
|
-
minItems: 1,
|
|
23
|
-
description: 'abap: a line, an exception class, an ABAP statement or a message; a line breakpoint may carry a condition. amdp: object_name (the class) and line of each.',
|
|
24
|
-
},
|
|
25
|
-
take_over: {
|
|
26
|
-
type: 'boolean',
|
|
27
|
-
default: false,
|
|
28
|
-
description: 'abap: takes over from another debugger listening for this user instead of refusing; the breakpoints of this SAP user (in user mode, for the same request user) are replaced. amdp: ends an AMDP session of this user left behind instead of refusing.',
|
|
29
|
-
},
|
|
30
|
-
...debugger_1.START_PROPERTIES,
|
|
31
|
-
...debugger_1.RUN_PROPERTY,
|
|
32
|
-
...compact_shared_1.DETAIL_PROPERTY,
|
|
33
|
-
},
|
|
34
|
-
required: ['kind', 'breakpoints'],
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
async function handleHandlerDebugStart(context, args) {
|
|
38
|
-
if (args.kind === 'amdp') {
|
|
39
|
-
return (0, debugger_1.debugAnswer)(args, async () => {
|
|
40
|
-
// The identity and the settings are the ABAP debugger's; the AMDP session takes none.
|
|
41
|
-
if (args.request_user !== undefined ||
|
|
42
|
-
args.debugging_mode !== undefined ||
|
|
43
|
-
args.settings !== undefined)
|
|
44
|
-
throw new Error('request_user, debugging_mode and settings apply to kind abap only');
|
|
45
|
-
(0, shared_1.refuseOtherKind)(context, 'amdp');
|
|
46
|
-
const d = (0, debugger_1.requireDebugger)(context, args, { create: 'amdp' });
|
|
47
|
-
// The compact items name the class `object_name`; the session takes
|
|
48
|
-
// `class_name`. The schema serves both kinds, so it cannot require them.
|
|
49
|
-
const r = await d.amdp.start({
|
|
50
|
-
stopExisting: args.take_over ?? false,
|
|
51
|
-
breakpoints: (0, debugger_1.amdpBreakpointsFromArgs)(args.breakpoints.map((b, i) => {
|
|
52
|
-
if (!b.object_name || b.line === undefined)
|
|
53
|
-
throw new Error(`breakpoints[${i}]: object_name and line`);
|
|
54
|
-
return { class_name: b.object_name, line: b.line };
|
|
55
|
-
})),
|
|
56
|
-
run: (0, debugger_1.runFromArgs)(args.run),
|
|
57
|
-
});
|
|
58
|
-
return { value: r, raw: JSON.stringify(r) };
|
|
59
|
-
}, (v) => v, (v) => v, () => ({ state_handle: context.state.handle }), () => (0, debugger_1.heldStateHandle)(context));
|
|
60
|
-
}
|
|
61
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => {
|
|
62
|
-
(0, shared_1.refuseOtherKind)(context, 'abap');
|
|
63
|
-
const d = (0, debugger_1.requireDebugger)(context, args, { create: 'abap' });
|
|
64
|
-
return d.abap.start(args.take_over ? 'takeOver' : 'refuse', {
|
|
65
|
-
breakpoints: (0, debugger_1.breakpointsFromArgs)(args.breakpoints),
|
|
66
|
-
run: (0, debugger_1.runFromArgs)(args.run),
|
|
67
|
-
...(0, debugger_1.startOptionsFromArgs)(args),
|
|
68
|
-
});
|
|
69
|
-
}, () => (0, debugger_1.startedExtra)(context), () => (0, debugger_1.heldStateHandle)(context));
|
|
70
|
-
}
|
|
71
|
-
//# sourceMappingURL=handleHandlerDebugStart.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugStart.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStart.ts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,CAAC;QACjC,MAAM,CAAC,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,IAAI,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE;YAC1D,WAAW,EAAE,IAAA,8BAAmB,EAAC,IAAI,CAAC,WAAW,CAAC;YAClD,GAAG,EAAE,IAAA,sBAAW,EAAC,IAAI,CAAC,GAAG,CAAC;YAC1B,GAAG,IAAA,+BAAoB,EAAC,IAAI,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC,EACD,GAAG,EAAE,CAAC,IAAA,uBAAY,EAAC,OAAO,CAAC,EAC3B,GAAG,EAAE,CAAC,IAAA,0BAAe,EAAC,OAAO,CAAC,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ArgsOf, HandlerContext } from '@mcp-abap-adt/lib/handlers';
|
|
2
|
-
export declare const TOOL_DEFINITION: {
|
|
3
|
-
readonly name: "HandlerDebugStep";
|
|
4
|
-
readonly available_in: readonly ["onprem", "cloud"];
|
|
5
|
-
readonly description: "Moves the stopped debuggee (into, over, return, continue, run or jump to a line), leaves it running (detach, release_debugger), ends it where it stands, or ends the debug session.";
|
|
6
|
-
readonly inputSchema: {
|
|
7
|
-
readonly type: "object";
|
|
8
|
-
readonly properties: {
|
|
9
|
-
readonly detail: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly enum: readonly ["terse", "full", "raw"];
|
|
12
|
-
readonly default: "terse";
|
|
13
|
-
readonly description: "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).";
|
|
14
|
-
};
|
|
15
|
-
readonly object_type: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly description: "For a line: CLAS, PROG, INCL or FUNC.";
|
|
18
|
-
};
|
|
19
|
-
readonly object_name: {
|
|
20
|
-
readonly type: "string";
|
|
21
|
-
readonly description: "For a line: the object holding it.";
|
|
22
|
-
};
|
|
23
|
-
readonly line: {
|
|
24
|
-
readonly type: "integer";
|
|
25
|
-
readonly description: "For a line: the line in the object source.";
|
|
26
|
-
};
|
|
27
|
-
readonly include: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
readonly description: "For a class: definitions, implementations, macros or testclasses; the main source when omitted.";
|
|
30
|
-
};
|
|
31
|
-
readonly parent_name: {
|
|
32
|
-
readonly type: "string";
|
|
33
|
-
readonly description: "For a function module: its function group.";
|
|
34
|
-
};
|
|
35
|
-
readonly action: {
|
|
36
|
-
readonly type: "string";
|
|
37
|
-
readonly enum: readonly ["into", "over", "return", "continue", "run_to_line", "jump_to_line", "detach", "release_debugger", "terminate", "stop"];
|
|
38
|
-
readonly description: "into enters the call, over runs it, return leaves the current one, continue runs to the next stop; run_to_line executes up to the line, jump_to_line moves there without executing what lies between; detach lets the program run on, the listener and the breakpoints kept; release_debugger frees the debugger and the program runs on; terminate ends the debuggee where it stands; stop ends the debug session. For AMDP only over, continue, terminate and stop apply.";
|
|
39
|
-
};
|
|
40
|
-
readonly state_handle: {
|
|
41
|
-
readonly type: "string";
|
|
42
|
-
readonly description: "Opaque handle identifying the server-held state this operation works on.";
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
readonly required: readonly ["state_handle", "action"];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
export declare function handleHandlerDebugStep(context: HandlerContext, args: ArgsOf<typeof TOOL_DEFINITION.inputSchema>): Promise<import("../../../dist/lib/answer").McpResult>;
|
|
49
|
-
//# sourceMappingURL=handleHandlerDebugStep.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugStep.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStep.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BlB,CAAC;AAYX,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDAoGjD"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOOL_DEFINITION = void 0;
|
|
4
|
-
exports.handleHandlerDebugStep = handleHandlerDebugStep;
|
|
5
|
-
const compact_shared_1 = require("@mcp-abap-adt/lib/compact-shared");
|
|
6
|
-
const debugger_1 = require("@mcp-abap-adt/lib/debugger");
|
|
7
|
-
const shared_1 = require("./shared");
|
|
8
|
-
exports.TOOL_DEFINITION = {
|
|
9
|
-
name: 'HandlerDebugStep',
|
|
10
|
-
available_in: ['onprem', 'cloud'],
|
|
11
|
-
description: 'Moves the stopped debuggee (into, over, return, continue, run or jump to a line), leaves it running (detach, release_debugger), ends it where it stands, or ends the debug session.',
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
...debugger_1.STATE_HANDLE_PROPERTY,
|
|
16
|
-
action: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
enum: [
|
|
19
|
-
'into',
|
|
20
|
-
'over',
|
|
21
|
-
'return',
|
|
22
|
-
'continue',
|
|
23
|
-
'run_to_line',
|
|
24
|
-
'jump_to_line',
|
|
25
|
-
'detach',
|
|
26
|
-
'release_debugger',
|
|
27
|
-
'terminate',
|
|
28
|
-
'stop',
|
|
29
|
-
],
|
|
30
|
-
description: 'into enters the call, over runs it, return leaves the current one, continue runs to the next stop; run_to_line executes up to the line, jump_to_line moves there without executing what lies between; detach lets the program run on, the listener and the breakpoints kept; release_debugger frees the debugger and the program runs on; terminate ends the debuggee where it stands; stop ends the debug session. For AMDP only over, continue, terminate and stop apply.',
|
|
31
|
-
},
|
|
32
|
-
...debugger_1.LINE_TARGET_PROPERTIES,
|
|
33
|
-
...compact_shared_1.DETAIL_PROPERTY,
|
|
34
|
-
},
|
|
35
|
-
required: ['state_handle', 'action'],
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
const STEPS = {
|
|
39
|
-
into: 'stepInto',
|
|
40
|
-
over: 'stepOver',
|
|
41
|
-
return: 'stepReturn',
|
|
42
|
-
continue: 'stepContinue',
|
|
43
|
-
};
|
|
44
|
-
const isStep = (action) => action in STEPS;
|
|
45
|
-
async function handleHandlerDebugStep(context, args) {
|
|
46
|
-
const action = args.action;
|
|
47
|
-
// The state ends once nothing is held; both kinds are stopped by the instance.
|
|
48
|
-
const stopped = (d) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
49
|
-
context.state.endWhenEmpty();
|
|
50
|
-
// A note is no debt: SAP's final refusal, reaching the model as it is.
|
|
51
|
-
const notes = await d.stop();
|
|
52
|
-
return {
|
|
53
|
-
value: { state: 'stopped', ...(notes.length ? { notes } : {}) },
|
|
54
|
-
raw: notes.join('\n'),
|
|
55
|
-
};
|
|
56
|
-
}, (v) => v);
|
|
57
|
-
const refused = (kind) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
58
|
-
throw new Error(`action: ${action} does not apply to an ${kind} debug session`);
|
|
59
|
-
}, (v) => v);
|
|
60
|
-
return (0, shared_1.branchByKind)(context, args, {
|
|
61
|
-
amdp: (d) => {
|
|
62
|
-
if (action === 'over' || action === 'continue') {
|
|
63
|
-
return (0, debugger_1.debugAnswer)(args, async () => d.amdp.step(action), (v) => ({ state: v }));
|
|
64
|
-
}
|
|
65
|
-
if (action === 'terminate') {
|
|
66
|
-
return (0, debugger_1.debugAnswer)(args, async () => {
|
|
67
|
-
await d.amdp.cancel();
|
|
68
|
-
return { value: 'cancelled', raw: '' };
|
|
69
|
-
}, (v) => v);
|
|
70
|
-
}
|
|
71
|
-
if (action === 'stop')
|
|
72
|
-
return stopped(d);
|
|
73
|
-
return refused('amdp');
|
|
74
|
-
},
|
|
75
|
-
abap: (d) => {
|
|
76
|
-
if (isStep(action)) {
|
|
77
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.step(STEPS[action]));
|
|
78
|
-
}
|
|
79
|
-
if (action === 'run_to_line' || action === 'jump_to_line') {
|
|
80
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => {
|
|
81
|
-
// The schema cannot tie line to these two actions.
|
|
82
|
-
const line = args.line;
|
|
83
|
-
if (line === undefined)
|
|
84
|
-
throw new Error(`line: needed for ${action}`);
|
|
85
|
-
let target;
|
|
86
|
-
if (args.object_type && args.object_name) {
|
|
87
|
-
target = {
|
|
88
|
-
object_type: args.object_type,
|
|
89
|
-
object_name: args.object_name,
|
|
90
|
-
include: args.include,
|
|
91
|
-
parent_name: args.parent_name,
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
// No object given: the line is in the object the debuggee stands in.
|
|
96
|
-
const top = (await d.abap.getStack()).value.stack.frames[0];
|
|
97
|
-
const here = top ? (0, debugger_1.addressOf)(top.uri) : undefined;
|
|
98
|
-
if (!here)
|
|
99
|
-
throw new Error('object_type and object_name: needed, the stopped frame has no object address');
|
|
100
|
-
target = here;
|
|
101
|
-
}
|
|
102
|
-
return d.abap.stepToLine(action === 'jump_to_line' ? 'stepJumpToLine' : 'stepRunToLine', (0, debugger_1.lineUriOf)(target, line));
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
if (action === 'detach')
|
|
106
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.detach());
|
|
107
|
-
if (action === 'release_debugger')
|
|
108
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.releaseDebugger());
|
|
109
|
-
if (action === 'terminate') {
|
|
110
|
-
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.terminate());
|
|
111
|
-
}
|
|
112
|
-
if (action === 'stop')
|
|
113
|
-
return stopped(d);
|
|
114
|
-
return refused('abap');
|
|
115
|
-
},
|
|
116
|
-
}, (0, shared_1.failedAnswer)(args));
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=handleHandlerDebugStep.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugStep.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStep.ts"],"names":[],"mappings":";;;AAyDA,wDAsGC;AA/JD,qEAAmE;AACnE,yDASoC;AAEpC,qCAAsD;AAEzC,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,WAAW,EACT,qLAAqL;IACvL,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,gCAAqB;YACxB,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE;oBACJ,MAAM;oBACN,MAAM;oBACN,QAAQ;oBACR,UAAU;oBACV,aAAa;oBACb,cAAc;oBACd,QAAQ;oBACR,kBAAkB;oBAClB,WAAW;oBACX,MAAM;iBACP;gBACD,WAAW,EACT,6cAA6c;aAChd;YACD,GAAG,iCAAsB;YACzB,GAAG,gCAAe;SACnB;QACD,QAAQ,EAAE,CAAC,cAAc,EAAE,QAAQ,CAAC;KACrC;CACO,CAAC;AAEX,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,YAAY;IACpB,QAAQ,EAAE,cAAc;CAChB,CAAC;AAEX,MAAM,MAAM,GAAG,CAAC,MAAc,EAAgC,EAAE,CAC9D,MAAM,IAAI,KAAK,CAAC;AAEX,KAAK,UAAU,sBAAsB,CAC1C,OAAuB,EACvB,IAAgD;IAEhD,MAAM,MAAM,GAAG,IAAI,CAAC,M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AAI,CAAC,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { ArgsOf, HandlerContext } from '@mcp-abap-adt/lib/handlers';
|
|
2
|
-
export declare const TOOL_DEFINITION: {
|
|
3
|
-
readonly name: "HandlerDebugView";
|
|
4
|
-
readonly available_in: readonly ["onprem", "cloud"];
|
|
5
|
-
readonly description: "The stopped debuggee: stack, variables (by name, or the scopes), memory, or an AMDP table variable's rows.";
|
|
6
|
-
readonly inputSchema: {
|
|
7
|
-
readonly type: "object";
|
|
8
|
-
readonly properties: {
|
|
9
|
-
readonly detail: {
|
|
10
|
-
readonly type: "string";
|
|
11
|
-
readonly enum: readonly ["terse", "full", "raw"];
|
|
12
|
-
readonly default: "terse";
|
|
13
|
-
readonly description: "How much of the answer to return: \"terse\" (default, the fields you need to act), \"full\" (the whole parse), \"raw\" (the document as ADT sent it).";
|
|
14
|
-
};
|
|
15
|
-
readonly what: {
|
|
16
|
-
readonly type: "string";
|
|
17
|
-
readonly enum: readonly ["stack", "variables", "memory", "table"];
|
|
18
|
-
readonly description: "stack, variables and memory read an ABAP stop; table reads an AMDP stop.";
|
|
19
|
-
};
|
|
20
|
-
readonly names: {
|
|
21
|
-
readonly type: "array";
|
|
22
|
-
readonly items: {
|
|
23
|
-
readonly type: "string";
|
|
24
|
-
};
|
|
25
|
-
readonly description: "variables: names to read, a path reads a component or a table row; the scopes when omitted. table: the table variable, first entry.";
|
|
26
|
-
};
|
|
27
|
-
readonly state_handle: {
|
|
28
|
-
readonly type: "string";
|
|
29
|
-
readonly description: "Opaque handle identifying the server-held state this operation works on.";
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
readonly required: readonly ["state_handle", "what"];
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
export declare function handleHandlerDebugView(context: HandlerContext, args: ArgsOf<typeof TOOL_DEFINITION.inputSchema>): Promise<import("../../../dist/lib/answer").McpResult>;
|
|
36
|
-
//# sourceMappingURL=handleHandlerDebugView.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugView.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugView.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyBlB,CAAC;AAEX,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDA0EjD"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TOOL_DEFINITION = void 0;
|
|
4
|
-
exports.handleHandlerDebugView = handleHandlerDebugView;
|
|
5
|
-
const compact_shared_1 = require("@mcp-abap-adt/lib/compact-shared");
|
|
6
|
-
const debugger_1 = require("@mcp-abap-adt/lib/debugger");
|
|
7
|
-
const shared_1 = require("./shared");
|
|
8
|
-
exports.TOOL_DEFINITION = {
|
|
9
|
-
name: 'HandlerDebugView',
|
|
10
|
-
available_in: ['onprem', 'cloud'],
|
|
11
|
-
description: "The stopped debuggee: stack, variables (by name, or the scopes), memory, or an AMDP table variable's rows.",
|
|
12
|
-
inputSchema: {
|
|
13
|
-
type: 'object',
|
|
14
|
-
properties: {
|
|
15
|
-
...debugger_1.STATE_HANDLE_PROPERTY,
|
|
16
|
-
what: {
|
|
17
|
-
type: 'string',
|
|
18
|
-
enum: ['stack', 'variables', 'memory', 'table'],
|
|
19
|
-
description: 'stack, variables and memory read an ABAP stop; table reads an AMDP stop.',
|
|
20
|
-
},
|
|
21
|
-
names: {
|
|
22
|
-
type: 'array',
|
|
23
|
-
items: { type: 'string' },
|
|
24
|
-
description: 'variables: names to read, a path reads a component or a table row; the scopes when omitted. table: the table variable, first entry.',
|
|
25
|
-
},
|
|
26
|
-
...compact_shared_1.DETAIL_PROPERTY,
|
|
27
|
-
},
|
|
28
|
-
required: ['state_handle', 'what'],
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
async function handleHandlerDebugView(context, args) {
|
|
32
|
-
const wrongKind = (kind) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
33
|
-
throw new Error(`what: ${args.what} does not apply to an ${kind} debug session`);
|
|
34
|
-
}, (v) => v);
|
|
35
|
-
return (0, shared_1.branchByKind)(context, args, {
|
|
36
|
-
amdp: (d) => {
|
|
37
|
-
if (args.what !== 'table')
|
|
38
|
-
return wrongKind('amdp');
|
|
39
|
-
return (0, debugger_1.debugAnswer)(args, async () => {
|
|
40
|
-
// The schema cannot tie names to what: a table needs its first entry.
|
|
41
|
-
const name = args.names?.[0];
|
|
42
|
-
if (!name?.trim())
|
|
43
|
-
throw new Error('names: the table variable to read, first entry');
|
|
44
|
-
return d.amdp.getTable(name);
|
|
45
|
-
}, (v) => v.rows);
|
|
46
|
-
},
|
|
47
|
-
abap: (d) => {
|
|
48
|
-
switch (args.what) {
|
|
49
|
-
case 'stack':
|
|
50
|
-
return (0, debugger_1.debugAnswer)(args, async () => d.abap.getStack(), (stop) => (0, debugger_1.terseStop)(stop.debuggee, stop.stack, stop.attach));
|
|
51
|
-
case 'variables': {
|
|
52
|
-
const names = args.names?.length ? args.names : undefined;
|
|
53
|
-
const byName = names !== undefined;
|
|
54
|
-
return (0, debugger_1.debugAnswer)(args, async () => names
|
|
55
|
-
? d.abap.getVariables(names)
|
|
56
|
-
: d.abap.getChildVariables(['@ROOT']), (v) => {
|
|
57
|
-
if (byName)
|
|
58
|
-
return (0, debugger_1.terseVariables)(v);
|
|
59
|
-
// Every member keeps the id a further read takes as a parent.
|
|
60
|
-
const variables = new Map((0, debugger_1.terseVariables)(v).map((t) => [t.id, t]));
|
|
61
|
-
return v.children.map((c) => variables.get(c.child) ?? { id: c.child, label: c.label });
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
case 'memory':
|
|
65
|
-
return (0, debugger_1.debugAnswer)(args, async () => d.abap.getMemorySizes(), (xml) => (0, debugger_1.terseMemorySizes)((0, debugger_1.readMemorySizes)(xml)), debugger_1.readXmlDocument);
|
|
66
|
-
default:
|
|
67
|
-
return wrongKind('abap');
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
}, (0, shared_1.failedAnswer)(args));
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=handleHandlerDebugView.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"handleHandlerDebugView.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugView.ts"],"names":[],"mappings":";;;AAwCA,wDA4EC;AApHD,qEAAmE;AACnE,yDAQoC;AAEpC,qCAAsD;AAEzC,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,WAAW,EACT,4GAA4G;IAC9G,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,GAAG,gCAAqB;YACxB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,CAAC;gBAC/C,WAAW,EACT,0EAA0E;aAC7E;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACzB,WAAW,EACT,qIAAqI;aACxI;YACD,GAAG,gCAAe;SACnB;QACD,QAAQ,EAAE,CAAC,cAAc,EAAE,MAAM,CAAC;KACnC;CACO,CAAC;AAEJ,KAAK,UAAU,sBAAsB,CAC1C,OAAuB,EACvB,IAAgD;IAEhD,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,EAAE,CACjC,IAAA,sBAAW,EACT,IAAI,E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