@xanots/sdk 0.0.5 → 0.0.7

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 (83) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +3 -3
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/{agent-file-refresh-IJ7GN2FJ.js → agent-file-refresh-4W37DGXS.js} +4 -4
  5. package/dist/bin.js +8 -8
  6. package/dist/branch-commands-PBQ36L4A.js +134 -0
  7. package/dist/{chunk-CYJ7R3AD.js → chunk-2V3JUXTF.js} +24 -11
  8. package/dist/{chunk-OR43PDCW.js → chunk-3EYUR3TX.js} +2 -2
  9. package/dist/{chunk-SG4UBJ47.js → chunk-3QW5NFZJ.js} +26 -5
  10. package/dist/{chunk-7SISR3CS.js → chunk-4PE4ZAB7.js} +3 -3
  11. package/dist/{chunk-PGBK64U5.js → chunk-4PTSTDIG.js} +2 -2
  12. package/dist/{live-diff-FP4SFNT4.js → chunk-5HCDZ2XN.js} +67 -6
  13. package/dist/{chunk-OARSPAIE.js → chunk-5PDOAR77.js} +58 -38
  14. package/dist/{chunk-5WGEURVI.js → chunk-6AAT2AYQ.js} +21 -1
  15. package/dist/{chunk-QA5ICJ4M.js → chunk-7BUTRVKA.js} +3 -3
  16. package/dist/{chunk-YUBJLB6G.js → chunk-7JDT4PBU.js} +75 -8
  17. package/dist/{chunk-LLWK6H77.js → chunk-BKDJN76G.js} +31 -1
  18. package/dist/{chunk-MS3BRZAZ.js → chunk-CL2H2WYE.js} +50 -27
  19. package/dist/{chunk-KXCPZUUM.js → chunk-DBHE35JM.js} +8 -67
  20. package/dist/chunk-EQW3YT5U.js +159 -0
  21. package/dist/{chunk-BPEEGJJA.js → chunk-FAWNUE2U.js} +39 -8
  22. package/dist/{chunk-ZGA5MUNC.js → chunk-FDKR4YMN.js} +2 -2
  23. package/dist/{chunk-APOR6TCV.js → chunk-H2DEDWQF.js} +4 -4
  24. package/dist/{chunk-PXXLBXOP.js → chunk-JAVB27HL.js} +2 -2
  25. package/dist/{chunk-AAFBSOSD.js → chunk-JQJPFUZI.js} +3 -3
  26. package/dist/{chunk-IVP6TS26.js → chunk-JQLR64UC.js} +6 -5
  27. package/dist/{chunk-FN4OQT2J.js → chunk-JUHKEAHJ.js} +4 -4
  28. package/dist/{chunk-WJYB7DSI.js → chunk-MDXR5E5Q.js} +2 -2
  29. package/dist/{chunk-WGDAOOXG.js → chunk-MU3O43L2.js} +3 -3
  30. package/dist/{chunk-YUPQOLFX.js → chunk-NJGNUVXR.js} +15 -4
  31. package/dist/{chunk-F5T45NAM.js → chunk-OKNSR7MT.js} +45 -2
  32. package/dist/{chunk-MFIHIS6B.js → chunk-OYMR5AMJ.js} +2 -2
  33. package/dist/{chunk-QUUB7HYK.js → chunk-P5C2YKAM.js} +2 -2
  34. package/dist/{chunk-6DHJVLYP.js → chunk-Q77KNEUL.js} +1 -1
  35. package/dist/{chunk-D6OGU2AI.js → chunk-QIWBCS7N.js} +2 -2
  36. package/dist/cli.d.ts +28 -2
  37. package/dist/cli.js +7 -7
  38. package/dist/{codegen-command-BLOS3GR3.js → codegen-command-DYH4H4TD.js} +18 -18
  39. package/dist/{completion-GHP5RRLQ.js → completion-A6BZ3XGU.js} +8 -7
  40. package/dist/{deploy-command-XOH76USO.js → deploy-command-HM57BINV.js} +15 -15
  41. package/dist/{env-target-POGJMD6Q.js → env-target-WA3BH5YU.js} +6 -6
  42. package/dist/{ephemeral-command-46SL27GJ.js → ephemeral-command-SD2KLX4P.js} +10 -10
  43. package/dist/index.d.ts +69 -26
  44. package/dist/index.js +6 -6
  45. package/dist/init-command-VIPWAQYS.js +30 -0
  46. package/dist/internal.d.ts +2 -2
  47. package/dist/internal.js +120 -62
  48. package/dist/{io-7VIA5SON.js → io-M7XZEMK7.js} +3 -3
  49. package/dist/live-diff-QK4KC2FJ.js +12 -0
  50. package/dist/{lock-KXOJIGCG.js → lock-GFXD6G2E.js} +6 -2
  51. package/dist/{lock-commands-6UONZW26.js → lock-commands-7VJKAXV6.js} +8 -8
  52. package/dist/{login-command-SG7IWTHW.js → login-command-DFCURZLC.js} +6 -6
  53. package/dist/{logout-command-J2AG5NKC.js → logout-command-WXVZQCAV.js} +2 -2
  54. package/dist/{marketplace-command-NKTQ3VPS.js → marketplace-command-BCOAAN2I.js} +3 -3
  55. package/dist/{meta-client-OW5WKWW7.js → meta-client-57ZWVHST.js} +2 -2
  56. package/dist/node.d.ts +2 -2
  57. package/dist/node.js +10 -10
  58. package/dist/{profile-command-ZPC2DPFV.js → profile-command-QJAAUZIV.js} +3 -3
  59. package/dist/{release-command-FKQ6E3TD.js → release-command-3IET7YII.js} +206 -26
  60. package/dist/{sandbox-details-command-DMY2KGA2.js → sandbox-details-command-EDO56IY3.js} +4 -4
  61. package/dist/{sandbox-export-command-R6QMEK3D.js → sandbox-export-command-MO6DEZ7Z.js} +5 -5
  62. package/dist/scaffold.d.ts +10 -13
  63. package/dist/scaffold.js +3 -3
  64. package/dist/{store-BJONDJoZ.d.ts → store-DfuWu1tE.d.ts} +1 -1
  65. package/dist/{test-command-56IAEYHX.js → test-command-S7SMRWMP.js} +8 -8
  66. package/dist/{upgrade-command-M2DZ3ZPD.js → upgrade-command-TZYSGXP7.js} +13 -13
  67. package/dist/{validate-command-CIBQJND7.js → validate-command-MMXEVHH3.js} +10 -10
  68. package/dist/{workspace-command-HZS43PHJ.js → workspace-command-X6L7HTXO.js} +24 -20
  69. package/guides/environment.md +6 -3
  70. package/guides/scaffold.md +3 -2
  71. package/llms/fields.md +8 -0
  72. package/llms/kinds-core.md +2 -1
  73. package/llms/lambda.md +1 -1
  74. package/llms/legacy.md +1 -1
  75. package/llms/lock.md +32 -0
  76. package/llms/object-kinds.md +2 -2
  77. package/llms/statements-calls.md +10 -3
  78. package/llms/statements-data.md +2 -1
  79. package/llms-full.txt +108 -58
  80. package/llms.txt +49 -49
  81. package/manifest.json +2 -2
  82. package/package.json +1 -1
  83. package/dist/init-command-NCRPVFGE.js +0 -30
