@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,27 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Wall-clock span label for statistics.
8
+ *
9
+ * Sub-second is the point: a fast tool call or a short LLM request is a real
10
+ * measurement, while the chat footer's `formatDuration` deliberately hides
11
+ * anything under a second. `formatSpan` prints `0.4s`, `12s`, `2m 14s`,
12
+ * `1h 4m` — one convention for every timing row in the context popover.
13
+ *
14
+ * Undefined, non-finite and non-positive values return `undefined`, so the
15
+ * caller omits the row instead of printing a measurement the source never made.
16
+ */
17
+ export function formatSpan(ms: number | undefined): string | undefined {
18
+ if (typeof ms !== 'number' || !Number.isFinite(ms) || ms <= 0) return undefined;
19
+ if (ms < 10_000) return `${(ms / 1000).toFixed(1)}s`;
20
+ const totalSeconds = Math.round(ms / 1000);
21
+ const hours = Math.floor(totalSeconds / 3600);
22
+ const minutes = Math.floor((totalSeconds % 3600) / 60);
23
+ const seconds = totalSeconds % 60;
24
+ if (hours > 0) return `${hours}h ${minutes}m`;
25
+ if (minutes > 0) return `${minutes}m ${seconds}s`;
26
+ return `${seconds}s`;
27
+ }
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The unified patch the journal diff tab copies. The panel renders the two
8
+ * sides itself, so this is the one place a wrong hunk header or a lost context
9
+ * line would reach the clipboard unnoticed.
10
+ */
11
+
12
+ import { describe, expect, test } from 'bun:test';
13
+ import { unifiedDiff } from '@/shared/lib/fs/unified-diff';
14
+
15
+ describe('unifiedDiff', () => {
16
+ test('equal texts produce no patch', () => {
17
+ expect(unifiedDiff('a.ts', 'one\ntwo\n', 'one\ntwo\n')).toBe('');
18
+ });
19
+
20
+ test('a changed line keeps three lines of context and a correct header', () => {
21
+ const before = 'a\nb\nc\nd\ne\nf\ng\n';
22
+ const after = 'a\nb\nc\nD\ne\nf\ng\n';
23
+ const patch = unifiedDiff('src/x.ts', before, after);
24
+ expect(patch).toContain('--- a/src/x.ts');
25
+ expect(patch).toContain('+++ b/src/x.ts');
26
+ expect(patch).toContain('@@ -1,7 +1,7 @@');
27
+ expect(patch).toContain('-d');
28
+ expect(patch).toContain('+D');
29
+ expect(patch).toContain(' a');
30
+ expect(patch).toContain(' g');
31
+ });
32
+
33
+ test('a created file is all additions', () => {
34
+ const patch = unifiedDiff('new.ts', '', 'one\ntwo\n');
35
+ expect(patch).toContain('@@ -0,0 +1,2 @@');
36
+ expect(patch).toContain('+one');
37
+ expect(patch).toContain('+two');
38
+ });
39
+
40
+ test('a deleted file is all deletions', () => {
41
+ const patch = unifiedDiff('gone.ts', 'one\ntwo\n', '');
42
+ expect(patch).toContain('@@ -1,2 +0,0 @@');
43
+ expect(patch).toContain('-one');
44
+ expect(patch).toContain('-two');
45
+ });
46
+
47
+ test('two distant changes become two hunks', () => {
48
+ const before = Array.from({ length: 40 }, (_, index) => `line ${index}`).join('\n');
49
+ const after = before.replace('line 1\n', 'LINE 1\n').replace('line 38', 'LINE 38');
50
+ const patch = unifiedDiff('big.ts', before, after);
51
+ expect(patch.match(/^@@ /gm)?.length).toBe(2);
52
+ });
53
+ });
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * A unified diff from two texts, for the journal diff tab's Copy action.
8
+ *
9
+ * The diff panel renders the two sides itself (`@codemirror/merge`), so this
10
+ * patch is not what the reader sees — it is what "Copy diff text" puts on the
11
+ * clipboard, and what a plugin's diff renderer receives. Keeping it here (not
12
+ * in the server module) means the same function can be tested without a
13
+ * session, and a future client-side caller gets the same answer.
14
+ *
15
+ * Line-based LCS, capped: a pair whose product exceeds {@link MAX_LCS_CELLS}
16
+ * falls back to "every old line removed, every new line added". That is still a
17
+ * valid patch, and it keeps a 20 000-line file from allocating a 400M-cell
18
+ * table on a request thread.
19
+ */
20
+
21
+ /** Context lines around each change, as `git diff` emits by default. */
22
+ const CONTEXT = 3;
23
+ /** Above this many DP cells, fall back to a whole-file replacement. */
24
+ const MAX_LCS_CELLS = 4_000_000;
25
+
26
+ type Op = { kind: ' ' | '-' | '+'; text: string };
27
+
28
+ /** Split into lines, dropping the empty tail a trailing newline produces. */
29
+ function splitLines(text: string): string[] {
30
+ if (text === '') return [];
31
+ const lines = text.split('\n');
32
+ if (lines[lines.length - 1] === '') lines.pop();
33
+ return lines;
34
+ }
35
+
36
+ /** Line-level LCS edit script from `a` to `b`. */
37
+ function editScript(a: readonly string[], b: readonly string[]): Op[] {
38
+ const n = a.length;
39
+ const m = b.length;
40
+ if (n * m > MAX_LCS_CELLS) {
41
+ return [
42
+ ...a.map((text): Op => ({ kind: '-', text })),
43
+ ...b.map((text): Op => ({ kind: '+', text })),
44
+ ];
45
+ }
46
+ // `dp[i][j]` = LCS length of a[i..] and b[j..].
47
+ const dp: Uint32Array[] = Array.from({ length: n + 1 }, () => new Uint32Array(m + 1));
48
+ for (let i = n - 1; i >= 0; i--) {
49
+ for (let j = m - 1; j >= 0; j--) {
50
+ dp[i][j] = a[i] === b[j] ? dp[i + 1][j + 1] + 1 : Math.max(dp[i + 1][j], dp[i][j + 1]);
51
+ }
52
+ }
53
+ const ops: Op[] = [];
54
+ let i = 0;
55
+ let j = 0;
56
+ while (i < n && j < m) {
57
+ if (a[i] === b[j]) {
58
+ ops.push({ kind: ' ', text: a[i] });
59
+ i++;
60
+ j++;
61
+ } else if (dp[i + 1][j] >= dp[i][j + 1]) {
62
+ ops.push({ kind: '-', text: a[i] });
63
+ i++;
64
+ } else {
65
+ ops.push({ kind: '+', text: b[j] });
66
+ j++;
67
+ }
68
+ }
69
+ while (i < n) ops.push({ kind: '-', text: a[i++] });
70
+ while (j < m) ops.push({ kind: '+', text: b[j++] });
71
+ return ops;
72
+ }
73
+
74
+ /** `start,count` of a unified hunk range; a zero-length range names the line before it. */
75
+ function hunkRange(start: number, count: number): string {
76
+ return `${count === 0 ? start : start + 1},${count}`;
77
+ }
78
+
79
+ /**
80
+ * Unified diff turning `before` into `after` at `path`; `''` when they are
81
+ * equal. `path` is the display path (repo- or cwd-relative).
82
+ */
83
+ export function unifiedDiff(path: string, before: string, after: string): string {
84
+ if (before === after) return '';
85
+ const ops = editScript(splitLines(before), splitLines(after));
86
+ const changed: number[] = [];
87
+ for (let index = 0; index < ops.length; index++) {
88
+ if (ops[index].kind !== ' ') changed.push(index);
89
+ }
90
+ if (changed.length === 0) return '';
91
+
92
+ // Group changed indices into hunks, merging when the gap is within twice the
93
+ // context (the same rule `git diff` uses).
94
+ const ranges: Array<[number, number]> = [];
95
+ let start = Math.max(0, changed[0] - CONTEXT);
96
+ let end = Math.min(ops.length - 1, changed[0] + CONTEXT);
97
+ for (let k = 1; k < changed.length; k++) {
98
+ const index = changed[k];
99
+ if (index - end <= 2 * CONTEXT) {
100
+ end = Math.min(ops.length - 1, index + CONTEXT);
101
+ } else {
102
+ ranges.push([start, end]);
103
+ start = Math.max(0, index - CONTEXT);
104
+ end = Math.min(ops.length - 1, index + CONTEXT);
105
+ }
106
+ }
107
+ ranges.push([start, end]);
108
+
109
+ let out = `--- a/${path}\n+++ b/${path}\n`;
110
+ for (const [from, to] of ranges) {
111
+ let oldLine = 1;
112
+ let newLine = 1;
113
+ for (let index = 0; index < from; index++) {
114
+ if (ops[index].kind !== '+') oldLine++;
115
+ if (ops[index].kind !== '-') newLine++;
116
+ }
117
+ let oldCount = 0;
118
+ let newCount = 0;
119
+ for (let index = from; index <= to; index++) {
120
+ if (ops[index].kind !== '+') oldCount++;
121
+ if (ops[index].kind !== '-') newCount++;
122
+ }
123
+ out += `@@ -${hunkRange(oldLine - 1, oldCount)} +${hunkRange(newLine - 1, newCount)} @@\n`;
124
+ for (let index = from; index <= to; index++) out += `${ops[index].kind}${ops[index].text}\n`;
125
+ }
126
+ return out;
127
+ }
@@ -50,6 +50,9 @@ const HARNESS_BASES: Readonly<Record<string, string>> = {
50
50
  jcode: '#111111',
51
51
  // xAI publishes a one-colour mark.
52
52
  grok: '#000000',
53
+ // Hermes' mark is the vendor's black "nous girl" portrait, so it paints in the
54
+ // theme's ink like the other monochrome marks.
55
+ hermes: '#000000',
53
56
  };
