@xano/developer-mcp 1.0.69 → 1.0.71
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/lib.d.ts
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
*
|
|
42
42
|
* @packageDocumentation
|
|
43
43
|
*/
|
|
44
|
-
export { validateXanoscript, type ValidateXanoscriptArgs, type ValidationResult, type ParserDiagnostic, } from "./tools/validate_xanoscript.js";
|
|
44
|
+
export { validateXanoscript, type ValidateXanoscriptArgs, type ValidationResult, type ParserDiagnostic, type DiagnosticSeverity, SEVERITY, } from "./tools/validate_xanoscript.js";
|
|
45
45
|
export { xanoscriptDocs, getXanoscriptDocsPath, setXanoscriptDocsPath, type XanoscriptDocsArgs, type XanoscriptDocsResult, type TopicDoc, } from "./tools/xanoscript_docs.js";
|
|
46
46
|
export { mcpVersion, getServerVersion, setServerVersion, type McpVersionResult, } from "./tools/mcp_version.js";
|
|
47
47
|
export { metaApiDocs, metaApiTopics, getMetaApiTopicNames, getMetaApiTopicDescriptions, type MetaApiDocsArgs, type MetaApiDocsResult, } from "./tools/meta_api_docs.js";
|
package/dist/lib.js
CHANGED
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
// Main Tool Exports
|
|
46
46
|
// =============================================================================
|
|
47
47
|
// Validation
|
|
48
|
-
export { validateXanoscript, } from "./tools/validate_xanoscript.js";
|
|
48
|
+
export { validateXanoscript, SEVERITY, } from "./tools/validate_xanoscript.js";
|
|
49
49
|
// XanoScript Documentation
|
|
50
50
|
export { xanoscriptDocs, getXanoscriptDocsPath, setXanoscriptDocsPath, } from "./tools/xanoscript_docs.js";
|
|
51
51
|
// MCP Version
|
|
@@ -23,7 +23,13 @@ export interface ValidateXanoscriptArgs {
|
|
|
23
23
|
/** Glob pattern to filter files when using directory (default: "**\/*.xs") */
|
|
24
24
|
pattern?: string;
|
|
25
25
|
}
|
|
26
|
+
export declare const SEVERITY: {
|
|
27
|
+
readonly ERROR: 1;
|
|
28
|
+
readonly WARNING: 2;
|
|
29
|
+
};
|
|
30
|
+
export type DiagnosticSeverity = (typeof SEVERITY)[keyof typeof SEVERITY];
|
|
26
31
|
export interface ParserDiagnostic {
|
|
32
|
+
severity: DiagnosticSeverity;
|
|
27
33
|
range: {
|
|
28
34
|
start: {
|
|
29
35
|
line: number;
|
|
@@ -15,6 +15,10 @@ import { getSchemeFromContent } from "@xano/xanoscript-language-server/utils.js"
|
|
|
15
15
|
import { readFileSync, existsSync, readdirSync } from "fs";
|
|
16
16
|
import { join, resolve, basename } from "path";
|
|
17
17
|
import { minimatch } from "minimatch";
|
|
18
|
+
export const SEVERITY = {
|
|
19
|
+
ERROR: 1,
|
|
20
|
+
WARNING: 2,
|
|
21
|
+
};
|
|
18
22
|
// =============================================================================
|
|
19
23
|
// Error Message Improvements
|
|
20
24
|
// =============================================================================
|
|
@@ -173,45 +177,62 @@ function validateCode(code, filePath) {
|
|
|
173
177
|
const text = code;
|
|
174
178
|
const scheme = getSchemeFromContent(text);
|
|
175
179
|
const parser = xanoscriptParser(text, scheme);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
errors: [],
|
|
180
|
-
message: filePath
|
|
181
|
-
? `✓ ${basename(filePath)}: Valid`
|
|
182
|
-
: "XanoScript is valid. No syntax errors found.",
|
|
183
|
-
file_path: filePath,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
const diagnostics = parser.errors.map((error) => {
|
|
187
|
-
const startOffset = error.token?.startOffset ?? 0;
|
|
188
|
-
const endOffset = error.token?.endOffset ?? 5;
|
|
180
|
+
function toDiagnostic(item, severity) {
|
|
181
|
+
const startOffset = item.token?.startOffset ?? 0;
|
|
182
|
+
const endOffset = item.token?.endOffset ?? 5;
|
|
189
183
|
const lines = text.substring(0, startOffset).split("\n");
|
|
190
184
|
const line = lines.length - 1;
|
|
191
185
|
const character = lines[lines.length - 1].length;
|
|
192
186
|
const endLines = text.substring(0, endOffset + 1).split("\n");
|
|
193
187
|
const endLine = endLines.length - 1;
|
|
194
188
|
const endCharacter = endLines[endLines.length - 1].length;
|
|
195
|
-
|
|
196
|
-
const enhancedMessage = enhanceErrorMessage(error.message, text, line);
|
|
189
|
+
const enhancedMessage = enhanceErrorMessage(item.message, text, line);
|
|
197
190
|
return {
|
|
191
|
+
severity,
|
|
198
192
|
range: {
|
|
199
193
|
start: { line, character },
|
|
200
194
|
end: { line: endLine, character: endCharacter },
|
|
201
195
|
},
|
|
202
196
|
message: enhancedMessage,
|
|
203
|
-
source:
|
|
197
|
+
source: item.name || "XanoScript Parser",
|
|
204
198
|
};
|
|
205
|
-
}
|
|
206
|
-
const
|
|
199
|
+
}
|
|
200
|
+
const diagnostics = [
|
|
201
|
+
...parser.errors.map((e) => toDiagnostic(e, SEVERITY.ERROR)),
|
|
202
|
+
...(parser.warnings ?? []).map((w) => toDiagnostic(w, SEVERITY.WARNING)),
|
|
203
|
+
];
|
|
204
|
+
if (diagnostics.length === 0) {
|
|
205
|
+
return {
|
|
206
|
+
valid: true,
|
|
207
|
+
errors: [],
|
|
208
|
+
message: filePath
|
|
209
|
+
? `✓ ${basename(filePath)}: Valid`
|
|
210
|
+
: "XanoScript is valid. No syntax errors found.",
|
|
211
|
+
file_path: filePath,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
const errors = diagnostics.filter((d) => d.severity === SEVERITY.ERROR);
|
|
215
|
+
const warnings = diagnostics.filter((d) => d.severity === SEVERITY.WARNING);
|
|
216
|
+
const hasErrors = errors.length > 0;
|
|
217
|
+
const formatDiagnostic = (d, i) => {
|
|
218
|
+
const label = d.severity === SEVERITY.ERROR ? "ERROR" : "WARNING";
|
|
207
219
|
const location = `Line ${d.range.start.line + 1}, Column ${d.range.start.character + 1}`;
|
|
208
|
-
return `${i + 1}. [${location}] ${d.message}`;
|
|
209
|
-
}
|
|
210
|
-
const
|
|
220
|
+
return `${i + 1}. [${label}] [${location}] ${d.message}`;
|
|
221
|
+
};
|
|
222
|
+
const messageLines = [];
|
|
223
|
+
const prefix = filePath ? `${hasErrors ? "✗" : "⚠"} ${basename(filePath)}: ` : "";
|
|
224
|
+
if (errors.length > 0) {
|
|
225
|
+
messageLines.push(`${prefix}Found ${errors.length} error(s)${warnings.length > 0 ? ` and ${warnings.length} warning(s)` : ""}:`);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
messageLines.push(`${prefix}Found ${warnings.length} warning(s):`);
|
|
229
|
+
}
|
|
230
|
+
messageLines.push("");
|
|
231
|
+
messageLines.push(...diagnostics.map(formatDiagnostic));
|
|
211
232
|
return {
|
|
212
|
-
valid:
|
|
233
|
+
valid: !hasErrors,
|
|
213
234
|
errors: diagnostics,
|
|
214
|
-
message:
|
|
235
|
+
message: messageLines.join("\n"),
|
|
215
236
|
file_path: filePath,
|
|
216
237
|
};
|
|
217
238
|
}
|
package/dist/xanoscript.test.js
CHANGED
|
@@ -36,12 +36,10 @@ describe("xanoscript module", () => {
|
|
|
36
36
|
"integrations/external-apis",
|
|
37
37
|
"integrations/utilities",
|
|
38
38
|
"frontend",
|
|
39
|
-
"run",
|
|
40
39
|
"addons",
|
|
41
40
|
"debugging",
|
|
42
41
|
"performance",
|
|
43
42
|
"realtime",
|
|
44
|
-
"schema",
|
|
45
43
|
"security",
|
|
46
44
|
"streaming",
|
|
47
45
|
"middleware",
|
|
@@ -151,7 +149,6 @@ describe("xanoscript module", () => {
|
|
|
151
149
|
it("should match run files", () => {
|
|
152
150
|
const result = getDocsForFilePath("run/job/main.xs");
|
|
153
151
|
expect(result).toContain("syntax");
|
|
154
|
-
expect(result).toContain("run");
|
|
155
152
|
});
|
|
156
153
|
it("should not include readme automatically", () => {
|
|
157
154
|
const result = getDocsForFilePath("api/test.xs");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/developer-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.71",
|
|
4
4
|
"description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/lib.js",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"license": "MIT",
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
64
|
-
"@xano/xanoscript-language-server": "^
|
|
64
|
+
"@xano/xanoscript-language-server": "^12.0.0",
|
|
65
65
|
"minimatch": "^10.1.2"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|