@kabmo-labs/kabmo 0.32.0 → 0.33.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 (303) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +537 -530
  3. package/dist/client/static/js/{CsvGrid-amafmq3z.js → CsvGrid-fncjbg6j.js} +2 -2
  4. package/dist/client/static/js/{DocxView-851ps9t0.js → DocxView-c9v2vr3r.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-kw1vy3r2.js → DrawioView-vxjksm12.js} +2 -2
  6. package/dist/client/static/js/ImageView-a3g5k226.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-hnjfwsjh.js +2 -0
  8. package/dist/client/static/js/Modal-qtftcp2t.js +38 -0
  9. package/dist/client/static/js/{PdfView-f5jkm0rs.js → PdfView-ksaes53y.js} +1 -1
  10. package/dist/client/static/js/SessionsView-30vcr95v.js +1 -0
  11. package/dist/client/static/js/{SheetView-23zxy30b.js → SheetView-vc484scg.js} +23 -23
  12. package/dist/client/static/js/{SvgPreview-c341y50e.js → SvgPreview-tph89jet.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-2dc3mpk6.js → abnfDiagram-O67JEVCF-xbar278c.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-7jmrr5ja.js → architectureDiagram-NJMV4G6O-s171n2z6.js} +3 -3
  16. package/dist/client/static/js/{astro-sjtf954j.js → astro-80bs6hvg.js} +1 -1
  17. package/dist/client/static/js/bash-b3rwyg5p.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-jrk2m0ea.js → blockDiagram-BEXU5L5S-gzx6rv9n.js} +3 -3
  19. package/dist/client/static/js/c-wkgxb1t1.js +1 -0
  20. package/dist/client/static/js/{c4Diagram-YGBWAQC7-48cyncjd.js → c4Diagram-YGBWAQC7-7f00skch.js} +2 -2
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-gm7jt1cd.js → classDiagram-v2-NBCMYWYE-j79v95nc.js} +4 -4
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-g0g3z0xp.js → cose-bilkent-JH36ORCC-5fkn7ee5.js} +1 -1
  23. package/dist/client/static/js/cpp-y0t6mynx.js +1 -0
  24. package/dist/client/static/js/css-6vj0d308.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-6vjde6am.js → cynefinDiagram-VND7K2PF-cfs1yvrd.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-q6k8bx1j.js → dagre-6A5THRUB-44bgc48p.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-87cmze2n.js → diagram-22UHCM2B-a4g4x83k.js} +19 -19
  29. package/dist/client/static/js/{diagram-3UASUU5V-1ejbr2p4.js → diagram-3UASUU5V-gm4rg5na.js} +1 -1
  30. package/dist/client/static/js/{diagram-ATOU4E4O-vaw1r6k2.js → diagram-ATOU4E4O-a95y41vk.js} +3 -3
  31. package/dist/client/static/js/{diagram-CDSNMT55-gxm9zv7d.js → diagram-CDSNMT55-t3j93mmc.js} +5 -5
  32. package/dist/client/static/js/{diagram-MLGK6HIB-x010xswm.js → diagram-MLGK6HIB-c2wdez02.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-qtcq7e6c.js → diagram-MPIPVDR6-gya9jhs5.js} +2 -2
  34. package/dist/client/static/js/{dockerfile-k5xbramm.js → dockerfile-a7q6174s.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-nwwbasfh.js → ebnfDiagram-ZINNZB2B-jjhkza6t.js} +1 -1
  36. package/dist/client/static/js/{elk-276RUBZZ-xcp7thax.js → elk-276RUBZZ-f7re45mw.js} +1 -1
  37. package/dist/client/static/js/{erDiagram-OPXOYQCR-xj1tp716.js → erDiagram-OPXOYQCR-tpm9g5te.js} +6 -6
  38. package/dist/client/static/js/{erlang-rz1g9mxy.js → erlang-qt876zrq.js} +1 -1
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-f7q96bea.js → ganttDiagram-FUAMR5RP-fz43n12d.js} +4 -4
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-1rydkyq9.js → gitGraphDiagram-X574FWY7-f61hgbn6.js} +9 -9
  44. package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
  45. package/dist/client/static/js/{index-0g25yrc0.js → index-03h3bkcf.js} +1 -1
  46. package/dist/client/static/js/{index-8m3q2zpb.js → index-0e40xskg.js} +1 -1
  47. package/dist/client/static/js/{index-w5131mtt.js → index-0n5wwe60.js} +2 -2
  48. package/dist/client/static/js/{index-ynqnbvn2.js → index-0tf0arsp.js} +3 -3
  49. package/dist/client/static/js/{index-0a1ekhqf.js → index-14vndmcr.js} +2 -2
  50. package/dist/client/static/js/index-1a0zkj8h.js +2 -0
  51. package/dist/client/static/js/{index-zca66d5d.js → index-1xqs14fr.js} +3 -3
  52. package/dist/client/static/js/{index-73xfkyea.js → index-1y9r4frb.js} +2 -2
  53. package/dist/client/static/js/{index-0n9c85ke.js → index-2svnq5gg.js} +2 -2
  54. package/dist/client/static/js/{index-pe9j88d4.js → index-2x5f66t6.js} +2 -2
  55. package/dist/client/static/js/{index-ggaqh9rt.js → index-354mqqra.js} +2 -2
  56. package/dist/client/static/js/{index-2t2tnc3x.js → index-3rcjx70v.js} +1 -1
  57. package/dist/client/static/js/{index-9nbxb421.js → index-3zc1b0dv.js} +2 -2
  58. package/dist/client/static/js/{index-14wppnkx.js → index-5tgq7aqx.js} +2 -2
  59. package/dist/client/static/js/{index-vrbcj11n.js → index-76zb4m0n.js} +2 -2
  60. package/dist/client/static/js/{index-x64kqgen.js → index-7y6rpsrp.js} +2 -2
  61. package/dist/client/static/js/{index-2n5wy1sh.js → index-8239j2v1.js} +1 -1
  62. package/dist/client/static/js/{index-pkyrkkbt.js → index-9fjt5anh.js} +2 -2
  63. package/dist/client/static/js/{index-m6wwc5h6.js → index-9t82sx0w.js} +2 -2
  64. package/dist/client/static/js/{index-hkq0y3pn.js → index-9y3gjdj7.js} +2 -2
  65. package/dist/client/static/js/{index-hyry1n8x.js → index-ahv9y42z.js} +2 -2
  66. package/dist/client/static/js/{index-f519m6s3.js → index-ajs3jj6j.js} +1 -1
  67. package/dist/client/static/js/index-apvkd37e.js +4 -0
  68. package/dist/client/static/js/index-at6bhjyf.js +1 -0
  69. package/dist/client/static/js/index-bkye8mz4.js +2 -0
  70. package/dist/client/static/js/{index-e7a3fkvv.js → index-d495kfm0.js} +1 -1
  71. package/dist/client/static/js/{index-hhm62nfj.js → index-dbe6afkf.js} +2 -2
  72. package/dist/client/static/js/{index-c20a46ww.js → index-djmg1d7h.js} +2 -2
  73. package/dist/client/static/js/{index-fc2j6bq2.js → index-e4p4cd3r.js} +2 -2
  74. package/dist/client/static/js/{index-f63y3mjj.js → index-eyzeya95.js} +5 -5
  75. package/dist/client/static/js/{index-123e8tqq.js → index-gcs49f3p.js} +1 -1
  76. package/dist/client/static/js/{index-c8jzx6b0.js → index-gs6f0qwa.js} +2 -2
  77. package/dist/client/static/js/{index-6sdctwv2.js → index-hf52f59k.js} +2 -2
  78. package/dist/client/static/js/{index-3anc30zh.js → index-j0r5hj0j.js} +2 -2
  79. package/dist/client/static/js/{index-31jrebvn.js → index-js7t1vb1.js} +18 -18
  80. package/dist/client/static/js/{index-xa7nrnda.js → index-km2zb6wk.js} +2 -2
  81. package/dist/client/static/js/{index-yvcpdk5f.js → index-m73za75e.js} +1 -1
  82. package/dist/client/static/js/{index-e6rar25v.js → index-pbe4yed4.js} +2 -2
  83. package/dist/client/static/js/{index-xpf2ra60.js → index-pxv2nw9w.js} +1 -1
  84. package/dist/client/static/js/{index-deex10rz.js → index-q2w6s8n7.js} +5 -5
  85. package/dist/client/static/js/{index-22jaxtz1.js → index-qckv9nte.js} +2 -2
  86. package/dist/client/static/js/{index-e26rd868.js → index-qsm2z36d.js} +2 -2
  87. package/dist/client/static/js/{index-5zd1jx9r.js → index-rg8jpbsw.js} +2 -2
  88. package/dist/client/static/js/{index-gvwqjpcr.js → index-rytaa8ca.js} +2 -2
  89. package/dist/client/static/js/{index-fmxn1rzs.js → index-sdtye3jy.js} +2 -2
  90. package/dist/client/static/js/index-sffjtm5w.js +12 -0
  91. package/dist/client/static/js/{index-tr8754r0.js → index-trm9x02n.js} +45 -45
  92. package/dist/client/static/js/{index-cwaz6geq.js → index-vtbbfwx0.js} +2 -2
  93. package/dist/client/static/js/{index-vmvcse63.js → index-vw4brsdx.js} +1 -1
  94. package/dist/client/static/js/{index-qmh0h87h.js → index-vw5k8csz.js} +55 -55
  95. package/dist/client/static/js/{index-52bgxh6f.js → index-w0fwb80e.js} +1 -1
  96. package/dist/client/static/js/{index-s9vp6p70.js → index-x07kp3jz.js} +2 -2
  97. package/dist/client/static/js/{index-8a3tmm1h.js → index-xj9649ac.js} +7 -7
  98. package/dist/client/static/js/{index-w4re5r8w.js → index-ypx3qmhq.js} +2 -2
  99. package/dist/client/static/js/{index-y139vc12.js → index-zt75xpq0.js} +193 -193
  100. package/dist/client/static/js/{index-nsrnyqcm.js → index-zvfvqvn9.js} +2 -2
  101. package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +1 -0
  102. package/dist/client/static/js/{infoDiagram-VRGFBTTK-ptg07tp2.js → infoDiagram-VRGFBTTK-1qj804sn.js} +1 -1
  103. package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
  104. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-bdk2dkf5.js → ishikawaDiagram-OU5B5YK6-4j4qsnzw.js} +3 -3
  105. package/dist/client/static/js/java-g4dgwbfd.js +1 -0
  106. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kez0ha4c.js → journeyDiagram-ZHPQQLJL-j0brnfft.js} +4 -4
  107. package/dist/client/static/js/json-j5q8nt57.js +1 -0
  108. package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
  109. package/dist/client/static/js/{julia-nmr85k8z.js → julia-4ghmfy3e.js} +1 -1
  110. package/dist/client/static/js/{kanban-definition-PNTS6WVX-dhzp3qg5.js → kanban-definition-PNTS6WVX-qqc22br0.js} +3 -3
  111. package/dist/client/static/js/lua-1g6w30de.js +1 -0
  112. package/dist/client/static/js/markdown-afx21x8c.js +1 -0
  113. package/dist/client/static/js/{mermaid.core-h7wttbss.js → mermaid.core-vv3wbe65.js} +7 -7
  114. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-tq5dd1em.js → mindmap-definition-NLK3R4M7-y5b2z8zp.js} +4 -4
  115. package/dist/client/static/js/one-dark-pro-hm3f56n1.js +1 -0
  116. package/dist/client/static/js/one-light-xrz49rct.js +1 -0
  117. package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +1 -0
  118. package/dist/client/static/js/{pegDiagram-GJSIUBJH-e5hrdfzv.js → pegDiagram-GJSIUBJH-0be07mqs.js} +1 -1
  119. package/dist/client/static/js/{perl-prxcva8r.js → perl-sd00t4b4.js} +1 -1
  120. package/dist/client/static/js/{php-m9kcctzs.js → php-2zfyqa61.js} +1 -1
  121. package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +1 -0
  122. package/dist/client/static/js/{pieDiagram-5QR66LMP-axvbvnz8.js → pieDiagram-5QR66LMP-544w86jk.js} +2 -2
  123. package/dist/client/static/js/properties-thd83wey.js +1 -0
  124. package/dist/client/static/js/python-264ns4xw.js +1 -0
  125. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-wtn28cfm.js → quadrantDiagram-O4NWA36T-p09e7z5s.js} +4 -4
  126. package/dist/client/static/js/r-qw82kkv9.js +1 -0
  127. package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +1 -0
  128. package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +1 -0
  129. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +1 -0
  130. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +1 -0
  131. package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +1 -0
  132. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-avjkq945.js → railroadDiagram-XR7U4H2S-de830ed2.js} +1 -1
  133. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bntx7r6q.js → requirementDiagram-PLB6GJNP-b47d74p1.js} +4 -4
  134. package/dist/client/static/js/{ruby-t06c0e7g.js → ruby-v9qaqhby.js} +1 -1
  135. package/dist/client/static/js/{rust-6gqjxyf0.js → rust-fkt0qyrs.js} +1 -1
  136. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-ps8nkdm2.js → sankeyDiagram-IPEJSGJF-6ezc2fpj.js} +5 -5
  137. package/dist/client/static/js/{sass-gsbyn3wh.js → sass-9bxped7y.js} +1 -1
  138. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3ckf1q6z.js → sequenceDiagram-PO4LG4MO-by5zqj6w.js} +18 -18
  139. package/dist/client/static/js/{sizeCapture-INFHLROL-akvcr1x7.js → sizeCapture-INFHLROL-q85r06j6.js} +1 -1
  140. package/dist/client/static/js/sql-g8wcshpc.js +1 -0
  141. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-c82914fz.js → stateDiagram-v2-GCMORJYK-ep5pyexs.js} +3 -3
  142. package/dist/client/static/js/{svelte-j54gfrvq.js → svelte-mwtx07d9.js} +1 -1
  143. package/dist/client/static/js/{swimlanes-2SLR337P-scgdefh4.js → swimlanes-2SLR337P-95fcqkh8.js} +1 -1
  144. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +8 -0
  145. package/dist/client/static/js/{timeline-definition-EJHVYXUP-z2ha1rhq.js → timeline-definition-EJHVYXUP-461e615g.js} +2 -2
  146. package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +1 -0
  147. package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +1 -0
  148. package/dist/client/static/js/tsx-nm94hed6.js +1 -0
  149. package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
  150. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-3wdmrfmk.js → usecaseDiagram-POWQR4AR-ftqfnvhg.js} +38 -38
  151. package/dist/client/static/js/{vennDiagram-UO4OBE2U-7m5tatzv.js → vennDiagram-UO4OBE2U-7t96h6ez.js} +7 -7
  152. package/dist/client/static/js/{vue-y8bb5f3h.js → vue-j8vb9d7r.js} +1 -1
  153. package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +1 -0
  154. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-55ps9s4z.js → wardleyDiagram-VNRHLVJA-0de8w8c6.js} +4 -4
  155. package/dist/client/static/js/xml-dz51p1m3.js +1 -0
  156. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-8bsjtm4t.js → xychartDiagram-PMCCYNJV-dez9phkf.js} +5 -5
  157. package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
  158. package/package.json +1 -1
  159. package/src/client/components/common/context-usage-button/McpSection.test.tsx +98 -0
  160. package/src/client/components/common/context-usage-button/McpSection.tsx +12 -5
  161. package/src/client/components/common/context-usage-button/SessionStats.tsx +80 -0
  162. package/src/client/components/common/context-usage-button/index.test.tsx +26 -0
  163. package/src/client/components/common/context-usage-button/index.tsx +36 -28
  164. package/src/client/components/common/harness-glyph/brands.ts +8 -0
  165. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  166. package/src/client/components/layout/session-sidebar/SessionsView.tsx +20 -33
  167. package/src/client/components/mobile/LayoutWrapper.tsx +28 -29
  168. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
  169. package/src/client/components/mobile/worktree-session.ts +4 -1
  170. package/src/client/components/settings/apply-side-effects.test.ts +11 -0
  171. package/src/client/components/settings/apply-side-effects.ts +7 -0
  172. package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
  173. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  174. package/src/client/components/settings/categories/NotificationSettings.tsx +1 -1
  175. package/src/client/components/settings/categories/chat-settings/ChangedFilesSection.tsx +79 -0
  176. package/src/client/components/settings/categories/chat-settings/groups.ts +4 -3
  177. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +101 -0
  178. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +16 -15
  179. package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
  180. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +21 -1
  181. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
  182. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +11 -0
  183. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  184. package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
  185. package/src/client/components/workspace/diff-panel/index.tsx +23 -4
  186. package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
  187. package/src/client/components/workspace/editor/Body.tsx +2 -0
  188. package/src/client/data/settings/omp-schema.json +73 -3
  189. package/src/client/hooks/chat/btw/mode.ts +5 -1
  190. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +9 -3
  191. package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
  192. package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
  193. package/src/client/hooks/chat/timeline/new-chat.ts +4 -1
  194. package/src/client/hooks/chat/timeline/pending-dispatch.ts +6 -10
  195. package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
  196. package/src/client/hooks/chat/waiting/dispatch.ts +4 -1
  197. package/src/client/hooks/ui/notification-events.test.ts +3 -0
  198. package/src/client/hooks/ui/notification-events.ts +3 -1
  199. package/src/client/hooks/ui/notification-sound.ts +13 -6
  200. package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
  201. package/src/client/hooks/workspace/batch-delete-run.ts +5 -1
  202. package/src/client/hooks/workspace/diff-file.ts +11 -4
  203. package/src/client/hooks/workspace/file-tabs.ts +13 -4
  204. package/src/client/hooks/workspace/journal-diff.ts +97 -0
  205. package/src/client/hooks/workspace/session-delete.ts +5 -1
  206. package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
  207. package/src/client/lib/notifications/native-banner-sound.ts +46 -0
  208. package/src/client/lib/notifications/os.test.ts +14 -5
  209. package/src/client/lib/notifications/os.ts +8 -0
  210. package/src/client/lib/router/branch-params.test.ts +62 -0
  211. package/src/client/lib/router/branch-params.ts +48 -0
  212. package/src/server/lib/assets/shell-settings.server.test.ts +35 -0
  213. package/src/server/lib/assets/shell-settings.server.ts +33 -0
  214. package/src/server/lib/harness/launch-table.ts +10 -0
  215. package/src/server/lib/omp/session/changes.test.ts +138 -0
  216. package/src/server/lib/omp/session/changes.ts +220 -0
  217. package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
  218. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
  219. package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
  220. package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
  221. package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
  222. package/src/server/lib/omp/session/subagent-presence.ts +12 -3
  223. package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
  224. package/src/server/lib/omp/session/telemetry.test.ts +81 -0
  225. package/src/server/lib/realtime/topics/peer-relay.server.test.ts +1 -11
  226. package/src/server/plugins/ssr.ts +20 -8
  227. package/src/server/routes/sessions/changes.test.ts +90 -0
  228. package/src/server/routes/sessions/changes.ts +55 -0
  229. package/src/server/routes/sessions/index.ts +6 -0
  230. package/src/shared/lib/chat/duration.ts +34 -0
  231. package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
  232. package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
  233. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
  234. package/src/shared/lib/format/duration.test.ts +31 -0
  235. package/src/shared/lib/format/duration.ts +27 -0
  236. package/src/shared/lib/fs/unified-diff.test.ts +53 -0
  237. package/src/shared/lib/fs/unified-diff.ts +127 -0
  238. package/src/shared/lib/harness/brand-color.ts +3 -0
  239. package/src/shared/lib/harness/catalog.test.ts +13 -0
  240. package/src/shared/lib/harness/catalog.ts +8 -1
  241. package/src/shared/lib/harness/fork.ts +4 -2
  242. package/src/shared/lib/harness/mcp-facts.ts +3 -0
  243. package/src/shared/lib/harness/provider-facts.ts +14 -0
  244. package/src/shared/lib/harness/updates.ts +5 -0
  245. package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
  246. package/src/shared/lib/omp/config/schema.test.ts +4 -2
  247. package/src/shared/lib/settings/defaults.ts +1 -0
  248. package/src/shared/lib/workspace/file-tab-id.ts +9 -0
  249. package/src/shared/types/context.ts +18 -0
  250. package/src/shared/types/fs.ts +21 -0
  251. package/src/shared/types/index.ts +1 -0
  252. package/src/shared/types/omp/session.ts +6 -0
  253. package/src/shared/types/session-changes.ts +58 -0
  254. package/src/shared/types/settings/state.ts +8 -0
  255. package/src/test-support/peer-harness.ts +13 -5
  256. package/dist/client/static/js/ImageView-ksx9bbct.js +0 -1
  257. package/dist/client/static/js/LayoutWrapper-9ftz050x.js +0 -2
  258. package/dist/client/static/js/Modal-f8x3j3be.js +0 -38
  259. package/dist/client/static/js/SessionsView-wzdf1cp6.js +0 -1
  260. package/dist/client/static/js/architecture-7GRP2DOG-4wsd6vk0.js +0 -1
  261. package/dist/client/static/js/bash-h6pkqvth.js +0 -1
  262. package/dist/client/static/js/c-thbdzmwv.js +0 -1
  263. package/dist/client/static/js/cpp-r1za1kke.js +0 -1
  264. package/dist/client/static/js/css-qsv4vvke.js +0 -1
  265. package/dist/client/static/js/cynefin-OW5HDTMX-eycwde8c.js +0 -1
  266. package/dist/client/static/js/eventmodeling-NTZA5JFV-srqbnmey.js +0 -1
  267. package/dist/client/static/js/flowDiagram-KWPJA3E3-yj98317w.js +0 -1
  268. package/dist/client/static/js/gitGraph-4MIJSDKK-5jcrvn94.js +0 -1
  269. package/dist/client/static/js/graphql-275pg7ya.js +0 -1
  270. package/dist/client/static/js/index-b08zd4eq.js +0 -1
  271. package/dist/client/static/js/index-g0pkzanm.js +0 -2
  272. package/dist/client/static/js/index-ga2xdef3.js +0 -2
  273. package/dist/client/static/js/index-r416e9dt.js +0 -12
  274. package/dist/client/static/js/index-xzfsaqyz.js +0 -4
  275. package/dist/client/static/js/info-A6RAGUB7-mbt0ryx5.js +0 -1
  276. package/dist/client/static/js/ini-jqdrx98c.js +0 -1
  277. package/dist/client/static/js/java-70zqqrkr.js +0 -1
  278. package/dist/client/static/js/json-kxk8gfet.js +0 -1
  279. package/dist/client/static/js/jsx-h1035eqk.js +0 -1
  280. package/dist/client/static/js/lua-j2356waf.js +0 -1
  281. package/dist/client/static/js/markdown-ffw6rgk6.js +0 -1
  282. package/dist/client/static/js/one-dark-pro-8acf6cn2.js +0 -1
  283. package/dist/client/static/js/one-light-ysc1knem.js +0 -1
  284. package/dist/client/static/js/packet-AYTQ26CC-a5yw789s.js +0 -1
  285. package/dist/client/static/js/pie-WAS4IAKB-x0y4v4r2.js +0 -1
  286. package/dist/client/static/js/properties-55mrarxr.js +0 -1
  287. package/dist/client/static/js/python-dhypc3j4.js +0 -1
  288. package/dist/client/static/js/r-6b8dt1wp.js +0 -1
  289. package/dist/client/static/js/radar-RG4KPBEZ-trrc3ta1.js +0 -1
  290. package/dist/client/static/js/railroad-74A4TZTK-dxgvx21w.js +0 -1
  291. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rbgkd8sk.js +0 -1
  292. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-exgw7j47.js +0 -1
  293. package/dist/client/static/js/railroad-peg-WCYAUIDC-28tpamzk.js +0 -1
  294. package/dist/client/static/js/sql-9dq913c8.js +0 -1
  295. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-0x2ashav.js +0 -8
  296. package/dist/client/static/js/treeView-Q6P3EWNA-1a00b6kc.js +0 -1
  297. package/dist/client/static/js/treemap-WGGIJYW6-2q4f2f7m.js +0 -1
  298. package/dist/client/static/js/tsx-wh5xgm7f.js +0 -1
  299. package/dist/client/static/js/typescript-ge85req5.js +0 -1
  300. package/dist/client/static/js/wardley-WFR3VGLG-x9v91the.js +0 -1
  301. package/dist/client/static/js/xml-7bgz40qa.js +0 -1
  302. package/dist/client/static/js/yaml-4ht9416k.js +0 -1
  303. package/src/client/components/layout/session-sidebar/new-session-context.test.ts +0 -55
