@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,11 @@
1
- import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
2
- import { B as useMutation, L as useVaultUi, S as useMediaQuery, V as useSuspenseQuery, r as Route, x as ViewPlaceholder, z as Tooltip } from "./router-C8MGqlAY.js";
3
- import { Ar as cn, Bi as Link, Gr as vaultChildrenQuery, Ii as useQueryClient, Jr as getVault, Kr as vaultMatchesQuery, Lr as afterVaultFileChange, Rr as afterVaultRefresh, Ur as shellQuery, Vi as useNavigate, Xr as saveVaultFile, Yr as previewVaultFile, fi as useQuery, n as buttonVariants, nt as ListCard, qr as vaultQuery, r as Icon, st as ROW, t as Button } from "./button-CIJqAhni.js";
4
- import { c as useRouter, j as require_react, u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
5
- import { t as MarkdownView } from "./markdown-view-Bn7xPdks.js";
1
+ import { E as ViewPlaceholder, N as useMediaQuery, St as useSuspenseQuery, _t as Tooltip, a as Route, ht as useVaultUi } from "./router-DkRHNTpE.js";
2
+ import { _ as previewVaultFile, a as afterVaultRefresh, d as shellQuery, ft as Link, g as getVault, h as vaultQuery, i as afterVaultFileChange, m as vaultMatchesQuery, p as vaultChildrenQuery, pt as useNavigate, v as saveVaultFile } from "./studio-queries-BtRGzDdh.js";
3
+ import { t as useMutation } from "./useMutation-DzTZGenE.js";
4
+ import { Dr as useQuery, Tr as cn, n as buttonVariants, r as Icon, t as Button, zr as useQueryClient } from "./button-CgOIVdmD.js";
5
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
6
+ import { f as ROW, s as ListCard } from "./store-Cs17okNG.js";
7
+ import { a as useRouter } from "./useSelector-DUmCUXAs.js";
8
+ import { t as MarkdownView } from "./markdown-view-BR8dJ7aR.js";
6
9
  // ../../node_modules/.bun/@tanstack+react-router@1.170.46+7492c01c6988791b/node_modules/@tanstack/react-router/dist/esm/useBlocker.js
7
10
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
11
  function _resolveBlockerOpts(opts, condition) {
@@ -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/vault.ts?tss-serverfn-split
5
5
  var MAX_CONTENT = 5242880;
6
6
  function companionOf(input) {
@@ -1,8 +1,8 @@
1
- import { t as createServerRpc } from "./createServerRpc-tK2lE9R2.js";
2
- import { t as createServerFn } from "./createServerFn-F5sAOF8V.js";
1
+ import { t as createServerRpc } from "./createServerRpc-bFKFpGFG.js";
2
+ import { n as createServerFn } from "../server.js";
3
3
  import { r as specActionOffers } from "./actions-D8erOphH.js";
4
- import { _ as VIEW_PARAM, g as STUDIO_MODE_PARAM, l as COMPANION_DIGEST_PATTERN, u as COMPANION_PARAM, v as companionDigest } from "./studio-BeltxxKt.js";
5
- import { n as validateStudioSearch } from "./search-JAKurDNh.js";
4
+ import { _ as STUDIO_MODE_PARAM, d as COMPANION_PARAM, u as COMPANION_DIGEST_PATTERN, v as VIEW_PARAM, y as companionDigest } from "./studio-CAcKp3bM.js";
5
+ import { r as validateStudioSearch } from "./search-BJnWLfkG.js";
6
6
  // src/server/views.ts?tss-serverfn-split
7
7
  var VIEWS = /* @__PURE__ */ new Set([
8
8
  "dashboard",
@@ -1,5 +1,6 @@
1
- import { Ar as cn, rt as PAGE_PAD } from "./button-CIJqAhni.js";
2
- import { u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
1
+ import { Tr as cn } from "./button-CgOIVdmD.js";
2
+ import { c as PAGE_PAD } from "./store-Cs17okNG.js";
3
+ import { t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
3
4
  // src/views/warnings.tsx
4
5
  var import_jsx_runtime = require_jsx_runtime();
5
6
  /** Degraded collection is reported without costing the rest of the page. */
@@ -1,8 +1,12 @@
1
- import { i as __toESM } from "./rolldown-runtime-DYf_mQCB.js";
2
- import { j as require_react, u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
3
- import { $ as CommandLine, Ar as cn, at as Pills, et as Count, nt as ListCard, rt as PAGE_PAD } from "./button-CIJqAhni.js";
4
- import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-3Jmn4awF.js";
5
- import { n as workflowPlan, t as PHASE_LABELS } from "./steps-Dq_CwY_s.js";
1
+ import { Dr as useQuery, Tr as cn } from "./button-CgOIVdmD.js";
2
+ import { R as changeStep, T as useBrowser, i as Route } from "./router-DkRHNTpE.js";
3
+ import { o as companionViewQuery } from "./studio-queries-BtRGzDdh.js";
4
+ import { t as CompanionView } from "./companion-view-BKVXD3TO.js";
5
+ import { t as Warnings } from "./warnings-CDy9pdgL.js";
6
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
7
+ import { a as Count, c as PAGE_PAD, i as CommandLine, s as ListCard, u as Pills } from "./store-Cs17okNG.js";
8
+ import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-BR_t9iMM.js";
9
+ import { n as workflowPlan, t as PHASE_LABELS } from "./steps-D56DApvK.js";
6
10
  // src/views/workflow/graph.ts
7
11
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
12
  var stageNode = (step) => ({
@@ -193,53 +197,36 @@ function DeliveryPathView({ payload, counts = NO_COUNTS, changesByStage = NO_STA
193
197
  });
194
198
  const [schema, setSchema] = (0, import_react.useState)(plan.paths[0].schema);
195
199
  const path = plan.paths.find((entry) => entry.schema === schema) ?? plan.paths[0];
196
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
200
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
197
201
  className: "workflow-delivery-path @container grid content-start gap-2",
198
202
  "aria-label": "Delivery Path",
199
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
200
- className: cn(PAGE_PAD, "flex flex-wrap items-center gap-3"),
201
- "data-workflow-schema-root": true,
202
- children: [
203
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
204
- className: "text-sm text-muted",
205
- children: "OpenSpec schema"
206
- }),
207
- plan.paths.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pills, {
208
- label: "OpenSpec schema",
209
- value: schema,
210
- onChange: setSchema,
211
- options: plan.paths.map((entry) => ({
212
- value: entry.schema,
213
- label: entry.label
214
- }))
215
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
216
- className: "font-mono text-sm",
217
- children: path.label
218
- }),
219
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
220
- className: "text-sm text-muted",
221
- children: path.tagline
222
- })
223
- ]
224
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathBody, {
203
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathBody, {
225
204
  path,
205
+ paths: plan.paths,
206
+ onSchemaChange: setSchema,
226
207
  counts,
227
208
  changesByStage
228
- }, path.schema)]
209
+ })
229
210
  });