54
57
 
55
58
  /**
@@ -89,6 +89,19 @@ describe('harness catalog after the Gemini retirement', () => {
89
89
  expect(HARNESS_LAUNCH.grok?.install).toContain('https://x.ai/cli/install.sh');
90
90
  });
91
91
 
92
+ test('hermes is listed and launches its own `acp` subcommand', () => {
93
+ // Hermes ships the ACP adapter in-tree (`acp_adapter/`), so the launch line
94
+ // is the CLI's own verb. The `acp` extra is a separate sync step, which the
95
+ // install hint has to name or the subcommand does not exist on a stock
96
+ // install.
97
+ const descriptor = harnessDescriptor('hermes');
98
+ expect(descriptor?.transport).toBe('acp');
99
+ expect(descriptor?.glyph).toBe('hermes');
100
+ expect(HARNESS_LAUNCH.hermes?.command).toEqual(['hermes', 'acp']);
101
+ expect(HARNESS_LAUNCH.hermes?.install).toContain('hermes-agent.nousresearch.com/install.sh');
102
+ expect(HARNESS_LAUNCH.hermes?.install).toContain("pm.sync_venv(['acp']");
103
+ });
104
+
92
105
  test('every catalog entry has a launch line or is the built-in transport', () => {
93
106
  // The built-in transport has no agent to launch by definition; everything
94
107
  // else without a line would probe to "no launch command is configured",
@@ -51,7 +51,11 @@ export type BuiltinHarnessId =
51
51
  * by the Jcode daemon. */