@@ -1,5 +1,5 @@
1
1
  {
2
- "source": "@oh-my-pi/pi-coding-agent 10 tabs / 615 settings",
2
+ "source": "@oh-my-pi/pi-coding-agent 10 tabs / 622 settings",
3
3
  "tabs": [
4
4
  {
5
5
  "id": "appearance",
@@ -124,6 +124,24 @@
124
124
  }
125
125
  ],
126
126
  "entries": {
127
+ "auth.unpausedProviders": {
128
+ "type": "array",
129
+ "default": [],
130
+ "ui": {
131
+ "tab": "providers",
132
+ "group": "Services",
133
+ "label": "Unpaused Providers",
134
+ "description": "Turn providers we paused back on: login, token refresh and stored credentials work again. Each pause names the account risk you accept. Project settings cannot set this",
135
+ "options": [
136
+ {
137
+ "value": "google-antigravity",
138
+ "label": "Google Antigravity (Gemini, Claude, GPT-OSS)",
139
+ "description": "Google Antigravity is paused: Google's terms do not allow third-party sign-in and Google has suspended accounts that used it (see #18341). Use GEMINI_API_KEY (AI Studio) or google-vertex instead."
140
+ }
141
+ ],
142
+ "condition": "unpausedProvidersNotProject"
143
+ }
144
+ },
127
145
  "modelRoleStorage": {
128
146
  "type": "enum",
129
147
  "default": "global",
@@ -6336,6 +6354,38 @@
6336
6354
  ]
6337
6355
  }
6338
6356
  },
