@xanots/sdk 0.0.5 → 0.0.6

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 (64) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +3 -3
  3. package/dist/.build-fingerprint +1 -1
  4. package/dist/{agent-file-refresh-IJ7GN2FJ.js → agent-file-refresh-6XT23SLU.js} +4 -4
  5. package/dist/bin.js +8 -8
  6. package/dist/branch-commands-R4FR75UW.js +134 -0
  7. package/dist/{chunk-7SISR3CS.js → chunk-2SUCC4DV.js} +2 -2
  8. package/dist/{chunk-BPEEGJJA.js → chunk-3FQD3QME.js} +3 -3
  9. package/dist/{chunk-KXCPZUUM.js → chunk-4HDOP7LH.js} +8 -67
  10. package/dist/{chunk-PGBK64U5.js → chunk-4PTSTDIG.js} +2 -2
  11. package/dist/{live-diff-FP4SFNT4.js → chunk-5HCDZ2XN.js} +67 -6
  12. package/dist/{chunk-5WGEURVI.js → chunk-6AAT2AYQ.js} +21 -1
  13. package/dist/{chunk-APOR6TCV.js → chunk-CEFYM6N5.js} +2 -2
  14. package/dist/{chunk-YUPQOLFX.js → chunk-CQBJNFDK.js} +2 -2
  15. package/dist/{chunk-FN4OQT2J.js → chunk-CU5VOSTW.js} +4 -4
  16. package/dist/{chunk-YUBJLB6G.js → chunk-EFH4NFPY.js} +6 -3
  17. package/dist/chunk-EQW3YT5U.js +159 -0
  18. package/dist/{chunk-CYJ7R3AD.js → chunk-GC7ZQHW7.js} +22 -10
  19. package/dist/{chunk-IVP6TS26.js → chunk-JQLR64UC.js} +6 -5
  20. package/dist/{chunk-PXXLBXOP.js → chunk-JRGDLAEA.js} +2 -2
  21. package/dist/{chunk-WGDAOOXG.js → chunk-MU3O43L2.js} +3 -3
  22. package/dist/{chunk-F5T45NAM.js → chunk-OKNSR7MT.js} +45 -2
  23. package/dist/{chunk-MFIHIS6B.js → chunk-OLQLJY5T.js} +2 -2
  24. package/dist/{chunk-QUUB7HYK.js → chunk-P5C2YKAM.js} +2 -2
  25. package/dist/{chunk-D6OGU2AI.js → chunk-P5OAM3G2.js} +2 -2
  26. package/dist/{chunk-6DHJVLYP.js → chunk-Q77KNEUL.js} +1 -1
  27. package/dist/{chunk-QA5ICJ4M.js → chunk-QVSUMHNN.js} +3 -3
  28. package/dist/{chunk-MS3BRZAZ.js → chunk-SOCYCBYG.js} +45 -22
  29. package/dist/{chunk-OARSPAIE.js → chunk-TYBB7ON3.js} +56 -36
  30. package/dist/{chunk-ZGA5MUNC.js → chunk-Y7BARS25.js} +2 -2
  31. package/dist/cli.d.ts +28 -2
  32. package/dist/cli.js +7 -7
  33. package/dist/{codegen-command-BLOS3GR3.js → codegen-command-6XXOIQ25.js} +16 -16
  34. package/dist/{completion-GHP5RRLQ.js → completion-A6BZ3XGU.js} +8 -7
  35. package/dist/{deploy-command-XOH76USO.js → deploy-command-MTQQXPOO.js} +12 -12
  36. package/dist/{env-target-POGJMD6Q.js → env-target-C5JFLDK3.js} +2 -2
  37. package/dist/{ephemeral-command-46SL27GJ.js → ephemeral-command-K3UJSDS4.js} +5 -5
  38. package/dist/index.d.ts +67 -24
  39. package/dist/index.js +6 -6
  40. package/dist/init-command-AY4KSXR5.js +30 -0
  41. package/dist/internal.js +13 -11
  42. package/dist/{io-7VIA5SON.js → io-65CJNLYI.js} +3 -3
  43. package/dist/live-diff-QK4KC2FJ.js +12 -0
  44. package/dist/{lock-KXOJIGCG.js → lock-PDFCNYUW.js} +2 -2
  45. package/dist/{lock-commands-6UONZW26.js → lock-commands-MC6I3MZA.js} +8 -8
  46. package/dist/{login-command-SG7IWTHW.js → login-command-LCOOOPO2.js} +4 -4
  47. package/dist/{marketplace-command-NKTQ3VPS.js → marketplace-command-BCOAAN2I.js} +3 -3
  48. package/dist/{meta-client-OW5WKWW7.js → meta-client-57ZWVHST.js} +2 -2
  49. package/dist/node.js +10 -10
  50. package/dist/{release-command-FKQ6E3TD.js → release-command-V4K4IORX.js} +191 -23
  51. package/dist/scaffold.d.ts +10 -13
  52. package/dist/scaffold.js +3 -3
  53. package/dist/{test-command-56IAEYHX.js → test-command-OEBIGOPP.js} +4 -4
  54. package/dist/{upgrade-command-M2DZ3ZPD.js → upgrade-command-52AAZ3NV.js} +13 -13
  55. package/dist/{validate-command-CIBQJND7.js → validate-command-KTLPSSH7.js} +10 -10
  56. package/dist/{workspace-command-HZS43PHJ.js → workspace-command-LX5S5N2H.js} +20 -16
  57. package/guides/scaffold.md +3 -2
  58. package/llms/statements-calls.md +1 -1
  59. package/llms/statements-data.md +2 -1
  60. package/llms-full.txt +4 -3
  61. package/llms.txt +1 -1
  62. package/manifest.json +1 -1
  63. package/package.json +1 -1
  64. package/dist/init-command-NCRPVFGE.js +0 -30