52
52
  | 'jcode'
53
53
  /** xAI's Grok Build CLI, over its own ACP server (`grok agent stdio`). */
54
- | 'grok';
54
+ | 'grok'
55
+ /** Nous Research's Hermes Agent, over the ACP adapter it ships in-tree
56
+ * (`hermes acp`). The stock install exposes only the messages gateway and
57
+ * the TUI; the ACP surface arrives with its `acp` extra. */
58
+ | 'hermes';
55
59
 
56
60
  /**
57
61
  * A harness id: one this build ships, or one the user added.
@@ -82,6 +86,7 @@ export const HARNESS_IDS: readonly BuiltinHarnessId[] = [
82
86
  'zcode',
83
87
  'jcode',
84
88
  'grok',
89
+ 'hermes',
85
90
  ];
86
91
 
87
92
  export interface HarnessDescriptor {
@@ -136,6 +141,7 @@ export type HarnessGlyph =
136
141
  | 'zcode'
137
142
  | 'jcode'
138
143
  | 'grok'
144
+ | 'hermes'
139
145
  /** A user-added ACP harness: no vendor mark, drawn as its initial. */
140
146
  | 'custom';
141
147
 
@@ -162,6 +168,7 @@ export const HARNESS_CATALOG: Readonly<Record<BuiltinHarnessId, HarnessDescripto
162
168
  zcode: { id: 'zcode', label: 'zcode', initial: 'Z', transport: 'acp', glyph: 'zcode' },
163
169
  jcode: { id: 'jcode', label: 'jcode', initial: 'J', transport: 'acp', glyph: 'jcode' },
164
170
  grok: { id: 'grok', label: 'grok', initial: 'G', transport: 'acp', glyph: 'grok' },
171
+ hermes: { id: 'hermes', label: 'hermes', initial: 'H', transport: 'acp', glyph: 'hermes' },
165
172
  };
166
173
 
