@kabmo-labs/kabmo 0.33.0 → 0.35.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 (272) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +785 -624
  3. package/dist/client/static/js/{CsvGrid-fncjbg6j.js → CsvGrid-0amzgtd7.js} +2 -2
  4. package/dist/client/static/js/{DocxView-c9v2vr3r.js → DocxView-bxjhzxe9.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-vxjksm12.js → DrawioView-7s1yqsf4.js} +2 -2
  6. package/dist/client/static/js/{ImageView-a3g5k226.js → ImageView-ycfbn66h.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-hnjfwsjh.js → LayoutWrapper-tw1q1x0g.js} +2 -2
  8. package/dist/client/static/js/Modal-wqjactyd.js +38 -0
  9. package/dist/client/static/js/{PdfView-ksaes53y.js → PdfView-x6dmtwvr.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-30vcr95v.js → SessionsView-t85wq0me.js} +1 -1
  11. package/dist/client/static/js/{SheetView-vc484scg.js → SheetView-n52nvz8s.js} +25 -25
  12. package/dist/client/static/js/{SvgPreview-tph89jet.js → SvgPreview-59z7syme.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-xbar278c.js → abnfDiagram-O67JEVCF-91gnt049.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-bajpnvy7.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-s171n2z6.js → architectureDiagram-NJMV4G6O-5b9qtff2.js} +4 -4
  16. package/dist/client/static/js/{astro-80bs6hvg.js → astro-31cbyw7b.js} +1 -1
  17. package/dist/client/static/js/bash-0h36tk0k.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-gzx6rv9n.js → blockDiagram-BEXU5L5S-6f23fjkn.js} +3 -3
  19. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7f00skch.js → c4Diagram-YGBWAQC7-76t6d3am.js} +5 -5
  20. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-j79v95nc.js → classDiagram-v2-NBCMYWYE-f9tb19xm.js} +3 -3
  21. package/dist/client/static/js/{cose-bilkent-JH36ORCC-5fkn7ee5.js → cose-bilkent-JH36ORCC-t6nwrbwj.js} +1 -1
  22. package/dist/client/static/js/cpp-4wp9sy20.js +1 -0
  23. package/dist/client/static/js/css-c9nsbkh6.js +1 -0
  24. package/dist/client/static/js/cynefin-OW5HDTMX-8q9e90m8.js +1 -0
  25. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-cfs1yvrd.js → cynefinDiagram-VND7K2PF-69gc244j.js} +1 -1
  26. package/dist/client/static/js/{dagre-6A5THRUB-44bgc48p.js → dagre-6A5THRUB-54bry3ey.js} +2 -2
  27. package/dist/client/static/js/{diagram-22UHCM2B-a4g4x83k.js → diagram-22UHCM2B-gfkebye6.js} +11 -11
  28. package/dist/client/static/js/{diagram-3UASUU5V-gm4rg5na.js → diagram-3UASUU5V-a1mr319f.js} +1 -1
  29. package/dist/client/static/js/{diagram-ATOU4E4O-a95y41vk.js → diagram-ATOU4E4O-tkyk0qbe.js} +3 -3
  30. package/dist/client/static/js/{diagram-CDSNMT55-t3j93mmc.js → diagram-CDSNMT55-np0hc9m2.js} +4 -4
  31. package/dist/client/static/js/{diagram-MLGK6HIB-c2wdez02.js → diagram-MLGK6HIB-nh06fshp.js} +2 -2
  32. package/dist/client/static/js/{diagram-MPIPVDR6-gya9jhs5.js → diagram-MPIPVDR6-27q2veks.js} +2 -2
  33. package/dist/client/static/js/{dockerfile-a7q6174s.js → dockerfile-4rtt6c0f.js} +1 -1
  34. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-jjhkza6t.js → ebnfDiagram-ZINNZB2B-x9p9jqe8.js} +1 -1
  35. package/dist/client/static/js/{elk-276RUBZZ-f7re45mw.js → elk-276RUBZZ-fw7waks3.js} +1 -1
  36. package/dist/client/static/js/{erDiagram-OPXOYQCR-tpm9g5te.js → erDiagram-OPXOYQCR-fdfgzr5d.js} +5 -5
  37. package/dist/client/static/js/{erlang-qt876zrq.js → erlang-trjm07as.js} +1 -1
  38. package/dist/client/static/js/eventmodeling-NTZA5JFV-kn4hsm3p.js +1 -0
  39. package/dist/client/static/js/flowDiagram-KWPJA3E3-ah8cvps1.js +1 -0
  40. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-fz43n12d.js → ganttDiagram-FUAMR5RP-2avbqgdr.js} +3 -3
  41. package/dist/client/static/js/gitGraph-4MIJSDKK-hvavh16n.js +1 -0
  42. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-f61hgbn6.js → gitGraphDiagram-X574FWY7-9jmc0a3g.js} +12 -12
  43. package/dist/client/static/js/graphql-hbkmxsty.js +1 -0
  44. package/dist/client/static/js/{index-8239j2v1.js → index-0v34a7wf.js} +1 -1
  45. package/dist/client/static/js/{index-vtbbfwx0.js → index-1wjp16f0.js} +2 -2
  46. package/dist/client/static/js/index-2mx9ej4k.css +1 -0
  47. package/dist/client/static/js/{index-q2w6s8n7.js → index-2v1nmxwr.js} +6 -6
  48. package/dist/client/static/js/{index-apvkd37e.js → index-3ecsp1rx.js} +3 -3
  49. package/dist/client/static/js/{index-1y9r4frb.js → index-43qpbxjv.js} +2 -2
  50. package/dist/client/static/js/{index-w0fwb80e.js → index-4vybd9e7.js} +1 -1
  51. package/dist/client/static/js/{index-ahv9y42z.js → index-6f6cmcbq.js} +2 -2
  52. package/dist/client/static/js/{index-9fjt5anh.js → index-7ct7qrsp.js} +2 -2
  53. package/dist/client/static/js/{index-ajs3jj6j.js → index-7q02xnvq.js} +1 -1
  54. package/dist/client/static/js/{index-rytaa8ca.js → index-7smwzkvq.js} +2 -2
  55. package/dist/client/static/js/{index-rg8jpbsw.js → index-8acv5b77.js} +2 -2
  56. package/dist/client/static/js/{index-gs6f0qwa.js → index-8f9x7ev8.js} +2 -2
  57. package/dist/client/static/js/{index-7y6rpsrp.js → index-8mwragbj.js} +2 -2
  58. package/dist/client/static/js/{index-gcs49f3p.js → index-8x9ecxb0.js} +1 -1
  59. package/dist/client/static/js/{index-3rcjx70v.js → index-9ketbkh6.js} +1 -1
  60. package/dist/client/static/js/{index-ypx3qmhq.js → index-a628fg4m.js} +2 -2
  61. package/dist/client/static/js/{index-e4p4cd3r.js → index-a8ffattk.js} +2 -2
  62. package/dist/client/static/js/{index-js7t1vb1.js → index-b8s3xraa.js} +6 -6
  63. package/dist/client/static/js/index-btr2w8cq.js +12 -0
  64. package/dist/client/static/js/index-dfzrpy54.js +2 -0
  65. package/dist/client/static/js/{index-pxv2nw9w.js → index-ee2p07eg.js} +1 -1
  66. package/dist/client/static/js/{index-03h3bkcf.js → index-ek2e773p.js} +1 -1
  67. package/dist/client/static/js/{index-1xqs14fr.js → index-fvc0x6nx.js} +3 -3
  68. package/dist/client/static/js/{index-3zc1b0dv.js → index-jc1yagmk.js} +2 -2
  69. package/dist/client/static/js/{index-d495kfm0.js → index-jmxqefe3.js} +1 -1
  70. package/dist/client/static/js/{index-2x5f66t6.js → index-k7q01ye4.js} +2 -2
  71. package/dist/client/static/js/{index-5tgq7aqx.js → index-kdkfyrja.js} +2 -2
  72. package/dist/client/static/js/{index-m73za75e.js → index-mc4nefs7.js} +3 -3
  73. package/dist/client/static/js/{index-trm9x02n.js → index-nb8tp4mj.js} +30 -30
  74. package/dist/client/static/js/{index-zt75xpq0.js → index-ncrenheb.js} +206 -206
  75. package/dist/client/static/js/{index-qsm2z36d.js → index-p16scjt7.js} +2 -2
  76. package/dist/client/static/js/{index-sdtye3jy.js → index-pc6eg8h2.js} +2 -2
  77. package/dist/client/static/js/{index-zvfvqvn9.js → index-pnt0vc59.js} +2 -2
  78. package/dist/client/static/js/{index-pbe4yed4.js → index-py2k8std.js} +2 -2
  79. package/dist/client/static/js/{index-dbe6afkf.js → index-pzbssnsc.js} +2 -2
  80. package/dist/client/static/js/{index-qckv9nte.js → index-qqz6bcdd.js} +2 -2
  81. package/dist/client/static/js/{index-xj9649ac.js → index-ray2czf6.js} +7 -7
  82. package/dist/client/static/js/{index-0tf0arsp.js → index-rbgemjsp.js} +3 -3
  83. package/dist/client/static/js/{index-vw4brsdx.js → index-rkn0bxxt.js} +1 -1
  84. package/dist/client/static/js/{index-76zb4m0n.js → index-rv89xpaf.js} +2 -2
  85. package/dist/client/static/js/index-sbd5e816.js +1 -0
  86. package/dist/client/static/js/{index-eyzeya95.js → index-sdby39w4.js} +5 -5
  87. package/dist/client/static/js/{index-0n5wwe60.js → index-t6c0pd43.js} +2 -2
  88. package/dist/client/static/js/{index-km2zb6wk.js → index-tp7yb3bv.js} +2 -2
  89. package/dist/client/static/js/{index-vw5k8csz.js → index-vnw3hbeg.js} +56 -56
  90. package/dist/client/static/js/{index-354mqqra.js → index-vq6wts05.js} +2 -2
  91. package/dist/client/static/js/{index-14vndmcr.js → index-w5373tg1.js} +2 -2
  92. package/dist/client/static/js/{index-0e40xskg.js → index-w7tpgt46.js} +1 -1
  93. package/dist/client/static/js/{index-djmg1d7h.js → index-whbtxmwh.js} +2 -2
  94. package/dist/client/static/js/{index-2svnq5gg.js → index-xs1m0bpt.js} +1 -1
  95. package/dist/client/static/js/{index-9y3gjdj7.js → index-xxtsm2rb.js} +2 -2
  96. package/dist/client/static/js/{index-hf52f59k.js → index-y3ms153k.js} +2 -2
  97. package/dist/client/static/js/{index-1a0zkj8h.js → index-yq39qbs1.js} +2 -2
  98. package/dist/client/static/js/{index-j0r5hj0j.js → index-zh2jj56s.js} +2 -2
  99. package/dist/client/static/js/info-A6RAGUB7-fmjz8qwg.js +1 -0
  100. package/dist/client/static/js/{infoDiagram-VRGFBTTK-1qj804sn.js → infoDiagram-VRGFBTTK-g2dky5xg.js} +2 -2
  101. package/dist/client/static/js/ini-72yrpvd4.js +1 -0
  102. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-4j4qsnzw.js → ishikawaDiagram-OU5B5YK6-exrcjwp1.js} +6 -6
  103. package/dist/client/static/js/java-ab5tb2ra.js +1 -0
  104. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-j0brnfft.js → journeyDiagram-ZHPQQLJL-pn752qa5.js} +4 -4
  105. package/dist/client/static/js/jsx-25zj9j3k.js +1 -0
  106. package/dist/client/static/js/{julia-4ghmfy3e.js → julia-evn99h2m.js} +1 -1
  107. package/dist/client/static/js/{kanban-definition-PNTS6WVX-qqc22br0.js → kanban-definition-PNTS6WVX-v8nvr373.js} +5 -5
  108. package/dist/client/static/js/lua-j5w0c9wm.js +1 -0
  109. package/dist/client/static/js/markdown-j6hn4377.js +1 -0
  110. package/dist/client/static/js/{mermaid.core-vv3wbe65.js → mermaid.core-egzv89zv.js} +6 -6
  111. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-y5b2z8zp.js → mindmap-definition-NLK3R4M7-t9njmv2w.js} +8 -8
  112. package/dist/client/static/js/one-dark-pro-bm3r4js7.js +1 -0
  113. package/dist/client/static/js/one-light-e07dt7sy.js +1 -0
  114. package/dist/client/static/js/packet-AYTQ26CC-cwr6n1cm.js +1 -0
  115. package/dist/client/static/js/{pegDiagram-GJSIUBJH-0be07mqs.js → pegDiagram-GJSIUBJH-zhycy2b7.js} +1 -1
  116. package/dist/client/static/js/{perl-sd00t4b4.js → perl-506fy8m8.js} +1 -1
  117. package/dist/client/static/js/{php-2zfyqa61.js → php-axtsvxck.js} +1 -1
  118. package/dist/client/static/js/pie-WAS4IAKB-h1ebfzgt.js +1 -0
  119. package/dist/client/static/js/{pieDiagram-5QR66LMP-544w86jk.js → pieDiagram-5QR66LMP-sgctvma2.js} +2 -2
  120. package/dist/client/static/js/properties-q8njes42.js +1 -0
  121. package/dist/client/static/js/python-vqxc7181.js +1 -0
  122. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-p09e7z5s.js → quadrantDiagram-O4NWA36T-kzzhdcph.js} +5 -5
  123. package/dist/client/static/js/r-0k5eej8m.js +1 -0
  124. package/dist/client/static/js/radar-RG4KPBEZ-k7p1m364.js +1 -0
  125. package/dist/client/static/js/railroad-74A4TZTK-d08dw3t0.js +1 -0
  126. package/dist/client/static/js/railroad-abnf-HS5TGJTU-txnjycgk.js +1 -0
  127. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-p0r3cv6w.js +1 -0
  128. package/dist/client/static/js/railroad-peg-WCYAUIDC-sryk900a.js +1 -0
  129. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-de830ed2.js → railroadDiagram-XR7U4H2S-nzjffwxm.js} +1 -1
  130. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-b47d74p1.js → requirementDiagram-PLB6GJNP-tz4xxn4d.js} +2 -2
  131. package/dist/client/static/js/{ruby-v9qaqhby.js → ruby-qp7zfk2m.js} +1 -1
  132. package/dist/client/static/js/{rust-fkt0qyrs.js → rust-fz913fvw.js} +1 -1
  133. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-6ezc2fpj.js → sankeyDiagram-IPEJSGJF-2wcb0xr6.js} +4 -4
  134. package/dist/client/static/js/{sass-9bxped7y.js → sass-gnk9vsyp.js} +1 -1
  135. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-by5zqj6w.js → sequenceDiagram-PO4LG4MO-vqgebfns.js} +18 -18
  136. package/dist/client/static/js/{sizeCapture-INFHLROL-q85r06j6.js → sizeCapture-INFHLROL-xc314tes.js} +1 -1
  137. package/dist/client/static/js/sql-0e9mnrda.js +1 -0
  138. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-ep5pyexs.js → stateDiagram-v2-GCMORJYK-8bd9b1h8.js} +3 -3
  139. package/dist/client/static/js/{svelte-mwtx07d9.js → svelte-brpgzrtv.js} +1 -1
  140. package/dist/client/static/js/{swimlanes-2SLR337P-95fcqkh8.js → swimlanes-2SLR337P-t6hbdzcw.js} +1 -1
  141. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-c1czc7kv.js +8 -0
  142. package/dist/client/static/js/{timeline-definition-EJHVYXUP-461e615g.js → timeline-definition-EJHVYXUP-2txxasx5.js} +4 -4
  143. package/dist/client/static/js/treeView-Q6P3EWNA-77kj68p1.js +1 -0
  144. package/dist/client/static/js/treemap-WGGIJYW6-rw94xc82.js +1 -0
  145. package/dist/client/static/js/tsx-yd5wt250.js +1 -0
  146. package/dist/client/static/js/typescript-v7z7crfe.js +1 -0
  147. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-ftqfnvhg.js → usecaseDiagram-POWQR4AR-3x353hn4.js} +17 -17
  148. package/dist/client/static/js/{vennDiagram-UO4OBE2U-7t96h6ez.js → vennDiagram-UO4OBE2U-cerpss8e.js} +7 -7
  149. package/dist/client/static/js/{vue-j8vb9d7r.js → vue-apnkw9qy.js} +1 -1
  150. package/dist/client/static/js/wardley-WFR3VGLG-18xe4fhz.js +1 -0
  151. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-0de8w8c6.js → wardleyDiagram-VNRHLVJA-cx6jfsbf.js} +4 -4
  152. package/dist/client/static/js/xml-94fhzrfs.js +1 -0
  153. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-dez9phkf.js → xychartDiagram-PMCCYNJV-tgn23xj1.js} +5 -5
  154. package/dist/client/static/js/yaml-s8af9rnw.js +1 -0
  155. package/package.json +4 -1
  156. package/src/client/components/auth/login-screen/index.tsx +1 -0
  157. package/src/client/components/common/MarkdownRenderer.tsx +9 -12
  158. package/src/client/components/settings/Modal.tsx +14 -84
  159. package/src/client/components/settings/Sidebar.tsx +3 -1
  160. package/src/client/components/settings/categories/ConnectSettings.tsx +105 -0
  161. package/src/client/components/settings/categories/connect-settings/DeviceTable.tsx +145 -0
  162. package/src/client/components/settings/categories/connect-settings/PairDialog.test.tsx +159 -0
  163. package/src/client/components/settings/categories/connect-settings/PairDialog.tsx +189 -0
  164. package/src/client/components/settings/categories/connect-settings/QrCode.tsx +56 -0
  165. package/src/client/components/settings/categories/connect-settings/ServerCard.tsx +94 -0
  166. package/src/client/components/settings/categories/connect-settings/TunnelRow.tsx +127 -0
  167. package/src/client/components/settings/categories/connect-settings/qr-image.ts +76 -0
  168. package/src/client/components/settings/category-content.tsx +116 -0
  169. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.test.tsx +120 -0
  170. package/src/client/components/workspace/chat-timeline/ChangedFilesSummary.tsx +56 -20
  171. package/src/client/components/workspace/chat-timeline/RunFooter.tsx +1 -0
  172. package/src/client/components/workspace/git-panel/init-state.test.ts +5 -0
  173. package/src/client/hooks/chat/composer/speech-to-text.ts +24 -17
  174. package/src/client/hooks/chat/timeline/change-stats.ts +57 -0
  175. package/src/client/hooks/connect/use-connect-status.ts +116 -0
  176. package/src/client/hooks/connect/use-pairing.ts +100 -0
  177. package/src/client/hooks/editor/file-actions.ts +3 -11
  178. package/src/client/hooks/editor/font.test.ts +2 -1
  179. package/src/client/hooks/editor/use-file-transfer.ts +2 -1
  180. package/src/client/hooks/ui/clipboard.ts +26 -0
  181. package/src/client/lib/browser/download.ts +22 -0
  182. package/src/client/tailwind.css +5 -0
  183. package/src/server/index.ts +2 -0
  184. package/src/server/lib/assets/font-css.server.test.ts +19 -0
  185. package/src/server/lib/auth/client-address.test.ts +58 -0
  186. package/src/server/lib/auth/client-address.ts +37 -3
  187. package/src/server/lib/auth/guard.ts +31 -4
  188. package/src/server/lib/auth/rate-limit.test.ts +25 -8
  189. package/src/server/lib/auth/rate-limit.ts +8 -5
  190. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +88 -0
  191. package/src/server/lib/connect/cloudflared.server.test.ts +65 -0
  192. package/src/server/lib/connect/cloudflared.server.ts +206 -0
  193. package/src/server/lib/connect/devices.server.ts +192 -0
  194. package/src/server/lib/connect/identity.server.ts +81 -0
  195. package/src/server/lib/connect/pairing.server.test.ts +56 -0
  196. package/src/server/lib/connect/pairing.server.ts +113 -0
  197. package/src/server/lib/connect/qr.roundtrip.test.ts +106 -0
  198. package/src/server/lib/connect/qr.server.ts +36 -0
  199. package/src/server/lib/connect/run.server.ts +101 -0
  200. package/src/server/lib/connect/status.server.ts +177 -0
  201. package/src/server/lib/connect/tailscale.server.test.ts +117 -0
  202. package/src/server/lib/connect/tailscale.server.ts +172 -0
  203. package/src/server/lib/db/schema.ts +4 -0
  204. package/src/server/lib/omp/session/changes.test.ts +64 -1
  205. package/src/server/lib/omp/session/changes.ts +94 -1
  206. package/src/server/routes/connect/devices.ts +56 -0
  207. package/src/server/routes/connect/index.ts +15 -0
  208. package/src/server/routes/connect/pair-page.ts +177 -0
  209. package/src/server/routes/connect/pair.ts +158 -0
  210. package/src/server/routes/connect/status.ts +19 -0
  211. package/src/server/routes/connect/tunnels.ts +76 -0
  212. package/src/server/routes/health/probe.ts +5 -0
  213. package/src/server/routes/index.ts +2 -0
  214. package/src/server/routes/sessions/changes.test.ts +12 -3
  215. package/src/server/routes/sessions/changes.ts +27 -3
  216. package/src/server/routes/sessions/index.ts +2 -1
  217. package/src/shared/lib/connect/payload.test.ts +144 -0
  218. package/src/shared/lib/connect/payload.ts +229 -0
  219. package/src/shared/lib/connect/tier.test.ts +73 -0
  220. package/src/shared/lib/connect/tier.ts +105 -0
  221. package/src/shared/lib/connect/types.ts +99 -0
  222. package/src/shared/lib/dictation/capture-failure.test.ts +46 -0
  223. package/src/shared/lib/dictation/capture-failure.ts +36 -0
  224. package/src/shared/lib/markdown/fira-code-fonts.css +65 -6
  225. package/src/shared/lib/markdown/marked.ts +7 -4
  226. package/src/shared/lib/markdown/mermaid-actions.test.ts +78 -0
  227. package/src/shared/lib/markdown/mermaid-actions.ts +45 -0
  228. package/src/shared/lib/markdown/mermaid.ts +41 -7
  229. package/src/shared/lib/settings/sections.ts +6 -1
  230. package/src/shared/types/session-changes.ts +6 -0
  231. package/src/shared/types/settings/state.ts +2 -0
  232. package/dist/client/static/js/Modal-qtftcp2t.js +0 -38
  233. package/dist/client/static/js/architecture-7GRP2DOG-tavtgb8a.js +0 -1
  234. package/dist/client/static/js/bash-b3rwyg5p.js +0 -1
  235. package/dist/client/static/js/cpp-y0t6mynx.js +0 -1
  236. package/dist/client/static/js/css-6vj0d308.js +0 -1
  237. package/dist/client/static/js/cynefin-OW5HDTMX-cdh3n2z2.js +0 -1
  238. package/dist/client/static/js/eventmodeling-NTZA5JFV-as97tpyp.js +0 -1
  239. package/dist/client/static/js/flowDiagram-KWPJA3E3-ggm06d12.js +0 -1
  240. package/dist/client/static/js/gitGraph-4MIJSDKK-eqz7p9ng.js +0 -1
  241. package/dist/client/static/js/graphql-n43pd5fs.js +0 -1
  242. package/dist/client/static/js/index-at6bhjyf.js +0 -1
  243. package/dist/client/static/js/index-bkye8mz4.js +0 -2
  244. package/dist/client/static/js/index-e94a1en0.css +0 -1
  245. package/dist/client/static/js/index-sffjtm5w.js +0 -12
  246. package/dist/client/static/js/info-A6RAGUB7-4pkzh1qx.js +0 -1
  247. package/dist/client/static/js/ini-j5dyq6gm.js +0 -1
  248. package/dist/client/static/js/java-g4dgwbfd.js +0 -1
  249. package/dist/client/static/js/jsx-7t5ecz9s.js +0 -1
  250. package/dist/client/static/js/lua-1g6w30de.js +0 -1
  251. package/dist/client/static/js/markdown-afx21x8c.js +0 -1
  252. package/dist/client/static/js/one-dark-pro-hm3f56n1.js +0 -1
  253. package/dist/client/static/js/one-light-xrz49rct.js +0 -1
  254. package/dist/client/static/js/packet-AYTQ26CC-yg71sp88.js +0 -1
  255. package/dist/client/static/js/pie-WAS4IAKB-89wd6np0.js +0 -1
  256. package/dist/client/static/js/properties-thd83wey.js +0 -1
  257. package/dist/client/static/js/python-264ns4xw.js +0 -1
  258. package/dist/client/static/js/r-qw82kkv9.js +0 -1
  259. package/dist/client/static/js/radar-RG4KPBEZ-avn0b8r9.js +0 -1
  260. package/dist/client/static/js/railroad-74A4TZTK-de27xv5w.js +0 -1
  261. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rg4zzj7x.js +0 -1
  262. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-d84fhj8v.js +0 -1
  263. package/dist/client/static/js/railroad-peg-WCYAUIDC-dvf8xrmc.js +0 -1
  264. package/dist/client/static/js/sql-g8wcshpc.js +0 -1
  265. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xs2en5dv.js +0 -8
  266. package/dist/client/static/js/treeView-Q6P3EWNA-mham0bh6.js +0 -1
  267. package/dist/client/static/js/treemap-WGGIJYW6-mxrxax86.js +0 -1
  268. package/dist/client/static/js/tsx-nm94hed6.js +0 -1
  269. package/dist/client/static/js/typescript-0s2t05jj.js +0 -1
  270. package/dist/client/static/js/wardley-WFR3VGLG-8vrvh9p3.js +0 -1
  271. package/dist/client/static/js/xml-dz51p1m3.js +0 -1
  272. package/dist/client/static/js/yaml-2cfkd30t.js +0 -1
