@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
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The composer wiring for an access ladder.
|
|
8
|
+
*
|
|
9
|
+
* The classifier is pinned separately; this file pins the two consequences the
|
|
10
|
+
* composer depends on: the ladder is NOT also a Session Mode chip (and Plan is
|
|
11
|
+
* not a third control for its `plan` value), and Kabmo's own tier stays out of
|
|
12
|
+
* the way — `yolo` beside the agent's "Manual" would auto-answer the requests
|
|
13
|
+
* the mode names.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
17
|
+
import { Window } from 'happy-dom';
|
|
18
|
+
import { h, render } from 'preact';
|
|
19
|
+
import { act } from 'preact/test-utils';
|
|
20
|
+
import { useChatTimelineModes } from '@/client/hooks/chat/timeline/modes';
|
|
21
|
+
import { useChatTimelineAccessMode } from '@/client/hooks/chat/timeline/access-mode';
|
|
22
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
23
|
+
import type { SessionModeState } from '@kabmo-labs/kabmo-harness/session-modes';
|
|
24
|
+
|
|
25
|
+
const CLAUDE_LADDER: SessionModeState = {
|
|
26
|
+
currentValue: 'default',
|
|
27
|
+
values: [
|
|
28
|
+
{ value: 'default', name: 'Manual' },
|
|
29
|
+
{ value: 'acceptEdits', name: 'Accept edits' },
|
|
30
|
+
{ value: 'plan', name: 'Plan' },
|
|
31
|
+
{ value: 'auto', name: 'Auto' },
|
|
32
|
+
{ value: 'bypassPermissions', name: 'Bypass permissions' },
|
|
33
|
+
],
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const CAPABILITIES = {
|
|
37
|
+
harness: 'claude',
|
|
38
|
+
modeValues: CLAUDE_LADDER.values.map((choice) => choice.value),
|
|
39
|
+
modeChoices: CLAUDE_LADDER.values,
|
|
40
|
+
modeCurrent: 'default',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
let container: HTMLElement;
|
|
44
|
+
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
47
|
+
container = document.body.appendChild(document.createElement('div'));
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(() => {
|
|
51
|
+
render(null, container);
|
|
52
|
+
container.remove();
|
|
53
|
+
restoreDomGlobals();
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
afterAll(() => restoreDomGlobals());
|
|
57
|
+
|
|
58
|
+
function ModesProbe() {
|
|
59
|
+
const modes = useChatTimelineModes('new-1790756769132', CAPABILITIES);
|
|
60
|
+
return h(
|
|
61
|
+
'div',
|
|
62
|
+
null,
|
|
63
|
+
h('span', { id: 'session' }, modes.sessionMode?.currentValue ?? 'none'),
|
|
64
|
+
h('span', { id: 'ladder' }, modes.accessLadder?.currentValue ?? 'none'),
|
|
65
|
+
h('span', { id: 'plan' }, String(modes.planAvailable)),
|
|
66
|
+
h('span', { id: 'spawn' }, modes.pendingAgentModeRef.current ?? 'none'),
|
|
67
|
+
h('button', { id: 'bypass', onClick: () => modes.onSelectSessionMode?.('bypassPermissions') }, 'bypass'),
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function AccessProbe({ harness, ladderOwnsAccess }: { harness: string; ladderOwnsAccess: boolean }) {
|
|
72
|
+
const { accessMode } = useChatTimelineAccessMode({ omp_access_mode: 'yolo' }, harness, ladderOwnsAccess);
|
|
73
|
+
return h('span', { id: 'access' }, accessMode);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
describe('an access ladder in the composer', () => {
|
|
77
|
+
test('is the Access Control, not a second Session Mode chip', async () => {
|
|
78
|
+
await act(async () => { render(h(ModesProbe, {}), container); });
|
|
79
|
+
expect(container.querySelector('#ladder')?.textContent).toBe('default');
|
|
80
|
+
expect(container.querySelector('#session')?.textContent).toBe('none');
|
|
81
|
+
// Plan is one of the ladder's rows, so a separate Plan button would be a
|
|
82
|
+
// second control for the same value.
|
|
83
|
+
expect(container.querySelector('#plan')?.textContent).toBe('false');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test('the pending pick is what the spawn must request', async () => {
|
|
87
|
+
await act(async () => { render(h(ModesProbe, {}), container); });
|
|
88
|
+
await act(async () => { (container.querySelector('#bypass') as HTMLButtonElement).click(); });
|
|
89
|
+
await act(async () => {});
|
|
90
|
+
expect(container.querySelector('#ladder')?.textContent).toBe('bypassPermissions');
|
|
91
|
+
expect(container.querySelector('#spawn')?.textContent).toBe('bypassPermissions');
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test('Kabmo’s stored tier cannot auto-answer beside the agent’s mode', async () => {
|
|
95
|
+
await act(async () => { render(h(AccessProbe, { harness: 'claude', ladderOwnsAccess: true }), container); });
|
|
96
|
+
expect(container.querySelector('#access')?.textContent).toBe('always-ask');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('a harness that never asks keeps the tier inert too', async () => {
|
|
100
|
+
// The chip is not drawn, but the SEND path still carries `accessMode`; a
|
|
101
|
+
// stored `yolo` there would silently auto-answer anything the agent later
|
|
102
|
+
// routed through Kabmo, over a dialog nobody was shown.
|
|
103
|
+
await act(async () => { render(h(AccessProbe, { harness: 'jcode', ladderOwnsAccess: false }), container); });
|
|
104
|
+
expect(container.querySelector('#access')?.textContent).toBe('always-ask');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('an agent that asks keeps the operator’s pick', async () => {
|
|
108
|
+
await act(async () => { render(h(AccessProbe, { harness: 'omp-rpc', ladderOwnsAccess: false }), container); });
|
|
109
|
+
expect(container.querySelector('#access')?.textContent).toBe('yolo');
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Which ACP mode ladders are access policies.
|
|
8
|
+
*
|
|
9
|
+
* The fixture ladders are the ones measured on this machine (or read from the
|
|
10
|
+
* adapter's own table) — the composer used to draw them as "Session Mode"
|
|
11
|
+
* beside Kabmo's Access Control, so "Bypass permissions" and "Always ask" were
|
|
12
|
+
* on screen at once. opencode, cursor and `omp-acp` must keep their own
|
|
13
|
+
* session-mode control; their ladders are workflow agents, not permissions.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { describe, expect, test } from 'bun:test';
|
|
17
|
+
import { accessLadder } from '@/client/hooks/chat/timeline/access-ladder';
|
|
18
|
+
import type { SessionModeState } from '@kabmo-labs/kabmo-harness/session-modes';
|
|
19
|
+
|
|
20
|
+
function ladder(current: string, values: Array<[string, string]>): SessionModeState {
|
|
21
|
+
return { currentValue: current, values: values.map(([value, name]) => ({ value, name })) };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
describe('accessLadder', () => {
|
|
25
|
+
test('claude’s permission modes are the access control', () => {
|
|
26
|
+
const mode = ladder('default', [
|
|
27
|
+
['default', 'Manual'],
|
|
28
|
+
['acceptEdits', 'Accept edits'],
|
|
29
|
+
['plan', 'Plan'],
|
|
30
|
+
['auto', 'Auto'],
|
|
31
|
+
['bypassPermissions', 'Bypass permissions'],
|
|
32
|
+
]);
|
|
33
|
+
expect(accessLadder(mode)).toBe(mode);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test('measured permission ladders from the other ACP adapters are too', () => {
|
|
37
|
+
// codex sandbox modes, zcode's guarded/yolo pair, antigravity's defaults,
|
|
38
|
+
// command-code's five, qwen's cycle, kimi's, hermes' edit policy.
|
|
39
|
+
for (const mode of [
|
|
40
|
+
ladder('agent', [['read-only', 'Read-only'], ['workspace-write', 'Workspace access'], ['agent', 'Auto review'], ['agent-full-access', 'Full access']]),
|
|
41
|
+
ladder('yolo', [['plan', 'plan'], ['build', 'build'], ['edit', 'edit'], ['guarded', 'guarded'], ['yolo', 'yolo']]),
|
|
42
|
+
ladder('default', [['default', 'Default'], ['accept-edits', 'Accept edits'], ['auto', 'Auto'], ['plan', 'Plan']]),
|
|
43
|
+
ladder('default', [['default', 'Default'], ['auto-accept', 'Auto accept'], ['plan', 'Plan'], ['dont-ask', 'Don’t ask'], ['bypass', 'Bypass']]),
|
|
44
|
+
ladder('default', [['plan', 'Plan'], ['default', 'Ask permissions'], ['auto-edit', 'Auto-edit'], ['auto', 'Auto'], ['yolo', 'YOLO']]),
|
|
45
|
+
ladder('default', [['default', 'Default'], ['plan', 'Plan'], ['auto', 'Auto'], ['yolo', 'YOLO']]),
|
|
46
|
+
ladder('default', [['default', 'Default'], ['accept_edits', 'Accept Edits'], ['dont_ask', 'Don’t Ask']]),
|
|
47
|
+
]) {
|
|
48
|
+
expect(accessLadder(mode)).toBe(mode);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('workflow ladders keep their own session-mode control', () => {
|
|
53
|
+
// omp-acp's default/plan pair: Plan is already its own toggle.
|
|
54
|
+
expect(accessLadder(ladder('default', [['default', 'Default'], ['plan', 'Plan']]))).toBeNull();
|
|
55
|
+
// opencode's agent roster.
|
|
56
|
+
expect(accessLadder(ladder('build', [['build', 'Build'], ['plan', 'Plan'], ['Sisyphus - ultraworker', 'Sisyphus - ultraworker'], ['architect', 'architect']]))).toBeNull();
|
|
57
|
+
// cursor's interaction modes.
|
|
58
|
+
expect(accessLadder(ladder('agent', [['agent', 'Agent'], ['ask', 'Ask'], ['plan', 'Plan']]))).toBeNull();
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
test('no ladder or a single value is not a control', () => {
|
|
62
|
+
expect(accessLadder(null)).toBeNull();
|
|
63
|
+
expect(accessLadder(undefined)).toBeNull();
|
|
64
|
+
expect(accessLadder(ladder('yolo', [['yolo', 'YOLO']]))).toBeNull();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* When an ACP agent's own `mode` ladder IS its access policy.
|
|
8
|
+
*
|
|
9
|
+
* Several adapters publish permission levels through the same `mode` config
|
|
10
|
+
* option Kabmo renders as "Session Mode": claude (`default` / `acceptEdits` /
|
|
11
|
+
* `plan` / `auto` / `bypassPermissions`), codex (`read-only` /
|
|
12
|
+
* `workspace-write` / `agent` / `agent-full-access`), zcode (`plan` / `build` /
|
|
13
|
+
* `edit` / `guarded` / `yolo`), antigravity (`default` / `accept-edits` /
|
|
14
|
+
* `auto` / `plan`), command-code (`default` / `auto-accept` / `plan` /
|
|
15
|
+
* `dont-ask` / `bypass`), qwen, kimi and hermes. Rendering those beside Kabmo's
|
|
16
|
+
* Always ask / Minimal / Full bypass tiers put two contradictory access
|
|
17
|
+
* controls in one composer — picking "Bypass permissions" while Access Control
|
|
18
|
+
* still said "Always ask" was the measured shape.
|
|
19
|
+
*
|
|
20
|
+
* The values are the only signal every adapter shares (ACP has no
|
|
21
|
+
* `permission` category). A ladder is treated as the access ladder when at
|
|
22
|
+
* least two of its values or names use permission vocabulary; the threshold
|
|
23
|
+
* keeps `omp-acp`'s `default` / `plan` pair, opencode's `build` / `plan` /
|
|
24
|
+
* `architect` agents and cursor's `agent` / `ask` / `plan` workflow modes out.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import type { SessionModeState } from '@kabmo-labs/kabmo-harness/session-modes';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Substrings of a normalised mode id/name, lowercased and stripped of
|
|
31
|
+
* punctuation so `acceptEdits`, `accept-edits` and `accept_edits` agree.
|
|
32
|
+
*
|
|
33
|
+
* `edit` is here for zcode's bare `edit`; `plan` is deliberately absent — it is
|
|
34
|
+
* a workflow value every ladder may carry and says nothing about permission.
|
|
35
|
+
*/
|
|
36
|
+
const ACCESS_WORDS = [
|
|
37
|
+
'bypass',
|
|
38
|
+
'permission',
|
|
39
|
+
'accept',
|
|
40
|
+
'auto',
|
|
41
|
+
'manual',
|
|
42
|
+
'guard',
|
|
43
|
+
'yolo',
|
|
44
|
+
'dontask',
|
|
45
|
+
'readonly',
|
|
46
|
+
'workspacewrite',
|
|
47
|
+
'fullaccess',
|
|
48
|
+
'default',
|
|
49
|
+
'edit',
|
|
50
|
+
] as const;
|
|
51
|
+
|
|
52
|
+
function isAccessChoice(choice: { value: string; name: string }): boolean {
|
|
53
|
+
const value = choice.value.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
54
|
+
const name = choice.name.toLowerCase().replace(/[^a-z0-9]/g, '');
|
|
55
|
+
return ACCESS_WORDS.some((word) => value.includes(word) || name.includes(word));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* The same selector when its values are access policies, else null.
|
|
60
|
+
*
|
|
61
|
+
* A ladder with fewer than two values has nothing to choose, so it cannot be
|
|
62
|
+
* an access CONTROL; the caller draws no control and the agent's default stays.
|
|
63
|
+
*/
|
|
64
|
+
export function accessLadder(mode: SessionModeState | null | undefined): SessionModeState | null {
|
|
65
|
+
if (!mode || mode.values.length < 2) return null;
|
|
66
|
+
let matches = 0;
|
|
67
|
+
for (const choice of mode.values) {
|
|
68
|
+
if (isAccessChoice(choice)) matches += 1;
|
|
69
|
+
if (matches >= 2) return mode;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
|
|
22
22
|
import { useCallback, useRef, useState } from 'preact/hooks';
|
|
23
23
|
import { ACCESS_MODE_SETTING_KEY,
|
|
24
|
+
DEFAULT_APPROVAL_MODE,
|
|
24
25
|
HARNESS_ACCESS_MODES_SETTING_KEY,
|
|
25
26
|
accessModeForHarness,
|
|
26
27
|
isOmpHarness,
|
|
27
28
|
readAccessModePicks, } from '@kabmo-labs/kabmo-omp/access-mode';
|
|
28
29
|
import type { ApprovalMode } from '@kabmo-labs/kabmo-omp/access-mode';
|
|
30
|
+
import { harnessRaisesApprovals } from '@kabmo-labs/kabmo-harness/catalog';
|
|
29
31
|
import { writeSetting } from '@/shared/lib/settings/client';
|
|
30
32
|
|
|
31
33
|
export interface ChatTimelineAccessMode {
|
|
@@ -38,6 +40,9 @@ export interface ChatTimelineAccessMode {
|
|
|
38
40
|
export function useChatTimelineAccessMode(
|
|
39
41
|
appSettings: Record<string, any>,
|
|
40
42
|
harness?: string | null,
|
|
43
|
+
/** True when the harness publishes its own access ladder (`accessLadder`),
|
|
44
|
+
* so that ladder — not this tier — decides. */
|
|
45
|
+
ladderOwnsAccess = false,
|
|
41
46
|
): ChatTimelineAccessMode {
|
|
42
47
|
const [picks, setPicks] = useState<Record<string, ApprovalMode>>({});
|
|
43
48
|
const picksRef = useRef(picks);
|
|
@@ -50,7 +55,12 @@ export function useChatTimelineAccessMode(
|
|
|
50
55
|
const stored = readAccessModePicks(appSettings);
|
|
51
56
|
// Derived, never stored: the harness can change under a pending chat (the
|
|
52
57
|
// tab strip), and this hook is the one place that turns that into a tier.
|
|
53
|
-
const
|
|
58
|
+
const tier = accessModeForHarness(harness, { ...stored, ...picks }, appSettings);
|
|
59
|
+
// INERT when Kabmo's tier has nothing to decide: the agent brings its own
|
|
60
|
+
// access ladder, or it never sends `session/request_permission` at all (see
|
|
61
|
+
// `harnessRaisesApprovals`). A stored `yolo` would otherwise answer silently
|
|
62
|
+
// — beside a chip reading "Manual", or over the only gate the agent has.
|
|
63
|
+
const accessMode = ladderOwnsAccess || !harnessRaisesApprovals(harness) ? DEFAULT_APPROVAL_MODE : tier;
|
|
54
64
|
const accessModeRef = useRef<ApprovalMode>(accessMode);
|
|
55
65
|
accessModeRef.current = accessMode;
|
|
56
66
|
|
|
@@ -204,12 +204,11 @@ export function useChatTimeline({
|
|
|
204
204
|
);
|
|
205
205
|
const { modes, planReview } = useComposerModes(sessionId, chatHarness);
|
|
206
206
|
|
|
207
|
-
// Access control, remembered PER HARNESS
|
|
208
|
-
//
|
|
209
|
-
//
|
|
210
|
-
// follow the operator onto another.
|
|
207
|
+
// Access control, remembered PER HARNESS (a pick made for one agent must not
|
|
208
|
+
// follow the operator onto another). The tier is INERT when the agent brings
|
|
209
|
+
// its own access ladder or never asks at all (see `useChatTimelineAccessMode`).
|
|
211
210
|
const { accessMode, accessModeRef, setAccessMode: handleAccessModeChange } =
|
|
212
|
-
useChatTimelineAccessMode(appSettings, chatHarness);
|
|
211
|
+
useChatTimelineAccessMode(appSettings, chatHarness, Boolean(modes.accessLadder));
|
|
213
212
|
|
|
214
213
|
const { steerOmpAgent, executeSend } = useChatTimelineSend({
|
|
215
214
|
folders,
|
|
@@ -59,8 +59,17 @@ export interface ChatTimelineModes {
|
|
|
59
59
|
*/
|
|
60
60
|
goalAvailable: boolean;
|
|
61
61
|
/** The agent's own mode selector (ACP). Null for omp and for an agent that
|
|
62
|
-
* publishes none; the composer then keeps the Plan toggle.
|
|
62
|
+
* publishes none; the composer then keeps the Plan toggle. ALSO null when
|
|
63
|
+
* `accessLadder` is set: that ladder is the access control, not a second
|
|
64
|
+
* session-mode control. */
|
|
63
65
|
sessionMode?: SessionModeState | null;
|
|
66
|
+
/**
|
|
67
|
+
* The agent's own ladder when its values ARE access policies (`claude`,
|
|
68
|
+
* `codex`, `zcode`, `antigravity`, …). The composer draws these inside the
|
|
69
|
+
* Access Control dropdown instead of beside Kabmo's tiers — two access
|
|
70
|
+
* controls in one composer contradicted each other.
|
|
71
|
+
*/
|
|
72
|
+
accessLadder?: SessionModeState | null;
|
|
64
73
|
/** Move the agent's mode selector. */
|
|
65
74
|
onSelectSessionMode?: (value: string) => void;
|
|
66
75
|
/**
|
|
@@ -39,6 +39,7 @@ import { isPendingSessionId } from '@kabmo-labs/kabmo-omp/session-core/default-t
|
|
|
39
39
|
import { isModeMarker } from '@kabmo-labs/kabmo-omp/mode/constants';
|
|
40
40
|
import type { ArmedGoal, GoalAction } from '@kabmo-labs/kabmo-omp/mode/actions';
|
|
41
41
|
import { modeAvailability, type ModeCapabilities } from '@/client/hooks/chat/timeline/mode-availability';
|
|
42
|
+
import { accessLadder } from '@/client/hooks/chat/timeline/access-ladder';
|
|
42
43
|
import { usePendingSessionMode } from '@/client/hooks/chat/timeline/pending-session-mode';
|
|
43
44
|
import { useSessionModesHydration } from '@/client/hooks/chat/timeline/modes-hydrate';
|
|
44
45
|
|
|
@@ -293,6 +294,12 @@ export function useChatTimelineModes(
|
|
|
293
294
|
// value in its own mode selector (measured: claude does, opencode does not).
|
|
294
295
|
// A button whose only outcome is a refusal is the shape this rule refuses.
|
|
295
296
|
const available = modeAvailability(capabilities);
|
|
297
|
+
// One access fact, one control: a ladder whose values are permission levels
|
|
298
|
+
// is rendered by the Access Control chip, not beside it. `sessionMode` goes
|
|
299
|
+
// null so the session-mode chip (and the Plan button it would replace) cannot
|
|
300
|
+
// offer the same choice twice.
|
|
301
|
+
const agentMode = sessionMode ?? pendingSession.mode;
|
|
302
|
+
const ladder = accessLadder(agentMode);
|
|
296
303
|
|
|
297
304
|
return {
|
|
298
305
|
plan,
|
|
@@ -302,9 +309,10 @@ export function useChatTimelineModes(
|
|
|
302
309
|
goalContinuation,
|
|
303
310
|
goalEvaluating,
|
|
304
311
|
pending,
|
|
305
|
-
planAvailable: available.plan && !goal,
|
|
312
|
+
planAvailable: available.plan && !goal && !ladder,
|
|
306
313
|
goalAvailable: available.goal,
|
|
307
|
-
sessionMode:
|
|
314
|
+
sessionMode: ladder ? null : agentMode,
|
|
315
|
+
accessLadder: ladder,
|
|
308
316
|
onSelectSessionMode,
|
|
309
317
|
pendingAgentModeRef: pendingSession.spawnRef,
|
|
310
318
|
error,
|
|
@@ -30,7 +30,7 @@ import { loadAcpSessions } from '@kabmo-labs/kabmo-harness/session/session-store
|
|
|
30
30
|
import { acpTelemetryFor } from '@kabmo-labs/kabmo-acp/session-core/acp-telemetry.server';
|
|
31
31
|
import { buildAcpTodos } from '@kabmo-labs/kabmo-acp/control/acp-todos.server';
|
|
32
32
|
import { buildAcpPlanState } from '@kabmo-labs/kabmo-acp/control/acp-plan';
|
|
33
|
-
import {
|
|
33
|
+
import { loadAcpPlanSnapshot } from '@kabmo-labs/kabmo-acp/session-core/acp-plan-state.server';
|
|
34
34
|
import { isMockMode } from '@kabmo-labs/kabmo-runtime-flags';
|
|
35
35
|
import type { SessionTodosPayload } from '@kabmo-labs/kabmo-app-contracts/todo';
|
|
36
36
|
import type { SessionPlanPayload } from '@kabmo-labs/kabmo-app-contracts/plan';
|
|
@@ -67,11 +67,11 @@ function todosDescriptor(sessionId: string): TopicDescriptor {
|
|
|
67
67
|
const acp = (await loadAcpSessions().catch(() => []))
|
|
68
68
|
.find((entry) => entry.sessionId === sessionId);
|
|
69
69
|
if (acp) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
70
|
+
const snapshot = await loadAcpPlanSnapshot(sessionId);
|
|
71
|
+
if (snapshot) {
|
|
72
72
|
return {
|
|
73
73
|
sessionId,
|
|
74
|
-
...buildAcpTodos(
|
|
74
|
+
...buildAcpTodos(snapshot.entries),
|
|
75
75
|
generatedAt: new Date().toISOString(),
|
|
76
76
|
isMock,
|
|
77
77
|
};
|
|
@@ -123,9 +123,10 @@ function planDescriptor(sessionId: string): TopicDescriptor {
|
|
|
123
123
|
const acp = (await loadAcpSessions().catch(() => []))
|
|
124
124
|
.find((entry) => entry.sessionId === sessionId);
|
|
125
125
|
if (acp && acp.harness !== 'omp-acp') {
|
|
126
|
+
const snapshot = await loadAcpPlanSnapshot(sessionId);
|
|
126
127
|
return {
|
|
127
128
|
sessionId,
|
|
128
|
-
...buildAcpPlanState(
|
|
129
|
+
...buildAcpPlanState(snapshot?.documents ?? []),
|
|
129
130
|
generatedAt: new Date().toISOString(),
|
|
130
131
|
isMock,
|
|
131
132
|
};
|
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
} from '@kabmo-labs/kabmo-acp/session-core/acp-plan-state.server';
|
|
27
27
|
import { claimHarness } from '@kabmo-labs/kabmo-harness/registry';
|
|
28
28
|
import { saveHarnessSession } from '@kabmo-labs/kabmo-harness/session/session-store.server';
|
|
29
|
+
import { AcpFrameRecorder } from '@kabmo-labs/kabmo-acp/session-core/acp-frames.server';
|
|
29
30
|
import type { SessionTodosPayload } from '@kabmo-labs/kabmo-app-contracts/todo';
|
|
30
31
|
import type { SessionPlanPayload } from '@kabmo-labs/kabmo-app-contracts/plan';
|
|
31
32
|
|
|
@@ -101,6 +102,40 @@ describe('ACP Todos topic', () => {
|
|
|
101
102
|
]);
|
|
102
103
|
});
|
|
103
104
|
|
|
105
|
+
test('a pre-snapshot session rebuilds its list from recorded frames', async () => {
|
|
106
|
+
await saveHarnessSession({
|
|
107
|
+
sessionId: 'acp-legacy',
|
|
108
|
+
harness: 'antigravity',
|
|
109
|
+
agentSessionId: '',
|
|
110
|
+
cwd: '/tmp',
|
|
111
|
+
});
|
|
112
|
+
const recorder = new AcpFrameRecorder(() => 'acp-legacy');
|
|
113
|
+
recorder.record('session/update', {
|
|
114
|
+
sessionId: 'acp-legacy',
|
|
115
|
+
update: {
|
|
116
|
+
sessionUpdate: 'tool_call',
|
|
117
|
+
toolCallId: 'steps-1',
|
|
118
|
+
name: 'update_steps',
|
|
119
|
+
status: 'in_progress',
|
|
120
|
+
rawInput: {
|
|
121
|
+
steps: [
|
|
122
|
+
{ title: 'Download kit', status: 'done' },
|
|
123
|
+
{ title: 'Build game', status: 'done' },
|
|
124
|
+
{ title: 'Submit entry', status: 'pending' },
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
await recorder.flush();
|
|
130
|
+
|
|
131
|
+
const payload = await resolveTodos('acp-legacy');
|
|
132
|
+
expect(payload.snapshot?.phases[0]?.tasks).toEqual([
|
|
133
|
+
{ content: 'Download kit', status: 'completed' },
|
|
134
|
+
{ content: 'Build game', status: 'completed' },
|
|
135
|
+
{ content: 'Submit entry', status: 'pending' },
|
|
136
|
+
]);
|
|
137
|
+
});
|
|
138
|
+
|
|
104
139
|
test('a closed ACP session with no snapshot answers empty, not an error', async () => {
|
|
105
140
|
await saveHarnessSession({
|
|
106
141
|
sessionId: 'acp-empty',
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A child outcome becomes the text a `SystemNotice` renders.
|
|
8
|
+
*
|
|
9
|
+
* The first line is load-bearing: it is the only thing a collapsed notice
|
|
10
|
+
* shows, so it must name the worker and the verdict. The rest is Markdown
|
|
11
|
+
* because a completed worker's final message is already Markdown.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, test } from 'bun:test';
|
|
15
|
+
import { renderChildOutcomeNotice } from '@kabmo-labs/kabmo-app-contracts/notice';
|
|
16
|
+
import { childOutcomeMarkdown } from '@/shared/lib/chat/orchestration/outcome-markdown';
|
|
17
|
+
|
|
18
|
+
describe('childOutcomeMarkdown', () => {
|
|
19
|
+
test('a completed worker keeps its report as the body', () => {
|
|
20
|
+
const text = childOutcomeMarkdown(
|
|
21
|
+
renderChildOutcomeNotice([
|
|
22
|
+
{ sessionId: 'c1', title: 'audit-auth', status: 'completed', output: '**Found** two bypasses.' },
|
|
23
|
+
]),
|
|
24
|
+
);
|
|
25
|
+
const [headline] = text.split('\n');
|
|
26
|
+
expect(headline).toBe('audit-auth — Completed');
|
|
27
|
+
expect(text).toContain('**Session** `c1`');
|
|
28
|
+
expect(text).toContain('**Found** two bypasses.');
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
test('a failed worker carries its reason on the collapsed line', () => {
|
|
32
|
+
const text = childOutcomeMarkdown(
|
|
33
|
+
renderChildOutcomeNotice([
|
|
34
|
+
{ sessionId: 'c1', status: 'failed', failure: '400 The model is unavailable.' },
|
|
35
|
+
]),
|
|
36
|
+
);
|
|
37
|
+
expect(text.split('\n')[0]).toBe('c1 — Failed: 400 The model is unavailable.');
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
test('a coalesced batch reports the count and each worker', () => {
|
|
41
|
+
const text = childOutcomeMarkdown(
|
|
42
|
+
renderChildOutcomeNotice([
|
|
43
|
+
{ sessionId: 'c1', title: 'audit-auth', status: 'completed', output: 'done' },
|
|
44
|
+
{ sessionId: 'c2', title: 'write-tests', status: 'failed', failure: 'quota' },
|
|
45
|
+
]),
|
|
46
|
+
);
|
|
47
|
+
const lines = text.split('\n');
|
|
48
|
+
expect(lines[0]).toBe('2 workers · 1 failed');
|
|
49
|
+
expect(text).toContain('### audit-auth — Completed');
|
|
50
|
+
expect(text).toContain('### write-tests — Failed: quota');
|
|
51
|
+
expect(text).toContain('---');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('an empty body is not rendered as a blank card', () => {
|
|
55
|
+
expect(childOutcomeMarkdown('')).toBe('No outcome recorded.');
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A child-outcome notice as Markdown for the timeline's system-notice card.
|
|
8
|
+
*
|
|
9
|
+
* The outcome travels as an envelope because the server has no other channel
|
|
10
|
+
* into a coordinator's transcript; the client used to draw it as its own card
|
|
11
|
+
* with one box per worker. The operator asked for one system notice instead, so
|
|
12
|
+
* this module turns the entries back into the text that card renders: a first
|
|
13
|
+
* line that survives in the collapsed header, and a Markdown body for the
|
|
14
|
+
* report itself (a worker's final message is already Markdown).
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
parseChildOutcomeNotice,
|
|
19
|
+
type ChildOutcomeEntry,
|
|
20
|
+
} from '@kabmo-labs/kabmo-app-contracts/notice';
|
|
21
|
+
|
|
22
|
+
const STATUS_LABEL: Record<ChildOutcomeEntry['status'], string> = {
|
|
23
|
+
completed: 'Completed',
|
|
24
|
+
failed: 'Failed',
|
|
25
|
+
interrupted: 'Interrupted',
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** The collapsed line answers "which worker, and did it work" without a click;
|
|
29
|
+
* a failure carries its reason because "failed" alone makes the reader open
|
|
30
|
+
* the card to learn whether it matters. */
|
|
31
|
+
function headlineOf(entry: ChildOutcomeEntry): string {
|
|
32
|
+
const name = entry.title?.trim() || entry.sessionId;
|
|
33
|
+
if (entry.status === 'completed') return `${name} — ${STATUS_LABEL.completed}`;
|
|
34
|
+
const reason = entry.failure?.trim() || (entry.status === 'interrupted' ? 'The run was interrupted.' : 'No reason given.');
|
|
35
|
+
return `${name} — ${STATUS_LABEL[entry.status]}: ${reason}`;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function detailOf(entry: ChildOutcomeEntry): string {
|
|
39
|
+
if (entry.status === 'completed') return entry.output?.trim() || 'No final output was recorded.';
|
|
40
|
+
return entry.failure?.trim() || 'The worker gave no reason.';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The notice text `SystemNotice` renders: first line is its subtitle, the rest
|
|
44
|
+
* is Markdown shown when the card opens. */
|
|
45
|
+
export function childOutcomeMarkdown(body: string): string {
|
|
46
|
+
const entries = parseChildOutcomeNotice(body);
|
|
47
|
+
if (entries.length === 0) return 'No outcome recorded.';
|
|
48
|
+
|
|
49
|
+
if (entries.length === 1) {
|
|
50
|
+
const entry = entries[0] as ChildOutcomeEntry;
|
|
51
|
+
return [
|
|
52
|
+
headlineOf(entry),
|
|
53
|
+
'',
|
|
54
|
+
`**Session** \`${entry.sessionId}\``,
|
|
55
|
+
'',
|
|
56
|
+
detailOf(entry),
|
|
57
|
+
].join('\n');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const failed = entries.filter((entry) => entry.status !== 'completed').length;
|
|
61
|
+
const summary = failed > 0
|
|
62
|
+
? `${entries.length} workers · ${failed} failed`
|
|
63
|
+
: `${entries.length} workers`;
|
|
64
|
+
const sections = entries.map((entry) =>
|
|
65
|
+
[
|
|
66
|
+
`### ${headlineOf(entry)}`,
|
|
67
|
+
'',
|
|
68
|
+
`**Session** \`${entry.sessionId}\``,
|
|
69
|
+
'',
|
|
70
|
+
detailOf(entry),
|
|
71
|
+
].join('\n'),
|
|
72
|
+
);
|
|
73
|
+
return [summary, '', sections.join('\n\n---\n\n')].join('\n');
|
|
74
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{kg}from"./index-ssepzdaz.js";import"./index-jnxmvxb8.js";import"./index-t71k3b28.js";export{kg as MergeDiffView};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Rg}from"./index-wnk9k57k.js";export{Rg as createArchitectureServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{wt}from"./index-mpyd7qxj.js";export{wt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_g}from"./index-wnk9k57k.js";export{_g as createCynefinServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Lg}from"./index-wnk9k57k.js";export{Lg as createEventModelingServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"./index-xfyxmaj1.js";import"./index-qkcmspxq.js";import{fb}from"./index-f31c6jg8.js";export{fb as diagram};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Sg}from"./index-wnk9k57k.js";export{Sg as createGitGraphServices};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{eA}from"./index-5tp3emtg.js";import"./index-3m1dksmy.js";import"./index-fhtnvqgf.js";import"./index-q0k1am0g.js";import"./index-ewryzs4g.js";export{eA as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Wn}from"./index-dqf0srrp.js";import"./index-q0k1am0g.js";import"./index-mpyd7qxj.js";export{Wn as default};
|