@uniqbit/mate-core 1.0.0-canary.5 → 1.0.0-canary.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) 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 +41 -1
  4. package/claude-plugin/hooks/rtk-worktree-git.mjs +58 -0
  5. package/claude-plugin/hooks/workflow-turn.mjs +68 -0
  6. package/opencode-plugin/src/companion.ts +6 -0
  7. package/opencode-plugin/src/server.ts +33 -2
  8. package/package.json +5 -2
  9. package/src/cli/commands/artifact/apply-context.ts +1 -0
  10. package/src/cli/commands/artifact/artifact.ts +16 -0
  11. package/src/cli/commands/artifact/delivery/archive.ts +37 -112
  12. package/src/cli/commands/artifact/delivery/branch-flags.ts +19 -1
  13. package/src/cli/commands/artifact/delivery/environment.ts +32 -72
  14. package/src/cli/commands/artifact/delivery/link.ts +53 -34
  15. package/src/cli/commands/artifact/delivery/output.ts +25 -4
  16. package/src/cli/commands/artifact/delivery/resolve.ts +101 -0
  17. package/src/cli/commands/artifact/delivery/submit.ts +164 -0
  18. package/src/cli/commands/artifact/delivery/take.ts +45 -0
  19. package/src/cli/commands/artifact/extract-repo-name.ts +1 -1
  20. package/src/cli/commands/artifact/finish/command.ts +455 -43
  21. package/src/cli/commands/artifact/finish/engine.ts +79 -61
  22. package/src/cli/commands/artifact/finish/finisher.ts +5 -12
  23. package/src/cli/commands/artifact/finish/git.ts +9 -10
  24. package/src/cli/commands/artifact/finish/openspec.ts +21 -174
  25. package/src/cli/commands/artifact/finish/secret-scan.ts +5 -43
  26. package/src/cli/commands/artifact/finish/worktree-cleanup.ts +57 -7
  27. package/src/cli/commands/artifact/pending/command.ts +119 -6
  28. package/src/cli/commands/artifact/pending/discovery.ts +7 -11
  29. package/src/cli/commands/artifact/project/command.ts +60 -0
  30. package/src/cli/commands/companion/list.ts +70 -14
  31. package/src/cli/commands/companion/sync.ts +18 -0
  32. package/src/cli/commands/companion/update.ts +4 -19
  33. package/src/cli/commands/install.ts +48 -36
  34. package/src/cli/commands/launch/claude.ts +2 -0
  35. package/src/cli/commands/launch/shared.ts +33 -6
  36. package/src/cli/commands/plugin/install.ts +27 -11
  37. package/src/cli/commands/report/index.ts +180 -184
  38. package/src/cli/commands/report/markdown.ts +67 -72
  39. package/src/cli/commands/shared/companion-selection.ts +3 -1
  40. package/src/cli/commands/studio/access.ts +6 -14
  41. package/src/cli/commands/studio/areas.ts +112 -33
  42. package/src/cli/commands/studio/companion-add.ts +72 -0
  43. package/src/cli/commands/studio/companion-removal.ts +15 -8
  44. package/src/cli/commands/studio/graph-model.ts +61 -0
  45. package/src/cli/commands/studio/graph.ts +336 -0
  46. package/src/cli/commands/studio/index.ts +4 -4
  47. package/src/{lib/factory/outcomes/sessions.ts → cli/commands/studio/live-sessions.ts} +26 -2
  48. package/src/cli/commands/studio/payload.ts +214 -32
  49. package/src/cli/commands/studio/reports.ts +19 -18
  50. package/src/cli/commands/studio/routes.ts +5 -18
  51. package/src/cli/commands/studio/selection.ts +12 -5
  52. package/src/cli/commands/studio/server.ts +291 -191
  53. package/src/cli/commands/studio/service-host.ts +266 -0
  54. package/src/cli/commands/studio/services.ts +34 -16
  55. package/src/cli/commands/studio/studio-app.ts +1 -0
  56. package/src/cli/commands/studio/terminal.ts +45 -3
  57. package/src/cli/commands/studio/vault.ts +41 -40
  58. package/src/cli/commands/studio/views/model.ts +1 -9
  59. package/src/cli/commands/studio/views/vault/markdown-tree.ts +90 -8
  60. package/src/cli/commands/unwrap.ts +3 -0
  61. package/src/cli/commands/update.ts +2 -0
  62. package/src/cli/commands/vscode/release-vsix.json +4 -0
  63. package/src/cli/commands/vscode/setup.ts +71 -13
  64. package/src/cli/commands/vscode/vsix.ts +48 -7
  65. package/src/cli/commands/workflow/workflow.ts +516 -0
  66. package/src/cli/commands/working/cleanup.ts +40 -8
  67. package/src/cli/commands/working/worktree.ts +176 -35
  68. package/src/cli/main.ts +39 -10
  69. package/src/cli/repo-list-table.tsx +73 -37
  70. package/src/cli/usage.ts +19 -8
  71. package/src/factory-host.ts +69 -0
  72. package/src/hooks/companion-instructions.ts +19 -8
  73. package/src/hooks/hook-io.ts +3 -1
  74. package/src/hooks/rtk-worktree-git.ts +48 -0
  75. package/src/hooks/session-banner.ts +25 -0
  76. package/src/hooks/validate-artifact-path.ts +44 -12
  77. package/src/hooks/workflow-turn.ts +219 -0
  78. package/src/lib/apply-context/fingerprint.ts +2 -1
  79. package/src/lib/apply-context/protocol.ts +2 -2
  80. package/src/lib/artifact-trailer.ts +27 -0
  81. package/src/lib/change-layout.ts +83 -38
  82. package/src/lib/delivery/branch-template.ts +114 -0
  83. package/src/lib/delivery/branches.ts +21 -16
  84. package/src/lib/delivery/checkout.ts +103 -0
  85. package/src/lib/delivery/environment.ts +131 -7
  86. package/src/lib/delivery/merge-git.ts +282 -26
  87. package/src/lib/delivery/overlap.ts +68 -16
  88. package/src/lib/delivery/record-delivery.ts +178 -37
  89. package/src/lib/delivery/record.ts +201 -27
  90. package/src/lib/delivery/refresh.ts +212 -151
  91. package/src/lib/delivery/remote.ts +66 -0
  92. package/src/lib/delivery/repository-access.ts +19 -60
  93. package/src/lib/delivery/resolve-branch.ts +157 -110
  94. package/src/lib/delivery/stages.ts +83 -50
  95. package/src/lib/delivery/staging/apply-chain.ts +164 -0
  96. package/src/lib/delivery/staging/artifact-type.ts +101 -0
  97. package/src/lib/delivery/staging/declared-type.ts +277 -0
  98. package/src/lib/delivery/staging/naming.ts +64 -0
  99. package/src/lib/delivery/staging/openspec-type.ts +135 -0
  100. package/src/lib/delivery/staging/pending-edit.ts +291 -0
  101. package/src/lib/delivery/staging/pending.ts +780 -0
  102. package/src/lib/delivery/staging/project.ts +373 -0
  103. package/src/lib/delivery/staging/publish.ts +1024 -0
  104. package/src/lib/delivery/staging/refs.ts +258 -0
  105. package/src/lib/delivery/staging/registry.ts +73 -0
  106. package/src/lib/delivery/staging/replay.ts +308 -0
  107. package/src/lib/delivery/staging/requirement-blocks.ts +10 -0
  108. package/src/lib/delivery/staging/resolve.ts +264 -0
  109. package/src/lib/delivery/staging/settle-linked.ts +290 -0
  110. package/src/lib/delivery/staging/submit.ts +929 -0
  111. package/src/lib/delivery/staging/worktree.ts +130 -0
  112. package/src/lib/delivery/submit-change.ts +443 -0
  113. package/src/lib/git-key.ts +15 -0
  114. package/src/lib/install.ts +2 -0
  115. package/src/lib/openspec-canonical-frontmatter.ts +159 -0
  116. package/src/lib/orchestrator/adapters/base.ts +31 -20
  117. package/src/lib/orchestrator/adapters/claude.ts +16 -3
  118. package/src/lib/orchestrator/adapters/opencode.ts +2 -0
  119. package/src/lib/orchestrator/companion-git-sync.ts +152 -16
  120. package/src/lib/orchestrator/companion-hub.ts +6 -1
  121. package/src/lib/orchestrator/engine-floor.ts +48 -0
  122. package/src/lib/orchestrator/framework-context.ts +15 -1
  123. package/src/lib/orchestrator/launcher.ts +34 -1
  124. package/src/lib/orchestrator/projection-claude-commands.ts +2 -2
  125. package/src/lib/orchestrator/projection-claude-entry.ts +42 -21
  126. package/src/lib/orchestrator/projection-claude-links.ts +33 -8
  127. package/src/lib/orchestrator/projection-claude-skills.ts +2 -2
  128. package/src/lib/orchestrator/projection-entries.ts +22 -18
  129. package/src/lib/orchestrator/projection-opencode-copies.ts +65 -21
  130. package/src/lib/orchestrator/projection-runtime-documents.ts +66 -43
  131. package/src/lib/orchestrator/projection-types.ts +28 -1
  132. package/src/lib/orchestrator/refresh-working-claude-links.ts +4 -1
  133. package/src/lib/orchestrator/session-prepare.ts +17 -2
  134. package/src/lib/orchestrator/setup-compatibilities.ts +1 -1
  135. package/src/lib/orchestrator/types.ts +4 -0
  136. package/src/lib/orchestrator/umbrella-checkouts.ts +102 -0
  137. package/src/lib/orchestrator/working-repo-projection.ts +24 -4
  138. package/src/lib/orchestrator/wrap-pass.ts +1 -0
  139. package/src/lib/prebuilt-workspace-prepare.ts +2 -1
  140. package/src/lib/prebuilt-workspace.ts +1 -0
  141. package/src/lib/public-npm.ts +95 -50
  142. package/src/lib/session-state.ts +74 -3
  143. package/src/lib/update-checker.ts +7 -1
  144. package/src/lib/usage/aggregate.ts +202 -0
  145. package/src/lib/usage/cache.ts +87 -0
  146. package/src/lib/usage/claude-pricing.ts +71 -0
  147. package/src/lib/usage/claude.ts +189 -0
  148. package/src/lib/usage/collect.ts +56 -0
  149. package/src/lib/usage/opencode.ts +188 -0
  150. package/src/lib/usage/records.ts +80 -0
  151. package/src/lib/usage/rtk-database.ts +72 -0
  152. package/src/lib/usage/savings.ts +209 -0
  153. package/src/lib/usage/scope.ts +182 -0
  154. package/src/lib/usage/source.ts +102 -0
  155. package/src/lib/usage/types.ts +143 -0
  156. package/src/lib/usage/window.ts +37 -0
  157. package/src/lib/workflow/declaration.ts +6 -0
  158. package/src/lib/workflow/handoff.ts +90 -0
  159. package/src/lib/workflow/hook-trust.ts +108 -0
  160. package/src/lib/workflow/position.ts +524 -0
  161. package/src/lib/workflow/report.ts +79 -0
  162. package/src/lib/workflow/work.ts +106 -0
  163. package/src/lib/workset/factory-local.ts +157 -0
  164. package/src/lib/workset/record.ts +25 -11
  165. package/src/lib/workset/repositories.ts +118 -25
  166. package/src/lib/workset/stage.ts +4 -2
  167. package/src/lib/workset/stages.ts +64 -4
  168. package/src/lib/workset/worktree-include.ts +161 -0
  169. package/src/lib/workset/worktree-index.ts +6 -2
  170. package/src/lib/workset/worktree.ts +622 -114
  171. package/src/opencode/companion-hooks.ts +52 -13
  172. package/src/opencode/companion-policy.ts +18 -5
  173. package/src/opencode/enter-worktree.ts +254 -6
  174. package/src/opencode/projected-guidance.ts +5 -2
  175. package/src/opencode/session-register.ts +2 -2
  176. package/src/opencode/turn-hook.ts +241 -0
  177. package/src/playbooks/companion-guidance.ts +6 -3
  178. package/src/plugin-api.ts +42 -0
  179. package/src/runtime/artifact-trailers.ts +63 -0
  180. package/src/runtime/claude-bg-isolation.ts +138 -0
  181. package/src/runtime/claude-hook-group.ts +2 -0
  182. package/src/runtime/companion-git-state.ts +155 -10
  183. package/src/runtime/companion-git.ts +96 -13
  184. package/src/runtime/companion-guidance.ts +107 -8
  185. package/src/runtime/companion-instructions.ts +1 -1
  186. package/src/runtime/companion-sync.ts +109 -21
  187. package/src/runtime/current-branch.ts +16 -2
  188. package/src/runtime/entered-worktree.ts +24 -0
  189. package/src/runtime/env-names.ts +2 -2
  190. package/src/runtime/env.ts +7 -6
  191. package/src/runtime/forge-remote.ts +48 -0
  192. package/src/runtime/git-layout.ts +21 -7
  193. package/src/runtime/git-tracked.ts +60 -0
  194. package/src/runtime/json-fields.ts +8 -0
  195. package/src/runtime/pending-records.ts +533 -0
  196. package/src/runtime/projected-guidance.ts +6 -2
  197. package/src/runtime/publication-secret-scan.ts +45 -0
  198. package/src/runtime/repo-destination.ts +72 -0
  199. package/src/runtime/repo-local.ts +25 -3
  200. package/src/runtime/rtk-git-guard.ts +66 -0
  201. package/src/runtime/runtime-document-manifest.ts +229 -19
  202. package/src/runtime/runtime-document-manifest.typecheck.ts +10 -0
  203. package/src/runtime/secret-guard.ts +9 -2
  204. package/src/runtime/secret-patterns.ts +3 -2
  205. package/src/runtime/secret-policy-weakening.ts +122 -0
  206. package/src/runtime/serving-claude-wrap.ts +15 -2
  207. package/src/runtime/skill-prefix.ts +75 -0
  208. package/src/runtime/submitted-arrivals.ts +547 -0
  209. package/src/runtime/turn-state.d.mts +14 -0
  210. package/src/runtime/turn-state.mjs +93 -0
  211. package/src/runtime/umbrella-children.ts +52 -0
  212. package/src/runtime/umbrella-folder.ts +84 -0
  213. package/src/runtime/workflow/change-folders.ts +66 -0
  214. package/src/runtime/workflow/declaration.ts +720 -0
  215. package/src/runtime/workflow/globs.ts +85 -0
  216. package/src/runtime/workflow/next-handoff-process.ts +98 -0
  217. package/src/runtime/workflow/turn.ts +309 -0
  218. package/src/runtime/workflow/workflow.ts +262 -0
  219. package/src/runtime/wrap-state.ts +5 -13
  220. package/src/studio.ts +71 -19
  221. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/schema.yaml +3 -3
  222. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/design.md +1 -1
  223. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/proposal.md +1 -1
  224. package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/tasks.md +1 -1
  225. package/src/templates/capabilities/openspec-cap/mate-minimal/schema.yaml +3 -3
  226. package/src/templates/mate-skills/agents/mate-apply-change/SKILL.md +103 -30
  227. package/src/templates/mate-skills/agents/mate-apply-change/references/openspec-apply-change.md +1 -1
  228. package/src/templates/mate-skills/agents/mate-archive-change/SKILL.md +7 -70
  229. package/src/templates/mate-skills/agents/mate-clarify-intent/SKILL.md +13 -7
  230. package/src/templates/mate-skills/agents/mate-domain-modeling/SKILL.md +10 -0
  231. package/src/templates/mate-skills/agents/mate-explore-change/SKILL.md +46 -14
  232. package/src/templates/mate-skills/agents/mate-propose-change/SKILL.md +50 -31
  233. package/src/templates/mate-skills/agents/mate-propose-change/references/mate-revise.md +13 -7
  234. package/src/templates/mate-skills/agents/mate-propose-change/references/openspec-update-change.md +1 -1
  235. package/src/templates/mate-skills/agents/mate-publish-artifact/SKILL.md +114 -86
  236. package/src/templates/mate-skills/agents/mate-publish-artifact/references/openspec.md +111 -100
  237. package/src/templates/mate-skills/agents/mate-show-me/SKILL.md +11 -5
  238. package/src/templates/mate-skills/agents/mate-simplify-code/SKILL.md +16 -6
  239. package/src/templates/mate-skills/agents/mate-submit-change/SKILL.md +114 -0
  240. package/src/templates/mate-skills/claude/mate-apply-change/SKILL.md +103 -30
  241. package/src/templates/mate-skills/claude/mate-apply-change/references/openspec-apply-change.md +1 -1
  242. package/src/templates/mate-skills/claude/mate-archive-change/SKILL.md +7 -70
  243. package/src/templates/mate-skills/claude/mate-clarify-intent/SKILL.md +13 -7
  244. package/src/templates/mate-skills/claude/mate-domain-modeling/SKILL.md +10 -0
  245. package/src/templates/mate-skills/claude/mate-explore-change/SKILL.md +46 -14
  246. package/src/templates/mate-skills/claude/mate-propose-change/SKILL.md +50 -31
  247. package/src/templates/mate-skills/claude/mate-propose-change/references/mate-revise.md +13 -7
  248. package/src/templates/mate-skills/claude/mate-propose-change/references/openspec-update-change.md +1 -1
  249. package/src/templates/mate-skills/claude/mate-publish-artifact/SKILL.md +114 -86
  250. package/src/templates/mate-skills/claude/mate-publish-artifact/references/openspec.md +111 -100
  251. package/src/templates/mate-skills/claude/mate-show-me/SKILL.md +11 -5
  252. package/src/templates/mate-skills/claude/mate-simplify-code/SKILL.md +16 -6
  253. package/src/templates/mate-skills/claude/mate-submit-change/SKILL.md +114 -0
  254. package/src/templates/mate-skills/openspec-references.ts +3 -2
  255. package/src/tools/setup/__snapshots__/runtime-surface-golden.test.ts.snap +912 -139
  256. package/src/tools/setup/capabilities/openspec.ts +54 -15
  257. package/src/tools/setup/capabilities/rtk.ts +98 -5
  258. package/src/tools/setup/capabilities/tokensave.ts +3 -2
  259. package/src/tools/setup/dynamic-plugins/api.ts +38 -0
  260. package/src/tools/setup/dynamic-plugins/audiences.ts +65 -21
  261. package/src/tools/setup/dynamic-plugins/frozen.ts +32 -13
  262. package/src/tools/setup/dynamic-plugins/host.ts +2 -32
  263. package/src/tools/setup/dynamic-plugins/hydrate.ts +4 -4
  264. package/src/tools/setup/dynamic-plugins/install.ts +24 -22
  265. package/src/tools/setup/dynamic-plugins/loader.ts +11 -7
  266. package/src/tools/setup/dynamic-plugins/paths.ts +30 -10
  267. package/src/tools/setup/dynamic-plugins/verify.ts +10 -7
  268. package/src/tools/setup/dynamic-plugins/workspaces.ts +153 -0
  269. package/src/tools/setup/engine.ts +20 -1
  270. package/src/tools/setup/mate.ts +5 -3
  271. package/src/tools/setup/package-managers/bun.ts +8 -8
  272. package/src/tools/setup/plugin.ts +9 -1
  273. package/src/tools/setup/plugins/gitignore.ts +15 -9
  274. package/src/tools/setup/plugins/guidance.ts +4 -2
  275. package/src/tools/setup/providers/claude-plugin-hooks.ts +30 -0
  276. package/src/tools/setup/providers/claude.ts +43 -6
  277. package/src/tools/setup/service-registry.ts +69 -0
  278. package/src/tools/setup/service.ts +233 -0
  279. package/src/tools/setup/utils.ts +28 -5
  280. package/src/tools/setup/working-repo-cleanup.ts +2 -2
  281. package/src/tools/setup/working-repo-local-state.ts +2 -0
  282. package/src/tools/setup.ts +25 -14
  283. package/studio-dist/client/assets/app-BFVyWHGo.css +2 -0
  284. package/studio-dist/client/assets/button-D6LrRkOG.js +1 -0
  285. package/studio-dist/client/assets/combobox-Dk2MMZWE.js +1 -0
  286. package/studio-dist/client/assets/companion-view-BVaZNtiI.js +1 -0
  287. package/studio-dist/client/assets/fields-D_FYhxQr.js +1 -0
  288. package/studio-dist/client/assets/getting-started-ByWRg7hC.js +1 -0
  289. package/studio-dist/client/assets/getting-started-DZSjYC-b.js +1 -0
  290. package/studio-dist/client/assets/getting-started._topic-C6OyQ4G6.js +1 -0
  291. package/studio-dist/client/assets/getting-started.index-BkmPHdEm.js +1 -0
  292. package/studio-dist/client/assets/graph-7jm2XzyL.js +2 -0
  293. package/studio-dist/client/assets/graph-canvas-DDuzsNSx.js +3242 -0
  294. package/studio-dist/client/assets/guides-D9VTjWXP.js +1 -0
  295. package/studio-dist/client/assets/index-BBmFpG4y.js +40 -0
  296. package/studio-dist/client/assets/jsx-runtime-MZURdZre.js +1 -0
  297. package/studio-dist/client/assets/markdown-view-RL5YvfZg.js +1 -0
  298. package/studio-dist/client/assets/panel-B8F8sOKQ.js +1 -0
  299. package/studio-dist/client/assets/plugins._service._view-CynxTbMx.js +1 -0
  300. package/studio-dist/client/assets/queries-axYk2u9L.js +1 -0
  301. package/studio-dist/client/assets/react-r45OnJCw.js +27 -0
  302. package/studio-dist/client/assets/reports-BCAyXh6p.js +1 -0
  303. package/studio-dist/client/assets/routes-BFPqq89E.js +1 -0
  304. package/studio-dist/client/assets/skills-DTks_uBx.js +1 -0
  305. package/studio-dist/client/assets/specs-DU1kqcp5.js +1 -0
  306. package/studio-dist/client/assets/specs-view-omrd_5P3.js +1 -0
  307. package/studio-dist/client/assets/steps-DhIFuAZy.js +1 -0
  308. package/studio-dist/client/assets/store-DJ5cncKA.js +1 -0
  309. package/studio-dist/client/assets/studio-BR9j15J0.js +100 -0
  310. package/studio-dist/client/assets/studio-queries-CFP_yTpr.js +2 -0
  311. package/studio-dist/client/assets/usage-CHmwtkoM.js +55 -0
  312. package/studio-dist/client/assets/useBaseQuery-BlC-AZ35.js +1 -0
  313. package/studio-dist/client/assets/useSelector-AYcH7lB0.js +2 -0
  314. package/studio-dist/client/assets/vault-DRg8MScm.js +1 -0
  315. package/studio-dist/client/assets/warnings-UHFy6HAp.js +1 -0
  316. package/studio-dist/client/assets/workflow-Bv9vSfVV.js +1 -0
  317. package/studio-dist/server/assets/__23tanstack-start-server-fn-resolver-DAbZ6fzY.js +106 -0
  318. package/studio-dist/server/assets/_tanstack-start-manifest_v.js +84 -39
  319. package/studio-dist/server/assets/{button-CIJqAhni.js → button-BfoNadNR.js} +14 -3750
  320. package/studio-dist/server/assets/combobox-oxUI6r4V.js +2089 -0
  321. package/studio-dist/server/assets/{companion-view-DISASvdJ.js → companion-view-DHUjPpA0.js} +3 -3
  322. package/studio-dist/server/assets/companions-kBrJZAd6.js +31 -0
  323. package/studio-dist/server/assets/{createServerRpc-tK2lE9R2.js → createServerRpc-bFKFpGFG.js} +1 -1
  324. package/studio-dist/server/assets/fields-BD_c65T1.js +1190 -0
  325. package/studio-dist/server/assets/getting-started-7P0oyWaM.js +67 -0
  326. package/studio-dist/server/assets/getting-started-B136TP57.js +4 -0
  327. package/studio-dist/server/assets/getting-started._topic-B1mV0kGz.js +13 -0
  328. package/studio-dist/server/assets/getting-started.index-CeGtvUsm.js +13 -0
  329. package/studio-dist/server/assets/graph-BWtmJOH2.js +16 -0
  330. package/studio-dist/server/assets/graph-DSDVEELZ.js +801 -0
  331. package/studio-dist/server/assets/graph-canvas-CID9Nksc.js +21066 -0
  332. package/studio-dist/server/assets/graph-wire-BdSUx0G5.js +58 -0
  333. package/studio-dist/server/assets/guides-BLJenHwQ.js +5 -0
  334. package/studio-dist/server/assets/guides-Bm3RbUB-.js +13 -0
  335. package/studio-dist/server/assets/guides.server-rHHqRuzV.js +66 -0
  336. package/studio-dist/server/assets/jsx-runtime-Bt0s0YKS.js +451 -0
  337. package/studio-dist/server/assets/{markdown-view-Bn7xPdks.js → markdown-view-D3v9x-cM.js} +28 -9
  338. package/studio-dist/server/assets/{panel-3Jmn4awF.js → panel-yqOl5GMU.js} +5 -5
  339. package/studio-dist/server/assets/plugins._service._view-DwqJX7s9.js +92 -0
  340. package/studio-dist/server/assets/queries-DYmGrhNO.js +32 -0
  341. package/studio-dist/server/assets/react-BO0uMhpm.js +89 -0
  342. package/studio-dist/server/assets/redirect-BaZ_QyqF.js +39 -0
  343. package/studio-dist/server/assets/{reports-D6YMqhnO.js → reports-7yaPz7aP.js} +15 -10
  344. package/studio-dist/server/assets/{reports-C06RXVE2.js → reports-C4Y_Jd-x.js} +3 -3
  345. package/studio-dist/server/assets/{router-C8MGqlAY.js → router-Dnoq5auE.js} +810 -1679
  346. package/studio-dist/server/assets/{routes-BcFgvqf7.js → routes-Cok4p3mK.js} +222 -76
  347. package/studio-dist/server/assets/{search-JAKurDNh.js → search-DUK7Jl6f.js} +21 -2
  348. package/studio-dist/server/assets/{shell-DS3wUexh.js → shell-DNVXedgE.js} +15 -6
  349. package/studio-dist/server/assets/{skills-BEnOxiDl.js → skills-D8qdXSku.js} +9 -8
  350. package/studio-dist/server/assets/{skills-CtrBAtX3.js → skills-pKmuAs0F.js} +3 -3
  351. package/studio-dist/server/assets/specs-DeHYUNFp.js +51 -0
  352. package/studio-dist/server/assets/specs-view-BGn-5Ik_.js +425 -0
  353. package/studio-dist/server/assets/{steps-Dq_CwY_s.js → steps-CV7Yk7L7.js} +88 -45
  354. package/studio-dist/server/assets/store-CWDGIp6x.js +280 -0
  355. package/studio-dist/server/assets/studio-CB94np48.js +10437 -0
  356. package/studio-dist/server/assets/studio-queries-BqZGBE70.js +1335 -0
  357. package/studio-dist/server/assets/usage-M6Gi6Km7.js +25584 -0
  358. package/studio-dist/server/assets/usage-j5jR9gX9.js +24 -0
  359. package/studio-dist/server/assets/useBaseQuery-Tv_QJt9r.js +2051 -0
  360. package/studio-dist/server/assets/{__23tanstack-start-server-fn-resolver-M2GBs8s3.js → useSelector-DUmCUXAs.js} +4 -668
  361. package/studio-dist/server/assets/{vault-Fvxt2Tzl.js → vault-PqVmssmW.js} +10 -7
  362. package/studio-dist/server/assets/{vault-BmWnryh3.js → vault-lBlvSyD4.js} +3 -3
  363. package/studio-dist/server/assets/{views-BgYa-za2.js → views-CsFp1i1G.js} +9 -6
  364. package/studio-dist/server/assets/{warnings-DzR6fyZh.js → warnings-BDs34j_m.js} +3 -2
  365. package/studio-dist/server/assets/{delivery-path-C29fBynY.js → workflow-T0eEldsa.js} +153 -120
  366. package/studio-dist/server/server.js +582 -8
  367. package/src/cli/commands/factory/factory.ts +0 -301
  368. package/src/cli/commands/report/collector.ts +0 -288
  369. package/src/cli/commands/studio/factory-credential.ts +0 -49
  370. package/src/cli/commands/studio/workset-session.ts +0 -131
  371. package/src/lib/delivery/archive-change.ts +0 -165
  372. package/src/lib/delivery/forge.ts +0 -279
  373. package/src/lib/delivery/token.ts +0 -24
  374. package/src/lib/factory/attach-client.ts +0 -113
  375. package/src/lib/factory/attach.ts +0 -178
  376. package/src/lib/factory/broker.ts +0 -190
  377. package/src/lib/factory/bun-commands.ts +0 -39
  378. package/src/lib/factory/client.ts +0 -92
  379. package/src/lib/factory/command.ts +0 -61
  380. package/src/lib/factory/credential-store.ts +0 -153
  381. package/src/lib/factory/frames.ts +0 -77
  382. package/src/lib/factory/ids.ts +0 -58
  383. package/src/lib/factory/outcomes/actions.ts +0 -114
  384. package/src/lib/factory/outcomes/index.ts +0 -391
  385. package/src/lib/factory/outcomes/lifecycle.ts +0 -205
  386. package/src/lib/factory/outcomes/runs.ts +0 -81
  387. package/src/lib/factory/prepare.ts +0 -49
  388. package/src/lib/factory/pty.ts +0 -103
  389. package/src/lib/factory/runner/companion-context.ts +0 -178
  390. package/src/lib/factory/runner/control.ts +0 -92
  391. package/src/lib/factory/runner/harness-agent.ts +0 -250
  392. package/src/lib/factory/runner/live.ts +0 -159
  393. package/src/lib/factory/runner/questions.ts +0 -22
  394. package/src/lib/factory/runner/rank.ts +0 -26
  395. package/src/lib/factory/runner/run-policy.ts +0 -12
  396. package/src/lib/factory/runner/run.ts +0 -199
  397. package/src/lib/factory/runner/scheduler.ts +0 -416
  398. package/src/lib/factory/runner/state.ts +0 -233
  399. package/src/lib/factory/runner/workflow.ts +0 -542
  400. package/src/lib/factory/runtime.ts +0 -981
  401. package/src/lib/factory/sandbox.ts +0 -292
  402. package/src/lib/factory/worktree-branch.ts +0 -17
  403. package/src/templates/capabilities/openspec-cap/mate-v1/templates/explore-brief.md +0 -25
  404. package/studio-dist/client/assets/app-CdPiFv59.css +0 -2
  405. package/studio-dist/client/assets/button-BIIHE0EQ.js +0 -3
  406. package/studio-dist/client/assets/companion-view-DM6YyXaR.js +0 -1
  407. package/studio-dist/client/assets/delivery-path-DELxj0Av.js +0 -1
  408. package/studio-dist/client/assets/factory-BZy0E8ty.js +0 -4
  409. package/studio-dist/client/assets/index-B3wkMzjA.js +0 -40
  410. package/studio-dist/client/assets/markdown-view-pQ2Qp_i5.js +0 -1
  411. package/studio-dist/client/assets/panel-CbajlC3p.js +0 -1
  412. package/studio-dist/client/assets/prepaint-CwSrpdFA.js +0 -27
  413. package/studio-dist/client/assets/react-CN2GSx7x.js +0 -1
  414. package/studio-dist/client/assets/reports-DllhYQ5_.js +0 -1
  415. package/studio-dist/client/assets/rolldown-runtime-WkwZ5CU-.js +0 -1
  416. package/studio-dist/client/assets/routes-COm-G3mK.js +0 -1
  417. package/studio-dist/client/assets/skills-DmWAy-jZ.js +0 -1
  418. package/studio-dist/client/assets/specs-BG3Wi3ln.js +0 -1
  419. package/studio-dist/client/assets/steps-DFsH3Neu.js +0 -1
  420. package/studio-dist/client/assets/vault-B2q1nBY5.js +0 -1
  421. package/studio-dist/client/assets/warnings-BSXIyuSQ.js +0 -1
  422. package/studio-dist/client/assets/workflow-DlsQD6Hc.js +0 -1
  423. package/studio-dist/server/assets/actions-Bvgj9eb8.js +0 -54
  424. package/studio-dist/server/assets/companions-BYbHWKOZ.js +0 -15
  425. package/studio-dist/server/assets/createServerFn-F5sAOF8V.js +0 -459
  426. package/studio-dist/server/assets/factory-DGPmNGbo.js +0 -69
  427. package/studio-dist/server/assets/factory-DUTa0eDs.js +0 -2172
  428. package/studio-dist/server/assets/prepaint-DJfTQ_VH.js +0 -45
  429. package/studio-dist/server/assets/react-Ce6dj15C.js +0 -46
  430. package/studio-dist/server/assets/rolldown-runtime-DYf_mQCB.js +0 -34
  431. package/studio-dist/server/assets/specs-C8rv34-5.js +0 -211
  432. package/studio-dist/server/assets/studio-BeltxxKt.js +0 -216
  433. package/studio-dist/server/assets/workflow-liRYecHk.js +0 -73
  434. /package/src/lib/{factory/keyed-serial.ts → keyed-serial.ts} +0 -0
  435. /package/src/templates/capabilities/openspec-cap/{mate-v1 → mate-full}/templates/spec.md +0 -0
