@kabmo-labs/kabmo 0.42.1 → 0.43.0

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 (362) hide show
  1. package/README.md +1 -1
  2. package/dist/client/index.html +1 -1
  3. package/dist/client/index.js +619 -582
  4. package/dist/client/static/js/{CsvGrid-8gdp5b49.js → CsvGrid-3fr85032.js} +2 -2
  5. package/dist/client/static/js/{DocxView-j9sphgra.js → DocxView-pqbp2fpd.js} +4 -4
  6. package/dist/client/static/js/{DrawioView-xsgjc7d8.js → DrawioView-m0vecq1m.js} +2 -2
  7. package/dist/client/static/js/ImageView-rbejbjwg.js +1 -0
  8. package/dist/client/static/js/LayoutWrapper-mxfsqh57.js +2 -0
  9. package/dist/client/static/js/Modal-vnwg4xn3.js +59 -0
  10. package/dist/client/static/js/{PdfView-afd5cg54.js → PdfView-wmg0vk2p.js} +1 -1
  11. package/dist/client/static/js/SessionsView-90z2t4qe.js +1 -0
  12. package/dist/client/static/js/{SheetView-gfzgxb4r.js → SheetView-rg5gkcd7.js} +13 -13
  13. package/dist/client/static/js/{SvgPreview-225pkb99.js → SvgPreview-wpb7b0ez.js} +1 -1
  14. package/dist/client/static/js/{abnfDiagram-O67JEVCF-z70sk69m.js → abnfDiagram-O67JEVCF-4pxqt66j.js} +1 -1
  15. package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +1 -0
  16. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-pf1gpkje.js → architectureDiagram-NJMV4G6O-kwt1va5y.js} +11 -11
  17. package/dist/client/static/js/{astro-nn7xg0we.js → astro-dpfdhc5e.js} +1 -1
  18. package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
  19. package/dist/client/static/js/{blockDiagram-BEXU5L5S-sr25kbn6.js → blockDiagram-BEXU5L5S-hbj5v7n7.js} +7 -7
  20. package/dist/client/static/js/c-8jf64j6h.js +1 -0
  21. package/dist/client/static/js/{c4Diagram-YGBWAQC7-znstpg86.js → c4Diagram-YGBWAQC7-epfzh8dw.js} +6 -6
  22. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-7n0pdcd8.js → classDiagram-v2-NBCMYWYE-kbks4qgz.js} +6 -6
  23. package/dist/client/static/js/{cose-bilkent-JH36ORCC-zn3qw4c4.js → cose-bilkent-JH36ORCC-dvdmckrf.js} +1 -1
  24. package/dist/client/static/js/cpp-vh94zee0.js +1 -0
  25. package/dist/client/static/js/css-p57h1fme.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-3z41vtzs.js → cynefinDiagram-VND7K2PF-r084stj5.js} +2 -2
  28. package/dist/client/static/js/{dagre-6A5THRUB-5j3zn883.js → dagre-6A5THRUB-64qc51n1.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-ryw1w2kh.js → diagram-22UHCM2B-70qtb1rm.js} +16 -16
  30. package/dist/client/static/js/{diagram-3UASUU5V-p91q4gkh.js → diagram-3UASUU5V-dgkvnsme.js} +1 -1
  31. package/dist/client/static/js/{diagram-ATOU4E4O-22dn73g4.js → diagram-ATOU4E4O-rnpsp26v.js} +3 -3
  32. package/dist/client/static/js/{diagram-CDSNMT55-589p9n53.js → diagram-CDSNMT55-26hthh60.js} +5 -5
  33. package/dist/client/static/js/{diagram-MLGK6HIB-ezw06wbx.js → diagram-MLGK6HIB-nc1s85r5.js} +2 -2
  34. package/dist/client/static/js/{diagram-MPIPVDR6-cfwrsvk1.js → diagram-MPIPVDR6-e4dckqhv.js} +3 -3
  35. package/dist/client/static/js/{dockerfile-r4k7q34y.js → dockerfile-rxtyyhr1.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3rv2wvbf.js → ebnfDiagram-ZINNZB2B-3w9h8qk7.js} +1 -1
  37. package/dist/client/static/js/{elixir-szk51ehr.js → elixir-5ewfhvfh.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-ma40kneq.js → elk-276RUBZZ-httpkyb1.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-xwstsfqa.js → erDiagram-OPXOYQCR-3qhvf7se.js} +8 -8
  40. package/dist/client/static/js/{erlang-zwy7cqdk.js → erlang-jqqa3ehb.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-1jat076e.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-qxyx9tr9.js → ganttDiagram-FUAMR5RP-t53m50e5.js} +6 -6
  44. package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +1 -0
  45. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-v6sg7bkh.js → gitGraphDiagram-X574FWY7-b5wn9eht.js} +14 -14
  46. package/dist/client/static/js/graphql-kesh8gk0.js +1 -0
  47. package/dist/client/static/js/html-sxpfydga.js +1 -0
  48. package/dist/client/static/js/{index-e1yz59fa.js → index-0c6vpk89.js} +2 -2
  49. package/dist/client/static/js/{index-p0ez6hqd.js → index-181p91hf.js} +1 -1
  50. package/dist/client/static/js/{index-kh6vp5w5.js → index-1dwdgp27.js} +1 -1
  51. package/dist/client/static/js/{index-df4yxfzd.js → index-2q23dwrs.js} +2 -2
  52. package/dist/client/static/js/{index-4cncqz8j.js → index-38v0781h.js} +2 -2
  53. package/dist/client/static/js/{index-mvykbyhe.js → index-4banz7gr.js} +1 -1
  54. package/dist/client/static/js/{index-nh29fkk9.js → index-7dp90ad1.js} +2 -2
  55. package/dist/client/static/js/{index-b37ewyvk.js → index-7z9tz4ze.js} +2 -2
  56. package/dist/client/static/js/{index-3d40c0a7.js → index-7zc1z9z9.js} +4 -4
  57. package/dist/client/static/js/{index-8pdz41yh.js → index-8y51kgan.js} +3 -3
  58. package/dist/client/static/js/{index-qh753ynv.js → index-axszsg7a.js} +1 -1
  59. package/dist/client/static/js/{index-pxtff3ez.js → index-bvjct7sp.js} +2 -2
  60. package/dist/client/static/js/{index-8b3t2y77.js → index-cqnpsw2m.js} +2 -2
  61. package/dist/client/static/js/{index-869bpqcs.js → index-d8r84zjd.js} +12 -12
  62. package/dist/client/static/js/{index-mq6s2faf.js → index-dg3b0mfk.js} +2 -2
  63. package/dist/client/static/js/index-dkqgmacr.js +4 -0
  64. package/dist/client/static/js/{index-pkes9492.js → index-e7yf273s.js} +2 -2
  65. package/dist/client/static/js/{index-0p43qr4k.js → index-egd0vfey.js} +1 -1
  66. package/dist/client/static/js/{index-x7m6dmt4.js → index-enb6chty.js} +1 -1
  67. package/dist/client/static/js/{index-6eq445nn.js → index-f4fqvct6.js} +22 -22
  68. package/dist/client/static/js/{index-pysqpc5n.js → index-fg965t62.js} +2 -2
  69. package/dist/client/static/js/{index-sr7sdm2t.js → index-fgyenbv8.js} +4 -4
  70. package/dist/client/static/js/{index-qsw5edtk.js → index-fjnkzk12.js} +5 -5
  71. package/dist/client/static/js/{index-0nca2nhp.js → index-g3a9j9hf.js} +1 -1
  72. package/dist/client/static/js/{index-x7a5jpvq.js → index-g4rsmakg.js} +3 -3
  73. package/dist/client/static/js/{index-qx6x4z0y.js → index-gmnmnfm0.js} +2 -2
  74. package/dist/client/static/js/{index-313ctswm.js → index-gwqb7m8g.js} +1 -1
  75. package/dist/client/static/js/{index-w5q9ymf4.js → index-j60gtvw8.js} +1 -1
  76. package/dist/client/static/js/index-jvs2fvqz.js +2 -0
  77. package/dist/client/static/js/{index-r8cc80w5.js → index-jz93j0at.js} +2 -2
  78. package/dist/client/static/js/{index-2w9j2nj4.js → index-k9ws464d.js} +2 -2
  79. package/dist/client/static/js/{index-b3d2k7ec.js → index-kc3c2gzb.js} +1 -1
  80. package/dist/client/static/js/{index-9hzfvjrb.js → index-kccp6tgd.js} +2 -2
  81. package/dist/client/static/js/{index-9ss64g4g.js → index-kmzd0adv.js} +1 -1
  82. package/dist/client/static/js/{index-8fvmyv7t.js → index-ksph3kpr.js} +2 -2
  83. package/dist/client/static/js/{index-dfqmwm7j.js → index-m9s9rg5k.js} +2 -2
  84. package/dist/client/static/js/{index-gsxebrq9.js → index-n9scbxy5.js} +2 -2
  85. package/dist/client/static/js/{index-mphhvgm9.js → index-q1gwgmxt.js} +2 -2
  86. package/dist/client/static/js/{index-b42t14wk.js → index-q81rxwh7.js} +35 -35
  87. package/dist/client/static/js/{index-ktbrmp29.js → index-qhytrsyb.js} +2 -2
  88. package/dist/client/static/js/index-qzw4jnnv.js +1 -0
  89. package/dist/client/static/js/{index-xsts4pqm.js → index-r11bbnek.js} +78 -78
  90. package/dist/client/static/js/{index-q3qpm7jn.js → index-rv4qs3wm.js} +2 -2
  91. package/dist/client/static/js/{index-hga3e13s.js → index-s78n0dtv.js} +2 -2
  92. package/dist/client/static/js/{index-03pyvmcz.js → index-sesghshh.js} +2 -2
  93. package/dist/client/static/js/index-tnv3dryk.js +9 -0
  94. package/dist/client/static/js/{index-v5dbrq83.js → index-tzbzehqd.js} +1 -1
  95. package/dist/client/static/js/index-vcrh95gf.css +1 -0
  96. package/dist/client/static/js/{index-4y0ayjfx.js → index-vmgzhp41.js} +1 -1
  97. package/dist/client/static/js/{index-6dxs0tvg.js → index-wmv3crye.js} +2 -2
  98. package/dist/client/static/js/{index-b0v6gwym.js → index-ycks7gyg.js} +2 -2
  99. package/dist/client/static/js/{index-hw14rhen.js → index-ynaxep06.js} +2 -2
  100. package/dist/client/static/js/{index-rab39785.js → index-ys0xpw3q.js} +2 -2
  101. package/dist/client/static/js/{index-feffxxss.js → index-yvgbr7ek.js} +2 -2
  102. package/dist/client/static/js/index-zqthmaxq.js +478 -0
  103. package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +1 -0
  104. package/dist/client/static/js/{infoDiagram-VRGFBTTK-0anekyhb.js → infoDiagram-VRGFBTTK-qv7438m3.js} +1 -1
  105. package/dist/client/static/js/ini-1x0ad976.js +1 -0
  106. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-zxpmfkjb.js → ishikawaDiagram-OU5B5YK6-p1w6zg5y.js} +4 -4
  107. package/dist/client/static/js/java-3944nq02.js +1 -0
  108. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-1e86fzra.js → journeyDiagram-ZHPQQLJL-ywk6xqxr.js} +5 -5
  109. package/dist/client/static/js/json-g5ggnd94.js +1 -0
  110. package/dist/client/static/js/jsx-f6p72qpc.js +1 -0
  111. package/dist/client/static/js/{julia-2eekpjq8.js → julia-0h9krgsd.js} +1 -1
  112. package/dist/client/static/js/{kanban-definition-PNTS6WVX-e85hhmr1.js → kanban-definition-PNTS6WVX-gtrmhggc.js} +5 -5
  113. package/dist/client/static/js/lua-edn2b3wn.js +1 -0
  114. package/dist/client/static/js/markdown-9dhg1fax.js +1 -0
  115. package/dist/client/static/js/{mermaid.core-jpcrnzyw.js → mermaid.core-5s24b4hh.js} +6 -6
  116. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-xwy5928e.js → mindmap-definition-NLK3R4M7-3wx7abqn.js} +4 -4
  117. package/dist/client/static/js/one-dark-pro-3vya9z02.js +1 -0
  118. package/dist/client/static/js/one-light-1yrwn9my.js +1 -0
  119. package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +1 -0
  120. package/dist/client/static/js/{pegDiagram-GJSIUBJH-7dy6pw26.js → pegDiagram-GJSIUBJH-yvyqnjya.js} +1 -1
  121. package/dist/client/static/js/{perl-dtn1fccw.js → perl-rptyx23q.js} +1 -1
  122. package/dist/client/static/js/{php-7av78hch.js → php-sagvq3wz.js} +1 -1
  123. package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +1 -0
  124. package/dist/client/static/js/{pieDiagram-5QR66LMP-nrv2t5yn.js → pieDiagram-5QR66LMP-26x6pj38.js} +3 -3
  125. package/dist/client/static/js/properties-fcmj08pv.js +1 -0
  126. package/dist/client/static/js/python-532d8ezm.js +1 -0
  127. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-3nt63xr8.js → quadrantDiagram-O4NWA36T-qhe8h0j9.js} +6 -6
  128. package/dist/client/static/js/r-ptmdxs2a.js +1 -0
  129. package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +1 -0
  130. package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +1 -0
  131. package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +1 -0
  132. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +1 -0
  133. package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +1 -0
  134. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-evm05hzp.js → railroadDiagram-XR7U4H2S-dwy3k2jx.js} +1 -1
  135. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-tzrcmktj.js → requirementDiagram-PLB6GJNP-hcmgfesg.js} +4 -4
  136. package/dist/client/static/js/{ruby-s2bqr910.js → ruby-9qyx7knh.js} +1 -1
  137. package/dist/client/static/js/{rust-pcvgybk3.js → rust-bmb4ee5w.js} +1 -1
  138. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-jvjd5rz8.js → sankeyDiagram-IPEJSGJF-s6d3k4zs.js} +6 -6
  139. package/dist/client/static/js/{sass-bm32bb5k.js → sass-07rteya0.js} +1 -1
  140. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-0zvjwx29.js → sequenceDiagram-PO4LG4MO-0fcmzgdy.js} +19 -19
  141. package/dist/client/static/js/{sizeCapture-INFHLROL-6t6g0edv.js → sizeCapture-INFHLROL-t8fcm7rq.js} +1 -1
  142. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-nb13b23a.js → stateDiagram-v2-GCMORJYK-jr80hfeg.js} +6 -6
  143. package/dist/client/static/js/{svelte-ztkaww47.js → svelte-w365cpwa.js} +1 -1
  144. package/dist/client/static/js/{swimlanes-2SLR337P-ef8vmg6f.js → swimlanes-2SLR337P-x1ay6w39.js} +1 -1
  145. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xj123xrp.js +8 -0
  146. package/dist/client/static/js/{timeline-definition-EJHVYXUP-3bfph698.js → timeline-definition-EJHVYXUP-qz0g6msb.js} +2 -2
  147. package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +1 -0
  148. package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +1 -0
  149. package/dist/client/static/js/typescript-683kkkaw.js +1 -0
  150. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-vj6yj6tc.js → usecaseDiagram-POWQR4AR-sxzrv8ht.js} +43 -43
  151. package/dist/client/static/js/{vennDiagram-UO4OBE2U-9xyyabaq.js → vennDiagram-UO4OBE2U-qsqgnjcv.js} +5 -5
  152. package/dist/client/static/js/{vue-cbqm4bed.js → vue-d6cesny1.js} +1 -1
  153. package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +1 -0
  154. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-zpcwgv9d.js → wardleyDiagram-VNRHLVJA-rvwxn458.js} +4 -4
  155. package/dist/client/static/js/xml-6ct32gys.js +1 -0
  156. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pdr2rms2.js → xychartDiagram-PMCCYNJV-nb4w7rcg.js} +5 -5
  157. package/dist/client/static/js/yaml-1d5m3bfj.js +1 -0
  158. package/marketplace/plugins/command-runner/package.json +2 -2
  159. package/marketplace/plugins/command-runner/src/app.test.tsx +161 -0
  160. package/marketplace/plugins/command-runner/src/app.tsx +37 -3
  161. package/marketplace/plugins/command-runner/src/panel/Glyph.tsx +22 -4
  162. package/marketplace/plugins/git-forge/package.json +2 -2
  163. package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +22 -3
  164. package/marketplace/plugins/git-forge/src/panel/index.tsx +21 -3
  165. package/marketplace/plugins/git-forge/src/panel/refresh.test.tsx +192 -0
  166. package/marketplace/plugins/git-forge/src/panel/use-forge.ts +4 -2
  167. package/marketplace/plugins/git-forge/src/panel/write.test.tsx +21 -0
  168. package/marketplace/plugins/stats/package.json +2 -2
  169. package/marketplace/plugins/stats/src/RefreshButton.tsx +9 -7
  170. package/marketplace/plugins/stats/src/app.tsx +15 -1
  171. package/marketplace/plugins/stats/src/refresh.test.tsx +166 -0
  172. package/package.json +1 -1
  173. package/src/client/components/common/anchored-menu/index.tsx +26 -8
  174. package/src/client/components/common/context-usage-button/McpSection.test.tsx +34 -5
  175. package/src/client/components/common/context-usage-button/McpSection.tsx +25 -3
  176. package/src/client/components/common/harness-glyph/brands.ts +3 -0
  177. package/src/client/components/common/harness-glyph/omo.ts +22 -0
  178. package/src/client/components/common/server-control/Panel.tsx +24 -86
  179. package/src/client/components/common/server-control/Row.tsx +98 -0
  180. package/src/client/components/common/server-control/index.test.tsx +69 -9
  181. package/src/client/components/layout/VisibilityMenu.tsx +18 -6
  182. package/src/client/components/layout/new-workspace-host/index.test.tsx +84 -0
  183. package/src/client/components/layout/new-workspace-host/index.tsx +35 -0
  184. package/src/client/components/mobile/header-titlebar.test.tsx +38 -3
  185. package/src/client/components/settings/Sidebar.tsx +2 -1
  186. package/src/client/components/settings/categories/GitSettings.tsx +31 -0
  187. package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +292 -0
  188. package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +215 -0
  189. package/src/client/components/settings/category-content.tsx +3 -0
  190. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +8 -0
  191. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +55 -2
  192. package/src/client/components/workspace/chat-timeline/MessageList.tsx +13 -1
  193. package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +56 -50
  194. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +38 -2
  195. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +13 -1
  196. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +50 -0
  197. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +20 -1
  198. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Bash.tsx +2 -1
  199. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +1 -4
  200. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
  201. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
  202. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
  203. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
  204. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
  205. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
  206. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
  207. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
  208. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
  209. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -0
  210. package/src/client/components/workspace/git-panel/CommitBox.test.tsx +98 -0
  211. package/src/client/components/workspace/git-panel/CommitBox.tsx +68 -3
  212. package/src/client/components/workspace/git-panel/index.test.ts +12 -0
  213. package/src/client/components/workspace/git-panel/index.tsx +20 -1
  214. package/src/client/components/workspace/repo-picker/index.test.tsx +20 -0
  215. package/src/client/components/workspace/repo-picker/index.tsx +5 -6
  216. package/src/client/data/settings/omp-schema.json +134 -8
  217. package/src/client/hooks/chat/context/mcp.ts +19 -1
  218. package/src/client/hooks/chat/timeline/jump-rail.ts +1 -0
  219. package/src/client/hooks/chat/timeline/row-window.test.ts +38 -3
  220. package/src/client/hooks/chat/timeline/row-window.ts +33 -9
  221. package/src/client/hooks/chat/timeline/scroll-geometry.ts +19 -1
  222. package/src/client/hooks/chat/timeline/scroll.ts +15 -0
  223. package/src/client/hooks/chat/timeline/thinking-open.ts +10 -4
  224. package/src/client/hooks/workspace/commit-box.test.ts +62 -1
  225. package/src/client/hooks/workspace/commit-box.ts +94 -2
  226. package/src/client/hooks/workspace/git-panel-data.ts +15 -7
  227. package/src/client/hooks/workspace/repo-scope/index.test.ts +10 -3
  228. package/src/client/hooks/workspace/repo-scope/index.ts +21 -9
  229. package/src/client/lib/plugins/repo-scope-service.ts +7 -25
  230. package/src/server/lib/chat/session-store.server.ts +22 -1
  231. package/src/server/lib/fs/git-commit-context.test.ts +111 -0
  232. package/src/server/lib/fs/git-commit-context.ts +85 -0
  233. package/src/server/lib/fs/git-commit-message.server.ts +251 -0
  234. package/src/server/lib/fs/git-commit-message.test.ts +211 -0
  235. package/src/server/lib/fs/git-commit-prompt.test.ts +69 -0
  236. package/src/server/lib/fs/git-commit-prompt.ts +57 -0
  237. package/src/server/lib/fs/git-commit-settings.server.ts +42 -0
  238. package/src/server/lib/fs/git-identity.server.test.ts +129 -0
  239. package/src/server/lib/fs/git-identity.server.ts +130 -0
  240. package/src/server/lib/harness/acp/acp-audit.server.ts +13 -62
  241. package/src/server/lib/harness/acp/acp-frames.server.test.ts +105 -0
  242. package/src/server/lib/harness/acp/acp-frames.server.ts +217 -0
  243. package/src/server/lib/harness/acp/acp-raw-messages.server.test.ts +69 -0
  244. package/src/server/lib/harness/acp/acp-raw-messages.server.ts +129 -0
  245. package/src/server/lib/harness/acp/acp-telemetry.server.ts +19 -0
  246. package/src/server/lib/harness/acp/one-shot.server.ts +141 -0
  247. package/src/server/lib/harness/acp/raw-listeners.ts +30 -0
  248. package/src/server/lib/harness/acp/session-handshake.ts +11 -3
  249. package/src/server/lib/harness/acp/session.test-util.ts +2 -0
  250. package/src/server/lib/harness/acp/session.ts +8 -0
  251. package/src/server/lib/harness/capabilities.ts +11 -0
  252. package/src/server/lib/harness/launch-table.ts +19 -0
  253. package/src/server/lib/harness/launch.ts +4 -0
  254. package/src/server/lib/harness/schema.server.ts +23 -0
  255. package/src/server/lib/harness/spawn.server.ts +18 -2
  256. package/src/server/lib/mcp/agent-config.server.test.ts +111 -0
  257. package/src/server/lib/mcp/agent-config.server.ts +205 -0
  258. package/src/server/lib/mcp/probe.server.ts +7 -1
  259. package/src/server/lib/mcp/registry.server.ts +4 -3
  260. package/src/server/lib/mcp/secrets.server.test.ts +85 -0
  261. package/src/server/lib/mcp/secrets.server.ts +108 -0
  262. package/src/server/lib/omp/core/print.server.ts +100 -0
  263. package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
  264. package/src/server/lib/omp/session/artifacts.server.test.ts +15 -5
  265. package/src/server/lib/omp/session/artifacts.server.ts +41 -26
  266. package/src/server/lib/omp/session/delete.server.ts +2 -0
  267. package/src/server/lib/omp/session/goal-auditor.server.ts +10 -48
  268. package/src/server/lib/omp/session/scan.ts +15 -2
  269. package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
  270. package/src/server/lib/realtime/topics/session-data.server.ts +6 -14
  271. package/src/server/routes/fs/git-message.test.ts +101 -0
  272. package/src/server/routes/fs/git-message.ts +60 -0
  273. package/src/server/routes/fs/index.ts +2 -0
  274. package/src/server/routes/omp/artifact.ts +4 -3
  275. package/src/server/routes/sessions/mcp.test.ts +65 -1
  276. package/src/server/routes/sessions/mcp.ts +77 -5
  277. package/src/server/routes/settings/git-identity.test.ts +77 -0
  278. package/src/server/routes/settings/git-identity.ts +47 -0
  279. package/src/server/routes/settings/index.ts +2 -0
  280. package/src/server/routes/telemetry/acp-telemetry.test.ts +149 -0
  281. package/src/server/routes/telemetry/context.ts +31 -0
  282. package/src/server/routes/telemetry/raw-messages.ts +34 -0
  283. package/src/shared/lib/chat/timeline/tool-render-mode.ts +3 -3
  284. package/src/shared/lib/chat/tool/artifact.test.ts +4 -2
  285. package/src/shared/lib/chat/tool/artifact.ts +6 -1
  286. package/src/shared/lib/chat/tool/proc-facts.ts +2 -1
  287. package/src/shared/lib/fs/paths.test.ts +2 -0
  288. package/src/shared/lib/fs/repo-label.test.ts +22 -1
  289. package/src/shared/lib/fs/repo-label.ts +29 -0
  290. package/src/shared/lib/git/commit-prompt.test.ts +47 -0
  291. package/src/shared/lib/git/commit-prompt.ts +72 -0
  292. package/src/shared/lib/git/identity.test.ts +46 -0
  293. package/src/shared/lib/git/identity.ts +70 -0
  294. package/src/shared/lib/harness/brand-color.ts +3 -0
  295. package/src/shared/lib/harness/catalog.test.ts +14 -0
  296. package/src/shared/lib/harness/catalog.ts +9 -1
  297. package/src/shared/lib/harness/mcp-facts.ts +4 -0
  298. package/src/shared/lib/harness/provider-facts.test.ts +11 -0
  299. package/src/shared/lib/harness/provider-facts.ts +14 -0
  300. package/src/shared/lib/harness/providers.ts +2 -2
  301. package/src/shared/lib/harness/updates.test.ts +8 -0
  302. package/src/shared/lib/harness/updates.ts +9 -0
  303. package/src/shared/lib/omp/session/operator-title.test.ts +21 -0
  304. package/src/shared/lib/omp/session/operator-title.ts +28 -0
  305. package/src/shared/lib/omp/session/proc-daemon.ts +124 -0
  306. package/src/shared/lib/omp/session/proc.test.ts +30 -3
  307. package/src/shared/lib/omp/session/proc.ts +6 -82
  308. package/src/shared/lib/omp/session/wait-idle.test.ts +15 -4
  309. package/src/shared/lib/omp/session/wait-idle.ts +11 -4
  310. package/src/shared/lib/settings/defaults.ts +5 -0
  311. package/src/shared/lib/workspace/new-workspace.ts +20 -0
  312. package/src/shared/types/settings/mcp.ts +2 -2
  313. package/src/shared/types/settings/state.ts +16 -0
  314. package/src/test-support/preload.ts +1 -0
  315. package/dist/client/static/js/ImageView-ve9hc519.js +0 -1
  316. package/dist/client/static/js/LayoutWrapper-5mqffvkc.js +0 -2
  317. package/dist/client/static/js/Modal-50whypff.js +0 -38
  318. package/dist/client/static/js/SessionsView-7719nvy0.js +0 -1
  319. package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +0 -1
  320. package/dist/client/static/js/bash-fjzhxy10.js +0 -1
  321. package/dist/client/static/js/c-wqtyezvw.js +0 -1
  322. package/dist/client/static/js/cpp-y0nzwner.js +0 -1
  323. package/dist/client/static/js/css-n2waj098.js +0 -1
  324. package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +0 -1
  325. package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +0 -1
  326. package/dist/client/static/js/flowDiagram-KWPJA3E3-evp84v09.js +0 -1
  327. package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +0 -1
  328. package/dist/client/static/js/graphql-gvb7e2eb.js +0 -1
  329. package/dist/client/static/js/html-tbz83eke.js +0 -1
  330. package/dist/client/static/js/index-001vebsp.js +0 -2
  331. package/dist/client/static/js/index-5599dngt.js +0 -1
  332. package/dist/client/static/js/index-5asf5625.js +0 -4
  333. package/dist/client/static/js/index-cqaz1281.js +0 -2
  334. package/dist/client/static/js/index-f4vr1c6e.css +0 -1
  335. package/dist/client/static/js/index-rt6ac0kk.js +0 -478
  336. package/dist/client/static/js/index-y1p3bdsw.js +0 -9
  337. package/dist/client/static/js/info-A6RAGUB7-n495k952.js +0 -1
  338. package/dist/client/static/js/ini-2gvjwh83.js +0 -1
  339. package/dist/client/static/js/java-1xwcq79s.js +0 -1
  340. package/dist/client/static/js/json-4pqjabgq.js +0 -1
  341. package/dist/client/static/js/jsx-wcsss15s.js +0 -1
  342. package/dist/client/static/js/lua-h7vjcn0h.js +0 -1
  343. package/dist/client/static/js/markdown-f30jjjh9.js +0 -1
  344. package/dist/client/static/js/one-dark-pro-r0tswz8r.js +0 -1
  345. package/dist/client/static/js/one-light-xzcfrptf.js +0 -1
  346. package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +0 -1
  347. package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +0 -1
  348. package/dist/client/static/js/properties-ymexza6q.js +0 -1
  349. package/dist/client/static/js/python-31ycwa66.js +0 -1
  350. package/dist/client/static/js/r-t2nne4xp.js +0 -1
  351. package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +0 -1
  352. package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +0 -1
  353. package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +0 -1
  354. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +0 -1
  355. package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +0 -1
  356. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-f4sx355z.js +0 -8
  357. package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +0 -1
  358. package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +0 -1
  359. package/dist/client/static/js/typescript-p3syh43m.js +0 -1
  360. package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +0 -1
  361. package/dist/client/static/js/xml-4enq788a.js +0 -1
  362. package/dist/client/static/js/yaml-pjtt3jsc.js +0 -1
