@xano/developer-mcp 1.0.53 → 1.0.54
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.
|
@@ -104,7 +104,8 @@ export const xanoscriptDocsToolDefinition = {
|
|
|
104
104
|
description: "Get XanoScript programming language documentation for AI code generation. " +
|
|
105
105
|
"Call without parameters for overview (README). " +
|
|
106
106
|
"Use 'topic' for specific documentation, or 'file_path' for context-aware docs based on the file you're editing. " +
|
|
107
|
-
"Use mode='quick_reference' for compact syntax cheatsheet (recommended for context efficiency)."
|
|
107
|
+
"Use mode='quick_reference' for compact syntax cheatsheet (recommended for context efficiency). " +
|
|
108
|
+
"file_path mode defaults to 'quick_reference' to reduce context size; use mode='full' to get complete docs.",
|
|
108
109
|
annotations: {
|
|
109
110
|
readOnlyHint: true,
|
|
110
111
|
destructiveHint: false,
|
|
@@ -134,7 +135,14 @@ export const xanoscriptDocsToolDefinition = {
|
|
|
134
135
|
description: "'full' = complete documentation with explanations and examples. " +
|
|
135
136
|
"'quick_reference' = compact cheatsheet with just syntax patterns and signatures. " +
|
|
136
137
|
"Use 'quick_reference' to save context window space when you just need a reminder. " +
|
|
137
|
-
"Default: 'full'.",
|
|
138
|
+
"Default: 'full' for topic mode, 'quick_reference' for file_path mode.",
|
|
139
|
+
},
|
|
140
|
+
exclude_topics: {
|
|
141
|
+
type: "array",
|
|
142
|
+
items: { type: "string" },
|
|
143
|
+
description: "List of topic names to exclude from file_path results. " +
|
|
144
|
+
"Use this to skip topics you've already loaded (e.g., exclude_topics: ['syntax', 'quickstart']). " +
|
|
145
|
+
"Only applies when using file_path parameter.",
|
|
138
146
|
},
|
|
139
147
|
},
|
|
140
148
|
required: [],
|
package/dist/xanoscript.d.ts
CHANGED
package/dist/xanoscript.js
CHANGED
|
@@ -93,7 +93,7 @@ export const XANOSCRIPT_DOCS_V2 = {
|
|
|
93
93
|
},
|
|
94
94
|
integrations: {
|
|
95
95
|
file: "integrations.md",
|
|
96
|
-
applyTo: [
|
|
96
|
+
applyTo: [],
|
|
97
97
|
description: "External service integrations index - see sub-topics for details",
|
|
98
98
|
},
|
|
99
99
|
"integrations/cloud-storage": {
|
|
@@ -133,7 +133,7 @@ export const XANOSCRIPT_DOCS_V2 = {
|
|
|
133
133
|
},
|
|
134
134
|
addons: {
|
|
135
135
|
file: "addons.md",
|
|
136
|
-
applyTo: ["addons/*.xs"
|
|
136
|
+
applyTo: ["addons/*.xs"],
|
|
137
137
|
description: "Reusable subqueries for fetching related data",
|
|
138
138
|
},
|
|
139
139
|
debugging: {
|
|
@@ -148,12 +148,12 @@ export const XANOSCRIPT_DOCS_V2 = {
|
|
|
148
148
|
},
|
|
149
149
|
realtime: {
|
|
150
150
|
file: "realtime.md",
|
|
151
|
-
applyTo: ["
|
|
151
|
+
applyTo: ["triggers/**/*.xs"],
|
|
152
152
|
description: "Real-time channels and events for push updates",
|
|
153
153
|
},
|
|
154
154
|
schema: {
|
|
155
155
|
file: "schema.md",
|
|
156
|
-
applyTo: [
|
|
156
|
+
applyTo: [],
|
|
157
157
|
description: "Runtime schema parsing and validation",
|
|
158
158
|
},
|
|
159
159
|
security: {
|
|
@@ -163,7 +163,7 @@ export const XANOSCRIPT_DOCS_V2 = {
|
|
|
163
163
|
},
|
|
164
164
|
streaming: {
|
|
165
165
|
file: "streaming.md",
|
|
166
|
-
applyTo: [
|
|
166
|
+
applyTo: [],
|
|
167
167
|
description: "Streaming data from files, requests, and responses",
|
|
168
168
|
},
|
|
169
169
|
middleware: {
|
|
@@ -241,7 +241,9 @@ export function getXanoscriptDocsVersion(docsPath) {
|
|
|
241
241
|
* Read XanoScript documentation with v2 structure
|
|
242
242
|
*/
|
|
243
243
|
export function readXanoscriptDocsV2(docsPath, args) {
|
|
244
|
-
|
|
244
|
+
// Default to quick_reference for file_path mode (loads many topics),
|
|
245
|
+
// full for topic mode (loads single topic)
|
|
246
|
+
const mode = args?.mode || (args?.file_path ? "quick_reference" : "full");
|
|
245
247
|
const version = getXanoscriptDocsVersion(docsPath);
|
|
246
248
|
// Default: return README
|
|
247
249
|
if (!args?.topic && !args?.file_path) {
|
|
@@ -250,7 +252,11 @@ export function readXanoscriptDocsV2(docsPath, args) {
|
|
|
250
252
|
}
|
|
251
253
|
// Context-aware: return docs matching file pattern
|
|
252
254
|
if (args?.file_path) {
|
|
253
|
-
|
|
255
|
+
let topics = getDocsForFilePath(args.file_path);
|
|
256
|
+
// Filter out excluded topics
|
|
257
|
+
if (args.exclude_topics && args.exclude_topics.length > 0) {
|
|
258
|
+
topics = topics.filter((t) => !args.exclude_topics.includes(t));
|
|
259
|
+
}
|
|
254
260
|
if (topics.length === 0) {
|
|
255
261
|
throw new Error(`No documentation found for file pattern: ${args.file_path}\n\nAvailable topics: ${Object.keys(XANOSCRIPT_DOCS_V2).join(", ")}`);
|
|
256
262
|
}
|
package/dist/xanoscript.test.js
CHANGED
|
@@ -70,7 +70,12 @@ describe("xanoscript module", () => {
|
|
|
70
70
|
expect(result).toContain("types");
|
|
71
71
|
expect(result).toContain("database");
|
|
72
72
|
expect(result).toContain("unit-testing");
|
|
73
|
-
|
|
73
|
+
// Niche topics should NOT be auto-included for apis
|
|
74
|
+
expect(result).not.toContain("addons");
|
|
75
|
+
expect(result).not.toContain("integrations");
|
|
76
|
+
expect(result).not.toContain("realtime");
|
|
77
|
+
expect(result).not.toContain("schema");
|
|
78
|
+
expect(result).not.toContain("streaming");
|
|
74
79
|
});
|
|
75
80
|
it("should match functions files", () => {
|
|
76
81
|
const result = getDocsForFilePath("functions/utils/format.xs");
|
|
@@ -78,6 +83,12 @@ describe("xanoscript module", () => {
|
|
|
78
83
|
expect(result).toContain("functions");
|
|
79
84
|
expect(result).toContain("types");
|
|
80
85
|
expect(result).toContain("database");
|
|
86
|
+
// Niche topics should NOT be auto-included for functions
|
|
87
|
+
expect(result).not.toContain("addons");
|
|
88
|
+
expect(result).not.toContain("integrations");
|
|
89
|
+
expect(result).not.toContain("realtime");
|
|
90
|
+
expect(result).not.toContain("schema");
|
|
91
|
+
expect(result).not.toContain("streaming");
|
|
81
92
|
});
|
|
82
93
|
it("should match tables files", () => {
|
|
83
94
|
const result = getDocsForFilePath("tables/users.xs");
|
|
@@ -89,7 +100,8 @@ describe("xanoscript module", () => {
|
|
|
89
100
|
expect(result).toContain("syntax");
|
|
90
101
|
expect(result).toContain("tasks");
|
|
91
102
|
expect(result).toContain("database");
|
|
92
|
-
|
|
103
|
+
// integrations is now topic-only (not auto-included)
|
|
104
|
+
expect(result).not.toContain("integrations");
|
|
93
105
|
});
|
|
94
106
|
it("should match triggers files", () => {
|
|
95
107
|
const result = getDocsForFilePath("triggers/table/users.xs");
|
|
@@ -270,6 +282,35 @@ Even more content.
|
|
|
270
282
|
});
|
|
271
283
|
expect(quickResult).toContain("Mode: quick_reference");
|
|
272
284
|
});
|
|
285
|
+
it("should default to quick_reference mode for file_path", () => {
|
|
286
|
+
const result = readXanoscriptDocsV2(DOCS_PATH, {
|
|
287
|
+
file_path: "apis/test.xs",
|
|
288
|
+
});
|
|
289
|
+
expect(result).toContain("Mode: quick_reference");
|
|
290
|
+
});
|
|
291
|
+
it("should default to full mode for topic", () => {
|
|
292
|
+
const result = readXanoscriptDocsV2(DOCS_PATH, { topic: "syntax" });
|
|
293
|
+
// Full mode returns the complete doc content, not quick_reference
|
|
294
|
+
expect(result).not.toContain("Mode: quick_reference");
|
|
295
|
+
});
|
|
296
|
+
it("should support exclude_topics with file_path", () => {
|
|
297
|
+
const result = readXanoscriptDocsV2(DOCS_PATH, {
|
|
298
|
+
file_path: "apis/users/create.xs",
|
|
299
|
+
exclude_topics: ["syntax", "quickstart"],
|
|
300
|
+
});
|
|
301
|
+
expect(result).toContain("Matched topics:");
|
|
302
|
+
expect(result).not.toContain("Matched topics: syntax");
|
|
303
|
+
// Verify excluded topics are not in the matched list
|
|
304
|
+
const matchLine = result.split("\n").find((l) => l.startsWith("Matched topics:"));
|
|
305
|
+
expect(matchLine).not.toContain("syntax");
|
|
306
|
+
expect(matchLine).not.toContain("quickstart");
|
|
307
|
+
});
|
|
308
|
+
it("should throw when all topics are excluded via exclude_topics", () => {
|
|
309
|
+
expect(() => readXanoscriptDocsV2(DOCS_PATH, {
|
|
310
|
+
file_path: "branch.xs",
|
|
311
|
+
exclude_topics: ["syntax", "cheatsheet", "quickstart", "debugging", "branch"],
|
|
312
|
+
})).toThrow("No documentation found");
|
|
313
|
+
});
|
|
273
314
|
it("should throw for invalid docs path", () => {
|
|
274
315
|
expect(() => readXanoscriptDocsV2("/nonexistent/path", { topic: "syntax" })).toThrow();
|
|
275
316
|
});
|
package/package.json
CHANGED