@xano/developer-mcp 2.3.0-beta.7 → 2.3.0-beta.9

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.
@@ -152,10 +152,7 @@ db.get "product" {
152
152
  A dotted path selects a nested field (`"price.amount"`). `output` is valid on `db.query`,
153
153
  `db.get`, `db.add`, `db.edit`, `db.patch` and `db.add_or_edit`; `db.has`, `db.del` and the
154
154
  bulk statements do not take it. The bundled language server behind `xano_validate_xanoscript`
155
- rejects it on `db.patch` and `db.add_or_edit`, which the platform accepts. The policy check
156
- `statement.param_required` with `param_names: ["output"]` (and `statements: ["db.query",
157
- "db.get"]`) is how a workspace requires it, so a finding reading `output must be explicit` is
158
- asking for exactly this line.
155
+ rejects it on `db.patch` and `db.add_or_edit`, which the platform accepts.
159
156
 
160
157
  ### Sorting
161
158
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.8.0",
2
+ "version": "2.11.0",
3
3
  "description": "Machine-readable index for XanoScript documentation (version mirrors version.json)",
4
4
 
5
5
  "topics": {
@@ -117,12 +117,19 @@
117
117
  "priority": 5,
118
118
  "aliases": ["db", "crud", "query", "sql"]
119
119
  },
120
+ "ai": {
121
+ "file": "ai.md",
122
+ "description": "Xano AI statements (credits only): ai.text.generate, ai.image.generate, ai.video.generate, ai.speech.generate, ai.speech.transcribe, ai.embedding.create, ai.rerank, ai.music.generate",
123
+ "applyTo": [],
124
+ "priority": 9,
125
+ "aliases": ["xano-ai", "ai-statements", "generate", "image-generation", "embeddings", "embedding", "rerank", "transcribe", "tts", "text-to-speech", "speech-to-text"]
126
+ },
120
127
  "agents": {
121
128
  "file": "agents.md",
122
129
  "description": "AI agent configuration with LLM providers and tools",
123
130
  "applyTo": ["ai/agent/*.xs"],
124
131
  "priority": 3,
125
- "aliases": ["ai", "llm", "chatbot"]
132
+ "aliases": ["agent", "llm", "chatbot"]
126
133
  },
127
134
  "tools": {
128
135
  "file": "tools.md",
@@ -154,8 +161,8 @@
154
161
  },
155
162
  "unit-testing": {
156
163
  "file": "unit-testing.md",
157
- "description": "Unit tests, mocks, and assertions within functions, APIs, and middleware",
158
- "applyTo": ["function/**/*.xs", "api/**/*.xs", "middleware/*.xs"],
164
+ "description": "Unit tests, mocks, and assertions within functions, APIs, middleware, and MCP tools, prompts and resources",
165
+ "applyTo": ["function/**/*.xs", "api/**/*.xs", "middleware/*.xs", "ai/tool/*.xs", "ai/prompt/*.xs", "prompt/**/*.xs", "ai/resource/*.xs", "resource/**/*.xs"],
159
166
  "priority": 7,
160
167
  "aliases": ["tests", "unit-tests", "mocks", "assertions"]
161
168
  },
@@ -305,20 +312,6 @@
305
312
  "applyTo": ["workspace/**/*.xs"],
306
313
  "priority": 3,
307
314
  "aliases": ["env", "environment", "preferences"]
308
- },
309
- "policies": {
310
- "file": "policies.md",
311
- "description": "Workspace policies: human descriptions and deterministic check rules, validated by the platform",
312
- "applyTo": ["policies/*.xs"],
313
- "exclusive": true,
314
- "priority": 3,
315
- "aliases": ["policy", "governance"]
316
- },
317
- "policy-templates": {
318
- "file": "policy-templates.md",
319
- "description": "The platform's policy templates by category: key, title, checks, framework tags and the settings each leaves to fill, with an example; recipes for goals that take several templates; what no check can see",
320
- "applyTo": [],
321
- "aliases": ["policy-template"]
322
315
  }
323
316
  },
324
317
 
@@ -384,10 +377,10 @@
384
377
  "api_group": { "file": "apis.md" },
385
378
  "task": { "file": "tasks.md" },
386
379
  "agent": { "file": "agents.md", "tools": "tools.md" },
387
- "tool": { "file": "tools.md", "mcp": "mcp-servers.md" },
380
+ "tool": { "file": "tools.md", "mcp": "mcp-servers.md", "testing": "unit-testing.md" },
388
381
  "mcp_server": { "file": "mcp-servers.md", "triggers": "triggers.md" },
389
- "prompt": { "file": "prompts.md", "mcp": "mcp-servers.md" },
390
- "resource": { "file": "resources.md", "mcp": "mcp-servers.md" },
382
+ "prompt": { "file": "prompts.md", "mcp": "mcp-servers.md", "testing": "unit-testing.md" },
383
+ "resource": { "file": "resources.md", "mcp": "mcp-servers.md", "testing": "unit-testing.md" },
391
384
  "table_trigger": { "file": "triggers.md", "section": "table-trigger" },
392
385
  "realtime_trigger": { "file": "triggers.md", "section": "realtime-trigger" },
393
386
  "workspace_trigger": { "file": "triggers.md", "section": "workspace-trigger" },
@@ -407,6 +400,15 @@
407
400
  "operations": {
408
401
  "realtime.publish": { "file": "realtime-v2.md" },
409
402
  "realtime.get_session": { "file": "realtime-v2.md" },
403
+ "ai.agent.run": { "file": "agents.md" },
404
+ "ai.text.generate": { "file": "ai.md" },
405
+ "ai.image.generate": { "file": "ai.md" },
406
+ "ai.video.generate": { "file": "ai.md" },
407
+ "ai.speech.generate": { "file": "ai.md" },
408
+ "ai.speech.transcribe": { "file": "ai.md" },
409
+ "ai.embedding.create": { "file": "ai.md" },
410
+ "ai.rerank": { "file": "ai.md" },
411
+ "ai.music.generate": { "file": "ai.md" },
410
412
  "mcp.elicit": { "file": "mcp-servers.md" },
411
413
  "mcp.progress": { "file": "mcp-servers.md" },
412
414
  "db.query": { "file": "database.md" },
@@ -512,6 +514,8 @@
512
514
  "email": ["integrations/utilities.md"],
513
515
  "scheduled_jobs": ["tasks.md"],
514
516
  "realtime": ["realtime.md", "triggers.md"],
515
- "ai_agents": ["agents.md", "tools.md", "mcp-servers.md"]
517
+ "ai_agents": ["agents.md", "tools.md", "mcp-servers.md"],
518
+ "ai_generation": ["ai.md", "file-uploads.md"],
519
+ "embeddings": ["ai.md", "database.md", "tables.md"]
516
520
  }