230
211
  }
231
212
  var nodeOf = (step) => step.kind === "human" ? "reviews" : step.id;
232
213
  /** The graph on the page; one stage's detail opens in the slide-over panel. */
233
- function PathBody({ path, counts, changesByStage }) {
214
+ function PathBody({ path, paths, onSchemaChange, counts, changesByStage }) {
234
215
  const [selected, setSelected] = (0, import_react.useState)(null);
235
216
  const step = path.steps.find((entry) => entry.id === selected) ?? null;
236
217
  const placed = changesByStage.filter((group) => group.changes.length > 0);
218
+ const changeSchema = (schema) => {
219
+ const next = paths.find((entry) => entry.schema === schema);
220
+ if (!next) return;
221
+ if (!next.steps.some((entry) => entry.id === selected)) setSelected(next.steps.find((entry) => entry.kind === "human")?.id ?? null);
222
+ onSchemaChange(schema);
223
+ };
237
224
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
238
225
  className: cn(PAGE_PAD, "workflow-path grid grid-cols-[minmax(380px,520px)_minmax(260px,1fr)] items-start gap-10 pt-10 pb-12 @max-[880px]:grid-cols-1"),
239
226
  "data-workflow-schema-panel": path.schema,
240
227
  children: [
241
228
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
242
- className: "workflow-path-graph grid min-w-0 justify-items-center gap-9 px-8",
229
+ className: "workflow-path-graph grid min-w-0 justify-items-center gap-9 px-8 pt-4",
243
230
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(WorkflowGraphView, {
244
231
  path,
245
232
  selected,
@@ -294,29 +281,35 @@ function PathBody({ path, counts, changesByStage }) {
294
281
  title: step ? `Stage ${step.label}` : "Stage",
295
282
  children: step ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StageDetail, {
296
283
  step,
297
- changes: changesByStage.find((group) => group.node === nodeOf(step))?.changes ?? []
284
+ changes: changesByStage.find((group) => group.node === nodeOf(step))?.changes ?? [],
285
+ children: step.kind === "human" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
286
+ title: "OpenSpec schema",
287
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
288
+ className: "grid gap-2",
289
+ "data-workflow-schema-root": true,
290
+ children: [paths.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pills, {
291
+ label: "OpenSpec schema",
292
+ value: path.schema,
293
+ onChange: changeSchema,
294
+ options: paths.map((entry) => ({
295
+ value: entry.schema,
296
+ label: entry.label
297
+ }))
298
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", {
299
+ className: "font-mono text-sm",
300
+ children: path.label
301
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
302
+ className: "text-sm text-muted",
303
+ children: path.tagline
304
+ })]
305
+ })
306
+ }) : null
298
307
  }) : null