@@ -0,0 +1,159 @@
1
+ import {
2
+ describeTransportFailure,
3
+ httpFailure
4
+ } from "./chunk-3IGNIP6R.js";
5
+
6
+ // src/deploy/branch.ts
7
+ var BRANCH_TIMEOUT_MS = 3e4;
8
+ var DEFAULT_BRANCH_LABEL = "v1";
9
+ function endpoint(baseUrl, workspaceId, suffix = "") {
10
+ return `${baseUrl.replace(/\/$/, "")}/api:meta/workspace/${workspaceId}/branch${suffix}`;
11
+ }
12
+ function assertUsableBranchLabel(label, flag) {
13
+ if (label.trim() === "") {
14
+ throw new Error(
15
+ `\`${flag}\` needs a branch label and was given an empty one.
16
+ The engine does not reject an empty label \u2014 it would create a branch with no name, which cannot be selected, promoted or deleted afterwards.`
17
+ );
18
+ }
19
+ if (label === DEFAULT_BRANCH_LABEL) {
20
+ throw new Error(
21
+ `\`${flag}=${DEFAULT_BRANCH_LABEL}\` names the workspace's DEFAULT branch, which is reserved.
22
+ The engine does not store it as an ordinary branch, so it is not caught by an "already exists" check \u2014 targeting it does not stage anything, it writes to the branch every workspace starts on.
23
+ Pick a different label, or drop the flag to release to whichever branch is currently live.`
24
+ );
25
+ }
26
+ }
27
+ async function call(auth, url, init, action) {
28
+ let res;
29
+ try {
30
+ res = await fetch(url, {
31
+ signal: AbortSignal.timeout(BRANCH_TIMEOUT_MS),
32
+ ...init,
33
+ // MERGED, never spread over: a caller passing `Content-Type` would
34
+ // otherwise replace the whole header object and send the request
35
+ // unauthenticated, which reads as a 401 from the endpoint rather than as
36
+ // the local mistake it is. Caller keys win on conflict; `Authorization` is
37
+ // not a key any caller here sets.
38
+ headers: {
39
+ accept: "application/json",
40
+ Authorization: `Bearer ${auth.access_token}`,
41
+ ...init.headers ?? {}
42
+ }
43
+ });
44
+ } catch (err) {
45
+ throw new Error(`${action} could not reach ${url}: ${describeTransportFailure(err)}`, { cause: err });
46
+ }
47
+ const text = await res.text();
48
+ if (!res.ok) {
49
+ throw new Error(httpFailure(action, { status: res.status, statusText: res.statusText }, text));
50
+ }
51
+ return text;
52
+ }
53
+ function toRecord(entry) {
54
+ if (entry === null || typeof entry !== "object") return void 0;
55
+ const row = entry;
56
+ const label = row.label;
57
+ if (typeof label !== "string" || label === "") return void 0;
58
+ return {
59
+ ...typeof row.id === "number" ? { id: row.id } : {},
60
+ label,
61
+ // Absent means false: the list shape omits `live` on non-live rows.
62
+ live: row.live === true,
63
+ backup: row.backup === true,
64
+ ...typeof row.created_at === "string" ? { createdAt: row.created_at } : {}
65
+ };
66
+ }
67
+ async function listBranches(auth, opts) {
68
+ const text = await call(auth, endpoint(opts.baseUrl, opts.workspaceId), { method: "GET" }, "list branches");
69
+ let parsed;
70
+ try {
71
+ parsed = JSON.parse(text);
72
+ } catch {
73
+ throw new Error(`list branches: could not parse the response as JSON:
74
+ ${text}`);
75
+ }
76
+ if (!Array.isArray(parsed)) {
77
+ throw new Error(`list branches: expected an array of branches, got:
78
+ ${text}`);
79
+ }
80
+ return parsed.map(toRecord).filter((b) => b !== void 0);
81
+ }
82
+ function liveBranchLabel(branches) {
83
+ return branches.find((b) => b.live)?.label;
84
+ }
85
+ async function createBranch(auth, opts) {
86
+ assertUsableBranchLabel(opts.label, "branch label");
87
+ const text = await call(
88
+ auth,
89
+ endpoint(opts.baseUrl, opts.workspaceId),
90
+ {
91
+ method: "POST",
92
+ headers: { "Content-Type": "application/json" },
93
+ body: JSON.stringify({
94
+ source_branch: opts.sourceBranch ?? DEFAULT_BRANCH_LABEL,
95
+ label: opts.label,
96
+ description: opts.description ?? ""
97
+ })
98
+ },
99
+ "create branch"
100
+ );
101
+ let parsed;
102
+ try {
103
+ parsed = JSON.parse(text);
104
+ } catch {
105
+ throw new Error(`create branch: could not parse the response as JSON:
106
+ ${text}`);
107
+ }
108
+ const record = toRecord(parsed);
109
+ if (record === void 0) {
110
+ throw new Error(`create branch: the response named no branch:
111
+ ${text}`);
112
+ }
113
+ return record;
114
+ }
115
+ async function setLiveBranch(auth, opts) {
116
+ await call(
117
+ auth,
118
+ `${endpoint(opts.baseUrl, opts.workspaceId, `/${encodeURIComponent(opts.label)}/live`)}`,
119
+ { method: "POST" },
120
+ "set live branch"
121
+ );
122
+ }
123
+ async function deleteBranch(auth, opts) {
124
+ await call(
125
+ auth,
126
+ endpoint(opts.baseUrl, opts.workspaceId, `/${encodeURIComponent(opts.label)}`),
127
+ { method: "DELETE" },
128
+ "delete branch"
129
+ );
130
+ }
131
+ function assertBranchAbsent(branches, label) {
132
+ if (!branches.some((b) => b.label === label)) return;
133
+ throw new Error(
134
+ `A branch named "${label}" already exists in this workspace.
135
+ Releasing into it is not offered: it would be a fresh import over a branch someone may be reviewing, and the SDK cannot tell those apart.
136
+ Pick a label that is free, or delete "${label}" first with \`xanots workspace branch delete ${label}\`.`
137
+ );
138
+ }
139
+ function requireBranch(branches, label) {
140
+ const found = branches.find((b) => b.label === label);
141
+ if (found !== void 0) return found;
142
+ const known = branches.map((b) => b.label).join(", ");
143
+ throw new Error(
144
+ `This workspace has no branch named "${label}".
145
+ ` + (known === "" ? `It reports no branches at all.` : `It has: ${known}`)
146
+ );
147
+ }
148
+
149
+ export {
150
+ assertUsableBranchLabel,
151
+ listBranches,
152
+ liveBranchLabel,
153
+ createBranch,
154
+ setLiveBranch,
155
+ deleteBranch,
156
+ assertBranchAbsent,
157
+ requireBranch
158
+ };
159
+ //# sourceMappingURL=chunk-EQW3YT5U.js.map
@@ -35,7 +35,7 @@ import {
35
35
  registerKind,
36
36
  tableColumns,
37
37
  withFilters
38
- } from "./chunk-YUPQOLFX.js";
38
+ } from "./chunk-CQBJNFDK.js";
39
39
  import {
40
40
  assertPathParamInputs,
41
41
  fillPathParams,
@@ -51,7 +51,7 @@ import {
51
51
  deriveGuid,
52
52
  realtimeChannelSeedName,
53
53
  resolveRef
54
- } from "./chunk-YUBJLB6G.js";
54
+ } from "./chunk-EFH4NFPY.js";
55
55
 
