@kabmo-labs/kabmo 0.42.0 → 0.42.2

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 (195) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +592 -593
  3. package/dist/client/static/js/{CsvGrid-20k047ht.js → CsvGrid-g6rek8y9.js} +1 -1
  4. package/dist/client/static/js/{DocxView-qpvhfcmg.js → DocxView-41t9ryws.js} +2 -2
  5. package/dist/client/static/js/{DrawioView-178skky8.js → DrawioView-mfxhfz1h.js} +1 -1
  6. package/dist/client/static/js/{ImageView-460th5qa.js → ImageView-bxqw3t4k.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-5cv0dty8.js → LayoutWrapper-zt14rv9m.js} +2 -2
  8. package/dist/client/static/js/{Modal-wks6p4r5.js → Modal-cm35g20x.js} +10 -10
  9. package/dist/client/static/js/{PdfView-y51g03nr.js → PdfView-bek8k888.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-rsmvn7ks.js → SessionsView-gn53zyn7.js} +1 -1
  11. package/dist/client/static/js/{SheetView-z7yvb05v.js → SheetView-vezssf6b.js} +1 -1
  12. package/dist/client/static/js/{SvgPreview-yehgzhem.js → SvgPreview-f1qaw73k.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-6zxpcy8b.js → abnfDiagram-O67JEVCF-4qn94h52.js} +1 -1
  14. package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +1 -0
  15. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-m98sgh3c.js → architectureDiagram-NJMV4G6O-tbewzdya.js} +3 -3
  16. package/dist/client/static/js/{blockDiagram-BEXU5L5S-cp7rervg.js → blockDiagram-BEXU5L5S-njgnwckz.js} +2 -2
  17. package/dist/client/static/js/{c4Diagram-YGBWAQC7-t31recqm.js → c4Diagram-YGBWAQC7-f58pcvbk.js} +1 -1
  18. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-fy8x3dkx.js → classDiagram-v2-NBCMYWYE-52g73vyw.js} +3 -3
  19. package/dist/client/static/js/{cose-bilkent-JH36ORCC-va7ybm9e.js → cose-bilkent-JH36ORCC-ptdnshzh.js} +1 -1
  20. package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +1 -0
  21. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-4k0k429c.js → cynefinDiagram-VND7K2PF-qabfdkzr.js} +1 -1
  22. package/dist/client/static/js/{dagre-6A5THRUB-ykdhxq6t.js → dagre-6A5THRUB-kyf5jetf.js} +2 -2
  23. package/dist/client/static/js/{diagram-22UHCM2B-5nvwx7b6.js → diagram-22UHCM2B-bxrsjtv9.js} +4 -4
  24. package/dist/client/static/js/{diagram-3UASUU5V-hc7zsjgw.js → diagram-3UASUU5V-0f41s00j.js} +1 -1
  25. package/dist/client/static/js/{diagram-ATOU4E4O-97ae07y7.js → diagram-ATOU4E4O-0z1zx9h1.js} +1 -1
  26. package/dist/client/static/js/{diagram-CDSNMT55-b56nnbbs.js → diagram-CDSNMT55-znrmr6bk.js} +3 -3
  27. package/dist/client/static/js/{diagram-MLGK6HIB-37rygr9k.js → diagram-MLGK6HIB-jfe2jhk0.js} +1 -1
  28. package/dist/client/static/js/{diagram-MPIPVDR6-wv3vhhfk.js → diagram-MPIPVDR6-2kaawmwa.js} +1 -1
  29. package/dist/client/static/js/{dockerfile-0efb1z6e.js → dockerfile-12exatm9.js} +1 -1
  30. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-13fv7vxg.js → ebnfDiagram-ZINNZB2B-s5n37rfp.js} +1 -1
  31. package/dist/client/static/js/{elixir-mabagxwa.js → elixir-szk51ehr.js} +1 -1
  32. package/dist/client/static/js/{elk-276RUBZZ-xam60ktz.js → elk-276RUBZZ-433rd9fp.js} +1 -1
  33. package/dist/client/static/js/{erDiagram-OPXOYQCR-24ctv2ee.js → erDiagram-OPXOYQCR-key6ah0b.js} +2 -2
  34. package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +1 -0
  35. package/dist/client/static/js/flowDiagram-KWPJA3E3-nznq0n36.js +1 -0
  36. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-766a8fqw.js → ganttDiagram-FUAMR5RP-4efkhmca.js} +2 -2
  37. package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +1 -0
  38. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-fmwjkgh6.js → gitGraphDiagram-X574FWY7-ac376y2k.js} +1 -1
  39. package/dist/client/static/js/html-tbz83eke.js +1 -0
  40. package/dist/client/static/js/{index-13xbwcbz.js → index-02543wk3.js} +1 -1
  41. package/dist/client/static/js/{index-sx809d6d.js → index-0e9nkc0g.js} +1 -1
  42. package/dist/client/static/js/{index-1c0pnsjd.js → index-0gbj4270.js} +1 -1
  43. package/dist/client/static/js/{index-z6kpc98a.js → index-0pabfaac.js} +1 -1
  44. package/dist/client/static/js/{index-4mstdh41.js → index-1t5ybx9v.js} +1 -1
  45. package/dist/client/static/js/{index-9vdbnvmk.js → index-1y3rzw6b.js} +1 -1
  46. package/dist/client/static/js/{index-qj34r6d0.js → index-38xv8h4t.js} +1 -1
  47. package/dist/client/static/js/{index-4j8rgr4p.js → index-50mdqev0.js} +1 -1
  48. package/dist/client/static/js/{index-zvazj4va.js → index-5jnvz9hw.js} +1 -1
  49. package/dist/client/static/js/{index-97qst4k9.js → index-77t0nvt1.js} +1 -1
  50. package/dist/client/static/js/{index-x7f5ysch.js → index-7a2efrbj.js} +1 -1
  51. package/dist/client/static/js/{index-yvxa7hd8.js → index-82vk27q1.js} +1 -1
  52. package/dist/client/static/js/{index-nbexks3x.js → index-8k7vjp8b.js} +1 -1
  53. package/dist/client/static/js/{index-sq3r1xhf.js → index-8kbp24xg.js} +1 -1
  54. package/dist/client/static/js/{index-zjydzxhm.js → index-b0v6gwym.js} +2 -2
  55. package/dist/client/static/js/{index-grczkttn.js → index-b42t14wk.js} +7 -7
  56. package/dist/client/static/js/{index-13dr1t1r.js → index-cz50ha6x.js} +23 -23
  57. package/dist/client/static/js/{index-8jqawh3r.js → index-dtj73vs1.js} +1 -1
  58. package/dist/client/static/js/{index-7t63akyt.js → index-dzmar8jr.js} +1 -1
  59. package/dist/client/static/js/{index-2x9eqztp.js → index-f33c4paw.js} +1 -1
  60. package/dist/client/static/js/{index-xxe52zrm.js → index-fb6pw9xb.js} +1 -1
  61. package/dist/client/static/js/{index-6ge6gk9w.js → index-gp57dx2v.js} +1 -1
  62. package/dist/client/static/js/{index-2hpy58d0.js → index-gsxebrq9.js} +2 -2
  63. package/dist/client/static/js/{index-czagykbq.js → index-pxtff3ez.js} +2 -2
  64. package/dist/client/static/js/{index-8hgm0abr.js → index-pzvr1699.js} +187 -183
  65. package/dist/client/static/js/{index-dydwcp3n.js → index-r9db1gsf.js} +1 -1
  66. package/dist/client/static/js/{index-b4y5g48d.js → index-raca8tsh.js} +1 -1
  67. package/dist/client/static/js/{index-95en3p3g.js → index-rf29f3fq.js} +4 -4
  68. package/dist/client/static/js/{index-sz3mxjvy.js → index-s4gv0rpk.js} +1 -1
  69. package/dist/client/static/js/{index-a9t9gdew.js → index-v3f7we4n.js} +4 -4
  70. package/dist/client/static/js/{index-ejdnjh5c.js → index-yjmm73jm.js} +1 -1
  71. package/dist/client/static/js/{index-1rxa9zxp.js → index-ykfd2fyj.js} +1 -1
  72. package/dist/client/static/js/{index-4z4ax55k.js → index-yzda8j2d.js} +6 -6
  73. package/dist/client/static/js/{index-vcn1kcpy.js → index-z78bzryw.js} +3 -3
  74. package/dist/client/static/js/{index-tqycj126.js → index-zndbhb9w.js} +1 -1
  75. package/dist/client/static/js/{index-ka2rc2cr.js → index-zs73zwjz.js} +3 -3
  76. package/dist/client/static/js/{index-xe5cqwnf.js → index-zs7sjv6x.js} +1 -1
  77. package/dist/client/static/js/{index-hzwr5fm9.js → index-zw621xez.js} +3 -3
  78. package/dist/client/static/js/info-A6RAGUB7-n495k952.js +1 -0
  79. package/dist/client/static/js/{infoDiagram-VRGFBTTK-tqytmzp1.js → infoDiagram-VRGFBTTK-4e7ej63f.js} +2 -2
  80. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rp77ff6m.js → ishikawaDiagram-OU5B5YK6-k3yet1ec.js} +2 -2
  81. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-c7bxrhf1.js → journeyDiagram-ZHPQQLJL-qe352kyd.js} +2 -2
  82. package/dist/client/static/js/{kanban-definition-PNTS6WVX-j2pxewqq.js → kanban-definition-PNTS6WVX-58hag75n.js} +4 -4
  83. package/dist/client/static/js/{mermaid.core-cqqe1krg.js → mermaid.core-6e89h6vm.js} +2 -2
  84. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-s03k32p9.js → mindmap-definition-NLK3R4M7-ncsam2fm.js} +1 -1
  85. package/dist/client/static/js/one-dark-pro-qmyne0tn.js +1 -0
  86. package/dist/client/static/js/one-light-dj0ecjcj.js +1 -0
  87. package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +1 -0
  88. package/dist/client/static/js/{pegDiagram-GJSIUBJH-dfg2j0zc.js → pegDiagram-GJSIUBJH-b5ckc39d.js} +1 -1
  89. package/dist/client/static/js/{perl-5vxax0nr.js → perl-dtn1fccw.js} +1 -1
  90. package/dist/client/static/js/{php-hgrgdq63.js → php-7av78hch.js} +1 -1
  91. package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +1 -0
  92. package/dist/client/static/js/{pieDiagram-5QR66LMP-pshd1j79.js → pieDiagram-5QR66LMP-s4d47ve8.js} +2 -2
  93. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-cvvvmtk2.js → quadrantDiagram-O4NWA36T-zm0ekvjz.js} +1 -1
  94. package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +1 -0
  95. package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +1 -0
  96. package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +1 -0
  97. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +1 -0
  98. package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +1 -0
  99. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-h53p3sha.js → railroadDiagram-XR7U4H2S-52vdqf53.js} +1 -1
  100. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-bdv2fkxd.js → requirementDiagram-PLB6GJNP-7kf8bmk9.js} +1 -1
  101. package/dist/client/static/js/{ruby-8pxcn21w.js → ruby-s2bqr910.js} +1 -1
  102. package/dist/client/static/js/{rust-j80dxgjg.js → rust-q98kssv3.js} +1 -1
  103. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-xqnnvmhy.js → sankeyDiagram-IPEJSGJF-bcb9f54a.js} +1 -1
  104. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-3p67305f.js → sequenceDiagram-PO4LG4MO-76ywvj7g.js} +3 -3
  105. package/dist/client/static/js/{sizeCapture-INFHLROL-f87525h7.js → sizeCapture-INFHLROL-p9bsf5dc.js} +1 -1
  106. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-e5st1fy3.js → stateDiagram-v2-GCMORJYK-1ecfb3fs.js} +1 -1
  107. package/dist/client/static/js/{swimlanes-2SLR337P-ceghkbez.js → swimlanes-2SLR337P-2pyjr946.js} +1 -1
  108. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-vc8hvfya.js → swimlanesDiagram-TC7HE7FX-qr5hdxm4.js} +1 -1
  109. package/dist/client/static/js/{timeline-definition-EJHVYXUP-f7evs443.js → timeline-definition-EJHVYXUP-4csxwmn2.js} +3 -3
  110. package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +1 -0
  111. package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +1 -0
  112. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0gpn21p7.js → usecaseDiagram-POWQR4AR-0p1jnbsn.js} +7 -7
  113. package/dist/client/static/js/{vennDiagram-UO4OBE2U-4spzy428.js → vennDiagram-UO4OBE2U-y1hgdet4.js} +2 -2
  114. package/dist/client/static/js/{vue-xm1dxpmy.js → vue-cbqm4bed.js} +1 -1
  115. package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +1 -0
  116. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-745xr2pa.js → wardleyDiagram-VNRHLVJA-p578yrgm.js} +2 -2
  117. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-7dr9qwx5.js → xychartDiagram-PMCCYNJV-b08b4ah0.js} +3 -3
  118. package/package.json +1 -1
  119. package/src/cli/lib/commands/session.js +12 -1
  120. package/src/client/components/workspace/chat-timeline/MessageItem.tsx +14 -123
  121. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +214 -0
  122. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +126 -0
  123. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +183 -0
  124. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
  125. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
  126. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
  127. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
  128. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
  129. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
  130. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
  131. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
  132. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -0
  133. package/src/client/hooks/chat/timeline/composer-modes.ts +10 -7
  134. package/src/client/hooks/chat/timeline/plan-review-republish.test.ts +121 -0
  135. package/src/client/hooks/chat/timeline/plan-review.ts +12 -3
  136. package/src/server/lib/harness/acp/acp-audit.server.ts +1 -1
  137. package/src/server/lib/harness/acp/session-exit.ts +39 -5
  138. package/src/server/lib/harness/acp/session-turns.ts +67 -12
  139. package/src/server/lib/harness/acp/session.test.ts +61 -0
  140. package/src/server/lib/harness/acp/session.ts +15 -25
  141. package/src/server/lib/harness/acp/turn-outcome.server.test.ts +97 -0
  142. package/src/server/lib/harness/acp/turn-outcome.server.ts +71 -0
  143. package/src/server/lib/harness/acp/turn-silence.ts +52 -0
  144. package/src/server/lib/harness/acp/turn.test.ts +85 -3
  145. package/src/server/lib/harness/acp/turn.ts +62 -4
  146. package/src/server/lib/lifecycle/after-listen.ts +10 -0
  147. package/src/server/lib/omp/rpc/frame-fold-contract.ts +21 -0
  148. package/src/server/lib/omp/rpc/frame-fold-host.test-util.ts +4 -0
  149. package/src/server/lib/omp/rpc/frame-fold.ts +25 -2
  150. package/src/server/lib/omp/rpc/manager.ts +9 -8
  151. package/src/server/lib/omp/rpc/retry-saga.ts +54 -0
  152. package/src/server/lib/omp/rpc/run-settle.server.ts +38 -5
  153. package/src/server/lib/omp/rpc/run-settle.test.ts +5 -2
  154. package/src/server/lib/omp/rpc/session-commands-dialog.test.ts +6 -20
  155. package/src/server/lib/omp/rpc/session-commands-mapping.test.ts +131 -0
  156. package/src/server/lib/omp/rpc/session-commands.test.ts +95 -116
  157. package/src/server/lib/omp/rpc/session-commands.ts +38 -17
  158. package/src/server/lib/omp/rpc/terminal-settle.test.ts +223 -0
  159. package/src/server/lib/omp/rpc/terminal-settle.ts +127 -29
  160. package/src/server/lib/omp/session/scan.ts +15 -2
  161. package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
  162. package/src/server/lib/sessions/notify.server.test.ts +11 -3
  163. package/src/server/lib/sessions/notify.server.ts +67 -42
  164. package/src/server/lib/sessions/spawn.server.test.ts +5 -1
  165. package/src/server/lib/sessions/spawn.server.ts +8 -3
  166. package/src/server/routes/sessions/answer.test.ts +62 -0
  167. package/src/server/routes/sessions/answer.ts +13 -2
  168. package/src/shared/lib/chat/composer/delegation.ts +11 -7
  169. package/src/shared/lib/chat/export-markdown.ts +19 -0
  170. package/src/shared/lib/chat/orchestration/notice.test.ts +118 -0
  171. package/src/shared/lib/chat/orchestration/notice.ts +183 -0
  172. package/src/shared/lib/chat/timeline/omp-callbacks.ts +6 -1
  173. package/src/shared/lib/chat/timeline/tool-render-mode.ts +3 -3
  174. package/src/shared/lib/icons/tint-hues.generated.ts +36 -36
  175. package/src/shared/lib/omp/session/operator-title.test.ts +21 -0
  176. package/src/shared/lib/omp/session/operator-title.ts +28 -0
  177. package/dist/client/static/js/architecture-7GRP2DOG-9q06651f.js +0 -1
  178. package/dist/client/static/js/cynefin-OW5HDTMX-w7a38g4g.js +0 -1
  179. package/dist/client/static/js/eventmodeling-NTZA5JFV-6wrjccyw.js +0 -1
  180. package/dist/client/static/js/flowDiagram-KWPJA3E3-19vjkg84.js +0 -1
  181. package/dist/client/static/js/gitGraph-4MIJSDKK-4je2p50v.js +0 -1
  182. package/dist/client/static/js/html-bwyt0ayy.js +0 -1
  183. package/dist/client/static/js/info-A6RAGUB7-k0z5qdew.js +0 -1
  184. package/dist/client/static/js/one-dark-pro-9tt0a020.js +0 -1
  185. package/dist/client/static/js/one-light-5fg4r0ra.js +0 -1
  186. package/dist/client/static/js/packet-AYTQ26CC-6cnvmb2z.js +0 -1
  187. package/dist/client/static/js/pie-WAS4IAKB-m9z1mztn.js +0 -1
  188. package/dist/client/static/js/radar-RG4KPBEZ-8m9rkex6.js +0 -1
  189. package/dist/client/static/js/railroad-74A4TZTK-wc55emj8.js +0 -1
  190. package/dist/client/static/js/railroad-abnf-HS5TGJTU-2y2rnrzq.js +0 -1
  191. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-zzcc9x0v.js +0 -1
  192. package/dist/client/static/js/railroad-peg-WCYAUIDC-z82na5nb.js +0 -1
  193. package/dist/client/static/js/treeView-Q6P3EWNA-kzh6cm3f.js +0 -1
  194. package/dist/client/static/js/treemap-WGGIJYW6-wz5ed560.js +0 -1
  195. package/dist/client/static/js/wardley-WFR3VGLG-zewbfccz.js +0 -1
