@kabmo-labs/kabmo 0.32.1 → 0.34.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 (334) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +805 -637
  3. package/dist/client/static/js/{CsvGrid-4gx0jevc.js → CsvGrid-vze4m5ag.js} +2 -2
  4. package/dist/client/static/js/{DocxView-0667nr8h.js → DocxView-jbf21gmh.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-522v0d0r.js → DrawioView-b52qybx5.js} +2 -2
  6. package/dist/client/static/js/{ImageView-t8xp60hm.js → ImageView-mdgzj8px.js} +1 -1
  7. package/dist/client/static/js/LayoutWrapper-3c49dvtt.js +2 -0
  8. package/dist/client/static/js/Modal-sqp864vd.js +38 -0
  9. package/dist/client/static/js/{PdfView-3fx172xh.js → PdfView-g06rxqb1.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-n3agmf5t.js → SessionsView-521adxyr.js} +1 -1
  11. package/dist/client/static/js/{SheetView-nmrdb1b8.js → SheetView-h8xmsz7q.js} +22 -22
  12. package/dist/client/static/js/{SvgPreview-0xsc6xam.js → SvgPreview-1j4jvcvz.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-jj31rs62.js → abnfDiagram-O67JEVCF-pasxh4b6.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-fc9kmq1w.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-ay3yr7pf.js → architectureDiagram-NJMV4G6O-ms14g0bm.js} +4 -4
  16. package/dist/client/static/js/{astro-qgx1r159.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-4x33e16k.js → blockDiagram-BEXU5L5S-ycn78fcq.js} +4 -4
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-dtb81cgz.js → c4Diagram-YGBWAQC7-vn2gpjfm.js} +5 -5
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-vk5a2n9w.js → classDiagram-v2-NBCMYWYE-fyrm1pr5.js} +5 -5
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-6rbjbe19.js → cose-bilkent-JH36ORCC-ea5nwvgq.js} +1 -1
  22. package/dist/client/static/js/css-6vj0d308.js +1 -0
  23. package/dist/client/static/js/cynefin-OW5HDTMX-a4t8992q.js +1 -0
  24. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-vyjksedr.js → cynefinDiagram-VND7K2PF-j6bsjpre.js} +2 -2
  25. package/dist/client/static/js/{dagre-6A5THRUB-7hey38z5.js → dagre-6A5THRUB-4smdkwv8.js} +2 -2
  26. package/dist/client/static/js/{diagram-22UHCM2B-aes06jde.js → diagram-22UHCM2B-9sm4kqwc.js} +19 -19
  27. package/dist/client/static/js/{diagram-3UASUU5V-3cfkgm3x.js → diagram-3UASUU5V-2h3qxaed.js} +1 -1
  28. package/dist/client/static/js/{diagram-ATOU4E4O-z8mfhwpy.js → diagram-ATOU4E4O-1981bc94.js} +3 -3
  29. package/dist/client/static/js/{diagram-CDSNMT55-t4821ctz.js → diagram-CDSNMT55-3vgsxavc.js} +5 -5
  30. package/dist/client/static/js/{diagram-MLGK6HIB-23yxbfrx.js → diagram-MLGK6HIB-c9gf2r3f.js} +2 -2
  31. package/dist/client/static/js/{diagram-MPIPVDR6-chhtf7v0.js → diagram-MPIPVDR6-gjqeq92d.js} +2 -2
  32. package/dist/client/static/js/{dockerfile-5b87ghm7.js → dockerfile-8v935dkn.js} +1 -1
  33. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-9jejcvfr.js → ebnfDiagram-ZINNZB2B-4vbsgh99.js} +1 -1
  34. package/dist/client/static/js/{elixir-rpa1g4gy.js → elixir-vcbg60wv.js} +1 -1
  35. package/dist/client/static/js/{elk-276RUBZZ-xhhtkf58.js → elk-276RUBZZ-nca3t891.js} +1 -1
  36. package/dist/client/static/js/{erDiagram-OPXOYQCR-mt2apjjb.js → erDiagram-OPXOYQCR-5kfkev03.js} +6 -6
  37. package/dist/client/static/js/{erlang-6m6tpt72.js → erlang-qt876zrq.js} +1 -1
  38. package/dist/client/static/js/eventmodeling-NTZA5JFV-18bdrkv5.js +1 -0
  39. package/dist/client/static/js/flowDiagram-KWPJA3E3-fg0yqx0h.js +1 -0
  40. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-8cm7a29w.js → ganttDiagram-FUAMR5RP-mxc73wmq.js} +3 -3
  41. package/dist/client/static/js/gitGraph-4MIJSDKK-8fa6y40p.js +1 -0
  42. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-5s0gbnx2.js → gitGraphDiagram-X574FWY7-7en3ag0e.js} +12 -12
  43. package/dist/client/static/js/graphql-n43pd5fs.js +1 -0
  44. package/dist/client/static/js/html-dbrwss36.js +1 -0
  45. package/dist/client/static/js/{index-ye3sr7db.js → index-0vm41je9.js} +4 -4
  46. package/dist/client/static/js/{index-5y7c62sm.js → index-1b0t1428.js} +5 -5
  47. package/dist/client/static/js/{index-9sd0vjmh.js → index-1ksg88qf.js} +2 -2
  48. package/dist/client/static/js/{index-brj8qwa6.js → index-1y9r4frb.js} +2 -2
  49. package/dist/client/static/js/index-231241f4.js +12 -0
  50. package/dist/client/static/js/index-2mx9ej4k.css +1 -0
  51. package/dist/client/static/js/{index-6q80csr0.js → index-2svnq5gg.js} +1 -1
  52. package/dist/client/static/js/{index-dt7e1328.js → index-354mqqra.js} +2 -2
  53. package/dist/client/static/js/{index-532btjmp.js → index-3zc1b0dv.js} +2 -2
  54. package/dist/client/static/js/{index-h06bcfds.js → index-4g46wbdw.js} +1 -1
  55. package/dist/client/static/js/{index-p7btwjvj.js → index-4qwzxj81.js} +3 -3
  56. package/dist/client/static/js/{index-3vhznzgr.js → index-52rqxgya.js} +1 -1
  57. package/dist/client/static/js/index-6sf2vsp2.js +1 -0
  58. package/dist/client/static/js/{index-xya34x4v.js → index-76zb4m0n.js} +2 -2
  59. package/dist/client/static/js/{index-jz9fpznk.js → index-7a64yjrm.js} +6 -6
  60. package/dist/client/static/js/{index-2xj14800.js → index-7y6rpsrp.js} +2 -2
  61. package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
  62. package/dist/client/static/js/{index-ay34b398.js → index-a0fmsv1d.js} +19 -19
  63. package/dist/client/static/js/{index-2gfc25tq.js → index-ag2rmtas.js} +1 -1
  64. package/dist/client/static/js/{index-sa9cp6km.js → index-ahv9y42z.js} +2 -2
  65. package/dist/client/static/js/{index-g33knza2.js → index-b29afsjh.js} +1 -1
  66. package/dist/client/static/js/{index-629kfbcb.js → index-c3ek61zv.js} +2 -2
  67. package/dist/client/static/js/{index-360d7j0d.js → index-cd65zqba.js} +1 -1
  68. package/dist/client/static/js/{index-4s8ttfxj.js → index-cgzrpvzj.js} +211 -211
  69. package/dist/client/static/js/{index-gbfg0anm.js → index-dbe6afkf.js} +2 -2
  70. package/dist/client/static/js/{index-z4v1xmh1.js → index-ev3yt353.js} +2 -2
  71. package/dist/client/static/js/{index-ehcpzk5b.js → index-eyfcm0cy.js} +1 -1
  72. package/dist/client/static/js/{index-a733k69t.js → index-f7jhhqtk.js} +2 -2
  73. package/dist/client/static/js/{index-hc2jmzpx.js → index-fta1y9pc.js} +65 -65
  74. package/dist/client/static/js/{index-vd0e25p0.js → index-fvmfge3p.js} +1 -1
  75. package/dist/client/static/js/{index-a6k2hqke.js → index-g2dyfze9.js} +1 -1
  76. package/dist/client/static/js/index-h5bn97p6.js +2 -0
  77. package/dist/client/static/js/{index-7fdp9c7m.js → index-hf52f59k.js} +2 -2
  78. package/dist/client/static/js/{index-qkscve6n.js → index-j0r5hj0j.js} +2 -2
  79. package/dist/client/static/js/{index-ejgd8w3s.js → index-j51d5a5m.js} +28 -28
  80. package/dist/client/static/js/{index-kpspnztv.js → index-jsyekbx9.js} +2 -2
  81. package/dist/client/static/js/{index-a0bdavdr.js → index-km2zb6wk.js} +2 -2
  82. package/dist/client/static/js/{index-59jb53v3.js → index-nccwxv0s.js} +2 -2
  83. package/dist/client/static/js/{index-dnp07j57.js → index-p0nz38bm.js} +1 -1
  84. package/dist/client/static/js/{index-c0x6s6f7.js → index-pm6xxwz1.js} +2 -2
  85. package/dist/client/static/js/{index-5x95n3hx.js → index-ptcrwswj.js} +1 -1
  86. package/dist/client/static/js/{index-fdbfzshx.js → index-ptcwae2n.js} +2 -2
  87. package/dist/client/static/js/{index-h7pn9qw6.js → index-qckv9nte.js} +2 -2
  88. package/dist/client/static/js/{index-wzma5n54.js → index-r014brzs.js} +2 -2
  89. package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
  90. package/dist/client/static/js/{index-qnwqaczk.js → index-rs80cwsv.js} +3 -3
  91. package/dist/client/static/js/{index-pf5sbesf.js → index-rytaa8ca.js} +2 -2
  92. package/dist/client/static/js/{index-c93sp4yh.js → index-rzxcj7cg.js} +1 -1
  93. package/dist/client/static/js/{index-a293pdg7.js → index-s7gkkkyz.js} +2 -2
  94. package/dist/client/static/js/{index-7n68yx6m.js → index-sd66wv26.js} +2 -2
  95. package/dist/client/static/js/{index-bbggh3f8.js → index-vhqe0y82.js} +2 -2
  96. package/dist/client/static/js/{index-dq1kdt03.js → index-vy6termr.js} +1 -1
  97. package/dist/client/static/js/{index-pf7syd7t.js → index-xx6mqpxm.js} +3 -3
  98. package/dist/client/static/js/{index-z5s27s26.js → index-ybm2x4vh.js} +1 -1
  99. package/dist/client/static/js/{index-jppt5mgc.js → index-zvfvqvn9.js} +2 -2
  100. package/dist/client/static/js/info-A6RAGUB7-3hk844f7.js +1 -0
  101. package/dist/client/static/js/{infoDiagram-VRGFBTTK-3w1yz32c.js → infoDiagram-VRGFBTTK-sef80132.js} +2 -2
  102. package/dist/client/static/js/ini-j5dyq6gm.js +1 -0
  103. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-ckt471dy.js → ishikawaDiagram-OU5B5YK6-yhvepp1q.js} +6 -6
  104. package/dist/client/static/js/java-g4dgwbfd.js +1 -0
  105. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-kfvn4w7e.js → journeyDiagram-ZHPQQLJL-5w77y95w.js} +5 -5
  106. package/dist/client/static/js/jsx-7t5ecz9s.js +1 -0
  107. package/dist/client/static/js/{julia-0j0gsjvc.js → julia-d4j6wgvf.js} +1 -1
  108. package/dist/client/static/js/{kanban-definition-PNTS6WVX-0q36cm83.js → kanban-definition-PNTS6WVX-02znqtna.js} +6 -6
  109. package/dist/client/static/js/lua-1g6w30de.js +1 -0
  110. package/dist/client/static/js/markdown-afx21x8c.js +1 -0
  111. package/dist/client/static/js/{mermaid.core-b1ssa824.js → mermaid.core-a6e6vck4.js} +6 -6
  112. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-e2ym5en8.js → mindmap-definition-NLK3R4M7-y4n74q9x.js} +8 -8
  113. package/dist/client/static/js/one-dark-pro-vwhfpzr8.js +1 -0
  114. package/dist/client/static/js/one-light-y5t9x6zh.js +1 -0
  115. package/dist/client/static/js/packet-AYTQ26CC-4nj2yy10.js +1 -0
  116. package/dist/client/static/js/{pegDiagram-GJSIUBJH-t8bbdyhe.js → pegDiagram-GJSIUBJH-pr7ehgzb.js} +1 -1
  117. package/dist/client/static/js/{perl-7n7e9ncg.js → perl-srptw5vm.js} +1 -1
  118. package/dist/client/static/js/{php-32vy69vd.js → php-n89g3fk7.js} +1 -1
  119. package/dist/client/static/js/pie-WAS4IAKB-k7rde3f9.js +1 -0
  120. package/dist/client/static/js/{pieDiagram-5QR66LMP-envv4brj.js → pieDiagram-5QR66LMP-39wpsk08.js} +2 -2
  121. package/dist/client/static/js/properties-thd83wey.js +1 -0
  122. package/dist/client/static/js/python-264ns4xw.js +1 -0
  123. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-72rk137a.js → quadrantDiagram-O4NWA36T-esm913km.js} +4 -4
  124. package/dist/client/static/js/r-qw82kkv9.js +1 -0
  125. package/dist/client/static/js/radar-RG4KPBEZ-513dpw4f.js +1 -0
  126. package/dist/client/static/js/railroad-74A4TZTK-9bqnst9c.js +1 -0
  127. package/dist/client/static/js/railroad-abnf-HS5TGJTU-7367d5bv.js +1 -0
  128. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-b806b1mj.js +1 -0
  129. package/dist/client/static/js/railroad-peg-WCYAUIDC-5a67rwf8.js +1 -0
  130. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-1ej0f5hr.js → railroadDiagram-XR7U4H2S-wy2mgya6.js} +1 -1
  131. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-rvdaknpd.js → requirementDiagram-PLB6GJNP-6z9xdgbq.js} +4 -4
  132. package/dist/client/static/js/{ruby-5ty7fys7.js → ruby-r81ytgcm.js} +1 -1
  133. package/dist/client/static/js/{rust-2geezrcs.js → rust-frn3szvc.js} +1 -1
  134. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-nxvhtdaw.js → sankeyDiagram-IPEJSGJF-rtmxk3ys.js} +5 -5
  135. package/dist/client/static/js/{sass-mey5150f.js → sass-9bxped7y.js} +1 -1
  136. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-n5cn5qrt.js → sequenceDiagram-PO4LG4MO-awzcrafg.js} +18 -18
  137. package/dist/client/static/js/{sizeCapture-INFHLROL-r074kj7s.js → sizeCapture-INFHLROL-03gy196j.js} +1 -1
  138. package/dist/client/static/js/sql-0e9mnrda.js +1 -0
  139. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-vxghxdb0.js → stateDiagram-v2-GCMORJYK-an8v3q5n.js} +3 -3
  140. package/dist/client/static/js/{svelte-3ewx0hzx.js → svelte-mwtx07d9.js} +1 -1
  141. package/dist/client/static/js/{swimlanes-2SLR337P-qkkv894p.js → swimlanes-2SLR337P-n9yb4wcs.js} +1 -1
  142. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-nx5nfnf0.js +8 -0
  143. package/dist/client/static/js/{timeline-definition-EJHVYXUP-5tbq4ex2.js → timeline-definition-EJHVYXUP-jceb575g.js} +4 -4
  144. package/dist/client/static/js/treeView-Q6P3EWNA-kcy40evb.js +1 -0
  145. package/dist/client/static/js/treemap-WGGIJYW6-fsrvqxf4.js +1 -0
  146. package/dist/client/static/js/tsx-nm94hed6.js +1 -0
  147. package/dist/client/static/js/typescript-0s2t05jj.js +1 -0
  148. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-6p8hf0b7.js → usecaseDiagram-POWQR4AR-888h3100.js} +39 -39
  149. package/dist/client/static/js/vennDiagram-UO4OBE2U-wbfz0rzv.js +34 -0
  150. package/dist/client/static/js/{vue-06rdf4wh.js → vue-c0rtg1wf.js} +1 -1
  151. package/dist/client/static/js/wardley-WFR3VGLG-36dmxww4.js +1 -0
  152. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-km2x4er8.js → wardleyDiagram-VNRHLVJA-rn8c5qf9.js} +4 -4
  153. package/dist/client/static/js/xml-dz51p1m3.js +1 -0
  154. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-kr3sgr4m.js → xychartDiagram-PMCCYNJV-8sn1apt6.js} +5 -5
  155. package/dist/client/static/js/yaml-2cfkd30t.js +1 -0
  156. package/package.json +4 -1
  157. package/src/client/components/auth/login-screen/index.tsx +1 -0
  158. package/src/client/components/common/MarkdownRenderer.tsx +9 -12
  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/mobile/LayoutWrapper.tsx +12 -3
  166. package/src/client/components/mobile/mobile-right-sidebar/FullDiff.tsx +9 -2
  167. package/src/client/components/settings/Modal.tsx +14 -84
  168. package/src/client/components/settings/Sidebar.tsx +3 -1
  169. package/src/client/components/settings/apply-side-effects.test.ts +11 -0
  170. package/src/client/components/settings/apply-side-effects.ts +7 -0
  171. package/src/client/components/settings/categories/ChatSettings.test.tsx +1 -1
  172. package/src/client/components/settings/categories/ChatSettings.tsx +2 -0
  173. package/src/client/components/settings/categories/ConnectSettings.tsx +105 -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/settings/categories/connect-settings/DeviceTable.tsx +145 -0
  178. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +160 -0
  179. package/src/client/components/settings/categories/connect-settings/QrCode.tsx +73 -0
  180. package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
  181. package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
  182. package/src/client/components/settings/category-content.tsx +116 -0
  183. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
  184. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +137 -0
  185. package/src/client/components/workspace/chat-timeline/MessageList.tsx +33 -1
  186. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +22 -1
  187. package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +13 -0
  188. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  189. package/src/client/components/workspace/diff-panel/Toolbar.tsx +17 -51
  190. package/src/client/components/workspace/diff-panel/index.tsx +23 -4
  191. package/src/client/components/workspace/diff-panel/toolbar-git-actions.tsx +94 -0
  192. package/src/client/components/workspace/editor/Body.tsx +2 -0
  193. package/src/client/data/settings/omp-schema.json +73 -3
  194. package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
  195. package/src/client/hooks/chat/timeline/changed-files-setting.test.ts +31 -0
  196. package/src/client/hooks/chat/timeline/changed-files-setting.ts +60 -0
  197. package/src/client/hooks/chat/timeline/session-changes.ts +51 -0
  198. package/src/client/hooks/connect/use-connect-status.ts +116 -0
  199. package/src/client/hooks/connect/use-pairing.ts +100 -0
  200. package/src/client/hooks/ui/clipboard.ts +26 -0
  201. package/src/client/hooks/ui/notification-events.test.ts +3 -0
  202. package/src/client/hooks/ui/notification-events.ts +3 -1
  203. package/src/client/hooks/ui/notification-sound.ts +13 -6
  204. package/src/client/hooks/ui/ui-sounds.test.ts +15 -0
  205. package/src/client/hooks/workspace/diff-file.ts +11 -4
  206. package/src/client/hooks/workspace/file-tabs.ts +13 -4
  207. package/src/client/hooks/workspace/journal-diff.ts +97 -0
  208. package/src/client/lib/notifications/native-banner-sound.test.ts +93 -0
  209. package/src/client/lib/notifications/native-banner-sound.ts +46 -0
  210. package/src/client/lib/notifications/os.test.ts +14 -5
  211. package/src/client/lib/notifications/os.ts +8 -0
  212. package/src/client/tailwind.css +5 -0
  213. package/src/server/index.ts +2 -0
  214. package/src/server/lib/assets/font-css.server.test.ts +19 -0
  215. package/src/server/lib/auth/client-address.test.ts +58 -0
  216. package/src/server/lib/auth/client-address.ts +37 -3
  217. package/src/server/lib/auth/guard.ts +31 -4
  218. package/src/server/lib/auth/rate-limit.test.ts +25 -8
  219. package/src/server/lib/auth/rate-limit.ts +8 -5
  220. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
  221. package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
  222. package/src/server/lib/connect/cloudflared.server.ts +206 -0
  223. package/src/server/lib/connect/devices.server.ts +192 -0
  224. package/src/server/lib/connect/identity.server.ts +81 -0
  225. package/src/server/lib/connect/pairing.server.test.ts +56 -0
  226. package/src/server/lib/connect/pairing.server.ts +113 -0
  227. package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
  228. package/src/server/lib/connect/qr.server.ts +36 -0
  229. package/src/server/lib/connect/run.server.ts +101 -0
  230. package/src/server/lib/connect/status.server.ts +177 -0
  231. package/src/server/lib/connect/tailscale.server.test.ts +117 -0
  232. package/src/server/lib/connect/tailscale.server.ts +172 -0
  233. package/src/server/lib/db/schema.ts +4 -0
  234. package/src/server/lib/harness/launch-table.ts +10 -0
  235. package/src/server/lib/omp/session/changes.test.ts +201 -0
  236. package/src/server/lib/omp/session/changes.ts +313 -0
  237. package/src/server/lib/omp/session/session-discovery.test.ts +4 -4
  238. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +6 -2
  239. package/src/server/lib/omp/session/subagent-presence-scan.ts +54 -0
  240. package/src/server/lib/omp/session/subagent-presence-store.test.ts +1 -1
  241. package/src/server/lib/omp/session/subagent-presence.test.ts +115 -0
  242. package/src/server/lib/omp/session/subagent-presence.ts +12 -3
  243. package/src/server/lib/omp/session/telemetry/compute.ts +68 -0
  244. package/src/server/lib/omp/session/telemetry.test.ts +81 -0
  245. package/src/server/routes/connect/devices.ts +56 -0
  246. package/src/server/routes/connect/index.ts +15 -0
  247. package/src/server/routes/connect/pair-page.ts +177 -0
  248. package/src/server/routes/connect/pair.ts +158 -0
  249. package/src/server/routes/connect/status.ts +19 -0
  250. package/src/server/routes/connect/tunnels.ts +76 -0
  251. package/src/server/routes/health/probe.ts +5 -0
  252. package/src/server/routes/index.ts +2 -0
  253. package/src/server/routes/sessions/changes.test.ts +99 -0
  254. package/src/server/routes/sessions/changes.ts +79 -0
  255. package/src/server/routes/sessions/index.ts +7 -0
  256. package/src/shared/lib/chat/duration.ts +34 -0
  257. package/src/shared/lib/chat/timeline/changed-files.test.ts +121 -0
  258. package/src/shared/lib/chat/timeline/changed-files.ts +71 -0
  259. package/src/shared/lib/chat/timeline/fork-anchor.test.ts +3 -0
  260. package/src/shared/lib/connect/payload.test.ts +144 -0
  261. package/src/shared/lib/connect/payload.ts +229 -0
  262. package/src/shared/lib/connect/tier.test.ts +73 -0
  263. package/src/shared/lib/connect/tier.ts +105 -0
  264. package/src/shared/lib/connect/types.ts +99 -0
  265. package/src/shared/lib/format/duration.test.ts +31 -0
  266. package/src/shared/lib/format/duration.ts +27 -0
  267. package/src/shared/lib/fs/unified-diff.test.ts +53 -0
  268. package/src/shared/lib/fs/unified-diff.ts +127 -0
  269. package/src/shared/lib/harness/brand-color.ts +3 -0
  270. package/src/shared/lib/harness/catalog.test.ts +13 -0
  271. package/src/shared/lib/harness/catalog.ts +8 -1
  272. package/src/shared/lib/harness/fork.ts +4 -2
  273. package/src/shared/lib/harness/mcp-facts.ts +3 -0
  274. package/src/shared/lib/harness/provider-facts.ts +14 -0
  275. package/src/shared/lib/harness/updates.ts +5 -0
  276. package/src/shared/lib/icons/tint-hues.generated.ts +27 -27
  277. package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
  278. package/src/shared/lib/markdown/marked.ts +7 -4
  279. package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
  280. package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
  281. package/src/shared/lib/markdown/mermaid.ts +41 -7
  282. package/src/shared/lib/omp/config/schema.test.ts +4 -2
  283. package/src/shared/lib/settings/defaults.ts +1 -0
  284. package/src/shared/lib/settings/sections.ts +6 -1
  285. package/src/shared/lib/workspace/file-tab-id.ts +9 -0
  286. package/src/shared/types/context.ts +18 -0
  287. package/src/shared/types/fs.ts +21 -0
  288. package/src/shared/types/index.ts +1 -0
  289. package/src/shared/types/omp/session.ts +6 -0
  290. package/src/shared/types/session-changes.ts +64 -0
  291. package/src/shared/types/settings/state.ts +10 -0
  292. package/dist/client/static/js/LayoutWrapper-xjnveecv.js +0 -2
  293. package/dist/client/static/js/Modal-k2jr9hc4.js +0 -38
  294. package/dist/client/static/js/architecture-7GRP2DOG-1y9zvsyt.js +0 -1
  295. package/dist/client/static/js/bash-m0qjsyy0.js +0 -1
  296. package/dist/client/static/js/css-t4ngafan.js +0 -1
  297. package/dist/client/static/js/cynefin-OW5HDTMX-k2188qcq.js +0 -1
  298. package/dist/client/static/js/eventmodeling-NTZA5JFV-pdr0qn0n.js +0 -1
  299. package/dist/client/static/js/flowDiagram-KWPJA3E3-zvz0mxne.js +0 -1
  300. package/dist/client/static/js/gitGraph-4MIJSDKK-wmqf046s.js +0 -1
  301. package/dist/client/static/js/graphql-692h0n2x.js +0 -1
  302. package/dist/client/static/js/html-pv88ny12.js +0 -1
  303. package/dist/client/static/js/index-61tm0v57.js +0 -1
  304. package/dist/client/static/js/index-e94a1en0.css +0 -1
  305. package/dist/client/static/js/index-kg86e3sy.js +0 -12
  306. package/dist/client/static/js/index-nmmxb4va.js +0 -2
  307. package/dist/client/static/js/info-A6RAGUB7-zg3twte6.js +0 -1
  308. package/dist/client/static/js/ini-cg0a5wm3.js +0 -1
  309. package/dist/client/static/js/java-vcck089n.js +0 -1
  310. package/dist/client/static/js/jsx-ht9zyzwa.js +0 -1
  311. package/dist/client/static/js/lua-ke895s2q.js +0 -1
  312. package/dist/client/static/js/markdown-gwmsh53r.js +0 -1
  313. package/dist/client/static/js/one-dark-pro-4geyzhjj.js +0 -1
  314. package/dist/client/static/js/one-light-tqssjm9t.js +0 -1
  315. package/dist/client/static/js/packet-AYTQ26CC-3pav51g0.js +0 -1
  316. package/dist/client/static/js/pie-WAS4IAKB-wqfh7zdk.js +0 -1
  317. package/dist/client/static/js/properties-mzvvbqg5.js +0 -1
  318. package/dist/client/static/js/python-3w64wsyd.js +0 -1
  319. package/dist/client/static/js/r-32re2zwb.js +0 -1
  320. package/dist/client/static/js/radar-RG4KPBEZ-w7qjdr2g.js +0 -1
  321. package/dist/client/static/js/railroad-74A4TZTK-rhr99kkj.js +0 -1
  322. package/dist/client/static/js/railroad-abnf-HS5TGJTU-c4jeea3m.js +0 -1
  323. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-x2ee66ex.js +0 -1
  324. package/dist/client/static/js/railroad-peg-WCYAUIDC-yw8wjfwg.js +0 -1
  325. package/dist/client/static/js/sql-g8wcshpc.js +0 -1
  326. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-y81h9n27.js +0 -8
  327. package/dist/client/static/js/treeView-Q6P3EWNA-ekz05ccs.js +0 -1
  328. package/dist/client/static/js/treemap-WGGIJYW6-aq6qymjr.js +0 -1
  329. package/dist/client/static/js/tsx-0p183w2f.js +0 -1
  330. package/dist/client/static/js/typescript-t9a5jyvv.js +0 -1
  331. package/dist/client/static/js/vennDiagram-UO4OBE2U-7k5jsxf9.js +0 -34
  332. package/dist/client/static/js/wardley-WFR3VGLG-z34tj4y3.js +0 -1
  333. package/dist/client/static/js/xml-81hxjjt4.js +0 -1
  334. package/dist/client/static/js/yaml-yssayv8a.js +0 -1
