@mcp-abap-adt/compact 14.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 ADDED
@@ -0,0 +1,49 @@
1
+ # @mcp-abap-adt/compact
2
+
3
+ The compact MCP server — the command that serves all 22.
4
+
5
+ ## What compact is
6
+
7
+ A different decomposition of the same ABAP ADT surface: the **operation** is the
8
+ tool and the object moves into the arguments. Where the object-oriented surface has
9
+ `CreateClass`, `CreateDomain`, `CreateDdl` and so on, compact has one
10
+ `HandlerCreate` with `object_type`. Twenty-two tool schemas instead of hundreds.
11
+
12
+ It exists for a host that **cannot build a retrieval pipeline of its own** — a small
13
+ context, no tool-RAG, no way to select tools per request — and must still drive ABAP
14
+ through MCP reliably. A consumer that does select per request (cloud-llm-hub, for
15
+ one) has no use for it and should take `@mcp-abap-adt/lib` instead.
16
+
17
+ ## Why two library packages
18
+
19
+ Capability is decided by what you import, not by a flag a caller can pass. A tool
20
+ list assembled from `@mcp-abap-adt/compact-readonly` has **no route to a write
21
+ handler in its module graph** — asserted against the graph, not against a list of
22
+ names, in `compact/src/__tests__/compactCapabilitySplit.test.ts`. The read-only
23
+ half depends on `@mcp-abap-adt/lib/handlers/read`; the modifying half on
24
+ `@mcp-abap-adt/lib/handlers/write`.
25
+
26
+ Note what this is not: both halves depend on `@mcp-abap-adt/lib`, so this is not a
27
+ smaller install, and it is not a sandbox — code that deliberately reaches into
28
+ `lib` can still call anything. It is a facade that offers no way to write.
29
+
30
+ ## Running it
31
+
32
+ ```bash
33
+ npm install -g @mcp-abap-adt/compact
34
+ mcp-abap-adt-compact # stdio, the 22 compact tools and nothing else
35
+ mcp-abap-adt-compact --version
36
+ ```
37
+
38
+ Configuration — connection, authentication, transports — is the same as
39
+ `mcp-abap-adt`'s, because the launcher is the same one: this command passes its own
40
+ tool list to `@mcp-abap-adt/core`'s launcher rather than reimplementing it. The
41
+ object-oriented command no longer accepts `--exposition=compact`; it refuses the
42
+ value and names this package.
43
+
44
+ The tool page is generated from the built packages: `docs/AVAILABLE_TOOLS.md`
45
+ (`npm run docs:tools`).
46
+
47
+ ## Licence
48
+
49
+ AGPL-3.0-only. See LICENSE.
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * MCP ABAP ADT — the compact command.
5
+ *
6
+ * Starts the server in THIS process so stdin/stdout stay wired to the MCP protocol
7
+ * with no intermediate layer, exactly as `mcp-abap-adt` does. The tool list is the
8
+ * compact facade's 22 tools and nothing else.
9
+ */
10
+ const { main } = require('../dist/launcher.js');
11
+
12
+ void main().catch((err) => {
13
+ console.error(
14
+ '[MCP] compact launcher failed:',
15
+ err instanceof Error ? err.message : String(err),
16
+ );
17
+ process.exit(1);
18
+ });
@@ -0,0 +1,6 @@
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
@@ -0,0 +1 @@
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 ADDED
@@ -0,0 +1,35 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @mcp-abap-adt/compact — the compact ABAP ADT server and its command.
3
+ *
4
+ * 22 tools instead of 370: one per operation, with the object in `object_type`. For
5
+ * a host that cannot build a retrieval pipeline of its own and must still drive ABAP
6
+ * through MCP reliably.
7
+ *
8
+ * The tools themselves are in `@mcp-abap-adt/compact-readonly` (13, changing
9
+ * nothing) and `@mcp-abap-adt/compact-modify` (9, writing, locking, activating or
10
+ * executing). A consumer that wants only one capability imports that package
11
+ * directly; this one is the server that serves both.
12
+ */
13
+ export { CompactHandlersGroup } from './group';
14
+ export { main } from './launcher';
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = exports.CompactHandlersGroup = void 0;
4
+ /**
5
+ * @mcp-abap-adt/compact — the compact ABAP ADT server and its command.
6
+ *
7
+ * 22 tools instead of 370: one per operation, with the object in `object_type`. For
8
+ * a host that cannot build a retrieval pipeline of its own and must still drive ABAP
9
+ * through MCP reliably.
10
+ *
11
+ * The tools themselves are in `@mcp-abap-adt/compact-readonly` (13, changing
12
+ * nothing) and `@mcp-abap-adt/compact-modify` (9, writing, locking, activating or
13
+ * executing). A consumer that wants only one capability imports that package
14
+ * directly; this one is the server that serves both.
15
+ */
16
+ var group_1 = require("./group");
17
+ Object.defineProperty(exports, "CompactHandlersGroup", { enumerable: true, get: function () { return group_1.CompactHandlersGroup; } });
18
+ var launcher_1 = require("./launcher");
19
+ Object.defineProperty(exports, "main", { enumerable: true, get: function () { return launcher_1.main; } });
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,iCAA+C;AAAtC,6GAAA,oBAAoB,OAAA;AAC7B,uCAAkC;AAAzB,gGAAA,IAAI,OAAA"}
@@ -0,0 +1,2 @@
1
+ export declare function main(): Promise<void>;
2
+ //# sourceMappingURL=launcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcher.d.ts","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":"AAmBA,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB1C"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.main = main;
4
+ /**
5
+ * The compact command: the same server, a different decomposition of its tool list.
6
+ *
7
+ * `@mcp-abap-adt/core` owns the launcher — configuration, transports, auth, the
8
+ * request context — and this command calls it with the compact groups instead of the
9
+ * object-oriented ones. Nothing is copied: `main` takes `extraGroups`, an
10
+ * `exposition` and `includeSearch`, which is all a second command needs.
11
+ *
12
+ * **Why a command at all**, rather than a flag on the first one: the host this is
13
+ * for cannot build a retrieval pipeline and must be handed a tool list short by
14
+ * construction. A flag can be forgotten or mistyped; a command whose default IS the
15
+ * compact list cannot be. `core` refuses `--exposition=compact` now and says to
16
+ * install this.
17
+ *
18
+ * The list is exactly the 22 compact tools: no `readonly`/`high`/`low` set, and the
19
+ * search tools left out too, because "a tool list of a known size" is the point.
20
+ */
21
+ const group_1 = require("./group");
22
+ async function main() {
23
+ // `--version` answers THIS package's version, not core's. The launcher core owns
24
+ // would print its own manifest, which is the defect 13.0.0 shipped in the other
25
+ // direction: a version that belongs to a different package reads as the truth.
26
+ if (process.argv.includes('--version') || process.argv.includes('-v')) {
27
+ const manifest = require('../package.json');
28
+ console.log(manifest.version);
29
+ return;
30
+ }
31
+ const { main: launch } = require('@mcp-abap-adt/core/launcher');
32
+ await launch({
33
+ exposition: [],
34
+ includeSearch: false,
35
+ extraGroups: (context) => [new group_1.CompactHandlersGroup(context)],
36
+ });
37
+ }
38
+ if (require.main === module) {
39
+ void main().catch((error) => {
40
+ console.error('[MCP] compact launcher failed:', error instanceof Error ? error.message : String(error));
41
+ process.exit(1);
42
+ });
43
+ }
44
+ //# sourceMappingURL=launcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launcher.js","sourceRoot":"","sources":["../src/launcher.ts"],"names":[],"mappings":";;AAmBA,oBAuBC;AA1CD;;;;;;;;;;;;;;;;GAgBG;AACH,mCAA+C;AAExC,KAAK,UAAU,IAAI;IACxB,iFAAiF;IACjF,gFAAgF;IAChF,+EAA+E;IAC/E,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;QACtE,MAAM,QAAQ,GAAG,OAAO,CAAC,iBAAiB,CAAwB,CAAC;QACnE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAC9B,OAAO;IACT,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,6BAA6B,CAM7D,CAAC;IAEF,MAAM,MAAM,CAAC;QACX,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,KAAK;QACpB,WAAW,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,4BAAoB,CAAC,OAAO,CAAC,CAAC;KAC9D,CAAC,CAAC;AACL,CAAC;AAED,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,KAAK,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CACX,gCAAgC,EAChC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CACvD,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}