@svgrid/mcp 3.0.13 → 3.0.14
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/validate.js +24 -0
- package/package.json +1 -1
- package/server.json +2 -2
package/dist/validate.js
CHANGED
|
@@ -254,6 +254,8 @@ const API_METHOD_HINTS = {
|
|
|
254
254
|
function push(ctx, d) {
|
|
255
255
|
ctx.out.push(d);
|
|
256
256
|
}
|
|
257
|
+
/** Package names that are not SvGrid but read like it (see AGENTS.md). */
|
|
258
|
+
const LOOKALIKE_PACKAGE = /^(?:svelte-grid|sv-grid|svgrid|@sv-grid\/[\w.-]+)$/;
|
|
257
259
|
/** Imports: unknown symbols, unknown subpaths, wrong package, missing themes. */
|
|
258
260
|
function checkImports(ctx) {
|
|
259
261
|
const { scan, raw, surface } = ctx;
|
|
@@ -267,6 +269,28 @@ function checkImports(ctx) {
|
|
|
267
269
|
const specStart = m.index + m[0].length - m[4].length - 1;
|
|
268
270
|
const spec = raw.slice(specStart, specStart + m[4].length);
|
|
269
271
|
const line = lineAt(raw, m.index);
|
|
272
|
+
// Look-alike packages a model reaches for (svelte-grid, sv-grid, @sv-grid/*)
|
|
273
|
+
// are unrelated projects. Only an import of a name SvGrid exports is flagged:
|
|
274
|
+
// code that really uses one of those libraries keeps its own names.
|
|
275
|
+
if (LOOKALIKE_PACKAGE.test(spec)) {
|
|
276
|
+
const names = (/\{([\s\S]*)\}/.exec(clause)?.[1] ?? '')
|
|
277
|
+
.split(',')
|
|
278
|
+
.map((n) => /^\s*(?:type\s+)?([A-Za-z_$][\w$]*)/.exec(n)?.[1])
|
|
279
|
+
.filter((n) => !!n);
|
|
280
|
+
const has = (s, n) => s.values.includes(n) || s.types.includes(n);
|
|
281
|
+
const ours = names.filter((n) => has(surface.grid, n) || has(surface.enterprise, n));
|
|
282
|
+
if (ours.length) {
|
|
283
|
+
const from = ours.every((n) => !has(surface.grid, n)) ? '@svgrid/enterprise' : '@svgrid/grid';
|
|
284
|
+
push(ctx, {
|
|
285
|
+
rule: 'svgrid/lookalike-package',
|
|
286
|
+
severity: 'error',
|
|
287
|
+
line,
|
|
288
|
+
message: `"${spec}" is an unrelated project; \`${ours[0]}\` comes from ${from}.`,
|
|
289
|
+
fix: `import { ${ours.join(', ')} } from '${from}'`,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
270
294
|
if (!spec.startsWith('@svgrid/'))
|
|
271
295
|
continue;
|
|
272
296
|
ctx.importedFrom.add(spec);
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "commercial",
|
|
6
6
|
"url": "https://svgrid.com/pricing"
|
|
7
7
|
},
|
|
8
|
-
"version": "3.0.
|
|
8
|
+
"version": "3.0.14",
|
|
9
9
|
"description": "Model Context Protocol server for SvGrid, the Svelte 5 data grid: checks the code your AI writes against the real API surface, plus version-pinned docs, API reference and 373 demo sources.",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"author": "jQWidgets <sales@jqwidgets.com>",
|
package/server.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "com.svgrid/svgrid",
|
|
4
4
|
"title": "SvGrid",
|
|
5
5
|
"description": "Checks AI-written SvGrid code against the real API, plus version-pinned Svelte 5 grid docs.",
|
|
6
|
-
"version": "3.0.
|
|
6
|
+
"version": "3.0.14",
|
|
7
7
|
"websiteUrl": "https://svgrid.com/docs/help/mcp-server/",
|
|
8
8
|
"repository": {
|
|
9
9
|
"url": "https://github.com/sv-grid/sv-grid",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"registryType": "npm",
|
|
16
16
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
17
17
|
"identifier": "@svgrid/mcp",
|
|
18
|
-
"version": "3.0.
|
|
18
|
+
"version": "3.0.14",
|
|
19
19
|
"runtimeHint": "npx",
|
|
20
20
|
"transport": {
|
|
21
21
|
"type": "stdio"
|