@xanots/sdk 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +28 -21
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/{agent-file-refresh-4W37DGXS.js → agent-file-refresh-QNKN5RYD.js} +3 -3
  5. package/dist/bin.js +8 -7
  6. package/dist/{branch-commands-PBQ36L4A.js → branch-commands-2BLOC2GR.js} +13 -11
  7. package/dist/{capture-7PO6SGB4.js → capture-4WVJY4DQ.js} +2 -2
  8. package/dist/{chunk-ZOYMZZ3S.js → chunk-3INK4Y4E.js} +1 -1
  9. package/dist/{chunk-NDZFBZHC.js → chunk-3UABJA4X.js} +1 -1
  10. package/dist/{chunk-7AXQKABT.js → chunk-5R73LFWK.js} +3 -3
  11. package/dist/{chunk-CDAQUY5W.js → chunk-5YCQ2QHH.js} +2 -2
  12. package/dist/{chunk-2ROR3AZC.js → chunk-75Z74TA7.js} +2 -2
  13. package/dist/{chunk-QTNO2WD6.js → chunk-7ZYW652H.js} +1 -1
  14. package/dist/{chunk-SNO3KHCY.js → chunk-ACCBOMCB.js} +109 -78
  15. package/dist/{chunk-4PTSTDIG.js → chunk-AIZKXUNP.js} +2 -2
  16. package/dist/{chunk-P5C2YKAM.js → chunk-ANUDXFEX.js} +18 -27
  17. package/dist/chunk-CTD5ZCV6.js +28 -0
  18. package/dist/{chunk-5HCDZ2XN.js → chunk-DBFU47BJ.js} +2 -2
  19. package/dist/{chunk-OKNSR7MT.js → chunk-DIA7CT7J.js} +129 -150
  20. package/dist/{chunk-JQLR64UC.js → chunk-F6CYJ7TN.js} +21 -6
  21. package/dist/{chunk-BKDJN76G.js → chunk-FE5I6S6N.js} +1 -1
  22. package/dist/{chunk-EM5QPTXP.js → chunk-I7DQDJAM.js} +30 -48
  23. package/dist/{chunk-QIWBCS7N.js → chunk-JGCWTCA7.js} +2 -2
  24. package/dist/{chunk-MDXR5E5Q.js → chunk-K5IOND4K.js} +2 -2
  25. package/dist/{chunk-4PE4ZAB7.js → chunk-KA6G2L7U.js} +5 -5
  26. package/dist/{chunk-64QK6JEK.js → chunk-LBYWGMOA.js} +36 -2
  27. package/dist/{chunk-3MDKV2VA.js → chunk-P6TAVLOX.js} +2 -2
  28. package/dist/{chunk-3QW5NFZJ.js → chunk-QKM4U5UK.js} +3 -3
  29. package/dist/{chunk-T4XPCJRF.js → chunk-TCFIPDB3.js} +1 -1
  30. package/dist/{chunk-FEQTQ6PM.js → chunk-VKSOTZK3.js} +2 -2
  31. package/dist/{chunk-6DHBYBTO.js → chunk-VNQM3V2C.js} +1 -2
  32. package/dist/{chunk-PYS7UNNW.js → chunk-W24FJHPD.js} +3 -3
  33. package/dist/chunk-WGPXT2G2.js +22 -0
  34. package/dist/{chunk-6AAT2AYQ.js → chunk-WP4OZZV4.js} +2 -2
  35. package/dist/{chunk-MU3O43L2.js → chunk-YBC3IKMF.js} +2 -2
  36. package/dist/{chunk-C3M5K4ZH.js → chunk-YYFXVYPX.js} +37 -6
  37. package/dist/chunk-ZQ2PKR6R.js +40 -0
  38. package/dist/cli.d.ts +57 -31
  39. package/dist/cli.js +6 -5
  40. package/dist/codegen-command-GB3H2KQ7.js +46 -0
  41. package/dist/{completion-A6BZ3XGU.js → completion-WF46272M.js} +2 -2
  42. package/dist/{config-NL33PN4D.js → config-476F3PT5.js} +1 -1
  43. package/dist/{deploy-command-QZ3GNLAD.js → deploy-command-QTIVA22A.js} +68 -100
  44. package/dist/{ephemeral-command-DL7EY4LL.js → ephemeral-command-U4AQ3TXX.js} +25 -28
  45. package/dist/index.d.ts +2 -2
  46. package/dist/index.js +5 -5
  47. package/dist/{init-command-4MG3UKUO.js → init-command-MAXULNAD.js} +13 -10
  48. package/dist/{onboard-command-EHOHKQQU.js → init-web-3JNFG6GI.js} +10 -10
  49. package/dist/internal.d.ts +2 -2
  50. package/dist/internal.js +42 -45
  51. package/dist/{live-diff-QK4KC2FJ.js → live-diff-IXKBVG4K.js} +3 -3
  52. package/dist/{lock-commands-Y4S4NUCE.js → lock-commands-DQ7CUMIV.js} +20 -19
  53. package/dist/{login-command-DFCURZLC.js → login-command-Z6CHTA57.js} +7 -7
  54. package/dist/{logout-command-WXVZQCAV.js → logout-command-ER6IKAYJ.js} +2 -2
  55. package/dist/{loop-7SAIGRCZ.js → loop-D5NPL4VH.js} +3 -3
  56. package/dist/{marketplace-command-BCOAAN2I.js → marketplace-command-P4IPLJ6J.js} +6 -6
  57. package/dist/{meta-client-57ZWVHST.js → meta-client-K2J4XH64.js} +6 -6
  58. package/dist/node.d.ts +2 -2
  59. package/dist/node.js +9 -8
  60. package/dist/{validate-command-GLF5ZOOW.js → preflight-command-GZ2GE5RN.js} +17 -16
  61. package/dist/{profile-command-QJAAUZIV.js → profile-command-LJSBDV2L.js} +5 -5
  62. package/dist/{release-command-DN75G5GJ.js → release-command-YUBTNHVX.js} +36 -33
  63. package/dist/{routes-manifest-SP3ZXLMR.js → routes-manifest-PWZHDOI5.js} +2 -2
  64. package/dist/scaffold.js +2 -2
  65. package/dist/{static-host-D6KS7X45.js → static-host-3WMV7IZO.js} +1 -1
  66. package/dist/status-command-AL47VG7H.js +162 -0
  67. package/dist/{store-CUCBSYLj.d.ts → store-BG1UPZ3Z.d.ts} +5 -5
  68. package/dist/{test-command-RRNNJ45I.js → test-command-YAZLKLGQ.js} +46 -29
  69. package/dist/{upgrade-command-XFOAWDI3.js → upgrade-command-FB5QJ363.js} +13 -12
  70. package/dist/{workspace-K72NP7SX.js → workspace-2COHDBM3.js} +1 -1
  71. package/dist/{workspace-command-QCFELEGR.js → workspace-command-43P42FBP.js} +31 -32
  72. package/dist/{workspace-export-AJMGN3CQ.js → workspace-export-DURY5WYL.js} +2 -2
  73. package/guides/README.md +2 -2
  74. package/guides/authoring.md +9 -1
  75. package/guides/cli.md +17 -19
  76. package/guides/codegen.md +21 -5
  77. package/guides/coverage.md +1 -1
  78. package/guides/deploying.md +31 -34
  79. package/guides/environment.md +4 -4
  80. package/guides/object-kinds.md +3 -3
  81. package/guides/project-structure.md +1 -1
  82. package/guides/scaffold.md +25 -2
  83. package/guides/typed-frontend.md +1 -1
  84. package/llms/fields.md +3 -2
  85. package/llms/kinds-agent-mcp.md +1 -1
  86. package/llms/kinds-core.md +1 -1
  87. package/llms/kinds-realtime.md +1 -1
  88. package/llms/lock.md +5 -5
  89. package/llms/statements-calls.md +2 -1
  90. package/llms/statements-data.md +5 -2
  91. package/llms/tests.md +3 -2
  92. package/llms-full.txt +41 -44
  93. package/llms.txt +20 -29
  94. package/manifest.json +95 -426
  95. package/package.json +1 -1
  96. package/dist/chunk-3EYUR3TX.js +0 -100
  97. package/dist/chunk-JQJPFUZI.js +0 -118
  98. package/dist/chunk-XP7S3VWY.js +0 -78
  99. package/dist/codegen-command-U2W72DLG.js +0 -43
  100. package/dist/env-target-NAYVEXBH.js +0 -16
  101. package/dist/sandbox-details-command-EDO56IY3.js +0 -18
  102. package/dist/sandbox-export-command-MO6DEZ7Z.js +0 -24