@@ -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 { $ as CommandLine, Ar as cn, Bi as Link, Gr as vaultChildrenQuery, Q as Age, Vi as useNavigate, at as Pills, ct as StatusWord, et as Count, fi as useQuery, nt as ListCard, ot as Progress, qr as vaultQuery, r as Icon, rt as PAGE_PAD, st as ROW, t as Button, tt as EmptyNote } from "./button-CIJqAhni.js";
4
- import { j as require_react, u as require_jsx_runtime } from "./__23tanstack-start-server-fn-resolver-M2GBs8s3.js";
5
- import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-3Jmn4awF.js";
6
- import { t as Warnings } from "./warnings-DzR6fyZh.js";
7
- import { t as MarkdownView } from "./markdown-view-Bn7xPdks.js";
8
- import { C as CHANGE_GROUPS, D as groupChanges, E as changeStep, T as changeGroup, c as Route, w as GROUP_TITLES } from "./router-C8MGqlAY.js";
1
+ import { t as CompanionView } from "./companion-view-DHUjPpA0.js";
2
+ import { J as Link, Y as useNavigate, f as vaultChildrenQuery, m as vaultQuery } from "./studio-queries-BqZGBE70.js";
3
+ import { n as require_react, o as __toESM, t as require_jsx_runtime } from "./jsx-runtime-Bt0s0YKS.js";
4
+ import { Dr as useQuery, Tr as cn, r as Icon, t as Button } from "./button-BfoNadNR.js";
5
+ import { a as Count, c as PAGE_PAD, d as Progress, f as ROW, i as CommandLine, o as EmptyNote, p as StatusWord, r as Age, s as ListCard, u as Pills } from "./store-CWDGIp6x.js";
6
+ import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-yqOl5GMU.js";
7
+ import { t as Warnings } from "./warnings-BDs34j_m.js";
8
+ import { t as MarkdownView } from "./markdown-view-D3v9x-cM.js";
9
+ import { C as groupChanges, S as changeStep, _ as GROUP_TITLES, b as changePath, f as Route, g as CHANGE_GROUPS, v as activeChanges, x as changeProgress, y as changeGroup } from "./router-Dnoq5auE.js";
9
10
  // src/views/overview/changed-specs.ts
