@open-rap/compiler 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +21 -2
- package/dist/agent/server.d.ts +35 -0
- package/dist/agent/server.js +408 -0
- package/dist/agent/server.js.map +1 -0
- package/dist/authoring/abapgit.d.ts +38 -0
- package/dist/authoring/abapgit.js +242 -0
- package/dist/authoring/abapgit.js.map +1 -0
- package/dist/authoring/catalog.d.ts +48 -0
- package/dist/authoring/catalog.js +117 -0
- package/dist/authoring/catalog.js.map +1 -0
- package/dist/authoring/floorplan.d.ts +28 -0
- package/dist/authoring/floorplan.js +31 -0
- package/dist/authoring/floorplan.js.map +1 -0
- package/dist/authoring/generate.d.ts +57 -0
- package/dist/authoring/generate.js +630 -0
- package/dist/authoring/generate.js.map +1 -0
- package/dist/authoring/mcp.d.ts +15 -0
- package/dist/authoring/mcp.js +52 -0
- package/dist/authoring/mcp.js.map +1 -0
- package/dist/authoring/new.d.ts +35 -0
- package/dist/authoring/new.js +389 -0
- package/dist/authoring/new.js.map +1 -0
- package/dist/bdef/ast.d.ts +249 -0
- package/dist/bdef/ast.js +3 -0
- package/dist/bdef/ast.js.map +1 -0
- package/dist/bdef/lexer.d.ts +105 -0
- package/dist/bdef/lexer.js +148 -0
- package/dist/bdef/lexer.js.map +1 -0
- package/dist/bdef/parser.d.ts +22 -0
- package/dist/bdef/parser.js +1012 -0
- package/dist/bdef/parser.js.map +1 -0
- package/dist/build.d.ts +26 -0
- package/dist/build.js +62 -0
- package/dist/build.js.map +1 -0
- package/dist/cds/adapter.d.ts +91 -0
- package/dist/cds/adapter.js +381 -0
- package/dist/cds/adapter.js.map +1 -0
- package/dist/cds/expression-ast.d.ts +65 -0
- package/dist/cds/expression-ast.js +330 -0
- package/dist/cds/expression-ast.js.map +1 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.js +485 -0
- package/dist/cli.js.map +1 -0
- package/dist/dcl/parser.d.ts +59 -0
- package/dist/dcl/parser.js +338 -0
- package/dist/dcl/parser.js.map +1 -0
- package/dist/ddic/catalog.d.ts +17 -0
- package/dist/ddic/catalog.js +211 -0
- package/dist/ddic/catalog.js.map +1 -0
- package/dist/ddic/cds-types.d.ts +47 -0
- package/dist/ddic/cds-types.js +131 -0
- package/dist/ddic/cds-types.js.map +1 -0
- package/dist/ddic/table-source.d.ts +70 -0
- package/dist/ddic/table-source.js +500 -0
- package/dist/ddic/table-source.js.map +1 -0
- package/dist/ddic/xml.d.ts +65 -0
- package/dist/ddic/xml.js +201 -0
- package/dist/ddic/xml.js.map +1 -0
- package/dist/dev.d.ts +128 -0
- package/dist/dev.js +434 -0
- package/dist/dev.js.map +1 -0
- package/dist/diagnostics.d.ts +33 -0
- package/dist/diagnostics.js +53 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/gen/abap/derived-types.d.ts +26 -0
- package/dist/gen/abap/derived-types.js +323 -0
- package/dist/gen/abap/derived-types.js.map +1 -0
- package/dist/gen/abap/eml.d.ts +118 -0
- package/dist/gen/abap/eml.js +362 -0
- package/dist/gen/abap/eml.js.map +1 -0
- package/dist/gen/abap/enums.d.ts +13 -0
- package/dist/gen/abap/enums.js +74 -0
- package/dist/gen/abap/enums.js.map +1 -0
- package/dist/gen/abap/framework-http.d.ts +14 -0
- package/dist/gen/abap/framework-http.js +1049 -0
- package/dist/gen/abap/framework-http.js.map +1 -0
- package/dist/gen/abap/framework-query.d.ts +14 -0
- package/dist/gen/abap/framework-query.js +225 -0
- package/dist/gen/abap/framework-query.js.map +1 -0
- package/dist/gen/abap/framework-utils.d.ts +29 -0
- package/dist/gen/abap/framework-utils.js +3707 -0
- package/dist/gen/abap/framework-utils.js.map +1 -0
- package/dist/gen/abap/framework.d.ts +12 -0
- package/dist/gen/abap/framework.js +480 -0
- package/dist/gen/abap/framework.js.map +1 -0
- package/dist/gen/abap/generate.d.ts +40 -0
- package/dist/gen/abap/generate.js +238 -0
- package/dist/gen/abap/generate.js.map +1 -0
- package/dist/gen/abap/rewrite.d.ts +82 -0
- package/dist/gen/abap/rewrite.js +957 -0
- package/dist/gen/abap/rewrite.js.map +1 -0
- package/dist/gen/abap/shadow.d.ts +25 -0
- package/dist/gen/abap/shadow.js +175 -0
- package/dist/gen/abap/shadow.js.map +1 -0
- package/dist/gen/abap/tokens.d.ts +33 -0
- package/dist/gen/abap/tokens.js +87 -0
- package/dist/gen/abap/tokens.js.map +1 -0
- package/dist/gen/app/index.d.ts +25 -0
- package/dist/gen/app/index.js +322 -0
- package/dist/gen/app/index.js.map +1 -0
- package/dist/gen/csdl.d.ts +11 -0
- package/dist/gen/csdl.js +562 -0
- package/dist/gen/csdl.js.map +1 -0
- package/dist/gen/deploy.d.ts +12 -0
- package/dist/gen/deploy.js +53 -0
- package/dist/gen/deploy.js.map +1 -0
- package/dist/gen/docs/index.d.ts +35 -0
- package/dist/gen/docs/index.js +267 -0
- package/dist/gen/docs/index.js.map +1 -0
- package/dist/gen/docs/markdown.d.ts +23 -0
- package/dist/gen/docs/markdown.js +187 -0
- package/dist/gen/docs/markdown.js.map +1 -0
- package/dist/gen/docs/site.d.ts +17 -0
- package/dist/gen/docs/site.js +106 -0
- package/dist/gen/docs/site.js.map +1 -0
- package/dist/gen/keycloak.d.ts +21 -0
- package/dist/gen/keycloak.js +90 -0
- package/dist/gen/keycloak.js.map +1 -0
- package/dist/gen/launchpad/index.d.ts +48 -0
- package/dist/gen/launchpad/index.js +302 -0
- package/dist/gen/launchpad/index.js.map +1 -0
- package/dist/gen/launchpad/ui.d.ts +14 -0
- package/dist/gen/launchpad/ui.js +350 -0
- package/dist/gen/launchpad/ui.js.map +1 -0
- package/dist/gen/mcp.d.ts +23 -0
- package/dist/gen/mcp.js +244 -0
- package/dist/gen/mcp.js.map +1 -0
- package/dist/gen/sql-expressions.d.ts +12 -0
- package/dist/gen/sql-expressions.js +136 -0
- package/dist/gen/sql-expressions.js.map +1 -0
- package/dist/gen/sql.d.ts +38 -0
- package/dist/gen/sql.js +612 -0
- package/dist/gen/sql.js.map +1 -0
- package/dist/gen/ui/index.d.ts +7 -0
- package/dist/gen/ui/index.js +27 -0
- package/dist/gen/ui/index.js.map +1 -0
- package/dist/gen/ui/layout.d.ts +230 -0
- package/dist/gen/ui/layout.js +511 -0
- package/dist/gen/ui/layout.js.map +1 -0
- package/dist/gen/ui/static.d.ts +55 -0
- package/dist/gen/ui/static.js +2901 -0
- package/dist/gen/ui/static.js.map +1 -0
- package/dist/gen/ui/views.d.ts +10 -0
- package/dist/gen/ui/views.js +511 -0
- package/dist/gen/ui/views.js.map +1 -0
- package/dist/gen/vendor.d.ts +23 -0
- package/dist/gen/vendor.js +68 -0
- package/dist/gen/vendor.js.map +1 -0
- package/dist/gen/xml.d.ts +9 -0
- package/dist/gen/xml.js +42 -0
- package/dist/gen/xml.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/input/project.d.ts +50 -0
- package/dist/input/project.js +128 -0
- package/dist/input/project.js.map +1 -0
- package/dist/ir/access-controls.d.ts +11 -0
- package/dist/ir/access-controls.js +148 -0
- package/dist/ir/access-controls.js.map +1 -0
- package/dist/ir/authorizations.d.ts +25 -0
- package/dist/ir/authorizations.js +178 -0
- package/dist/ir/authorizations.js.map +1 -0
- package/dist/ir/behaviors.d.ts +16 -0
- package/dist/ir/behaviors.js +548 -0
- package/dist/ir/behaviors.js.map +1 -0
- package/dist/ir/builder.d.ts +20 -0
- package/dist/ir/builder.js +505 -0
- package/dist/ir/builder.js.map +1 -0
- package/dist/ir/config.d.ts +25 -0
- package/dist/ir/config.js +130 -0
- package/dist/ir/config.js.map +1 -0
- package/dist/ir/dictionary.d.ts +54 -0
- package/dist/ir/dictionary.js +328 -0
- package/dist/ir/dictionary.js.map +1 -0
- package/dist/ir/entities.d.ts +58 -0
- package/dist/ir/entities.js +676 -0
- package/dist/ir/entities.js.map +1 -0
- package/dist/ir/expressions.d.ts +33 -0
- package/dist/ir/expressions.js +327 -0
- package/dist/ir/expressions.js.map +1 -0
- package/dist/ir/handlers.d.ts +63 -0
- package/dist/ir/handlers.js +398 -0
- package/dist/ir/handlers.js.map +1 -0
- package/dist/ir/number-ranges.d.ts +24 -0
- package/dist/ir/number-ranges.js +74 -0
- package/dist/ir/number-ranges.js.map +1 -0
- package/dist/ir/seed.d.ts +23 -0
- package/dist/ir/seed.js +78 -0
- package/dist/ir/seed.js.map +1 -0
- package/dist/ir/service.d.ts +21 -0
- package/dist/ir/service.js +96 -0
- package/dist/ir/service.js.map +1 -0
- package/dist/launchpad/config.d.ts +47 -0
- package/dist/launchpad/config.js +321 -0
- package/dist/launchpad/config.js.map +1 -0
- package/dist/launchpad/workspace.d.ts +48 -0
- package/dist/launchpad/workspace.js +166 -0
- package/dist/launchpad/workspace.js.map +1 -0
- package/dist/srvd/parser.d.ts +36 -0
- package/dist/srvd/parser.js +193 -0
- package/dist/srvd/parser.js.map +1 -0
- package/dist/standard/data.d.ts +18 -0
- package/dist/standard/data.js +534 -0
- package/dist/standard/data.js.map +1 -0
- package/dist/standard/index.d.ts +36 -0
- package/dist/standard/index.js +507 -0
- package/dist/standard/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +4 -0
- package/dist/version.js.map +1 -0
- package/docs/AGENTS.md +79 -0
- package/docs/ANNOTATIONS.md +76 -0
- package/docs/DECISIONS.md +1554 -0
- package/docs/DEPLOYMENT.md +113 -0
- package/docs/DIAGNOSTICS.md +116 -0
- package/docs/FEATURES.md +287 -0
- package/docs/GUIDE.md +560 -0
- package/docs/KNOWN_GAPS.md +216 -0
- package/docs/MCP.md +84 -0
- package/docs/PLAN.md +690 -0
- package/docs/README.md +148 -0
- package/docs/REMOTE_APIS.md +121 -0
- package/docs/ROADMAP.md +35 -0
- package/docs/UTILITIES.md +95 -0
- package/package.json +49 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Clément Ringot and contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @open-rap/compiler
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The compiler of [Open RAP Runtime](https://clementringot.github.io/Open-Rap-Runtime/): CDS, BDEF,
|
|
4
|
+
SRVD and DCL parsers, intermediate representation, generators (SQL, OData V4 `$metadata`,
|
|
5
|
+
transpiled ABAP, OpenUI5 UI) and the command line.
|
|
6
|
+
|
|
7
|
+
For the complete `rapt` command (with the runtime, OpenUI5 and PGlite that `rapt dev` and
|
|
8
|
+
`rapt build` use), install the [`open-rap-runtime`](https://www.npmjs.com/package/open-rap-runtime)
|
|
9
|
+
package instead:
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm install -g open-rap-runtime
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
As a library:
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
import { buildModel, loadProject } from "@open-rap/compiler";
|
|
19
|
+
const { model, diagnostics } = buildModel(loadProject("my-project"));
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
MIT license.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rapt agent` (decision D64): an MCP server for the AI coding agents that write RAP sources with
|
|
3
|
+
* rapt (GitHub Copilot, Claude Code, Cursor…). It speaks the Model Context Protocol over stdio
|
|
4
|
+
* (newline-delimited JSON-RPC) and offers what an agent needs and cannot easily find alone:
|
|
5
|
+
* the diagnostics of the project, the catalog of the object types and their creation, the
|
|
6
|
+
* floorplans, the abapGit files, and the documentation of Open RAP Runtime (which is not in the
|
|
7
|
+
* project of the user). The VS Code extension registers it, so that the agent mode of VS Code
|
|
8
|
+
* finds it without configuration; other clients start `rapt agent <workspace>`.
|
|
9
|
+
*
|
|
10
|
+
* Not to be confused with `rapt mcp` (D47), which writes the MCP tools of a *service*: the
|
|
11
|
+
* application then serves them to agents that use the business object.
|
|
12
|
+
*
|
|
13
|
+
* Every path is relative to the workspace given on start; paths outside it are refused.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AgentServer {
|
|
16
|
+
private readonly workspace;
|
|
17
|
+
private readonly tools;
|
|
18
|
+
constructor(workspace: string);
|
|
19
|
+
/** The project folder of a call: given (inside the workspace), or the only one of the workspace. */
|
|
20
|
+
private project;
|
|
21
|
+
private relative;
|
|
22
|
+
private defineTools;
|
|
23
|
+
/** Handles one JSON-RPC message; undefined for a notification. */
|
|
24
|
+
handle(message: {
|
|
25
|
+
jsonrpc?: string;
|
|
26
|
+
id?: string | number | null;
|
|
27
|
+
method?: string;
|
|
28
|
+
params?: Record<string, unknown>;
|
|
29
|
+
}): Promise<Record<string, unknown> | undefined>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Serves the agent over stdio until stdin closes. Anything else written to stdout (a log of a
|
|
33
|
+
* library) would break the protocol: it goes to stderr.
|
|
34
|
+
*/
|
|
35
|
+
export declare function serveAgent(workspace: string): Promise<number>;
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `rapt agent` (decision D64): an MCP server for the AI coding agents that write RAP sources with
|
|
3
|
+
* rapt (GitHub Copilot, Claude Code, Cursor…). It speaks the Model Context Protocol over stdio
|
|
4
|
+
* (newline-delimited JSON-RPC) and offers what an agent needs and cannot easily find alone:
|
|
5
|
+
* the diagnostics of the project, the catalog of the object types and their creation, the
|
|
6
|
+
* floorplans, the abapGit files, and the documentation of Open RAP Runtime (which is not in the
|
|
7
|
+
* project of the user). The VS Code extension registers it, so that the agent mode of VS Code
|
|
8
|
+
* finds it without configuration; other clients start `rapt agent <workspace>`.
|
|
9
|
+
*
|
|
10
|
+
* Not to be confused with `rapt mcp` (D47), which writes the MCP tools of a *service*: the
|
|
11
|
+
* application then serves them to agents that use the business object.
|
|
12
|
+
*
|
|
13
|
+
* Every path is relative to the workspace given on start; paths outside it are refused.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
16
|
+
import path from "node:path";
|
|
17
|
+
import { generateAbapGitFiles } from "../authoring/abapgit.js";
|
|
18
|
+
import { FLOORPLAN_CATALOG, OBJECT_CATALOG } from "../authoring/catalog.js";
|
|
19
|
+
import { floorplans } from "../authoring/floorplan.js";
|
|
20
|
+
import { generateObject } from "../authoring/generate.js";
|
|
21
|
+
import { newBusinessObject } from "../authoring/new.js";
|
|
22
|
+
import { generateApplication } from "../build.js";
|
|
23
|
+
import { countDiagnostics } from "../diagnostics.js";
|
|
24
|
+
import { documentationSources } from "../gen/docs/index.js";
|
|
25
|
+
import { headingId } from "../gen/docs/markdown.js";
|
|
26
|
+
import { loadProject } from "../input/project.js";
|
|
27
|
+
import { registerApp } from "../launchpad/workspace.js";
|
|
28
|
+
import { COMPILER_VERSION } from "../version.js";
|
|
29
|
+
/** Versions of the protocol this server speaks, the newest first. */
|
|
30
|
+
const PROTOCOL_VERSIONS = ["2025-06-18", "2025-03-26", "2024-11-05"];
|
|
31
|
+
const INSTRUCTIONS = `rapt compiles RAP business objects (ABAP RESTful Application Programming Model sources in abapGit format: tables, CDS views, metadata extensions, behavior definitions, ABAP behavior pools, service definitions and bindings) into a Node.js application, without an SAP system.
|
|
32
|
+
- Write the sources as in ADT; prefer rapt_generate (or rapt_new_business_object) to create objects: file names and abapGit XML are then right.
|
|
33
|
+
- After each change, run rapt_check until there are no errors; each diagnostic has a code explained by rapt_docs_read({ page: "diagnostics" }).
|
|
34
|
+
- Stay in standard mode (as on SAP) unless the user asks for the enhanced extensions.
|
|
35
|
+
- Read the documentation with rapt_docs_search and rapt_docs_read (guide, features, annotations, known gaps with their workarounds) before guessing.
|
|
36
|
+
- Never edit .rapt/ (generated). To run the application, the user starts rapt dev (or the "RAP: Start rapt dev" command in VS Code).`;
|
|
37
|
+
class ToolError extends Error {
|
|
38
|
+
}
|
|
39
|
+
const PROJECT = { type: "string", description: "The folder of the RAP project (the one with .abapgit.xml), relative to the workspace. Default: the only project of the workspace." };
|
|
40
|
+
/** Folders that contain a RAP project, under the workspace (not in node_modules, .rapt, hidden folders). */
|
|
41
|
+
function findProjects(root, depth = 4) {
|
|
42
|
+
const found = [];
|
|
43
|
+
const visit = (dir, level) => {
|
|
44
|
+
if (existsSync(path.join(dir, ".abapgit.xml")) || (existsSync(path.join(dir, "src")) && existsSync(path.join(dir, "rapt")))) {
|
|
45
|
+
found.push(dir);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
if (level >= depth)
|
|
49
|
+
return;
|
|
50
|
+
let entries;
|
|
51
|
+
try {
|
|
52
|
+
entries = readdirSync(dir);
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
for (const entry of entries) {
|
|
58
|
+
if (entry.startsWith(".") || entry === "node_modules" || entry === "dist")
|
|
59
|
+
continue;
|
|
60
|
+
const full = path.join(dir, entry);
|
|
61
|
+
if (statSync(full, { throwIfNoEntry: false })?.isDirectory() === true)
|
|
62
|
+
visit(full, level + 1);
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
visit(root, 0);
|
|
66
|
+
return found;
|
|
67
|
+
}
|
|
68
|
+
function str(args, key) {
|
|
69
|
+
const value = args[key];
|
|
70
|
+
return typeof value === "string" && value.trim() !== "" ? value.trim() : undefined;
|
|
71
|
+
}
|
|
72
|
+
/** Splits a Markdown document into its sections (by heading), for the search and the reading. */
|
|
73
|
+
function sections(markdown) {
|
|
74
|
+
const result = [];
|
|
75
|
+
let current = { heading: "", id: "", level: 1, lines: [] };
|
|
76
|
+
let code = false;
|
|
77
|
+
for (const line of markdown.split("\n")) {
|
|
78
|
+
if (line.startsWith("```"))
|
|
79
|
+
code = !code;
|
|
80
|
+
const heading = code ? null : /^(#{1,4})\s+(.+)$/.exec(line);
|
|
81
|
+
if (heading !== null) {
|
|
82
|
+
result.push({ heading: current.heading, id: current.id, level: current.level, text: current.lines.join("\n").trim() });
|
|
83
|
+
const title = (heading[2] ?? "").replace(/`/g, "");
|
|
84
|
+
current = { heading: title, id: headingId(heading[2] ?? ""), level: heading[1]?.length ?? 1, lines: [line] };
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
current.lines.push(line);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
result.push({ heading: current.heading, id: current.id, level: current.level, text: current.lines.join("\n").trim() });
|
|
91
|
+
return result.filter((s) => s.text !== "");
|
|
92
|
+
}
|
|
93
|
+
export class AgentServer {
|
|
94
|
+
workspace;
|
|
95
|
+
tools;
|
|
96
|
+
constructor(workspace) {
|
|
97
|
+
this.workspace = workspace;
|
|
98
|
+
this.workspace = path.resolve(workspace);
|
|
99
|
+
this.tools = this.defineTools();
|
|
100
|
+
}
|
|
101
|
+
/** The project folder of a call: given (inside the workspace), or the only one of the workspace. */
|
|
102
|
+
project(args) {
|
|
103
|
+
const given = str(args, "project");
|
|
104
|
+
if (given !== undefined) {
|
|
105
|
+
const full = path.resolve(this.workspace, given);
|
|
106
|
+
const relative = path.relative(this.workspace, full);
|
|
107
|
+
if (relative.startsWith("..") || path.isAbsolute(relative)) {
|
|
108
|
+
throw new ToolError(`${given}: outside the workspace ${this.workspace}`);
|
|
109
|
+
}
|
|
110
|
+
return full;
|
|
111
|
+
}
|
|
112
|
+
const projects = findProjects(this.workspace);
|
|
113
|
+
if (projects.length === 1 && projects[0] !== undefined)
|
|
114
|
+
return projects[0];
|
|
115
|
+
if (projects.length === 0)
|
|
116
|
+
throw new ToolError("no RAP project in the workspace: create one with rapt_new_business_object (project: a new folder)");
|
|
117
|
+
throw new ToolError(`several RAP projects, give "project": ${projects.map((p) => path.relative(this.workspace, p) || ".").join(", ")}`);
|
|
118
|
+
}
|
|
119
|
+
relative(full) {
|
|
120
|
+
return path.relative(this.workspace, full).split(path.sep).join("/") || ".";
|
|
121
|
+
}
|
|
122
|
+
defineTools() {
|
|
123
|
+
const docs = () => documentationSources();
|
|
124
|
+
return [
|
|
125
|
+
{
|
|
126
|
+
name: "rapt_projects",
|
|
127
|
+
title: "List the RAP projects",
|
|
128
|
+
description: "Lists the RAP projects (abapGit folders) of the workspace.",
|
|
129
|
+
inputSchema: { type: "object", properties: {} },
|
|
130
|
+
annotations: { readOnlyHint: true },
|
|
131
|
+
run: () => ({ workspace: this.workspace, projects: findProjects(this.workspace).map((p) => this.relative(p)) }),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "rapt_check",
|
|
135
|
+
title: "Check the project",
|
|
136
|
+
description: "Compiles the RAP project (CDS, BDEF, behavior pool ABAP with abaplint, service) without writing anything and returns its diagnostics: file, line, column, severity, code, message. Run it after each change until there are no errors.",
|
|
137
|
+
inputSchema: { type: "object", properties: { project: PROJECT, service: { type: "string", description: "Service definition, when the project has several." }, mode: { type: "string", enum: ["standard", "enhanced"] } } },
|
|
138
|
+
annotations: { readOnlyHint: true },
|
|
139
|
+
run: async (args) => {
|
|
140
|
+
const root = this.project(args);
|
|
141
|
+
const service = str(args, "service");
|
|
142
|
+
const mode = str(args, "mode");
|
|
143
|
+
const { diagnostics } = await generateApplication(loadProject(root), { scaffold: false, ...(service === undefined ? {} : { service }), ...(mode === undefined ? {} : { mode }) });
|
|
144
|
+
const items = diagnostics.sorted().map((d) => ({ ...d, ...(d.file === undefined ? {} : { file: this.relative(path.join(root, ...d.file.split("/"))) }) }));
|
|
145
|
+
return { project: this.relative(root), ok: !diagnostics.hasErrors(), counts: countDiagnostics(items), diagnostics: items };
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
name: "rapt_object_types",
|
|
150
|
+
title: "List the object types",
|
|
151
|
+
description: "The types of objects rapt_generate creates (table, view, projection, behavior definition, behavior pool, service…), with what each one is, what it derives from and its inputs; and the floorplans of the generated UI.",
|
|
152
|
+
inputSchema: { type: "object", properties: {} },
|
|
153
|
+
annotations: { readOnlyHint: true },
|
|
154
|
+
run: () => ({ objectTypes: OBJECT_CATALOG, floorplans: FLOORPLAN_CATALOG }),
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: "rapt_generate",
|
|
158
|
+
title: "Create an object",
|
|
159
|
+
description: "Writes one new object of the project, derived from an existing one as the ADT wizards do, with its abapGit XML: e.g. kind view from a table, projection from a view, behavior from a root entity, pool for a BDEF, service exposing entities, binding for a service. See rapt_object_types for the kinds and their inputs. Never overwrites a file.",
|
|
160
|
+
inputSchema: {
|
|
161
|
+
type: "object",
|
|
162
|
+
required: ["kind", "name"],
|
|
163
|
+
properties: {
|
|
164
|
+
project: PROJECT,
|
|
165
|
+
kind: { type: "string", enum: OBJECT_CATALOG.filter((e) => e.kind !== "bo").map((e) => e.kind) },
|
|
166
|
+
name: { type: "string", description: "Name of the new object (e.g. ZR_Order, ZBP_R_ORDER)." },
|
|
167
|
+
description: { type: "string", description: "Label (EndUserText.label)." },
|
|
168
|
+
from: { type: "string", description: "The object it derives from (view ← table, projection ← view, behavior/metadata/access ← entity, dataelement ← domain)." },
|
|
169
|
+
for: { type: "string", description: "The BDEF of a pool, the service definition of a binding." },
|
|
170
|
+
expose: { type: "array", items: { type: "string" }, description: "service: the exposed entities." },
|
|
171
|
+
root: { type: "boolean", description: "view, tableentity: a root entity." },
|
|
172
|
+
bindingType: { type: "string", enum: ["ui", "webapi"] },
|
|
173
|
+
type: { type: "string", description: "dataelement, domain: the built-in type (abap.char(10))." },
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
run: (args) => {
|
|
177
|
+
const root = this.project(args);
|
|
178
|
+
const kind = str(args, "kind");
|
|
179
|
+
const name = str(args, "name");
|
|
180
|
+
if (kind === undefined || name === undefined)
|
|
181
|
+
throw new ToolError("kind and name are required");
|
|
182
|
+
const expose = Array.isArray(args["expose"]) ? args["expose"].filter((e) => typeof e === "string") : undefined;
|
|
183
|
+
const options = Object.fromEntries(Object.entries({ from: str(args, "from"), for: str(args, "for"), bindingType: str(args, "bindingType"), type: str(args, "type"), description: str(args, "description") }).filter(([, v]) => v !== undefined));
|
|
184
|
+
const result = generateObject(root, kind, name, { ...options, ...(expose === undefined ? {} : { expose }), ...(args["root"] === true ? { root: true } : {}) });
|
|
185
|
+
if (result.error !== undefined)
|
|
186
|
+
throw new ToolError(result.error);
|
|
187
|
+
return { project: this.relative(root), written: result.written, next: "rapt_check" };
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "rapt_new_business_object",
|
|
192
|
+
title: "Create a complete business object",
|
|
193
|
+
description: "Writes a complete managed RAP business object, activatable on SAP: table, root view and projection, metadata extension (List Report and Object Page), behavior definitions, behavior pool, service definition and binding, initial data, abapGit XML. The project folder is created when it does not exist. Never overwrites a file.",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
type: "object",
|
|
196
|
+
required: ["entity"],
|
|
197
|
+
properties: {
|
|
198
|
+
project: { type: "string", description: "Folder of the project, relative to the workspace (created if needed). Default: the workspace." },
|
|
199
|
+
entity: { type: "string", description: "Name of the root entity, e.g. Travel." },
|
|
200
|
+
prefix: { type: "string", description: "Prefix of the object names (Z by default): ZRT gives zrt_travel, ZRT_R_Travel…" },
|
|
201
|
+
description: { type: "string" },
|
|
202
|
+
launchpad: { type: "boolean", description: "Add the application to the launchpad of the workspace (default true)." },
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
run: (args) => {
|
|
206
|
+
const given = str(args, "project");
|
|
207
|
+
const root = given === undefined ? this.workspace : path.resolve(this.workspace, given);
|
|
208
|
+
if (path.relative(this.workspace, root).startsWith(".."))
|
|
209
|
+
throw new ToolError(`${given ?? ""}: outside the workspace`);
|
|
210
|
+
const entity = str(args, "entity");
|
|
211
|
+
if (entity === undefined)
|
|
212
|
+
throw new ToolError("entity is required");
|
|
213
|
+
const prefix = str(args, "prefix");
|
|
214
|
+
const description = str(args, "description");
|
|
215
|
+
const result = newBusinessObject(root, entity, { ...(prefix === undefined ? {} : { prefix }), ...(description === undefined ? {} : { description }) });
|
|
216
|
+
if (result.error !== undefined)
|
|
217
|
+
throw new ToolError(result.error);
|
|
218
|
+
// as rapt new: the application joins the launchpad of the workspace (D69)
|
|
219
|
+
const launchpad = args["launchpad"] === false ? undefined : registerApp(root);
|
|
220
|
+
return { project: this.relative(root), written: result.written, ...(launchpad === undefined ? {} : { launchpad: { ...launchpad, file: this.relative(launchpad.file) } }), next: "rapt_check, then the user runs rapt dev" };
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
name: "rapt_floorplan",
|
|
225
|
+
title: "Floorplan of the UI",
|
|
226
|
+
description: "Without entitySet: the root entity sets of the service with their floorplan (chosen or default), and the floorplans with what each one needs. With entitySet and floorplan: sets the floorplan (listReport, worklist, analyticalListPage, formEntry) in rapt/config.json and adds the application to the launchpad of the workspace.",
|
|
227
|
+
inputSchema: { type: "object", properties: { project: PROJECT, entitySet: { type: "string" }, floorplan: { type: "string", enum: FLOORPLAN_CATALOG.map((f) => f.floorplan) }, launchpad: { type: "boolean", description: "Setting a floorplan adds the application to the launchpad of the workspace (default true)." } } },
|
|
228
|
+
run: (args) => {
|
|
229
|
+
const result = floorplans(this.project(args), str(args, "entitySet"), str(args, "floorplan"));
|
|
230
|
+
if (!result.ok)
|
|
231
|
+
throw new ToolError(result.error);
|
|
232
|
+
// as rapt floorplan: the application is created once its floorplan is chosen (D69)
|
|
233
|
+
const launchpad = "file" in result && args["launchpad"] !== false ? registerApp(result.root) : undefined;
|
|
234
|
+
return { ...result, root: this.relative(result.root), ...(launchpad === undefined ? {} : { launchpad: { ...launchpad, file: this.relative(launchpad.file) } }) };
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "rapt_abapgit",
|
|
239
|
+
title: "Write the abapGit files",
|
|
240
|
+
description: "Writes the abapGit XML files the sources lack (needed to import the project into an SAP system with abapGit); check: true only reports them.",
|
|
241
|
+
inputSchema: { type: "object", properties: { project: PROJECT, check: { type: "boolean" } } },
|
|
242
|
+
run: (args) => {
|
|
243
|
+
const root = this.project(args);
|
|
244
|
+
return { project: this.relative(root), ...generateAbapGitFiles(root, { check: args["check"] === true }) };
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
name: "rapt_docs_search",
|
|
249
|
+
title: "Search the documentation",
|
|
250
|
+
description: "Searches the documentation of Open RAP Runtime (guide, features, annotations, diagnostic codes, known gaps and workarounds, decisions…) and returns the best sections, to read with rapt_docs_read.",
|
|
251
|
+
inputSchema: { type: "object", required: ["query"], properties: { query: { type: "string" }, limit: { type: "integer", minimum: 1, maximum: 20 } } },
|
|
252
|
+
annotations: { readOnlyHint: true },
|
|
253
|
+
run: (args) => {
|
|
254
|
+
const query = str(args, "query");
|
|
255
|
+
if (query === undefined)
|
|
256
|
+
throw new ToolError("query is required");
|
|
257
|
+
const terms = query.toLowerCase().split(/[^\p{L}\p{N}_@.#-]+/u).filter((t) => t.length > 1);
|
|
258
|
+
const limit = typeof args["limit"] === "number" ? Math.min(20, Math.max(1, Math.floor(args["limit"]))) : 8;
|
|
259
|
+
const hits = docs().flatMap((page) => sections(page.markdown).map((s) => {
|
|
260
|
+
const text = s.text.toLowerCase();
|
|
261
|
+
const heading = s.heading.toLowerCase();
|
|
262
|
+
let score = 0;
|
|
263
|
+
for (const term of terms) {
|
|
264
|
+
const count = text.split(term).length - 1;
|
|
265
|
+
if (count === 0)
|
|
266
|
+
return { score: 0, page, s };
|
|
267
|
+
score += Math.min(count, 10) + (heading.includes(term) ? 10 : 0);
|
|
268
|
+
}
|
|
269
|
+
return { score, page, s };
|
|
270
|
+
}));
|
|
271
|
+
return {
|
|
272
|
+
results: hits
|
|
273
|
+
.filter((h) => h.score > 0)
|
|
274
|
+
.sort((a, b) => b.score - a.score)
|
|
275
|
+
.slice(0, limit)
|
|
276
|
+
.map((h) => {
|
|
277
|
+
const at = Math.max(0, h.s.text.toLowerCase().indexOf(terms[0] ?? "") - 80);
|
|
278
|
+
return { page: h.page.id, title: h.page.title, section: h.s.heading, sectionId: h.s.id, excerpt: h.s.text.slice(at, at + 300).replace(/\s+/g, " ") };
|
|
279
|
+
}),
|
|
280
|
+
};
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
name: "rapt_docs_read",
|
|
285
|
+
title: "Read the documentation",
|
|
286
|
+
description: "Returns a page of the documentation of Open RAP Runtime as Markdown (or one of its sections). Without page: the list of the pages.",
|
|
287
|
+
inputSchema: { type: "object", properties: { page: { type: "string", description: "e.g. guide, features, annotations, diagnostics, known_gaps, decisions, deployment, mcp." }, section: { type: "string", description: "A heading or section id of the page." } } },
|
|
288
|
+
annotations: { readOnlyHint: true },
|
|
289
|
+
run: (args) => {
|
|
290
|
+
const pages = docs();
|
|
291
|
+
const id = str(args, "page")?.toLowerCase().replace(/\.md$/, "");
|
|
292
|
+
if (id === undefined)
|
|
293
|
+
return { pages: pages.map((p) => ({ page: p.id, title: p.title })) };
|
|
294
|
+
const page = pages.find((p) => p.id === id);
|
|
295
|
+
if (page === undefined)
|
|
296
|
+
throw new ToolError(`${id}: no such page (${pages.map((p) => p.id).join(", ")})`);
|
|
297
|
+
const wanted = str(args, "section");
|
|
298
|
+
if (wanted === undefined)
|
|
299
|
+
return { page: page.id, title: page.title, markdown: page.markdown };
|
|
300
|
+
const all = sections(page.markdown);
|
|
301
|
+
const index = all.findIndex((s) => s.id === headingId(wanted) || s.id === wanted || s.heading.toLowerCase().includes(wanted.toLowerCase()));
|
|
302
|
+
if (index < 0)
|
|
303
|
+
throw new ToolError(`${wanted}: no such section of ${page.id}`);
|
|
304
|
+
const start = all[index];
|
|
305
|
+
// the section and its subsections
|
|
306
|
+
const parts = [start];
|
|
307
|
+
for (const s of all.slice(index + 1)) {
|
|
308
|
+
if (start === undefined || s.level <= start.level)
|
|
309
|
+
break;
|
|
310
|
+
parts.push(s);
|
|
311
|
+
}
|
|
312
|
+
return { page: page.id, title: page.title, section: start?.heading, markdown: parts.map((p) => p?.text).join("\n\n") };
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
/** Handles one JSON-RPC message; undefined for a notification. */
|
|
318
|
+
async handle(message) {
|
|
319
|
+
const id = message.id ?? null;
|
|
320
|
+
const reply = (body) => (message.id === undefined ? undefined : { jsonrpc: "2.0", id, ...body });
|
|
321
|
+
switch (message.method) {
|
|
322
|
+
case "initialize": {
|
|
323
|
+
const asked = typeof message.params?.["protocolVersion"] === "string" ? message.params["protocolVersion"] : undefined;
|
|
324
|
+
return reply({
|
|
325
|
+
result: {
|
|
326
|
+
protocolVersion: asked !== undefined && PROTOCOL_VERSIONS.includes(asked) ? asked : PROTOCOL_VERSIONS[0],
|
|
327
|
+
capabilities: { tools: { listChanged: false } },
|
|
328
|
+
serverInfo: { name: "rapt", title: "Open RAP Runtime", version: COMPILER_VERSION },
|
|
329
|
+
instructions: INSTRUCTIONS,
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
case "ping":
|
|
334
|
+
return reply({ result: {} });
|
|
335
|
+
case "tools/list":
|
|
336
|
+
return reply({ result: { tools: this.tools.map((t) => ({ name: t.name, title: t.title, description: t.description, inputSchema: t.inputSchema, annotations: { title: t.title, ...(t.annotations ?? {}) } })) } });
|
|
337
|
+
case "tools/call": {
|
|
338
|
+
const name = message.params?.["name"];
|
|
339
|
+
const tool = this.tools.find((t) => t.name === name);
|
|
340
|
+
if (tool === undefined)
|
|
341
|
+
return reply({ error: { code: -32602, message: `unknown tool ${String(name)}` } });
|
|
342
|
+
const args = typeof message.params?.["arguments"] === "object" && message.params["arguments"] !== null ? message.params["arguments"] : {};
|
|
343
|
+
try {
|
|
344
|
+
const result = await tool.run(args);
|
|
345
|
+
return reply({ result: { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], structuredContent: result, isError: false } });
|
|
346
|
+
}
|
|
347
|
+
catch (error) {
|
|
348
|
+
return reply({ result: { content: [{ type: "text", text: error.message }], isError: true } });
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
default:
|
|
352
|
+
if (message.method?.startsWith("notifications/") === true)
|
|
353
|
+
return undefined;
|
|
354
|
+
return reply({ error: { code: -32601, message: `method ${String(message.method)} not found` } });
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Serves the agent over stdio until stdin closes. Anything else written to stdout (a log of a
|
|
360
|
+
* library) would break the protocol: it goes to stderr.
|
|
361
|
+
*/
|
|
362
|
+
export async function serveAgent(workspace) {
|
|
363
|
+
const server = new AgentServer(workspace);
|
|
364
|
+
const write = process.stdout.write.bind(process.stdout);
|
|
365
|
+
process.stdout.write = ((chunk, ...rest) => process.stderr.write(chunk, ...rest));
|
|
366
|
+
console.log = console.error;
|
|
367
|
+
const send = (body) => {
|
|
368
|
+
write(`${JSON.stringify(body)}\n`);
|
|
369
|
+
};
|
|
370
|
+
let buffer = "";
|
|
371
|
+
let queue = Promise.resolve();
|
|
372
|
+
process.stdin.setEncoding("utf8");
|
|
373
|
+
process.stdin.on("data", (chunk) => {
|
|
374
|
+
buffer += chunk;
|
|
375
|
+
let newline = buffer.indexOf("\n");
|
|
376
|
+
while (newline >= 0) {
|
|
377
|
+
const line = buffer.slice(0, newline).trim();
|
|
378
|
+
buffer = buffer.slice(newline + 1);
|
|
379
|
+
newline = buffer.indexOf("\n");
|
|
380
|
+
if (line === "")
|
|
381
|
+
continue;
|
|
382
|
+
// one message at a time, in order: the compiler is not reentrant on the same project
|
|
383
|
+
queue = queue.then(async () => {
|
|
384
|
+
let message;
|
|
385
|
+
try {
|
|
386
|
+
message = JSON.parse(line);
|
|
387
|
+
}
|
|
388
|
+
catch {
|
|
389
|
+
send({ jsonrpc: "2.0", id: null, error: { code: -32700, message: "parse error" } });
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
const messages = Array.isArray(message) ? message : [message];
|
|
393
|
+
const replies = [];
|
|
394
|
+
for (const m of messages) {
|
|
395
|
+
const r = await server.handle(m);
|
|
396
|
+
if (r !== undefined)
|
|
397
|
+
replies.push(r);
|
|
398
|
+
}
|
|
399
|
+
if (replies.length > 0)
|
|
400
|
+
send(Array.isArray(message) ? replies : replies[0]);
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
await new Promise((resolve) => process.stdin.once("end", resolve));
|
|
405
|
+
await queue;
|
|
406
|
+
return 0;
|
|
407
|
+
}
|
|
408
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/agent/server.ts"],"names":[],"mappings":"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|
|
1
|
+
/**
|
|
2
|
+
* `rapt abapgit` (decision D42): writes the abapGit metadata (`.xml` files, `.abapgit.xml`,
|
|
3
|
+
* `package.devc.xml`) the sources lack, so that a project written only as source code can be
|
|
4
|
+
* pulled into an SAP system with abapGit.
|
|
5
|
+
*
|
|
6
|
+
* - tables written as source (`.tabl.astabl`): their XML is (re)generated from the source, and
|
|
7
|
+
* `.abapgit.xml` ignores the `.astabl` files (abapGit does not know them);
|
|
8
|
+
* - CDS entities, metadata extensions, access controls, behavior definitions, service
|
|
9
|
+
* definitions, classes and interfaces: the XML is created when missing (description from
|
|
10
|
+
* `@EndUserText.label` or the ABAP Doc short text, CDS source type from the source); an existing
|
|
11
|
+
* XML file is never changed.
|
|
12
|
+
*/
|
|
13
|
+
import { type ProjectIssue } from "../input/project.js";
|
|
14
|
+
export interface AbapGitOptions {
|
|
15
|
+
/** Only report what would be written (exit code 1 when something is missing). */
|
|
16
|
+
check?: boolean;
|
|
17
|
+
/** Description of the package (package.devc.xml), default: the folder name. */
|
|
18
|
+
packageDescription?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface AbapGitResult {
|
|
21
|
+
/** Files written (or to write, with `check`), relative to the project root. */
|
|
22
|
+
written: string[];
|
|
23
|
+
/** Objects whose XML cannot be derived from a source. */
|
|
24
|
+
skipped: {
|
|
25
|
+
file: string;
|
|
26
|
+
reason: string;
|
|
27
|
+
}[];
|
|
28
|
+
issues: ProjectIssue[];
|
|
29
|
+
}
|
|
30
|
+
/** The AFF metadata of a CDS type (DRTY): `<name>.drty.json`, format of SAP/abap-file-formats. */
|
|
31
|
+
export declare function drtyJson(description: string): string;
|
|
32
|
+
/** `@EndUserText.label: '…'` before the definition. */
|
|
33
|
+
export declare function cdsLabel(source: string): string | undefined;
|
|
34
|
+
/** Source type of a CDS DDL source (DDLS-SOURCE_TYPE). */
|
|
35
|
+
export declare function ddlSourceType(source: string): string | undefined;
|
|
36
|
+
/** The ABAP Doc short text of a class or interface: `"! <p class="shorttext synchronized">…</p>`. */
|
|
37
|
+
export declare function abapDocShortText(source: string): string | undefined;
|
|
38
|
+
export declare function generateAbapGitFiles(dir: string, options?: AbapGitOptions): AbapGitResult;
|