@kabmo-labs/kabmo 0.41.0 → 0.42.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 (305) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +533 -518
  3. package/dist/client/static/js/{CsvGrid-60njj97j.js → CsvGrid-20k047ht.js} +2 -2
  4. package/dist/client/static/js/{DocxView-rsv0j46a.js → DocxView-qpvhfcmg.js} +5 -5
  5. package/dist/client/static/js/{DrawioView-n2g5df3a.js → DrawioView-178skky8.js} +2 -2
  6. package/dist/client/static/js/ImageView-460th5qa.js +1 -0
  7. package/dist/client/static/js/LayoutWrapper-5cv0dty8.js +2 -0
  8. package/dist/client/static/js/Modal-wks6p4r5.js +38 -0
  9. package/dist/client/static/js/{PdfView-1r7a0qkp.js → PdfView-y51g03nr.js} +1 -1
  10. package/dist/client/static/js/SessionsView-rsmvn7ks.js +1 -0
  11. package/dist/client/static/js/{SheetView-bt5pp042.js → SheetView-z7yvb05v.js} +25 -25
  12. package/dist/client/static/js/{SvgPreview-vfmqgmrx.js → SvgPreview-yehgzhem.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-8k5hk1yx.js → abnfDiagram-O67JEVCF-6zxpcy8b.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +1 -0
  15. package/dist/client/static/js/architectureDiagram-NJMV4G6O-m98sgh3c.js +36 -0
  16. package/dist/client/static/js/{astro-0rh34hha.js → astro-nn7xg0we.js} +1 -1
  17. package/dist/client/static/js/bash-fjzhxy10.js +1 -0
  18. package/dist/client/static/js/{blockDiagram-BEXU5L5S-04sbtdth.js → blockDiagram-BEXU5L5S-cp7rervg.js} +5 -5
  19. package/dist/client/static/js/c-wqtyezvw.js +1 -0
  20. package/dist/client/static/js/c4Diagram-YGBWAQC7-t31recqm.js +38 -0
  21. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-18cc0bsb.js → classDiagram-v2-NBCMYWYE-fy8x3dkx.js} +5 -5
  22. package/dist/client/static/js/{cose-bilkent-JH36ORCC-dk683zvp.js → cose-bilkent-JH36ORCC-va7ybm9e.js} +1 -1
  23. package/dist/client/static/js/cpp-y0nzwner.js +1 -0
  24. package/dist/client/static/js/css-a13jmmnc.js +1 -0
  25. package/dist/client/static/js/css-n2waj098.js +1 -0
  26. package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +1 -0
  27. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-m2sx8d8s.js → cynefinDiagram-VND7K2PF-4k0k429c.js} +2 -2
  28. package/dist/client/static/js/{dagre-6A5THRUB-qf3pr59p.js → dagre-6A5THRUB-ykdhxq6t.js} +2 -2
  29. package/dist/client/static/js/{diagram-22UHCM2B-twnz23mt.js → diagram-22UHCM2B-5nvwx7b6.js} +8 -8
  30. package/dist/client/static/js/{diagram-3UASUU5V-417bas6t.js → diagram-3UASUU5V-hc7zsjgw.js} +1 -1
  31. package/dist/client/static/js/diagram-ATOU4E4O-97ae07y7.js +3 -0
  32. package/dist/client/static/js/diagram-CDSNMT55-b56nnbbs.js +30 -0
  33. package/dist/client/static/js/{diagram-MLGK6HIB-7a0h1hs3.js → diagram-MLGK6HIB-37rygr9k.js} +1 -1
  34. package/dist/client/static/js/{diagram-MPIPVDR6-w75bftmd.js → diagram-MPIPVDR6-wv3vhhfk.js} +2 -2
  35. package/dist/client/static/js/{dockerfile-g5qbaeq3.js → dockerfile-0efb1z6e.js} +1 -1
  36. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-vdzm3tsv.js → ebnfDiagram-ZINNZB2B-13fv7vxg.js} +1 -1
  37. package/dist/client/static/js/{elixir-gpez1k9m.js → elixir-mabagxwa.js} +1 -1
  38. package/dist/client/static/js/{elk-276RUBZZ-2fsbb484.js → elk-276RUBZZ-xam60ktz.js} +1 -1
  39. package/dist/client/static/js/{erDiagram-OPXOYQCR-vnkztq7d.js → erDiagram-OPXOYQCR-24ctv2ee.js} +6 -6
  40. package/dist/client/static/js/{erlang-jqqa3ehb.js → erlang-zwy7cqdk.js} +1 -1
  41. package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +1 -0
  42. package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +1 -0
  43. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-pbvcch52.js → ganttDiagram-FUAMR5RP-766a8fqw.js} +2 -2
  44. package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +1 -0
  45. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-dkvktvzr.js → gitGraphDiagram-X574FWY7-fmwjkgh6.js} +2 -2
  46. package/dist/client/static/js/graphql-gvb7e2eb.js +1 -0
  47. package/dist/client/static/js/html-bwyt0ayy.js +1 -0
  48. package/dist/client/static/js/{index-rc8wrs2a.js → index-03pyvmcz.js} +2 -2
  49. package/dist/client/static/js/index-13dr1t1r.js +314 -0
  50. package/dist/client/static/js/{index-rebnv57p.js → index-13xbwcbz.js} +2 -2
  51. package/dist/client/static/js/{index-pbsm2vw7.js → index-1c0pnsjd.js} +2 -2
  52. package/dist/client/static/js/index-1rxa9zxp.js +1 -0
  53. package/dist/client/static/js/{index-c6kx7s6a.js → index-2hpy58d0.js} +2 -2
  54. package/dist/client/static/js/{index-f8pq132s.js → index-2x9eqztp.js} +1 -1
  55. package/dist/client/static/js/{index-pn91shfp.js → index-4cncqz8j.js} +2 -2
  56. package/dist/client/static/js/index-4j8rgr4p.js +1 -0
  57. package/dist/client/static/js/{index-x2kb1kx5.js → index-4mstdh41.js} +3 -3
  58. package/dist/client/static/js/index-4z4ax55k.js +12 -0
  59. package/dist/client/static/js/{index-55hq7tnj.js → index-6ge6gk9w.js} +1 -1
  60. package/dist/client/static/js/{index-re1xz433.js → index-7t63akyt.js} +1 -1
  61. package/dist/client/static/js/{index-zye9309h.js → index-8b3t2y77.js} +2 -2
  62. package/dist/client/static/js/index-8hgm0abr.js +474 -0
  63. package/dist/client/static/js/index-8jqawh3r.js +2 -0
  64. package/dist/client/static/js/index-95en3p3g.js +9 -0
  65. package/dist/client/static/js/{index-rdqn92tc.js → index-97qst4k9.js} +2 -2
  66. package/dist/client/static/js/{index-xfa5hswh.js → index-9vdbnvmk.js} +1 -1
  67. package/dist/client/static/js/{index-zfykeg7x.js → index-a9t9gdew.js} +9 -9
  68. package/dist/client/static/js/{index-ds6a2cx7.js → index-b4y5g48d.js} +5 -5
  69. package/dist/client/static/js/{index-hz177dr2.js → index-czagykbq.js} +2 -2
  70. package/dist/client/static/js/{index-yq9vnd1y.js → index-dfqmwm7j.js} +2 -2
  71. package/dist/client/static/js/{index-tgper3yy.js → index-dydwcp3n.js} +2 -2
  72. package/dist/client/static/js/{index-0c6vpk89.js → index-e1yz59fa.js} +2 -2
  73. package/dist/client/static/js/{index-ce4vytm6.js → index-e6any867.js} +2 -2
  74. package/dist/client/static/js/{index-j5ram1ve.js → index-ejdnjh5c.js} +2 -2
  75. package/dist/client/static/js/index-f4vr1c6e.css +1 -0
  76. package/dist/client/static/js/{index-cytks03p.js → index-feffxxss.js} +2 -2
  77. package/dist/client/static/js/{index-6fx2t6y7.js → index-grczkttn.js} +12 -12
  78. package/dist/client/static/js/{index-s78n0dtv.js → index-hga3e13s.js} +2 -2
  79. package/dist/client/static/js/{index-ajjq0b8y.js → index-hw14rhen.js} +2 -2
  80. package/dist/client/static/js/index-hzwr5fm9.js +4 -0
  81. package/dist/client/static/js/{index-sj4y8kj2.js → index-j17h4z6f.js} +2 -2
  82. package/dist/client/static/js/{index-a4ed3mks.js → index-ka2rc2cr.js} +5 -5
  83. package/dist/client/static/js/{index-djv15k5s.js → index-ktbrmp29.js} +2 -2
  84. package/dist/client/static/js/{index-3rymer2w.js → index-nbexks3x.js} +1 -1
  85. package/dist/client/static/js/{index-ngk9h0v9.js → index-nh29fkk9.js} +2 -2
  86. package/dist/client/static/js/{index-gn92c6hp.js → index-p0ez6hqd.js} +2 -2
  87. package/dist/client/static/js/{index-e7yf273s.js → index-pkes9492.js} +2 -2
  88. package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
  89. package/dist/client/static/js/index-qj34r6d0.js +1 -0
  90. package/dist/client/static/js/{index-ntcqyqd5.js → index-qx6x4z0y.js} +2 -2
  91. package/dist/client/static/js/{index-agdbjh5k.js → index-r8cc80w5.js} +2 -2
  92. package/dist/client/static/js/{index-9dnkfpx4.js → index-rab39785.js} +2 -2
  93. package/dist/client/static/js/{index-haaz8t7e.js → index-sk9ej289.js} +2 -2
  94. package/dist/client/static/js/{index-9fnzcg2x.js → index-sq3r1xhf.js} +2 -2
  95. package/dist/client/static/js/{index-pfbyfab5.js → index-sx809d6d.js} +2 -2
  96. package/dist/client/static/js/{index-7w3gqw2b.js → index-sz3mxjvy.js} +1 -1
  97. package/dist/client/static/js/{index-4jk8ngjg.js → index-tqycj126.js} +2 -2
  98. package/dist/client/static/js/{index-0xaz2eyv.js → index-vcn1kcpy.js} +3 -3
  99. package/dist/client/static/js/{index-2z9wrb46.js → index-x7f5ysch.js} +2 -2
  100. package/dist/client/static/js/index-xe5cqwnf.js +1 -0
  101. package/dist/client/static/js/index-xxe52zrm.js +2 -0
  102. package/dist/client/static/js/{index-amawahyh.js → index-yvxa7hd8.js} +2 -2
  103. package/dist/client/static/js/{index-e6qjfcz9.js → index-z6kpc98a.js} +1 -1
  104. package/dist/client/static/js/{index-yzg9mbsv.js → index-zjydzxhm.js} +1 -1
  105. package/dist/client/static/js/{index-ne131hmw.js → index-zvazj4va.js} +2 -2
  106. package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +1 -0
  107. package/dist/client/static/js/{infoDiagram-VRGFBTTK-mh6yks62.js → infoDiagram-VRGFBTTK-tqytmzp1.js} +1 -1
  108. package/dist/client/static/js/ini-2gvjwh83.js +1 -0
  109. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-hnfqppnv.js → ishikawaDiagram-OU5B5YK6-rp77ff6m.js} +1 -1
  110. package/dist/client/static/js/java-1xwcq79s.js +1 -0
  111. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-s4nv1f3q.js → journeyDiagram-ZHPQQLJL-c7bxrhf1.js} +2 -2
  112. package/dist/client/static/js/json-4pqjabgq.js +1 -0
  113. package/dist/client/static/js/jsx-wcsss15s.js +1 -0
  114. package/dist/client/static/js/{julia-yre4bxb9.js → julia-2eekpjq8.js} +1 -1
  115. package/dist/client/static/js/{kanban-definition-PNTS6WVX-t8kbfefp.js → kanban-definition-PNTS6WVX-j2pxewqq.js} +5 -5
  116. package/dist/client/static/js/lua-h7vjcn0h.js +1 -0
  117. package/dist/client/static/js/markdown-f30jjjh9.js +1 -0
  118. package/dist/client/static/js/{mermaid.core-0784021p.js → mermaid.core-cqqe1krg.js} +6 -6
  119. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-swkkze8c.js → mindmap-definition-NLK3R4M7-s03k32p9.js} +5 -5
  120. package/dist/client/static/js/one-dark-pro-9tt0a020.js +1 -0
  121. package/dist/client/static/js/one-light-5fg4r0ra.js +1 -0
  122. package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +1 -0
  123. package/dist/client/static/js/{pegDiagram-GJSIUBJH-jqayzh7z.js → pegDiagram-GJSIUBJH-dfg2j0zc.js} +1 -1
  124. package/dist/client/static/js/{perl-weeskn1v.js → perl-5vxax0nr.js} +1 -1
  125. package/dist/client/static/js/{php-vf3045p9.js → php-hgrgdq63.js} +1 -1
  126. package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +1 -0
  127. package/dist/client/static/js/{pieDiagram-5QR66LMP-w03a65ky.js → pieDiagram-5QR66LMP-pshd1j79.js} +1 -1
  128. package/dist/client/static/js/properties-ymexza6q.js +1 -0
  129. package/dist/client/static/js/python-31ycwa66.js +1 -0
  130. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-2j7sfa9s.js → quadrantDiagram-O4NWA36T-cvvvmtk2.js} +4 -4
  131. package/dist/client/static/js/r-t2nne4xp.js +1 -0
  132. package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +1 -0
  133. package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +1 -0
  134. package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +1 -0
  135. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +1 -0
  136. package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +1 -0
  137. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-jtkkgy34.js → railroadDiagram-XR7U4H2S-h53p3sha.js} +1 -1
  138. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t85ckjdb.js → requirementDiagram-PLB6GJNP-bdv2fkxd.js} +4 -4
  139. package/dist/client/static/js/{ruby-1a2ryzy6.js → ruby-8pxcn21w.js} +1 -1
  140. package/dist/client/static/js/{rust-736r0f0v.js → rust-j80dxgjg.js} +1 -1
  141. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-5pfkw8ne.js → sankeyDiagram-IPEJSGJF-xqnnvmhy.js} +2 -2
  142. package/dist/client/static/js/{sass-tq4vw7hd.js → sass-bm32bb5k.js} +1 -1
  143. package/dist/client/static/js/{scss-x7ddw6gb.js → scss-e2dndbfa.js} +1 -1
  144. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-55vs9zv5.js → sequenceDiagram-PO4LG4MO-3p67305f.js} +10 -10
  145. package/dist/client/static/js/{sizeCapture-INFHLROL-pzqqd7f4.js → sizeCapture-INFHLROL-f87525h7.js} +1 -1
  146. package/dist/client/static/js/sql-bwnasywx.js +1 -0
  147. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-6nhrph8n.js → stateDiagram-v2-GCMORJYK-e5st1fy3.js} +6 -6
  148. package/dist/client/static/js/{svelte-0hv6pak2.js → svelte-ztkaww47.js} +1 -1
  149. package/dist/client/static/js/{swimlanes-2SLR337P-6tcnxfbv.js → swimlanes-2SLR337P-ceghkbez.js} +1 -1
  150. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-vc8hvfya.js +8 -0
  151. package/dist/client/static/js/{timeline-definition-EJHVYXUP-1dz46nt5.js → timeline-definition-EJHVYXUP-f7evs443.js} +2 -2
  152. package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +1 -0
  153. package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +1 -0
  154. package/dist/client/static/js/tsx-zfy727zs.js +1 -0
  155. package/dist/client/static/js/typescript-p3syh43m.js +1 -0
  156. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-b3jfveq6.js → usecaseDiagram-POWQR4AR-0gpn21p7.js} +27 -27
  157. package/dist/client/static/js/{vennDiagram-UO4OBE2U-dnc3jqvp.js → vennDiagram-UO4OBE2U-4spzy428.js} +1 -1
  158. package/dist/client/static/js/{vue-zccj3qa5.js → vue-xm1dxpmy.js} +1 -1
  159. package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +1 -0
  160. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-466m8400.js → wardleyDiagram-VNRHLVJA-745xr2pa.js} +4 -4
  161. package/dist/client/static/js/xml-4enq788a.js +1 -0
  162. package/dist/client/static/js/xychartDiagram-PMCCYNJV-7dr9qwx5.js +7 -0
  163. package/dist/client/static/js/yaml-pjtt3jsc.js +1 -0
  164. package/package.json +1 -1
  165. package/src/client/components/common/batch-selection/folder-state.ts +2 -2
  166. package/src/client/components/common/server-control/Panel.tsx +16 -5
  167. package/src/client/components/common/server-control/index.test.tsx +63 -9
  168. package/src/client/components/common/session-row/TrailingSlot.tsx +8 -0
  169. package/src/client/components/common/session-row/index.tsx +16 -9
  170. package/src/client/components/layout/session-sidebar/CategoryItem.tsx +1 -1
  171. package/src/client/components/layout/session-sidebar/ClassicView.tsx +13 -0
  172. package/src/client/components/layout/session-sidebar/HarnessFilter.tsx +175 -0
  173. package/src/client/components/layout/session-sidebar/SessionList.tsx +9 -1
  174. package/src/client/components/layout/session-sidebar/SessionsView.tsx +6 -0
  175. package/src/client/components/layout/session-sidebar/harness-filter.test.tsx +173 -0
  176. package/src/client/components/layout/session-sidebar/modern/FilterChips.tsx +63 -18
  177. package/src/client/components/layout/session-sidebar/modern/SearchField.tsx +1 -1
  178. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +21 -12
  179. package/src/client/components/layout/session-sidebar/modern/WorkspaceSection.tsx +1 -1
  180. package/src/client/components/layout/session-sidebar/modern/index.tsx +11 -2
  181. package/src/client/components/layout/session-sidebar/modern/search-field.test.tsx +96 -0
  182. package/src/client/components/layout/session-sidebar/session-list-states.test.tsx +3 -0
  183. package/src/client/components/layout/session-sidebar/variant-props.ts +7 -0
  184. package/src/client/components/mobile/SessionSidebar.tsx +14 -25
  185. package/src/client/components/mobile/mobile-session-sidebar/ClassicDrawer.tsx +19 -0
  186. package/src/client/components/mobile/mobile-session-sidebar/Item.tsx +1 -1
  187. package/src/client/components/settings/categories/omp-settings/EngineHeader.tsx +1 -1
  188. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.image.test.ts +147 -0
  189. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.test.ts +51 -83
  190. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +44 -63
  191. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadDirectory.tsx +72 -0
  192. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/ReadImage.tsx +51 -0
  193. package/src/client/components/workspace/chat-timeline/tool-renderers/panels/read-test-util.ts +91 -0
  194. package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +80 -62
  195. package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +15 -33
  196. package/src/client/components/workspace/git-panel/commit-modal/Header.tsx +1 -1
  197. package/src/client/components/workspace/terminal-panel/copy.test.ts +179 -0
  198. package/src/client/components/workspace/terminal-panel/copy.ts +76 -0
  199. package/src/client/components/workspace/terminal-panel/mount.ts +13 -0
  200. package/src/client/data/settings/omp-schema.json +39 -18
  201. package/src/client/hooks/chat/omp/pending-child.test.ts +1 -1
  202. package/src/client/hooks/chat/omp/session-sidebar-controller.test.ts +61 -0
  203. package/src/client/hooks/chat/omp/session-sidebar-controller.ts +37 -39
  204. package/src/client/hooks/chat/omp/sidebar-filter.ts +62 -0
  205. package/src/client/hooks/chat/timeline/session-changes.test.ts +85 -0
  206. package/src/client/hooks/chat/timeline/session-changes.ts +8 -5
  207. package/src/client/hooks/shell/servers.ts +60 -2
  208. package/src/client/hooks/ui/updates/mobile-flow.ts +56 -0
  209. package/src/client/tailwind.css +58 -0
  210. package/src/server/lib/harness/acp/commands.test.ts +1 -0
  211. package/src/server/lib/harness/acp/commands.ts +12 -4
  212. package/src/server/lib/harness/acp/replay-transcript.ts +32 -13
  213. package/src/server/lib/harness/acp/session-transcript.server.test.ts +162 -0
  214. package/src/server/lib/harness/acp/session-transcript.server.ts +350 -0
  215. package/src/server/lib/harness/acp/session.ts +6 -1
  216. package/src/server/lib/harness/schema.server.ts +18 -0
  217. package/src/server/lib/harness/spawn.server.ts +14 -1
  218. package/src/server/lib/models/provider-icon-fetch.ts +2 -2
  219. package/src/server/lib/models/provider-icon-parse.test.ts +0 -12
  220. package/src/server/lib/models/provider-icon-parse.ts +0 -8
  221. package/src/server/lib/omp/rpc/frame-fold.test.ts +16 -1
  222. package/src/server/lib/omp/rpc/frame-fold.ts +17 -4
  223. package/src/server/lib/omp/session/blobs.server.test.ts +34 -0
  224. package/src/server/lib/omp/session/blobs.server.ts +8 -3
  225. package/src/server/lib/omp/session/delete.server.ts +4 -0
  226. package/src/server/lib/omp/session/sidebar-activity.server.test.ts +2 -1
  227. package/src/server/routes/agent/harness-command.test.ts +71 -0
  228. package/src/server/routes/agent/harness-command.ts +27 -13
  229. package/src/server/routes/chat/imported.ts +5 -2
  230. package/src/server/routes/chat/live-meta.ts +42 -0
  231. package/src/server/routes/chat/session.test.ts +110 -0
  232. package/src/server/routes/chat/session.ts +31 -34
  233. package/src/shared/lib/chat/transcript-rows.ts +22 -0
  234. package/src/shared/lib/fs/file-kind.test.ts +46 -3
  235. package/src/shared/lib/fs/file-kind.ts +40 -9
  236. package/src/shared/lib/omp/config/schema-releases.test.ts +29 -0
  237. package/src/shared/lib/workspace/harness-filter.test.ts +89 -0
  238. package/src/shared/lib/workspace/harness-filter.ts +75 -0
  239. package/src/{client/lib → shared/lib/workspace}/session-tree.test.ts +1 -1
  240. package/src/shared/lib/workspace/session-visibility.test.ts +71 -0
  241. package/src/shared/lib/workspace/session-visibility.ts +48 -23
  242. package/src/shared/lib/workspace/sidebar-filter-row.test.ts +64 -23
  243. package/src/shared/lib/workspace/sidebar-filter-row.ts +89 -31
  244. package/dist/client/static/js/ImageView-t330jx6y.js +0 -1
  245. package/dist/client/static/js/LayoutWrapper-qp6nsw65.js +0 -2
  246. package/dist/client/static/js/Modal-sbya4ahp.js +0 -38
  247. package/dist/client/static/js/SessionsView-yqs5m8tj.js +0 -1
  248. package/dist/client/static/js/architecture-7GRP2DOG-1wqga929.js +0 -1
  249. package/dist/client/static/js/architectureDiagram-NJMV4G6O-7jcb7fgy.js +0 -36
  250. package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
  251. package/dist/client/static/js/c-67jyc7sg.js +0 -1
  252. package/dist/client/static/js/c4Diagram-YGBWAQC7-vwac9za0.js +0 -38
  253. package/dist/client/static/js/cpp-crfbnwv8.js +0 -1
  254. package/dist/client/static/js/css-2re5mbea.js +0 -1
  255. package/dist/client/static/js/css-983fbv00.js +0 -1
  256. package/dist/client/static/js/cynefin-OW5HDTMX-j2dpdgkh.js +0 -1
  257. package/dist/client/static/js/diagram-ATOU4E4O-n63cpdnx.js +0 -3
  258. package/dist/client/static/js/diagram-CDSNMT55-v86p14dd.js +0 -30
  259. package/dist/client/static/js/eventmodeling-NTZA5JFV-xjvjawd3.js +0 -1
  260. package/dist/client/static/js/flowDiagram-KWPJA3E3-j21f2bfg.js +0 -1
  261. package/dist/client/static/js/gitGraph-4MIJSDKK-r0zbk95f.js +0 -1
  262. package/dist/client/static/js/graphql-npbd9fdx.js +0 -1
  263. package/dist/client/static/js/html-1cpe2xc8.js +0 -1
  264. package/dist/client/static/js/index-1sw00wm0.js +0 -2
  265. package/dist/client/static/js/index-7fwppdkn.js +0 -1
  266. package/dist/client/static/js/index-ae91g8ka.js +0 -9
  267. package/dist/client/static/js/index-b6cyn4hr.js +0 -314
  268. package/dist/client/static/js/index-efn233xp.js +0 -4
  269. package/dist/client/static/js/index-esx3zwnt.js +0 -1
  270. package/dist/client/static/js/index-fbbp5cwj.js +0 -2
  271. package/dist/client/static/js/index-g1cggqgx.js +0 -12
  272. package/dist/client/static/js/index-ghsdzs4m.js +0 -1
  273. package/dist/client/static/js/index-gs7ytgdw.js +0 -474
  274. package/dist/client/static/js/index-jqs23cc7.css +0 -1
  275. package/dist/client/static/js/index-qjsy6p86.js +0 -1
  276. package/dist/client/static/js/info-A6RAGUB7-a8xap43w.js +0 -1
  277. package/dist/client/static/js/ini-df5bw23e.js +0 -1
  278. package/dist/client/static/js/java-8j33rj1p.js +0 -1
  279. package/dist/client/static/js/json-g5ggnd94.js +0 -1
  280. package/dist/client/static/js/jsx-f6p72qpc.js +0 -1
  281. package/dist/client/static/js/lua-bahx6qze.js +0 -1
  282. package/dist/client/static/js/markdown-9dhg1fax.js +0 -1
  283. package/dist/client/static/js/one-dark-pro-h5tmw145.js +0 -1
  284. package/dist/client/static/js/one-light-x7vj1pxr.js +0 -1
  285. package/dist/client/static/js/packet-AYTQ26CC-b5bvg6v1.js +0 -1
  286. package/dist/client/static/js/pie-WAS4IAKB-77ee73zg.js +0 -1
  287. package/dist/client/static/js/properties-49mfnee4.js +0 -1
  288. package/dist/client/static/js/python-qb69wp1s.js +0 -1
  289. package/dist/client/static/js/r-s3mf2tch.js +0 -1
  290. package/dist/client/static/js/radar-RG4KPBEZ-cp79xtvb.js +0 -1
  291. package/dist/client/static/js/railroad-74A4TZTK-dcpgqhcb.js +0 -1
  292. package/dist/client/static/js/railroad-abnf-HS5TGJTU-qasqv686.js +0 -1
  293. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-e46908rd.js +0 -1
  294. package/dist/client/static/js/railroad-peg-WCYAUIDC-7009t6bk.js +0 -1
  295. package/dist/client/static/js/sql-aczp05f2.js +0 -1
  296. package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-7xrkrkpa.js +0 -8
  297. package/dist/client/static/js/treeView-Q6P3EWNA-tpn62q8j.js +0 -1
  298. package/dist/client/static/js/treemap-WGGIJYW6-w910f1g4.js +0 -1
  299. package/dist/client/static/js/tsx-s1shkfg9.js +0 -1
  300. package/dist/client/static/js/typescript-htx9v6bf.js +0 -1
  301. package/dist/client/static/js/wardley-WFR3VGLG-pt9tq808.js +0 -1
  302. package/dist/client/static/js/xml-wr1dxav5.js +0 -1
  303. package/dist/client/static/js/xychartDiagram-PMCCYNJV-kryrpqp1.js +0 -7
  304. package/dist/client/static/js/yaml-0y9fdskg.js +0 -1
  305. /package/src/{client/lib → shared/lib/workspace}/session-tree.ts +0 -0
