@kabmo-labs/kabmo 0.58.1 → 0.59.1

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 (399) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +513 -495
  3. package/dist/client/static/js/{Body-ysmhxbvk.js → Body-5yedtmnk.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-w90pxyn2.js → CsvGrid-39m8pp1c.js} +2 -2
  5. package/dist/client/static/js/{DocxView-evxn6kaq.js → DocxView-vd99cv12.js} +3 -3
  6. package/dist/client/static/js/{DrawioView-tmdevwf4.js → DrawioView-6nq4412n.js} +2 -2
  7. package/dist/client/static/js/{HtmlPreview-bpsn2z9p.js → HtmlPreview-cs51gszy.js} +1 -1
  8. package/dist/client/static/js/ImageView-nc2n0w6s.js +1 -0
  9. package/dist/client/static/js/LayoutWrapper-j7786frq.js +2 -0
  10. package/dist/client/static/js/MergeDiffView-0rn5zsy5.js +1 -0
  11. package/dist/client/static/js/Modal-7ag7a9qq.js +60 -0
  12. package/dist/client/static/js/{PdfView-txxn6qff.js → PdfView-0zab721q.js} +1 -1
  13. package/dist/client/static/js/SessionsView-t9rhx472.js +1 -0
  14. package/dist/client/static/js/{SheetView-52b33e6f.js → SheetView-2wdn5hkd.js} +11 -11
  15. package/dist/client/static/js/{SvgPreview-hrk4pfm1.js → SvgPreview-fmrfxd7z.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-at77sybc.js → abnfDiagram-O67JEVCF-41scfh9v.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-bwn1drdz.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-raw33jgg.js → architectureDiagram-NJMV4G6O-fp6etjvt.js} +3 -3
  19. package/dist/client/static/js/{astro-qha7sceh.js → astro-ryr2ajmg.js} +1 -1
  20. package/dist/client/static/js/bash-zknkkwkw.js +1 -0
  21. package/dist/client/static/js/{blockDiagram-BEXU5L5S-b6e90fbk.js → blockDiagram-BEXU5L5S-pespk9mt.js} +4 -4
  22. package/dist/client/static/js/c-0w02jkxb.js +1 -0
  23. package/dist/client/static/js/{c4Diagram-YGBWAQC7-msg9y1c6.js → c4Diagram-YGBWAQC7-rt4z91dx.js} +2 -2
  24. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-jmrd1h8r.js → classDiagram-v2-NBCMYWYE-6bzaq8sd.js} +4 -4
  25. package/dist/client/static/js/{cose-bilkent-JH36ORCC-na65ebq3.js → cose-bilkent-JH36ORCC-z3fhgcba.js} +1 -1
  26. package/dist/client/static/js/cpp-p5b4vean.js +1 -0
  27. package/dist/client/static/js/css-9jzbvdyz.js +1 -0
  28. package/dist/client/static/js/css-sn00sq6v.js +1 -0
  29. package/dist/client/static/js/cynefin-OW5HDTMX-jbc50ks8.js +1 -0
  30. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-9xkkw71m.js → cynefinDiagram-VND7K2PF-8endeh4p.js} +2 -2
  31. package/dist/client/static/js/{dagre-6A5THRUB-p59f19tv.js → dagre-6A5THRUB-2a2f32dv.js} +2 -2
  32. package/dist/client/static/js/{diagram-22UHCM2B-2e2rcvn7.js → diagram-22UHCM2B-wgbyr6b7.js} +9 -9
  33. package/dist/client/static/js/{diagram-3UASUU5V-r9ds8vgr.js → diagram-3UASUU5V-5122b41x.js} +1 -1
  34. package/dist/client/static/js/{diagram-ATOU4E4O-jgwxv7v8.js → diagram-ATOU4E4O-1gt9fr7e.js} +3 -3
  35. package/dist/client/static/js/{diagram-CDSNMT55-20m35eqq.js → diagram-CDSNMT55-v6hs59jb.js} +4 -4
  36. package/dist/client/static/js/{diagram-MLGK6HIB-vt3kxt2m.js → diagram-MLGK6HIB-yey2m5nm.js} +1 -1
  37. package/dist/client/static/js/{diagram-MPIPVDR6-c47rgxf1.js → diagram-MPIPVDR6-hg4f3q4d.js} +2 -2
  38. package/dist/client/static/js/{dockerfile-gtcyey0q.js → dockerfile-56tfnp5r.js} +1 -1
  39. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-aszw3xy3.js → ebnfDiagram-ZINNZB2B-2mhc9aar.js} +1 -1
  40. package/dist/client/static/js/{elixir-w92v180e.js → elixir-fyxw6d70.js} +1 -1
  41. package/dist/client/static/js/{elk-276RUBZZ-gbvr3gry.js → elk-276RUBZZ-wedtvz9y.js} +2 -2
  42. package/dist/client/static/js/{erDiagram-OPXOYQCR-1hqca8qe.js → erDiagram-OPXOYQCR-1kysnby9.js} +6 -6
  43. package/dist/client/static/js/{erlang-v7344938.js → erlang-97ayje6m.js} +1 -1
  44. package/dist/client/static/js/eventmodeling-NTZA5JFV-b37ey01t.js +1 -0
  45. package/dist/client/static/js/flowDiagram-KWPJA3E3-vd4z6bvy.js +1 -0
  46. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-07v22te5.js → ganttDiagram-FUAMR5RP-j4g65rpm.js} +3 -3
  47. package/dist/client/static/js/gitGraph-4MIJSDKK-mvqq7tcs.js +1 -0
  48. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-y068jtz9.js → gitGraphDiagram-X574FWY7-vcwmj4b3.js} +8 -8
  49. package/dist/client/static/js/graphql-xzykn0ba.js +1 -0
  50. package/dist/client/static/js/html-2zc3shky.js +1 -0
  51. package/dist/client/static/js/{index-r8d4bk86.js → index-10vzyga1.js} +2 -2
  52. package/dist/client/static/js/index-1mkn5fbf.js +481 -0
  53. package/dist/client/static/js/{index-medk4f18.js → index-2h7xh93h.js} +2 -2
  54. package/dist/client/static/js/{index-fhtnvqgf.js → index-3j2he86h.js} +2 -2
  55. package/dist/client/static/js/{index-zhgh7a31.js → index-3kedv94b.js} +2 -2
  56. package/dist/client/static/js/{index-374xq5a4.js → index-42k78whj.js} +1 -1
  57. package/dist/client/static/js/{index-c9aqx3ht.js → index-42q5gg7t.js} +1 -1
  58. package/dist/client/static/js/index-461ga40v.js +2 -0
  59. package/dist/client/static/js/{index-9qf2h9jb.js → index-51rbgeh9.js} +12 -12
  60. package/dist/client/static/js/{index-tdg7hz80.js → index-58z2hatp.js} +2 -2
  61. package/dist/client/static/js/{index-4tbdws4r.js → index-5e4e18tg.js} +2 -2
  62. package/dist/client/static/js/{index-th61y26d.js → index-69mnn71v.js} +2 -2
  63. package/dist/client/static/js/index-6vbra7p9.js +1 -0
  64. package/dist/client/static/js/{index-007sewcn.js → index-7enfdvh0.js} +2 -2
  65. package/dist/client/static/js/{index-gaa39w5q.js → index-8tzt0dek.js} +2 -2
  66. package/dist/client/static/js/{index-ewryzs4g.js → index-92h38pwg.js} +2 -2
  67. package/dist/client/static/js/{index-vw8b29ek.js → index-9mgpbwfr.js} +1 -1
  68. package/dist/client/static/js/{index-80kx6dm6.js → index-a3bpmw2r.js} +2 -2
  69. package/dist/client/static/js/{index-fv7nybnf.js → index-a70sk36c.js} +2 -2
  70. package/dist/client/static/js/index-c5401dqs.js +4 -0
  71. package/dist/client/static/js/{index-xmg1x6zv.js → index-csxnqgzw.js} +5 -5
  72. package/dist/client/static/js/{index-qefssj0m.js → index-d201jvs9.js} +1 -1
  73. package/dist/client/static/js/{index-y0f3wbc3.js → index-d9sfavx1.js} +2 -2
  74. package/dist/client/static/js/{index-5hvt233n.js → index-db6s66jr.js} +2 -2
  75. package/dist/client/static/js/index-dbsy29gn.js +2 -0
  76. package/dist/client/static/js/{index-j830qk07.js → index-dw9epydj.js} +2 -2
  77. package/dist/client/static/js/{index-s4dpkds5.js → index-e39m185a.js} +2 -2
  78. package/dist/client/static/js/{index-dxq1tbwm.js → index-fg0ne74z.js} +2 -2
  79. package/dist/client/static/js/{index-hb7a7m9m.js → index-fnaq8baz.js} +1 -1
  80. package/dist/client/static/js/{index-tq3t3qm4.js → index-fsa18ns9.js} +2 -2
  81. package/dist/client/static/js/{index-wxqcnsrq.js → index-fvphmwkf.js} +2 -2
  82. package/dist/client/static/js/{index-94d416ee.js → index-gajpd90b.js} +2 -2
  83. package/dist/client/static/js/{index-rxt8sf9a.js → index-h1xbx74w.js} +2 -2
  84. package/dist/client/static/js/{index-1e0rt7c6.js → index-hgzf4ask.js} +5 -5
  85. package/dist/client/static/js/{index-wn28m9h7.js → index-hrez92pw.js} +8 -8
  86. package/dist/client/static/js/{index-zs7kw0be.js → index-jaf968hx.js} +4 -4
  87. package/dist/client/static/js/{index-sxag9ptg.js → index-jct0jryd.js} +2 -2
  88. package/dist/client/static/js/{index-5xxbbzqa.js → index-kt77dwsg.js} +7 -7
  89. package/dist/client/static/js/{index-8d8ce00v.js → index-m62sf9wn.js} +2 -2
  90. package/dist/client/static/js/{index-6x0kn8pb.js → index-mhrkjbjq.js} +2 -2
  91. package/dist/client/static/js/index-mttx9327.css +1 -0
  92. package/dist/client/static/js/{index-1e710snk.js → index-n7bmqeqz.js} +1 -1
  93. package/dist/client/static/js/{index-3ymw778n.js → index-ndqtff48.js} +2 -2
  94. package/dist/client/static/js/{index-cmjyet7w.js → index-nf4hq5tg.js} +27 -27
  95. package/dist/client/static/js/{index-3p732mvs.js → index-np2rfq06.js} +2 -2
  96. package/dist/client/static/js/{index-2s17netq.js → index-nwbr15b3.js} +2 -2
  97. package/dist/client/static/js/{index-nptbz7sv.js → index-pn0ja904.js} +1 -1
  98. package/dist/client/static/js/{index-azz46nwc.js → index-pr8wsq24.js} +2 -2
  99. package/dist/client/static/js/{index-7sq6cjt1.js → index-q3k8r0ms.js} +11 -11
  100. package/dist/client/static/js/{index-an7fq7f6.js → index-qc3de995.js} +1 -1
  101. package/dist/client/static/js/{index-f61c25vn.js → index-r42f3r1p.js} +3 -3
  102. package/dist/client/static/js/{index-e4nge3f4.js → index-s7p2wdr1.js} +1 -1
  103. package/dist/client/static/js/{index-vny4ymjf.js → index-sg65xdey.js} +1 -1
  104. package/dist/client/static/js/index-skp6991n.js +2 -0
  105. package/dist/client/static/js/index-spnrx2c0.js +2 -0
  106. package/dist/client/static/js/{index-fe92hqmb.js → index-sqyvj03y.js} +4 -4
  107. package/dist/client/static/js/{index-cpp43af3.js → index-tz5ewsza.js} +9 -9
  108. package/dist/client/static/js/{index-v8xhgfeq.js → index-vs2y8gxr.js} +2 -2
  109. package/dist/client/static/js/{index-e0kahttb.js → index-vs3g6njv.js} +1 -1
  110. package/dist/client/static/js/index-wkxsypj1.js +2 -0
  111. package/dist/client/static/js/{index-gqrt766t.js → index-xqz7bqcn.js} +61 -61
  112. package/dist/client/static/js/{index-jxsha63v.js → index-y4cx8cqf.js} +2 -2
  113. package/dist/client/static/js/{index-kzzvrqnv.js → index-y5pkqrga.js} +2 -2
  114. package/dist/client/static/js/{index-3m1dksmy.js → index-yrwm437g.js} +2 -2
  115. package/dist/client/static/js/{index-7ynf3s2w.js → index-z82nd2bd.js} +2 -2
  116. package/dist/client/static/js/info-A6RAGUB7-zkv4crz7.js +1 -0
  117. package/dist/client/static/js/{infoDiagram-VRGFBTTK-1x83h4k4.js → infoDiagram-VRGFBTTK-7craq9x2.js} +2 -2
  118. package/dist/client/static/js/ini-62r3vxaf.js +1 -0
  119. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-et6z3c28.js → ishikawaDiagram-OU5B5YK6-ncjty2re.js} +2 -2
  120. package/dist/client/static/js/java-kacycary.js +1 -0
  121. package/dist/client/static/js/javascript-zc1qnyyp.js +1 -0
  122. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-sw669e7a.js → journeyDiagram-ZHPQQLJL-yx222bzt.js} +2 -2
  123. package/dist/client/static/js/json-yrwpn6bd.js +1 -0
  124. package/dist/client/static/js/jsx-b40ag8q1.js +1 -0
  125. package/dist/client/static/js/{julia-z14p8jsx.js → julia-agc5kfvg.js} +1 -1
  126. package/dist/client/static/js/{kanban-definition-PNTS6WVX-aqxg95kx.js → kanban-definition-PNTS6WVX-a2f84qmn.js} +6 -6
  127. package/dist/client/static/js/lua-bk961f37.js +1 -0
  128. package/dist/client/static/js/markdown-b7rgzgd6.js +1 -0
  129. package/dist/client/static/js/mermaid.core-9vfwthw3.js +12 -0
  130. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-530anpc4.js → mindmap-definition-NLK3R4M7-fsxysg6f.js} +4 -4
  131. package/dist/client/static/js/one-dark-pro-7v4by00h.js +1 -0
  132. package/dist/client/static/js/one-light-5rfzh8p4.js +1 -0
  133. package/dist/client/static/js/packet-AYTQ26CC-dgpge627.js +1 -0
  134. package/dist/client/static/js/{pegDiagram-GJSIUBJH-5zar6hvy.js → pegDiagram-GJSIUBJH-77wxmp9g.js} +1 -1
  135. package/dist/client/static/js/{perl-1na2x6yd.js → perl-v5vbtzgf.js} +1 -1
  136. package/dist/client/static/js/{php-x75tt7w3.js → php-83qwy98t.js} +1 -1
  137. package/dist/client/static/js/pie-WAS4IAKB-b8pgsqrd.js +1 -0
  138. package/dist/client/static/js/{pieDiagram-5QR66LMP-3bx8syvw.js → pieDiagram-5QR66LMP-gvgfhez0.js} +3 -3
  139. package/dist/client/static/js/properties-k8gbzggp.js +1 -0
  140. package/dist/client/static/js/python-343tspad.js +1 -0
  141. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-yaarpr2e.js → quadrantDiagram-O4NWA36T-9zkbt5h8.js} +2 -2
  142. package/dist/client/static/js/r-ycdwmv8g.js +1 -0
  143. package/dist/client/static/js/radar-RG4KPBEZ-fmfe5y27.js +1 -0
  144. package/dist/client/static/js/railroad-74A4TZTK-b5tks4ce.js +1 -0
  145. package/dist/client/static/js/railroad-abnf-HS5TGJTU-0sf4m0ze.js +1 -0
  146. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pjfy3pt7.js +1 -0
  147. package/dist/client/static/js/railroad-peg-WCYAUIDC-nr8ngt42.js +1 -0
  148. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-ag41q4nt.js → railroadDiagram-XR7U4H2S-w55bsyw6.js} +1 -1
  149. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g8sr48h4.js → requirementDiagram-PLB6GJNP-828s1e5g.js} +3 -3
  150. package/dist/client/static/js/{ruby-3h22qahv.js → ruby-994n5j6e.js} +1 -1
  151. package/dist/client/static/js/{rust-r27demr5.js → rust-csv5f258.js} +1 -1
  152. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-t1wbd1hh.js → sankeyDiagram-IPEJSGJF-34f3fyvg.js} +3 -3
  153. package/dist/client/static/js/{sass-8bq5r2tz.js → sass-p6g7qdv2.js} +1 -1
  154. package/dist/client/static/js/{scss-c04ezwnn.js → scss-4j4t3r6y.js} +1 -1
  155. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-407mjqty.js → sequenceDiagram-PO4LG4MO-nnta2hn0.js} +7 -7
  156. package/dist/client/static/js/{sizeCapture-INFHLROL-w38zb9ky.js → sizeCapture-INFHLROL-gpcramga.js} +1 -1
  157. package/dist/client/static/js/sql-kwpd5w07.js +1 -0
  158. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-4cvgymkc.js → stateDiagram-v2-GCMORJYK-3f2en220.js} +3 -3
  159. package/dist/client/static/js/{svelte-egg3x4tw.js → svelte-bek3h1sz.js} +1 -1
  160. package/dist/client/static/js/{swimlanes-2SLR337P-w7ts2rzw.js → swimlanes-2SLR337P-jgqt12z9.js} +1 -1
  161. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xx1z57df.js +8 -0
  162. package/dist/client/static/js/{timeline-definition-EJHVYXUP-nq46nzy9.js → timeline-definition-EJHVYXUP-sgchcs11.js} +3 -3
  163. package/dist/client/static/js/treeView-Q6P3EWNA-23r9fa68.js +1 -0
  164. package/dist/client/static/js/treemap-WGGIJYW6-mxxzdrj6.js +1 -0
  165. package/dist/client/static/js/tsx-gjxfjnbk.js +1 -0
  166. package/dist/client/static/js/typescript-4dchbnya.js +1 -0
  167. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-q144snzb.js → usecaseDiagram-POWQR4AR-znkg9pkq.js} +15 -15
  168. package/dist/client/static/js/{vennDiagram-UO4OBE2U-2wemak2p.js → vennDiagram-UO4OBE2U-dncg96ej.js} +4 -4
  169. package/dist/client/static/js/{vue-d7p4wv35.js → vue-y44m889c.js} +1 -1
  170. package/dist/client/static/js/wardley-WFR3VGLG-cbqtax1x.js +1 -0
  171. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-bb2qvvgr.js → wardleyDiagram-VNRHLVJA-77xz2d49.js} +4 -4
  172. package/dist/client/static/js/xml-xs6qz3ya.js +1 -0
  173. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9dr05fdq.js → xychartDiagram-PMCCYNJV-40j1aqyf.js} +4 -4
  174. package/dist/client/static/js/yaml-174nk5bn.js +1 -0
  175. package/package.json +7 -7
  176. package/src/client/borders.css +15 -3
  177. package/src/client/components/common/ComposerTextarea.test.tsx +13 -1
  178. package/src/client/components/common/ComposerTextarea.tsx +8 -2
  179. package/src/client/components/common/MarkdownRenderer.tsx +11 -2
  180. package/src/client/components/common/harness-glyph/harness-glyph.test.ts +0 -4
  181. package/src/client/components/common/harness-glyph/index.tsx +4 -5
  182. package/src/client/components/common/markdown-inline-file.test.tsx +90 -15
  183. package/src/client/components/common/session-actions-menu/index.test.tsx +45 -0
  184. package/src/client/components/common/session-actions-menu/index.tsx +6 -1
  185. package/src/client/components/common/session-row/TrailingSlot.tsx +8 -1
  186. package/src/client/components/common/session-row/index.tsx +4 -0
  187. package/src/client/components/common/session-row/session-row.test.tsx +5 -0
  188. package/src/client/components/layout/desktop-layout/RightColumn.tsx +4 -1
  189. package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +28 -35
  190. package/src/client/components/layout/desktop-layout/index.tsx +5 -3
  191. package/src/client/components/layout/desktop-layout/resizer/index.tsx +13 -3
  192. package/src/client/components/layout/desktop-layout/resizer/panel.test.ts +41 -0
  193. package/src/client/components/layout/session-sidebar/CategoryHeader.tsx +21 -1
  194. package/src/client/components/layout/session-sidebar/CategoryHeader.worktree.test.tsx +1 -0
  195. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +8 -2
  196. package/src/client/components/layout/session-sidebar/ClassicView.tsx +2 -0
  197. package/src/client/components/layout/session-sidebar/SessionList.tsx +4 -0
  198. package/src/client/components/layout/session-sidebar/SessionsView.tsx +22 -1
  199. package/src/client/components/layout/session-sidebar/modern/RevealRow.tsx +36 -5
  200. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +45 -28
  201. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +10 -3
  202. package/src/client/components/layout/session-sidebar/modern/index.tsx +2 -0
  203. package/src/client/components/layout/session-sidebar/modern/reveal-row.test.tsx +28 -1
  204. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +27 -11
  205. package/src/client/components/layout/session-sidebar/search-results.test.tsx +29 -16
  206. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +1 -0
  207. package/src/client/components/layout/session-sidebar/variant-props.ts +2 -0
  208. package/src/client/components/mobile/LayoutWrapper.tsx +9 -0
  209. package/src/client/components/mobile/SessionSidebar.tsx +4 -0
  210. package/src/client/components/mobile/left-drawer-nav.test.tsx +1 -1
  211. package/src/client/components/mobile/mobile-session-sidebar/Body.tsx +4 -0
  212. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +3 -0
  213. package/src/client/components/mobile/mobile-session-sidebar/Item.test.tsx +85 -0
  214. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +30 -14
  215. package/src/client/components/mobile/mobile-session-sidebar/List.tsx +4 -0
  216. package/src/client/components/settings/apply-side-effects.test.ts +31 -0
  217. package/src/client/components/settings/apply-side-effects.ts +7 -0
  218. package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +3 -2
  219. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.test.tsx +95 -0
  220. package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +35 -0
  221. package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +1 -0
  222. package/src/client/components/workspace/chat-timeline/MessageItem.gutter.test.ts +26 -0
  223. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +6 -3
  224. package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +17 -0
  225. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +9 -3
  226. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +39 -2
  227. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +19 -4
  228. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.tsx +28 -21
  229. package/src/client/components/workspace/chat-timeline/chat-input/AttachmentToolbar.wait.test.tsx +48 -0
  230. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +44 -21
  231. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.test.ts +24 -0
  232. package/src/client/components/workspace/chat-timeline/chat-input/GoalBanner.tsx +44 -18
  233. package/src/client/components/workspace/chat-timeline/chat-input/GoalSurfaces.tsx +2 -1
  234. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.test.ts +35 -0
  235. package/src/client/components/workspace/chat-timeline/chat-input/ModeToggles.tsx +33 -12
  236. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +24 -0
  237. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +14 -3
  238. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +24 -1
  239. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +78 -135
  240. package/src/client/components/workspace/chat-timeline/chat-input/VoiceButton.tsx +58 -0
  241. package/src/client/components/workspace/chat-timeline/chat-input/action-base.ts +42 -0
  242. package/src/client/components/workspace/chat-timeline/chat-input/index.tsx +1 -0
  243. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.test.ts +108 -0
  244. package/src/client/components/workspace/chat-timeline/chat-input/mode-icons.tsx +122 -0
  245. package/src/client/components/workspace/chat-timeline/chat-input/narrow.test.tsx +78 -20
  246. package/src/client/components/workspace/chat-timeline/chat-input/styles/index.tsx +11 -5
  247. package/src/client/components/workspace/chat-timeline/chat-input/styles.test.tsx +19 -0
  248. package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +9 -0
  249. package/src/client/components/workspace/chat-timeline/index.tsx +1 -1
  250. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.test.tsx +125 -0
  251. package/src/client/components/workspace/chat-timeline/tool-renderers/ask-panel/OptionRow.tsx +84 -27
  252. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.test.tsx +18 -0
  253. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Mcp.tsx +14 -5
  254. package/src/client/components/workspace/model-dropdown/CloseButton.tsx +2 -2
  255. package/src/client/components/workspace/model-dropdown/Fullscreen.tsx +2 -2
  256. package/src/client/components/workspace/model-dropdown/HarnessTabs.tsx +40 -10
  257. package/src/client/components/workspace/model-dropdown/Header.tsx +33 -18
  258. package/src/client/components/workspace/model-dropdown/Panel.tsx +19 -1
  259. package/src/client/components/workspace/model-dropdown/ThinkingLevels.tsx +51 -0
  260. package/src/client/components/workspace/model-dropdown/Trigger.tsx +99 -0
  261. package/src/client/components/workspace/model-dropdown/bands.ts +51 -0
  262. package/src/client/components/workspace/model-dropdown/harness-tabs.test.tsx +39 -5
  263. package/src/client/components/workspace/model-dropdown/index.tsx +20 -47
  264. package/src/client/components/workspace/model-dropdown/picker-close.test.tsx +34 -4
  265. package/src/client/components/workspace/model-dropdown/thinking-levels.test.tsx +108 -0
  266. package/src/client/components/workspace/model-dropdown/trigger.test.ts +54 -8
  267. package/src/client/hooks/chat/composer/attachments.test.ts +12 -0
  268. package/src/client/hooks/chat/composer/attachments.ts +16 -4
  269. package/src/client/hooks/chat/composer/pipeline.test.ts +14 -0
  270. package/src/client/hooks/chat/composer/pipeline.ts +15 -6
  271. package/src/client/hooks/chat/omp/session-list.activity.test.ts +20 -0
  272. package/src/client/hooks/chat/omp/session-merges.ts +18 -6
  273. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +4 -0
  274. package/src/client/hooks/chat/timeline/scope.test.ts +17 -0
  275. package/src/client/hooks/chat/timeline/scope.ts +6 -1
  276. package/src/client/hooks/chat/timeline/send-refusal.test.ts +19 -0
  277. package/src/client/hooks/chat/timeline/send-steer.test.ts +17 -0
  278. package/src/client/hooks/chat/timeline/send.ts +17 -0
  279. package/src/client/hooks/editor/quick-open.ts +41 -0
  280. package/src/client/hooks/ui/border-style.test.ts +13 -0
  281. package/src/client/hooks/ui/markdown-render.ts +11 -6
  282. package/src/client/hooks/ui/open-inline-file.test.ts +16 -0
  283. package/src/client/hooks/ui/open-inline-file.ts +4 -2
  284. package/src/client/hooks/ui/show-more.ts +11 -1
  285. package/src/client/hooks/ui/ui-feedback.test.ts +11 -0
  286. package/src/client/hooks/ui/verified-inline-files.test.tsx +143 -0
  287. package/src/client/hooks/ui/verified-inline-files.ts +165 -0
  288. package/src/client/hooks/workspace/mobile-workspace-panels.test.tsx +116 -0
  289. package/src/client/hooks/workspace/mobile-workspace-panels.ts +73 -0
  290. package/src/client/hooks/workspace/panel-resize.test.ts +127 -0
  291. package/src/client/hooks/workspace/panel-resize.ts +81 -0
  292. package/src/client/hooks/workspace/session-list-limit.test.ts +80 -0
  293. package/src/client/hooks/workspace/session-list-limit.ts +69 -0
  294. package/src/client/hooks/workspace/session-pin.ts +58 -0
  295. package/src/client/hooks/workspace/workspace-panels-mode.test.tsx +87 -0
  296. package/src/client/hooks/workspace/workspace-panels-mode.ts +76 -0
  297. package/src/client/lib/router/branch-params.test.ts +17 -1
  298. package/src/client/lib/router/branch-params.ts +18 -0
  299. package/src/client/lib/ui/pressed.ts +15 -0
  300. package/src/client/tailwind.css +30 -10
  301. package/src/server/lib/connect/cloudflared.lifecycle.test.ts +25 -9
  302. package/src/server/lib/db/schema.test.ts +1 -1
  303. package/src/server/lib/db/schema.ts +17 -0
  304. package/src/server/lib/harness/activity.server.test.ts +81 -0
  305. package/src/server/lib/harness/activity.server.ts +55 -0
  306. package/src/server/lib/harness/spawn.server.ts +9 -0
  307. package/src/server/lib/omp/session/delete.server.ts +4 -2
  308. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +24 -2
  309. package/src/server/lib/omp/session/sidebar-data.canonical.test.ts +14 -0
  310. package/src/server/lib/sessions/last-opened.server.test.ts +17 -0
  311. package/src/server/lib/sessions/last-opened.server.ts +18 -1
  312. package/src/server/routes/sessions/index.ts +3 -2
  313. package/src/server/routes/sessions/routes.test.ts +29 -46
  314. package/src/server/routes/sessions/session.ts +40 -62
  315. package/src/server/routes/sessions/state.test.ts +89 -0
  316. package/src/server/routes/sessions/state.ts +86 -0
  317. package/src/shared/lib/chat/attachment-budget.test.ts +74 -0
  318. package/src/shared/lib/chat/attachment-budget.ts +111 -0
  319. package/src/shared/lib/chat/attachments.test.ts +0 -17
  320. package/src/shared/lib/chat/attachments.ts +0 -53
  321. package/src/shared/lib/chat/timeline/block-chrome.test.ts +35 -0
  322. package/src/shared/lib/chat/timeline/block-chrome.ts +21 -0
  323. package/src/shared/lib/markdown/degenerate-emphasis.test.ts +64 -0
  324. package/src/shared/lib/markdown/degenerate-emphasis.ts +90 -0
  325. package/src/shared/lib/markdown/inline-file.test.ts +79 -22
  326. package/src/shared/lib/markdown/inline-file.ts +57 -25
  327. package/src/shared/lib/markdown/marked.ts +5 -1
  328. package/src/shared/lib/settings/defaults.ts +2 -0
  329. package/src/shared/lib/theme/border-style.ts +1 -1
  330. package/src/shared/lib/workspace/active-project.test.ts +17 -1
  331. package/src/shared/lib/workspace/active-project.ts +9 -0
  332. package/src/shared/lib/workspace/project-settings-delete.test.ts +97 -0
  333. package/src/shared/lib/workspace/project-settings.test.ts +2 -34
  334. package/src/shared/lib/workspace/project-settings.ts +6 -0
  335. package/src/shared/lib/workspace/session-list-limit.test.ts +31 -0
  336. package/src/shared/lib/workspace/session-list-limit.ts +32 -0
  337. package/src/shared/lib/workspace/sidebar-sort.test.ts +21 -0
  338. package/src/shared/lib/workspace/workspace-panel-widths.ts +1 -1
  339. package/src/shared/lib/workspace/workspace-session.test.ts +34 -0
  340. package/src/shared/lib/workspace/workspace-session.ts +40 -0
  341. package/src/shared/types/settings/state.ts +10 -0
  342. package/dist/client/static/js/ImageView-ssazqckj.js +0 -1
  343. package/dist/client/static/js/LayoutWrapper-qwpfq4dq.js +0 -2
  344. package/dist/client/static/js/MergeDiffView-en6aazw8.js +0 -1
  345. package/dist/client/static/js/Modal-zjnhj9nb.js +0 -60
  346. package/dist/client/static/js/SessionsView-eryjtmb2.js +0 -1
  347. package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +0 -1
  348. package/dist/client/static/js/bash-n5d0esqg.js +0 -1
  349. package/dist/client/static/js/c-pk766wx0.js +0 -1
  350. package/dist/client/static/js/cpp-3pt91jvm.js +0 -1
  351. package/dist/client/static/js/css-q2k6afe3.js +0 -1
  352. package/dist/client/static/js/css-sp1cgdbr.js +0 -1
  353. package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +0 -1
  354. package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +0 -1
  355. package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +0 -1
  356. package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +0 -1
  357. package/dist/client/static/js/graphql-qx4tt6ze.js +0 -1
  358. package/dist/client/static/js/html-5e0g8664.js +0 -1
  359. package/dist/client/static/js/index-4ddgpqm0.css +0 -1
  360. package/dist/client/static/js/index-5g2j626a.js +0 -1
  361. package/dist/client/static/js/index-cc7qbfvn.js +0 -477
  362. package/dist/client/static/js/index-f27wvdky.js +0 -4
  363. package/dist/client/static/js/index-m5n0zsft.js +0 -2
  364. package/dist/client/static/js/index-rqt8mem9.js +0 -2
  365. package/dist/client/static/js/index-s9k82stc.js +0 -2
  366. package/dist/client/static/js/index-skwem10a.js +0 -2
  367. package/dist/client/static/js/index-tv9rn2nd.js +0 -2
  368. package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +0 -1
  369. package/dist/client/static/js/ini-bdk46a3d.js +0 -1
  370. package/dist/client/static/js/java-3g3925cf.js +0 -1
  371. package/dist/client/static/js/javascript-av46zx4c.js +0 -1
  372. package/dist/client/static/js/json-hdyzmffz.js +0 -1
  373. package/dist/client/static/js/jsx-y8r9mrdq.js +0 -1
  374. package/dist/client/static/js/lua-wf5k6p3r.js +0 -1
  375. package/dist/client/static/js/markdown-9bf16dx7.js +0 -1
  376. package/dist/client/static/js/mermaid.core-6cgqsgcf.js +0 -12
  377. package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +0 -1
  378. package/dist/client/static/js/one-light-2n5y8592.js +0 -1
  379. package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +0 -1
  380. package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +0 -1
  381. package/dist/client/static/js/properties-xk4dn00p.js +0 -1
  382. package/dist/client/static/js/python-7sgz05n4.js +0 -1
  383. package/dist/client/static/js/r-w4qxm0pv.js +0 -1
  384. package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +0 -1
  385. package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +0 -1
  386. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +0 -1
  387. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +0 -1
  388. package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +0 -1
  389. package/dist/client/static/js/sql-sd00wgem.js +0 -1
  390. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-v82nym6b.js +0 -8
  391. package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +0 -1
  392. package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +0 -1
  393. package/dist/client/static/js/tsx-h5yzg80q.js +0 -1
  394. package/dist/client/static/js/typescript-qy1sbhea.js +0 -1
  395. package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +0 -1
  396. package/dist/client/static/js/xml-mrk4xakv.js +0 -1
  397. package/dist/client/static/js/yaml-xaza6dra.js +0 -1
  398. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +0 -110
  399. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +0 -86