@@ -0,0 +1,126 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * A row Kabmo wrote must not read as a row a person wrote.
8
+ *
9
+ * Both halves are pinned through the rendered DOM, because the bug was a
10
+ * decision made at a call site: a delegating message is an orchestration
11
+ * contract PREPENDED to the operator's sentence, and a child outcome is a card
12
+ * with no operator text at all. Drawing either as a user bubble put Kabmo's own
13
+ * machinery — a shell heredoc, a worker report from a session nobody is looking
14
+ * at — in the mouth of the person reading the transcript.
15
+ *
16
+ * Rendered with `h()` against happy-dom, the same way the notice and gutter
17
+ * suites do.
18
+ */
19
+
20
+ import { afterAll, afterEach, beforeAll, describe, expect, test } from 'bun:test';
21
+ import { Window } from 'happy-dom';
22
+ import { h, render } from 'preact';
23
+ import { act } from 'preact/test-utils';
24
+ import { UserTurn } from '@/client/components/workspace/chat-timeline/UserTurn';
25
+ import {
26
+ ORCHESTRATION_CONTRACT,
27
+ WORKER_BRIEF,
28
+ renderChildOutcomeNotice,
29
+ } from '@/shared/lib/chat/orchestration/notice';
30
+ import type { ChatMessageData } from '@/shared/types';
31
+
32
+ const DOM_GLOBALS = ['window', 'document', 'navigator', 'Node', 'Element', 'HTMLElement', 'Event'] as const;
33
+ const nativeGlobals: Partial<Record<(typeof DOM_GLOBALS)[number], unknown>> = {};
34
+
35
+ beforeAll(() => {
36
+ const win = new Window({ url: 'http://localhost' });
37
+ const target = globalThis as unknown as Record<string, unknown>;
38
+ for (const key of DOM_GLOBALS) {
39
+ if (!(key in nativeGlobals)) nativeGlobals[key] = target[key];
40
+ target[key] = (win as unknown as Record<string, unknown>)[key];
41
+ }
42
+ });
43
+
44
+ afterAll(() => {
45
+ const target = globalThis as unknown as Record<string, unknown>;
46
+ for (const key of DOM_GLOBALS) {
47
+ if (nativeGlobals[key] === undefined) delete target[key];
48
+ else target[key] = nativeGlobals[key];
49
+ }
50
+ });
51
+
52
+ let container: HTMLElement | null = null;
53
+
54
+ afterEach(() => {
55
+ if (container) {
56
+ act(() => render(null, container as HTMLElement));
57
+ container.remove();
58
+ container = null;
59
+ }
60
+ });
61
+
62
+ function mount(content: string): HTMLElement {
63
+ container = document.body.appendChild(document.createElement('div'));
64
+ const msg = { id: 'm1', role: 'user', content } as ChatMessageData;
65
+ act(() =>
66
+ render(
67
+ h(UserTurn, {
68
+ msg,
69
+ content,
70
+ isMobile: false,
71
+ userActions: true,
72
+ canFork: false,
73
+ className: '',
74
+ }),
75
+ container as HTMLElement,
76
+ ),
77
+ );
78
+ return container;
79
+ }
80
+
81
+ describe('an injected prompt renders as a card, not a bubble', () => {
82
+ test('a child outcome has no operator bubble at all', () => {
83
+ const root = mount(
84
+ renderChildOutcomeNotice([
85
+ { sessionId: 'c1', status: 'failed', failure: '400 The model is unavailable.' },
86
+ ]),
87
+ );
88
+ const text = root.textContent ?? '';
89
+ expect(text).toContain('Worker outcome');
90
+ expect(text).toContain('Failed');
91
+ // The card's subtitle names the worker; no bubble and no toolbar, because
92
+ // the operator wrote none of this row.
93
+ expect(root.querySelector('button[aria-label="Undo this message"]')).toBeNull();
94
+ });
95
+
96
+ test('the operator keeps their own words beside the contract', () => {
97
+ const content = [
98
+ ORCHESTRATION_CONTRACT.open,
99
+ 'You are the orchestrator for this message.',
100
+ ORCHESTRATION_CONTRACT.close,
101
+ '',
102
+ 'koordinasikan timnya',
103
+ ].join('\n');
104
+ const root = mount(content);
105
+ const text = root.textContent ?? '';
106
+ expect(text).toContain('Orchestration');
107
+ expect(text).toContain('koordinasikan timnya');
108
+ // The contract's own instructions never become the visible bubble text.
109
+ expect(root.innerHTML).not.toContain('You are the orchestrator for this message.');
110
+ });
111
+
112
+ test('a worker brief is one card and never a bubble', () => {
113
+ const root = mount(
114
+ `${WORKER_BRIEF.open}\nYou are session c1.\n\nTASK\ncheck the log\n${WORKER_BRIEF.close}`,
115
+ );
116
+ expect(root.textContent).toContain('Dispatched worker');
117
+ expect(root.querySelector('button[aria-label="Undo this message"]')).toBeNull();
118
+ });
119
+
120
+ test('an ordinary user message keeps its bubble and its toolbar', () => {
121
+ const root = mount('just fix the test please');
122
+ const text = root.textContent ?? '';
123
+ expect(text).toContain('just fix the test please');
124
+ expect(root.querySelector('button[aria-label="Undo this message"]')).not.toBeNull();
125
+ });
126
+ });
@@ -0,0 +1,183 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * One `role: "user"` row.
8
+ *
9
+ * Split out of `MessageItem` when the orchestration card landed: the row now
10
+ * has two halves — the text Kabmo injected and the text the operator typed —
11
+ * and keeping both in the assistant renderer pushed that file past the repo's
12
+ * ceiling.
13
+ *
14
+ * The split is the point. A delegating message is an orchestration contract
15
+ * PREPENDED to what the person wrote, and a child outcome is a notice with no
16
+ * operator text at all. Drawing either as a bubble made Kabmo's own machinery
17
+ * look like something a human said, so the injected half renders as a card
18
+ * (`OrchestrationNotice`) and only the operator's words keep the bubble.
19
+ */
20
+
21
+ import { useMemo } from 'preact/hooks';
22
+ import { Bot, GitFork, MessageSquarePlus, Undo2, User } from 'lucide-preact';
23
+ import type { Attachment, ChatMessageData } from '@/shared/types';
24
+ import type { ForkAnchorRole } from '@/shared/lib/chat/timeline/fork-anchor';
25
+ import { toAttachmentList } from '@/shared/lib/chat/attachments';
26
+ import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
27
+ import { AttachmentChips } from '@/client/components/workspace/chat-timeline/AttachmentChips';
28
+ import { CopyButton } from '@/client/components/common/CopyButton';
29
+ import { PluginMessageActions } from '@/client/components/workspace/chat-timeline/PluginMessageActions';
30
+ import { OrchestrationNotice } from '@/client/components/workspace/chat-timeline/OrchestrationNotice';
31
+ import { formatMessageStamp } from '@/shared/lib/format/time';
32
+ import { transcriptBlockPadding, transcriptGutter } from '@/shared/lib/chat/timeline/gutter';
33
+ import { parseOrchestrationBlock } from '@/shared/lib/chat/orchestration/notice';
34
+
35
+ export interface UserTurnProps {
36
+ msg: ChatMessageData | any;
37
+ /** The row's display text, already resolved by the caller. */
38
+ content: unknown;
39
+ isMobile: boolean;
40
+ /** Whether this row offers Undo / New-chat (a chat turn, not a BTW question). */
41
+ userActions: boolean;
42
+ canFork: boolean;
43
+ className: string;
44
+ onUndo?: (msgId: string, content?: string) => void;
45
+ onNewChat?: (content: string, attachments?: Attachment[]) => void;
46
+ onFork?: (msgId: string, role: ForkAnchorRole) => void;
47
+ }
48
+
49
+ export function UserTurn({
50
+ msg,
51
+ content,
52
+ isMobile,
53
+ userActions,
54
+ canFork,
55
+ className,
56
+ onUndo,
57
+ onNewChat,
58
+ onFork,
59
+ }: UserTurnProps) {
60
+ const isAgentAttributed = msg.attribution === 'agent';
61
+ const raw = typeof content === 'string' ? content : '';
62
+ const orchestration = useMemo(() => parseOrchestrationBlock(raw), [raw]);
63
+ // What the operator actually wrote. For a delegating turn that is the text
64
+ // after the contract; for a notice it is nothing, and the row is the card.
65
+ const operatorText = orchestration ? orchestration.rest : raw;
66
+ const showBubble = !orchestration || operatorText.length > 0;
67
+ const displayText = useMemo(() => operatorText.trim(), [operatorText]);
68
+
69
+ const handleNewChat = (e?: Event) => {
70
+ if (e) e.preventDefault();
71
+ if (!onNewChat) return;
72
+ // Committed rows carry the persisted display fields only (no `File`), which
73
+ // is what the composer and the send path both expect on a replay.
74
+ const attachments = toAttachmentList(msg.attachments);
75
+ onNewChat(displayText, attachments.length ? attachments : undefined);
76
+ };
77
+
78
+ return (
79
+ <div id={msg.id} className={`flex flex-col space-y-1.5 w-full max-w-full ${className}`}>
80
+ {orchestration && <OrchestrationNotice block={orchestration} isMobile={isMobile} />}
81
+
82
+ {showBubble && (
83
+ <div className="flex flex-col items-end space-y-1.5 w-full max-w-full">
84
+ {/* User bubble - standardized to text-[13px] with markdown support */}
85
+ <div className={`bg-paper ${transcriptBlockPadding(isMobile)} sm:p-4 rounded-xl border border-ink/15 text-[13px] text-ink shadow-xs max-w-[92%] sm:max-w-[85%] break-words overflow-hidden flex flex-col space-y-2 font-sans select-text ${transcriptGutter(isMobile)}`} style={{ lineHeight: 'var(--markdown-body-line-height)' }}>
86
+ {isAgentAttributed && (
87
+ <div className="flex items-center space-x-1.5 pb-1.5 mb-1 border-b border-ink/10 text-[11px] font-mono text-ink/70">
88
+ <Bot size={12} className="text-ink shrink-0" />
89
+ <span className="font-semibold text-ink">Subagent Assignment</span>
90
+ <span className="text-[10px] uppercase tracking-wider px-1.5 py-0.5 rounded bg-ink/5 text-ink/60">Delegated</span>
91
+ </div>
92
+ )}
93
+ <MarkdownRenderer content={displayText} />
94
+
95
+ <AttachmentChips
96
+ attachments={msg.attachments || []}
97
+ onOpenFile={(att: { name?: string; content?: string }) => {
98
+ window.dispatchEvent(new CustomEvent('omp:open-file', {
99
+ detail: { path: att.name ?? 'attachment', content: att.content }
100
+ }));
101
+ }}
102
+ />
103
+ </div>
104
+
105
+ {/* User Metadata & Toolbar (Undo on the left of Copy) */}
106
+ <div className="flex items-center space-x-2.5 text-[11px] text-ink/60 px-1 font-mono">
107
+ <div className="flex items-center space-x-1.5 border-r border-ink/15 pr-2.5">
108
+ {isAgentAttributed ? (
109
+ <>
110
+ <Bot size={11} className="text-ink/70 shrink-0" />
111
+ <span className="text-[10px] uppercase font-semibold tracking-wider text-ink/60">Agent</span>
112
+ </>
113
+ ) : (
114
+ <User size={11} className="text-ink/70 shrink-0" />
115
+ )}
116
+ {formatMessageStamp(msg) && <span>{formatMessageStamp(msg)}</span>}
117
+ </div>
118
+
119
+ <div className="flex items-center space-x-1">
120
+ {/* Undo Button (to the left of copy button) */}
121
+ {userActions && (
122
+ <button
123
+ type="button"
124
+ className="flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer"
125
+ title="Undo / Edit message"
126
+ aria-label="Undo this message"
127
+ onClick={() => onUndo?.(msg.id, displayText)}
128
+ >
129
+ <Undo2 size={12} />
130
+ </button>
131
+ )}
132
+
133
+ {/* Copy Button — the operator's words, never the injected contract. */}
134
+ <CopyButton
135
+ text={displayText}
136
+ className="flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer"
137
+ iconSize={12}
138
+ title="Copy prompt"
139
+ ariaLabel="Copy prompt"
140
+ emptyTitle="Nothing to copy — attachment-only prompt"
141
+ />
142
+
143
+ {/* Fork Button — branches the session at this row, leaving the
144
+ source untouched. Separate from New Chat: a fork carries the
145
+ history, a new chat does not. */}
146
+ {userActions && canFork && (
147
+ <button
148
+ type="button"
149
+ className="flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer"
150
+ title="Fork from here"
151
+ aria-label="Fork this session from this message"
152
+ onClick={(e) => {
153
+ e.preventDefault();
154
+ onFork?.(msg.id, 'user');
155
+ }}
156
+ >
157
+ <GitFork size={12} />
158
+ </button>
159
+ )}
160
+
161
+ {/* New Chat Button */}
162
+ {userActions && (
163
+ <button
164
+ type="button"
165
+ className="flex items-center hover:text-ink transition-colors p-1 rounded hover:bg-ink/5 cursor-pointer"
166
+ title="New Chat from here"
167
+ aria-label="Start a new chat from this message"
168
+ onClick={handleNewChat}
169
+ >
170
+ <MessageSquarePlus size={12} />
171
+ </button>
172
+ )}
173
+
174
+ {/* Plugin contributions, in store order. The empty slot renders
175
+ nothing, so a Kabmo with no plugins keeps this strip intact. */}
176
+ <PluginMessageActions messageId={String(msg.id)} role="user" text={displayText} />
177
+ </div>
178
+ </div>
179
+ </div>
180
+ )}
181
+ </div>
182
+ );
183
+ }
@@ -57,7 +57,7 @@ export function ToolBody({ tool, view }: { tool: ToolCallData; view: ToolView })
57
57
  <ToolDetailsPanel tool={tool} />