299
308
  })
300
309
  ]
301
310
  });
302
311
  }
303
312
  var overviewId = (path) => `workflow-${path.schema}-overview`;
304
- /** Each node's progress, by column: everything left of the current node is done. */
305
- function progressOf(graph, progress) {
306
- if (!progress) return () => void 0;
307
- const at = currentColumn(graph, progress.current);
308
- return (node) => {
309
- if (node.column < at) return "done";
310
- return node.id === progress.current ? "current" : "next";
311
- };
312
- }
313
- /** The current node's column; past the last column when `complete`. */
314
- function currentColumn(graph, current) {
315
- const found = graph.nodes.find((node) => node.id === current);
316
- if (found) return found.column;
317
- if (current === "complete") return graph.columns;
318
- return -1;
319
- }
320
313
  var COUNT_NAMES = { reviews: (count) => `${count} ${count === 1 ? "change waits" : "changes wait"} for review` };
321
314
  var countName = (node, label, count) => COUNT_NAMES[node]?.(count) ?? `${count} ${count === 1 ? "change" : "changes"} at ${label}`;
322
315
  /** How many of the companion's changes are at a node; named for assistive technology. */
@@ -331,17 +324,15 @@ function CountBadge({ count, name }) {
331
324
  }
332
325
  /**
333
326
  * Stage buttons are the only announced part: their document order is the stage order. Bands,
334
- * edges, and marks are decorative and hidden from assistive technology. With `progress` the
335
- * map shows one item's position, and nodes are plain labels.
327
+ * edges, and marks are decorative and hidden from assistive technology. Without `onSelect`
328
+ * nodes are plain labels.
336
329
  */