167
174
  /**
@@ -24,10 +24,12 @@ export function harnessForksAtMessage(harness: string | null | undefined): boole
24
24
  * Harnesses that advertise `session/fork` but take no anchor: the fork copies
25
25
  * the whole conversation. `zcode` is checkpoint-scoped (`latestCheckpoint`),
26
26
  * `opencode` and `minimax` have a message-level fork in their own API that
27
- * their ACP adapter does not pass through.
27
+ * their ACP adapter does not pass through, and `hermes` advertises
28
+ * `SessionForkCapabilities()` with a `fork_session(cwd, session_id)` that takes
29
+ * no message id.
28
30
  */
29
31
  export function harnessForksWholeChat(harness: string | null | undefined): boolean {
30
- return harness === 'opencode' || harness === 'minimax' || harness === 'zcode';
32
+ return harness === 'opencode' || harness === 'minimax' || harness === 'zcode' || harness === 'hermes';
31
33
  }
32
34
 
33
35
  /** What a harness can fork: nothing, the whole chat, or at a message. */
@@ -55,6 +55,9 @@ export const HARNESS_MCP_FACTS: Record<BuiltinHarnessId, HarnessMcpFacts> = {
55
55
  // Measured on 1.0.77: `mcpCapabilities` advertises stdio, http AND sse, and
56
56
  // the agent also loads config.toml / ~/.claude.json / .mcp.json on its own.
57
57
  grok: { delivery: 'acp', note: 'Injected on session/new and advertised for stdio, http and sse (measured 1.0.77); grok also loads MCP servers from config.toml, ~/.claude.json and the project .mcp.json.' },
58
+ // Hermes' ACP adapter takes the editor's `mcpServers` on session/new and adds
59
+ // them to the servers its own `config.yaml` already enables.
60
+ hermes: { delivery: 'acp', note: 'Injected on session/new, on top of the servers ~/.hermes/config.yaml enables; the editor list is always added.' },
58
61
  };
59
62
 
60
63
  /**
@@ -178,6 +178,20 @@ export const HARNESS_PROVIDER_FACTS: Readonly<Partial<Record<HarnessId, HarnessP
178
178
  importFrom: [],
179
179
  summary: 'Grok takes custom models as [model.<name>] tables in ~/.grok/config.toml (model, base_url, api_key or env_key, context_window). Kabmo does not write that file; xAI models still need `grok login`.',
180
180
  },
181
+ hermes: {
182
+ registry: {
183
+ // Hermes keeps providers in `providers.<name>` in ~/.hermes/config.yaml
184
+ // (`api` for the base URL, `api_key` or `key_env`, `transport`, `models`),
185
+ // and its own `hermes model` / dashboard write that file. The model list
186
+ // may be a string array OR a map, which no Kabmo writer models, so the
187
+ // file is read-only here.
188
+ kind: 'agent-managed', file: '.hermes/config.yaml', pointer: 'providers',
189
+ writable: false, baseUrlField: null, apiKeyField: null, modelsField: null,
190
+ },
191
+ createsChoice: true,
192
+ importFrom: [],
193
+ summary: 'Hermes keeps providers in ~/.hermes/config.yaml (api, api_key or key_env, transport, models), written by `hermes model` and its dashboard; Kabmo shows the models it publishes but does not edit that file.',
194
+ },
181
195
  claude: {
182
196
  registry: {
183
197
  kind: 'env', file: null, pointer: 'environment',
@@ -155,6 +155,11 @@ export const HARNESS_UPDATE_FACTS: Readonly<Partial<Record<HarnessId, HarnessUpd
155
155
  command: 'grok update',
156
156
  note: 'The CLI updates itself (`grok update`, plus `[cli] auto_update`); Kabmo runs its own subcommand.',
157
157
  },
158
+ hermes: {
159
+ kind: 'self',
160
+ command: 'hermes update',
161
+ note: 'The CLI updates itself (`hermes update`, which also adds the `hermes-acp` launcher to older installs); Kabmo runs its own subcommand.',
162
+ },
158
163
  };
159
164
 
160
165
  /** The facts for a harness, or "Kabmo knows nothing about updating it". */
