@xano/developer-mcp 1.0.25 → 1.0.27
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/README.md +50 -0
- package/dist/cli_docs/format.d.ts +12 -0
- package/dist/cli_docs/format.js +98 -0
- package/dist/{api_docs → cli_docs}/index.d.ts +6 -11
- package/dist/cli_docs/index.js +86 -0
- package/dist/cli_docs/topics/function.js +114 -0
- package/dist/cli_docs/topics/integration.d.ts +2 -0
- package/dist/cli_docs/topics/integration.js +157 -0
- package/dist/{api_docs/topics/agent.d.ts → cli_docs/topics/profile.d.ts} +1 -1
- package/dist/cli_docs/topics/profile.js +153 -0
- package/dist/{api_docs/topics/api.d.ts → cli_docs/topics/run.d.ts} +1 -1
- package/dist/cli_docs/topics/run.js +248 -0
- package/dist/cli_docs/topics/start.js +111 -0
- package/dist/cli_docs/topics/static_host.d.ts +2 -0
- package/dist/cli_docs/topics/static_host.js +77 -0
- package/dist/cli_docs/topics/workspace.js +119 -0
- package/dist/cli_docs/types.d.ts +44 -0
- package/dist/cli_docs/types.js +4 -0
- package/dist/index.js +42 -0
- package/dist/xanoscript_docs/README.md +78 -64
- package/dist/xanoscript_docs/apis.md +81 -27
- package/dist/xanoscript_docs/branch.md +13 -13
- package/dist/xanoscript_docs/database.md +57 -17
- package/dist/xanoscript_docs/functions.md +43 -71
- package/dist/xanoscript_docs/performance.md +14 -23
- package/dist/xanoscript_docs/tables.md +47 -1
- package/dist/xanoscript_docs/tools.md +9 -7
- package/dist/xanoscript_docs/types.md +12 -10
- package/package.json +1 -1
- package/dist/api_docs/format.d.ts +0 -5
- package/dist/api_docs/format.js +0 -171
- package/dist/api_docs/index.js +0 -111
- package/dist/api_docs/topics/agent.js +0 -142
- package/dist/api_docs/topics/api.js +0 -176
- package/dist/api_docs/topics/apigroup.d.ts +0 -2
- package/dist/api_docs/topics/apigroup.js +0 -124
- package/dist/api_docs/topics/authentication.d.ts +0 -2
- package/dist/api_docs/topics/authentication.js +0 -61
- package/dist/api_docs/topics/branch.d.ts +0 -2
- package/dist/api_docs/topics/branch.js +0 -73
- package/dist/api_docs/topics/file.d.ts +0 -2
- package/dist/api_docs/topics/file.js +0 -70
- package/dist/api_docs/topics/function.js +0 -164
- package/dist/api_docs/topics/history.d.ts +0 -2
- package/dist/api_docs/topics/history.js +0 -149
- package/dist/api_docs/topics/mcp_server.d.ts +0 -2
- package/dist/api_docs/topics/mcp_server.js +0 -139
- package/dist/api_docs/topics/middleware.d.ts +0 -2
- package/dist/api_docs/topics/middleware.js +0 -156
- package/dist/api_docs/topics/realtime.d.ts +0 -2
- package/dist/api_docs/topics/realtime.js +0 -112
- package/dist/api_docs/topics/start.js +0 -107
- package/dist/api_docs/topics/table.d.ts +0 -2
- package/dist/api_docs/topics/table.js +0 -195
- package/dist/api_docs/topics/task.d.ts +0 -2
- package/dist/api_docs/topics/task.js +0 -165
- package/dist/api_docs/topics/tool.d.ts +0 -2
- package/dist/api_docs/topics/tool.js +0 -150
- package/dist/api_docs/topics/workflows.d.ts +0 -2
- package/dist/api_docs/topics/workflows.js +0 -131
- package/dist/api_docs/topics/workspace.js +0 -153
- package/dist/api_docs/types.d.ts +0 -79
- package/dist/api_docs/types.js +0 -4
- package/dist/templates/init-workspace.d.ts +0 -10
- package/dist/templates/init-workspace.js +0 -278
- package/dist/templates/xanoscript-index.d.ts +0 -11
- package/dist/templates/xanoscript-index.js +0 -72
- package/dist/xanoscript_docs/ephemeral.md +0 -330
- package/dist/xanoscript_docs_auto/README.md +0 -119
- package/dist/xanoscript_docs_auto/agents.md +0 -446
- package/dist/xanoscript_docs_auto/apis.md +0 -517
- package/dist/xanoscript_docs_auto/control-flow.md +0 -543
- package/dist/xanoscript_docs_auto/database.md +0 -551
- package/dist/xanoscript_docs_auto/debugging.md +0 -527
- package/dist/xanoscript_docs_auto/filters.md +0 -464
- package/dist/xanoscript_docs_auto/functions.md +0 -431
- package/dist/xanoscript_docs_auto/integrations.md +0 -657
- package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
- package/dist/xanoscript_docs_auto/operators.md +0 -368
- package/dist/xanoscript_docs_auto/syntax.md +0 -287
- package/dist/xanoscript_docs_auto/tables.md +0 -447
- package/dist/xanoscript_docs_auto/tasks.md +0 -479
- package/dist/xanoscript_docs_auto/testing.md +0 -574
- package/dist/xanoscript_docs_auto/tools.md +0 -485
- package/dist/xanoscript_docs_auto/triggers.md +0 -595
- package/dist/xanoscript_docs_auto/types.md +0 -323
- package/dist/xanoscript_docs_auto/variables.md +0 -462
- package/dist/xanoscript_docs_auto/version.json +0 -5
- /package/dist/{api_docs → cli_docs}/topics/function.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/start.d.ts +0 -0
- /package/dist/{api_docs → cli_docs}/topics/workspace.d.ts +0 -0
|
@@ -19,7 +19,9 @@ function "<name>" {
|
|
|
19
19
|
}
|
|
20
20
|
response = $result
|
|
21
21
|
}
|
|
22
|
+
```
|
|
22
23
|
|
|
24
|
+
```xs
|
|
23
25
|
// Function with no inputs - IMPORTANT: braces must be on separate lines
|
|
24
26
|
function "<name>" {
|
|
25
27
|
description = "..."
|
|
@@ -31,6 +33,7 @@ function "<name>" {
|
|
|
31
33
|
```
|
|
32
34
|
|
|
33
35
|
### Calling Functions
|
|
36
|
+
|
|
34
37
|
```xs
|
|
35
38
|
function.run "<name>" {
|
|
36
39
|
input = { key: value }
|
|
@@ -55,7 +58,9 @@ function "calculate_total" {
|
|
|
55
58
|
```
|
|
56
59
|
|
|
57
60
|
### With Subfolders
|
|
61
|
+
|
|
58
62
|
Functions can be organized in subfolders:
|
|
63
|
+
|
|
59
64
|
```
|
|
60
65
|
functions/
|
|
61
66
|
├── math/
|
|
@@ -82,31 +87,25 @@ input {
|
|
|
82
87
|
}
|
|
83
88
|
```
|
|
84
89
|
|
|
85
|
-
### Empty Input Blocks
|
|
90
|
+
### Empty and Single-Input Blocks
|
|
86
91
|
|
|
87
|
-
|
|
92
|
+
Empty input blocks and single-input blocks can be written as one-liners. However, when there are two or more inputs, each must be on its own line.
|
|
88
93
|
|
|
89
94
|
```xs
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
description = "Returns all users"
|
|
93
|
-
input {
|
|
94
|
-
}
|
|
95
|
-
stack {
|
|
96
|
-
db.query "user" {} as $users
|
|
97
|
-
}
|
|
98
|
-
response = $users
|
|
99
|
-
}
|
|
95
|
+
// OK - empty input as one-liner
|
|
96
|
+
input {}
|
|
100
97
|
|
|
101
|
-
//
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
response = $users
|
|
98
|
+
// OK - single input as one-liner
|
|
99
|
+
input { email email_input? filters=trim|lower }
|
|
100
|
+
|
|
101
|
+
// OK - multiple inputs on separate lines
|
|
102
|
+
input {
|
|
103
|
+
email email_input? filters=trim|lower
|
|
104
|
+
text name
|
|
109
105
|
}
|
|
106
|
+
|
|
107
|
+
// WRONG - multiple inputs on one line will cause parsing errors
|
|
108
|
+
input { email email_input? filters=trim|lower text name }
|
|
110
109
|
```
|
|
111
110
|
|
|
112
111
|
---
|
|
@@ -116,6 +115,7 @@ function "get_all_users" {
|
|
|
116
115
|
Contains the function logic using control flow, variables, and operations.
|
|
117
116
|
|
|
118
117
|
### Variables
|
|
118
|
+
|
|
119
119
|
```xs
|
|
120
120
|
stack {
|
|
121
121
|
var $counter { value = 0 }
|
|
@@ -127,6 +127,7 @@ stack {
|
|
|
127
127
|
```
|
|
128
128
|
|
|
129
129
|
### Conditionals
|
|
130
|
+
|
|
130
131
|
```xs
|
|
131
132
|
stack {
|
|
132
133
|
conditional {
|
|
@@ -144,6 +145,7 @@ stack {
|
|
|
144
145
|
```
|
|
145
146
|
|
|
146
147
|
### Loops
|
|
148
|
+
|
|
147
149
|
```xs
|
|
148
150
|
stack {
|
|
149
151
|
// For loop (count-based)
|
|
@@ -170,6 +172,7 @@ stack {
|
|
|
170
172
|
```
|
|
171
173
|
|
|
172
174
|
### Switch
|
|
175
|
+
|
|
173
176
|
```xs
|
|
174
177
|
stack {
|
|
175
178
|
switch ($input.status) {
|
|
@@ -208,6 +211,7 @@ response = null // No return value
|
|
|
208
211
|
## Calling Functions
|
|
209
212
|
|
|
210
213
|
### Basic Call
|
|
214
|
+
|
|
211
215
|
```xs
|
|
212
216
|
function.run "calculate_total" {
|
|
213
217
|
input = { quantity: 5, price: 10.50 }
|
|
@@ -215,6 +219,7 @@ function.run "calculate_total" {
|
|
|
215
219
|
```
|
|
216
220
|
|
|
217
221
|
### With Variables
|
|
222
|
+
|
|
218
223
|
```xs
|
|
219
224
|
function.run "process_order" {
|
|
220
225
|
input = {
|
|
@@ -226,6 +231,7 @@ function.run "process_order" {
|
|
|
226
231
|
```
|
|
227
232
|
|
|
228
233
|
### Nested Calls
|
|
234
|
+
|
|
229
235
|
```xs
|
|
230
236
|
stack {
|
|
231
237
|
function.run "validate_user" {
|
|
@@ -245,6 +251,7 @@ stack {
|
|
|
245
251
|
## Complete Examples
|
|
246
252
|
|
|
247
253
|
### Utility Function
|
|
254
|
+
|
|
248
255
|
```xs
|
|
249
256
|
function "utils/format_currency" {
|
|
250
257
|
description = "Format number as currency string"
|
|
@@ -265,6 +272,7 @@ function "utils/format_currency" {
|
|
|
265
272
|
```
|
|
266
273
|
|
|
267
274
|
### Data Processing
|
|
275
|
+
|
|
268
276
|
```xs
|
|
269
277
|
function "process_order" {
|
|
270
278
|
input {
|
|
@@ -305,6 +313,7 @@ function "process_order" {
|
|
|
305
313
|
```
|
|
306
314
|
|
|
307
315
|
### Validation Function
|
|
316
|
+
|
|
308
317
|
```xs
|
|
309
318
|
function "validate_email_unique" {
|
|
310
319
|
input {
|
|
@@ -346,65 +355,28 @@ stack {
|
|
|
346
355
|
}
|
|
347
356
|
```
|
|
348
357
|
|
|
349
|
-
### group (
|
|
358
|
+
### group (Organizational Block)
|
|
350
359
|
|
|
351
|
-
|
|
360
|
+
Group related statements together for readability. The `group` block is purely organizational — it does **not** create parallel execution or a new scope.
|
|
352
361
|
|
|
353
362
|
```xs
|
|
354
363
|
stack {
|
|
364
|
+
// Use group to visually organize related initialization
|
|
355
365
|
group {
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
api.request {
|
|
362
|
-
url = "https://api.example.com/products"
|
|
363
|
-
method = "GET"
|
|
364
|
-
} as $products
|
|
365
|
-
|
|
366
|
-
api.request {
|
|
367
|
-
url = "https://api.example.com/orders"
|
|
368
|
-
method = "GET"
|
|
369
|
-
} as $orders
|
|
370
|
-
}
|
|
366
|
+
stack {
|
|
367
|
+
var $total {
|
|
368
|
+
value = 0
|
|
369
|
+
}
|
|
371
370
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
users: $users.response.result,
|
|
376
|
-
products: $products.response.result,
|
|
377
|
-
orders: $orders.response.result
|
|
371
|
+
var $count {
|
|
372
|
+
value = 0
|
|
373
|
+
}
|
|
378
374
|
}
|
|
379
375
|
}
|
|
380
|
-
}
|
|
381
|
-
```
|
|
382
|
-
|
|
383
|
-
### Parallel Database Queries
|
|
384
|
-
|
|
385
|
-
```xs
|
|
386
|
-
stack {
|
|
387
|
-
group {
|
|
388
|
-
db.query "user" {
|
|
389
|
-
where = $db.user.is_active == true
|
|
390
|
-
return = { type: "count" }
|
|
391
|
-
} as $active_users
|
|
392
|
-
|
|
393
|
-
db.query "order" {
|
|
394
|
-
where = $db.order.created_at >= $input.start_date
|
|
395
|
-
return = { type: "count" }
|
|
396
|
-
} as $order_count
|
|
397
|
-
|
|
398
|
-
db.query "product" {
|
|
399
|
-
where = $db.product.stock == 0
|
|
400
|
-
return = { type: "count" }
|
|
401
|
-
} as $out_of_stock
|
|
402
|
-
}
|
|
403
376
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
out_of_stock: $out_of_stock
|
|
377
|
+
// Variables from the group are accessible here
|
|
378
|
+
var $average {
|
|
379
|
+
value = $total / $count
|
|
408
380
|
}
|
|
409
381
|
}
|
|
410
382
|
```
|
|
@@ -512,5 +484,5 @@ foreach ($items) {
|
|
|
512
484
|
3. **Organize in folders** - Group related functions: `utils/`, `auth/`, `orders/`
|
|
513
485
|
4. **Return early** - Use return for guard clauses
|
|
514
486
|
5. **Keep stacks shallow** - Avoid deeply nested conditionals
|
|
515
|
-
6. **Use group for
|
|
487
|
+
6. **Use group for organization** - Visually group related statements for readability
|
|
516
488
|
7. **Use remove sparingly** - Consider filtering arrays instead
|
|
@@ -12,7 +12,7 @@ Best practices for building fast, efficient XanoScript applications.
|
|
|
12
12
|
|------|----------------|
|
|
13
13
|
| Database | Indexes, query optimization, pagination |
|
|
14
14
|
| Caching | Redis, response caching |
|
|
15
|
-
| Loops | Bulk operations,
|
|
15
|
+
| Loops | Bulk operations, efficient iteration |
|
|
16
16
|
| Filters | Efficient data transformations |
|
|
17
17
|
|
|
18
18
|
---
|
|
@@ -212,34 +212,25 @@ conditional {
|
|
|
212
212
|
|
|
213
213
|
---
|
|
214
214
|
|
|
215
|
-
##
|
|
215
|
+
## Organizing with Group
|
|
216
216
|
|
|
217
|
-
|
|
217
|
+
The `group` statement is an organizational block for visually grouping related statements. It does **not** create parallel execution or a new scope — variables declared inside a group are accessible outside it.
|
|
218
218
|
|
|
219
219
|
```xs
|
|
220
|
-
//
|
|
220
|
+
// Use group to organize related variable initialization
|
|
221
221
|
group {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
}
|
|
222
|
+
stack {
|
|
223
|
+
var $total {
|
|
224
|
+
value = 0
|
|
225
|
+
}
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
products: $product_count
|
|
227
|
+
var $count {
|
|
228
|
+
value = 0
|
|
229
|
+
}
|
|
230
|
+
}
|
|
232
231
|
}
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
### Parallel API Calls
|
|
236
232
|
|
|
237
|
-
|
|
238
|
-
group {
|
|
239
|
-
api.request { url = "https://api1.example.com/data" } as $data1
|
|
240
|
-
api.request { url = "https://api2.example.com/data" } as $data2
|
|
241
|
-
api.request { url = "https://api3.example.com/data" } as $data3
|
|
242
|
-
}
|
|
233
|
+
// $total and $count are accessible here
|
|
243
234
|
```
|
|
244
235
|
|
|
245
236
|
---
|
|
@@ -401,7 +392,7 @@ conditional {
|
|
|
401
392
|
4. **Avoid N+1 queries** - Use joins or batch fetching
|
|
402
393
|
5. **Use bulk operations** - For batch inserts/updates
|
|
403
394
|
6. **Cache expensive operations** - Redis with appropriate TTL
|
|
404
|
-
7. **
|
|
395
|
+
7. **Use group for organization** - Group related statements for readability
|
|
405
396
|
8. **Filter early** - In database, not application code
|
|
406
397
|
9. **Stream large responses** - Don't load into memory
|
|
407
398
|
10. **Monitor performance** - Log slow operations
|
|
@@ -23,9 +23,11 @@ table "<name>" {
|
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
### Field Types
|
|
26
|
+
|
|
26
27
|
`int`, `text`, `email`, `password`, `decimal`, `bool`, `timestamp`, `date`, `uuid`, `vector`, `json`, `image`, `video`, `audio`, `attachment`, `enum`
|
|
27
28
|
|
|
28
29
|
### Index Types
|
|
30
|
+
|
|
29
31
|
`primary`, `btree`, `btree|unique`, `gin`
|
|
30
32
|
|
|
31
33
|
---
|
|
@@ -58,6 +60,7 @@ table "user" {
|
|
|
58
60
|
## Schema Fields
|
|
59
61
|
|
|
60
62
|
### Basic Fields
|
|
63
|
+
|
|
61
64
|
```xs
|
|
62
65
|
schema {
|
|
63
66
|
int id
|
|
@@ -70,6 +73,7 @@ schema {
|
|
|
70
73
|
```
|
|
71
74
|
|
|
72
75
|
### Optional & Defaults
|
|
76
|
+
|
|
73
77
|
```xs
|
|
74
78
|
schema {
|
|
75
79
|
text nickname? // Optional, no default
|
|
@@ -80,6 +84,7 @@ schema {
|
|
|
80
84
|
```
|
|
81
85
|
|
|
82
86
|
### With Filters
|
|
87
|
+
|
|
83
88
|
```xs
|
|
84
89
|
schema {
|
|
85
90
|
text name filters=trim
|
|
@@ -90,6 +95,7 @@ schema {
|
|
|
90
95
|
```
|
|
91
96
|
|
|
92
97
|
### With Metadata
|
|
98
|
+
|
|
93
99
|
```xs
|
|
94
100
|
schema {
|
|
95
101
|
text ssn {
|
|
@@ -104,6 +110,7 @@ schema {
|
|
|
104
110
|
```
|
|
105
111
|
|
|
106
112
|
### Foreign Keys
|
|
113
|
+
|
|
107
114
|
```xs
|
|
108
115
|
schema {
|
|
109
116
|
int user_id {
|
|
@@ -117,6 +124,7 @@ schema {
|
|
|
117
124
|
```
|
|
118
125
|
|
|
119
126
|
### Enum Fields
|
|
127
|
+
|
|
120
128
|
```xs
|
|
121
129
|
schema {
|
|
122
130
|
enum status {
|
|
@@ -129,6 +137,7 @@ schema {
|
|
|
129
137
|
```
|
|
130
138
|
|
|
131
139
|
### JSON Fields
|
|
140
|
+
|
|
132
141
|
```xs
|
|
133
142
|
schema {
|
|
134
143
|
json metadata
|
|
@@ -137,17 +146,24 @@ schema {
|
|
|
137
146
|
```
|
|
138
147
|
|
|
139
148
|
### Vector Fields
|
|
149
|
+
|
|
140
150
|
```xs
|
|
141
151
|
schema {
|
|
142
|
-
vector embedding //
|
|
152
|
+
vector embedding // Required vector field
|
|
153
|
+
vector? embeddings? { // Optional vector field with explicit size
|
|
154
|
+
size = 768
|
|
155
|
+
}
|
|
143
156
|
}
|
|
144
157
|
```
|
|
145
158
|
|
|
159
|
+
The `size` parameter specifies the vector dimensions (must match your embedding model's output). Pair with a vector index for similarity search (see [Vector Index](#vector-index) below).
|
|
160
|
+
|
|
146
161
|
---
|
|
147
162
|
|
|
148
163
|
## Indexes
|
|
149
164
|
|
|
150
165
|
### Primary Key
|
|
166
|
+
|
|
151
167
|
```xs
|
|
152
168
|
index = [
|
|
153
169
|
{type: "primary", field: [{name: "id"}]}
|
|
@@ -155,6 +171,7 @@ index = [
|
|
|
155
171
|
```
|
|
156
172
|
|
|
157
173
|
### B-tree Index
|
|
174
|
+
|
|
158
175
|
```xs
|
|
159
176
|
index = [
|
|
160
177
|
{type: "btree", field: [{name: "email", op: "asc"}]}
|
|
@@ -163,6 +180,7 @@ index = [
|
|
|
163
180
|
```
|
|
164
181
|
|
|
165
182
|
### Unique Index
|
|
183
|
+
|
|
166
184
|
```xs
|
|
167
185
|
index = [
|
|
168
186
|
{type: "btree|unique", field: [{name: "email"}]}
|
|
@@ -171,6 +189,7 @@ index = [
|
|
|
171
189
|
```
|
|
172
190
|
|
|
173
191
|
### Composite Index
|
|
192
|
+
|
|
174
193
|
```xs
|
|
175
194
|
index = [
|
|
176
195
|
{type: "btree", field: [{name: "user_id"}, {name: "created_at", op: "desc"}]}
|
|
@@ -178,6 +197,7 @@ index = [
|
|
|
178
197
|
```
|
|
179
198
|
|
|
180
199
|
### GIN Index (for JSON/arrays)
|
|
200
|
+
|
|
181
201
|
```xs
|
|
182
202
|
index = [
|
|
183
203
|
{type: "gin", field: [{name: "tags", op: "jsonb_path_op"}]}
|
|
@@ -185,11 +205,35 @@ index = [
|
|
|
185
205
|
]
|
|
186
206
|
```
|
|
187
207
|
|
|
208
|
+
### Full-Text Search Index
|
|
209
|
+
|
|
210
|
+
```xs
|
|
211
|
+
index = [
|
|
212
|
+
{
|
|
213
|
+
name : "search_content"
|
|
214
|
+
lang : "english"
|
|
215
|
+
type : "search"
|
|
216
|
+
field: [{name: "searchable_content", op: "A"}]
|
|
217
|
+
}
|
|
218
|
+
]
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
### Vector Index
|
|
222
|
+
|
|
223
|
+
```xs
|
|
224
|
+
index = [
|
|
225
|
+
{type: "vector", field: [{name: "embeddings", op: "vector_cosine_ops"}]}
|
|
226
|
+
]
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
Required for vector similarity searches via `cosine_distance` in `db.query`. PostgreSQL vector indexes only support ascending scans, so queries must sort by distance `asc` to use the index. Sorting `desc` will bypass the index and trigger a full table scan. See [database.md](database.md) for query usage.
|
|
230
|
+
|
|
188
231
|
---
|
|
189
232
|
|
|
190
233
|
## Complete Examples
|
|
191
234
|
|
|
192
235
|
### User Table (with auth)
|
|
236
|
+
|
|
193
237
|
```xs
|
|
194
238
|
table "user" {
|
|
195
239
|
auth = true
|
|
@@ -212,6 +256,7 @@ table "user" {
|
|
|
212
256
|
```
|
|
213
257
|
|
|
214
258
|
### Product Table
|
|
259
|
+
|
|
215
260
|
```xs
|
|
216
261
|
table "product" {
|
|
217
262
|
auth = false
|
|
@@ -235,6 +280,7 @@ table "product" {
|
|
|
235
280
|
```
|
|
236
281
|
|
|
237
282
|
### Order with Foreign Keys
|
|
283
|
+
|
|
238
284
|
```xs
|
|
239
285
|
table "order" {
|
|
240
286
|
auth = false
|
|
@@ -74,23 +74,25 @@ input {
|
|
|
74
74
|
}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
|
-
### Empty Input Blocks
|
|
77
|
+
### Empty and Single-Input Blocks
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
Empty input blocks and single-input blocks can be written as one-liners. When there are two or more inputs, each must be on its own line.
|
|
80
80
|
|
|
81
81
|
```xs
|
|
82
|
-
//
|
|
82
|
+
// OK - empty input
|
|
83
83
|
tool "get_system_status" {
|
|
84
84
|
description = "Get current system status"
|
|
85
85
|
instructions = "Use this to check if the system is healthy"
|
|
86
|
-
input {
|
|
87
|
-
}
|
|
86
|
+
input {}
|
|
88
87
|
stack { ... }
|
|
89
88
|
response = $status
|
|
90
89
|
}
|
|
91
90
|
|
|
92
|
-
//
|
|
93
|
-
input {}
|
|
91
|
+
// OK - single input as one-liner
|
|
92
|
+
input { text query filters=trim }
|
|
93
|
+
|
|
94
|
+
// WRONG - multiple inputs on one line will cause parsing errors
|
|
95
|
+
input { text query filters=trim int limit }
|
|
94
96
|
```
|
|
95
97
|
|
|
96
98
|
---
|
|
@@ -60,23 +60,25 @@ input {
|
|
|
60
60
|
}
|
|
61
61
|
```
|
|
62
62
|
|
|
63
|
-
### Empty Input Blocks
|
|
63
|
+
### Empty and Single-Input Blocks
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
Empty input blocks and single-input blocks can be written as one-liners. When there are two or more inputs, each must be on its own line.
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
```xs
|
|
68
|
+
// OK - empty input as one-liner
|
|
69
|
+
input {}
|
|
68
70
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- Function/API/tool will fail to deploy
|
|
71
|
+
// OK - single input as one-liner
|
|
72
|
+
input { email email_input? filters=trim|lower }
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
// CORRECT - braces on separate lines
|
|
74
|
+
// OK - multiple inputs on separate lines
|
|
75
75
|
input {
|
|
76
|
+
email email_input? filters=trim|lower
|
|
77
|
+
text name
|
|
76
78
|
}
|
|
77
79
|
|
|
78
|
-
// WRONG -
|
|
79
|
-
input {}
|
|
80
|
+
// WRONG - multiple inputs on one line will cause parsing errors
|
|
81
|
+
input { email email_input? filters=trim|lower text name }
|
|
80
82
|
```
|
|
81
83
|
|
|
82
84
|
Access inputs in stack: `$input.username`, `$input.age`
|
package/package.json
CHANGED