@xano/sdk 1.0.10 → 1.0.11
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/CHANGELOG.md +13 -0
- package/dist/.build-fingerprint +1 -1
- package/dist/{agent-file-refresh-VOGTQ3JE.js → agent-file-refresh-CKLYJRIS.js} +4 -4
- package/dist/{agent-skill-command-LDT5JXIO.js → agent-skill-command-QKQG5NIZ.js} +24 -24
- package/dist/{backend-dir-UNUO7TNL.js → backend-dir-V2FELHYM.js} +4 -4
- package/dist/bin.js +24 -24
- package/dist/{branch-commands-IJ7SK5AM.js → branch-commands-ZY2W3ICB.js} +14 -14
- package/dist/bundle.d.ts +2 -2
- package/dist/bundle.js +5 -5
- package/dist/{chunk-HTP2CLRQ.js → chunk-3BI62SPQ.js} +2 -2
- package/dist/{chunk-6NXIRULE.js → chunk-3Q43PZGI.js} +17 -17
- package/dist/{chunk-TWBENPZR.js → chunk-4BR5TEXI.js} +14 -14
- package/dist/{chunk-QTMXJQZN.js → chunk-4WBZ6T76.js} +2 -2
- package/dist/{chunk-V5RXO5AK.js → chunk-4ZTXYT3T.js} +2 -2
- package/dist/{chunk-6BIOLAJ4.js → chunk-64ODZADR.js} +7 -7
- package/dist/{chunk-OHTHG3LL.js → chunk-6LECAG3Y.js} +4 -4
- package/dist/{chunk-7KPKDHHI.js → chunk-76SBT7KS.js} +2 -2
- package/dist/{chunk-THGELNPV.js → chunk-7FPFYYCW.js} +4 -4
- package/dist/{chunk-JSPFDMTV.js → chunk-7YSZSEZL.js} +2 -2
- package/dist/{chunk-Z52FKP34.js → chunk-AM5T76NQ.js} +6 -6
- package/dist/{chunk-BEXZ4XRV.js → chunk-AXNX4NWN.js} +2 -2
- package/dist/{chunk-FDZ2ANSS.js → chunk-B7JRCM2S.js} +2 -2
- package/dist/{chunk-436AOVZS.js → chunk-D2PSNKZD.js} +2 -2
- package/dist/{chunk-77IFWJ53.js → chunk-D5NAWB4P.js} +2 -2
- package/dist/{chunk-GDAWYDHY.js → chunk-DRWUMFSP.js} +2 -2
- package/dist/{chunk-ETAZIGNT.js → chunk-F2NFNYCB.js} +2 -2
- package/dist/{chunk-DHU3EGGF.js → chunk-FDPW2M3S.js} +2 -2
- package/dist/{chunk-U4JD5NMP.js → chunk-FGNDJBT4.js} +2 -2
- package/dist/{chunk-IIAF7VKN.js → chunk-FNA5CUVN.js} +2 -2
- package/dist/{chunk-4XHAT7C5.js → chunk-HJZUI2ZU.js} +2 -2
- package/dist/{chunk-DSD2NNTX.js → chunk-HUEFVPYW.js} +2 -2
- package/dist/{chunk-DW47JVXI.js → chunk-HW2JPR5W.js} +20 -20
- package/dist/{chunk-PPI647YF.js → chunk-HXRXQAZE.js} +29 -29
- package/dist/{chunk-IW6E3LES.js → chunk-I5XSXMJQ.js} +2 -2
- package/dist/{chunk-3P35HT64.js → chunk-IDOVZLPK.js} +2 -2
- package/dist/{chunk-6NEV2PEC.js → chunk-IEDQT4Z3.js} +6 -6
- package/dist/{chunk-6JAEMMZ7.js → chunk-IFXPHVPY.js} +3 -3
- package/dist/{chunk-HDKSHL4Z.js → chunk-J746QNTP.js} +1 -1
- package/dist/{chunk-6YOH2L3G.js → chunk-JFPLHK6Y.js} +3 -3
- package/dist/{chunk-I53OTC3O.js → chunk-JHQAVWHW.js} +3 -3
- package/dist/{chunk-3IFRZXHN.js → chunk-KCCZCIDJ.js} +2 -2
- package/dist/{chunk-KSGITXNE.js → chunk-KDPXO5PO.js} +5 -5
- package/dist/{chunk-JE7BL5IF.js → chunk-KI6U2GD2.js} +7 -7
- package/dist/{chunk-6ZFJEJXZ.js → chunk-KICERNAP.js} +5 -5
- package/dist/{chunk-3TTR4BHW.js → chunk-KSBUHLNF.js} +2 -2
- package/dist/{chunk-ECGRCTVI.js → chunk-KYTQW3YT.js} +2 -2
- package/dist/{chunk-45A3AF2B.js → chunk-LYN3XNDE.js} +74 -68
- package/dist/{chunk-HMFEWTI7.js → chunk-NHXBKFHG.js} +42 -42
- package/dist/{chunk-5DLDRUCQ.js → chunk-NPW6DSZB.js} +3 -3
- package/dist/{chunk-BYYVOX2P.js → chunk-NU7EME32.js} +29 -29
- package/dist/{chunk-6BOKCTCM.js → chunk-NZ7ML6LG.js} +4 -4
- package/dist/{chunk-T3ZVNOJC.js → chunk-ONNSFD73.js} +10 -10
- package/dist/{chunk-XUSL2Z5C.js → chunk-QAY4RW2E.js} +3 -3
- package/dist/{chunk-NIANORYB.js → chunk-RNKP5TA2.js} +2 -2
- package/dist/{chunk-O376UAZS.js → chunk-SFOUFU4C.js} +110 -6
- package/dist/{chunk-KA3JN4SH.js → chunk-SNKABK5L.js} +2 -2
- package/dist/{chunk-EOIJ7MVW.js → chunk-T3HNISBN.js} +3 -3
- package/dist/{chunk-CTKBGPM6.js → chunk-U4LRDTIM.js} +3 -3
- package/dist/{chunk-FZGK4VM5.js → chunk-UUYKEIHP.js} +2 -2
- package/dist/{chunk-S56YBYMN.js → chunk-VIRFG3WG.js} +2 -2
- package/dist/{chunk-2ND7WS3E.js → chunk-VTZF3ZNR.js} +2 -2
- package/dist/{chunk-LTPF25L2.js → chunk-W2QFR3ZJ.js} +2 -2
- package/dist/{chunk-HU6D6PYT.js → chunk-WM7Y3MDE.js} +2 -2
- package/dist/{chunk-EKTIGGFO.js → chunk-WZXEQUIM.js} +4 -4
- package/dist/{chunk-3TWQDGQY.js → chunk-YKCDUHBR.js} +2 -2
- package/dist/{chunk-UVF45BVU.js → chunk-Z6N5N4MN.js} +1 -1
- package/dist/{chunk-KCCZGDQG.js → chunk-ZS7VI7RK.js} +3 -3
- package/dist/cli.d.ts +3 -3
- package/dist/cli.js +23 -23
- package/dist/{codegen-command-A7M5JLLY.js → codegen-command-6AB3REIV.js} +38 -38
- package/dist/codegen.d.ts +3 -3
- package/dist/{deploy-command-RP7Q4XBE.js → deploy-command-LRJBO4LX.js} +27 -27
- package/dist/{deploy-source-ITSAHJW7.js → deploy-source-JTPMMO3B.js} +7 -7
- package/dist/{dev-env-sync-SN6TL22O.js → dev-env-sync-ODJYGSWT.js} +24 -24
- package/dist/{emit-D-a6JznN.d.ts → emit-YLt3GfsZ.d.ts} +3 -3
- package/dist/{env-example-refresh-USAGYVJ2.js → env-example-refresh-DR44A6YZ.js} +39 -39
- package/dist/{env-pull-command-6KEESNVU.js → env-pull-command-47XQO5J2.js} +20 -20
- package/dist/{env-target-HOGLLJN5.js → env-target-HBY2LQUA.js} +2 -2
- package/dist/{env-var-command-VOAINMHX.js → env-var-command-HTKKTBOC.js} +13 -13
- package/dist/{ephemeral-command-I7VPCBVQ.js → ephemeral-command-T5EFYCEY.js} +21 -21
- package/dist/{generate-command-G7EJ7GW4.js → generate-command-36OWZF23.js} +42 -42
- package/dist/{gitignore-WFZ2BTMS.js → gitignore-NLLQURLD.js} +6 -6
- package/dist/{guards-4VPSEOAI.js → guards-RU4C7TFG.js} +5 -5
- package/dist/{impersonate-command-ZJDK7ZYO.js → impersonate-command-HJYBQV6X.js} +9 -9
- package/dist/index.d.ts +8 -8
- package/dist/index.js +14 -14
- package/dist/{init-command-CTWDNYAZ.js → init-command-54M3AA27.js} +27 -27
- package/dist/{init-modules-FJITJ6IB.js → init-modules-MVULNRKR.js} +2 -2
- package/dist/internal.d.ts +6 -6
- package/dist/internal.js +27 -16
- package/dist/{keep-data-merge-KLNLVBYK.js → keep-data-merge-Y6PYJOPW.js} +15 -15
- package/dist/{landing-record-ZB4OJQF2.js → landing-record-LBJMKORB.js} +5 -5
- package/dist/{live-diff-CGTGOH3S.js → live-diff-HARRGFV4.js} +8 -8
- package/dist/{local-engine-choice-FO7LABXX.js → local-engine-choice-SXSWNCZT.js} +8 -8
- package/dist/{local-engine-command-LI7HUH5Y.js → local-engine-command-3GICPJPL.js} +9 -9
- package/dist/{local-engine-mcp-command-EVYRLPE7.js → local-engine-mcp-command-ZUS7LQ7F.js} +9 -9
- package/dist/{lock-commands-I4RARW5F.js → lock-commands-PTBKQE72.js} +24 -24
- package/dist/{login-command-MJT5CCXL.js → login-command-HH4FA65C.js} +9 -9
- package/dist/{logout-command-GSQ2R3XL.js → logout-command-WPUWLZSW.js} +3 -3
- package/dist/{loop-XFDS65OD.js → loop-QHZD37KX.js} +8 -8
- package/dist/{marketplace-command-GK4F5ZZ2.js → marketplace-command-ISG2U5NA.js} +13 -13
- package/dist/{meta-client-2A7LYGUQ.js → meta-client-P7E6PCB7.js} +2 -2
- package/dist/node.d.ts +7 -7
- package/dist/node.js +30 -30
- package/dist/{operation-outcome-UK5ALWRE.js → operation-outcome-2Z6II4HB.js} +4 -4
- package/dist/{output-target-GFPSLLEJ.js → output-target-MWYZ5HYN.js} +7 -7
- package/dist/{plan-disclosure-GNLDYV2A.js → plan-disclosure-PQAXSAUH.js} +12 -12
- package/dist/{preflight-command-LP5D6UOD.js → preflight-command-6LCPYVTV.js} +34 -34
- package/dist/{profile-command-R7XLNTY6.js → profile-command-74AR3FB7.js} +10 -10
- package/dist/{promote-command-TEVVCM77.js → promote-command-YD3YQWJG.js} +46 -46
- package/dist/{publish-command-WTVINN5E.js → publish-command-7VKTBVVP.js} +27 -27
- package/dist/{pull-command-KFHHW2BA.js → pull-command-XIYO7WTF.js} +40 -40
- package/dist/{raw-where-ZMLND6AG.d.ts → raw-where-gWGr-E4t.d.ts} +1 -1
- package/dist/{release-command-QUKHOKIY.js → release-command-NADSTRM2.js} +35 -35
- package/dist/{release-ns-command-T4R3VODA.js → release-ns-command-2VUTJ4A6.js} +44 -44
- package/dist/{routes-manifest-RIZGSOZC.js → routes-manifest-Z7I4TZIL.js} +7 -7
- package/dist/{routes-manifest-file-QFPNFJMZ.js → routes-manifest-file-BDJ6XQXF.js} +9 -9
- package/dist/{secrets-file-J4KFYNFP.js → secrets-file-KBMEY2SS.js} +5 -5
- package/dist/{secrets-fill-command-YIU6ESFN.js → secrets-fill-command-YUAJSOZW.js} +26 -26
- package/dist/{source-resolve-WHXNMVJT.js → source-resolve-KB7NWL3I.js} +3 -3
- package/dist/{status-command-DIDOS3JC.js → status-command-YRIB6UJP.js} +12 -12
- package/dist/{store-xUySg-KR.d.ts → store-BM7SQcUt.d.ts} +3 -3
- package/dist/{sync-baseline-3CDL4PKT.js → sync-baseline-JGAAOS25.js} +10 -10
- package/dist/{sync-contributions-VAGROOWY.js → sync-contributions-LMLYV7VL.js} +2 -2
- package/dist/{tables-command-UJLYYMME.js → tables-command-IONX4ZF2.js} +10 -10
- package/dist/{tenant-command-NGKJD3AX.js → tenant-command-635Y2YCR.js} +52 -52
- package/dist/{test-command-JOPQCHJA.js → test-command-CN76VVUK.js} +10 -10
- package/dist/{token-NJ5XPGGM.js → token-WL7SSK64.js} +2 -2
- package/dist/{toolchain-hooks-3ZAAAWPL.js → toolchain-hooks-VI2WOPST.js} +8 -8
- package/dist/{toolchain-modules-4KS3SSJW.js → toolchain-modules-OXUU342N.js} +2 -2
- package/dist/{tracked-backend-3U4T6ZA7.js → tracked-backend-ON5V2RBJ.js} +9 -9
- package/dist/{update-check-5KCA4TE6.js → update-check-I75SHTAD.js} +25 -25
- package/dist/{upgrade-command-MNP6G752.js → upgrade-command-2J7P5NSX.js} +27 -27
- package/dist/{whoami-command-E5CSF3E6.js → whoami-command-HJJK2QJS.js} +4 -4
- package/dist/{workspace-WZMBLK4P.js → workspace-7QVUA7HI.js} +2 -2
- package/dist/{workspace-binding-JT4EK4HU.js → workspace-binding-D7HZTF7N.js} +3 -3
- package/dist/{workspace-command-Z7BUA6A5.js → workspace-command-KXTR5SOE.js} +48 -48
- package/dist/{workspace-env-KFWW2G7G.js → workspace-env-RASIOYSN.js} +5 -5
- package/dist/{xano-6T6L7TTI.js → xano-2A2GT7EH.js} +7 -7
- package/dist/{xanosdk-import-FUS3ZGGQ.js → xanosdk-import-767BQ2HP.js} +2 -2
- package/dist/{xanosdk-project-NM2J5YFK.js → xanosdk-project-PETOFVUQ.js} +5 -5
- package/dist/{xdo-CxDr2Q1C.d.ts → xdo-D4OwfF2J.d.ts} +10 -4
- package/guides/codes.md +1 -0
- package/llms/client.md +2 -1
- package/llms/errors.md +2 -0
- package/llms/filters.md +2 -1
- package/llms/kinds-agent-mcp.md +2 -0
- package/llms/values.md +1 -1
- package/llms-full.txt +10 -4
- package/llms.txt +1 -1
- package/manifest.json +2 -2
- package/package.json +1 -1
- package/skills/xano-backend/SKILL.md +2 -2
package/llms-full.txt
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# xanosdk v1.0.
|
|
1
|
+
# xanosdk v1.0.11
|
|
2
2
|
|
|
3
3
|
> TypeScript SDK that compiles a typed Xano workspace into the importable packageExport JSON bundle.
|
|
4
4
|
|
|
@@ -659,7 +659,8 @@ Importing a def into a browser bundle or a Node script — for `getPath()`, `get
|
|
|
659
659
|
Fix: `xanosdk routes <entry> --emit xano/routes.gen.ts` (`paths` is an accepted alias) — verbs, paths, and sockets as
|
|
660
660
|
plain data importing NOTHING, still compile-checked: `routePath("GET blog/{slug}", { slug })`
|
|
661
661
|
`channelPath("rooms/{room_id}", { room_id })`, `socketUrl("chat", baseUrl)` (tenant base
|
|
662
|
-
URLs lifted to `wss://h/ws/<tenant>:<canonical>`)
|
|
662
|
+
URLs lifted to `wss://h/ws/<tenant>:<canonical>`), `mcpUrl("notes_mcp", baseUrl)` (an MCP
|
|
663
|
+
server's address to show a user or hand a client; browser JS cannot call it). A rename is a type error, not a 404.
|
|
663
664
|
- **Request types without the def.** `routes.gen.ts` also exports types-only `RouteInputs`,
|
|
664
665
|
`ChannelInputs`, `MessageInputs` (and `MessageName`), keyed like `ROUTES`, `CHANNELS`, and
|
|
665
666
|
`"<channel key> <message name>"`: `type NewListing = RouteInputs["POST listings"]`. A
|
|
@@ -770,6 +771,8 @@ core sections still refresh; under `routes --emit --strict` it is fatal. `@xano-
|
|
|
770
771
|
- A lambda returns error TEXT with HTTP 200 (`Could not resolve "node:crypto"`, an undefined-binding message) — the body threw; use the preloaded globals, the surface's bindings, and `capture`. `llms/lambda.md`.
|
|
771
772
|
- `Unable to locate request.` (404) on an endpoint that deployed — a lowercase verb, a `.` in the name, or a CORS `mode` typo that dropped the whole API group. `llms/kinds-core.md`.
|
|
772
773
|
- A browser call fails on a missing `access-control-allow-origin` while deploy looks fine — CORS `mode: "custom"` with `"*"` or an unmatched origin. `llms/kinds-core.md`.
|
|
774
|
+
- 403 `Forbidden: Origin not allowed` from an MCP server URL — the request came from a browser; MCP endpoints refuse every `Origin`, so call them server-side. `llms/kinds-agent-mcp.md`.
|
|
775
|
+
- `ERROR_FATAL` `The free model is not available in this process.` — an `xano-free` agent run on the Xano Engine on this machine; it runs only on Xano's cloud. `llms/kinds-agent-mcp.md`.
|
|
773
776
|
- A websocket is closed right after the handshake — a refused `connect` gate: an empty/falsy return, a crash, or a gating trigger with no `response`. `llms/triggers.md`.
|
|
774
777
|
- `to_throw failed - response is ok` around an auth-refused call — `ERROR_CODE_ACCESS_DENIED` carries no message; the auth gate is not reachable from a workflow test. `llms/tests.md`.
|
|
775
778
|
- Output reads `Hi [object Object]` — a tagged value inside a JS template literal; compose at runtime with `withFilters` + `fl.concat`. `llms.txt`.
|
|
@@ -868,6 +871,7 @@ The run is isolated in ways that make a correct test fail for reasons the failur
|
|
|
868
871
|
|
|
869
872
|
- An MCP server serves THREE primitives, and each reaches the client differently: a `tool()` is an action the MODEL calls (it may write); a `resource()` is read-only context the client APPLICATION lists and attaches by `uri` (reference docs, a schema, one record through a `{variable}` template); a `prompt()` is a message template with arguments the USER picks by name. Context a session opens with is a `resource()`; a workflow a user starts by name is a `prompt()`; data the model must fetch on its own mid-task stays a `tool()`, since a client shows the model only the resources attached to the conversation. Register each kind (`registerTools`/`registerPrompts`/`registerResources`) and list it on the server.
|
|
870
873
|
- `mcpServer({ name, guid?, description?, instructions?, docs?, enabled?, canonical?, spec?, tags?, history?, tools?, prompts?, resources?, oauth?, llm?, output? })` — an MCP toolset. `llm?`/`output?` are the same blocks `agent()` takes and are usually absent: an MCP server and an agent are ONE stored object distinguished by `type`. Returns a handle with `getPath()`/`getUrl(baseUrl)` for the Streamable-HTTP endpoint — `getUrl` is NOT idempotent, a `baseUrl` already carrying an `/x2/mcp/<…>/stream` path THROWS, so resolve ONCE from the instance base URL. Fires on an ephemeral. A TENANT rides AFTER the prefix (`/x2/mcp/tenant/<tenant>/<canonical>/<token>/stream`), not as a base-URL segment: `getUrl` LIFTS a `/tenant/<name>` out of the base and re-places it there, so `getUrl(window.XANO_HOST)` is correct as-is; concatenating them by hand builds an unregistered route that 404s. Pass `{ tenant }` when the base URL cannot name it (a tenant on its own domain).
|
|
874
|
+
- ⚠ Refuses any request carrying a browser `Origin`, preflight too: 403, JSON-RPC `-32000` `Forbidden: Origin not allowed`. One with no `Origin` (curl, a server, an MCP client) is served; the bundle cannot admit an origin, so call it server-side, never from browser JS.
|
|
871
875
|
- `tools?`: a `ToolsetToolEntry[]`. Pass the `tool()` HANDLES directly (`tools: [saveNote]`); use the `{ tool, enabled?, auth?, type?, resourceUri?, toolMeta? }` wrapper when an entry needs more. `type: "resource"` (+ a required `resourceUri`) is the LEGACY way to publish a tool as an MCP resource — author a `resource()` and list it in `resources` instead; `toolMeta` is extra metadata on a tool entry. The two payload fields are per-type and supplying the other one is refused, because the engine stores it against neither. `auth` names an auth **table** (a `table({ auth: true })` handle or its name) — per-tool, and the only gate there is. ⚠ It is also what gives the tool a CALLER, on an `agent()` exactly as on an MCP server. `auth()` inside a tool whose entry names no table does NOT return null: the call answers a normal result carrying `{"code":"ERROR_FATAL","message":""}`, so the model reads a successful tool result and reports success while nothing is written. A caller token does not rescue it — the ENTRY supplies identity. Spell it `{ tool: saveNote, auth: users }`; `export()` warns. An entry naming no tool THROWS at export; a deliberate raw `id: 0` warns and carries through.
|
|
872
876
|
- `prompts?` / `resources?`: `prompt()` / `resource()` HANDLES (or names), or a `{ prompt, enabled?, auth? }` / `{ resource, enabled?, auth? }` wrapper. `auth` names the auth table and is what gives the stack a caller: a prompt/resource reading `auth()` behind an entry with none answers every `prompts/get` / `resources/read` with `-32603 "Access Denied"` (`export()` warns `toolset.primitive-reads-auth-ungated`). Listing one target twice THROWS; two resources with one `uri` on one server fail `export()` (`mcp.resource-uri-duplicate`). MCP-server only — `agent()` takes tools only.
|
|
873
877
|
- `history?` is the server tier for its tools, prompts AND resources alike; an object's own `history` wins. The workspace tier (`workspaceConfig({ history })`) has `prompt` and `resource` keys, both default on.
|
|
@@ -888,6 +892,7 @@ The run is isolated in ways that make a correct test fail for reasons the failur
|
|
|
888
892
|
- `s.mcp.oauth.revoke({ mcp_server, user_id? | grant_id? | all?, as? })` — end hosted sign-ins on a server: EXACTLY ONE of `user_id`, `grant_id`, `all: c.bool(true)`, else `export()` fails (`mcp.oauth-revoke-target`). Binds `{ revoked }`.
|
|
889
893
|
- `agent({ name, guid?, description?, docs?, enabled?, canonical?, tags?, history?, llm, tools?, output? })` — an LLM orchestrator. No top-level `instructions`/`prompt`/`spec` — the prompt lives under `llm`. Invoke from a stack with `s.ai.agent.run({ agent, args })`.
|
|
890
894
|
- `llm` (REQUIRED): typed provider settings, a discriminated union on `type` (`"xano-free" | "anthropic" | "openai" | "google-genai"`). Shared fields: `systemPrompt?`, `maxSteps?` (default `5`), and `prompt?` XOR `messages?` (genuinely exclusive: both is a type error and throws — the engine stores ONE `prompt_type`, so one would be dropped); plus provider fields (`apiKey?`, `model?`, `temperature?`, `reasoningEffort?`, …). String fields accept Twig placeholders — `{{ $args.x }}` for run inputs (the `args` of `s.ai.agent.run`), `{{ $env.NAME }}` for env vars.
|
|
895
|
+
- `xano-free` runs only on Xano's cloud: on the Xano Engine on this machine a run fails `ERROR_FATAL` `The free model is not available in this process.` — use a keyed provider there.
|
|
891
896
|
- `tools?`: same `ToolsetToolEntry[]` as `mcpServer` — bare `tool()` handles, or a `{ tool, enabled?, auth? }` wrapper when one needs `enabled`/`auth`. A tool reading `auth()` MUST use the wrapper naming the auth table — a bare handle runs it with no caller (see `mcpServer`'s `tools?`).
|
|
892
897
|
- `output?`: `{ schema: Record<string, input.*>, enabled? }` — structured-output schema. `schema` is a named-field record authored with the `input.*` catalog, exactly like a `defineFunction`/`query` `input:` map (the stored `structuredOutputsSchema` is the same wire shape as function inputs). e.g. `output: { schema: { priority: input.enum(["low","high"]), summary: input.text() } }`. When you pass the agent *handle* to `s.ai.agent.run({ agent })`, `.result` is typed straight from this schema — no `resultShape` witness needed (the shape is declared once). `resultShape` remains only to override that, or to type an agent referenced by bare name.
|
|
893
898
|
- **Run + read recipe (`s.ai.agent.run`):** bind the run to a var (`s.ai.agent.run({ agent, args, allowToolExecution: c.bool(true), as: "run" })`) — it produces a rich envelope, and the completion is at **`.result`**. Read one structured field with a dotted ref (`response: ref("run.result.priority")`) or the whole completion (`ref("run.result")`, typed from `output.schema`); persist it in a later step the same way (`s.set_var("summary", ref("run.result.summary"))`). `args` is a plain object of run inputs (`{ topic: inp("topic") }` — raw literals are fine, e.g. `{ max_steps: 3 }`) surfaced to the agent as `{{ $args.topic }}`. `.toolCalls` is the FINAL step's calls only (often `[]`); every call is a `.steps[].content[]` entry of `type: "tool-call"`. ⚠ An agent with tools needs `allowToolExecution: c.bool(true)` on the run: unset, its tools are OFF and it answers without them (warns `stack.agent-tools-off`).
|
|
@@ -1250,7 +1255,7 @@ Microservices (the `microservice()` def and the statement that calls it):
|
|
|
1250
1255
|
- `inp(name: string) => Value` — Reference a function/endpoint input → tag "input". Resolves ONLY against the `input` block of the def it sits in — a value produced earlier in the stack is `ref("var.field")`, not `inp("field")`. A name that is not declared here deploys clean and fails at runtime with ERROR_FATAL "Unable to locate input: <name>" on every branch that reads it; `export()` warns, and `--strict` fails the build. Sending the name in the request does NOT rescue it — an undeclared input is never bound, so the call fails identically with the value present. A dotted path drills INTO a declared input (`inp("action.amount")` needs a declared `action`).
|
|
1251
1256
|
- `col(name: string) => Value` — Reference a table column → tag "col".
|
|
1252
1257
|
- `auth(path?: string) => Value` — Reference the authenticated identity (auth("id") → $auth.id) → tag "auth".
|
|
1253
|
-
- `caught(path?: "code" | "message" | "name" | "result") => Value` — Read the caught error inside an s.try_catch CATCH arm → tag "trycatch". Valid ONLY there — it reads empty in the try/finally arms and outside the statement. Those four fields are all the engine binds
|
|
1258
|
+
- `caught(path?: "code" | "message" | "name" | "result") => Value` — Read the caught error inside an s.try_catch CATCH arm → tag "trycatch". Valid ONLY there — it reads empty in the try/finally arms and outside the statement. Those four fields are all the engine binds; bare caught() is the whole error record. `code` is the error type: `ERROR_FATAL` for an engine error, a precondition's `error_type` (`ERROR_CODE_ACCESS_DENIED`, …), `ERROR_CODE_THROWN_ERROR` for `s.throw`. `message` is the error text (a precondition's `error`, the engine's, an LLM provider's) EXCEPT for `s.throw`, where it is the fixed "Throw Error Statement" and your value is in `result`. `name` is `s.throw`'s `name` (empty without one), else a label (`Exception`, `Access Denied`). ⚠ An `s.ai.agent.run` provider failure binds `result: { name: "AI_APICallError", statusCode, isRetryable, data }`; branch a fallback on `withFilters(caught("result"), fl.get("statusCode"))` (401: the key was refused). The path takes only the four names; reach deeper with `fl.get`.
|
|
1254
1259
|
- `toolset(path: "token" | "params" | `params.${string}`) => Value` — Read a toolset-scoped binding inside a tool → tag "toolset". The engine binds two: token (the calling URL's token, null when absent) and params (its parameters, as an object); a dotted params.<key> reads one parameter out of that object. Bound only while a tool runs under its toolset — anywhere else it reads empty.
|
|
1255
1260
|
- `env(name: string) => Value` — Read a WORKSPACE environment variable (set via workspaceConfig({ env }) or the dashboard) → `$env.NAME`. Compiles to tag "setting" with the plain name. env("remote_ip") reads a user var named remote_ip, not the caller IP — use sys.remoteIp() for that. A name that does not exist resolves to NULL rather than erroring, so a typo deploys clean and fails downstream of the value: prefer typedEnv(config), which turns the names that config declares into properties (E.STRIPE_KEY), and export() warns stack.env-undeclared on any env() or bare setting() outside the declared set once a config declares env at all.
|
|
1256
1261
|
- `setting(name: string) => Value` — Reference a workspace setting → tag "setting". Built-in system vars are $-prefixed settings, e.g. setting("$remote_ip"); prefer the typed sys.* accessors.
|
|
@@ -1622,7 +1627,8 @@ stored value inside a `db.edit` `row` (it is `null`; `null + 1` aborts): `db.get
|
|
|
1622
1627
|
- `fl.url_hasarg(key: text): text`
|
|
1623
1628
|
- `fl.yaml_encode(options?: bool, inline?: int, indent?: int): text`
|
|
1624
1629
|
|
|
1625
|
-
Zero-argument filters — call as `fl.<name>()`; an argument is a compile error:
|
|
1630
|
+
Zero-argument filters, by operand type — call as `fl.<name>()`; an argument is a compile error. array: array_entries, array_keys, array_lower, array_pop, array_shift, array_shuffle, array_values, count, first, flatten, last, reverse, rsort, safe_array; comparison: bitwise_not, empty, even, is_array, is_bool, is_decimal, is_int, is_object, is_text, is_uuid, not, odd; geo: to_geo_linestring, to_geo_multilinestring, to_geo_multipoint, to_geo_multipolygon, to_geo_point, to_geo_polygon; math: abs, acos, acosh, asin, asinh, atan, atanh, avg, ceil, cos, deg2rad, exp, floor, ln, log10, product, rad2deg, sin, sqrt, sum, tan; misc: null; other: sort; security: uid, uuid4; text: addslashes, capitalize, escape, from_utf8, list_encodings, lower, querystring_parse, sql_alias, sql_esc, strip_accents, strlen, text_escape, text_unescape, to_utf8, upper, url_parse; timestamp: ms_to_secs, secs_to_ms; transform: base64_decode, base64_decode_urlsafe, base64_encode, base64_encode_urlsafe, bin2hex, bindec, create_object_from_entries, decbin, dechex, decoct, hex2bin, hexdec, json_decode, json_encode, octdec, to_bool, to_decimal, to_expr, to_int, to_text, url_decode, url_decode_rfc3986, url_encode, url_encode_rfc3986, xml_decode, yaml_decode.
|
|
1631
|
+
`fl.reverse()` reverses a list only: on a text value it answers the text UNCHANGED, with no error.
|
|
1626
1632
|
|
|
1627
1633
|
Variadic filters — they take arguments, but no declared list, so the count is not checked: sprintf.
|
|
1628
1634
|
|
package/llms.txt
CHANGED
package/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xanosdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "TypeScript SDK that compiles a typed Xano workspace into the importable packageExport JSON bundle.",
|
|
5
5
|
"coverage": {
|
|
6
6
|
"objectKinds": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
{
|
|
129
129
|
"name": "caught",
|
|
130
130
|
"signature": "(path?: \"code\" | \"message\" | \"name\" | \"result\") => Value",
|
|
131
|
-
"description": "Read the caught error inside an s.try_catch CATCH arm → tag \"trycatch\". Valid ONLY there — it reads empty in the try/finally arms and outside the statement. Those four fields are all the engine binds
|
|
131
|
+
"description": "Read the caught error inside an s.try_catch CATCH arm → tag \"trycatch\". Valid ONLY there — it reads empty in the try/finally arms and outside the statement. Those four fields are all the engine binds; bare caught() is the whole error record. `code` is the error type: `ERROR_FATAL` for an engine error, a precondition's `error_type` (`ERROR_CODE_ACCESS_DENIED`, …), `ERROR_CODE_THROWN_ERROR` for `s.throw`. `message` is the error text (a precondition's `error`, the engine's, an LLM provider's) EXCEPT for `s.throw`, where it is the fixed \"Throw Error Statement\" and your value is in `result`. `name` is `s.throw`'s `name` (empty without one), else a label (`Exception`, `Access Denied`). ⚠ An `s.ai.agent.run` provider failure binds `result: { name: \"AI_APICallError\", statusCode, isRetryable, data }`; branch a fallback on `withFilters(caught(\"result\"), fl.get(\"statusCode\"))` (401: the key was refused). The path takes only the four names; reach deeper with `fl.get`."
|
|
132
132
|
},
|
|
133
133
|
{
|
|
134
134
|
"name": "toolset",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xano/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "The official TypeScript SDK for Xano, one platform to build, run and govern AI-built software. Your coding agent writes the backend in TypeScript, you run it on the Xano Engine on your machine, then deploy it to Xano.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"xanosdk",
|
|
@@ -14,8 +14,8 @@ description: >-
|
|
|
14
14
|
FastAPI) unless the user asks for Xano.
|
|
15
15
|
license: MIT
|
|
16
16
|
metadata:
|
|
17
|
-
xanosdk-version: "1.0.
|
|
18
|
-
xanosdk-digest: "sha256:
|
|
17
|
+
xanosdk-version: "1.0.11"
|
|
18
|
+
xanosdk-digest: "sha256:c5d35da65c9b45a105277ba0dec5d798f6fcb6239a99f50db8f6327d1c7abca6"
|
|
19
19
|
---
|
|
20
20
|
|
|
21
21
|
# Xano backend
|