6357
+ "todo.midRunNudges": {
6358
+ "type": "enum",
6359
+ "default": "capped",
6360
+ "values": [
6361
+ "off",
6362
+ "capped",
6363
+ "backoff"
6364
+ ],
6365
+ "ui": {
6366
+ "tab": "tools",
6367
+ "group": "Todos",
6368
+ "label": "Mid-Run Todo Nudges",
6369
+ "description": "How often a long turn is reminded to update its todo list while it keeps changing things",
6370
+ "options": [
6371
+ {
6372
+ "value": "off",
6373
+ "label": "Off",
6374
+ "description": "Never nudge mid-run"
6375
+ },
6376
+ {
6377
+ "value": "capped",
6378
+ "label": "Capped",
6379
+ "description": "Nudge after 12 edits or commands, at most twice until the todo list changes or you send a message"
6380
+ },
6381
+ {
6382
+ "value": "backoff",
6383
+ "label": "Backoff",
6384
+ "description": "Keep nudging with a doubling gap: after 12, 24, 48, 96, then every 192 edits or commands"
6385
+ }
6386
+ ]
6387
+ }
6388
+ },
6339
6389
  "todo.eager": {
6340
6390
  "type": "enum",
6341
6391
  "default": "default",
@@ -6431,7 +6481,7 @@
6431
6481
  },