@@ -18,7 +18,9 @@ import { MobileSessionToolbar } from '@/client/components/mobile/mobile-session-
18
18
  import { MobileSessionList } from '@/client/components/mobile/mobile-session-sidebar/List';
19
19
  import { MobileSessionListSkeleton } from '@/client/components/mobile/mobile-session-sidebar/Skeleton';
20
20
  import { SessionListNotice } from '@/client/components/layout/session-sidebar/SessionListNotice';
21
+ import { HarnessFilter } from '@/client/components/layout/session-sidebar/HarnessFilter';
21
22
  import type { BatchBinding } from '@/client/components/common/batch-selection/types';
23
+ import type { HarnessFilterOption } from '@/shared/lib/workspace/harness-filter';
22
24
  import type { SessionSortOption, WorkspaceFolderData } from '@/shared/types';
23
25
  import type { ToastTone } from '@/shared/lib/ui/toast-duration';
24
26
 
@@ -34,6 +36,11 @@ export interface ClassicDrawerProps {
34
36
  sortOption: SessionSortOption;
35
37
  optionsOpen: boolean;
36
38
  showArchived: boolean;
39
+ /** The harness the list is narrowed to, or null for every harness. */
40
+ harnessFilter: string | null;
41
+ onHarnessFilterChange: (harness: string | null) => void;
42
+ /** The harnesses the list holds, with row counts — the filter's menu. */
43
+ harnessOptions: HarnessFilterOption[];
37
44
  optionsRef: RefObject<HTMLDivElement>;
38
45
  scheduledCount: number;
39
46
  refreshing: boolean;
@@ -71,6 +78,9 @@ export function ClassicDrawer({
71
78
  sortOption,
72
79
  optionsOpen,
73
80
  showArchived,
81
+ harnessFilter,
82
+ onHarnessFilterChange,
83
+ harnessOptions,
74
84
  optionsRef,
75
85
  scheduledCount,
76
86
  refreshing,
@@ -121,6 +131,15 @@ export function ClassicDrawer({
121
131
  selecting={selecting}
122
132
  />
123
133
 
134
+ <div className="px-3 pt-2 pb-1">
135
+ <HarnessFilter
136
+ options={harnessOptions}
137
+ value={harnessFilter}
138
+ onChange={onHarnessFilterChange}
139
+ touch
140
+ />
141
+ </div>
142
+
124
143
  {failed ? (
125
144
  <SessionListNotice touch onRetry={onRefresh} refreshing={refreshing} />
126
145
  ) : initializing ? (
@@ -5,7 +5,7 @@ import { MobileSessionRow, MOBILE_BRANCH_STYLE } from '@/client/components/mobil
5
5
  import { SessionBranch, branchControlFor } from '@/client/components/common/session-branch';
6
6
  import type { BranchControl } from '@/client/components/common/session-branch';
7
7
  import type { ToastTone } from '@/shared/lib/ui/toast-duration';
8
- import { buildSessionTree } from '@/client/lib/session-tree';
8
+ import { buildSessionTree } from '@/shared/lib/workspace/session-tree';
9
9
  import { useWorktreeDialog } from '@/client/components/mobile/mobile-session-sidebar/WorktreeDialog';
10
10
  import { useShowMore } from '@/client/hooks/ui/show-more';
11
11
  import { useExpandedSessions } from '@/client/hooks/workspace/expanded-sessions';
@@ -72,7 +72,7 @@ export function EngineHeader({
72
72
  value={searchQuery}
73
73
  onChange={(e) => onSearchChange(e.currentTarget.value)}
74
74
  placeholder="Search every setting…"
75
- className="w-52 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40 focus:outline-none focus:border-ink/40"
75
+ className="kabmo-search-field w-52 bg-paper border border-ink/15 rounded-md pl-6 pr-6 py-1 text-ink placeholder:text-ink/40 focus:outline-none focus:border-ink/40"
76
76
  />
77
77
  {searchQuery && (
78
78
  <button
@@ -0,0 +1,147 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The pictures a `read` card paints, and the full-size view behind a click.
8
+ *
9
+ * The card used to draw the bytes at `max-h-72` with no affordance, so a
10
+ * screenshot of fine text could not be read; and an SVG — which omp returns as
11
+ * SOURCE, because it has no magic bytes — rendered as a code block with no
12
+ * picture at all. Both now open the same surface `eval` screenshots do.
13
+ *
14
+ * Split from `Read.test.ts` (the text branches) because each suite is at the
15
+ * repo's per-file ceiling; both mount through `read-test-util.ts`.
16
+ */
17
+
18
+ import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
19
+ import { act } from 'preact/test-utils';
20
+ import {
21
+ installReadDom,
22
+ mountRead,
23
+ readTool,
24
+ restoreReadDom,
25
+ } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/read-test-util';
26
+
27
+ beforeAll(() => {
28
+ installReadDom();
29
+ });
30
+
31
+ afterAll(() => {
32
+ restoreReadDom();
33
+ });
34
+
35
+ /** Close the preview the click opened, so the next case starts clean. */
36
+ function closePreview(): void {
37
+ act(() => {
38
+ window.dispatchEvent(new window.KeyboardEvent('keydown', { key: 'Escape' }));
39
+ });
40
+ }
41
+
42
+ describe('Read panel — image preview', () => {
43
+ test('the result’s own picture opens at full size when clicked', async () => {
44
+ // The card painted the bytes with no affordance, so a screenshot of fine
45
+ // text could not be read. The full-size surface is the one `eval`
46
+ // screenshots open into: a dialog with the zoom/pan pill, on the SAME URL
47
+ // the thumbnail drew.
48
+ const el = await mountRead(readTool({
49
+ target: '/tmp/shot.png',
50
+ input: { path: '/tmp/shot.png' },
51
+ images: [{ mimeType: 'image/png', dataBase64: 'AAAA' }],
52
+ }));
53
+ const open = el.querySelector('button[aria-label="Open /tmp/shot.png full size"]') as HTMLButtonElement;
54
+ expect(open).not.toBeNull();
55
+ expect(open.querySelector('img')?.getAttribute('src')).toBe('data:image/png;base64,AAAA');
56
+
57
+ act(() => open.click());
58
+
59
+ const dialog = document.querySelector('[role="dialog"]');
60
+ expect(dialog).not.toBeNull();
61
+ expect(dialog?.getAttribute('aria-label')).toBe('/tmp/shot.png');
62
+ expect(dialog?.querySelector('button[title="Fit to view (0)"]')).not.toBeNull();
63
+ expect(dialog?.querySelector('button[title="Zoom in (+)"]')).not.toBeNull();
64
+ expect(dialog?.querySelector('img')?.getAttribute('src')).toBe('data:image/png;base64,AAAA');
65
+
66
+ closePreview();
67
+ expect(document.querySelector('[role="dialog"]')).toBeNull();
68
+ });
69
+
70
+ test('a path-only image read opens the same preview', async () => {
71
+ // A result that carries no image block falls back to the raw-file route;
72
+ // the click affordance belongs to both branches, not just to the bytes the
73
+ // result returned.
74
+ const el = await mountRead(readTool({ target: 'assets/logo.png', input: { path: 'assets/logo.png' } }));
75
+ const open = el.querySelector('button[aria-label="Open assets/logo.png full size"]') as HTMLButtonElement;
76
+ expect(open).not.toBeNull();
77
+ expect(open.querySelector('img')?.getAttribute('src')).toContain('/api/fs/raw?path=assets%2Flogo.png');
78
+
79
+ act(() => open.click());
80
+ expect(document.querySelector('[role="dialog"] img')?.getAttribute('src')).toContain(
81
+ '/api/fs/raw?path=assets%2Flogo.png',
82
+ );
83
+ closePreview();
84
+ });
85
+
86
+ test('a path-only webp read opens the same preview', async () => {
87
+ // WEBP is in the image table AND in the magic-byte table (RIFF/WEBP at
88
+ // offset 8), so a `.webp` a provider did not decode still previews.
89
+ const el = await mountRead(readTool({ target: 'assets/logo.webp', input: { path: 'assets/logo.webp' } }));
90
+ const open = el.querySelector('button[aria-label="Open assets/logo.webp full size"]') as HTMLButtonElement;
91
+ expect(open).not.toBeNull();
92
+ expect(open.querySelector('img')?.getAttribute('src')).toContain('/api/fs/raw?path=assets%2Flogo.webp');
93
+
94
+ act(() => open.click());
95
+ expect(document.querySelector('[role="dialog"] img')?.getAttribute('src')).toContain(
96
+ '/api/fs/raw?path=assets%2Flogo.webp',
97
+ );
98
+ closePreview();
99
+ });
100
+
101
+ test('an svg image block paints through the blob route', async () => {
102
+ // omp hands an `<svg>` back as text, but a result CAN carry an svg image
103
+ // block; the blob route labels it `image/svg+xml` from the bytes, so the
104
+ // card paints it instead of a broken picture with an octet-stream type.
105
+ const hash = 'a'.repeat(64);
106
+ const el = await mountRead(readTool({
107
+ target: 'assets/mark.svg',
108
+ input: { path: 'assets/mark.svg' },
109
+ images: [{ mimeType: 'image/svg+xml', blobRef: `blob:sha256:${hash}` }],
110
+ }));
111
+ const open = el.querySelector('button[aria-label="Open assets/mark.svg full size"]') as HTMLButtonElement;
112
+ expect(open).not.toBeNull();
113
+ expect(open.querySelector('img')?.getAttribute('src')).toBe(`/api/omp/blob?hash=${hash}`);
114
+ });
115
+
116
+ test('an svg read paints the picture AND keeps the source it returned', async () => {
117
+ // omp answers a `read` of an SVG with its markup, so treating it as a
118
+ // picture-only card would hide the only text the tool actually returned.
119
+ // The preview is additive: image on top, source below, still copyable.
120
+ const source = '1|<svg xmlns="http://www.w3.org/2000/svg" width="300" height="120"><rect width="300" height="120"/></svg>';
121
+ const el = await mountRead(readTool({
122
+ target: 'assets/mark.svg',
123
+ input: { path: 'assets/mark.svg' },
124
+ output: source,
125
+ details: { fileSize: 224, totalLines: 1, displayContent: { text: source.slice(2), startLine: 1, lineNumbers: [1] } },
126
+ }));
127
+ const open = el.querySelector('button[aria-label="Open assets/mark.svg full size"]') as HTMLButtonElement;
128
+ expect(open).not.toBeNull();
129
+ expect(open.querySelector('img')?.getAttribute('src')).toContain('/api/fs/raw?path=assets%2Fmark.svg');
130
+ const text = el.textContent ?? '';
131
+ expect(text).toContain('SVG');
132
+ // The markup the tool returned is still on the card, not replaced by pixels.
133
+ expect(text).toContain('<rect');
134
+ expect(text).toContain('Copy file content');
135
+ });
136
+
137
+ test('a failed svg read stays a message, with no picture over it', async () => {
138
+ const el = await mountRead(readTool({
139
+ target: 'assets/missing.svg',
140
+ input: { path: 'assets/missing.svg' },
141
+ status: 'error',
142
+ isError: true,
143
+ output: "Path 'assets/missing.svg' not found",
144
+ }));
145
+ expect(el.querySelector('button[aria-label="Open assets/missing.svg full size"]')).toBeNull();
146
+ });
147
+ });
@@ -4,119 +4,72 @@
4
4
  */
5
5
 
6
6
  /**
7
- * The Read panel's lazy fallback.
7
+ * The Read panel's text branches: the lazy `/api/fs/read` fallback and the
8
+ * documents it renders as prose.
8
9
  *
9
10
  * A `read` whose result carries no output falls back to fetching the path it
10
- * named through `/api/fs/read`. An omp internal URL names no file: the route
11
- * refused `proc://kabmo-dev`, and the panel printed
12
- * `// Loaded file: proc://kabmo-dev` as if that were the file's contents.
13
- * A `read` of a process is answered by the `proc://` panel, never by this one —
14
- * but a legacy transcript can still hand it a virtual URL.
11
+ * named. An omp internal URL names no file: the route refused `proc://kabmo-dev`,
12
+ * and the panel printed `// Loaded file: proc://kabmo-dev` as if that were the
13
+ * file's contents. A `read` of a process is answered by the `proc://` panel,
14
+ * never by this one — but a legacy transcript can still hand it a virtual URL.
15
15
  *
16
- * Rendered with `h()` against happy-dom, following `panels/Edit.test.ts`.
16
+ * The picture branches are `Read.image.test.ts`; both mount through
17
+ * `read-test-util.ts`.
17
18
  */
18
19
 
19
20
  import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
20
- import { Window } from 'happy-dom';
21
- import { h, render } from 'preact';
22
- import { act } from 'preact/test-utils';
23
- import { Read } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/Read';
24
- import type { ToolCallData } from '@/shared/types';
25
-
26
- const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'HTMLInputElement', 'Event', 'MouseEvent', 'KeyboardEvent', 'fetch'] as const;
27
- const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
28
-
29
- let calls: string[] = [];
30
- /** The next response the stub hands back. Defaults to a 200 carrying `hello`. */
31
- let nextResponse: { ok: boolean; status: number; body: unknown } = {
32
- ok: true,
33
- status: 200,
34
- body: { content: 'hello' },
35
- };
21
+ import {
22
+ fetchCalls,
23
+ installReadDom,
24
+ mountRead,
25
+ readTool,
26
+ restoreReadDom,
27
+ setNextResponse,
28
+ } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/read-test-util';
36
29
 
37
30
  beforeAll(() => {
38
- const win = new Window({ url: 'http://localhost' });
39
- const target = globalThis as unknown as Record<string, unknown>;
40
- for (const key of DOM_GLOBALS) {
41
- nativeGlobals[key] = target[key];
42
- target[key] = (win as unknown as Record<string, unknown>)[key];
43
- }
44
- // The panel reads the status and the body, so the stub has to carry both: a
45
- // refused read is `ok: false` with an `error`, and the assertions below are
46
- // about which sentence the panel printed.
47
- const stub = (async (url: string) => {
48
- calls.push(String(url));
49
- const { ok, status, body } = nextResponse;
50
- return { ok, status, json: async () => body };
51
- }) as unknown as typeof globalThis.fetch;
52
- globalThis.fetch = stub;
31
+ installReadDom();
53
32
  });
54
33
 
55
34
  afterAll(() => {
56
- const target = globalThis as unknown as Record<string, unknown>;
57
- for (const key of DOM_GLOBALS) {
58
- if (nativeGlobals[key] === undefined) delete target[key];
59
- else target[key] = nativeGlobals[key];
60
- }
35
+ restoreReadDom();
61
36
  });
62
37
 
63
- /** Mount and flush the effect + its fetch microtask chain. */
64
- async function mount(tool: ToolCallData) {
65
- const container = document.createElement('div');
66
- document.body.appendChild(container);
67
- await act(async () => {
68
- render(h(Read, { tool, output: tool.output ?? '' }), container);
69
- });
70
- // The reader awaits `fetch` and then `res.json()`, and each state write lands
71
- // a turn later; a few separate `act` passes drain that chain without binding
72
- // the test to the clock.
73
- for (let pass = 0; pass < 4; pass += 1) {
74
- await act(async () => {
75
- await Promise.resolve();
76
- });
77
- }
78
- return container;
79
- }
80
-
81
- function readTool(partial: Partial<ToolCallData>): ToolCallData {
82
- return { id: 'r1', type: 'read', name: 'read', title: 'read', output: '', status: 'success', details: {}, ...partial } as ToolCallData;
83
- }
84
-
85
38
  describe('Read panel — lazy fallback', () => {
86
39
  beforeEach(() => {
87
- nextResponse = { ok: true, status: 200, body: { content: 'hello' } };
40
+ setNextResponse({ ok: true, status: 200, body: { content: 'hello' } });
88
41
  });
89
42
 
90
43
  test('a virtual URL never reaches /api/fs/read', async () => {
91
- calls = [];
92
- const el = await mount(readTool({ target: 'proc://kabmo-dev', input: { path: 'proc://kabmo-dev' } }));
93
- expect(calls).toHaveLength(0);
44
+ fetchCalls.length = 0;
45
+ const el = await mountRead(readTool({ target: 'proc://kabmo-dev', input: { path: 'proc://kabmo-dev' } }));
46
+ expect(fetchCalls).toHaveLength(0);
94
47
  expect(el.textContent ?? '').not.toContain('Loaded file');
95
48
  });
96
49
 
97
50
  test('a real path still lazy-loads', async () => {
98
- calls = [];
99
- await mount(readTool({ target: 'src/x.ts', input: { path: 'src/x.ts' } }));
100
- expect(calls[0]).toContain('/api/fs/read?path=src%2Fx.ts');
51
+ fetchCalls.length = 0;
52
+ await mountRead(readTool({ target: 'src/x.ts', input: { path: 'src/x.ts' } }));
53
+ expect(fetchCalls[0]).toContain('/api/fs/read?path=src%2Fx.ts');
101
54
  });
102
55
 
103
56
  test('a refused read prints the server’s reason, never a fake body', async () => {
104
57
  // A binary or oversized file is refused by the route with its own sentence.
105
58
  // Printing `// Loaded file: <path>` described contents that were never read.
106
- nextResponse = {
59
+ setNextResponse({
107
60
  ok: false,
108
61
  status: 415,
109
62
  body: { error: 'This file is not text, so it cannot be shown in the editor.', kind: 'binary' },
110
- };
111
- const el = await mount(readTool({ target: 'archive.zip', input: { path: 'archive.zip' } }));
63
+ });
64
+ const el = await mountRead(readTool({ target: 'archive.zip', input: { path: 'archive.zip' } }));
112
65
  const text = el.textContent ?? '';
113
66
  expect(text).toContain('not text');
114
67
  expect(text).not.toContain('Loaded file');
115
68
  });
116
69
 
117
70
  test('a read whose body is missing a content field is reported, not faked', async () => {
118
- nextResponse = { ok: true, status: 200, body: {} };
119
- const el = await mount(readTool({ target: 'src/y.ts', input: { path: 'src/y.ts' } }));
71
+ setNextResponse({ ok: true, status: 200, body: {} });
72
+ const el = await mountRead(readTool({ target: 'src/y.ts', input: { path: 'src/y.ts' } }));
120
73
  const text = el.textContent ?? '';
121
74
  expect(text).toContain('HTTP 200');
122
75
  expect(text).not.toContain('Loaded file');
@@ -130,7 +83,7 @@ describe('Read panel — language and markdown', () => {
130
83
  // was badged `javascript` (the language detector's default for a path with
131
84
  // no extension) and rendered as one `<pre>` of literal syntax.
132
85
  const text = '# eval — Eval\n\n- Static content? Use `read`.';
133
- const el = await mount(readTool({
86
+ const el = await mountRead(readTool({
134
87
  target: 'xd://eval',
135
88
  input: { path: 'xd://eval' },
136
89
  output: text.split('\n').map((row, index) => `${index + 1}|${row}`).join('\n'),
@@ -169,7 +122,7 @@ describe('Read panel — language and markdown', () => {
169
122
  '- MUST open a tab before direct use.',
170
123
  '</critical>',
171
124
  ].join('\n');
172
- const el = await mount(readTool({
125
+ const el = await mountRead(readTool({
173
126
  target: 'xd://eval/browser',
174
127
  input: { path: 'xd://eval/browser' },
175
128
  output: text.split('\n').map((line, index) => `${index + 1}|${line}`).join('\n'),
@@ -193,7 +146,7 @@ describe('Read panel — language and markdown', () => {
193
146
  // `read xd://propose` payload (one row) rendered as the paragraph
194
147
  // `1|Write your plan's <slug> …`.
195
148
  const line = "Write your plan's <slug> as plain text to xd://propose to submit the plan for approval.";
196
- const el = await mount(readTool({
149
+ const el = await mountRead(readTool({
197
150
  target: 'xd://propose',
198
151
  input: { path: 'xd://propose' },
199
152
  output: `1|${line}`,
@@ -211,7 +164,7 @@ describe('Read panel — language and markdown', () => {
211
164
  test('a failed xd:// read stays a message, not a document', async () => {
212
165
  // `read xd://nope` answers "No such tool: xd://nope. Mounted devices: …",
213
166
  // which is a refusal rather than a document; it keeps the code surface.
214
- const el = await mount(readTool({
167
+ const el = await mountRead(readTool({
215
168
  target: 'xd://nope',
216
169
  input: { path: 'xd://nope' },
217
170
  status: 'error',
@@ -231,7 +184,7 @@ describe('Read panel — language and markdown', () => {
231
184
  // renderer must strip that gutter before the markdown parse — otherwise the
232
185
  // heading is the paragraph `1|# Diagnose`.
233
186
  const text = '# Diagnose\n\n## Steps\n\n1. Reproduce';
234
- const el = await mount(readTool({
187
+ const el = await mountRead(readTool({
235
188
  target: 'skill://diagnose',
236
189
  input: { path: 'skill://diagnose' },
237
190
  output: text.split('\n').map((line, index) => `${index + 1}|${line}`).join('\n'),
@@ -250,7 +203,7 @@ describe('Read panel — language and markdown', () => {
250
203
  });
251
204
 
252
205
  test('a source file still gets its language badge and code gutter', async () => {
253
- const el = await mount(readTool({
206
+ const el = await mountRead(readTool({
254
207
  target: 'src/x.ts',
255
208
  input: { path: 'src/x.ts' },
256
209
  output: '1|const a = 1;',
@@ -260,4 +213,19 @@ describe('Read panel — language and markdown', () => {
260
213
  expect(text).toContain('typescript');
261
214
  expect(text).toContain('const a = 1;');
262
215
  });
216
+
217
+ test('a directory read draws the tree omp printed', async () => {
218
+ // The listing lives in `ReadDirectory` (split for the file-size ceiling);
219
+ // this pins the wiring, so a prop rename cannot silently empty the card.
220
+ const el = await mountRead(readTool({
221
+ target: 'src',
222
+ input: { path: 'src' },
223
+ output: '.\n- components/\n- index.ts',
224
+ }));
225
+ const text = el.textContent ?? '';
226
+ expect(text).toContain('Directory');
227
+ expect(text).toContain('components/');
228
+ expect(text).toContain('index.ts');
229
+ expect(el.querySelector('svg.lucide-folder')).not.toBeNull();
230
+ });
263
231
  });
@@ -1,9 +1,9 @@
1
1
  import { useEffect, useMemo, useState } from 'preact/hooks';
2
- import { FileCode, FileImage, FileText, Folder, FolderOpen, Info, Loader2 } from 'lucide-preact';
2
+ import { FileCode, FileImage, FolderOpen, Info, Loader2 } from 'lucide-preact';
3
3
  import { getLanguageFromPath } from '@/shared/lib/code/language';
4
4
  import { useDeferredHighlightLines } from '@/client/hooks/code/deferred-highlight';
5
5
  import { parseDirListing, parseNumberedCode } from '@/shared/lib/code/parser';
6
- import { getImageMimeType } from '@/shared/lib/fs/file-kind';
6
+ import { getPaintableImageMimeType, SVG_MIME } from '@/shared/lib/fs/file-kind';
7
7
  import { buildFsRawUrl, isVirtualPath, stripReadSelector } from '@/shared/lib/fs/paths';
8
8
  import { toolImageSrc } from '@/shared/lib/omp/session/tool-images';
9
9
  import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
@@ -14,6 +14,8 @@ import { extractLineMeta } from '@/client/components/workspace/chat-timeline/too
14
14
  import { ToolPanelHeader } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolPanelHeader';
15
15
  import { NumberedCode } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/numbered-code';
16
16
  import { getToolInputPath } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/tool-input';
17
+ import { ReadImage } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/ReadImage';
18
+ import { ReadDirectory } from '@/client/components/workspace/chat-timeline/tool-renderers/panels/ReadDirectory';
17
19
  import { isXdDocRead } from '@/client/components/workspace/chat-timeline/tool-renderers/registry';
18
20
 
19
21
  interface ReadPanelProps {
@@ -56,12 +58,29 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
56
58
  // over an output that is an error message. The failure renders as its own
57
59
  // text instead.
58
60
  const readFailed = tool?.status === 'error' || tool?.isError === true;
59
- const isPathImage = !resultImage && !readFailed && getImageMimeType(cleanFetchPath) !== null;
61
+ const pathImageMime = getPaintableImageMimeType(cleanFetchPath);
62
+ const isPathImage = !resultImage && !readFailed && pathImageMime !== null;
60
63
  const isImage = Boolean(resultImage) || isPathImage;
61
64
  const imageUrl = resultImage?.src ?? (isPathImage ? buildFsRawUrl({ path: cleanFetchPath }) : null);
65
+ /**
66
+ * An SVG read is the one picture the panel ALSO has text for: omp hands an
67
+ * `<svg>` back as source (it has no magic bytes, so the reader treats it as
68
+ * XML), and the file itself is a picture. So the preview is ADDED above the
69
+ * source instead of replacing it — the reader gets the rendering, and the
70
+ * markup the tool actually returned stays readable and copyable.
71
+ */
72
+ const svgPreviewUrl = isPathImage && pathImageMime === SVG_MIME ? imageUrl : null;
73
+
74
+ /**
75
+ * True when the card draws a picture and nothing else: a raster image (from
76
+ * the result's bytes or the path fallback) with no source text to show. An
77
+ * SVG is the exception — its preview sits above the markup — so the lazy text
78
+ * read still runs for it.
79
+ */
80
+ const isPictureOnly = isImage && !svgPreviewUrl;
62
81
 
63
82
  useEffect(() => {
64
- if (cleanFetchPath && !virtualPath && !isImage && !output && lazyContent === null && !loadingFile) {
83
+ if (cleanFetchPath && !virtualPath && !isPictureOnly && !output && lazyContent === null && !loadingFile) {
65
84
  setLoadingFile(true);
66
85
  fetch(`/api/fs/read?path=${encodeURIComponent(cleanFetchPath)}`)
67
86
  .then(async (res) => {
@@ -85,7 +104,7 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
85
104
  setLoadingFile(false);
86
105
  });
87
106
  }
88
- }, [cleanFetchPath, virtualPath, output, lazyContent, loadingFile, isImage]);
107
+ }, [cleanFetchPath, virtualPath, output, lazyContent, loadingFile, isPictureOnly]);
89
108
 
90
109
  const details = (tool?.details ?? {}) as Record<string, any>;
91
110
  /** omp's own display text: the rows it drew, WITHOUT the `1|` line-number
@@ -180,7 +199,15 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
180
199
  // `xd://` device docs, whose payload is the same markdown behind a
181
200
  // `text/plain` content type.
182
201
  const isMarkdown = isDocRead && !isDir;
183
- const kindLabel = isDir ? 'Directory' : isImage ? 'Image' : isMarkdown ? 'Markdown' : lang;
202
+ const kindLabel = isDir
203
+ ? 'Directory'
204
+ : svgPreviewUrl
205
+ ? 'SVG'
206
+ : isImage
207
+ ? 'Image'
208
+ : isMarkdown
209
+ ? 'Markdown'
210
+ : lang;
184
211
  /** The document a markdown read draws — and what Copy copies. omp's own
185
212
  * `displayContent.text` first: it is the gutter-free text, and the gutter
186
213
  * stripper that serves every other read keeps a one-row document's `1|`
@@ -215,11 +242,11 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
215
242
  <div className="space-y-2">
216
243
  {/* Header Info */}
217
244
  <ToolPanelHeader
218
- icon={isDir ? <FolderOpen size={12} /> : isImage ? <FileImage size={12} /> : <FileCode size={12} />}
245
+ icon={isDir ? <FolderOpen size={12} /> : isImage || svgPreviewUrl ? <FileImage size={12} /> : <FileCode size={12} />}
219
246
  label={filePath || resultImage?.name || (isDir ? 'Directory Listing' : 'File Content')}
220
247
  badge={kindLabel}
221
248
  copyText={
222
- rawContent && !isImage
249
+ rawContent && !isPictureOnly
223
250
  ? isMarkdown
224
251
  ? markdownContent
225
252
  : parsedCode.hasLineNumbers
@@ -230,18 +257,14 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
230
257
  copyLabel="Copy file content"
231
258
  />
232
259
 
233
- {isImage && imageUrl ? (
234
- /* An image read has no code to show: paint the bytes. */
235
- <div className="overflow-hidden rounded-lg border border-ink/8 bg-paper">
236
- <div className="flex max-h-80 items-center justify-center overflow-auto bg-canvas/60 p-3">
237
- <img
238
- src={imageUrl}
239
- alt={resultImage?.name ?? cleanFetchPath ?? 'Image'}
240
- title={resultImage?.name ?? cleanFetchPath}
241
- className="max-h-72 max-w-full object-contain"
242
- />
243
- </div>
244
- </div>
260
+ {/* An SVG is a picture AND text: omp returns the markup, and the file
261
+ renders. The preview goes above the source the reader can still copy. */}
262
+ {svgPreviewUrl && <ReadImage src={svgPreviewUrl} name={cleanFetchPath || 'Image'} />}
263
+
264
+ {isPictureOnly && imageUrl ? (
265
+ /* An image read has no code to show: paint the bytes, and open them at
266
+ full size on click — the same surface the `eval` screenshots use. */
267
+ <ReadImage src={imageUrl} name={resultImage?.name ?? cleanFetchPath ?? 'Image'} />
245
268
  ) : loadingFile ? (
246
269
  <div className="flex items-center gap-2 rounded-lg border border-ink/8 bg-paper px-3 py-3 font-mono text-[11px] text-ink/50">
247
270
  <Loader2 size={12} className="animate-spin" />
@@ -249,49 +272,7 @@ export function Read({ tool, targetFilePath, output }: ReadPanelProps) {
249
272
  </div>
250
273
  ) : isDir ? (
251
274
  /* Render Directory Listing */
252
- <div className="overflow-hidden rounded-lg border border-ink/8 bg-paper">
253
- {skippedEntries > 0 && (
254
- <div className="flex items-center gap-1.5 border-b border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
255
- <Info size={11} className="shrink-0" />
256
- <span>… {skippedEntries} earlier entries hidden</span>
257
- </div>
258
- )}
259
- <div className="max-h-72 divide-y divide-ink/[0.04] overflow-y-auto font-mono text-[11px]">
260
- {visibleEntries.map((entry, idx) => (
261
- <div
262
- key={idx}
263
- className="flex items-center gap-2 px-3 py-1.5 transition-colors hover:bg-ink/[0.02]"
264
- style={{ paddingLeft: `${Math.max(12, (entry.indent + 1) * 16)}px` }}
265
- >
266
- {entry.isDir ? (
267
- <Folder size={12} className="shrink-0 text-ink/60" />
268
- ) : (
269
- <FileText size={12} className="shrink-0 text-ink/40" />
270
- )}
271
- <span
272
- className={`min-w-0 flex-1 truncate ${
273
- entry.isDir ? 'font-semibold text-ink' : 'text-ink/80'
274
- }`}
275
- >
276
- {entry.name}
277
- {entry.isDir && '/'}
278
- </span>
279
- {entry.size && <span className="shrink-0 font-mono text-[10px] text-ink/40">{entry.size}</span>}
280
- {entry.time && (
281
- <span className="shrink-0 rounded bg-ink/5 px-1 py-0.2 font-mono text-[10px] text-ink/45">
282
- {entry.time}
283
- </span>
284
- )}
285
- </div>
286
- ))}
287
- </div>
288
- {dirInfo.notice && (
289
- <div className="flex items-center gap-1.5 border-t border-ink/8 bg-canvas/60 px-3 py-1.5 text-[10px] text-ink/50">
290
- <Info size={11} className="shrink-0" />
291
- <span>{dirInfo.notice}</span>
292
- </div>
293
- )}
294
- </div>
275
+ <ReadDirectory entries={visibleEntries} skipped={skippedEntries} notice={dirInfo.notice} />
295
276
  ) : isMarkdown ? (
296
277
  /* omp draws a `text/markdown` read (and an `xd://` doc read) as the
297
278
  document it is: headings, lists, links and code fences, not a code