@@ -94,6 +94,9 @@ export interface UseTimelineRowWindowDeps {
94
94
  * the jump reached the bottom and the correction pulled the viewport
95
95
  * 2 000 px back up, 217 px short of the tail once the stream grew again). */
96
96
  jumpCountRef?: RefObject<number>;
97
+ /** Set when the measurement that just landed was a row ABOVE the viewport;
98
+ * the geometry pin stands down for that delivery (the up/down bounce). */
99
+ skipTailPinRef?: RefObject<boolean>;
97
100
  /** False renders every row (a short list, or a surface without a scroller). */
98
101
  enabled?: boolean;
99
102
  }
@@ -105,6 +108,7 @@ export function useTimelineRowWindow({
105
108
  jumpActiveRef,
106
109
  jumpBehaviorRef,
107
110
  jumpCountRef,
111
+ skipTailPinRef,
108
112
  enabled = true,
109
113
  }: UseTimelineRowWindowDeps): TimelineRowWindow {
110
114
  // Heights of rows that have been on screen at least once, by id — so a row
@@ -207,21 +211,26 @@ export function useTimelineRowWindow({
207
211
  if (!enabled) return;
208
212
  const el = element;
209
213
  if (!el) return;
210
- const measure = (): boolean => {
214
+ const measure = (): { changed: boolean; above: boolean } => {
211
215
  let changed = false;
216
+ let above = false;
212
217
  for (const node of el.querySelectorAll<HTMLElement>('[data-row-id]')) {
213
218
  const id = node.dataset.rowId;
214
219
  if (!id) continue;
215
- const height = node.getBoundingClientRect().height;
220
+ const rect = node.getBoundingClientRect();
221
+ const height = rect.height;
216
222
  if (height <= 0) continue;
217
223
  const previous = measuredRef.current.get(id);
218
224
  if (previous !== undefined && Math.abs(previous - height) <= MEASURE_EPSILON_PX) continue;
219
225
  measuredRef.current.set(id, height);
226
+ // A row at or above the viewport's top moves the content ABOVE the
227
+ // reader; the tail pin must not follow it (see `skipTailPinRef`).
228
+ if (rect.bottom <= 0) above = true;
220
229
  changed = true;
221
230
  }
222
- return changed;
231
+ return { changed, above };
223
232
  };
224
- const adopt = (): void => {
233
+ const adopt = (above: boolean): void => {
225
234
  // Which row the reader is looking at, under the geometry they are still
226
235
  // seeing: `el.scrollTop` has not moved yet (a browser does not adjust it
227
236
  // when content above grows), so the OLD layout is the right one to read
@@ -257,10 +266,18 @@ export function useTimelineRowWindow({
257
266
  // the browser: three rows removed and re-added per expand), which throws
258
267
  // away every block's local state.
259
268
  const next = layoutTimelineRows(ids, measuredRef.current);
260
- const target = tail || !anchorId
261
- ? Math.max(0, el.scrollHeight - el.clientHeight)
262
- : next.offsets[rowIndex(ids, anchorId)] + offset;
269
+ // A measurement ABOVE the viewport moved the content the reader is
270
+ // looking at: keep the anchor and let the geometry pin stand down, or
271
+ // following the tail moves the viewport by the measured-vs-estimated
272
+ // difference (the reported up/down bounce).
273
+ const keepAnchor = above && tail && Boolean(anchorId);
274
+ const target = keepAnchor
275
+ ? next.offsets[rowIndex(ids, anchorId)] + offset
276
+ : tail || !anchorId
277
+ ? Math.max(0, el.scrollHeight - el.clientHeight)
278
+ : next.offsets[rowIndex(ids, anchorId)] + offset;
263
279
  tailPinRef.current = tail;
280
+ if (keepAnchor && skipTailPinRef) skipTailPinRef.current = true;
264
281
  // A reveal OWNS the viewport until it settles: it re-writes its target
265
282
  // every frame, so a correction here would be written back over it and the
266
283
  // two would trade the viewport (measured before this guard existed: the
@@ -276,7 +293,8 @@ export function useTimelineRowWindow({
276
293
  }
277
294
  setVersion((value) => value + 1);
278
295
  };
279
- if (measure()) adopt();
296
+ const first = measure();
297
+ if (first.changed) adopt(first.above);
280
298
 
281
299
  if (typeof ResizeObserver === 'undefined') return;
282
300
  let frame: number | null = null;
@@ -287,7 +305,8 @@ export function useTimelineRowWindow({
287
305
  // frame, and the report it eventually raises is an uncaught page error.
288
306
  frame = requestAnimationFrame(() => {
289
307
  frame = null;
290
- if (measure()) adopt();
308
+ const result = measure();
309
+ if (result.changed) adopt(result.above);
291
310
  });
292
311
  });
293
312
  for (const node of el.querySelectorAll('[data-row-id]')) observer.observe(node);
@@ -301,6 +320,11 @@ export function useTimelineRowWindow({
301
320
  useLayoutEffect(() => {
302
321
  const el = element;
303
322
  if (!el || !tailPinRef.current) return;
323
+ // The measurement that just landed was ABOVE the viewport: the row window
324
+ // kept the anchor, and the geometry pin stands down for this delivery.
325
+ // Writing the tail here would undo that and move the viewport by the
326
+ // measured-vs-estimated difference (the reported up/down bounce).
327
+ if (skipTailPinRef?.current) return;
304
328
  // A jump to the tail owns the position while it lands; its own watch is
305
329
  // what puts the viewport at the bottom, and a second writer here is a
306
330
  // second animation.
@@ -51,6 +51,13 @@ export interface TimelineGeometryPinDeps {
51
51
  followRef: RefObject<boolean>;
52
52
  /** A jump in flight owns the position; its own watch re-aims. */
53
53
  jumpActiveRef: RefObject<boolean>;
54
+ /**
55
+ * The row window measured a row ABOVE the viewport: the content height above
56
+ * the reader changed, and re-pinning the tail would move the viewport by the
57
+ * measured-vs-estimated difference (the reported up/down bounce). Skip one
58
+ * delivery and clear the flag.
59
+ */
60
+ skipTailPinRef: RefObject<boolean>;
54
61
  pinToBottom: (behavior: ScrollBehavior) => void;
55
62
  /** Re-derives the scroll-bottom affordance from the same geometry. */
56
63
  syncFollowBottom: () => void;
@@ -61,6 +68,7 @@ export function useTimelineGeometryPin({
61
68
  contentNode,
62
69
  followRef,
63
70
  jumpActiveRef,
71
+ skipTailPinRef,
64
72
  pinToBottom,
65
73
  syncFollowBottom,
66
74
  }: TimelineGeometryPinDeps): void {
@@ -71,6 +79,16 @@ export function useTimelineGeometryPin({
71
79
  let frame: number | null = null;
72
80
  const observer = new ResizeObserver((entries) => {
73
81
  const containerResized = entries.some((entry) => entry.target === container);
82
+ // The row window just measured a row ABOVE the viewport. The content
83
+ // height above the reader changed; re-pinning the tail here would move
84
+ // the viewport by the measured-vs-estimated difference — the reported
85
+ // up/down bounce. The row window already wrote the anchor, so this
86
+ // delivery stands down.
87
+ if (skipTailPinRef.current) {
88
+ skipTailPinRef.current = false;
89
+ syncFollowBottom();
90
+ return;
91
+ }
74
92
  if (containerResized && followRef.current && !jumpActiveRef.current) {
75
93
  pinToBottom('instant');
76
94
  syncFollowBottom();
@@ -91,5 +109,5 @@ export function useTimelineGeometryPin({
91
109
  observer.disconnect();
92
110
  if (frame !== null) cancelAnimationFrame(frame);
93
111
  };
94
- }, [contentNode, scrollNode, followRef, jumpActiveRef, pinToBottom, syncFollowBottom]);
112
+ }, [contentNode, scrollNode, followRef, jumpActiveRef, skipTailPinRef, pinToBottom, syncFollowBottom]);
95
113
  }
@@ -126,6 +126,15 @@ export interface ChatTimelineScrollResult {
126
126
  * rAF reached the tail.
127
127
  */
128
128
  jumpBehaviorRef: RefObject<ScrollBehavior>;
129
+ /**
130
+ * Set by the row window when the measurement that just landed was a row
131
+ * ABOVE the viewport. The content height above the reader changed, so the
132
+ * geometry pin must NOT re-pin the tail for that delivery — doing so moves
133
+ * the viewport by the measured-vs-estimated difference, which is the
134
+ * reported "scroll down, back, scroll down, back" while a thinking block
135
+ * streams. The observer clears it after skipping one delivery.
136
+ */
137
+ skipTailPinRef: RefObject<boolean>;
129
138
  handleScroll: () => void;
130
139
  scrollToBottom: (behavior?: ScrollBehavior) => void;
131
140
  /** Jump to the tail and re-engage follow mode (scroll-bottom button, the
@@ -168,6 +177,10 @@ export function useChatTimelineScroll(options: ChatTimelineScrollOptions = {}):
168
177
  const jumpActiveRef = useRef(false);
169
178
  // The motion of the jump in flight; see ChatTimelineScrollResult.
170
179
  const jumpBehaviorRef = useRef<ScrollBehavior>('smooth');
180
+ // Set by the row window when the measurement that just landed was a row
181
+ // ABOVE the viewport; the geometry pin skips one delivery. See the result
182
+ // field's doc.
183
+ const skipTailPinRef = useRef(false);
171
184
  // The landing watch: owns the viewport until the jump has landed.
172
185
  const landingRef = useRef<JumpLanding | null>(null);
173
186
  // Last time the READER touched the scroller (wheel, touch, pointer, key).
@@ -269,6 +282,7 @@ export function useChatTimelineScroll(options: ChatTimelineScrollOptions = {}):
269
282
  contentNode,
270
283
  followRef,
271
284
  jumpActiveRef,
285
+ skipTailPinRef,
272
286
  pinToBottom,
273
287
  syncFollowBottom,
274
288
  });
@@ -292,6 +306,7 @@ export function useChatTimelineScroll(options: ChatTimelineScrollOptions = {}):
292
306
  jumpCountRef,
293
307
  jumpActiveRef,
294
308
  jumpBehaviorRef,
309
+ skipTailPinRef,
295
310
  handleScroll,
296
311
  scrollToBottom,
297
312
  jumpToBottom,
@@ -40,22 +40,28 @@ export interface ThinkingOpenState {
40
40
  /**
41
41
  * `messageId` is optional so a block mounted outside a session (a spec, a
42
42
  * preview) still toggles — it just cannot remember the choice.
43
+ *
44
+ * `autoOpen` is the RUN's liveness, not the segment's: a warm session can
45
+ * deliver a thinking segment's first update and its `message_end` inside one
46
+ * animation frame, so the block mounts already finalized. Keying the default
47
+ * on the segment's own `isGenerating` left it collapsed for the rest of the
48
+ * run — the reported "thinking sometimes does not open".
43
49
  */
44
50
  export function useThinkingOpenState(
45
51
  messageId: string | undefined,
46
52
  defaultOpen: boolean,
47
- isGenerating: boolean,
53
+ autoOpen: boolean,
48
54
  ): ThinkingOpenState {
49
55
  const [stored, setStored] = useSessionState<Record<string, boolean>>(THINKING_OPEN_STATE_KEY, {});
50
- const [local, setLocal] = useState(defaultOpen || isGenerating);
56
+ const [local, setLocal] = useState(defaultOpen || autoOpen);
51
57
  const choice = messageId ? stored[messageId] : undefined;
52
58
 
53
59
  // A run that starts streaming opens itself, as it always has. This is the
54
60
  // local half on purpose: the stored half is the reader's own choice, and it
55
61
  // must not be overwritten by a default.
56
62
  useEffect(() => {
57
- if (isGenerating) setLocal(true);
58
- }, [isGenerating]);
63
+ if (autoOpen) setLocal(true);
64
+ }, [autoOpen]);
59
65
 
60
66
  const isOpen = choice ?? local;
61
67
  const toggle = (): void => {
@@ -44,6 +44,11 @@ let headMessage: string | null = PREVIOUS;
44
44
  /** Holds the read open, so a case can act while it is in flight. */
45
45
  let gate: Promise<void> | null = null;
46
46
  let release: () => void = () => {};
47
+ /** The commit-message request the hook issued. */
48
+ let generateBody: Record<string, unknown> | null = null;
49
+ /** What the generation endpoint answers. */
50
+ let generateAnswer: string | null = 'feat: generated';
51
+ let generateStatus = 200;
47
52
  let container: HTMLElement;
48
53
  const nativeFetch = Bun.fetch;
49
54
 
@@ -65,11 +70,18 @@ async function mount(stored: Record<string, unknown> = {}) {
65
70
  });
66
71
  return null;
67
72
  };
68
- globalThis.fetch = (async (input: unknown) => {
73
+ globalThis.fetch = (async (input: unknown, init?: RequestInit) => {
69
74
  const url = String(input);
70
75
  if (url.includes('/state')) {
71
76
  return new Response(JSON.stringify({ state: stored }), { status: 200, headers: { 'content-type': 'application/json' } });
72
77
  }
78
+ if (url.includes('/api/fs/git-message')) {
79
+ generateBody = JSON.parse(String(init?.body ?? '{}')) as Record<string, unknown>;
80
+ const body = generateStatus === 200
81
+ ? { success: true, message: generateAnswer }
82
+ : { error: 'Stage changes first.', code: 'nothing_staged' };
83
+ return new Response(JSON.stringify(body), { status: generateStatus, headers: { 'content-type': 'application/json' } });
84
+ }
73
85
  reads.push(url);
74
86
  if (gate) await gate;
75
87
  return new Response(JSON.stringify({ success: true, message: headMessage }), { status: 200, headers: { 'content-type': 'application/json' } });
@@ -101,6 +113,9 @@ afterEach(() => {
101
113
  headMessage = PREVIOUS;
102
114
  gate = null;
103
115
  release = () => {};
116
+ generateBody = null;
117
+ generateAnswer = 'feat: generated';
118
+ generateStatus = 200;
104
119
  if (container) render(null, container);
105
120
  container?.remove();
106
121
  // The store is a module singleton: without this the previous case's draft is
@@ -200,4 +215,50 @@ describe('useCommitBox amend pre-fill', () => {
200
215
  expect(mounted!.message).toBe('');
201
216
  expect(mounted!.amend).toBe(false);
202
217
  });
218
+
219
+ test('generate fills an empty draft and marks it generated', async () => {
220
+ await mount();
221
+ await act(async () => { mounted!.generate(); });
222
+ await settle();
223
+
224
+ expect(mounted!.message).toBe('feat: generated');
225
+ expect(mounted!.generated).toBe(true);
226
+ expect(mounted!.suggestion).toBeNull();
227
+ expect(generateBody).toMatchObject({ root: ROOT, repo: '.', sessionId: SESSION });
228
+ });
229
+
230
+ test('a typed draft is never overwritten; the answer becomes a suggestion', async () => {
231
+ await mount();
232
+ await act(async () => { mounted!.setMessage('my own message'); });
233
+ await act(async () => { mounted!.generate(); });
234
+ await settle();
235
+
236
+ expect(mounted!.message).toBe('my own message');
237
+ expect(mounted!.suggestion).toBe('feat: generated');
238
+
239
+ await act(async () => { mounted!.useSuggestion(); });
240
+ expect(mounted!.message).toBe('feat: generated');
241
+ expect(mounted!.generated).toBe(true);
242
+ expect(mounted!.suggestion).toBeNull();
243
+ });
244
+
245
+ test('a failed generate leaves the draft alone', async () => {
246
+ generateStatus = 409;
247
+ await mount();
248
+ await act(async () => { mounted!.generate(); });
249
+ await settle();
250
+
251
+ expect(mounted!.message).toBe('');
252
+ expect(mounted!.suggestion).toBeNull();
253
+ });
254
+
255
+ test('generate sends the amend flag', async () => {
256
+ await mount();
257
+ await act(async () => { mounted!.toggleAmend(true); });
258
+ await settle();
259
+ await act(async () => { mounted!.generate(); });
260
+ await settle();
261
+
262
+ expect(generateBody).toMatchObject({ amend: true });
263
+ });
203
264
  });
@@ -31,8 +31,9 @@
31
31
  * box keeps the placeholder it always had.
32
32
  */
33
33
 
34
- import { useCallback, useEffect, useRef } from 'preact/hooks';
34
+ import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
35
35
  import { useSessionState, useSessionStateSnapshot } from '@/client/hooks/workspace/session-state';
36
+ import { pushToast } from '@/client/hooks/ui/toasts';
36
37
 
37
38
  interface UseCommitBoxOptions {
38
39
  rootPath?: string;
@@ -50,12 +51,26 @@ export interface CommitBoxState {
50
51
  /** The checkbox handler: it is what triggers the pre-fill. */
51
52
  toggleAmend: (next: boolean) => void;
52
53
  commit: () => void;
54
+ /** True while the commit-message model is answering. */
55
+ isGenerating: boolean;
56
+ /** A generated message that was NOT written into a non-empty draft. */
57
+ suggestion: string | null;
58
+ /** True while the draft is the generated text and the user has not edited it. */
59
+ generated: boolean;
60
+ generate: () => void;
61
+ useSuggestion: () => void;
62
+ dismissSuggestion: () => void;
53
63
  }
54
64
 
55
65
  export function useCommitBox({ rootPath, repo, execute }: UseCommitBoxOptions): CommitBoxState {
56
66
  const { sessionId } = useSessionStateSnapshot();
57
67
  const [message, setMessage] = useSessionState<string>('git.commitDraft', '');
58
68
  const [amend, setAmend] = useSessionState<boolean>('git.amend', false);
69
+ const [isGenerating, setIsGenerating] = useState(false);
70
+ const [suggestion, setSuggestion] = useState<string | null>(null);
71
+ const [generated, setGenerated] = useState(false);
72
+ /** Guards a double click while the request is in flight. */
73
+ const generatingRef = useRef(false);
59
74
  /** The text this hook seeded, so un-ticking clears only its own write. */
60
75
  const seededRef = useRef<string | null>(null);
61
76
  // The live draft and checkbox, read inside the async tail without making
@@ -69,6 +84,68 @@ export function useCommitBox({ rootPath, repo, execute }: UseCommitBoxOptions):
69
84
  const setMessageRef = useRef(setMessage);
70
85
  setMessageRef.current = setMessage;
71
86
 
87
+ /** The UI's setter: a user edit ends the "generated" state. */
88
+ const setDraft = useCallback(
89
+ (value: string) => {
90
+ setMessage(value);
91
+ setGenerated(false);
92
+ },
93
+ [setMessage],
94
+ );
95
+
96
+ const generate = useCallback(() => {
97
+ if (generatingRef.current) return;
98
+ generatingRef.current = true;
99
+ setIsGenerating(true);
100
+ setSuggestion(null);
101
+
102
+ const body = {
103
+ ...(rootPath ? { root: rootPath } : {}),
104
+ repo,
105
+ ...(sessionId ? { sessionId } : {}),
106
+ ...(amendRef.current ? { amend: true } : {}),
107
+ };
108
+
109
+ void fetch('/api/fs/git-message', {
110
+ method: 'POST',
111
+ headers: { 'Content-Type': 'application/json' },
112
+ body: JSON.stringify(body),
113
+ })
114
+ .then(async (response) => {
115
+ const payload = await response.json().catch(() => null) as { message?: unknown; error?: unknown } | null;
116
+ if (!response.ok || typeof payload?.message !== 'string' || !payload.message.trim()) {
117
+ throw new Error(
118
+ typeof payload?.error === 'string' ? payload.error : `Request failed (HTTP ${response.status})`,
119
+ );
120
+ }
121
+ const text = payload.message.trim();
122
+ // A draft the user typed is never overwritten: the answer becomes a
123
+ // suggestion they can accept. An empty box is filled directly.
124
+ if (messageRef.current.trim().length === 0) {
125
+ setMessageRef.current(text);
126
+ setGenerated(true);
127
+ } else {
128
+ setSuggestion(text);
129
+ }
130
+ })
131
+ .catch((error: unknown) => {
132
+ pushToast(error instanceof Error ? error.message : String(error), 'error');
133
+ })
134
+ .finally(() => {
135
+ generatingRef.current = false;
136
+ setIsGenerating(false);
137
+ });
138
+ }, [rootPath, repo, sessionId]);
139
+
140
+ const useSuggestion = useCallback(() => {
141
+ if (suggestion === null) return;
142
+ setMessage(suggestion);
143
+ setGenerated(true);
144
+ setSuggestion(null);
145
+ }, [suggestion, setMessage]);
146
+
147
+ const dismissSuggestion = useCallback(() => setSuggestion(null), []);
148
+
72
149
  useEffect(() => {
73
150
  if (!amend) return;
74
151
  // A draft is already there — the user's, from this session or a restore.
@@ -123,7 +200,22 @@ export function useCommitBox({ rootPath, repo, execute }: UseCommitBoxOptions):
123
200
  setMessage('');
124
201
  setAmend(false);
125
202
  seededRef.current = null;
203
+ setSuggestion(null);
204
+ setGenerated(false);
126
205
  }, [execute, setAmend, setMessage]);
127
206
 
128
- return { message, setMessage, amend, seeded: seededRef.current !== null && message === seededRef.current, toggleAmend, commit };
207
+ return {
208
+ message,
209
+ setMessage: setDraft,
210
+ amend,
211
+ seeded: seededRef.current !== null && message === seededRef.current,
212
+ toggleAmend,
213
+ commit,
214
+ isGenerating,
215
+ suggestion,
216
+ generated,
217
+ generate,
218
+ useSuggestion,
219
+ dismissSuggestion,
220
+ };
129
221
  }
@@ -56,15 +56,18 @@ export function useGitPanelData(
56
56
  ): GitPanelData {
57
57
  const fetcher = useFetcher<GitPanelStatus>();
58
58
 
59
- const { activeRepo: pickedRepo, setActiveRepo, ready: activeRepoReady } = useRepoScope(rootPath);
59
+ const { pickedRepo, setActiveRepo, ready: activeRepoReady } = useRepoScope(rootPath);
60
60
  const { repos, scanning: reposScanning, rescan: refreshRepos } = useRepoList(rootPath, enabled);
61
61
  // When the user has picked nothing and the workspace root is not itself a
62
62
  // repo, git falls back to the first repo discovery found — the same choice
63
- // the loader makes for a request that names no repo. Resolving it here rather
64
- // than reading it back from the response is what keeps the header label, the
65
- // picker's checkmark and the requests describing one repo: the response
66
- // arrives a render later, and by then it may belong to a workspace the user
67
- // has already left.
63
+ // the loader makes for a request that names no repo. An EXPLICIT pick of the
64
+ // root is honored even when it is not a repo, so the picker's root row is a
65
+ // real choice (the panel then draws its "not a repository" state) rather than
66
+ // a control that silently snaps back to the first nested repo. Resolving it
67
+ // here rather than reading it back from the response is what keeps the header
68
+ // label, the picker's checkmark and the requests describing one repo: the
69
+ // response arrives a render later, and by then it may belong to a workspace
70
+ // the user has already left.
68
71
  const activeRepo = resolveRepoForPanel(pickedRepo, repos);
69
72
  const activeRepoRef = useRef(activeRepo);
70
73
  activeRepoRef.current = activeRepo;
@@ -111,7 +114,12 @@ export function useGitPanelData(
111
114
  const targetRepo = repo ?? activeRepoRef.current;
112
115
  const params = new URLSearchParams();
113
116
  if (rootPath) params.set('root', rootPath);
114
- if (targetRepo && targetRepo !== '.') params.set('repo', targetRepo);
117
+ // ALWAYS send the repo, including `'.'`. The route's implicit-repo fallback
118
+ // (`repos.includes('.') ? '.' : repos[0]`) exists for a request that names
119
+ // none, and an explicit root pick must not be mistaken for one: omitting
120
+ // `repo` here made the panel read the first nested repo while its header
121
+ // and topic described the root.
122
+ if (targetRepo) params.set('repo', targetRepo);
115
123
  // The toolbar's ↑ahead ↓behind badge is what this asks for; it makes the
116
124
  // loader refresh the branch's remote-tracking ref before counting, so the
117
125
  // numbers describe origin rather than the last fetch.
@@ -190,6 +190,13 @@ describe('resolveRepoForPanel', () => {
190
190
  expect(resolveRepoForPanel('projects/a', ['projects/a', 'projects/b'])).toBe('projects/a');
191
191
  });
192
192
 
193
+ test('keeps an EXPLICIT root pick even when the root is not a repo', () => {
194
+ // The picker offers the root row, so a click on it must stick: the git
195
+ // panel then draws its "not a repository" state. Resolving it back to the
196
+ // first nested repo made the row a dead control.
197
+ expect(resolveRepoForPanel('.', ['alpha', 'conflicted'])).toBe('.');
198
+ });
199
+
193
200
  test('keeps the root when the root IS a repo', () => {
194
201
  // `.` is a real repository here, so it is a legitimate answer rather than
195
202
  // "no pick" — falling through to a nested one would move the panel off the
@@ -203,11 +210,11 @@ describe('resolveRepoForPanel', () => {
203
210
  // makes this deterministic — measured, `readdir` order differs between
204
211
  // machines and after a directory is rewritten, so an unsorted list made the
205
212
  // default repository differ between two reads of the same workspace.
206
- expect(resolveRepoForPanel('.', ['alpha', 'conflicted'])).toBe('alpha');
207
- expect(resolveRepoForPanel('.', ['conflicted', 'alpha'])).toBe('conflicted');
213
+ expect(resolveRepoForPanel(null, ['alpha', 'conflicted'])).toBe('alpha');
214
+ expect(resolveRepoForPanel(null, ['conflicted', 'alpha'])).toBe('conflicted');
208
215
  });
209
216
 
210
217
  test('answers the root when there is nothing to fall back to', () => {
211
- expect(resolveRepoForPanel('.', [])).toBe('.');
218
+ expect(resolveRepoForPanel(null, [])).toBe('.');
212
219
  });
213
220
  });
@@ -67,6 +67,14 @@ const LEGACY_REPO_STATE_KEYS = ['git.activeRepo', 'files.activeRepo', 'search.ac
67
67
  * The repo a git panel works on: the user's pick, or — when they have none and
68
68
  * the workspace root is not itself a repo — the first repo discovery found.
69
69
  *
70
+ * `null` means NO PICK. An explicit `'.'` is the root and is honored even when
71
+ * the root is not a repository: the git panel then draws its "not a repository"
72
+ * state, which is the one action that can turn the folder into a repo. The
73
+ * fallback exists only for a session that has not chosen anything, so the two
74
+ * cases must not be conflated — the picker offers the root row, and a click on
75
+ * it that silently resolved back to the first nested repo would be a dead
76
+ * control.
77
+ *
70
78
  * The git loader applies the same fallback when it is sent no repo at all
71
79
  * (`repo = repos.includes('.') ? '.' : repos[0]`), so resolving it here is what
72
80
  * keeps the header label, the picker's checkmark and the requests all naming
@@ -75,9 +83,9 @@ const LEGACY_REPO_STATE_KEYS = ['git.activeRepo', 'files.activeRepo', 'search.ac
75
83
  * nested repos is a normal workspace — so the files, search and terminal panels
76
84
  * keep `'.'` as the root itself.
77
85
  */
78
- export function resolveRepoForPanel(pick: string, repos: readonly string[]): string {
79
- if (pick !== '.' || repos.includes('.')) return pick;
80
- return repos[0] ?? '.';
86
+ export function resolveRepoForPanel(pick: string | null, repos: readonly string[]): string {
87
+ if (pick !== null) return pick;
88
+ return repos.includes('.') ? '.' : (repos[0] ?? '.');
81
89
  }
82
90
 
83
91
  /**
@@ -91,6 +99,8 @@ export function resolveRepoForPanel(pick: string, repos: readonly string[]): str
91
99
  */
92
100
  export function useRepoScope(rootPath: string | undefined): {
93
101
  activeRepo: string;
102
+ /** The stored pick for this root, or null when the session has none. */
103
+ pickedRepo: string | null;
94
104
  setActiveRepo: (repo: string) => void;
95
105
  ready: boolean;
96
106
  } {
@@ -126,13 +136,15 @@ export function useRepoScope(rootPath: string | undefined): {
126
136
 
127
137
  // A pick made under another root (or stored before the root was recorded
128
138
  // alongside it) names a directory that need not exist here: fall back to the
129
- // workspace root.
130
- const activeRepo =
139
+ // workspace root. `pickedRepo` keeps the distinction the git panel needs —
140
+ // `null` is "no pick", `'.'` is an explicit choice of the root.
141
+ const pickedRepo =
131
142
  pick && typeof pick === 'object' && pick.root === scope && typeof pick.repo === 'string' && pick.repo
132
143
  ? pick.repo
133
- : '.';
144
+ : null;
145
+ const activeRepo = pickedRepo ?? '.';
134
146
 
135
- return { activeRepo, setActiveRepo, ready };
147
+ return { activeRepo, pickedRepo, setActiveRepo, ready };
136
148
  }
137
149
 
138
150
  /**
@@ -142,9 +154,9 @@ export function useRepoScope(rootPath: string | undefined): {
142
154
  * the panel's own reads, so the dot describes the repository its view would show.
143
155
  */
144
156
  export function useResolvedRepo(rootPath: string | undefined, active: boolean): string {
145
- const { activeRepo } = useRepoScope(rootPath);
157
+ const { pickedRepo } = useRepoScope(rootPath);
146
158
  const { repos } = useRepoList(rootPath, active);
147
- return resolveRepoForPanel(activeRepo, repos);
159
+ return resolveRepoForPanel(pickedRepo, repos);
148
160
  }
149
161
 
150
162
  export interface RepoListHandle {
@@ -28,13 +28,13 @@
28
28
  * script (no component), so the two cannot disagree about which tree they mean.
29
29
  */
30
30
 
31
- import type { RepoScope, RepoScopeRow, UiKitServices } from '@kabmo-labs/kabmo-ui';
31
+ import type { RepoScope, UiKitServices } from '@kabmo-labs/kabmo-ui';
32
32
  import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
33
33
  import { subscribeSessionKey } from '@/shared/lib/workspace/session-state/listeners';
34
34
  import { pluginContext, subscribePluginContext } from '@/client/lib/plugins/context';
35
35
  import { repoStore, UNKNOWN_LIST } from '@/client/hooks/workspace/repo-scope/store';
36
36
  import { REPO_SCOPE_STATE_KEY } from '@/client/hooks/workspace/repo-scope';
37
- import { repoLabel, repoShortLabel } from '@/shared/lib/fs/repo-label';
37
+ import { repoRows } from '@/shared/lib/fs/repo-label';
38
38
 
39
39
  /** A repo choice, kept next to the workspace root it was made under. */
40
40
  interface RepoPick {
@@ -42,28 +42,6 @@ interface RepoPick {
42
42
  repo: string;
43
43
  }
44
44
 
45
- /**
46
- * The choices, as rows.
47
- *
48
- * The labels are computed HERE because the naming rule is the host's: the root
49
- * reads as its folder's name, a list row keeps its whole root-relative path so
50
- * `jns6_5/token` and `jns7/token` are distinguishable, and a trigger truncates
51
- * to the last segment. The kit is a published package that cannot import
52
- * `repo-label`, and a second copy of those rules is how one repo comes to be
53
- * labelled two ways in two places.
54
- *
55
- * `'.'` always leads: the root is a legitimate choice even when it is not itself
56
- * a repository, because a folder of nested repos is a normal workspace.
57
- */
58
- function rowsFor(root: string, repos: readonly string[]): RepoScopeRow[] {
59
- const rest = repos.filter((repo) => repo !== '.');
60
- return ['.', ...rest].map((repo) => ({
61
- repo,
62
- label: repoLabel(repo, root),
63
- short: repoShortLabel(repo, root),
64
- }));
65
- }
66
-
67
45
  /**
68
46
  * The scope as it stands.
69
47
  *
@@ -90,6 +68,10 @@ function readRepoScope(): RepoScope {
90
68
  * - **A pick from another root is not this root's pick.** The slot is per
91
69
  * session, so a session that picked a repo and was then pointed at another
92
70
  * workspace still holds the old pair; the fallback is the workspace root.
71
+ *
72
+ * The rows come from `repoRows`, which always leads with `'.'`: the root is a
73
+ * legitimate choice even when it is not itself a repository, because a folder of
74
+ * nested repos is a normal workspace.
93
75
  */
94
76
  export function resolveRepoScope(
95
77
  root: string | null,
@@ -104,7 +86,7 @@ export function resolveRepoScope(
104
86
  pick && typeof pick === 'object' && pick.root === root && typeof pick.repo === 'string' && pick.repo
105
87
  ? pick.repo
106
88
  : '.';
107
- return { root, repo, rows: rowsFor(root, repos), scanning, ready: true };
89
+ return { root, repo, rows: repoRows(root, repos), scanning, ready: true };
108
90
  }
109
91
 
110
92
  /**