517
521
  }
@@ -621,20 +621,7 @@ db.query "dad_jokes" {
621
621
  } as $joke
622
622
  ```
623
623
 
624
- ### 10. Using $env in run.job input blocks
625
- ```xs
626
- // Wrong - $env not allowed in input blocks
627
- // run.job "my_job" { input { text api_key = $env.API_KEY } }
628
-
629
- // Correct - access $env in the stack instead
630
- run.job "my_job" {
631
- stack {
632
- var $api_key { value = $env.API_KEY }
633
- }
634
- }
635
- ```
636
-
637
- ### 11. Using `object` type without schema
624
+ ### 10. Using `object` type without schema
638
625
  ```xs
639
626
  // Wrong - object requires a schema
640
627
  // input { object data }
@@ -655,7 +642,7 @@ input {
655
642
  }
656
643
  ```
657
644
 
658
- ### 12. While loop outside of stack block
645
+ ### 11. While loop outside of stack block
659
646
  ```xs
660
647
  // Wrong - while must be inside stack
661
648
  // while (true) { each { ... } }
@@ -668,7 +655,7 @@ stack {
668
655
  }
669
656
  ```
670
657
 
671
- ### 13. Multiple constructs in one file
658
+ ### 12. Multiple constructs in one file
672
659
 
673
660
  Each `.xs` file must contain exactly **one** construct. Placing two constructs in the same file causes a parse error.
674
661
 
@@ -682,7 +669,7 @@ Each `.xs` file must contain exactly **one** construct. Placing two constructs i
682
669
  // function/helper_b.xs -> contains only "helper_b"
683
670
  ```
684
671
 
685
- ### 14. Using `image?` for file uploads (the `.path` footgun)
672
+ ### 13. Using `image?` for file uploads (the `.path` footgun)
686
673
 
687
674
  Upload inputs **must** be typed `file?`. `image?`/`attachment?`/`video?`/`audio?` pass the raw upload object (which has `tmp_name` but no `.path`), so `storage.*` fails at runtime with `Missing param: path`. The validator does **not** catch this — it is syntactically valid.
688
675
 
