@svgrid/mcp 3.0.3 → 3.0.5
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/data.js +26 -19
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +1 -1
- package/dist/search.d.ts +11 -0
- package/dist/search.js +34 -1
- package/package.json +2 -2
- package/server.json +2 -2
package/dist/preview.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare const UI_RESOURCE_URI = "ui://svgrid/preview.html";
|
|
|
8
8
|
* start failing in a way nobody is watching for. `tools/mcp-tools.test.ts` checks these
|
|
9
9
|
* against the workspace so they cannot quietly rot either.
|
|
10
10
|
*/
|
|
11
|
-
export declare const PREVIEW_GRID_WC_VERSION = "3.0.
|
|
11
|
+
export declare const PREVIEW_GRID_WC_VERSION = "3.0.5";
|
|
12
12
|
export declare function previewResource(): {
|
|
13
13
|
uri: string;
|
|
14
14
|
name: string;
|
package/dist/preview.js
CHANGED
|
@@ -27,7 +27,7 @@ const UI_RESOURCE_META_KEY = 'ui/resourceUri';
|
|
|
27
27
|
* start failing in a way nobody is watching for. `tools/mcp-tools.test.ts` checks these
|
|
28
28
|
* against the workspace so they cannot quietly rot either.
|
|
29
29
|
*/
|
|
30
|
-
export const PREVIEW_GRID_WC_VERSION = '3.0.
|
|
30
|
+
export const PREVIEW_GRID_WC_VERSION = '3.0.5';
|
|
31
31
|
const EXT_APPS_VERSION = '1.7.5';
|
|
32
32
|
const CDN = 'https://cdn.jsdelivr.net/npm';
|
|
33
33
|
/**
|
package/dist/search.d.ts
CHANGED
|
@@ -33,6 +33,17 @@ export declare const STOP_WORDS: Set<string>;
|
|
|
33
33
|
/** Terms worth matching on: longer than one character, and not filler. */
|
|
34
34
|
export declare function meaningfulTerms(query: string): string[];
|
|
35
35
|
export declare function queryTokens(query: string): string[];
|
|
36
|
+
/**
|
|
37
|
+
* Reduce a term to a stem that still matches its other forms as a substring.
|
|
38
|
+
*
|
|
39
|
+
* Terms match by substring, so "virtual" already finds "virtualization", but the
|
|
40
|
+
* reverse fails: "virtual scrolling rows" dropped the virtualization page, which
|
|
41
|
+
* says "scroll" and "row" and never "scrolling" or "rows". Stripping the common
|
|
42
|
+
* inflections fixes that direction. Deliberately crude - it only ever shortens
|
|
43
|
+
* a term, so it can widen a match but never lose one the full word had. Used
|
|
44
|
+
* only as a fallback presence check; ranking still scores the exact term.
|
|
45
|
+
*/
|
|
46
|
+
export declare function stem(term: string): string;
|
|
36
47
|
/** A window of text around the first needle that appears, for search results. */
|
|
37
48
|
export declare function excerptAround(markdown: string, needles: string[]): string;
|
|
38
49
|
/**
|
package/dist/search.js
CHANGED
|
@@ -50,6 +50,32 @@ export function queryTokens(query) {
|
|
|
50
50
|
return specific;
|
|
51
51
|
return tokens.length ? tokens : [query.toLowerCase().trim()];
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Reduce a term to a stem that still matches its other forms as a substring.
|
|
55
|
+
*
|
|
56
|
+
* Terms match by substring, so "virtual" already finds "virtualization", but the
|
|
57
|
+
* reverse fails: "virtual scrolling rows" dropped the virtualization page, which
|
|
58
|
+
* says "scroll" and "row" and never "scrolling" or "rows". Stripping the common
|
|
59
|
+
* inflections fixes that direction. Deliberately crude - it only ever shortens
|
|
60
|
+
* a term, so it can widen a match but never lose one the full word had. Used
|
|
61
|
+
* only as a fallback presence check; ranking still scores the exact term.
|
|
62
|
+
*/
|
|
63
|
+
export function stem(term) {
|
|
64
|
+
// Longer minimums on the verb endings keep "string" from becoming "str".
|
|
65
|
+
for (const [suffix, min] of [['ing', 4], ['ed', 4], ['ies', 3], ['s', 3]]) {
|
|
66
|
+
if (!term.endsWith(suffix))
|
|
67
|
+
continue;
|
|
68
|
+
let base = term.slice(0, -suffix.length);
|
|
69
|
+
if (base.length < min)
|
|
70
|
+
continue;
|
|
71
|
+
// "pinning" -> "pinn" -> "pin", "pinned" -> "pin". "queries" -> "quer"
|
|
72
|
+
// matches "query" too.
|
|
73
|
+
if (suffix !== 's' && suffix !== 'ies' && base.at(-1) === base.at(-2))
|
|
74
|
+
base = base.slice(0, -1);
|
|
75
|
+
return base;
|
|
76
|
+
}
|
|
77
|
+
return term;
|
|
78
|
+
}
|
|
53
79
|
/** A window of text around the first needle that appears, for search results. */
|
|
54
80
|
export function excerptAround(markdown, needles) {
|
|
55
81
|
const lower = markdown.toLowerCase();
|
|
@@ -96,6 +122,13 @@ export function rankDocs(docs, query, limit) {
|
|
|
96
122
|
const count = occurrences(markdown, t);
|
|
97
123
|
if (inTitle || inHeading || count > 0)
|
|
98
124
|
matched += 1;
|
|
125
|
+
// The stem only decides whether the term is present at all. Scoring it
|
|
126
|
+
// like the exact form reorders pages that already matched: "column
|
|
127
|
+
// filtering" put "Custom column filters" above the filtering overview.
|
|
128
|
+
else if (markdown.includes(stem(t))) {
|
|
129
|
+
matched += 1;
|
|
130
|
+
score += 1;
|
|
131
|
+
}
|
|
99
132
|
if (inTitle)
|
|
100
133
|
score += 25;
|
|
101
134
|
if (slugWords.includes(t))
|
|
@@ -119,7 +152,7 @@ export function rankDocs(docs, query, limit) {
|
|
|
119
152
|
title: s.d.title,
|
|
120
153
|
section: s.d.section,
|
|
121
154
|
score: s.score,
|
|
122
|
-
excerpt: excerptAround(s.d.markdown, [phrase, ...tokens]),
|
|
155
|
+
excerpt: excerptAround(s.d.markdown, [phrase, ...tokens, ...tokens.map(stem)]),
|
|
123
156
|
})),
|
|
124
157
|
total: pool.length,
|
|
125
158
|
partial: complete.length === 0 && scored.length > 0,
|
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.5",
|
|
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>",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.0.4",
|
|
34
34
|
"svelte": "^5.55.5",
|
|
35
35
|
"zod": "^3.23.8",
|
|
36
|
-
"@svgrid/enterprise": "^3.
|
|
36
|
+
"@svgrid/enterprise": "^3.1.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^22.10.7",
|
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.5",
|
|
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.5",
|
|
19
19
|
"runtimeHint": "npx",
|
|
20
20
|
"transport": {
|
|
21
21
|
"type": "stdio"
|