@xanots/sdk 0.0.6 → 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 (63) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/.build-fingerprint +1 -1
  3. package/dist/{agent-file-refresh-6XT23SLU.js → agent-file-refresh-4W37DGXS.js} +3 -3
  4. package/dist/bin.js +6 -6
  5. package/dist/{branch-commands-R4FR75UW.js → branch-commands-PBQ36L4A.js} +3 -3
  6. package/dist/{chunk-GC7ZQHW7.js → chunk-2V3JUXTF.js} +5 -4
  7. package/dist/{chunk-OR43PDCW.js → chunk-3EYUR3TX.js} +2 -2
  8. package/dist/{chunk-SG4UBJ47.js → chunk-3QW5NFZJ.js} +26 -5
  9. package/dist/{chunk-2SUCC4DV.js → chunk-4PE4ZAB7.js} +2 -2
  10. package/dist/{chunk-TYBB7ON3.js → chunk-5PDOAR77.js} +11 -11
  11. package/dist/{chunk-QVSUMHNN.js → chunk-7BUTRVKA.js} +2 -2
  12. package/dist/{chunk-EFH4NFPY.js → chunk-7JDT4PBU.js} +70 -6
  13. package/dist/{chunk-LLWK6H77.js → chunk-BKDJN76G.js} +31 -1
  14. package/dist/{chunk-SOCYCBYG.js → chunk-CL2H2WYE.js} +23 -23
  15. package/dist/{chunk-4HDOP7LH.js → chunk-DBHE35JM.js} +3 -3
  16. package/dist/{chunk-3FQD3QME.js → chunk-FAWNUE2U.js} +39 -8
  17. package/dist/{chunk-Y7BARS25.js → chunk-FDKR4YMN.js} +2 -2
  18. package/dist/{chunk-CEFYM6N5.js → chunk-H2DEDWQF.js} +4 -4
  19. package/dist/{chunk-JRGDLAEA.js → chunk-JAVB27HL.js} +2 -2
  20. package/dist/{chunk-AAFBSOSD.js → chunk-JQJPFUZI.js} +3 -3
  21. package/dist/{chunk-CU5VOSTW.js → chunk-JUHKEAHJ.js} +4 -4
  22. package/dist/{chunk-WJYB7DSI.js → chunk-MDXR5E5Q.js} +2 -2
  23. package/dist/{chunk-CQBJNFDK.js → chunk-NJGNUVXR.js} +15 -4
  24. package/dist/{chunk-OLQLJY5T.js → chunk-OYMR5AMJ.js} +2 -2
  25. package/dist/{chunk-P5OAM3G2.js → chunk-QIWBCS7N.js} +2 -2
  26. package/dist/cli.js +5 -5
  27. package/dist/{codegen-command-6XXOIQ25.js → codegen-command-DYH4H4TD.js} +13 -13
  28. package/dist/{deploy-command-MTQQXPOO.js → deploy-command-HM57BINV.js} +12 -12
  29. package/dist/{env-target-C5JFLDK3.js → env-target-WA3BH5YU.js} +6 -6
  30. package/dist/{ephemeral-command-K3UJSDS4.js → ephemeral-command-SD2KLX4P.js} +7 -7
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.js +6 -6
  33. package/dist/{init-command-AY4KSXR5.js → init-command-VIPWAQYS.js} +8 -8
  34. package/dist/internal.d.ts +2 -2
  35. package/dist/internal.js +111 -55
  36. package/dist/{io-65CJNLYI.js → io-M7XZEMK7.js} +3 -3
  37. package/dist/{lock-PDFCNYUW.js → lock-GFXD6G2E.js} +6 -2
  38. package/dist/{lock-commands-MC6I3MZA.js → lock-commands-7VJKAXV6.js} +6 -6
  39. package/dist/{login-command-LCOOOPO2.js → login-command-DFCURZLC.js} +3 -3
  40. package/dist/{logout-command-J2AG5NKC.js → logout-command-WXVZQCAV.js} +2 -2
  41. package/dist/node.d.ts +2 -2
  42. package/dist/node.js +8 -8
  43. package/dist/{profile-command-ZPC2DPFV.js → profile-command-QJAAUZIV.js} +3 -3
  44. package/dist/{release-command-V4K4IORX.js → release-command-3IET7YII.js} +26 -14
  45. package/dist/{sandbox-details-command-DMY2KGA2.js → sandbox-details-command-EDO56IY3.js} +4 -4
  46. package/dist/{sandbox-export-command-R6QMEK3D.js → sandbox-export-command-MO6DEZ7Z.js} +5 -5
  47. package/dist/{store-BJONDJoZ.d.ts → store-DfuWu1tE.d.ts} +1 -1
  48. package/dist/{test-command-OEBIGOPP.js → test-command-S7SMRWMP.js} +6 -6
  49. package/dist/{upgrade-command-52AAZ3NV.js → upgrade-command-TZYSGXP7.js} +9 -9
  50. package/dist/{validate-command-KTLPSSH7.js → validate-command-MMXEVHH3.js} +7 -7
  51. package/dist/{workspace-command-LX5S5N2H.js → workspace-command-X6L7HTXO.js} +16 -16
  52. package/guides/environment.md +6 -3
  53. package/llms/fields.md +8 -0
  54. package/llms/kinds-core.md +2 -1
  55. package/llms/lambda.md +1 -1
  56. package/llms/legacy.md +1 -1
  57. package/llms/lock.md +32 -0
  58. package/llms/object-kinds.md +2 -2
  59. package/llms/statements-calls.md +9 -2
  60. package/llms-full.txt +105 -56
  61. package/llms.txt +49 -49
  62. package/manifest.json +2 -2
  63. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,23 @@ listed here.