@@ -7,25 +7,25 @@ import {
7
7
  } from "./chunk-NUQCEOKA.js";
8
8
  import {
9
9
  refreshAgentFiles
10
- } from "./chunk-D6OGU2AI.js";
11
- import "./chunk-7SISR3CS.js";
10
+ } from "./chunk-QIWBCS7N.js";
11
+ import "./chunk-4PE4ZAB7.js";
12
12
  import {
13
13
  runNpm
14
14
  } from "./chunk-ZSYZTGJH.js";
15
15
  import {
16
16
  sdkDep
17
- } from "./chunk-QUUB7HYK.js";
18
- import "./chunk-6DHJVLYP.js";
17
+ } from "./chunk-P5C2YKAM.js";
18
+ import "./chunk-Q77KNEUL.js";
19
19
  import {
20
20
  checkForUpgrade,
21
21
  detectInstallMode,
22
22
  registryUrl,
23
23
  suppressUpdateNotice,
24
24
  upgradeCommand
25
- } from "./chunk-ZGA5MUNC.js";
26
- import "./chunk-MS3BRZAZ.js";
27
- import "./chunk-IVP6TS26.js";
28
- import "./chunk-MFIHIS6B.js";
25
+ } from "./chunk-FDKR4YMN.js";
26
+ import "./chunk-CL2H2WYE.js";
27
+ import "./chunk-JQLR64UC.js";
28
+ import "./chunk-OYMR5AMJ.js";
29
29
  import "./chunk-GNPVYOPB.js";
30
30
  import {
31
31
  blank,
@@ -35,12 +35,12 @@ import {
35
35
  success,
36
36
  warn
37
37
  } from "./chunk-EZG76F7R.js";
38
- import "./chunk-BPEEGJJA.js";
39
- import "./chunk-F5T45NAM.js";
40
- import "./chunk-YUPQOLFX.js";
38
+ import "./chunk-FAWNUE2U.js";
39
+ import "./chunk-OKNSR7MT.js";
40
+ import "./chunk-NJGNUVXR.js";
41
41
  import "./chunk-WHOJWOSV.js";
42
42
  import "./chunk-5XZ744TS.js";
43
- import "./chunk-YUBJLB6G.js";
43
+ import "./chunk-7JDT4PBU.js";
44
44
 
45
45
  // src/emit/upgrade-command.ts
46
46
  import { readFileSync, writeFileSync } from "fs";
@@ -174,4 +174,4 @@ function messageOf(err) {
174
174
  export {
175
175
  runUpgradeCommand
176
176
  };
177
- //# sourceMappingURL=upgrade-command-M2DZ3ZPD.js.map
177
+ //# sourceMappingURL=upgrade-command-TZYSGXP7.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  assertBundleInput,
3
3
  loadBundleText
4
- } from "./chunk-QA5ICJ4M.js";
5
- import "./chunk-MS3BRZAZ.js";
6
- import "./chunk-IVP6TS26.js";
7
- import "./chunk-MFIHIS6B.js";
4
+ } from "./chunk-7BUTRVKA.js";
5
+ import "./chunk-CL2H2WYE.js";
6
+ import "./chunk-JQLR64UC.js";
7
+ import "./chunk-OYMR5AMJ.js";
8
8
  import "./chunk-GNPVYOPB.js";
