@nocopypaste/vue-grid-mcp 0.25.0 → 0.25.1
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/bin/vue-grid-mcp.js +1 -1
- package/package.json +2 -2
- package/src/server.js +9 -1
package/bin/vue-grid-mcp.js
CHANGED
|
@@ -23,7 +23,7 @@ if (!command) {
|
|
|
23
23
|
`${d.severity.padEnd(7)} ${d.path || '(config)'}: ${d.message}${d.fix ? `\n fix: ${d.fix}` : ''}`,
|
|
24
24
|
)
|
|
25
25
|
console.log(ok ? `\nOK (${diagnostics.length} note(s))` : '\nNOT OK')
|
|
26
|
-
process.
|
|
26
|
+
process.exitCode = ok ? 0 : 1
|
|
27
27
|
} else if (command === 'guide') {
|
|
28
28
|
process.stdout.write((await loadDocs()).files['AGENTS.md'])
|
|
29
29
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocopypaste/vue-grid-mcp",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "MCP server for @nocopypaste/vue-grid: the grid's rules, API reference, renderer catalogue, doc search and a grid-config validator, as tools for coding agents. Zero dependencies besides the grid itself.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test": "node --test"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@nocopypaste/vue-grid": "^0.25.
|
|
34
|
+
"@nocopypaste/vue-grid": "^0.25.1"
|
|
35
35
|
},
|
|
36
36
|
"repository": {
|
|
37
37
|
"type": "git",
|
package/src/server.js
CHANGED
|
@@ -19,6 +19,14 @@ const INSTRUCTIONS =
|
|
|
19
19
|
* Exported for tests.
|
|
20
20
|
*/
|
|
21
21
|
export async function handle(message, docs, version) {
|
|
22
|
+
if (
|
|
23
|
+
!message ||
|
|
24
|
+
typeof message !== 'object' ||
|
|
25
|
+
Array.isArray(message) ||
|
|
26
|
+
message.jsonrpc !== '2.0' ||
|
|
27
|
+
typeof message.method !== 'string'
|
|
28
|
+
)
|
|
29
|
+
return { jsonrpc: '2.0', id: null, error: { code: -32600, message: 'Invalid Request' } }
|
|
22
30
|
const { id, method, params = {} } = message
|
|
23
31
|
const reply = (result) => (id === undefined ? undefined : { jsonrpc: '2.0', id, result })
|
|
24
32
|
const fail = (code, msg) =>
|
|
@@ -112,7 +120,7 @@ export async function serve({
|
|
|
112
120
|
)
|
|
113
121
|
continue
|
|
114
122
|
}
|
|
115
|
-
const batch = Array.isArray(message) ? message : [message]
|
|
123
|
+
const batch = Array.isArray(message) && message.length ? message : [message]
|
|
116
124
|
for (const m of batch) {
|
|
117
125
|
const response = await handle(m, docs, version)
|
|
118
126
|
if (response) output.write(JSON.stringify(response) + '\n')
|