11
11
 
12
12
  ---
13
13
 
14
+ ## 0.0.6 — The action identity fix
15
+
16
+ _2026-08-28_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.6)
17
+
18
+ `action.call` and `action.package.call` now take the identity the instance assigned at install
19
+ instead of deriving one from a name. A derived id is well-formed and addresses nothing, so those
20
+ calls exported clean and never resolved — if you have either in a workspace, this is a call-site
21
+ change you need to make. Alongside it: a lock-file false positive that refused a legal workspace,
22
+ and a grounding correction about what an omitted column on `db.add` actually stores.
23
+
24
+ - ⚠️ `action.call` takes the id the instance assigned, not one derived from a name
25
+ - One canonical on two different kinds is no longer a lock error
26
+ - An omitted column on `db.add` lands on its own default, not `null`
27
+ - `xanots init` asks two questions instead of three
28
+
29
+ ---
30
+
14
31
  ## 0.0.5 — Sign in without a loopback
15
32
 
16
33
  _2026-08-26_ · [release notes](https://github.com/xanots/sdk/releases/tag/v0.0.5)
@@ -1 +1 @@
1
- 2ea4560ab5068ad3f41aaaccf9f6084502c807310086df6cd6a011bb8ab31aec
1
+ 12b76c8975e939f33a9312372b45a4090256a351870c259c08c96691cbda54af
@@ -3,8 +3,8 @@ import {
3
3
  codingAgentDetected,
4
4
  isCI,
5
5
  refreshAgentFiles
6
- } from "./chunk-P5OAM3G2.js";
7
- import "./chunk-2SUCC4DV.js";
6
+ } from "./chunk-QIWBCS7N.js";
7
+ import "./chunk-4PE4ZAB7.js";
8
8
  import "./chunk-ZSYZTGJH.js";
9
9
  import "./chunk-Q77KNEUL.js";
10
10
  import "./chunk-EZG76F7R.js";
@@ -14,4 +14,4 @@ export {
14
14
  isCI,
15
15
  refreshAgentFiles
16
16
  };
17
- //# sourceMappingURL=agent-file-refresh-6XT23SLU.js.map
17
+ //# sourceMappingURL=agent-file-refresh-4W37DGXS.js.map
package/dist/bin.js CHANGED
@@ -1,27 +1,27 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  maybeNotifyUpdate
4
- } from "./chunk-Y7BARS25.js";
4
+ } from "./chunk-FDKR4YMN.js";
5
5
  import {
6
6
  readVersion,
7
7
  run
8
- } from "./chunk-SOCYCBYG.js";
8
+ } from "./chunk-CL2H2WYE.js";
9
9
  import {
10
10
  exitCodeOf,
11
11
  reportFailure
12
12
  } from "./chunk-JQLR64UC.js";
13
- import "./chunk-OLQLJY5T.js";
13
+ import "./chunk-OYMR5AMJ.js";
14
14
  import "./chunk-GNPVYOPB.js";
15
15
  import {
16
16
  clearProgress,
17
17
  error
18
18
  } from "./chunk-EZG76F7R.js";
19
- import "./chunk-3FQD3QME.js";
19
+ import "./chunk-FAWNUE2U.js";
20
20
  import "./chunk-OKNSR7MT.js";
21
- import "./chunk-CQBJNFDK.js";
21
+ import "./chunk-NJGNUVXR.js";
22
22
  import "./chunk-WHOJWOSV.js";
23
23
  import "./chunk-5XZ744TS.js";
24
- import "./chunk-EFH4NFPY.js";
24
+ import "./chunk-7JDT4PBU.js";
25
25
 
26
26
  // src/emit/interrupt.ts
27
27
  var EXIT_SIGINT = 130;
@@ -9,8 +9,8 @@ import {
9
9
  } from "./chunk-4PTSTDIG.js";