@@ -708,7 +695,7 @@ stack {
708
695
 
709
696
  See `xano_xanoscript_docs({ topic: "file-uploads" })` for the full pattern.
710
697
 
711
- ### 15. Wrong delete operation names
698
+ ### 14. Wrong delete operation names
712
699
 
713
700
  There is no `db.delete`, no `db.delete_all`, and no fluent `db.<table>.query()...delete()`. The parser rejects all three. Pick by scope: one record, many-by-condition, or the whole table.
714
701
 
@@ -735,7 +722,7 @@ db.truncate "session" { reset = true }
735
722
 
736
723
  See `xano_xanoscript_docs({ topic: "database" })` for all delete operations.
737
724
 
738
- ### 16. Read-then-edit counters (lost updates)
725
+ ### 15. Read-then-edit counters (lost updates)
739
726
 
740
727
  `db.get` → add → `db.edit` races: two concurrent requests both read `5` and write `6`. Use `db.increment` (atomic; negative `value` decrements; guard with `where`, no clamping; the key is `field_name`).
741
728
 
@@ -747,6 +734,10 @@ db.increment "product" {
747
734
  } as $products
748
735
  ```
749
736
 
737
+ ### 17. `api_key` on `ai.*`, an agent for a one-shot call, or raw media in a file column
738
+
739
+ Xano AI `ai.*` statements bill credits only: no `api_key`/`provider` key. One prompt → one answer is `ai.text.generate`; `ai.agent.run` is for tools or multi-step work. `$result.image`/`.audio` is a temporary file resource (saves `null` in a file column) unless `save_to_files = "public"`: the key then holds the stored file. Or store a `storage.create_image`/`_audio`/`_video` result. Topic: `ai`.
740
+
750
741
  ---
751
742
 
752
743
  ## Validation is syntax-only
@@ -767,5 +758,6 @@ Explore more with `xano_xanoscript_docs({ topic: "<topic>" })`:
767
758
  | `functions` | Reusable function stacks, async patterns, loops |
768
759
  | `apis` | HTTP endpoints, authentication, CRUD patterns |
769
760
  | `file-uploads` | Uploading files to Xano storage (`file?`, create_attachment, signed URLs) |
761
+ | `ai` | Xano AI statements: generate text/images/video/speech/music, transcribe, embed, rerank |
770
762
  | `security` | Security best practices and authentication |
771
763
  | `integrations` | External API patterns (OpenAI, Stripe, etc.) |
@@ -156,10 +156,6 @@ input {
156
156
  }
157
157
  ```
158
158
 
159
- ### Workspace policies
160
-
161
- If the project has a `policies/` folder, the branch has governance policies. Keep to the active blocking ones while you write code (their findings block merges), then evaluate after changing code: `xano policy evaluate`, the `policy_check` a `xano workspace push` returns, or `xano_evaluate_policies`. `topic: "policies"` has the details.
162
-
163
159
  ### Available Topics
164
160
 
165
- survival, working, readme, essentials, syntax, syntax/string-filters, syntax/array-filters, syntax/functions, types, database, functions, apis, tables, tasks, triggers, agents, tools, mcp-servers, prompts, resources, security, performance, debugging, unit-testing, workflow-tests, middleware, addons, realtime, realtime-v2, streaming, schema, integrations, integrations/cloud-storage, integrations/search, integrations/redis, integrations/external-apis, integrations/utilities, workspace, branch, run, frontend, policies
161
+ survival, working, readme, essentials, syntax, syntax/string-filters, syntax/array-filters, syntax/functions, types, database, functions, apis, tables, tasks, triggers, agents, tools, mcp-servers, prompts, resources, security, performance, debugging, unit-testing, workflow-tests, middleware, addons, realtime, realtime-v2, streaming, schema, integrations, integrations/cloud-storage, integrations/search, integrations/redis, integrations/external-apis, integrations/utilities, workspace, branch, run, frontend
@@ -1,10 +1,10 @@
1
1
  ---
2
- applyTo: "function/**/*.xs, api/**/*.xs, middleware/*.xs"
2
+ applyTo: "function/**/*.xs, api/**/*.xs, middleware/*.xs, ai/tool/*.xs, ai/prompt/*.xs, prompt/**/*.xs, ai/resource/*.xs, resource/**/*.xs"
3
3
  ---
4
4
 
5
5
  # Unit Testing
6
6
 
7
- Unit tests, mocks, and assertions defined inline within functions, API endpoints, and middleware. Unit tests validate individual construct behavior in isolation — for end-to-end workflow testing across multiple constructs, see `workflow-tests`.
7
+ Unit tests, mocks, and assertions defined inline within functions, API endpoints, middleware, and MCP tools, prompts and resources. Unit tests validate individual construct behavior in isolation — for end-to-end workflow testing across multiple constructs, see `workflow-tests`.
8
8
 
9
9
  ## Quick Reference
10
10
 
@@ -275,6 +275,33 @@ query "products/{id}" verb=GET {
275
275
 
276
276
  ---
277
277
 
278
+ ## Testing MCP Tools, Prompts and Resources
279
+
280
+ A `tool`, `prompt` or `resource` takes `test` blocks the same way. The test's `input` fills the declaration's inputs, and `$response` is its `response` value.
281
+
282
+ ```xs
283
+ prompt "summarize" {
284
+ input {
285
+ text doc
286
+ }
287
+
288
+ stack {
289
+ var $messages {
290
+ value = [{role: "user", content: "Summarize: " ~ $input.doc}]
291
+ }
292
+ }
293
+
294
+ response = $messages
295
+
296
+ test "builds one user message" {
297
+ input = { doc: "hello" }
298
+ expect.to_not_equal ($response) { value = null }
299
+ }
300
+ }
301
+ ```
302
+
303
+ ---
304
+
278
305
  ## Testing Error Cases
279
306
 
280
307
  ```xs
@@ -1,4 +1,4 @@
1
1
  {
2
- "version": "2.9.1",
3
- "updated": "2026-10-21"
2
+ "version": "2.11.0",
3
+ "updated": "2026-11-03"
4
4
  }
@@ -128,14 +128,7 @@ throw {
128
128
  var $obj { value = { name: "Alice", age: 30 } }
129
129
  ```
130
130
 
131
- ### 10. Using $env in run.job input blocks
132
- ```xs
133
- // WRONG: run.job "my_job" { input { text api_key = $env.API_KEY } }
134
- // RIGHT — access $env in the stack:
135
- run.job "my_job" { stack { var $api_key { value = $env.API_KEY } } }
136
- ```
137
-
138
- ### 11. Using `object` type without schema
131
+ ### 10. Using `object` type without schema
139
132
  ```xs
140
133
  // WRONG: input { object data }
141
134
  // RIGHT — use json for arbitrary data:
@@ -144,14 +137,14 @@ input { json data }
144
137
  input { object data { schema { text name int id } } }
145
138
  ```
146
139
 
147
- ### 12. While loop outside of stack block
140
+ ### 11. While loop outside of stack block
148
141
  ```xs
149
142
  // WRONG: while (true) { each { ... } }
150
143
  // RIGHT:
151
144
  stack { while (true) { each { ... } } }
152
145
  ```
153
146
 
154
- ### 13. Multiple constructs in one file
147
+ ### 12. Multiple constructs in one file
155
148
  ```
156
149
  // WRONG — two constructs in one file:
157
150
  // function "helper_a" { ... }
@@ -622,6 +615,41 @@ api.request {
622
615
 
623
616
  ---
624
617
 
618
+ ## AI Statements (Xano AI)
619
+
620
+ ```
621
+ One-shot model call → ai.text.generate | ai.image.generate | ai.video.generate | ai.speech.generate
622
+ ai.speech.transcribe | ai.embedding.create | ai.rerank | ai.music.generate
623
+ Tools / multi-step → ai.agent.run
624
+ ```
625
+
626
+ ```xs
627
+ // Xano AI credits only: no api_key/provider key. Fails with credits_exhausted when credits run out.
628
+ ai.text.generate {
629
+ model = "gemini-3.8-flash"
630
+ prompt = $input.question
631
+ } as $result
632
+
633
+ // Media comes back as a temporary file resource and is NOT stored automatically.
634
+ // A file resource in a file column saves null: store it first. Either set
635
+ // save_to_files = "public" on the media statement ($gen.image is then the stored
636
+ // file, not a file resource), or use the From File statement (storage.create_image / create_video / create_audio):
637
+ ai.image.generate {
638
+ model = "gemini-3.1-flash-image"
639
+ prompt = "A red fox, watercolor"
640
+ } as $gen
641
+
642
+ storage.create_image {
643
+ value = $gen.image
644
+ access = "public"
645
+ filename = "fox.png"
646
+ } as $stored
647
+ ```
648
+
649
+ > Keys, defaults, output shapes and the model table: `xano_xanoscript_docs({ topic: "ai" })`
650
+
651
+ ---
652
+
625
653
  ## Common Patterns
626
654
 
627
655
  ### Authentication Check
@@ -651,10 +679,6 @@ var $msg { value = ($status|to_text) ~ ": " ~ ($data|json_encode) }
651
679
 
652
680
  ---
653
681
 
654
- ## Workspace policies
655
-
656
- If the project has a `policies/` folder, the branch has governance policies. Keep to the active blocking ones while you write code (their findings block merges), then evaluate after changing code: `xano policy evaluate`, the `policy_check` a `xano workspace push` returns, or `xano_evaluate_policies`. `topic: "policies"` has the details.
657
-
658
682
  ## Topic Index
659
683
 
660
684
  | Topic | Description | Size |
@@ -670,6 +694,7 @@ If the project has a `policies/` folder, the branch has governance policies. Kee
670
694
  | `tables` | Database schema definitions | ~7KB |
671
695
  | `tasks` | Scheduled/cron jobs | ~6KB |
672
696
  | `triggers` | Event handlers (table, realtime, agent, MCP) | ~17KB |
697
+ | `ai` | Xano AI statements (ai.text.generate, ai.image.generate, ...) | ~14KB |
673
698
  | `agents` | AI agent configuration | ~9KB |
674
699
  | `tools` | AI tools for agents | ~7KB |
675
700
  | `mcp-servers` | MCP server definitions | ~4KB |
@@ -682,4 +707,3 @@ If the project has a `policies/` folder, the branch has governance policies. Kee
682
707
  | `middleware` | Request/response interceptors | ~6KB |
683
708
  | `realtime` | WebSocket channels and events | ~9KB |
684
709
  | `streaming` | Large file/data streaming | ~8KB |
685
- | `policies` | Workspace policy documents: syntax, checks, authoring and fix rules | ~78KB |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xano/developer-mcp",
3
- "version": "2.3.0-beta.7",
3
+ "version": "2.3.0-beta.9",
4
4
  "description": "MCP server and library for Xano development - XanoScript validation, Meta API, Run API, and CLI documentation",
5
5
  "mcpName": "io.github.xano-inc/xano-developer-mcp",
6
6
  "type": "module",
@@ -37,7 +37,6 @@
37
37
  "test": "vitest run",
38
38
  "test:watch": "vitest",
39
39
  "test:coverage": "vitest run --coverage",
40
- "gen:policy-docs": "node scripts/gen-policy-check-docs.mjs",
41
40
  "prepublishOnly": "./scripts/check-publish-tag.sh && npm run build",
42
41
  "publish:beta": "./scripts/bump-version.sh beta && npm publish --tag beta",
43
42
  "publish:latest": "./scripts/bump-version.sh patch && npm publish"
@@ -63,7 +62,7 @@
63
62
  "license": "MIT",
64
63
  "dependencies": {
65
64
  "@modelcontextprotocol/sdk": "^1.26.0",
66
- "@xano/xanoscript-language-server": "^12.22.0",
65
+ "@xano/xanoscript-language-server": "^12.30.0",
67
66
  "minimatch": "^10.1.2",
68
67
  "zod": "^4.0.0"
69
68
  },
@@ -1,2 +0,0 @@
1
- import type { TopicDoc } from "../types.js";
2
- export declare const policyDoc: TopicDoc;
@@ -1,92 +0,0 @@
1
- const flags = [
2
- { name: "workspace", short: "w", type: "string", description: "Workspace ID; defaults to the selected official CLI profile" },
3
- { name: "branch", short: "b", type: "string", description: "Branch label; use the same branch for publishing and evaluating" },
4
- { name: "profile", short: "p", type: "string", description: "Official CLI profile name" },
5
- { name: "output", short: "o", type: "string", default: "summary", description: "summary or json" },
6
- { name: "verbose", short: "v", type: "boolean", default: "false", description: "Print the request the CLI makes and the raw platform response beside the normal output; useful when a refusal or a finding needs to be traced to the route that produced it" },
7
- ];
8
- const messageFlag = { name: "message", short: "m", type: "string", description: "Short label for the Version History entry this publish creates; ignored when the definition is unchanged" };
9
- const sourceFlags = [
10
- { name: "file", short: "f", type: "string", description: "Path to one policy XanoScript document; use this or --stdin. policy parse also accepts the path as a positional argument" },
11
- { name: "stdin", type: "boolean", description: "Read one policy document from standard input" },
12
- ];
13
- export const policyDoc = {
14
- topic: "policy",
15
- title: "Xano CLI - Workspace Policies",
16
- description: `Policy support in the official @xano/cli uses the existing profile and Metadata API client. Requires policy-enabled builds of the CLI and instance. A policy combines its human description with deterministic check rules and lives as workspace XanoScript. The policy language - syntax, fields, rules, refusal messages and versioning - is documented once, in xano_xanoscript_docs({topic: "policies"}) (mode: "quick_reference" for the short form; the full topic carries every check's description); this topic covers the commands.
17
-
18
- Use the authenticated Xano MCP tools for live tool calls, or these CLI commands for local workspace files. The standalone developer MCP serves this documentation; it does not itself authenticate to your workspace.`,
19
- ai_hints: `Discover exact check parameters with policy catalogue; each entry carries a human label beside its check id. Native policy parse is the validation authority. The developer MCP's language server checks policy syntax locally, and checks rules only as warnings against its bundled copy of the catalogue, which may be older than the instance. An unknown check id is refused by parse, publish and workspace push with payload.code policy_unknown_check, naming the nearest ids, and the CLI adds a pointer to xano policy catalogue. Do not invent a local policy parser. policy parse prints canonical source, which is sparse and orders params the catalogue's way, so do not read a shorter file as a lost setting.
20
-
21
- Reads, parsing and evaluation need the workspace:policy permission at read level; creating, updating and deleting need it at create, update or delete level. policy coverage is the exception: it needs only the object kind's own read permission (workspace:api for an endpoint, workspace:function, workspace:database for a table, ...), never workspace:policy, and a refusal (policy_object_permission_required) names that permission, which the role or, for a Metadata API token, the token's scopes lack. A refused request prints the platform's message and what to do about it, keyed on the refusal's code: the feature is off, the role lacks the permission (an instance admin grants it; a new token does not help), or the token was created without the scope (create one that has it). workspace push lets unchanged policy files through for any reader; a changed policy file from a caller whose permission does not allow the change refuses the whole push, so exclude them with -e "policies/*" or pull again.
22
-
23
- Policy source uses active = true or active = false before enforcement. The retired lifecycle field is refused. policy list labels rows Active, Blocking; Active, Advisory; or Inactive. Inactive policies are saved directly, skipped by branch checks, and reported with status inactive.
24
-
25
- A parse or validation error in summary output is located at line N, col M, with line 1 the first line, followed by the offending text; -o json keeps the platform payload untouched, whose line and col count from 1 too. Every policy command run with -o json reports its own failure as one object on stdout rather than as prose on stderr: {"error": {"message": "...", "exit": 1}}, and exits 1. Exit 2 is never an error object: it is reserved for blocking findings, which are ordinary results.
26
-
27
- policy evaluate and workspace push print the platform's policy_check verdict (see the Metadata API policy topic for the statuses). Their exit code follows the import and the blocking policies only: 1 when the import or the request fails, 2 whenever policy_check.blocking is true (an active blocking policy has findings; an inactive policy never blocks), and 0 otherwise. A pass, a fail and not_applicable (no active policy on the branch) print a headline with the platform's message; disabled, unavailable, error, any other status (an older instance's forbidden) or no feedback at all print one warning line on stderr with the platform's status and message, and leave the exit code alone. A workspace push by a credential without workspace:policy read gets a policy_check with access: "coverage" and scope: "pushed_objects": only its own findings on the objects the push carried that it may read (the workspace too, for a push carrying workspace.xs and a credential with workspace:settings read), each printed with its policy key and title, rule name, message and Fix: hint under Blocking or Advisory, then a count of the findings on objects the push did not list (On objects this push did not list: N new findings (B blocking), counted, not named.; N findings instead of N new findings when elsewhere.basis is all, no baseline being known, or missing, from an older platform) and the platform's note; it names no run (run_id 0), so the CLI prints no xano policy runs hint. blocking is what a policy reader's push of the same change says, so exit 2 follows it whoever pushes, even with nothing of the credential's own listed. For CI, key on policy_check.blocking in -o json rather than on status: advisory findings arrive as status fail with blocking false. A policy finding never rolls back imported code on a branch that is not live. A push to the live branch is gated before it commits: a 403 policy_gate refusal exits 2, prints the platform's sentence (it names the policies the blocking findings come from, to every caller) and says nothing was imported, lists the blocking findings for a credential with workspace:policy read (anyone else gets the counts and the keys), and under -o json prints {imported: false, refused: <payload>}; --policy-override "<reason>" sends an audited override (workspace:policy update), and --no-transaction to live is refused (exit 1). A create past the plan's per-branch cap is refused with policy_plan_limit, naming the plan. Releases carry policies: release create, push and import print the release's stored policy check; tenant deploy_release --check prints the deploy gate's verdict and --override-reason overrides it; tenant_deploy_request set_status and bypass take --override-policy; a refused deploy exits 2. release deploy --set_live and branch set_live exit 2 when the set-live gate refuses (a refused release deploy keeps the new branch and names it), and function create and function edit exit 2 when the live-branch publish gate refuses the save (nothing is saved); each takes --policy-override "<reason>" (workspace:policy update; only with the user's own reason), a blank one is refused before any request, and any other failure exits 1. Each policy change needs only its own workspace:policy level: update to edit a policy, delete to delete one (an active blocking policy included); branch set_live and release deploy --set_live need no policy permission. policy parse and policy publish print rule warnings on stderr.
28
-
29
- A rule with zero objects checked and no findings has status no_objects and message no objects checked. Older stored runs keep pass with checked: 0; readers accept both. The run and policy_check stay pass when nothing failed, and policy_check.message names the unchecked rules. Merge, publish and deploy gates read findings and are unaffected. The CLI summary renders both as no objects checked, never as an error; policy status keeps its no_objects_checked row status.
30
-
31
- A run can hold tens of thousands of findings, so large ones are read a page at a time. The policy_check a workspace push answers lists the first 100 findings and blocking findings, beside counts {findings, blocking, errors}, total and truncated; when the lists were cut the push prints the counts, heads each list "first 100 of N" and ends with Listed: the first 100 of N; \`xano policy runs <run_id>\` has them all. policy runs <id> reads a run's summary and one page of its findings (--offset, --limit up to 500, and filters), or every page with --all, and policy status reads the latest run's summary; policy evaluate --summary answers the run summary with its first 50 findings; policy evaluate without it still answers the whole run.
32
-
33
- Publishing an identical definition writes nothing and prints No changes; JSON output carries unchanged: true. Do not add a cosmetic edit to force a version. Version history is listed, diffed and restored in the Xano dashboard only; there is no CLI command for it. policy status reads the platform's latest_run for each policy: a policy is stale when it changed after the branch's newest run, so that run's findings no longer describe it.
34
-
35
- workspace pull writes policies to policies/<KEY>.xs when the credential can read them (without workspace:policy read the pull succeeds and omits them) and prints one hint after a pull that included them: Run \`xano skills pull\` to install the policies skill for your coding agent (see the skills topic). workspace push includes policies in the normal multidoc import and reports policy_check afterward; the workspace topic covers its -m/--message. sandbox push and ephemeral push (and their --dry-run) and release push carry policy files while the instance's Policies feature is on: a sandbox or ephemeral push lands them without evaluating them (no policy_check), and release push sends policies/*.xs with the rest and prints the release's stored policy check. A release built by release push carries those files only for a caller holding workspace:policy create and update; for anyone else it carries the workspace's live-branch policies instead, and the push prints the platform's policies_skipped message naming the files when they differ from the live ones. release import of an archive that carries policies needs the same workspace:policy create and update: without them the platform refuses it, nothing is stored, and the CLI prints the platform's message and the remedy for the role or the token. A push to a remote tenant, a push to a tenant created before policies (it has no policy table until its next platform update), or any push while the feature is off leaves them out, and the push prints the platform's policies_skipped message once, as a warning naming the files and why. While the instance's Policies feature is off, workspace pull carries no policies (and prints no skills hint) and workspace push leaves its policy files out, printing the platform's one line instead of a policy count. Existing workspace push deletion/sync behavior remains governed by its normal flags.`,
36
- related_topics: ["workspace", "profile", "branch", "skills"],
37
- commands: [
38
- { name: "policy catalogue", description: "List built-in checks, their schemas and analysis limitations from the instance, each followed by its uses (a goal in a customer's words, the params that achieve it as one line of JSON, scope params included, and a note when it has one), then the templates a policy can start from, grouped under the catalogue's category labels in its order. The recipes follow: goals that span several templates, each with what to set up first, its templates in the order to create them, the rules no template covers (created together in a policy of your own) and what no rule in it can see. The catalogue ends with what no check can see, each topic with why. The full catalogue is long; --check narrows it to one check id and --recipe to one recipe id (the summary adds the topics that recipe cannot see), in either output mode, and an unknown id names the closest matches; the two flags cannot be combined. -o json without them is the whole catalogue as served.", usage: "xano policy catalogue [options]", flags: [...flags, { name: "check", type: "string", description: "Show only this check id; not with --recipe" }, { name: "recipe", type: "string", description: "Show only this recipe id and what it cannot see; not with --check" }], examples: ["xano policy catalogue -o json", "xano policy catalogue --check object.auth_required", "xano policy catalogue --recipe protect_card_data"] },
39
- { name: "policy list", description: "List policies on the selected branch, each with its active state, id and current version.", usage: "xano policy list [options]", flags, examples: ["xano policy list -b dev -o json"] },
40
- {
41
- name: "policy create",
42
- description: "Create an independent Active, Advisory policy from a platform template (the templates policy catalogue lists). Copies the template's sparse settings; every needs path must be filled with --param. Parsed natively before saving. A taken template key gets a free numeric suffix (case-insensitive); a taken explicit --key is refused. Never updates an existing policy and stores no link to the template. A recipe has no create action: a recipe id given to --template is refused with the recipe's templates to create in order with --template, one policy each, a pointer to a policy of your own (xano policy publish) for the rules no template covers, and xano policy catalogue --recipe <id> for what to set up first. Rule warnings go to stderr; -o json prints the saved policy.",
43
- usage: "xano policy create --template <id> [--key KEY] [--param N.path=JSON ...] [options]",
44
- flags: [...flags, messageFlag, { name: "template", type: "string", required: true, description: "Template id from the catalogue's templates" }, { name: "key", type: "string", description: "Policy key; defaults to the template's suggested key" }, { name: "param", type: "string", description: "Repeatable N.path=JSON override; rule numbers start at 1, and the N. prefix is optional for a single-rule template" }],
45
- examples: ["xano policy create --template endpoints_need_login -b dev", "xano policy create --template no_pii_in_responses --key DATA-020 --param 'fields=[\"email\",\"ssn\"]'"],
46
- },
47
- {
48
- name: "policy parse",
49
- description: "Parse and format source on the instance without saving. Summary output is canonical XanoScript; JSON includes {policy, source}. The file may be given as a positional argument or with --file - they are the same input, and --stdin is unchanged.",
50
- usage: "xano policy parse [file] [options]",
51
- args: [{ name: "file", required: false, description: "Path to one policy XanoScript document, the positional form of --file. Omit it and pass --stdin to read the document from standard input" }],
52
- flags: [...flags, ...sourceFlags],
53
- examples: ["xano policy parse policies/AUTH-EXAMPLE.xs", "xano policy parse --file policies/AUTH-EXAMPLE.xs", "cat policies/AUTH-EXAMPLE.xs | xano policy parse --stdin -o json"],
54
- },
55
- { name: "policy publish", description: "Parse one policy, then create or update by its stable key on the selected branch using canonical source. Prints Published KEY (Version N), or No changes to KEY (Version N) when the definition already matches what is stored. Use workspace push for an atomic multi-policy import.", usage: "xano policy publish --file <path> [options]", flags: [...flags, ...sourceFlags, messageFlag], examples: ["xano policy publish --file policies/AUTH-EXAMPLE.xs -b dev", "xano policy publish --file policies/AUTH-EXAMPLE.xs -m \"Tightened the scope\""] },
56
- { name: "policy evaluate", description: "Evaluate active policies and store a new run, then print the platform's verdict and the run's findings. Exits 2 when policy_check.blocking is true, and 0 for every other verdict; not_applicable (no active policy) prints a headline with the platform's message and is no run: nothing is stored, so there is no Not stored line and nothing new in policy runs. Only a disabled, unavailable or errored verdict prints one warning line. A credential that may read but not write gets its findings with nothing stored, and the CLI says Not stored. --policy KEY tries that one policy alone, even if inactive: nothing is stored or audited, the latest run is untouched, nothing is gated, and each rule's clear objects are named; an inactive trial never exits 2, and a blank key is refused before any request.", usage: "xano policy evaluate [options]", flags: [...flags, { name: "policy", type: "string", description: "Try this one policy key alone (a trial: never stored or audited)" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what this run recorded: each policy's statement and each rule's name and resolved settings" }, { name: "summary", type: "boolean", default: "false", description: "Send answer: summary: answer the run summary (counts, each policy's verdict, rule results) and its first 50 findings instead of the whole run, and say which run has the rest. -o json passes that answer through" }], examples: ["xano policy evaluate -b dev -o json", "xano policy evaluate --run-detail", "xano policy evaluate --summary -o json", "xano policy evaluate --policy AUTH-001"] },
57
- {
58
- name: "policy runs",
59
- description: "List the runs the branch retains (only the newest twenty exist), newest first, with status, finding count, objects checked, trigger and start time. With a run id, read that one run, including one older than the latest, which policy status cannot reach: its summary (counts, each policy's verdict, rule results) and one page of its findings in the platform's order, blocking first, 100 unless --limit says otherwise; a page that is not every finding is marked (one page) and names the next page's --offset. --all reads every page instead (500 a request, saying so on stderr when there are more) and prints or returns every matching finding. The filter flags narrow the findings on the instance; a repeated flag matches any of its values. JSON output is the platform's own body: the run summaries for a list, and for one id the run summary with findings, the page's findings as an array (every one with --all), and findings_page {total, offset, limit, next_offset}, next_offset null after the last. The finding flags need a run id. --release <name> reads a release's policy check (stored when it was cut) the same way, plus its shipped policies; --release-id <id> reads it by id (exclusive with --release and --branch); --recheck checks the release again from its archive and stores the run. Needs the workspace:policy permission at read level.",
60
- usage: "xano policy runs [run_id] [options]",
61
- flags: [
62
- ...flags,
63
- { name: "release", type: "string", description: "Read this release's policy check instead of a branch run" },
64
- { name: "release-id", type: "number", description: "Read a release's policy check by release id" },
65
- { name: "recheck", type: "boolean", default: "false", description: "With --release or --release-id, check the release again and store the run" },
66
- { name: "limit", type: "number", description: "Without a run id, the newest N runs (1-20, default 20); with one, how many findings to print (1-500, default 100)" },
67
- { name: "offset", type: "number", default: "0", description: "With a run id, how many findings to skip" },
68
- { name: "all", type: "boolean", default: "false", description: "With a run id, read every page and print or return every matching finding; not with --offset or --limit" },
69
- { name: "blocking", type: "boolean", default: "false", description: "With a run id, only the blocking findings" },
70
- { name: "advisory", type: "boolean", default: "false", description: "With a run id, only the advisory findings" },
71
- { name: "policy", type: "string", description: "With a run id, only this policy key's findings; repeatable" },
72
- { name: "rule", type: "string", description: "With a run id, only this rule id's findings (AUTH-001.R1); repeatable" },
73
- { name: "severity", type: "string", description: "With a run id, only findings of this severity (critical, high, medium, low); repeatable" },
74
- { name: "kind", type: "string", description: "With a run id, only findings on this object kind; repeatable" },
75
- { name: "object", type: "string", description: "With a run id, only findings on this object, written type:id (query:18); repeatable" },
76
- { name: "tag", type: "string", description: "With a run id, only findings whose policy or object carries this tag; repeatable" },
77
- { name: "search", type: "string", description: "With a run id, only findings whose policy key or title, rule title, object name or message contains this text" },
78
- { name: "run-detail", type: "boolean", default: "false", description: "With a run id, also print the policy statements and rule settings that run recorded" },
79
- ],
80
- examples: ["xano policy runs", "xano policy runs --limit 5", "xano policy runs 1674 --run-detail -o json", "xano policy runs 1674 --offset 100 --limit 100", "xano policy runs 1674 --all -o json", "xano policy runs 1674 --blocking --policy AUTH-001 --severity critical", "xano policy runs --release v1.2", "xano policy runs --release-id 12 --recheck"],
81
- },
82
- { name: "policy coverage", description: "Show one object as Studio's object panel does, from the branch's latest run: the chip (Policies 1 blocking · 1 advisory, Policies ✓ 6 pass, Policies · 3 apply · not checked yet, Policies · Last check failed when a policy that applies here could not be checked, Policies · None apply), the object's findings, Blocking then Advisory, each with its policy key and title, rule name, message and Fix: hint, then the policies that apply, counted as the panel counts those with no finding here (6 passing · 1 couldn't check · 1 not checked yet), each Blocking or Advisory, failing, passing, couldn't check or not checked yet, and why it applies, and the platform's note. A policy the run passed still reads passing when the run errored on another policy. Needs only the object kind's own read permission, not workspace:policy, so every credential gets the same trimmed answer (no statements, rule settings, run ids or other objects' findings). The object is written type:id, as findings name it; the workspace object's id is the workspace's own id (workspace:17). -o json is the platform's answer. Exits 0 when it answers, and 1 on a refusal or a malformed type:id. Drafts are checked in Studio (on Save or with Check draft); the CLI reads stored definitions only.", usage: "xano policy coverage <type>:<id> [options]", args: [{ name: "object", required: true, description: "The object, written type:id (query:42, function:12, table:7); for workspace, the workspace's own id (workspace:17)" }], flags, examples: ["xano policy coverage query:42", "xano policy coverage function:12 -b dev -o json"] },
83
- { name: "policy delete", description: "Delete a policy from the selected branch, by policy key or by id; its Version History is kept. An unresolved name is refused naming the policies the branch does have. Prompts before deleting; --force skips the prompt. The delete sends the updated_at it listed, so a policy changed after that (for example while the prompt waited) is refused with policy_stale and nothing is deleted: run the command again. This is the only way to remove a policy from the CLI: workspace push is additive, so deleting policies/KEY.xs and pushing leaves the policy in place. Needs the workspace:policy permission at delete level.", usage: "xano policy delete <key-or-id> [options]", flags: [...flags, { name: "force", short: "f", type: "boolean", default: "false", description: "Skip the confirmation prompt; only with the user's explicit confirmation" }], examples: ["xano policy delete TMP-DX-001", "xano policy delete 922 --force -o json"] },
84
- {
85
- name: "policy status",
86
- description: "Inspect stored policy/run state without evaluating. The Enforcement column reads Blocking or Advisory, and a finding count reads (blocking) when the latest run judged it blocking: the run evaluated the policy in its current version as active and blocking. A policy is stale when it changed after the branch's newest run (the platform's latest_run), so that run's findings no longer describe it. Informational (exit 0) by default; with --fail-on-findings it exits 2 when the latest run has blocking findings, else 1 for stale, missing or errored evaluation evidence (advisory findings still exit 0), and a nonzero exit is always explained by one line naming the reason. A blocking reason is a prediction: the merge gate evaluates the branch again before a merge. In -o json each row's status is one of pass, fail, error, stale, not_evaluated, no_checks, no_objects_checked or inactive, with blocking, rules_unchecked (a pass whose rules checked no objects) and counted (whether its findings come from the latest run's evidence); --fail-on-findings adds fail_on_findings: {exit, reason}. It reads the latest run's summary, not the whole run, so in -o json run carries each policy's finding count and verdict rather than the findings; xano policy runs <id> lists them.",
87
- usage: "xano policy status [options]",
88
- flags: [...flags, { name: "fail-on-findings", type: "boolean", default: "false", description: "Exit 2 when the latest run has blocking findings; otherwise exit 1 for stale, missing or errored evaluation evidence" }, { name: "run-detail", type: "boolean", default: "false", description: "Also print what the latest run recorded: each policy's statement and each rule's name and resolved settings. Summary output only" }],
89
- examples: ["xano policy status -b dev -o json", "xano policy status --fail-on-findings -o json", "xano policy status --run-detail"],
90
- },
91
- ],
92
- };
@@ -1,2 +0,0 @@
1
- import type { TopicDoc } from "../types.js";
2
- export declare const skillsDoc: TopicDoc;
@@ -1,57 +0,0 @@
1
- const flags = [
2
- { name: "workspace", short: "w", type: "string", description: "Workspace ID; defaults to the selected official CLI profile" },
3
- { name: "branch", short: "b", type: "string", description: "Branch label; defaults to the profile's branch, else live. The platform skill is the same on every branch; the branch only decides which workspace knowledge record named xano-policies, if any, replaces it" },
4
- { name: "profile", short: "p", type: "string", description: "Official CLI profile name" },
5
- { name: "directory", short: "d", type: "string", default: ".", description: "Project directory to install into (default: current directory). The file is written under its .claude/skills/, not to a positional argument" },
6
- { name: "output", short: "o", type: "string", default: "summary", description: "summary or json; summary prints the path written, json prints {branch, bytes, name, path, source, workspace}, where source is platform, or workspace when the workspace's own xano-policies record was installed" },
7
- { name: "verbose", short: "v", type: "boolean", default: "false", description: "Print the request the CLI makes and the raw platform response beside the normal output" },
8
- ];
9
- export const skillsDoc = {
10
- topic: "skills",
11
- title: "Xano CLI - Agent Skills",
12
- description: `\`xano skills pull\` installs the agent skill your Xano instance generates for your coding agent. Today that is one skill, \`xano-policies\`: the workspace policy file format, the authoring and honesty rules, and the instance's own check catalogue, generated from the live registry at request time so it can never describe a check the instance does not have.
13
-
14
- The skill is fetched from \`GET /api:meta/workspace/{workspace_id}/agent-skills?surface=cli&branch=<label>\` and written to \`.claude/skills/xano-policies/SKILL.md\` under the project directory; nothing else in the project is touched. That replaces the published stub only when the stub was installed into the project for Claude Code (\`npx skills add xano-inc/xano-developer-mcp -s xano-policies -a claude-code\`, without \`-g\`). A stub installed globally (\`-g\`) or for another agent lives where that agent reads it and stays there, so remove it after pulling.
15
-
16
- The route is one of the policy routes, gated like the others; the \`policy\` topic says what each refusal means. When the workspace has its own enabled knowledge record named \`xano-policies\`, the route serves that record instead of the platform skill, and the command says so.
17
-
18
- The same generator serves three surfaces. \`surface=studio\` (the default on the route) is the variant Xano's own Studio agent loads; \`surface=mcp\` is the one the authenticated MCP's \`xano_get_policy_skill\` serves; \`surface=cli\` is the variant this command writes, and it is the only one the CLI asks for.
19
-
20
- This is not workspace knowledge. The generated policy skill is produced by the platform, not stored as a workspace knowledge record, so it does not appear in \`knowledge list\` and it is not written under \`knowledge/\` by \`workspace pull\`.`,
21
- ai_hints: `Run \`xano skills pull\` once per project, and again after the instance is upgraded, because the skill is generated from the instance's check catalogue, not from the workspace's policies. The command is idempotent: re-running it rewrites the file and prints the path it wrote. \`xano workspace pull\` prints a hint after a pull that included policies: "Run \`xano skills pull\` to install the policies skill for your coding agent."
22
-
23
- Treat the pulled file as authoritative over any stub: if \`.claude/skills/xano-policies/SKILL.md\` contains a check catalogue section, it came from the instance. Never edit the pulled file by hand - the next pull overwrites it - and never invent check ids or parameters from a stub; \`xano policy catalogue\` and the pulled skill are the only sources of truth for what this instance can check.
24
-
25
- A profile has to be selected first (\`xano profile use <name> -w <workspace_id> -b <branch>\`), or the workspace and branch given with -w/-b, because the route is addressed by workspace and branch.`,
26
- related_topics: ["policy", "knowledge", "workspace"],
27
- commands: [
28
- {
29
- name: "skills pull",
30
- description: "Fetch the CLI variant of the generated xano-policies skill for the selected workspace and branch and write it to .claude/skills/xano-policies/SKILL.md under the project directory. Idempotent: it overwrites whatever is there and prints the path written, and says so when the workspace's own xano-policies record was installed instead of the platform skill. Needs the workspace:policy permission at read level.",
31
- usage: "xano skills pull [options]",
32
- flags,
33
- examples: [
34
- "xano skills pull",
35
- "xano skills pull -d ./my-app -b dev",
36
- "xano skills pull -w 1 -b v1 -o json",
37
- ],
38
- },
39
- ],
40
- workflows: [
41
- {
42
- name: "Give a coding agent the live policy skill",
43
- description: "Replace the published stub skill with the skill generated from this instance's check catalogue",
44
- steps: [
45
- "Select the workspace and branch: `xano profile use local -w 1 -b v1`",
46
- "Pull the skill: `xano skills pull -d ./my-app`",
47
- "The command writes `./my-app/.claude/skills/xano-policies/SKILL.md` and prints that path",
48
- "Start a new agent session in that directory so the skill manifest is re-read",
49
- "Remove a stub installed globally or for another agent",
50
- "Re-run the pull after the instance is upgraded",
51
- ],
52
- example: `xano profile use local -w 1 -b v1
53
- xano workspace pull -d ./my-app
54
- xano skills pull -d ./my-app`,
55
- },
56
- ],
57
- };
@@ -1,3 +0,0 @@
1
- import type { TopicDoc } from "../types.js";
2
- export declare const policyExample = "policy \"AUTH-EXAMPLE\" {\n title = \"Require authentication\"\n statement = \"Endpoints require authentication unless the endpoint or its API group is tagged public.\"\n severity = \"high\"\n active = true\n enforcement = \"advisory\"\n\n rule {\n check = \"object.auth_required\"\n params = {except_tags: [\"public\", \"xano:quick-start\"]}\n }\n}";
3
- export declare const policyDoc: TopicDoc;