@@ -0,0 +1,116 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Which page a settings category draws.
8
+ *
9
+ * Split out of `Modal.tsx` when that file reached the 350-line ceiling: the
10
+ * switch is a pure function of the category and a handful of callbacks, and
11
+ * keeping it beside the modal's own state made every new category a change to a
12
+ * file that also owns focus, search and the restart flow.
13
+ *
14
+ * The `default` branch is the harness pages: a single-harness category carries a
15
+ * dynamic id (`harness:claude`), so it cannot be a `case` here.
16
+ */
17
+
18
+ import type { SettingsCategoryId, SettingsState } from '@/shared/types';
19
+ import { harnessIdFromCategory } from '@/shared/lib/harness/menu';
20
+ import { AppearanceSettings } from '@/client/components/settings/categories/AppearanceSettings';
21
+ import { ChatSettings } from '@/client/components/settings/categories/ChatSettings';
22
+ import { KeyboardSettings } from '@/client/components/settings/categories/KeyboardSettings';
23
+ import { ProjectSettings } from '@/client/components/settings/categories/ProjectSettings';
24
+ import { ProviderSettings } from '@/client/components/settings/categories/ProviderSettings';
25
+ import { AgentSettings } from '@/client/components/settings/categories/AgentSettings';
26
+ import { BehaviorSettings } from '@/client/components/settings/categories/BehaviorSettings';
27
+ import { CommandSettings } from '@/client/components/settings/categories/CommandSettings';
28
+ import { McpSettings } from '@/client/components/settings/categories/McpSettings';
29
+ import { HarnessSettings } from '@/client/components/settings/categories/HarnessSettings';
30
+ import { SkillSettings } from '@/client/components/settings/categories/SkillSettings';
31
+ import { PluginSettings } from '@/client/components/settings/categories/PluginSettings';
32
+ import { PanelPluginSettings } from '@/client/components/settings/categories/PanelPluginSettings';
33
+ import { SkillCatalogSettings, type CatalogTab } from '@/client/components/settings/categories/SkillCatalogSettings';
34
+ import { OtherSettings } from '@/client/components/settings/categories/OtherSettings';
35
+ import { OmpSettings } from '@/client/components/settings/categories/OmpSettings';
36
+ import { TokenUsageSettings } from '@/client/components/settings/categories/TokenUsageSettings';
37
+ import { UsageSettings } from '@/client/components/settings/categories/UsageSettings';
38
+ import { NotificationSettings } from '@/client/components/settings/categories/NotificationSettings';
39
+ import { ConnectSettings } from '@/client/components/settings/categories/ConnectSettings';
40
+
41
+ export interface CategoryContentProps {
42
+ category: SettingsCategoryId;
43
+ settings: SettingsState;
44
+ onUpdate: (updater: Partial<SettingsState> | ((prev: SettingsState) => SettingsState)) => void;
45
+ /** The provider dialog was asked for by a caller, not by a click in the page. */
46
+ autoOpenAdd: boolean;
47
+ onAddModalClose: () => void;
48
+ /** Which catalog tab a navigation asked for; the catalog owns it once mounted. */
49
+ catalogTab: CatalogTab;
50
+ onNavigateToCatalog: (tab?: CatalogTab) => void;
51
+ }
52
+
53
+ export function CategoryContent({
54
+ category,
55
+ settings,
56
+ onUpdate,
57
+ autoOpenAdd,
58
+ onAddModalClose,
59
+ catalogTab,
60
+ onNavigateToCatalog,
61
+ }: CategoryContentProps) {
62
+ switch (category) {
63
+ case 'appearance':
64
+ return <AppearanceSettings settings={settings} onUpdate={onUpdate} />;
65
+ case 'chats':
66
+ return <ChatSettings settings={settings} onUpdate={onUpdate} />;
67
+ case 'keyboard':
68
+ return <KeyboardSettings settings={settings} onUpdate={onUpdate} />;
69
+ case 'projects':
70
+ return <ProjectSettings />;
71
+ case 'providers':
72
+ return <ProviderSettings autoOpenAdd={autoOpenAdd} onAddModalClose={onAddModalClose} />;
73
+ case 'agents':
74
+ return <AgentSettings settings={settings} onUpdate={onUpdate} />;
75
+ case 'harness-index':
76
+ return <HarnessSettings />;
77
+ case 'behavior':
78
+ return <BehaviorSettings />;
79
+ case 'commands':
80
+ return <CommandSettings settings={settings} onUpdate={onUpdate} />;
81
+ case 'mcp':
82
+ return <McpSettings settings={settings} onUpdate={onUpdate} />;
83
+ case 'token-usage':
84
+ return <TokenUsageSettings settings={settings} onUpdate={onUpdate} />;
85
+ case 'notifications':
86
+ return <NotificationSettings settings={settings} onUpdate={onUpdate} />;
87
+ case 'connect':
88
+ return <ConnectSettings />;
89
+ case 'plugins':
90
+ return <PluginSettings />;
91
+ case 'panel-plugins':
92
+ return <PanelPluginSettings />;
93
+ case 'skills':
94
+ return (
95
+ <SkillSettings
96
+ settings={settings}
97
+ onUpdate={onUpdate}
98
+ onNavigateToCatalog={onNavigateToCatalog}
99
+ />
100
+ );
101
+ case 'skills-catalog':
102
+ return <SkillCatalogSettings initialTab={catalogTab} />;
103
+ case 'omp':
104
+ return <OmpSettings settings={settings} onUpdate={onUpdate} />;
105
+ case 'usage':
106
+ return <UsageSettings />;
107
+ default: {
108
+ // A single harness page: its own card, verbatim — the same component the
109
+ // overview draws, because a second renderer for one agent is how the two
110
+ // views start disagreeing about what it can do.
111
+ const harnessId = harnessIdFromCategory(category);
112
+ if (harnessId) return <HarnessSettings only={harnessId} />;
113
+ return <OtherSettings category={category} />;
114
+ }
115
+ }
116
+ }
@@ -0,0 +1,120 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The run's changed-files summary.
8
+ *
9
+ * Two facts are pinned here because both were visible defects waiting to
10
+ * happen:
11
+ *
12
+ * - the frame sits on the transcript gutter. Desktop keeps `mx-3` so the box
13
+ * lines up with the tool cards above it; a phone has no gutter, because its
14
+ * container already is one (see `transcriptGutter`).
15
+ * - the `+`/`−` counts the server returns are printed per file and summed in
16
+ * the header. A path with no counts (an unstored blob) prints none, never a
17
+ * zero that claims the write changed nothing.
18
+ */
19
+
20
+ import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
21
+ import { Window } from 'happy-dom';
22
+ import { h, render } from 'preact';
23
+ import { act } from 'preact/test-utils';
24
+ import { ChangedFilesSummary } from '@/client/components/workspace/chat-timeline/ChangedFilesSummary';
25
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
26
+ import type { ChangedFile } from '@/shared/types';
27
+
28
+ const originalFetch = Bun.fetch;
29
+ let container: HTMLElement;
30
+
31
+ const FILES: ChangedFile[] = [
32
+ { path: '/repo/src/a.ts', displayPath: 'src/a.ts', status: 'modified', agent: 'Main' },
33
+ { path: '/repo/src/b.ts', displayPath: 'src/b.ts', status: 'added', agent: 'Main' },
34
+ ];
35
+
36
+ beforeAll(() => installDomGlobals(new Window({ url: 'http://localhost' })));
37
+ afterAll(() => restoreDomGlobals());
38
+
39
+ beforeEach(() => {
40
+ globalThis.fetch = (async () => Response.json({
41
+ files: {
42
+ '/repo/src/a.ts': { added: 3, removed: 1 },
43
+ '/repo/src/b.ts': { added: 4, removed: 0 },
44
+ },
45
+ })) as unknown as typeof fetch;
46
+ container = document.createElement('div');
47
+ document.body.appendChild(container);
48
+ });
49
+
50
+ afterEach(() => {
51
+ globalThis.fetch = originalFetch;
52
+ render(null, container);
53
+ container.remove();
54
+ });
55
+
56
+ async function paint(files: ChangedFile[], isMobile: boolean): Promise<HTMLElement> {
57
+ await act(async () => {
58
+ render(
59
+ h(ChangedFilesSummary, { files, sessionId: 's1', from: 1, to: 2, isMobile }),
60
+ container,
61
+ );
62
+ });
63
+ // The stats read resolves on a later task; let it land inside `act`.
64
+ await act(async () => {
65
+ const tick = Promise.withResolvers<void>();
66
+ setTimeout(tick.resolve, 0);
67
+ await tick.promise;
68
+ });
69
+ return container;
70
+ }
71
+
72
+ describe('ChangedFilesSummary', () => {
73
+ test('desktop keeps the transcript gutter, a phone does not', async () => {
74
+ const desktop = await paint(FILES, false);
75
+ const desktopBox = desktop.firstElementChild as HTMLElement;
76
+ expect(desktopBox.className).toContain('mx-3');
77
+
78
+ container.remove();
79
+ container = document.createElement('div');
80
+ document.body.appendChild(container);
81
+ const phone = await paint(FILES, true);
82
+ const phoneBox = phone.firstElementChild as HTMLElement;
83
+ expect(phoneBox.className).not.toContain('mx-3');
84
+ });
85
+
86
+ test('the header sums every file’s counts and each row prints its own', async () => {
87
+ const el = await paint(FILES, false);
88
+ const header = el.querySelector('button') as HTMLElement;
89
+ expect(header.textContent).toContain('2 files changed');
90
+ expect(header.textContent).toContain('+7');
91
+ expect(header.textContent).toContain('\u22121');
92
+
93
+ await act(async () => {
94
+ header.click();
95
+ });
96
+ const rows = el.querySelectorAll('li');
97
+ expect(rows.length).toBe(2);
98
+ expect(rows[0]?.textContent).toContain('+3');
99
+ expect(rows[0]?.textContent).toContain('\u22121');
100
+ expect(rows[1]?.textContent).toContain('+4');
101
+ expect(rows[1]?.textContent).not.toContain('\u22120');
102
+ });
103
+
104
+ test('a file the server could not count prints no stat', async () => {
105
+ globalThis.fetch = (async () => Response.json({
106
+ files: { '/repo/src/a.ts': { added: 2, removed: 0 } },
107
+ })) as unknown as typeof fetch;
108
+
109
+ const el = await paint(FILES, false);
110
+ const header = el.querySelector('button') as HTMLElement;
111
+ expect(header.textContent).toContain('+2');
112
+
113
+ await act(async () => {
114
+ header.click();
115
+ });
116
+ const rows = el.querySelectorAll('li');
117
+ expect(rows[1]?.textContent).not.toContain('+');
118
+ expect(rows[1]?.textContent).not.toContain('\u2212');
119
+ });
120
+ });
@@ -0,0 +1,137 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The collapsed "N files changed" row above a run's footer.
8
+ *
9
+ * The list is the agent's own change journal, bucketed into the run by
10
+ * `bucketChangesByRun`; clicking a file opens a diff tab whose two sides are
11
+ * the journal's before/after snapshots, not the worktree. That is the point:
12
+ * another agent or the user may have edited the file since, and the reader
13
+ * asked what THIS run did.
14
+ *
15
+ * The `+`/`−` counts come from `useChangeStats`, which reads the same net pair
16
+ * the diff tab shows, so the summary and the opened diff cannot disagree.
17
+ */
18
+
19
+ import { useMemo, useState } from 'preact/hooks';
20
+ import { ChevronDown, ChevronRight } from 'lucide-preact';
21
+ import { useChangeStats } from '@/client/hooks/chat/timeline/change-stats';
22
+ import { transcriptGutter } from '@/shared/lib/chat/timeline/gutter';
23
+ import type { ChangedFile } from '@/shared/types';
24
+
25
+ const STATUS_LABEL: Record<ChangedFile['status'], string> = {
26
+ added: 'A',
27
+ modified: 'M',
28
+ deleted: 'D',
29
+ };
30
+
31
+ const STATUS_CLASS: Record<ChangedFile['status'], string> = {
32
+ added: 'text-success',
33
+ modified: 'text-warning',
34
+ deleted: 'text-error',
35
+ };
36
+
37
+ interface ChangedFilesSummaryProps {
38
+ files: ChangedFile[];
39
+ sessionId: string;
40
+ /** Run window, epoch ms — the range the diff tab reads. */
41
+ from: number;
42
+ to: number;
43
+ isMobile?: boolean;
44
+ }
45
+
46
+ export function ChangedFilesSummary({
47
+ files,
48
+ sessionId,
49
+ from,
50
+ to,
51
+ isMobile = false,
52
+ }: ChangedFilesSummaryProps) {
53
+ const [expanded, setExpanded] = useState(false);
54
+ const stats = useChangeStats(sessionId, from, to);
55
+ const totals = useMemo(() => {
56
+ let added = 0;
57
+ let removed = 0;
58
+ for (const file of files) {
59
+ const counts = stats[file.path];
60
+ if (!counts) continue;
61
+ added += counts.added;
62
+ removed += counts.removed;
63
+ }
64
+ return { added, removed };
65
+ }, [files, stats]);
66
+
67
+ if (files.length === 0) return null;
68
+ const label = `${files.length} file${files.length === 1 ? '' : 's'} changed`;
69
+ const hasTotals = totals.added > 0 || totals.removed > 0;
70
+
71
+ return (
72
+ <div className={`${transcriptGutter(isMobile)} rounded-md border border-ink/10 bg-paper/60`}>
73
+ <button
74
+ type="button"
75
+ onClick={() => setExpanded((value) => !value)}
76
+ aria-expanded={expanded}
77
+ className="flex w-full items-center gap-1.5 px-2.5 py-1.5 text-left text-[11px] text-ink/70 hover:text-ink transition-colors cursor-pointer"
78
+ >
79
+ {expanded
80
+ ? <ChevronDown size={12} className="shrink-0" />
81
+ : <ChevronRight size={12} className="shrink-0" />}
82
+ <span className="font-medium">{label}</span>
83
+ {hasTotals && (
84
+ <span className="ml-auto flex shrink-0 items-center gap-1.5 font-mono text-[10px]">
85
+ {totals.added > 0 && <span className="text-success">+{totals.added}</span>}
86
+ {totals.removed > 0 && <span className="text-error">{'\u2212'}{totals.removed}</span>}
87
+ </span>
88
+ )}
89
+ </button>
90
+ {expanded && (
91
+ <ul className="border-t border-ink/10 py-0.5">
92
+ {files.map((file) => {
93
+ const counts = stats[file.path];
94
+ return (
95
+ <li key={file.path}>
96
+ <button
97
+ type="button"
98
+ onClick={() => openJournalDiff(file, sessionId, from, to)}
99
+ className="flex w-full items-center gap-2 px-2.5 py-1 text-left text-[11px] hover:bg-ink/[0.04] transition-colors cursor-pointer"
100
+ title={file.path}
101
+ >
102
+ <span className={`w-3 shrink-0 font-mono font-semibold ${STATUS_CLASS[file.status]}`}>
103
+ {STATUS_LABEL[file.status]}
104
+ </span>
105
+ <span className="min-w-0 flex-1 truncate font-mono text-ink/80">{file.displayPath}</span>
106
+ {file.agent !== 'Main' && (
107
+ <span className="shrink-0 text-[10px] text-ink/40">{file.agent}</span>
108
+ )}
109
+ {counts && (
110
+ <span className="flex shrink-0 items-center gap-1 font-mono text-[10px]">
111
+ {counts.added > 0 && <span className="text-success">+{counts.added}</span>}
112
+ {counts.removed > 0 && <span className="text-error">{'\u2212'}{counts.removed}</span>}
113
+ </span>
114
+ )}
115
+ </button>
116
+ </li>
117
+ );
118
+ })}
119
+ </ul>
120
+ )}
121
+ </div>
122
+ );
123
+ }
124
+
125
+ /** Open the journal diff tab for one file. The desktop and phone layouts both
126
+ * listen for `omp:open-diff`; the journal fields are what make it a journal
127
+ * read rather than a worktree read. */
128
+ function openJournalDiff(file: ChangedFile, sessionId: string, from: number, to: number): void {
129
+ window.dispatchEvent(new CustomEvent('omp:open-diff', {
130
+ detail: {
131
+ file: file.displayPath,
132
+ status: STATUS_LABEL[file.status],
133
+ source: 'journal',
134
+ journal: { sessionId, path: file.path, from, to },
135
+ },
136
+ }));
137
+ }
@@ -8,9 +8,11 @@ import { TurnRail } from '@/client/components/workspace/chat-timeline/TurnRail';
8
8
  import { useToolRenderMode } from '@/client/hooks/chat/timeline/tool-render-mode';
