@uniqbit/mate-core 0.20.0 → 0.21.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 (287) hide show
  1. package/claude-capability-plugins/companion-mentions/.claude-plugin/plugin.json +1 -1
  2. package/claude-capability-plugins/companion-mentions/hooks/register.ts +1 -1
  3. package/claude-plugin/hooks/hooks.json +10 -1
  4. package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
  5. package/opencode-plugin/src/server.ts +9 -2
  6. package/package.json +2 -1
  7. package/src/cli/commands/artifact/delivery/environment.ts +28 -8
  8. package/src/cli/commands/artifact/delivery/link.ts +28 -9
  9. package/src/cli/commands/artifact/delivery/output.ts +7 -0
  10. package/src/cli/commands/companion/update.ts +2 -19
  11. package/src/cli/commands/factory/factory.ts +11 -1
  12. package/src/cli/commands/install.ts +47 -36
  13. package/src/cli/commands/launch/claude.ts +2 -0
  14. package/src/cli/commands/launch/shared.ts +33 -6
  15. package/src/cli/commands/plugin/install.ts +27 -11
  16. package/src/cli/commands/report/index.ts +180 -184
  17. package/src/cli/commands/report/markdown.ts +67 -72
  18. package/src/cli/commands/shared/companion-selection.ts +3 -1
  19. package/src/cli/commands/studio/access.ts +6 -14
  20. package/src/cli/commands/studio/areas.ts +112 -33
  21. package/src/cli/commands/studio/companion-add.ts +87 -0
  22. package/src/cli/commands/studio/companion-removal.ts +15 -8
  23. package/src/cli/commands/studio/factory-credential.ts +1 -15
  24. package/src/cli/commands/studio/factory-git-tokens.ts +40 -0
  25. package/src/cli/commands/studio/factory-relay.ts +18 -0
  26. package/src/cli/commands/studio/graph-model.ts +61 -0
  27. package/src/cli/commands/studio/graph.ts +336 -0
  28. package/src/cli/commands/studio/index.ts +4 -4
  29. package/src/cli/commands/studio/payload.ts +42 -15
  30. package/src/cli/commands/studio/repository-add.ts +116 -0
  31. package/src/cli/commands/studio/routes.ts +6 -0
  32. package/src/cli/commands/studio/selection.ts +12 -3
  33. package/src/cli/commands/studio/server.ts +127 -5
  34. package/src/cli/commands/studio/services.ts +40 -0
  35. package/src/cli/commands/studio/terminal.ts +45 -3
  36. package/src/cli/commands/studio/views/vault/markdown-tree.ts +84 -3
  37. package/src/cli/commands/studio/workset-session.ts +47 -14
  38. package/src/cli/commands/unwrap.ts +3 -0
  39. package/src/cli/commands/update.ts +2 -0
  40. package/src/cli/commands/vscode/release-vsix.json +4 -0
  41. package/src/cli/commands/vscode/setup.ts +71 -13
  42. package/src/cli/commands/vscode/vsix.ts +48 -7
  43. package/src/cli/commands/working/cleanup.ts +40 -8
  44. package/src/cli/commands/working/worktree.ts +176 -35
  45. package/src/cli/main.ts +17 -2
  46. package/src/cli/usage.ts +1 -1
  47. package/src/hooks/rtk-worktree-git.ts +48 -0
  48. package/src/hooks/validate-artifact-path.ts +38 -7
  49. package/src/lib/delivery/branch-template.ts +122 -0
  50. package/src/lib/delivery/branches.ts +21 -16
  51. package/src/lib/delivery/checkout.ts +102 -0
  52. package/src/lib/delivery/environment.ts +2 -0
  53. package/src/lib/delivery/merge-git.ts +13 -1
  54. package/src/lib/delivery/record-delivery.ts +83 -29
  55. package/src/lib/delivery/record.ts +15 -3
  56. package/src/lib/delivery/resolve-branch.ts +157 -110
  57. package/src/lib/factory/attach-client.ts +11 -1
  58. package/src/lib/factory/broker.ts +37 -40
  59. package/src/lib/factory/client.ts +22 -1
  60. package/src/lib/factory/clone-url.ts +39 -0
  61. package/src/lib/factory/command.ts +21 -5
  62. package/src/lib/factory/git-auth.ts +61 -0
  63. package/src/lib/factory/git-credential-store.ts +181 -0
  64. package/src/lib/factory/ids.ts +12 -2
  65. package/src/lib/factory/outcomes/actions.ts +20 -4
  66. package/src/lib/factory/outcomes/index.ts +77 -11
  67. package/src/lib/factory/outcomes/lifecycle.ts +9 -2
  68. package/src/lib/factory/outcomes/sessions.ts +23 -1
  69. package/src/lib/factory/prepare.ts +9 -3
  70. package/src/lib/factory/runner/scheduler.ts +96 -14
  71. package/src/lib/factory/runner/workflow.ts +5 -1
  72. package/src/lib/factory/runtime.ts +143 -43
  73. package/src/lib/orchestrator/companion-hub.ts +6 -1
  74. package/src/lib/orchestrator/engine-floor.ts +48 -0
  75. package/src/lib/orchestrator/launcher.ts +34 -1
  76. package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
  77. package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
  78. package/src/lib/orchestrator/projection-claude-links.ts +32 -8
  79. package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
  80. package/src/lib/orchestrator/projection-entries.ts +22 -18
  81. package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
  82. package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
  83. package/src/lib/orchestrator/projection-types.ts +28 -1
  84. package/src/lib/orchestrator/refresh-working-claude-links.ts +3 -1
  85. package/src/lib/orchestrator/session-prepare.ts +6 -1
  86. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  87. package/src/lib/orchestrator/types.ts +4 -0
  88. package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
  89. package/src/lib/orchestrator/working-repo-projection.ts +24 -4
  90. package/src/lib/orchestrator/wrap-pass.ts +1 -0
  91. package/src/lib/public-npm.ts +95 -50
  92. package/src/lib/session-state.ts +72 -2
  93. package/src/lib/update-checker.ts +7 -1
  94. package/src/lib/usage/aggregate.ts +202 -0
  95. package/src/lib/usage/cache.ts +87 -0
  96. package/src/lib/usage/claude-pricing.ts +71 -0
  97. package/src/lib/usage/claude.ts +189 -0
  98. package/src/lib/usage/collect.ts +56 -0
  99. package/src/lib/usage/opencode.ts +188 -0
  100. package/src/lib/usage/records.ts +80 -0
  101. package/src/lib/usage/rtk-database.ts +72 -0
  102. package/src/lib/usage/savings.ts +209 -0
  103. package/src/lib/usage/scope.ts +182 -0
  104. package/src/lib/usage/source.ts +102 -0
  105. package/src/lib/usage/types.ts +143 -0
  106. package/src/lib/usage/window.ts +37 -0
  107. package/src/lib/workset/factory-local.ts +157 -0
  108. package/src/lib/workset/record.ts +25 -11
  109. package/src/lib/workset/repositories.ts +118 -25
  110. package/src/lib/workset/worktree-include.ts +161 -0
  111. package/src/lib/workset/worktree-index.ts +6 -2
  112. package/src/lib/workset/worktree.ts +591 -101
  113. package/src/opencode/companion-hooks.ts +46 -8
  114. package/src/opencode/companion-policy.ts +18 -5
  115. package/src/opencode/enter-worktree.ts +254 -6
  116. package/src/opencode/session-register.ts +2 -2
  117. package/src/runtime/claude-bg-isolation.ts +138 -0
  118. package/src/runtime/companion-git.ts +10 -2
  119. package/src/runtime/companion-guidance.ts +17 -4
  120. package/src/runtime/current-branch.ts +16 -2
  121. package/src/runtime/entered-worktree.ts +24 -0
  122. package/src/runtime/git-tracked.ts +60 -0
  123. package/src/runtime/repo-destination.ts +72 -0
  124. package/src/runtime/repo-local.ts +25 -3
  125. package/src/runtime/rtk-git-guard.ts +66 -0
  126. package/src/runtime/runtime-document-manifest.ts +229 -19
  127. package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
  128. package/src/runtime/secret-guard.ts +9 -2
  129. package/src/runtime/secret-policy-weakening.ts +122 -0
  130. package/src/runtime/serving-claude-wrap.ts +15 -2
  131. package/src/runtime/umbrella-folder.ts +56 -0
  132. package/src/runtime/wrap-state.ts +5 -13
  133. package/src/studio.ts +37 -0
  134. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +61 -6
  135. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +8 -4
  136. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +9 -5
  137. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +5 -4
  138. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +10 -4
  139. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +5 -1
  140. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +61 -6
  141. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +8 -4
  142. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +9 -5
  143. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +5 -4
  144. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +10 -4
  145. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +5 -1
  146. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +307 -42
  147. package/src/tools/setup/capabilities/rtk.ts +93 -1
  148. package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
  149. package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
  150. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
  151. package/src/tools/setup/dynamic-plugins/install.ts +24 -22
  152. package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
  153. package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
  154. package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
  155. package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
  156. package/src/tools/setup/mate.ts +3 -3
  157. package/src/tools/setup/plugins/gitignore.ts +15 -9
  158. package/src/tools/setup/providers/claude-plugin-hooks.ts +12 -0
  159. package/src/tools/setup/providers/claude.ts +25 -3
  160. package/src/tools/setup/utils.ts +4 -2
  161. package/src/tools/setup/working-repo-cleanup.ts +2 -2
  162. package/src/tools/setup/working-repo-local-state.ts +2 -0
  163. package/src/tools/setup.ts +25 -14
  164. package/studio-dist/client/assets/app-D9cw6szy.css +2 -0
  165. package/studio-dist/client/assets/artifacts-WD2ZXYrx.js +1 -0
  166. package/studio-dist/client/assets/button-Br0O1sXw.js +1 -0
  167. package/studio-dist/client/assets/combobox-DA7RAUUZ.js +1 -0
  168. package/studio-dist/client/assets/companion-view-CrabvxS8.js +1 -0
  169. package/studio-dist/client/assets/factory-DGS0E16C.js +6 -0
  170. package/studio-dist/client/assets/fields-6aXBpFhJ.js +1 -0
  171. package/studio-dist/client/assets/getting-started-Clde4w6P.js +1 -0
  172. package/studio-dist/client/assets/getting-started-D6kgWwWZ.js +1 -0
  173. package/studio-dist/client/assets/getting-started._topic-BiunccbT.js +1 -0
  174. package/studio-dist/client/assets/getting-started.index-DpiNoGw8.js +1 -0
  175. package/studio-dist/client/assets/graph-B_TCBVbu.js +2 -0
  176. package/studio-dist/client/assets/graph-canvas-Ba37Y5AE.js +3242 -0
  177. package/studio-dist/client/assets/guides-Du_RtJxP.js +1 -0
  178. package/studio-dist/client/assets/index-Df8L1LQa.js +40 -0
  179. package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
  180. package/studio-dist/client/assets/markdown-view-BOX6x0rL.js +1 -0
  181. package/studio-dist/client/assets/panel-dbmCx7Mx.js +1 -0
  182. package/studio-dist/client/assets/queries-RvHeXY12.js +1 -0
  183. package/studio-dist/client/assets/react-3QStrcDO.js +27 -0
  184. package/studio-dist/client/assets/report-url-XRL0x1SY.js +1 -0
  185. package/studio-dist/client/assets/reports-r3IK7Doz.js +1 -0
  186. package/studio-dist/client/assets/routes-C0A5LTFc.js +1 -0
  187. package/studio-dist/client/assets/select-CnaMd617.js +1 -0
  188. package/studio-dist/client/assets/skills-CzjzHpBT.js +1 -0
  189. package/studio-dist/client/assets/specs-B0ldF_6J.js +1 -0
  190. package/studio-dist/client/assets/specs-view-BnCLA0gW.js +1 -0
  191. package/studio-dist/client/assets/spinner-Dcm3fqK1.js +1 -0
  192. package/studio-dist/client/assets/steps-C0p2N1Pb.js +1 -0
  193. package/studio-dist/client/assets/store-Dw34catY.js +1 -0
  194. package/studio-dist/client/assets/studio-Cpz_HRHp.js +100 -0
  195. package/studio-dist/client/assets/studio-queries-ibmpFo6R.js +2 -0
  196. package/studio-dist/client/assets/usage-C2QJ_0IZ.js +55 -0
  197. package/studio-dist/client/assets/useAnchoredPopupScrollLock-Bj-FWb8z.js +1 -0
  198. package/studio-dist/client/assets/useMutation-aAr2uiay.js +1 -0
  199. package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
  200. package/studio-dist/client/assets/vault-BGcxkSIY.js +1 -0
  201. package/studio-dist/client/assets/warnings-R1cE1rLf.js +1 -0
  202. package/studio-dist/client/assets/workflow-C2qTrMDH.js +1 -0
  203. package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-Bn896ZYj.js +122 -0
  204. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +102 -35
  205. package/studio-dist/server/assets/{actions-Bvgj9eb8.js → actions-DYSv-9VV.js} +10 -4
  206. package/studio-dist/server/assets/artifacts-DnF9L3dZ.js +216 -0
  207. package/studio-dist/server/assets/{button-CIJqAhni.js → button-CgOIVdmD.js} +13 -1702
  208. package/studio-dist/server/assets/combobox-DV_s9W0s.js +483 -0
  209. package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-BKVXD3TO.js} +3 -3
  210. package/studio-dist/server/assets/companions-C7fctnU9.js +31 -0
  211. package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
  212. package/studio-dist/server/assets/{factory-DUTa0eDs.js → factory-C7Ybg0xG.js} +1256 -353
  213. package/studio-dist/server/assets/{factory-DGPmNGbo.js → factory-Df5uAHjb.js} +53 -6
  214. package/studio-dist/server/assets/fields-BbieQTD0.js +1190 -0
  215. package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
  216. package/studio-dist/server/assets/getting-started-CRxMWorQ.js +67 -0
  217. package/studio-dist/server/assets/getting-started._topic-DJKQAzYl.js +13 -0
  218. package/studio-dist/server/assets/getting-started.index-D84gec1t.js +13 -0
  219. package/studio-dist/server/assets/graph-CSje3029.js +801 -0
  220. package/studio-dist/server/assets/graph-DDZzXM1L.js +16 -0
  221. package/studio-dist/server/assets/graph-canvas-22bWB5-2.js +21066 -0
  222. package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
  223. package/studio-dist/server/assets/guides-D9dk1Frq.js +13 -0
  224. package/studio-dist/server/assets/guides-IE-19POz.js +5 -0
  225. package/studio-dist/server/assets/guides.server-vcYRY5wx.js +66 -0
  226. package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
  227. package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-BR8dJ7aR.js} +28 -9
  228. package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-BR_t9iMM.js} +4 -4
  229. package/studio-dist/server/assets/queries-DWoTin-q.js +32 -0
  230. package/studio-dist/server/assets/react-CdqSUhaL.js +89 -0
  231. package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
  232. package/studio-dist/server/assets/report-url-BUXPcE_8.js +9 -0
  233. package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-CQ9qQ1-n.js} +9 -10
  234. package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-dYDEoBeq.js} +3 -3
  235. package/studio-dist/server/assets/{router-C8MGqlAY.js → router-DkRHNTpE.js} +787 -2862
  236. package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-B6GfOew4.js} +22 -171
  237. package/studio-dist/server/assets/{search-JAKurDNh.js → search-BJnWLfkG.js} +21 -2
  238. package/studio-dist/server/assets/select-Af7Wibii.js +1609 -0
  239. package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-Hq-hXgnT.js} +6 -5
  240. package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-B7nEuVbx.js} +9 -8
  241. package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-B_YYL7q8.js} +3 -3
  242. package/studio-dist/server/assets/specs-BpLUFntA.js +51 -0
  243. package/studio-dist/server/assets/specs-view-0peMVd22.js +426 -0
  244. package/studio-dist/server/assets/spinner-CdwJW4VB.js +20 -0
  245. package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-D56DApvK.js} +1 -1
  246. package/studio-dist/server/assets/store-Cs17okNG.js +280 -0
  247. package/studio-dist/server/assets/studio-CAcKp3bM.js +10340 -0
  248. package/studio-dist/server/assets/studio-queries-BtRGzDdh.js +1451 -0
  249. package/studio-dist/server/assets/usage-COdjd1gD.js +25570 -0
  250. package/studio-dist/server/assets/usage-f6pqE1tm.js +24 -0
  251. package/studio-dist/server/assets/useAnchoredPopupScrollLock-DlBKHRw7.js +756 -0
  252. package/studio-dist/server/assets/useMutation-DzTZGenE.js +690 -0
  253. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
  254. package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-BDuIUq0F.js} +8 -5
  255. package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-BVLp6zu3.js} +3 -3
  256. package/studio-dist/server/assets/{views-BgYa-za2.js → views-flRUr21z.js} +4 -4
  257. package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-CDy9pdgL.js} +3 -2
  258. package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-D9GKI2EV.js} +132 -106
  259. package/studio-dist/server/server.js +582 -8
  260. package/src/cli/commands/report/collector.ts +0 -288
  261. package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
  262. package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
  263. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
  264. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
  265. package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
  266. package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
  267. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
  268. package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
  269. package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
  270. package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
  271. package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
  272. package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  273. package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
  274. package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
  275. package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
  276. package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
  277. package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
  278. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
  279. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
  280. package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
  281. package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
  282. package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
  283. package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
  284. package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
  285. package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
  286. package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
  287. package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