56
56
  // src/statements/set-var.ts
57
57
  var SET_VAR = "mvp:set_var";
@@ -546,29 +546,41 @@ function addonCall(args) {
546
546
  input: encodeCallInput(args.input)
547
547
  }, args);
548
548
  }
549
+ function refuseDerivedIdentity(statement, args) {
550
+ const legacy = args;
551
+ if (legacy.action === void 0 && legacy.package === void 0) return;
552
+ throw new Error(
553
+ `Statement "${statement}": \`action\`/\`package\` named an action and let the SDK derive its id. An action is a third-party package installed onto the instance, so its id is assigned at install and cannot be derived from a name \u2014 a derived one addresses nothing. Pass the installed id instead: \`actionId\` for action.call, or \`traceId\`/\`versionId\`/\`slug\` for action.package.call. Read them off an existing call in a pulled workspace.`
554
+ );
555
+ }
549
556
  function actionCall(args) {
550
557
  args = argsOrEmpty(args);
551
- assertArg("mvp:action", "action", args.action);
558
+ refuseDerivedIdentity("mvp:action", args);
559
+ assertArg("mvp:action", "actionId", args.actionId);
552
560
  return annotate({
553
561
  name: "mvp:action",
554
- context: { run_version: { id: resolveRef("function", args.action) } },
562
+ context: { run_version: { id: args.actionId } },
555
563
  as: args.as,
556
564
  input: encodeCallInput(args.input),
557
- settings_registry: []
565
+ settings_registry: encodeCallInput(args.registry)
558
566
  }, args);
559
567
  }
