@xanots/sdk 0.0.9 → 0.0.10

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +28 -21
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
  5. package/dist/bin.js +8 -7
  6. package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
  7. package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
  8. package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
  9. package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
  10. package/dist/{chunk-7OXFMCTX.js → chunk-5R73LFWK.js} +3 -3
  11. package/dist/{chunk-OW2QZEWL.js → chunk-5YCQ2QHH.js} +2 -2
  12. package/dist/{chunk-5YQOIFT4.js → chunk-75Z74TA7.js} +2 -2
  13. package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
  14. package/dist/{chunk-K3YSQDXJ.js → chunk-ACCBOMCB.js} +91 -74
  15. package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
  16. package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
  17. package/dist/chunk-CTD5ZCV6.js +28 -0
  18. package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
  19. package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
  20. package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
  21. package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
  22. package/dist/{chunk-L6TPHWAU.js → chunk-I7DQDJAM.js} +30 -48
  23. package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
  24. package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
  25. package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
  26. package/dist/{chunk-QONOJO45.js → chunk-LBYWGMOA.js} +1 -1
  27. package/dist/{chunk-ZZLPTHT5.js → chunk-P6TAVLOX.js} +2 -2
  28. package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
  29. package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
  30. package/dist/{chunk-UDL46O35.js → chunk-VKSOTZK3.js} +2 -2
  31. package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
  32. package/dist/{chunk-KSV7VOEX.js → chunk-W24FJHPD.js} +3 -3
  33. package/dist/chunk-WGPXT2G2.js +22 -0
  34. package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
  35. package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
  36. package/dist/{chunk-6Z5CNWFC.js → chunk-YYFXVYPX.js} +37 -6
  37. package/dist/chunk-ZQ2PKR6R.js +40 -0
  38. package/dist/cli.d.ts +57 -31
  39. package/dist/cli.js +6 -5
  40. package/dist/codegen-command-GB3H2KQ7.js +46 -0
  41. package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
  42. package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
  43. package/dist/{deploy-command-5TTI4TUP.js → deploy-command-QTIVA22A.js} +67 -99
  44. package/dist/{ephemeral-command-7TK52YQM.js → ephemeral-command-U4AQ3TXX.js} +25 -28
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +5 -5
  47. package/dist/{init-command-OVFFW4QS.js → init-command-MAXULNAD.js} +13 -10
  48. package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
  49. package/dist/internal.d.ts +2 -2
  50. package/dist/internal.js +27 -36
  51. package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
  52. package/dist/{lock-commands-ET7NIOLH.js → lock-commands-DQ7CUMIV.js} +20 -19
  53. package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
  54. package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
  55. package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
  56. package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
  57. package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
  58. package/dist/node.d.ts +2 -2
  59. package/dist/node.js +9 -8
  60. package/dist/{validate-command-SK5FPCV7.js → preflight-command-GZ2GE5RN.js} +17 -16
  61. package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
  62. package/dist/{release-command-4EXVLYV2.js → release-command-YUBTNHVX.js} +36 -33
  63. package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
  64. package/dist/scaffold.js +2 -2
  65. package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
  66. package/dist/status-command-AL47VG7H.js +162 -0
  67. package/dist/{store-CUCBSYLj.d.ts → store-BG1UPZ3Z.d.ts} +5 -5
  68. package/dist/{test-command-2F5LKMI6.js → test-command-YAZLKLGQ.js} +45 -28
  69. package/dist/{upgrade-command-QL523I62.js → upgrade-command-FB5QJ363.js} +13 -12
  70. package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
  71. package/dist/{workspace-command-HYA6JEKK.js → workspace-command-43P42FBP.js} +31 -32
  72. package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
  73. package/guides/README.md +2 -2
  74. package/guides/cli.md +17 -19
  75. package/guides/codegen.md +21 -5
  76. package/guides/coverage.md +1 -1
  77. package/guides/deploying.md +31 -34
  78. package/guides/environment.md +4 -4
  79. package/guides/object-kinds.md +3 -3
  80. package/guides/project-structure.md +1 -1
  81. package/guides/scaffold.md +25 -2
  82. package/guides/typed-frontend.md +1 -1
  83. package/llms/kinds-agent-mcp.md +1 -1
  84. package/llms/kinds-core.md +1 -1
  85. package/llms/kinds-realtime.md +1 -1
  86. package/llms/lock.md +5 -5
  87. package/llms/tests.md +1 -1
  88. package/llms-full.txt +25 -34
  89. package/llms.txt +16 -25
  90. package/manifest.json +95 -426
  91. package/package.json +1 -1
  92. package/dist/chunk-3EYUR3TX.js +0 -100
  93. package/dist/chunk-JQJPFUZI.js +0 -118
  94. package/dist/chunk-YNZFIY4J.js +0 -78
  95. package/dist/codegen-command-YSCSCVT5.js +0 -43
  96. package/dist/env-target-4T7AT347.js +0 -16
  97. package/dist/sandbox-details-command-EDO56IY3.js +0 -18
  98. package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
