@lumeo-ui/mcp-server 2.0.0-rc.4 → 2.0.0-rc.40
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/dist/componentsApi.js +46 -0
- package/dist/index.js +433 -160
- package/dist/installInfo.js +101 -0
- package/package.json +2 -1
- package/src/components-api.json +40614 -0
- package/src/registry.json +1265 -15
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loads the auto-generated `components-api.json` produced by
|
|
3
|
+
* `tools/Lumeo.RegistryGen` (Roslyn-based scan of every `[Parameter]` /
|
|
4
|
+
* `[CascadingParameter]` property across every Razor component in the repo).
|
|
5
|
+
*
|
|
6
|
+
* This is the source-of-truth schema for ALL 131 Lumeo components. The
|
|
7
|
+
* legacy hand-curated `components.ts` is kept as an OPTIONAL example overlay:
|
|
8
|
+
* when it has an entry for a component we surface its `example` Razor snippet
|
|
9
|
+
* verbatim alongside the auto-generated parameter list.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
12
|
+
import { dirname, resolve } from "node:path";
|
|
13
|
+
import { fileURLToPath } from "node:url";
|
|
14
|
+
function findPath() {
|
|
15
|
+
try {
|
|
16
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
17
|
+
// dist/ -> ../src/components-api.json
|
|
18
|
+
// src/ -> ./components-api.json
|
|
19
|
+
const candidates = [
|
|
20
|
+
resolve(here, "../src/components-api.json"),
|
|
21
|
+
resolve(here, "./components-api.json"),
|
|
22
|
+
// monorepo fallback when running uninstalled
|
|
23
|
+
resolve(here, "../..", "components-api.json"),
|
|
24
|
+
];
|
|
25
|
+
for (const c of candidates)
|
|
26
|
+
if (existsSync(c))
|
|
27
|
+
return c;
|
|
28
|
+
}
|
|
29
|
+
catch { /* ignore */ }
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
export function loadComponentsApi() {
|
|
33
|
+
const path = findPath();
|
|
34
|
+
if (!path)
|
|
35
|
+
return null;
|
|
36
|
+
try {
|
|
37
|
+
const raw = readFileSync(path, "utf8");
|
|
38
|
+
const parsed = JSON.parse(raw);
|
|
39
|
+
if (!parsed?.components)
|
|
40
|
+
return null;
|
|
41
|
+
return parsed;
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
}
|