560
568
  function actionPackageCall(args) {
561
569
  args = argsOrEmpty(args);
570
+ refuseDerivedIdentity("mvp:action_package", args);
571
+ assertArg("mvp:action_package", "traceId", args.traceId);
572
+ assertArg("mvp:action_package", "versionId", args.versionId);
573
+ assertArg("mvp:action_package", "slug", args.slug);
562
574
  return annotate({
563
575
  name: "mvp:action_package",
564
576
  context: {
565
- action: { trace_id: "" },
566
- package: { slug: args.package ?? "" },
567
- package_version: { id: "" }
577
+ action: { trace_id: args.traceId },
578
+ package: { slug: args.slug },
579
+ package_version: { id: args.versionId }
568
580
  },
569
581
  as: args.as,
570
582
  input: encodeCallInput(args.input),
571
- settings_registry: []
583
+ settings_registry: encodeCallInput(args.registry)
572
584
  }, args);
573
585
  }
574
586
  function workflowTestCall(args) {
@@ -3721,4 +3733,4 @@ export {
3721
3733
  workspaceKind,
3722
3734
  workspaceConfig
3723
3735
  };
3724
- //# sourceMappingURL=chunk-CYJ7R3AD.js.map
3736
+ //# sourceMappingURL=chunk-GC7ZQHW7.js.map
@@ -18,8 +18,9 @@ import {
18
18
  liveCommandNames,
19
19
  liveSubcommandNames,
20
20
  renderArgs,
21
- suggest
22
- } from "./chunk-F5T45NAM.js";
21
+ suggest,
22
+ visibleFlags
23
+ } from "./chunk-OKNSR7MT.js";
23
24
 
24
25
  // src/emit/help.ts
25
26
  function table(rows, s, indent = " ", fixedWidth) {
@@ -96,7 +97,7 @@ function renderCommandHelp(command, s = stdoutStyle()) {
96
97
  lines.push("", s.bold("Subcommands"), ...table(rows, s));
97
98
  }
98
99
  lines.push(...argSection(spec.args, s));
99
- lines.push(...flagSection(spec.flags, s));
100
+ lines.push(...flagSection(visibleFlags(spec), s));
100
101
  lines.push(...exampleSection(spec.example, s));
101
102
  if (subs.length > 0) {
102
103
  lines.push("", s.dim(`Run \`xanots ${command} <subcommand> --help\` for a subcommand's flags.`));
@@ -113,7 +114,7 @@ function renderSubcommandHelp(command, sub, s = stdoutStyle()) {
113
114
  `${s.dim("Usage:")} xanots ${command} ${sub}${args ? ` ${args}` : ""} ${s.dim("[options]")}`
114
115
  ];
115
116
  lines.push(...argSection(spec.args, s));
116
- lines.push(...flagSection(spec.flags, s));
117
+ lines.push(...flagSection(visibleFlags(spec), s));
117
118
  lines.push(...exampleSection(spec.example, s));
118
119
  return lines.join("\n") + "\n";
119
120
  }
@@ -245,4 +246,4 @@ export {
245
246
  reportFailure,
246
247
  exitCodeOf
247
248
  };
248
- //# sourceMappingURL=chunk-IVP6TS26.js.map
249
+ //# sourceMappingURL=chunk-JQLR64UC.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  c,
3
3
  resp
4
- } from "./chunk-YUPQOLFX.js";
4
+ } from "./chunk-CQBJNFDK.js";
5
5
 
6
6
  // src/values/expect.ts