package/llms.txt CHANGED
@@ -1,4 +1,4 @@
1
- # xanots v0.0.9
1
+ # xanots v0.0.10
2
2
 
3
3
  > TypeScript SDK that compiles a typed Xano workspace into the importable packageExport JSON bundle.
4
4
 
@@ -50,7 +50,7 @@ installed), so a plain file read resolves them at the version you have.
50
50
  - [Column and input types](llms/fields.md): Read when declaring a table column (`f.*`) or a function/query input (`input.*`) — a type's options and accessor methods, and the `s.precondition` error/status contract that rides the same catalog.
51
51
  - [Filter catalog](llms/filters.md): Read when piping a value through `fl.*` — the full catalog with each filter's argument types.
52
52
  - [Lambda bodies (JavaScript)](llms/lambda.md): Read when writing a JavaScript body, or weighing whether to reach for one at all — `lam.fn`, `fl.lambda`, `fl.reduce`, `s.lambda`. Lambda workers are a bounded shared resource, and each surface binds a different set of identifiers.
53
- - [Lock file](llms/lock.md): Read when a `xano.lock` exists or should — renaming/pruning/adopting identities, seeding the lock programmatically, or asking which commands write it.
53
+ - [Lock file](llms/lock.md): Read when a `xano.lock` exists or should — renaming/pruning/importing identities, seeding the lock programmatically, or asking which commands write it.
54
54
  - [Legacy paradigms and retired statements](llms/legacy.md): Read when the code was PULLED from an existing Xano instance rather than authored here — how a codegen'd tree reads and the three shapes in it that must not be "fixed", plus a `raw({ name: "mvp:…" })` statement, a `realtimeTrigger()`, or any name the catalogs do not list.
55
55
  - [Statement catalog](llms/statements-catalog.md): Read for the field signature of a specific statement — every surface, grouped by `s.*` namespace. Look here after the control-flow core in the router does not cover what you need.
56
56
 
@@ -115,7 +115,7 @@ which fails with a "must be ES modules" error until you switch it to module.
115
115
 
116
116
  Set `canonical` on every `apiGroup`. The engine mints the URL token server-side, so
117
117
  without one a group's client paths are unresolvable until a lock exists: the bundle
118
- exports fine and `xanots paths` / `getPath()` then fail on the very queries it just
118
+ exports fine and `xanots routes` / `getPath()` then fail on the very queries it just
119
119
  built. An explicit `canonical` resolves them from the source alone.
120
120
 
121
121
  Build warnings: `export()` prints the shapes that deploy clean and then do the wrong
@@ -134,7 +134,7 @@ api-group/toolset canonical in a lock file written BESIDE THE ENTRY FILE —
134
134
  To rename an object: rename in code, export (stderr prints the exact fix-up), run
135
135
  `xanots lock rename <kind> <old> <new>`, export again — the original guid is emitted
136
136
  under the new name, so the engine renames in place instead of delete+create. Taking
137
- over an existing workspace: `xanots lock adopt <its-packageExport.json>` first, then
137
+ over an existing workspace: `xanots lock import <its-packageExport.json>` first, then
138
138
  export. Pruning, programmatic seeding, and which commands write the lock:
139
139
  `llms/lock.md`.
140
140
 
@@ -147,19 +147,19 @@ environment and prints its URL.
147
147
  AND records — before importing. The blast radius is a disposable environment, not a
148
148
  production workspace, but confirm with the user before the first run.
149
149
 
150
- **Two destinations, and the choice changes more than the target.**
150
+ **One destination, and no flag for it.**
151
151
 
152
- - `--dest ephemeral` (DEFAULT) a NAMED, workspace-scoped, auto-expiring tenant
153
- (~1h; `--expires-hours` 1–72 at create time). The active one is tracked in
152
+ - `xanots deploy` writes to a NAMED, workspace-scoped, auto-expiring ephemeral tenant
153
+ (~1h; `--expires-hours` 1–72 at create time), and to nothing else an `--env` here
154
+ is a usage error, not a choice. The active env is tracked in
154
155
  `./.xano/ephemeral.json`, so deploying again REFRESHES it and the URL is unchanged;
155
156
  if it expired or was swept, a fresh one is created and the new URL is called out.
156
157
  `--static` puts the frontend ON THE EPHEMERAL, so backend and frontend share one
157
158
  disposable environment.
158
159
  ⚠ Only the BACKEND URL survives a refresh: the replace clears static hosting too,