10
11
  var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
11
12
  /** Each capability once, at the newest shipped change that touched it. */
@@ -215,6 +216,73 @@ function ChangedSpecs({ shipped }) {
215
216
  })
216
217
  });
217
218
  }
219
+ // src/components/path-steps.tsx
220
+ var BAR = {
221
+ accent: "before:bg-accent",
222
+ warn: "before:bg-warn",
223
+ why: "before:bg-why",
224
+ bad: "before:bg-bad"
225
+ };
226
+ var BAR_FILL = {
227
+ accent: "bg-accent",
228
+ warn: "bg-warn",
229
+ why: "bg-why",
230
+ bad: "bg-bad"
231
+ };
232
+ var LABEL = {
233
+ accent: "text-text",
234
+ warn: "text-warn",
235
+ why: "text-why",
236
+ bad: "text-bad"
237
+ };
238
+ /** `current` before the first step reads "Saved for later"; past the last, "Delivered". */
239
+ function CompactPath({ steps, current, tone }) {
240
+ let label = `Step ${current + 1} of ${steps.length} · ${steps[current]}`;
241
+ if (current < 0) label = "Saved for later";
242
+ else if (current >= steps.length) label = "Delivered";
243
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
244
+ className: "grid gap-2",
245
+ role: "group",
246
+ "aria-label": "Delivery Path",
247
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
248
+ className: cn("m-0 text-xs font-semibold", current >= 0 ? LABEL[tone] : "text-muted"),
249
+ children: label
250
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
251
+ className: "m-0 grid list-none gap-1 p-0",
252
+ style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` },
253
+ children: steps.map((name, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
254
+ "aria-current": index === current ? "step" : void 0,
255
+ className: cn("h-1 rounded-full bg-rule", index < current && "bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]", index === current && BAR_FILL[tone]),
256
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
257
+ className: "sr-only",
258
+ children: name
259
+ })
260
+ }, name))
261
+ })]
262
+ });
263
+ }
264
+ /**
265
+ * Where something is on the Delivery Path, as one bar per step. Steps before `current` are
266
+ * done, `current` is marked and takes `tone`; `current` outside the list marks none, and a
267
+ * value past the end marks every step done.
268
+ */
269
+ function PathSteps({ steps, current, tone = "accent", compact = false }) {
270
+ if (compact) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactPath, {
271
+ steps,
272
+ current,
273
+ tone
274
+ });
275
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
276
+ className: "m-0 grid list-none gap-1 p-0",
277
+ style: { gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))` },
278
+ "aria-label": "Delivery Path",
279
+ children: steps.map((name, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
280
+ "aria-current": index === current ? "step" : void 0,
281
+ className: cn("grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']", index < current && "before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]", index === current && "font-semibold text-text", index === current && BAR[tone]),
282
+ children: name
283
+ }, name))
284
+ });
285
+ }
218
286
  // src/views/overview/artifacts.tsx
