@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.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +457 -444
- package/dist/client/static/js/{Body-karkrzkc.js → Body-ysmhxbvk.js} +3 -3
- package/dist/client/static/js/{CsvGrid-j03knmbe.js → CsvGrid-w90pxyn2.js} +1 -1
- package/dist/client/static/js/{DocxView-e8408vzs.js → DocxView-evxn6kaq.js} +1 -1
- package/dist/client/static/js/{DrawioView-fj4mfzch.js → DrawioView-tmdevwf4.js} +1 -1
- package/dist/client/static/js/{HtmlPreview-9g8xwzgw.js → HtmlPreview-bpsn2z9p.js} +1 -1
- package/dist/client/static/js/{ImageView-sz4fzz9k.js → ImageView-ssazqckj.js} +1 -1
- package/dist/client/static/js/{LayoutWrapper-q6q4h04a.js → LayoutWrapper-qwpfq4dq.js} +2 -2
- package/dist/client/static/js/MergeDiffView-en6aazw8.js +1 -0
- package/dist/client/static/js/{Modal-ahecatp5.js → Modal-zjnhj9nb.js} +19 -19
- package/dist/client/static/js/{PdfView-8jtdx5hd.js → PdfView-txxn6qff.js} +1 -1
- package/dist/client/static/js/{SessionsView-jwp8xvw5.js → SessionsView-eryjtmb2.js} +1 -1
- package/dist/client/static/js/{SheetView-hwx8s864.js → SheetView-52b33e6f.js} +1 -1
- package/dist/client/static/js/{SvgPreview-ete36nzv.js → SvgPreview-hrk4pfm1.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-7nsqzz6z.js → abnfDiagram-O67JEVCF-at77sybc.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-v05ap4e3.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-xvpkfq2f.js → architectureDiagram-NJMV4G6O-raw33jgg.js} +3 -3
- package/dist/client/static/js/{astro-rsrqgjjx.js → astro-qha7sceh.js} +1 -1
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-0saahcs6.js → blockDiagram-BEXU5L5S-b6e90fbk.js} +6 -6
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-ktpqnb4a.js → c4Diagram-YGBWAQC7-msg9y1c6.js} +2 -2
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-x67cz3ms.js → classDiagram-v2-NBCMYWYE-jmrd1h8r.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-9wzmhkz8.js → cose-bilkent-JH36ORCC-na65ebq3.js} +1 -1
- package/dist/client/static/js/css-q2k6afe3.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-sqv0ze38.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-dmmgmv99.js → cynefinDiagram-VND7K2PF-9xkkw71m.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-ygkkms1t.js → dagre-6A5THRUB-p59f19tv.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-qxj0pqb4.js → diagram-22UHCM2B-2e2rcvn7.js} +8 -8
- package/dist/client/static/js/{diagram-3UASUU5V-77k8w5dt.js → diagram-3UASUU5V-r9ds8vgr.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-m0h86vf4.js → diagram-ATOU4E4O-jgwxv7v8.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-5v28kaeg.js → diagram-CDSNMT55-20m35eqq.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-zgcg9gaz.js → diagram-MLGK6HIB-vt3kxt2m.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-10c9s6e6.js → diagram-MPIPVDR6-c47rgxf1.js} +1 -1
- package/dist/client/static/js/{dockerfile-dr9sdsqp.js → dockerfile-gtcyey0q.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-mz4022dz.js → ebnfDiagram-ZINNZB2B-aszw3xy3.js} +1 -1
- package/dist/client/static/js/{elixir-3dy25ex8.js → elixir-w92v180e.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-ccerbsag.js → elk-276RUBZZ-gbvr3gry.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-a8vjyrrw.js → erDiagram-OPXOYQCR-1hqca8qe.js} +2 -2
- package/dist/client/static/js/eventmodeling-NTZA5JFV-t4dzf5s7.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-c16xmjyv.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-sz1g29fp.js → ganttDiagram-FUAMR5RP-07v22te5.js} +2 -2
- package/dist/client/static/js/gitGraph-4MIJSDKK-0jq8y0qd.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-efqk42q0.js → gitGraphDiagram-X574FWY7-y068jtz9.js} +8 -8
- package/dist/client/static/js/graphql-qx4tt6ze.js +1 -0
- package/dist/client/static/js/html-5e0g8664.js +1 -0
- package/dist/client/static/js/{index-gw4c5n3a.js → index-007sewcn.js} +1 -1
- package/dist/client/static/js/{index-qbqm3c91.js → index-1e0rt7c6.js} +2 -2
- package/dist/client/static/js/{index-6qqsy78z.js → index-1e710snk.js} +1 -1
- package/dist/client/static/js/{index-kc5yt2cd.js → index-2s17netq.js} +2 -2
- package/dist/client/static/js/{index-7s4dge1z.js → index-374xq5a4.js} +1 -1
- package/dist/client/static/js/index-4ddgpqm0.css +1 -0
- package/dist/client/static/js/{index-6h46r2de.js → index-5g2j626a.js} +1 -1
- package/dist/client/static/js/{index-5tp3emtg.js → index-5hvt233n.js} +1 -1
- package/dist/client/static/js/{index-ssepzdaz.js → index-5xxbbzqa.js} +5 -5
- package/dist/client/static/js/{index-jnxmvxb8.js → index-7sq6cjt1.js} +11 -11
- package/dist/client/static/js/{index-q0k1am0g.js → index-80kx6dm6.js} +2 -2
- package/dist/client/static/js/{index-2f6psebk.js → index-8d8ce00v.js} +1 -1
- package/dist/client/static/js/{index-gqsnyh8k.js → index-94d416ee.js} +1 -1
- package/dist/client/static/js/{index-2a0b9ya2.js → index-an7fq7f6.js} +1 -1
- package/dist/client/static/js/{index-6ey6y9em.js → index-azz46nwc.js} +2 -2
- package/dist/client/static/js/{index-bkwax812.js → index-c9aqx3ht.js} +1 -1
- package/dist/client/static/js/{index-rr79n77k.js → index-cc7qbfvn.js} +155 -148
- package/dist/client/static/js/{index-wnk9k57k.js → index-cmjyet7w.js} +50 -50
- package/dist/client/static/js/{index-f31c6jg8.js → index-cpp43af3.js} +8 -8
- package/dist/client/static/js/{index-dz18nn65.js → index-dxq1tbwm.js} +1 -1
- package/dist/client/static/js/{index-8aqjj2x2.js → index-e0kahttb.js} +1 -1
- package/dist/client/static/js/{index-ts8rhd06.js → index-e4nge3f4.js} +1 -1
- package/dist/client/static/js/{index-k4qshngy.js → index-f27wvdky.js} +3 -3
- package/dist/client/static/js/{index-7ma44af3.js → index-f61c25vn.js} +1 -1
- package/dist/client/static/js/{index-nzq51nbb.js → index-fe92hqmb.js} +5 -5
- package/dist/client/static/js/{index-k56patms.js → index-fv7nybnf.js} +2 -2
- package/dist/client/static/js/{index-xfyxmaj1.js → index-gqrt766t.js} +44 -44
- package/dist/client/static/js/{index-mkp3gwag.js → index-hb7a7m9m.js} +1 -1
- package/dist/client/static/js/{index-qkcmspxq.js → index-j830qk07.js} +1 -1
- package/dist/client/static/js/{index-6ac860yz.js → index-kzzvrqnv.js} +1 -1
- package/dist/client/static/js/{index-x7h04xzf.js → index-m5n0zsft.js} +1 -1
- package/dist/client/static/js/{index-q5q8a3qn.js → index-medk4f18.js} +1 -1
- package/dist/client/static/js/{index-tnxp90ac.js → index-nptbz7sv.js} +1 -1
- package/dist/client/static/js/{index-r1wrke3j.js → index-qefssj0m.js} +1 -1
- package/dist/client/static/js/{index-mpyd7qxj.js → index-r8d4bk86.js} +2 -2
- package/dist/client/static/js/{index-vf01q99d.js → index-rqt8mem9.js} +2 -2
- package/dist/client/static/js/{index-zh550byg.js → index-s4dpkds5.js} +1 -1
- package/dist/client/static/js/index-s9k82stc.js +2 -0
- package/dist/client/static/js/{index-xygk0v3e.js → index-skwem10a.js} +2 -2
- package/dist/client/static/js/{index-k1576e2m.js → index-tv9rn2nd.js} +1 -1
- package/dist/client/static/js/{index-dqf0srrp.js → index-vny4ymjf.js} +2 -2
- package/dist/client/static/js/{index-w5j1wgcz.js → index-vw8b29ek.js} +1 -1
- package/dist/client/static/js/{index-e42ys2q3.js → index-wn28m9h7.js} +7 -7
- package/dist/client/static/js/{index-tc07gd33.js → index-wxqcnsrq.js} +2 -2
- package/dist/client/static/js/{index-j863hg0d.js → index-xmg1x6zv.js} +6 -6
- package/dist/client/static/js/{index-t71k3b28.js → index-zhgh7a31.js} +1 -1
- package/dist/client/static/js/{index-vb5a3g01.js → index-zs7kw0be.js} +3 -3
- package/dist/client/static/js/info-A6RAGUB7-szttx3v5.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-rykcacj5.js → infoDiagram-VRGFBTTK-1x83h4k4.js} +2 -2
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-rj752kd8.js → ishikawaDiagram-OU5B5YK6-et6z3c28.js} +2 -2
- package/dist/client/static/js/javascript-av46zx4c.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-mtetwn6f.js → journeyDiagram-ZHPQQLJL-sw669e7a.js} +3 -3
- package/dist/client/static/js/{julia-mxe3pnz3.js → julia-z14p8jsx.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-4h5pw5mm.js → kanban-definition-PNTS6WVX-aqxg95kx.js} +7 -7
- package/dist/client/static/js/{mermaid.core-bs542jma.js → mermaid.core-6cgqsgcf.js} +3 -3
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-67s4xy7h.js → mindmap-definition-NLK3R4M7-530anpc4.js} +4 -4
- package/dist/client/static/js/one-dark-pro-9hnhtkpr.js +1 -0
- package/dist/client/static/js/one-light-2n5y8592.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-401149bv.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-qykb6ssk.js → pegDiagram-GJSIUBJH-5zar6hvy.js} +1 -1
- package/dist/client/static/js/{perl-a8eeaqkn.js → perl-1na2x6yd.js} +1 -1
- package/dist/client/static/js/{php-6gq92zt8.js → php-x75tt7w3.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-bgfv8tfz.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-mymrrvck.js → pieDiagram-5QR66LMP-3bx8syvw.js} +2 -2
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-6f8ahd40.js → quadrantDiagram-O4NWA36T-yaarpr2e.js} +2 -2
- package/dist/client/static/js/radar-RG4KPBEZ-pw720590.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-n2a30ngs.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-rn5rx9qt.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-t4yryhtd.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-c4ebgvrr.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-c3habpvw.js → railroadDiagram-XR7U4H2S-ag41q4nt.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-nysqy6te.js → requirementDiagram-PLB6GJNP-g8sr48h4.js} +4 -4
- package/dist/client/static/js/{ruby-mc826p2e.js → ruby-3h22qahv.js} +1 -1
- package/dist/client/static/js/{rust-m4f4vpvn.js → rust-r27demr5.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s5dtfp3z.js → sankeyDiagram-IPEJSGJF-t1wbd1hh.js} +1 -1
- package/dist/client/static/js/{scss-9wz47c6t.js → scss-c04ezwnn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-bb3yp049.js → sequenceDiagram-PO4LG4MO-407mjqty.js} +5 -5
- package/dist/client/static/js/{sizeCapture-INFHLROL-0m2msee7.js → sizeCapture-INFHLROL-w38zb9ky.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-cd0qgj6t.js → stateDiagram-v2-GCMORJYK-4cvgymkc.js} +3 -3
- package/dist/client/static/js/{svelte-5vrwkc13.js → svelte-egg3x4tw.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-rpb01f7p.js → swimlanes-2SLR337P-w7ts2rzw.js} +1 -1
- package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-zx36y2c8.js → swimlanesDiagram-TC7HE7FX-v82nym6b.js} +1 -1
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-tqw2e6y1.js → timeline-definition-EJHVYXUP-nq46nzy9.js} +4 -4
- package/dist/client/static/js/treeView-Q6P3EWNA-bxgt5yhm.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-hh3595m0.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-dhf4d5xg.js → usecaseDiagram-POWQR4AR-q144snzb.js} +22 -22
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-ztkk79dv.js → vennDiagram-UO4OBE2U-2wemak2p.js} +5 -5
- package/dist/client/static/js/{vue-gmjnxjm3.js → vue-d7p4wv35.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-6bza7h1b.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-ahre5tmv.js → wardleyDiagram-VNRHLVJA-bb2qvvgr.js} +2 -2
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-vak2c50n.js → xychartDiagram-PMCCYNJV-9dr05fdq.js} +4 -4
- package/package.json +4 -4
- package/src/client/components/common/anchored-menu/index.tsx +11 -4
- package/src/client/components/common/session-row/TrailingSlot.tsx +6 -2
- package/src/client/components/common/session-row/index.tsx +32 -16
- package/src/client/components/common/session-row/session-row.test.tsx +56 -18
- package/src/client/components/layout/session-sidebar/modern/WorkspaceHeader.tsx +24 -3
- package/src/client/components/layout/session-sidebar/modern/workspace-header.test.tsx +20 -0
- package/src/client/components/workspace/chat-timeline/ChatOverlays.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/NewChatModal.tsx +5 -0
- package/src/client/components/workspace/chat-timeline/OrchestrationNotice.tsx +81 -162
- package/src/client/components/workspace/chat-timeline/SystemNotice.tsx +7 -3
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +12 -4
- package/src/client/components/workspace/chat-timeline/ToolCallingSection.tsx +1 -0
- package/src/client/components/workspace/chat-timeline/UserTurn.test.tsx +24 -6
- package/src/client/components/workspace/chat-timeline/UserTurn.tsx +17 -4
- package/src/client/components/workspace/chat-timeline/block-chrome.test.tsx +16 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +66 -10
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +103 -41
- package/src/client/components/workspace/chat-timeline/chat-input/ComposerRows.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.test.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/chat-input/SessionModeDropdown.tsx +54 -35
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.test.tsx +110 -0
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +51 -32
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.test.ts +62 -0
- package/src/client/components/workspace/chat-timeline/chat-input/Toolbar.tsx +15 -3
- package/src/client/components/workspace/chat-timeline/chat-input/access-capability.test.tsx +151 -0
- package/src/client/components/workspace/chat-timeline/chat-input/modes-props.ts +5 -0
- package/src/client/components/workspace/chat-timeline/fork-preview.test.tsx +1 -1
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.test.tsx +21 -5
- package/src/client/components/workspace/chat-timeline/target-picker/ParentSessionPicker.tsx +100 -71
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +9 -9
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +83 -66
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.test.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/target-picker/WorktreePicker.tsx +36 -15
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ArtifactChip.tsx +7 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +10 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +11 -6
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +2 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.test.tsx +5 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +19 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +50 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/props.ts +2 -0
- package/src/client/hooks/chat/timeline/access-ladder-wiring.test.ts +111 -0
- package/src/client/hooks/chat/timeline/access-ladder.test.ts +66 -0
- package/src/client/hooks/chat/timeline/access-ladder.ts +72 -0
- package/src/client/hooks/chat/timeline/access-mode.ts +11 -1
- package/src/client/hooks/chat/timeline/index.ts +4 -5
- package/src/client/hooks/chat/timeline/modes-contract.ts +10 -1
- package/src/client/hooks/chat/timeline/modes.ts +10 -2
- package/src/server/lib/realtime/topics/session-data.server.ts +6 -5
- package/src/server/lib/realtime/topics/session-data.test.ts +35 -0
- package/src/shared/lib/chat/orchestration/outcome-markdown.test.ts +57 -0
- package/src/shared/lib/chat/orchestration/outcome-markdown.ts +74 -0
- package/dist/client/static/js/MergeDiffView-b8f013ws.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-dc7zys46.js +0 -1
- package/dist/client/static/js/css-9gak6bze.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-9fx59e89.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-61d2ee91.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-104ywb7w.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-zkb30q0t.js +0 -1
- package/dist/client/static/js/graphql-2ntm7jyh.js +0 -1
- package/dist/client/static/js/html-mt2yb43b.js +0 -1
- package/dist/client/static/js/index-f44k9k8d.css +0 -1
- package/dist/client/static/js/index-ver116ed.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-xxvyt8p8.js +0 -1
- package/dist/client/static/js/javascript-0mqgcvps.js +0 -1
- package/dist/client/static/js/one-dark-pro-541ed4b7.js +0 -1
- package/dist/client/static/js/one-light-nr79mykt.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-cm8jeesg.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-8b9xgcxv.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-fxr2x2mf.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-5qd45xk1.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-6fa00vpk.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-pcbtg7tj.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-r0fdhdtp.js +0 -1
- package/dist/client/static/js/treeView-Q6P3EWNA-9sn2h4ea.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-9fzms0pq.js +0 -1
- 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
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
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
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
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 {
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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<
|
|
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<
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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:
|
|
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
|
|
126
|
-
()
|
|
127
|
-
|
|
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
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
191
|
-
<
|
|
192
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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 && (
|
|
@@ -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
|
|
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('
|
|
89
|
+
expect(text).toContain('System Notice');
|
|
90
90
|
expect(text).toContain('Failed');
|
|
91
|
-
// The card's
|
|
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
|
|
109
|
-
|
|
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
|
-
*
|
|
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
|
|
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(
|
|
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
|
-
|
|
87
|
-
const yolo =
|
|
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(
|
|
97
|
+
expect(document.body.textContent).not.toContain('decides which calls it asks about');
|
|
91
98
|
});
|
|
92
99
|
|
|
93
|
-
test('
|
|
94
|
-
|
|
95
|
-
expect(
|
|
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(
|
|
98
|
-
expect(
|
|
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
|
});
|