@mcp-abap-adt/compact 18.1.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.
Files changed (40) hide show
  1. package/README.md +73 -27
  2. package/bin/mcp-abap-adt-compact.js +7 -8
  3. package/dist/index.d.ts +9 -8
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.js +11 -9
  6. package/dist/index.js.map +1 -1
  7. package/dist/launcher.d.ts +10 -22
  8. package/dist/launcher.d.ts.map +1 -1
  9. package/dist/launcher.js +29 -151
  10. package/dist/launcher.js.map +1 -1
  11. package/docs/AVAILABLE_TOOLS.md +307 -139
  12. package/package.json +7 -7
  13. package/dist/debug/group.d.ts +0 -21
  14. package/dist/debug/group.d.ts.map +0 -1
  15. package/dist/debug/group.js +0 -39
  16. package/dist/debug/group.js.map +0 -1
  17. package/dist/debug/handleHandlerDebugStart.d.ts +0 -137
  18. package/dist/debug/handleHandlerDebugStart.d.ts.map +0 -1
  19. package/dist/debug/handleHandlerDebugStart.js +0 -71
  20. package/dist/debug/handleHandlerDebugStart.js.map +0 -1
  21. package/dist/debug/handleHandlerDebugStep.d.ts +0 -49
  22. package/dist/debug/handleHandlerDebugStep.d.ts.map +0 -1
  23. package/dist/debug/handleHandlerDebugStep.js +0 -118
  24. package/dist/debug/handleHandlerDebugStep.js.map +0 -1
  25. package/dist/debug/handleHandlerDebugView.d.ts +0 -36
  26. package/dist/debug/handleHandlerDebugView.d.ts.map +0 -1
  27. package/dist/debug/handleHandlerDebugView.js +0 -72
  28. package/dist/debug/handleHandlerDebugView.js.map +0 -1
  29. package/dist/debug/handleHandlerDebugWait.d.ts +0 -29
  30. package/dist/debug/handleHandlerDebugWait.d.ts.map +0 -1
  31. package/dist/debug/handleHandlerDebugWait.js +0 -39
  32. package/dist/debug/handleHandlerDebugWait.js.map +0 -1
  33. package/dist/debug/shared.d.ts +0 -23
  34. package/dist/debug/shared.d.ts.map +0 -1
  35. package/dist/debug/shared.js +0 -45
  36. package/dist/debug/shared.js.map +0 -1
  37. package/dist/group.d.ts +0 -6
  38. package/dist/group.d.ts.map +0 -1
  39. package/dist/group.js +0 -35
  40. package/dist/group.js.map +0 -1
@@ -1,29 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,39 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"handleHandlerDebugWait.js","sourceRoot":"","sources":["../../src/debug/handleHandlerDebugWait.ts"],"names":[],"mappings":";;;AA2BA,wDA+BC;AA1DD,qEAAmE;AACnE,yDAMoC;AAEpC,qCAAsD;AAEzC,QAAA,eAAe,GAAG;IAC7B,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,CAAC,QAAQ,E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C,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC;KACxE,EACD,IAAA,qBAAY,EAAC,IAAI,CAAC,CACnB,CAAC;AACJ,CAAC"}
@@ -1,23 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,45 +0,0 @@
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
@@ -1 +0,0 @@
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,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC;AACtD,CAAC;AAED,yEAAyE;AACzE,SAAgB,eAAe,CAC7B,OAAuB,EACvB,MAAuB;IAEvB,MAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;IAClC,IAAI,CAAC,IAAI;QAAE,OAAO;IAClB,MAAM,KAAK,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;IACxD,IAAI,KAAK,CAAC,UAAU,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,KAAK,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,6DAA6D,CACtG,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAC1B,OAAuB,EACvB,IAA8B,EAC9B,QAGC,EACD,SAAgC;IAEhC,IAAI,CAAmB,CAAC;IACxB,IAAI,CAAC;QACH,CAAC,GAAG,IAAA,0BAAe,EAAC,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChC,CAAC;AAED,qFAAqF;AAC9E,MAAM,YAAY,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,KAAc,EAAE,EAAE,CAChE,IAAA,sBAAW,EACT,IAAI,EACJ,KAAK,IAAI,EAAE;IACT,MAAM,KAAK,CAAC;AACd,CAAC,EACD,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CACT,CAAC;AAPS,QAAA,YAAY,gBAOrB"}
package/dist/group.d.ts DELETED
@@ -1,6 +0,0 @@
1
- import { BaseHandlerGroup, type HandlerEntry } from '@mcp-abap-adt/lib/handlers';
2
- export declare class CompactHandlersGroup extends BaseHandlerGroup {
3
- protected groupName: string;
4
- getHandlers(): HandlerEntry[];
5
- }
6
- //# sourceMappingURL=group.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAmBA,OAAO,EACL,gBAAgB,EAChB,KAAK,YAAY,EAClB,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,oBAAqB,SAAQ,gBAAgB;IACxD,SAAS,CAAC,SAAS,SAAqB;IAExC,WAAW,IAAI,YAAY,EAAE;CAO9B"}
package/dist/group.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompactHandlersGroup = void 0;
4
- /**
5
- * The whole compact facade, composed of its two halves.
6
- *
7
- * This group used to live in `lib`, beside every other handler group. It lives here
8
- * because the halves do: `@mcp-abap-adt/compact-readonly` and
9
- * `@mcp-abap-adt/compact-modify` are separate packages so that a consumer can
10
- * import the capability it means to hand out, and the union is what a local command
11
- * serves — locally the server gives every access, and choosing less is the
12
- * consumer's act of importing one half rather than a flag someone can pass.
13
- *
14
- * **It composes the two ENTRY BUILDERS, not two group instances.** The launcher
15
- * sets the context on the group that owns an entry, once per request; a child group
16
- * constructed here would hold the context that existed when the list was built, and
17
- * its handlers would run against a stale connection or the `null` a server holds
18
- * before it has connected. Passing `() => this.context` makes every handler read
19
- * THIS group's context at call time.
20
- */
21
- const compact_modify_1 = require("@mcp-abap-adt/compact-modify");
22
- const compact_readonly_1 = require("@mcp-abap-adt/compact-readonly");
23
- const handlers_1 = require("@mcp-abap-adt/lib/handlers");
24
- class CompactHandlersGroup extends handlers_1.BaseHandlerGroup {
25
- groupName = 'CompactHandlers';
26
- getHandlers() {
27
- const context = () => this.context;
28
- return [
29
- ...(0, compact_readonly_1.compactReadOnlyEntries)(context),
30
- ...(0, compact_modify_1.compactModifyEntries)(context),
31
- ];
32
- }
33
- }
34
- exports.CompactHandlersGroup = CompactHandlersGroup;
35
- //# sourceMappingURL=group.js.map
package/dist/group.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"group.js","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,iEAAoE;AACpE,qEAAwE;AACxE,yDAGoC;AAEpC,MAAa,oBAAqB,SAAQ,2BAAgB;IAC9C,SAAS,GAAG,iBAAiB,CAAC;IAExC,WAAW;QACT,MAAM,OAAO,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC;QACnC,OAAO;YACL,GAAG,IAAA,yCAAsB,EAAC,OAAO,CAAC;YAClC,GAAG,IAAA,qCAAoB,EAAC,OAAO,CAAC;SACjC,CAAC;IACJ,CAAC;CACF;AAVD,oDAUC"}