219
287
  var CHANGES_DIR = "openspec/changes";
220
288
  var changeDir = (change) => `${CHANGES_DIR}/${change.name}`;
@@ -265,6 +333,12 @@ function SpecFiles({ companion, dir, onRead }) {
265
333
  }) }, entry.path))
266
334
  });
267
335
  }
336
+ /** What an artifact's row says it offers. */
337
+ function artifactNote(artifact) {
338
+ if (artifact.declared) return artifact.folder ? "folder" : "read";
339
+ if (!artifact.done) return "not yet";
340
+ return artifact.folder ? "per capability" : "read";
341
+ }
268
342
  /** The artifacts the Delivery Path writes, in its order; a written one opens to read. */
269
343
  function Artifacts({ change, companion, onRead }) {
270
344
  if (change.artifacts.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
@@ -275,31 +349,36 @@ function Artifacts({ change, companion, onRead }) {
275
349
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
276
350
  className: "m-0 -mx-2 grid list-none gap-0.5 p-0",
277
351
  children: change.artifacts.map((artifact) => {
352
+ const declared = artifact.path !== void 0;
278
353
  const done = artifact.status === "done";
279
- const readable = done && companion !== void 0;
280
- const folder = artifact.id === "specs";
354
+ const readable = (done || declared) && companion !== void 0;
355
+ const folder = artifact.path === void 0 ? artifact.id === "specs" : artifact.path.endsWith("/");
281
356
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
282
357
  type: "button",
283
358
  className: ITEM,
284
359
  disabled: !readable || folder,
285
360
  "data-artifact": artifact.id,
286
- onClick: () => onRead(`${dir}/${artifact.id}.md`),
361
+ onClick: () => onRead(artifact.path ?? `${dir}/${artifact.id}.md`),
287
362
  children: [
288
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { done }),
363
+ declared ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Check, { done }),
289
364
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
290
- className: done ? "text-text" : "text-muted",
365
+ className: done || declared ? "text-text" : "text-muted",
291
366
  children: artifact.id
292
367
  }),
293
368
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
294
369
  className: "ml-auto text-xs text-muted",
295
- children: !done ? "not yet" : folder ? "per capability" : "read"
370
+ children: artifactNote({
371
+ declared,
372
+ done,
373
+ folder
374
+ })
296
375
  }),
