@kabmo-labs/kabmo 0.58.0 → 0.58.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (216) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +457 -444
  3. package/dist/client/static/js/{Body-karkrzkc.js → Body-ysmhxbvk.js} +3 -3
  4. package/dist/client/static/js/{CsvGrid-j03knmbe.js → CsvGrid-w90pxyn2.js} +1 -1
  5. package/dist/client/static/js/{DocxView-e8408vzs.js → DocxView-evxn6kaq.js} +1 -1
  6. package/dist/client/static/js/{DrawioView-fj4mfzch.js → DrawioView-tmdevwf4.js} +1 -1
  7. package/dist/client/static/js/{HtmlPreview-9g8xwzgw.js → HtmlPreview-bpsn2z9p.js} +1 -1
  8. package/dist/client/static/js/{ImageView-sz4fzz9k.js → ImageView-ssazqckj.js} +1 -1
  9. package/dist/client/static/js/{LayoutWrapper-q6q4h04a.js → LayoutWrapper-qwpfq4dq.js} +2 -2
  10. package/dist/client/static/js/MergeDiffView-en6aazw8.js +1 -0
  11. package/dist/client/static/js/{Modal-ahecatp5.js → Modal-zjnhj9nb.js} +19 -19
  12. package/dist/client/static/js/{PdfView-8jtdx5hd.js → PdfView-txxn6qff.js} +1 -1
  13. package/dist/client/static/js/{SessionsView-jwp8xvw5.js → SessionsView-eryjtmb2.js} +1 -1
  14. package/dist/client/static/js/{SheetView-hwx8s864.js → SheetView-52b33e6f.js} +1 -1
  15. package/dist/client/static/js/{SvgPreview-ete36nzv.js → SvgPreview-hrk4pfm1.js} +1 -1
  16. package/dist/client/static/js/{abnfDiagram-O67JEVCF-7nsqzz6z.js → abnfDiagram-O67JEVCF-at77sybc.js} +1 -1
  17. package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +1 -0
  18. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xvpkfq2f.js → architectureDiagram-NJMV4G6O-raw33jgg.js} +3 -3
  19. package/dist/client/static/js/{astro-rsrqgjjx.js → astro-qha7sceh.js} +1 -1
  20. package/dist/client/static/js/{blockDiagram-BEXU5L5S-0saahcs6.js → blockDiagram-BEXU5L5S-b6e90fbk.js} +6 -6
  21. package/dist/client/static/js/{c4Diagram-YGBWAQC7-ktpqnb4a.js → c4Diagram-YGBWAQC7-msg9y1c6.js} +2 -2
  22. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-x67cz3ms.js → classDiagram-v2-NBCMYWYE-jmrd1h8r.js} +5 -5
  23. package/dist/client/static/js/{cose-bilkent-JH36ORCC-9wzmhkz8.js → cose-bilkent-JH36ORCC-na65ebq3.js} +1 -1
  24. package/dist/client/static/js/css-q2k6afe3.js +1 -0
  25. package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +1 -0
  26. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dmmgmv99.js → cynefinDiagram-VND7K2PF-9xkkw71m.js} +1 -1
  27. package/dist/client/static/js/{dagre-6A5THRUB-ygkkms1t.js → dagre-6A5THRUB-p59f19tv.js} +2 -2
  28. package/dist/client/static/js/{diagram-22UHCM2B-qxj0pqb4.js → diagram-22UHCM2B-2e2rcvn7.js} +8 -8
  29. package/dist/client/static/js/{diagram-3UASUU5V-77k8w5dt.js → diagram-3UASUU5V-r9ds8vgr.js} +2 -2
  30. package/dist/client/static/js/{diagram-ATOU4E4O-m0h86vf4.js → diagram-ATOU4E4O-jgwxv7v8.js} +3 -3
  31. package/dist/client/static/js/{diagram-CDSNMT55-5v28kaeg.js → diagram-CDSNMT55-20m35eqq.js} +4 -4
  32. package/dist/client/static/js/{diagram-MLGK6HIB-zgcg9gaz.js → diagram-MLGK6HIB-vt3kxt2m.js} +1 -1
  33. package/dist/client/static/js/{diagram-MPIPVDR6-10c9s6e6.js → diagram-MPIPVDR6-c47rgxf1.js} +1 -1
  34. package/dist/client/static/js/{dockerfile-dr9sdsqp.js → dockerfile-gtcyey0q.js} +1 -1
  35. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mz4022dz.js → ebnfDiagram-ZINNZB2B-aszw3xy3.js} +1 -1
  36. package/dist/client/static/js/{elixir-3dy25ex8.js → elixir-w92v180e.js} +1 -1
  37. package/dist/client/static/js/{elk-276RUBZZ-ccerbsag.js → elk-276RUBZZ-gbvr3gry.js} +1 -1
  38. package/dist/client/static/js/{erDiagram-OPXOYQCR-a8vjyrrw.js → erDiagram-OPXOYQCR-1hqca8qe.js} +2 -2
  39. package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +1 -0
  40. package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +1 -0
  41. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-sz1g29fp.js → ganttDiagram-FUAMR5RP-07v22te5.js} +2 -2
  42. package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +1 -0
  43. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-efqk42q0.js → gitGraphDiagram-X574FWY7-y068jtz9.js} +8 -8
  44. package/dist/client/static/js/graphql-qx4tt6ze.js +1 -0
  45. package/dist/client/static/js/html-5e0g8664.js +1 -0
  46. package/dist/client/static/js/{index-gw4c5n3a.js → index-007sewcn.js} +1 -1
  47. package/dist/client/static/js/{index-qbqm3c91.js → index-1e0rt7c6.js} +2 -2
  48. package/dist/client/static/js/{index-6qqsy78z.js → index-1e710snk.js} +1 -1
  49. package/dist/client/static/js/{index-kc5yt2cd.js → index-2s17netq.js} +2 -2
  50. package/dist/client/static/js/{index-7s4dge1z.js → index-374xq5a4.js} +1 -1
  51. package/dist/client/static/js/index-4ddgpqm0.css +1 -0
  52. package/dist/client/static/js/{index-6h46r2de.js → index-5g2j626a.js} +1 -1
  53. package/dist/client/static/js/{index-5tp3emtg.js → index-5hvt233n.js} +1 -1
  54. package/dist/client/static/js/{index-ssepzdaz.js → index-5xxbbzqa.js} +5 -5
  55. package/dist/client/static/js/{index-jnxmvxb8.js → index-7sq6cjt1.js} +11 -11
  56. package/dist/client/static/js/{index-q0k1am0g.js → index-80kx6dm6.js} +2 -2
  57. package/dist/client/static/js/{index-2f6psebk.js → index-8d8ce00v.js} +1 -1
  58. package/dist/client/static/js/{index-gqsnyh8k.js → index-94d416ee.js} +1 -1
  59. package/dist/client/static/js/{index-2a0b9ya2.js → index-an7fq7f6.js} +1 -1
  60. package/dist/client/static/js/{index-6ey6y9em.js → index-azz46nwc.js} +2 -2
  61. package/dist/client/static/js/{index-bkwax812.js → index-c9aqx3ht.js} +1 -1
  62. package/dist/client/static/js/{index-rr79n77k.js → index-cc7qbfvn.js} +155 -148
  63. package/dist/client/static/js/{index-wnk9k57k.js → index-cmjyet7w.js} +50 -50
  64. package/dist/client/static/js/{index-f31c6jg8.js → index-cpp43af3.js} +8 -8
  65. package/dist/client/static/js/{index-dz18nn65.js → index-dxq1tbwm.js} +1 -1
  66. package/dist/client/static/js/{index-8aqjj2x2.js → index-e0kahttb.js} +1 -1
  67. package/dist/client/static/js/{index-ts8rhd06.js → index-e4nge3f4.js} +1 -1
  68. package/dist/client/static/js/{index-k4qshngy.js → index-f27wvdky.js} +3 -3
  69. package/dist/client/static/js/{index-7ma44af3.js → index-f61c25vn.js} +1 -1
  70. package/dist/client/static/js/{index-nzq51nbb.js → index-fe92hqmb.js} +5 -5
  71. package/dist/client/static/js/{index-k56patms.js → index-fv7nybnf.js} +2 -2
  72. package/dist/client/static/js/{index-xfyxmaj1.js → index-gqrt766t.js} +44 -44
  73. package/dist/client/static/js/{index-mkp3gwag.js → index-hb7a7m9m.js} +1 -1
  74. package/dist/client/static/js/{index-qkcmspxq.js → index-j830qk07.js} +1 -1
  75. package/dist/client/static/js/{index-6ac860yz.js → index-kzzvrqnv.js} +1 -1
  76. package/dist/client/static/js/{index-x7h04xzf.js → index-m5n0zsft.js} +1 -1
  77. package/dist/client/static/js/{index-q5q8a3qn.js → index-medk4f18.js} +1 -1
  78. package/dist/client/static/js/{index-tnxp90ac.js → index-nptbz7sv.js} +1 -1
  79. package/dist/client/static/js/{index-r1wrke3j.js → index-qefssj0m.js} +1 -1
  80. package/dist/client/static/js/{index-mpyd7qxj.js → index-r8d4bk86.js} +2 -2
  81. package/dist/client/static/js/{index-vf01q99d.js → index-rqt8mem9.js} +2 -2
  82. package/dist/client/static/js/{index-zh550byg.js → index-s4dpkds5.js} +1 -1
  83. package/dist/client/static/js/index-s9k82stc.js +2 -0
  84. package/dist/client/static/js/{index-xygk0v3e.js → index-skwem10a.js} +2 -2
  85. package/dist/client/static/js/{index-k1576e2m.js → index-tv9rn2nd.js} +1 -1
  86. package/dist/client/static/js/{index-dqf0srrp.js → index-vny4ymjf.js} +2 -2
  87. package/dist/client/static/js/{index-w5j1wgcz.js → index-vw8b29ek.js} +1 -1
  88. package/dist/client/static/js/{index-e42ys2q3.js → index-wn28m9h7.js} +7 -7
  89. package/dist/client/static/js/{index-tc07gd33.js → index-wxqcnsrq.js} +2 -2
  90. package/dist/client/static/js/{index-j863hg0d.js → index-xmg1x6zv.js} +6 -6
  91. package/dist/client/static/js/{index-t71k3b28.js → index-zhgh7a31.js} +1 -1
  92. package/dist/client/static/js/{index-vb5a3g01.js → index-zs7kw0be.js} +3 -3
  93. package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +1 -0
  94. package/dist/client/static/js/{infoDiagram-VRGFBTTK-rykcacj5.js → infoDiagram-VRGFBTTK-1x83h4k4.js} +2 -2
  95. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rj752kd8.js → ishikawaDiagram-OU5B5YK6-et6z3c28.js} +2 -2
  96. package/dist/client/static/js/javascript-av46zx4c.js +1 -0
  97. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mtetwn6f.js → journeyDiagram-ZHPQQLJL-sw669e7a.js} +3 -3
  98. package/dist/client/static/js/{julia-mxe3pnz3.js → julia-z14p8jsx.js} +1 -1
  99. package/dist/client/static/js/{kanban-definition-PNTS6WVX-4h5pw5mm.js → kanban-definition-PNTS6WVX-aqxg95kx.js} +7 -7
  100. package/dist/client/static/js/{mermaid.core-bs542jma.js → mermaid.core-6cgqsgcf.js} +3 -3
  101. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-67s4xy7h.js → mindmap-definition-NLK3R4M7-530anpc4.js} +4 -4
  102. package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +1 -0
  103. package/dist/client/static/js/one-light-2n5y8592.js +1 -0
  104. package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +1 -0
  105. package/dist/client/static/js/{pegDiagram-GJSIUBJH-qykb6ssk.js → pegDiagram-GJSIUBJH-5zar6hvy.js} +1 -1
  106. package/dist/client/static/js/{perl-a8eeaqkn.js → perl-1na2x6yd.js} +1 -1
  107. package/dist/client/static/js/{php-6gq92zt8.js → php-x75tt7w3.js} +1 -1
  108. package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +1 -0
  109. package/dist/client/static/js/{pieDiagram-5QR66LMP-mymrrvck.js → pieDiagram-5QR66LMP-3bx8syvw.js} +2 -2
  110. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-6f8ahd40.js → quadrantDiagram-O4NWA36T-yaarpr2e.js} +2 -2
  111. package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +1 -0
  112. package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +1 -0
  113. package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +1 -0
  114. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +1 -0
  115. package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +1 -0
  116. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-c3habpvw.js → railroadDiagram-XR7U4H2S-ag41q4nt.js} +1 -1
  117. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-nysqy6te.js → requirementDiagram-PLB6GJNP-g8sr48h4.js} +4 -4
  118. package/dist/client/static/js/{ruby-mc826p2e.js → ruby-3h22qahv.js} +1 -1
  119. package/dist/client/static/js/{rust-m4f4vpvn.js → rust-r27demr5.js} +1 -1
  120. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s5dtfp3z.js → sankeyDiagram-IPEJSGJF-t1wbd1hh.js} +1 -1
  121. package/dist/client/static/js/{scss-9wz47c6t.js → scss-c04ezwnn.js} +1 -1
  122. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bb3yp049.js → sequenceDiagram-PO4LG4MO-407mjqty.js} +5 -5
  123. package/dist/client/static/js/{sizeCapture-INFHLROL-0m2msee7.js → sizeCapture-INFHLROL-w38zb9ky.js} +1 -1
  124. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-cd0qgj6t.js → stateDiagram-v2-GCMORJYK-4cvgymkc.js} +3 -3
  125. package/dist/client/static/js/{svelte-5vrwkc13.js → svelte-egg3x4tw.js} +1 -1
  126. package/dist/client/static/js/{swimlanes-2SLR337P-rpb01f7p.js → swimlanes-2SLR337P-w7ts2rzw.js} +1 -1
  127. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-zx36y2c8.js → swimlanesDiagram-TC7HE7FX-v82nym6b.js} +1 -1
  128. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tqw2e6y1.js → timeline-definition-EJHVYXUP-nq46nzy9.js} +4 -4
  129. package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +1 -0
  130. package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +1 -0
  131. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dhf4d5xg.js → usecaseDiagram-POWQR4AR-q144snzb.js} +22 -22
  132. package/dist/client/static/js/{vennDiagram-UO4OBE2U-ztkk79dv.js → vennDiagram-UO4OBE2U-2wemak2p.js} +5 -5
  133. package/dist/client/static/js/{vue-gmjnxjm3.js → vue-d7p4wv35.js} +1 -1
  134. package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +1 -0
  135. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-ahre5tmv.js → wardleyDiagram-VNRHLVJA-bb2qvvgr.js} +2 -2
  136. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-vak2c50n.js → xychartDiagram-PMCCYNJV-9dr05fdq.js} +4 -4
  137. package/package.json +4 -4
  138. package/src/client/components/common/anchored-menu/index.tsx +11 -4
  139. package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
  140. package/src/client/components/common/session-row/index.tsx +32 -16
  141. package/src/client/components/common/session-row/session-row.test.tsx +56 -18
  142. package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +24 -3
  143. package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +20 -0
  144. package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
  145. package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
  146. package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
  147. package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +7 -3
  148. package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +12 -4
  149. package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
  150. package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
  151. package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
  152. package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +16 -0
  153. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +66 -10
  154. package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +103 -41
  155. package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +3 -1
  156. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +2 -2
  157. package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +54 -35
  158. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +110 -0
  159. package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +51 -32
  160. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +62 -0
  161. package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +15 -3
  162. package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
  163. package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
  164. package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
  165. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
  166. package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
  167. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
  168. package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
  169. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
  170. package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +36 -15
  171. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -3
  172. package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +10 -2
  173. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
  174. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
  175. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
  176. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
  177. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +5 -3
  178. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +19 -12
  179. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
  180. package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
  181. package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
  182. package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
  183. package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
  184. package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
  185. package/src/client/hooks/chat/timeline/index.ts +4 -5
  186. package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
  187. package/src/client/hooks/chat/timeline/modes.ts +10 -2
  188. package/src/server/lib/realtime/topics/session-data.server.ts +6 -5
  189. package/src/server/lib/realtime/topics/session-data.test.ts +35 -0
  190. package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
  191. package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
  192. package/dist/client/static/js/MergeDiffView-b8f013ws.js +0 -1
  193. package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +0 -1
  194. package/dist/client/static/js/css-9gak6bze.js +0 -1
  195. package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +0 -1
  196. package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +0 -1
  197. package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +0 -1
  198. package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +0 -1
  199. package/dist/client/static/js/graphql-2ntm7jyh.js +0 -1
  200. package/dist/client/static/js/html-mt2yb43b.js +0 -1
  201. package/dist/client/static/js/index-f44k9k8d.css +0 -1
  202. package/dist/client/static/js/index-ver116ed.js +0 -2
  203. package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +0 -1
  204. package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
  205. package/dist/client/static/js/one-dark-pro-541ed4b7.js +0 -1
  206. package/dist/client/static/js/one-light-nr79mykt.js +0 -1
  207. package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +0 -1
  208. package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +0 -1
  209. package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +0 -1
  210. package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +0 -1
  211. package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +0 -1
  212. package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +0 -1
  213. package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +0 -1
  214. package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +0 -1
  215. package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +0 -1
  216. package/dist/client/static/js/wardley-WFR3VGLG-vy6rp5gp.js +0 -1
