@mcp-abap-adt/compact 17.1.0 → 17.2.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 +12 -1
- package/bin/mcp-abap-adt-compact.js +2 -1
- package/dist/debug/group.d.ts +21 -0
- package/dist/debug/group.d.ts.map +1 -0
- package/dist/debug/group.js +39 -0
- package/dist/debug/group.js.map +1 -0
- package/dist/debug/handleHandlerDebugStart.d.ts +102 -0
- package/dist/debug/handleHandlerDebugStart.d.ts.map +1 -0
- package/dist/debug/handleHandlerDebugStart.js +68 -0
- package/dist/debug/handleHandlerDebugStart.js.map +1 -0
- package/dist/debug/handleHandlerDebugStep.d.ts +49 -0
- package/dist/debug/handleHandlerDebugStep.d.ts.map +1 -0
- package/dist/debug/handleHandlerDebugStep.js +108 -0
- package/dist/debug/handleHandlerDebugStep.js.map +1 -0
- package/dist/debug/handleHandlerDebugView.d.ts +36 -0
- package/dist/debug/handleHandlerDebugView.d.ts.map +1 -0
- package/dist/debug/handleHandlerDebugView.js +72 -0
- package/dist/debug/handleHandlerDebugView.js.map +1 -0
- package/dist/debug/handleHandlerDebugWait.d.ts +29 -0
- package/dist/debug/handleHandlerDebugWait.d.ts.map +1 -0
- package/dist/debug/handleHandlerDebugWait.js +39 -0
- package/dist/debug/handleHandlerDebugWait.js.map +1 -0
- package/dist/debug/shared.d.ts +23 -0
- package/dist/debug/shared.d.ts.map +1 -0
- package/dist/debug/shared.js +45 -0
- package/dist/debug/shared.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/launcher.d.ts +18 -12
- package/dist/launcher.d.ts.map +1 -1
- package/dist/launcher.js +71 -31
- package/dist/launcher.js.map +1 -1
- package/docs/AVAILABLE_TOOLS.md +67 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @mcp-abap-adt/compact
|
|
2
2
|
|
|
3
|
-
The compact MCP server — the command that serves all 25.
|
|
3
|
+
The compact MCP server — the command that serves all 25, and the four debugger verbs on request.
|
|
4
4
|
|
|
5
5
|
## What compact is
|
|
6
6
|
|
|
@@ -33,6 +33,7 @@ smaller install, and it is not a sandbox — code that deliberately reaches into
|
|
|
33
33
|
npm install -g @mcp-abap-adt/compact
|
|
34
34
|
mcp-abap-adt-compact # stdio, all 25 compact tools
|
|
35
35
|
mcp-abap-adt-compact --exposition=ro # the 16 that change nothing
|
|
36
|
+
mcp-abap-adt-compact --exposition=rw,debug # all 25 and the four debugger verbs
|
|
36
37
|
mcp-abap-adt-compact --version
|
|
37
38
|
```
|
|
38
39
|
|
|
@@ -42,6 +43,16 @@ update, delete, activate, lock, unlock, unit-test run or profiler run is in the
|
|
|
42
43
|
list at all, so a client cannot call one). The object-oriented sets
|
|
43
44
|
`readonly`/`high`/`low` belong to `mcp-abap-adt` and are refused here by name.
|
|
44
45
|
|
|
46
|
+
**The debugger is opt-in.** `debug` beside `ro` or `rw` (`--exposition=ro,debug`)
|
|
47
|
+
adds four verbs: `HandlerDebugStart` (`kind: abap|amdp`, the breakpoints, `take_over`,
|
|
48
|
+
an optional background `run`; answers a `state_handle`), `HandlerDebugWait`,
|
|
49
|
+
`HandlerDebugView` (stack, variables, memory, an AMDP table) and `HandlerDebugStep`
|
|
50
|
+
(the steps, `terminate`, and `stop`, which ends the session). `debug` alone is
|
|
51
|
+
refused: it names no half of the facade, and taking `rw` for it would open the write
|
|
52
|
+
tools unasked. A breakpoint catches every request of the connected SAP user, which
|
|
53
|
+
is why the verbs are never served by default. What a debug session is, what keeps it
|
|
54
|
+
alive on each transport and what ends it: [Debugger](https://github.com/fr0ster/mcp-abap-adt/blob/main/docs/user-guide/DEBUGGER.md).
|
|
55
|
+
|
|
45
56
|
Configuration — connection, authentication, transports — is the same as
|
|
46
57
|
`mcp-abap-adt`'s, because the launcher is the same one: this command passes its own
|
|
47
58
|
tool list to `@mcp-abap-adt/core`'s launcher rather than reimplementing it. The
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Starts the server in THIS process so stdin/stdout stay wired to the MCP protocol
|
|
7
7
|
* with no intermediate layer, exactly as `mcp-abap-adt` does. The tool list is the
|
|
8
|
-
* compact facade's
|
|
8
|
+
* compact facade's tools and nothing else: 25 with `rw`, the 16 that change nothing
|
|
9
|
+
* with `ro`, and four debug verbs beside either with `debug`.
|
|
9
10
|
*/
|
|
10
11
|
const { main } = require('../dist/launcher.js');
|
|
11
12
|
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,102 @@
|
|
|
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. take_over: abap \u2014 ${string}; amdp \u2014 ends an AMDP session of this user left behind. 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 kind: {
|
|
30
|
+
readonly type: "string";
|
|
31
|
+
readonly enum: readonly ["abap", "amdp"];
|
|
32
|
+
readonly description: "abap debugs ABAP code; amdp debugs SQLScript methods of a class.";
|
|
33
|
+
};
|
|
34
|
+
readonly breakpoints: {
|
|
35
|
+
readonly minItems: 1;
|
|
36
|
+
readonly description: "abap: a line, an exception class, an ABAP statement or a message, each with an optional condition. amdp: object_name (the class) and line of each.";
|
|
37
|
+
readonly type: "array";
|
|
38
|
+
readonly items: {
|
|
39
|
+
readonly type: "object";
|
|
40
|
+
readonly properties: {
|
|
41
|
+
readonly exception_class: {
|
|
42
|
+
readonly type: "string";
|
|
43
|
+
readonly description: "Stops where an exception of this class is raised.";
|
|
44
|
+
};
|
|
45
|
+
readonly statement: {
|
|
46
|
+
readonly type: "string";
|
|
47
|
+
readonly description: "Stops at every ABAP statement of this keyword.";
|
|
48
|
+
};
|
|
49
|
+
readonly message: {
|
|
50
|
+
readonly type: "object";
|
|
51
|
+
readonly description: "Stops where this message is sent: message class, number, type.";
|
|
52
|
+
readonly properties: {
|
|
53
|
+
readonly id: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
};
|
|
56
|
+
readonly number: {
|
|
57
|
+
readonly type: "string";
|
|
58
|
+
};
|
|
59
|
+
readonly type: {
|
|
60
|
+
readonly type: "string";
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
readonly required: readonly ["id", "number", "type"];
|
|
64
|
+
};
|
|
65
|
+
readonly condition: {
|
|
66
|
+
readonly type: "string";
|
|
67
|
+
readonly description: "Stops only when this ABAP condition holds.";
|
|
68
|
+
};
|
|
69
|
+
readonly object_type: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
readonly description: "For a line: CLAS, PROG, INCL or FUNC.";
|
|
72
|
+
};
|
|
73
|
+
readonly object_name: {
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
readonly description: "For a line: the object holding it.";
|
|
76
|
+
};
|
|
77
|
+
readonly line: {
|
|
78
|
+
readonly type: "integer";
|
|
79
|
+
readonly description: "For a line: the line in the object source.";
|
|
80
|
+
};
|
|
81
|
+
readonly include: {
|
|
82
|
+
readonly type: "string";
|
|
83
|
+
readonly description: "For a class: definitions, implementations, macros or testclasses; the main source when omitted.";
|
|
84
|
+
};
|
|
85
|
+
readonly parent_name: {
|
|
86
|
+
readonly type: "string";
|
|
87
|
+
readonly description: "For a function module: its function group.";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
readonly take_over: {
|
|
93
|
+
readonly type: "boolean";
|
|
94
|
+
readonly default: false;
|
|
95
|
+
readonly description: "Takes over from an existing debugger of this user instead of refusing.";
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
readonly required: readonly ["kind", "breakpoints"];
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
export declare function handleHandlerDebugStart(context: HandlerContext, args: ArgsOf<typeof TOOL_DEFINITION.inputSchema>): Promise<import("../../../dist/lib/answer").McpResult>;
|
|
102
|
+
//# sourceMappingURL=handleHandlerDebugStart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugStart.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStart.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BlB,CAAC;AAEX,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDA8CjD"}
|
|
@@ -0,0 +1,68 @@
|
|
|
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. take_over: abap — ${debugger_1.TAKE_OVER_SENTENCE.replace(/\.$/, '')}; amdp — ends an AMDP session of this user left behind. ${debugger_1.USER_MODE_SENTENCE}`,
|
|
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, each with an optional condition. amdp: object_name (the class) and line of each.',
|
|
24
|
+
},
|
|
25
|
+
take_over: {
|
|
26
|
+
type: 'boolean',
|
|
27
|
+
default: false,
|
|
28
|
+
description: 'Takes over from an existing debugger of this user instead of refusing.',
|
|
29
|
+
},
|
|
30
|
+
...debugger_1.RUN_PROPERTY,
|
|
31
|
+
...compact_shared_1.DETAIL_PROPERTY,
|
|
32
|
+
},
|
|
33
|
+
required: ['kind', 'breakpoints'],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
async function handleHandlerDebugStart(context, args) {
|
|
37
|
+
if (args.kind === 'amdp') {
|
|
38
|
+
return (0, debugger_1.debugAnswer)(args, async () => {
|
|
39
|
+
(0, shared_1.refuseOtherKind)(context, 'amdp');
|
|
40
|
+
const d = (0, debugger_1.requireDebugger)(context, args, { create: 'amdp' });
|
|
41
|
+
// The compact items name the class `object_name`; the session takes
|
|
42
|
+
// `class_name`. The schema serves both kinds, so it cannot require them.
|
|
43
|
+
const r = await d.amdp.start({
|
|
44
|
+
stopExisting: args.take_over ?? false,
|
|
45
|
+
breakpoints: (0, debugger_1.amdpBreakpointsFromArgs)(args.breakpoints.map((b, i) => {
|
|
46
|
+
if (!b.object_name || b.line === undefined)
|
|
47
|
+
throw new Error(`breakpoints[${i}]: object_name and line`);
|
|
48
|
+
return { class_name: b.object_name, line: b.line };
|
|
49
|
+
})),
|
|
50
|
+
run: (0, debugger_1.runFromArgs)(args.run),
|
|
51
|
+
});
|
|
52
|
+
return { value: r, raw: JSON.stringify(r) };
|
|
53
|
+
}, (v) => v, (v) => v, () => ({ state_handle: context.state.handle }), () => (0, debugger_1.heldStateHandle)(context));
|
|
54
|
+
}
|
|
55
|
+
return (0, debugger_1.debugStateAnswer)(args, async () => {
|
|
56
|
+
(0, shared_1.refuseOtherKind)(context, 'abap');
|
|
57
|
+
const d = (0, debugger_1.requireDebugger)(context, args, { create: 'abap' });
|
|
58
|
+
return d.abap.start(args.take_over ? 'takeOver' : 'refuse', {
|
|
59
|
+
breakpoints: (0, debugger_1.breakpointsFromArgs)(args.breakpoints),
|
|
60
|
+
run: (0, debugger_1.runFromArgs)(args.run),
|
|
61
|
+
});
|
|
62
|
+
}, () => ({
|
|
63
|
+
state_handle: context.state.handle,
|
|
64
|
+
terminal_id: context.debugger().abap.ids.terminalId,
|
|
65
|
+
ide_id: context.debugger().abap.ids.ideId,
|
|
66
|
+
}), () => (0, debugger_1.heldStateHandle)(context));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=handleHandlerDebugStart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugStart.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStart.ts"],"names":[],"mappings":";;;AAiDA,0DAgDC;AAjGD,qEAAmE;AACnE,yDAYoC;AAEpC,qCAA2C;AAE9B,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,WAAW,EAAE,kQAAkQ,6BAAkB,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,2DAA2D,6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UAAU;QACpD,MAAM,EAAE,OAAO,CAAC,QAAS,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK;KAC3C,CAAC,EACF,GAAG,EAAE,CAAC,IAAA,0BAAe,EAAC,OAAO,CAAC,CAC/B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
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), 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", "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; 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
|
|
@@ -0,0 +1 @@
|
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BlB,CAAC;AAYX,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDA4FjD"}
|
|
@@ -0,0 +1,108 @@
|
|
|
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), 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
|
+
'terminate',
|
|
26
|
+
'stop',
|
|
27
|
+
],
|
|
28
|
+
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; terminate ends the debuggee where it stands; stop ends the debug session. For AMDP only over, continue, terminate and stop apply.',
|
|
29
|
+
},
|
|
30
|
+
...debugger_1.LINE_TARGET_PROPERTIES,
|
|
31
|
+
...compact_shared_1.DETAIL_PROPERTY,
|
|
32
|
+
},
|
|
33
|
+
required: ['state_handle', 'action'],
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
const STEPS = {
|
|
37
|
+
into: 'stepInto',
|
|
38
|
+
over: 'stepOver',
|
|
39
|
+
return: 'stepReturn',
|
|
40
|
+
continue: 'stepContinue',
|
|
41
|
+
};
|
|
42
|
+
const isStep = (action) => action in STEPS;
|
|
43
|
+
async function handleHandlerDebugStep(context, args) {
|
|
44
|
+
const action = args.action;
|
|
45
|
+
// The state ends once nothing is held; both kinds are stopped by the instance.
|
|
46
|
+
const stopped = (d) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
47
|
+
context.state.endWhenEmpty();
|
|
48
|
+
await d.stop();
|
|
49
|
+
return { value: { state: 'stopped' }, raw: '' };
|
|
50
|
+
}, (v) => v);
|
|
51
|
+
const refused = (kind) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
52
|
+
throw new Error(`action: ${action} does not apply to an ${kind} debug session`);
|
|
53
|
+
}, (v) => v);
|
|
54
|
+
return (0, shared_1.branchByKind)(context, args, {
|
|
55
|
+
amdp: (d) => {
|
|
56
|
+
if (action === 'over' || action === 'continue') {
|
|
57
|
+
return (0, debugger_1.debugAnswer)(args, async () => d.amdp.step(action), (v) => ({ state: v }));
|
|
58
|
+
}
|
|
59
|
+
if (action === 'terminate') {
|
|
60
|
+
return (0, debugger_1.debugAnswer)(args, async () => {
|
|
61
|
+
await d.amdp.cancel();
|
|
62
|
+
return { value: 'cancelled', raw: '' };
|
|
63
|
+
}, (v) => v);
|
|
64
|
+
}
|
|
65
|
+
if (action === 'stop')
|
|
66
|
+
return stopped(d);
|
|
67
|
+
return refused('amdp');
|
|
68
|
+
},
|
|
69
|
+
abap: (d) => {
|
|
70
|
+
if (isStep(action)) {
|
|
71
|
+
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.step(STEPS[action]));
|
|
72
|
+
}
|
|
73
|
+
if (action === 'run_to_line' || action === 'jump_to_line') {
|
|
74
|
+
return (0, debugger_1.debugStateAnswer)(args, async () => {
|
|
75
|
+
// The schema cannot tie line to these two actions.
|
|
76
|
+
const line = args.line;
|
|
77
|
+
if (line === undefined)
|
|
78
|
+
throw new Error(`line: needed for ${action}`);
|
|
79
|
+
let target;
|
|
80
|
+
if (args.object_type && args.object_name) {
|
|
81
|
+
target = {
|
|
82
|
+
object_type: args.object_type,
|
|
83
|
+
object_name: args.object_name,
|
|
84
|
+
include: args.include,
|
|
85
|
+
parent_name: args.parent_name,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
// No object given: the line is in the object the debuggee stands in.
|
|
90
|
+
const top = (await d.abap.getStack()).value.stack.frames[0];
|
|
91
|
+
const here = top ? (0, debugger_1.addressOf)(top.uri) : undefined;
|
|
92
|
+
if (!here)
|
|
93
|
+
throw new Error('object_type and object_name: needed, the stopped frame has no object address');
|
|
94
|
+
target = here;
|
|
95
|
+
}
|
|
96
|
+
return d.abap.stepToLine(action === 'jump_to_line' ? 'stepJumpToLine' : 'stepRunToLine', (0, debugger_1.lineUriOf)(target, line));
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
if (action === 'terminate') {
|
|
100
|
+
return (0, debugger_1.debugStateAnswer)(args, async () => d.abap.terminate());
|
|
101
|
+
}
|
|
102
|
+
if (action === 'stop')
|
|
103
|
+
return stopped(d);
|
|
104
|
+
return refused('abap');
|
|
105
|
+
},
|
|
106
|
+
}, (0, shared_1.failedAnswer)(args));
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=handleHandlerDebugStep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugStep.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugStep.ts"],"names":[],"mappings":";;;AAuDA,wDA8FC;AArJD,qEAAmE;AACnE,yDASoC;AAEpC,qCAAsD;AAEzC,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,CAAC,QAAQ,EAAE,OAAO,CAAU;IAC1C,WAAW,EACT,uIAAuI;IACzI,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,WAAW;oBACX,MAAM;iBACP;gBACD,WAAW,EACT,yUAAyU;aAC5U;YACD,GAAG,iCAAsB;YACzB,GAAG,gCAAe;SACnB;QACD,QAAQ,EAAE,CAAC,cAAc,EAAE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+
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugView.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugView.ts"],"names":[],"mappings":"AAQA,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"}
|
|
@@ -0,0 +1,72 @@
|
|
|
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(), debugger_1.readXmlDocument, debugger_1.readXmlDocument);
|
|
66
|
+
default:
|
|
67
|
+
return wrongKind('abap');
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
}, (0, shared_1.failedAnswer)(args));
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=handleHandlerDebugView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugView.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugView.ts"],"names":[],"mappings":";;;AAsCA,wDA4EC;AAlHD,qEAAmE;AACnE,yDAMoC;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,EACJ,KAAK,IAAI,EAAE;QACT,MAAM,IAAI,KAAK,CACb,SAAS,IAAI,CAAC,IAAI,yBAAyB,IAAI,gBAAgB,CAChE,CAAC;IACJ,CAAC,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CACT,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CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC;wBAC5B,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC,CAAC,EACzC,CAAC,CAAC,EAAE,EAAE;wBACJ,IAAI,MAAM;4BAAE,OAAO,IAAA,yBAAc,EAAC,CAAC,CAAC,CAAC;wBACrC,8DAA8D;wBAC9D,MAAM,SAAS,GAAG,IAAI,GAAG,CACvB,IAAA,yBAAc,EAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CACxC,CAAC;wBACF,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CACnB,CAAC,CAAC,EAAE,EAAE,CACJ,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,CAC5D,CAAC;oBACJ,CAAC,CACF,CAAC;gBACJ,CAAC;gBACD,KAAK,QAAQ;oBACX,OAAO,IAAA,sBAAW,EAChB,IAAI,EACJ,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,EAAE,EACnC,0BAAe,EACf,0BAAe,CAChB,CAAC;gBACJ;oBACE,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;KACF,EACD,IAAA,qBAAY,EAAC,IAAI,CAAC,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ArgsOf, HandlerContext } from '@mcp-abap-adt/lib/handlers';
|
|
2
|
+
export declare const TOOL_DEFINITION: {
|
|
3
|
+
readonly name: "HandlerDebugWait";
|
|
4
|
+
readonly available_in: readonly ["onprem", "cloud"];
|
|
5
|
+
readonly description: "State of a debug session after waiting up to hold_seconds; for AMDP, its events.";
|
|
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 hold_seconds: {
|
|
16
|
+
readonly type: "number";
|
|
17
|
+
readonly default: 10;
|
|
18
|
+
readonly description: "Longest wait for a change, at most 30 seconds.";
|
|
19
|
+
};
|
|
20
|
+
readonly state_handle: {
|
|
21
|
+
readonly type: "string";
|
|
22
|
+
readonly description: "Opaque handle identifying the server-held state this operation works on.";
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
readonly required: readonly ["state_handle"];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
export declare function handleHandlerDebugWait(context: HandlerContext, args: ArgsOf<typeof TOOL_DEFINITION.inputSchema>): Promise<import("../../../dist/lib/answer").McpResult>;
|
|
29
|
+
//# sourceMappingURL=handleHandlerDebugWait.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleHandlerDebugWait.d.ts","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugWait.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAGzE,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;CAclB,CAAC;AAEX,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,yDA6BjD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_DEFINITION = void 0;
|
|
4
|
+
exports.handleHandlerDebugWait = handleHandlerDebugWait;
|
|
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: 'HandlerDebugWait',
|
|
10
|
+
available_in: ['onprem', 'cloud'],
|
|
11
|
+
description: 'State of a debug session after waiting up to hold_seconds; for AMDP, its events.',
|
|
12
|
+
inputSchema: {
|
|
13
|
+
type: 'object',
|
|
14
|
+
properties: {
|
|
15
|
+
...debugger_1.STATE_HANDLE_PROPERTY,
|
|
16
|
+
...debugger_1.HOLD_SECONDS_PROPERTY,
|
|
17
|
+
...compact_shared_1.DETAIL_PROPERTY,
|
|
18
|
+
},
|
|
19
|
+
required: ['state_handle'],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
async function handleHandlerDebugWait(context, args) {
|
|
23
|
+
const seconds = () => args.hold_seconds ?? 10;
|
|
24
|
+
return (0, shared_1.branchByKind)(context, args, {
|
|
25
|
+
amdp: (d) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
26
|
+
const s = await d.amdp.wait(seconds());
|
|
27
|
+
return {
|
|
28
|
+
value: s,
|
|
29
|
+
raw: s.state === 'event'
|
|
30
|
+
? s.events.map((e) => e.body).join('\n')
|
|
31
|
+
: JSON.stringify(s),
|
|
32
|
+
};
|
|
33
|
+
}, (s) => s.state === 'event'
|
|
34
|
+
? { state: 'event', events: s.events.map(debugger_1.terseAmdpEvent) }
|
|
35
|
+
: s),
|
|
36
|
+
abap: (d) => (0, debugger_1.debugStateAnswer)(args, async () => d.abap.wait(seconds())),
|
|
37
|
+
}, (0, shared_1.failedAnswer)(args));
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=handleHandlerDebugWait.js.map
|
|
@@ -0,0 +1 @@
|
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KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAc,CAAC,EAAE;YAC1D,CAAC,CAAC,CAAC,CACR;QACH,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,2BAAgB,EAAC,IAAI,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;KACxE,EACD,IAAA,qBAAY,EAAC,IAAI,CAAC,CACnB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type DebuggerInstance } from '@mcp-abap-adt/lib/debugger';
|
|
2
|
+
import type { HandlerContext } from '@mcp-abap-adt/lib/handlers';
|
|
3
|
+
/**
|
|
4
|
+
* The kind a compact debug session holds. One instance holds ABAP or AMDP, never
|
|
5
|
+
* both: the start fixes the kind and every later verb reads it from the instance.
|
|
6
|
+
*/
|
|
7
|
+
export declare function kindOf(instance: DebuggerInstance): 'abap' | 'amdp';
|
|
8
|
+
/** A start of one kind is refused while the instance holds the other. */
|
|
9
|
+
export declare function refuseOtherKind(context: HandlerContext, wanted: 'abap' | 'amdp'): void;
|
|
10
|
+
/**
|
|
11
|
+
* Runs the branch of the kind the instance holds. The handle is checked first; a
|
|
12
|
+
* handle that is not available is answered by `onFailure` with the same text a
|
|
13
|
+
* tool of the full surface gives.
|
|
14
|
+
*/
|
|
15
|
+
export declare function branchByKind<R>(context: HandlerContext, args: {
|
|
16
|
+
state_handle: string;
|
|
17
|
+
}, branches: {
|
|
18
|
+
abap: (d: DebuggerInstance) => R;
|
|
19
|
+
amdp: (d: DebuggerInstance) => R;
|
|
20
|
+
}, onFailure: (error: unknown) => R): R;
|
|
21
|
+
/** The answer for a call that failed before it reached a reading: the tool error. */
|
|
22
|
+
export declare const failedAnswer: (args: unknown) => (error: unknown) => Promise<import("../../../dist/lib/answer").McpResult>;
|
|
23
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/debug/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,MAAM,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAElE;AAED,yEAAyE;AACzE,wBAAgB,eAAe,CAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,MAAM,GAAG,MAAM,GACtB,IAAI,CASN;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,CAAC,EAC5B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,EAC9B,QAAQ,EAAE;IACR,IAAI,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,CAAC,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,EAAE,gBAAgB,KAAK,CAAC,CAAC;CAClC,EACD,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC,GAC/B,CAAC,CAQH;AAED,qFAAqF;AACrF,eAAO,MAAM,YAAY,GAAI,MAAM,OAAO,MAAM,OAAO,OAAO,0DAO3D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.failedAnswer = void 0;
|
|
4
|
+
exports.kindOf = kindOf;
|
|
5
|
+
exports.refuseOtherKind = refuseOtherKind;
|
|
6
|
+
exports.branchByKind = branchByKind;
|
|
7
|
+
const debugger_1 = require("@mcp-abap-adt/lib/debugger");
|
|
8
|
+
/**
|
|
9
|
+
* The kind a compact debug session holds. One instance holds ABAP or AMDP, never
|
|
10
|
+
* both: the start fixes the kind and every later verb reads it from the instance.
|
|
11
|
+
*/
|
|
12
|
+
function kindOf(instance) {
|
|
13
|
+
return instance.amdp.holdsState() ? 'amdp' : 'abap';
|
|
14
|
+
}
|
|
15
|
+
/** A start of one kind is refused while the instance holds the other. */
|
|
16
|
+
function refuseOtherKind(context, wanted) {
|
|
17
|
+
const held = context.debugger?.();
|
|
18
|
+
if (!held)
|
|
19
|
+
return;
|
|
20
|
+
const other = wanted === 'abap' ? held.amdp : held.abap;
|
|
21
|
+
if (other.holdsState()) {
|
|
22
|
+
throw new Error(`a ${wanted === 'abap' ? 'amdp' : 'abap'} debug session is already open on this server; end it first`);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Runs the branch of the kind the instance holds. The handle is checked first; a
|
|
27
|
+
* handle that is not available is answered by `onFailure` with the same text a
|
|
28
|
+
* tool of the full surface gives.
|
|
29
|
+
*/
|
|
30
|
+
function branchByKind(context, args, branches, onFailure) {
|
|
31
|
+
let d;
|
|
32
|
+
try {
|
|
33
|
+
d = (0, debugger_1.requireDebugger)(context, args, 'use');
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return onFailure(error);
|
|
37
|
+
}
|
|
38
|
+
return branches[kindOf(d)](d);
|
|
39
|
+
}
|
|
40
|
+
/** The answer for a call that failed before it reached a reading: the tool error. */
|
|
41
|
+
const failedAnswer = (args) => (error) => (0, debugger_1.debugAnswer)(args, async () => {
|
|
42
|
+
throw error;
|
|
43
|
+
}, (v) => v);
|
|
44
|
+
exports.failedAnswer = failedAnswer;
|
|
45
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/debug/shared.ts"],"names":[],"mappings":";;;AAWA,wBAEC;AAGD,0CAYC;AAOD,oCAgBC;AAnDD,yDAIoC;AAGpC;;;GAGG;AACH,SAAgB,MAAM,CAAC,QAA0B;IAC/C,OAAO,QAAQ,CA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.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @mcp-abap-adt/compact — the compact ABAP ADT server and its command.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 25 tools instead of 370: one per operation, with the object in `object_type`. For
|
|
5
5
|
* a host that cannot build a retrieval pipeline of its own and must still drive ABAP
|
|
6
6
|
* through MCP reliably.
|
|
7
7
|
*
|
|
8
|
-
* The tools themselves are in `@mcp-abap-adt/compact-readonly` (
|
|
8
|
+
* The tools themselves are in `@mcp-abap-adt/compact-readonly` (16, changing
|
|
9
9
|
* nothing) and `@mcp-abap-adt/compact-modify` (9, writing, locking, activating or
|
|
10
10
|
* executing). A consumer that wants only one capability imports that package
|
|
11
11
|
* directly; this one is the server that serves both.
|
package/dist/index.js
CHANGED
|
@@ -4,11 +4,11 @@ exports.main = exports.CompactHandlersGroup = void 0;
|
|
|
4
4
|
/**
|
|
5
5
|
* @mcp-abap-adt/compact — the compact ABAP ADT server and its command.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
7
|
+
* 25 tools instead of 370: one per operation, with the object in `object_type`. For
|
|
8
8
|
* a host that cannot build a retrieval pipeline of its own and must still drive ABAP
|
|
9
9
|
* through MCP reliably.
|
|
10
10
|
*
|
|
11
|
-
* The tools themselves are in `@mcp-abap-adt/compact-readonly` (
|
|
11
|
+
* The tools themselves are in `@mcp-abap-adt/compact-readonly` (16, changing
|
|
12
12
|
* nothing) and `@mcp-abap-adt/compact-modify` (9, writing, locking, activating or
|
|
13
13
|
* executing). A consumer that wants only one capability imports that package
|
|
14
14
|
* directly; this one is the server that serves both.
|
package/dist/launcher.d.ts
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/** What `--exposition` means here. `rw` is the default: locally, every access. */
|
|
2
2
|
export type CompactExposition = 'ro' | 'rw';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* **The default belongs to an ABSENT flag, never to an empty value.** The first
|
|
11
|
-
* version treated the two alike, so `--exposition="$MODE"` with an unset variable
|
|
12
|
-
* opened all 22 tools — writes included — and `--exposition=ro --exposition=`
|
|
13
|
-
* overrode a deliberate `ro` the same way (found in review on PR #247). A flag that
|
|
14
|
-
* is present but says nothing is a caller who meant something and lost it in a
|
|
15
|
-
* shell; the only safe answer is to refuse.
|
|
4
|
+
* Which half of the facade: the last of `ro`/`rw` in the list, `rw` when the flag
|
|
5
|
+
* is absent. A value outside `ro`, `rw`, `debug` is refused by name rather than
|
|
6
|
+
* defaulted, because starting with a different tool list than the one that was
|
|
7
|
+
* asked for is the failure this is meant to prevent — and so is `debug` alone: it
|
|
8
|
+
* names no half, and taking `rw` for it would open the write tools unasked.
|
|
16
9
|
*/
|
|
17
10
|
export declare function parseCompactExposition(argv: readonly string[]): CompactExposition;
|
|
11
|
+
/** Whether the four debugger verbs are served: `debug` in the `--exposition` list. */
|
|
12
|
+
export declare function parseCompactDebug(argv: readonly string[]): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* The groups this command hands the core launcher, through `extraGroups` — the
|
|
15
|
+
* option every published core launcher takes: its half of the facade, and the
|
|
16
|
+
* debugger verbs when `debug` is listed. Each is a real group, never an object
|
|
17
|
+
* literal wrapping the entries: the launcher sets the per-request context on the
|
|
18
|
+
* group that owns an entry, and only a `BaseHandlerGroup` reads `this.context`
|
|
19
|
+
* when the handler runs. A literal closing over the startup context is exactly the
|
|
20
|
+
* defect review caught on PR #240 — a server running every call against the
|
|
21
|
+
* connection it had before it connected.
|
|
22
|
+
*/
|
|
23
|
+
export declare function compactExtraGroups(argv: readonly string[]): (context: never) => object[];
|
|
18
24
|
export declare function main(): Promise<void>;
|
|
19
25
|
//# sourceMappingURL=launcher.d.ts.map
|
package/dist/launcher.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AA0BA,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,CAAC;AA+D5C;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,iBAAiB,CAkBnB;AAED,sFAAsF;AACtF,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAElE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,SAAS,MAAM,EAAE,GACtB,CAAC,OAAO,EAAE,KAAK,KAAK,MAAM,EAAE,CAS9B;AAED,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA+B1C"}
|
package/dist/launcher.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseCompactExposition = parseCompactExposition;
|
|
4
|
+
exports.parseCompactDebug = parseCompactDebug;
|
|
5
|
+
exports.compactExtraGroups = compactExtraGroups;
|
|
4
6
|
exports.main = main;
|
|
5
7
|
/**
|
|
6
8
|
* The compact command: the same server, a different decomposition of its tool list.
|
|
@@ -16,8 +18,8 @@ exports.main = main;
|
|
|
16
18
|
* construction. `core` refuses `--exposition=compact` now and says to install this.
|
|
17
19
|
*
|
|
18
20
|
* **And why this command has an exposition of its own.** The two halves of the
|
|
19
|
-
* facade are a real choice for whoever starts the server: `rw` serves all
|
|
20
|
-
* `ro` serves the
|
|
21
|
+
* facade are a real choice for whoever starts the server: `rw` serves all 25 tools,
|
|
22
|
+
* `ro` serves the 16 that change nothing — no create, update, delete, activate,
|
|
21
23
|
* lock, unlock, unit-test run or profiler run anywhere in the list. Locally the
|
|
22
24
|
* default gives every access (`rw`); `ro` is there for a host that means to hand out
|
|
23
25
|
* a surface which cannot change the system. The vocabulary is deliberately NOT
|
|
@@ -25,20 +27,26 @@ exports.main = main;
|
|
|
25
27
|
* command does not serve.
|
|
26
28
|
*/
|
|
27
29
|
const compact_readonly_1 = require("@mcp-abap-adt/compact-readonly");
|
|
28
|
-
const group_1 = require("./group");
|
|
30
|
+
const group_1 = require("./debug/group");
|
|
31
|
+
const group_2 = require("./group");
|
|
29
32
|
const HELP_EXPOSITION = `
|
|
30
33
|
HANDLER EXPOSITION:
|
|
31
34
|
--exposition=<set> Which half of the compact facade to serve
|
|
32
|
-
Options: ro, rw
|
|
35
|
+
Options: ro, rw, debug — a comma list
|
|
33
36
|
Default: rw
|
|
34
37
|
|
|
35
|
-
- rw: all
|
|
38
|
+
- rw: all 25 tools — HandlerGet, HandlerCreate,
|
|
36
39
|
HandlerUpdate, HandlerDelete,
|
|
37
40
|
HandlerActivate, HandlerLock, ...
|
|
38
|
-
- ro: the
|
|
41
|
+
- ro: the 16 that change nothing. No create,
|
|
39
42
|
update, delete, activate, lock, unlock,
|
|
40
43
|
unit-test run or profiler run is in the
|
|
41
44
|
list at all, so a client cannot call one.
|
|
45
|
+
- debug: beside ro or rw, never alone,
|
|
46
|
+
the four debugger verbs
|
|
47
|
+
(HandlerDebugStart, ...Wait, ...View,
|
|
48
|
+
...Step). They catch every request
|
|
49
|
+
of the connected SAP user.
|
|
42
50
|
|
|
43
51
|
The object-oriented sets (readonly, high, low)
|
|
44
52
|
belong to \`mcp-abap-adt\`; this command serves the
|
|
@@ -46,20 +54,17 @@ HANDLER EXPOSITION:
|
|
|
46
54
|
tool and the object goes in \`object_type\`.
|
|
47
55
|
`;
|
|
48
56
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* `--exposition=ro` and `--exposition ro`; anything else is refused by name rather
|
|
52
|
-
* than falling back to a default, because starting with a different tool list than
|
|
53
|
-
* the one that was asked for is the failure this is meant to prevent.
|
|
57
|
+
* The comma list a `--exposition` flag carries, in both spellings; the last flag
|
|
58
|
+
* wins. `undefined` when the flag is absent.
|
|
54
59
|
*
|
|
55
60
|
* **The default belongs to an ABSENT flag, never to an empty value.** The first
|
|
56
61
|
* version treated the two alike, so `--exposition="$MODE"` with an unset variable
|
|
57
|
-
* opened all
|
|
62
|
+
* opened all 25 tools — writes included — and `--exposition=ro --exposition=`
|
|
58
63
|
* overrode a deliberate `ro` the same way (found in review on PR #247). A flag that
|
|
59
64
|
* is present but says nothing is a caller who meant something and lost it in a
|
|
60
65
|
* shell; the only safe answer is to refuse.
|
|
61
66
|
*/
|
|
62
|
-
function
|
|
67
|
+
function expositionValues(argv) {
|
|
63
68
|
let seen = false;
|
|
64
69
|
let value;
|
|
65
70
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -75,16 +80,61 @@ function parseCompactExposition(argv) {
|
|
|
75
80
|
value = arg.slice('--exposition='.length);
|
|
76
81
|
}
|
|
77
82
|
}
|
|
78
|
-
// The default belongs to an ABSENT flag, never to an empty value.
|
|
79
83
|
if (!seen)
|
|
80
|
-
return
|
|
84
|
+
return undefined;
|
|
81
85
|
const wanted = (value ?? '').trim().toLowerCase();
|
|
82
|
-
if (wanted === 'ro' || wanted === 'rw')
|
|
83
|
-
return wanted;
|
|
84
86
|
if (wanted === '') {
|
|
85
|
-
throw new Error("--exposition was given no value. This command takes 'ro' (the
|
|
87
|
+
throw new Error("--exposition was given no value. This command takes 'ro' (the 16 tools that change nothing) or 'rw' (all 25), and 'debug' beside either. An empty value is refused rather than defaulted: an unset shell variable must not silently open the write tools.");
|
|
86
88
|
}
|
|
87
|
-
|
|
89
|
+
return wanted.split(',').map((v) => v.trim());
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Which half of the facade: the last of `ro`/`rw` in the list, `rw` when the flag
|
|
93
|
+
* is absent. A value outside `ro`, `rw`, `debug` is refused by name rather than
|
|
94
|
+
* defaulted, because starting with a different tool list than the one that was
|
|
95
|
+
* asked for is the failure this is meant to prevent — and so is `debug` alone: it
|
|
96
|
+
* names no half, and taking `rw` for it would open the write tools unasked.
|
|
97
|
+
*/
|
|
98
|
+
function parseCompactExposition(argv) {
|
|
99
|
+
const values = expositionValues(argv);
|
|
100
|
+
if (!values)
|
|
101
|
+
return 'rw';
|
|
102
|
+
let base;
|
|
103
|
+
for (const v of values) {
|
|
104
|
+
if (v === 'ro' || v === 'rw')
|
|
105
|
+
base = v;
|
|
106
|
+
else if (v !== 'debug') {
|
|
107
|
+
throw new Error(`--exposition=${v} is not a compact set. This command takes 'ro' (the 16 tools that change nothing) or 'rw' (all 25, the default), and 'debug' beside either. The sets readonly/high/low belong to \`mcp-abap-adt\`.`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
if (!base) {
|
|
111
|
+
throw new Error("--exposition=debug alone names no half of the facade: add 'ro' or 'rw' beside it (for example ro,debug).");
|
|
112
|
+
}
|
|
113
|
+
return base;
|
|
114
|
+
}
|
|
115
|
+
/** Whether the four debugger verbs are served: `debug` in the `--exposition` list. */
|
|
116
|
+
function parseCompactDebug(argv) {
|
|
117
|
+
return expositionValues(argv)?.includes('debug') ?? false;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* The groups this command hands the core launcher, through `extraGroups` — the
|
|
121
|
+
* option every published core launcher takes: its half of the facade, and the
|
|
122
|
+
* debugger verbs when `debug` is listed. Each is a real group, never an object
|
|
123
|
+
* literal wrapping the entries: the launcher sets the per-request context on the
|
|
124
|
+
* group that owns an entry, and only a `BaseHandlerGroup` reads `this.context`
|
|
125
|
+
* when the handler runs. A literal closing over the startup context is exactly the
|
|
126
|
+
* defect review caught on PR #240 — a server running every call against the
|
|
127
|
+
* connection it had before it connected.
|
|
128
|
+
*/
|
|
129
|
+
function compactExtraGroups(argv) {
|
|
130
|
+
const exposition = parseCompactExposition(argv);
|
|
131
|
+
const debug = parseCompactDebug(argv);
|
|
132
|
+
return (context) => [
|
|
133
|
+
exposition === 'ro'
|
|
134
|
+
? new compact_readonly_1.CompactReadOnlyHandlersGroup(context)
|
|
135
|
+
: new group_2.CompactHandlersGroup(context),
|
|
136
|
+
...(debug ? [new group_1.CompactDebugHandlersGroup(context)] : []),
|
|
137
|
+
];
|
|
88
138
|
}
|
|
89
139
|
async function main() {
|
|
90
140
|
// `--version` answers THIS package's version, not core's. The launcher core owns
|
|
@@ -95,7 +145,7 @@ async function main() {
|
|
|
95
145
|
console.log(manifest.version);
|
|
96
146
|
return;
|
|
97
147
|
}
|
|
98
|
-
const
|
|
148
|
+
const extraGroups = compactExtraGroups(process.argv.slice(2));
|
|
99
149
|
const { main: launch } = require('@mcp-abap-adt/core/launcher');
|
|
100
150
|
await launch({
|
|
101
151
|
program: 'mcp-abap-adt-compact',
|
|
@@ -103,17 +153,7 @@ async function main() {
|
|
|
103
153
|
helpExposition: HELP_EXPOSITION,
|
|
104
154
|
exposition: [],
|
|
105
155
|
includeSearch: false,
|
|
106
|
-
|
|
107
|
-
// entries: the launcher sets the per-request context on the group that owns an
|
|
108
|
-
// entry, and only a `BaseHandlerGroup` reads `this.context` when the handler
|
|
109
|
-
// runs. A literal closing over the startup context is exactly the defect review
|
|
110
|
-
// caught on PR #240 — a server running every call against the connection it had
|
|
111
|
-
// before it connected.
|
|
112
|
-
extraGroups: (context) => [
|
|
113
|
-
exposition === 'ro'
|
|
114
|
-
? new compact_readonly_1.CompactReadOnlyHandlersGroup(context)
|
|
115
|
-
: new group_1.CompactHandlersGroup(context),
|
|
116
|
-
],
|
|
156
|
+
extraGroups,
|
|
117
157
|
});
|
|
118
158
|
}
|
|
119
159
|
if (require.main === module) {
|
package/dist/launcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"launcher.js","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":";;AAiGA,wDAoBC;AAGD,8CA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
Generated from the built packages, not from source text: these are the tool
|
|
4
4
|
definitions a client receives.
|
|
5
5
|
|
|
6
|
-
- Tools:
|
|
6
|
+
- Tools: 29
|
|
7
7
|
- Read-only half: `@mcp-abap-adt/compact-readonly`
|
|
8
8
|
- Modifying half: `@mcp-abap-adt/compact-modify`
|
|
9
|
+
- Debugger verbs: `@mcp-abap-adt/compact`, served only with `--exposition=ro,debug` or `rw,debug`
|
|
9
10
|
- Command: `mcp-abap-adt-compact` (`@mcp-abap-adt/compact`)
|
|
10
11
|
|
|
11
12
|
## How it works
|
|
12
13
|
|
|
13
14
|
One tool per OPERATION, with the object in `object_type`: `HandlerCreate` with
|
|
14
|
-
`object_type: "CLASS"` rather than a `CreateClass` tool.
|
|
15
|
+
`object_type: "CLASS"` rather than a `CreateClass` tool. 29 schemas instead of
|
|
15
16
|
the object-oriented surface's hundreds, for a host that cannot select tools
|
|
16
17
|
per request.
|
|
17
18
|
|
|
@@ -508,3 +509,67 @@ per request.
|
|
|
508
509
|
- `amdp_trace` — Enable AMDP tracing.
|
|
509
510
|
- `max_time_for_tracing` — Maximum tracing time.
|
|
510
511
|
|
|
512
|
+
### HandlerDebugStart
|
|
513
|
+
|
|
514
|
+
**Half:** debugger verbs of `@mcp-abap-adt/compact` (opt-in: `debug` in `--exposition`)
|
|
515
|
+
|
|
516
|
+
**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. take_over: abap — Displaces another debugger listening for the same user; amdp — ends an AMDP session of this user left behind. Catches every request of the connected SAP user, not only programs run by this server.
|
|
517
|
+
|
|
518
|
+
**Available in:** cloud, onprem
|
|
519
|
+
|
|
520
|
+
**Parameters:**
|
|
521
|
+
|
|
522
|
+
- `kind` (required) — abap debugs ABAP code; amdp debugs SQLScript methods of a class.
|
|
523
|
+
- `breakpoints` (required) — abap: a line, an exception class, an ABAP statement or a message, each with an optional condition. amdp: object_name (the class) and line of each.
|
|
524
|
+
- `take_over` — Takes over from an existing debugger of this user instead of refusing.
|
|
525
|
+
- `run` — 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.
|
|
526
|
+
- `detail` — 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).
|
|
527
|
+
|
|
528
|
+
### HandlerDebugWait
|
|
529
|
+
|
|
530
|
+
**Half:** debugger verbs of `@mcp-abap-adt/compact` (opt-in: `debug` in `--exposition`)
|
|
531
|
+
|
|
532
|
+
**Description:** State of a debug session after waiting up to hold_seconds; for AMDP, its events.
|
|
533
|
+
|
|
534
|
+
**Available in:** cloud, onprem
|
|
535
|
+
|
|
536
|
+
**Parameters:**
|
|
537
|
+
|
|
538
|
+
- `state_handle` (required) — Opaque handle identifying the server-held state this operation works on.
|
|
539
|
+
- `hold_seconds` — Longest wait for a change, at most 30 seconds.
|
|
540
|
+
- `detail` — 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).
|
|
541
|
+
|
|
542
|
+
### HandlerDebugView
|
|
543
|
+
|
|
544
|
+
**Half:** debugger verbs of `@mcp-abap-adt/compact` (opt-in: `debug` in `--exposition`)
|
|
545
|
+
|
|
546
|
+
**Description:** The stopped debuggee: stack, variables (by name, or the scopes), memory, or an AMDP table variable's rows.
|
|
547
|
+
|
|
548
|
+
**Available in:** cloud, onprem
|
|
549
|
+
|
|
550
|
+
**Parameters:**
|
|
551
|
+
|
|
552
|
+
- `state_handle` (required) — Opaque handle identifying the server-held state this operation works on.
|
|
553
|
+
- `what` (required) — stack, variables and memory read an ABAP stop; table reads an AMDP stop.
|
|
554
|
+
- `names` — variables: names to read, a path reads a component or a table row; the scopes when omitted. table: the table variable, first entry.
|
|
555
|
+
- `detail` — 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).
|
|
556
|
+
|
|
557
|
+
### HandlerDebugStep
|
|
558
|
+
|
|
559
|
+
**Half:** debugger verbs of `@mcp-abap-adt/compact` (opt-in: `debug` in `--exposition`)
|
|
560
|
+
|
|
561
|
+
**Description:** Moves the stopped debuggee (into, over, return, continue, run or jump to a line), ends it where it stands, or ends the debug session.
|
|
562
|
+
|
|
563
|
+
**Available in:** cloud, onprem
|
|
564
|
+
|
|
565
|
+
**Parameters:**
|
|
566
|
+
|
|
567
|
+
- `state_handle` (required) — Opaque handle identifying the server-held state this operation works on.
|
|
568
|
+
- `action` (required) — 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; terminate ends the debuggee where it stands; stop ends the debug session. For AMDP only over, continue, terminate and stop apply.
|
|
569
|
+
- `object_type` — For a line: CLAS, PROG, INCL or FUNC.
|
|
570
|
+
- `object_name` — For a line: the object holding it.
|
|
571
|
+
- `line` — For a line: the line in the object source.
|
|
572
|
+
- `include` — For a class: definitions, implementations, macros or testclasses; the main source when omitted.
|
|
573
|
+
- `parent_name` — For a function module: its function group.
|
|
574
|
+
- `detail` — 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).
|
|
575
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mcp-abap-adt/compact",
|
|
3
3
|
"mcpName": "io.github.fr0ster/mcp-abap-adt-compact",
|
|
4
|
-
"version": "17.
|
|
4
|
+
"version": "17.2.0",
|
|
5
5
|
"description": "The compact MCP server for SAP ABAP ADT: one tool per operation with the object in the arguments \u2014 25 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>",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@mcp-abap-adt/compact-modify": "^17.0.0",
|
|
62
62
|
"@mcp-abap-adt/compact-readonly": "^17.0.0",
|
|
63
|
-
"@mcp-abap-adt/core": "^17.
|
|
64
|
-
"@mcp-abap-adt/lib": "^17.
|
|
63
|
+
"@mcp-abap-adt/core": "^17.2.0",
|
|
64
|
+
"@mcp-abap-adt/lib": "^17.2.0"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"typescript": "^6.0.2",
|