7
7
  var TEST_EXPECT_TYPES = [
@@ -90,4 +90,4 @@ export {
90
90
  TEST_EXPECT_TYPES,
91
91
  expect
92
92
  };
93
- //# sourceMappingURL=chunk-PXXLBXOP.js.map
93
+ //# sourceMappingURL=chunk-JRGDLAEA.js.map
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  renderThemeScript
3
- } from "./chunk-QUUB7HYK.js";
3
+ } from "./chunk-P5C2YKAM.js";
4
4
  import {
5
5
  defaultThemeChoice,
6
6
  iconLibraryOf,
7
7
  reactPreset
8
- } from "./chunk-6DHJVLYP.js";
8
+ } from "./chunk-Q77KNEUL.js";
9
9
 
10
10
  // src/emit/frontend-svelte.ts
11
11
  var CODE_CLASS = "bg-muted rounded px-1.5 py-0.5 font-mono text-sm";
@@ -842,4 +842,4 @@ export {
842
842
  allFrontendPresets,
843
843
  resolveFrameworkFlag
844
844
  };
845
- //# sourceMappingURL=chunk-WGDAOOXG.js.map
845
+ //# sourceMappingURL=chunk-MU3O43L2.js.map
@@ -142,6 +142,19 @@ var FLAGS = {
142
142
  "reset-data": { spec: "--reset-data", summary: "Empty every table the bundle carries before importing" },
143
143
  seed: { spec: "--seed", summary: "Write the bundle's table rows (off by default)" },
144
144
  replace: { spec: "--replace", summary: "Wipe the workspace and import in its place, instead of merging" },
145
+ branch: {
146
+ spec: "--branch <label>",
147
+ summary: "Release to this branch instead of the live one (stages logic; schema is shared)"
148
+ },
149
+ "set-live": { spec: "--set-live", summary: "Promote the branch to live once the import lands" },
150
+ "allow-shared-schema-changes": {
151
+ spec: "--allow-shared-schema-changes",
152
+ summary: "Proceed even though table/microservice changes reach every branch"
153
+ },
154
+ "backup-branch": {
155
+ spec: "--backup-branch[=<label>]",
156
+ summary: "Snapshot the live branch before importing, so the release can be rolled back"
157
+ },
145
158
  open: { spec: "--open", summary: "Open the deployed URL in your browser when it lands" },
146
159
  // ── Global (accepted by every command; see GLOBAL_FLAGS) ───────────────
147
160
  json: {
@@ -316,6 +329,10 @@ var COMMANDS = {
316
329
  "reset-data",
317
330
  "seed",
318
331
  "replace",
332
+ "branch",
333
+ "set-live",
334
+ "allow-shared-schema-changes",
335
+ "backup-branch",
319
336
  "yes",
320
337
  { key: "force", summary: "Skip the confirmation prompt (same as --yes)" },
321
338
  "static",
@@ -327,6 +344,13 @@ var COMMANDS = {
327
344
  ...COMPILE,
328
345
  ...AUTH
329
346
  ],
347
+ // Branch-targeted releases are built and tested, but the instance-side
348
+ // support they need is not live yet, so they stay off every discovery
349
+ // surface for now. The flags still parse and run — and the release refuses
350
+ // outright unless the server confirms the branch it planned against, so an
351
+ // instance without support fails closed rather than overwriting production.
352
+ // Delete this line (and nothing else) to announce them.
353
+ unreleasedFlags: ["branch", "set-live", "allow-shared-schema-changes", "backup-branch"],
330
354
  example: "xanots release ./index.ts --dry-run"
331
355
  },
332
356
  validate: {
@@ -365,6 +389,19 @@ var COMMANDS = {
365
389
  flags: ["path", { key: "name", summary: "Output basename (default: `workspace`)" }, ...AUTH],
366
390
  example: "xanots workspace export --path -"
367
391
  },
392
+ branch: {
393
+ // Hidden until instance-side branch support ships — see
394
+ // `release.unreleasedFlags`. The verb works; it is just not advertised.
395
+ unreleased: true,
396
+ summary: "List, promote, or delete its branches",
397
+ display: "workspace branch <list|set-live|delete> [label]",
398
+ args: [
399
+ { name: "verb", required: true },
400
+ { name: "label", required: false }
401
+ ],
402
+ flags: ["yes", ...AUTH],
403
+ example: "xanots workspace branch list"
404
+ },
368
405
  codegen: {
369
406
  summary: "Decode it into a runnable XanoTS project",
370
407
  args: [{ name: "path", required: true, path: true }],
@@ -627,7 +664,12 @@ function flagValues(ref) {
627
664
  function liveSubcommandNames(command) {
628
665
  const subs = getCommand(command)?.subcommands;
629
666
  if (!subs) return [];
630
- return Object.entries(subs).filter(([, spec]) => spec.removed === void 0).map(([name]) => name);
667
+ return Object.entries(subs).filter(([, spec]) => spec.removed === void 0 && spec.unreleased === void 0).map(([name]) => name);
668
+ }
669
+ function visibleFlags(spec) {
670
+ const hidden = spec.unreleasedFlags;
671
+ if (!spec.flags || !hidden || hidden.length === 0) return spec.flags;
672
+ return spec.flags.filter((ref) => !hidden.includes(flagKey(ref)));
631
673
  }
632
674
  function distance(a, b) {
633
675
  let row = Array.from({ length: b.length + 1 }, (_, j) => j);
@@ -673,6 +715,7 @@ export {
673
715
  flagSummary,
674
716
  flagValues,
675
717
  liveSubcommandNames,
718
+ visibleFlags,
676
719
  suggest
677
720
  };
678
- //# sourceMappingURL=chunk-F5T45NAM.js.map
721
+ //# sourceMappingURL=chunk-OKNSR7MT.js.map
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  parseLock,
6
6
  serializeLock
7
- } from "./chunk-YUBJLB6G.js";
7
+ } from "./chunk-EFH4NFPY.js";
8
8
 
9
9
  // src/lock/io.ts
10
10
  import { readFileSync, existsSync } from "fs";
@@ -35,4 +35,4 @@ export {
35
35
  readLockFile,
36
36
  writeLockFile
37
37
  };
38
- //# sourceMappingURL=chunk-MFIHIS6B.js.map
38
+ //# sourceMappingURL=chunk-OLQLJY5T.js.map
@@ -5,7 +5,7 @@ import {
5
5
  fontImports,
6
6
  fontThemeVars,
7
7
  orderedTokens
8
- } from "./chunk-6DHJVLYP.js";
8
+ } from "./chunk-Q77KNEUL.js";
9
9
 
10
10
  // src/emit/init-templates.ts
11
11
  function sdkDep(sdkVersion) {
@@ -887,4 +887,4 @@ export {
887
887
  renderCnUtil,
888
888
  renderApiTs
889
889
  };
890
- //# sourceMappingURL=chunk-QUUB7HYK.js.map
890
+ //# sourceMappingURL=chunk-P5C2YKAM.js.map
@@ -5,7 +5,7 @@ import {
5
5
  presetFilePath,
6
6
  renderPreset,
7
7
  upsertManagedBlock
8
- } from "./chunk-7SISR3CS.js";
8
+ } from "./chunk-2SUCC4DV.js";
9
9
  import {
10
10
  warn
11
11
  } from "./chunk-EZG76F7R.js";
@@ -92,4 +92,4 @@ export {
92
92
  isCI,
93
93
  refreshAgentFiles
94
94
  };
95
- //# sourceMappingURL=chunk-D6OGU2AI.js.map
95
+ //# sourceMappingURL=chunk-P5OAM3G2.js.map
@@ -2041,4 +2041,4 @@ export {
2041
2041
  iconLibraryOf,
2042
2042
  reactPreset
2043
2043
  };
2044
- //# sourceMappingURL=chunk-6DHJVLYP.js.map
2044
+ //# sourceMappingURL=chunk-Q77KNEUL.js.map
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  compileBundle
3
- } from "./chunk-MS3BRZAZ.js";
3
+ } from "./chunk-SOCYCBYG.js";
4
4
  import {
5
5
  missingArgument
6
- } from "./chunk-IVP6TS26.js";
6
+ } from "./chunk-JQLR64UC.js";
7
7
 