9
9
  import { isNoticeRow } from '@/shared/lib/chat/notice-row';
10
10
  import { previousNonNoticeIndex, resolveRunFooters, streamingRowIndex } from '@/shared/lib/chat/timeline/run-footer';
11
+ import { bucketChangesByRun } from '@/shared/lib/chat/timeline/changed-files';
12
+ import { runWindowMs } from '@/shared/lib/chat/duration';
11
13
  import { groupTraceRows } from '@/shared/lib/chat/timeline/trace-groups';
12
14
  import type { TimelineRowWindow } from '@/client/hooks/chat/timeline/row-window';
13
- import type { Attachment, ChatMessageData } from '@/shared/types';
15
+ import type { Attachment, ChatMessageData, SessionChangeRecord } from '@/shared/types';
14
16
  import type { ForkAnchorRole } from '@/shared/lib/chat/timeline/fork-anchor';
15
17
 
16
18
  export interface MessageListProps {
@@ -46,6 +48,10 @@ export interface MessageListProps {
46
48
  * own timeline mounts a window instead.
47
49
  */
48
50
  rowWindow?: TimelineRowWindow;
51
+ /** Session id the journal diff tabs read from. */
52
+ sessionId?: string;
53
+ /** The session's agent change journal, bucketed into runs here. */
54
+ changeRecords?: SessionChangeRecord[];
49
55
  }
50
56
 
51
57
  /**
@@ -78,6 +84,8 @@ export const MessageList = memo(function MessageList({
78
84
  isMobile = false,
79
85
  userActions = true,
80
86
  rowWindow,
87
+ sessionId,
88
+ changeRecords,
81
89
  }: MessageListProps) {
82
90
  const { streamingIdx, footers, prevNonNoticeIdx } = useMemo(() => {
83
91
  return {
@@ -90,6 +98,24 @@ export const MessageList = memo(function MessageList({
90
98
  };
91
99
  }, [messages, isGenerating]);
92
100
 
101
+ // The journal's writes bucketed into runs, and each run's wall-clock window
102
+ // (the range a journal diff tab reads). Both are derived from the same
103
+ // `footers` pass, so a run's list and its diff cannot disagree about which
104
+ // run they describe.
105
+ const changedFilesByOwner = useMemo(
106
+ () => bucketChangesByRun(messages, footers, changeRecords ?? []),
107
+ [messages, footers, changeRecords],
108
+ );
109
+ const runWindows = useMemo(() => {
110
+ const windows = new Map<number, { start: number; end: number }>();
111
+ for (const slot of footers) {
112
+ if (!slot) continue;
113
+ const window = runWindowMs(messages, slot.runStartIndex, slot.ownerIndex);
114
+ if (window) windows.set(slot.ownerIndex, window);
115
+ }
116
+ return windows;
117
+ }, [messages, footers]);
118
+
93
119
  const start = rowWindow ? rowWindow.start : 0;
94
120
  const end = rowWindow ? Math.min(rowWindow.end, messages.length) : messages.length;
95
121
  const visible = start === 0 && end === messages.length ? messages : messages.slice(start, end);
@@ -167,6 +193,9 @@ export const MessageList = memo(function MessageList({
167
193
  onFork={onFork}
168
194
  isMobile={isMobile}
169
195
  showActions={userActions}
196
+ changedFiles={changedFilesByOwner.get(inlineFooter.ownerIndex)}
197
+ sessionId={sessionId}
198
+ runWindow={runWindows.get(inlineFooter.ownerIndex)}
170
199
  />
171
200
  )}
172
201
  </div>
@@ -190,6 +219,9 @@ export const MessageList = memo(function MessageList({
190
219
  onFork={onFork}
191
220
  isMobile={isMobile}
192
221
  showActions={userActions}
222
+ changedFiles={changedFilesByOwner.get(trailingFooter.ownerIndex)}
223
+ sessionId={sessionId}
224
+ runWindow={runWindows.get(trailingFooter.ownerIndex)}
193
225
  />
194
226
  )}
195
227
  </Fragment>
@@ -1,5 +1,6 @@
1
- import type { Attachment, ChatMessageData } from '@/shared/types';
1
+ import type { Attachment, ChangedFile, ChatMessageData } from '@/shared/types';
2
2
  import { AiMessageFooter } from '@/client/components/workspace/chat-timeline/AiMessageFooter';
3
+ import { ChangedFilesSummary } from '@/client/components/workspace/chat-timeline/ChangedFilesSummary';
3
4
  import { messageAnswerText } from '@/shared/lib/chat/notice-row';
4
5
  import { formatMessageStamp } from '@/shared/lib/format/time';
5
6
  import type { ForkAnchorRole } from '@/shared/lib/chat/timeline/fork-anchor';
@@ -46,6 +47,12 @@ interface RunFooterProps {
46
47
  * side answer) turns them off rather than rendering dead buttons.
47
48
  */
48
49
  showActions?: boolean;
50
+ /** Files this run changed, from the session's agent change journal. */
51
+ changedFiles?: ChangedFile[];
52
+ /** Session id the journal diff tabs read from. */
53
+ sessionId?: string;
54
+ /** The run's wall-clock window, epoch ms. */
55
+ runWindow?: { start: number; end: number };
49
56
  }
