@fundamental-ngx/mcp 0.62.0-rc.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +109 -0
  2. package/package.json +21 -0
  3. package/src/data/components.json +61370 -0
  4. package/src/extractors/build-metadata.d.ts +8 -0
  5. package/src/extractors/build-metadata.js +178 -0
  6. package/src/extractors/build-metadata.js.map +1 -0
  7. package/src/extractors/cem-extractor.d.ts +17 -0
  8. package/src/extractors/cem-extractor.js +430 -0
  9. package/src/extractors/cem-extractor.js.map +1 -0
  10. package/src/extractors/changelog-extractor.d.ts +6 -0
  11. package/src/extractors/changelog-extractor.js +115 -0
  12. package/src/extractors/changelog-extractor.js.map +1 -0
  13. package/src/extractors/description-extractor.d.ts +11 -0
  14. package/src/extractors/description-extractor.js +58 -0
  15. package/src/extractors/description-extractor.js.map +1 -0
  16. package/src/extractors/example-extractor.d.ts +19 -0
  17. package/src/extractors/example-extractor.js +67 -0
  18. package/src/extractors/example-extractor.js.map +1 -0
  19. package/src/extractors/token-extractor.d.ts +6 -0
  20. package/src/extractors/token-extractor.js +345 -0
  21. package/src/extractors/token-extractor.js.map +1 -0
  22. package/src/extractors/typedoc-extractor.d.ts +16 -0
  23. package/src/extractors/typedoc-extractor.js +576 -0
  24. package/src/extractors/typedoc-extractor.js.map +1 -0
  25. package/src/index.d.ts +2 -0
  26. package/src/index.js +3 -0
  27. package/src/index.js.map +1 -0
  28. package/src/server.d.ts +1 -0
  29. package/src/server.js +794 -0
  30. package/src/server.js.map +1 -0
  31. package/src/types/component-metadata.d.ts +177 -0
  32. package/src/types/component-metadata.js +21 -0
  33. package/src/types/component-metadata.js.map +1 -0