8
8
  // src/emit/bundle-input.ts
9
9
  import { existsSync, readFileSync } from "fs";
@@ -34,4 +34,4 @@ export {
34
34
  assertBundleInput,
35
35
  loadBundleText
36
36
  };
37
- //# sourceMappingURL=chunk-QA5ICJ4M.js.map
37
+ //# sourceMappingURL=chunk-QVSUMHNN.js.map
@@ -9,11 +9,11 @@ import {
9
9
  unknownFlag,
10
10
  unknownHelpTopic,
11
11
  unknownSubcommand
12
- } from "./chunk-IVP6TS26.js";
12
+ } from "./chunk-JQLR64UC.js";
13
13
  import {
14
14
  readLockFile,
15
15
  writeLockFile
16
- } from "./chunk-MFIHIS6B.js";
16
+ } from "./chunk-OLQLJY5T.js";
17
17
  import {
18
18
  detail,
19
19
  info,
@@ -24,13 +24,13 @@ import {
24
24
  Xano,
25
25
  assertSeedIds,
26
26
  coerceSeedRowValues
27
- } from "./chunk-BPEEGJJA.js";
27
+ } from "./chunk-3FQD3QME.js";
28
28
  import {
29
29
  getCommand,
30
30
  getSubcommand,
31
31
  isCommand,
32
32
  suggest
33
- } from "./chunk-F5T45NAM.js";
33
+ } from "./chunk-OKNSR7MT.js";
34
34
  import {
35
35
  FILTER_NAMES,
36
36
  KNOWLEDGE_DIR,
@@ -44,7 +44,7 @@ import {
44
44
  pathSegment,
45
45
  serializeBundle,
46
46
  tableColumns
47
- } from "./chunk-YUPQOLFX.js";
47
+ } from "./chunk-CQBJNFDK.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-YUBJLB6G.js";
59
+ } from "./chunk-EFH4NFPY.js";
60
60
 