@@ -1,8 +1,8 @@
1
- import { t as createServerRpc } from "./createServerRpc-tK2lE9R2.js";
1
+ import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
2
  import { n as healthNote } from "./model-PyPALjii.js";
3
- import { t as createServerFn } from "./createServerFn-F5sAOF8V.js";
4
- import { g as STUDIO_MODE_PARAM, u as COMPANION_PARAM, v as companionDigest } from "./studio-BeltxxKt.js";
5
- import { n as validateStudioSearch } from "./search-JAKurDNh.js";
3
+ import { n as createServerFn } from "../server.js";
4
+ import { _ as STUDIO_MODE_PARAM, d as COMPANION_PARAM, y as companionDigest } from "./studio-CAcKp3bM.js";
5
+ import { r as validateStudioSearch } from "./search-BJnWLfkG.js";
6
6
  // src/server/shell.ts?tss-serverfn-split
7
7
  /** `refresh` collects the companion again; every other call reads the held snapshot. */
8
8
  var getShell_createServerFn_handler = createServerRpc({
@@ -25,7 +25,8 @@ var getShell = createServerFn({ method: "GET" }).validator((input) => ({
25
25
  note: healthNote(companion),
26
26
  unready: companion.health !== "ready",
27
27
  missing: companion.health === "missing",
28
- pairings: companion.pairings.map((pairing) => pairing.repositoryId)
28
+ pairings: companion.pairings.map((pairing) => pairing.repositoryId),
29
+ ...context.studio.keepsFolder(companion.path) ? { keepsFolder: true } : {}
29
30
  }));
30
31
  const payload = page.payload;
31
32
  return {
@@ -1,11 +1,12 @@
1
- import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
2
- import { t as CompanionView } from "./companion-view-DISASvdJ.js";
3
- import { j as require_react, u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
4
- import { $ as CommandLine, Ar as cn, Ei as keepPreviousData, Wr as skillPreviewQuery, at as Pills, fi as useQuery, nt as ListCard, r as Icon, rt as PAGE_PAD, st as ROW, tt as EmptyNote } from "./button-CIJqAhni.js";
5
- import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-3Jmn4awF.js";
6
- import { n as workflowPlan } from "./steps-Dq_CwY_s.js";
7
- import { t as MarkdownView } from "./markdown-view-Bn7xPdks.js";
8
- import { a as Route } from "./router-C8MGqlAY.js";
1
+ import { t as CompanionView } from "./companion-view-BKVXD3TO.js";
2
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
3
+ import { c as PAGE_PAD, f as ROW, i as CommandLine, o as EmptyNote, s as ListCard, u as Pills } from "./store-Cs17okNG.js";
4
+ import { Dr as useQuery, Tr as cn, r as Icon } from "./button-CgOIVdmD.js";
5
+ import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-BR_t9iMM.js";
6
+ import { n as workflowPlan } from "./steps-D56DApvK.js";
7
+ import { Y as keepPreviousData, f as skillPreviewQuery } from "./studio-queries-BtRGzDdh.js";
8
+ import { t as MarkdownView } from "./markdown-view-BR8dJ7aR.js";
9
+ import { c as Route } from "./router-DkRHNTpE.js";
9
10
  // src/views/skills/skill-files.tsx
10
11
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
11
12
  var import_jsx_runtime = require_jsx_runtime();
@@ -1,6 +1,6 @@
1
- import { t as createServerRpc } from "./createServerRpc-tK2lE9R2.js";
2
- import { t as createServerFn } from "./createServerFn-F5sAOF8V.js";
3
- import { l as COMPANION_DIGEST_PATTERN } from "./studio-BeltxxKt.js";
1
+ import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
+ import { n as createServerFn } from "../server.js";
3
+ import { u as COMPANION_DIGEST_PATTERN } from "./studio-CAcKp3bM.js";
4
4
  // src/server/skills.ts?tss-serverfn-split
5
5
  var AGENTS = /* @__PURE__ */ new Set([
6
6
  "claude",
@@ -0,0 +1,51 @@
1
+ import "./studio-CAcKp3bM.js";
2
+ import { t as CompanionView } from "./companion-view-BKVXD3TO.js";
3
+ import { n as Specs } from "./specs-view-0peMVd22.js";
4
+ import { n as findAction } from "./actions-D8erOphH.js";
5
+ import { s as Route } from "./router-DkRHNTpE.js";
6
+ import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
7
+ // src/lib/spec-offers.ts
8
+ /** Spec offers as the view renders them: prompts rebuilt from core's action list. */
9
+ function specOffers(data) {
10
+ return (data.actions ?? []).flatMap(({ id, runAgents, copyAgents }) => {
11
+ const action = findAction(id);
12
+ return action ? [{
13
+ action,
14
+ runAgents,
15
+ copyAgents
16
+ }] : [];
17
+ });
18
+ }
19
+ // src/routes/specs.tsx?tsr-split=component
20
+ var import_jsx_runtime = require_jsx_runtime();
21
+ var SplitComponent = function SpecsRoute() {
22
+ const search = Route.useSearch();
23
+ const navigate = Route.useNavigate();
24
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionView, {
25
+ view: "specs",
26
+ search,
27
+ children: (data) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Specs, {
28
+ payload: {
29
+ specs: data.specs ?? [],
30
+ warnings: data.warnings
31
+ },
32
+ actions: specOffers(data),
33
+ companion: search.companion,
34
+ filter: {
35
+ q: search.q,
36
+ repo: search.repo,
37
+ area: search.area
38
+ },
39
+ onFilterChange: (next) => void navigate({
40
+ search: (previous) => ({
41
+ ...previous,
42
+ q: next.q || void 0,
43
+ repo: next.repo,
44
+ area: next.area
45
+ }),
46
+ replace: true
47
+ })
48
+ })
49
+ });
50
+ };
51
+ export { SplitComponent as component };
@@ -0,0 +1,426 @@
1
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
2
+ import { ft as Link, h as vaultQuery } from "./studio-queries-BtRGzDdh.js";
3
+ import { Dr as useQuery, Tr as cn, r as Icon } from "./button-CgOIVdmD.js";
4
+ import "./studio-CAcKp3bM.js";
5
+ import { t as SUBJECT_PATTERN } from "./actions-D8erOphH.js";
6
+ import { c as PAGE_PAD, f as ROW, o as EmptyNote, p as StatusWord, s as ListCard } from "./store-Cs17okNG.js";
7
+ import { t as Input } from "./fields-BbieQTD0.js";
8
+ import { a as Select, c as SelectTrigger, l as SelectValue, o as SelectContent, s as SelectItem } from "./select-Af7Wibii.js";
9
+ import { a as ComboboxItem, i as ComboboxInput, n as ComboboxContent, o as ComboboxList, r as ComboboxEmpty, t as Combobox } from "./combobox-DV_s9W0s.js";
10
+ import { t as Warnings } from "./warnings-CDy9pdgL.js";
11
+ import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-BR_t9iMM.js";
12
+ import { t as MarkdownView } from "./markdown-view-BR8dJ7aR.js";
13
+ // ../mate-core/src/cli/commands/studio/graph-model.ts
14
+ /** Edge kinds by wire code: an edge's kind is its index here. */
15
+ var GRAPH_EDGE_KINDS = [
16
+ "binds",
17
+ "in",
18
+ "mentions",
19
+ "co-change"
20
+ ];
21
+ var ROOT_AREA_LABEL = "Repository root";
22
+ var capabilityNodeId = (capability) => `spec:${capability}`;
23
+ /** Companion-relative path of an archived artifact; `specs/<capability>/spec.md` for a delta. */
24
+ var archivedArtifactPath = (anchor, artifact) => `openspec/changes/archive/${anchor}/${artifact}`;
25
+ var canonicalSpecPath = (capability) => `openspec/specs/${capability}/spec.md`;
26
+ // src/views/specs/spec-areas.ts
27
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
28
+ var UNASSIGNED_AREA = "unassigned";
29
+ var repoValue = (repository) => repository ?? "(none)";
30
+ /** A spec binds one pair or several, so it is placed under each of them. */
31
+ function placements(specs) {
32
+ return specs.flatMap((spec) => spec.scopes.length === 0 ? [{
33
+ repository: null,
34
+ area: UNASSIGNED_AREA,
35
+ spec
36
+ }] : spec.scopes.map((scope) => ({
37
+ repository: scope.repository ?? null,
38
+ area: scope.area ?? UNASSIGNED_AREA,
39
+ spec
40
+ })));
41
+ }
42
+ /** Repositories by name, No repository last. */
43
+ function compareRepositories(left, right) {
44
+ if (left === right) return 0;
45
+ if (left === null) return 1;
46
+ if (right === null) return -1;
47
+ return left.localeCompare(right);
48
+ }
49
+ var countSpecs = (entries) => new Set(entries.map((entry) => entry.spec.capability)).size;
50
+ /** Repository options, then the chosen repository's Area options, each with its spec count. */
51
+ function filterOptions(specs, repo) {
52
+ const all = placements(specs);
53
+ const byRepository = Map.groupBy(all, (entry) => repoValue(entry.repository));
54
+ const repositories = [...byRepository.entries()].map(([value, entries]) => ({
55
+ value,
56
+ repository: entries[0].repository,
57
+ count: countSpecs(entries)
58
+ })).toSorted((left, right) => compareRepositories(left.repository, right.repository));
59
+ const scoped = repo !== void 0 && byRepository.get(repo) || all;
60
+ return {
61
+ repositories,
62
+ areas: [...Map.groupBy(scoped, (entry) => `${repoValue(entry.repository)}\n${entry.area}`).values()].map((entries) => {
63
+ const { repository, area } = entries[0];
64
+ return {
65
+ repo: repoValue(repository),
66
+ repository,
67
+ area,
68
+ count: countSpecs(entries)
69
+ };
70
+ }).toSorted((left, right) => compareRepositories(left.repository, right.repository) || left.area.localeCompare(right.area))
71
+ };
72
+ }
73
+ /**
74
+ * The filter with every value that names nothing in the specs dropped: an unknown repository,
75
+ * an Area outside the chosen repository, an Area without a repository, or blank search.
76
+ * Takes the {@link filterOptions} for `filter.repo`.
77
+ */
78
+ function effectiveFilter({ repositories, areas }, filter) {
79
+ const q = filter.q?.trim();
80
+ const repo = repositories.some((option) => option.value === filter.repo) ? filter.repo : void 0;
81
+ const area = repo !== void 0 && areas.some((option) => option.area === filter.area) ? filter.area : void 0;
82
+ return {
83
+ ...q ? { q } : {},
84
+ ...repo === void 0 ? {} : { repo },
85
+ ...area === void 0 ? {} : { area }
86
+ };
87
+ }
88
+ function matches(entry, filter) {
89
+ if (filter.repo !== void 0 && repoValue(entry.repository) !== filter.repo) return false;
90
+ if (filter.area !== void 0 && entry.area !== filter.area) return false;
91
+ if (!filter.q) return true;
92
+ const needle = filter.q.toLowerCase();
93
+ return entry.spec.capability.toLowerCase().includes(needle) || entry.area.toLowerCase().includes(needle);
94
+ }
95
+ /**
96
+ * Matching specs grouped by repository, then Area. The same Area path under two repositories
97
+ * forms two groups; groups without a matching spec are left out. Pass an
98
+ * {@link effectiveFilter}.
99
+ */
100
+ function groupSpecs(specs, filter = {}) {
101
+ const matching = placements(specs).filter((entry) => matches(entry, filter));
102
+ return [...Map.groupBy(matching, (entry) => repoValue(entry.repository)).values()].map((entries) => ({
103
+ repository: entries[0].repository,
104
+ areas: [...Map.groupBy(entries, (entry) => entry.area)].map(([area, areaEntries]) => ({
105
+ area,
106
+ specs: [...new Set(areaEntries.map((entry) => entry.spec))]
107
+ })).toSorted((left, right) => left.area.localeCompare(right.area))
108
+ })).toSorted((left, right) => compareRepositories(left.repository, right.repository));
109
+ }
110
+ // src/views/specs/specs-view.tsx
111
+ var import_jsx_runtime = require_jsx_runtime();
112
+ var NO_ACTIONS = [];
113
+ function specStatus(spec) {
114
+ if (spec.valid === false) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusWord, {
115
+ marker: "issue",
116
+ children: `${spec.issueCount ?? 0} issues`
117
+ });
118
+ if (spec.valid === true) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusWord, {
119
+ marker: "done",
120
+ children: "valid"
121
+ });
122
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusWord, {
123
+ marker: "idle",
124
+ children: "unvalidated"
125
+ });
126
+ }
127
+ var ROOT_AREA = ".";
128
+ /** The repository-root Area reads as words; any other Area is its path. */
129
+ var areaLabel = (area) => area === ROOT_AREA ? ROOT_AREA_LABEL : area;
130
+ var repositoryLabel = (repository) => repository ?? "No repository";
131
+ var scopeLabel = ({ repository, area }) => [repository, area === void 0 ? void 0 : areaLabel(area)].filter(Boolean).join(" · ");
132
+ /** Address writes from typing wait for a pause; the list itself narrows on every key. */
133
+ var SEARCH_COMMIT_MS = 200;
134
+ function requirementsText(count) {
135
+ if (count === void 0) return "requirements unknown";
136
+ return `${count} ${count === 1 ? "requirement" : "requirements"}`;
137
+ }
138
+ var NO_FILTER = {};
139
+ /** Capabilities by repository and Area; a spec opens wide in the panel. */
140
+ function Specs({ payload, actions = NO_ACTIONS, companion, filter = NO_FILTER, onFilterChange }) {
141
+ const [local, setLocal] = (0, import_react.useState)(filter);
142
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Warnings, { warnings: payload.warnings }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecsByArea, {
143
+ specs: payload.specs,
144
+ actions,
145
+ companion,
146
+ filter: onFilterChange ? filter : local,
147
+ onFilterChange: onFilterChange ?? setLocal
148
+ })] });
149
+ }
150
+ var ALL_AREAS = {
151
+ key: "",
152
+ label: "All Areas"
153
+ };
154
+ var sameAreaItem = (left, right) => left.key === right.key;
155
+ var areaItemLabel = (item) => item.label;
156
+ function SpecsToolbar({ specs, options: { repositories, areas }, filter, search, onSearch, onChange }) {
157
+ const scoped = filter.repo !== void 0;
158
+ const repoItems = [{
159
+ value: "",
160
+ label: "All repositories"
161
+ }, ...repositories.map((option) => ({
162
+ value: option.value,
163
+ label: `${repositoryLabel(option.repository)} (${option.count})`
164
+ }))];
165
+ const areaItems = [ALL_AREAS, ...areas.map((option) => {
166
+ const place = scoped ? areaLabel(option.area) : `${repositoryLabel(option.repository)} · ${areaLabel(option.area)}`;
167
+ return {
168
+ key: `${option.repo}\n${option.area}`,
169
+ label: `${place} (${option.count})`,
170
+ option
171
+ };
172
+ })];
173
+ const chosenArea = areaItems.find((item) => item.option?.repo === filter.repo && item.option?.area === filter.area) ?? ALL_AREAS;
174
+ const chooseRepo = (repo) => {
175
+ const next = repo || void 0;
176
+ const kept = filterOptions(specs, next).areas.some((option) => option.repo === next && option.area === filter.area);
177
+ onChange({
178
+ ...filter,
179
+ repo: next,
180
+ area: kept ? filter.area : void 0
181
+ });
182
+ };
183
+ const chooseArea = (item) => onChange(item?.option ? {
184
+ ...filter,
185
+ repo: item.option.repo,
186
+ area: item.option.area
187
+ } : {
188
+ ...filter,
189
+ area: void 0
190
+ });
191
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
192
+ className: "flex flex-wrap items-center gap-2",
193
+ role: "search",
194
+ "aria-label": "Filter specs",
195
+ children: [
196
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Input, {
197
+ type: "search",
198
+ className: "w-64 max-sm:w-full",
199
+ placeholder: "Search capability or Area",
200
+ "aria-label": "Search specs",
201
+ value: search,
202
+ onChange: (event) => onSearch(event.currentTarget.value)
203
+ }),
204
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Select, {
205
+ items: repoItems,
206
+ value: filter.repo ?? "",
207
+ onValueChange: chooseRepo,
208
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectTrigger, {
209
+ className: "w-auto max-w-72",
210
+ "aria-label": "Repository",
211
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectValue, {})
212
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectContent, { children: repoItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SelectItem, {
213
+ value: item.value,
214
+ children: item.label
215
+ }, item.value)) })]
216
+ }),
217
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Combobox, {
218
+ items: areaItems,
219
+ value: chosenArea,
220
+ onValueChange: chooseArea,
221
+ isItemEqualToValue: sameAreaItem,
222
+ itemToStringLabel: areaItemLabel,
223
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxInput, {
224
+ className: "w-80 max-sm:w-full",
225
+ "aria-label": "Area",
226
+ placeholder: "All Areas"
227
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(ComboboxContent, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxEmpty, { children: "No Areas match" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxList, { children: (item) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ComboboxItem, {
228
+ value: item,
229
+ children: item.label
230
+ }, item.key) })] })]
231
+ })
232
+ ]
233
+ });
234
+ }
235
+ var ACTION_BUTTON = "inline-flex h-7 items-center gap-1.5 rounded-[6px] border border-rule bg-surface px-2.5 text-xs text-text hover:border-accent hover:bg-accent-soft";
236
+ function SpecActions({ capability, actions }) {
237
+ if (!SUBJECT_PATTERN.test(capability) || actions.length === 0) return null;
238
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
239
+ className: "spec-actions flex flex-wrap items-center gap-1.5",
240
+ children: actions.map(({ action, runAgents, copyAgents }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [runAgents.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
241
+ type: "button",
242
+ className: cn(ACTION_BUTTON, "spec-action"),
243
+ "data-studio-action": action.id,
244
+ "data-studio-subject": capability,
245
+ "data-studio-agents": runAgents.join(" "),
246
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
247
+ name: "play",
248
+ className: "size-3.5"
249
+ }), action.label]
250
+ }) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
251
+ type: "button",
252
+ className: cn(ACTION_BUTTON, "spec-copy"),
253
+ "aria-label": "Copy prompt",
254
+ "data-studio-copy-prompt": action.id,
255
+ "data-prompt-claude": copyAgents.includes("claude") ? action.prompts.claude(capability) : void 0,
256
+ "data-prompt-opencode": copyAgents.includes("opencode") ? action.prompts.opencode(capability) : void 0,
257
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
258
+ name: "copy",
259
+ className: "size-3.5"
260
+ }), "Copy prompt"]
261
+ })] }, action.id))
262
+ });
263
+ }
264
+ function SpecRows({ specs, open, onOpen }) {
265
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
266
+ className: "m-0 list-none p-0",
267
+ children: specs.map((spec) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
268
+ type: "button",
269
+ className: cn(ROW, "grid grid-cols-[minmax(0,1fr)_auto_120px] py-1.5 max-sm:grid-cols-[minmax(0,1fr)_auto]"),
270
+ "aria-current": open === spec.capability ? "true" : void 0,
271
+ "data-spec": spec.capability,
272
+ onClick: () => onOpen(spec.capability),
273
+ children: [
274
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
275
+ className: "truncate font-mono text-sm",
276
+ children: spec.capability
277
+ }),
278
+ spec.valid === true ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}) : specStatus(spec),
279
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
280
+ className: "text-right text-xs text-muted tabular-nums max-sm:hidden",
281
+ children: requirementsText(spec.requirementCount)
282
+ })
283
+ ]
284
+ }) }, spec.capability))
285
+ });
286
+ }
287
+ function SpecsByArea({ specs, actions, companion, filter, onFilterChange }) {
288
+ const [search, setSearch] = (0, import_react.useState)(filter.q ?? "");
289
+ const [addressSearch, setAddressSearch] = (0, import_react.useState)(filter.q);
290
+ if (filter.q !== addressSearch) {
291
+ setAddressSearch(filter.q);
292
+ if ((filter.q ?? "") !== search.trim()) setSearch(filter.q ?? "");
293
+ }
294
+ const pending = (0, import_react.useRef)(void 0);
295
+ (0, import_react.useEffect)(() => () => clearTimeout(pending.current), []);
296
+ const options = filterOptions(specs, filter.repo);
297
+ const applied = effectiveFilter(options, {
298
+ ...filter,
299
+ q: search
300
+ });
301
+ const commit = (next) => {
302
+ clearTimeout(pending.current);
303
+ onFilterChange(next);
304
+ };
305
+ const onSearch = (value) => {
306
+ setSearch(value);
307
+ clearTimeout(pending.current);
308
+ pending.current = setTimeout(() => onFilterChange({
309
+ ...applied,
310
+ q: value.trim()
311
+ }), SEARCH_COMMIT_MS);
312
+ };
313
+ const clear = () => {
314
+ setSearch("");
315
+ commit({});
316
+ };
317
+ const groups = groupSpecs(specs, applied);
318
+ const [open, setOpen] = (0, import_react.useState)(null);
319
+ const order = [...new Set(groups.flatMap((group) => group.areas.flatMap((area) => area.specs.map((spec) => spec.capability))))];
320
+ const current = specs.find((spec) => spec.capability === open) ?? null;
321
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
322
+ className: cn(PAGE_PAD, "grid content-start gap-3 pb-10"),
323
+ "aria-label": "Specs by repository and Area",
324
+ children: [specs.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyNote, { children: "No specs in this companion." }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecsToolbar, {
325
+ specs,
326
+ options,
327
+ filter: applied,
328
+ search,
329
+ onSearch,
330
+ onChange: (next) => commit({
331
+ ...next,
332
+ q: search.trim()
333
+ })
334
+ }), groups.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(EmptyNote, {
335
+ className: "flex flex-wrap items-center gap-3",
336
+ children: ["No spec matches the search and filters.", /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
337
+ type: "button",
338
+ className: ACTION_BUTTON,
339
+ onClick: clear,
340
+ children: "Clear filters"
341
+ })]
342
+ }) : groups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
343
+ className: "grid content-start gap-3",
344
+ "aria-label": `Repository ${repositoryLabel(group.repository)}`,
345
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h2", {
346
+ className: "m-0 mt-2 font-mono text-sm font-semibold text-muted",
347
+ children: repositoryLabel(group.repository)
348
+ }), group.areas.map(({ area, specs: areaSpecs }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListCard, {
349
+ level: 3,
350
+ title: area === ROOT_AREA ? areaLabel(area) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
351
+ className: "font-mono",
352
+ children: area
353
+ }),
354
+ label: `Area ${area}`,
355
+ count: areaSpecs.length,
356
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecRows, {
357
+ specs: areaSpecs,
358
+ open,
359
+ onOpen: setOpen
360
+ })
361
+ }, area))]
362
+ }, group.repository ?? ""))] }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidePanel, {
363
+ items: order,
364
+ current: current?.capability ?? null,
365
+ onSelect: setOpen,
366
+ wide: true,
367
+ title: current ? `Spec ${current.capability}` : "Spec",
368
+ children: current ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecDetail, {
369
+ spec: current,
370
+ actions,
371
+ companion
372
+ }) : null
373
+ })]
374
+ });
375
+ }
376
+ /** A spec's panel body: head, Vault link and the rendered spec; the Graph panel reuses it. */
377
+ function SpecDetail({ spec, actions = NO_ACTIONS, companion, withStatus = true, children }) {
378
+ const path = canonicalSpecPath(spec.capability);
379
+ const file = useQuery({
380
+ ...vaultQuery(companion ?? "", { path }),
381
+ enabled: Boolean(companion)
382
+ });
383
+ const markdown = file.data?.open?.markdown;
384
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
385
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelHead, {
386
+ mono: true,
387
+ title: spec.capability,
388
+ kicker: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [withStatus ? specStatus(spec) : null, /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
389
+ className: "ml-auto",
390
+ children: spec.scopes.map(scopeLabel).join(", ")
391
+ })] }),
392
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
393
+ className: "flex flex-wrap items-center gap-2",
394
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecActions, {
395
+ capability: spec.capability,
396
+ actions
397
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
398
+ className: "inline-flex items-center gap-1.5 text-sm",
399
+ to: "/vault",
400
+ search: (previous) => ({
401
+ companion: previous.companion,
402
+ studioMode: previous.studioMode,
403
+ path
404
+ }),
405
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
406
+ name: "external",
407
+ className: "size-3.5"
408
+ }), " Open in Vault"]
409
+ })]
410
+ })
411
+ }),
412
+ children,
413
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
414
+ title: "Spec",
415
+ aside: spec.requirementCount === void 0 ? void 0 : requirementsText(spec.requirementCount),
416
+ children: markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
417
+ className: "prose-panel",
418
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownView, { nodes: markdown })
419
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
420
+ className: "m-0 text-sm text-muted",
421
+ children: file.isError ? "The spec file could not be read." : file.isPending && companion ? "Loading…" : "The spec file could not be read."
422
+ })
423
+ })
424
+ ] });
425
+ }
426
+ export { archivedArtifactPath as a, ROOT_AREA_LABEL as i, Specs as n, capabilityNodeId as o, GRAPH_EDGE_KINDS as r, SpecDetail as t };
@@ -0,0 +1,20 @@
1
+ import { Tr as cn } from "./button-CgOIVdmD.js";
2
+ import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
3
+ // src/components/ui/spinner.tsx
4
+ var import_jsx_runtime = require_jsx_runtime();
5
+ function Spinner({ className, ...props }) {
6
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
7
+ "data-slot": "spinner",
8
+ role: "status",
9
+ "aria-label": "Loading",
10
+ viewBox: "0 0 24 24",
11
+ fill: "none",
12
+ stroke: "currentColor",
13
+ strokeWidth: 2,
14
+ strokeLinecap: "round",
15
+ className: cn("size-4 shrink-0 animate-spin motion-reduce:animate-none", className),
16
+ ...props,
17
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M12 3a9 9 0 1 1-9 9" })
18
+ });
19
+ }
20
+ export { Spinner as t };
@@ -1,4 +1,4 @@
1
- import { a as SCHEMA_ARTIFACTS, c as CHANGE_PLACEHOLDER, d as IDEA_PLACEHOLDER, o as deliveryPath, s as isMateSchema } from "./studio-BeltxxKt.js";
1
+ import { a as SCHEMA_ARTIFACTS, f as IDEA_PLACEHOLDER, l as CHANGE_PLACEHOLDER, o as deliveryPath, s as isMateSchema } from "./studio-CAcKp3bM.js";
2
2
  // src/views/workflow/steps.ts
3
3
  var CLARIFY_MODES = [
4
4
  "mate-clarify-intent",