50
57
 
51
58
  /**
@@ -70,9 +77,23 @@ export function RunFooter({
70
77
  onFork,
71
78
  isMobile = false,
72
79
  showActions = true,
80
+ changedFiles,
81
+ sessionId,
82
+ runWindow,
73
83
  }: RunFooterProps) {
74
84
  return (
75
85
  <div className="mt-2">
86
+ {changedFiles && changedFiles.length > 0 && sessionId && runWindow && (
87
+ <div className="mb-1.5">
88
+ <ChangedFilesSummary
89
+ files={changedFiles}
90
+ sessionId={sessionId}
91
+ from={runWindow.start}
92
+ to={runWindow.end}
93
+ isMobile={isMobile}
94
+ />
95
+ </div>
96
+ )}
76
97
  <AiMessageFooter
77
98
  provider={msg.provider || provider}
78
99
  providerNames={providerNames}
@@ -5,6 +5,8 @@ import { MinimapShortcuts } from '@/client/components/workspace/chat-timeline/Mi
5
5
  import { MobileTurnJump } from '@/client/components/workspace/chat-timeline/MobileTurnJump';
6
6
  import { LoadingOlderIndicator } from '@/client/components/workspace/chat-timeline/SessionSkeleton';
7
7
  import { OrphanAsks } from '@/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OrphanAsks';
8
+ import { useSessionChanges } from '@/client/hooks/chat/timeline/session-changes';
9
+ import { useShowChangedFiles } from '@/client/hooks/chat/timeline/changed-files-setting';
8
10
  import type { Attachment, ChatMessageData, UserTurnRef } from '@/shared/types';
9
11
  import type { ForkAnchorRole } from '@/shared/lib/chat/timeline/fork-anchor';
10
12
 
@@ -41,6 +43,8 @@ interface TimelineBodyProps {
41
43
  jumpToBottom: (behavior?: ScrollBehavior) => void;
42
44
  /** Which rows of `messages` are mounted (see `useTimelineRowWindow`). */
