@vizejs/musea-mcp-server 0.104.0 → 0.106.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{src-Bm2NHBYp.mjs → src-DMeHW2z2.mjs} +54 -12
- package/package.json +4 -2
package/dist/cli.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as startServer, t as createMuseaServer } from "./src-
|
|
1
|
+
import { n as startServer, t as createMuseaServer } from "./src-DMeHW2z2.mjs";
|
|
2
2
|
export { createMuseaServer, createMuseaServer as default, startServer };
|
|
@@ -24,7 +24,7 @@ async function findArtFiles(root, include, exclude) {
|
|
|
24
24
|
const entries = await fs.promises.readdir(dir, { withFileTypes: true });
|
|
25
25
|
for (const entry of entries) {
|
|
26
26
|
const fullPath = path.join(dir, entry.name);
|
|
27
|
-
const relative = path.relative(root, fullPath);
|
|
27
|
+
const relative = normalizePath(path.relative(root, fullPath));
|
|
28
28
|
let excluded = false;
|
|
29
29
|
for (const pattern of exclude) if (matchGlob(relative, pattern) || matchGlob(entry.name, pattern)) {
|
|
30
30
|
excluded = true;
|
|
@@ -43,9 +43,50 @@ async function findArtFiles(root, include, exclude) {
|
|
|
43
43
|
await scan(root);
|
|
44
44
|
return files;
|
|
45
45
|
}
|
|
46
|
+
function normalizePath(value) {
|
|
47
|
+
return value.replaceAll(path.sep, "/");
|
|
48
|
+
}
|
|
46
49
|
function matchGlob(filepath, pattern) {
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
return globToRegExp(pattern).test(normalizePath(filepath));
|
|
51
|
+
}
|
|
52
|
+
function globToRegExp(pattern) {
|
|
53
|
+
const normalized = normalizePath(pattern);
|
|
54
|
+
if (normalized.endsWith("/**")) return new RegExp(`^${globSource(normalized.slice(0, -3))}(?:/.*)?$`);
|
|
55
|
+
return new RegExp(`^${globSource(normalized)}$`);
|
|
56
|
+
}
|
|
57
|
+
function globSource(pattern) {
|
|
58
|
+
let source = "";
|
|
59
|
+
for (let index = 0; index < pattern.length;) {
|
|
60
|
+
const char = pattern[index];
|
|
61
|
+
const next = pattern[index + 1];
|
|
62
|
+
const afterNext = pattern[index + 2];
|
|
63
|
+
if (char === "*" && next === "*" && afterNext === "/") {
|
|
64
|
+
source += "(?:.*/)?";
|
|
65
|
+
index += 3;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
if (char === "*" && next === "*") {
|
|
69
|
+
source += ".*";
|
|
70
|
+
index += 2;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
if (char === "*") {
|
|
74
|
+
source += "[^/]*";
|
|
75
|
+
index += 1;
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
if (char === "?") {
|
|
79
|
+
source += "[^/]";
|
|
80
|
+
index += 1;
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
source += escapeRegExp(char);
|
|
84
|
+
index += 1;
|
|
85
|
+
}
|
|
86
|
+
return source;
|
|
87
|
+
}
|
|
88
|
+
function escapeRegExp(value) {
|
|
89
|
+
return value.replace(/[\\^$.*+?()[\]{}|]/g, "\\$&");
|
|
49
90
|
}
|
|
50
91
|
//#endregion
|
|
51
92
|
//#region src/tools/definitions.ts
|
|
@@ -1471,19 +1512,20 @@ async function handleSearchTokens(ctx, args) {
|
|
|
1471
1512
|
* the tool name, using the native Rust binding and server context.
|
|
1472
1513
|
*/
|
|
1473
1514
|
async function handleToolCall(ctx, name, args) {
|
|
1474
|
-
|
|
1515
|
+
let binding;
|
|
1516
|
+
const loadBinding = () => binding ??= ctx.loadNative();
|
|
1475
1517
|
switch (name) {
|
|
1476
|
-
case "analyze_component": return handleAnalyzeComponent(ctx,
|
|
1477
|
-
case "get_palette": return handleGetPalette(ctx,
|
|
1518
|
+
case "analyze_component": return handleAnalyzeComponent(ctx, loadBinding(), args);
|
|
1519
|
+
case "get_palette": return handleGetPalette(ctx, loadBinding(), args);
|
|
1478
1520
|
case "list_components": return handleListComponents(ctx, args);
|
|
1479
|
-
case "get_component": return handleGetComponent(ctx,
|
|
1480
|
-
case "get_variant": return handleGetVariant(ctx,
|
|
1521
|
+
case "get_component": return handleGetComponent(ctx, loadBinding(), args);
|
|
1522
|
+
case "get_variant": return handleGetVariant(ctx, loadBinding(), args);
|
|
1481
1523
|
case "search_components": return handleSearchComponents(ctx, args);
|
|
1482
1524
|
case "recommend_components": return handleRecommendComponents(ctx, args);
|
|
1483
|
-
case "generate_variants": return handleGenerateVariants(ctx,
|
|
1484
|
-
case "generate_csf": return handleGenerateCsf(ctx,
|
|
1485
|
-
case "generate_docs": return handleGenerateDocs(ctx,
|
|
1486
|
-
case "generate_catalog": return handleGenerateCatalog(ctx,
|
|
1525
|
+
case "generate_variants": return handleGenerateVariants(ctx, loadBinding(), args);
|
|
1526
|
+
case "generate_csf": return handleGenerateCsf(ctx, loadBinding(), args);
|
|
1527
|
+
case "generate_docs": return handleGenerateDocs(ctx, loadBinding(), args);
|
|
1528
|
+
case "generate_catalog": return handleGenerateCatalog(ctx, loadBinding(), args);
|
|
1487
1529
|
case "get_tokens": return handleGetTokens(ctx, args);
|
|
1488
1530
|
case "search_tokens": return handleSearchTokens(ctx, args);
|
|
1489
1531
|
default: throw new McpError(ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizejs/musea-mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.106.0",
|
|
4
4
|
"description": "MCP server for building Vue.js design systems - component analysis, documentation, variant generation, and design tokens",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -42,12 +42,13 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
45
|
-
"@vizejs/native": "0.
|
|
45
|
+
"@vizejs/native": "0.106.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@tsdown/css": "0.22.0",
|
|
49
49
|
"@types/node": "25.7.0",
|
|
50
50
|
"tsdown": "0.22.0",
|
|
51
|
+
"tsx": "4.21.0",
|
|
51
52
|
"typescript": "6.0.3",
|
|
52
53
|
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.21",
|
|
53
54
|
"vite-plus": "0.1.21"
|
|
@@ -59,6 +60,7 @@
|
|
|
59
60
|
"build": "vp pack",
|
|
60
61
|
"dev": "vp pack --watch",
|
|
61
62
|
"start": "node dist/cli.mjs",
|
|
63
|
+
"test": "vp exec tsx --test src/**/*.test.ts",
|
|
62
64
|
"check": "vp check src vite.config.ts",
|
|
63
65
|
"check:fix": "vp check --fix src vite.config.ts",
|
|
64
66
|
"fmt": "vp fmt --write src vite.config.ts"
|