9
9
  import {
10
10
  blank,
@@ -14,19 +14,19 @@ import {
14
14
  success,
15
15
  warn
16
16
  } from "./chunk-EZG76F7R.js";
17
- import "./chunk-BPEEGJJA.js";
18
- import "./chunk-F5T45NAM.js";
19
- import "./chunk-YUPQOLFX.js";
17
+ import "./chunk-FAWNUE2U.js";
18
+ import "./chunk-OKNSR7MT.js";
19
+ import "./chunk-NJGNUVXR.js";
20
20
  import "./chunk-WHOJWOSV.js";
21
21
  import "./chunk-5XZ744TS.js";
22
- import "./chunk-YUBJLB6G.js";
22
+ import "./chunk-7JDT4PBU.js";
23
23
 
24
24
  // src/emit/validate-command.ts
25
25
  var EXIT_VALIDATION_FAILED = 2;
26
26
  async function runValidateCommand(args) {
27
27
  assertBundleInput(args, { command: "validate" });
28
28
  const { resolveValidateConfig, verifyToken } = await import("./config-NL33PN4D.js");
29
- const { MetaClient } = await import("./meta-client-OW5WKWW7.js");
29
+ const { MetaClient } = await import("./meta-client-57ZWVHST.js");
30
30
  const config = resolveValidateConfig({ instance: args.instance });
31
31
  const who = await verifyToken(config);
32
32
  const host = new URL(config.instance).host;
@@ -119,4 +119,4 @@ function fmt(v) {
119
119
  export {
120
120
  runValidateCommand
121
121
  };
122
- //# sourceMappingURL=validate-command-CIBQJND7.js.map
122
+ //# sourceMappingURL=validate-command-MMXEVHH3.js.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  fetchWorkspaceBundle,
3
3
  runCodegenCommand
4
- } from "./chunk-OARSPAIE.js";
4
+ } from "./chunk-5PDOAR77.js";
5
5
  import "./chunk-ZOYMZZ3S.js";
6
6
  import {
7
7
  resolveOutputTarget
8
- } from "./chunk-AAFBSOSD.js";
9
- import "./chunk-OR43PDCW.js";
8
+ } from "./chunk-JQJPFUZI.js";
9
+ import "./chunk-3EYUR3TX.js";
10
10
  import {
11
11
  printMicroserviceSection,
12
12
  readMicroservices
@@ -14,35 +14,35 @@ import {
14
14
  import {
15
15
  ENV_WORKSPACE,
16
16
  getAccessToken
17
- } from "./chunk-SG4UBJ47.js";
18
- import "./chunk-LLWK6H77.js";
17
+ } from "./chunk-3QW5NFZJ.js";
18
+ import "./chunk-BKDJN76G.js";
19
19
  import "./chunk-QTNO2WD6.js";
20
20
  import "./chunk-ZUTSMMAG.js";
21
21
  import "./chunk-X4DVXBFY.js";
22
- import "./chunk-KXCPZUUM.js";
22
+ import "./chunk-DBHE35JM.js";
23
23
  import {
24
24
  isMachineOutput,
25
25
  writeJson
26
26
  } from "./chunk-NUQCEOKA.js";
27
- import "./chunk-7SISR3CS.js";
27
+ import "./chunk-4PE4ZAB7.js";
28
28
  import "./chunk-ZSYZTGJH.js";
29
29
  import {
30
30
  fetchOrExplain,
31
31
  httpFailure
32
32
  } from "./chunk-3IGNIP6R.js";
33
- import "./chunk-PXXLBXOP.js";
33
+ import "./chunk-JAVB27HL.js";
34
34
  import "./chunk-LU7TRWMC.js";
35
- import "./chunk-WGDAOOXG.js";
36
- import "./chunk-QUUB7HYK.js";
37
- import "./chunk-6DHJVLYP.js";
35
+ import "./chunk-MU3O43L2.js";
36
+ import "./chunk-P5C2YKAM.js";
37
+ import "./chunk-Q77KNEUL.js";
38
38
  import "./chunk-4BXJGVZ3.js";
39
- import "./chunk-CYJ7R3AD.js";
40
- import "./chunk-MS3BRZAZ.js";
39
+ import "./chunk-2V3JUXTF.js";
40
+ import "./chunk-CL2H2WYE.js";
41
41
  import {
42
42
  removedSubcommand,
43
43
  unknownSubcommand
44
- } from "./chunk-IVP6TS26.js";
45
- import "./chunk-MFIHIS6B.js";
44
+ } from "./chunk-JQLR64UC.js";
45
+ import "./chunk-OYMR5AMJ.js";
46
46
  import "./chunk-GNPVYOPB.js";
