@xanots/sdk 0.0.10 → 0.0.12

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 (102) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +48 -5
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/{agent-file-refresh-QNKN5RYD.js → agent-file-refresh-GQWAAOBV.js} +4 -4
  5. package/dist/bin.js +12 -11
  6. package/dist/{branch-commands-2BLOC2GR.js → branch-commands-5KMPAAZV.js} +7 -7
  7. package/dist/bundle.d.ts +218 -0
  8. package/dist/bundle.js +143 -0
  9. package/dist/{capture-4WVJY4DQ.js → capture-YLUVAITI.js} +2 -2
  10. package/dist/chunk-2VTJSI6X.js +192 -0
  11. package/dist/{chunk-5XZ744TS.js → chunk-2ZCUO2UG.js} +1 -1
  12. package/dist/{chunk-OYMR5AMJ.js → chunk-3LQGF2WS.js} +2 -2
  13. package/dist/{chunk-WP4OZZV4.js → chunk-3VFCKHOB.js} +2 -2
  14. package/dist/{chunk-XHEXOES3.js → chunk-5YDINUAP.js} +1 -1
  15. package/dist/{chunk-LU7TRWMC.js → chunk-6VNRMKFJ.js} +2 -2
  16. package/dist/{chunk-CTD5ZCV6.js → chunk-7WRJPKGK.js} +2 -2
  17. package/dist/{chunk-3INK4Y4E.js → chunk-AE3PDSDS.js} +1 -1
  18. package/dist/{chunk-5YCQ2QHH.js → chunk-AG5GCZDD.js} +2 -2
  19. package/dist/{chunk-DBFU47BJ.js → chunk-AOFFKSJC.js} +2 -2
  20. package/dist/{chunk-TCFIPDB3.js → chunk-AVGDL6RB.js} +1 -1
  21. package/dist/{chunk-4BXJGVZ3.js → chunk-DCMANKMX.js} +2 -69
  22. package/dist/{chunk-WHOJWOSV.js → chunk-EETVJZAZ.js} +1 -1
  23. package/dist/chunk-EHP3WPEG.js +21 -0
  24. package/dist/{chunk-W24FJHPD.js → chunk-ELK7UALJ.js} +3 -3
  25. package/dist/{chunk-VNQM3V2C.js → chunk-EXENFOWE.js} +2 -2
  26. package/dist/{chunk-P6TAVLOX.js → chunk-GSP2BY4F.js} +17 -10
  27. package/dist/{chunk-AIZKXUNP.js → chunk-IMLYGQK6.js} +2 -2
  28. package/dist/{chunk-LBYWGMOA.js → chunk-N74KDCBD.js} +176 -42
  29. package/dist/{chunk-3IGNIP6R.js → chunk-NDP7OUPS.js} +1 -1
  30. package/dist/chunk-OHX6MIUZ.js +184 -0
  31. package/dist/{chunk-EQW3YT5U.js → chunk-P6PVBQL6.js} +2 -2
  32. package/dist/{chunk-I7DQDJAM.js → chunk-PLE5QQOZ.js} +55 -56
  33. package/dist/chunk-PR7OXHGZ.js +70 -0
  34. package/dist/{chunk-VKSOTZK3.js → chunk-QYSQ3UDO.js} +160 -8
  35. package/dist/{chunk-ZQ2PKR6R.js → chunk-RQ3FXV4K.js} +2 -2
  36. package/dist/{chunk-Q77KNEUL.js → chunk-RQNMTDXD.js} +1703 -2
  37. package/dist/{chunk-QKM4U5UK.js → chunk-TJS2AF5Y.js} +2 -2
  38. package/dist/{chunk-DIA7CT7J.js → chunk-V5Y7D4LH.js} +11 -2
  39. package/dist/{chunk-KA6G2L7U.js → chunk-VK26K7AY.js} +3 -3
  40. package/dist/{chunk-YYFXVYPX.js → chunk-VPAWRBK5.js} +12 -16
  41. package/dist/{chunk-5R73LFWK.js → chunk-VRNZ2NVV.js} +7 -7
  42. package/dist/{chunk-ACCBOMCB.js → chunk-XT3XQ4PF.js} +32 -27
  43. package/dist/{chunk-7JDT4PBU.js → chunk-XWFRNJMQ.js} +5 -179
  44. package/dist/{chunk-7ZYW652H.js → chunk-YHS6VVLJ.js} +2 -2
  45. package/dist/{chunk-75Z74TA7.js → chunk-YX22LKQE.js} +2 -2
  46. package/dist/{chunk-F6CYJ7TN.js → chunk-Z2ZIE5CO.js} +2 -2
  47. package/dist/cli.d.ts +13 -6
  48. package/dist/cli.js +11 -10
  49. package/dist/codegen-command-Y2SPMAUW.js +47 -0
  50. package/dist/codegen.d.ts +5 -4
  51. package/dist/codegen.js +2 -2
  52. package/dist/{completion-WF46272M.js → completion-HJU5QEFB.js} +2 -2
  53. package/dist/{deploy-command-QTIVA22A.js → deploy-command-XHS5PKPV.js} +20 -19
  54. package/dist/{ephemeral-command-U4AQ3TXX.js → ephemeral-command-2NKPEXUU.js} +8 -8
  55. package/dist/index.d.ts +88 -102
  56. package/dist/index.js +13 -12
  57. package/dist/init-command-23FFNUFT.js +32 -0
  58. package/dist/internal.d.ts +10 -16
  59. package/dist/internal.js +76 -54
  60. package/dist/io-UBDMMDH6.js +12 -0
  61. package/dist/{live-diff-IXKBVG4K.js → live-diff-HCOTN5WC.js} +3 -3
  62. package/dist/{lock-GFXD6G2E.js → lock-HQ4KARU2.js} +3 -2
  63. package/dist/{lock-commands-DQ7CUMIV.js → lock-commands-WCRC56ME.js} +12 -11
  64. package/dist/{login-command-Z6CHTA57.js → login-command-P7LXD5TE.js} +6 -6
  65. package/dist/{loop-D5NPL4VH.js → loop-IC5ISSYB.js} +3 -3
  66. package/dist/{marketplace-command-P4IPLJ6J.js → marketplace-command-T6JCHW7J.js} +4 -4
  67. package/dist/{meta-client-K2J4XH64.js → meta-client-LKRKR3L2.js} +4 -4
  68. package/dist/node.d.ts +6 -5
  69. package/dist/node.js +18 -17
  70. package/dist/{preflight-command-GZ2GE5RN.js → preflight-command-TZWPHBXY.js} +17 -16
  71. package/dist/{profile-command-LJSBDV2L.js → profile-command-WBNSMQSI.js} +3 -3
  72. package/dist/{release-command-YUBTNHVX.js → release-command-WEFYRTCI.js} +27 -26
  73. package/dist/response-D6xGLEIn.d.ts +839 -0
  74. package/dist/{routes-manifest-PWZHDOI5.js → routes-manifest-5ZFKUQWA.js} +2 -2
  75. package/dist/{runtime-V4C3AC3A.js → runtime-LSLIDALK.js} +1 -1
  76. package/dist/scaffold.d.ts +16 -8
  77. package/dist/scaffold.js +7 -11
  78. package/dist/{static-host-3WMV7IZO.js → static-host-4JDQCHUW.js} +1 -1
  79. package/dist/{status-command-AL47VG7H.js → status-command-VARULAR5.js} +4 -4
  80. package/dist/{store-BG1UPZ3Z.d.ts → store-DAnUIi1T.d.ts} +95 -87
  81. package/dist/{test-command-YAZLKLGQ.js → test-command-YCAR4O35.js} +7 -7
  82. package/dist/{upgrade-command-FB5QJ363.js → upgrade-command-GYEIMJBG.js} +16 -16
  83. package/dist/{workspace-2COHDBM3.js → workspace-33KHFLX3.js} +2 -2
  84. package/dist/{workspace-command-43P42FBP.js → workspace-command-2ZTGT26W.js} +28 -27
  85. package/dist/{workspace-export-DURY5WYL.js → workspace-export-MLYTYZS5.js} +3 -3
  86. package/dist/{response-CVAE2kMj.d.ts → xdo-ODuJklk6.d.ts} +28 -860
  87. package/guides/authoring.md +11 -2
  88. package/guides/typed-frontend.md +5 -5
  89. package/llms/filters.md +11 -10
  90. package/llms/kinds-core.md +1 -1
  91. package/llms/statements-data.md +6 -3
  92. package/llms/values.md +1 -1
  93. package/llms-full.txt +53 -42
  94. package/llms.txt +34 -27
  95. package/manifest.json +6 -2
  96. package/package.json +7 -2
  97. package/dist/chunk-ANUDXFEX.js +0 -881
  98. package/dist/chunk-JGCWTCA7.js +0 -95
  99. package/dist/chunk-YBC3IKMF.js +0 -845
  100. package/dist/codegen-command-GB3H2KQ7.js +0 -46
  101. package/dist/init-command-MAXULNAD.js +0 -33
  102. package/dist/io-M7XZEMK7.js +0 -11
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  defineFunction,
3
3
  fileUrl