6432
6482
  "grep.contextBefore": {
6433
6483
  "type": "number",
6434
- "default": 1,
6484
+ "default": 0,
6435
6485
  "ui": {
6436
6486
  "tab": "tools",
6437
6487
  "group": "Grep & Browser",
@@ -6463,7 +6513,7 @@
6463
6513
  },
6464
6514
  "grep.contextAfter": {
6465
6515
  "type": "number",
6466
- "default": 3,
6516
+ "default": 0,
6467
6517
  "ui": {
6468
6518
  "tab": "tools",
6469
6519
  "group": "Grep & Browser",
@@ -6628,6 +6678,16 @@
6628
6678
  "description": "Enable the read-only archive eval prelude: prompt history, recent projects, past sessions and recaps"
6629
6679
  }
6630
6680
  },
6681
+ "commit.enabled": {
6682
+ "type": "boolean",
6683
+ "default": true,
6684
+ "ui": {
6685
+ "tab": "tools",
6686
+ "group": "Available Tools",
6687
+ "label": "Selective commit",
6688
+ "description": "Enable the commit eval prelude and /commit: commit only the lines this agent and its subagents wrote"
6689
+ }
6690
+ },
6631
6691
  "computer.display": {
6632
6692
  "type": "string",
6633
6693
  "default": "active",
@@ -7189,6 +7249,16 @@
7189
7249
  "description": "Ordered bash command approval rules. Each item has match and approval fields; only '*' wildcards are supported."
7190
7250
  }
7191
7251
  },
