@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
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The UI of the launchpad (decision D37), plain OpenUI5 (sap.m, sap.f): the counterpart of the
|
|
3
|
+
* SAP Fiori launchpad, whose shell (sap.ushell) exists in SAPUI5 only. A ShellBar (home, search,
|
|
4
|
+
* user menu with the logout), the groups of tiles of `/launchpad/config` (GenericTile; a
|
|
5
|
+
* NumericContent for the tiles with a count) and the navigation by intent (`#Travel-manage`).
|
|
6
|
+
*/
|
|
7
|
+
const esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
8
|
+
export function launchpadIndexHtml(title) {
|
|
9
|
+
return `<!DOCTYPE html>
|
|
10
|
+
<html lang="en">
|
|
11
|
+
<head>
|
|
12
|
+
<meta charset="utf-8">
|
|
13
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
14
|
+
<title>${esc(title)}</title>
|
|
15
|
+
<link rel="icon" href="logo.svg" type="image/svg+xml">
|
|
16
|
+
<script id="sap-ui-bootstrap" src="../resources/sap-ui-core.js"
|
|
17
|
+
data-sap-ui-theme="sap_horizon"
|
|
18
|
+
data-sap-ui-async="true"
|
|
19
|
+
data-sap-ui-compat-version="edge"
|
|
20
|
+
data-sap-ui-resource-roots='{"rapt.launchpad": "./"}'
|
|
21
|
+
data-sap-ui-on-init="module:sap/ui/core/ComponentSupport"></script>
|
|
22
|
+
<style>html, body { height: 100%; margin: 0; }</style>
|
|
23
|
+
</head>
|
|
24
|
+
<body class="sapUiBody" id="content">
|
|
25
|
+
<div data-sap-ui-component data-name="rapt.launchpad" data-id="container" data-height="100%" data-settings='{"id": "launchpad"}' style="height: 100%"></div>
|
|
26
|
+
</body>
|
|
27
|
+
</html>
|
|
28
|
+
`;
|
|
29
|
+
}
|
|
30
|
+
export function launchpadManifest(title) {
|
|
31
|
+
return `${JSON.stringify({
|
|
32
|
+
"_version": "1.65.0",
|
|
33
|
+
"sap.app": { id: "rapt.launchpad", type: "application", title, applicationVersion: { version: "1.0.0" } },
|
|
34
|
+
"sap.ui": { technology: "UI5", deviceTypes: { desktop: true, tablet: true, phone: true } },
|
|
35
|
+
"sap.ui5": {
|
|
36
|
+
rootView: { viewName: "rapt.launchpad.view.Launchpad", type: "XML", id: "home" },
|
|
37
|
+
dependencies: { minUI5Version: "1.136.0", libs: { "sap.m": {}, "sap.f": {} } },
|
|
38
|
+
contentDensities: { compact: true, cozy: true },
|
|
39
|
+
resources: { css: [{ uri: "css/style.css" }] },
|
|
40
|
+
},
|
|
41
|
+
}, null, 2)}\n`;
|
|
42
|
+
}
|
|
43
|
+
export const LAUNCHPAD_COMPONENT = `sap.ui.define([
|
|
44
|
+
"sap/ui/core/UIComponent",
|
|
45
|
+
"sap/ui/model/json/JSONModel"
|
|
46
|
+
], function (UIComponent, JSONModel) {
|
|
47
|
+
"use strict";
|
|
48
|
+
|
|
49
|
+
return UIComponent.extend("rapt.launchpad.Component", {
|
|
50
|
+
metadata: { manifest: "json", interfaces: ["sap.ui.core.IAsyncContentCreation"] },
|
|
51
|
+
|
|
52
|
+
init: function () {
|
|
53
|
+
UIComponent.prototype.init.apply(this, arguments);
|
|
54
|
+
this.setModel(new JSONModel({ title: "", user: {}, logout: "", groups: [], spaces: [], space: "", page: "", pages: [], counts: {}, loaded: false, error: "", emptyText: "" }));
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
`;
|
|
59
|
+
export const LAUNCHPAD_VIEW = `<mvc:View controllerName="rapt.launchpad.controller.Launchpad" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:f="sap.f" xmlns:core="sap.ui.core" displayBlock="true" height="100%">
|
|
60
|
+
<Page id="page" enableScrolling="true" class="raptLaunchpad">
|
|
61
|
+
<customHeader>
|
|
62
|
+
<f:ShellBar id="shellBar" title="{/title}" homeIcon="logo.svg" homeIconTooltip="Home" homeIconPressed=".onHome" avatarPressed=".onAvatarPressed">
|
|
63
|
+
<f:searchManager>
|
|
64
|
+
<f:SearchManager id="search" placeholder="Search for apps" liveChange=".onSearch" search=".onSearch"/>
|
|
65
|
+
</f:searchManager>
|
|
66
|
+
<f:profile>
|
|
67
|
+
<Avatar id="avatar" initials="{/user/initials}" tooltip="{/user/name}"/>
|
|
68
|
+
</f:profile>
|
|
69
|
+
</f:ShellBar>
|
|
70
|
+
</customHeader>
|
|
71
|
+
<content>
|
|
72
|
+
<MessageStrip id="message" visible="{= \${/error} !== '' }" text="{/error}" type="Error" showIcon="true" class="sapUiSmallMargin"/>
|
|
73
|
+
<IconTabHeader id="spaces" visible="{= \${/spaces}.length > 1 }" selectedKey="{/space}" select=".onSpaceSelect" mode="Inline"
|
|
74
|
+
items="{path: '/spaces', templateShareable: false}">
|
|
75
|
+
<items><IconTabFilter key="{id}" text="{title}"/></items>
|
|
76
|
+
</IconTabHeader>
|
|
77
|
+
<HBox id="pageBar" visible="{= \${/pages}.length > 1 }" alignItems="Center" class="raptLaunchpadPages">
|
|
78
|
+
<Label text="Page" labelFor="pages" class="sapUiTinyMarginEnd"/>
|
|
79
|
+
<Select id="pages" selectedKey="{/page}" change=".onPageSelect" items="{path: '/pages', templateShareable: false}">
|
|
80
|
+
<items><core:Item key="{id}" text="{title}"/></items>
|
|
81
|
+
</Select>
|
|
82
|
+
</HBox>
|
|
83
|
+
<VBox id="groups" class="raptLaunchpadGroups"/>
|
|
84
|
+
<Text id="empty" visible="{= \${/emptyText} !== '' }" text="{/emptyText}" class="raptLaunchpadEmpty"/>
|
|
85
|
+
</content>
|
|
86
|
+
</Page>
|
|
87
|
+
</mvc:View>
|
|
88
|
+
`;
|
|
89
|
+
export const LAUNCHPAD_CONTROLLER = `sap.ui.define([
|
|
90
|
+
"sap/ui/core/mvc/Controller",
|
|
91
|
+
"sap/m/GenericTile",
|
|
92
|
+
"sap/m/TileContent",
|
|
93
|
+
"sap/m/NumericContent",
|
|
94
|
+
"sap/m/ImageContent",
|
|
95
|
+
"sap/m/Title",
|
|
96
|
+
"sap/m/FlexBox",
|
|
97
|
+
"sap/m/VBox",
|
|
98
|
+
"sap/m/Text",
|
|
99
|
+
"sap/m/Button",
|
|
100
|
+
"sap/m/ResponsivePopover"
|
|
101
|
+
], function (Controller, GenericTile, TileContent, NumericContent, ImageContent, Title, FlexBox, VBox, Text, Button, ResponsivePopover) {
|
|
102
|
+
"use strict";
|
|
103
|
+
|
|
104
|
+
var INTENT = /^([A-Za-z][A-Za-z0-9_]*-[A-Za-z][A-Za-z0-9_]*)(\\?.*)?$/;
|
|
105
|
+
|
|
106
|
+
/** The menu of the user: its identifier, and the logout of the OIDC sessions. */
|
|
107
|
+
function userMenu(sId, oUser, sLogout) {
|
|
108
|
+
var aItems = [];
|
|
109
|
+
if (oUser.id !== oUser.name) {
|
|
110
|
+
aItems.push(new Text({ text: oUser.id }));
|
|
111
|
+
}
|
|
112
|
+
if (!sLogout) {
|
|
113
|
+
aItems.push(new Text({ text: "Development user (no login)" }));
|
|
114
|
+
}
|
|
115
|
+
var oMenu = new ResponsivePopover(sId, { title: oUser.name, placement: "Bottom", contentMinWidth: "12rem" });
|
|
116
|
+
if (aItems.length > 0) {
|
|
117
|
+
oMenu.addContent(new VBox({ items: aItems }).addStyleClass("sapUiSmallMargin"));
|
|
118
|
+
}
|
|
119
|
+
if (sLogout) {
|
|
120
|
+
oMenu.setBeginButton(new Button(sId + "-logout", {
|
|
121
|
+
text: "Sign Out",
|
|
122
|
+
icon: "sap-icon://log",
|
|
123
|
+
press: function () {
|
|
124
|
+
window.location.assign(sLogout);
|
|
125
|
+
}
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
return oMenu;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return Controller.extend("rapt.launchpad.controller.Launchpad", {
|
|
132
|
+
onInit: function () {
|
|
133
|
+
var that = this;
|
|
134
|
+
this._sQuery = "";
|
|
135
|
+
fetch("/launchpad/config", { credentials: "same-origin", headers: { accept: "application/json" } })
|
|
136
|
+
.then(function (oResponse) {
|
|
137
|
+
if (!oResponse.ok) {
|
|
138
|
+
throw new Error("The launchpad answered " + oResponse.status);
|
|
139
|
+
}
|
|
140
|
+
return oResponse.json();
|
|
141
|
+
})
|
|
142
|
+
.then(function (oConfig) {
|
|
143
|
+
var oModel = that._model();
|
|
144
|
+
oModel.setProperty("/title", oConfig.title);
|
|
145
|
+
oModel.setProperty("/user", oConfig.user);
|
|
146
|
+
oModel.setProperty("/logout", oConfig.logout || "");
|
|
147
|
+
oModel.setProperty("/groups", oConfig.groups);
|
|
148
|
+
oModel.setProperty("/spaces", oConfig.spaces || [{ id: "home", title: oConfig.title, pages: [{ id: "home", title: oConfig.title, groups: oConfig.groups }] }]);
|
|
149
|
+
that._selectSpace(that._rememberedSpace());
|
|
150
|
+
document.title = oConfig.title;
|
|
151
|
+
// #SemanticObject-action: straight to the application of the intent
|
|
152
|
+
if (that._navigateToIntent()) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
that._render();
|
|
156
|
+
that._loadCounts();
|
|
157
|
+
oModel.setProperty("/loaded", true);
|
|
158
|
+
})
|
|
159
|
+
.catch(function (oError) {
|
|
160
|
+
that._model().setProperty("/error", oError.message);
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
|
|
164
|
+
_model: function () {
|
|
165
|
+
return this.getOwnerComponent().getModel();
|
|
166
|
+
},
|
|
167
|
+
|
|
168
|
+
_tiles: function () {
|
|
169
|
+
return this._model().getProperty("/groups").reduce(function (aAll, oGroup) {
|
|
170
|
+
return aAll.concat(oGroup.tiles);
|
|
171
|
+
}, []);
|
|
172
|
+
},
|
|
173
|
+
|
|
174
|
+
/** The space shown last (local storage), else the first one. */
|
|
175
|
+
_rememberedSpace: function () {
|
|
176
|
+
try {
|
|
177
|
+
return window.localStorage.getItem("rapt.launchpad.space") || "";
|
|
178
|
+
} catch (e) {
|
|
179
|
+
return "";
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
_selectSpace: function (sId, sPage) {
|
|
184
|
+
var oModel = this._model();
|
|
185
|
+
var aSpaces = oModel.getProperty("/spaces");
|
|
186
|
+
var oSpace = aSpaces.find(function (s) { return s.id === sId; }) || aSpaces[0];
|
|
187
|
+
if (!oSpace) {
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
oModel.setProperty("/space", oSpace.id);
|
|
191
|
+
oModel.setProperty("/pages", oSpace.pages);
|
|
192
|
+
var oPage = oSpace.pages.find(function (p) { return p.id === sPage; }) || oSpace.pages[0];
|
|
193
|
+
oModel.setProperty("/page", oPage ? oPage.id : "");
|
|
194
|
+
try {
|
|
195
|
+
window.localStorage.setItem("rapt.launchpad.space", oSpace.id);
|
|
196
|
+
} catch (e) {
|
|
197
|
+
// the space is not remembered
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
onSpaceSelect: function (oEvent) {
|
|
202
|
+
this._selectSpace(oEvent.getParameter("key"));
|
|
203
|
+
this._render();
|
|
204
|
+
},
|
|
205
|
+
|
|
206
|
+
onPageSelect: function (oEvent) {
|
|
207
|
+
this._model().setProperty("/page", oEvent.getParameter("selectedItem").getKey());
|
|
208
|
+
this._render();
|
|
209
|
+
},
|
|
210
|
+
|
|
211
|
+
/** The sections shown: those of the current page; while searching, every section of every space. */
|
|
212
|
+
_shownGroups: function () {
|
|
213
|
+
var oModel = this._model();
|
|
214
|
+
if (this._sQuery) {
|
|
215
|
+
return oModel.getProperty("/groups");
|
|
216
|
+
}
|
|
217
|
+
var oPage = (oModel.getProperty("/pages") || []).find(function (p) { return p.id === oModel.getProperty("/page"); });
|
|
218
|
+
return oPage ? oPage.groups : oModel.getProperty("/groups");
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
_navigateToIntent: function () {
|
|
222
|
+
var sHash = window.location.hash.replace(/^#/, "");
|
|
223
|
+
try {
|
|
224
|
+
sHash = decodeURIComponent(sHash);
|
|
225
|
+
} catch (e) {
|
|
226
|
+
// kept as written
|
|
227
|
+
}
|
|
228
|
+
var aMatch = INTENT.exec(sHash);
|
|
229
|
+
if (!aMatch || aMatch[1] === "Shell-home") {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
var oTile = this._tiles().find(function (t) {
|
|
233
|
+
return t.intent === aMatch[1];
|
|
234
|
+
});
|
|
235
|
+
if (!oTile) {
|
|
236
|
+
this._model().setProperty("/error", "No application of the launchpad for the intent " + aMatch[1]);
|
|
237
|
+
return false;
|
|
238
|
+
}
|
|
239
|
+
var sQuery = aMatch[2] || "";
|
|
240
|
+
window.location.replace(oTile.target + (sQuery && oTile.target.indexOf("?") >= 0 ? "&" + sQuery.slice(1) : sQuery));
|
|
241
|
+
return true;
|
|
242
|
+
},
|
|
243
|
+
|
|
244
|
+
_render: function () {
|
|
245
|
+
var that = this;
|
|
246
|
+
var oBox = this.byId("groups");
|
|
247
|
+
var sQuery = this._sQuery.toLowerCase();
|
|
248
|
+
var iVisible = 0;
|
|
249
|
+
oBox.destroyItems();
|
|
250
|
+
this._shownGroups().forEach(function (oGroup) {
|
|
251
|
+
var aTiles = oGroup.tiles.filter(function (t) {
|
|
252
|
+
return !sQuery || [t.title, t.subtitle, t.info].some(function (s) {
|
|
253
|
+
return !!s && s.toLowerCase().indexOf(sQuery) >= 0;
|
|
254
|
+
});
|
|
255
|
+
});
|
|
256
|
+
if (aTiles.length === 0) {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
iVisible += aTiles.length;
|
|
260
|
+
var oTiles = new FlexBox({ wrap: "Wrap", renderType: "Bare" }).addStyleClass("raptLaunchpadTiles");
|
|
261
|
+
aTiles.forEach(function (oTile) {
|
|
262
|
+
oTiles.addItem(that._tile(oTile));
|
|
263
|
+
});
|
|
264
|
+
oBox.addItem(new VBox({ items: [new Title({ text: oGroup.title, level: "H2", titleStyle: "H4" }).addStyleClass("raptLaunchpadGroupTitle"), oTiles] }).addStyleClass("raptLaunchpadGroup"));
|
|
265
|
+
});
|
|
266
|
+
this._model().setProperty("/emptyText", iVisible > 0 ? "" : sQuery ? "No app matches the search." : "No application is assigned to your roles.");
|
|
267
|
+
},
|
|
268
|
+
|
|
269
|
+
_tile: function (oTile) {
|
|
270
|
+
var oContent;
|
|
271
|
+
if (oTile.count) {
|
|
272
|
+
oContent = new NumericContent({ value: "{/counts/" + oTile.id + "}", icon: oTile.icon, withMargin: false, nullifyValue: false, animateTextChange: false });
|
|
273
|
+
} else if (oTile.icon) {
|
|
274
|
+
oContent = new ImageContent({ src: oTile.icon });
|
|
275
|
+
}
|
|
276
|
+
return new GenericTile(this.createId("tile-" + oTile.id), {
|
|
277
|
+
header: oTile.title,
|
|
278
|
+
subheader: oTile.subtitle,
|
|
279
|
+
press: this._open.bind(this, oTile),
|
|
280
|
+
tileContent: [new TileContent({ footer: oTile.info, content: oContent })]
|
|
281
|
+
}).addStyleClass("raptLaunchpadTile");
|
|
282
|
+
},
|
|
283
|
+
|
|
284
|
+
/** The dynamic tiles: the $count of an entity set of an application, with the access controls of the user. */
|
|
285
|
+
_loadCounts: function () {
|
|
286
|
+
var oModel = this._model();
|
|
287
|
+
this._tiles().filter(function (t) {
|
|
288
|
+
return !!t.count;
|
|
289
|
+
}).forEach(function (oTile) {
|
|
290
|
+
fetch(oTile.count, { credentials: "same-origin", headers: { accept: "text/plain" } })
|
|
291
|
+
.then(function (oResponse) {
|
|
292
|
+
return oResponse.ok ? oResponse.text() : "";
|
|
293
|
+
})
|
|
294
|
+
.then(function (sCount) {
|
|
295
|
+
oModel.setProperty("/counts/" + oTile.id, sCount.trim());
|
|
296
|
+
})
|
|
297
|
+
.catch(function () {
|
|
298
|
+
oModel.setProperty("/counts/" + oTile.id, "");
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
},
|
|
302
|
+
|
|
303
|
+
_open: function (oTile) {
|
|
304
|
+
if (oTile.external) {
|
|
305
|
+
window.open(oTile.target, "_blank", "noopener");
|
|
306
|
+
} else {
|
|
307
|
+
window.location.assign(oTile.target);
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
|
|
311
|
+
onHome: function () {
|
|
312
|
+
window.location.assign("/");
|
|
313
|
+
},
|
|
314
|
+
|
|
315
|
+
onSearch: function (oEvent) {
|
|
316
|
+
var sValue = oEvent.getParameter("newValue");
|
|
317
|
+
this._sQuery = (sValue === undefined ? oEvent.getParameter("query") : sValue) || "";
|
|
318
|
+
this._render();
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
onAvatarPressed: function (oEvent) {
|
|
322
|
+
if (!this._oUserMenu) {
|
|
323
|
+
this._oUserMenu = userMenu(this.createId("userMenu"), this._model().getProperty("/user"), this._model().getProperty("/logout"));
|
|
324
|
+
this.getView().addDependent(this._oUserMenu);
|
|
325
|
+
}
|
|
326
|
+
this._oUserMenu.openBy(oEvent.getParameter("avatar"));
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
`;
|
|
331
|
+
export const LAUNCHPAD_CSS = `.raptLaunchpadGroups { padding: 1rem 2rem 0 2rem; }
|
|
332
|
+
.raptLaunchpadPages { padding: 0.75rem 2rem 0 2rem; }
|
|
333
|
+
.raptLaunchpadGroup { margin-bottom: 1.5rem; }
|
|
334
|
+
.raptLaunchpadGroupTitle { margin: 0 0 0.75rem 0; }
|
|
335
|
+
.raptLaunchpadTile { margin: 0 1rem 1rem 0; }
|
|
336
|
+
.raptLaunchpadEmpty { display: block; margin: 2rem; }
|
|
337
|
+
@media (max-width: 599px) {
|
|
338
|
+
.raptLaunchpadGroups { padding: 1rem 1rem 0 1rem; }
|
|
339
|
+
.raptLaunchpadTile { margin: 0 0.5rem 0.5rem 0; }
|
|
340
|
+
}
|
|
341
|
+
`;
|
|
342
|
+
/** The mark of the launchpad: four tiles. */
|
|
343
|
+
export const LAUNCHPAD_LOGO = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
|
|
344
|
+
<rect x="3" y="3" width="11" height="11" rx="2.5" fill="#0070f2"/>
|
|
345
|
+
<rect x="18" y="3" width="11" height="11" rx="2.5" fill="#0070f2" fill-opacity="0.6"/>
|
|
346
|
+
<rect x="3" y="18" width="11" height="11" rx="2.5" fill="#0070f2" fill-opacity="0.6"/>
|
|
347
|
+
<rect x="18" y="18" width="11" height="11" rx="2.5" fill="#0070f2"/>
|
|
348
|
+
</svg>
|
|
349
|
+
`;
|
|
350
|
+
//# sourceMappingURL=ui.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/gen/launchpad/ui.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAEhI,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,OAAO;;;;;WAKE,GAAG,CAAC,KAAK,CAAC;;;;;;;;;;;;;;CAcpB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,KAAa;IAC7C,OAAO,GAAG,IAAI,CAAC,SAAS,CACtB;QACE,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,kBAAkB,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QACzG,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QAC1F,SAAS,EAAE;YACT,QAAQ,EAAE,EAAE,QAAQ,EAAE,+BAA+B,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE;YAChF,YAAY,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,EAAE;YAC9E,gBAAgB,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;YAC/C,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,EAAE;SAC/C;KACF,EACD,IAAI,EACJ,CAAC,CACF,IAAI,CAAC;AACR,CAAC;AAED,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;CAelC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6B7B,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiPnC,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG;;;;;;;;;;CAU5B,CAAC;AAEF,6CAA6C;AAC7C,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;CAM7B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP tools of the service (decision D47): for each entity set, list, get, create, update and
|
|
3
|
+
* delete, and each action and function, as RAP exposes them in OData. Their descriptions come from
|
|
4
|
+
* the UI and CDS labels, unless `rapt/mcp.json` gives one (it may also turn a tool off). `rapt mcp`
|
|
5
|
+
* writes that file with every tool, for the developer to explain each one.
|
|
6
|
+
*/
|
|
7
|
+
import { type McpToolModel, type McpToolsModel, type Model } from "@open-rap/model";
|
|
8
|
+
import type { Diagnostics } from "../diagnostics.js";
|
|
9
|
+
import type { Project } from "../input/project.js";
|
|
10
|
+
export declare const MCP_FILE = "rapt/mcp.json";
|
|
11
|
+
/** `rapt/mcp.json`: the server and, per tool, a description (or false: the tool is not offered). */
|
|
12
|
+
export interface McpConfig {
|
|
13
|
+
server?: {
|
|
14
|
+
name?: string;
|
|
15
|
+
instructions?: string;
|
|
16
|
+
};
|
|
17
|
+
tools?: Record<string, string | false>;
|
|
18
|
+
}
|
|
19
|
+
export declare function loadMcpConfig(project: Project, diagnostics: Diagnostics): McpConfig | undefined;
|
|
20
|
+
/** Every tool of the service, with its default description. */
|
|
21
|
+
export declare function defaultMcpTools(model: Model): McpToolModel[];
|
|
22
|
+
/** The tools of the application: the defaults, with the descriptions and choices of rapt/mcp.json. */
|
|
23
|
+
export declare function buildMcpTools(model: Model, config: McpConfig, diagnostics: Diagnostics): McpToolsModel;
|
package/dist/gen/mcp.js
ADDED
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The MCP tools of the service (decision D47): for each entity set, list, get, create, update and
|
|
3
|
+
* delete, and each action and function, as RAP exposes them in OData. Their descriptions come from
|
|
4
|
+
* the UI and CDS labels, unless `rapt/mcp.json` gives one (it may also turn a tool off). `rapt mcp`
|
|
5
|
+
* writes that file with every tool, for the developer to explain each one.
|
|
6
|
+
*/
|
|
7
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
import { buildODataService, findEntity, getAnnotation, } from "@open-rap/model";
|
|
10
|
+
export const MCP_FILE = "rapt/mcp.json";
|
|
11
|
+
export function loadMcpConfig(project, diagnostics) {
|
|
12
|
+
const file = path.join(project.root, MCP_FILE);
|
|
13
|
+
if (!existsSync(file)) {
|
|
14
|
+
return undefined;
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const json = JSON.parse(readFileSync(file, "utf8"));
|
|
18
|
+
if (typeof json !== "object" || json === null || Array.isArray(json)) {
|
|
19
|
+
throw new Error("expected an object { server, tools }");
|
|
20
|
+
}
|
|
21
|
+
return json;
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
diagnostics.error("MCP001", `${MCP_FILE}: ${error.message}`, { file: MCP_FILE, line: 1 });
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function schemaOf(edm, description) {
|
|
29
|
+
const withDescription = (s) => (description === undefined ? s : { ...s, description });
|
|
30
|
+
switch (edm.type) {
|
|
31
|
+
case "Edm.Boolean":
|
|
32
|
+
return withDescription({ type: "boolean" });
|
|
33
|
+
case "Edm.Byte":
|
|
34
|
+
case "Edm.Int16":
|
|
35
|
+
case "Edm.Int32":
|
|
36
|
+
case "Edm.Int64":
|
|
37
|
+
return withDescription({ type: "integer" });
|
|
38
|
+
case "Edm.Decimal":
|
|
39
|
+
case "Edm.Double":
|
|
40
|
+
return withDescription({ type: "number" });
|
|
41
|
+
case "Edm.Date":
|
|
42
|
+
return withDescription({ type: "string", format: "date" });
|
|
43
|
+
case "Edm.DateTimeOffset":
|
|
44
|
+
return withDescription({ type: "string", format: "date-time" });
|
|
45
|
+
case "Edm.TimeOfDay":
|
|
46
|
+
return withDescription({ type: "string", pattern: "^\\d{2}:\\d{2}:\\d{2}$" });
|
|
47
|
+
case "Edm.Guid":
|
|
48
|
+
return withDescription({ type: "string", format: "uuid" });
|
|
49
|
+
default: {
|
|
50
|
+
const s = { type: "string" };
|
|
51
|
+
if (edm.maxLength !== undefined)
|
|
52
|
+
s.maxLength = edm.maxLength;
|
|
53
|
+
if (edm.digitSequence === true)
|
|
54
|
+
s.pattern = "^\\d*$";
|
|
55
|
+
return withDescription(s);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
class ToolBuilder {
|
|
60
|
+
model;
|
|
61
|
+
service;
|
|
62
|
+
tools = [];
|
|
63
|
+
constructor(model) {
|
|
64
|
+
this.model = model;
|
|
65
|
+
this.service = buildODataService(model);
|
|
66
|
+
}
|
|
67
|
+
labelOf(type, property) {
|
|
68
|
+
const entity = findEntity(this.model, type.entity);
|
|
69
|
+
const field = entity?.fields.find((f) => f.name === type.properties.find((p) => p.name === property)?.field);
|
|
70
|
+
const label = getAnnotation(field?.annotations, "EndUserText.label");
|
|
71
|
+
const quickInfo = getAnnotation(field?.annotations, "EndUserText.quickInfo");
|
|
72
|
+
return typeof quickInfo === "string" ? quickInfo : typeof label === "string" ? label : undefined;
|
|
73
|
+
}
|
|
74
|
+
names(type, set) {
|
|
75
|
+
const entity = findEntity(this.model, type.entity);
|
|
76
|
+
const header = getAnnotation(entity?.annotations, "UI.headerInfo");
|
|
77
|
+
const record = typeof header === "object" && header !== null && !Array.isArray(header) ? header : {};
|
|
78
|
+
const singular = typeof record["typename"] === "string" ? record["typename"] : set;
|
|
79
|
+
const plural = typeof record["typenameplural"] === "string" ? record["typenameplural"] : `${singular} entries`;
|
|
80
|
+
return { singular, plural };
|
|
81
|
+
}
|
|
82
|
+
keySchema(type) {
|
|
83
|
+
const properties = {};
|
|
84
|
+
for (const key of type.keys) {
|
|
85
|
+
const property = type.properties.find((p) => p.name === key);
|
|
86
|
+
if (property !== undefined)
|
|
87
|
+
properties[key] = schemaOf(property.edm, this.labelOf(type, key));
|
|
88
|
+
}
|
|
89
|
+
return { properties, required: [...type.keys] };
|
|
90
|
+
}
|
|
91
|
+
keys(type) {
|
|
92
|
+
return type.keys.map((k) => ({ name: k, edm: type.properties.find((p) => p.name === k)?.edm.type ?? "Edm.String" }));
|
|
93
|
+
}
|
|
94
|
+
/** Writable properties of a create (not computed) or an update (neither computed nor immutable). */
|
|
95
|
+
writable(type, update) {
|
|
96
|
+
const properties = {};
|
|
97
|
+
const fields = [];
|
|
98
|
+
const required = [];
|
|
99
|
+
for (const p of type.properties) {
|
|
100
|
+
if (p.computed || p.name.startsWith("__") || (update && (p.immutable || p.key)))
|
|
101
|
+
continue;
|
|
102
|
+
properties[p.name] = schemaOf(p.edm, this.labelOf(type, p.name));
|
|
103
|
+
fields.push({ name: p.name, edm: p.edm.type });
|
|
104
|
+
if (!update && p.mandatory)
|
|
105
|
+
required.push(p.name);
|
|
106
|
+
}
|
|
107
|
+
return { properties, fields, required };
|
|
108
|
+
}
|
|
109
|
+
build() {
|
|
110
|
+
for (const set of this.service.entitySets) {
|
|
111
|
+
const type = this.service.entityTypes.find((t) => t.name === set.entityType);
|
|
112
|
+
if (type === undefined || set.draftAdministrativeData === true)
|
|
113
|
+
continue;
|
|
114
|
+
const { singular, plural } = this.names(type, set.name);
|
|
115
|
+
const help = set.valueHelp === true ? " (value help)" : "";
|
|
116
|
+
const filterable = type.properties.filter((p) => !p.name.startsWith("__")).map((p) => p.name).join(", ");
|
|
117
|
+
this.tools.push({
|
|
118
|
+
name: `${set.name}_list`,
|
|
119
|
+
title: `List ${plural}${help}`,
|
|
120
|
+
description: `Lists the ${plural}${help}. Properties: ${filterable}.`,
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {
|
|
124
|
+
filter: { type: "string", description: `OData $filter, e.g. ${type.properties.find((p) => !p.key && p.edm.type === "Edm.String")?.name ?? type.keys[0] ?? "Name"} eq 'X'` },
|
|
125
|
+
...(set.searchable ? { search: { type: "string", description: "Free text search" } } : {}),
|
|
126
|
+
select: { type: "array", items: { type: "string" }, description: "Properties to return (all by default)" },
|
|
127
|
+
orderby: { type: "string", description: "OData $orderby, e.g. Name desc" },
|
|
128
|
+
top: { type: "integer", minimum: 1, maximum: 1000, description: "Maximum number of entries (default 50)" },
|
|
129
|
+
skip: { type: "integer", minimum: 0, description: "Entries to skip (paging)" },
|
|
130
|
+
},
|
|
131
|
+
additionalProperties: false,
|
|
132
|
+
},
|
|
133
|
+
annotations: { readOnlyHint: true },
|
|
134
|
+
call: { kind: "list", set: set.name, keys: this.keys(type) },
|
|
135
|
+
});
|
|
136
|
+
const key = this.keySchema(type);
|
|
137
|
+
this.tools.push({
|
|
138
|
+
name: `${set.name}_get`,
|
|
139
|
+
title: `Read a ${singular}`,
|
|
140
|
+
description: `Reads one ${singular} by its key (${type.keys.join(", ")}).`,
|
|
141
|
+
inputSchema: { type: "object", properties: key.properties, required: key.required, additionalProperties: false },
|
|
142
|
+
annotations: { readOnlyHint: true },
|
|
143
|
+
call: { kind: "get", set: set.name, keys: this.keys(type) },
|
|
144
|
+
});
|
|
145
|
+
if (set.insertable) {
|
|
146
|
+
const w = this.writable(type, false);
|
|
147
|
+
this.tools.push({
|
|
148
|
+
name: `${set.name}_create`,
|
|
149
|
+
title: `Create a ${singular}`,
|
|
150
|
+
description: `Creates a ${singular}; the business object checks it (validations) and returns it, or its messages.`,
|
|
151
|
+
inputSchema: { type: "object", properties: w.properties, required: w.required, additionalProperties: false },
|
|
152
|
+
annotations: {},
|
|
153
|
+
call: { kind: "create", set: set.name, keys: this.keys(type), fields: w.fields },
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (set.updatable) {
|
|
157
|
+
const w = this.writable(type, true);
|
|
158
|
+
this.tools.push({
|
|
159
|
+
name: `${set.name}_update`,
|
|
160
|
+
title: `Change a ${singular}`,
|
|
161
|
+
description: `Changes the given properties of a ${singular} (the others are kept).`,
|
|
162
|
+
inputSchema: { type: "object", properties: { ...key.properties, ...w.properties }, required: key.required, additionalProperties: false },
|
|
163
|
+
annotations: { idempotentHint: true },
|
|
164
|
+
call: { kind: "update", set: set.name, keys: this.keys(type), fields: w.fields },
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if (set.deletable) {
|
|
168
|
+
this.tools.push({
|
|
169
|
+
name: `${set.name}_delete`,
|
|
170
|
+
title: `Delete a ${singular}`,
|
|
171
|
+
description: `Deletes a ${singular}${type.navigations.some((n) => n.kind === "composition") ? " and its compositions" : ""}.`,
|
|
172
|
+
inputSchema: { type: "object", properties: key.properties, required: key.required, additionalProperties: false },
|
|
173
|
+
annotations: { destructiveHint: true, idempotentHint: true },
|
|
174
|
+
call: { kind: "delete", set: set.name, keys: this.keys(type) },
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
for (const navigation of type.navigations.filter((n) => n.kind === "composition" && n.insertable)) {
|
|
178
|
+
const child = this.service.entityTypes.find((t) => t.name === navigation.targetType);
|
|
179
|
+
if (child === undefined)
|
|
180
|
+
continue;
|
|
181
|
+
const w = this.writable(child, false);
|
|
182
|
+
const childNames = this.names(child, navigation.targetSet);
|
|
183
|
+
this.tools.push({
|
|
184
|
+
name: `${set.name}_create${navigation.name}`,
|
|
185
|
+
title: `Create a ${childNames.singular} of a ${singular}`,
|
|
186
|
+
description: `Creates a ${childNames.singular} under a ${singular} (composition ${navigation.name}).`,
|
|
187
|
+
inputSchema: { type: "object", properties: { ...key.properties, ...w.properties }, required: [...key.required, ...w.required.filter((r) => !key.required.includes(r))], additionalProperties: false },
|
|
188
|
+
annotations: {},
|
|
189
|
+
call: { kind: "createChild", set: set.name, keys: this.keys(type), navigation: navigation.name, fields: w.fields },
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
for (const operation of this.service.operations.filter((o) => o.boundType === type.name)) {
|
|
193
|
+
const parameters = {};
|
|
194
|
+
for (const p of operation.parameters)
|
|
195
|
+
parameters[p.name] = schemaOf(p.edm);
|
|
196
|
+
const properties = operation.collectionBound ? parameters : { ...key.properties, ...parameters };
|
|
197
|
+
const required = [...(operation.collectionBound ? [] : key.required), ...operation.parameters.filter((p) => !p.nullable).map((p) => p.name)];
|
|
198
|
+
const isFunction = operation.kind === "function";
|
|
199
|
+
this.tools.push({
|
|
200
|
+
name: `${set.name}_${operation.name}`,
|
|
201
|
+
title: `${operation.name} (${singular})`,
|
|
202
|
+
description: `${isFunction ? "Function" : "Action"} ${operation.name} of ${operation.collectionBound ? `the ${plural}` : `a ${singular}`}${operation.factory ? " (creates a new instance)" : ""}.`,
|
|
203
|
+
inputSchema: { type: "object", properties, required, additionalProperties: false },
|
|
204
|
+
annotations: isFunction ? { readOnlyHint: true } : {},
|
|
205
|
+
call: {
|
|
206
|
+
kind: isFunction ? "function" : "action",
|
|
207
|
+
set: set.name,
|
|
208
|
+
keys: this.keys(type),
|
|
209
|
+
operation: `${this.service.namespace}.${operation.name}`,
|
|
210
|
+
collectionBound: operation.collectionBound,
|
|
211
|
+
fields: operation.parameters.map((p) => ({ name: p.name, edm: p.edm.type })),
|
|
212
|
+
},
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/** Every tool of the service, with its default description. */
|
|
219
|
+
export function defaultMcpTools(model) {
|
|
220
|
+
const builder = new ToolBuilder(model);
|
|
221
|
+
builder.build();
|
|
222
|
+
return builder.tools;
|
|
223
|
+
}
|
|
224
|
+
/** The tools of the application: the defaults, with the descriptions and choices of rapt/mcp.json. */
|
|
225
|
+
export function buildMcpTools(model, config, diagnostics) {
|
|
226
|
+
const all = defaultMcpTools(model);
|
|
227
|
+
const configured = config.tools ?? {};
|
|
228
|
+
for (const name of Object.keys(configured)) {
|
|
229
|
+
if (!all.some((t) => t.name === name)) {
|
|
230
|
+
diagnostics.warning("MCP002", `${MCP_FILE}: no tool ${name} in the service (run rapt mcp to update the file)`, { file: MCP_FILE, line: 1 });
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
const tools = all
|
|
234
|
+
.filter((t) => configured[t.name] !== false)
|
|
235
|
+
.map((t) => {
|
|
236
|
+
const description = configured[t.name];
|
|
237
|
+
return typeof description === "string" && description.trim() !== "" ? { ...t, description } : t;
|
|
238
|
+
});
|
|
239
|
+
const server = { name: config.server?.name ?? model.service.name.toLowerCase(), version: "1.0.0" };
|
|
240
|
+
if (config.server?.instructions !== undefined)
|
|
241
|
+
server.instructions = config.server.instructions;
|
|
242
|
+
return { server, tools };
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=mcp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{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