@@ -41,33 +41,33 @@ export const ICON_HUES: Readonly<Record<string, number>> = {
41
41
  Command: 100, Component: 200, Copy: 320, CopyPlus: 40, CornerDownLeft: 10, Cpu: 250,
42
42
  Database: 280, Dice5: 50, Diff: 300, DollarSign: 220, Download: 210, DownloadCloud: 180,
43
43
  Edit2: 210, Ellipsis: 100, ExternalLink: 60, Eye: 20, EyeOff: 350, File: 310,
44
- FileCode: 260, FileCog: 340, FileEdit: 270, FileImage: 40, FilePlus: 350, FilePlus2: 350,
45
- FileSearch: 310, FileText: 80, Files: 320, Flag: 350, FlaskConical: 170, Folder: 290,
46
- FolderGit: 190, FolderGit2: 190, FolderInput: 310, FolderOpen: 330, FolderPlus: 250, FolderSearch: 10,
47
- FolderTree: 10, Gamepad2: 300, GitBranch: 30, GitCommitVertical: 240, GitCompare: 340, GitFork: 30,
48
- GitMerge: 90, GitPullRequest: 10, Globe: 340, GraduationCap: 190, GripVertical: 350, Hammer: 310,
49
- Hand: 200, HardDrive: 0, Hash: 330, Heading: 250, Heart: 270, History: 110,
50
- Home: 20, Image: 140, Key: 240, KeyRound: 240, Keyboard: 120, Laptop: 170,
51
- Layers: 30, LayoutTemplate: 170, Leaf: 50, Library: 160, Lightbulb: 0, List: 170,
52
- ListChecks: 320, ListFilter: 230, ListOrdered: 220, ListTodo: 210, ListTree: 330, Loader2: 40,
53
- Lock: 220, LockKeyhole: 270, LockOpen: 180, LogIn: 140, LogOut: 190, Maximize: 310,
54
- Maximize2: 270, Menu: 100, MessageSquare: 150, MessageSquareOff: 40, MessageSquarePlus: 350, MessagesSquare: 220,
55
- Mic: 160, MicOff: 170, Minimize: 290, Minimize2: 130, Minus: 110, Monitor: 250,
56
- Moon: 80, MoreHorizontal: 160, MousePointerClick: 70, MoveVertical: 300, Music: 280, Package: 270,
57
- PackageOpen: 230, Paintbrush: 250, Palette: 320, PanelLeft: 280, PanelLeftClose: 160, PanelRight: 330,
58
- PanelRightClose: 350, Paperclip: 310, Pause: 10, Pencil: 0, PencilLine: 260, Pin: 0,
59
- PinOff: 50, Pipette: 120, Play: 310, Plug: 50, Plus: 210, Power: 340,
60
- Puzzle: 50, Quote: 110, Radio: 320, Ratio: 160, RefreshCw: 180, Regex: 280,
61
- Replace: 190, ReplaceAll: 140, Rocket: 210, RotateCcw: 330, RotateCw: 0, Rows: 160,
62
- Rows3: 250, Save: 40, SaveAll: 190, Scissors: 260, Search: 250, Send: 110,
63
- Server: 300, ServerCog: 50, Settings: 240, Settings2: 20, Shield: 160, Shrink: 160,
64
- Sliders: 290, SlidersHorizontal: 50, Smartphone: 20, Space: 290, Sparkles: 180, Square: 60,
65
- SquareFunction: 220, SquarePen: 10, Star: 170, StickyNote: 100, Store: 340, Sun: 90,
66
- Tablet: 290, Tag: 310, Target: 200, Terminal: 210, TextSelect: 220, Ticket: 170,
67
- TriangleAlert: 210, Type: 170, Undo2: 310, Upload: 0, UploadCloud: 50, User: 140,
68
- Variable: 330, Volume2: 270, VolumeX: 50, Wand2: 270, WandSparkles: 40, Waypoints: 30,
69
- WholeWord: 240, WrapText: 340, Wrench: 0, X: 230, Zap: 120, ZoomIn: 250,
70
- ZoomOut: 340,
44
+ FileCode: 260, FileCog: 340, FileDiff: 280, FileEdit: 270, FileImage: 40, FilePlus: 350,
45
+ FilePlus2: 350, FileSearch: 310, FileText: 80, Files: 320, Flag: 350, FlaskConical: 170,
46
+ Folder: 290, FolderGit: 190, FolderGit2: 190, FolderInput: 310, FolderOpen: 330, FolderPlus: 250,
47
+ FolderSearch: 10, FolderTree: 10, Gamepad2: 300, GitBranch: 30, GitCommitVertical: 240, GitCompare: 340,
48
+ GitFork: 30, GitMerge: 90, GitPullRequest: 10, Globe: 340, GraduationCap: 190, GripVertical: 350,
49
+ Hammer: 310, Hand: 200, HardDrive: 0, Hash: 330, Heading: 250, Heart: 270,
50
+ History: 110, Home: 20, Image: 140, Key: 240, KeyRound: 240, Keyboard: 120,
51
+ Laptop: 170, Layers: 30, LayoutTemplate: 170, Leaf: 50, Library: 160, Lightbulb: 0,
52
+ List: 170, ListChecks: 320, ListFilter: 230, ListOrdered: 220, ListTodo: 210, ListTree: 330,
53
+ Loader2: 40, Lock: 220, LockKeyhole: 270, LockOpen: 180, LogIn: 140, LogOut: 190,
54
+ Maximize: 310, Maximize2: 270, Menu: 100, MessageSquare: 150, MessageSquareOff: 40, MessageSquarePlus: 350,
55
+ MessagesSquare: 220, Mic: 160, MicOff: 170, Minimize: 290, Minimize2: 130, Minus: 110,
56
+ Monitor: 250, Moon: 80, MoreHorizontal: 160, MousePointerClick: 70, MoveVertical: 300, Music: 280,
57
+ Package: 270, PackageOpen: 230, Paintbrush: 250, Palette: 320, PanelLeft: 280, PanelLeftClose: 160,
58
+ PanelRight: 330, PanelRightClose: 350, Paperclip: 310, Pause: 10, Pencil: 0, PencilLine: 260,
59
+ Pin: 0, PinOff: 50, Pipette: 120, Play: 310, Plug: 50, Plus: 210,
60
+ Power: 340, Puzzle: 50, Quote: 110, Radio: 320, Ratio: 160, RefreshCw: 180,
61
+ Regex: 280, Replace: 190, ReplaceAll: 140, Rocket: 210, RotateCcw: 330, RotateCw: 0,
62
+ Rows: 160, Rows3: 250, Save: 40, SaveAll: 190, Scissors: 260, Search: 250,
63
+ Send: 110, Server: 300, ServerCog: 50, Settings: 240, Settings2: 20, Shield: 160,
64
+ Shrink: 160, Sliders: 290, SlidersHorizontal: 50, Smartphone: 20, Space: 290, Sparkles: 180,
65
+ Square: 60, SquareFunction: 220, SquarePen: 10, Star: 170, StickyNote: 100, Store: 340,
66
+ Sun: 90, Tablet: 290, Tag: 310, Target: 200, Terminal: 210, TextSelect: 220,
67
+ Ticket: 170, TriangleAlert: 210, Type: 170, Undo2: 310, Upload: 0, UploadCloud: 50,
68
+ User: 140, Variable: 330, Volume2: 270, VolumeX: 50, Wand2: 270, WandSparkles: 40,
69
+ Waypoints: 30, WholeWord: 240, WrapText: 340, Wrench: 0, X: 230, Zap: 120,
70
+ ZoomIn: 250, ZoomOut: 340,
71
71
  };