@@ -46,6 +46,26 @@ describe('SidebarDataProvider merges the activity topic', () => {
46
46
  harness.server.stop();
47
47
  });
48
48
 
49
+ test('lifts the running row to the top of its folder when its stamp advances', async () => {
50
+ const harness = await mountProvider();
51
+ await harness.push({
52
+ folders: [{
53
+ id: 1, name: 'ws', isExpanded: true, hasMore: false, totalSessions: 3,
54
+ sessions: [
55
+ { id: 'a', folder_id: 1, title: 'A', updated_at: '2026-10-24T01:00:00.000Z' },
56
+ { id: 'b', folder_id: 1, title: 'B', updated_at: '2026-10-24T00:30:00.000Z' },
57
+ { id: 'c', folder_id: 1, title: 'C', updated_at: '2026-10-24T00:10:00.000Z' },
58
+ ],
59
+ }],
60
+ isMock: false,
61
+ });
62
+
63
+ await harness.push(undefined, undefined, { c: { updatedAt: '2026-10-24T01:05:00.000Z' } });
64
+
65
+ expect(harness.holder.api?.folders[0]?.sessions?.map((session) => session.id)).toEqual(['c', 'a', 'b']);
66
+ harness.server.stop();
67
+ });
68
+
49
69
  test('never moves a row backwards, so a late frame cannot reorder the list', async () => {
50
70
  const harness = await mountProvider();
51
71
  // The structure already carries a stamp the activity payload has not caught
@@ -16,6 +16,7 @@
16
16
 
17
17
  import type { WorkspaceFolderData } from '@/shared/types';
18
18
  import type { SidebarActivityPayload, SidebarStatusPayload } from '@kabmo-labs/kabmo-app-contracts/realtime';
19
+ import { compareSessions } from '@kabmo-labs/kabmo-workspace/sidebar/sidebar-sort';
19
20
 
20
21
  /** Merge a structure payload with the volatile map, by session id. */
21
22
  export function mergeStatus(
@@ -49,6 +50,11 @@ export function mergeStatus(
49
50
  * ends — a `false` here is "not seen yet", not "none exist";
50
51
  * - nothing else is touched. Every other field of a row changes on a
51
52
  * STRUCTURAL event, and those publish the structure for their own reason.
53
+ *
54
+ * A row whose stamp moved is also REORDERED inside its folder: the sidebar's
55
+ * order is activity, newest first, and a mid-turn append publishes no
56
+ * structure. Without the sort the stamp advanced while the row stayed where
57
+ * it was — a chat still streaming sat below rows it had outrun.
52
58
  */
53
59
  export function mergeActivity(
54
60
  folders: WorkspaceFolderData[],
@@ -56,9 +62,9 @@ export function mergeActivity(
56
62
  ): WorkspaceFolderData[] {
57
63
  if (!activity) return folders;
58
64
  let changed = false;
59
- const merged = folders.map((folder) => ({
60
- ...folder,
61
- sessions: (folder.sessions ?? []).map((session) => {
65
+ const merged = folders.map((folder) => {
66
+ let folderChanged = false;
67
+ const sessions = (folder.sessions ?? []).map((session) => {
62
68
  const live = activity[String(session.id)];
63
69
  if (!live) return session;
64
70
  const updated_at = live.updatedAt && isNewerStamp(live.updatedAt, session.updated_at)
@@ -66,10 +72,16 @@ export function mergeActivity(
66
72
  : session.updated_at;
67
73
  const hasSubagents = session.hasSubagents || live.hasSubagents === true;
68
74
  if (updated_at === session.updated_at && hasSubagents === Boolean(session.hasSubagents)) return session;
69
- changed = true;
75
+ folderChanged = true;
70
76
  return { ...session, updated_at, hasSubagents };
71
- }),
72
- }));
77
+ });
78
+ if (!folderChanged) return folder;
79
+ changed = true;
80
+ // The shared comparator is the server's own rule, including pins: an
81
+ // activity frame must not push a pinned row back down.
82
+ sessions.sort(compareSessions);
83
+ return { ...folder, sessions };
84
+ });
73
85
  // A stable identity matters: the sidebar's own `useMemo` chain (filter, sort,
74
86
  // pending overlay) keys on this array, and returning a fresh one per activity
75
87
  // frame would re-sort 731 rows for a stamp that did not move.
@@ -45,6 +45,7 @@ import { writeSetting } from '@/shared/lib/settings/client';
45
45
  import { subscribeSessionKey } from '@/shared/lib/workspace/session-state/listeners';
46
46
  import { CHAT_DRAFT_ATTACHMENTS_KEY, CHAT_DRAFT_KEY } from '@/shared/lib/chat/composer/draft';
47
47
  import type { SessionSortOption, WorkspaceFolderData } from '@/shared/types';
48
+ import { isWorkspaceSessionId } from '@/shared/lib/workspace/workspace-session';
48
49
 
49
50
  /** Debounce before the sort preference is POSTed to /api/settings (ms). */
50
51
  const SORT_PERSIST_DEBOUNCE_MS = 200;
@@ -196,6 +197,9 @@ export function useSessionSidebarController(
196
197
  // the reload and — when its run is live — a switch away from it.
197
198
  useEffect(() => {
198
199
  if (!sessionParam || initializing) return;
200
+ // A workspace session is a UI scope, not a chat: drawing it as a pending
201
+ // row would put a session that never spawns in the list.
202
+ if (isWorkspaceSessionId(sessionParam)) return;
199
203
  if (folders.some((folder) => (folder.sessions ?? []).some((s) => String(s.id) === sessionParam))) return;
200
204
  hydratePendingSession(sessionParam, folderIdParam, sessionStatus[sessionParam] === 'stream');
201
205
  }, [sessionParam, folders, initializing, folderIdParam, sessionStatus]);
@@ -84,6 +84,23 @@ describe('useTimelineScope', () => {
84
84
  expect(scope?.sessionId).toBe('new-1');
85
85
  });
86
86
 
87
+ test('a workspace session is not a chat, but keeps its folder scope', async () => {
88
+ await mount();
89
+
90
+ await act(async () => {
91
+ scope?.setSearchParams((prev) => {
92
+ prev.set('sessionId', 'workspace-7');
93
+ prev.set('folderId', '7');
94
+ return prev;
95
+ }, { replace: true });
96
+ });
97
+
98
+ // The timeline draws the new-chat composer for folder 7; it must never
99
+ // fetch a transcript for an id that is not an omp session.
100
+ expect(scope?.sessionId).toBeNull();
101
+ expect(scope?.selectedFolderId).toBe(7);
102
+ });
103
+
87
104
  test('the picker writes the param and reads back the number', async () => {
88
105
  await mount();
89
106
 
@@ -15,6 +15,7 @@
15
15
 
16
16
  import { useCallback } from 'preact/hooks';
17
17
  import { useSearchParams, type SetSearchParams } from '@/client/lib/router/search-params';
18
+ import { isWorkspaceSessionId } from '@/shared/lib/workspace/workspace-session';
18
19
 
19
20
  export interface TimelineScope {
20
21
  sessionId: string | null;
@@ -28,7 +29,11 @@ export interface TimelineScope {
28
29
 
29
30
  export function useTimelineScope(): TimelineScope {
30
31
  const [searchParams, setSearchParams] = useSearchParams();
31
- const sessionId = searchParams.get('sessionId');
32
+ const rawSessionId = searchParams.get('sessionId');
33
+ // A workspace session is a panel scope, not a chat: the timeline reads it as
34
+ // "no session", so it draws the new-chat composer for the folder in the URL
35
+ // instead of fetching a transcript that cannot exist.
36
+ const sessionId = isWorkspaceSessionId(rawSessionId) ? null : rawSessionId;
32
37
  const folderId = searchParams.get('folderId');
33
38
  // DERIVED, never mirrored into state. The URL is the one value the picker,
34
39
  // the prewarm and the send all read; a copy in `useState` synced by an effect
@@ -18,6 +18,7 @@
18
18
  */
19
19
 
20
20
  import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
21
+ import { MAX_ATTACHMENT_BYTES } from '@/shared/lib/chat/attachment-budget';
21
22
  import { act, installDomGlobals, makeSendHarness, originalFetch, requests, restoreDomGlobals, stubComposerFetch } from '@/client/hooks/chat/timeline/send.test-util';
22
23
 
23
24
  beforeAll(() => {
@@ -69,4 +70,22 @@ describe('a refused send', () => {
69
70
  });
70
71
  expect(h1.reported).toEqual([]);
71
72
  });
73
+
74
+ test('a replayed attachment past the byte ceiling is refused before dispatch', async () => {
75
+ const h1 = makeSendHarness();
76
+ const limit = `${Math.round(MAX_ATTACHMENT_BYTES / 1024 / 1024)} MB`;
77
+ await act(async () => {
78
+ await h1.sends.executeSend('hello', [{
79
+ id: 'a1',
80
+ name: 'huge.png',
81
+ type: 'image/png',
82
+ size: MAX_ATTACHMENT_BYTES + 1,
83
+ preview: 'blob:http://localhost/1',
84
+ dataBase64: 'AAAA',
85
+ }]);
86
+ });
87
+ expect(h1.reported).toEqual([`"huge.png" was not attached — the largest allowed file is ${limit}.`]);
88
+ expect(h1.agent.calls.prompts).toEqual([]);
89
+ expect(h1.state.messages).toEqual([]);
90
+ });
72
91
  });
@@ -8,6 +8,7 @@
8
8
  * the executeSend cases live in `send-execute.test.ts`. */
9
9
 
10
10
  import { afterEach, beforeAll, afterAll, describe, expect, test } from 'bun:test';
11
+ import { MAX_ATTACHMENT_BYTES } from '@/shared/lib/chat/attachment-budget';
11
12
  import { Window } from 'happy-dom';
12
13
  import { h, render } from 'preact';
13
14
  import { act } from 'preact/test-utils';
@@ -239,4 +240,20 @@ describe('steerOmpAgent', () => {
239
240
  });
240
241
  expect(h1.drafts).toEqual([]);
241
242
  });
243
+
244
+ test('refuses a replayed attachment past the byte ceiling and keeps the draft', async () => {
245
+ const h1 = makeSendHarness();
246
+ const limit = `${Math.round(MAX_ATTACHMENT_BYTES / 1024 / 1024)} MB`;
247
+ const result = await h1.sends.steerOmpAgent('steer me', [{
248
+ id: 'a1',
249
+ name: 'huge.png',
250
+ type: 'image/png',
251
+ size: MAX_ATTACHMENT_BYTES + 1,
252
+ preview: 'blob:http://localhost/1',
253
+ dataBase64: 'AAAA',
254
+ }]);
255
+ expect(result).toEqual({ ok: false, busy: false, error: `"huge.png" was not attached — the largest allowed file is ${limit}.` });
256
+ expect(h1.agent.calls.steers).toEqual([]);
257
+ expect(h1.drafts).toEqual(['steer me']);
258
+ });
242
259
  });
@@ -23,6 +23,7 @@ import { postModeCommand } from '@/client/hooks/chat/timeline/mode-post';
23
23
  import type { ArmedGoal } from '@kabmo-labs/kabmo-omp/mode/actions';
24
24
  import { blockTuiOnlySend } from '@/client/hooks/chat/timeline/tui-only-guard';
25
25
  import { PHASE_VERBS } from '@/shared/lib/chat/timeline/tool-phrases';
26
+ import { describeOversizedAttachments, oversizedAttachments } from '@/shared/lib/chat/attachment-budget';
26
27
  import { formatClock } from '@kabmo-labs/kabmo-format/time';
27
28
 
28
29
  export function useChatTimelineSend(deps: ChatTimelineSendDeps): ChatTimelineSendResult {
@@ -102,6 +103,13 @@ export function useChatTimelineSend(deps: ChatTimelineSendDeps): ChatTimelineSen
102
103
  // Steer the running omp agent (interrupt-and-reply). Returns the outcome so
103
104
  // the caller can report a refusal: the composer is cleared before this runs.
104
105
  const steerOmpAgent = useCallback(async (text: string, attachments: Attachment[]): Promise<PromptDispatchResult> => {
106
+ // A queued item's "Send now" can steer a turn with a snapshot queued before
107
+ // the ceiling existed; the draft comes back so the prompt is not lost.
108
+ const oversized = describeOversizedAttachments(oversizedAttachments(attachments));
109
+ if (oversized) {
110
+ setInputValue(text);
111
+ return { ok: false, busy: false, error: oversized };
112
+ }
105
113
  // A steer IS a new prompt: a pick made during the interrupted turn belongs
106
114
  // to it, so it is pushed before the interrupt-and-reply starts the turn.
107
115
  await flushDeferredPick(ompAgent, deferredComposerPickRef);
@@ -130,6 +138,15 @@ export function useChatTimelineSend(deps: ChatTimelineSendDeps): ChatTimelineSen
130
138
  // command that was typed before the guard existed, or that arrived from the
131
139
  // queue. Nothing has been rendered yet, so no rollback is needed.
132
140
  if (blockTuiOnlySend(text, setLocalMessages, harness)) return { ok: false, busy: false, error: 'TUI-only command' };
141
+ // The composer refuses an oversized upload when it is attached; this is the
142
+ // second gate for REPLAY paths — a seeded New Chat row, a queued item, a
143
+ // retry — where the attachment came from persisted state and never passed
144
+ // through `addFiles`. Refused before any optimistic row exists.
145
+ const oversized = describeOversizedAttachments(oversizedAttachments(attachments));
146
+ if (oversized) {
147
+ reportActionError(oversized);
148
+ return { ok: false, busy: false, error: oversized };
149
+ }
133
150
  // A queued delivery replays the snapshot the item was queued with; a plain
134
151
  // send keeps the session's live picks. 'auto' thinking leaves omp alone.
135
152
  const modelOverride = options?.model ?? null;
@@ -125,3 +125,44 @@ export async function fetchQuickOpenIndex(root?: string | null, repo?: string |
125
125
  return [];
126
126
  }
127
127
  }
128
+
129
+ /**
130
+ * How long a resolved index is reused.
131
+ *
132
+ * Every message in the timeline that names a bare file asks the same question in
133
+ * the same commit, and a fresh `/api/fs/list` walk per message would be a burst
134
+ * of identical 3 000-row walks. The window is short on purpose: the index is
135
+ * only used to decide whether an inline chip is clickable, and a file created
136
+ * after a stale walk must become clickable soon.
137
+ */
138
+ const INDEX_REUSE_MS = 5_000;
139
+
140
+ interface CachedIndex {
141
+ startedAt: number;
142
+ result: Promise<QuickOpenEntry[]>;
143
+ }
144
+
145
+ const indexCache = new Map<string, CachedIndex>();
146
+
147
+ /**
148
+ * The index shared by every concurrent and near-simultaneous caller.
149
+ *
150
+ * Same answer as `fetchQuickOpenIndex`, but one request per scope per
151
+ * `INDEX_REUSE_MS` window instead of one per chat message. A refusal is cached
152
+ * like any other answer: two callers must see the SAME result, and the retry
153
+ * after the window is the honest recovery.
154
+ */
155
+ export function loadQuickOpenIndex(root?: string | null, repo?: string | null): Promise<QuickOpenEntry[]> {
156
+ const key = `${root ?? ''}\u0000${repo ?? ''}`;
157
+ const now = Date.now();
158
+ const cached = indexCache.get(key);
159
+ if (cached && now - cached.startedAt < INDEX_REUSE_MS) return cached.result;
160
+ const result = fetchQuickOpenIndex(root, repo);
161
+ indexCache.set(key, { startedAt: now, result });
162
+ return result;
163
+ }
164
+
165
+ /** Drop the shared index. Tests that change a scope's listing call this. */
166
+ export function forgetQuickOpenIndex(): void {
167
+ indexCache.clear();
168
+ }
@@ -152,6 +152,19 @@ describe('borders.css', () => {
152
152
  expect(rule).toContain('.border-dashed');
153
153
  });
154
154
 
155
+ test('the chat transcript is the one subtree the clearing rules skip', async () => {
156
+ const all = selectors(await declarations());
157
+ // Both clearing rules — the rung border and the row divider — must exclude
158
+ // the timeline, or a borderless install flattens every thinking block and
159
+ // tool card into one text wall (the reported "border ikut hilang").
160
+ const guarded = all.filter((selector) => selector.includes(':not([data-chat-timeline]'));
161
+ expect(guarded.length).toBe(2);
162
+ for (const selector of guarded) {
163
+ expect({ selector, subtree: selector.includes('[data-chat-timeline] *') })
164
+ .toEqual({ selector, subtree: true });
165
+ }
166
+ });
167
+
155
168
  test('a dialog keeps an edge via outline, never by replacing its shadow', async () => {
156
169
  const css = await declarations();
157
170
  const start = css.indexOf(':is(.glass-overlay, .glass-popover)');
@@ -29,12 +29,18 @@ import { rewriteWikiReferences } from '@/shared/lib/wiki/document-urls';
29
29
  import { expandGollumLinks } from '@/shared/lib/wiki/pages';
30
30
  import { MATH_PENDING_CLASS, preloadKatex } from '@/shared/lib/markdown/katex';
31
31
  import { sanitizeHtml } from '@/shared/lib/markdown/sanitize';
32
- import { markInlineFilePaths } from '@/shared/lib/markdown/inline-file';
32
+ import { inlineFileCandidates, type InlineFileReference as MarkdownFileReference } from '@/shared/lib/markdown/inline-file';
33
33
  import { localizeFileImageSources, markLocalImageSources } from '@/shared/lib/chat/timeline/local-image';
34
34
 
35
35
  export interface RenderedMarkdown {
36
36
  html: string;
37
37
  blocks: MdBlock[];
38
+ /**
39
+ * The inline file references the HTML names, for the caller to verify
40
+ * against the workspace before marking any of them clickable. Document and
41
+ * wiki renders resolve their own references and leave this empty.
42
+ */
43
+ references: MarkdownFileReference[];
38
44
  }
39
45
 
40
46
  /** Everything the render depends on, as PRIMITIVES. A new object per render is
@@ -73,7 +79,7 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
73
79
  } = options;
74
80
 
75
81
  return useMemo(() => {
76
- if (!content) return { html: '', blocks: [] as MdBlock[] };
82
+ if (!content) return { html: '', blocks: [] as MdBlock[], references: [] as MarkdownFileReference[] };
77
83
  // Gollum's `[[Page]]` is invisible to a markdown parser, so it is expanded
78
84
  // before parsing rather than patched afterwards.
79
85
  const source = wikiPath ? expandGollumLinks(content) : content;
@@ -97,13 +103,12 @@ export function useRenderedMarkdown(options: MarkdownRenderOptions): RenderedMar
97
103
  // Agent output is the one place an inline `` `path` `` is a file the reader
98
104
  // can open. A document preview and a wiki page resolve their OWN references
99
105
  // through the scope above, so marking them here would be a second rule for
100
- // the same job. The marker runs after sanitization: the attributes never
101
- // need a DOMPurify allow-list entry (same contract as local images).
106
+ // the same job. The caller marks only the ones the workspace confirms.
102
107
  const agentOutput = !isDocument && !isWiki;
103
- const withFiles = agentOutput ? markInlineFilePaths(sanitized) : sanitized;
104
108
  return {
105
- html: chat ? markLocalImageSources(withFiles) : withFiles,
109
+ html: chat ? markLocalImageSources(sanitized) : sanitized,
106
110
  blocks: mapped?.blocks ?? [],
111
+ references: agentOutput ? inlineFileCandidates(sanitized) : [],
107
112
  };
108
113
  // Primitive deps: the caller may build `scope`/`wikiScope` inline, and a
109
114
  // new object identity would re-parse the whole document every render.
@@ -15,6 +15,7 @@
15
15
  import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
16
16
  import { Window } from 'happy-dom';
17
17
  import { closePalette, paletteState } from '@/client/lib/commands/overlays';
18
+ import { forgetQuickOpenIndex, loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
18
19
  import { setPluginContext } from '@/client/lib/plugins/context';
19
20
  import { getLineReveal, setLineReveal } from '@/client/lib/line-reveal';
20
21
  import {
@@ -62,6 +63,7 @@ afterEach(() => {
62
63
  closePalette();
63
64
  setLineReveal(null);
64
65
  setPluginContext(null, null);
66
+ forgetQuickOpenIndex();
65
67
  files = [];
66
68
  fetchCalls = [];
67
69
  opened = [];
@@ -90,6 +92,20 @@ describe('openInlineFileReference', () => {
90
92
  expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
91
93
  });
92
94
 
95
+ test('a click reuses the index the chip verification already fetched', async () => {
96
+ setPluginContext(null, ROOT);
97
+ files = [{ path: 'src/client/App.tsx' }, { path: 'src/server/read.ts' }];
98
+ // The verification pass for the chip, before any click.
99
+ await loadQuickOpenIndex(ROOT);
100
+ fetchCalls = [];
101
+
102
+ await openInlineFileReference({ path: 'App.tsx', line: 3 });
103
+
104
+ expect(fetchCalls).toEqual([]);
105
+ expect(getLineReveal()).toEqual({ path: 'src/client/App.tsx', line: 3 });
106
+ expect(opened.map((file) => file.path)).toEqual(['src/client/App.tsx']);
107
+ });
108
+
93
109
  test('a bare filename with several matches opens the picker on the name', async () => {
94
110
  setPluginContext(null, ROOT);
95
111
  files = [{ path: 'src/a/index.ts' }, { path: 'src/b/index.ts' }];
@@ -21,7 +21,7 @@
21
21
  * jump that was already served).
22
22
  */
23
23
 
24
- import { fetchQuickOpenIndex } from '@/client/hooks/editor/quick-open';
24
+ import { loadQuickOpenIndex } from '@/client/hooks/editor/quick-open';
25
25
  import { openFileInEditor } from '@/client/hooks/ui/open-file';
26
26
  import { openPalette } from '@/client/lib/commands/overlays';
27
27
  import { setLineReveal } from '@/client/lib/line-reveal';
@@ -45,7 +45,9 @@ export async function openInlineFileReference(reference: InlineFileTarget): Prom
45
45
  const root = pluginContext().workspacePath ?? undefined;
46
46
 
47
47
  if (root && !reference.path.includes('/')) {
48
- const entries = await fetchQuickOpenIndex(root);
48
+ // The same loader the chip verification used, so a click does not repeat
49
+ // the walk the chip already paid for.
50
+ const entries = await loadQuickOpenIndex(root);
49
51
  const target = chooseFileTarget(reference, entries);
50
52
  if (target.kind === 'pick') {
51
53
  openPalette('files', { query: target.query });
@@ -17,7 +17,7 @@
17
17
  * keep going AND to start over.
18
18
  */
19
19
 
20
- import { useCallback, useState } from 'preact/hooks';
20
+ import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
21
21
 
22
22
  export interface ShowMore {
23
23
  visibleCount: number;
@@ -29,6 +29,16 @@ export interface ShowMore {
29
29
 
30
30
  export function useShowMore(initial = 5, step = 7): ShowMore {
31
31
  const [visibleCount, setVisibleCount] = useState(initial);
32
+ const previousInitial = useRef(initial);
33
+ // A page size that comes from a setting can change while the list is mounted
34
+ // (Settings is drawn over the open sidebar). Reset to the new window rather
35
+ // than keep a count the user never chose — but not on mount, where the state
36
+ // already starts at `initial` and a late effect would overwrite a click.
37
+ useEffect(() => {
38
+ if (previousInitial.current === initial) return;
39
+ previousInitial.current = initial;
40
+ setVisibleCount(initial);
41
+ }, [initial]);
32
42
  const showMore = useCallback(() => setVisibleCount((c) => c + step), [step]);
33
43
  const showLess = useCallback(() => setVisibleCount(initial), [initial]);
34
44
  return { visibleCount, showMore, showLess, canShowLess: visibleCount > initial };
@@ -180,6 +180,17 @@ describe('useShowMore', () => {
180
180
  expect(seen.current!.visibleCount).toBe(13);
181
181
  });
182
182
 
183
+ test('a new initial resets the window, so a saved page size applies immediately', () => {
184
+ const seen: { current: ShowMore | null } = { current: null };
185
+ mount(h(ShowMoreProbe, { initial: 5, seen }));
186
+ act(() => seen.current!.showMore());
187
+ expect(seen.current!.visibleCount).toBe(12);
188
+
189
+ mount(h(ShowMoreProbe, { initial: 10, seen }));
190
+ expect(seen.current!.visibleCount).toBe(10);
191
+ expect(seen.current!.canShowLess).toBe(false);
192
+ });
193
+
183
194
  test('canShowLess is false until the window grows, and showLess collapses to the initial size', () => {
184
195
  const seen: { current: ShowMore | null } = { current: null };
185
196
  mount(h(ShowMoreProbe, { seen }));
@@ -0,0 +1,143 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * Which references the timeline is allowed to make clickable.
8
+ *
9
+ * The integration suite (`markdown-inline-file.test.tsx`) pins the chip; this
10
+ * pins the answers the hook gives the marker — a directory path is stat'ed, a
11
+ * bare name goes through the index, and an unanswerable probe (refusal, no
12
+ * workspace) verifies NOTHING, because a clickable chip that opens a missing
13
+ * file is the bug.
14
+ */
15
+
16
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
17
+ import { Window } from 'happy-dom';
18
+ import { render } from 'preact';
19
+ import { act } from 'preact/test-utils';
20
+ import { forgetQuickOpenIndex } from '@/client/hooks/editor/quick-open';
21
+ import {
22
+ forgetInlineFileVerdicts,
23
+ probeInlineFileExists,
24
+ useVerifiedInlineFiles,
25
+ } from '@/client/hooks/ui/verified-inline-files';
26
+ import { setPluginContext } from '@/client/lib/plugins/context';
27
+ import type { InlineFileReference } from '@/shared/lib/markdown/inline-file';
28
+
29
+ const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement'] as const;
30
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
31
+ const nativeFetch = globalThis.fetch;
32
+
33
+ let container: HTMLElement;
34
+ let requests: string[] = [];
35
+ let existing = new Set<string>();
36
+ let listed: string[] = [];
37
+ let failFetch = false;
38
+
39
+ function jsonResponse(body: unknown, status = 200): Response {
40
+ return { ok: status >= 200 && status < 300, status, json: async () => body } as unknown as Response;
41
+ }
42
+
43
+ function Harness({ references }: { references: readonly InlineFileReference[] }) {
44
+ const verified = useVerifiedInlineFiles(references);
45
+ return <span id="verified">{[...verified].sort().join(',')}</span>;
46
+ }
47
+
48
+ async function settle(): Promise<void> {
49
+ await act(async () => {
50
+ const { promise, resolve } = Promise.withResolvers<void>();
51
+ setTimeout(resolve, 0);
52
+ await promise;
53
+ });
54
+ }
55
+
56
+ async function mount(references: InlineFileReference[], root: string | null): Promise<string> {
57
+ container = document.createElement('div');
58
+ document.body.appendChild(container);
59
+ setPluginContext(null, root);
60
+ act(() => render(<Harness references={references} />, container));
61
+ await settle();
62
+ return container.querySelector('#verified')?.textContent ?? '';
63
+ }
64
+
65
+ beforeAll(() => {
66
+ const win = new Window({ url: 'http://localhost' });
67
+ const target = globalThis as unknown as Record<string, unknown>;
68
+ for (const key of DOM_GLOBALS) {
69
+ nativeGlobals[key] = target[key];
70
+ target[key] = (win as unknown as Record<string, unknown>)[key];
71
+ }
72
+ globalThis.fetch = (async (input: string | URL | Request) => {
73
+ const url = new URL(String(input), 'http://localhost');
74
+ requests.push(`${url.pathname}?${url.searchParams.toString()}`);
75
+ if (failFetch) throw new Error('offline');
76
+ if (url.pathname === '/api/fs/exists') {
77
+ return jsonResponse({ exists: existing.has(url.searchParams.get('path') ?? ''), mtimeMs: null });
78
+ }
79
+ if (url.pathname === '/api/fs/list') {
80
+ return jsonResponse({ files: listed.map((path) => ({ path })), truncated: false });
81
+ }
82
+ return jsonResponse({}, 404);
83
+ }) as unknown as typeof globalThis.fetch;
84
+ });
85
+
86
+ afterAll(() => {
87
+ const target = globalThis as unknown as Record<string, unknown>;
88
+ for (const key of DOM_GLOBALS) {
89
+ if (nativeGlobals[key] === undefined) delete target[key];
90
+ else target[key] = nativeGlobals[key];
91
+ }
92
+ globalThis.fetch = nativeFetch;
93
+ });
94
+
95
+ afterEach(() => {
96
+ render(null, container);
97
+ container.remove();
98
+ setPluginContext(null, null);
99
+ forgetQuickOpenIndex();
100
+ forgetInlineFileVerdicts();
101
+ requests = [];
102
+ existing = new Set();
103
+ listed = [];
104
+ failFetch = false;
105
+ });
106
+
107
+ describe('useVerifiedInlineFiles', () => {
108
+ test('a directory path is verified by the exists route, a bare name by the index', async () => {
109
+ existing = new Set(['src/a.ts']);
110
+ listed = ['src/client/App.tsx'];
111
+ const text = await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo');
112
+ expect(text).toBe('App.tsx,src/a.ts');
113
+ });
114
+
115
+ test('a path the workspace does not have is not verified', async () => {
116
+ existing = new Set(['src/a.ts']);
117
+ expect(await mount([{ path: 'src/gone.ts' }], '/repo')).toBe('');
118
+ });
119
+
120
+ test('the same path is asked about once', async () => {
121
+ existing = new Set(['src/a.ts']);
122
+ await mount([{ path: 'src/a.ts' }, { path: 'src/a.ts', line: 9 }], '/repo');
123
+ expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
124
+ });
125
+
126
+ test('a settled verdict is reused instead of stat-ing again', async () => {
127
+ existing = new Set(['src/a.ts']);
128
+ expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
129
+ expect(await probeInlineFileExists('/repo', 'src/a.ts')).toBe(true);
130
+ expect(requests.filter((url) => url.startsWith('/api/fs/exists'))).toHaveLength(1);
131
+ });
132
+
133
+ test('a failed probe verifies nothing', async () => {
134
+ failFetch = true;
135
+ expect(await mount([{ path: 'src/a.ts' }, { path: 'App.tsx' }], '/repo')).toBe('');
136
+ });
137
+
138
+ test('without a workspace nothing is asked and nothing is verified', async () => {
139
+ existing = new Set(['src/a.ts']);
140
+ expect(await mount([{ path: 'src/a.ts' }], null)).toBe('');
141
+ expect(requests).toEqual([]);
142
+ });
143
+ });