43
45
  rowWindow: TimelineRowWindow;
46
+ /** Session id the journal diff tabs read from. */
47
+ sessionId?: string;
44
48
  }
45
49
 
46
50
  /**
@@ -76,7 +80,14 @@ export function TimelineBody({
76
80
  showScrollBottom,
77
81
  jumpToBottom,
78
82
  rowWindow,
83
+ sessionId,
79
84
  }: TimelineBodyProps) {
85
+ // The agent's own change journal, for the per-run file list above each
86
+ // footer. Read once a run settles; a session with no journal (older omp)
87
+ // answers an empty list and the summary simply does not render. The setting
88
+ // gates the read too, so turning the list off costs no request.
89
+ const showChangedFiles = useShowChangedFiles();
90
+ const records = useSessionChanges(sessionId ?? null, isGenerating, showChangedFiles);
80
91
  return (
81
92
  <>
82
93
  {/* Jump to a user turn. The rail is desktop's form — one 1px line per
@@ -129,6 +140,8 @@ export function TimelineBody({
129
140
  onFork={onFork}
130
141
  isMobile={isMobile}
131
142
  rowWindow={rowWindow}
143
+ sessionId={sessionId}
144
+ changeRecords={records}
132
145
  />
133
146
  {/* An ask whose tool card this client cannot see (a subagent's, an
134
147
  extension's own dialog, a call outside the loaded window) still
@@ -268,7 +268,7 @@ export function ChatTimeline({ className = '', appSettings = {}, onSessionTitle,
268
268
  onFork={fork}
269
269
  showScrollBottom={showScrollBottom}
270
270
  jumpToBottom={jumpToBottom}
271
- rowWindow={rowWindow}
271
+ rowWindow={rowWindow} sessionId={sessionId}
272
272
  />
273
273
  )}
274
274
  </div>
@@ -1,10 +1,11 @@
1
- import { AlignJustify, Check, ChevronDown, ChevronUp, Code2, Columns, Copy, Diff, FileCode, Minus, Plus, RefreshCw, Space, Undo2, WrapText } from 'lucide-preact';
1
+ import { AlignJustify, Check, ChevronDown, ChevronUp, Code2, Columns, Copy, Diff, FileCode, RefreshCw, Space, WrapText } from 'lucide-preact';
2
2
  import { FileIcon } from '@/client/components/common/file-icon';
3
3
  import { EditorViewButtons, useEditorViewActions } from '@/client/components/common/editor-view-buttons';
4
4
  import { getGitStatusInfo } from '@/shared/lib/fs/git-status';
5
5
  import { ToolbarRow, type ToolbarCluster } from '@/client/components/common/toolbar-row';
6
6
  import { DiffContentModeSegments, DiffViewModeSegments } from '@/client/components/workspace/diff-panel/ToolbarSegments';
7
7
  import { HunkStepper } from '@/client/components/workspace/diff-panel/HunkStepper';
8
+ import { ACTION_CLASS, gitActionClusters } from '@/client/components/workspace/diff-panel/toolbar-git-actions';
8
9
 
9
10
  export type DiffViewMode = 'unified' | 'split';
10
11
 
@@ -41,6 +42,12 @@ interface DiffToolbarProps {
41
42
  * chat column or sidebar beside it for a mode to widen into.
42
43
  */