72
72
 
73
73
  /**
@@ -7,12 +7,29 @@
7
7
  * GENERATED — do not edit by hand. Run `bun run scripts/katex-fonts-woff2.mjs`
8
8
  * after upgrading @fontsource/fira-code.
9
9
  *
10
- * Fira Code, latin subset, woff2-only, weights 400/500/600/700 — the faces
11
- * `main.tsx` imports. Replaces `@fontsource/fira-code/{400,500,600,700}.css`,
12
- * which pulled 7 subsets (cyrillic, cyrillic-ext, greek, greek-ext, latin,
13
- * latin-ext, symbols2) x 4 weights x 2 formats = 56 files. This console is
14
- * English-only, so the other six subsets were dead weight, and the woff
15
- * fallback is never fetched by a browser that supports woff2.
10
+ * Fira Code, latin + symbols2 subsets, woff2-only, weights 400/500/600/700 —
11
+ * the faces `main.tsx` imports. Replaces
12
+ * `@fontsource/fira-code/{400,500,600,700}.css`, which pulled 7 subsets
13
+ * (cyrillic, cyrillic-ext, greek, greek-ext, latin, latin-ext, symbols2) x 4
14
+ * weights x 2 formats = 56 files. This console is English-only, so the
15
+ * language subsets were dead weight, and the woff fallback is never fetched by
16
+ * a browser that supports woff2.
17
+ *
18
+ * ## `symbols2` is NOT a language subset — dropping it broke every ASCII box
19
+ *
20
+ * It is the only subset carrying U+2500-259F (box drawing) and U+2000-200A
21
+ * (the fixed-width spaces). Without it those codepoints have no Fira Code face
22
+ * and fall through to the next family in the stack, `monospace` — a system
23
+ * face whose advance is not 0.6 em. Measured in WebKit at 12px: `M` 7.2px,
24
+ * `─`/`│`/`┌` 8.502px, so a box drawn with `─` overshoots its own `│` border by
25
+ * 1.3px per column and an agent's ASCII diagram arrives visibly skewed. With
26
+ * the face below declared, all four measure 7.2px.
27
+ *
28
+ * The `unicode-range` on every face is upstream's, and it is what keeps the
29
+ * 4 kB symbols2 files off the wire: a page that lays out no box-drawing glyph
30
+ * never requests them. Declaring the ranges also makes the face choice
31
+ * explicit instead of relying on "last declared wins" for the U+2000-200A
32
+ * overlap with latin.
16
33
  *
17
34
  * `font-display: swap` and the family/style/weight declarations match upstream,
18
35
  * so text metrics are unchanged.
@@ -24,6 +41,7 @@
24
41
  font-display: swap;
25
42
  font-weight: 400;
26
43
  src: url('@fontsource/fira-code/files/fira-code-latin-400-normal.woff2') format('woff2');
44
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
27
45
  }
28
46
 
29
47
  @font-face {
@@ -32,6 +50,7 @@
32
50
  font-display: swap;
33
51
  font-weight: 500;
34
52
  src: url('@fontsource/fira-code/files/fira-code-latin-500-normal.woff2') format('woff2');
53
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
35
54
  }
36
55
 
37
56
  @font-face {
@@ -40,6 +59,7 @@
40
59
  font-display: swap;
41
60
  font-weight: 600;
42
61
  src: url('@fontsource/fira-code/files/fira-code-latin-600-normal.woff2') format('woff2');
62
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
43
63
  }
44
64
 
45
65
  @font-face {
@@ -48,4 +68,43 @@
48
68
  font-display: swap;
49
69
  font-weight: 700;
50
70
  src: url('@fontsource/fira-code/files/fira-code-latin-700-normal.woff2') format('woff2');
71
+ unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
72
+ }
73
+
74
+ /* Box drawing, block elements and the fixed-width spaces — see the note above.
75
+ * Declared AFTER latin so the U+2000-200A overlap resolves to this face. */
76
+ @font-face {
77
+ font-family: 'Fira Code';
78
+ font-style: normal;
79
+ font-display: swap;
80
+ font-weight: 400;
81
+ src: url('@fontsource/fira-code/files/fira-code-symbols2-400-normal.woff2') format('woff2');
82
+ unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
83
+ }
84
+
85
+ @font-face {
86
+ font-family: 'Fira Code';
87
+ font-style: normal;
88
+ font-display: swap;
89
+ font-weight: 500;
90
+ src: url('@fontsource/fira-code/files/fira-code-symbols2-500-normal.woff2') format('woff2');
91
+ unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
92
+ }
93
+
94
+ @font-face {
95
+ font-family: 'Fira Code';
96
+ font-style: normal;
97
+ font-display: swap;
98
+ font-weight: 600;
99
+ src: url('@fontsource/fira-code/files/fira-code-symbols2-600-normal.woff2') format('woff2');
100
+ unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
101
+ }
102
+
103
+ @font-face {
104
+ font-family: 'Fira Code';
105
+ font-style: normal;
106
+ font-display: swap;
107
+ font-weight: 700;
108
+ src: url('@fontsource/fira-code/files/fira-code-symbols2-700-normal.woff2') format('woff2');
109
+ unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
51
110
  }