61
61
  // src/emit/cli.ts
62
62
  import { pathToFileURL as pathToFileURL3, fileURLToPath as fileURLToPath3 } from "url";
@@ -430,6 +430,10 @@ function parseArgs(argv) {
430
430
  let resetData = false;
431
431
  let seed = false;
432
432
  let replace = false;
433
+ let branch;
434
+ let setLive = false;
435
+ let allowSharedSchemaChanges = false;
436
+ let backupBranch;
433
437
  let emit2;
434
438
  let json = false;
435
439
  let open = false;
@@ -624,6 +628,21 @@ function parseArgs(argv) {
624
628
  seed = true;
625
629
  } else if (arg === "--replace") {
626
630
  replace = true;
631
+ } else if (arg === "--branch" || arg.startsWith("--branch=")) {
632
+ const value = arg === "--branch" ? rest[++i] : arg.slice("--branch=".length);
633
+ if (value === void 0 || value === "") {
634
+ throw new Error("--branch expects a branch label (e.g. `--branch staging`).");
635
+ }
636
+ branch = value;
637
+ } else if (arg === "--set-live") {
638
+ setLive = true;
639
+ } else if (arg === "--allow-shared-schema-changes") {
640
+ allowSharedSchemaChanges = true;
641
+ } else if (arg === "--backup-branch") {
642
+ backupBranch = true;
643
+ } else if (arg.startsWith("--backup-branch=")) {
644
+ const value = arg.slice("--backup-branch=".length);
645
+ backupBranch = value === "" ? true : value;
627
646
  } else if (arg === "--json") {
628
647
  json = true;
629
648
  } else if (arg === "--open") {
@@ -724,6 +743,10 @@ function parseArgs(argv) {
724
743
  resetData,
725
744
  seed,
726
745
  replace,
746
+ branch,
747
+ setLive,
748
+ allowSharedSchemaChanges,
749
+ backupBranch,
727
750
  emit: emit2,
728
751
  json,
729
752
  open,
@@ -932,11 +955,11 @@ async function run(argv) {
932
955
  return;
933
956
  }
934
957
  if (command === "init") {
935
- const { runInitCommand } = await import("./init-command-NCRPVFGE.js");
958
+ const { runInitCommand } = await import("./init-command-AY4KSXR5.js");
936
959
  return runInitCommand(args);
937
960
  }
938
961
  if (command === "completion") {
939
- const { isCompletionShell, runCompletionCommand, COMPLETION_SHELLS } = await import("./completion-GHP5RRLQ.js");
962
+ const { isCompletionShell, runCompletionCommand, COMPLETION_SHELLS } = await import("./completion-A6BZ3XGU.js");
940
963
  const shell = args.positionals[0];
941
964
  if (shell === void 0 || !isCompletionShell(shell)) {
942
965
  throw new UsageError(
@@ -947,15 +970,15 @@ async function run(argv) {
947
970
  return runCompletionCommand(shell);
948
971
  }
949
972
  if (command === "upgrade") {
950
- const { runUpgradeCommand } = await import("./upgrade-command-M2DZ3ZPD.js");
973
+ const { runUpgradeCommand } = await import("./upgrade-command-52AAZ3NV.js");
951
974
  return runUpgradeCommand(args);
952
975
  }
953
976
  if (command === "lock") {
954
- const { runLockCommand } = await import("./lock-commands-6UONZW26.js");
977
+ const { runLockCommand } = await import("./lock-commands-MC6I3MZA.js");
955
978
  return runLockCommand(args);
956
979
  }
957
980
  if (command === "login") {
958
- const { runLoginCommand } = await import("./login-command-SG7IWTHW.js");
981
+ const { runLoginCommand } = await import("./login-command-LCOOOPO2.js");
959
982
  return runLoginCommand(args);
960
983
  }
961
984
  if (command === "logout") {
@@ -963,15 +986,15 @@ async function run(argv) {
963
986
  return runLogoutCommand(args);
964
987
  }
965
988
  if (command === "deploy") {
966
- const { runDeployCommand } = await import("./deploy-command-XOH76USO.js");
989
+ const { runDeployCommand } = await import("./deploy-command-MTQQXPOO.js");
967
990
  return runDeployCommand(args);
968
991
  }
969
992
  if (command === "ephemeral") {
970
- const { runEphemeralCommand } = await import("./ephemeral-command-46SL27GJ.js");
993
+ const { runEphemeralCommand } = await import("./ephemeral-command-K3UJSDS4.js");
971
994
  return runEphemeralCommand(args);
972
995
  }
973
996
  if (command === "release") {
974
- const { runReleaseCommand } = await import("./release-command-FKQ6E3TD.js");
997
+ const { runReleaseCommand } = await import("./release-command-V4K4IORX.js");
975
998
  return runReleaseCommand(args);
976
999
  }
977
1000
  if (command === "sandbox") {
@@ -987,21 +1010,21 @@ async function run(argv) {
987
1010
  return runSandboxExportCommand(args);
988
1011
  }
989
1012
  if (args.subcommand === "codegen") {
990
- const { runCodegenCommand } = await import("./codegen-command-BLOS3GR3.js");
1013
+ const { runCodegenCommand } = await import("./codegen-command-6XXOIQ25.js");
991
1014
  return runCodegenCommand(args, { kind: "sandbox" });
992
1015
  }
993
1016
  throw unknownSubcommand("sandbox", args.subcommand);
994
1017
  }
995
1018
  if (command === "test") {
996
- const { runTestCommand } = await import("./test-command-56IAEYHX.js");
1019
+ const { runTestCommand } = await import("./test-command-OEBIGOPP.js");
997
1020
  return runTestCommand(args);
998
1021
  }
999
1022
  if (command === "workspace") {
1000
- const { runWorkspaceCommand } = await import("./workspace-command-HZS43PHJ.js");
1023
+ const { runWorkspaceCommand } = await import("./workspace-command-LX5S5N2H.js");
1001
1024
  return runWorkspaceCommand(args);
1002
1025
  }
1003
1026
  if (command === "codegen") {
1004
- const { runCodegenCommand } = await import("./codegen-command-BLOS3GR3.js");
1027
+ const { runCodegenCommand } = await import("./codegen-command-6XXOIQ25.js");
1005
1028
  return runCodegenCommand(args, { kind: "file" });
1006
1029
  }
1007
1030
  if (command === "profile") {
@@ -1019,7 +1042,7 @@ async function run(argv) {
1019
1042
  if (!["list", "search", "details", "install"].includes(args.subcommand ?? "")) {
1020
1043
  throw unknownSubcommand("marketplace", args.subcommand);
1021
1044
  }
1022
- const marketplace = await import("./marketplace-command-NKTQ3VPS.js");
1045
+ const marketplace = await import("./marketplace-command-BCOAAN2I.js");
1023
1046
  if (args.subcommand === "list") return marketplace.runMarketplaceListCommand(args);
1024
1047
  if (args.subcommand === "search") return marketplace.runMarketplaceSearchCommand(args);
1025
1048
  if (args.subcommand === "details") return marketplace.runMarketplaceDetailsCommand(args);
@@ -1029,7 +1052,7 @@ async function run(argv) {
1029
1052
  throw unknownCommand("push");
1030
1053
  }
1031
1054
  if (command === "validate") {
1032
- const { runValidateCommand } = await import("./validate-command-CIBQJND7.js");
1055
+ const { runValidateCommand } = await import("./validate-command-KTLPSSH7.js");
1033
1056
  return runValidateCommand(args);
1034
1057
  }
1035
1058
  if (command !== "compile" && command !== "export" && command !== "paths" && command !== "routes") {
@@ -1061,7 +1084,7 @@ async function run(argv) {
1061
1084
  }
1062
1085
  async function refreshAgentGuidance() {
1063
1086
  try {
1064
- const { refreshAgentFiles } = await import("./agent-file-refresh-IJ7GN2FJ.js");
1087
+ const { refreshAgentFiles } = await import("./agent-file-refresh-6XT23SLU.js");
1065
1088
  const refreshed = refreshAgentFiles({
1066
1089
  projectDir: process.cwd(),
1067
1090
  sdkVersion: readVersion()
@@ -1294,4 +1317,4 @@ export {
1294
1317
  exportBundleJson,
1295
1318
  compileBundle
1296
1319
  };
1297
- //# sourceMappingURL=chunk-MS3BRZAZ.js.map
1320
+ //# sourceMappingURL=chunk-SOCYCBYG.js.map