10
10
  import {
11
11
  getAccessToken
12
- } from "./chunk-SG4UBJ47.js";
13
- import "./chunk-LLWK6H77.js";
12
+ } from "./chunk-3QW5NFZJ.js";
13
+ import "./chunk-BKDJN76G.js";
14
14
  import {
15
15
  isMachineOutput,
16
16
  writeJson
@@ -131,4 +131,4 @@ Promote another branch first (\`xanots workspace branch set-live <other>\`), the
131
131
  export {
132
132
  runBranchCommand
133
133
  };
134
- //# sourceMappingURL=branch-commands-R4FR75UW.js.map
134
+ //# sourceMappingURL=branch-commands-PBQ36L4A.js.map
@@ -35,7 +35,7 @@ import {
35
35
  registerKind,
36
36
  tableColumns,
37
37
  withFilters
38
- } from "./chunk-CQBJNFDK.js";
38
+ } from "./chunk-NJGNUVXR.js";
39
39
  import {
40
40
  assertPathParamInputs,
41
41
  fillPathParams,
@@ -50,8 +50,9 @@ import {
50
50
  import {
51
51
  deriveGuid,
52
52
  realtimeChannelSeedName,
53
+ resolveQueryRef,
53
54
  resolveRef
54
- } from "./chunk-EFH4NFPY.js";
55
+ } from "./chunk-7JDT4PBU.js";
55
56
 
56
57
  // src/statements/set-var.ts
57
58
  var SET_VAR = "mvp:set_var";
@@ -482,7 +483,7 @@ function functionCall(args) {
482
483
  function apiCall(args) {
483
484
  args = argsOrEmpty(args);
484
485
  assertArg("mvp:workspace_run_endpoint", "api", args.api);
485
- const context = { id: resolveRef("query", args.api) };
486
+ const context = { id: resolveQueryRef(args.api) };
486
487
  const headers = coerceHeaders(args.headers);
487
488
  if (headers) context.headers = vf(headers);
488
489
  if (args.auth) {
@@ -3733,4 +3734,4 @@ export {
3733
3734
  workspaceKind,
3734
3735
  workspaceConfig
3735
3736
  };
3736
- //# sourceMappingURL=chunk-GC7ZQHW7.js.map
3737
+ //# sourceMappingURL=chunk-2V3JUXTF.js.map
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-NDZFBZHC.js";
5
5
  import {
6
6
  getAccessToken
7
- } from "./chunk-SG4UBJ47.js";
7
+ } from "./chunk-3QW5NFZJ.js";
8
8
  import {
9
9
  isMachineOutput,
10
10
  writeJson
@@ -97,4 +97,4 @@ export {
97
97
  fetchSandboxDetails,
98
98
  runSandboxDetailsCommand
99
99
  };
100
- //# sourceMappingURL=chunk-OR43PDCW.js.map
100
+ //# sourceMappingURL=chunk-3EYUR3TX.js.map
@@ -7,12 +7,14 @@ import {
7
7
  globalAuthFilePath,
8
8
  localAuthFilePath,
9
9
  oauthErrorCode,
10
+ oauthErrorResponse,
10
11
  readCredential,
11
12
  resolveAuthFilePath,
12
13
  resolveAuthHost,
14
+ resolveOAuthErrorCode,
13
15
  resolveScope,
14
16
  writeCredential
15
- } from "./chunk-LLWK6H77.js";
17
+ } from "./chunk-BKDJN76G.js";
16
18
  import {
17
19
  detail,
18
20
  hostLabel,
@@ -40,7 +42,26 @@ function refreshAccessToken(authHost, clientId, refreshToken, scope) {
40
42
  return provider.refresh(refreshToken, { scope });
41
43
  }
42
44
  function isTransientRefreshError(err) {
43
- return oauthErrorCode(err) === void 0;
45
+ if (oauthErrorCode(err) !== void 0) return false;
46
+ const res = oauthErrorResponse(err);
47
+ if (res === void 0) return true;
48
+ return res.status >= 500;
49
+ }
50
+ async function describeRefreshFailure(err) {
51
+ const base = err instanceof Error ? err.message : String(err);
52
+ const res = oauthErrorResponse(err);
53
+ if (res === void 0) return base;
54
+ const parts = [`HTTP ${res.status}`];
55
+ const code = await resolveOAuthErrorCode(err);
56
+ if (code !== void 0) parts.push(code);
57
+ else if (!res.bodyUsed) {
58
+ try {
59
+ const text = (await res.clone().text()).trim();
60
+ if (text !== "") parts.push(text.length > 200 ? `${text.slice(0, 197)}\u2026` : text);
61
+ } catch {
62
+ }
63
+ }
64
+ return `${base} (${parts.join(" \u2014 ")})`;
44
65
  }
45
66
  async function refreshWithRetry(authHost, clientId, refreshToken, scope) {
46
67
  try {
@@ -215,8 +236,8 @@ async function refreshUnderLock(authFilePath, saved) {
215
236
  try {
216
237
  set = await refreshWithRetry(current.auth_host, current.client_id, current.refresh_token, current.scope);
217
238
  } catch (err) {
218
- const message = err instanceof Error ? err.message : String(err);
219
- if (oauthErrorCode(err) === "invalid_grant") {
239
+ const message = await describeRefreshFailure(err);
240
+ if (await resolveOAuthErrorCode(err) === "invalid_grant") {
220
241
  clearCredential(authFilePath);
221
242
  throw new Error(
222
243
  `Session for ${instance} has expired or was revoked (the refresh token was rejected). Run \`xanots login\` to sign in again.`
@@ -251,4 +272,4 @@ export {
251
272
  envMetaCredentialVarsSet,
252
273
  getAccessToken
253
274
  };
254
- //# sourceMappingURL=chunk-SG4UBJ47.js.map
275
+ //# sourceMappingURL=chunk-3QW5NFZJ.js.map
@@ -31,7 +31,7 @@ that reads well, type-checks, and is wrong. Read before writing:
31
31
  conditions are for.
32
32
  3. \`node_modules/@xanots/sdk/manifest.json\` \u2014 only for per-entry detail neither
33
33
  carries: a statement's full field schema with engine defaults, a filter's
34
- complete argument list. Grep or \`jq\` the one entry you need; it is ~55k
34
+ complete argument list. Grep or \`jq\` the one entry you need; it is ~65k
35
35
  tokens, so never read it whole.
36
36
 
37
37
  The published types and JSDoc (\`node_modules/@xanots/sdk/**/*.d.ts\`) are that
@@ -442,4 +442,4 @@ export {
442
442
  resolveAiPresets,
443
443
  scaffoldProject
444
444
  };
445
- //# sourceMappingURL=chunk-2SUCC4DV.js.map
445
+ //# sourceMappingURL=chunk-4PE4ZAB7.js.map
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-ZOYMZZ3S.js";
19
19
  import {
20
20
  getAccessToken
21
- } from "./chunk-SG4UBJ47.js";
21
+ } from "./chunk-3QW5NFZJ.js";
22
22
  import {
23
23
  exportWorkspaceBundle
24
24
  } from "./chunk-QTNO2WD6.js";
@@ -27,15 +27,15 @@ import {
27
27
  resolveFrontendPreset,
28
28
  resolveThemeChoice,
29
29
  sanitizeAppName
30
- } from "./chunk-4HDOP7LH.js";
30
+ } from "./chunk-DBHE35JM.js";
31
31
  import {
32
32
  XANO_DIR,
33
33
  resolveAiPresets,
34
34
  scaffoldProject
35
- } from "./chunk-2SUCC4DV.js";
35
+ } from "./chunk-4PE4ZAB7.js";
36
36
  import {
37
37
  TEST_EXPECT_TYPES
38
- } from "./chunk-JRGDLAEA.js";
38
+ } from "./chunk-JAVB27HL.js";
39
39
  import {
40
40
  raw
41
41
  } from "./chunk-LU7TRWMC.js";
@@ -67,11 +67,11 @@ import {
67
67
  searchConstrainsRows,
68
68
  tableTrigger,
69
69
  workspaceTrigger
70
- } from "./chunk-GC7ZQHW7.js";
70
+ } from "./chunk-2V3JUXTF.js";
71
71
  import {
72
72
  loadDefault,
73
73
  readVersion
74
- } from "./chunk-SOCYCBYG.js";
74
+ } from "./chunk-CL2H2WYE.js";
75
75
  import {
76
76
  UsageError
77
77
  } from "./chunk-JQLR64UC.js";
@@ -115,7 +115,7 @@ import {
115
115
  sys,
116
116
  toolset,
117
117
  withFilters
118
- } from "./chunk-CQBJNFDK.js";
118
+ } from "./chunk-NJGNUVXR.js";
119
119
  import {
120
120
  parsePathParams,
121
121
  unboundPathParams
@@ -130,7 +130,7 @@ import {
130
130
  } from "./chunk-5XZ744TS.js";
131
131
  import {
132
132
  REFERENCEABLE_KIND_PAYLOAD_KEYS
133
- } from "./chunk-EFH4NFPY.js";
133
+ } from "./chunk-7JDT4PBU.js";
134
134
 
135
135
  // src/emit/codegen-command.ts
136
136
  import { existsSync, readFileSync, writeFileSync } from "fs";
@@ -6751,7 +6751,7 @@ async function fetchBundle(args, source) {
6751
6751
  if (source.kind === "sandbox") {
6752
6752
  const auth3 = await getAccessToken(args);
6753
6753
  step("Reading the sandbox workspace");
6754
- const { fetchSandboxBundle } = await import("./sandbox-export-command-R6QMEK3D.js");
6754
+ const { fetchSandboxBundle } = await import("./sandbox-export-command-MO6DEZ7Z.js");
6755
6755
  return {
6756
6756
  bundle: await fetchSandboxBundle(auth3),
6757
6757
  origin: { source: "sandbox", origin: auth3.instance }
@@ -6765,7 +6765,7 @@ async function fetchBundle(args, source) {
6765
6765
  );
6766
6766
  }
6767
6767
  const auth3 = await getAccessToken(args);
6768
- const { resolveLive, fetchEphemeralBundle } = await import("./ephemeral-command-K3UJSDS4.js");
6768
+ const { resolveLive, fetchEphemeralBundle } = await import("./ephemeral-command-SD2KLX4P.js");
6769
6769
  const summary = await resolveLive(auth3, auth3.workspaceId, name);
6770
6770
  step(`Reading ephemeral "${name}"`);
6771
6771
  return {
@@ -7034,4 +7034,4 @@ export {
7034
7034
  verifyCrashEntry,
7035
7035
  blameGeneratedFile
7036
7036
  };
7037
- //# sourceMappingURL=chunk-TYBB7ON3.js.map
7037
+ //# sourceMappingURL=chunk-5PDOAR77.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  compileBundle
3
- } from "./chunk-SOCYCBYG.js";
3
+ } from "./chunk-CL2H2WYE.js";
4
4
  import {
5
5
  missingArgument
6
6
  } from "./chunk-JQLR64UC.js";
@@ -34,4 +34,4 @@ export {
34
34
  assertBundleInput,
35
35
  loadBundleText
36
36
  };
37
- //# sourceMappingURL=chunk-QVSUMHNN.js.map
37
+ //# sourceMappingURL=chunk-7BUTRVKA.js.map
@@ -269,6 +269,39 @@ function realtimeMessageSeedName(server, channelPath, name) {
269
269
  seedPart("message", "name", name)
270
270
  ].join(SEED_SEP);
271
271
  }
272
+ function querySeedName(group, verb, name) {
273
+ return [
274
+ group === "" ? "" : seedPart("query", "apiGroup", group),
275
+ seedPart("query", "verb", verb),
276
+ seedPart("query", "name", name)
277
+ ].join(SEED_SEP);
278
+ }
279
+ function deriveQueryGuid(group, verb, name) {
280
+ const seed = `query:${querySeedName(group, verb, name)}`;
281
+ const guid = getLockedGuid(seed) ?? getLockedGuid(`query:${name}`) ?? rawDeriveGuid(seed);
282
+ SEEN_SEEDS.set(guid, seed);
283
+ return guid;
284
+ }
285
+ function queryGroupComponent(ref) {
286
+ if (ref.apiGroupId !== void 0) return `#${ref.apiGroupId}`;
287
+ const group = ref.apiGroup;
288
+ if (group === void 0) return "";
289
+ return typeof group === "string" ? group : group.name;
290
+ }
291
+ function resolveQueryRef(target) {
292
+ if (typeof target !== "string" && target.guid) {
293
+ if (target.name) SEEN_SEEDS.set(target.guid, `query:${target.name}`);
294
+ return target.guid;
295
+ }
296
+ const handle = typeof target === "string" ? void 0 : target;
297
+ if (handle?.verb !== void 0 && handle.name) {
298
+ return deriveQueryGuid(queryGroupComponent(handle), handle.verb, handle.name);
299
+ }
300
+ const label = typeof target === "string" ? `"${target}"` : `"${handle?.name ?? "?"}"`;
301
+ throw new Error(
302
+ `Cannot resolve query reference ${label}: a query's identity is composed from its api group, verb, and name, so a bare name cannot identify one. Pass the query() def handle (it carries all three), or a { name, guid } pair to address an object by explicit identity.`
303
+ );
304
+ }
272
305
  function rawDeriveGuid(seed) {
273
306
  return md5Hex(seed);
274
307
  }
@@ -321,6 +354,30 @@ function resolvePayloadKey(kindOrPayloadKey) {
321
354
  function lockKey(payloadKey, name) {
322
355
  return `${payloadKey}:${name}`;
323
356
  }
357
+ function lockNameForObject(payloadKey, obj, appNameByGuid) {
358
+ if (payloadKey !== "query") return obj.name;
359
+ const verb = typeof obj.verb === "string" ? obj.verb : "";
360
+ const appId = obj.app?.id;
361
+ let group = "";
362
+ if (typeof appId === "string" && appId !== "") {
363
+ group = appNameByGuid.get(appId) ?? appId;
364
+ } else if (typeof appId === "number" && appId !== 0) {
365
+ group = `#${appId}`;
366
+ }
367
+ return [group, verb, obj.name].join("|");
368
+ }
369
+ function appNamesByGuid(appSection) {
370
+ const map = /* @__PURE__ */ new Map();
371
+ if (!Array.isArray(appSection)) return map;
372
+ for (const row of appSection) {
373
+ if (!row || typeof row !== "object") continue;
374
+ const { name, guid } = row;
375
+ if (typeof name === "string" && typeof guid === "string" && guid !== "") {
376
+ map.set(guid, name);
377
+ }
378
+ }
379
+ return map;
380
+ }
324
381
  function emptyLock() {
325
382
  return { version: LOCK_VERSION, objects: {} };
326
383
  }
@@ -508,7 +565,7 @@ function recordObserved(ctx, key, identity) {
508
565
  const prior = ctx.observed[key];
509
566
  if (prior?.guid !== void 0 && identity.guid !== void 0 && prior.guid !== identity.guid) {
510
567
  throw new Error(
511
- `Two exported objects collapse onto lock key "${key}" with different guids (${prior.guid} vs ${identity.guid}) \u2014 two same-kind objects sharing a name: a query verb pair pinning explicit guids, or a kind whose identity is composed from more than the name (a realtime channel is unique per server, a message per channel). The lock keys identity by (type, name) and cannot track both; rename one of the objects.`
568
+ `Two exported objects collapse onto lock key "${key}" with different guids (${prior.guid} vs ${identity.guid}) \u2014 two same-kind objects sharing a name behind explicit guids, or a realtime kind whose identity is composed from more than the name (a channel is unique per server, a message per channel). The lock cannot track both under one key; rename one of the objects.`
512
569
  );
513
570
  }
514
571
  const entry = ctx.lock.objects[key];
@@ -573,6 +630,7 @@ function adoptFromBundle(lock, bundle, bundlePath) {
573
630
  objects[key] = after;
574
631
  }
575
632
  };
633
+ const appNames = appNamesByGuid(sections["app"]);
576
634
  for (const payloadKey of LOCK_PAYLOAD_KEYS) {
577
635
  const arr = sections[payloadKey];
578
636
  if (!Array.isArray(arr)) continue;
@@ -581,18 +639,19 @@ function adoptFromBundle(lock, bundle, bundlePath) {
581
639
  if (!obj || typeof obj !== "object") continue;
582
640
  const o = obj;
583
641
  if (typeof o.name !== "string" || typeof o.guid !== "string" || o.guid === "") continue;
584
- if (namesSeen.has(o.name)) {
642
+ const lockName = lockNameForObject(payloadKey, o, appNames);
643
+ if (namesSeen.has(lockName)) {
585
644
  throw new Error(
586
- `${bundlePath} contains two "${payloadKey}" objects named "${o.name}" (a query verb pair, most likely). The lock keys by (type, name) and cannot represent both \u2014 adoption aborted. Rename one of them engine-side so names are unique, then re-export and re-adopt.`
645
+ `${bundlePath} contains two "${payloadKey}" objects with the identity "${lockName}" \u2014 the lock keys identity per kind and cannot represent both. Adoption aborted; rename one of them engine-side, then re-export and re-adopt.`
587
646
  );
588
647
  }
589
- namesSeen.add(o.name);
648
+ namesSeen.add(lockName);
590
649
  const incoming = { guid: o.guid };
591
650
  if (typeof o.canonical === "string" && o.canonical !== "") {
592
651
  incoming.canonical = o.canonical;
593
652
  canonicalsSeen = true;
594
653
  }
595
- applyEntry(lockKey(payloadKey, o.name), incoming);
654
+ applyEntry(lockKey(payloadKey, lockName), incoming);
596
655
  }
597
656
  }
598
657
  const ws = sections["workspace"];
@@ -663,6 +722,9 @@ export {
663
722
  REFERENCEABLE_KINDS,
664
723
  realtimeChannelSeedName,
665
724
  realtimeMessageSeedName,
725
+ deriveQueryGuid,
726
+ queryGroupComponent,
727
+ resolveQueryRef,
666
728
  deriveGuid,
667
729
  guidSeedHint,
668
730
  resolveRef,
@@ -672,6 +734,8 @@ export {
672
734
  CANONICAL_PAYLOAD_KEYS,
673
735
  resolvePayloadKey,
674
736
  lockKey,
737
+ lockNameForObject,
738
+ appNamesByGuid,
675
739
  emptyLock,
676
740
  parseLock,
677
741
  validateLockModel,
@@ -683,4 +747,4 @@ export {
683
747
  adoptFromBundle,
684
748
  mergeObserved
685
749
  };
686
- //# sourceMappingURL=chunk-EFH4NFPY.js.map
750
+ //# sourceMappingURL=chunk-7JDT4PBU.js.map
@@ -122,6 +122,34 @@ function oauthErrorCode(err) {
122
122
  }
123
123
  return void 0;
124
124
  }
125
+ function oauthErrorResponse(err) {
126
+ const cause = err?.cause;
127
+ return typeof Response !== "undefined" && cause instanceof Response ? cause : void 0;
128
+ }
129
+ var OAUTH_ERROR_CODES = /* @__PURE__ */ new Set([
130
+ "invalid_request",
131
+ "invalid_client",
132
+ "invalid_grant",
133
+ "unauthorized_client",
134
+ "unsupported_grant_type",
135
+ "invalid_scope"
136
+ ]);
137
+ async function resolveOAuthErrorCode(err) {
138
+ const rfc = oauthErrorCode(err);
139
+ if (rfc !== void 0) return rfc;
140
+ const res = oauthErrorResponse(err);
141
+ if (res === void 0 || res.bodyUsed) return void 0;
142
+ try {
143
+ const body = await res.clone().json();
144
+ if (!body || typeof body !== "object") return void 0;
145
+ const fields = body;
146
+ for (const candidate of [fields.error, fields.message, fields.code]) {
147
+ if (typeof candidate === "string" && OAUTH_ERROR_CODES.has(candidate)) return candidate;
148
+ }
149
+ } catch {
150
+ }
151
+ return void 0;
152
+ }
125
153
  var OpenIdProvider = class {
126
154
  constructor(opts) {
127
155
  this.opts = opts;
@@ -470,6 +498,8 @@ export {
470
498
  DEFAULT_PORT,
471
499
  decodeAudience,
472
500
  oauthErrorCode,
501
+ oauthErrorResponse,
502
+ resolveOAuthErrorCode,
473
503
  OpenIdProvider,
474
504
  globalAuthFilePath,
475
505
  localAuthFilePath,
@@ -483,4 +513,4 @@ export {
483
513
  resolveScope,
484
514
  assertHttpsOrigin
485
515
  };
486
- //# sourceMappingURL=chunk-LLWK6H77.js.map
516
+ //# sourceMappingURL=chunk-BKDJN76G.js.map
@@ -13,7 +13,7 @@ import {
13
13
  import {
14
14
  readLockFile,
15
15
  writeLockFile
16
- } from "./chunk-OLQLJY5T.js";
16
+ } from "./chunk-OYMR5AMJ.js";
17
17
  import {
18
18
  detail,
19
19
  info,
@@ -24,7 +24,7 @@ import {
24
24
  Xano,
25
25
  assertSeedIds,
26
26
  coerceSeedRowValues
27
- } from "./chunk-3FQD3QME.js";
27
+ } from "./chunk-FAWNUE2U.js";
28
28
  import {
29
29
  getCommand,
30
30
  getSubcommand,
@@ -44,7 +44,7 @@ import {
44
44
  pathSegment,
45
45
  serializeBundle,
46
46
  tableColumns
47
- } from "./chunk-CQBJNFDK.js";
47
+ } from "./chunk-NJGNUVXR.js";
48
48
  import {
49
49
  WORKSPACE_KEY,
50
50
  createLockContext,
@@ -56,7 +56,7 @@ import {
56
56
  seedLockOverrides,
57
57
  serializeLock,
58
58
  validateLockModel
59
- } from "./chunk-EFH4NFPY.js";
59
+ } from "./chunk-7JDT4PBU.js";
60
60
 
61
61
  // src/emit/cli.ts
62
62
  import { pathToFileURL as pathToFileURL3, fileURLToPath as fileURLToPath3 } from "url";
@@ -955,7 +955,7 @@ async function run(argv) {
955
955
  return;
956
956
  }
957
957
  if (command === "init") {
958
- const { runInitCommand } = await import("./init-command-AY4KSXR5.js");
958
+ const { runInitCommand } = await import("./init-command-VIPWAQYS.js");
959
959
  return runInitCommand(args);
960
960
  }
961
961
  if (command === "completion") {
@@ -970,31 +970,31 @@ async function run(argv) {
970
970
  return runCompletionCommand(shell);
971
971
  }
972
972
  if (command === "upgrade") {
973
- const { runUpgradeCommand } = await import("./upgrade-command-52AAZ3NV.js");
973
+ const { runUpgradeCommand } = await import("./upgrade-command-TZYSGXP7.js");
974
974
  return runUpgradeCommand(args);
975
975
  }
976
976
  if (command === "lock") {
977
- const { runLockCommand } = await import("./lock-commands-MC6I3MZA.js");
977
+ const { runLockCommand } = await import("./lock-commands-7VJKAXV6.js");
978
978
  return runLockCommand(args);
979
979
  }
980
980
  if (command === "login") {
981
- const { runLoginCommand } = await import("./login-command-LCOOOPO2.js");
981
+ const { runLoginCommand } = await import("./login-command-DFCURZLC.js");
982
982
  return runLoginCommand(args);
983
983
  }
984
984
  if (command === "logout") {
985
- const { runLogoutCommand } = await import("./logout-command-J2AG5NKC.js");
985
+ const { runLogoutCommand } = await import("./logout-command-WXVZQCAV.js");
986
986
  return runLogoutCommand(args);
987
987
  }
988
988
  if (command === "deploy") {
989
- const { runDeployCommand } = await import("./deploy-command-MTQQXPOO.js");
989
+ const { runDeployCommand } = await import("./deploy-command-HM57BINV.js");
990
990
  return runDeployCommand(args);
991
991
  }
992
992
  if (command === "ephemeral") {
993
- const { runEphemeralCommand } = await import("./ephemeral-command-K3UJSDS4.js");
993
+ const { runEphemeralCommand } = await import("./ephemeral-command-SD2KLX4P.js");
994
994
  return runEphemeralCommand(args);
995
995
  }
996
996
  if (command === "release") {
997
- const { runReleaseCommand } = await import("./release-command-V4K4IORX.js");
997
+ const { runReleaseCommand } = await import("./release-command-3IET7YII.js");
998
998
  return runReleaseCommand(args);
999
999
  }
1000
1000
  if (command === "sandbox") {
@@ -1002,40 +1002,40 @@ async function run(argv) {
1002
1002
  throw removedSubcommand("sandbox", "deploy");
1003
1003
  }
1004
1004
  if (args.subcommand === "details") {
1005
- const { runSandboxDetailsCommand } = await import("./sandbox-details-command-DMY2KGA2.js");
1005
+ const { runSandboxDetailsCommand } = await import("./sandbox-details-command-EDO56IY3.js");
1006
1006
  return runSandboxDetailsCommand(args);
1007
1007
  }
1008
1008
  if (args.subcommand === "export") {
1009
- const { runSandboxExportCommand } = await import("./sandbox-export-command-R6QMEK3D.js");
1009
+ const { runSandboxExportCommand } = await import("./sandbox-export-command-MO6DEZ7Z.js");
1010
1010
  return runSandboxExportCommand(args);
1011
1011
  }
1012
1012
  if (args.subcommand === "codegen") {
1013
- const { runCodegenCommand } = await import("./codegen-command-6XXOIQ25.js");
1013
+ const { runCodegenCommand } = await import("./codegen-command-DYH4H4TD.js");
1014
1014
  return runCodegenCommand(args, { kind: "sandbox" });
1015
1015
  }
1016
1016
  throw unknownSubcommand("sandbox", args.subcommand);
1017
1017
  }
1018
1018
  if (command === "test") {
1019
- const { runTestCommand } = await import("./test-command-OEBIGOPP.js");
1019
+ const { runTestCommand } = await import("./test-command-S7SMRWMP.js");
1020
1020
  return runTestCommand(args);
1021
1021
  }
1022
1022
  if (command === "workspace") {
1023
- const { runWorkspaceCommand } = await import("./workspace-command-LX5S5N2H.js");
1023
+ const { runWorkspaceCommand } = await import("./workspace-command-X6L7HTXO.js");
1024
1024
  return runWorkspaceCommand(args);
1025
1025
  }
1026
1026
  if (command === "codegen") {
1027
- const { runCodegenCommand } = await import("./codegen-command-6XXOIQ25.js");
1027
+ const { runCodegenCommand } = await import("./codegen-command-DYH4H4TD.js");
1028
1028
  return runCodegenCommand(args, { kind: "file" });
1029
1029
  }
1030
1030
  if (command === "profile") {
1031
1031
  if (args.subcommand !== "me") {
1032
1032
  throw unknownSubcommand("profile", args.subcommand);
1033
1033
  }
1034
- const { runProfileCommand } = await import("./profile-command-ZPC2DPFV.js");
1034
+ const { runProfileCommand } = await import("./profile-command-QJAAUZIV.js");
1035
1035
  return runProfileCommand(args);
1036
1036
  }
1037
1037
  if (command === "whoami") {
1038
- const { runProfileCommand } = await import("./profile-command-ZPC2DPFV.js");
1038
+ const { runProfileCommand } = await import("./profile-command-QJAAUZIV.js");
1039
1039
  return runProfileCommand(args);
1040
1040
  }
1041
1041
  if (command === "marketplace") {
@@ -1052,7 +1052,7 @@ async function run(argv) {
1052
1052
  throw unknownCommand("push");
1053
1053
  }
1054
1054
  if (command === "validate") {
1055
- const { runValidateCommand } = await import("./validate-command-KTLPSSH7.js");
1055
+ const { runValidateCommand } = await import("./validate-command-MMXEVHH3.js");
1056
1056
  return runValidateCommand(args);
1057
1057
  }
1058
1058
  if (command !== "compile" && command !== "export" && command !== "paths" && command !== "routes") {
@@ -1084,7 +1084,7 @@ async function run(argv) {
1084
1084
  }
1085
1085
  async function refreshAgentGuidance() {
1086
1086
  try {
1087
- const { refreshAgentFiles } = await import("./agent-file-refresh-6XT23SLU.js");
1087
+ const { refreshAgentFiles } = await import("./agent-file-refresh-4W37DGXS.js");
1088
1088
  const refreshed = refreshAgentFiles({
1089
1089
  projectDir: process.cwd(),
1090
1090
  sdkVersion: readVersion()
@@ -1317,4 +1317,4 @@ export {
1317
1317
  exportBundleJson,
1318
1318
  compileBundle
1319
1319
  };
1320
- //# sourceMappingURL=chunk-SOCYCBYG.js.map
1320
+ //# sourceMappingURL=chunk-CL2H2WYE.js.map