@@ -98,7 +98,7 @@ ${overloadsFor("routePath", rows)}
98
98
  ${IMPLEMENTATION}${realtimeSection}`;
99
99
  }
100
100
  var HEADER = `/**
101
- * GENERATED by \`xanots paths --emit\`. Do not edit.
101
+ * GENERATED by \`xanots routes --emit\`. Do not edit.
102
102
  *
103
103
  * Plain data plus one interpolator \u2014 this file imports nothing, so a frontend
104
104
  * gets the typed path/verb (and socket) contract without pulling the SDK runtime
@@ -241,4 +241,4 @@ export {
241
241
  RouteManifestError,
242
242
  renderRouteManifest
243
243
  };
244
- //# sourceMappingURL=routes-manifest-SP3ZXLMR.js.map
244
+ //# sourceMappingURL=routes-manifest-PWZHDOI5.js.map
package/dist/scaffold.js CHANGED
@@ -4,10 +4,10 @@ import {
4
4
  allFrontendPresets,
5
5
  findFrontendPreset,
6
6
  resolveFrameworkFlag
7
- } from "./chunk-MU3O43L2.js";
7
+ } from "./chunk-YBC3IKMF.js";
8
8
  import {
9
9
  renderIndexCss
10
- } from "./chunk-P5C2YKAM.js";
10
+ } from "./chunk-ANUDXFEX.js";
11
11
  import {
12
12
  ACCENTS,
13
13
  ACCENT_TOKENS,
@@ -135,4 +135,4 @@ export {
135
135
  findSeedLeaks,
136
136
  tarGz2 as tarGz
137
137
  };
138
- //# sourceMappingURL=static-host-D6KS7X45.js.map
138
+ //# sourceMappingURL=static-host-3WMV7IZO.js.map
@@ -0,0 +1,162 @@
1
+ import {
2
+ getEphemeral,
3
+ isExpired
4
+ } from "./chunk-VNQM3V2C.js";
5
+ import {
6
+ isMachineOutput,
7
+ writeJson
8
+ } from "./chunk-NUQCEOKA.js";
9
+ import {
10
+ getEnvironment,
11
+ readEphemeralState
12
+ } from "./chunk-K5IOND4K.js";
13
+ import {
14
+ getAccessToken
15
+ } from "./chunk-QKM4U5UK.js";
16
+ import "./chunk-FE5I6S6N.js";
17
+ import {
18
+ fetchOrExplain,
19
+ httpFailure
20
+ } from "./chunk-3IGNIP6R.js";
21
+ import "./chunk-GNPVYOPB.js";
22
+ import {
23
+ formatExpiration,
24
+ formatFields,
25
+ stdoutStyle
26
+ } from "./chunk-EZG76F7R.js";
27
+
28
+ // src/emit/status-command.ts
29
+ var TIMEOUT_MS = 3e4;
30
+ function asString(v) {
31
+ return typeof v === "string" && v !== "" ? v : void 0;
32
+ }
33
+ async function getJson(url, auth, action) {
34
+ const res = await fetchOrExplain(
35
+ url,
36
+ {
37
+ headers: { accept: "application/json", Authorization: `Bearer ${auth.access_token}` },
38
+ signal: AbortSignal.timeout(TIMEOUT_MS)
39
+ },
40
+ action,
41
+ TIMEOUT_MS
42
+ );
43
+ const text = await res.text();
44
+ if (!res.ok) throw new Error(httpFailure(action, res, text));
45
+ try {
46
+ return JSON.parse(text);
47
+ } catch {
48
+ throw new Error(`${action}: could not parse the response as JSON:
49
+ ${text.slice(0, 200)}`);
50
+ }
51
+ }
52
+ async function readWorkspace(auth) {
53
+ const list = await getJson(`${auth.instance}/api:meta/workspace`, auth, "workspace list");
54
+ const all = Array.isArray(list) ? list : [];
55
+ const match = all.find((w) => w.id === auth.workspaceId);
56
+ if (match === void 0) {
57
+ return {
58
+ id: auth.workspaceId,
59
+ name: null,
60
+ credential: auth.credentialType,
61
+ note: `this credential cannot see workspace ${auth.workspaceId} \u2014 run \`xanots workspace details\` for the ids that would work`
62
+ };
63
+ }
64
+ return {
65
+ id: auth.workspaceId,
66
+ name: asString(match.name) ?? null,
67
+ credential: auth.credentialType
68
+ };
69
+ }
70
+ async function readEnvironment(auth, cwd) {
71
+ const tracked = getEnvironment(readEphemeralState(cwd), auth.workspaceId);
72
+ if (tracked === void 0) return null;
73
+ const summary = await getEphemeral(auth, { parentWorkspaceId: auth.workspaceId, name: tracked.name });
74
+ if (summary === null) {
75
+ return {
76
+ name: tracked.name,
77
+ display: tracked.display,
78
+ url: tracked.url,
79
+ state: null,
80
+ expiresAt: tracked.expires_at,
81
+ alive: false
82
+ };
83
+ }
84
+ return {
85
+ name: summary.name,
86
+ display: summary.display,
87
+ url: summary.url,
88
+ state: summary.state ?? null,
89
+ expiresAt: summary.expiresAt,
90
+ alive: !isExpired(summary.expiresAt)
91
+ };
92
+ }
93
+ async function readStatus(args, cwd = process.cwd()) {
94
+ let auth;
95
+ try {
96
+ auth = await getAccessToken(args);
97
+ } catch {
98
+ return { signedIn: false, instance: null, user: null, workspace: null, environment: null };
99
+ }
100
+ const me = await getJson(`${auth.instance}/api:meta/auth/me`, auth, "whoami");
101
+ return {
102
+ signedIn: true,
103
+ instance: auth.instance,
104
+ user: {
105
+ id: typeof me.id === "number" ? me.id : void 0,
106
+ name: asString(me.name),
107
+ email: asString(me.email)
108
+ },
109
+ workspace: await readWorkspace(auth),
110
+ environment: await readEnvironment(auth, cwd)
111
+ };
112
+ }
113
+ function prettyStatus(status) {
114
+ const s = stdoutStyle();
115
+ if (!status.signedIn) {
116
+ return `
117
+ ${formatFields([
118
+ ["Signed in", `${s.bold("no")} ${s.dim("\xB7 run `xanots login`")}`]
119
+ ])}`;
120
+ }
121
+ const who = [status.user?.name, status.user?.email && `<${status.user.email}>`].filter(Boolean).join(" ");
122
+ const rows = [
123
+ ["Signed in", who !== "" ? who : s.dim("(unknown user)")],
124
+ ["Instance", s.bold(s.cyan(status.instance ?? ""))]
125
+ ];
126
+ const ws = status.workspace;
127
+ if (ws !== null) {
128
+ rows.push([
129
+ "Workspace",
130
+ `${ws.id}${ws.name === null ? "" : ` \xB7 ${ws.name}`} ${s.dim(`\xB7 ${ws.credential}`)}`
131
+ ]);
132
+ if (ws.note !== void 0) rows.push(["", s.dim(ws.note)]);
133
+ }
134
+ const env = status.environment;
135
+ if (env === null) {
136
+ rows.push(["Environment", s.dim("none yet \xB7 run `xanots deploy`")]);
137
+ } else if (!env.alive) {
138
+ rows.push([
139
+ "Environment",
140
+ `${env.name} ${s.dim("\xB7 gone or expired \xB7 run `xanots deploy` for a fresh one")}`
141
+ ]);
142
+ } else {
143
+ const state = env.state === null ? "" : ` ${s.dim(`\xB7 ${env.state}`)}`;
144
+ rows.push(["Environment", `${env.name}${state} ${s.dim(`\xB7 expires ${formatExpiration(env.expiresAt)}`)}`]);
145
+ if (env.url !== void 0) rows.push(["URL", s.bold(s.cyan(env.url))]);
146
+ }
147
+ return `
148
+ ${formatFields(rows)}`;
149
+ }
150
+ async function runStatusCommand(args) {
151
+ const status = await readStatus(args);
152
+ if (isMachineOutput(args)) {
153
+ writeJson(status);
154
+ } else {
155
+ process.stdout.write(prettyStatus(status));
156
+ }
157
+ }
158
+ export {
159
+ readStatus,
160
+ runStatusCommand
161
+ };
162
+ //# sourceMappingURL=status-command-AL47VG7H.js.map
@@ -5051,7 +5051,7 @@ type RealtimeServerHandle = RealtimeServerDef & {
5051
5051
  * IN A BROWSER BUNDLE, prefer the generated manifest: importing this def for
5052
5052
  * its `getUrl()` pulls the SDK runtime in with it (the same ~289 kB floor a
5053
5053
  * query def costs — the factory CALLS that build the def run at module load).
5054
- * `xanots paths <entry> --emit xano/routes.gen.ts` writes the identical
5054
+ * `xanots routes <entry> --emit xano/routes.gen.ts` writes the identical
5055
5055
  * address, tenant lift included, as `socketUrl("<server>", baseUrl)` in a file
5056
5056
  * that imports nothing.
5057
5057
  *
@@ -5353,7 +5353,7 @@ type RealtimeChannelHandle<I extends Record<string, InputDescriptor> = Record<st
5353
5353
  * channel).
5354
5354
  *
5355
5355
  * IN A BROWSER BUNDLE, prefer the generated manifest's `channelPath()`
5356
- * (`xanots paths <entry> --emit`): identical output and the same
5356
+ * (`xanots routes <entry> --emit`): identical output and the same
5357
5357
  * compile-time param checking, in a file that imports no SDK runtime.
5358
5358
  */