@@ -4,115 +4,59 @@
4
4
  */
5
5
 
6
6
  /**
7
- * The card a Kabmo-injected prompt wears in the timeline.
7
+ * The card a Kabmo-injected orchestrator prompt wears in the timeline.
8
8
  *
9
- * A delegating message, a worker brief and a child outcome all reach omp as
10
- * `role: "user"` turns, because that is the only channel Kabmo can inject
11
- * through. Drawn as bubbles they are indistinguishable from something the
12
- * operator typed: a 1 KB orchestration contract with shell heredocs, a worker
13
- * preamble quoting its own session id, a report from a session nobody is
14
- * looking at. All three belong to Kabmo, not to the person reading the
15
- * transcript, so they get a card with a label and a collapse control instead.
9
+ * A delegating message and a worker brief reach omp as `role: "user"` turns,
10
+ * because that is the only channel Kabmo can inject through. Drawn as bubbles
11
+ * they are indistinguishable from something the operator typed: a 1 KB
12
+ * orchestration contract with shell heredocs, a worker preamble quoting its own
13
+ * session id. Both belong to Kabmo, so they get a labelled card instead.
16
14
  *
17
- * The OPERATOR'S OWN WORDS still render as their bubble (`MessageItem` splits
18
- * the envelope's trailing text out); this card only ever holds the injected
19
- * half. That split is the whole reason the envelope wraps the injection rather
20
- * than replacing the message: a delegating prompt is contract + the sentence
21
- * they actually wrote, and dropping the sentence would rewrite their turn.
15
+ * The CONTRACT is header-only: the operator sees which turn delegated and how
16
+ * many workers, never the heredoc or its spawn commands. A worker brief keeps
17
+ * its collapse control. A child outcome is not drawn here at all — `UserTurn`
18
+ * hands it to `SystemNotice` as Markdown (`childOutcomeMarkdown`).
19
+ *
20
+ * The OPERATOR'S OWN WORDS still render as their bubble (`UserTurn` splits the
21
+ * envelope's trailing text out); this card only ever holds the injected half.
22
22
  */