4
- } from "./chunk-XHEXOES3.js";
4
+ } from "./chunk-5YDINUAP.js";
5
5
  import {
6
6
  TEST_EXPECT_TYPES,
7
7
  expect
8
- } from "./chunk-75Z74TA7.js";
8
+ } from "./chunk-YX22LKQE.js";
9
9
  import {
10
10
  addon,
11
11
  agent,
@@ -17,7 +17,7 @@ import {
17
17
  task,
18
18
  tool,
19
19
  workflowTest
20
- } from "./chunk-5R73LFWK.js";
20
+ } from "./chunk-VRNZ2NVV.js";
21
21
  import {
22
22
  actionCall,
23
23
  actionPackageCall,
@@ -100,11 +100,11 @@ import {
100
100
  workflowTestCall,
101
101
  workspaceConfig,
102
102
  workspaceTrigger
103
- } from "./chunk-P6TAVLOX.js";
103
+ } from "./chunk-GSP2BY4F.js";
104
104
  import {
105
105
  Xano,
106
106
  workspace
107
- } from "./chunk-VKSOTZK3.js";
107
+ } from "./chunk-QYSQ3UDO.js";
108
108
  import {
109
109
  LAMBDA_BINDINGS,
110
110
  LAMBDA_CODE_FILTERS,
@@ -148,16 +148,17 @@ import {
148
148
  toSearchParams,
149
149
  toolset,
150
150
  withFilters
151
- } from "./chunk-LBYWGMOA.js";
152
- import "./chunk-WHOJWOSV.js";
153
- import {
154
- annotate,
155
- statements
156
- } from "./chunk-5XZ744TS.js";
151
+ } from "./chunk-N74KDCBD.js";
152
+ import "./chunk-EETVJZAZ.js";
157
153
  import {
158
154
  resetLockOverrides,
159
155
  seedLockOverrides
160
- } from "./chunk-7JDT4PBU.js";
156
+ } from "./chunk-XWFRNJMQ.js";
157
+ import {
158
+ annotate,
159
+ statements
160
+ } from "./chunk-2ZCUO2UG.js";
161
+ import "./chunk-OHX6MIUZ.js";
161
162
  export {
162
163
  LAMBDA_BINDINGS,
163
164
  LAMBDA_CODE_FILTERS,
@@ -0,0 +1,32 @@
1
+ import {
2
+ projectShellFiles,
3
+ resolveFromSource,
4
+ runInitCommand,
5
+ sanitizeAppName
6
+ } from "./chunk-VPAWRBK5.js";
7
+ import {
8
+ resolveAiFlags
9
+ } from "./chunk-VK26K7AY.js";
10
+ import "./chunk-ZSYZTGJH.js";
11
+ import "./chunk-RQNMTDXD.js";
12
+ import "./chunk-XT3XQ4PF.js";
13
+ import "./chunk-7WRJPKGK.js";
14
+ import "./chunk-3LQGF2WS.js";
15
+ import "./chunk-Z2ZIE5CO.js";
16
+ import "./chunk-GNPVYOPB.js";
17
+ import "./chunk-EZG76F7R.js";
18
+ import "./chunk-QYSQ3UDO.js";
19
+ import "./chunk-V5Y7D4LH.js";
20
+ import "./chunk-N74KDCBD.js";
21
+ import "./chunk-EETVJZAZ.js";
22
+ import "./chunk-XWFRNJMQ.js";
23
+ import "./chunk-2ZCUO2UG.js";
24
+ import "./chunk-OHX6MIUZ.js";
25
+ export {
26
+ projectShellFiles,
27
+ resolveAiFlags,
28
+ resolveFromSource,
29
+ runInitCommand,
30
+ sanitizeAppName
31
+ };
32
+ //# sourceMappingURL=init-command-23FFNUFT.js.map
@@ -1,24 +1,19 @@
1
- import { F as FunctionXdo } from './response-CVAE2kMj.js';
2
- export { a as FIELD_METHODS, R as REFERENCEABLE_KINDS, d as deriveGuid, e as encodeResponse, b as encodeStatement, g as getStatementFactory, i as isRegisteredStatement, r as resolveRef, t as toNestedFields } from './response-CVAE2kMj.js';
3
- import { S as StatementSpec, F as FunctionDef, O as ObjectKind } from './store-BG1UPZ3Z.js';
4
- export { A as AdoptChange, a as AdoptResult, B as Bundle, b as BundlePayload, c as BundleType, d as FILTER_NAMES, G as GENERATED_STATEMENT_NAMES, K as KNOWLEDGE_DIR, e as KNOWLEDGE_FILE, L as LLMS_TXT, f as LOCK_VERSION, g as LockEntry, h as LockExportContext, i as LockFile, M as Manifest, j as ManifestField, k as ManifestKind, l as ManifestStatement, m as MergeResult, P as PAYLOAD_ARRAY_KEYS, n as PayloadArrayKey, Q as QUERY_EXPRESSION_FILTERS, R as RenameResult, T as TOTAL_OBJECT_KINDS, V as VECTOR_FILTERS, W as WORKSPACE_KEY, o as addonKind, p as adoptFromBundle, q as agentKind, r as apiGroupKind, s as buildBundle, t as buildManifest, u as buildMiddlewareBlock, v as buildWorkspaceHistory, w as calcSignatureJson, x as channelPathParams, y as createLockContext, z as declaredServicePorts, C as emptyLock, D as encodeAddon, E as encodeAgent, H as encodeApiGroup, I as encodeColumn, J as encodeContainerHistory, N as encodeFromSpec, U as encodeHistory, X as encodeIndex, Y as encodeKnowledge, Z as encodeMcpServer, _ as encodeMicroservice, $ as encodeMiddleware, a0 as encodeMiddlewareEntry, a1 as encodeMiddlewareList, a2 as encodeObject, a3 as encodeQuery, a4 as encodeRealtimeChannel, a5 as encodeRealtimeMessage, a6 as encodeRealtimeServer, a7 as encodeSchedule, a8 as encodeTable, a9 as encodeTask, aa as encodeTool, ab as encodeToolRefs, ac as encodeToolsetBase, ad as encodeTrigger, ae as encodeView, af as encodeWorkflowTest, ag as encodeWorkspaceConfig, ah as generatedStatements, ai as getKind, aj as getLockedCanonical, ak as getLockedGuid, al as isKnowledgeDirSource, am as isKnowledgeFileSource, an as isLockSeeded, ao as isQueryExpressionFilter, ap as isRegisteredKind, aq as knowledgeKind, ar as lockKey, as as mcpServerKind, at as mergeObserved, au as microserviceKind, av as middlewareKind, aw as mintCanonical, ax as parseLock, ay as phpJsonEncode, az as queryKind, aA as realtimeChannelGuid, aB as realtimeChannelKind, aC as realtimeMessageGuid, aD as realtimeMessageKind, aE as realtimeServerKind, aF as recordObserved, aG as registerKind, aH as registerSpec, aI as registeredKinds, aJ as renameLockEntry, aK as renderDocs, aL as renderLlmsTxt, aM as resolveAuthRef, aN as resolvePayloadKey, aO as resolveRealtimeServerCanonical, aP as resolveToolsetCanonical, aQ as serializeBundle, aR as serializeLock, aS as tableKind, aT as taskKind, aU as toolKind, aV as triggerKind, aW as validateLockModel, aX as workflowTestKind, aY as workspaceKind } from './store-BG1UPZ3Z.js';
1
+ export { F as FIELD_METHODS, R as REFERENCEABLE_KINDS, d as deriveGuid, e as encodeResponse, a as encodeStatement, g as getStatementFactory, i as isRegisteredStatement, r as resolveRef, t as toNestedFields } from './response-D6xGLEIn.js';
2
+ import { S as StatementSpec, F as FunctionDef, O as ObjectKind } from './store-DAnUIi1T.js';
3
+ export { A as AdoptChange, a as AdoptResult, B as Bundle, b as BundlePayload, c as BundleType, d as FILTER_NAMES, G as GENERATED_STATEMENT_NAMES, K as KNOWLEDGE_DIR, e as KNOWLEDGE_FILE, L as LLMS_TXT, f as LOCK_VERSION, g as LockEntry, h as LockExportContext, i as LockFile, M as Manifest, j as ManifestField, k as ManifestKind, l as ManifestStatement, m as MergeResult, P as PAYLOAD_ARRAY_KEYS, n as PayloadArrayKey, Q as QUERY_EXPRESSION_FILTERS, R as RenameResult, T as TOTAL_OBJECT_KINDS, V as VECTOR_FILTERS, W as WORKSPACE_KEY, o as addonKind, p as adoptFromBundle, q as agentKind, r as apiGroupKind, s as buildBundle, t as buildManifest, u as buildMiddlewareBlock, v as buildWorkspaceHistory, w as calcSignatureJson, x as channelPathParams, y as createLockContext, z as declaredServicePorts, C as emptyLock, D as encodeAddon, E as encodeAgent, H as encodeApiGroup, I as encodeColumn, J as encodeContainerHistory, N as encodeFromSpec, U as encodeHistory, X as encodeIndex, Y as encodeKnowledge, Z as encodeMcpServer, _ as encodeMicroservice, $ as encodeMiddleware, a0 as encodeMiddlewareEntry, a1 as encodeMiddlewareList, a2 as encodeObject, a3 as encodeQuery, a4 as encodeRealtimeChannel, a5 as encodeRealtimeMessage, a6 as encodeRealtimeServer, a7 as encodeSchedule, a8 as encodeTable, a9 as encodeTask, aa as encodeTool, ab as encodeToolRefs, ac as encodeToolsetBase, ad as encodeTrigger, ae as encodeView, af as encodeWorkflowTest, ag as encodeWorkspaceConfig, ah as generatedStatements, ai as getKind, aj as getLockedCanonical, ak as getLockedGuid, al as isKnowledgeDirSource, am as isKnowledgeFileSource, an as isLockSeeded, ao as isQueryExpressionFilter, ap as isRegisteredKind, aq as knowledgeKind, ar as lockKey, as as mcpServerKind, at as mergeObserved, au as microserviceKind, av as middlewareKind, aw as mintCanonical, ax as parseLock, ay as phpJsonEncode, az as queryKind, aA as realtimeChannelGuid, aB as realtimeChannelKind, aC as realtimeMessageGuid, aD as realtimeMessageKind, aE as realtimeServerKind, aF as recordObserved, aG as registerKind, aH as registerSpec, aI as registeredKinds, aJ as renameLockEntry, aK as renderDocs, aL as renderLlmsTxt, aM as resolveAuthRef, aN as resolvePayloadKey, aO as resolveRealtimeServerCanonical, aP as resolveToolsetCanonical, aQ as serializeBundle, aR as serializeLock, aS as tableKind, aT as taskKind, aU as toolKind, aV as triggerKind, aW as validateLockModel, aX as workflowTestKind, aY as workspaceKind } from './store-DAnUIi1T.js';
4
+ import { F as FunctionXdo } from './xdo-ODuJklk6.js';
5
5
 
6
6
  /**
7
- * AUTO-GENERATED by scripts/codegen.ts DO NOT EDIT BY HAND.
8
- *
9
- * The declarative statement catalog (U9): one StatementSpec per cleanly
7
+ * The declarative statement catalog: one StatementSpec per cleanly
10
8
  * interpretable statement schema, generated from the Xano engine's statement
11
9
  * schema definitions. The engine-only `output` flag is pinned from the
12
- * persisted golden fixtures (KTD-4). Regenerate with `npm run codegen`.
13
- *
14
- * Coverage: 153 declarative statements generated.
15
- * Deferred (see PENDING.md): 63.
10
+ * persisted golden fixtures.
16
11
  */
17
12
 
18
13
  declare const GENERATED_SPECS: StatementSpec[];
19
14
 
20
15
  /**
21
- * The `function` object kind (KTD-2). This is the MVP's `compile()` envelope
16
+ * The `function` object kind. This is the MVP's `compile()` envelope
22
17
  * logic, re-homed as the first registered kind. Behavior is unchanged — the
23
18
  * MVP golden test is the regression guard.
24
19
  */
@@ -39,15 +34,14 @@ declare const functionKind: ObjectKind<FunctionDef, FunctionXdo>;
39
34
  * `mvp:microservice_request` and the engine files its schema under the `api`
40
35
  * namespace, but a microservice is a first-class workspace object here — with
41
36
  * its own def factory and deploy path — so its call statement is filed beside
42
- * it. The same decision is recorded as a `NAMESPACE_OVERRIDES` entry in
43
- * `scripts/codegen.ts`, which is what keeps the generated factory tree in
44
- * agreement with this key.
37
+ * it. The same decision is mirrored in codegen, which is what keeps the
38
+ * generated factory tree in agreement with this key.
45
39
  *
46
40
  * A second entry does the same: `lambda` is stored as `mvp:lambda` and the
47
41
  * engine files its schema under the `api` namespace, but a lambda runs wherever
48
42
  * a stack runs — in functions, tasks, middleware, and triggers, not only APIs —
49
43
  * so filing it under `s.api.*` said something false about where it is available
50
- * (issue #221). It is `s.lambda`, with the matching `NAMESPACE_OVERRIDES` entry.
44
+ *. It is `s.lambda`, with the matching `NAMESPACE_OVERRIDES` entry.
51
45
  *
52
46
  * One surface-pair shares a stored name (so the catalog has one fewer unique
53
47
  * stored name than surfaces): `util.get_raw_input`/`util.get_input` →
package/dist/internal.js CHANGED
@@ -1,11 +1,7 @@
1
1
  import {
2
2
  FIELD_METHODS,
3
- IMPLEMENTED_STATEMENTS,
4
- STATEMENT_SURFACES,
5
- SUPERSEDED_STATEMENTS,
6
- TOTAL_STATEMENTS,
7
- sPathOf
8
- } from "./chunk-4BXJGVZ3.js";
3
+ SUPERSEDED_STATEMENTS
4
+ } from "./chunk-PR7OXHGZ.js";
9
5
  import {
10
6
  addonKind,
11
7
  agentKind,
@@ -33,7 +29,7 @@ import {
33
29
  taskKind,
34
30
  toolKind,
35
31
  workflowTestKind
36
- } from "./chunk-5R73LFWK.js";
32
+ } from "./chunk-VRNZ2NVV.js";
37
33
  import {
38
34
  GENERATED_SPECS,
39
35
  GENERATED_STATEMENT_NAMES,
@@ -55,7 +51,13 @@ import {
55
51
  registerSpec,
56
52
  triggerKind,
57
53
  workspaceKind
58
- } from "./chunk-P6TAVLOX.js";
54
+ } from "./chunk-GSP2BY4F.js";
55
+ import {
56
+ IMPLEMENTED_STATEMENTS,
57
+ STATEMENT_SURFACES,
58
+ TOTAL_STATEMENTS,
59
+ sPathOf
60
+ } from "./chunk-DCMANKMX.js";
59
61
  import {
60
62
  COMMANDS,
61
63
  FLAGS,
@@ -63,7 +65,7 @@ import {
63
65
  flagKey,
64
66
  flagSummary,
65
67
  visibleFlags
66
- } from "./chunk-DIA7CT7J.js";
68
+ } from "./chunk-V5Y7D4LH.js";
67
69
  import {
68
70
  DECODE_ONLY_STATEMENTS,
69
71
  FILTER_NAMES,
@@ -109,13 +111,8 @@ import {
109
111
  serializeBundle,
110
112
  tableKind,
111
113
  toNestedFields
112
- } from "./chunk-LBYWGMOA.js";
113
- import "./chunk-WHOJWOSV.js";
114
- import {
115
- encodeStatement,
116
- getStatementFactory,
117
- isRegisteredStatement
118
- } from "./chunk-5XZ744TS.js";
114
+ } from "./chunk-N74KDCBD.js";
115
+ import "./chunk-EETVJZAZ.js";
119
116
  import {
120
117
  LOCK_VERSION,
121
118
  REFERENCEABLE_KINDS,
@@ -137,7 +134,13 @@ import {
137
134
  resolveRef,
138
135
  serializeLock,
139
136
  validateLockModel
140
- } from "./chunk-7JDT4PBU.js";
137
+ } from "./chunk-XWFRNJMQ.js";
138
+ import {
139
+ encodeStatement,
140
+ getStatementFactory,
141
+ isRegisteredStatement
142
+ } from "./chunk-2ZCUO2UG.js";
143
+ import "./chunk-OHX6MIUZ.js";
141
144
 
142
145
  // src/statements/byte-evidence.ts
143
146
  var UNCONFIRMED_STATEMENTS = /* @__PURE__ */ new Set([]);
@@ -313,7 +316,7 @@ var VALUE_CONSTRUCTORS = [
313
316
  { name: "c.expression", signature: "(source: string) => Value", description: `Xano Expression Engine source, passed through VERBATIM \u2192 tag "const:expr2". The string IS the expression: c.expression('"Hi, " ~ $input.name'), c.expression("$var.price * $var.qty"). \u26A0\uFE0F NOT VALIDATED \u2014 never parsed or type-checked, invisible to InferResponse, and untouched by a rename that updates every typed ref(); a typo surfaces at runtime or as a wrong answer. Use it ONLY for syntax the typed surfaces cannot express (~ concatenation, inline arithmetic, conditionals) \u2014 prefer ref/inp/col, withFilters+fl.*, and obj() (which BUILDS a checked expression). Not the expr() condition builder.` },
314
317
  { name: "c.expressionLegacy", signature: "(source: string) => Value", legacy: true, description: "the older `const:expr` expression form, emitted by codegen for workspaces that still hold one \u2014 author `c.expression` instead." },
315
318
  { name: "c.now", signature: "() => Value", description: "Current time as epoch-ms \u2014 the engine-native const:epochms constant (no filter). Valid inline as a where/cmp operand. For cutoff math (cutoff = now - max_age) either compare inline or, for reuse/readability, hoist it into an s.set_var and compare against the var." },
316
- { name: "obj", signature: "(fields: Record<string, Value | nested>) => ObjValue<typeof fields>", description: 'Dynamic object value \u2192 tag "const:expr2" (an object-literal expression string). The dynamic sibling of c.obj: members may be inp/ref/auth/col values, env()/setting()/sys.*, c.now(), c.* constants, nested records, or arrays \u2014 and each member may carry a FILTER CHAIN (withFilters + fl.*), which renders as the expression pipe `$var.row|get:"a.b"`. That matters most for the null-safe drill: db.get binds null on a miss, so ref(path, { safe: true }) inside an obj() is the normal shape, not a workaround \u2014 you do NOT need a preceding s.set_var to hoist it. The member record rides the return type, so InferResponse resolves each member the way it resolves a top-level response key \u2014 `response: { user: obj({ id: ref("row.id") }) }` derives `{ user: { id: Col | null } }`, and a raw nested object literal (`response: { user: { id: ref("row.id") } }`, auto-wrapped through this) derives the same. NEST WITH A RAW RECORD, not an inner obj() call: an inner call yields a const:expr2 value, which the expression serializer has no spelling for and THROWS. Still rejected: a filter ARGUMENT carrying its own chain (a trailing | binds to the whole value, not one argument), a DISABLED filter (an expression string cannot record that), and the output/response/toolset/reg tags \u2014 build those in a prior step and ref() them. Use for e.g. s.ai.agent.run args.' },
319
+ { name: "obj", signature: "(fields: Record<string, Value | nested>) => ObjValue<typeof fields>", description: 'Dynamic object value \u2192 tag "const:expr2" (an object-literal expression string). The dynamic sibling of c.obj: members may be inp/ref/auth/col values, env()/setting()/sys.*, c.now(), c.* constants, nested records, or arrays \u2014 and each member may carry a FILTER CHAIN (withFilters + fl.*), which renders as the expression pipe `$var.row|get:"a.b"`. That matters most for the null-safe drill: db.get binds null on a miss, so ref(path, { safe: true }) inside an obj() is the normal shape, not a workaround \u2014 you do NOT need a preceding s.set_var to hoist it. The member record rides the return type, so InferResponse resolves each member the way it resolves a top-level response key \u2014 `response: { user: obj({ id: ref("row.id") }) }` derives `{ user: { id: Col | null } }`, and a raw nested object literal (`response: { user: { id: ref("row.id") } }`, auto-wrapped through this) derives the same. A constant record or list has two spellings that both work and render identically: bare (`{ a: 1 }`, `[]`) or `c.obj(...)`/`c.array([...])` \u2014 prefer the bare form. NEST WITH A RAW RECORD, not an inner obj() call: an inner call yields a const:expr2 value, which the expression serializer has no spelling for and THROWS. The legacy blank `c.obj(null)` is refused here (it evaluates to null, not {}) \u2014 write c.null() or c.obj(). Still rejected: a filter ARGUMENT that carries its own chain or is a c.now() (a trailing | binds to the whole value, not one argument, and c.now() needs one), a DISABLED filter (an expression string cannot record that), and the output/response/toolset/reg tags \u2014 build those in a prior step and ref() them. Use for e.g. s.ai.agent.run args.' },
317
320
  { name: "ref", signature: "(name: string, opts?: { safe?: boolean }) => Value", description: 'Reference a stack variable \u2192 tag "var". Pass { safe: true } for null-safe nested access \u2014 a dotted ref("owner.user_id", { safe: true }) compiles through the get filter so it resolves to null instead of raising "Unable to locate var" when the base is null.' },
318
321
  {
319
322
  name: "inp",
@@ -541,6 +544,14 @@ var FILTER_NOTES = {
541
544
  ends_with: "piped value is the subject text; the arg is the substring searched for",
542
545
  starts_with: "piped value is the subject text; the arg is the substring searched for",
543
546
  icontains: "case-insensitive; piped value is the subject, the arg is the substring",
547
+ // The regex family REVERSES that direction, which is the whole reason it needs
548
+ // its own note: the pattern is piped and the subject is the argument. Written
549
+ // the other way round it reads correctly, type-checks, and answers false for
550
+ // every input, so the note has to state the order and the symptom.
551
+ regex_test: 'piped value is the PATTERN (build it with `c.regex(...)`); the arg is the subject \u2014 the REVERSE of `contains`/`starts_with`. Swapped, it answers false for every input with no error, so write `withFilters(c.regex("^a+$"), fl.regex_test(inp("s")))` (or name the arg: `fl.regex_test({ subject: inp("s") })`). A pattern found in the subject slot is refused at build time',
552
+ regex_match: "piped value is the PATTERN, the arg is the subject \u2014 see `regex_test`",
553
+ regex_match_all: "piped value is the PATTERN, the arg is the subject \u2014 see `regex_test`",
554
+ regex_replace: "piped value is the PATTERN, `subject` is the text searched \u2014 see `regex_test`. The replacement comes FIRST",
544
555
  iends_with: "case-insensitive; piped value is the subject, the arg is the substring",
545
556
  istarts_with: "case-insensitive; piped value is the subject, the arg is the substring",
546
557
  // "empty" is a specific set of values, not just null.
@@ -804,17 +815,19 @@ function renderSections(m) {
804
815
  `Coverage: object kinds ${m.coverage.objectKinds.implemented}/${m.coverage.objectKinds.total}, statement surfaces ${m.coverage.statements.implemented}/${m.coverage.statements.total}, filters ${m.coverage.filters.total} (${m.coverage.filters.typed} typed).`,
805
816
  // The shortfall by name: an agent that cannot see WHICH kinds are missing
806
817
  // will invent a factory for one. Reasons live in `manifest.json`.
807
- `Not authorable here: ${m.coverage.objectKinds.unmodeled.map((k) => k.kind).join(", ")} \u2014 these cannot be authored and do not survive a pull; see \`coverage.objectKinds.unmodeled\` in \`manifest.json\`.`,
818
+ `Not authorable here: ${m.coverage.objectKinds.unmodeled.map((k) => k.kind).join(", ")} \u2014 these cannot be authored and do not survive a pull; reasons in \`coverage.objectKinds.unmodeled\`.`,
808
819
  "",
809
820
  "This file is the whole always-read surface: the mental model, the deploy contract,",
810
821
  "every gotcha, and control flow. Per-surface detail lives in the topic files listed",
811
- "below \u2014 open the one whose condition matches the task, and skip the rest. For",
812
- "exhaustive per-entry detail in NEITHER \u2014 a statement's full field schema with engine",
813
- "defaults, a filter's complete argument list, the engine `storedName` mapping \u2014 do a",
814
- "TARGETED lookup in the shipped `manifest.json` (grep or `jq` the one entry you need;",
815
- "it is ~65k tokens, so never read it whole). Its top-level keys are `" + Object.keys(m).join("`, `") + "`. `statements` and `filters` are ARRAYS, not maps \u2014 SELECT, do not index:",
822
+ "below \u2014 open the one whose condition matches the task, skip the rest. For",
823
+ "exhaustive per-entry detail in NEITHER \u2014 a statement's field schema with engine",
824
+ "defaults, a filter's full argument list, the `storedName` mapping \u2014 do a TARGETED",
825
+ "lookup in the shipped `manifest.json` (a program imports it as",
826
+ '`@xanots/sdk/manifest.json`, needing `with { type: "json" }` in Node ESM;',
827
+ "it is ~60k tokens, so never read it whole). Its top-level keys are `" + Object.keys(m).join("`, `") + "`. `statements` and `filters` are ARRAYS, not maps \u2014 SELECT, do not index:",
816
828
  ` jq '.statements[] | select(.sPath=="db.get")' manifest.json`,
817
829
  ` jq '.filters[] | select(.name=="json_decode")' manifest.json`,
830
+ `\u26A0 \`fields\` is null on the ${m.statements.filter((st) => st.declarative !== true).length} \`declarative: false\` statements (\`db.get\`, \u2026): typed wrappers whose arguments are the factory's \`.d.ts\` signature. Null \u2260 missing.`,
818
831
  `Select a statement on \`sPath\` (the \`s.*\` path you write), NOT \`surface\` (the XanoScript term): ${m.statements.filter((s) => s.surface !== s.sPath).length} of ${m.statements.length} differ \u2014 \`var\`\u2192\`set_var\`, \`break\`\u2192\`foreach_break\`, \`foreach.remove\`\u2192\`foreach_remove\`, and every \`expect.*\`.`,
819
832
  "",
820
833
  NAVIGATION_SLOT
@@ -1034,6 +1047,10 @@ function renderSections(m) {
1034
1047
  ' check-in \u2014 use `db.query({ where: [expr(col("habit"), "=", ...), expr(col("date"), "=", ...)], as })`',
1035
1048
  " (a `where` array is ANDed) and branch on the result, rather than pushing the",
1036
1049
  " check to the client.",
1050
+ "- **A column named `run` is reserved.** The table deploys and reads back fine, then",
1051
+ " EVERY `s.db.add` into it 400s \u2014 at any column type, with or without a value \u2014 and",
1052
+ " the error names the column while complaining about the VALUE. Use `run_id`. Exact,",
1053
+ " case-sensitive, one name: `Run`/`runs`/`run_id` are fine. `--strict` fails on it.",
1037
1054
  "- **System columns are auto-injected.** `id` + `created_at` are prepended to",
1038
1055
  " every table (`system: true` by default); declaring them by hand is redundant.",
1039
1056
  ' `id` is an `int` PK by default; pass `idType: "uuid"` on the table for a uuid key.',
@@ -1088,18 +1105,19 @@ function renderSections(m) {
1088
1105
  " `xanots export`/`deploy` CLI path. Seed rows are never emitted into the bundle",
1089
1106
  " either way; only `deploy` ships them. The `node:fs` writers",
1090
1107
  " (`writeBundle`/`writeArtifact`) and lock-file I/O import from `@xanots/sdk/node`,",
1091
- " NOT the browser-safe `@xanots/sdk` entry (which a frontend can import query",
1092
- " defs from to use `getPath()`/`InferInput` with no Node built-ins in the bundle).",
1108
+ " NOT the browser-safe `@xanots/sdk` entry (a frontend imports defs from it for",
1109
+ " `getPath()`/`InferInput`).",
1093
1110
  " The compiler machinery (per-kind `encode*`, the registries, the bundle serializer,",
1094
1111
  " the lock model) is on `@xanots/sdk/internal` and is never needed to author.",
1112
+ " READING a bundle back is `@xanots/sdk/bundle` \u2014 a statement walker (`2.if.0` paths),",
1113
+ " a structural hash, `mvp:*` catalog, `tableRefOf`.",
1095
1114
  "- **Client bundle size / tree-shaking.** `@xanots/sdk` is `sideEffects: false` and pulls",
1096
1115
  " no Node built-ins, so a bundler drops unused SDK exports. But importing a **def** for its",
1097
1116
  " `getPath()`/`verb`/`getUrl()`/`getChannel()` also pulls whatever its `stack` references:",
1098
1117
  " the `s.*`/`c.*` factory CALLS run at module load to BUILD it. Types are free.",
1099
- " \u26A0 A FLOOR \u2014 **~289 kB minified (~57 kB gzipped)** for the FIRST def; splitting modules",
1118
+ " \u26A0 A FLOOR \u2014 **~267 kB minified (~65 kB gzipped)** for the FIRST def; splitting modules",
1100
1119
  " never removes it. The floor is the RUNTIME, not the def: a second def, or a much richer",
1101
- " one, adds ~1 kB. So the cost is paid by importing ANY def at all, and reducing what a",
1102
- " def does will not reduce it.",
1120
+ " one, adds ~2 kB \u2014 so reducing what a def does will not reduce it.",
1103
1121
  " Fix: `xanots routes <entry> --emit xano/routes.gen.ts` (`paths` is an accepted alias) \u2014 verbs, paths, and sockets as",
1104
1122
  ' plain data importing NOTHING, still compile-checked: `routePath("blog/{slug}", { slug })`,',
1105
1123
  ' `channelPath("rooms/{room_id}", { room_id })`, `socketUrl("chat", baseUrl)` (tenant base',
@@ -1153,17 +1171,18 @@ function renderSections(m) {
1153
1171
  " return.",
1154
1172
  "- **Build regex-filter patterns with `c.regex(body, flags?)`, never `c.text`.**",
1155
1173
  " The regex filters (`regex_test`/`regex_match`/`regex_replace`/\u2026) are pattern-piped",
1156
- " PHP `preg_*`: the piped value is the PATTERN and must be delimiter-wrapped. A bare",
1157
- ' `c.text("^[^@\\s]+@...$")` is an invalid pattern that matches *nothing* for every',
1158
- " input, so a precondition on it silently rejects all values (valid ones included).",
1159
- ' `c.regex("^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$", "i")` wraps + escapes it for you (accepts a',
1160
- " JS `RegExp` too: `c.regex(/^\u2026$/i)`), and `withFilters` throws on a bare `c.text`",
1161
- " pattern pointing here \u2014 from ANY position in the chain, so a normalizer in front",
1162
- ' (`withFilters(c.text("^hi"), fl.trim(), fl.regex_test(...))`) is refused too; nothing',
1163
- " upstream adds the delimiters. `s.expect.to_match`'s `value` is the same PATTERN slot,",
1164
- " refused the same way; a `ref`/`inp` pattern is passed through untouched, either place.",
1165
- " Better still, prefer a native typed input",
1166
- " (`input.email({...})`) over hand-rolled validation.",
1174
+ " PHP `preg_*`: the piped value is the PATTERN and must be delimiter-wrapped, and the",
1175
+ ' ARGUMENT is the subject. A bare `c.text("^\u2026$")` is an invalid pattern that matches',
1176
+ " *nothing* for every input, so a precondition on it silently rejects all values.",
1177
+ ' `c.regex(body, "i")` wraps + escapes it for you (a JS `RegExp` too: `c.regex(/^\u2026$/i)`).',
1178
+ " Reversed \u2014 subject piped, pattern in the argument \u2014 reads correctly, type-checks, and",
1179
+ " answers false for EVERY input, so an `if (matches) reject` guard admits what it",
1180
+ " refuses. `withFilters` throws on a bare `c.text` pattern from ANY position in",
1181
+ " the chain (a normalizer in front of the regex filter is refused too; nothing upstream",
1182
+ " adds the delimiters) and on a pattern found in the subject slot; `s.expect.to_match`",
1183
+ " is the same PATTERN slot, refused both ways; a `ref`/`inp` pattern is passed through untouched.",
1184
+ " `export()` warns on a reversed pair in stored bytes. Better still:",
1185
+ " a native typed input (`input.email`) over hand-rolled validation.",
1167
1186
  "- **Compose a rule set as SIBLINGS, not a folded chain.** `and(...rules)` takes any",
1168
1187
  " number of terms and encodes flat; `rules.reduce((acc, r) => and(acc, r))` nests one",
1169
1188
  " container per rule, which costs quadratic bytes (512 terms: 394 KiB flat, 21 MiB",
@@ -1243,7 +1262,7 @@ function renderSections(m) {
1243
1262
  ' - `verb`: `"GET" | "POST" | "PUT" | "PATCH" | "DELETE" | "HEAD"` (required), UPPERCASE. Anything else \u2014 most often a lowercase `"post"` \u2014 makes `query()` THROW, because Xano does NOT reject it: it stores the verb as NULL, a null verb serves as GET, and the endpoint then answers on the wrong method while the one you meant 404s `Unable to locate request.`',
1244
1263
  " - `apiGroup`: an `apiGroup()` def handle (or its name) \u2014 binds by guid, stable across syncs. Raw numeric `apiGroupId?` is the escape hatch and wins if both given.",
1245
1264
  ' - `auth`: `false` (no auth) or an auth-table id; `responseType`: `"standard" | "stream"` (default `standard`) \u2014 any other spelling THROWS, since Xano stores an unrecognized one as NULL and a null buffers as `standard`, so a misspelled stream quietly does not stream.',
1246
- ' - `name` is the endpoint PATH within the group. A `{param}` segment is a URL PATH PARAM bound to the input of the same name, and segments chain: `name: "blog/{slug}/review/{review_id}"` + `input: { slug: input.text(), review_id: input.int() }`. Read it with `inp("slug")` like any other input. Every `{param}` MUST have a matching input or `query()` THROWS \u2014 Xano treats an unbound marker as inert route text, so the endpoint would answer on the path and see nothing. A `{param}` need NOT be a whole segment (`"blog/post-{slug}"` routes fine), but its type must fit one segment (no object/list/json/file/geo/vector); there are no wildcards or patterns. `required: true` is NOT demanded (the engine\'s editor leaves path inputs unmarked). Inputs absent from the path are ordinary query-string/body params. Name charset is ONLY `A-Za-z0-9_-/{}`, max 200: a `.` (`"export.zip"`) is NOT rejected by Xano \u2014 it stores an EMPTY name that deploys clean then 404s forever, so `query()` THROWS. Use `"export_zip"` and set the extension in the response headers.',
1265
+ ' - `name` is the endpoint PATH within the group. A `{param}` segment is a URL PATH PARAM bound to the input of the same name, and segments chain: `name: "blog/{slug}/review/{review_id}"` + `input: { slug: input.text(), review_id: input.int() }`. Read it with `inp("slug")` like any other input. Every `{param}` MUST have a matching input or `query()` THROWS \u2014 Xano treats an unbound marker as inert route text, so the endpoint would answer on the path and see nothing. A `{param}` need NOT be a whole segment (`"blog/post-{slug}"` routes fine), but its type must fit one segment (no object/list/json/file/geo/vector); there are no wildcards or patterns. `required: true` is NOT demanded (the engine\'s editor leaves path inputs unmarked). The CONVERSE is warned, not enforced: an input a `GET`/`DELETE`/`HEAD` looks ONE ROW up by (`s.db.get`/`get_by_id`/`has`/by-field edit/patch/delete) belongs in the path \u2014 `export()` warns `query.path-segment-candidate`. It still serves `?blog_id=1`, but the route is not addressable and `getPath()` types STATIC, so a caller cannot pass the value positionally. A segment is any value naming WHICH resource is wanted, not just an id (`"shop/{country}"`). An input that NARROWS A LIST (`s.db.query`) stays a query-string param. Inputs absent from the path are ordinary query-string/body params. Name charset is ONLY `A-Za-z0-9_-/{}`, max 200: a `.` (`"export.zip"`) is NOT rejected by Xano \u2014 it stores an EMPTY name that deploys clean then 404s forever, so `query()` THROWS. Use `"export_zip"` and set the extension in the response headers.',
1247
1266
  ' - **Client recipe:** `q.getPath({ params: { slug: "hello" } })` \u2192 `/api:<canonical>/blog/hello` \u2014 never interpolate by hand. `getPath` percent-encodes each value (so `?`/`#`/spaces stay in their segment) and throws on what encoding cannot contain: a `/`, and a value that IS `.`/`..` (a URL parser drops those before routing \u2014 `%2e` counts \u2014 addressing a different endpoint). The keys are typed from the literal `name`, so a typo is a compile error. The HANDLE\'s `q.toSearchParams(input)` drops path params for a GET; the free `query.toSearchParams(input)` has no view of the route and keeps every key.',
1248
1267
  "- `apiGroup({ name, guid?, canonical?, description?, docs?, swagger?, apiGroupEnabled?, documentation?, cors? })` \u2014 a query container; register it and bind queries to it via their `apiGroup`.",
1249
1268
  " - `cors?`: `{ mode?, allowOrigins?: string[], allowHeaders?: string[], allowCredentials?, maxAge?, allowMethods?: { get?, post?, put?, patch?, delete?, head? } }`.",
@@ -1568,12 +1587,13 @@ function renderSections(m) {
1568
1587
  "which the DB applies atomically. Reserve the pipeline form for low-contention counters",
1569
1588
  "where a rare lost update is acceptable.",
1570
1589
  "\u26A0 `direct_query` needs the table's PHYSICAL Postgres name, which the typed surface",
1571
- "does NOT expose: the engine derives a physical name from workspace + table ids (of the",
1572
- "form `x<workspace_id>_<table_id>`, e.g. `x6_203970`), ids assigned at import \u2014 not knowable",
1573
- "from a `table()` def (identity is a name + guid, not the numeric id), and `sql_name`",
1574
- "persists empty. So the safe counter drops out of the typed surface: hardcode",
1575
- "the physical name after inspecting the deployed table. A typed atomic path needs an",
1576
- "engine change.",
1590
+ "does NOT expose: the engine derives it from ids assigned at import \u2014 not knowable from a",
1591
+ "`table()` def (identity is a name + guid, not the numeric id) \u2014 and `sql_name` persists",
1592
+ "empty. The derived name is also NOT STABLE: a deploy is a full replace, so every table is",
1593
+ "created afresh and the id in its name moves each time, on the same unchanged project. So",
1594
+ "the safe counter drops out of the typed surface: resolve the physical name from",
1595
+ "`information_schema` inside the request that uses it, and never store, cache or hardcode",
1596
+ "one. A typed atomic path needs an engine change.",
1577
1597
  ""
1578
1598
  );
1579
1599
  const argFilters = m.filters.filter((fl) => fl.args?.length);
@@ -1644,7 +1664,7 @@ function renderSections(m) {
1644
1664
  "",
1645
1665
  "- `s.db.get({ table, fieldName?, fieldValue, lock?, output?, as? })` \u2014 one row by field match; `output` restricts returned columns (and overrides column visibility \u2014 it can pull `internal` columns like a password hash).",
1646
1666
  "- `s.db.get_by_id({ table, id, output?, addon?, tableAlias?, as? })` \u2014 get by primary key. Takes `id`, NOT `fieldName`/`fieldValue`; binds the row or `null` for an id that names no row. Both spellings are live in pulled workspaces.",
1647
- ' - \u26A0 `id` is validated `>= 1`, so the `0` sentinel an optional `f.tableRef` stores fails the request with HTTP 400 `Value is less than the minimum value of 1` \u2014 it does NOT bind `null`. The throw is not scoped to the lookup: inside a `foreach` it kills the whole request, so one unset FK loses every other row\'s work. Read a nullable FK with the field-match form, which binds `null` on `0` and lets the loop finish: `s.db.get({ table, fieldName: "id", fieldValue: ref("row.fk"), as })`.',
1667
+ ' - \u26A0 `id` is validated `>= 1`, so the `0` sentinel an optional `f.tableRef` stores fails the request with HTTP 400 `Value is less than the minimum value of 1` \u2014 it does NOT bind `null`. The throw is not scoped to the lookup: inside a `foreach` it kills the whole request, so one unset FK loses every other row\'s work. Read a nullable FK with the field-match form, which binds `null` on `0` and lets the loop finish: `s.db.get({ table, fieldName: "id", fieldValue: ref("row.fk"), as })`. `export()` warns when the `id` is statically a `0` \u2014 the literal `c.int(0)`, an `inp()` whose declared input default is `0`, or a `ref()` to a column declared `default: 0` \u2014 and `--strict` fails the build.',
1648
1668
  "- `s.db.has({ table, fieldName?, fieldValue, as? })` \u2014 existence test.",
1649
1669
  "- `s.db.del({ table, fieldName?, fieldValue, as? })` \u2014 delete by field match.",
1650
1670
  "- `s.db.add({ table, row?, data?, output?, as? })` \u2014 insert; `row` is a partial keyed by column.",
@@ -1666,13 +1686,14 @@ function renderSections(m) {
1666
1686
  ' - \u26A0 `like`/`ilike` take the operand as the PATTERN, verbatim: a bare term matches only an exact whole-string equal, and the endpoint answers HTTP 200 with zero rows \u2014 nothing reports a problem, so a search box that matches nothing ships. For substring matching use `includes`/`not includes`, which wrap the operand in `%\u2026%` themselves and match case-INSENSITIVELY. Prefer them over a hand-built `"%" + term + "%"`, which is non-empty even for an empty term and so defeats `ignoreEmpty`; `includes` composes with it. `contains`/`@>`/`overlaps` are JSON/array containment, not text \u2014 on a text column they 400 `ParseError: Invalid value for param`.',
1667
1687
  " - Compose nested boolean logic with `and(...)` / `or(...)` groups (also available on `addon()` `where`).",
1668
1688
  " - An operand may be a bare value (`col`/`inp`/`ref`/`auth`/`c.*`) OR a **filtered** value (`withFilters(...)`) inline \u2014 the engine compiles the string and arithmetic filters (`trim`, `concat`, `upper`, `lower`, \u2026) into the SQL.",
1669
- " - \u26A0 The REQUEST-TIME timestamp filters have no SQL form and kill the request with a bare fatal naming nothing: `epochms_transform`, `epochms_add_ms`, `epochms_add_secs`, `epochms_date`, `epochms_from_format`. For a relative cutoff use the SQL-side family instead (`epochms_add_day`, `epochms_sub_month`, `epochms_year`, \u2026) or compute it in an earlier `s.set_var` and `ref()` that. `export --strict` reports it; a bare `c.now()` operand is always fine.",
1689
+ " - \u26A0 The REQUEST-TIME timestamp filters have no SQL form and kill the request with a bare fatal naming nothing: `epochms_transform`, `epochms_add_ms`, `epochms_add_secs`, `epochms_date`, `epochms_from_format`. For a relative cutoff use the SQL-side family instead (`epochms_add_day`, `epochms_sub_month`, `epochms_year`, \u2026) \u2014 by raw name, since `fl.*` has no builder for them \u2014 or compute it in an earlier `s.set_var` and `ref()` that. `export --strict` reports it; a bare `c.now()` operand is always fine.",
1670
1690
  ' - `bind: [{ table, as?, join?, where? }]` \u2014 joins (`context.bind[]`). `join` defaults to `"inner"`. `as` defaults to the table name; two joins to the same table need distinct aliases.',
1671
1691
  ' - \u26A0 In `where`/`sort`/`eval` a JOINED column takes a dotted path (`col("team_row.id")`); THIS query\'s own columns stay **bare** (`col("team")`). Qualifying your own by table name needs `tableAlias` (same rule as `aggregate`) \u2014 without it the engine reads the operand as text and 400s `ParseError: Invalid value for param` naming the OTHER operand, so it throws at export instead.',
1672
1692
  ' - `bind: [{ table: team, as: "team_row", join: "left", where: expr(col("team"), "=", col("team_row.id")) }]`',
1693
+ ' - \u26A0 A join does NOT put the joined table\'s columns on the returned row \u2014 with or without a `bind`, a row is the QUERIED table\'s columns, which is what `InferResponse` types. There is no `row.team_row`. To read a joined column, PROJECT it with an `eval` whose `name` is the dotted path: `eval: [{ name: "team_row.name", as: "team_name" }]` puts `team_name` on the row and on the inferred type. A bare `name` there is `Unsupported parameter reference` at runtime (it qualifies to the base table), and a dotted joined column in `output` is dropped with no error.',
1673
1694
  ' - `returnType` \u2014 `"list"` (default) | `"single"` | `"count"` | `"exists"` | `"stream"` | `"aggregate"`. Drives `context.return.type` AND the `InferResponse` shape: `count`\u2192`number`, `exists`\u2192`boolean`, `single`\u2192`Row|null`, `stream`\u2192`Row[]` (pageable, no envelope), `list`\u2192`Row[]`/envelope, `aggregate`\u2192rows keyed by the `aggregate.group`/`eval` aliases. \u26A0 A bare `count` of ZERO serializes as an EMPTY body, not `0` \u2014 a client parsing JSON gets a parse error on the one result it most needs to handle. Wrap it: `response: { count: ref("n") }`.',
1674
1695
  ' - `eval: [{ name, as, filters? }]` \u2014 computed columns (`context.eval[]`). Each `as` grafts onto the row as an `unknown` key in `InferResponse`; shadowing a real column throws. Write `name` **bare** (`"embedding"`) \u2014 it is alias-qualified on emit exactly like `aggregate` (a bare eval name is `Unsupported param format` at runtime), and the statement declares the alias it used. An `as` alias is `sort`able in the SAME query.',
1675
- " - An `eval`/`sort`/`where` filter pipeline compiles to **SQL**, so it resolves a DIFFERENT registry than `fl.*` (which runs in the request): the vector family, geo `distance`/`within`/`covers`, `search_rank`, the aggregators. Exported as `QUERY_EXPRESSION_FILTERS`/`VECTOR_FILTERS`.",
1696
+ ' - An `eval`/`sort`/`where` filter pipeline compiles to **SQL**, so it resolves a DIFFERENT registry than `fl.*` (which runs in the request): the vector family, geo `distance`/`within`/`covers`, `search_rank`, the aggregators. \u26A0 `fl.*` carries NO builder for these \u2014 reach them by raw name, `filter("epochms_add_day", \u2026)` or the `{ name, arg }` form. The name lists are `QUERY_EXPRESSION_FILTERS`/`VECTOR_FILTERS` on `@xanots/sdk/internal`.',
1676
1697
  ' - **Vector similarity search** \u2014 the ONLY way to query an `f.vector` column (no `SearchOp` does distance). `eval: [{ name: "embedding", as: "distance", filters: [{ name: "vector_cos_distance", arg: [inp("q")] }] }]` + `sort: [{ sortBy: "distance", dir: "asc" }]` ranks in the DATABASE over the column\'s index. Match the filter to the index `op` (`vector_cos_distance`\u2194`vector_cosine_ops`, `vector_l2_distance`\u2194`vector_l2_ops`, `vector_l1_distance`\u2194`vector_l1_ops`, `vector_inner_product`\u2194`vector_ip_ops`); `vector_cos_similarity` is the inverse, so sort it `desc`. The same filter on a `where` operand cuts off BY distance instead of by row count.',
1677
1698
  ' - `aggregate: { group?, eval?, sort?, paging? }` (with `returnType:"aggregate"`) builds `context.return.aggregate`. `group`/`eval` are `{ name, as, filters? }`, an aggregator like `sum`/`count` riding `filters`. Some aggregators resolve ONLY here, not in a runtime value pipeline: `count_distinct`, `median`, `to_list`/`to_distinct_list` (each with `_asc`/`_desc`), and `vector_distance`.',
1678
1699
  ' - \u26A0 Write each `name` as a **bare** column (`"status"`). It is alias-qualified to `"<alias>.status"` on emit \u2014 the engine rejects an unqualified column in an aggregate with `Unsupported param format`. An already-dotted `name` (a `bind`ed/joined column) passes through.',
@@ -1686,6 +1707,8 @@ function renderSections(m) {
1686
1707
  ' - `distinct` \u2014 `"auto"` (default) | `"yes"` | `"no"`, riding `context.return.<list|stream>.distinct`.',
1687
1708
  "- `s.db.truncate({ table, reset?, as? })` \xB7 `s.db.schema({ table, path, as? })`.",
1688
1709
  '- `s.db.direct_query({ sql, responseType?, args?, parser?, as? })` \u2014 `sql` is a **raw string** (not a `Value`); binds go in `args: Value[]`. `parser: "template_engine"` renders the body as a template first \u2014 how a query interpolates a column or table name a bound arg cannot carry; omit it for the default.',
1710
+ " - Template placeholders are Twig over the request scope: `{{ $input.name }}` for an input, `{{ $var.name }}` for a stack variable. \u26A0 A BARE `{{ name }}` renders as the empty string \u2014 HTTP 200, no error, a query that silently ran with a blank where the value belonged. A bound `?` arg carries a VALUE without the template at all.",
1711
+ " - \u26A0 A table's PHYSICAL name is **not stable across deploys**. A deploy is a full replace, so every table is created afresh and the id in its name moves every time \u2014 the same unchanged project redeployed three times gave one table three different names. Never store, cache, hardcode or fixture one: resolve it from `information_schema` inside the same request that uses it.",
1689
1712
  "- `s.db.external.<engine>.direct_query({ sql, connectionString, responseType?, args?, parser?, as? })` \u2014 same shape against an EXTERNAL database; `<engine>` is `postgres`/`mysql`/`mssql`/`oracle`/`snowflake`. `connectionString` is a `Value` \u2014 reach for `env(...)`, not a literal \u2014 stored as `context.connection_string_flex`. A bare string stores the older `context.connection_string` instead (an env-var name unless it looks like a URL); each form round-trips as itself.",
1690
1713
  "- `s.db.transaction({ body, as? })` \u2014 run a `Statement[]` atomically. `as` binds whatever the block returned.",
1691
1714
  "- `s.db.bulk.add({ table, items, allowIdField?, as? })` / `s.db.bulk.update` / `s.db.bulk.patch` \u2014 `items` is an array `Value`.",
@@ -2043,10 +2066,9 @@ function renderDocs(m) {
2043
2066
  const nav = [
2044
2067
  "## Topic files",
2045
2068
  "",
2046
- "Each line is a condition on the task. Open the files whose condition matches and",
2047
- "skip the rest \u2014 paths are relative to this file (`node_modules/@xanots/sdk/` once",
2048
- `installed), so a plain file read resolves them at the version you have.`,
2049
- `\`${LLMS_FULL_TXT}\` is everything concatenated \u2014 one fetch, for a reader that cannot open files.`,
2069
+ "Paths are relative to this file (`node_modules/@xanots/sdk/` once installed), so a",
2070
+ "plain file read resolves them at the version you have.",
2071
+ `\`${LLMS_FULL_TXT}\` is everything concatenated \u2014 one fetch for a reader that cannot open files.`,
2050
2072
  "",
2051
2073
  ...topics.map((t) => `- [${t.title}](${t.path}): ${t.readWhen}`),
2052
2074
  ""
@@ -0,0 +1,12 @@
1
+ import {
2
+ readLockFile,
3
+ writeLockFile
4
+ } from "./chunk-3LQGF2WS.js";
5
+ import "./chunk-GNPVYOPB.js";
6
+ import "./chunk-XWFRNJMQ.js";
7
+ import "./chunk-OHX6MIUZ.js";
8
+ export {
9
+ readLockFile,
10
+ writeLockFile
11
+ };
12
+ //# sourceMappingURL=io-UBDMMDH6.js.map
@@ -2,11 +2,11 @@ import {
2
2
  compareToLive,
3
3
  diffAgainstLive,
4
4
  sharedSchemaChanges
5
- } from "./chunk-DBFU47BJ.js";
6
- import "./chunk-3INK4Y4E.js";
5
+ } from "./chunk-AOFFKSJC.js";
6
+ import "./chunk-AE3PDSDS.js";
7
7
  export {
8
8
  compareToLive,
9
9
  diffAgainstLive,
10
10
  sharedSchemaChanges
11
11
  };
12
- //# sourceMappingURL=live-diff-IXKBVG4K.js.map
12
+ //# sourceMappingURL=live-diff-HCOTN5WC.js.map
@@ -17,7 +17,8 @@ import {
17
17
  resolvePayloadKey,
18
18
  serializeLock,
19
19
  validateLockModel
20
- } from "./chunk-7JDT4PBU.js";
20
+ } from "./chunk-XWFRNJMQ.js";
21
+ import "./chunk-OHX6MIUZ.js";
21
22
  export {
22
23
  CANONICAL_PAYLOAD_KEYS,
23
24
  LOCK_PAYLOAD_KEYS,
@@ -38,4 +39,4 @@ export {
38
39
  serializeLock,
39
40
  validateLockModel
40
41
  };
41
- //# sourceMappingURL=lock-GFXD6G2E.js.map
42
+ //# sourceMappingURL=lock-HQ4KARU2.js.map
@@ -1,25 +1,24 @@
1
1
  import {
2
2
  loadDefault
3
- } from "./chunk-ACCBOMCB.js";
4
- import "./chunk-CTD5ZCV6.js";
3
+ } from "./chunk-XT3XQ4PF.js";
4
+ import "./chunk-7WRJPKGK.js";
5
5
  import {
6
6
  readLockFile,
7
7
  writeLockFile
8
- } from "./chunk-OYMR5AMJ.js";
8
+ } from "./chunk-3LQGF2WS.js";
9
9
  import {
10
10
  UsageError,
11
11
  missingArgument,
12
12
  unknownSubcommand
13
- } from "./chunk-F6CYJ7TN.js";
13
+ } from "./chunk-Z2ZIE5CO.js";
14
14
  import "./chunk-GNPVYOPB.js";
15
15
  import "./chunk-EZG76F7R.js";
16
16
  import {
17
17
  Xano
18
- } from "./chunk-VKSOTZK3.js";
19
- import "./chunk-DIA7CT7J.js";
20
- import "./chunk-LBYWGMOA.js";
21
- import "./chunk-WHOJWOSV.js";
22
- import "./chunk-5XZ744TS.js";
18
+ } from "./chunk-QYSQ3UDO.js";
19
+ import "./chunk-V5Y7D4LH.js";
20
+ import "./chunk-N74KDCBD.js";
21
+ import "./chunk-EETVJZAZ.js";
23
22
  import {
24
23
  adoptFromBundle,
25
24
  createLockContext,
@@ -28,7 +27,9 @@ import {
28
27
  resetLockOverrides,
29
28
  resolvePayloadKey,
30
29
  seedLockOverrides
31
- } from "./chunk-7JDT4PBU.js";
30
+ } from "./chunk-XWFRNJMQ.js";
31
+ import "./chunk-2ZCUO2UG.js";
32
+ import "./chunk-OHX6MIUZ.js";
32
33
 
33
34
  // src/emit/lock-commands.ts
34
35
  import { existsSync, readFileSync } from "fs";
@@ -230,4 +231,4 @@ ${lines}
230
231
  export {
231
232
  runLockCommand
232
233
  };
233
- //# sourceMappingURL=lock-commands-DQ7CUMIV.js.map
234
+ //# sourceMappingURL=lock-commands-WCRC56ME.js.map
@@ -5,10 +5,10 @@ import {
5
5
  } from "./chunk-W5NOKYEG.js";
6
6
  import {
7
7
  promptLine
8
- } from "./chunk-AIZKXUNP.js";
8
+ } from "./chunk-IMLYGQK6.js";
9
9
  import {
10
10
  envMetaCredentialVarsSet
11
- } from "./chunk-QKM4U5UK.js";
11
+ } from "./chunk-TJS2AF5Y.js";
12
12
  import {
13
13
  CALLBACK_PATH,
14
14
  DEFAULT_PORT,
@@ -26,7 +26,7 @@ import {
26
26
  } from "./chunk-FE5I6S6N.js";
27
27
  import {
28
28
  UsageError
29
- } from "./chunk-F6CYJ7TN.js";
29
+ } from "./chunk-Z2ZIE5CO.js";
30
30
  import "./chunk-GNPVYOPB.js";
31
31
  import {
32
32
  blank,
@@ -37,7 +37,7 @@ import {
37
37
  success,
38
38
  warn
39
39
  } from "./chunk-EZG76F7R.js";
40
- import "./chunk-DIA7CT7J.js";
40
+ import "./chunk-V5Y7D4LH.js";
41
41
 
42
42
  // src/emit/login-command.ts
43
43
  import * as client from "openid-client";
@@ -177,7 +177,7 @@ async function attemptLogin(p) {
177
177
  `Could not determine the instance from the issued token (no readable \`aud\` claim). This is unexpected \u2014 please report it.`
178
178
  );
179
179
  }
180
- const { resolveScopedWorkspaceId } = await import("./workspace-2COHDBM3.js");
180
+ const { resolveScopedWorkspaceId } = await import("./workspace-33KHFLX3.js");
181
181
  detail("Resolving the workspace this token is scoped to\u2026");
182
182
  const workspaceId = await resolveScopedWorkspaceId({
183
183
  access_token: tokens.access_token,
@@ -267,4 +267,4 @@ async function acquireByPaste(p) {
267
267
  export {
268
268
  runLoginCommand
269
269
  };
270
- //# sourceMappingURL=login-command-Z6CHTA57.js.map
270
+ //# sourceMappingURL=login-command-P7LXD5TE.js.map
@@ -3,10 +3,10 @@ import {
3
3
  indexByIdentity,
4
4
  kindIsRunnable,
5
5
  resolveMatch
6
- } from "./chunk-TCFIPDB3.js";
6
+ } from "./chunk-AVGDL6RB.js";
7
7
  import {
8
8
  normalize
9
- } from "./chunk-3INK4Y4E.js";
9
+ } from "./chunk-AE3PDSDS.js";
10
10
 
11
11
  // src/validate/loop.ts
12
12
  async function runValidateLoop(client, bundleText) {
@@ -90,4 +90,4 @@ export {
90
90
  runValidateLoop,
91
91
  runnableFunctionNames
92
92
  };
93
- //# sourceMappingURL=loop-D5NPL4VH.js.map
93
+ //# sourceMappingURL=loop-IC5ISSYB.js.map