@xano/developer-mcp 1.0.54 → 1.0.56
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/tools/xanoscript_docs.js +3 -3
- package/dist/xanoscript.js +17 -7
- package/dist/xanoscript.test.js +9 -7
- package/dist/xanoscript_docs/README.md +7 -7
- package/dist/xanoscript_docs/cheatsheet.md +4 -1
- package/dist/xanoscript_docs/database.md +2 -2
- package/dist/xanoscript_docs/docs_index.json +60 -53
- package/dist/xanoscript_docs/essentials.md +665 -0
- package/dist/xanoscript_docs/functions.md +1 -1
- package/dist/xanoscript_docs/middleware.md +5 -18
- package/dist/xanoscript_docs/quickstart.md +15 -6
- package/dist/xanoscript_docs/security.md +18 -43
- package/dist/xanoscript_docs/syntax/array-filters.md +238 -0
- package/dist/xanoscript_docs/syntax/functions.md +136 -0
- package/dist/xanoscript_docs/syntax/string-filters.md +188 -0
- package/dist/xanoscript_docs/syntax.md +92 -900
- package/dist/xanoscript_docs/triggers.md +1 -1
- package/dist/xanoscript_docs/types.md +1 -1
- package/package.json +1 -1
|
@@ -104,7 +104,7 @@ 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
|
|
107
|
+
"Use mode='quick_reference' for compact syntax reference (recommended for context efficiency). " +
|
|
108
108
|
"file_path mode defaults to 'quick_reference' to reduce context size; use mode='full' to get complete docs.",
|
|
109
109
|
annotations: {
|
|
110
110
|
readOnlyHint: true,
|
|
@@ -133,7 +133,7 @@ export const xanoscriptDocsToolDefinition = {
|
|
|
133
133
|
type: "string",
|
|
134
134
|
enum: ["full", "quick_reference"],
|
|
135
135
|
description: "'full' = complete documentation with explanations and examples. " +
|
|
136
|
-
"'quick_reference' = compact
|
|
136
|
+
"'quick_reference' = compact reference with just syntax patterns and signatures. " +
|
|
137
137
|
"Use 'quick_reference' to save context window space when you just need a reminder. " +
|
|
138
138
|
"Default: 'full' for topic mode, 'quick_reference' for file_path mode.",
|
|
139
139
|
},
|
|
@@ -141,7 +141,7 @@ export const xanoscriptDocsToolDefinition = {
|
|
|
141
141
|
type: "array",
|
|
142
142
|
items: { type: "string" },
|
|
143
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', '
|
|
144
|
+
"Use this to skip topics you've already loaded (e.g., exclude_topics: ['syntax', 'essentials']). " +
|
|
145
145
|
"Only applies when using file_path parameter.",
|
|
146
146
|
},
|
|
147
147
|
},
|
package/dist/xanoscript.js
CHANGED
|
@@ -16,20 +16,30 @@ export const XANOSCRIPT_DOCS_V2 = {
|
|
|
16
16
|
applyTo: [],
|
|
17
17
|
description: "XanoScript overview, workspace structure, and quick reference",
|
|
18
18
|
},
|
|
19
|
-
|
|
20
|
-
file: "
|
|
19
|
+
essentials: {
|
|
20
|
+
file: "essentials.md",
|
|
21
21
|
applyTo: ["**/*.xs"],
|
|
22
|
-
description: "
|
|
22
|
+
description: "Common patterns, quick reference, and common mistakes to avoid",
|
|
23
23
|
},
|
|
24
24
|
syntax: {
|
|
25
25
|
file: "syntax.md",
|
|
26
26
|
applyTo: ["**/*.xs"],
|
|
27
27
|
description: "Expressions, operators, and filters for all XanoScript code",
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
file: "
|
|
31
|
-
applyTo: [
|
|
32
|
-
description: "
|
|
29
|
+
"syntax/string-filters": {
|
|
30
|
+
file: "syntax/string-filters.md",
|
|
31
|
+
applyTo: [],
|
|
32
|
+
description: "String filters, regex, encoding, security filters, text functions",
|
|
33
|
+
},
|
|
34
|
+
"syntax/array-filters": {
|
|
35
|
+
file: "syntax/array-filters.md",
|
|
36
|
+
applyTo: [],
|
|
37
|
+
description: "Array filters, functional operations, and array functions",
|
|
38
|
+
},
|
|
39
|
+
"syntax/functions": {
|
|
40
|
+
file: "syntax/functions.md",
|
|
41
|
+
applyTo: [],
|
|
42
|
+
description: "Math filters/functions, object functions, bitwise operations",
|
|
33
43
|
},
|
|
34
44
|
types: {
|
|
35
45
|
file: "types.md",
|
package/dist/xanoscript.test.js
CHANGED
|
@@ -10,9 +10,11 @@ describe("xanoscript module", () => {
|
|
|
10
10
|
it("should have all expected topics", () => {
|
|
11
11
|
const expectedTopics = [
|
|
12
12
|
"readme",
|
|
13
|
-
"
|
|
13
|
+
"essentials",
|
|
14
14
|
"syntax",
|
|
15
|
-
"
|
|
15
|
+
"syntax/string-filters",
|
|
16
|
+
"syntax/array-filters",
|
|
17
|
+
"syntax/functions",
|
|
16
18
|
"types",
|
|
17
19
|
"tables",
|
|
18
20
|
"functions",
|
|
@@ -155,10 +157,10 @@ describe("xanoscript module", () => {
|
|
|
155
157
|
const result = getDocsForFilePath("apis/test.xs");
|
|
156
158
|
expect(result).not.toContain("readme");
|
|
157
159
|
});
|
|
158
|
-
it("should include syntax and
|
|
160
|
+
it("should include syntax and essentials for .xs files", () => {
|
|
159
161
|
const result = getDocsForFilePath("some/random/file.xs");
|
|
160
162
|
expect(result).toContain("syntax");
|
|
161
|
-
expect(result).toContain("
|
|
163
|
+
expect(result).toContain("essentials");
|
|
162
164
|
});
|
|
163
165
|
});
|
|
164
166
|
describe("extractQuickReference", () => {
|
|
@@ -296,19 +298,19 @@ Even more content.
|
|
|
296
298
|
it("should support exclude_topics with file_path", () => {
|
|
297
299
|
const result = readXanoscriptDocsV2(DOCS_PATH, {
|
|
298
300
|
file_path: "apis/users/create.xs",
|
|
299
|
-
exclude_topics: ["syntax", "
|
|
301
|
+
exclude_topics: ["syntax", "essentials"],
|
|
300
302
|
});
|
|
301
303
|
expect(result).toContain("Matched topics:");
|
|
302
304
|
expect(result).not.toContain("Matched topics: syntax");
|
|
303
305
|
// Verify excluded topics are not in the matched list
|
|
304
306
|
const matchLine = result.split("\n").find((l) => l.startsWith("Matched topics:"));
|
|
305
307
|
expect(matchLine).not.toContain("syntax");
|
|
306
|
-
expect(matchLine).not.toContain("
|
|
308
|
+
expect(matchLine).not.toContain("essentials");
|
|
307
309
|
});
|
|
308
310
|
it("should throw when all topics are excluded via exclude_topics", () => {
|
|
309
311
|
expect(() => readXanoscriptDocsV2(DOCS_PATH, {
|
|
310
312
|
file_path: "branch.xs",
|
|
311
|
-
exclude_topics: ["syntax", "
|
|
313
|
+
exclude_topics: ["syntax", "essentials", "debugging", "branch"],
|
|
312
314
|
})).toThrow("No documentation found");
|
|
313
315
|
});
|
|
314
316
|
it("should throw for invalid docs path", () => {
|
|
@@ -111,7 +111,7 @@ $db.table.field // Database field reference (in queries)
|
|
|
111
111
|
$this // Current item in loops/maps
|
|
112
112
|
```
|
|
113
113
|
|
|
114
|
-
**Reserved Variables:** The following cannot be used as variable names: `$response`, `$output`, `$input`, `$auth`, `$env`, `$db`, `$this`, `$result`, `$index`.
|
|
114
|
+
**Reserved Variables:** The following cannot be used as variable names: `$response`, `$output`, `$input`, `$auth`, `$env`, `$db`, `$this`, `$result`, `$index`. See `xanoscript_docs({ topic: "essentials" })` for detailed variable access rules.
|
|
115
115
|
|
|
116
116
|
### Type Names
|
|
117
117
|
|
|
@@ -162,7 +162,7 @@ This helps AI tools apply the correct documentation based on the file being edit
|
|
|
162
162
|
|
|
163
163
|
For common patterns and quick examples, use:
|
|
164
164
|
```
|
|
165
|
-
xanoscript_docs({ topic: "
|
|
165
|
+
xanoscript_docs({ topic: "essentials" })
|
|
166
166
|
```
|
|
167
167
|
|
|
168
168
|
This includes:
|
|
@@ -182,8 +182,8 @@ Use `xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
|
|
|
182
182
|
|
|
183
183
|
| Topic | Description | Key Sections |
|
|
184
184
|
| ------------ | ---------------------------------------------------- | ------------ |
|
|
185
|
-
| `
|
|
186
|
-
| `syntax` | Expressions, operators, filters, system variables | Filters
|
|
185
|
+
| `essentials` | Common patterns, quick examples, mistakes to avoid | Patterns, Common Mistakes |
|
|
186
|
+
| `syntax` | Expressions, operators, filters, system variables | Filters, Error Handling |
|
|
187
187
|
| `types` | Data types, validation, input blocks | Validation Filters, Input Blocks |
|
|
188
188
|
| `functions` | Reusable function stacks, async, loops | Loops, Async Patterns |
|
|
189
189
|
| `schema` | Runtime schema parsing and validation | parse.object, parse.array |
|
|
@@ -193,7 +193,7 @@ Use `xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
|
|
|
193
193
|
| Topic | Description | Key Sections |
|
|
194
194
|
| ----------- | ---------------------------------------------------------- | ------------ |
|
|
195
195
|
| `tables` | Database schema definitions with indexes and relationships | Indexes, Foreign Keys |
|
|
196
|
-
| `database` | All db.\* operations: query, get, add, edit, patch, delete | Decision Tree
|
|
196
|
+
| `database` | All db.\* operations: query, get, add, edit, patch, delete | Decision Tree, Bulk Ops |
|
|
197
197
|
| `addons` | Reusable subqueries for fetching related data | Usage Patterns |
|
|
198
198
|
| `streaming` | Streaming data from files, requests, and responses | File Streams, API Streams |
|
|
199
199
|
|
|
@@ -201,7 +201,7 @@ Use `xanoscript_docs({ topic: "<topic>" })` to retrieve documentation.
|
|
|
201
201
|
|
|
202
202
|
| Topic | Description | Key Sections |
|
|
203
203
|
| ---------- | --------------------------------------------------------------- | ------------ |
|
|
204
|
-
| `apis` | HTTP endpoint definitions with authentication and CRUD patterns | Decision Tree
|
|
204
|
+
| `apis` | HTTP endpoint definitions with authentication and CRUD patterns | Decision Tree, CRUD Examples |
|
|
205
205
|
| `tasks` | Scheduled and cron jobs | Cron Syntax, Input Handling |
|
|
206
206
|
| `triggers` | Event-driven handlers (table, realtime, workspace, agent, MCP) | Predefined Inputs, Event Types |
|
|
207
207
|
| `realtime` | Real-time channels and events for push updates | Channels, Events |
|
|
@@ -287,4 +287,4 @@ function "call_external_api" {
|
|
|
287
287
|
}
|
|
288
288
|
```
|
|
289
289
|
|
|
290
|
-
For more patterns, see `xanoscript_docs({ topic: "
|
|
290
|
+
For more patterns, see `xanoscript_docs({ topic: "essentials" })` or `xanoscript_docs({ topic: "integrations" })`.
|
|
@@ -613,7 +613,7 @@ try_catch {
|
|
|
613
613
|
conditional {
|
|
614
614
|
if ($error.name == "DeadlockError") {
|
|
615
615
|
// Retry logic
|
|
616
|
-
util.sleep { value =
|
|
616
|
+
util.sleep { value = 1 } // value = seconds
|
|
617
617
|
function.run "retry_transaction" { input = $input }
|
|
618
618
|
}
|
|
619
619
|
else {
|
|
@@ -646,6 +646,6 @@ Explore more with `xanoscript_docs({ topic: "<topic>" })`:
|
|
|
646
646
|
|-------|-------------|
|
|
647
647
|
| `tables` | Database schema definitions with indexes and relationships |
|
|
648
648
|
| `syntax` | Query filters, operators, and expressions |
|
|
649
|
-
| `
|
|
649
|
+
| `essentials` | Common CRUD patterns and examples |
|
|
650
650
|
| `addons` | Reusable subqueries for fetching related data |
|
|
651
651
|
| `performance` | Query optimization best practices |
|
|
@@ -3,24 +3,33 @@
|
|
|
3
3
|
"description": "Machine-readable index for XanoScript documentation",
|
|
4
4
|
|
|
5
5
|
"topics": {
|
|
6
|
-
"
|
|
7
|
-
"file": "
|
|
8
|
-
"purpose": "
|
|
6
|
+
"essentials": {
|
|
7
|
+
"file": "essentials.md",
|
|
8
|
+
"purpose": "Common patterns, quick reference, and mistakes to avoid",
|
|
9
9
|
"priority": 1,
|
|
10
|
-
"aliases": ["quick", "common", "basics", "start"]
|
|
11
|
-
},
|
|
12
|
-
"quickstart": {
|
|
13
|
-
"file": "quickstart.md",
|
|
14
|
-
"purpose": "Common patterns and mistakes to avoid",
|
|
15
|
-
"priority": 2,
|
|
16
|
-
"aliases": ["start", "getting-started", "patterns", "mistakes"]
|
|
10
|
+
"aliases": ["quick", "common", "basics", "start", "cheatsheet", "quickstart", "patterns", "mistakes"]
|
|
17
11
|
},
|
|
18
12
|
"syntax": {
|
|
19
13
|
"file": "syntax.md",
|
|
20
|
-
"purpose": "Operators, filters, expressions, error handling",
|
|
21
|
-
"priority":
|
|
14
|
+
"purpose": "Operators, core filters, expressions, error handling",
|
|
15
|
+
"priority": 2,
|
|
22
16
|
"aliases": ["filters", "operators", "expressions"]
|
|
23
17
|
},
|
|
18
|
+
"syntax/string-filters": {
|
|
19
|
+
"file": "syntax/string-filters.md",
|
|
20
|
+
"purpose": "String filters, regex, encoding, security filters, text functions",
|
|
21
|
+
"aliases": ["string", "regex", "encoding", "security-filters"]
|
|
22
|
+
},
|
|
23
|
+
"syntax/array-filters": {
|
|
24
|
+
"file": "syntax/array-filters.md",
|
|
25
|
+
"purpose": "Array filters, functional operations, array functions",
|
|
26
|
+
"aliases": ["array", "map", "filter", "reduce", "sort"]
|
|
27
|
+
},
|
|
28
|
+
"syntax/functions": {
|
|
29
|
+
"file": "syntax/functions.md",
|
|
30
|
+
"purpose": "Math filters/functions, object functions, bitwise operations",
|
|
31
|
+
"aliases": ["math", "object", "bitwise"]
|
|
32
|
+
},
|
|
24
33
|
"types": {
|
|
25
34
|
"file": "types.md",
|
|
26
35
|
"purpose": "Data types, validation, input blocks",
|
|
@@ -220,46 +229,44 @@
|
|
|
220
229
|
"function.run": { "file": "functions.md" },
|
|
221
230
|
"redis.get": { "file": "integrations/redis.md" },
|
|
222
231
|
"redis.set": { "file": "integrations/redis.md" },
|
|
223
|
-
"
|
|
224
|
-
"
|
|
225
|
-
"array.
|
|
226
|
-
"array.
|
|
227
|
-
"array.
|
|
228
|
-
"array.
|
|
229
|
-
"array.
|
|
230
|
-
"array.
|
|
231
|
-
"array.
|
|
232
|
-
"array.
|
|
233
|
-
"array.
|
|
234
|
-
"array.
|
|
235
|
-
"array.
|
|
236
|
-
"array.
|
|
237
|
-
"array.
|
|
238
|
-
"array.
|
|
239
|
-
"array.
|
|
240
|
-
"
|
|
241
|
-
"
|
|
242
|
-
"text.
|
|
243
|
-
"text.
|
|
244
|
-
"text.
|
|
245
|
-
"text.
|
|
246
|
-
"text.
|
|
247
|
-
"text.
|
|
248
|
-
"text.
|
|
249
|
-
"text.
|
|
250
|
-
"text.
|
|
251
|
-
"
|
|
252
|
-
"
|
|
253
|
-
"math.
|
|
254
|
-
"math.
|
|
255
|
-
"math.
|
|
256
|
-
"math.
|
|
257
|
-
"math.bitwise.
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"object.
|
|
261
|
-
"object.values": { "file": "syntax.md" },
|
|
262
|
-
"object.entries": { "file": "syntax.md" },
|
|
232
|
+
"array.push": { "file": "syntax/array-filters.md" },
|
|
233
|
+
"array.pop": { "file": "syntax/array-filters.md" },
|
|
234
|
+
"array.shift": { "file": "syntax/array-filters.md" },
|
|
235
|
+
"array.unshift": { "file": "syntax/array-filters.md" },
|
|
236
|
+
"array.merge": { "file": "syntax/array-filters.md" },
|
|
237
|
+
"array.find": { "file": "syntax/array-filters.md" },
|
|
238
|
+
"array.find_index": { "file": "syntax/array-filters.md" },
|
|
239
|
+
"array.has": { "file": "syntax/array-filters.md" },
|
|
240
|
+
"array.every": { "file": "syntax/array-filters.md" },
|
|
241
|
+
"array.filter": { "file": "syntax/array-filters.md" },
|
|
242
|
+
"array.filter_count": { "file": "syntax/array-filters.md" },
|
|
243
|
+
"array.map": { "file": "syntax/array-filters.md" },
|
|
244
|
+
"array.partition": { "file": "syntax/array-filters.md" },
|
|
245
|
+
"array.group_by": { "file": "syntax/array-filters.md" },
|
|
246
|
+
"array.union": { "file": "syntax/array-filters.md" },
|
|
247
|
+
"array.difference": { "file": "syntax/array-filters.md" },
|
|
248
|
+
"array.intersection": { "file": "syntax/array-filters.md" },
|
|
249
|
+
"text.contains": { "file": "syntax/string-filters.md" },
|
|
250
|
+
"text.icontains": { "file": "syntax/string-filters.md" },
|
|
251
|
+
"text.starts_with": { "file": "syntax/string-filters.md" },
|
|
252
|
+
"text.istarts_with": { "file": "syntax/string-filters.md" },
|
|
253
|
+
"text.ends_with": { "file": "syntax/string-filters.md" },
|
|
254
|
+
"text.iends_with": { "file": "syntax/string-filters.md" },
|
|
255
|
+
"text.trim": { "file": "syntax/string-filters.md" },
|
|
256
|
+
"text.ltrim": { "file": "syntax/string-filters.md" },
|
|
257
|
+
"text.rtrim": { "file": "syntax/string-filters.md" },
|
|
258
|
+
"text.append": { "file": "syntax/string-filters.md" },
|
|
259
|
+
"text.prepend": { "file": "syntax/string-filters.md" },
|
|
260
|
+
"math.add": { "file": "syntax/functions.md" },
|
|
261
|
+
"math.sub": { "file": "syntax/functions.md" },
|
|
262
|
+
"math.mul": { "file": "syntax/functions.md" },
|
|
263
|
+
"math.div": { "file": "syntax/functions.md" },
|
|
264
|
+
"math.bitwise.and": { "file": "syntax/functions.md" },
|
|
265
|
+
"math.bitwise.or": { "file": "syntax/functions.md" },
|
|
266
|
+
"math.bitwise.xor": { "file": "syntax/functions.md" },
|
|
267
|
+
"object.keys": { "file": "syntax/functions.md" },
|
|
268
|
+
"object.values": { "file": "syntax/functions.md" },
|
|
269
|
+
"object.entries": { "file": "syntax/functions.md" },
|
|
263
270
|
"redis.remove": { "file": "integrations/redis.md" },
|
|
264
271
|
"redis.keys": { "file": "integrations/redis.md" },
|
|
265
272
|
"security.jwe_encode": { "file": "security.md" },
|
|
@@ -297,7 +304,7 @@
|
|
|
297
304
|
"authentication": ["security.md", "apis.md"],
|
|
298
305
|
"authorization": ["security.md"],
|
|
299
306
|
"rate_limiting": ["security.md", "integrations/redis.md"],
|
|
300
|
-
"error_handling": ["syntax.md", "
|
|
307
|
+
"error_handling": ["syntax.md", "essentials.md"],
|
|
301
308
|
"pagination": ["database.md", "apis.md"],
|
|
302
309
|
"file_upload": ["integrations/cloud-storage.md", "streaming.md"],
|
|
303
310
|
"caching": ["performance.md", "integrations/redis.md"],
|