337
- function WorkflowGraphView({ path, progress, label = "Delivery Path map", selected = null, onSelect, counts = NO_COUNTS }) {
330
+ function WorkflowGraphView({ path, label = "Delivery Path map", selected = null, onSelect, counts = NO_COUNTS }) {
338
331
  const graph = workflowGraph(path);
339
- const stateOf = progressOf(graph, progress);
340
- const plain = Boolean(progress) || !onSelect;
332
+ const plain = !onSelect;
341
333
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("nav", {
342
334
  className: "workflow-graph",
343
335
  "aria-label": label,
344
- "data-progress-activity": progress?.activity,
345
336
  style: {
346
337
  "--graph-columns": String(graph.columns),
347
338
  "--graph-rows": String(graph.rows)
@@ -368,17 +359,12 @@ function WorkflowGraphView({ path, progress, label = "Delivery Path map", select
368
359
  })
369
360
  ]
370
361
  }),
371
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GraphLayer, {
372
- graph,
373
- stateOf
374
- }),
362
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(GraphLayer, { graph }),
375
363
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
376
364
  className: "workflow-graph-nodes",
377
365
  children: graph.nodes.map((node) => node.kind === "start" ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
378
366
  className: "workflow-graph-node",
379
367
  "data-node-kind": node.kind,
380
- "data-progress": stateOf(node),
381
- "aria-current": stateOf(node) === "current" ? "step" : void 0,
382
368
  style: {
383
369
  "--graph-row": String(node.column + 1),
384
370
  "--graph-lane": String(node.row + 1),
@@ -391,11 +377,7 @@ function WorkflowGraphView({ path, progress, label = "Delivery Path map", select
391
377
  box: true,
392
378
  plain,
393
379
  current: selected === node.step.id,
394
- onSelect,
395
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressNote, {
396
- progress,
397
- state: stateOf(node)
398
- })
380
+ onSelect
399
381
  }), plain ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CountBadge, {
400
382
  count: counts[node.id],
401
383
  name: countName(node.id, node.step.label, counts[node.id] ?? 0)
@@ -405,9 +387,14 @@ function WorkflowGraphView({ path, progress, label = "Delivery Path map", select
405
387
  "data-map-group": "human",
406
388
  "data-current": node.steps.some((step) => step.id === selected) ? "true" : void 0,
407
389
  children: [
408
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
390
+ plain ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
409
391
  className: "workflow-graph-group-label",
410
392
  children: "Human review"
393
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
394
+ type: "button",
395
+ className: "workflow-graph-group-label cursor-pointer rounded-sm focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",
396
+ onClick: () => onSelect?.(node.steps[0].id),
397
+ children: "Human review"
411
398
  }),
412
399
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", { children: node.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(NodeLink, {
413
400
  step,
@@ -415,10 +402,6 @@ function WorkflowGraphView({ path, progress, label = "Delivery Path map", select
415
402
  current: selected === step.id,
416
403
  onSelect
417
404
  }) }, step.id)) }),
418
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ProgressNote, {
419
- progress,
420
- state: stateOf(node)
421
- }),
422
405
  plain ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CountBadge, {
423
406
  count: counts.reviews,
424
407
  name: countName("reviews", "Human review", counts.reviews ?? 0)
@@ -443,25 +426,7 @@ function GraphLegend() {
443
426
  ]
444
427
  });
445
428
  }
446
- /** The current node's note, plus the done mark for assistive technology. */
447
- function ProgressNote({ progress, state }) {
448
- if (state === "done") return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
449
- className: "sr-only",
450
- children: ", done"
451
- });
452
- if (state !== "current" || !progress?.note) return null;
453
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
454
- className: "workflow-graph-note",
455
- children: progress.note
456
- });
457
- }
458
- function GraphLayer({ graph, stateOf }) {
459
- /** A flow edge into a done or current node is the way the item came. */
460
- const travelled = (edge) => {
461
- const to = graph.nodes.find((node) => node.id === edge.to);
462
- const state = to ? stateOf(to) : void 0;
463
- return edge.kind === "flow" && (state === "done" || state === "current");
464
- };
429
+ function GraphLayer({ graph }) {
465
430
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("svg", {
466
431
  className: "workflow-graph-layer",
467
432
  "aria-hidden": "true",
@@ -477,8 +442,7 @@ function GraphLayer({ graph, stateOf }) {
477
442
  "data-edge-kind": edge.kind,
478
443
  "data-edge-from": edge.from,
479
444
  "data-edge-to": edge.to,
480
- "data-new-session": edge.newSession ? "true" : void 0,
481
- "data-travelled": travelled(edge) ? "true" : void 0
445
+ "data-new-session": edge.newSession ? "true" : void 0
482
446
  }, `${edge.kind}-${edge.from}-${edge.to}`))
483
447
  }),