43
44
  viewModeButtons?: boolean;
45
+ /**
46
+ * Hide the git writes. A journal diff shows the agent's own snapshots, which
47
+ * are not the worktree: staging or discarding from it would write a state the
48
+ * reader never saw.
49
+ */
50
+ readOnly?: boolean;
44
51
  onSetViewMode: (mode: DiffViewMode) => void;
45
52
  onSetContentMode: (mode: DiffContentMode) => void;
46
53
  onToggleWordWrap: () => void;
@@ -52,9 +59,6 @@ interface DiffToolbarProps {
52
59
  onCopyDiff: () => void;
53
60
  }
54
61
 
55
- const ACTION_CLASS =
56
- 'flex items-center justify-center p-1.5 rounded transition-colors cursor-pointer disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent disabled:hover:text-ink/50';
57
-
58
62
  export function DiffToolbar({
59
63
  filePath,
60
64
  status,
@@ -72,6 +76,7 @@ export function DiffToolbar({
72
76
  isCopied,
73
77
  isBusy = false,
74
78
  viewModeButtons = true,
79
+ readOnly = false,
75
80
  onSetViewMode,
76
81
  onSetContentMode,
77
82
  onToggleWordWrap,
@@ -249,53 +254,14 @@ export function DiffToolbar({
249
254
  ),
250
255
  });
251
256
 
252
- if (!isStaged) {
253
- clusters.push({
254
- id: 'discard',
255
- actions: [{ label: 'Discard changes in this file', icon: Undo2, onSelect: onDiscard, disabled: locked }],
256
- children: (
257
- <button
258
- type="button"
259
- onClick={onDiscard}
260
- className={`${ACTION_CLASS} text-ink/50 hover:text-error hover:bg-error/10`}
261
- title="Discard changes in this file"
262
- aria-label="Discard changes in this file"
263
- disabled={locked}
264
- >
265
- <Undo2 size={13} />
266
- </button>
267
- ),
268
- });
269
- }
270
-
271
- clusters.push({
272
- id: 'stage',
273
- // The panel's primary write: a menu row must not be the only way to stage.
274
- pinned: true,
275
- actions: [{ label: stageLabel, icon: isStaged ? Minus : Plus, onSelect: onStageUnstage, disabled: locked }],
276
- children: (
277
- <button
278
- type="button"
279
- onClick={onStageUnstage}
280
- className="px-2 py-1 text-[11px] font-medium rounded border border-ink/15 hover:bg-ink/5 flex items-center space-x-1 transition-colors text-ink cursor-pointer disabled:cursor-default disabled:opacity-40 disabled:hover:bg-transparent"
281
- title={stageLabel}
282
- aria-label={stageLabel}
283
- disabled={locked}
284
- >
285
- {isStaged ? (
286
- <>
287
- <Minus size={12} />
288
- <span className="hidden @[360px]:inline">Unstage</span>
289
- </>
290
- ) : (
291
- <>
292
- <Plus size={12} />
293
- <span className="hidden @[360px]:inline">Stage</span>
294
- </>
295
- )}
296
- </button>
297
- ),
298
- });
257
+ clusters.push(...gitActionClusters({
258
+ isStaged,
259
+ locked,
260
+ readOnly,
261
+ stageLabel,
262
+ onStageUnstage,
263
+ onDiscard,
264
+ }));
299
265
 
300
266
  if (onOpenInEditor) {
301
267
  clusters.push({