58
58
  )}
59
59
 
60
- {!view.hasBody && view.commandOrInput && (
60
+ {view.hasGenericBody && view.commandOrInput && (
61
61
  <div className="space-y-1.5 code-surface">
62
62
  <div className="flex items-center justify-between">
63
63
  <div className="flex items-center gap-1.5">
@@ -85,14 +85,14 @@ export function ToolBody({ tool, view }: { tool: ToolCallData; view: ToolView })
85
85
  </div>
86
86
  )}
87
87
 
88
- {!view.hasBody && view.diffText && (
88
+ {view.hasGenericBody && view.diffText && (
89
89
  <div className="space-y-1.5">
90
90
  <SectionLabel>Diff</SectionLabel>
91
91
  <DiffView text={view.diffText} path={view.subtitle} />
92
92
  </div>
93
93
  )}
94
94
 
95
- {!view.hasBody && view.outputText && <FallbackOutput text={view.outputText} />}
95
+ {view.hasGenericBody && view.outputText && <FallbackOutput text={view.outputText} />}
96
96
  </>
97
97
  );
98
98
  }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * @license
3
+ * SPDX-License-Identifier: MIT
4
+ */
5
+
6
+ /**
7
+ * The two facts a tool row carries OUTSIDE its body: the way back to a spilled
8
+ * result, and the runtime's reminder that interrupted the call.
9
+ *
10
+ * They used to live in the card's action slot only, so a `compact`, `trace`,
11
+ * `minimal` or `tui` transcript silently dropped both: a result whose output
12
+ * omp capped showed the truncated copy with no way to open the rest, and a
13
+ * reminder envelope read as an ordinary success. A style is a frame, not a
14
+ * capability, so every row renders the same two facts.
15
+ *
16
+ * Rendered as a SIBLING of the row's toggle button (see the line styles), never
17
+ * inside it: `ArtifactChip` is a button itself, and nesting an interactive
18
+ * element inside the row's `<button>` is invalid and loses it to a screen
19
+ * reader.
20
+ */
21
+
22
+ import { Bell } from 'lucide-preact';
23
+ import type { ToolCallData } from '@/shared/types';
24
+ import { ArtifactChip } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip';
25
+ import { useTimelineScope } from '@/client/hooks/chat/timeline/scope';
26
+ import { artifactRefOf } from '@/shared/lib/chat/tool/artifact';
27
+
28
+ export function ToolRowActions({ tool, isReminder }: { tool: ToolCallData; isReminder: boolean }) {
29
+ const { sessionId } = useTimelineScope();
30
+ // Nothing to say: render NOTHING, not an empty flex child. The card's action
31
+ // slot and the line styles' row both space their children with a gap, so an
32
+ // empty wrapper would shift the status badge and the chevron by that gap.
33
+ if (!isReminder && !(sessionId && artifactRefOf(tool))) return null;
34
+
35
+ return (
36
+ <span className="flex shrink-0 items-center gap-1.5">
37
+ <ArtifactChip tool={tool} />
38
+ {isReminder && (
39
+ <span className="inline-flex items-center gap-1 rounded-full bg-error/10 px-2 py-0.5 text-[10px] font-semibold text-error">
40
+ <Bell size={10} /> Reminder
41
+ </span>
42
+ )}
43
+ </span>
44
+ );
45
+ }
@@ -47,8 +47,10 @@ export interface ToolView {
47
47
  hasPanel: boolean;
48
48
  /** The plugin renderer to use INSTEAD, when the host has no panel. */
49
49
  pluginPanel: PluginTimelineRenderer;
50
- /** Whether there is anything to expand. */
50
+ /** Whether there is anything to expand — a panel, a plugin, or generic text. */
51
51
  hasBody: boolean;
52
+ /** The generic Input / Diff / Output fallback is what fills the body. */
53
+ hasGenericBody: boolean;
52
54
  summary: ToolSummary | null;
53
55
  header: ToolCardHeader;
54
56
  subtitle: string | undefined;
@@ -76,7 +78,6 @@ export function useToolView(tool: ToolCallData): ToolView {
76
78
  // so a plugin can ship its own agent tool without shadowing `bash` or `read`.
77
79
  const pluginRenderer = usePluginTimelineRenderer(toolKey);
78
80
  const pluginPanel = hasPanel ? null : pluginRenderer;
79
- const hasBody = hasPanel || pluginPanel !== null;
80
81
  const summary = useMemo(() => toolSummary(tool), [tool]);
81
82
  const header = useMemo(() => toolCardHeader(tool, toolKey), [tool, toolKey]);
82
83
  const subtitle = toolCardSubtitle(tool, header);
@@ -85,9 +86,17 @@ export function useToolView(tool: ToolCallData): ToolView {
85
86
  const outputText = tool.output || (tool.error ? `Error: ${tool.error}` : '');
86
87
  const diffText = diffTextOf(tool);
87
88
 
89
+ // A tool with no panel and no plugin still has something to show: the generic
90
+ // Input / Diff / Output fallback. The card always rendered it (its shell sees
91
+ // a child VNode and calls that a body); the line styles used to gate the body
92
+ // on a panel alone, so a custom or plugin tool opened nothing at all.
93
+ const hasGenericBody =
94
+ !hasPanel && pluginPanel === null && Boolean(commandOrInput || diffText || outputText);
95
+ const hasBody = hasPanel || pluginPanel !== null || hasGenericBody;
96
+
88
97
  const inputJson = useMemo(
89
- () => (!hasBody && commandOrInput ? tryParseJson(commandOrInput) : null),
90
- [hasBody, commandOrInput],
98
+ () => (hasGenericBody && commandOrInput ? tryParseJson(commandOrInput) : null),
99
+ [hasGenericBody, commandOrInput],
91
100
  );
92
101
 
93
102
  // A reminder envelope in the result is the runtime interrupting the call, not
@@ -118,6 +127,7 @@ export function useToolView(tool: ToolCallData): ToolView {
118
127
  hasPanel,
119
128
  pluginPanel,
120
129
  hasBody,
130
+ hasGenericBody,
121
131
  summary: headerSummary,
122
132
  header,
123
133
  subtitle,
@@ -14,10 +14,9 @@
14
14
 
15
15
  import { useCallback } from 'preact/hooks';
16
16
  import { memo } from 'preact/compat';
17
- import { Bell } from 'lucide-preact';
18
- import { ArtifactChip } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip';
19
17
  import { ToolBody } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody';
20
18
  import { ToolCardShell } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolCardShell';
19
+ import { ToolRowActions } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions';
21
20
  import { useToolView } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view';
22
21
  import type { ToolRowProps } from '@/client/components/workspace/chat-timeline/tool-renderers/styles/props';
23
22
 
@@ -30,16 +29,7 @@ export const CardRow = memo(function CardRow({ tool, isOpen, onToggle, defaultEx
30
29
 
31
30
  // A reminder envelope in the result is the runtime interrupting the call, not
32
31
  // its outcome — the header flags it beside the status badge.
33
- const actions = (
34
- <>
35
- <ArtifactChip tool={tool} />
36
- {view.isReminder && (
37
- <span className="inline-flex items-center gap-1 rounded-full bg-error/10 px-2 py-0.5 text-[10px] font-semibold text-error">
38
- <Bell size={10} /> Reminder
39
- </span>
40
- )}
41
- </>
42
- );
32
+ const actions = <ToolRowActions tool={tool} isReminder={view.isReminder} />;
43
33
 
44
34
  return (
45
35
  <ToolCardShell
@@ -21,6 +21,7 @@ import { memo } from 'preact/compat';
21
21
  import { ChevronDown } from 'lucide-preact';
22
22
  import { ToolBody } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody';
23
23
  import { ToolFactChips } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolFactChips';
24
+ import { ToolRowActions } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions';
24
25
  import { toolStatusGlyph, STATUS_TONE_CLASS } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/status-glyph';
25
26
  import { useToolView } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view';
26
27
  import { toolToggleLabel } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label';
@@ -39,45 +40,48 @@ export const CompactRow = memo(function CompactRow({ tool, isOpen, onToggle, def
39
40
 
40
41
  return (
41
42
  <div className="group" data-tool-row="compact">
42
- <button
43
- type="button"
44
- onClick={handleToggle}
45
- disabled={!view.hasBody || view.alwaysExpanded}
46
- aria-expanded={isExpanded}
47
- aria-label={view.hasBody && !view.alwaysExpanded ? toolToggleLabel(view.header.title, view.subtitle, isExpanded) : undefined}
48
- className={`flex w-full flex-wrap items-center gap-x-2 gap-y-0.5 rounded-md px-1.5 py-1 text-left transition-colors ${
49
- view.hasBody && !view.alwaysExpanded ? 'cursor-pointer hover:bg-ink/[0.03]' : 'cursor-default'
50
- } focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
51
- >
52
- <span className={`shrink-0 ${STATUS_TONE_CLASS[status.tone]}`} aria-hidden="true">
53
- {status.glyph}
54
- </span>
55
- <span className="sr-only">{status.word}</span>
56
- <span className="shrink-0 text-ink/45" aria-hidden="true">
57
- {view.icon}
58
- </span>
59
- <span className="shrink-0 truncate text-[12px] font-semibold tracking-tight text-ink">
60
- {view.header.title}
61
- </span>
62
- {/* The subject and the facts share ONE clipping row, the way the card's
63
- meta line does. Without the clip a long `+43 −16` chip pair widened
64
- the section past the phone viewport: measured at 390, the section's
65
- scrollWidth ran to 439 against a 362 client width. */}
66
- <span className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
67
- <span className="min-w-0 flex-1 truncate font-mono text-[10.5px] text-ink/45">{view.subtitle}</span>
68
- {view.summary && view.summary.facts.length > 0 && (
69
- <span className="shrink-0">
70
- <ToolFactChips facts={view.summary.facts} max={2} />
71
- </span>
43
+ <div className="flex items-center gap-1">
44
+ <button
45
+ type="button"
46
+ onClick={handleToggle}
47
+ disabled={!view.hasBody || view.alwaysExpanded}
48
+ aria-expanded={isExpanded}
49
+ aria-label={view.hasBody && !view.alwaysExpanded ? toolToggleLabel(view.header.title, view.subtitle, isExpanded) : undefined}
50
+ className={`flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-0.5 rounded-md px-1.5 py-1 text-left transition-colors ${
51
+ view.hasBody && !view.alwaysExpanded ? 'cursor-pointer hover:bg-ink/[0.03]' : 'cursor-default'
52
+ } focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
53
+ >
54
+ <span className={`shrink-0 ${STATUS_TONE_CLASS[status.tone]}`} aria-hidden="true">
55
+ {status.glyph}
56
+ </span>
57
+ <span className="sr-only">{status.word}</span>
58
+ <span className="shrink-0 text-ink/45" aria-hidden="true">
59
+ {view.icon}
60
+ </span>
61
+ <span className="shrink-0 truncate text-[12px] font-semibold tracking-tight text-ink">
62
+ {view.header.title}
63
+ </span>
64
+ {/* The subject and the facts share ONE clipping row, the way the card's
65
+ meta line does. Without the clip a long `+43 −16` chip pair widened
66
+ the section past the phone viewport: measured at 390, the section's
67
+ scrollWidth ran to 439 against a 362 client width. */}
68
+ <span className="flex min-w-0 flex-1 items-center gap-2 overflow-hidden">
69
+ <span className="min-w-0 flex-1 truncate font-mono text-[10.5px] text-ink/45">{view.subtitle}</span>
70
+ {view.summary && view.summary.facts.length > 0 && (
71
+ <span className="shrink-0">
72
+ <ToolFactChips facts={view.summary.facts} max={2} />
73
+ </span>
74
+ )}
75
+ </span>
76
+ {view.hasBody && !view.alwaysExpanded && (
77
+ <ChevronDown
78
+ size={13}
79
+ className={`shrink-0 text-ink/30 transition-transform duration-200 ${isExpanded ? 'rotate-180' : ''}`}
80
+ />
72
81
  )}
73
- </span>
74
- {view.hasBody && !view.alwaysExpanded && (
75
- <ChevronDown
76
- size={13}
77
- className={`shrink-0 text-ink/30 transition-transform duration-200 ${isExpanded ? 'rotate-180' : ''}`}
78
- />
79
- )}
80
- </button>
82
+ </button>
83
+ <ToolRowActions tool={tool} isReminder={view.isReminder} />
84
+ </div>
81
85
 
82
86
  {isExpanded && view.hasBody && (
83
87
  <div className="ml-5 mt-0.5 overflow-hidden border-l border-dashed border-ink/15 py-2 pl-3 space-y-3 code-surface">
@@ -17,6 +17,7 @@
17
17
  import { useCallback, useState } from 'preact/hooks';
18
18
  import { memo } from 'preact/compat';
19
19
  import { ToolBody } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolBody';
20
+ import { ToolRowActions } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions';
20
21
  import { toolStatusGlyph, STATUS_TONE_CLASS } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/status-glyph';
21
22
  import { useToolView } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view';
22
23
  import { toolToggleLabel } from '@/client/components/workspace/chat-timeline/tool-renderers/shared/toggle-label';
@@ -40,27 +41,30 @@ export const MinimalRow = memo(function MinimalRow({ tool, isOpen, onToggle, def
40
41
 
41
42
  return (
42
43
  <div className="px-1" data-tool-row="minimal">
43
- <button
44
- type="button"
45
- onClick={handleToggle}
46
- disabled={!view.hasBody || view.alwaysExpanded}
47
- aria-expanded={isExpanded}
48
- aria-label={view.hasBody && !view.alwaysExpanded ? toolToggleLabel(view.header.title, view.subtitle, isExpanded) : undefined}
49
- className={`flex w-full items-baseline gap-1.5 rounded py-0.5 text-left text-[11.5px] transition-colors ${
50
- view.hasBody && !view.alwaysExpanded ? 'cursor-pointer hover:bg-ink/[0.03]' : 'cursor-default'
51
- } focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
52
- >
53
- <span className={`shrink-0 self-center ${toneClass}`} aria-hidden="true">
54
- {status.glyph}
55
- </span>
56
- <span className="sr-only">{status.word}</span>
57
- <span className="shrink-0 font-medium text-ink/70">{view.header.title}</span>
58
- {(view.subtitle || factsLine) && <span className="text-ink/25">·</span>}
59
- <span className="min-w-0 truncate font-mono text-ink/45">
60
- {view.subtitle}
61
- {factsLine}
62
- </span>
63
- </button>
44
+ <div className="flex items-center gap-1">
45
+ <button
46
+ type="button"
47
+ onClick={handleToggle}
48
+ disabled={!view.hasBody || view.alwaysExpanded}
49
+ aria-expanded={isExpanded}
50
+ aria-label={view.hasBody && !view.alwaysExpanded ? toolToggleLabel(view.header.title, view.subtitle, isExpanded) : undefined}
51
+ className={`flex min-w-0 flex-1 items-baseline gap-1.5 rounded py-0.5 text-left text-[11.5px] transition-colors ${
52
+ view.hasBody && !view.alwaysExpanded ? 'cursor-pointer hover:bg-ink/[0.03]' : 'cursor-default'
53
+ } focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
54
+ >
55
+ <span className={`shrink-0 self-center ${toneClass}`} aria-hidden="true">
56
+ {status.glyph}
57
+ </span>
58
+ <span className="sr-only">{status.word}</span>
59
+ <span className="shrink-0 font-medium text-ink/70">{view.header.title}</span>
60
+ {(view.subtitle || factsLine) && <span className="text-ink/25">·</span>}
61
+ <span className="min-w-0 truncate font-mono text-ink/45">
62
+ {view.subtitle}
63
+ {factsLine}
64
+ </span>
65
+ </button>
66
+ <ToolRowActions tool={tool} isReminder={view.isReminder} />
67
+ </div>
64
68
 
65
69
  {isExpanded && view.hasBody && (
66
70
  <div className="my-1.5 overflow-hidden rounded-md border border-dashed border-ink/15 px-3 py-2.5 space-y-3 code-surface">