297
376
  readable && !folder ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Icon, {
298
377
  name: "right",
299
378
  className: "text-muted"
300
379
  }) : null
301
380
  ]
302
- }), readable && folder ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecFiles, {
381
+ }), readable && folder && !declared ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SpecFiles, {
303
382
  companion,
304
383
  dir,
305
384
  onRead
@@ -307,10 +386,20 @@ function Artifacts({ change, companion, onRead }) {
307
386
  })
308
387
  });
309
388
  }
310
- /** One artifact read in the panel, so a review needs no trip to the Vault. */
311
- function ArtifactReader({ companion, path, change, onBack }) {
389
+ /** A companion markdown file, rendered; says so while it loads or cannot be read. */
390
+ function ArtifactBody({ companion, path }) {
312
391
  const file = useQuery(vaultQuery(companion, { path }));
313
392
  const markdown = file.data?.open?.markdown;
393
+ return markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
394
+ className: "prose-panel",
395
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownView, { nodes: markdown })
396
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
397
+ className: "m-0 text-sm text-muted",
398
+ children: file.isPending ? "Loading…" : "The file could not be read."
399
+ });
400
+ }
401
+ /** One artifact read in the panel, so a review needs no trip to the Vault. */
402
+ function ArtifactReader({ companion, path, change, onBack }) {
314
403
  const name = path.slice(changeDir(change).length + 1);
315
404
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", {
316
405
  className: "grid content-start gap-3 px-5 py-4",
@@ -342,19 +431,18 @@ function ArtifactReader({ companion, path, change, onBack }) {
342
431
  }), " Open in Vault"]
