contentrain 0.10.0 → 0.11.1

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 (87) hide show
  1. package/README.md +4 -0
  2. package/dist/{activity-DP5wjWLV.mjs → activity-3JA0eECa.mjs} +2 -2
  3. package/dist/{branches-D_LPptfM.mjs → branches-g2vq3Ka-.mjs} +2 -2
  4. package/dist/{cdn-build-BuacuDbL.mjs → cdn-build-BT87QXnP.mjs} +2 -2
  5. package/dist/{cdn-init-CGl8-QCR.mjs → cdn-init-DU_kUt56.mjs} +2 -2
  6. package/dist/{connect-CKx-SfQ7.mjs → connect-BgrS9le_.mjs} +2 -2
  7. package/dist/index.mjs +10 -9
  8. package/dist/{login-yLBoeLVM.mjs → login-BBrpSIn2.mjs} +2 -2
  9. package/dist/{logout-DBm34b7e.mjs → logout-6UriBhYh.mjs} +1 -1
  10. package/dist/{merge-pPg9upjo.mjs → merge-CfnE33IP.mjs} +7 -1
  11. package/dist/reconcile-B69abfnm.mjs +154 -0
  12. package/dist/{resolve-context-DPdtEC0i.mjs → resolve-context-CczlaT6o.mjs} +1 -1
  13. package/dist/{serve-BbJlmK0r.mjs → serve-KyrZZLh4.mjs} +2 -2
  14. package/dist/serve-ui/assets/{AgentPromptGroup.vue_vue_type_script_setup_true_lang-DGijfAoG.js → AgentPromptGroup.vue_vue_type_script_setup_true_lang-aUmPXZcx.js} +1 -1
  15. package/dist/serve-ui/assets/{AppLayout-Cu18nQFJ.js → AppLayout-DDDJN8hd.js} +1 -1
  16. package/dist/serve-ui/assets/BranchDetailPage-DSCFVd50.js +17 -0
  17. package/dist/serve-ui/assets/{BranchesPage-hxZVqEWG.js → BranchesPage-BVmuLtHJ.js} +1 -1
  18. package/dist/serve-ui/assets/{CardContent.vue_vue_type_script_setup_true_lang-Wep4RMkj.js → CardContent.vue_vue_type_script_setup_true_lang-wzodQHah.js} +1 -1
  19. package/dist/serve-ui/assets/{CollapsibleTrigger.vue_vue_type_script_setup_true_lang-ClPT-9J4.js → CollapsibleTrigger.vue_vue_type_script_setup_true_lang-C1wEA-d3.js} +1 -1
  20. package/dist/serve-ui/assets/{Collection-CvRfhUB7.js → Collection-Dyohp6vl.js} +1 -1
  21. package/dist/serve-ui/assets/ConfigProvider-Drzuc2zO.js +1 -0
  22. package/dist/serve-ui/assets/{ContentListPage-KrCopmD6.js → ContentListPage-DLul5bLF.js} +1 -1
  23. package/dist/serve-ui/assets/{ContentPage-RYWcjK9c.js → ContentPage-C88ixXsn.js} +1 -1
  24. package/dist/serve-ui/assets/{DashboardPage-B_M6WKld.js → DashboardPage-912g0zec.js} +1 -1
  25. package/dist/serve-ui/assets/{DialogTitle.vue_vue_type_script_setup_true_lang-VT8-tcWV.js → DialogTitle.vue_vue_type_script_setup_true_lang-De8dcLW1.js} +1 -1
  26. package/dist/serve-ui/assets/{DoctorPage-DMnd50Qe.js → DoctorPage-8KnO4Jfu.js} +1 -1
  27. package/dist/serve-ui/assets/{FormatReferencePage-8Y_dGr6K.js → FormatReferencePage-Br_KVDzu.js} +1 -1
  28. package/dist/serve-ui/assets/{Input.vue_vue_type_script_setup_true_lang-DTg5x_1H.js → Input.vue_vue_type_script_setup_true_lang-BKEszmi1.js} +1 -1
  29. package/dist/serve-ui/assets/{ModelDetailPage-3-G2J9oZ.js → ModelDetailPage-Dv1zkw9M.js} +1 -1
  30. package/dist/serve-ui/assets/{ModelsPage-7bZuwfxB.js → ModelsPage-oF-MdIjs.js} +1 -1
  31. package/dist/serve-ui/assets/NormalizePage-Dd5GQiVd.js +11 -0
  32. package/dist/serve-ui/assets/{PageHeader.vue_vue_type_script_setup_true_lang-f_qa-M1s.js → PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js} +1 -1
  33. package/dist/serve-ui/assets/{Presence-CfATKqRO.js → Presence-CwTW6JV8.js} +1 -1
  34. package/dist/serve-ui/assets/{Separator.vue_vue_type_script_setup_true_lang-D-ZdYJPm.js → Separator.vue_vue_type_script_setup_true_lang-Cfw9azsF.js} +1 -1
  35. package/dist/serve-ui/assets/{StudioHint.vue_vue_type_script_setup_true_lang-C_9M35tB.js → StudioHint.vue_vue_type_script_setup_true_lang-njj2MiMe.js} +1 -1
  36. package/dist/serve-ui/assets/{TrustBadge.vue_vue_type_script_setup_true_lang-CNzxpJIB.js → TrustBadge.vue_vue_type_script_setup_true_lang-CKSr5l6Z.js} +1 -1
  37. package/dist/serve-ui/assets/{ValidatePage-Ci8Njrjy.js → ValidatePage-CfGlf3r6.js} +1 -1
  38. package/dist/serve-ui/assets/{arrow-down-DuuSrZrX.js → arrow-down-k7y8IG0A.js} +1 -1
  39. package/dist/serve-ui/assets/{arrow-left-Dxkqq18_.js → arrow-left-Db-cyAsD.js} +1 -1
  40. package/dist/serve-ui/assets/{book-marked-BJCFfYPg.js → book-marked-Do-N1OrO.js} +1 -1
  41. package/dist/serve-ui/assets/{book-open-BrhESfqB.js → book-open-C5gyxyGy.js} +1 -1
  42. package/dist/serve-ui/assets/{box-DnDvmOFz.js → box-BP-1CTkM.js} +1 -1
  43. package/dist/serve-ui/assets/{chevron-down-DxPRdtQ2.js → chevron-down-DYr0P7tu.js} +1 -1
  44. package/dist/serve-ui/assets/{chevron-right-4fFpOcQY.js → chevron-right-DyOhl-vS.js} +1 -1
  45. package/dist/serve-ui/assets/{circle-alert-DHoba5Yl.js → circle-alert-CK5y4MwL.js} +1 -1
  46. package/dist/serve-ui/assets/{content-CUJS4qD7.js → content-CpU25d4T.js} +1 -1
  47. package/dist/serve-ui/assets/{database-DXeLd4fP.js → database-Yx3eEqcB.js} +1 -1
  48. package/dist/serve-ui/assets/{file-code-DAeYB6-U.js → file-code-BUzIo-9Q.js} +1 -1
  49. package/dist/serve-ui/assets/{file-text-CNkcFAch.js → file-text-Cb1CMf3W.js} +1 -1
  50. package/dist/serve-ui/assets/{git-branch-C8WJyunb.js → git-branch-BIn35AbU.js} +1 -1
  51. package/dist/serve-ui/assets/{git-merge-zRH3kO3U.js → git-merge-Kep8fChm.js} +1 -1
  52. package/dist/serve-ui/assets/{hash-CXM2KyoG.js → hash-CgFntI-_.js} +1 -1
  53. package/dist/serve-ui/assets/{index-ChZMsiq8.js → index-DRccbFO1.js} +2 -2
  54. package/dist/serve-ui/assets/{languages-DJeX1WoO.js → languages-CZzFhI1_.js} +1 -1
  55. package/dist/serve-ui/assets/{plus-BKiDA6K4.js → plus-DZbd3Qbv.js} +1 -1
  56. package/dist/serve-ui/assets/{project-CoRDn0ek.js → project-Qe0nJIFZ.js} +1 -1
  57. package/dist/serve-ui/assets/{scan-search-D5bwEyY7.js → scan-search-DgPppelD.js} +1 -1
  58. package/dist/serve-ui/assets/{settings-BmVCntIC.js → settings-BzrU1Pv6.js} +1 -1
  59. package/dist/serve-ui/assets/{shield-check-CiRjJIVW.js → shield-check-COBaQC43.js} +1 -1
  60. package/dist/serve-ui/assets/{stethoscope-B8Z0pam_.js → stethoscope-CF0BFg7y.js} +1 -1
  61. package/dist/serve-ui/assets/{trash-2-B_0ZPRjy.js → trash-2-CO6c5OwW.js} +1 -1
  62. package/dist/serve-ui/assets/useDirection-CfSipebM.js +1 -0
  63. package/dist/serve-ui/assets/{useId-D0eDf3m4.js → useId-D77Djrst.js} +1 -1
  64. package/dist/serve-ui/assets/{useNonce-CiRlnwG8.js → useNonce-B9x5H0aQ.js} +1 -1
  65. package/dist/serve-ui/assets/{useWatch-BEMqYN2q.js → useWatch-jK8PaHZV.js} +1 -1
  66. package/dist/serve-ui/index.html +1 -1
  67. package/dist/{server-Dsv_Afjl.mjs → server-BD2qBZB1.mjs} +15 -6
  68. package/dist/{status-BAQ8GFyN.mjs → status-BRo3eFxi.mjs} +2 -2
  69. package/dist/{status-DhhEDuTh.mjs → status-RzPLgczw.mjs} +14 -15
  70. package/dist/studio-CbILv2hl.mjs +24 -0
  71. package/dist/{submissions-JTtZXvcf.mjs → submissions-BDEURUE9.mjs} +2 -2
  72. package/dist/{usage-CC7Chuf6.mjs → usage-0MVnFzfq.mjs} +2 -2
  73. package/dist/{webhooks-C-D4zHq8.mjs → webhooks-CjQ03K_4.mjs} +2 -2
  74. package/dist/{whoami-D0ZYvnWU.mjs → whoami-JXOEA4vl.mjs} +1 -1
  75. package/package.json +4 -4
  76. package/dist/serve-ui/assets/BranchDetailPage-B5Zb4CWG.js +0 -17
  77. package/dist/serve-ui/assets/ConfigProvider-DPWUDqGh.js +0 -1
  78. package/dist/serve-ui/assets/NormalizePage-D1ACHOOk.js +0 -11
  79. package/dist/serve-ui/assets/useDirection-BO2bsovR.js +0 -1
  80. package/dist/studio-aKJw68fB.mjs +0 -24
  81. /package/dist/{client-CJsHr9Db.mjs → client-CaL6uO8q.mjs} +0 -0
  82. /package/dist/{demo-DP9ceYhe.mjs → demo-C8bRXPnQ.mjs} +0 -0
  83. /package/dist/{oauth-server-BSgPLV_2.mjs → oauth-server--RbeH3Ex.mjs} +0 -0
  84. /package/dist/{scaffold-irxW-vdX.mjs → scaffold-DfAeDGjo.mjs} +0 -0
  85. /package/dist/{setup-seyBYKIP.mjs → setup-B0fn4CI0.mjs} +0 -0
  86. /package/dist/{skills-X_wFbJXX.mjs → skills-DKI702Oz.mjs} +0 -0
  87. /package/dist/{validate-CBPJDGH4.mjs → validate-D3IhiwXy.mjs} +0 -0