@@ -0,0 +1,94 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * This server's identity and the addresses it answers on.
8
+ *
9
+ * The identity is shown because a device pins it: when a phone refuses a server
10
+ * that "looks right", the two ids are what the user compares. The addresses are
11
+ * shown with their reason when they do not work — a LAN row on a loopback-only
12
+ * listener says so, rather than looking like a broken network.
13
+ */
14
+
15
+ import { Copy } from 'lucide-preact';
16
+ import type { ConnectAddress, ConnectStatus } from '@/shared/lib/connect/types';
17
+
18
+ const ROUTE_LABEL: Record<ConnectAddress['kind'], string> = {
19
+ tailscale: 'Tailscale',
20
+ lan: 'LAN',
21
+ cloudflare: 'Cloudflare',
22
+ };
23
+
24
+ function copy(value: string): void {
25
+ void navigator.clipboard?.writeText(value).catch(() => {
26
+ // A clipboard the page cannot reach is not worth a dialog: the address is
27
+ // on screen and selectable.
28
+ });
29
+ }
30
+
31
+ export function ServerCard({ status }: { status: ConnectStatus }) {
32
+ return (
33
+ <section className="rounded-xl border border-ink/10 bg-paper">
34
+ <header className="flex flex-wrap items-baseline justify-between gap-2 border-b border-ink/10 px-4 py-3">
35
+ <div className="min-w-0">
36
+ <h4 className="text-sm font-semibold text-ink">{status.label}</h4>
37
+ <p className="mt-0.5 text-[11px] text-ink/60">kabmo {status.version}</p>
38
+ </div>
39
+ <div className="text-right">
40
+ <div className="text-[10px] font-mono uppercase tracking-wider text-ink/40">server id</div>
41
+ <div className="font-mono text-[11px] text-ink/70" title={status.serverId}>
42
+ {status.serverId.slice(0, 6)}…{status.serverId.slice(-4)}
43
+ </div>
44
+ </div>
45
+ </header>
46
+
47
+ <div className="px-4 py-3">
48
+ <div className="mb-2 text-[10px] font-bold uppercase tracking-wider text-ink/40">Addresses</div>
49
+ {status.addresses.length === 0 ? (
50
+ <p className="text-[11px] text-ink/60">
51
+ No address yet. Turn on Tailscale Serve, or start this server with --lan.
52
+ </p>
53
+ ) : (
54
+ <ul className="space-y-1.5">
55
+ {status.addresses.map((address) => {
56
+ const usable = address.unavailable === null && address.url !== '';
57
+ return (
58
+ <li key={`${address.kind}:${address.url}`} className="flex items-start gap-2">
59
+ <span
60
+ aria-hidden="true"
61
+ className={`mt-1.5 h-1.5 w-1.5 flex-shrink-0 rounded-full ${usable ? 'bg-ink' : 'bg-ink/25'}`}
62
+ />
63
+ <div className="min-w-0 flex-1">
64
+ <div className="flex items-baseline gap-2">
65
+ <span className="w-[74px] flex-shrink-0 text-[11px] font-semibold text-ink">
66
+ {ROUTE_LABEL[address.kind]}
67
+ </span>
68
+ <span className={`truncate font-mono text-[11px] ${usable ? 'text-ink/80' : 'text-ink/40'}`}>
69
+ {usable ? address.url : '—'}
70
+ </span>
71
+ </div>
72
+ {address.unavailable && (
73
+ <p className="mt-0.5 pl-[82px] text-[11px] leading-relaxed text-ink/55">{address.unavailable}</p>
74
+ )}
75
+ </div>
76
+ {usable && (
77
+ <button
78
+ type="button"
79
+ onClick={() => copy(address.url)}
80
+ aria-label={`Copy ${ROUTE_LABEL[address.kind]} address`}
81
+ className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
82
+ >
83
+ <Copy size={13} />
84
+ </button>
85
+ )}
86
+ </li>
87
+ );
88
+ })}
89
+ </ul>
90
+ )}
91
+ </div>
92
+ </section>
93
+ );
94
+ }
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * One tunnel provider: its switch, its state, and the sentence that explains it.
8
+ *
9
+ * The switch is the only control that changes anything, and it is disabled while
10
+ * its own request is in flight — not while the other provider's is, because the
11
+ * two are independent and a page that freezes both makes a slow Tailscale call
12
+ * look like a broken Cloudflare row.
13
+ *
14
+ * The Cloudflare card states what it costs: TLS terminates at Cloudflare's edge,
15
+ * so their machines read the console's password and every prompt. That belongs
16
+ * on the card, not in a wiki, because it is the fact that decides whether the
17
+ * user turns it on.
18
+ */
19
+
20
+ import { Copy, ExternalLink } from 'lucide-preact';
21
+ import type { TunnelState } from '@/shared/lib/connect/types';
22
+
23
+ const PROVIDER_COPY: Record<TunnelState['provider'], { title: string; blurb: string }> = {
24
+ tailscale: {
25
+ title: 'Tailscale',
26
+ blurb: 'Serve to your tailnet only. TLS ends on this machine, so Tailscale never sees the traffic.',
27
+ },
28
+ cloudflare: {
29
+ title: 'Cloudflare',
30
+ blurb: 'A public URL. Cloudflare terminates TLS and can read every request, including your password.',
31
+ },
32
+ };
33
+
34
+ const PHASE_LABEL: Record<TunnelState['phase'], string> = {
35
+ off: 'off',
36
+ starting: 'starting…',
37
+ up: 'connected',
38
+ degraded: 'degraded',
39
+ failed: 'unavailable',
40
+ };
41
+
42
+ export interface TunnelRowProps {
43
+ tunnel: TunnelState;
44
+ busy: boolean;
45
+ onToggle: (next: 'start' | 'stop') => void;
46
+ }
47
+
48
+ export function TunnelRow({ tunnel, busy, onToggle }: TunnelRowProps) {
49
+ const copy = PROVIDER_COPY[tunnel.provider];
50
+ const on = tunnel.phase === 'up' || tunnel.phase === 'degraded';
51
+ const canToggle = tunnel.phase !== 'failed';
52
+
53
+ return (
54
+ <div className="px-4 py-3">
55
+ <div className="flex items-start justify-between gap-3">
56
+ <div className="min-w-0">
57
+ <div className="flex items-center gap-2">
58
+ <h5 className="text-sm font-semibold text-ink">{copy.title}</h5>
59
+ <span className="flex items-center gap-1 text-[11px] text-ink/60">
60
+ <span
61
+ aria-hidden="true"
62
+ className={`h-1.5 w-1.5 rounded-full ${on ? 'bg-ink' : 'bg-ink/25'}`}
63
+ />
64
+ {PHASE_LABEL[tunnel.phase]}
65
+ </span>
66
+ </div>
67
+ <p className="mt-1 max-w-[52ch] text-[11px] leading-relaxed text-ink/60">{copy.blurb}</p>
68
+ </div>
69
+
70
+ <button
71
+ type="button"
72
+ role="switch"
73
+ aria-checked={on}
74
+ aria-label={`${on ? 'Stop' : 'Start'} ${copy.title}`}
75
+ disabled={busy || !canToggle}
76
+ onClick={() => onToggle(on ? 'stop' : 'start')}
77
+ className={`relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 ${
78
+ on ? 'bg-ink' : 'bg-ink/20'
79
+ }`}
80
+ >
81
+ <span
82
+ aria-hidden="true"
83
+ className={`pointer-events-none inline-block h-5 w-5 transform rounded-full bg-paper shadow ring-0 transition duration-200 ease-in-out ${
84
+ on ? 'translate-x-5' : 'translate-x-0'
85
+ }`}
86
+ />
87
+ </button>
88
+ </div>
89
+
90
+ {tunnel.url && (
91
+ <div className="mt-2 flex items-center gap-1.5">
92
+ <a
93
+ href={tunnel.url}
94
+ target="_blank"
95
+ rel="noreferrer"
96
+ className="truncate font-mono text-[11px] text-ink/80 underline decoration-ink/20 underline-offset-2 hover:decoration-ink/60"
97
+ >
98
+ {tunnel.url}
99
+ </a>
100
+ <button
101
+ type="button"
102
+ onClick={() => void navigator.clipboard?.writeText(tunnel.url ?? '').catch(() => {})}
103
+ aria-label={`Copy ${copy.title} address`}
104
+ className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
105
+ >
106
+ <Copy size={12} />
107
+ </button>
108
+ <a
109
+ href={tunnel.url}
110
+ target="_blank"
111
+ rel="noreferrer"
112
+ aria-label={`Open ${copy.title} address`}
113
+ className="flex-shrink-0 rounded-md p-1 text-ink/50 transition-colors hover:bg-ink/5 hover:text-ink"
114
+ >
115
+ <ExternalLink size={12} />
116
+ </a>
117
+ </div>
118
+ )}
119
+
120
+ {tunnel.reason && (
121
+ <p className="mt-2 rounded-md border border-ink/10 bg-ink/[0.03] px-2.5 py-1.5 text-[11px] leading-relaxed text-ink/65">
122
+ {tunnel.reason}
123
+ </p>
124
+ )}
125
+ </div>
126
+ );
127
+ }
@@ -0,0 +1,76 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The pairing QR as a file.
8
+ *
9
+ * The download hands the user the same drawing the dialog shows, not a
10
+ * screenshot of it: the geometry (quiet zone, integer pixels per module) is
11
+ * shared with `QrCode`, so a saved code scans exactly like the one on screen.
12
+ * A PNG re-encode would resample module edges — the failure the on-screen
13
+ * renderer already avoids by drawing whole pixels.
14
+ */
15
+
16
+ import { saveBlob } from '@/client/lib/browser/download';
17
+ import type { QrMatrix } from '@/shared/lib/connect/types';
18
+
19
+ export const QUIET_ZONE = 4;
20
+
21
+ /**
22
+ * The widest the code is drawn, in CSS pixels.
23
+ *
24
+ * A screenshot of this dialog is what a camera-less device uploads, so the size
25
+ * is a functional choice, not a layout one: at 260 px a ~100-module code is under
26
+ * 3 px per module, and `jsQR` failed to read a real capture of it ("no QR code
27
+ * found") while the same code at 4 px per module decoded every time.
28
+ */
29
+ export const TARGET_EDGE = 340;
30
+
31
+ export interface QrGeometry {
32
+ span: number;
33
+ modulePx: number;
34
+ edge: number;
35
+ }
36
+
37
+ /**
38
+ * The drawing's dimensions. `modulePx` is an INTEGER: a fractional size makes
39
+ * the browser antialias every module edge, which is exactly what a binarizer
40
+ * cannot read — and it is why the same code scanned from a phone camera but not
41
+ * from a screenshot.
42
+ */
43
+ export function qrGeometry(matrix: QrMatrix): QrGeometry {
44
+ const span = matrix.size + QUIET_ZONE * 2;
45
+ const modulePx = Math.max(3, Math.floor(TARGET_EDGE / span));
46
+ return { span, modulePx, edge: span * modulePx };
47
+ }
48
+
49
+ function escapeXml(value: string): string {
50
+ return value.replace(/[&<>"']/g, (char) => `&#${char.charCodeAt(0)};`);
51
+ }
52
+
53
+ /** The QR as a standalone SVG document, quiet zone included. */
54
+ export function qrSvgMarkup(matrix: QrMatrix, label: string): string {
55
+ const { span, edge } = qrGeometry(matrix);
56
+ const rects: string[] = [];
57
+ for (let row = 0; row < matrix.size; row += 1) {
58
+ const line = matrix.rows[row] ?? '';
59
+ for (let column = 0; column < matrix.size; column += 1) {
60
+ if (line[column] !== '1') continue;
61
+ rects.push(`<rect x="${column + QUIET_ZONE}" y="${row + QUIET_ZONE}" width="1" height="1"/>`);
62
+ }
63
+ }
64
+ return [
65
+ `<svg xmlns="http://www.w3.org/2000/svg" role="img" aria-label="${escapeXml(label)}"`,
66
+ ` viewBox="0 0 ${span} ${span}" width="${edge}" height="${edge}" shape-rendering="crispEdges">`,
67
+ `<rect width="${span}" height="${span}" fill="#ffffff"/>`,
68
+ `<g fill="#141310">${rects.join('')}</g>`,
69
+ '</svg>',
70
+ ].join('');
71
+ }
72
+
73
+ /** Hand the QR to the browser as a downloadable SVG named `name`. */
74
+ export function downloadQrSvg(matrix: QrMatrix, name: string, label: string): void {
75
+ saveBlob(new Blob([qrSvgMarkup(matrix, label)], { type: 'image/svg+xml' }), name);
76
+ }
@@ -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
+ });
@@ -11,10 +11,15 @@
11
11
  * the journal's before/after snapshots, not the worktree. That is the point:
12
12
  * another agent or the user may have edited the file since, and the reader
13
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.
14
17
  */
15
18
 
16
- import { useState } from 'preact/hooks';
19
+ import { useMemo, useState } from 'preact/hooks';
17
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';
18
23
  import type { ChangedFile } from '@/shared/types';
19
24
 
20
25
  const STATUS_LABEL: Record<ChangedFile['status'], string> = {
@@ -35,6 +40,7 @@ interface ChangedFilesSummaryProps {
35
40
  /** Run window, epoch ms — the range the diff tab reads. */
36
41
  from: number;
37
42
  to: number;
43
+ isMobile?: boolean;
38
44
  }
39
45
 
40
46
  export function ChangedFilesSummary({
@@ -42,13 +48,28 @@ export function ChangedFilesSummary({
42
48
  sessionId,
43
49
  from,
44
50
  to,
51
+ isMobile = false,
45
52
  }: ChangedFilesSummaryProps) {
46
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
+
47
67
  if (files.length === 0) return null;
48
68
  const label = `${files.length} file${files.length === 1 ? '' : 's'} changed`;
69
+ const hasTotals = totals.added > 0 || totals.removed > 0;
49
70
 
50
71
  return (
51
- <div className="rounded-md border border-ink/10 bg-paper/60">
72
+ <div className={`${transcriptGutter(isMobile)} rounded-md border border-ink/10 bg-paper/60`}>
52
73
  <button
53
74
  type="button"
54
75
  onClick={() => setExpanded((value) => !value)}
@@ -59,27 +80,42 @@ export function ChangedFilesSummary({
59
80
  ? <ChevronDown size={12} className="shrink-0" />
60
81
  : <ChevronRight size={12} className="shrink-0" />}
61
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
+ )}
62
89
  </button>
63
90
  {expanded && (
64
91
  <ul className="border-t border-ink/10 py-0.5">
65
- {files.map((file) => (
66
- <li key={file.path}>
67
- <button
68
- type="button"
69
- onClick={() => openJournalDiff(file, sessionId, from, to)}
70
- 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"
71
- title={file.path}
72
- >
73
- <span className={`w-3 shrink-0 font-mono font-semibold ${STATUS_CLASS[file.status]}`}>
74
- {STATUS_LABEL[file.status]}
75
- </span>
76
- <span className="min-w-0 flex-1 truncate font-mono text-ink/80">{file.displayPath}</span>
77
- {file.agent !== 'Main' && (
78
- <span className="shrink-0 text-[10px] text-ink/40">{file.agent}</span>
79
- )}
80
- </button>
81
- </li>
82
- ))}
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
+ })}
83
119
  </ul>
84
120
  )}
85
121
  </div>
@@ -90,6 +90,7 @@ export function RunFooter({
90
90
  sessionId={sessionId}
91
91
  from={runWindow.start}
92
92
  to={runWindow.end}
93
+ isMobile={isMobile}
93
94
  />
94
95
  </div>
95
96
  )}