343
432
  })
344
433
  ]
345
- }), markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
346
- className: "prose-panel",
347
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MarkdownView, { nodes: markdown })
348
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
349
- className: "m-0 text-sm text-muted",
350
- children: file.isPending ? "Loading…" : "The file could not be read."
434
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ArtifactBody, {
435
+ companion,
436
+ path
351
437
  })]
352
438
  });
353
439
  }
354
440
  // src/views/overview/changes.tsx
441
+ var SUBMITTED_TITLE = "Awaiting publication";
442
+ var NONE_SUBMITTED = [];
355
443
  var GROUP_HINTS = {
356
444
  "needs-you": "Review or fix before the build goes on",
357
- building: "An agent is working through the tasks",
445
+ building: "Some tasks are done; others remain",
358
446
  ready: "Every task is done"
359
447
  };
360
448
  /** A change's status word and marker shape. */
@@ -364,6 +452,21 @@ function status(change) {
364
452
  word: "Invalid"
365
453
  };
366
454
  const group = changeGroup(change);
455
+ if (change.planned === false) {
456
+ const stage = change.position?.stage;
457
+ if (!stage) return {
458
+ marker: "idle",
459
+ word: change.dropped ? "Dropped" : "Not placed"
460
+ };
461
+ if (group === "ready") return {
462
+ marker: "done",
463
+ word: stage.label
464
+ };
465
+ return {
466
+ marker: stage.kind === "review" ? "review" : "build",
467
+ word: stage.label
468
+ };
469
+ }
367
470
  if (group === "needs-you") return (change.totalTasks ?? 0) === 0 ? {
368
471
  marker: "warn",
369
472
  word: "No tasks"
@@ -373,34 +476,17 @@ function status(change) {
373
476
  };
374
477
  if (group === "building") return {
375
478
  marker: "build",
376
- word: "Building"
479
+ word: GROUP_TITLES.building
377
480
  };
378
481
  return {
379
482
  marker: "done",
380
483
  word: "Ready"
381
484
  };
382
485
  }