5359
5359
  getChannel: IsStaticPath<N> extends true ? (params?: Record<string, never>) => string : (params: PathParamValues<N>) => string;
@@ -7332,10 +7332,10 @@ interface ManifestCliFlag {
7332
7332
  * `src/emit/commands.ts` — the same table that renders `--help` and generates the
7333
7333
  * shell completions.
7334
7334
  *
7335
- * It used to be hand-maintained here, and it drifted: `init` and `validate` were
7335
+ * It used to be hand-maintained here, and it drifted: `init` and `preflight` were
7336
7336
  * missing outright, `deploy` was short six flags, and the `--static` description
7337
- * claimed the frontend always lands on the parent workspace (true only under
7338
- * `--dest sandbox`). Deriving it makes that class of drift unrepresentable, which
7337
+ * claimed the frontend lands on the parent workspace, which it does not.
7338
+ * Deriving it makes that class of drift unrepresentable, which
7339
7339
  * matters more now that `llms.txt` no longer documents the CLI — this array and
7340
7340
  * `--help` are the only two surfaces, and they are now one source.
7341
7341
  */
@@ -1,25 +1,28 @@
1
- import {
2
- resolveMetaTarget
3
- } from "./chunk-XP7S3VWY.js";
4
- import "./chunk-MDXR5E5Q.js";
5
- import "./chunk-3EYUR3TX.js";
6
- import "./chunk-NDZFBZHC.js";
7
- import {
8
- getAccessToken
9
- } from "./chunk-3QW5NFZJ.js";
10
- import "./chunk-BKDJN76G.js";
11
1
  import {
12
2
  isMachineOutput,
13
3
  writeJson
14
4
  } from "./chunk-NUQCEOKA.js";
5
+ import {
6
+ resolveMetaTarget
7
+ } from "./chunk-ZQ2PKR6R.js";
8
+ import "./chunk-K5IOND4K.js";
9
+ import {
10
+ getAccessToken
11
+ } from "./chunk-QKM4U5UK.js";
12
+ import "./chunk-FE5I6S6N.js";
15
13
  import {
16
14
  fetchOrExplain,
17
15
  httpFailure,
18
16
  serverMessage
19
17
  } from "./chunk-3IGNIP6R.js";
20
18
  import {
19
+ parseEnvSelector,
20
+ unknownEnv
21
+ } from "./chunk-CTD5ZCV6.js";
22
+ import {
23
+ UsageError,
21
24
  unknownSubcommand
22
- } from "./chunk-JQLR64UC.js";
25
+ } from "./chunk-F6CYJ7TN.js";
23
26
  import "./chunk-GNPVYOPB.js";
