@kabmo-labs/kabmo 0.43.0 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +614 -605
- package/dist/client/static/js/{CsvGrid-3fr85032.js → CsvGrid-1t2q46rg.js} +2 -2
- package/dist/client/static/js/{DocxView-pqbp2fpd.js → DocxView-301hxnwk.js} +4 -4
- package/dist/client/static/js/{DrawioView-m0vecq1m.js → DrawioView-47bwea5t.js} +2 -2
- package/dist/client/static/js/ImageView-68zdx5ex.js +1 -0
- package/dist/client/static/js/LayoutWrapper-vw54s8ra.js +2 -0
- package/dist/client/static/js/{Modal-vnwg4xn3.js → Modal-fb9b4gq6.js} +18 -18
- package/dist/client/static/js/{PdfView-wmg0vk2p.js → PdfView-m64ksepp.js} +1 -1
- package/dist/client/static/js/SessionsView-zyjwhpzm.js +1 -0
- package/dist/client/static/js/{SheetView-rg5gkcd7.js → SheetView-e88sqprx.js} +13 -13
- package/dist/client/static/js/{SvgPreview-wpb7b0ez.js → SvgPreview-hs9a713t.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-4pxqt66j.js → abnfDiagram-O67JEVCF-fnr5kyqk.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-mq93vqx9.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-kwt1va5y.js → architectureDiagram-NJMV4G6O-7v003363.js} +11 -11
- package/dist/client/static/js/{astro-dpfdhc5e.js → astro-t9vjc0mc.js} +1 -1
- package/dist/client/static/js/bash-fjzhxy10.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-hbj5v7n7.js → blockDiagram-BEXU5L5S-k4mwbw3d.js} +5 -5
- package/dist/client/static/js/c-y1y6v00q.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-epfzh8dw.js → c4Diagram-YGBWAQC7-688zq6f4.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-kbks4qgz.js → classDiagram-v2-NBCMYWYE-h0s16pxr.js} +5 -5
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-dvdmckrf.js → cose-bilkent-JH36ORCC-qb2t8qq5.js} +1 -1
- package/dist/client/static/js/cpp-9f6zkdd4.js +1 -0
- package/dist/client/static/js/css-g85rwzty.js +1 -0
- package/dist/client/static/js/css-y4y3qtsb.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-qyg5rjr5.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-r084stj5.js → cynefinDiagram-VND7K2PF-syhtcr7b.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-64qc51n1.js → dagre-6A5THRUB-7wgbx6cm.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-70qtb1rm.js → diagram-22UHCM2B-951cmp5h.js} +21 -21
- package/dist/client/static/js/{diagram-3UASUU5V-dgkvnsme.js → diagram-3UASUU5V-mvdbqt7b.js} +2 -2
- package/dist/client/static/js/{diagram-ATOU4E4O-rnpsp26v.js → diagram-ATOU4E4O-hkvdtgdm.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-26hthh60.js → diagram-CDSNMT55-bkkz35ca.js} +4 -4
- package/dist/client/static/js/{diagram-MLGK6HIB-nc1s85r5.js → diagram-MLGK6HIB-z6pcrkc3.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-e4dckqhv.js → diagram-MPIPVDR6-mkwf8j4m.js} +1 -1
- package/dist/client/static/js/{dockerfile-rxtyyhr1.js → dockerfile-7gd570bm.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3w9h8qk7.js → ebnfDiagram-ZINNZB2B-trym26ts.js} +1 -1
- package/dist/client/static/js/{elixir-5ewfhvfh.js → elixir-z77c7tfn.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-httpkyb1.js → elk-276RUBZZ-gkhz67v6.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-3qhvf7se.js → erDiagram-OPXOYQCR-gkyr5cqs.js} +7 -7
- package/dist/client/static/js/{erlang-jqqa3ehb.js → erlang-6vrvh2m6.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-15yz245z.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-n1sapfye.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-t53m50e5.js → ganttDiagram-FUAMR5RP-1qpme6ks.js} +4 -4
- package/dist/client/static/js/gitGraph-4MIJSDKK-xtjwv160.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-b5wn9eht.js → gitGraphDiagram-X574FWY7-wbg3kqak.js} +10 -10
- package/dist/client/static/js/graphql-amk52c95.js +1 -0
- package/dist/client/static/js/html-2y935m7r.js +1 -0
- package/dist/client/static/js/index-07yh7qx0.js +1 -0
- package/dist/client/static/js/{index-kccp6tgd.js → index-1923aj4g.js} +2 -2
- package/dist/client/static/js/{index-kmzd0adv.js → index-19ffgf9a.js} +1 -1
- package/dist/client/static/js/index-204ae4vs.js +2 -0
- package/dist/client/static/js/{index-cqnpsw2m.js → index-22whvfdw.js} +2 -2
- package/dist/client/static/js/{index-dg3b0mfk.js → index-232nsp2c.js} +2 -2
- package/dist/client/static/js/{index-fgyenbv8.js → index-31hntzse.js} +5 -5
- package/dist/client/static/js/{index-7zc1z9z9.js → index-3w845q50.js} +4 -4
- package/dist/client/static/js/{index-gmnmnfm0.js → index-4y4hshcx.js} +2 -2
- package/dist/client/static/js/index-53ysgsd2.js +1 -0
- package/dist/client/static/js/{index-g4rsmakg.js → index-62ng8tkj.js} +3 -3
- package/dist/client/static/js/{index-4banz7gr.js → index-6ah5sj5y.js} +1 -1
- package/dist/client/static/js/{index-tzbzehqd.js → index-6gyk52ff.js} +2 -2
- package/dist/client/static/js/{index-m9s9rg5k.js → index-6s4mrdew.js} +2 -2
- package/dist/client/static/js/index-6t21c6jt.js +2 -0
- package/dist/client/static/js/{index-7dp90ad1.js → index-83pwa9c0.js} +2 -2
- package/dist/client/static/js/{index-f4fqvct6.js → index-8trggh1z.js} +15 -15
- package/dist/client/static/js/{index-ys0xpw3q.js → index-92n96mgd.js} +2 -2
- package/dist/client/static/js/index-ad4x44d6.js +9 -0
- package/dist/client/static/js/{index-s78n0dtv.js → index-as1wptfa.js} +2 -2
- package/dist/client/static/js/{index-j17h4z6f.js → index-barbpakv.js} +2 -2
- package/dist/client/static/js/index-bjqz7swa.js +1 -0
- package/dist/client/static/js/{index-yvgbr7ek.js → index-c3v62nvt.js} +2 -2
- package/dist/client/static/js/{index-zqthmaxq.js → index-cq98p2rb.js} +200 -199
- package/dist/client/static/js/{index-q1gwgmxt.js → index-czedkbmb.js} +2 -2
- package/dist/client/static/js/{index-sesghshh.js → index-dmv2zasz.js} +2 -2
- package/dist/client/static/js/{index-ycks7gyg.js → index-e6rm5xzj.js} +2 -2
- package/dist/client/static/js/{index-2q23dwrs.js → index-ehacfgwm.js} +2 -2
- package/dist/client/static/js/{index-q81rxwh7.js → index-fbpc1wx6.js} +41 -41
- package/dist/client/static/js/{index-qhytrsyb.js → index-fj4k07zt.js} +2 -2
- package/dist/client/static/js/{index-jz93j0at.js → index-gtkhz0hj.js} +2 -2
- package/dist/client/static/js/{index-181p91hf.js → index-hfsvwfgw.js} +2 -2
- package/dist/client/static/js/{index-sk9ej289.js → index-jaqjvk22.js} +2 -2
- package/dist/client/static/js/{index-e7yf273s.js → index-jbkkwa2q.js} +2 -2
- package/dist/client/static/js/{index-38v0781h.js → index-ks23y2cd.js} +2 -2
- package/dist/client/static/js/{index-7z9tz4ze.js → index-kwpaz891.js} +2 -2
- package/dist/client/static/js/{index-0c6vpk89.js → index-n0matkz9.js} +2 -2
- package/dist/client/static/js/index-n6fbd265.js +1 -0
- package/dist/client/static/js/{index-rv4qs3wm.js → index-nqjd3hh5.js} +2 -2
- package/dist/client/static/js/{index-ynaxep06.js → index-nr8s5xm9.js} +2 -2
- package/dist/client/static/js/index-nvevymac.js +2 -0
- package/dist/client/static/js/index-pxm44qfd.js +1 -0
- package/dist/client/static/js/{index-fg965t62.js → index-pysqpc5n.js} +2 -2
- package/dist/client/static/js/index-qf9x7yet.js +1 -0
- package/dist/client/static/js/{index-dkqgmacr.js → index-qkjx6521.js} +4 -4
- package/dist/client/static/js/index-qm92sf9w.js +12 -0
- package/dist/client/static/js/{index-fjnkzk12.js → index-qsw5edtk.js} +5 -5
- package/dist/client/static/js/index-rpzxrr2d.js +1 -0
- package/dist/client/static/js/index-s8bktzpg.js +1 -0
- package/dist/client/static/js/index-sc7r305t.css +1 -0
- package/dist/client/static/js/{index-vmgzhp41.js → index-svmzgtcx.js} +2 -2
- package/dist/client/static/js/{index-k9ws464d.js → index-tr2pkfs6.js} +2 -2
- package/dist/client/static/js/{index-bvjct7sp.js → index-tzdm1y3z.js} +2 -2
- package/dist/client/static/js/{index-r11bbnek.js → index-v5npdwy2.js} +65 -65
- package/dist/client/static/js/{index-wmv3crye.js → index-v7bcgh77.js} +2 -2
- package/dist/client/static/js/index-wytdbvax.js +3 -0
- package/dist/client/static/js/{index-n9scbxy5.js → index-yfjvx4yf.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-e31s2xvj.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-qv7438m3.js → infoDiagram-VRGFBTTK-yebngg8c.js} +1 -1
- package/dist/client/static/js/ini-kemnmt16.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-p1w6zg5y.js → ishikawaDiagram-OU5B5YK6-kh4nqj6q.js} +3 -3
- package/dist/client/static/js/java-caqpfm88.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-ywk6xqxr.js → journeyDiagram-ZHPQQLJL-4khnf8x1.js} +5 -5
- package/dist/client/static/js/json-qn73s8xb.js +1 -0
- package/dist/client/static/js/jsx-bvterpm5.js +1 -0
- package/dist/client/static/js/{julia-0h9krgsd.js → julia-svwxx41e.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-gtrmhggc.js → kanban-definition-PNTS6WVX-snmq3wq4.js} +4 -4
- package/dist/client/static/js/lua-1hcfm8ya.js +1 -0
- package/dist/client/static/js/markdown-n6na4ykv.js +1 -0
- package/dist/client/static/js/{mermaid.core-5s24b4hh.js → mermaid.core-yctw30sk.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-3wx7abqn.js → mindmap-definition-NLK3R4M7-atfv66wq.js} +3 -3
- package/dist/client/static/js/one-dark-pro-c1vnxka7.js +1 -0
- package/dist/client/static/js/one-light-mbxx52p5.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-mtzmsrk4.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-yvyqnjya.js → pegDiagram-GJSIUBJH-hpbtxjht.js} +1 -1
- package/dist/client/static/js/{perl-rptyx23q.js → perl-mr0ds2ex.js} +1 -1
- package/dist/client/static/js/{php-sagvq3wz.js → php-5h3wt6tv.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-85nwadmj.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-26x6pj38.js → pieDiagram-5QR66LMP-9zrtkdr2.js} +2 -2
- package/dist/client/static/js/properties-nxcks67c.js +1 -0
- package/dist/client/static/js/python-58p0gqn0.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-qhe8h0j9.js → quadrantDiagram-O4NWA36T-xq970vx1.js} +6 -6
- package/dist/client/static/js/r-eyn8en0g.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-ae3jdajx.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-3m0s7cse.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-pz22c3eb.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-cgqgqq15.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-ts0nmcxb.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-dwy3k2jx.js → railroadDiagram-XR7U4H2S-1g9jchbk.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-hcmgfesg.js → requirementDiagram-PLB6GJNP-ntt088y4.js} +4 -4
- package/dist/client/static/js/{ruby-9qyx7knh.js → ruby-nn836rtq.js} +1 -1
- package/dist/client/static/js/{rust-bmb4ee5w.js → rust-eygk56y5.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-s6d3k4zs.js → sankeyDiagram-IPEJSGJF-95k8c5v6.js} +5 -5
- package/dist/client/static/js/{sass-07rteya0.js → sass-c2bk03e4.js} +1 -1
- package/dist/client/static/js/{scss-e2dndbfa.js → scss-qycakpjn.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-0fcmzgdy.js → sequenceDiagram-PO4LG4MO-qfvxrwfa.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-t8fcm7rq.js → sizeCapture-INFHLROL-0m7dc5nd.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-jr80hfeg.js → stateDiagram-v2-GCMORJYK-femwcn7n.js} +5 -5
- package/dist/client/static/js/{svelte-w365cpwa.js → svelte-bfy1rq5g.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-x1ay6w39.js → swimlanes-2SLR337P-5n1qq48r.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-n85hawg8.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-qz0g6msb.js → timeline-definition-EJHVYXUP-vdsj18be.js} +7 -7
- package/dist/client/static/js/treeView-Q6P3EWNA-fvpt3hm8.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-4z9s24je.js +1 -0
- package/dist/client/static/js/tsx-fnzxsv25.js +1 -0
- package/dist/client/static/js/typescript-0ppbqrb6.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-sxzrv8ht.js → usecaseDiagram-POWQR4AR-psjbrprk.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-qsqgnjcv.js → vennDiagram-UO4OBE2U-4yn9kac9.js} +7 -7
- package/dist/client/static/js/{vue-d6cesny1.js → vue-0fwtgwj4.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-73mrhkmy.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-rvwxn458.js → wardleyDiagram-VNRHLVJA-js0tbpca.js} +3 -3
- package/dist/client/static/js/xml-v1ytr8qz.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-nb4w7rcg.js → xychartDiagram-PMCCYNJV-svr38ygh.js} +5 -5
- package/dist/client/static/js/yaml-txrqz62t.js +1 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/proc/identity.ts +4 -3
- package/package.json +2 -2
- package/src/client/App.tsx +1 -1
- package/src/client/borders.css +143 -0
- package/src/client/components/common/context-usage-button/Ring.tsx +34 -9
- package/src/client/components/common/context-usage-button/index.test.tsx +19 -2
- package/src/client/components/common/context-usage-button/index.tsx +4 -4
- package/src/client/components/common/header-controls/index.test.tsx +26 -59
- package/src/client/components/common/header-controls/index.tsx +41 -52
- package/src/client/components/common/header-controls/phone-row.test.tsx +265 -0
- package/src/client/components/common/header-controls/plugin-entry.test.tsx +25 -3
- package/src/client/components/common/header-controls/shell-chrome.test.tsx +2 -2
- package/src/client/components/layout/LeftDock.tsx +7 -0
- package/src/client/components/layout/desktop-layout/DesktopOverlays.tsx +51 -0
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +117 -15
- package/src/client/components/layout/desktop-layout/RightColumn.tsx +257 -0
- package/src/client/components/layout/desktop-layout/TopNavbar.tsx +23 -24
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +50 -78
- package/src/client/components/layout/desktop-layout/index.tsx +73 -73
- package/src/client/components/layout/session-sidebar/Footer.test.tsx +20 -0
- package/src/client/components/layout/session-sidebar/Footer.tsx +24 -2
- package/src/client/components/layout/session-sidebar/Header.test.ts +10 -0
- package/src/client/components/layout/session-sidebar/Header.tsx +2 -2
- package/src/client/components/mobile/mobile-main-view/Header.test.tsx +2 -3
- package/src/client/components/mobile/mobile-main-view/Header.tsx +12 -10
- package/src/client/components/settings/Modal.tsx +14 -9
- package/src/client/components/settings/ProjectSelectorDropdown.tsx +18 -6
- package/src/client/components/settings/SettingsSidebarList.tsx +2 -1
- package/src/client/components/settings/Sidebar.tsx +6 -4
- package/src/client/components/settings/apply-side-effects.test.ts +17 -0
- package/src/client/components/settings/apply-side-effects.ts +26 -5
- package/src/client/components/settings/band-height.test.tsx +122 -0
- package/src/client/components/settings/categories/AppearanceSettings.test.tsx +144 -0
- package/src/client/components/settings/categories/AppearanceSettings.tsx +81 -39
- package/src/client/components/settings/categories/ChatSettings.tsx +9 -15
- package/src/client/components/settings/categories/UsageSettings.tsx +2 -1
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.test.tsx +101 -0
- package/src/client/components/settings/categories/appearance-settings/BorderStyleSection.tsx +134 -0
- package/src/client/components/settings/categories/appearance-settings/EditorBlameSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorFontSection.tsx +5 -5
- package/src/client/components/settings/categories/appearance-settings/EditorIndentSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +6 -6
- package/src/client/components/settings/categories/appearance-settings/EditorTypingSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/IconStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/PanelNavSection.tsx +167 -0
- package/src/client/components/settings/categories/appearance-settings/SidebarStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/SurfaceStyleSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeSection.tsx +42 -0
- package/src/client/components/settings/categories/appearance-settings/TrayIconSection.tsx +2 -2
- package/src/client/components/settings/categories/appearance-settings/groups.test.ts +47 -0
- package/src/client/components/settings/categories/appearance-settings/groups.ts +95 -0
- package/src/client/components/settings/categories/chat-settings/LayoutSection.tsx +31 -14
- package/src/client/components/settings/categories/mcp-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/project-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/provider-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/categories/usage-settings/SidebarList.tsx +2 -1
- package/src/client/components/settings/master-detail/GroupDetail.tsx +38 -0
- package/src/client/components/settings/{categories/chat-settings/SidebarList.tsx → master-detail/GroupSidebar.tsx} +35 -12
- package/src/client/components/settings/master-detail/index.tsx +3 -1
- package/src/client/components/settings/pane-header.ts +25 -0
- package/src/client/components/workspace/browser-toolbar/index.test.tsx +39 -1
- package/src/client/components/workspace/browser-toolbar/index.tsx +53 -17
- package/src/client/components/workspace/chat-timeline/ColumnResizeHandle.tsx +107 -0
- package/src/client/components/workspace/chat-timeline/ComposerDockFrame.tsx +9 -3
- package/src/client/components/workspace/chat-timeline/EmptyWorkspacePrompt.tsx +35 -26
- package/src/client/components/workspace/chat-timeline/TimelineBody.tsx +6 -0
- package/src/client/components/workspace/chat-timeline/column-resize.test.tsx +292 -0
- package/src/client/components/workspace/chat-timeline/composer-dock-frame.test.tsx +5 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/extension-dialog/index.tsx +21 -9
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +18 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +47 -0
- package/src/client/components/workspace/context-panel/index.tsx +10 -4
- package/src/client/components/workspace/editor/EditorHideButton.tsx +41 -0
- package/src/client/components/workspace/editor/EmptyEditor.tsx +11 -2
- package/src/client/components/workspace/editor/PluginColumn.tsx +11 -1
- package/src/client/components/workspace/editor/Tabs.tsx +8 -0
- package/src/client/components/workspace/editor/editor-hide-button.test.ts +144 -0
- package/src/client/components/workspace/editor/index.tsx +8 -2
- package/src/client/components/workspace/editor/props.ts +9 -0
- package/src/client/components/workspace/file-explorer/RowLabel.test.tsx +90 -0
- package/src/client/components/workspace/file-explorer/RowLabel.tsx +1 -4
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.test.ts +52 -46
- package/src/client/components/workspace/git-panel/commit-modal/CommitRow.tsx +41 -21
- package/src/client/components/workspace/git-panel/commit-modal/GraphCanvas.tsx +6 -5
- package/src/client/components/workspace/git-panel/commit-modal/index.tsx +19 -22
- package/src/client/components/workspace/panel-header/title-policy.test.tsx +62 -0
- package/src/client/components/workspace/panel-header/title-policy.tsx +83 -0
- package/src/client/components/workspace/panel-tabs/Home.density.test.tsx +122 -0
- package/src/client/components/workspace/panel-tabs/Home.test.tsx +137 -0
- package/src/client/components/workspace/panel-tabs/Home.tsx +106 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.test.tsx +221 -0
- package/src/client/components/workspace/panel-tabs/TabStrip.tsx +315 -0
- package/src/client/components/workspace/panel-tabs/index.tsx +97 -0
- package/src/client/components/workspace/panels/builtin.tsx +9 -0
- package/src/client/components/workspace/plan-panel/index.tsx +7 -2
- package/src/client/components/workspace/repo-picker/Modal.tsx +1 -1
- package/src/client/components/workspace/repo-picker/index.test.tsx +32 -8
- package/src/client/components/workspace/repo-picker/index.tsx +2 -2
- package/src/client/components/workspace/search-panel/Body.tsx +7 -1
- package/src/client/components/workspace/search-panel/index.tsx +2 -1
- package/src/client/components/workspace/terminal-panel/Header.tsx +10 -3
- package/src/client/components/workspace/terminal-panel/index.tsx +4 -1
- package/src/client/components/workspace/todo-panel/index.tsx +6 -1
- package/src/client/components/workspace/usage-panel/index.tsx +7 -2
- package/src/client/components/workspace/user-browser-panel/AddressBar.tsx +43 -4
- package/src/client/components/workspace/user-browser-panel/Frame.tsx +101 -45
- package/src/client/components/workspace/user-browser-panel/TabStrip.tsx +107 -0
- package/src/client/components/workspace/user-browser-panel/index.tsx +31 -6
- package/src/client/glass.test.ts +1 -1
- package/src/client/hooks/browser/use-annotate.ts +6 -5
- package/src/client/hooks/browser/use-user-browser.test.tsx +279 -0
- package/src/client/hooks/browser/use-user-browser.ts +190 -44
- package/src/client/hooks/chat/omp/index.ts +2 -6
- package/src/client/hooks/chat/timeline/column-drag.ts +171 -0
- package/src/client/hooks/chat/timeline/width-mode.test.ts +112 -11
- package/src/client/hooks/chat/timeline/width-mode.ts +91 -18
- package/src/client/hooks/ui/border-style.test.ts +172 -0
- package/src/client/hooks/ui/border-style.ts +60 -0
- package/src/client/hooks/ui/navbar-controls.test.ts +27 -1
- package/src/client/hooks/ui/navbar-controls.ts +95 -20
- package/src/client/hooks/ui/style-attributes.test.ts +2 -0
- package/src/client/hooks/workspace/active-project.ts +46 -0
- package/src/client/hooks/workspace/commit-expansion.test.ts +135 -0
- package/src/client/hooks/workspace/commit-expansion.ts +56 -0
- package/src/client/hooks/workspace/panel-nav.test.ts +102 -0
- package/src/client/hooks/workspace/panel-nav.ts +95 -0
- package/src/client/hooks/workspace/panel-tabs.session.test.tsx +235 -0
- package/src/client/hooks/workspace/panel-tabs.ts +194 -0
- package/src/client/hooks/workspace/right-open-request.ts +53 -0
- package/src/client/hooks/workspace/right-side.test.ts +204 -0
- package/src/client/hooks/workspace/right-side.ts +142 -0
- package/src/client/main.tsx +9 -4
- package/src/client/tailwind.css +6 -0
- package/src/server/lib/assets/shell-attributes.server.ts +26 -10
- package/src/server/lib/assets/shell-attributes.test.ts +26 -0
- package/src/server/lib/changes/capture-client-write.server.ts +45 -0
- package/src/server/lib/changes/capture.server.ts +20 -5
- package/src/server/lib/db/schema.ts +3 -0
- package/src/server/lib/harness/acp/auth.test.ts +69 -0
- package/src/server/lib/harness/acp/auth.ts +71 -0
- package/src/server/lib/harness/acp/background-replay.test.ts +154 -0
- package/src/server/lib/harness/acp/background-replay.ts +92 -0
- package/src/server/lib/harness/acp/background-work.ts +80 -50
- package/src/server/lib/harness/acp/calls.test.ts +68 -0
- package/src/server/lib/harness/acp/calls.ts +13 -0
- package/src/server/lib/harness/acp/client-capabilities.ts +5 -2
- package/src/server/lib/harness/acp/client-fs.test.ts +13 -0
- package/src/server/lib/harness/acp/client-fs.ts +16 -2
- package/src/server/lib/harness/acp/client.ts +22 -23
- package/src/server/lib/harness/acp/commands.test.ts +19 -0
- package/src/server/lib/harness/acp/commands.ts +26 -8
- package/src/server/lib/harness/acp/frames.ts +16 -1
- package/src/server/lib/harness/acp/grants.server.ts +75 -0
- package/src/server/lib/harness/acp/grants.test.ts +65 -0
- package/src/server/lib/harness/acp/grants.ts +79 -0
- package/src/server/lib/harness/acp/permissions.test.ts +9 -0
- package/src/server/lib/harness/acp/permissions.ts +56 -36
- package/src/server/lib/harness/acp/prompt-files.test.ts +69 -0
- package/src/server/lib/harness/acp/prompt-files.ts +58 -0
- package/src/server/lib/harness/acp/prompt.ts +50 -11
- package/src/server/lib/harness/acp/protocol.ts +20 -1
- package/src/server/lib/harness/acp/session-approvals.ts +45 -0
- package/src/server/lib/harness/acp/session-config-view.ts +81 -0
- package/src/server/lib/harness/acp/session-config.ts +48 -9
- package/src/server/lib/harness/acp/session-handshake.test.ts +71 -2
- package/src/server/lib/harness/acp/session-handshake.ts +128 -53
- package/src/server/lib/harness/acp/session-intake.test.ts +93 -0
- package/src/server/lib/harness/acp/session-intake.ts +75 -0
- package/src/server/lib/harness/acp/session-lifecycle.ts +50 -0
- package/src/server/lib/harness/acp/session-lost.test.ts +44 -0
- package/src/server/lib/harness/acp/session-lost.ts +34 -0
- package/src/server/lib/harness/acp/session-notify.ts +47 -0
- package/src/server/lib/harness/acp/session-observers.test.ts +4 -4
- package/src/server/lib/harness/acp/session-permissions.test.ts +64 -0
- package/src/server/lib/harness/acp/session-permissions.ts +9 -4
- package/src/server/lib/harness/acp/session-requests.ts +6 -0
- package/src/server/lib/harness/acp/session-roots.server.ts +47 -0
- package/src/server/lib/harness/acp/session-roots.test.ts +31 -0
- package/src/server/lib/harness/acp/session-start.ts +7 -0
- package/src/server/lib/harness/acp/session-turns.ts +15 -3
- package/src/server/lib/harness/acp/session-wiring.test.ts +53 -0
- package/src/server/lib/harness/acp/session-wiring.ts +109 -0
- package/src/server/lib/harness/acp/session.test-util.ts +34 -2
- package/src/server/lib/harness/acp/session.test.ts +10 -10
- package/src/server/lib/harness/acp/session.ts +146 -144
- package/src/server/lib/harness/acp/tool-calls.ts +27 -15
- package/src/server/lib/harness/acp/tool-identity.test.ts +136 -0
- package/src/server/lib/harness/acp/tool-identity.ts +121 -0
- package/src/server/lib/harness/acp/turn-cancel.test.ts +79 -0
- package/src/server/lib/harness/acp/turn-cancel.ts +61 -0
- package/src/server/lib/harness/acp/turn-dispatch.test.ts +103 -0
- package/src/server/lib/harness/acp/turn-dispatch.ts +61 -0
- package/src/server/lib/harness/acp/turn-queue.ts +43 -0
- package/src/server/lib/harness/acp/turn-verdict.ts +102 -0
- package/src/server/lib/harness/acp/turn.ts +86 -88
- package/src/server/lib/harness/acp/v2.test.ts +9 -0
- package/src/server/lib/harness/acp/v2.ts +13 -0
- package/src/server/lib/harness/acp/verbs.ts +35 -4
- package/src/server/lib/harness/session-lease.server.ts +3 -2
- package/src/server/lib/omp/session/delete.server.ts +3 -0
- package/src/server/lib/omp/session/lease-probe.server.test.ts +82 -0
- package/src/server/lib/omp/session/lease-probe.server.ts +180 -0
- package/src/server/lib/omp/session/ownership.server.test.ts +17 -6
- package/src/server/lib/omp/session/ownership.server.ts +7 -5
- package/src/server/plugins/ssr.ts +6 -3
- package/src/shared/lib/browser/user-tabs.test.ts +165 -0
- package/src/shared/lib/browser/user-tabs.ts +172 -0
- package/src/shared/lib/chat/timeline/width-mode.test.ts +34 -2
- package/src/shared/lib/chat/timeline/width-mode.ts +71 -22
- package/src/shared/lib/commands/catalog.ts +2 -2
- package/src/shared/lib/fs/git-status.test.ts +23 -0
- package/src/shared/lib/fs/git-status.ts +15 -0
- package/src/shared/lib/icons/tint-hues.generated.ts +20 -20
- package/src/shared/lib/settings/defaults.ts +7 -1
- package/src/shared/lib/theme/border-style.test.ts +83 -0
- package/src/shared/lib/theme/border-style.ts +122 -0
- package/src/shared/lib/workspace/keymap.ts +2 -1
- package/src/shared/lib/workspace/panel-nav.test.ts +162 -0
- package/src/shared/lib/workspace/panel-nav.ts +105 -0
- package/src/shared/lib/workspace/panel-tabs-close.test.ts +154 -0
- package/src/shared/lib/workspace/panel-tabs.ts +105 -0
- package/src/shared/lib/workspace/session-state/cache.ts +22 -0
- package/src/shared/lib/workspace/session-state/merge.ts +6 -0
- package/src/shared/lib/workspace/session-state/store.ts +23 -0
- package/src/shared/types/omp/agent.ts +14 -5
- package/src/shared/types/settings/state.ts +50 -3
- package/src/test-support/header-controls-harness.ts +22 -0
- package/src/test-support/peer-harness.ts +2 -2
- package/dist/client/static/js/ImageView-rbejbjwg.js +0 -1
- package/dist/client/static/js/LayoutWrapper-mxfsqh57.js +0 -2
- package/dist/client/static/js/SessionsView-90z2t4qe.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +0 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +0 -1
- package/dist/client/static/js/c-8jf64j6h.js +0 -1
- package/dist/client/static/js/cpp-vh94zee0.js +0 -1
- package/dist/client/static/js/css-a13jmmnc.js +0 -1
- package/dist/client/static/js/css-p57h1fme.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-1jat076e.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +0 -1
- package/dist/client/static/js/graphql-kesh8gk0.js +0 -1
- package/dist/client/static/js/html-sxpfydga.js +0 -1
- package/dist/client/static/js/index-1dwdgp27.js +0 -1
- package/dist/client/static/js/index-8y51kgan.js +0 -3
- package/dist/client/static/js/index-axszsg7a.js +0 -1
- package/dist/client/static/js/index-d8r84zjd.js +0 -12
- package/dist/client/static/js/index-egd0vfey.js +0 -1
- package/dist/client/static/js/index-enb6chty.js +0 -1
- package/dist/client/static/js/index-g3a9j9hf.js +0 -1
- package/dist/client/static/js/index-gwqb7m8g.js +0 -1
- package/dist/client/static/js/index-j60gtvw8.js +0 -1
- package/dist/client/static/js/index-jvs2fvqz.js +0 -2
- package/dist/client/static/js/index-kc3c2gzb.js +0 -1
- package/dist/client/static/js/index-ksph3kpr.js +0 -2
- package/dist/client/static/js/index-qzw4jnnv.js +0 -1
- package/dist/client/static/js/index-tnv3dryk.js +0 -9
- package/dist/client/static/js/index-vcrh95gf.css +0 -1
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +0 -1
- package/dist/client/static/js/ini-1x0ad976.js +0 -1
- package/dist/client/static/js/java-3944nq02.js +0 -1
- package/dist/client/static/js/json-g5ggnd94.js +0 -1
- package/dist/client/static/js/jsx-f6p72qpc.js +0 -1
- package/dist/client/static/js/lua-edn2b3wn.js +0 -1
- package/dist/client/static/js/markdown-9dhg1fax.js +0 -1
- package/dist/client/static/js/one-dark-pro-3vya9z02.js +0 -1
- package/dist/client/static/js/one-light-1yrwn9my.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +0 -1
- package/dist/client/static/js/properties-fcmj08pv.js +0 -1
- package/dist/client/static/js/python-532d8ezm.js +0 -1
- package/dist/client/static/js/r-ptmdxs2a.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xj123xrp.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +0 -1
- package/dist/client/static/js/tsx-zfy727zs.js +0 -1
- package/dist/client/static/js/typescript-683kkkaw.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +0 -1
- package/dist/client/static/js/xml-6ct32gys.js +0 -1
- package/dist/client/static/js/yaml-1d5m3bfj.js +0 -1
- package/src/server/lib/omp/session/lease-flock.server.ts +0 -117
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The order one agent notification is routed in.
|
|
8
|
+
*
|
|
9
|
+
* The order IS the rule: the idle clock and the silence ceiling must see every
|
|
10
|
+
* frame (that is the only evidence a turn is alive), `$/cancel_request` must be
|
|
11
|
+
* answered before the frame is folded, a `session/load` replay belongs to the
|
|
12
|
+
* background probe, and the raw panel reads the ORIGINAL payload — so the frame
|
|
13
|
+
* log is fed before the mapper folds it and before the turn gate can drop one.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { handleAcpCancelRequest } from '@/server/lib/harness/acp/session-requests';
|
|
17
|
+
import { handleSessionNotification, type AcpNotificationHost } from '@/server/lib/harness/acp/session-notifications';
|
|
18
|
+
import type { RawNotificationSink } from '@/server/lib/harness/acp/raw-listeners';
|
|
19
|
+
|
|
20
|
+
/** What one routed notification reads. */
|
|
21
|
+
export interface AcpNotifyHost extends AcpNotificationHost {
|
|
22
|
+
readonly rawSink: RawNotificationSink;
|
|
23
|
+
readonly background: { consume(method: string, params: Record<string, unknown>): boolean };
|
|
24
|
+
readonly turns: { noteActivity(): void };
|
|
25
|
+
readonly idle: { reset(): void };
|
|
26
|
+
/** The approval queue, for a withdrawn `$/cancel_request`. */
|
|
27
|
+
respond(id: string | number, result: unknown): void;
|
|
28
|
+
readonly permissions: import('@/server/lib/harness/acp/permissions').PendingPermissions;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function handleAcpNotification(
|
|
32
|
+
host: AcpNotifyHost,
|
|
33
|
+
method: string,
|
|
34
|
+
params: Record<string, unknown>,
|
|
35
|
+
): void {
|
|
36
|
+
// A long turn emits no commands but plenty of `session/update` frames.
|
|
37
|
+
host.idle.reset();
|
|
38
|
+
// The same frames are the only evidence a turn is still alive: ACP has no
|
|
39
|
+
// probe, so the silence ceiling is what bounds a wedged agent.
|
|
40
|
+
host.turns.noteActivity();
|
|
41
|
+
// The agent withdrawing a request it made; the approval it parks is answered.
|
|
42
|
+
if (handleAcpCancelRequest(host, method, params)) return;
|
|
43
|
+
// A `session/load` probe's replay repeats the whole chat; it is the probe's.
|
|
44
|
+
if (host.background.consume(method, params)) return;
|
|
45
|
+
if (method === 'session/update') host.rawSink.emit(method, params);
|
|
46
|
+
handleSessionNotification(host, method, params);
|
|
47
|
+
}
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
18
18
|
import { isolateDb, releaseDb } from '@/test-support/isolated-db';
|
|
19
|
-
import { mountSession, notify } from '@/server/lib/harness/acp/session.test-util';
|
|
19
|
+
import { flushTicks, mountSession, notify } from '@/server/lib/harness/acp/session.test-util';
|
|
20
20
|
import { loadAcpSessions, saveHarnessSession } from '@/server/lib/harness/session-store.server';
|
|
21
21
|
import { onRealtimeSignal } from '@/server/lib/realtime/signals.server';
|
|
22
22
|
|
|
@@ -43,7 +43,7 @@ describe('ACP silent turn', () => {
|
|
|
43
43
|
await turn.started;
|
|
44
44
|
if (say) notify(session, { sessionUpdate: 'agent_message_chunk', content: { type: 'text', text: say } });
|
|
45
45
|
turn.finish({ stopReason: 'end_turn' });
|
|
46
|
-
|
|
46
|
+
await flushTicks();
|
|
47
47
|
return events;
|
|
48
48
|
};
|
|
49
49
|
|
|
@@ -88,7 +88,7 @@ describe('ACP stream marker', () => {
|
|
|
88
88
|
expect(streamMarks()).toEqual(['stream']);
|
|
89
89
|
|
|
90
90
|
turn.finish({ stopReason: 'end_turn' });
|
|
91
|
-
|
|
91
|
+
await flushTicks();
|
|
92
92
|
expect(streamMarks()).toEqual(['stream', 'finish']);
|
|
93
93
|
});
|
|
94
94
|
|
|
@@ -107,7 +107,7 @@ describe('ACP stream marker', () => {
|
|
|
107
107
|
// No answer at all is the ACP silent-turn verdict, and the only reason the
|
|
108
108
|
// notification has to show.
|
|
109
109
|
turn.finish({ stopReason: 'end_turn' });
|
|
110
|
-
|
|
110
|
+
await flushTicks();
|
|
111
111
|
expect(streamMarks()).toEqual(['stream', 'finish']);
|
|
112
112
|
expect(streamMarkFailures()).toEqual([null, 'The agent ended the turn without sending an answer']);
|
|
113
113
|
});
|
|
@@ -104,6 +104,70 @@ describe('ACP permission gating', () => {
|
|
|
104
104
|
});
|
|
105
105
|
});
|
|
106
106
|
|
|
107
|
+
describe('ACP approval options', () => {
|
|
108
|
+
const withOptions = (session: AcpSession, id: number, options: Array<{ optionId: string; kind: string }>, action = 'execute') =>
|
|
109
|
+
(session as unknown as PermissionHost).onClientRequest(id, 'session/request_permission', {
|
|
110
|
+
sessionId: 'acp-1',
|
|
111
|
+
toolCall: { kind: action, title: 'Run the thing', rawInput: { command: 'rm -rf build' } },
|
|
112
|
+
options,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
test('dismissing a dialog with only an allow option answers cancelled, never allow', async () => {
|
|
116
|
+
const { session, permissionAnswers } = mountSession();
|
|
117
|
+
await withOptions(session, 30, [{ optionId: 'allow', kind: 'allow_once' }]);
|
|
118
|
+
session.resolvePermission('30', false);
|
|
119
|
+
expect(permissionAnswers()).toEqual([
|
|
120
|
+
{ id: 30, result: { outcome: { outcome: 'cancelled' } } },
|
|
121
|
+
]);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
test('Confirm picks the allow option even when the agent lists reject first', async () => {
|
|
125
|
+
const { session, permissionAnswers } = mountSession();
|
|
126
|
+
await withOptions(session, 31, [
|
|
127
|
+
{ optionId: 'deny', kind: 'reject_once' },
|
|
128
|
+
{ optionId: 'allow', kind: 'allow_once' },
|
|
129
|
+
]);
|
|
130
|
+
session.resolvePermission('31', true);
|
|
131
|
+
expect(permissionAnswers()).toEqual([
|
|
132
|
+
{ id: 31, result: { outcome: { outcome: 'selected', optionId: 'allow' } } },
|
|
133
|
+
]);
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
test('an "always allow" choice answers that option and silences the next identical request', async () => {
|
|
137
|
+
const { session, events, permissionAnswers } = mountSession();
|
|
138
|
+
await withOptions(session, 32, [
|
|
139
|
+
{ optionId: 'once', kind: 'allow_once' },
|
|
140
|
+
{ optionId: 'always', kind: 'allow_always' },
|
|
141
|
+
{ optionId: 'deny', kind: 'reject_once' },
|
|
142
|
+
]);
|
|
143
|
+
session.resolvePermission('32', false, 'always');
|
|
144
|
+
expect(permissionAnswers()).toEqual([
|
|
145
|
+
{ id: 32, result: { outcome: { outcome: 'selected', optionId: 'always' } } },
|
|
146
|
+
]);
|
|
147
|
+
const before = dialogs(events);
|
|
148
|
+
expect(await withOptions(session, 33, [
|
|
149
|
+
{ optionId: 'once', kind: 'allow_once' },
|
|
150
|
+
{ optionId: 'always', kind: 'allow_always' },
|
|
151
|
+
])).toEqual({
|
|
152
|
+
answered: true,
|
|
153
|
+
result: { outcome: { outcome: 'selected', optionId: 'always' } },
|
|
154
|
+
});
|
|
155
|
+
expect(dialogs(events)).toBe(before);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
test('a choice id the dialog does not hold is never substituted', async () => {
|
|
159
|
+
const { session, permissionAnswers } = mountSession();
|
|
160
|
+
await withOptions(session, 34, [
|
|
161
|
+
{ optionId: 'allow', kind: 'allow_once' },
|
|
162
|
+
{ optionId: 'deny', kind: 'reject_once' },
|
|
163
|
+
]);
|
|
164
|
+
session.resolvePermission('34', true, 'not-an-option');
|
|
165
|
+
expect(permissionAnswers()).toEqual([
|
|
166
|
+
{ id: 34, result: { outcome: { outcome: 'selected', optionId: 'allow' } } },
|
|
167
|
+
]);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
107
171
|
describe('ACP cancellation answers parked approvals', () => {
|
|
108
172
|
test('Stop answers every parked request with the cancelled outcome', async () => {
|
|
109
173
|
const { session, permissionAnswers } = mountSession();
|
|
@@ -19,11 +19,12 @@ import type { AcpId } from '@/server/lib/harness/acp/protocol';
|
|
|
19
19
|
import type { PendingPermissions } from '@/server/lib/harness/acp/permissions';
|
|
20
20
|
import type { ApprovalMode } from '@/shared/lib/omp/config/access-mode';
|
|
21
21
|
import { allowOption, autoApproval, type PermissionOption } from '@/server/lib/harness/acp/permissions';
|
|
22
|
+
import { permissionGrantKey } from '@/server/lib/harness/acp/grants';
|
|
22
23
|
import { noteAwaitingInput } from '@/server/lib/notifications/feed.server';
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
|
-
* The option id to select when the tier
|
|
26
|
-
* park it as a dialog.
|
|
26
|
+
* The option id to select when the tier (or a standing grant) already allows
|
|
27
|
+
* this call, or null to park it as a dialog.
|
|
27
28
|
*
|
|
28
29
|
* Answered HERE, before a dialog exists: parking it would ask a question the
|
|
29
30
|
* operator's own selection already answered, and `isBusy()` would report a
|
|
@@ -32,12 +33,16 @@ import { noteAwaitingInput } from '@/server/lib/notifications/feed.server';
|
|
|
32
33
|
export function preApprovedOption(
|
|
33
34
|
accessMode: ApprovalMode,
|
|
34
35
|
params: Record<string, unknown>,
|
|
36
|
+
permissions?: PendingPermissions,
|
|
35
37
|
): string | null {
|
|
36
38
|
const toolCall = params.toolCall && typeof params.toolCall === 'object'
|
|
37
39
|
? Object.fromEntries(Object.entries(params.toolCall))
|
|
38
40
|
: undefined;
|
|
39
|
-
if (!autoApproval(accessMode, toolCall)) return null;
|
|
40
41
|
const options = Array.isArray(params.options) ? (params.options as PermissionOption[]) : [];
|
|
42
|
+
// A standing "always allow" is the operator's own answer to this exact call;
|
|
43
|
+
// it wins over the tier, including one that would otherwise ask.
|
|
44
|
+
if (permissions?.grants.has(permissionGrantKey(toolCall))) return allowOption(options, 'always');
|
|
45
|
+
if (!autoApproval(accessMode, toolCall)) return null;
|
|
41
46
|
return allowOption(options);
|
|
42
47
|
}
|
|
43
48
|
|
|
@@ -99,7 +104,7 @@ export function answerPermissionRequest(
|
|
|
99
104
|
id: AcpId,
|
|
100
105
|
params: Record<string, unknown>,
|
|
101
106
|
): Promise<PermissionRequestAnswer> {
|
|
102
|
-
const optionId = preApprovedOption(host.accessMode, params);
|
|
107
|
+
const optionId = preApprovedOption(host.accessMode, params, host.permissions);
|
|
103
108
|
if (optionId) {
|
|
104
109
|
return Promise.resolve({ answered: true, result: { outcome: { outcome: 'selected', optionId } } });
|
|
105
110
|
}
|
|
@@ -54,6 +54,12 @@ export function handleAcpClientRequest(
|
|
|
54
54
|
// The file surface the client advertised at `initialize`. Routed before the
|
|
55
55
|
// refusal so an agent that took the advertisement at its word gets an answer.
|
|
56
56
|
if (isAcpFsMethod(method)) return handleAcpFsRequest(host, method, params);
|
|
57
|
+
// Cursor asks the CLIENT to run a nested task (`cursor/task`, measured on
|
|
58
|
+
// cursor-agent 2026.08.11). Answering `-32601` made its adapter fall back with
|
|
59
|
+
// an error in the middle of a delegation the tool card had already drawn; an
|
|
60
|
+
// empty result is what the adapter expects from a client that does not run
|
|
61
|
+
// the child itself.
|
|
62
|
+
if (method === 'cursor/task') return Promise.resolve({ answered: true, result: {} });
|
|
57
63
|
// `-32601`, not "internal error": the agent decides from the code whether this
|
|
58
64
|
// client simply lacks the method (Spec §Errors).
|
|
59
65
|
return Promise.resolve({
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The directories one ACP chat may work in.
|
|
8
|
+
*
|
|
9
|
+
* ACP carries `additionalDirectories` on `session/new|load|resume|fork` when the
|
|
10
|
+
* agent advertises `sessionCapabilities.additionalDirectories`. Kabmo never sent
|
|
11
|
+
* it, so an agent driving a WORKTREE chat could only write inside the worktree
|
|
12
|
+
* — and its `fs/*` calls for the repository the worktree belongs to were refused
|
|
13
|
+
* as "outside this session's workspace".
|
|
14
|
+
*
|
|
15
|
+
* The roots are computed from what Kabmo already knows: the session's cwd, plus
|
|
16
|
+
* the primary repository root when the cwd IS a worktree (the worktree registry
|
|
17
|
+
* holds that pair). Nothing else is invented — a root the client will not serve
|
|
18
|
+
* must not be advertised to the agent either.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { getDb } from '@/server/db.server';
|
|
22
|
+
import { worktreeRowFor } from '@/server/lib/db/worktree-registry.server';
|
|
23
|
+
|
|
24
|
+
/** The session's own root plus any registered parent repository root. */
|
|
25
|
+
export async function sessionRoots(cwd: string): Promise<string[]> {
|
|
26
|
+
const roots = [cwd];
|
|
27
|
+
try {
|
|
28
|
+
const db = await getDb();
|
|
29
|
+
const row = await worktreeRowFor(db, cwd);
|
|
30
|
+
if (row?.primary_root && row.primary_root !== cwd) roots.push(row.primary_root);
|
|
31
|
+
} catch {
|
|
32
|
+
// no-excuse-ok: catch — an unreadable worktree registry leaves one root,
|
|
33
|
+
// which is the same behaviour as before this module existed.
|
|
34
|
+
}
|
|
35
|
+
return roots;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The `additionalDirectories` list to send, or nothing when the capability is
|
|
39
|
+
* absent or there is only one root. */
|
|
40
|
+
export function additionalDirectoriesFor(
|
|
41
|
+
roots: readonly string[],
|
|
42
|
+
cwd: string,
|
|
43
|
+
advertised: boolean,
|
|
44
|
+
): { additionalDirectories?: string[] } {
|
|
45
|
+
const extra = roots.filter((root) => root !== cwd);
|
|
46
|
+
return advertised && extra.length > 0 ? { additionalDirectories: extra } : {};
|
|
47
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `additionalDirectories` is only sent when the agent advertised it.
|
|
8
|
+
*
|
|
9
|
+
* The gate is the point: the field is a v2 capability, and an agent that does
|
|
10
|
+
* not advertise it must not receive it — at best the key is ignored, at worst the
|
|
11
|
+
* whole setup request is refused and no chat starts at all.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, test } from 'bun:test';
|
|
15
|
+
import { additionalDirectoriesFor } from '@/server/lib/harness/acp/session-roots.server';
|
|
16
|
+
|
|
17
|
+
describe('additionalDirectoriesFor', () => {
|
|
18
|
+
test('sends the extra roots when the agent advertised the capability', () => {
|
|
19
|
+
expect(additionalDirectoriesFor(['/work/repo', '/work/repo-a'], '/work/repo-a', true)).toEqual({
|
|
20
|
+
additionalDirectories: ['/work/repo'],
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
test('sends nothing when the capability is absent', () => {
|
|
25
|
+
expect(additionalDirectoriesFor(['/work/repo', '/work/repo-a'], '/work/repo-a', false)).toEqual({});
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('sends nothing when the session has only its own root', () => {
|
|
29
|
+
expect(additionalDirectoriesFor(['/work/repo'], '/work/repo', true)).toEqual({});
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -22,12 +22,16 @@ import type {
|
|
|
22
22
|
AcpHandshakeTarget,
|
|
23
23
|
} from '@/server/lib/harness/acp/session-handshake';
|
|
24
24
|
import { handshakeAcpSession } from '@/server/lib/harness/acp/session-handshake';
|
|
25
|
+
import { loadAcpGrants } from '@/server/lib/harness/acp/grants.server';
|
|
25
26
|
import type { IdleReaper } from '@/server/lib/omp/rpc/idle-reaper';
|
|
26
27
|
|
|
27
28
|
/** The session slice a start drives: the handshake target, its clock and id. */
|
|
28
29
|
export interface AcpStartTarget extends AcpHandshakeTarget {
|
|
29
30
|
sessionId: string;
|
|
30
31
|
idle: IdleReaper;
|
|
32
|
+
/** The approval queue, so the grants earned in an earlier process are
|
|
33
|
+
* hydrated before the first `session/request_permission` can arrive. */
|
|
34
|
+
permissions?: { grants: { hydrate(keys: readonly string[]): void } };
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export async function startAcpSession(
|
|
@@ -56,6 +60,9 @@ export async function startAcpSession(
|
|
|
56
60
|
);
|
|
57
61
|
if (wantsReplay) await replay.run(mapper, handshake);
|
|
58
62
|
else await handshake();
|
|
63
|
+
// "Always allow" is the operator's standing decision for this chat; a new
|
|
64
|
+
// child must not ask again. Read once, before the session can take a prompt.
|
|
65
|
+
target.permissions?.grants.hydrate(await loadAcpGrants(target.sessionId));
|
|
59
66
|
// A slow handshake is not idleness: the window starts once it is usable.
|
|
60
67
|
target.idle.reset(true);
|
|
61
68
|
return { sessionId: target.sessionId };
|
|
@@ -45,7 +45,8 @@ import type { HarnessId } from '@/shared/lib/harness/catalog';
|
|
|
45
45
|
import type { AcpTurns, AcpTurnEndInfo } from '@/server/lib/harness/acp/turn';
|
|
46
46
|
import { driveAcpGoalAfterTurn } from '@/server/lib/harness/acp/acp-goal-driver.server';
|
|
47
47
|
import type { AcpGoalHost } from '@/server/lib/harness/acp/acp-goal.server';
|
|
48
|
-
import { assistantTextOf, spawnsBackgroundWork } from '@/server/lib/harness/acp/background-work';
|
|
48
|
+
import { assistantTextOf, spawnsBackgroundWork, toolIdsOf } from '@/server/lib/harness/acp/background-work';
|
|
49
|
+
import { isLostSession } from '@/server/lib/harness/acp/session-lost';
|
|
49
50
|
|
|
50
51
|
/** What a turn reads and moves on the session. */
|
|
51
52
|
export interface AcpTurnTarget {
|
|
@@ -62,6 +63,9 @@ export interface AcpTurnTarget {
|
|
|
62
63
|
isAlive(): boolean;
|
|
63
64
|
isBusy(): boolean;
|
|
64
65
|
send(command: Record<string, unknown>): Promise<unknown>;
|
|
66
|
+
/** Drop this session when the agent says it no longer has it, so the next
|
|
67
|
+
* command respawns and resumes. */
|
|
68
|
+
dropLostSession?: () => void;
|
|
65
69
|
}
|
|
66
70
|
|
|
67
71
|
/** What the turn-end bookkeeping moves on the session. */
|
|
@@ -69,7 +73,7 @@ export interface AcpTurnEndHost
|
|
|
69
73
|
extends Omit<AcpTurnTarget, 'runModel' | 'sessionId' | 'isAlive' | 'isBusy' | 'send'>, AcpGoalHost {
|
|
70
74
|
assistantCount: number;
|
|
71
75
|
usage: { endTurn(): void };
|
|
72
|
-
background: { start(baseline: string): void };
|
|
76
|
+
background: { start(baseline: string, knownTools?: readonly string[]): void };
|
|
73
77
|
}
|
|
74
78
|
|
|
75
79
|
/**
|
|
@@ -87,7 +91,8 @@ export function endAcpTurn(host: AcpTurnEndHost, info: AcpTurnEndInfo): Promise<
|
|
|
87
91
|
// `end_turn` right after `invoke_subagent`, and its completion is held until
|
|
88
92
|
// the next request (upstream #1461). Probe the transcript instead.
|
|
89
93
|
if (!info.cancelled && info.failed !== true && spawnsBackgroundWork(info.message)) {
|
|
90
|
-
|
|
94
|
+
// The replay repeats this turn's own calls; only work that is NEW is news.
|
|
95
|
+
host.background.start(assistantTextOf(info.message), toolIdsOf(info.message));
|
|
91
96
|
}
|
|
92
97
|
void driveAcpGoalAfterTurn(host, info.message, { cancelled: info.cancelled === true }).catch(() => {});
|
|
93
98
|
return reported;
|
|
@@ -152,6 +157,13 @@ export async function settleAcpTurn(
|
|
|
152
157
|
if (finalText && status === 'completed') {
|
|
153
158
|
void saveSessionAnswer(target.sessionId, finalText).catch(() => {});
|
|
154
159
|
}
|
|
160
|
+
// A lost agent session is not recoverable in THIS process: every later prompt
|
|
161
|
+
// answers the same refusal. Dropping the session lets the route respawn it and
|
|
162
|
+
// resume from the agent's own history — the alternative is a chat that can
|
|
163
|
+
// never send again.
|
|
164
|
+
if (isLostSession(info.failure) && target.dropLostSession) {
|
|
165
|
+
target.dropLostSession();
|
|
166
|
+
}
|
|
155
167
|
const reported = noteChildOutcome({
|
|
156
168
|
sessionId: target.sessionId,
|
|
157
169
|
status,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The wiring must let the background notice MOVE the session's counters.
|
|
8
|
+
*
|
|
9
|
+
* Measured against a real agy chat: the notice was finally delivered after a
|
|
10
|
+
* subagent turn, and it threw `Attempted to assign to readonly property` inside
|
|
11
|
+
* `deliverBackgroundNotice` because the counts were getter-only. The whole
|
|
12
|
+
* "did the subagent report back" path had already run; only the last step
|
|
13
|
+
* failed, so a unit test that never writes the counts could not catch it.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { describe, expect, test } from 'bun:test';
|
|
17
|
+
import { acpWiringFor } from '@/server/lib/harness/acp/session-wiring';
|
|
18
|
+
import { deliverBackgroundNotice } from '@/server/lib/harness/acp/background-work';
|
|
19
|
+
|
|
20
|
+
function session() {
|
|
21
|
+
return {
|
|
22
|
+
cwd: '/tmp',
|
|
23
|
+
sessionId: 's1',
|
|
24
|
+
runModel: { provider: 'p', modelId: 'm' },
|
|
25
|
+
messageCount: 2,
|
|
26
|
+
assistantCount: 1,
|
|
27
|
+
emit: () => {},
|
|
28
|
+
onTurnEnded: async () => {},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const parts = {
|
|
33
|
+
proc: {} as never,
|
|
34
|
+
mapper: {} as never,
|
|
35
|
+
idle: {} as never,
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
describe('acpWiringFor', () => {
|
|
39
|
+
test('reads the counts live', () => {
|
|
40
|
+
const target = session();
|
|
41
|
+
const wiring = acpWiringFor(target, parts);
|
|
42
|
+
target.messageCount = 9;
|
|
43
|
+
expect(wiring.messageCount).toBe(9);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test('lets a delivered notice increment them, as the real path does', () => {
|
|
47
|
+
const target = session();
|
|
48
|
+
const wiring = acpWiringFor(target, parts);
|
|
49
|
+
expect(() => deliverBackgroundNotice(wiring, 'the subagent finished')).not.toThrow();
|
|
50
|
+
expect(target.messageCount).toBe(3);
|
|
51
|
+
expect(target.assistantCount).toBe(2);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The seams an ACP session binds at construction: the turn machine and the
|
|
8
|
+
* background probe.
|
|
9
|
+
*
|
|
10
|
+
* Both are pure wiring over the process and the mapper, and both are the place a
|
|
11
|
+
* reader gets lost inside `session.ts` — the turn machine's `prompt` seam builds
|
|
12
|
+
* the blocks a prompt sends, and the probe's `load` is a `session/load` on the
|
|
13
|
+
* session's OWN id. Naming them here keeps the session class to the state it
|
|
14
|
+
* owns.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
AcpBackgroundProbe,
|
|
19
|
+
BACKGROUND_LOAD_TIMEOUT_MS,
|
|
20
|
+
deliverBackgroundNotice,
|
|
21
|
+
type BackgroundNoticeHost,
|
|
22
|
+
} from '@/server/lib/harness/acp/background-work';
|
|
23
|
+
import type { AcpProcess } from '@/server/lib/harness/acp/client';
|
|
24
|
+
import type { AcpFrameMapper } from '@/server/lib/harness/acp/frames';
|
|
25
|
+
import { promptBlocks } from '@/server/lib/harness/acp/prompt';
|
|
26
|
+
import { promptFileLinks } from '@/server/lib/harness/acp/prompt-files';
|
|
27
|
+
import { AcpTurns, type AcpTurnEndInfo } from '@/server/lib/harness/acp/turn';
|
|
28
|
+
import { stampMessageModel } from '@/server/lib/harness/acp/session-config';
|
|
29
|
+
import type { AgentEvent } from '@/server/lib/omp/rpc/constants';
|
|
30
|
+
import type { IdleReaper } from '@/server/lib/omp/rpc/idle-reaper';
|
|
31
|
+
|
|
32
|
+
/** Everything the two seams read off the session. The counts are the background
|
|
33
|
+
* notice's alone: it emits one synthetic assistant row and has to move them. */
|
|
34
|
+
export interface AcpWiringHost extends BackgroundNoticeHost {
|
|
35
|
+
readonly cwd: string;
|
|
36
|
+
readonly proc: AcpProcess;
|
|
37
|
+
readonly mapper: AcpFrameMapper;
|
|
38
|
+
readonly idle: IdleReaper;
|
|
39
|
+
sessionId: string;
|
|
40
|
+
runModel: { provider: string; modelId: string } | null;
|
|
41
|
+
emit(event: AgentEvent): void;
|
|
42
|
+
onTurnEnded(info: AcpTurnEndInfo): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** The wiring a session builds for itself.
|
|
46
|
+
*
|
|
47
|
+
* `sessionId`/`runModel` getters keep the handshake's late assignment visible
|
|
48
|
+
* to the turn machine. The two COUNTS are accessors in BOTH directions: the
|
|
49
|
+
* background notice emits a synthetic assistant row and increments them, and a
|
|
50
|
+
* getter-only property made that throw `Attempted to assign to readonly
|
|
51
|
+
* property` at the moment the notice was finally delivered — measured against
|
|
52
|
+
* a real agy chat, after the whole "did the subagent report back" path had
|
|
53
|
+
* already been exercised for 200 s. */
|
|
54
|
+
export function acpWiringFor(session: {
|
|
55
|
+
cwd: string;
|
|
56
|
+
sessionId: string;
|
|
57
|
+
runModel: { provider: string; modelId: string } | null;
|
|
58
|
+
messageCount: number;
|
|
59
|
+
assistantCount: number;
|
|
60
|
+
emit(event: AgentEvent): void;
|
|
61
|
+
onTurnEnded(info: AcpTurnEndInfo): Promise<void>;
|
|
62
|
+
}, parts: { proc: AcpProcess; mapper: AcpFrameMapper; idle: IdleReaper }): AcpWiringHost {
|
|
63
|
+
return {
|
|
64
|
+
cwd: session.cwd,
|
|
65
|
+
proc: parts.proc,
|
|
66
|
+
mapper: parts.mapper,
|
|
67
|
+
idle: parts.idle,
|
|
68
|
+
get sessionId() { return session.sessionId; },
|
|
69
|
+
get runModel() { return session.runModel; },
|
|
70
|
+
get messageCount() { return session.messageCount; },
|
|
71
|
+
set messageCount(count: number) { session.messageCount = count; },
|
|
72
|
+
get assistantCount() { return session.assistantCount; },
|
|
73
|
+
set assistantCount(count: number) { session.assistantCount = count; },
|
|
74
|
+
emit: (event) => session.emit(event),
|
|
75
|
+
onTurnEnded: (info) => void session.onTurnEnded(info),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The background probe: ACP holds a subagent's completion until the next
|
|
80
|
+
* request, and `session/load` is the only request that surfaces it. */
|
|
81
|
+
export function acpBackgroundProbe(host: AcpWiringHost): AcpBackgroundProbe {
|
|
82
|
+
return new AcpBackgroundProbe({
|
|
83
|
+
load: () => host.proc.loadSession(host.sessionId, host.cwd, BACKGROUND_LOAD_TIMEOUT_MS),
|
|
84
|
+
resetIdle: () => host.idle.reset(),
|
|
85
|
+
emit: (text) => deliverBackgroundNotice(host, text),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** The turn machine: one prompt, its frames, and how it ends. */
|
|
90
|
+
export function acpTurns(host: AcpWiringHost): AcpTurns {
|
|
91
|
+
return new AcpTurns({
|
|
92
|
+
emit: (event) => host.emit(event),
|
|
93
|
+
prompt: (message, images) =>
|
|
94
|
+
// `@path` mentions travel as `resource_link` blocks: no agent but omp
|
|
95
|
+
// expands them, and the file would otherwise reach the model as a path
|
|
96
|
+
// with no bytes behind it.
|
|
97
|
+
promptFileLinks(host.cwd, message).then(
|
|
98
|
+
(files) => host.proc.prompt(host.sessionId, promptBlocks(message, images, files), 0) as Promise<{ stopReason?: string } | undefined>,
|
|
99
|
+
),
|
|
100
|
+
cancelAgent: () => host.proc.cancel(host.sessionId),
|
|
101
|
+
abandonPrompt: () => host.proc.abandonPrompt(host.sessionId),
|
|
102
|
+
resetMapper: () => host.mapper.reset(),
|
|
103
|
+
closeMessage: () => host.mapper.closeMessage().map((event) => stampMessageModel(event, host.runModel)),
|
|
104
|
+
openCalls: () => host.mapper.openCalls(),
|
|
105
|
+
// Armed from the turn's END, exactly as the omp wrapper arms it from its own
|
|
106
|
+
// terminal settle: without this a queued follow-up never left the table.
|
|
107
|
+
onTurnEnd: (info) => host.onTurnEnded(info),
|
|
108
|
+
});
|
|
109
|
+
}
|
|
@@ -26,6 +26,7 @@ import { AcpTurns } from '@/server/lib/harness/acp/turn';
|
|
|
26
26
|
import { SessionListeners } from '@/server/lib/harness/acp/session-listeners';
|
|
27
27
|
import { RawNotificationSink } from '@/server/lib/harness/acp/raw-listeners';
|
|
28
28
|
import { PendingPermissions } from '@/server/lib/harness/acp/permissions';
|
|
29
|
+
import { acpConfigView } from '@/server/lib/harness/acp/session-config-view';
|
|
29
30
|
import { stampMessageModel } from '@/server/lib/harness/acp/session-config';
|
|
30
31
|
import type { AgentEvent } from '@/server/lib/omp/rpc/constants';
|
|
31
32
|
|
|
@@ -70,6 +71,16 @@ export interface BackgroundProbeStub {
|
|
|
70
71
|
consume: (method: string, params: Record<string, unknown>) => boolean;
|
|
71
72
|
}
|
|
72
73
|
|
|
74
|
+
/** Drain the microtask queue.
|
|
75
|
+
*
|
|
76
|
+
* `session/prompt` is chained: a settle resolves the stub, then the busy-retry
|
|
77
|
+
* wrapper, the turn's `settle`, `finish`, the end seams and the queue each take
|
|
78
|
+
* a hop. Four ticks stopped being enough the moment that wrapper existed; this
|
|
79
|
+
* is a fixed count of hops, not a wall-clock wait. */
|
|
80
|
+
export async function flushTicks(count = 24): Promise<void> {
|
|
81
|
+
for (let i = 0; i < count; i += 1) await Promise.resolve();
|
|
82
|
+
}
|
|
83
|
+
|
|
73
84
|
/** One in-flight `session/prompt` the stub can settle. */
|
|
74
85
|
interface PendingPrompt {
|
|
75
86
|
promise: Promise<unknown>;
|
|
@@ -77,7 +88,7 @@ interface PendingPrompt {
|
|
|
77
88
|
reject: (reason?: unknown) => void;
|
|
78
89
|
}
|
|
79
90
|
|
|
80
|
-
export function mountSession(): MountedSession {
|
|
91
|
+
export function mountSession(options: { busyWaitMs?: number } = {}): MountedSession {
|
|
81
92
|
const events: AgentEvent[] = [];
|
|
82
93
|
const dispatched = Promise.withResolvers<void>();
|
|
83
94
|
const calls: PendingPrompt[] = [];
|
|
@@ -114,6 +125,8 @@ export function mountSession(): MountedSession {
|
|
|
114
125
|
// A config write; the default reply omits the list, which is the shape a
|
|
115
126
|
// harness that ignores the protocol's "complete list" rule returns.
|
|
116
127
|
setConfigOption: async (_sessionId: string, _configId: string, _value: string | boolean) => ({}),
|
|
128
|
+
setMode: async (_sessionId: string, _modeId: string) => ({}),
|
|
129
|
+
setModel: async (_sessionId: string, _modelId: string) => ({}),
|
|
117
130
|
deleteSession: async (sessionId: string) => {
|
|
118
131
|
deletes.push(sessionId);
|
|
119
132
|
return {};
|
|
@@ -135,7 +148,7 @@ export function mountSession(): MountedSession {
|
|
|
135
148
|
.onTurnEnded(info);
|
|
136
149
|
turnEndCount += 1;
|
|
137
150
|
},
|
|
138
|
-
});
|
|
151
|
+
}, options);
|
|
139
152
|
const marks: string[] = [];
|
|
140
153
|
const markFailures: Array<string | null> = [];
|
|
141
154
|
const answers: { id: unknown; result: unknown }[] = [];
|
|
@@ -158,6 +171,25 @@ export function mountSession(): MountedSession {
|
|
|
158
171
|
turns,
|
|
159
172
|
mapper,
|
|
160
173
|
permissions: new PendingPermissions(),
|
|
174
|
+
// The config view is a constructor field; a prototype mount has none, and
|
|
175
|
+
// `set_model` writes through it.
|
|
176
|
+
config: acpConfigView(
|
|
177
|
+
{
|
|
178
|
+
get harness() { return 'opencode'; },
|
|
179
|
+
get sessionId() { return 'acp-1'; },
|
|
180
|
+
get configOptions() { return session.configOptions; },
|
|
181
|
+
set configOptions(options) { session.configOptions = options; },
|
|
182
|
+
get runModel() { return session.runModel; },
|
|
183
|
+
set runModel(model) { session.runModel = model; },
|
|
184
|
+
get modes() { return session.modes; },
|
|
185
|
+
set modes(modes) { session.modes = modes; },
|
|
186
|
+
get models() { return session.models; },
|
|
187
|
+
set models(models) { session.models = models; },
|
|
188
|
+
get isStreaming() { return session.isStreaming; },
|
|
189
|
+
emit: (event) => session.emit(event),
|
|
190
|
+
},
|
|
191
|
+
proc,
|
|
192
|
+
),
|
|
161
193
|
accessMode: 'always-ask',
|
|
162
194
|
capabilities: {},
|
|
163
195
|
configOptions: [],
|