23
23
 
24
24
  import { useMemo, useState } from 'preact/hooks';
25
- import { AlertCircle, ArrowRightLeft, CheckCircle2, ChevronDown, Info, Workflow, XCircle } from 'lucide-preact';
25
+ import { ArrowRightLeft, ChevronDown, Workflow } from 'lucide-preact';
26
26
  import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
27
27
  import { transcriptGutter } from '@/shared/lib/chat/timeline/gutter';
28
28
  import { blockChrome } from '@/shared/lib/chat/timeline/block-chrome';
29
29
  import { useToolRenderMode } from '@/client/hooks/chat/timeline/tool-render-mode';
30
- import {
31
- parseChildOutcomeNotice,
32
- type ChildOutcomeEntry,
33
- type OrchestrationBlock,
34
- } from '@kabmo-labs/kabmo-app-contracts/notice';
30
+ import type { OrchestrationBlock } from '@kabmo-labs/kabmo-app-contracts/notice';
31
+
32
+ /** The two injected prompts this card still draws. */
33
+ export type TimelineNoticeBlock = Omit<OrchestrationBlock, 'kind'> & { kind: 'contract' | 'worker' };
34
+
35
+ /** Narrow an envelope for the card; an outcome belongs to `SystemNotice`. */
36
+ export function isTimelineNoticeBlock(block: OrchestrationBlock): block is TimelineNoticeBlock {
37
+ return block.kind !== 'outcome';
38
+ }
35
39
 