24
27
  import {
25
28
  blank,
@@ -29,7 +32,7 @@ import {
29
32
  success,
30
33
  warn
31
34
  } from "./chunk-EZG76F7R.js";
32
- import "./chunk-OKNSR7MT.js";
35
+ import "./chunk-DIA7CT7J.js";
33
36
 
34
37
  // src/deploy/tests.ts
35
38
  var TIMEOUT_MS = 12e4;
@@ -189,7 +192,7 @@ async function runTest(auth, target, handle) {
189
192
 
190
193
  // src/emit/test-command.ts
191
194
  var EXIT_TESTS_FAILED = 5;
192
- var DEFAULT_DEST = "ephemeral";
195
+ var DEFAULT_ENV = { kind: "ephemeral" };
193
196
  async function mapWithConcurrency(items, limit, work) {
194
197
  const results = new Array(items.length);
195
198
  let next = 0;
@@ -224,7 +227,7 @@ function summarize(dest, env, outcomes) {
224
227
  total: outcomes.length,
225
228
  passed: outcomes.filter((o) => o.status === "pass").length,
226
229
  failed: outcomes.filter((o) => o.status === "fail").length,
227
- results: outcomes.map((o) => ({
230
+ tests: outcomes.map((o) => ({
228
231
  kind: o.kind,
229
232
  name: o.name,
230
233
  object: o.object,
@@ -250,10 +253,22 @@ function report(args, dest, env, outcomes) {
250
253
  }
251
254
  if (summary.failed > 0) process.exitCode = EXIT_TESTS_FAILED;
252
255
  }
253
- async function resolveTarget(args, auth) {
254
- const dest = args.dest ?? DEFAULT_DEST;
255
- const target = await resolveMetaTarget(auth, { dest, name: args.name });
256
- return { dest, env: target.env ?? null, target };
256
+ function assertNoName(args) {
257
+ if (args.name === void 0) return;
258
+ throw new UsageError(
259
+ `\`xanots test\` takes no \`--name\` \u2014 name the environment inside \`--env\` instead: \`--env ephemeral:${args.name}\`.`,
260
+ { helpFor: { command: "test", subcommand: args.subcommand } }
261
+ );
262
+ }
263
+ function selectEnv(args) {
264
+ if (args.env === void 0) return DEFAULT_ENV;
265
+ return parseEnvSelector(args.env) ?? (() => {
266
+ throw unknownEnv("--env", args.env, { command: "test", subcommand: args.subcommand });
267
+ })();
268
+ }
269
+ async function resolveTarget(selector, auth) {
270
+ const target = await resolveMetaTarget(auth, selector);
271
+ return { dest: selector.kind, env: target.env ?? null, target };
257
272
  }
258
273
  async function collect(auth, target, kind) {
259
274
  return listTests(auth, target, {
@@ -264,8 +279,8 @@ async function collect(auth, target, kind) {
264
279
  function nameWidth(handles) {
265
280
  return Math.max(0, ...handles.map((h) => h.name.length));
266
281
  }
267
- async function runList(args, auth) {
268
- const { dest, env, target } = await resolveTarget(args, auth);
282
+ async function runList(args, auth, selector) {
283
+ const { dest, env, target } = await resolveTarget(selector, auth);
269
284
  const handles = await collect(auth, target, args.kind);
270
285
  if (isMachineOutput(args)) {
271
286
  writeJson({
@@ -300,13 +315,13 @@ function match(handles, needle) {
300
315
  if (qualified.length > 0) return qualified;
301
316
  return handles.filter((h) => h.name === needle);
302
317
  }
303
- async function runOne(args, auth, name) {
304
- const { dest, env, target } = await resolveTarget(args, auth);
318
+ async function runOne(args, auth, selector, name) {
319
+ const { dest, env, target } = await resolveTarget(selector, auth);
305
320
  const handles = await collect(auth, target, args.kind);
306
321
  const found = match(handles, name);
307
322
  if (found.length === 0) {
308
323
  throw new Error(
309
- `No test named "${name}" in ${target.label}. Run \`xanots test list${args.dest ? ` --dest ${args.dest}` : ""}\` to see what is there.`
324
+ `No test named "${name}" in ${target.label}. Run \`xanots test list${args.env ? ` --env ${args.env}` : ""}\` to see what is there.`
310
325
  );
311
326
  }
312
327
  if (found.length > 1) {
@@ -348,8 +363,8 @@ async function runSuite(auth, target, opts) {
348
363
  return outcome;
349
364
  });
350
365
  }
351
- async function runAll(args, auth) {
352
- const { dest, env, target } = await resolveTarget(args, auth);
366
+ async function runAll(args, auth, selector) {
367
+ const { dest, env, target } = await resolveTarget(selector, auth);
353
368
  const outcomes = await runSuite(auth, target, {
354
369
  kind: args.kind,
355
370
  concurrency: args.concurrency,
@@ -358,19 +373,21 @@ async function runAll(args, auth) {
358
373
  report(args, dest, env, outcomes);
359
374
  }
360
375
  async function runTestCommand(args) {
376
+ assertNoName(args);
377
+ const selector = selectEnv(args);
361
378
  const auth = await getAccessToken(args);
362
379
  switch (args.subcommand) {
363
380
  case "list":
364
- return runList(args, auth);
381
+ return runList(args, auth, selector);
365
382
  case "run": {
366
383
  const name = args.positionals[0];
367
384
  if (name === void 0 || name === "") {
368
385
  throw new Error('`xanots test run` needs a test name: `xanots test run "<name>"`.');
369
386
  }
370
- return runOne(args, auth, name);
387
+ return runOne(args, auth, selector, name);
371
388
  }
372
389
  case "run-all":
373
- return runAll(args, auth);
390
+ return runAll(args, auth, selector);
374
391
  default:
375
392
  throw unknownSubcommand("test", args.subcommand);
376
393
  }
@@ -380,4 +397,4 @@ export {
380
397
  runSuite,
381
398
  runTestCommand
382
399
  };
383
- //# sourceMappingURL=test-command-RRNNJ45I.js.map
400
+ //# sourceMappingURL=test-command-YAZLKLGQ.js.map
@@ -1,20 +1,20 @@
1
1
  import {
2
2
  assertProjectDir
3
3
  } from "./chunk-ERQZFWIW.js";
4
+ import {
5
+ refreshAgentFiles
6
+ } from "./chunk-JGCWTCA7.js";
4
7
  import {
5
8
  isMachineOutput,
6
9
  writeJson
7
10
  } from "./chunk-NUQCEOKA.js";
8
- import {
9
- refreshAgentFiles
10
- } from "./chunk-QIWBCS7N.js";
11
- import "./chunk-4PE4ZAB7.js";
11
+ import "./chunk-KA6G2L7U.js";
12
12
  import {
13
13
  runNpm
14
14
  } from "./chunk-ZSYZTGJH.js";
15
15
  import {
16
16
  sdkDep
17
- } from "./chunk-P5C2YKAM.js";
17
+ } from "./chunk-ANUDXFEX.js";
18
18
  import "./chunk-Q77KNEUL.js";
19
19
  import {
20
20
  checkForUpgrade,
@@ -22,10 +22,11 @@ import {
22
22
  registryUrl,
23
23
  suppressUpdateNotice,
24
24
  upgradeCommand
25
- } from "./chunk-CDAQUY5W.js";
26
- import "./chunk-SNO3KHCY.js";
27
- import "./chunk-JQLR64UC.js";
25
+ } from "./chunk-5YCQ2QHH.js";
26
+ import "./chunk-ACCBOMCB.js";
27
+ import "./chunk-CTD5ZCV6.js";
28
28
  import "./chunk-OYMR5AMJ.js";
29
+ import "./chunk-F6CYJ7TN.js";
29
30
  import "./chunk-GNPVYOPB.js";
30
31
  import {
31
32
  blank,
@@ -35,9 +36,9 @@ import {
35
36
  success,
36
37
  warn
37
38
  } from "./chunk-EZG76F7R.js";
38
- import "./chunk-FEQTQ6PM.js";
39
- import "./chunk-OKNSR7MT.js";
40
- import "./chunk-64QK6JEK.js";
39
+ import "./chunk-VKSOTZK3.js";
40
+ import "./chunk-DIA7CT7J.js";
41
+ import "./chunk-LBYWGMOA.js";
41
42
  import "./chunk-WHOJWOSV.js";
42
43
  import "./chunk-5XZ744TS.js";
43
44
  import "./chunk-7JDT4PBU.js";
@@ -174,4 +175,4 @@ function messageOf(err) {
174
175
  export {
175
176
  runUpgradeCommand
176
177
  };
177
- //# sourceMappingURL=upgrade-command-XFOAWDI3.js.map
178
+ //# sourceMappingURL=upgrade-command-FB5QJ363.js.map
@@ -46,4 +46,4 @@ ${text}`);
46
46
  export {
47
47
  resolveScopedWorkspaceId
48
48
  };
49
- //# sourceMappingURL=workspace-K72NP7SX.js.map
49
+ //# sourceMappingURL=workspace-2COHDBM3.js.map
@@ -1,48 +1,49 @@
1
- import {
2
- fetchWorkspaceBundle,
3
- runCodegenCommand
4
- } from "./chunk-EM5QPTXP.js";
5
- import "./chunk-ZOYMZZ3S.js";
6
1
  import {
7
2
  resolveOutputTarget
8
- } from "./chunk-JQJPFUZI.js";
9
- import "./chunk-3EYUR3TX.js";
3
+ } from "./chunk-WGPXT2G2.js";
10
4
  import {
11
5
  printMicroserviceSection,
12
6
  readMicroservices
13
- } from "./chunk-NDZFBZHC.js";
7
+ } from "./chunk-3UABJA4X.js";
8
+ import {
9
+ isMachineOutput,
10
+ writeJson
11
+ } from "./chunk-NUQCEOKA.js";
12
+ import {
13
+ fetchWorkspaceBundle
14
+ } from "./chunk-I7DQDJAM.js";
15
+ import "./chunk-3INK4Y4E.js";
16
+ import "./chunk-ZQ2PKR6R.js";
17
+ import "./chunk-K5IOND4K.js";
14
18
  import {
15
19
  ENV_WORKSPACE,
16
20
  getAccessToken
17
- } from "./chunk-3QW5NFZJ.js";
18
- import "./chunk-BKDJN76G.js";
19
- import "./chunk-QTNO2WD6.js";
21
+ } from "./chunk-QKM4U5UK.js";
22
+ import "./chunk-FE5I6S6N.js";
23
+ import "./chunk-7ZYW652H.js";
20
24
  import "./chunk-ZUTSMMAG.js";
21
25
  import "./chunk-X4DVXBFY.js";
22
- import "./chunk-C3M5K4ZH.js";
23
- import {
24
- isMachineOutput,
25
- writeJson
26
- } from "./chunk-NUQCEOKA.js";
27
- import "./chunk-4PE4ZAB7.js";
28
- import "./chunk-ZSYZTGJH.js";
29
26
  import {
30
27
  fetchOrExplain,
31
28
  httpFailure
32
29
  } from "./chunk-3IGNIP6R.js";
33
- import "./chunk-2ROR3AZC.js";
30
+ import "./chunk-YYFXVYPX.js";
31
+ import "./chunk-KA6G2L7U.js";
32
+ import "./chunk-ZSYZTGJH.js";
33
+ import "./chunk-75Z74TA7.js";
34
34
  import "./chunk-LU7TRWMC.js";
35
- import "./chunk-MU3O43L2.js";
36
- import "./chunk-P5C2YKAM.js";
35
+ import "./chunk-YBC3IKMF.js";
36
+ import "./chunk-ANUDXFEX.js";
37
37
  import "./chunk-Q77KNEUL.js";
38
38
  import "./chunk-4BXJGVZ3.js";
39
- import "./chunk-3MDKV2VA.js";
40
- import "./chunk-SNO3KHCY.js";
39
+ import "./chunk-P6TAVLOX.js";
40
+ import "./chunk-ACCBOMCB.js";
41
+ import "./chunk-CTD5ZCV6.js";
42
+ import "./chunk-OYMR5AMJ.js";
41
43
  import {
42
44
  removedSubcommand,
43
45
  unknownSubcommand
44
- } from "./chunk-JQLR64UC.js";
45
- import "./chunk-OYMR5AMJ.js";
46
+ } from "./chunk-F6CYJ7TN.js";
46
47
  import "./chunk-GNPVYOPB.js";
47
48
  import {
48
49
  formatFields,
@@ -50,9 +51,9 @@ import {
50
51
  step,
51
52
  success
52
53
  } from "./chunk-EZG76F7R.js";
53
- import "./chunk-FEQTQ6PM.js";
54
- import "./chunk-OKNSR7MT.js";
55
- import "./chunk-64QK6JEK.js";
54
+ import "./chunk-VKSOTZK3.js";
55
+ import "./chunk-DIA7CT7J.js";
56
+ import "./chunk-LBYWGMOA.js";
56
57
  import "./chunk-WHOJWOSV.js";
57
58
  import "./chunk-5XZ744TS.js";
58
59
  import "./chunk-7JDT4PBU.js";
@@ -67,10 +68,8 @@ async function runWorkspaceCommand(args) {
67
68
  return runDetails(args);
68
69
  case "export":
69
70
  return runExport(args);
70
- case "codegen":
71
- return runCodegenCommand(args, { kind: "workspace" });
72
71
  case "branch": {
73
- const { runBranchCommand } = await import("./branch-commands-PBQ36L4A.js");
72
+ const { runBranchCommand } = await import("./branch-commands-2BLOC2GR.js");
74
73
  return runBranchCommand(args);
75
74
  }
76
75
  case "deploy":
@@ -160,4 +159,4 @@ async function runExport(args) {
160
159
  export {
161
160
  runWorkspaceCommand
162
161
  };
163
- //# sourceMappingURL=workspace-command-QCFELEGR.js.map
162
+ //# sourceMappingURL=workspace-command-43P42FBP.js.map
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  exportWorkspaceBundle
3
- } from "./chunk-QTNO2WD6.js";
3
+ } from "./chunk-7ZYW652H.js";
4
4
  import "./chunk-ZUTSMMAG.js";
5
5
  import "./chunk-X4DVXBFY.js";
6
6
  import "./chunk-3IGNIP6R.js";
7
7
  export {
8
8
  exportWorkspaceBundle
9
9
  };
10
- //# sourceMappingURL=workspace-export-AJMGN3CQ.js.map
10
+ //# sourceMappingURL=workspace-export-DURY5WYL.js.map
package/guides/README.md CHANGED
@@ -11,10 +11,10 @@ typed, so your editor's autocomplete is usually the faster lookup — tab-comple
11
11
  | [Object kinds](object-kinds.md) | Every authorable kind, and splitting a workspace across microservices |
12
12
  | [Authoring reference](authoring.md) | Tables and fields, statements, values, inputs, middleware, request history |
13
13
  | [CLI](cli.md) | Every command, shell completion, and what failures look like |
14
- | [Signing in & deploying](deploying.md) | Auth, ephemerals, `--static`, releasing to production, `xanots validate` |
14
+ | [Signing in & deploying](deploying.md) | Auth, ephemerals, `--static`, releasing to production, `xanots preflight` |
15
15
  | [Environment & identity](environment.md) | Every environment variable, and how `xano.lock` pins identity |
16
16
  | [The typed frontend surface](typed-frontend.md) | Path resolution, input/response inference, bundle cost, the route manifest |
17
- | [Pulling an existing workspace](codegen.md) | What `xanots codegen` writes, how faithful it is, and how to read its report |
17
+ | [Pulling an existing workspace](codegen.md) | What `xanots init --from` writes, how faithful it is, and how to read its report |
18
18
  | [Coverage & agent grounding](coverage.md) | What's covered, what's out of scope, and the files agents read |
19
19
 
20
20
  ## The agent-facing surface
@@ -127,7 +127,7 @@ auto-assigned `id`/`created_at`, `s.db.del` binds `null`, and `edit`/`del` **thr
127
127
  `s.db.query` mirrors the whole Xano query builder — `returnType`, `bind` joins, computed
128
128
  `eval` columns, `aggregate` groups, `distinct`, and the full operator set via
129
129
  `cmp(left, op, right)` with `and(...)`/`or(...)` for boolean groups. Signatures are in
130
- `llms/statements-data.md`; four behaviors are worth knowing here:
130
+ `llms/statements-data.md`; five behaviors are worth knowing here:
131
131
 
132
132
  - **A join condition spells its two sides differently.** The joined table's column takes its
133
133
  `as` alias; this query's own columns stay bare:
@@ -148,6 +148,14 @@ auto-assigned `id`/`created_at`, `s.db.del` binds `null`, and `edit`/`del` **thr
148
148
  disagree: a branch folds terms strictly left to right (`a OR b AND c` = `(a OR b) AND c`)
149
149
  while a `db.query` filter inherits SQL's AND-before-OR precedence (`a OR (b AND c)`). Write
150
150
  `and(or(a, b), c)` or `or(a, and(b, c))` — each says exactly one thing in every context.
151
+ - **`like`/`ilike` take the operand as the pattern, verbatim.** The operand *is* the pattern,
152
+ so `cmp(col("body"), "ilike", inp("q"))` with a bare term matches only a whole-string equal —
153
+ and the endpoint answers 200 with an empty list, which reads as "no results for that query".
154
+ For substring search use `includes` / `not includes`, which wrap the operand in `%…%`
155
+ themselves and match case-insensitively. Prefer that over building `"%" + term + "%"`: a
156
+ hand-built pattern is non-empty even for a blank term, which defeats the `ignoreEmpty` below.
157
+ `contains` / `@>` / `overlaps` are JSON and array containment, not text — on a text column
158
+ they fail with a parse error.
151
159
  - **`ignoreEmpty` DROPS the clause — it does not match zero rows.** `cmp(col("owner"), "in",
152
160
  ids, { ignoreEmpty: true })` with an empty `ids` returns the **unfiltered** table, where the
153
161
  same clause without the flag matches nothing. Never put it on a filter that scopes rows to a