383
- var PATH_STAGES = [
384
- "Propose change",
385
- "Human review",
386
- "Apply change",
387
- "Archive change"
388
- ];
389
- /** Where the change is on the Delivery Path, as four steps. */
390
- function PathSteps({ stage }) {
391
- const at = PATH_STAGES.indexOf(stage);
392
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ol", {
393
- className: "m-0 grid list-none grid-cols-4 gap-1 p-0",
394
- "aria-label": "Delivery Path",
395
- children: PATH_STAGES.map((name, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", {
396
- "aria-current": index === at ? "step" : void 0,
397
- className: cn("grid gap-1.5 text-2xs text-muted before:h-1 before:rounded-full before:bg-rule before:content-['']", index < at && "before:bg-[color-mix(in_srgb,var(--accent)_55%,var(--border))]", index === at && "font-semibold text-text before:bg-accent", index === at && name === "Human review" && "before:bg-why"),
398
- children: name
399
- }, name))
400
- });
401
- }
402
- function ChangeDetail({ change, companion, reading, onRead }) {
403
- const step = changeStep(change);
486
+ function ChangeDetail({ change, workflow, companion, reading, onRead }) {
487
+ const step = changeStep(change, workflow);
488
+ const path = changePath(workflow);
489
+ const progress = changeProgress(change);
404
490
  const { marker, word } = status(change);
405
491
  const artifacts = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
406
492
  title: "Artifacts",
@@ -436,7 +522,11 @@ function ChangeDetail({ change, companion, reading, onRead }) {
436
522
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
437
523
  title: "Delivery Path",
438
524
  aside: step.stage,
439
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathSteps, { stage: step.stage })
525
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PathSteps, {
526
+ steps: path.map((stage) => stage.label),
527
+ current: path.findIndex((stage) => stage.id === step.stageId),
528
+ tone: step.review ? "why" : "accent"
529
+ })
440
530
  }),
441
531
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(PanelSection, {
442
532
  title: "Next step",
@@ -445,23 +535,20 @@ function ChangeDetail({ change, companion, reading, onRead }) {
445
535
  children: [step.next, "."]
446
536
  }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CommandLine, { text: step.prompt })]
447
537
  }),
448
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
449
- title: "Tasks",
450
- aside: `${change.completedTasks ?? 0}/${change.totalTasks ?? 0}`,
451
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Progress, {
452
- done: change.completedTasks ?? 0,
453
- total: change.totalTasks ?? 0
454
- })
538
+ change.planned === false ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PanelSection, {
539
+ title: progress.unit === "tasks" ? "Tasks" : "Plan",
540
+ aside: `${progress.done}/${progress.total}`,
541
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Progress, { ...progress })
455
542
  }),
456
543
  review ? null : artifacts
457
544
  ] })] });
458
545
  }
459
- function ChangeRow({ change, current, onOpen }) {
546
+ function ChangeRow({ change, workflow, current, onOpen }) {
460
547
  const { marker, word } = status(change);
461
- const step = changeStep(change);
548
+ const step = changeStep(change, workflow);
462
549
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("button", {
463
550
  type: "button",
464
- className: cn(ROW, "grid grid-cols-[minmax(0,1fr)_120px_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]"),
551
+ className: cn(ROW, "grid grid-cols-[minmax(0,1fr)_max-content_150px_72px] @max-[640px]:grid-cols-[minmax(0,1fr)_auto]"),
465
552
  "aria-current": current ? "true" : void 0,
466
553
  "data-change": change.name,
467
554
  onClick: onOpen,
@@ -482,10 +569,7 @@ function ChangeRow({ change, current, onOpen }) {
482
569
  }),
483
570
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
484
571
  className: "@max-[640px]:hidden",
485
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Progress, {
486
- done: change.completedTasks ?? 0,
487
- total: change.totalTasks ?? 0
488
- })
572
+ children: change.planned === false ? null : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Progress, { ...changeProgress(change) })
489
573
  }),
490
574
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Age, {
491
575
  at: change.lastModified,
@@ -494,12 +578,76 @@ function ChangeRow({ change, current, onOpen }) {
494
578
  ]
495
579
  }) });
496
580
  }
497
- /** Active changes in up to three groups by what they need; detail opens in the panel. */
498
- function Changes({ changes, selected, companion }) {
581
+ /** A submitted change: whose it is, its delivery and whether its group is blocked. */
582
+ function SubmittedRow({ change }) {
583
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", {
584
+ className: cn(ROW, "grid grid-cols-[minmax(0,1fr)_max-content] hover:bg-transparent"),
585
+ "data-submitted": change.name,
586
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
587
+ className: "grid min-w-0 gap-0.5",
588
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
589
+ className: "truncate font-mono text-sm",
590
+ children: change.name
591
+ }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
592
+ className: "truncate text-xs text-muted",
593
+ children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
594
+ className: change.mine ? "font-semibold text-accent" : void 0,
595
+ children: change.mine ? "Yours" : change.author ?? "Someone else"
596
+ }), ` · ${change.group || "no delivery branch"}`]
597
+ })]
598
+ }), change.blocked ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusWord, {
599
+ marker: "issue",
600
+ children: "Blocked"
601
+ }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StatusWord, {
602
+ marker: "idle",
603
+ children: "Submitted"
604
+ })]
605
+ });
606
+ }
607
+ /** Submitted changes awaiting publication; nothing when there are none. */
608
+ function SubmittedCard({ submitted }) {
609
+ if (submitted.length === 0) return null;
610
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListCard, {
611
+ title: SUBMITTED_TITLE,
612
+ count: submitted.length,
613
+ hint: "Publish with /mate-publish-artifact once merged",
614
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", {
615
+ className: "m-0 list-none p-0",
616
+ children: submitted.map((change) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubmittedRow, { change }, change.name))
617
+ })
618
+ });
619
+ }
620
+ /** The filter pills: all, each active group, and the submitted card when it has any. */
621
+ function filterOptions(groups, submittedCount) {
622
+ return [
623
+ {
624
+ value: "all",
625
+ label: "All",
626
+ count: CHANGE_GROUPS.reduce((sum, group) => sum + groups[group].length, 0) + submittedCount
627
+ },
628
+ ...CHANGE_GROUPS.map((group) => ({
629
+ value: group,
630
+ label: GROUP_TITLES[group],
631
+ count: groups[group].length,
632
+ tone: group === "needs-you" ? "warn" : void 0
633
+ })),
634
+ ...submittedCount > 0 ? [{
635
+ value: "submitted",
636
+ label: SUBMITTED_TITLE,
637
+ count: submittedCount
638
+ }] : []
639
+ ];
640
+ }
641
+ /**
642
+ * Active changes in up to three groups by what they need, then submitted changes awaiting
643
+ * publication; an active change's detail opens in the panel.
644
+ */
645
+ function Changes({ changes: all, submitted = NONE_SUBMITTED, selected, companion, workflow }) {
499
646
  const navigate = useNavigate();
500
647
  const [filter, setFilter] = (0, import_react.useState)("all");
501
648
  const [pass, setPass] = (0, import_react.useState)(false);
502
649
  const [reading, setReading] = (0, import_react.useState)(null);
650
+ const changes = activeChanges(all, submitted);
503
651
  const groups = groupChanges(changes);
504
652
  const shown = CHANGE_GROUPS.filter((group) => filter === "all" || filter === group);
505
653
  const listed = shown.flatMap((group) => groups[group]);
@@ -517,7 +665,7 @@ function Changes({ changes, selected, companion }) {
517
665
  replace: true
518
666
  });
519
667
  };