@@ -0,0 +1,8 @@
1
+ import { ComponentCatalog } from '../types/component-metadata';
2
+ /**
3
+ * Build the complete MCP metadata catalog.
4
+ *
5
+ * Orchestrates all extractors and writes the unified components.json.
6
+ * Can be run as a standalone script or via an NX executor.
7
+ */
8
+ export declare function buildMetadata(basePath: string, outputPath: string): Promise<ComponentCatalog>;
@@ -0,0 +1,178 @@
1
+ import { mkdir, writeFile } from 'fs/promises';
2
+ import { dirname, resolve } from 'path';
3
+ import { extractAllUi5Components } from './cem-extractor';
4
+ import { extractDescriptions } from './description-extractor';
5
+ import { extractExamples } from './example-extractor';
6
+ import { extractAllTypeDocComponents } from './typedoc-extractor';
7
+ /** Map npm package name to the docs directory alias used in example paths. */
8
+ const LIBRARY_TO_DIR = {
9
+ '@fundamental-ngx/core': 'core',
10
+ '@fundamental-ngx/platform': 'platform',
11
+ '@fundamental-ngx/btp': 'btp',
12
+ '@fundamental-ngx/cx': 'cx',
13
+ '@fundamental-ngx/cdk': 'cdk'
14
+ };
15
+ /** Derive the example directory name from a selector.
16
+ * "fd-date-picker" → "date-picker"
17
+ * "fdp-table" → "table"
18
+ * "button[fd-button], a[fd-button]" → "button"
19
+ * "[fdOverflowLayout]" → "overflow-layout"
20
+ */
21
+ function selectorToDir(selector) {
22
+ // Handle attribute selectors like "button[fd-button], a[fd-button]" or "[fdOverflowLayout]"
23
+ const attrMatch = selector.match(/\[(fd[pbk]?)-([^\]]+)\]/);
24
+ if (attrMatch) {
25
+ return attrMatch[2];
26
+ }
27
+ // Handle camelCase attribute selectors like "[fdOverflowLayout]"
28
+ const camelMatch = selector.match(/\[fd([A-Z][^\]]*)\]/);
29
+ if (camelMatch) {
30
+ // Convert camelCase to kebab-case: "OverflowLayout" → "overflow-layout"
31
+ return camelMatch[1]
32
+ .replace(/([A-Z])/g, '-$1')
33
+ .toLowerCase()
34
+ .replace(/^-/, '');
35
+ }
36
+ // Simple prefix selectors: "fd-button" → "button"
37
+ return selector
38
+ .split(',')[0]
39
+ .trim()
40
+ .replace(/^(fd[pbk]?|cx|ui5)-/, '');
41
+ }
42
+ /**
43
+ * Build the complete MCP metadata catalog.
44
+ *
45
+ * Orchestrates all extractors and writes the unified components.json.
46
+ * Can be run as a standalone script or via an NX executor.
47
+ */
48
+ export async function buildMetadata(basePath, outputPath) {
49
+ console.log('Starting metadata extraction...');
50
+ const startTime = Date.now();
51
+ // Run CEM and TypeDoc extraction in parallel
52
+ const [cemComponents, typeDocComponents] = await Promise.all([
53
+ extractAllUi5Components(basePath).then((components) => {
54
+ console.log(` CEM: extracted ${components.length} UI5 components`);
55
+ return components;
56
+ }),
57
+ extractAllTypeDocComponents(basePath).then((components) => {
58
+ console.log(` TypeDoc: extracted ${components.length} hand-written components`);
59
+ return components;
60
+ })
61
+ ]);
62
+ // Merge all components
63
+ const allComponents = [...cemComponents, ...typeDocComponents];
64
+ // Enrich with examples
65
+ const examples = await extractExamples(basePath);
66
+ console.log(` Examples: found ${examples.size} components with examples`);
67
+ // Attach examples to matching components
68
+ let enrichedCount = 0;
69
+ for (const component of allComponents) {
70
+ const libDir = LIBRARY_TO_DIR[component.library];
71
+ if (!libDir) {
72
+ continue;
73
+ }
74
+ const compDir = selectorToDir(component.selector);
75
+ const key = `${libDir}/${compDir}`;
76
+ const compExamples = examples.get(key);
77
+ if (compExamples && compExamples.length > 0) {
78
+ component.examples = compExamples.map((ex) => ({
79
+ name: ex.name,
80
+ description: ex.description,
81
+ typescript: ex.typescript,
82
+ html: ex.html
83
+ }));
84
+ enrichedCount++;
85
+ }
86
+ }
87
+ console.log(` Examples: enriched ${enrichedCount} components`);
88
+ // Enrich with docs descriptions (for components missing JSDoc)
89
+ const descriptions = await extractDescriptions(basePath);
90
+ console.log(` Descriptions: found ${descriptions.size} docs descriptions`);
91
+ let descriptionEnrichedCount = 0;
92
+ for (const component of allComponents) {
93
+ // Skip components that already have a real description (from JSDoc)
94
+ if (component.description && !component.description.match(/^\w[\w ]+ (?:component|directive) \(/)) {
95
+ continue;
96
+ }
97
+ const libDir = LIBRARY_TO_DIR[component.library];
98
+ if (!libDir) {
99
+ continue;
100
+ }
101
+ const compDir = selectorToDir(component.selector);
102
+ const key = `${libDir}/${compDir}`;
103
+ const docsDesc = descriptions.get(key);
104
+ if (docsDesc) {
105
+ component.description = docsDesc;
106
+ descriptionEnrichedCount++;
107
+ }
108
+ }
109
+ console.log(` Descriptions: enriched ${descriptionEnrichedCount} components`);
110
+ // Sort alphabetically by selector for consistent output
111
+ allComponents.sort((a, b) => a.selector.localeCompare(b.selector));
112
+ const catalog = {
113
+ generatedAt: new Date().toISOString(),
114
+ version: '0.62.0-rc.67',
115
+ components: allComponents
116
+ };
117
+ // Write output
118
+ await mkdir(dirname(outputPath), { recursive: true });
119
+ await writeFile(outputPath, JSON.stringify(catalog, null, 2), 'utf-8');
120
+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
121
+ console.log(`\nMetadata extraction complete in ${elapsed}s`);
122
+ console.log(` Total components: ${allComponents.length}`);
123
+ console.log(` Output: ${outputPath}`);
124
+ return catalog;
125
+ }
126
+ /**
127
+ * CLI entry point for running extraction standalone.
128
+ * Usage: npx ts-node libs/mcp-server/src/extractors/build-metadata.ts [--dry-run]
129
+ */
130
+ async function main() {
131
+ const basePath = resolve(__dirname, '../../../../');
132
+ const outputPath = resolve(__dirname, '../data/components.json');
133
+ const isDryRun = process.argv.includes('--dry-run');
134
+ try {
135
+ const catalog = await buildMetadata(basePath, isDryRun ? '/dev/null' : outputPath);
136
+ if (isDryRun) {
137
+ // In dry-run mode, compare with existing file
138
+ const { readFile } = await import('fs/promises');
139
+ try {
140
+ const existing = await readFile(outputPath, 'utf-8');
141
+ const existingCatalog = JSON.parse(existing);
142
+ if (existingCatalog.components.length !== catalog.components.length) {
143
+ console.error(`\nSTALE: Component count changed (${existingCatalog.components.length} → ${catalog.components.length})`);
144
+ process.exit(1);
145
+ }
146
+ // Compare component names/selectors
147
+ const existingSelectors = new Set(existingCatalog.components.map((c) => c.selector));
148
+ const newSelectors = new Set(catalog.components.map((c) => c.selector));
149
+ const added = catalog.components.filter((c) => !existingSelectors.has(c.selector));
150
+ const removed = existingCatalog.components.filter((c) => !newSelectors.has(c.selector));
151
+ if (added.length > 0 || removed.length > 0) {
152
+ if (added.length) {
153
+ console.error(` Added: ${added.map((c) => c.selector).join(', ')}`);
154
+ }
155
+ if (removed.length) {
156
+ console.error(` Removed: ${removed.map((c) => c.selector).join(', ')}`);
157
+ }
158
+ console.error('\nSTALE: Run `nx run mcp-server:extract-metadata` to update.');
159
+ process.exit(1);
160
+ }
161
+ console.log('\ncomponents.json is up to date.');
162
+ }
163
+ catch {
164
+ console.error('\nSTALE: components.json does not exist. Run `nx run mcp-server:extract-metadata`.');
165
+ process.exit(1);
166
+ }
167
+ }
168
+ }
169
+ catch (error) {
170
+ console.error('Metadata extraction failed:', error);
171
+ process.exit(1);
172
+ }
173
+ }
174
+ // Run if executed directly
175
+ if (require.main === module) {
176
+ main();
177
+ }
178
+ //# sourceMappingURL=build-metadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-metadata.js","sourceRoot":"","sources":["../../../../../libs/mcp-server/src/extractors/build-metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAElE,8EAA8E;AAC9E,MAAM,cAAc,GAA2B;IAC3C,uBAAuB,EAAE,MAAM;IAC/B,2BAA2B,EAAE,UAAU;IACvC,sBAAsB,EAAE,KAAK;IAC7B,qBAAqB,EAAE,IAAI;IAC3B,sBAAsB,EAAE,KAAK;CAChC,CAAC;AAEF;;;;;GAKG;AACH,SAAS,aAAa,CAAC,QAAgB;IACnC,4FAA4F;IAC5F,MAAM,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC5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AAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;oBAC7E,CAAC;oBACD,OAAO,CAAC,KAAK,CAAC,8DAA8D,CAAC,CAAC;oBAC9E,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACpB,CAAC;gBAED,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAC;YACpD,CAAC;YAAC,MAAM,CAAC;gBACL,OAAO,CAAC,KAAK,CAAC,oFAAoF,CAAC,CAAC;gBACpG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YACpB,CAAC;QACL,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,OAAO,CAAC,KAAK,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;QACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;AACL,CAAC;AAED,2BAA2B;AAC3B,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC1B,IAAI,EAAE,CAAC;AACX,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { ComponentMetadata, Library } from '../types/component-metadata';
2
+ /**
3
+ * Extract component metadata from a single Custom Elements Manifest JSON file.
4
+ *
5
+ * @param cemFilePath Absolute path to a `custom-elements-internal.json` file.
6
+ * @param library The fundamental-ngx library this CEM belongs to.
7
+ * @returns Array of normalized `ComponentMetadata` entries.
8
+ */
9
+ export declare function extractFromCem(cemFilePath: string, library: Library): Promise<ComponentMetadata[]>;
10
+ /**
11
+ * Convenience function that extracts metadata from all three UI5 Web Components
12
+ * CEM files and returns a merged array.
13
+ *
14
+ * @param basePath Absolute path to the repository root (where `node_modules` lives).
15
+ * @returns Combined array of `ComponentMetadata` for all UI5 packages.
16
+ */
17
+ export declare function extractAllUi5Components(basePath: string): Promise<ComponentMetadata[]>;
@@ -0,0 +1,430 @@
1
+ import { readFile } from 'fs/promises';
2
+ import { resolve } from 'path';
3
+ const CEM_SOURCES = [
4
+ {
5
+ cemPath: '@ui5/webcomponents/dist/custom-elements-internal.json',
6
+ library: '@fundamental-ngx/ui5-webcomponents'
7
+ },
8
+ {
9
+ cemPath: '@ui5/webcomponents-fiori/dist/custom-elements-internal.json',
10
+ library: '@fundamental-ngx/ui5-webcomponents-fiori'
11
+ },
12
+ {
13
+ cemPath: '@ui5/webcomponents-ai/dist/custom-elements-internal.json',
14
+ library: '@fundamental-ngx/ui5-webcomponents-ai'
15
+ }
16
+ ];
17
+ // ---------------------------------------------------------------------------
18
+ // Public API
19
+ // ---------------------------------------------------------------------------
20
+ /**
21
+ * Extract component metadata from a single Custom Elements Manifest JSON file.
22
+ *
23
+ * @param cemFilePath Absolute path to a `custom-elements-internal.json` file.
24
+ * @param library The fundamental-ngx library this CEM belongs to.
25
+ * @returns Array of normalized `ComponentMetadata` entries.
26
+ */
27
+ export async function extractFromCem(cemFilePath, library) {
28
+ const raw = await readFile(cemFilePath, 'utf-8');
29
+ const cem = JSON.parse(raw);
30
+ const enumMap = buildEnumMap(cem);
31
+ const components = [];
32
+ for (const mod of cem.modules) {
33
+ for (const decl of mod.declarations ?? []) {
34
+ if (!isPublicCustomElement(decl)) {
35
+ continue;
36
+ }
37
+ const component = mapDeclaration(decl, mod.path, library, enumMap);
38
+ components.push(component);
39
+ }
40
+ }
41
+ return components;
42
+ }
43
+ /**
44
+ * Convenience function that extracts metadata from all three UI5 Web Components
45
+ * CEM files and returns a merged array.
46
+ *
47
+ * @param basePath Absolute path to the repository root (where `node_modules` lives).
48
+ * @returns Combined array of `ComponentMetadata` for all UI5 packages.
49
+ */
50
+ export async function extractAllUi5Components(basePath) {
51
+ const results = [];
52
+ for (const source of CEM_SOURCES) {
53
+ const cemFilePath = resolve(basePath, 'node_modules', source.cemPath);
54
+ try {
55
+ const components = await extractFromCem(cemFilePath, source.library);
56
+ results.push(...components);
57
+ }
58
+ catch {
59
+ // CEM file may not exist (e.g. ai package not installed)
60
+ }
61
+ }
62
+ return results;
63
+ }
64
+ // ---------------------------------------------------------------------------
65
+ // Internal helpers
66
+ // ---------------------------------------------------------------------------
67
+ /** Type guard: declaration is a public, non-abstract custom element. */
68
+ function isPublicCustomElement(decl) {
69
+ if (decl.kind !== 'class') {
70
+ return false;
71
+ }
72
+ const cls = decl;
73
+ return (cls.customElement === true &&
74
+ !!cls.tagName &&
75
+ cls._ui5privacy !== 'private' &&
76
+ cls._ui5privacy !== 'protected' &&
77
+ cls._ui5abstract !== true);
78
+ }
79
+ /** Build a lookup from enum name to its member values. */
80
+ function buildEnumMap(cem) {
81
+ const map = new Map();
82
+ for (const mod of cem.modules) {
83
+ for (const decl of mod.declarations ?? []) {
84
+ if (decl.kind === 'enum') {
85
+ const enumDecl = decl;
86
+ const values = (enumDecl.members ?? []).map((m) => m.name);
87
+ map.set(enumDecl.name, values);
88
+ }
89
+ }
90
+ }
91
+ return map;
92
+ }
93
+ /** Try to resolve enum values from a type reference. */
94
+ function resolveEnumValues(type, enumMap) {
95
+ if (!type) {
96
+ return undefined;
97
+ }
98
+ // Check direct references first
99
+ if (type.references?.length) {
100
+ for (const ref of type.references) {
101
+ const refValues = enumMap.get(ref.name);
102
+ if (refValues?.length) {
103
+ return refValues;
104
+ }
105
+ }
106
+ }
107
+ // Fall back to matching the type text against known enum names
108
+ const typeName = type.text.replace(/\s*\|.*$/, '').trim();
109
+ const typeValues = enumMap.get(typeName);
110
+ if (typeValues?.length) {
111
+ return typeValues;
112
+ }
113
+ // Handle inline union types like '"Auto" | "Accent1" | "Accent2"'
114
+ if (type.text.includes('"') && type.text.includes('|')) {
115
+ const matches = type.text.match(/"([^"]+)"/g);
116
+ if (matches?.length) {
117
+ return matches.map((m) => m.replace(/"/g, ''));
118
+ }
119
+ }
120
+ return undefined;
121
+ }
122
+ // ---------------------------------------------------------------------------
123
+ // Declaration → ComponentMetadata mapping
124
+ // ---------------------------------------------------------------------------
125
+ function mapDeclaration(decl, modulePath, library, enumMap) {
126
+ const rawDescription = decl.description ?? '';
127
+ return {
128
+ name: decl.name,
129
+ selector: decl.tagName,
130
+ library,
131
+ category: inferCategory(modulePath, library),
132
+ description: cleanCemDescription(rawDescription),
133
+ since: decl._ui5since,
134
+ deprecated: normalizeDeprecated(decl.deprecated),
135
+ inputs: mapInputs(decl.members, enumMap),
136
+ outputs: mapOutputs(decl.events),
137
+ slots: mapSlots(decl.slots),
138
+ methods: mapMethods(decl.members),
139
+ cssProperties: mapCssProperties(decl.cssProperties),
140
+ keyboardHandling: extractSection(rawDescription, 'Keyboard Handling'),
141
+ sourceFile: modulePath,
142
+ source: 'cem'
143
+ };
144
+ }
145
+ // ---------------------------------------------------------------------------
146
+ // Input mapping
147
+ // ---------------------------------------------------------------------------
148
+ function mapInputs(members, enumMap) {
149
+ if (!members) {
150
+ return [];
151
+ }
152
+ return members
153
+ .filter((m) => m.kind === 'field' && m.privacy === 'public' && !m.readonly)
154
+ .map((m) => ({
155
+ name: m.name,
156
+ type: m.type?.text ?? 'unknown',
157
+ defaultValue: m.default,
158
+ description: m.description ?? '',
159
+ required: m.default === undefined && !isOptionalType(m.type?.text),
160
+ enumValues: resolveEnumValues(m.type, enumMap),
161
+ since: m._ui5since,
162
+ deprecated: normalizeDeprecated(m.deprecated)
163
+ }));
164
+ }
165
+ /** Returns true if the type string indicates the value is optional. */
166
+ function isOptionalType(typeText) {
167
+ if (!typeText) {
168
+ return false;
169
+ }
170
+ return typeText.includes('undefined') || typeText.includes('null') || typeText.endsWith('?');
171
+ }
172
+ // ---------------------------------------------------------------------------
173
+ // Output mapping
174
+ // ---------------------------------------------------------------------------
175
+ function mapOutputs(events) {
176
+ if (!events) {
177
+ return [];
178
+ }
179
+ return events
180
+ .filter((e) => e._ui5privacy !== 'private' && e._ui5privacy !== 'protected')
181
+ .map((e) => ({
182
+ name: toUi5OutputName(e.name),
183
+ type: e.type?.text ?? 'CustomEvent',
184
+ description: e.description ?? '',
185
+ detail: mapEventDetail(e._ui5parameters),
186
+ since: e._ui5since,
187
+ deprecated: normalizeDeprecated(e.deprecated)
188
+ }));
189
+ }
190
+ /**
191
+ * Convert a DOM event name to the Angular output name used by the UI5 wrappers.
192
+ * Prefix with "ui5" and PascalCase the rest.
193
+ *
194
+ * Examples:
195
+ * - "click" → "ui5Click"
196
+ * - "selection-change" → "ui5SelectionChange"
197
+ * - "close" → "ui5Close"
198
+ */
199
+ function toUi5OutputName(eventName) {
200
+ const pascal = eventName
201
+ .split('-')
202
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
203
+ .join('');
204
+ return `ui5${pascal}`;
205
+ }
206
+ function mapEventDetail(params) {
207
+ if (!params?.length) {
208
+ return undefined;
209
+ }
210
+ return params
211
+ .filter((p) => p._ui5privacy !== 'private' && p._ui5privacy !== 'protected')
212
+ .map((p) => ({
213
+ name: p.name,
214
+ type: p.type?.text ?? 'unknown',
215
+ description: p.description ?? ''
216
+ }));
217
+ }
218
+ // ---------------------------------------------------------------------------
219
+ // Slot mapping
220
+ // ---------------------------------------------------------------------------
221
+ function mapSlots(slots) {
222
+ if (!slots) {
223
+ return [];
224
+ }
225
+ return slots
226
+ .filter((s) => s._ui5privacy !== 'private' && s._ui5privacy !== 'protected')
227
+ .map((s) => ({
228
+ name: s.name,
229
+ description: s.description ?? '',
230
+ acceptedTypes: extractAcceptedTypes(s._ui5type),
231
+ since: s._ui5since,
232
+ deprecated: normalizeDeprecated(s.deprecated)
233
+ }));
234
+ }
235
+ /** Extract accepted type names from a slot's _ui5type field. */
236
+ function extractAcceptedTypes(type) {
237
+ if (!type) {
238
+ return undefined;
239
+ }
240
+ // References give the most accurate type names
241
+ if (type.references?.length) {
242
+ return type.references.map((ref) => ref.name);
243
+ }
244
+ // Fall back to parsing the text, e.g. "Array<HTMLElement>" → ["HTMLElement"]
245
+ const genericMatch = type.text.match(/Array<(.+)>/);
246
+ if (genericMatch) {
247
+ return genericMatch[1].split('|').map((t) => t.trim());
248
+ }
249
+ return [type.text];
250
+ }
251
+ // ---------------------------------------------------------------------------
252
+ // Method mapping
253
+ // ---------------------------------------------------------------------------
254
+ function mapMethods(members) {
255
+ if (!members) {
256
+ return [];
257
+ }
258
+ return members
259
+ .filter((m) => m.kind === 'method' && m.privacy === 'public')
260
+ .map((m) => ({
261
+ name: m.name,
262
+ returnType: m.return?.type?.text ?? 'void',
263
+ description: m.description ?? '',
264
+ params: mapMethodParams(m.parameters),
265
+ deprecated: normalizeDeprecated(m.deprecated)
266
+ }));
267
+ }
268
+ function mapMethodParams(params) {
269
+ if (!params) {
270
+ return [];
271
+ }
272
+ return params.map((p) => ({
273
+ name: p.name,
274
+ type: p.type?.text ?? 'unknown',
275
+ description: p.description ?? '',
276
+ optional: p.name.endsWith('?') || (p.type?.text?.includes('undefined') ?? false)
277
+ }));
278
+ }
279
+ // ---------------------------------------------------------------------------
280
+ // CSS property mapping
281
+ // ---------------------------------------------------------------------------
282
+ function mapCssProperties(props) {
283
+ if (!props) {
284
+ return [];
285
+ }
286
+ return props.map((p) => ({
287
+ name: p.name,
288
+ description: p.description ?? '',
289
+ defaultValue: p.default
290
+ }));
291
+ }
292
+ // ---------------------------------------------------------------------------
293
+ // Description cleaning
294
+ // ---------------------------------------------------------------------------
295
+ /** Normalize a CEM `deprecated` field (string message or boolean) to a string or undefined. */
296
+ function normalizeDeprecated(value) {
297
+ if (typeof value === 'string') {
298
+ return value;
299
+ }
300
+ if (value === true) {
301
+ return 'Deprecated';
302
+ }
303
+ return undefined;
304
+ }
305
+ /**
306
+ * Extract the content of a named `### Section` from a CEM markdown description.
307
+ * Returns `undefined` if the section is not found.
308
+ *
309
+ * @param sectionName Plain text section name (must not contain regex special characters).
310
+ */
311
+ function extractSection(markdown, sectionName) {
312
+ const escaped = sectionName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
313
+ const pattern = new RegExp(`###\\s+${escaped}\\s*\\n([\\s\\S]*?)(?=\\n###\\s|$)`);
314
+ const match = markdown.match(pattern);
315
+ if (!match) {
316
+ return undefined;
317
+ }
318
+ return match[1].trim() || undefined;
319
+ }
320
+ /**
321
+ * Clean a CEM markdown description into plain-text suitable for MCP output.
322
+ *
323
+ * 1. Extract the "### Overview" section content (if present)
324
+ * 2. Otherwise use everything before the first `###` header
325
+ * 3. Strip known boilerplate sections (ES6 Module Import, Keyboard Handling)
326
+ * 4. Remove markdown formatting
327
+ */
328
+ function cleanCemDescription(raw) {
329
+ if (!raw) {
330
+ return '';
331
+ }
332
+ // Try to extract Overview section
333
+ let text = extractSection(raw, 'Overview');
334
+ if (!text) {
335
+ // No ### Overview — use text before the first ### header
336
+ const firstHeader = raw.indexOf('###');
337
+ text = firstHeader > 0 ? raw.slice(0, firstHeader).trim() : raw;
338
+ }
339
+ // Remove remaining ### sections that may have leaked through
340
+ text = text.replace(/###\s+[\s\S]*$/m, '').trim();
341
+ // Strip markdown formatting
342
+ text = text
343
+ .replace(/`([^`]+)`/g, '$1') // inline code
344
+ .replace(/\*\*([^*]+)\*\*/g, '$1') // bold
345
+ .replace(/\*([^*]+)\*/g, '$1') // italic
346
+ .replace(/\[([^\]]+)\]\([^)]+\)/g, '$1') // links
347
+ .replace(/\n{2,}/g, '\n') // collapse blank lines
348
+ .trim();
349
+ return text;
350
+ }
351
+ // ---------------------------------------------------------------------------
352
+ // Category inference
353
+ // ---------------------------------------------------------------------------
354
+ /** Infer a human-readable category from the module path and library. */
355
+ function inferCategory(modulePath, library) {
356
+ switch (library) {
357
+ case '@fundamental-ngx/ui5-webcomponents-fiori':
358
+ return 'Fiori';
359
+ case '@fundamental-ngx/ui5-webcomponents-ai':
360
+ return 'AI';
361
+ default:
362
+ break;
363
+ }
364
+ // For the base @ui5/webcomponents package, try to derive category from path
365
+ // Module paths look like "dist/Button.js", "dist/CalendarDate.js"
366
+ const fileName = modulePath.replace(/^dist\//, '').replace(/\.js$/, '');
367
+ // Group by common prefixes
368
+ const categoryPrefixes = {
369
+ Avatar: 'User & Identity',
370
+ Badge: 'Indicators',
371
+ Bar: 'Layout',
372
+ Breadcrumbs: 'Navigation',
373
+ BusyIndicator: 'Indicators',
374
+ Button: 'Actions',
375
+ Calendar: 'Date & Time',
376
+ Card: 'Data Display',
377
+ Carousel: 'Data Display',
378
+ CheckBox: 'Form',
379
+ ColorPalette: 'Form',
380
+ ColorPicker: 'Form',
381
+ ComboBox: 'Form',
382
+ DatePicker: 'Date & Time',
383
+ DateRangePicker: 'Date & Time',
384
+ DateTimePicker: 'Date & Time',
385
+ Dialog: 'Popover & Dialog',
386
+ DragDrop: 'Utilities',
387
+ FileUploader: 'Form',
388
+ Form: 'Form',
389
+ Icon: 'Data Display',
390
+ Input: 'Form',
391
+ Label: 'Form',
392
+ Link: 'Navigation',
393
+ List: 'Data Display',
394
+ Menu: 'Navigation',
395
+ MessageStrip: 'Feedback',
396
+ MultiComboBox: 'Form',
397
+ MultiInput: 'Form',
398
+ Panel: 'Layout',
399
+ Popover: 'Popover & Dialog',
400
+ Progress: 'Indicators',
401
+ Radio: 'Form',
402
+ RangeSlider: 'Form',
403
+ RatingIndicator: 'Form',
404
+ ResponsivePopover: 'Popover & Dialog',
405
+ SegmentedButton: 'Actions',
406
+ Select: 'Form',
407
+ Slider: 'Form',
408
+ SplitButton: 'Actions',
409
+ StepInput: 'Form',
410
+ Switch: 'Form',
411
+ Tab: 'Navigation',
412
+ Table: 'Data Display',
413
+ TextArea: 'Form',
414
+ TimePicker: 'Date & Time',
415
+ Title: 'Data Display',
416
+ Toast: 'Feedback',
417
+ ToggleButton: 'Actions',
418
+ Token: 'Data Display',
419
+ Toolbar: 'Actions',
420
+ Tree: 'Data Display',
421
+ Tag: 'Data Display'
422
+ };
423
+ for (const [prefix, category] of Object.entries(categoryPrefixes)) {
424
+ if (fileName.startsWith(prefix)) {
425
+ return category;
426
+ }
427
+ }
428
+ return 'UI5 Component';
429
+ }
430
+ //# sourceMappingURL=cem-extractor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cem-extractor.js","sourceRoot":"","sources":["../../../../../libs/mcp-server/src/extractors/cem-extractor.ts"],"names":[],"mappings":"A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