159
160
  so `--static` publishes a NEW host every run and the previous URL stops serving.
160
- - `--dest sandbox` your single throwaway tenant, no expiry. `--static` puts the
161
- frontend on your OWN (parent) workspace instead, because the sandbox tenant does
162
- not serve static hosting.
161
+ - `xanots status` names the env this project last deployed to, its URL and its expiry,
162
+ without your having to remember which one it was.
163
163
  - `xanots release` promotes to your INSTANCE workspace and MERGES, not replaces:
164
164
  adds/updates what you define, deletes nothing, writes no rows. Destruction is
165
165
  opt-in per flag, previewed + confirmed, and can drop a table WITH its rows.
@@ -182,7 +182,7 @@ host falls back to '', and every call 404s off the dev server.
182
182
  ⚠ It is INJECTED in bracket form — `window["XANO_HOST"]="…"` — so verifying a deploy
183
183
  by grepping `window.XANO_HOST` matches nothing and reads as a failed inject. Grep the
184
184
  bare `XANO_HOST` token.
185
- ⚠ `xanots validate` ignores the deploy login and reads `XANO_VALIDATE_INSTANCE` /
185
+ ⚠ `xanots preflight` ignores the deploy login and reads `XANO_VALIDATE_INSTANCE` /
186
186
  `XANO_VALIDATE_TOKEN` (+ optional `XANO_VALIDATE_WORKSPACE_ID`) from the environment.
187
187
  **Displaying a stored file.** A file column comes back as `{ path, name, type, size,
188
188
  meta, access, url }`. ⚠ Do NOT use its `url`: on a tenant-scoped environment that field
@@ -332,7 +332,7 @@ Non-obvious authoring rules:
332
332
  never removes it. The floor is the RUNTIME, not the def: a second def, or a much richer
333
333
  one, adds ~1 kB. So the cost is paid by importing ANY def at all, and reducing what a
334
334
  def does will not reduce it.
335
- Fix: `xanots paths <entry> --emit xano/routes.gen.ts` (`routes` is an accepted alias) — verbs, paths, and sockets as
335
+ Fix: `xanots routes <entry> --emit xano/routes.gen.ts` (`paths` is an accepted alias) — verbs, paths, and sockets as
336
336
  plain data importing NOTHING, still compile-checked: `routePath("blog/{slug}", { slug })`,
337
337
  `channelPath("rooms/{room_id}", { room_id })`, `socketUrl("chat", baseUrl)` (tenant base
338
338
  URLs lifted to `wss://h/ws/<tenant>:<canonical>`). A rename is a type error, not a 404.
@@ -419,19 +419,10 @@ Non-obvious authoring rules:
419
419
  credential the runner has. As a file that triple is `{ "type": "token",
420
420
  "instance_base_url": …, "workspace_id": <n>, "meta_api_token": … }`. The older
421
421
  `$XANO_REFRESH_TOKEN` + `$XANO_CLIENT_ID` pair still works but ROTATES: single-use.
422
- - **Event-driven objects fire on an EPHEMERAL, not in the sandbox.** A `task`
423
- (scheduled), an `mcpServer`, and every trigger — `tableTrigger` included — run normally
424
- on an ephemeral env, which is `deploy`'s DEFAULT destination. So test an event-driven
425
- design (screen-on-insert, cron cleanup, MCP tool call) by deploying it and letting it
426
- run.
427
- ⚠ Under `--dest sandbox` they import cleanly but their stacks NEVER execute, and there
428
- is no way to fire one manually — an insert on a bound table does not run its
429
- `tableTrigger`, and the design silently does nothing. Only synchronously-invoked objects
430
- (queries, functions, and the agents an endpoint calls with `s.ai.agent.run`) run there.
431
- If you must stay on the sandbox, verify the logic out of band: factor the body into a
432
- `defineFunction` (or a callable `query`) and invoke it directly — a `tableTrigger` that
433
- screens a row on insert should delegate to a function a `query` can also call via
434
- `s.function.run`, and you assert against that.
422
+ - **Event-driven objects fire on an EPHEMERAL.** A `task` (scheduled), an `mcpServer`,
423
+ and every trigger — `tableTrigger` included — run normally on an ephemeral env, which
424
+ is where `deploy` sends them. So test an event-driven design (screen-on-insert, cron
425
+ cleanup, MCP tool call) by deploying it and letting it run.
435
426
  - **Zero-based numeric keys make `c.obj` a LIST.** `c.obj({ "0": "a" })` evaluates to
436
427
  `["a"]`: a numeric key IS an index in the engine's data model, so keys that are exactly
437
428
  `0..n-1` come back as a list with HTTP 200 and no error. Write `c.array([...])` when you