36
- const KIND_LABEL: Record<OrchestrationBlock['kind'], string> = {
40
+ const KIND_LABEL: Record<TimelineNoticeBlock['kind'], string> = {
37
41
  contract: 'Orchestration',
38
42
  worker: 'Dispatched worker',
39
- outcome: 'Worker outcome',
40
43
  };
41
44
 
42
- const KIND_ICON: Record<OrchestrationBlock['kind'], typeof Workflow> = {
45
+ const KIND_ICON: Record<TimelineNoticeBlock['kind'], typeof Workflow> = {
43
46
  contract: Workflow,
44
47
  worker: ArrowRightLeft,
45
- outcome: Info,
46
48
  };
47
49
 
48
- const STATUS_STYLE: Record<ChildOutcomeEntry['status'], { label: string; icon: typeof CheckCircle2; badge: string }> = {
49
- completed: { label: 'Completed', icon: CheckCircle2, badge: 'bg-success/10 text-success-text' },
50
- failed: { label: 'Failed', icon: XCircle, badge: 'bg-error/10 text-error-text' },
51
- interrupted: { label: 'Interrupted', icon: AlertCircle, badge: 'bg-warning/10 text-warning-text' },
52
- };
53
-
54
- /** How many workers a contract names — the count is the card's one-line
55
- * summary, and the spawn command is what a contract is made of. */
56
- function workerCount(body: string): number {
57
- return body.match(/--harness\s+\S+/g)?.length ?? 0;
58
- }
59
-
60
- /** The collapsed subtitle for one kind. Deliberately short: the whole body is
61
- * one click away, and a truncated heredoc tells the reader nothing. */
62
- function subtitleOf(block: OrchestrationBlock): string {
63
- if (block.kind === 'contract') {
64
- const count = workerCount(block.body);
65
- return count === 1 ? '1 worker' : `${count} workers`;
66
- }
67
- if (block.kind === 'worker') {
68
- const task = block.body.split(/\r?\nTASK\r?\n/)[1]?.trim() ?? '';
69
- const first = task.split(/\r?\n/).map((line) => line.trim()).find(Boolean);
70
- return first ?? 'No task text';
71
- }
72
- const entries = parseChildOutcomeNotice(block.body);
73
- if (entries.length === 0) return 'No outcome recorded';
74
- if (entries.length === 1) {
75
- const entry = entries[0] as ChildOutcomeEntry;
76
- const name = entry.title || entry.sessionId;
77
- // The reason rides the collapsed line: a card that only says "failed" makes
78
- // the reader open it to learn whether it matters.
79
- return entry.status === 'completed' ? name : `${name} — ${entry.failure ?? entry.status}`;
80
- }
81
- return `${entries.length} workers`;
82
- }
83
-
84
- function OutcomeEntry({ entry, showStatus }: { entry: ChildOutcomeEntry; showStatus: boolean }) {
85
- const style = STATUS_STYLE[entry.status];
86
- const Icon = style.icon;
87
- return (
88
- <div className="space-y-1.5 rounded-lg border border-ink/8 bg-paper p-2.5">
89
- <div className="flex flex-wrap items-center gap-2">
90
- {/* A single worker's verdict is already on the card's header; repeating
91
- it here reads as two different results. */}
92
- {showStatus && (
93
- <span className={`flex items-center gap-1 rounded px-1.5 py-0.5 font-mono text-[10px] font-semibold uppercase ${style.badge}`}>
94
- <Icon size={10} />
95
- {style.label}
96
- </span>
97
- )}
98
- {entry.title && <span className="truncate text-[12px] font-medium text-ink">{entry.title}</span>}
99
- <span className="truncate font-mono text-[10px] text-ink/45">{entry.sessionId}</span>
100
- </div>
101
- {entry.status === 'completed' ? (
102
- <div className="text-[11.5px] leading-relaxed text-ink/85">
103
- <MarkdownRenderer content={entry.output?.trim() || 'No final output was recorded.'} />
104
- </div>
105
- ) : (
106
- <p className="font-mono text-[11px] leading-relaxed break-words whitespace-pre-wrap text-ink/80">
107
- {entry.failure?.trim() || 'The worker gave no reason.'}
108
- </p>
109
- )}
110
- </div>
111
- );
50
+ /** The first line of the TASK section: a brief's whole point is what it says
51
+ * there, not the shell preamble above it. */
52
+ function workerSubtitle(body: string): string {
53
+ const task = body.split(/\r?\nTASK\r?\n/)[1]?.trim() ?? '';
54
+ const first = task.split(/\r?\n/).map((line) => line.trim()).find(Boolean);
55
+ return first ?? 'No task text';
112
56
  }
113
57
 
114
58
  export interface OrchestrationNoticeProps {
115
- block: OrchestrationBlock;
59
+ block: TimelineNoticeBlock;
116
60
  /** Phone layout: the card's frame is the timeline gutter itself. */
117
61
  isMobile?: boolean;
118
62
  }
@@ -121,27 +65,37 @@ export function OrchestrationNotice({ block, isMobile = false }: OrchestrationNo
121
65
  const mode = useToolRenderMode();
122
66
  const chrome = blockChrome(mode);
123
67
  const [open, setOpen] = useState(false);
68
+ const contract = block.kind === 'contract';
124
69
  const Icon = KIND_ICON[block.kind];
125
- const entries = useMemo(
126
- () => (block.kind === 'outcome' ? parseChildOutcomeNotice(block.body) : []),
127
- [block],
70
+ const subtitle = useMemo(() => {
71
+ if (!contract) return workerSubtitle(block.body);
72
+ const count = block.body.match(/--harness\s+\S+/g)?.length ?? 0;
73
+ return count === 1 ? '1 worker' : `${count} workers`;
74
+ }, [block, contract]);
75
+ const showSubtitle = contract || !open;
76
+
77
+ const headerInner = (
78
+ <>
79
+ <span className={`${chrome.icon} bg-ink/8 text-ink/70`}>
80
+ <Icon size={13} />
81
+ </span>
82
+ <span className="flex min-w-0 flex-1 flex-col">
83
+ <span className="flex flex-wrap items-center gap-2">
84
+ <span className="truncate text-[12px] font-semibold tracking-tight text-ink">
85
+ {KIND_LABEL[block.kind]}
86
+ </span>
87
+ <span className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
88
+ Kabmo
89
+ </span>
90
+ </span>
91
+ {showSubtitle && subtitle && (
92
+ <span className="truncate font-mono text-[10.5px] text-ink/45" title={subtitle}>
93
+ {subtitle}
94
+ </span>
95
+ )}
96
+ </span>
97
+ </>
128
98
  );
129
- const subtitle = useMemo(() => subtitleOf(block), [block]);
130
- const failed = entries.some((entry) => entry.status !== 'completed');
131
- const badgeClass =
132
- block.kind === 'outcome'
133
- ? failed
134
- ? 'bg-error/10 text-error-text'
135
- : 'bg-success/10 text-success-text'
136
- : 'bg-ink/8 text-ink/70';
137
- // The aggregate verdict is on the HEADER, not only inside the body: a
138
- // collapsed card is the normal state, and "did my worker fail" must be
139
- // answerable without opening it.
140
- const aggregate = block.kind === 'outcome' && entries.length > 0
141
- ? failed
142
- ? STATUS_STYLE.failed
143
- : STATUS_STYLE.completed
144
- : null;
145
99
 
146
100
  return (
147
101
  <div className={`${transcriptGutter(isMobile)} text-[12px] text-ink select-text ${chrome.root}`}>
@@ -149,63 +103,28 @@ export function OrchestrationNotice({ block, isMobile = false }: OrchestrationNo
149
103
  its node, exactly as the notice card does. */}
150
104
  {mode === 'trace' && <span aria-hidden="true" className={chrome.node} />}
151
105
  <div className={chrome.frame || undefined}>
152
- <button
153
- type="button"
154
- onClick={() => setOpen((prev) => !prev)}
155
- aria-expanded={open}
156
- className={`${chrome.header} cursor-pointer hover:bg-ink/[0.03] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
157
- >
158
- <span className={`${chrome.icon} ${badgeClass}`}>
159
- <Icon size={13} />
160
- </span>
161
- <span className="flex min-w-0 flex-1 flex-col">
162
- <span className="flex flex-wrap items-center gap-2">
163
- <span className="truncate text-[12px] font-semibold tracking-tight text-ink">
164
- {KIND_LABEL[block.kind]}
165
- </span>
166
- <span className="rounded bg-ink/5 px-1.5 py-0.2 font-mono text-[10px] text-ink/60">
167
- Kabmo
168
- </span>
169
- {aggregate && (
170
- <span className={`flex items-center gap-1 rounded px-1.5 py-0.2 font-mono text-[10px] font-semibold uppercase ${aggregate.badge}`}>
171
- <aggregate.icon size={10} />
172
- {aggregate.label}
173
- </span>
174
- )}
175
- </span>
176
- {!open && subtitle && (
177
- <span className="truncate font-mono text-[10.5px] text-ink/45" title={subtitle}>
178
- {subtitle}
179
- </span>
180
- )}
181
- </span>
182
- <ChevronDown
183
- size={14}
184
- className={`shrink-0 text-ink/35 transition-transform duration-200 ${open ? 'rotate-180' : ''}`}
185
- />
186
- </button>
106
+ {contract ? (
107
+ <div className={chrome.header}>{headerInner}</div>
108
+ ) : (
109
+ <button
110
+ type="button"
111
+ onClick={() => setOpen((prev) => !prev)}
112
+ aria-expanded={open}
113
+ className={`${chrome.header} cursor-pointer hover:bg-ink/[0.03] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ink/20`}
114
+ >
115
+ {headerInner}
116
+ <ChevronDown
117
+ size={14}
118
+ className={`shrink-0 text-ink/35 transition-transform duration-200 ${open ? 'rotate-180' : ''}`}
119
+ />
120
+ </button>
121
+ )}
187
122
 
188
- {open && (
123
+ {!contract && open && (
189
124
  <div className={chrome.body}>
190
- {block.kind === 'outcome' ? (
191
- <div className="space-y-2">
192
- {entries.length === 0 ? (
193
- <p className="font-mono text-[11px] text-ink/60">No outcome recorded.</p>
194
- ) : (
195
- entries.map((entry) => (
196
- <OutcomeEntry
197
- key={entry.sessionId}
198
- entry={entry}
199
- showStatus={entries.length > 1}
200
- />
201
- ))
202
- )}
203
- </div>
204
- ) : (
205
- <div className="rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px] leading-relaxed text-ink/85">
206
- <MarkdownRenderer content={block.body} />
207
- </div>
208
- )}
125
+ <div className="rounded-lg border border-ink/8 bg-paper p-3 text-[11.5px] leading-relaxed text-ink/85">
126
+ <MarkdownRenderer content={block.body} />
127
+ </div>
209
128
  </div>
210
129
  )}
211
130
  </div>
@@ -47,12 +47,16 @@ interface SystemNoticeProps {
47
47
  source?: string;
48
48
  /** Phone layout: the card's frame is the timeline gutter itself. */
49
49
  isMobile?: boolean;
50
+ /** The body is Markdown even when its prose looks like code. A generated
51
+ * report may quote `return x` or a snippet mid-sentence; the generic
52
+ * code-sniffing branch would then print the whole report as a JS dump. */
53
+ markdown?: boolean;
50
54
  }
51
55
 
52
56
  /** System notice card — handles generic notices, structured <task-result> agent
53
57
  * jobs, and <system-reminder> blocks, all collapsed by default; a goal-mode
54
58
  * injection renders open and has no collapse control (see `forcedOpen`). */
55
- export function SystemNotice({ notice, source, isMobile = false }: SystemNoticeProps) {
59
+ export function SystemNotice({ notice, source, isMobile = false, markdown = false }: SystemNoticeProps) {
56
60
  const mode = useToolRenderMode();
57
61
  const chrome = blockChrome(mode);
58
62
  const [userOpen, setUserOpen] = useState(false);
@@ -112,14 +116,14 @@ export function SystemNotice({ notice, source, isMobile = false }: SystemNoticeP
112
116
  const firstLine = (lines.find((l) => l.trim()) ?? '').trim();
113
117
  const restStart = lines.findIndex((l) => l.trim() === firstLine);
114
118
  const rest = lines.slice(restStart + 1).join('\n').trim();
115
- const isCode = isCodeLike(rest);
119
+ const isCode = markdown ? false : isCodeLike(rest);
116
120
  return {
117
121
  clean,
118
122
  firstLine,
119
123
  rest,
120
124
  isCode,
121
125
  };
122
- }, [notice]);
126
+ }, [notice, markdown]);
123
127
 
124
128
  // Deferred and gated: the code branch only renders while the card is open, so
125
129
  // a collapsed notice computes nothing and an opened one paints its text first.
@@ -135,10 +135,18 @@ export function ThinkingSection({
135
135
  {duration}
136
136
  </span>
137
137
  )}
138
- <ChevronDown
139
- size={14}
140
- className={`shrink-0 text-ink/35 transition-transform duration-200 ${isOpen ? 'rotate-180' : ''}`}
141
- />
138
+ {/* `tui` draws the terminal's own navigator glyph, the same
139
+ `▸`/`▾` the tool rows use, instead of the card's chevron. */}
140
+ {mode === 'tui' ? (
141
+ <span className="shrink-0 pl-1 text-[12px] text-ink/40" aria-hidden="true">
142
+ {isOpen ? '▾' : '▸'}
143
+ </span>
144
+ ) : (
145
+ <ChevronDown
146
+ size={14}
147
+ className={`shrink-0 text-ink/35 transition-transform duration-200 ${isOpen ? 'rotate-180' : ''}`}
148
+ />
149
+ )}
142
150
  </button>
143
151
 
144
152
  {isOpen && (
@@ -141,6 +141,7 @@ export function ToolCallingSection({ tools, defaultExpanded = false, isMobile =
141
141
  tool={tool}
142
142
  isOpen={Boolean(openMap[tool.id])}
143
143
  onToggle={toggle}
144
+ isMobile={isMobile}
144
145
  />
145
146
  </Fragment>
146
147
  );
@@ -79,20 +79,36 @@ function mount(content: string): HTMLElement {
79
79
  }
80
80
 
81
81
  describe('an injected prompt renders as a card, not a bubble', () => {
82
- test('a child outcome has no operator bubble at all', () => {
82
+ test('a child outcome is one system notice rendered as markdown', () => {
83
83
  const root = mount(
84
84
  renderChildOutcomeNotice([
85
85
  { sessionId: 'c1', status: 'failed', failure: '400 The model is unavailable.' },
86
86
  ]),
87
87
  );
88
88
  const text = root.textContent ?? '';
89
- expect(text).toContain('Worker outcome');
89
+ expect(text).toContain('System Notice');
90
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.
91
+ // The card's collapsed line names the worker and its reason; no bubble and
92
+ // no toolbar, because the operator wrote none of this row.
93
+ expect(text).toContain('c1 — Failed: 400 The model is unavailable.');
93
94
  expect(root.querySelector('button[aria-label="Undo this message"]')).toBeNull();
94
95
  });
95
96
 
97
+ test('an outcome body renders as markdown when the notice opens', async () => {
98
+ const root = mount(
99
+ renderChildOutcomeNotice([
100
+ { sessionId: 'c1', title: 'audit-auth', status: 'completed', output: '**Found** two bypasses, then return early.' },
101
+ ]),
102
+ );
103
+ const toggle = root.querySelector('button[aria-expanded]') as HTMLButtonElement;
104
+ expect(toggle.getAttribute('aria-expanded')).toBe('false');
105
+ await act(async () => {
106
+ toggle.click();
107
+ });
108
+ expect(Array.from(root.querySelectorAll('strong')).some((el) => el.textContent === 'Found')).toBe(true);
109
+ expect(root.textContent).toContain('two bypasses, then return early.');
110
+ });
111
+
96
112
  test('the operator keeps their own words beside the contract', () => {
97
113
  const content = [
98
114
  ORCHESTRATION_CONTRACT.open,
@@ -105,8 +121,10 @@ describe('an injected prompt renders as a card, not a bubble', () => {
105
121
  const text = root.textContent ?? '';
106
122
  expect(text).toContain('Orchestration');
107
123
  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.');
124
+ // The contract is a header line, never an expandable body: its own
125
+ // instructions do not reach the transcript at all.
126
+ expect(text).not.toContain('You are the orchestrator for this message.');
127
+ expect(root.querySelector('[aria-expanded]')).toBeNull();
110
128
  });
111
129
 
112
130
  test('a worker brief is one card and never a bubble', () => {
@@ -14,8 +14,10 @@
14
14
  * The split is the point. A delegating message is an orchestration contract
15
15
  * PREPENDED to what the person wrote, and a child outcome is a notice with no
16
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.
17
+ * look like something a human said, so the injected half renders as a card —
18
+ * the contract as one header line, a worker brief as a collapsed card, and an
19
+ * outcome as a `SystemNotice` whose Markdown body carries the report — while
20
+ * only the operator's words keep the bubble.
19
21
  */
20
22
 
21
23
  import { useMemo } from 'preact/hooks';
@@ -27,7 +29,9 @@ import { MarkdownRenderer } from '@/client/components/common/MarkdownRenderer';
27
29
  import { AttachmentChips } from '@/client/components/workspace/chat-timeline/AttachmentChips';
28
30
  import { CopyButton } from '@/client/components/common/CopyButton';
29
31
  import { PluginMessageActions } from '@/client/components/workspace/chat-timeline/PluginMessageActions';
30
- import { OrchestrationNotice } from '@/client/components/workspace/chat-timeline/OrchestrationNotice';
32
+ import { OrchestrationNotice, isTimelineNoticeBlock } from '@/client/components/workspace/chat-timeline/OrchestrationNotice';
33
+ import { SystemNotice } from '@/client/components/workspace/chat-timeline/SystemNotice';
34
+ import { childOutcomeMarkdown } from '@/shared/lib/chat/orchestration/outcome-markdown';
31
35
  import { formatMessageStamp } from '@kabmo-labs/kabmo-format/time';
32
36
  import { transcriptBlockPadding, transcriptGutter } from '@/shared/lib/chat/timeline/gutter';
33
37
  import { parseOrchestrationBlock } from '@kabmo-labs/kabmo-app-contracts/notice';
@@ -60,6 +64,10 @@ export function UserTurn({
60
64
  const isAgentAttributed = msg.attribution === 'agent';
61
65
  const raw = typeof content === 'string' ? content : '';
62
66
  const orchestration = useMemo(() => parseOrchestrationBlock(raw), [raw]);
67
+ const outcomeNotice = useMemo(
68
+ () => (orchestration?.kind === 'outcome' ? childOutcomeMarkdown(orchestration.body) : ''),
69
+ [orchestration],
70
+ );
63
71
  // What the operator actually wrote. For a delegating turn that is the text
64
72
  // after the contract; for a notice it is nothing, and the row is the card.
65
73
  const operatorText = orchestration ? orchestration.rest : raw;
@@ -77,7 +85,12 @@ export function UserTurn({
77
85
 
78
86
  return (
79
87
  <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} />}
88
+ {orchestration?.kind === 'outcome' && (
89
+ <SystemNotice notice={outcomeNotice} isMobile={isMobile} markdown />
90
+ )}
91
+ {orchestration && isTimelineNoticeBlock(orchestration) && (
92
+ <OrchestrationNotice block={orchestration} isMobile={isMobile} />
93
+ )}
81
94
 
82
95
  {showBubble && (
83
96
  <div className="flex flex-col items-end space-y-1.5 w-full max-w-full">
@@ -147,6 +147,22 @@ describe('thinking follows the render style', () => {
147
147
  expect(compactMarks.some((el) => el.className.includes('rounded-full'))).toBe(false);
148
148
  });
149
149
 
150
+ test('tui toggles thinking with the terminal `▸`/`▾`, not the card chevron', async () => {
151
+ const tui = await paint('tui', h(ThinkingSection, { thinking: THOUGHT }));
152
+ const toggle = tui.querySelector('button[aria-expanded]') as HTMLButtonElement;
153
+ expect(toggle.textContent).toContain('▸');
154
+ expect(toggle.querySelector('.lucide-chevron-down')).toBeNull();
155
+ await act(async () => {
156
+ toggle.click();
157
+ });
158
+ expect(toggle.textContent).toContain('▾');
159
+
160
+ const card = await paint('card', h(ThinkingSection, { thinking: THOUGHT }));
161
+ const cardToggle = card.querySelector('button[aria-expanded]') as HTMLButtonElement;
162
+ expect(cardToggle.textContent).not.toContain('▸');
163
+ expect(cardToggle.querySelector('.lucide-chevron-down')).not.toBeNull();
164
+ });
165
+
150
166
  test('a style change reaches a mounted thinking block', async () => {
151
167
  await paint('card', h(ThinkingSection, { thinking: THOUGHT }));
152
168
  expect(container.innerHTML).toContain('rounded-xl');
@@ -16,6 +16,7 @@ import { Window } from 'happy-dom';
16
16
  import { h, render } from 'preact';
17
17
  import { act } from 'preact/test-utils';
18
18
  import { AccessDropdown } from '@/client/components/workspace/chat-timeline/chat-input/AccessDropdown';
19
+ import type { SessionModeState } from '@kabmo-labs/kabmo-harness/session-modes';
19
20
  import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
20
21
 
21
22
  let container: HTMLElement | undefined;
@@ -33,16 +34,22 @@ afterEach(() => {
33
34
 
34
35
  afterAll(() => restoreDomGlobals());
35
36
 
36
- async function open(harness?: string, iconOnly?: boolean): Promise<HTMLElement> {
37
+ async function open(
38
+ harness?: string,
39
+ iconOnly?: boolean,
40
+ extra: { ladder?: SessionModeState; onSelect?: () => void; onSelectLadder?: (value: string) => void } = {},
41
+ ): Promise<HTMLElement> {
37
42
  container = document.createElement('div');
38
43
  document.body.appendChild(container);
39
44
  await act(async () => {
40
45
  render(
41
46
  h(AccessDropdown, {
42
47
  value: 'always-ask',
43
- onSelect: () => {},
48
+ onSelect: extra.onSelect ?? (() => {}),
44
49
  ...(harness ? { harness } : {}),
45
50
  ...(iconOnly ? { iconOnly } : {}),
51
+ ...(extra.ladder ? { ladder: extra.ladder } : {}),
52
+ ...(extra.onSelectLadder ? { onSelectLadder: extra.onSelectLadder } : {}),
46
53
  }),
47
54
  container!,
48
55
  );
@@ -83,18 +90,67 @@ describe('AccessDropdown label', () => {
83
90
 
84
91
  describe('AccessDropdown copy', () => {
85
92
  test('omp keeps the restricted-folder promise', async () => {
86
- const el = await open('omp-rpc');
87
- const yolo = el.querySelector('[title*="restricted folder"]');
93
+ await open('omp-rpc');
94
+ const yolo = document.body.querySelector('[title*="restricted folder"]');
88
95
  expect(yolo).not.toBeNull();
89
96
  // omp's tier is the gate, so there is nothing to disclaim.
90
- expect(el.textContent).not.toContain('decides which calls it asks about');
97
+ expect(document.body.textContent).not.toContain('decides which calls it asks about');
91
98
  });
92
99
 
93
- test('another agent gets the answer-policy wording and the disclaimer', async () => {
94
- const el = await open('claude');
95
- expect(el.textContent).toContain('decides which calls it asks about');
100
+ test('an ACP agent without an access ladder gets the answer-policy wording', async () => {
101
+ await open('opencode');
102
+ expect(document.body.textContent).toContain('decides which calls it asks about');
96
103
  // The omp-only rule must not be promised on a transport that has no such gate.
97
- expect(el.querySelector('[title*="restricted folder"]')).toBeNull();
98
- expect(el.querySelector('[title*="Every approval the agent asks for"]')).not.toBeNull();
104
+ expect(document.body.querySelector('[title*="restricted folder"]')).toBeNull();
105
+ expect(document.body.querySelector('[title*="Every approval the agent asks for"]')).not.toBeNull();
106
+ });
107
+ });
108
+
109
+ const CLAUDE_LADDER: SessionModeState = {
110
+ currentValue: 'default',
111
+ values: [
112
+ { value: 'default', name: 'Manual' },
113
+ { value: 'acceptEdits', name: 'Accept edits' },
114
+ { value: 'plan', name: 'Plan' },
115
+ { value: 'auto', name: 'Auto' },
116
+ { value: 'bypassPermissions', name: 'Bypass permissions' },
117
+ ],
118
+ };
119
+
120
+ describe('AccessDropdown with the agent’s own access ladder', () => {
121
+ test('names the agent’s current mode and never shows Kabmo’s tiers', async () => {
122
+ await open('claude', false, { ladder: CLAUDE_LADDER, onSelectLadder: () => {} });
123
+ const trigger = container!.querySelector('button') as HTMLButtonElement;
124
+ expect(trigger.getAttribute('aria-label')).toBe('Access control: Manual');
125
+ expect(trigger.textContent).toContain('Manual');
126
+
127
+ const rows = [...document.body.querySelectorAll('[role="option"]')];
128
+ expect(rows.map((row) => row.textContent)).toEqual([
129
+ 'Manual',
130
+ 'Accept edits',
131
+ 'Plan',
132
+ 'Auto',
133
+ 'Bypass permissions',
134
+ ]);
135
+ // The two controls that contradicted each other are never on screen together.
136
+ expect(document.body.textContent).not.toContain('Always ask');
137
+ expect(document.body.textContent).not.toContain('Full bypass');
138
+ expect(document.body.textContent).toContain('This agent’s own access modes');
139
+ });
140
+
141
+ test('a pick moves the agent mode, not Kabmo’s tier', async () => {
142
+ const picks: string[] = [];
143
+ let tiers = 0;
144
+ await open('claude', false, {
145
+ ladder: CLAUDE_LADDER,
146
+ onSelect: () => { tiers += 1; },
147
+ onSelectLadder: (value) => picks.push(value),
148
+ });
149
+ const bypass = [...document.body.querySelectorAll('[role="option"]')]
150
+ .find((row) => row.textContent === 'Bypass permissions') as HTMLButtonElement;
151
+ await act(async () => { bypass.click(); });
152
+ expect(picks).toEqual(['bypassPermissions']);
153
+ expect(tiers).toBe(0);
154
+ expect(document.body.querySelector('[role="listbox"]')).toBeNull();
99
155
  });
100
156
  });