484
448
  graph.nodes.map((node) => {
@@ -509,21 +473,17 @@ function GraphLayer({ graph, stateOf }) {
509
473
  * `box` marks a standalone node; stages inside the review group share its box. `plain` renders
510
474
  * a label, for a map that opens nothing.
511
475
  */
512
- function NodeLink({ step, box, plain, current, onSelect, children }) {
476
+ function NodeLink({ step, box, plain, current, onSelect }) {
513
477
  const shared = {
514
478
  className: box ? "workflow-graph-link workflow-graph-box" : "workflow-graph-link",
515
479
  "data-map-stage": step.id,
516
480
  "data-stage-kind": step.kind,
517
481
  "data-optional": step.optional ? "true" : void 0
518
482
  };
519
- const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
520
- step.badges.includes("openspec") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
521
- className: "workflow-graph-openspec",
522
- "aria-hidden": "true"
523
- }) : null,
524
- step.kind === "human" ? step.artifact : step.label,
525
- children
526
- ] });
483
+ const body = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [step.badges.includes("openspec") ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
484
+ className: "workflow-graph-openspec",
485
+ "aria-hidden": "true"
486
+ }) : null, step.kind === "human" ? step.artifact : step.label] });
527
487
  if (plain) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
528
488
  ...shared,
529
489
  children: body
@@ -538,7 +498,7 @@ function NodeLink({ step, box, plain, current, onSelect, children }) {
538
498
  });
539
499
  }
540
500
  /** One stage in the panel: what it does, how it runs, and the changes at it. */
541
- function StageDetail({ step, changes }) {
501
+ function StageDetail({ step, changes, children }) {
542
502
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("article", {
543
503
  className: "workflow-card",
544
504
  "data-stage": step.id,
@@ -570,6 +530,7 @@ function StageDetail({ step, changes }) {
570
530
  }) : null]
571
531
  }) : null
572
532
  }),
533
+ children,
573
534
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PanelSection, {
574
535
  title: step.kind === "human" ? "How it runs" : "Run",
575
536
  children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(StageRun, { step }), step.missingSkill ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", {
@@ -651,4 +612,69 @@ function StageRun({ step }) {
651
612
  label: `${step.label} prompt`
652
613
  });
653
614
  }
654
- export { WorkflowGraphView as n, DeliveryPathView as t };
615
+ // src/views/workflow/workflow-view.tsx
616
+ /** Graph node per change stage, in path order; matches the stage the Overview panel names. */
617
+ var STAGE_NODES = [
618
+ {
619
+ node: "propose",
620
+ label: "Propose change"
621
+ },
622
+ {
623
+ node: "reviews",
624
+ label: "Human review"
625
+ },
626
+ {
627
+ node: "apply",
628
+ label: "Apply change"
629
+ },
630
+ {
631
+ node: "archive",
632
+ label: "Archive change"
633
+ }
634
+ ];
635
+ function stagesOf(changes) {
636
+ const byStage = STAGE_NODES.map((stage) => ({
637
+ ...stage,
638
+ changes: changes.flatMap((change) => changeStep(change).stage === stage.label ? [change.name] : [])
639
+ }));
640
+ const counts = {};
641
+ for (const stage of byStage) if (stage.changes.length > 0) counts[stage.node] = stage.changes.length;
642
+ return {
643
+ counts,
644
+ byStage
645
+ };
646
+ }
647
+ var NO_CHANGES = [];
648
+ function Workflow({ payload, changes = NO_CHANGES }) {
649
+ const { counts, byStage } = stagesOf(changes);
650
+ 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)("div", {
651
+ className: "workflow-view",
652
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DeliveryPathView, {
653
+ payload,
654
+ counts,
655
+ changesByStage: byStage
656
+ })
657
+ })] });
658
+ }
659
+ // src/routes/workflow.tsx?tsr-split=component
660
+ var SplitComponent = function WorkflowRoute() {
661
+ const search = Route.useSearch();
662
+ const browser = useBrowser();
663
+ const overview = useQuery({
664
+ ...companionViewQuery("dashboard", search),
665
+ enabled: browser
666
+ });
667
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompanionView, {
668
+ view: "workflow",
669
+ search,
670
+ children: (data) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Workflow, {
671
+ payload: {
672
+ skills: data.skills ?? [],
673
+ topology: data.topology ?? null,
674
+ warnings: data.warnings
675
+ },
676
+ changes: overview.data?.changes ?? []
677
+ })
678
+ });
679
+ };
680
+ export { SplitComponent as component };