package/README.md CHANGED
@@ -66,6 +66,7 @@ Example: `contentrain --debug status` or `CONTENTRAIN_DEBUG=1 contentrain valida
66
66
  | `contentrain generate` | Generate `.contentrain/client/` and `#contentrain` package imports |
67
67
  | `contentrain diff` | Review and merge or reject pending `cr/*` branches interactively |
68
68
  | `contentrain merge <branch>` | Merge one pending `cr/*` branch non-interactively (CI/agents); deletes its remote copy |
69
+ | `contentrain reconcile` | Content-aware three-way merge of a diverged contentrain ↔ base pair (dry-run plan, interactive decisions) |
69
70
  | `contentrain prune` | Delete merged `cr/*` branches locally and on the remote (backlog drain) |
70
71
  | `contentrain describe <model>` | Inspect a model's schema, stats, and import snippet |
71
72
  | `contentrain describe-format` | Print the Contentrain content-format specification |
@@ -98,6 +99,7 @@ Every read command supports `--json` for CI use; write commands surface `--watch
98
99
  | `generate` | `--json`, `--watch` |
99
100
  | `diff` | `--json` |
100
101
  | `merge` | `--yes` (skip confirm) |
102
+ | `reconcile` | `--yes` (execute a clean plan without prompting), `--json` (dry-run plan) |
101
103
  | `prune` | `--dry-run`, `--yes`, `--json` (mutates only with `--yes`) |
102
104
  | `describe` | `--sample`, `--locale`, `--json` |
103
105
  | `scaffold` | `--template <id>`, `--locales <csv>`, `--no-sample`, `--json` |
@@ -242,6 +244,8 @@ This installs:
242
244
 
243
245
  Most write operations create feature branches from the dedicated `contentrain` branch. In review mode, these branches are pushed to remote for team review. In auto-merge mode, they are merged into the `contentrain` branch and baseBranch is advanced via update-ref.
244
246
 
247
+ When baseBranch has diverged (commits `contentrain` lacks — the state a dual-domain migration PR leaves behind), a write is a **partial success**: it lands on `contentrain` and reports `base_advance: "blocked_diverged"` instead of failing. `contentrain status` shows the relation in both directions; `contentrain reconcile` merges the branches content-aware (a two-parent merge commit) so the fast-forward advance works again.
248
+
245
249
  Merging a review branch (via `contentrain merge`, `contentrain diff`, the Serve UI, or the MCP tools) also deletes its remote copy, so merged branches never pile up as phantom pending reviews. The same applies to rejected/deleted drafts. This is best-effort — an offline or permission failure only produces a warning — and can be disabled with `remoteBranchCleanup: false` in `config.json`. Note that deleting a pushed branch closes any open PR/MR on it.
246
250
 
247
251
  Use:
@@ -1,6 +1,6 @@
1
1
  import { i as pc } from "./ui-B8l_LC36.mjs";
2
- import { n as resolveStudioClient } from "./client-CJsHr9Db.mjs";
3
- import { t as resolveStudioContext } from "./resolve-context-DPdtEC0i.mjs";
2
+ import { n as resolveStudioClient } from "./client-CaL6uO8q.mjs";
3
+ import { t as resolveStudioContext } from "./resolve-context-CczlaT6o.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { intro, log, outro, spinner } from "@clack/prompts";
6
6
  //#region src/studio/commands/activity.ts
@@ -1,6 +1,6 @@
1
1
  import { i as pc, r as formatTable, t as formatCount } from "./ui-B8l_LC36.mjs";
2
- import { n as resolveStudioClient } from "./client-CJsHr9Db.mjs";
3
- import { t as resolveStudioContext } from "./resolve-context-DPdtEC0i.mjs";
2
+ import { n as resolveStudioClient } from "./client-CaL6uO8q.mjs";
3
+ import { t as resolveStudioContext } from "./resolve-context-CczlaT6o.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { confirm, intro, isCancel, log, outro, select, spinner } from "@clack/prompts";
6
6
  //#region src/studio/commands/branches.ts
@@ -1,6 +1,6 @@
1
1
  import { i as pc, t as formatCount } from "./ui-B8l_LC36.mjs";
2
- import { n as resolveStudioClient } from "./client-CJsHr9Db.mjs";
3
- import { t as resolveStudioContext } from "./resolve-context-DPdtEC0i.mjs";
2
+ import { n as resolveStudioClient } from "./client-CaL6uO8q.mjs";
3
+ import { t as resolveStudioContext } from "./resolve-context-CczlaT6o.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { intro, log, outro, spinner } from "@clack/prompts";
6
6
  //#region src/studio/commands/cdn-build.ts
@@ -1,6 +1,6 @@
1
1
  import { i as pc } from "./ui-B8l_LC36.mjs";
2
- import { n as resolveStudioClient } from "./client-CJsHr9Db.mjs";
3
- import { t as resolveStudioContext } from "./resolve-context-DPdtEC0i.mjs";
2
+ import { n as resolveStudioClient } from "./client-CaL6uO8q.mjs";
3
+ import { t as resolveStudioContext } from "./resolve-context-CczlaT6o.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { confirm, intro, isCancel, log, outro, spinner } from "@clack/prompts";
6
6
  //#region src/studio/commands/cdn-init.ts
@@ -1,6 +1,6 @@
1
1
  import { i as pc } from "./ui-B8l_LC36.mjs";
2
- import { c as saveDefaults, n as resolveStudioClient } from "./client-CJsHr9Db.mjs";
3
- import { n as openBrowser, t as startOAuthServer } from "./oauth-server-BSgPLV_2.mjs";
2
+ import { c as saveDefaults, n as resolveStudioClient } from "./client-CaL6uO8q.mjs";
3
+ import { n as openBrowser, t as startOAuthServer } from "./oauth-server--RbeH3Ex.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { confirm, intro, isCancel, log, outro, select, spinner, text } from "@clack/prompts";
6
6
  import { createGit } from "@contentrain/mcp/git/identity";
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { i as pc } from "./ui-B8l_LC36.mjs";
3
3
  import { defineCommand, runMain } from "citty";
4
4
  //#region package.json
5
- var version = "0.10.0";
5
+ var version = "0.11.1";
6
6
  //#endregion
7
7
  //#region src/utils/debug.ts
8
8
  /**
@@ -44,20 +44,21 @@ runMain(defineCommand({
44
44
  },
45
45
  subCommands: {
46
46
  init: () => import("./init-BYzWdWAH.mjs").then((m) => m.default),
47
- status: () => import("./status-DhhEDuTh.mjs").then((m) => m.default),
47
+ status: () => import("./status-RzPLgczw.mjs").then((m) => m.default),
48
48
  doctor: () => import("./doctor-MOf_LQEL.mjs").then((m) => m.default),
49
- validate: () => import("./validate-CBPJDGH4.mjs").then((m) => m.default),
50
- serve: () => import("./serve-BbJlmK0r.mjs").then((m) => m.default),
49
+ validate: () => import("./validate-D3IhiwXy.mjs").then((m) => m.default),
50
+ serve: () => import("./serve-KyrZZLh4.mjs").then((m) => m.default),
51
51
  generate: () => import("./generate-VI3xEA3Q.mjs").then((m) => m.default),
52
52
  diff: () => import("./diff-BUGOF3SZ.mjs").then((m) => m.default),
53
- merge: () => import("./merge-pPg9upjo.mjs").then((m) => m.default),
53
+ merge: () => import("./merge-CfnE33IP.mjs").then((m) => m.default),
54
+ reconcile: () => import("./reconcile-B69abfnm.mjs").then((m) => m.default),
54
55
  prune: () => import("./prune-DCcyYVcD.mjs").then((m) => m.default),
55
56
  describe: () => import("./describe-CpQROC9y.mjs").then((m) => m.default),
56
57
  "describe-format": () => import("./describe-format-CUAqB0C4.mjs").then((m) => m.default),
57
- scaffold: () => import("./scaffold-irxW-vdX.mjs").then((m) => m.default),
58
- setup: () => import("./setup-seyBYKIP.mjs").then((m) => m.default),
59
- skills: () => import("./skills-X_wFbJXX.mjs").then((m) => m.default),
60
- studio: () => import("./studio-aKJw68fB.mjs").then((m) => m.default)
58
+ scaffold: () => import("./scaffold-DfAeDGjo.mjs").then((m) => m.default),
59
+ setup: () => import("./setup-B0fn4CI0.mjs").then((m) => m.default),
60
+ skills: () => import("./skills-DKI702Oz.mjs").then((m) => m.default),
61
+ studio: () => import("./studio-CbILv2hl.mjs").then((m) => m.default)
61
62
  }
62
63
  }));
63
64
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { i as pc } from "./ui-B8l_LC36.mjs";
2
- import { i as checkPermissions, o as loadCredentials, s as saveCredentials, t as StudioApiClient } from "./client-CJsHr9Db.mjs";
3
- import { n as openBrowser, t as startOAuthServer } from "./oauth-server-BSgPLV_2.mjs";
2
+ import { i as checkPermissions, o as loadCredentials, s as saveCredentials, t as StudioApiClient } from "./client-CaL6uO8q.mjs";
3
+ import { n as openBrowser, t as startOAuthServer } from "./oauth-server--RbeH3Ex.mjs";
4
4
  import { defineCommand } from "citty";
5
5
  import { confirm, intro, isCancel, log, outro, select, spinner } from "@clack/prompts";
6
6
  //#region src/studio/commands/login.ts
@@ -1,5 +1,5 @@
1
1
  import { i as pc } from "./ui-B8l_LC36.mjs";
2
- import { a as clearCredentials, o as loadCredentials, t as StudioApiClient } from "./client-CJsHr9Db.mjs";
2
+ import { a as clearCredentials, o as loadCredentials, t as StudioApiClient } from "./client-CaL6uO8q.mjs";
3
3
  import { defineCommand } from "citty";
4
4
  import { intro, log, outro } from "@clack/prompts";
5
5
  //#region src/studio/commands/logout.ts
@@ -5,6 +5,7 @@ import { confirm, intro, isCancel, log, outro } from "@clack/prompts";
5
5
  import { createGit } from "@contentrain/mcp/git/identity";
6
6
  import { CONTENTRAIN_BRANCH } from "@contentrain/types";
7
7
  import { mergeBranch } from "@contentrain/mcp/git/transaction";
8
+ import { normalizeOperationError } from "@contentrain/mcp/git/errors";
8
9
  //#region src/commands/merge.ts
9
10
  /**
10
11
  * One-shot merge of a single contentrain feature branch.
@@ -64,6 +65,8 @@ var merge_default = defineCommand({
64
65
  try {
65
66
  const result = await mergeBranch(projectRoot, branch);
66
67
  log.success(`Merged ${branch} (commit ${result.commit.slice(0, 8)})`);
68
+ if (result.base_advance === "blocked_diverged") log.warning(result.warning ?? "The base branch has diverged and was not advanced — run `contentrain reconcile`.");
69
+ if (result.remote_push === "rejected") log.warning("The remote refused the contentrain push — local and remote have diverged; fetch and run `contentrain reconcile`.");
67
70
  if (result.remote?.deleted) log.message(pc.dim(" Deleted remote copy."));
68
71
  if (result.remote?.warning) log.warning(`Remote copy not deleted: ${result.remote.warning}`);
69
72
  if (result.sync?.synced?.length) log.message(pc.dim(` Synced ${result.sync.synced.length} file(s) to working tree.`));
@@ -73,7 +76,10 @@ var merge_default = defineCommand({
73
76
  if (result.sync.warning) log.message(pc.dim(` ${result.sync.warning}`));
74
77
  }
75
78
  } catch (error) {
76
- log.error(`Merge failed: ${error instanceof Error ? error.message : String(error)}`);
79
+ const normalized = normalizeOperationError(error, "merge");
80
+ log.error(`Merge failed: ${normalized.error}`);
81
+ if (normalized.developer_action) log.message(pc.dim(` Try: ${normalized.developer_action}`));
82
+ else if (normalized.agent_hint) log.message(pc.dim(` ${normalized.agent_hint}`));
77
83
  process.exitCode = 1;
78
84
  return;
79
85
  }
@@ -0,0 +1,154 @@
1
+ import { i as pc } from "./ui-B8l_LC36.mjs";
2
+ import { r as resolveProjectRoot } from "./context-OskMGy8y.mjs";
3
+ import { t as openMcpSession } from "./mcp-client-DVWTex2i.mjs";
4
+ import { defineCommand } from "citty";
5
+ import { intro, isCancel, log, outro, select } from "@clack/prompts";
6
+ //#region src/commands/reconcile.ts
7
+ /**
8
+ * Content-aware reconcile of a diverged contentrain ↔ base pair, wrapping
9
+ * `contentrain_reconcile`. Flow: dry-run → show the plan → interactive
10
+ * ours/theirs decisions for any conflicts → execute with the collected
11
+ * resolutions. `--json` runs the dry-run and mirrors the tool response
12
+ * verbatim; `--yes` executes a CLEAN plan without prompting (conflicts
13
+ * still stop it — a content decision is never defaulted).
14
+ */
15
+ var reconcile_default = defineCommand({
16
+ meta: {
17
+ name: "reconcile",
18
+ description: "Merge a diverged base branch back into the content branch, content-aware"
19
+ },
20
+ args: {
21
+ root: {
22
+ type: "string",
23
+ description: "Project root path",
24
+ required: false
25
+ },
26
+ yes: {
27
+ type: "boolean",
28
+ description: "Execute without prompting when the plan has no conflicts",
29
+ required: false
30
+ },
31
+ json: {
32
+ type: "boolean",
33
+ description: "Emit the dry-run plan as raw JSON for scripts",
34
+ required: false
35
+ }
36
+ },
37
+ async run({ args }) {
38
+ const session = await openMcpSession(await resolveProjectRoot(args.root));
39
+ try {
40
+ const preview = await session.call("contentrain_reconcile", { dry_run: true });
41
+ if (args.json) {
42
+ process.stdout.write(JSON.stringify(preview, null, 2));
43
+ if (preview.error) process.exitCode = 1;
44
+ return;
45
+ }
46
+ intro(pc.bold("contentrain reconcile"));
47
+ if (preview.error) {
48
+ log.error(preview.error);
49
+ process.exitCode = 1;
50
+ return;
51
+ }
52
+ if (preview.status === "in_sync") {
53
+ log.success(preview.message ?? "Branches are already reconciled.");
54
+ outro("");
55
+ return;
56
+ }
57
+ const summary = preview.summary ?? {};
58
+ log.info(pc.bold("Plan"));
59
+ log.message(` Files to merge: ${summary.files_merged ?? 0}`);
60
+ log.message(` Taken from ${pc.cyan("contentrain")}: ${summary.entries_taken_ours ?? 0}`);
61
+ log.message(` Taken from ${preview.base ?? "base"}: ${summary.entries_taken_theirs ?? 0}`);
62
+ log.message(` Field-merged: ${summary.entries_field_merged ?? 0}`);
63
+ for (const change of preview.changes ?? []) log.message(pc.dim(` ${change.action === "delete" ? "−" : "±"} ${change.path}`));
64
+ for (const advisory of preview.advisories ?? []) log.warning(advisory);
65
+ const conflicts = preview.conflicts ?? [];
66
+ const resolutions = [];
67
+ if (conflicts.length > 0) {
68
+ log.warning(pc.bold(`${conflicts.length} conflict(s) need a decision`));
69
+ for (const conflict of conflicts) {
70
+ const where = [
71
+ conflict.key,
72
+ conflict.field,
73
+ conflict.locale
74
+ ].filter(Boolean).join(" · ");
75
+ const choice = await select({
76
+ message: `${conflict.message}${where ? ` (${where})` : ""}`,
77
+ options: [
78
+ {
79
+ value: "theirs",
80
+ label: `Take ${preview.base ?? "base"}${conflict.theirs !== void 0 ? `: ${short(conflict.theirs)}` : ""}${conflict.suggested === "theirs" ? pc.dim(" (suggested)") : ""}`
81
+ },
82
+ {
83
+ value: "ours",
84
+ label: `Keep contentrain${conflict.ours !== void 0 ? `: ${short(conflict.ours)}` : ""}${conflict.suggested === "ours" ? pc.dim(" (suggested)") : ""}`
85
+ },
86
+ {
87
+ value: "skip",
88
+ label: "Decide later (leaves the divergence in place)"
89
+ }
90
+ ]
91
+ });
92
+ if (isCancel(choice)) {
93
+ outro("Cancelled — nothing was written.");
94
+ return;
95
+ }
96
+ if (choice !== "skip") resolutions.push({
97
+ id: conflict.id,
98
+ choose: choice
99
+ });
100
+ }
101
+ if (resolutions.length < conflicts.length) {
102
+ log.warning(`${conflicts.length - resolutions.length} conflict(s) left undecided — run reconcile again when ready.`);
103
+ outro("Nothing was written.");
104
+ return;
105
+ }
106
+ } else if (!args.yes) {
107
+ const go = await select({
108
+ message: `Merge ${preview.base ?? "the base branch"} into contentrain and fast-forward it?`,
109
+ options: [{
110
+ value: "yes",
111
+ label: "Execute the plan"
112
+ }, {
113
+ value: "no",
114
+ label: "Not now"
115
+ }]
116
+ });
117
+ if (isCancel(go) || go === "no") {
118
+ outro("Nothing was written.");
119
+ return;
120
+ }
121
+ }
122
+ const result = await session.call("contentrain_reconcile", {
123
+ dry_run: false,
124
+ ...resolutions.length > 0 ? { resolutions } : {}
125
+ });
126
+ if (result.error) {
127
+ log.error(result.error);
128
+ process.exitCode = 1;
129
+ return;
130
+ }
131
+ if (result.status === "conflicts") {
132
+ log.warning(result.message ?? "Conflicts changed since the preview — run reconcile again.");
133
+ for (const advisory of result.advisories ?? []) log.message(pc.dim(` ${advisory}`));
134
+ process.exitCode = 1;
135
+ return;
136
+ }
137
+ log.success(result.message ?? "Reconciled.");
138
+ if (result.commit) log.message(pc.dim(` Merge commit ${result.commit.slice(0, 8)}`));
139
+ for (const advisory of result.advisories ?? []) log.warning(advisory);
140
+ outro("");
141
+ } catch (error) {
142
+ log.error(error instanceof Error ? error.message : String(error));
143
+ process.exitCode = 1;
144
+ } finally {
145
+ await session.close();
146
+ }
147
+ }
148
+ });
149
+ function short(value) {
150
+ const text = typeof value === "string" ? value : JSON.stringify(value);
151
+ return text.length > 60 ? `${text.slice(0, 57)}…` : text;
152
+ }
153
+ //#endregion
154
+ export { reconcile_default as default };
@@ -1,4 +1,4 @@
1
- import { c as saveDefaults, o as loadCredentials } from "./client-CJsHr9Db.mjs";
1
+ import { c as saveDefaults, o as loadCredentials } from "./client-CaL6uO8q.mjs";
2
2
  import { confirm, isCancel, select } from "@clack/prompts";
3
3
  //#region src/studio/resolve-context.ts
4
4
  /**
@@ -55,7 +55,7 @@ var serve_default = defineCommand({
55
55
  let projectRoot = await resolveProjectRoot(args.root);
56
56
  let demoDir;
57
57
  if (args.demo) {
58
- const { createDemoProject, cleanupDemoProject } = await import("./demo-DP9ceYhe.mjs");
58
+ const { createDemoProject, cleanupDemoProject } = await import("./demo-C8bRXPnQ.mjs");
59
59
  demoDir = await createDemoProject();
60
60
  projectRoot = demoDir;
61
61
  consola.info(`Demo project created at ${demoDir}`);
@@ -139,7 +139,7 @@ var serve_default = defineCommand({
139
139
  consola.warn("Serve UI not found. Running in API-only mode.");
140
140
  consola.info("UI will be available after building: cd packages/cli/src/serve-ui && pnpm build");
141
141
  }
142
- const { createServeApp } = await import("./server-Dsv_Afjl.mjs");
142
+ const { createServeApp } = await import("./server-BD2qBZB1.mjs");
143
143
  const { app, handleUpgrade } = await createServeApp({
144
144
  projectRoot,
145
145
  port,
@@ -1,4 +1,4 @@
1
- import{c as i,a as p,o as t,p as o,q as s,j as u,u as a,B as n,g as m,b as l,r as x,G as d,f as g}from"./index-ChZMsiq8.js";/**
1
+ import{c as i,a as p,o as t,p as o,q as s,j as u,u as a,B as n,g as m,b as l,r as x,G as d,f as g}from"./index-DRccbFO1.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c as K,d as Le,r as w,w as G,a as E,t as se,o as f,b as y,e as g,f as k,n as J,u as t,m as $,g as B,h as C,i as N,j as S,k as X,l as Y,p as L,q as m,s as O,F as Z,v as Q,x as ne,R as he,y as z,z as H,A as be,B as A,C as me,D as pe,E as Pe,G as le}from"./index-ChZMsiq8.js";import{P as W,d as j,_ as ae,r as ge,u as _e}from"./useWatch-BEMqYN2q.js";import{u as Re,S as Te,_ as De}from"./Input.vue_vue_type_script_setup_true_lang-DTg5x_1H.js";import{u as ee}from"./project-CoRDn0ek.js";import{B as ye}from"./box-DnDvmOFz.js";import{F as Se}from"./file-text-CNkcFAch.js";import{S as xe}from"./shield-check-CiRjJIVW.js";import{G as we}from"./git-branch-C8WJyunb.js";import{S as Ie}from"./scan-search-D5bwEyY7.js";import{S as ze}from"./stethoscope-B8Z0pam_.js";import{F as He}from"./file-code-DAeYB6-U.js";import{B as Oe}from"./book-open-BrhESfqB.js";import{u as R,c as ie,a as q,P as te,b as ce,d as Ce,w as Be}from"./Presence-CfATKqRO.js";import{u as Ne}from"./useDirection-BO2bsovR.js";import{c as Me,u as Ve}from"./useNonce-CiRlnwG8.js";import"./ConfigProvider-DPWUDqGh.js";/**
1
+ import{c as K,d as Le,r as w,w as G,a as E,t as se,o as f,b as y,e as g,f as k,n as J,u as t,m as $,g as B,h as C,i as N,j as S,k as X,l as Y,p as L,q as m,s as O,F as Z,v as Q,x as ne,R as he,y as z,z as H,A as be,B as A,C as me,D as pe,E as Pe,G as le}from"./index-DRccbFO1.js";import{P as W,d as j,_ as ae,r as ge,u as _e}from"./useWatch-jK8PaHZV.js";import{u as Re,S as Te,_ as De}from"./Input.vue_vue_type_script_setup_true_lang-BKEszmi1.js";import{u as ee}from"./project-Qe0nJIFZ.js";import{B as ye}from"./box-BP-1CTkM.js";import{F as Se}from"./file-text-Cb1CMf3W.js";import{S as xe}from"./shield-check-COBaQC43.js";import{G as we}from"./git-branch-BIn35AbU.js";import{S as Ie}from"./scan-search-DgPppelD.js";import{S as ze}from"./stethoscope-CF0BFg7y.js";import{F as He}from"./file-code-BUzIo-9Q.js";import{B as Oe}from"./book-open-C5gyxyGy.js";import{u as R,c as ie,a as q,P as te,b as ce,d as Ce,w as Be}from"./Presence-CwTW6JV8.js";import{u as Ne}from"./useDirection-CfSipebM.js";import{c as Me,u as Ve}from"./useNonce-B9x5H0aQ.js";import"./ConfigProvider-Drzuc2zO.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1,17 @@
1
+ import{c as X,a as P,o as a,b as h,e as o,f as T,m as O,u as e,i as ie,z as Z,p as c,y as L,j as t,s as u,g as _,G as D,q as i,B as s,S as xe,Z as be,F as z,x as N,L as E,h as C,r as j,X as J,C as ye,v as ke}from"./index-DRccbFO1.js";import{u as we}from"./content-CpU25d4T.js";import{u as ze}from"./project-Qe0nJIFZ.js";import{a as $,_ as Ce}from"./PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js";import{_ as $e,C as Be,a as G}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-aUmPXZcx.js";import{P as ce,r as De,d as Fe,_ as je,j as Pe}from"./useWatch-jK8PaHZV.js";import{_ as Ie}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CKSr5l6Z.js";import{_ as K,a as Me,b as qe,c as Te}from"./CollapsibleTrigger.vue_vue_type_script_setup_true_lang-C1wEA-d3.js";import{_ as Ae}from"./CardContent.vue_vue_type_script_setup_true_lang-wzodQHah.js";import{_ as Re}from"./Separator.vue_vue_type_script_setup_true_lang-Cfw9azsF.js";import{i as ue,D as Se,_ as Q,b as Y,c as ee,d as te}from"./DialogTitle.vue_vue_type_script_setup_true_lang-De8dcLW1.js";import{b as We,u as Ne}from"./useId-D77Djrst.js";import{u as de}from"./Presence-CwTW6JV8.js";import{A as Le}from"./arrow-left-Db-cyAsD.js";import{G as se}from"./git-merge-Kep8fChm.js";import{G as ae}from"./git-branch-BIn35AbU.js";import{P as Oe,M as Ee}from"./plus-DZbd3Qbv.js";import{F as Ge}from"./file-text-Cb1CMf3W.js";import"./shield-check-COBaQC43.js";import"./getActiveElement-FUKBWQwh.js";import"./ConfigProvider-Drzuc2zO.js";/**
2
+ * @license lucide-vue-next v0.474.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const V=X("CircleCheckBigIcon",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
7
+ * @license lucide-vue-next v0.474.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const re=X("CircleXIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
12
+ * @license lucide-vue-next v0.474.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const U=X("FileIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);var Ve=P({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(x){const g=x;de();const p=ue();return(v,F)=>(a(),h(e(ce),O(g,{id:e(p).descriptionId}),{default:o(()=>[T(v.$slots,"default")]),_:3},16,["id"]))}}),Ue=Ve,Xe=P({__name:"DialogTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(x){const g=x,p=ue(),{forwardRef:v,currentElement:F}=de();return p.contentId||(p.contentId=We(void 0,"reka-dialog-content")),ie(()=>{p.triggerElement.value=F.value}),(I,n)=>(a(),h(e(ce),O(g,{ref:e(v),type:I.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":e(p).open.value||!1,"aria-controls":e(p).open.value?e(p).contentId:void 0,"data-state":e(p).open.value?"open":"closed",onClick:e(p).onOpenToggle}),{default:o(()=>[T(I.$slots,"default")]),_:3},16,["type","aria-expanded","aria-controls","data-state","onClick"]))}}),Ze=Xe;const le=P({__name:"DialogDescription",props:{asChild:{type:Boolean},as:{},class:{type:[Boolean,null,String,Object,Array]}},setup(x){const g=x,p=De(g,"class"),v=Ne(p);return(F,I)=>(a(),h(e(Ue),O({"data-slot":"dialog-description"},e(v),{class:e(Z)("text-muted-foreground text-sm",g.class)}),{default:o(()=>[T(F.$slots,"default")]),_:3},16,["class"]))}}),ne=P({__name:"DialogFooter",props:{class:{type:[Boolean,null,String,Object,Array]},showCloseButton:{type:Boolean,default:!1}},setup(x){const g=x;return(p,v)=>(a(),c("div",{"data-slot":"dialog-footer",class:L(e(Z)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",g.class))},[T(p.$slots,"default"),x.showCloseButton?(a(),h(e(Se),{key:0,"as-child":""},{default:o(()=>[t(e($),{variant:"outline"},{default:o(()=>[...v[0]||(v[0]=[u(" Close ",-1)])]),_:1})]),_:1})):_("",!0)],2))}}),oe=P({__name:"DialogTrigger",props:{asChild:{type:Boolean},as:{}},setup(x){const g=x;return(p,v)=>(a(),h(e(Ze),O({"data-slot":"dialog-trigger"},g),{default:o(()=>[T(p.$slots,"default")]),_:3},16))}}),He="/merge-2.svg",Je={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Ke={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Qe={class:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs"},Ye={class:"px-6 py-6 space-y-4"},et={class:"text-sm"},tt={class:"flex items-start gap-3"},st={class:"flex-1 space-y-2 min-w-0"},at={class:"text-sm font-medium"},rt={class:"text-xs text-muted-foreground"},lt={key:0,class:"text-xs text-muted-foreground"},nt={key:1,class:"space-y-1 mt-1"},ot={class:"text-xs font-medium flex items-center gap-2"},it={class:"space-y-1 font-mono text-xs"},ct={key:2,class:"text-xs text-muted-foreground italic"},ut={key:2,class:"rounded-lg border border-amber-200 bg-amber-50 p-4 dark:border-amber-900 dark:bg-amber-950"},dt={class:"flex items-start gap-3"},pt={class:"flex-1 space-y-2"},ft={class:"text-sm font-medium text-amber-900 dark:text-amber-100"},mt={class:"mt-2 space-y-1 font-mono text-xs text-amber-900/80 dark:text-amber-100/80"},ht={key:3,class:"flex justify-center py-12"},vt={class:"flex items-center gap-4 flex-wrap"},_t={class:"flex items-center gap-2"},gt={class:"text-xs font-mono bg-muted px-2 py-1 rounded"},xt={class:"flex items-center gap-2"},bt={class:"text-xs font-mono bg-primary/10 text-primary px-2 py-1 rounded"},yt={class:"ml-auto flex items-center gap-3 text-xs text-muted-foreground"},kt={class:"flex items-center gap-1"},wt={class:"flex items-center gap-1 text-status-success"},zt={class:"flex items-center gap-1 text-status-error"},Ct={key:0,class:"rounded-lg border border-border bg-muted/30 p-4 font-mono text-xs text-muted-foreground overflow-x-auto whitespace-pre-wrap"},$t={key:1,class:"space-y-3"},Bt={class:"font-mono text-xs text-foreground flex-1 truncate"},Dt={class:"flex items-center gap-2 text-xs shrink-0"},Ft={key:0,class:"text-status-success font-mono"},jt={key:1,class:"text-status-error font-mono"},Pt={class:"max-h-96 overflow-auto custom-scrollbar"},It={class:"p-0 m-0"},Mt={class:"block text-xs leading-5"},qt={key:2,class:"flex flex-col items-center py-12 text-center"},Tt={class:"text-sm text-muted-foreground"},as=P({__name:"BranchDetailPage",setup(x){const g=ke(),p=ye(),v=we(),F=ze(),I=Pe(),n=Fe("serve-ui-texts").locale("en").get(),k=C(()=>decodeURIComponent(g.params.branchName)),b=C(()=>v.branchDiff),w=j(!1),y=j(null),A=j(!1),R=j(!1),B=j(null);async function pe(){try{const f=encodeURIComponent(k.value),r=await I.get(`/branches/${f}/sync-status`);B.value=r.warning}catch{B.value=null}}const d=j(null);async function fe(){d.value=await F.fetchMergePreview(k.value)}const S=C(()=>{const r=k.value.replace("contentrain/","").split("/");return{scope:r[0]??"unknown",target:r.length>2?r.slice(1,-1).join("/"):r[1]??"",timestamp:r.length>2?r[r.length-1]??"":""}}),M=C(()=>{var W;if(!((W=b.value)!=null&&W.diff))return[];const f=b.value.diff,r=[];let l=null;for(const m of f.split(`
17
+ `))if(m.startsWith("diff --git")){l&&r.push(l);const q=m.match(/b\/(.+)$/);l={path:(q==null?void 0:q[1])??"unknown",additions:0,deletions:0,lines:[]},l.lines.push({text:m,type:"header"})}else l&&(m.startsWith("+++")||m.startsWith("---")||m.startsWith("index ")?l.lines.push({text:m,type:"header"}):m.startsWith("@@")?l.lines.push({text:m,type:"hunk"}):m.startsWith("+")?(l.additions++,l.lines.push({text:m,type:"add"})):m.startsWith("-")?(l.deletions++,l.lines.push({text:m,type:"remove"})):l.lines.push({text:m,type:"context"}));return l&&r.push(l),r}),me=C(()=>M.value.reduce((f,r)=>f+r.additions,0)),he=C(()=>M.value.reduce((f,r)=>f+r.deletions,0)),ve=C(()=>k.value.includes("normalize")),H=C(()=>{var r;if(!((r=b.value)!=null&&r.stat))return 0;const f=b.value.stat.match(/(\d+)\s+files?\s+changed/);return f?Number.parseInt(f[1],10):M.value.length});async function _e(){w.value=!0,y.value=null,A.value=!1;try{const f=await v.approveBranch(k.value);f.base_advance==="blocked_diverged"&&f.warning?(y.value={type:"success",message:f.warning},D.success(n["branch-detail.branch-merged-successfully"]),D.warning(f.warning,{duration:1e4})):(y.value={type:"success",message:n["branch-detail.branch-merged-successfully"]},D.success(n["branch-detail.branch-merged-successfully"])),setTimeout(()=>p.push("/branches"),1500)}catch(f){const r=f instanceof Error&&f.message?f.message:n["branch-detail.failed-to-merge-branch"];y.value={type:"error",message:r},D.error(r)}finally{w.value=!1}}async function ge(){w.value=!0,y.value=null,R.value=!1;try{await v.rejectBranch(k.value),y.value={type:"success",message:n["branch-detail.branch-rejected-and-deleted"]},D.success(n["branch-detail.branch-rejected-and-deleted"]),setTimeout(()=>p.push("/branches"),1500)}catch{y.value={type:"error",message:n["branch-detail.failed-to-delete-branch"]},D.error(n["branch-detail.failed-to-delete-branch"])}finally{w.value=!1}}return ie(async()=>{try{await v.fetchBranchDiff(k.value)}catch{D.error("Failed to load branch data.")}pe(),fe()}),(f,r)=>(a(),c("div",null,[t(Ce,{title:S.value.target||S.value.scope,description:e(n)["branch-detail.branch-review-and-diff"]},{actions:o(()=>[t(e($),{variant:"ghost",size:"sm",onClick:r[0]||(r[0]=l=>e(p).push("/branches"))},{default:o(()=>[t(e(Le),{class:"mr-1.5 size-4"}),u(" "+s(e(n)["branch-detail.back"]),1)]),_:1}),t(e(Q),{open:A.value,"onUpdate:open":r[2]||(r[2]=l=>A.value=l)},{default:o(()=>[t(e(oe),{"as-child":""},{default:o(()=>[t(e($),{variant:"default",size:"sm",disabled:w.value||!b.value},{default:o(()=>[t(e(se),{class:"mr-1.5 size-4"}),u(" "+s(e(n)["branch-detail.approve-merge"]),1)]),_:1},8,["disabled"])]),_:1}),t(e(Y),null,{default:o(()=>[t(e(ee),null,{default:o(()=>[t(e(te),null,{default:o(()=>[u(s(e(n)["branch-detail.confirm-merge"]),1)]),_:1}),t(e(le),null,{default:o(()=>{var l;return[u(s(e(n)["branch-detail.this-will-merge"])+" ",1),i("code",Je,s(k.value),1),u(" "+s(e(n)["branch-detail.into"])+" ",1),i("code",Ke,s(((l=b.value)==null?void 0:l.base)??"main"),1),u(" "+s(e(n)["branch-detail.and-delete-the-source"]),1)]}),_:1})]),_:1}),t(e(ne),null,{default:o(()=>[t(e($),{variant:"outline",size:"sm",onClick:r[1]||(r[1]=l=>A.value=!1)},{default:o(()=>[u(s(e(n)["branch-detail.cancel"]),1)]),_:1}),t(e($),{variant:"default",size:"sm",disabled:w.value,onClick:_e},{default:o(()=>[w.value?(a(),h(e(E),{key:0,class:"mr-1.5 size-4 animate-spin"})):(a(),h(e(Be),{key:1,class:"mr-1.5 size-4"})),u(" "+s(e(n)["branch-detail.merge"]),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"]),t(e(Q),{open:R.value,"onUpdate:open":r[4]||(r[4]=l=>R.value=l)},{default:o(()=>[t(e(oe),{"as-child":""},{default:o(()=>[t(e($),{variant:"destructive",size:"sm",disabled:w.value||!b.value},{default:o(()=>[t(e(J),{class:"mr-1.5 size-4"}),u(" "+s(e(n)["branch-detail.reject"]),1)]),_:1},8,["disabled"])]),_:1}),t(e(Y),null,{default:o(()=>[t(e(ee),null,{default:o(()=>[t(e(te),null,{default:o(()=>[u(s(e(n)["branch-detail.confirm-rejection"]),1)]),_:1}),t(e(le),null,{default:o(()=>[u(s(e(n)["branch-detail.this-will-permanently-delete"])+" ",1),i("code",Qe,s(k.value),1),r[5]||(r[5]=u(". All changes in this branch will be lost. ",-1))]),_:1})]),_:1}),t(e(ne),null,{default:o(()=>[t(e($),{variant:"outline",size:"sm",onClick:r[3]||(r[3]=l=>R.value=!1)},{default:o(()=>[u(s(e(n)["branch-detail.cancel"]),1)]),_:1}),t(e($),{variant:"destructive",size:"sm",disabled:w.value,onClick:ge},{default:o(()=>[w.value?(a(),h(e(E),{key:0,class:"mr-1.5 size-4 animate-spin"})):(a(),h(e(J),{key:1,class:"mr-1.5 size-4"})),u(" "+s(e(n)["branch-detail.delete-branch"]),1)]),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])]),_:1},8,["title","description"]),i("div",Ye,[y.value?(a(),c("div",{key:0,class:L(e(Z)("flex items-center gap-3 rounded-lg border p-4",y.value.type==="success"?"border-status-success/30 bg-status-success/5":"border-status-error/30 bg-status-error/5"))},[y.value.type==="success"?(a(),h(e(V),{key:0,class:"size-5 text-status-success shrink-0"})):(a(),h(e(re),{key:1,class:"size-5 text-status-error shrink-0"})),i("span",et,s(y.value.message),1)],2)):_("",!0),d.value?(a(),c("div",{key:1,class:L(["rounded-lg border p-4",d.value.alreadyMerged?"border-status-info/30 bg-status-info/5":d.value.conflicts&&d.value.conflicts.length>0?"border-status-error/30 bg-status-error/5":d.value.canFastForward?"border-status-success/30 bg-status-success/5":"border-status-warning/30 bg-status-warning/5"])},[i("div",tt,[d.value.alreadyMerged?(a(),h(e(V),{key:0,class:"size-5 shrink-0 text-status-info"})):d.value.canFastForward&&(!d.value.conflicts||d.value.conflicts.length===0)?(a(),h(e(V),{key:1,class:"size-5 shrink-0 text-status-success"})):d.value.conflicts&&d.value.conflicts.length>0?(a(),h(e(xe),{key:2,class:"size-5 shrink-0 text-status-error"})):(a(),h(e(be),{key:3,class:"size-5 shrink-0 text-status-warning"})),i("div",st,[i("p",at,s(e(n)["branch-detail.preview-title"]),1),i("p",rt,[d.value.alreadyMerged?(a(),c(z,{key:0},[u(s(e(n)["branch-detail.preview-already-merged"]),1)],64)):d.value.canFastForward&&(!d.value.conflicts||d.value.conflicts.length===0)?(a(),c(z,{key:1},[u(s(e(n)["branch-detail.preview-ff-clean"]),1)],64)):(a(),c(z,{key:2},[u(s(e(n)["branch-detail.preview-requires-3way"]),1)],64))]),!d.value.alreadyMerged&&d.value.filesChanged>0?(a(),c("p",lt,s(d.value.filesChanged)+" "+s(e(n)["branch-detail.preview-files-changed-suffix"]),1)):_("",!0),d.value.conflicts&&d.value.conflicts.length>0?(a(),c("div",nt,[i("p",ot,[u(s(e(n)["branch-detail.preview-conflicts-heading"])+" ",1),t(e(je),{variant:"outline",class:"text-[10px] border-status-error/50 text-status-error"},{default:o(()=>[u(s(d.value.conflicts.length),1)]),_:1})]),i("ul",it,[(a(!0),c(z,null,N(d.value.conflicts,l=>(a(),c("li",{key:l,class:"flex items-center gap-1.5"},[t(e(U),{class:"size-3 shrink-0 text-status-error"}),u(" "+s(l),1)]))),128))])])):_("",!0),d.value.conflicts===null?(a(),c("p",ct,s(e(n)["branch-detail.preview-check-unavailable"]),1)):_("",!0)])])],2)):_("",!0),B.value&&B.value.skipped.length>0?(a(),c("div",ut,[i("div",dt,[t(e(re),{class:"size-5 shrink-0 text-amber-600 dark:text-amber-400"}),i("div",pt,[i("p",ft,s(B.value.skipped.length)+" file"+s(B.value.skipped.length===1?"":"s")+" skipped during selective sync ",1),r[6]||(r[6]=i("p",{class:"text-xs text-amber-800 dark:text-amber-200"}," The merge landed in git, but the developer's working tree has uncommitted changes that would have been overwritten. Review and commit or discard these files, then run the sync again manually if needed. ",-1)),i("ul",mt,[(a(!0),c(z,null,N(B.value.skipped,l=>(a(),c("li",{key:l,class:"flex items-center gap-1.5"},[t(e(U),{class:"size-3 shrink-0"}),u(" "+s(l),1)]))),128))])])])])):_("",!0),e(v).loading?(a(),c("div",ht,[t(e(E),{class:"size-6 animate-spin text-primary"})])):b.value?(a(),c(z,{key:4},[t(e(K),null,{default:o(()=>[t(e(Ae),{class:"p-4"},{default:o(()=>[i("div",vt,[i("div",_t,[t(e(ae),{class:"size-4 text-muted-foreground"}),i("code",gt,s(b.value.base),1)]),t(e(se),{class:"size-4 text-primary"}),i("div",xt,[t(e(ae),{class:"size-4 text-primary"}),i("code",bt,s(k.value.replace("contentrain/","")),1)]),i("div",yt,[t(e(Ie),{status:S.value.scope==="normalize"?"pending":"partial",reason:S.value.scope==="normalize"?"Review required":void 0},null,8,["status","reason"]),i("span",kt,[t(e(U),{class:"size-3"}),u(" "+s(H.value)+" "+s(e(n)["branch-detail.file"])+s(H.value!==1?"s":""),1)]),i("span",wt,[t(e(Oe),{class:"size-3"}),u(" "+s(me.value),1)]),i("span",zt,[t(e(Ee),{class:"size-3"}),u(" "+s(he.value),1)])])])]),_:1})]),_:1}),b.value.stat?(a(),c("pre",Ct,s(b.value.stat),1)):_("",!0),M.value.length>0?(a(),c("div",$t,[(a(!0),c(z,null,N(M.value,(l,W)=>(a(),h(e(Te),{key:W,"default-open":!0},{default:o(()=>[t(e(K),{class:"overflow-hidden"},{default:o(()=>[t(e(Me),{class:"flex w-full items-center gap-3 p-3 hover:bg-muted/50 transition-colors text-left"},{default:o(()=>[t(e(Ge),{class:"size-4 text-muted-foreground shrink-0"}),i("span",Bt,s(l.path),1),i("div",Dt,[l.additions>0?(a(),c("span",Ft,"+"+s(l.additions),1)):_("",!0),l.deletions>0?(a(),c("span",jt,"-"+s(l.deletions),1)):_("",!0)])]),_:2},1024),t(e(qe),null,{default:o(()=>[t(e(Re)),i("div",Pt,[i("pre",It,[i("code",Mt,[(a(!0),c(z,null,N(l.lines,(m,q)=>(a(),c(z,{key:q},[m.type!=="header"?(a(),c("span",{key:0,class:L([{"bg-status-success/10 text-status-success":m.type==="add","bg-status-error/10 text-status-error":m.type==="remove","bg-primary/5 text-primary font-medium":m.type==="hunk","text-muted-foreground":m.type==="context"},"block px-4 font-mono"])},s(m.text),3)):_("",!0)],64))),128))])])])]),_:2},1024)]),_:2},1024)]),_:2},1024))),128)),t($e,{title:e(n)["branch-detail.ask-your-agent"],class:"mt-4"},{default:o(()=>[t(G,{prompt:e(n)["branch-detail.review-the-changes-on"]},null,8,["prompt"]),t(G,{prompt:e(n)["branch-detail.check-the-content-quality"]},null,8,["prompt"]),ve.value?(a(),h(G,{key:0,prompt:e(n)["branch-detail.continue-with-phase-2"]},null,8,["prompt"])):_("",!0)]),_:1},8,["title"])])):(a(),c("div",qt,[r[7]||(r[7]=i("img",{src:He,alt:"",class:"empty-illustration mb-4"},null,-1)),i("p",Tt,s(e(n)["branch-detail.no-diff-available-for"]),1)]))],64)):_("",!0)])]))}});export{as as default};
@@ -1,4 +1,4 @@
1
- import{c as he,a as I,t as J,o as d,b as C,e as c,j as p,u as e,f as k,r as $,i as Q,l as _e,h as T,M as ye,V as xe,N as we,n as Ce,g as Y,Q as Se,I as Te,m as O,z as F,J as Ie,K as ke,p as S,q as m,G as Be,L as K,s as R,B as w,F as N,x as U,y as z,A as X,C as Fe}from"./index-ChZMsiq8.js";import{u as qe}from"./content-CUJS4qD7.js";import{P as V,r as D,d as Re,u as $e,_ as G}from"./useWatch-BEMqYN2q.js";import{_ as Ve,a as Z}from"./PageHeader.vue_vue_type_script_setup_true_lang-f_qa-M1s.js";import{_ as Ae}from"./StudioHint.vue_vue_type_script_setup_true_lang-C_9M35tB.js";import{_ as ee,a as E}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-DGijfAoG.js";import{b as le,a as Me,u as ze}from"./useId-D0eDf3m4.js";import{f as ie,c as ue,u as L,P as Pe}from"./Presence-CfATKqRO.js";import{u as de}from"./useDirection-BO2bsovR.js";import{u as ce,R as Ee}from"./Collection-CvRfhUB7.js";import{g as te}from"./getActiveElement-FUKBWQwh.js";import{G as H}from"./git-branch-C8WJyunb.js";import{C as Oe}from"./chevron-right-4fFpOcQY.js";import{S as De}from"./shield-check-CiRjJIVW.js";import{S as Le}from"./scan-search-D5bwEyY7.js";import{D as je}from"./database-DXeLd4fP.js";import{F as ae}from"./file-text-CNkcFAch.js";import{S as se}from"./settings-BmVCntIC.js";import{L as Ke,T as Ne}from"./trash-2-B_0ZPRjy.js";import{G as Ue}from"./git-merge-zRH3kO3U.js";import{B as Ge}from"./box-DnDvmOFz.js";import"./ConfigProvider-DPWUDqGh.js";/**
1
+ import{c as he,a as I,t as J,o as d,b as C,e as c,j as p,u as e,f as k,r as $,i as Q,l as _e,h as T,M as ye,V as xe,N as we,n as Ce,g as Y,Q as Se,I as Te,m as O,z as F,J as Ie,K as ke,p as S,q as m,G as Be,L as K,s as R,B as w,F as N,x as U,y as z,A as X,C as Fe}from"./index-DRccbFO1.js";import{u as qe}from"./content-CpU25d4T.js";import{P as V,r as D,d as Re,u as $e,_ as G}from"./useWatch-jK8PaHZV.js";import{_ as Ve,a as Z}from"./PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js";import{_ as Ae}from"./StudioHint.vue_vue_type_script_setup_true_lang-njj2MiMe.js";import{_ as ee,a as E}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-aUmPXZcx.js";import{b as le,a as Me,u as ze}from"./useId-D77Djrst.js";import{f as ie,c as ue,u as L,P as Pe}from"./Presence-CwTW6JV8.js";import{u as de}from"./useDirection-CfSipebM.js";import{u as ce,R as Ee}from"./Collection-Dyohp6vl.js";import{g as te}from"./getActiveElement-FUKBWQwh.js";import{G as H}from"./git-branch-BIn35AbU.js";import{C as Oe}from"./chevron-right-DyOhl-vS.js";import{S as De}from"./shield-check-COBaQC43.js";import{S as Le}from"./scan-search-DgPppelD.js";import{D as je}from"./database-Yx3eEqcB.js";import{F as ae}from"./file-text-Cb1CMf3W.js";import{S as se}from"./settings-BzrU1Pv6.js";import{L as Ke,T as Ne}from"./trash-2-CO6c5OwW.js";import{G as Ue}from"./git-merge-Kep8fChm.js";import{B as Ge}from"./box-BP-1CTkM.js";import"./ConfigProvider-Drzuc2zO.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as n,o as t,p as o,y as r,u as c,z as l,f as p}from"./index-ChZMsiq8.js";const u=n({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(a){const s=a;return(e,d)=>(t(),o("div",{"data-slot":"card-content",class:r(c(l)("px-6",s.class))},[p(e.$slots,"default")],2))}});export{u as _};
1
+ import{a as n,o as t,p as o,y as r,u as c,z as l,f as p}from"./index-DRccbFO1.js";const u=n({__name:"CardContent",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(a){const s=a;return(e,d)=>(t(),o("div",{"data-slot":"card-content",class:r(c(l)("px-6",s.class))},[p(e.$slots,"default")],2))}});export{u as _};
@@ -1 +1 @@
1
- import{a as u,t as P,o as p,b as m,e as d,f as c,u as e,r as _,w as T,i as M,j as N,m as y,g as A,h as w,M as F,p as D,y as E,z as H,J as I,K as V}from"./index-ChZMsiq8.js";import{b as j,a as z}from"./useId-D0eDf3m4.js";import{f as S,u as B,c as J,k as K,P as L}from"./Presence-CfATKqRO.js";import{P as k}from"./useWatch-BEMqYN2q.js";const[R,G]=J("CollapsibleRoot");var Q=u({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(l,{expose:r,emit:a}){const s=l,n=S(s,"open",a,{defaultValue:s.defaultOpen,passive:s.open===void 0}),{disabled:i,unmountOnHide:f}=P(s);return G({contentId:"",disabled:i,open:n,unmountOnHide:f,onOpenToggle:()=>{i.value||(n.value=!n.value)}}),r({open:n}),B(),(v,h)=>(p(),m(e(k),{as:v.as,"as-child":s.asChild,"data-state":e(n)?"open":"closed","data-disabled":e(i)?"":void 0},{default:d(()=>[c(v.$slots,"default",{open:e(n)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),U=Q,W=u({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(l,{emit:r}){const a=l,s=r,o=R();o.contentId||(o.contentId=j(void 0,"reka-collapsible-content"));const n=_(),{forwardRef:i,currentElement:f}=B(),v=_(0),h=_(0),q=w(()=>o.open.value),C=_(q.value),b=_();T(()=>{var t;return[q.value,(t=n.value)==null?void 0:t.present]},async()=>{await F();const t=f.value;if(!t)return;b.value=b.value||{transitionDuration:t.style.transitionDuration,animationName:t.style.animationName},t.style.transitionDuration="0s",t.style.animationName="none";const g=t.getBoundingClientRect();h.value=g.height,v.value=g.width,C.value||(t.style.transitionDuration=b.value.transitionDuration,t.style.animationName=b.value.animationName)},{immediate:!0});const x=w(()=>C.value&&o.open.value);return M(()=>{requestAnimationFrame(()=>{C.value=!1})}),K(f,"beforematch",t=>{requestAnimationFrame(()=>{o.onOpenToggle(),s("contentFound")})}),(t,g)=>(p(),m(e(L),{ref_key:"presentRef",ref:n,present:t.forceMount||e(o).open.value,"force-mount":!0},{default:d(({present:O})=>{var $;return[N(e(k),y(t.$attrs,{id:e(o).contentId,ref:e(i),"as-child":a.asChild,as:t.as,hidden:O?void 0:e(o).unmountOnHide.value?"":"until-found","data-state":x.value?void 0:e(o).open.value?"open":"closed","data-disabled":($=e(o).disabled)!=null&&$.value?"":void 0,style:{"--reka-collapsible-content-height":`${h.value}px`,"--reka-collapsible-content-width":`${v.value}px`}}),{default:d(()=>[!e(o).unmountOnHide.value||O?c(t.$slots,"default",{key:0}):A("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),X=W,Y=u({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(l){const r=l;B();const a=R();return(s,o)=>{var n,i;return p(),m(e(k),{type:s.as==="button"?"button":void 0,as:s.as,"as-child":r.asChild,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value,"data-state":e(a).open.value?"open":"closed","data-disabled":(n=e(a).disabled)!=null&&n.value?"":void 0,disabled:(i=e(a).disabled)==null?void 0:i.value,onClick:e(a).onOpenToggle},{default:d(()=>[c(s.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),Z=Y;const se=u({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(l){const r=l;return(a,s)=>(p(),D("div",{"data-slot":"card",class:E(e(H)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",r.class))},[c(a.$slots,"default")],2))}}),ne=u({__name:"Collapsible",props:{defaultOpen:{type:Boolean},open:{type:Boolean},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:open"],setup(l,{emit:r}){const o=z(l,r);return(n,i)=>(p(),m(e(U),y({"data-slot":"collapsible"},e(o)),{default:d(f=>[c(n.$slots,"default",I(V(f)))]),_:3},16))}}),le=u({__name:"CollapsibleContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(l){const r=l;return(a,s)=>(p(),m(e(X),y({"data-slot":"collapsible-content"},r),{default:d(()=>[c(a.$slots,"default")]),_:3},16))}}),re=u({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean},as:{}},setup(l){const r=l;return(a,s)=>(p(),m(e(Z),y({"data-slot":"collapsible-trigger"},r),{default:d(()=>[c(a.$slots,"default")]),_:3},16))}});export{se as _,re as a,le as b,ne as c};
1
+ import{a as u,t as P,o as p,b as m,e as d,f as c,u as e,r as _,w as T,i as M,j as N,m as y,g as A,h as w,M as F,p as D,y as E,z as H,J as I,K as V}from"./index-DRccbFO1.js";import{b as j,a as z}from"./useId-D77Djrst.js";import{f as S,u as B,c as J,k as K,P as L}from"./Presence-CwTW6JV8.js";import{P as k}from"./useWatch-jK8PaHZV.js";const[R,G]=J("CollapsibleRoot");var Q=u({__name:"CollapsibleRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},disabled:{type:Boolean,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:open"],setup(l,{expose:r,emit:a}){const s=l,n=S(s,"open",a,{defaultValue:s.defaultOpen,passive:s.open===void 0}),{disabled:i,unmountOnHide:f}=P(s);return G({contentId:"",disabled:i,open:n,unmountOnHide:f,onOpenToggle:()=>{i.value||(n.value=!n.value)}}),r({open:n}),B(),(v,h)=>(p(),m(e(k),{as:v.as,"as-child":s.asChild,"data-state":e(n)?"open":"closed","data-disabled":e(i)?"":void 0},{default:d(()=>[c(v.$slots,"default",{open:e(n)})]),_:3},8,["as","as-child","data-state","data-disabled"]))}}),U=Q,W=u({inheritAttrs:!1,__name:"CollapsibleContent",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["contentFound"],setup(l,{emit:r}){const a=l,s=r,o=R();o.contentId||(o.contentId=j(void 0,"reka-collapsible-content"));const n=_(),{forwardRef:i,currentElement:f}=B(),v=_(0),h=_(0),q=w(()=>o.open.value),C=_(q.value),b=_();T(()=>{var t;return[q.value,(t=n.value)==null?void 0:t.present]},async()=>{await F();const t=f.value;if(!t)return;b.value=b.value||{transitionDuration:t.style.transitionDuration,animationName:t.style.animationName},t.style.transitionDuration="0s",t.style.animationName="none";const g=t.getBoundingClientRect();h.value=g.height,v.value=g.width,C.value||(t.style.transitionDuration=b.value.transitionDuration,t.style.animationName=b.value.animationName)},{immediate:!0});const x=w(()=>C.value&&o.open.value);return M(()=>{requestAnimationFrame(()=>{C.value=!1})}),K(f,"beforematch",t=>{requestAnimationFrame(()=>{o.onOpenToggle(),s("contentFound")})}),(t,g)=>(p(),m(e(L),{ref_key:"presentRef",ref:n,present:t.forceMount||e(o).open.value,"force-mount":!0},{default:d(({present:O})=>{var $;return[N(e(k),y(t.$attrs,{id:e(o).contentId,ref:e(i),"as-child":a.asChild,as:t.as,hidden:O?void 0:e(o).unmountOnHide.value?"":"until-found","data-state":x.value?void 0:e(o).open.value?"open":"closed","data-disabled":($=e(o).disabled)!=null&&$.value?"":void 0,style:{"--reka-collapsible-content-height":`${h.value}px`,"--reka-collapsible-content-width":`${v.value}px`}}),{default:d(()=>[!e(o).unmountOnHide.value||O?c(t.$slots,"default",{key:0}):A("v-if",!0)]),_:2},1040,["id","as-child","as","hidden","data-state","data-disabled","style"])]}),_:3},8,["present"]))}}),X=W,Y=u({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(l){const r=l;B();const a=R();return(s,o)=>{var n,i;return p(),m(e(k),{type:s.as==="button"?"button":void 0,as:s.as,"as-child":r.asChild,"aria-controls":e(a).contentId,"aria-expanded":e(a).open.value,"data-state":e(a).open.value?"open":"closed","data-disabled":(n=e(a).disabled)!=null&&n.value?"":void 0,disabled:(i=e(a).disabled)==null?void 0:i.value,onClick:e(a).onOpenToggle},{default:d(()=>[c(s.$slots,"default")]),_:3},8,["type","as","as-child","aria-controls","aria-expanded","data-state","data-disabled","disabled","onClick"])}}}),Z=Y;const se=u({__name:"Card",props:{class:{type:[Boolean,null,String,Object,Array]}},setup(l){const r=l;return(a,s)=>(p(),D("div",{"data-slot":"card",class:E(e(H)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",r.class))},[c(a.$slots,"default")],2))}}),ne=u({__name:"Collapsible",props:{defaultOpen:{type:Boolean},open:{type:Boolean},disabled:{type:Boolean},unmountOnHide:{type:Boolean},asChild:{type:Boolean},as:{}},emits:["update:open"],setup(l,{emit:r}){const o=z(l,r);return(n,i)=>(p(),m(e(U),y({"data-slot":"collapsible"},e(o)),{default:d(f=>[c(n.$slots,"default",I(V(f)))]),_:3},16))}}),le=u({__name:"CollapsibleContent",props:{forceMount:{type:Boolean},asChild:{type:Boolean},as:{}},setup(l){const r=l;return(a,s)=>(p(),m(e(X),y({"data-slot":"collapsible-content"},r),{default:d(()=>[c(a.$slots,"default")]),_:3},16))}}),re=u({__name:"CollapsibleTrigger",props:{asChild:{type:Boolean},as:{}},setup(l){const r=l;return(a,s)=>(p(),m(e(Z),y({"data-slot":"collapsible-trigger"},r),{default:d(()=>[c(a.$slots,"default")]),_:3},16))}});export{se as _,re as a,le as b,ne as c};
@@ -1,4 +1,4 @@
1
- import{c as I,h as f,r as v,_ as w,a as d,k as S,$ as p,w as x,a0 as $,a1 as T}from"./index-ChZMsiq8.js";import{S as h}from"./useWatch-BEMqYN2q.js";import{e as _}from"./Presence-CfATKqRO.js";/**
1
+ import{c as I,h as f,r as v,_ as w,a as d,k as S,$ as p,w as x,a0 as $,a1 as T}from"./index-DRccbFO1.js";import{S as h}from"./useWatch-jK8PaHZV.js";import{e as _}from"./Presence-CwTW6JV8.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -0,0 +1 @@
1
+ import{c as o}from"./Presence-CwTW6JV8.js";const[e]=o("ConfigProvider");export{e as i};
@@ -1,4 +1,4 @@
1
- var en=Object.defineProperty;var Zt=r=>{throw TypeError(r)};var tn=(r,e,t)=>e in r?en(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Q=(r,e,t)=>tn(r,typeof e!="symbol"?e+"":e,t),rn=(r,e,t)=>e.has(r)||Zt("Cannot "+t);var Ke=(r,e,t)=>(rn(r,e,"read from private field"),t?t.call(r):e.get(r)),Qt=(r,e,t)=>e.has(r)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t);import{c as _e,k as et,h as G,H as nn,a as D,t as yt,o as p,b as C,e as g,f as I,u as l,r as O,j as k,m as X,I as re,J as tt,K as rt,i as Se,A as Be,p as q,g as te,x as xe,F as se,w as ke,q as $,M as Je,n as ht,T as sn,s as W,l as ln,N as an,B as S,y as ee,z as J,L as Gt,O as on,P as un,Q as cn,G as We,S as Jt,v as dn}from"./index-ChZMsiq8.js";import{u as pn}from"./content-CUJS4qD7.js";import{u as fn}from"./project-CoRDn0ek.js";import{P as ce,r as je,d as hn,u as gn,_ as oe}from"./useWatch-BEMqYN2q.js";import{f as ct,t as mn,d as vn,c as Xt}from"./useFormatters-DgWFpsAv.js";import{_ as yn,a as ue}from"./PageHeader.vue_vue_type_script_setup_true_lang-f_qa-M1s.js";import{_ as xn}from"./StudioHint.vue_vue_type_script_setup_true_lang-C_9M35tB.js";import{C as Tt,_ as Yt,a as Le,b as er}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-DGijfAoG.js";import{P as vr,D as yr,a as xr,T as br,b as kr,i as tr,V as bn,h as kn,_ as _n,c as wn,d as Sn,e as $n,f as qn}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CNzxpJIB.js";import{S as Cn,_ as Bn}from"./Input.vue_vue_type_script_setup_true_lang-DTg5x_1H.js";import{u as Ae,a as $e,b as xt}from"./useId-D0eDf3m4.js";import{i as Pn,e as _r,r as Tn,f as At,c as nt,g as An,u as de,P as wr,a as zn}from"./Presence-CfATKqRO.js";import{u as Rn}from"./useDirection-BO2bsovR.js";import{u as Fe,R as On}from"./Collection-CvRfhUB7.js";import{F as Sr,u as $r,a as qr,f as rr,_ as In,b as En,c as Dn,d as Mn}from"./DialogTitle.vue_vue_type_script_setup_true_lang-VT8-tcWV.js";import{g as Et}from"./getActiveElement-FUKBWQwh.js";import{c as nr,u as Ln}from"./useNonce-CiRlnwG8.js";import{C as Dt}from"./chevron-down-DxPRdtQ2.js";import{F as jn}from"./file-text-CNkcFAch.js";import{A as Fn}from"./arrow-down-DuuSrZrX.js";import{C as Nn}from"./chevron-right-4fFpOcQY.js";import"./shield-check-CiRjJIVW.js";import"./ConfigProvider-DPWUDqGh.js";/**
1
+ var en=Object.defineProperty;var Zt=r=>{throw TypeError(r)};var tn=(r,e,t)=>e in r?en(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Q=(r,e,t)=>tn(r,typeof e!="symbol"?e+"":e,t),rn=(r,e,t)=>e.has(r)||Zt("Cannot "+t);var Ke=(r,e,t)=>(rn(r,e,"read from private field"),t?t.call(r):e.get(r)),Qt=(r,e,t)=>e.has(r)?Zt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t);import{c as _e,k as et,h as G,H as nn,a as D,t as yt,o as p,b as C,e as g,f as I,u as l,r as O,j as k,m as X,I as re,J as tt,K as rt,i as Se,A as Be,p as q,g as te,x as xe,F as se,w as ke,q as $,M as Je,n as ht,T as sn,s as W,l as ln,N as an,B as S,y as ee,z as J,L as Gt,O as on,P as un,Q as cn,G as We,S as Jt,v as dn}from"./index-DRccbFO1.js";import{u as pn}from"./content-CpU25d4T.js";import{u as fn}from"./project-Qe0nJIFZ.js";import{P as ce,r as je,d as hn,u as gn,_ as oe}from"./useWatch-jK8PaHZV.js";import{f as ct,t as mn,d as vn,c as Xt}from"./useFormatters-DgWFpsAv.js";import{_ as yn,a as ue}from"./PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js";import{_ as xn}from"./StudioHint.vue_vue_type_script_setup_true_lang-njj2MiMe.js";import{C as Tt,_ as Yt,a as Le,b as er}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-aUmPXZcx.js";import{P as vr,D as yr,a as xr,T as br,b as kr,i as tr,V as bn,h as kn,_ as _n,c as wn,d as Sn,e as $n,f as qn}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CKSr5l6Z.js";import{S as Cn,_ as Bn}from"./Input.vue_vue_type_script_setup_true_lang-BKEszmi1.js";import{u as Ae,a as $e,b as xt}from"./useId-D77Djrst.js";import{i as Pn,e as _r,r as Tn,f as At,c as nt,g as An,u as de,P as wr,a as zn}from"./Presence-CwTW6JV8.js";import{u as Rn}from"./useDirection-CfSipebM.js";import{u as Fe,R as On}from"./Collection-Dyohp6vl.js";import{F as Sr,u as $r,a as qr,f as rr,_ as In,b as En,c as Dn,d as Mn}from"./DialogTitle.vue_vue_type_script_setup_true_lang-De8dcLW1.js";import{g as Et}from"./getActiveElement-FUKBWQwh.js";import{c as nr,u as Ln}from"./useNonce-B9x5H0aQ.js";import{C as Dt}from"./chevron-down-DYr0P7tu.js";import{F as jn}from"./file-text-Cb1CMf3W.js";import{A as Fn}from"./arrow-down-k7y8IG0A.js";import{C as Nn}from"./chevron-right-DyOhl-vS.js";import"./shield-check-COBaQC43.js";import"./ConfigProvider-Drzuc2zO.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{a as $,p as l,j as d,u as e,q as s,B as n,F as p,x as C,g as w,r as F,h as z,o as a,y as B,z as V,b as L,A as N,e as x,s as _,C as S}from"./index-ChZMsiq8.js";import{u as q}from"./project-CoRDn0ek.js";import{_ as P}from"./PageHeader.vue_vue_type_script_setup_true_lang-f_qa-M1s.js";import{d as T,_ as g}from"./useWatch-BEMqYN2q.js";import{S as A,_ as E}from"./Input.vue_vue_type_script_setup_true_lang-DTg5x_1H.js";import{F as h}from"./file-text-CNkcFAch.js";import{L as K}from"./languages-DJeX1WoO.js";import{B as O}from"./book-open-BrhESfqB.js";import{D as R}from"./database-DXeLd4fP.js";const U={class:"px-6 py-6"},G={key:0,class:"flex flex-col items-center py-16 text-center"},H={class:"mb-4 flex size-14 items-center justify-center rounded-full bg-muted"},I={class:"text-lg font-semibold"},J={class:"mt-2 max-w-sm text-sm text-muted-foreground"},M={class:"relative mb-6 max-w-sm"},Q={class:"mb-3 text-xs font-medium uppercase tracking-wider text-muted-foreground"},W={class:"space-y-1.5"},X=["onClick"],Y={class:"min-w-0 flex-1"},Z={class:"font-medium text-foreground"},ee={class:"flex items-center gap-2 shrink-0"},te={key:0,class:"py-12 text-center text-sm text-muted-foreground"},fe=$({__name:"ContentPage",setup(se){const t=T("serve-ui-texts").locale("en").get(),v=q(),j=S(),u=F(""),b=z(()=>{var r;const o=((r=v.status)==null?void 0:r.models)??[];if(!u.value)return o;const i=u.value.toLowerCase();return o.filter(m=>m.id.toLowerCase().includes(i)||m.domain.toLowerCase().includes(i))}),D=z(()=>{const o={};for(const i of b.value){const r=i.domain||"default";o[r]||(o[r]=[]),o[r].push(i)}return o}),y={collection:{icon:R,color:"bg-primary/10 text-primary",label:t["content.collection"]},singleton:{icon:h,color:"bg-status-info/10 text-status-info",label:t["content.singleton"]},document:{icon:O,color:"bg-status-success/10 text-status-success",label:t["content.document"]},dictionary:{icon:h,color:"bg-status-warning/10 text-status-warning",label:t["content.dictionary"]}};function f(o){return y[o]??y.collection}return(o,i)=>{var r;return a(),l("div",null,[d(P,{title:e(t)["content.content"],description:e(t)["content.browse-and-inspect-content"]},null,8,["title","description"]),s("div",U,[(((r=e(v).status)==null?void 0:r.models)??[]).length===0?(a(),l("div",G,[s("div",H,[d(e(h),{class:"size-6 text-muted-foreground"})]),s("h2",I,n(e(t)["content.no-models-yet"]),1),s("p",J,n(e(t)["content.create-models-using-your"]),1)])):(a(),l(p,{key:1},[s("div",M,[d(e(A),{class:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),d(e(E),{modelValue:u.value,"onUpdate:modelValue":i[0]||(i[0]=m=>u.value=m),placeholder:e(t)["content.filter-models"],class:"h-9 pl-9 text-sm"},null,8,["modelValue","placeholder"])]),(a(!0),l(p,null,C(D.value,(m,k)=>(a(),l("div",{key:k,class:"mb-8 last:mb-0"},[s("h3",Q,n(k),1),s("div",W,[(a(!0),l(p,null,C(m,c=>(a(),l("button",{key:c.id,class:B(e(V)("group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-4 py-3 text-left transition-all","hover:border-primary/30 hover:shadow-sm")),onClick:oe=>e(j).push(`/content/${c.id}`)},[s("div",{class:B(e(V)("flex size-8 shrink-0 items-center justify-center rounded-md",f(c.kind).color))},[(a(),L(N(f(c.kind).icon),{class:"size-4"}))],2),s("div",Y,[s("span",Z,n(c.id),1)]),s("div",ee,[d(e(g),{variant:"secondary",class:"text-[10px]"},{default:x(()=>[_(n(f(c.kind).label),1)]),_:2},1024),d(e(g),{variant:"outline",class:"text-[10px]"},{default:x(()=>[_(n(c.fields)+" "+n(e(t)["content.fields"]),1)]),_:2},1024),c.i18n?(a(),L(e(g),{key:0,variant:"outline",class:"text-[10px] text-status-info border-status-info/30"},{default:x(()=>[d(e(K),{class:"mr-0.5 size-3"}),_(" "+n(e(t)["content.i18n"]),1)]),_:1})):w("",!0)])],10,X))),128))])]))),128)),b.value.length===0&&u.value?(a(),l("div",te,n(e(t)["content.no-models-matching"])+n(u.value)+'" ',1)):w("",!0)],64))])])}}});export{fe as default};
1
+ import{a as $,p as l,j as d,u as e,q as s,B as n,F as p,x as C,g as w,r as F,h as z,o as a,y as B,z as V,b as L,A as N,e as x,s as _,C as S}from"./index-DRccbFO1.js";import{u as q}from"./project-Qe0nJIFZ.js";import{_ as P}from"./PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js";import{d as T,_ as g}from"./useWatch-jK8PaHZV.js";import{S as A,_ as E}from"./Input.vue_vue_type_script_setup_true_lang-BKEszmi1.js";import{F as h}from"./file-text-Cb1CMf3W.js";import{L as K}from"./languages-CZzFhI1_.js";import{B as O}from"./book-open-C5gyxyGy.js";import{D as R}from"./database-Yx3eEqcB.js";const U={class:"px-6 py-6"},G={key:0,class:"flex flex-col items-center py-16 text-center"},H={class:"mb-4 flex size-14 items-center justify-center rounded-full bg-muted"},I={class:"text-lg font-semibold"},J={class:"mt-2 max-w-sm text-sm text-muted-foreground"},M={class:"relative mb-6 max-w-sm"},Q={class:"mb-3 text-xs font-medium uppercase tracking-wider text-muted-foreground"},W={class:"space-y-1.5"},X=["onClick"],Y={class:"min-w-0 flex-1"},Z={class:"font-medium text-foreground"},ee={class:"flex items-center gap-2 shrink-0"},te={key:0,class:"py-12 text-center text-sm text-muted-foreground"},fe=$({__name:"ContentPage",setup(se){const t=T("serve-ui-texts").locale("en").get(),v=q(),j=S(),u=F(""),b=z(()=>{var r;const o=((r=v.status)==null?void 0:r.models)??[];if(!u.value)return o;const i=u.value.toLowerCase();return o.filter(m=>m.id.toLowerCase().includes(i)||m.domain.toLowerCase().includes(i))}),D=z(()=>{const o={};for(const i of b.value){const r=i.domain||"default";o[r]||(o[r]=[]),o[r].push(i)}return o}),y={collection:{icon:R,color:"bg-primary/10 text-primary",label:t["content.collection"]},singleton:{icon:h,color:"bg-status-info/10 text-status-info",label:t["content.singleton"]},document:{icon:O,color:"bg-status-success/10 text-status-success",label:t["content.document"]},dictionary:{icon:h,color:"bg-status-warning/10 text-status-warning",label:t["content.dictionary"]}};function f(o){return y[o]??y.collection}return(o,i)=>{var r;return a(),l("div",null,[d(P,{title:e(t)["content.content"],description:e(t)["content.browse-and-inspect-content"]},null,8,["title","description"]),s("div",U,[(((r=e(v).status)==null?void 0:r.models)??[]).length===0?(a(),l("div",G,[s("div",H,[d(e(h),{class:"size-6 text-muted-foreground"})]),s("h2",I,n(e(t)["content.no-models-yet"]),1),s("p",J,n(e(t)["content.create-models-using-your"]),1)])):(a(),l(p,{key:1},[s("div",M,[d(e(A),{class:"absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground"}),d(e(E),{modelValue:u.value,"onUpdate:modelValue":i[0]||(i[0]=m=>u.value=m),placeholder:e(t)["content.filter-models"],class:"h-9 pl-9 text-sm"},null,8,["modelValue","placeholder"])]),(a(!0),l(p,null,C(D.value,(m,k)=>(a(),l("div",{key:k,class:"mb-8 last:mb-0"},[s("h3",Q,n(k),1),s("div",W,[(a(!0),l(p,null,C(m,c=>(a(),l("button",{key:c.id,class:B(e(V)("group flex w-full items-center gap-3 rounded-lg border border-border bg-card px-4 py-3 text-left transition-all","hover:border-primary/30 hover:shadow-sm")),onClick:oe=>e(j).push(`/content/${c.id}`)},[s("div",{class:B(e(V)("flex size-8 shrink-0 items-center justify-center rounded-md",f(c.kind).color))},[(a(),L(N(f(c.kind).icon),{class:"size-4"}))],2),s("div",Y,[s("span",Z,n(c.id),1)]),s("div",ee,[d(e(g),{variant:"secondary",class:"text-[10px]"},{default:x(()=>[_(n(f(c.kind).label),1)]),_:2},1024),d(e(g),{variant:"outline",class:"text-[10px]"},{default:x(()=>[_(n(c.fields)+" "+n(e(t)["content.fields"]),1)]),_:2},1024),c.i18n?(a(),L(e(g),{key:0,variant:"outline",class:"text-[10px] text-status-info border-status-info/30"},{default:x(()=>[d(e(K),{class:"mr-0.5 size-3"}),_(" "+n(e(t)["content.i18n"]),1)]),_:1})):w("",!0)])],10,X))),128))])]))),128)),b.value.length===0&&u.value?(a(),l("div",te,n(e(t)["content.no-models-matching"])+n(u.value)+'" ',1)):w("",!0)],64))])])}}});export{fe as default};
@@ -1,4 +1,4 @@
1
- import{_ as P}from"./model-empty-state-B6AM4bil.js";import{c as $,a as oe,w as ae,i as re,p as d,j as c,u as e,q as o,L as H,B as l,s as m,F as h,b,e as v,g as u,x as k,C as ne,h as g,r as W,G as q,o as n,y as f,z as x,A as S}from"./index-ChZMsiq8.js";import{u as le}from"./project-CoRDn0ek.js";import{u as ie}from"./content-CUJS4qD7.js";import{d as de,u as ce,_ as w}from"./useWatch-BEMqYN2q.js";import{_ as ue}from"./PageHeader.vue_vue_type_script_setup_true_lang-f_qa-M1s.js";import{A as z,_ as me}from"./StudioHint.vue_vue_type_script_setup_true_lang-C_9M35tB.js";import{_ as be,a as pe}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-DGijfAoG.js";import{_ as ge,C as fe}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CNzxpJIB.js";import{S as K}from"./settings-BmVCntIC.js";import{G as J}from"./git-branch-C8WJyunb.js";import{B as Q}from"./book-marked-BJCFfYPg.js";import{B as F}from"./box-DnDvmOFz.js";import{B as xe}from"./book-open-BrhESfqB.js";import{F as he}from"./file-code-DAeYB6-U.js";import{L as ve,T as _e}from"./trash-2-B_0ZPRjy.js";import{G as ye}from"./git-merge-zRH3kO3U.js";import{F as U}from"./file-text-CNkcFAch.js";import{L as ke}from"./languages-DJeX1WoO.js";import"./useId-D0eDf3m4.js";import"./Presence-CfATKqRO.js";import"./shield-check-CiRjJIVW.js";/**
1
+ import{_ as P}from"./model-empty-state-B6AM4bil.js";import{c as $,a as oe,w as ae,i as re,p as d,j as c,u as e,q as o,L as H,B as l,s as m,F as h,b,e as v,g as u,x as k,C as ne,h as g,r as W,G as q,o as n,y as f,z as x,A as S}from"./index-DRccbFO1.js";import{u as le}from"./project-Qe0nJIFZ.js";import{u as ie}from"./content-CpU25d4T.js";import{d as de,u as ce,_ as w}from"./useWatch-jK8PaHZV.js";import{_ as ue}from"./PageHeader.vue_vue_type_script_setup_true_lang-B4RP_f6D.js";import{A as z,_ as me}from"./StudioHint.vue_vue_type_script_setup_true_lang-njj2MiMe.js";import{_ as be,a as pe}from"./AgentPromptGroup.vue_vue_type_script_setup_true_lang-aUmPXZcx.js";import{_ as ge,C as fe}from"./TrustBadge.vue_vue_type_script_setup_true_lang-CKSr5l6Z.js";import{S as K}from"./settings-BzrU1Pv6.js";import{G as J}from"./git-branch-BIn35AbU.js";import{B as Q}from"./book-marked-Do-N1OrO.js";import{B as F}from"./box-BP-1CTkM.js";import{B as xe}from"./book-open-C5gyxyGy.js";import{F as he}from"./file-code-BUzIo-9Q.js";import{L as ve,T as _e}from"./trash-2-CO6c5OwW.js";import{G as ye}from"./git-merge-Kep8fChm.js";import{F as U}from"./file-text-Cb1CMf3W.js";import{L as ke}from"./languages-CZzFhI1_.js";import"./useId-D77Djrst.js";import"./Presence-CwTW6JV8.js";import"./shield-check-COBaQC43.js";/**
2
2
  * @license lucide-vue-next v0.474.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.