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

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