47
47
  import {
48
48
  formatFields,
@@ -50,12 +50,12 @@ import {
50
50
  step,
51
51
  success
52
52
  } from "./chunk-EZG76F7R.js";
53
- import "./chunk-BPEEGJJA.js";
54
- import "./chunk-F5T45NAM.js";
55
- import "./chunk-YUPQOLFX.js";
53
+ import "./chunk-FAWNUE2U.js";
54
+ import "./chunk-OKNSR7MT.js";
55
+ import "./chunk-NJGNUVXR.js";
56
56
  import "./chunk-WHOJWOSV.js";
57
57
  import "./chunk-5XZ744TS.js";
58
- import "./chunk-YUBJLB6G.js";
58
+ import "./chunk-7JDT4PBU.js";
59
59
 
60
60
  // src/emit/workspace-command.ts
61
61
  import { writeFileSync } from "fs";
@@ -69,6 +69,10 @@ async function runWorkspaceCommand(args) {
69
69
  return runExport(args);
70
70
  case "codegen":
71
71
  return runCodegenCommand(args, { kind: "workspace" });
72
+ case "branch": {
73
+ const { runBranchCommand } = await import("./branch-commands-PBQ36L4A.js");
74
+ return runBranchCommand(args);
75
+ }
72
76
  case "deploy":
73
77
  throw removedSubcommand("workspace", "deploy");
74
78
  default:
@@ -156,4 +160,4 @@ async function runExport(args) {
156
160
  export {
157
161
  runWorkspaceCommand
158
162
  };
159
- //# sourceMappingURL=workspace-command-HZS43PHJ.js.map
163
+ //# sourceMappingURL=workspace-command-X6L7HTXO.js.map
@@ -65,8 +65,10 @@ Every top-level object carries a stable `guid` — Xano's identity anchor. On a
65
65
  the engine matches an incoming object to an existing one **by guid** and updates it in
66
66
  place; no match means a new object. So re-running `export`/`deploy` on the same code maps
67
67
  cleanly onto the same workspace — **no duplicates**. By default the guid derives from the
68
- object's `name`; set an explicit `guid` to pin identity across a rename, or to adopt an
69
- existing workspace object into code.
68
+ object's `name` for a **query**, from its api group, verb, and name together, which is
69
+ the engine's own uniqueness for an endpoint, so `GET items` and `POST items` are distinct
70
+ objects and a path may repeat across groups. Set an explicit `guid` to pin identity across
71
+ a rename, or to adopt an existing workspace object into code.
70
72
 
71
73
  The opt-in **`xano.lock`** freezes the whole workspace's identities at once — every
72
74
  auto-derived guid, plus the `canonical` URL tokens of API groups and toolsets (which the
@@ -81,7 +83,8 @@ guard. Adopt it early either way: once identities have drifted, the only way bac
81
83
  Precedence at emit is always **explicit in-code value → lock entry → name derivation**.
82
84
 
83
85
  **When the lock is actually load-bearing.** Because the default derivation is deterministic
84
- — `md5("<type>:<name>")` a project that created all of its own objects can regenerate a
86
+ — `md5("<type>:<name>")`, and `md5("query:<group>|<verb>|<name>")` for a query a project
87
+ that created all of its own objects can regenerate a
85
88
  byte-identical lock from its own source. Delete that lock, release again, and the same guids
86
89
  come back: the objects match and update in place. For that project the lock is a *cache*, and
87
90
  losing it costs nothing.
@@ -12,8 +12,9 @@ What `xanots init` writes, the two frontend presets, theming, add-ons, and the S
12
12
  `--marketplace <pkg>` (repeatable, comma-separated; installs add-ons and
13
13
  registers them — below), `--force` (scaffold into a non-empty folder),
14
14
  `--no-install` (skip `npm install`).
15
- In a terminal, `init` prompts for the framework, the theme, and the AI files;
16
- every prompt has a default, so pressing enter three times is a valid answer.
15
+ In a terminal, `init` prompts for the framework and the AI files; every prompt
16
+ has a default, so pressing enter twice is a valid answer. The look is never
17
+ prompted for — it comes from the flags above, or from `xanots onboard`.
17
18
  The starter backend is empty but already compiles and deploys — grow it from the
18
19
  walkthrough in `xano/EXAMPLE.md`.
19
20
 
package/llms/fields.md CHANGED
@@ -57,6 +57,14 @@ the entry's own name. `hidden: ["created_at"]` drops columns from that expansion
57
57
  `input.list(element)` for arrays — wrap any element constructor, e.g.
58
58
  `input.list(input.text())` or `input.list(input.object({ id: f.int() }))`. Prefer the
59
59
  typed forms over `input.json()` when the shape is known.
60
+ **A file reaches a column in two steps.** `input.file` is the RAW upload (the request's
61
+ multipart/base64 bytes) and cannot be written to a file column directly: store it first —
62
+ `s.storage.create_image({ as: "img", value: ref("input.avatar"), access: "public" })`
63
+ (the request input bag is read as a dotted `ref("input.<name>")` here) — then write
64
+ `ref("img")` into the `f.image()` cell with `s.db.add`/`edit`. `access` defaults to
65
+ `"public"` (a guessable URL): pass `"private"` and hand out `s.storage.sign_private_url`
66
+ results for anything user-scoped. `create_video`/`create_audio`/`create_attachment` are
67
+ the same shape for the other file columns.
60
68
  **Typed inputs validate/coerce on bind, before your stack runs** — so reach for the
61
69
  specific type instead of hand-rolling checks. `input.email({ required: true })` rejects a
62
70
  malformed address with a 400 (and trims; add `methods: ["lower"]` to downcase) — no
@@ -5,7 +5,8 @@
5
5
  The def-object passed to each factory. `?` = optional. `input` is keyed by
6
6
  input name (`input.<type>(opts?)`); `stack` is `Statement[]` (`s.*`); `response`
7
7
  is a `ResponseDef` (see **Responses** below). Object identity is `guid?` —
8
- omit it and it derives from `name` (set it to survive a rename).
8
+ omit it and it derives from `name` (for a query, from group + verb + name; set it
9
+ to survive a rename).
9
10
 
10
11
  - `defineFunction({ name, guid?, description?, docs?, workspace?, input?, stack?, response?, tests? })`
11
12
  - `query({ name, verb, apiGroup?, guid?, auth?, input?, stack?, response?, responseType?, apiEnabled?, disabled?, cache?, description?, docs?, tests?, example? })`
package/llms/lambda.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Lambda bodies (JavaScript)
2
2
 
3
- > 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, each surface binds a different set of identifiers, and the hazards are not guessable.
3
+ > 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.
4
4
 
5
5
  **A lambda is an escape hatch, not a default.** The body runs outside the request's own
6
6
  runtime, and a workspace has a BOUNDED pool of lambda workers every lambda in it shares
package/llms/legacy.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Legacy paradigms and retired statements
2
2
 
3
- > 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. None of the retired names are authorable for new code.
3
+ > 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.
4
4
 
5
5
  Older paradigms this SDK still supports and still emits when it decodes an existing
6
6
  workspace. **Do not author these.** They are listed by name only so you recognize them
package/llms/lock.md ADDED
@@ -0,0 +1,32 @@
1
+ # Lock file
2
+
3
+ > Read when a `xano.lock` exists or should — renaming/pruning/adopting identities, seeding the lock programmatically, or asking which commands write it.
4
+
5
+ `xano.lock` pins each object's guid and each api-group/toolset canonical, so renames
6
+ stay renames (guids otherwise derive from `(type, name)`; a query's from `(api group,
7
+ verb, name)`). Created by `xanots export <entry> --lock`, auto-read once present,
8
+ committed. A query's entry is keyed by that composed identity —
9
+ `query:<group>|<verb>|<name>` — the same seed its guid derives from; a legacy
10
+ `query:<name>` entry keeps pinning and is migrated by the next locked export (the
11
+ old key drops automatically once its guid re-lands under the composed one).
12
+
13
+ - `xanots lock rename <kind> <old> <new>` — `kind` is the payload key (or `table`/`api_group`).
14
+ Run it after renaming in code; the next export emits the original guid under the new name.
15
+ - `xanots lock prune <entry-file> [keys…] --yes` — drops orphaned entries. Finding orphans
16
+ RUNS the entry's module scope (env assertions included); `--no-verify --yes <kind:name>…`
17
+ prunes named keys with no evaluation and no orphan check.
18
+ - `xanots lock adopt <live-bundle.json> [--yes]` — seed the lock from an engine
19
+ packageExport when taking over an existing workspace.
20
+ - Every lock subcommand accepts `--lock=<path>`. `rename`/`adopt` take no entry file, so
21
+ from outside the lock's directory pass `--lock` (or `--entry=<entry-file>` to derive it).
22
+ - Programmatic use: call `seedLockOverrides(readLockFile(path))` BEFORE importing any def
23
+ module — references bake guids at import time, so late seeding is a silent no-op
24
+ (`resetLockOverrides` exists for tests).
25
+
26
+ What writes the lock: `export`/`deploy` of an ENTRY FILE update it via the shared compile
27
+ step — only when a lock exists or `--lock` is passed. Nothing from a DEPLOY is written
28
+ back beyond that (an ephemeral/sandbox is a separate workspace, so its identities must
29
+ not pollute yours). The one write-back is `release --replace`, which mints fresh
30
+ identities in the workspace the lock describes: it re-pins the lock from the rebuilt
31
+ workspace, because otherwise the next release matches nothing and duplicates every
32
+ object. CI: `--frozen-lock` fails instead of changing the lock.
@@ -1,6 +1,6 @@
1
1
  # Object kinds
2
2
 
3
- > Read when you need the full catalog of authorable primitives which factory builds each, which register method takes it, and which payload key it lands under. Read it too when a `register*` call will not typecheck because the array was built by `.flatMap()`/`.concat()` across modules.
3
+ > Read when deciding WHAT to build every authorable primitive (tables, endpoints, functions, tasks, agents, MCP, realtime, microservices, …), what each is, and which factory + register method build it. Read it too when a `register*` call will not typecheck because the array was built by `.flatMap()`/`.concat()` across modules.
4
4
 
5
5
  Author with the factory, register on the Xano instance, lands under the payload key. Each line ends with a one-liner on what the primitive is.
6
6
 
@@ -27,6 +27,6 @@ Author with the factory, register on the Xano instance, lands under the payload
27
27
  - realtime_server: `realtimeServer` → `Xano.registerRealtimeServers` → payload `realtime_server` — A realtime (websocket) server: the canonical-addressed container that owns realtime channels. Off until `enabled: true`. Returns a handle with `getUrl(baseUrl)`/`getPath()` for the client's socket URL (`wss://<host>/ws/<canonical>`).
28
28
  - channel: `realtimeChannel` → `Xano.registerRealtimeChannels` → payload `channel` — A realtime channel: a joinable path on a realtime server (`rooms/{room_id}`) with typed path params, join/publish policy, a client-visible conversation transcript, and delivery semantics. Owns message handlers. Returns a handle with `getChannel(params)` for the path a client joins.
29
29
  - message: `realtimeMessage` → `Xano.registerRealtimeMessages` → payload `message` — A realtime message handler: a named message type on a channel with its own typed payload and stack — the realtime analogue of a query. Pass the `realtimeChannel()` handle as `channel` and the owning server comes with it.
30
- - microservice: `microservice` → `Xano.registerMicroservices` → payload `microservice` — A container workload deployed alongside the workspace, called from a stack with `s.microservice.request`. Two mutually exclusive shapes via `kind`: `builtin` declares containers (image/ports/resources/env/command/args) plus optional `ingresses`, and `helm` points at a chart and its `values` — passing both throws. EARLY SURFACE, expected to change — every export of a workspace declaring one prints a notice saying so. `configs`/`volumes` are typed and `@deprecated` but NOT deployable: the engine rejects an import carrying either, so `export()` fails the build rather than letting the deploy fatal. Put a value the workload reads in a container's `env`, and storage in a container's own `volumes` (`emptyDir`/`persistent`/`config`). Container names are free-form — they need not match the microservice name, which is what a stack addresses. SECRETS RIDE ALONG — `chart.values` and `registryAuth.dockerconfigjson` are carried into the bundle, and into a pulled tree, verbatim (they must be, or a pulled microservice could not be redeployed). Both are stored strings with NO deploy-time indirection: `process.env.X` in the def resolves at EXPORT and writes the literal into the bundle, so it is not a way to keep the credential out. Either leave `registryAuth` unset (public image, or a credential attached outside this workspace) or treat the bundle and any pulled tree as secret material — keep them out of git, or rotate after. Export prints a notice per microservice carrying either field; `--strict` does not promote it. For a secret a STACK reads, the mapped surface is `workspaceConfig({ env })` + `env("NAME")`.
30
+ - microservice: `microservice` → `Xano.registerMicroservices` → payload `microservice` — A container workload deployed alongside the workspace, called from a stack with `s.microservice.request`. Def shapes (`builtin` containers vs a `helm` chart) and the SECRET-handling rules its config carries: `llms/statements-calls.md`.
31
31
  - knowledge: `knowledge` → `Xano.registerKnowledge` → payload `knowledge` — Markdown the workspace's AI agents read before they act — an `agents.md` of standing instructions, a `skill`, or a `doc`. The body is a real markdown FILE via `knowledgeFile("./x.md", import.meta.url)`, and `mode` decides how much of it reaches the agent.
32
32
  - workspace: `workspaceConfig` → `Xano.registerWorkspace` → payload `workspace` — Workspace-level configuration such as default middleware chains and request-history defaults per host kind.
@@ -1,23 +1,30 @@
1
1
  # Auth, cross-object calls, and microservices
2
2
 
3
- > Read when the stack authenticates, calls another object (`s.function.run`, `s.api.request`, `s.tool.call`), or reaches a microservice.
3
+ > Read when the stack authenticates (the signup/login/token recipe is here), calls another object (`s.function.run`, `s.api.request`, `s.tool.call`), or reaches a microservice.
4
4
 
5
5
  Auth & calls:
6
6
 
7
7
  - `s.security.create_auth_token({ table, id, extras?, expiration?, as? })` — `extras` defaults to `{}`, `expiration` to `86400`s (`0` = never).
8
+ - **Marketplace first:** `@xanots/auth` registers a complete auth surface — signup/login/me endpoints plus their `user`/`account`/`event_log` tables — via `registerAuth(ws, { canonical: "authn" })`. Authentication only, not authorization. Inspect with `xanots marketplace details @xanots/auth --prompt`.
9
+ - **The auth loop end to end** — what that module implements; author it directly for a custom flow. An auth TABLE (`table({ auth: true })`) backs identity; a PUBLIC login query verifies and mints a token; every protected query names that table as `auth:` and reads the caller with `auth(...)`.
10
+ - Signup: `s.db.add({ table: users, row: { email: inp("email"), password: inp("password") } })` — the `f.password()` column hashes on write; take the submission as `input.text()` on signup AND login (see Gotchas on double-hashing).
11
+ - Login: `s.db.get({ table: users, fieldName: "email", fieldValue: inp("email"), output: ["id", "password"], as: "u" })` — the `output` naming `password` is REQUIRED (the column is `access: "internal"` and absent from the row otherwise) → `s.precondition({ expr: expr(ref("u", { safe: true }), "!=", c.null()), error: c.text("No such user."), error_type: "notfound" })` → `s.security.check_password({ text_password: inp("password"), hash_password: ref("u.password"), as: "ok" })` → precondition on `ok` → `s.security.create_auth_token({ table: users, id: ref("u.id"), as: "token" })` → `response: { token: ref("token") }`.
12
+ - Client: send it as an `Authorization: Bearer <token>` header. A `query({ auth: users })` refuses a request without a valid one before its stack runs; inside the stack `auth("id")` is the caller's row id (`response: { id: auth("id") }` is the whole `me` endpoint).
8
13
  - `s.security.create_guid({ as? })` — bind a fresh GUID string. Takes nothing else.
9
14
  - `s.function.run({ fn, input?, as?, runtime? })` / `s.function.call({ fn, input?, as? })` — run another function; `input` is keyed by the target's input names.
10
15
  - `runtime?` runs it in the BACKGROUND: `{ mode: "async-shared" }` or `{ mode: "async-dedicated", cpu?, memory?, timeout?, maxRetry? }` (resources read at dedicated only). An async call DOES NOT return the result — it dispatches and continues, so `as` binds nothing; collect with `s.await({ ids })`. Omit for a normal call. Same block on `s.ai.agent.run`.
11
- - `s.api.call({ api, input?, headers?, auth?, as? })` — invoke an endpoint. `headers` REPLACES the request headers the callee sees and takes the same shapes as `s.api.request`'s — a `{ "Name": value }` record (values may be tagged), a `string[]` of `"Name: value"` lines, or one `Value`. `auth` is `{ token, ignoreExpiration? }`: `token` must be a BARE STRING — a tagged `Value` deploys clean and then fails the run with `Param: token - Text filter requires an integer, float, string or boolean value`, since the engine stores that slot as plain text and never evaluates it. Neither slot authenticates the call today; see `llms/tests.md` for what a workflow-test run actually sees. WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`) — elsewhere it deploys clean and 500s the first real request.
16
+ - `s.api.call({ api, input?, headers?, auth?, as? })` — invoke an endpoint. `api` takes the `query()` def HANDLE (or a `{ name, guid }` pair) — a bare name is refused, because a query's identity is composed from its api group, verb, and name. `headers` REPLACES the request headers the callee sees and takes the same shapes as `s.api.request`'s — a `{ "Name": value }` record (values may be tagged), a `string[]` of `"Name: value"` lines, or one `Value`. `auth` is `{ token, ignoreExpiration? }`: `token` must be a BARE STRING — a tagged `Value` deploys clean and then fails the run with `Param: token - Text filter requires an integer, float, string or boolean value`, since the engine stores that slot as plain text and never evaluates it. Neither slot authenticates the call today; see `llms/tests.md` for what a workflow-test run actually sees. WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`) — elsewhere it deploys clean and 500s the first real request.
12
17
  - `s.api.request({ url, method?, params?, headers?, timeout?, follow_location?, verify_host?, verify_peer?, ca_certificate?, certificate?, certificate_pass?, private_key?, private_key_pass?, description?, output?, as? })` — external HTTP request (`mvp:api_request`). Ergonomic types, each also accepting a dynamic `Value`: `method` suggests the 7 verbs (GET/POST/PUT/DELETE/HEAD/OPTIONS/PATCH), `params` a plain JSON object **or** a FLAT record whose values are tagged `Value`s (`{ count: ref("count") }`, each lifted via a `set` filter — the same record-of-values shape `response: { key: value }` takes); a tagged value NESTED inside an object or array THROWS at encode, so wrap a structured body in `obj({...})`, which encodes any depth as one `const:expr2` (→ query string for GET/HEAD/OPTIONS, body otherwise), `headers` a `{ "Name": value }` record whose values may be tagged (`{ "x-api-key": env("KEY") }`, each pair joined to a `"Name: value"` line) **or** a `string[]` of full header lines — prefer a header over a `?key=` query param for a credential — a URL travels into access logs, proxies and `Referer`. ⚠ Neither spelling is envelope-safe: the `as` envelope's `request` half mirrors `url`, `params` AND `headers`, so never return it raw from a credentialed request — read `response.result`. A NAME outside the header-token charset is refused, and a LITERAL value carrying a newline is refused; a value may hold `:` and spaces (`Bearer a: b` is a valid value). A TAGGED value cannot be checked at build time, so strip CRLF from caller-controlled input before this slot. Literal pairs lead the emitted array and computed ones follow, so the wire order is not the record's key order, `timeout` a `number` in seconds (1–86400), and `follow_location`/`verify_host`/`verify_peer` booleans. `description` (Settings tab) and `output` filters (Output tab) ride the envelope. SSL cert interdependencies (certificate↔private_key, ca_certificate→verify_peer) are checked at build time when statically provable, else by the engine at runtime. The `as` result is typed as the `{request, response}` envelope (`response.status: number`, `response.result: unknown`), so `InferResponse` resolves a `ref` to it. Same typed result on `webflow.request` and `microservice.request`.
13
18
  - `s.stream.from_request({ url, method?, …tls, as? })` — streaming external HTTP request (`mvp:streaming_api_request`); same typed field surface as `s.api.request` (no description/output envelope). `url` is REQUIRED — it shares `api.request`'s engine declaration, which has no default.
14
19
  - `s.webflow.request({ path, method?, …tls, as? })` — Webflow API request (`mvp:connect_webflow_api_request`); like `s.api.request` but addressed by `path` (host is engine-supplied), and `path` is REQUIRED — the engine rejects an empty one. No `headers`: the engine builds its own from the workspace's Webflow connection and ignores an authored value.
15
20
  - `s.task.call` / `s.tool.call` / `s.trigger.call` / `s.middleware.call` / `s.addon.call` — same `{ <target>, input?, as? }` shape against the named kind. `s.task.call` and `s.trigger.call` are WORKFLOW-TEST ONLY (see Gotchas in `llms.txt`); `s.tool.call`, `s.middleware.call` and `s.addon.call` run from any stack.
16
- - `s.action.call({ action, package?, input?, as? })` / `s.action.package.call()` — invoke a marketplace action; `package` is its slug.
21
+ - `s.action.call({ actionId, input?, registry?, as? })` / `s.action.package.call({ traceId, versionId, slug, input?, registry?, as? })` — invoke an installed action. Ids are SUPPLIED, never derived from a name: an action is installed onto the instance, so its identity is assigned at install and differs per instance — read them off a call in a pulled workspace. The package form needs all three parts; they are one composite and two of them address nothing. `registry` is the action's own settings, `input` the per-call arguments.
17
22
  - `s.cloud.job({ image, command, args?, secret?, template?, await?, as? })` — launch a containerized job. `image`/`command` are REQUIRED; omitted → `Missing param`. ⚠ `await` is SECONDS (default 60), not a boolean.
18
23
  - `s.cloud.job.status({ id, as? })` · `s.cloud.job.await({ ids, timeout, as? })` — poll one job, or block on several (`ids` a list `Value`, `timeout` in seconds; both required).
19
24
 
20
25
  Microservices (the `microservice()` def and the statement that calls it):
21
26
 
27
+ - `microservice({ name, kind, … })` — two mutually exclusive shapes via `kind`: `builtin` declares containers (image/ports/resources/env/command/args) plus optional `ingresses`, and `helm` points at a chart and its `values` — passing both throws. EARLY SURFACE, expected to change — every export of a workspace declaring one prints a notice saying so. `configs`/`volumes` are typed and `@deprecated` but NOT deployable: the engine rejects an import carrying either, so `export()` fails the build rather than letting the deploy fatal. Put a value the workload reads in a container's `env`, and storage in a container's own `volumes` (`emptyDir`/`persistent`/`config`). Container names are free-form — they need not match the microservice name, which is what a stack addresses.
28
+ - SECRETS RIDE ALONG — `chart.values` and `registryAuth.dockerconfigjson` are carried into the bundle, and into a pulled tree, verbatim (they must be, or a pulled microservice could not be redeployed). Both are stored strings with NO deploy-time indirection: `process.env.X` in the def resolves at EXPORT and writes the literal into the bundle, so it is not a way to keep the credential out. Either leave `registryAuth` unset (public image, or a credential attached outside this workspace) or treat the bundle and any pulled tree as secret material — keep them out of git, or rotate after. Export prints a notice per microservice carrying either field; `--strict` does not promote it. For a secret a STACK reads, the mapped surface is `workspaceConfig({ env })` + `env("NAME")`.
22
29
  - `s.microservice.request({ host, path, port?, method?, params?, headers?, timeout?, follow_location?, as? })` — in-cluster microservice call (`mvp:microservice_request`); no TLS fields. ONLY `host`+`path` required; the rest default to the engine's values (`GET`/`{}`/`[]`/`10`/`true`), always emitted. Pass the `microservice()` DEF as `host` — it binds by NAME (how the engine resolves it), so a rename fixes every call site and the port is checked before deploy. `port?` folds into `host` as `"name:port"`: a def exposing ONE `servicePort` resolves automatically, SEVERAL requires it. A raw `"name:port"` string works, unvalidated, and is the only way to reach an instance-level microservice. `tenantDeploy: "manual"` on the def imports the row without starting the workload.
23
30
  - `s.workflow_test.call({ workflowTest, datasource?, as? })` — run another workflow test from inside one, which is the only place it runs (see Gotchas in `llms.txt`). The odd one out: NO `input` (a workflow test takes none), and it carries `datasource?` instead — same clone caveat as the kind's own field.
@@ -16,7 +16,8 @@ primary key `id`):
16
16
  - `s.db.del({ table, fieldName?, fieldValue, as? })` — delete by field match.
17
17
  - `s.db.add({ table, row?, data?, output?, as? })` — insert; `row` is a partial keyed by column.
18
18
  - A row CELL takes a tagged `Value`, a nested object of sub-keys, or a bare JS literal typed against that column: `row: { is_hidden: true, notes: "…" }` encodes exactly as `{ is_hidden: c.bool(true), notes: c.text("…") }`. The tag comes from the COLUMN, not the literal — `10` on an `f.decimal()` column is `const:decimal`, not `const:int` — so a literal contradicting its column is a compile error on a `f.*`-schema table (`{ is_hidden: "yes" }` on an `f.bool()` column) and throws at encode on a raw-`ColumnDef[]` one. An `f.enum()` column keeps its member union. A column with no literal form — obj/json/list/geo/vector/file — still needs `c.obj`/`c.array`.
19
- - `null` is accepted on EVERY column, including ones that refuse every other literal, and encodes `const:null` — a write OF null, not the same as omitting the key (omitted takes the column's type default on `add`: `[]` for a list, `{}` for obj/json, else `null`; on `edit` it is left untouched). A column's `nullable` is not consulted; the engine refuses a null it forbids.
19
+ - `null` is accepted on EVERY column, including ones that refuse every other literal, and encodes `const:null` — a write OF null, not the same as omitting the key. A column's `nullable` is not consulted at encode; the engine refuses a null it forbids.
20
+ - Omitting a key on `add` writes the column's type default — declared `default` if set, `[]` for a list, `{}` for obj/json, else `null`. That `null` is EMITTED, not what the row holds: the engine applies the column's nullability, so a `nullable` column keeps `null` and a non-nullable one lands on its type's zero value (`""`, `0`, `false`). Set the cell when the stored value matters. On `edit` an omitted key keeps its stored value.
20
21
  - An `f.password()` cell takes the PLAINTEXT — the column hashes on write, so a pre-hashed value, or a hashing filter on the cell, stores a hash of a hash that `security.check_password` can never match.
21
22
  - `s.db.edit({ table, fieldName?, fieldValue, row?, data?, output?, as? })` — update by field match.
22
23
  - `s.db.patch({ table, fieldName?, fieldValue, data, output?, as? })` — merge a partial (`data` is an object value).