@@ -32,6 +32,7 @@ import { codeSafeAutolink } from '@/shared/lib/markdown/autolink';
32
32
  import remend from 'remend';
33
33
  import { highlightCode } from '@/shared/lib/code/syntax-highlight';
34
34
  import { directiveBlockHtml, isDirectiveLanguage, parseDirectiveAttributes } from '@/shared/lib/markdown/directives';
35
+ import { mermaidActionsHtml, mermaidSourceHtml } from '@/shared/lib/markdown/mermaid-actions';
35
36
  import { mathExtensions, setProseEscaped } from '@/shared/lib/markdown/math-extensions';
36
37
  import { registerBlockMapper } from '@/shared/lib/markdown/blocks/renderer';
37
38
  import { mapBlocks } from '@/shared/lib/markdown/blocks/scan';
@@ -82,11 +83,13 @@ function codeBlockShell(code: string, bodyHtml: string): string {
82
83
  </div>\n`;
83
84
  }
84
85
 
85
- // ```mermaid fences become a placeholder hydrated to SVG by mermaid.ts.
86
+ // ```mermaid fences become a placeholder hydrated to SVG by mermaid.ts. The
87
+ // actions come from `mermaid-actions.ts` rather than `codeBlockShell` because
88
+ // the hydrated block carries a refresh button too, and both states must show
89
+ // the same set.
86
90
  function mermaidBlockRenderer(code: string): string {
87
- const body = `<pre><code class="language-mermaid">${escapeHtml(code)}</code></pre>`;
88
- const shell = codeBlockShell(code, body);
89
- return `<div class="mermaid-block" data-mermaid="${encodeURIComponent(code)}" data-mermaid-state="pending">${shell}</div>`;
91
+ const body = `<div class="code-block">${mermaidActionsHtml(code)}${mermaidSourceHtml(code)}</div>`;
92
+ return `<div class="mermaid-block" data-mermaid="${encodeURIComponent(code)}" data-mermaid-state="pending">${body}</div>`;
90
93
  }
91
94
 
92
95
  function codeBlockRenderer(token: CodeToken): string {
@@ -0,0 +1,78 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The mermaid block's own actions.
8
+ *
9
+ * The refresh button is the reader's only repair for a diagram that rendered
10
+ * blank, and it is wired by a DELEGATED listener that looks for
11
+ * `data-mermaid-refresh` — so the two things that can silently kill it are
12
+ * (a) the attribute not surviving `sanitizeHtml`, and (b) the hydrated block
13
+ * replacing the placeholder's markup with a set that lacks the button. Both
14
+ * are asserted here, plus the copy payload, which must be the diagram source
15
+ * and not its URI escape.
16
+ */
17
+
18
+ import { afterEach, describe, expect, test } from 'bun:test';
19
+ import { Window } from 'happy-dom';
20
+ import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
21
+ import { renderMarkdown } from '@/shared/lib/markdown/marked';
22
+ import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
23
+ import { mermaidActionsHtml, mermaidSourceHtml } from '@/shared/lib/markdown/mermaid-actions';
24
+ import { refreshMermaidFromClick } from '@/shared/lib/markdown/mermaid';
25
+
26
+ afterEach(() => restoreDomGlobals());
27
+
28
+ const FENCE = '```mermaid\ngraph TD\n A["quoted"] --> B\n```';
29
+
30
+ describe('mermaid block actions', () => {
31
+ test('the placeholder carries both actions, and the refresh hook survives sanitizing', () => {
32
+ installDomGlobals(new Window({ url: 'http://localhost' }));
33
+ const html = sanitizeHtml(renderMarkdown(FENCE));
34
+ expect(html).toContain('data-mermaid-refresh');
35
+ expect(html).toContain('data-copy=');
36
+ // The copy payload is the source, not its percent escape.
37
+ expect(html).toContain('graph TD');
38
+ expect(html).not.toContain('graph%20TD');
39
+ });
40
+
41
+ test('the hydrated action set is the same one the placeholder emitted', () => {
42
+ const html = mermaidActionsHtml('graph TD\n A --> B');
43
+ expect(html).toContain('data-mermaid-refresh');
44
+ expect(html).toContain('data-copy="graph TD\n A --> B"');
45
+ });
46
+
47
+ test('a quote in the source cannot break out of the copy attribute', () => {
48
+ const html = mermaidActionsHtml('A["x"] --> B');
49
+ expect(html).toContain('data-copy="A[&quot;x&quot;] --> B"');
50
+ });
51
+
52
+ test('the fallback body escapes markup so a fence cannot inject HTML', () => {
53
+ expect(mermaidSourceHtml('<img src=x onerror=alert(1)>')).toBe(
54
+ '<pre><code class="language-mermaid">&lt;img src=x onerror=alert(1)&gt;</code></pre>',
55
+ );
56
+ });
57
+
58
+ test('a click on the refresh button re-renders that block and reports handled', () => {
59
+ installDomGlobals(new Window({ url: 'http://localhost' }));
60
+ const host = document.createElement('div');
61
+ // The raw render, not `sanitizeHtml`: happy-dom's purifier drops every
62
+ // `<div>`, which would remove the block this test is about.
63
+ host.innerHTML = renderMarkdown(FENCE);
64
+ document.body.append(host);
65
+ const block = host.querySelector<HTMLElement>('.mermaid-block')!;
66
+ block.querySelector('pre')!.setAttribute('data-marker', '1');
67
+ const button = block.querySelector<HTMLElement>('[data-mermaid-refresh]')!;
68
+
69
+ expect(refreshMermaidFromClick(button)).toBe(true);
70
+ // The block was reset to its placeholder, which is the retry starting.
71
+ expect(block.querySelector('[data-marker]')).toBeNull();
72
+ // The retry is in flight: `renderBlock` marks the block before awaiting.
73
+ expect(block.dataset.mermaidState).toBe('rendering');
74
+
75
+ // Any other click is not a refresh, so the caller keeps its own handling.
76
+ expect(refreshMermaidFromClick(host)).toBe(false);
77
+ });
78
+ });