7252
+ "bash.allowedEnvVars": {
7253
+ "type": "array",
7254
+ "default": [],
7255
+ "ui": {
7256
+ "tab": "shell",
7257
+ "group": "Bash",
7258
+ "label": "Bash Allowed Environment Variables",
7259
+ "description": "Exact environment variable names allowed as leading KEY=VALUE prefixes when matching bash.patterns allow rules (no wildcards). Any value is accepted, so list only benign build/test variables; execution-altering variables (PATH, LD_PRELOAD, BASH_ENV, *_RUNNER, *_WRAPPER) allow arbitrary command execution."
7260
+ }
7261
+ },
7192
7262
  "bashInterceptor.enabled": {
7193
7263
  "type": "boolean",
7194
7264
  "default": false,
@@ -26,6 +26,7 @@ import { useBtwSession, type BtwLiveAnswer } from '@/client/hooks/chat/btw';
26
26
  import { useKabmoEvent } from '@/client/hooks/ui/window-event';
27
27
  import { useSessionState } from '@/client/hooks/workspace/session-state';
28
28
  import { useSearchParams } from '@/client/lib/router/search-params';
29
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
29
30
  import { PHASE_VERBS } from '@/shared/lib/chat/timeline/tool-phrases';
30
31
 
31
32
  /** Question sent when a question arrived carrying only images. */
@@ -152,7 +153,10 @@ export function useBtwMode(sessionId: string | null): BtwMode {
152
153
  setOpen(false);
153
154
  setSelectedTopicId(null);
154
155
  setSearchParams((prev) => {
155
- const next = new URLSearchParams(prev);
156
+ // The promoted topic is a real session, not the draft whose branch hints
157
+ // may still be in the URL (a backed-out fork) — they would describe it as
158
+ // a fork of another chat.
159
+ const next = clearBranchParams(prev);
156
160
  next.set('sessionId', created);
157
161
  if (next.has('subagent')) next.delete('subagent');
158
162
  return next;
@@ -22,6 +22,7 @@
22
22
 
23
23
  import { useCallback, useEffect, useMemo, useRef, useState } from 'preact/hooks';
24
24
  import { useSearchParams } from '@/client/lib/router/search-params';
25
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
25
26
  import { DEFAULT_SESSION_SORT_OPTION, isValidSessionSortOption, sortFolders } from '@/shared/lib/workspace/sidebar-sort';
26
27
  import { useSessionStatusAck } from '@/client/hooks/chat/omp/session-statuses';
27
28
  import { useSidebarData } from '@/client/hooks/chat/omp/session-list';
@@ -250,10 +251,15 @@ export function useSessionSidebarController(
250
251
  onSelectSession(id);
251
252
  } else {
252
253
  setSearchParams(prev => {
253
- prev.set('sessionId', id.toString());
254
+ // The branch hints belong to a PENDING draft's URL. Selecting a real
255
+ // session must not leave them behind: they would describe this chat as
256
+ // a fork of another, and the next New Session would inherit the source
257
+ // transcript the user already backed out of.
258
+ const next = clearBranchParams(prev);
259
+ next.set('sessionId', id.toString());
254
260
  // Navigating away from a session must also exit its transcript view.
255
- if (prev.has('subagent')) prev.delete('subagent');
256
- return prev;
261
+ if (next.has('subagent')) next.delete('subagent');
262
+ return next;
257
263
  }, { replace: true });
258
264
  }
259
265
  onAfterSelect?.();
@@ -0,0 +1,31 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The changed-files setting's read rule: on unless the stored value is the
8
+ * literal `false`. A missing key (an install that predates the setting) and a
9
+ * malformed value both keep the list, because the list is the only place the
10
+ * transcript says which files a run touched.
11
+ */
12
+
13
+ import { describe, expect, test } from 'bun:test';
14
+ import { primeKabmoSettings } from '@/shared/lib/settings/client';
15
+ import { currentShowChangedFiles } from '@/client/hooks/chat/timeline/changed-files-setting';
16
+
17
+ describe('currentShowChangedFiles', () => {
18
+ test('defaults on, and only the literal false turns it off', () => {
19
+ primeKabmoSettings({});
20
+ expect(currentShowChangedFiles()).toBe(true);
21
+
22
+ primeKabmoSettings({ showChangedFiles: false });
23
+ expect(currentShowChangedFiles()).toBe(false);
24
+
25
+ primeKabmoSettings({ showChangedFiles: true });
26
+ expect(currentShowChangedFiles()).toBe(true);
27
+
28
+ primeKabmoSettings({ showChangedFiles: 'no' });
29
+ expect(currentShowChangedFiles()).toBe(true);
30
+ });
31
+ });
@@ -0,0 +1,60 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The one reader/writer of the transcript's "N files changed" list.
8
+ *
9
+ * The list is a Preact subtree, so something in JavaScript must re-render when
10
+ * the setting moves. The settings modal calls {@link applyShowChangedFiles},
11
+ * which announces {@link CHANGED_FILES_CHANGED_EVENT}; {@link useShowChangedFiles}
12
+ * is the single subscriber, and the timeline is the only consumer.
13
+ *
14
+ * The initial value comes from the primed settings snapshot
15
+ * (`primeKabmoSettings` in `main.tsx`), so a mounted timeline draws the stored
16
+ * choice on its first render — no flash of the default.
17
+ */
18
+
19
+ import { useState } from 'preact/hooks';
20
+ import { readKabmoSetting } from '@/shared/lib/settings/client';
21
+ import { useKabmoEvent } from '@/client/hooks/ui/window-event';
22
+ import type { SettingsState } from '@/shared/types';
23
+
24
+ /**
25
+ * `app_settings` key holding the choice (in the `kabmo_settings` blob).
26
+ *
27
+ * `satisfies keyof SettingsState` because the key and the field name must be
28
+ * the same string for persistence to work at all — renaming the field without
29
+ * this line would leave the setting silently unsaved.
30
+ */
31
+ export const CHANGED_FILES_SETTING_KEY = 'showChangedFiles' satisfies keyof SettingsState;
32
+
33
+ /** Window event carrying the resolved boolean as `detail`. */
34
+ export const CHANGED_FILES_CHANGED_EVENT = 'omp:changed-files-changed';
35
+
36
+ /** The stored choice; only the literal `false` turns the list off. */
37
+ export function currentShowChangedFiles(appSettings?: Record<string, any>): boolean {
38
+ return readKabmoSetting<unknown>(CHANGED_FILES_SETTING_KEY, appSettings) !== false;
39
+ }
40
+
41
+ /**
42
+ * Announce a new choice. Called by the settings modal when the value changes —
43
+ * the persisted copy is written by the modal's own `writeKabmoSettings`, so
44
+ * this function only has to make the open timeline re-render.
45
+ */
46
+ export function applyShowChangedFiles(value: unknown): void {
47
+ if (typeof window === 'undefined') return;
48
+ window.dispatchEvent(
49
+ new CustomEvent(CHANGED_FILES_CHANGED_EVENT, { detail: value !== false }),
50
+ );
51
+ }
52
+
53
+ /** Whether the transcript should draw the list, kept live across settings edits. */
54
+ export function useShowChangedFiles(): boolean {
55
+ const [show, setShow] = useState<boolean>(() => currentShowChangedFiles());
56
+ useKabmoEvent(CHANGED_FILES_CHANGED_EVENT, (event) => {
57
+ setShow((event as CustomEvent<unknown>).detail !== false);
58
+ });
59
+ return show;
60
+ }
@@ -25,6 +25,7 @@ import { useCallback, useEffect, useRef } from 'preact/hooks';
25
25
  import type { Dispatch, SetStateAction } from 'preact/compat';
26
26
  import type { Attachment, ChatMessageData, PromptDispatchResult, WorkspaceFolderData } from '@/shared/types';
27
27
  import type { SetSearchParams } from '@/client/lib/router/search-params';
28
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
28
29
  import { activeProjectForSession } from '@/shared/lib/workspace/active-project';
29
30
  import { startPendingSession, patchPendingEntry } from '@/client/hooks/chat/omp/pending-sessions';
30
31
  import { setHarnessPick } from '@/client/hooks/chat/timeline/session-harness';
@@ -82,7 +83,9 @@ export function useNewChatSubmit(
82
83
  }
83
84
  parkedRef.current = { pendingId, text, attachments, ...(harness ? { harness } : {}) };
84
85
  setSearchParams((prev) => {
85
- const next = new URLSearchParams(prev);
86
+ // New Chat starts a top-level chat: a fork that was backed out of left
87
+ // `forkFrom`/`forkAt` in the URL, and this chat would be drawn as it.
88
+ const next = clearBranchParams(prev);
86
89
  next.set('sessionId', pendingId);
87
90
  // Carry the workspace the chat was started from: the first send SPAWNS a
88
91
  // real omp session in that folder's cwd, and a dialog opened from a
@@ -20,6 +20,7 @@ import type { Attachment, ChatMessageData, PromptDispatchResult } from '@/shared
20
20
  import type { ArmedGoal } from '@/shared/lib/omp/mode/actions';
21
21
  import type { ChatTimelineSendDeps } from '@/client/hooks/chat/timeline/send-props';
22
22
  import { adoptPendingSession, pendingEntryFor } from '@/client/hooks/chat/omp/pending-sessions';
23
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
23
24
  import { recordSpawnHarness } from '@/client/hooks/chat/timeline/spawn-harness';
24
25
  import { childSpawnBody } from '@/client/hooks/chat/timeline/child-spawn';
25
26
  import { forkRequestBody } from '@/client/hooks/chat/timeline/fork-request';
@@ -184,11 +185,8 @@ export async function dispatchPendingChat(
184
185
  deps.pendingHarnessRef.current = null;
185
186
  persistUserTurn(body.sessionId, input.newUserMsg);
186
187
  deps.setSearchParams((prev) => {
187
- const next = new URLSearchParams(prev);
188
+ const next = clearBranchParams(prev);
188
189
  next.set('sessionId', body.sessionId!);
189
- next.delete('forkFrom');
190
- next.delete('forkAt');
191
- next.delete('parentSessionId');
192
190
  return next;
193
191
  }, { replace: true });
194
192
  prependInheritedHistory(
@@ -243,11 +241,10 @@ export async function dispatchPendingChat(
243
241
  deps.pendingHarnessRef.current = null;
244
242
  persistUserTurn(body.sessionId, input.newUserMsg);
245
243
  deps.setSearchParams((prev) => {
246
- const next = new URLSearchParams(prev);
244
+ // The branch hints belonged to the pending chat; a real session's URL must
245
+ // not keep them, or the next draft opened here is read as this branch.
246
+ const next = clearBranchParams(prev);
247
247
  next.set('sessionId', body.sessionId!);
248
- // The parameter belonged to the pending chat; a real session's URL must
249
- // not keep a stale parent hint for a later pending chat.
250
- next.delete('parentSessionId');
251
248
  return next;
252
249
  }, { replace: true });
253
250
  return { ok: true, busy: false };
@@ -292,9 +289,8 @@ export async function dispatchPendingChat(
292
289
  deps.pendingHarnessRef.current = null;
293
290
  persistUserTurn(session.sessionId, input.newUserMsg);
294
291
  deps.setSearchParams((prev) => {
295
- const next = new URLSearchParams(prev);
292
+ const next = clearBranchParams(prev);
296
293
  next.set('sessionId', session.sessionId);
297
- next.delete('parentSessionId');
298
294
  return next;
299
295
  }, { replace: true });
300
296
  return { ok: true, busy: false };
@@ -0,0 +1,51 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The session's agent change journal, for the chat's per-run file list.
8
+ *
9
+ * Read once per settled run: the journal is written while the agent works, so
10
+ * asking mid-run would show a partial list that then changes under the reader.
11
+ * A failed read keeps the previous list — a transient 500 is not a reason to
12
+ * blank a summary the reader is looking at.
13
+ */
14
+
15
+ import { useEffect, useState } from 'preact/hooks';
16
+ import type { SessionChangeRecord } from '@/shared/types';
17
+
18
+ export function useSessionChanges(
19
+ sessionId: string | null,
20
+ isGenerating: boolean,
21
+ enabled = true,
22
+ ): SessionChangeRecord[] {
23
+ const [records, setRecords] = useState<SessionChangeRecord[]>([]);
24
+
25
+ useEffect(() => {
26
+ if (!enabled) {
27
+ setRecords([]);
28
+ return;
29
+ }
30
+ if (!sessionId) {
31
+ setRecords([]);
32
+ return;
33
+ }
34
+ if (isGenerating) return;
35
+ let cancelled = false;
36
+ void (async () => {
37
+ try {
38
+ const res = await fetch(`/api/sessions/${encodeURIComponent(sessionId)}/changes`);
39
+ const data = (await res.json().catch(() => null)) as { records?: SessionChangeRecord[] } | null;
40
+ if (!cancelled && Array.isArray(data?.records)) setRecords(data.records);
41
+ } catch {
42
+ // Keep the previous list.
43
+ }
44
+ })();
45
+ return () => {
46
+ cancelled = true;
47
+ };
48
+ }, [sessionId, isGenerating, enabled]);
49
+
50
+ return records;
51
+ }
@@ -25,6 +25,7 @@ import {
25
25
  import { markPendingSessionDraft, pendingSessionWait } from '@/client/hooks/chat/omp/pending-waiting';
26
26
  import { restoreHeldDraft } from '@/client/hooks/chat/waiting/restore';
27
27
  import { useSearchParams } from '@/client/lib/router/search-params';
28
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
28
29
  import type { ToastTone } from '@/shared/lib/ui/toast-duration';
29
30
 
30
31
  export interface WaitingDispatchOptions {
@@ -74,7 +75,9 @@ export function useWaitingDispatch({ onNotice }: WaitingDispatchOptions = {}): v
74
75
  // while the dispatch happened elsewhere.
75
76
  setSearchParams((prev) => {
76
77
  if (prev.get('sessionId') !== pendingId) return prev;
77
- const next = new URLSearchParams(prev);
78
+ // The real session now owns this chat; the draft's branch hints do
79
+ // not belong to it (its fork/child edge is already in the store).
80
+ const next = clearBranchParams(prev);
78
81
  next.set('sessionId', prompt.sessionId as string);
79
82
  return next;
80
83
  }, { replace: true });
@@ -115,6 +115,9 @@ describe('useNotificationEvents', () => {
115
115
  params: {
116
116
  title: 'Fix the build',
117
117
  body: 'The run ended with error',
118
+ // The shell picks its chime from this: `ask` is the attention cue, the
119
+ // others the completion chime.
120
+ kind: 'error',
118
121
  tag: 'error:s-1',
119
122
  sessionId: 's-1',
120
123
  // The event's own moment travels with it: a banner delivered later must
@@ -44,12 +44,14 @@ export function useNotificationEvents(): void {
44
44
  const event = asNotificationEvent(frame.payload);
45
45
  if (!event) return;
46
46
  // The chime is its own preference and plays for an ask regardless of
47
- // whether this device is allowed a system banner.
47
+ // whether this device is allowed a system banner; inside a shell the
48
+ // banner plays it instead (see `native-banner-sound`).
48
49
  if (event.kind === 'ask') triggerInputRequiredSound();
49
50
  if (!isNotificationPlatformEnabled(notificationPlatformForClient())) return;
50
51
  void showOsNotification({
51
52
  title: event.title,
52
53
  body: event.body,
54
+ kind: event.kind,
53
55
  tag: notificationTag(event),
54
56
  sessionId: event.sessionId,
55
57
  at: event.at,
@@ -1,5 +1,6 @@
1
1
  import { useCallback } from 'preact/hooks';
2
2
  import { readKabmoSetting } from '@/shared/lib/settings/client';
3
+ import { nativeBannerPlaysSound } from '@/client/lib/notifications/native-banner-sound';
3
4
 
4
5
  interface WebkitWindow extends Window {
5
6
  webkitAudioContext?: typeof AudioContext;
@@ -138,22 +139,28 @@ export function isChatSoundEnabled(appSettings?: Record<string, any>): boolean {
138
139
 
139
140
  /**
140
141
  * Triggers the completion notification sound if the user setting is enabled.
142
+ *
143
+ * Silent inside a shell: its banner plays the same chime, and playing both is
144
+ * the double sound this design removes.
141
145
  */
142
146
  export function triggerChatCompletionSound(appSettings?: Record<string, any>) {
143
- if (isChatSoundEnabled(appSettings)) {
144
- playNotificationSound();
145
- }
147
+ if (!isChatSoundEnabled(appSettings)) return;
148
+ if (nativeBannerPlaysSound('finish', appSettings)) return;
149
+ playNotificationSound();
146
150
  }
147
151
 
148
152
  /**
149
153
  * Triggers the input-required cue, gated by the same notification preference as
150
154
  * the completion chime. Reads settings from the primed snapshot: the alert fires
151
155
  * from the app-wide session list, which has no settings props to thread.
156
+ *
157
+ * Silent inside a shell, like the completion chime — the shell's banner plays
158
+ * the attention cue instead.
152
159
  */
153
160
  export function triggerInputRequiredSound() {
154
- if (isChatSoundEnabled()) {
155
- playInputRequiredSound();
156
- }
161
+ if (!isChatSoundEnabled()) return;
162
+ if (nativeBannerPlaysSound('ask')) return;
163
+ playInputRequiredSound();
157
164
  }
158
165
 
159
166
  export function useNotificationSound() {
@@ -38,6 +38,7 @@ afterEach(() => {
38
38
  jest.useRealTimers();
39
39
  FakeAudioContext.instances.length = 0;
40
40
  (win as unknown as Record<string, unknown>).AudioContext = FakeAudioContext;
41
+ delete window.__kabmoCall;
41
42
  });
42
43
  /** The alert mounts the real hook, so every constructed context is a cue. */
43
44
 
@@ -241,6 +242,20 @@ describe('isChatSoundEnabled', () => {
241
242
  triggerChatCompletionSound();
242
243
  expect(FakeAudioContext.instances).toHaveLength(1);
243
244
  });
245
+
246
+ test('inside a shell the banner plays the chime instead', () => {
247
+ window.__kabmoCall = () => Promise.resolve(null);
248
+ primeKabmoSettings({ chatCompletionSound: true, notifyOnFinish: true });
249
+
250
+ triggerChatCompletionSound();
251
+ expect(FakeAudioContext.instances).toEqual([]);
252
+
253
+ // The same setting with the shell's banner switched off: nothing else is
254
+ // making sound, so the page must.
255
+ primeKabmoSettings({ chatCompletionSound: true, notifyOnFinish: false });
256
+ triggerChatCompletionSound();
257
+ expect(FakeAudioContext.instances).toHaveLength(1);
258
+ });
244
259
  });
245
260
 
246
261
  /** The snapshot and the DOM globals are module/global state shared across the whole `bun test` process. */
@@ -22,6 +22,7 @@
22
22
 
23
23
  import { useCallback, useState } from 'preact/hooks';
24
24
  import { useSearchParams } from '@/client/lib/router/search-params';
25
+ import { clearBranchParams } from '@/client/lib/router/branch-params';
25
26
  import { forgetSession } from '@/shared/lib/workspace/session-state/store';
26
27
  import {
27
28
  deleteSessionsBatch,
@@ -74,7 +75,10 @@ export function useBatchDeleteRun(refresh: () => void): BatchDeleteRun {
74
75
  const openSession = searchParams.get('sessionId');
75
76
  if (openSession && result.removed.includes(openSession)) {
76
77
  setSearchParams((prev) => {
77
- const next = new URLSearchParams(prev);
78
+ // A pending draft's branch hints belong to a chat that no longer
79
+ // exists: the landing page would otherwise draw the forked source's
80
+ // transcript above an empty composer.
81
+ const next = clearBranchParams(prev);
78
82
  next.delete('sessionId');
79
83
  next.delete('subagent');
80
84
  return next;
@@ -6,6 +6,12 @@ interface UseFileDiffOptions {
6
6
  isStaged: boolean;
7
7
  repo: string;
8
8
  root?: string;
9
+ /**
10
+ * Whether this hook owns the read. A journal diff tab passes `false`: its two
11
+ * sides come from the session's change journal, and a git read would be a
12
+ * second, wrong answer for the same panel.
13
+ */
14
+ enabled?: boolean;
9
15
  }
10
16
 
11
17
  export interface FileDiffState {
@@ -33,7 +39,7 @@ export interface FileDiffState {
33
39
  * earlier read overwriting a newer one, and a dependency on the staged/status
34
40
  * copies re-keying the callback and firing a fetch per render.
35
41
  */
36
- export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileDiffOptions): FileDiffState {
42
+ export function useFileDiff({ filePath, status, isStaged, repo, root, enabled = true }: UseFileDiffOptions): FileDiffState {
37
43
  const [rawDiff, setRawDiff] = useState<string>('');
38
44
  const [oldContent, setOldContent] = useState<string>('');
39
45
  const [newContent, setNewContent] = useState<string>('');
@@ -53,7 +59,7 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
53
59
  const fetchSeqRef = useRef(0);
54
60
 
55
61
  const fetchDiff = useCallback(async (overrides: { staged?: boolean; status?: string } = {}) => {
56
- if (!filePath) return;
62
+ if (!enabled || !filePath) return;
57
63
  const seq = ++fetchSeqRef.current;
58
64
  setIsLoading(true);
59
65
  setErrorMessage(null);
@@ -109,7 +115,7 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
109
115
  } finally {
110
116
  if (seq === fetchSeqRef.current) setIsLoading(false);
111
117
  }
112
- }, [filePath, repo, root]);
118
+ }, [filePath, repo, root, enabled]);
113
119
 
114
120
  /**
115
121
  * The read is keyed on the pair the caller asked for, not only on the path.
@@ -121,12 +127,13 @@ export function useFileDiff({ filePath, status, isStaged, repo, root }: UseFileD
121
127
  * seeded first: `fetchDiff` reads them, and the state copies lag a render.
122
128
  */
123
129
  useEffect(() => {
130
+ if (!enabled) return;
124
131
  stagedRef.current = isStaged;
125
132
  statusRef.current = status;
126
133
  setCurrentStatus(status);
127
134
  setCurrentStaged(isStaged);
128
135
  void fetchDiff();
129
- }, [fetchDiff, isStaged, status]);
136
+ }, [fetchDiff, isStaged, status, enabled]);
130
137
 
131
138
  const adoptState = useCallback((next: { staged?: boolean; status?: string }) => {
132
139
  if (typeof next.staged === 'boolean') {
@@ -2,14 +2,14 @@ import { useCallback, useEffect, useRef } from 'preact/hooks';
2
2
  import { useSessionState } from '@/client/hooks/workspace/session-state';
3
3
  import { useSessionStateContext } from '@/client/hooks/workspace/session-state/context';
4
4
  import { useKabmoEvent } from '@/client/hooks/ui/window-event';
5
- import { diffTabId, diffTabName, fileTabId } from '@/shared/lib/workspace/file-tab-id';
5
+ import { diffTabId, diffTabName, fileTabId, journalDiffTabId } from '@/shared/lib/workspace/file-tab-id';
6
6
  import { getSessionValue, setSessionKey } from '@/shared/lib/workspace/session-state/store';
7
7
  import {
8
8
  SCROLL_POSITIONS_KEY,
9
9
  dropScrollPosition,
10
10
  type ScrollPositions,
11
11
  } from '@/shared/lib/workspace/scroll-positions';
12
- import type { OpenedFile } from '@/shared/types/fs';
12
+ import type { JournalDiffRef, OpenedFile } from '@/shared/types/fs';
13
13
 
14
14
  export interface OpenFileInput {
15
15
  id?: number | string;
@@ -135,10 +135,16 @@ export function useFileTabs(
135
135
  status?: string;
136
136
  repo?: string;
137
137
  root?: string;
138
+ /** `journal` reads the agent's own before/after snapshots, not the worktree. */
139
+ source?: 'journal';
140
+ journal?: JournalDiffRef;
138
141
  }) => {
139
142
  const rawPath = diffInfo.file.replace(/^\/+/, '');
140
143
  const isStaged = Boolean(diffInfo.staged);
141
- const diffId = diffTabId(rawPath, isStaged);
144
+ const journal = diffInfo.source === 'journal' ? diffInfo.journal : undefined;
145
+ const diffId = journal
146
+ ? journalDiffTabId(journal.path, journal.from, journal.to)
147
+ : diffTabId(rawPath, isStaged);
142
148
 
143
149
  const diffEntry: OpenedFile = {
144
150
  id: diffId,
@@ -149,11 +155,12 @@ export function useFileTabs(
149
155
  diffStaged: isStaged,
150
156
  repo: diffInfo.repo || '.',
151
157
  root: diffInfo.root ?? activeProjectPath ?? undefined,
158
+ ...(journal ? { diffSource: 'journal' as const, journalDiff: journal } : {}),
152
159
  };
153
160
 
154
161
  setOpenedFiles(prev => {
155
162
  const existing = prev.find(
156
- f => f.id === diffId || (f.isDiff && f.path === rawPath && f.diffStaged === isStaged)
163
+ f => f.id === diffId || (!journal && f.isDiff && f.path === rawPath && f.diffStaged === isStaged)
157
164
  );
158
165
  if (existing) {
159
166
  setActiveFileId(existing.id);
@@ -289,6 +296,8 @@ export function useFileTabs(
289
296
  status?: string;
290
297
  repo?: string;
291
298
  root?: string;
299
+ source?: 'journal';
300
+ journal?: JournalDiffRef;
292
301
  }>;
293
302
  if (!customEvent.detail || !customEvent.detail.file) return;
294
303
  handleOpenDiff(customEvent.detail);