520
- if (changes.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
668
+ if (changes.length === 0 && submitted.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("section", {
521
669
  className: cn(PAGE_PAD, "pb-10"),
522
670
  "aria-label": "Changes",
523
671
  children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(EmptyNote, { children: "No change is in flight in this companion." })
@@ -532,16 +680,7 @@ function Changes({ changes, selected, companion }) {
532
680
  label: "Show changes",
533
681
  value: filter,
534
682
  onChange: setFilter,
535
- options: [{
536
- value: "all",
537
- label: "All",
538
- count: changes.length
539
- }, ...CHANGE_GROUPS.map((group) => ({
540
- value: group,
541
- label: GROUP_TITLES[group],
542
- count: groups[group].length,
543
- tone: group === "needs-you" ? "warn" : void 0
544
- }))]
683
+ options: filterOptions(groups, submitted.length)
545
684
  }), groups["needs-you"].length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Button, {
546
685
  variant: "primary",
547
686
  size: "sm",
@@ -562,6 +701,7 @@ function Changes({ changes, selected, companion }) {
562
701
  className: "m-0 list-none p-0",
563
702
  children: groups[group].map((change) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChangeRow, {
564
703
  change,
704
+ workflow,
565
705
  current: change.name === selected,
566
706
  onOpen: () => {
567
707
  setPass(false);
@@ -570,6 +710,7 @@ function Changes({ changes, selected, companion }) {
570
710
  }, change.name))
571
711
  })
572
712
  }, group)),
713
+ filter === "all" || filter === "submitted" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubmittedCard, { submitted }) : null,
573
714
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SidePanel, {
574
715
  items: walk.map((change) => change.name),
575
716
  current: current?.name ?? null,
@@ -579,6 +720,7 @@ function Changes({ changes, selected, companion }) {
579
720
  title: current ? `Change ${current.name}` : "Change",
580
721
  children: current ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ChangeDetail, {
581
722
  change: current,
723
+ workflow,
582
724
  companion,
583
725
  reading: readingPath,
584
726
  onRead: (path) => setReading(path ? {
@@ -595,8 +737,10 @@ function Changes({ changes, selected, companion }) {
595
737
  function Dashboard({ payload, selected, companion }) {
596
738
  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)(Changes, {
597
739
  changes: payload.changes,
740
+ submitted: payload.submitted,
598
741
  selected,
599
- companion
742
+ companion,
743
+ workflow: payload.workflow ?? void 0
600
744
  })] });
601
745
  }
602
746
  // src/routes/index.tsx?tsr-split=component
@@ -612,7 +756,9 @@ function Overview() {
612
756
  } }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Dashboard, {
613
757
  payload: {
614
758
  changes: data.changes ?? [],
615
- warnings: data.warnings
759
+ submitted: data.submitted,
760
+ warnings: data.warnings,
761
+ workflow: data.workflow
616
762
  },
617
763
  selected: search.change,
618
764
  companion: search.companion
@@ -1,4 +1,4 @@
1
- import { b as viewsFor, f as LEGACY_ROLE_PARAM, g as STUDIO_MODE_PARAM, l as COMPANION_DIGEST_PATTERN, u as COMPANION_PARAM, y as requestedMode } from "./studio-BeltxxKt.js";
1
+ import { C as STUDIO_MODE_PARAM, D as viewsFor, E as requestedMode, _ as COMPANION_PARAM, g as COMPANION_DIGEST_PATTERN, y as LEGACY_ROLE_PARAM } from "./studio-CB94np48.js";
2
2
  // src/lib/search.ts
3
3
  /**
4
4
  * Forgiving like the server's own parsing: an unknown value selects nothing rather than failing.
@@ -12,8 +12,27 @@ function validateStudioSearch(raw) {
12
12
  if (typeof raw.role === "string") params.set(LEGACY_ROLE_PARAM, raw.role);
13
13
  const mode = requestedMode(params);
14
14
  if (mode) search.studioMode = mode;
15
+ const days = Number(raw.usageDays);
16
+ if (/^\d+$/.test(String(raw.usageDays)) && Number.isInteger(days) && days >= 1 && days <= 365) search.usageDays = days;
17
+ if (typeof raw.usageRepository === "string" && /^[a-zA-Z0-9_-]{1,64}$/.test(raw.usageRepository)) search.usageRepository = raw.usageRepository;
15
18
  return search;
16
19
  }
20
+ /** The router JSON-parses search values, so `?q=2026` arrives as a number; read it as typed. */
21
+ function searchText(value) {
22
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") return;
23
+ return String(value).trim() || void 0;
24
+ }
25
+ /** Values naming nothing in the companion's specs are dropped by the view, not here. */
26
+ function validateSpecsSearch(raw) {
27
+ const q = searchText(raw.q);
28
+ const repo = searchText(raw.repo);
29
+ const area = searchText(raw.area);
30
+ return {
31
+ ...q ? { q } : {},
32
+ ...repo ? { repo } : {},
33
+ ...area ? { area } : {}
34
+ };
35
+ }
17
36
  /**
18
37
  * The address to replace this one with so it names the effective mode and no legacy `role`,
19
38
  * or `null` when it already does. A view the mode is not offered lands on the Overview.
@@ -33,4 +52,4 @@ function canonicalHref(pathname, searchStr, view, studioMode) {
33
52
  params.set(STUDIO_MODE_PARAM, studioMode);
34
53
  return `${pathname}?${params}`;
35
54
  }
36
- export { validateStudioSearch as n, canonicalHref as t };
55
+ export { validateSpecsSearch as n, validateStudioSearch as r, canonicalHref as t };
@@ -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 { C as STUDIO_MODE_PARAM, T as companionDigest, _ as COMPANION_PARAM } from "./studio-CB94np48.js";
5
+ import { r as validateStudioSearch } from "./search-DUK7Jl6f.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 {
@@ -41,7 +42,15 @@ var getShell = createServerFn({ method: "GET" }).validator((input) => ({
41
42
  specs: payload.specs.length
42
43
  } : null,
43
44
  writable: page.writable,
44
- factoryMode: context.studio.factoryMode,
45
+ addsCompanions: context.studio.addsCompanions(),
46
+ pluginViews: context.studio.services().flatMap((service) => service.views.flatMap((view) => view.moduleUrl ? [{
47
+ service: service.id,
48
+ view: view.id,
49
+ label: view.label,
50
+ ...view.description ? { description: view.description } : {},
51
+ moduleUrl: view.moduleUrl,
52
+ ...view.attentionUrl ? { attentionUrl: view.attentionUrl } : {}
53
+ }] : [])),
45
54
  terminal: page.terminal ? {
46
55
  pinned: page.terminal.pinned,
47
56
  target: page.terminal.target,
@@ -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-DHUjPpA0.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-CWDGIp6x.js";
4
+ import { Dr as useQuery, Tr as cn, r as Icon } from "./button-BfoNadNR.js";
5
+ import { n as PanelSection, r as SidePanel, t as PanelHead } from "./panel-yqOl5GMU.js";
6
+ import { i as workflowPlan } from "./steps-CV7Yk7L7.js";
7
+ import { d as skillPreviewQuery, j as keepPreviousData } from "./studio-queries-BqZGBE70.js";
8
+ import { t as MarkdownView } from "./markdown-view-D3v9x-cM.js";
9
+ import { l as Route } from "./router-Dnoq5auE.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 { g as COMPANION_DIGEST_PATTERN } from "./studio-CB94np48.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-CB94np48.js";
2
+ import { t as CompanionView } from "./companion-view-DHUjPpA0.js";
3
+ import { n as Specs } from "./specs-view-BGn-5Ik_.js";
4
+ import { n as findAction } from "./actions-D8erOphH.js";
5
+ import { c as Route } from "./router-Dnoq5auE.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 };