@kabmo-labs/kabmo 0.42.2 → 0.43.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/README.md +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +721 -675
- package/dist/client/static/js/{CsvGrid-g6rek8y9.js → CsvGrid-g67pk2zy.js} +2 -2
- package/dist/client/static/js/{DocxView-41t9ryws.js → DocxView-pyh6p2kb.js} +4 -4
- package/dist/client/static/js/{DrawioView-mfxhfz1h.js → DrawioView-g48r6y2m.js} +2 -2
- package/dist/client/static/js/ImageView-rnzf5tve.js +1 -0
- package/dist/client/static/js/LayoutWrapper-rekrgth6.js +2 -0
- package/dist/client/static/js/Modal-edw446r8.js +59 -0
- package/dist/client/static/js/{PdfView-bek8k888.js → PdfView-6z3cgj37.js} +1 -1
- package/dist/client/static/js/SessionsView-e84tjbcr.js +1 -0
- package/dist/client/static/js/{SheetView-vezssf6b.js → SheetView-64076z1j.js} +13 -13
- package/dist/client/static/js/{SvgPreview-f1qaw73k.js → SvgPreview-dmpgavgd.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-4qn94h52.js → abnfDiagram-O67JEVCF-nfz5z1vw.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-7j23x20s.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-tbewzdya.js → architectureDiagram-NJMV4G6O-jra2jyzw.js} +11 -11
- package/dist/client/static/js/{astro-nn7xg0we.js → astro-dpfdhc5e.js} +1 -1
- package/dist/client/static/js/bash-vv2ysp0a.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-njgnwckz.js → blockDiagram-BEXU5L5S-3szktxam.js} +7 -7
- package/dist/client/static/js/c-8jf64j6h.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-f58pcvbk.js → c4Diagram-YGBWAQC7-xe9vbppt.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-52g73vyw.js → classDiagram-v2-NBCMYWYE-egzhj1xn.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-ptdnshzh.js → cose-bilkent-JH36ORCC-dfrk1wnr.js} +1 -1
- package/dist/client/static/js/cpp-vh94zee0.js +1 -0
- package/dist/client/static/js/css-p57h1fme.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-me5xnx6a.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-qabfdkzr.js → cynefinDiagram-VND7K2PF-xefpcmpg.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-kyf5jetf.js → dagre-6A5THRUB-vtzjnrt9.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-bxrsjtv9.js → diagram-22UHCM2B-4vvn790v.js} +16 -16
- package/dist/client/static/js/{diagram-3UASUU5V-0f41s00j.js → diagram-3UASUU5V-tmht3bew.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-0z1zx9h1.js → diagram-ATOU4E4O-p5wa5ztx.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-znrmr6bk.js → diagram-CDSNMT55-8myesjfc.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-jfe2jhk0.js → diagram-MLGK6HIB-9t3x2d5f.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-2kaawmwa.js → diagram-MPIPVDR6-8ahgnmhy.js} +3 -3
- package/dist/client/static/js/{dockerfile-12exatm9.js → dockerfile-x8aa0543.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-s5n37rfp.js → ebnfDiagram-ZINNZB2B-5semw111.js} +1 -1
- package/dist/client/static/js/{elixir-szk51ehr.js → elixir-5ewfhvfh.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-433rd9fp.js → elk-276RUBZZ-jmhs58ww.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-key6ah0b.js → erDiagram-OPXOYQCR-31wvbpdr.js} +8 -8
- package/dist/client/static/js/{erlang-zwy7cqdk.js → erlang-jqqa3ehb.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-5zbvjj84.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-36ygrbvm.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4efkhmca.js → ganttDiagram-FUAMR5RP-c2dycjrf.js} +6 -6
- package/dist/client/static/js/gitGraph-4MIJSDKK-tjhkv71w.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ac376y2k.js → gitGraphDiagram-X574FWY7-y4k4pdd8.js} +14 -14
- package/dist/client/static/js/graphql-kesh8gk0.js +1 -0
- package/dist/client/static/js/html-sxpfydga.js +1 -0
- package/dist/client/static/js/{index-e1yz59fa.js → index-0c6vpk89.js} +2 -2
- package/dist/client/static/js/{index-0pabfaac.js → index-0q2qfcjn.js} +1 -1
- package/dist/client/static/js/{index-p0ez6hqd.js → index-181p91hf.js} +1 -1
- package/dist/client/static/js/{index-zs73zwjz.js → index-2b46dzw8.js} +4 -4
- package/dist/client/static/js/{index-02543wk3.js → index-2cbnjc32.js} +2 -2
- package/dist/client/static/js/{index-7a2efrbj.js → index-3588r3wg.js} +2 -2
- package/dist/client/static/js/{index-4cncqz8j.js → index-38v0781h.js} +2 -2
- package/dist/client/static/js/{index-z78bzryw.js → index-48gh56ka.js} +3 -3
- package/dist/client/static/js/{index-0e9nkc0g.js → index-48pb18zj.js} +2 -2
- package/dist/client/static/js/{index-77t0nvt1.js → index-4rv388z7.js} +2 -2
- package/dist/client/static/js/index-52xmdeh2.js +1 -0
- package/dist/client/static/js/{index-5jnvz9hw.js → index-6fpd55cq.js} +2 -2
- package/dist/client/static/js/{index-nh29fkk9.js → index-7dp90ad1.js} +2 -2
- package/dist/client/static/js/{index-yzda8j2d.js → index-8kqepehd.js} +12 -12
- package/dist/client/static/js/{index-raca8tsh.js → index-aar68x31.js} +4 -4
- package/dist/client/static/js/{index-pxtff3ez.js → index-bvjct7sp.js} +2 -2
- package/dist/client/static/js/{index-cz50ha6x.js → index-cgzw43bc.js} +78 -78
- package/dist/client/static/js/{index-50mdqev0.js → index-cje5gg45.js} +1 -1
- package/dist/client/static/js/{index-zndbhb9w.js → index-cjhvtzdd.js} +2 -2
- package/dist/client/static/js/{index-8b3t2y77.js → index-cqnpsw2m.js} +2 -2
- package/dist/client/static/js/{index-r9db1gsf.js → index-dkwhs38j.js} +2 -2
- package/dist/client/static/js/{index-pkes9492.js → index-e7yf273s.js} +2 -2
- package/dist/client/static/js/{index-8kbp24xg.js → index-efra065v.js} +1 -1
- package/dist/client/static/js/index-f77c3ag0.js +479 -0
- package/dist/client/static/js/{index-yjmm73jm.js → index-f7djda1g.js} +2 -2
- package/dist/client/static/js/{index-8k7vjp8b.js → index-fbcg8y95.js} +1 -1
- package/dist/client/static/js/{index-pysqpc5n.js → index-fg965t62.js} +2 -2
- package/dist/client/static/js/{index-qsw5edtk.js → index-fjnkzk12.js} +5 -5
- package/dist/client/static/js/{index-s4gv0rpk.js → index-g3shdymf.js} +1 -1
- package/dist/client/static/js/{index-qx6x4z0y.js → index-gmnmnfm0.js} +2 -2
- package/dist/client/static/js/{index-gp57dx2v.js → index-h5n1btqy.js} +1 -1
- package/dist/client/static/js/{index-r8cc80w5.js → index-jz93j0at.js} +2 -2
- package/dist/client/static/js/{index-dtj73vs1.js → index-kc5znr75.js} +2 -2
- package/dist/client/static/js/index-m1n4v0z7.js +9 -0
- package/dist/client/static/js/{index-1t5ybx9v.js → index-m94f4ngb.js} +3 -3
- package/dist/client/static/js/{index-dfqmwm7j.js → index-m9s9rg5k.js} +2 -2
- package/dist/client/static/js/{index-gsxebrq9.js → index-n9scbxy5.js} +2 -2
- package/dist/client/static/js/{index-zs7sjv6x.js → index-nt7nhchn.js} +1 -1
- package/dist/client/static/js/{index-v3f7we4n.js → index-pt8440xh.js} +22 -22
- package/dist/client/static/js/{index-b42t14wk.js → index-q81rxwh7.js} +35 -35
- package/dist/client/static/js/{index-ktbrmp29.js → index-qhytrsyb.js} +2 -2
- package/dist/client/static/js/index-rn8w29pv.js +2 -0
- package/dist/client/static/js/{index-1y3rzw6b.js → index-s00j9042.js} +1 -1
- package/dist/client/static/js/{index-hga3e13s.js → index-s78n0dtv.js} +2 -2
- package/dist/client/static/js/index-s7rfbydk.js +4 -0
- package/dist/client/static/js/{index-03pyvmcz.js → index-sesghshh.js} +2 -2
- package/dist/client/static/js/{index-ykfd2fyj.js → index-sg6sz3g8.js} +1 -1
- package/dist/client/static/js/index-vcrh95gf.css +1 -0
- package/dist/client/static/js/{index-82vk27q1.js → index-vyw4tbn8.js} +2 -2
- package/dist/client/static/js/{index-dzmar8jr.js → index-w5rw8f7w.js} +1 -1
- package/dist/client/static/js/{index-f33c4paw.js → index-x6v37h3j.js} +1 -1
- package/dist/client/static/js/{index-b0v6gwym.js → index-ycks7gyg.js} +2 -2
- package/dist/client/static/js/{index-hw14rhen.js → index-ynaxep06.js} +2 -2
- package/dist/client/static/js/{index-rab39785.js → index-ys0xpw3q.js} +2 -2
- package/dist/client/static/js/{index-feffxxss.js → index-yvgbr7ek.js} +2 -2
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-4e7ej63f.js → infoDiagram-VRGFBTTK-z3pqx7w8.js} +1 -1
- package/dist/client/static/js/ini-1x0ad976.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-k3yet1ec.js → ishikawaDiagram-OU5B5YK6-f5v6z8yr.js} +4 -4
- package/dist/client/static/js/java-3944nq02.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qe352kyd.js → journeyDiagram-ZHPQQLJL-js1yxatk.js} +5 -5
- package/dist/client/static/js/json-g5ggnd94.js +1 -0
- package/dist/client/static/js/jsx-f6p72qpc.js +1 -0
- package/dist/client/static/js/{julia-2eekpjq8.js → julia-0h9krgsd.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-58hag75n.js → kanban-definition-PNTS6WVX-m0a6069c.js} +5 -5
- package/dist/client/static/js/lua-edn2b3wn.js +1 -0
- package/dist/client/static/js/markdown-9dhg1fax.js +1 -0
- package/dist/client/static/js/{mermaid.core-6e89h6vm.js → mermaid.core-6xvbnm63.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ncsam2fm.js → mindmap-definition-NLK3R4M7-a9f9yzc0.js} +4 -4
- package/dist/client/static/js/one-dark-pro-hteqzfb0.js +1 -0
- package/dist/client/static/js/one-light-dapnh0rs.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-ng6wq5xj.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-b5ckc39d.js → pegDiagram-GJSIUBJH-4v4pf1h1.js} +1 -1
- package/dist/client/static/js/{perl-dtn1fccw.js → perl-rptyx23q.js} +1 -1
- package/dist/client/static/js/{php-7av78hch.js → php-sagvq3wz.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-rf6jhxf6.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-s4d47ve8.js → pieDiagram-5QR66LMP-a54yrmfm.js} +3 -3
- package/dist/client/static/js/properties-fcmj08pv.js +1 -0
- package/dist/client/static/js/python-532d8ezm.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-zm0ekvjz.js → quadrantDiagram-O4NWA36T-1twhvnp2.js} +6 -6
- package/dist/client/static/js/r-ptmdxs2a.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-ygp6hxq4.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-rxgnrb2g.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xkv52a2p.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-bvcktbqh.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-9c3v7jsq.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-52vdqf53.js → railroadDiagram-XR7U4H2S-83tqfdcy.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-7kf8bmk9.js → requirementDiagram-PLB6GJNP-73e3pzw6.js} +4 -4
- package/dist/client/static/js/{ruby-s2bqr910.js → ruby-9qyx7knh.js} +1 -1
- package/dist/client/static/js/{rust-q98kssv3.js → rust-jds4e4r7.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-bcb9f54a.js → sankeyDiagram-IPEJSGJF-1bzwj6sb.js} +6 -6
- package/dist/client/static/js/{sass-bm32bb5k.js → sass-07rteya0.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-76ywvj7g.js → sequenceDiagram-PO4LG4MO-yh3h988k.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-p9bsf5dc.js → sizeCapture-INFHLROL-1n121yp6.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1ecfb3fs.js → stateDiagram-v2-GCMORJYK-0tdrzn06.js} +6 -6
- package/dist/client/static/js/{svelte-ztkaww47.js → svelte-w365cpwa.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-2pyjr946.js → swimlanes-2SLR337P-77n1ttdw.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-akjqm31r.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-4csxwmn2.js → timeline-definition-EJHVYXUP-b6r0k3e8.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-fb58a7z1.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-ej4qhksx.js +1 -0
- package/dist/client/static/js/typescript-683kkkaw.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-0p1jnbsn.js → usecaseDiagram-POWQR4AR-efq58m3m.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-y1hgdet4.js → vennDiagram-UO4OBE2U-ad4gvd5r.js} +5 -5
- package/dist/client/static/js/{vue-cbqm4bed.js → vue-d6cesny1.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-mkp0kanv.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-p578yrgm.js → wardleyDiagram-VNRHLVJA-v89tys2p.js} +4 -4
- package/dist/client/static/js/xml-6ct32gys.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-b08b4ah0.js → xychartDiagram-PMCCYNJV-xtgzmknw.js} +5 -5
- package/dist/client/static/js/yaml-1d5m3bfj.js +1 -0
- package/marketplace/plugins/command-runner/package.json +2 -2
- package/marketplace/plugins/command-runner/src/app.test.tsx +161 -0
- package/marketplace/plugins/command-runner/src/app.tsx +37 -3
- package/marketplace/plugins/command-runner/src/panel/Glyph.tsx +22 -4
- package/marketplace/plugins/git-forge/package.json +2 -2
- package/marketplace/plugins/git-forge/src/panel/Glyph.tsx +22 -3
- package/marketplace/plugins/git-forge/src/panel/index.tsx +21 -3
- package/marketplace/plugins/git-forge/src/panel/refresh.test.tsx +192 -0
- package/marketplace/plugins/git-forge/src/panel/use-forge.ts +4 -2
- package/marketplace/plugins/git-forge/src/panel/write.test.tsx +21 -0
- package/marketplace/plugins/stats/package.json +2 -2
- package/marketplace/plugins/stats/src/RefreshButton.tsx +9 -7
- package/marketplace/plugins/stats/src/app.tsx +15 -1
- package/marketplace/plugins/stats/src/refresh.test.tsx +166 -0
- package/package.json +1 -1
- package/src/client/components/common/anchored-menu/index.tsx +26 -8
- package/src/client/components/common/context-usage-button/McpSection.test.tsx +34 -5
- package/src/client/components/common/context-usage-button/McpSection.tsx +25 -3
- package/src/client/components/common/harness-glyph/brands.ts +3 -0
- package/src/client/components/common/harness-glyph/omo.ts +22 -0
- package/src/client/components/common/server-control/Panel.tsx +24 -86
- package/src/client/components/common/server-control/Row.tsx +98 -0
- package/src/client/components/common/server-control/index.test.tsx +69 -9
- package/src/client/components/layout/VisibilityMenu.tsx +18 -6
- package/src/client/components/layout/new-workspace-host/index.test.tsx +84 -0
- package/src/client/components/layout/new-workspace-host/index.tsx +35 -0
- package/src/client/components/mobile/header-titlebar.test.tsx +38 -3
- package/src/client/components/settings/Sidebar.tsx +2 -1
- package/src/client/components/settings/categories/GitSettings.tsx +31 -0
- package/src/client/components/settings/categories/git-settings/CommitMessageSection.tsx +292 -0
- package/src/client/components/settings/categories/git-settings/IdentitySection.tsx +215 -0
- package/src/client/components/settings/category-content.tsx +3 -0
- package/src/client/components/workspace/chat-timeline/MessageItem.tsx +8 -0
- package/src/client/components/workspace/chat-timeline/MessageList.test.ts +55 -2
- package/src/client/components/workspace/chat-timeline/MessageList.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/PendingChatView.tsx +56 -50
- package/src/client/components/workspace/chat-timeline/ThinkingSection.test.tsx +38 -2
- package/src/client/components/workspace/chat-timeline/ThinkingSection.tsx +13 -1
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.test.tsx +50 -0
- package/src/client/components/workspace/chat-timeline/target-picker/WorkspacePicker.tsx +20 -1
- 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/Bash.tsx +2 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Proc.tsx +1 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/TaskResult.tsx +18 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Wait.tsx +3 -2
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/task-rows.ts +47 -0
- package/src/client/components/workspace/git-panel/CommitBox.test.tsx +98 -0
- package/src/client/components/workspace/git-panel/CommitBox.tsx +68 -3
- package/src/client/components/workspace/git-panel/index.test.ts +12 -0
- package/src/client/components/workspace/git-panel/index.tsx +20 -1
- package/src/client/components/workspace/repo-picker/index.test.tsx +20 -0
- package/src/client/components/workspace/repo-picker/index.tsx +5 -6
- package/src/client/data/settings/omp-schema.json +134 -8
- package/src/client/hooks/chat/context/mcp.ts +19 -1
- package/src/client/hooks/chat/omp/index.ts +2 -6
- package/src/client/hooks/chat/timeline/jump-rail.ts +1 -0
- package/src/client/hooks/chat/timeline/row-window.test.ts +38 -3
- package/src/client/hooks/chat/timeline/row-window.ts +33 -9
- package/src/client/hooks/chat/timeline/scroll-geometry.ts +19 -1
- package/src/client/hooks/chat/timeline/scroll.ts +15 -0
- package/src/client/hooks/chat/timeline/thinking-open.ts +10 -4
- package/src/client/hooks/workspace/commit-box.test.ts +62 -1
- package/src/client/hooks/workspace/commit-box.ts +94 -2
- package/src/client/hooks/workspace/git-panel-data.ts +15 -7
- package/src/client/hooks/workspace/repo-scope/index.test.ts +10 -3
- package/src/client/hooks/workspace/repo-scope/index.ts +21 -9
- package/src/client/lib/plugins/repo-scope-service.ts +7 -25
- 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/chat/session-store.server.ts +22 -1
- package/src/server/lib/db/schema.ts +3 -0
- package/src/server/lib/fs/git-commit-context.test.ts +111 -0
- package/src/server/lib/fs/git-commit-context.ts +85 -0
- package/src/server/lib/fs/git-commit-message.server.ts +251 -0
- package/src/server/lib/fs/git-commit-message.test.ts +211 -0
- package/src/server/lib/fs/git-commit-prompt.test.ts +69 -0
- package/src/server/lib/fs/git-commit-prompt.ts +57 -0
- package/src/server/lib/fs/git-commit-settings.server.ts +42 -0
- package/src/server/lib/fs/git-identity.server.test.ts +129 -0
- package/src/server/lib/fs/git-identity.server.ts +130 -0
- package/src/server/lib/harness/acp/acp-audit.server.ts +13 -62
- package/src/server/lib/harness/acp/acp-frames.server.test.ts +105 -0
- package/src/server/lib/harness/acp/acp-frames.server.ts +217 -0
- package/src/server/lib/harness/acp/acp-raw-messages.server.test.ts +69 -0
- package/src/server/lib/harness/acp/acp-raw-messages.server.ts +129 -0
- package/src/server/lib/harness/acp/acp-telemetry.server.ts +19 -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 +139 -0
- package/src/server/lib/harness/acp/background-replay.ts +87 -0
- package/src/server/lib/harness/acp/background-work.ts +50 -33
- 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/one-shot.server.ts +141 -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/raw-listeners.ts +30 -0
- 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 +139 -56
- 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 +11 -0
- package/src/server/lib/harness/acp/session-wiring.ts +100 -0
- package/src/server/lib/harness/acp/session.test-util.ts +36 -2
- package/src/server/lib/harness/acp/session.test.ts +10 -10
- package/src/server/lib/harness/acp/session.ts +149 -139
- 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/capabilities.ts +11 -0
- package/src/server/lib/harness/launch-table.ts +19 -0
- package/src/server/lib/harness/launch.ts +4 -0
- package/src/server/lib/harness/schema.server.ts +23 -0
- package/src/server/lib/harness/spawn.server.ts +18 -2
- package/src/server/lib/mcp/agent-config.server.test.ts +111 -0
- package/src/server/lib/mcp/agent-config.server.ts +205 -0
- package/src/server/lib/mcp/probe.server.ts +7 -1
- package/src/server/lib/mcp/registry.server.ts +4 -3
- package/src/server/lib/mcp/secrets.server.test.ts +85 -0
- package/src/server/lib/mcp/secrets.server.ts +108 -0
- package/src/server/lib/omp/core/print.server.ts +100 -0
- package/src/server/lib/omp/rpc/frame-fold.ts +4 -0
- package/src/server/lib/omp/session/artifacts.server.test.ts +15 -5
- package/src/server/lib/omp/session/artifacts.server.ts +41 -26
- package/src/server/lib/omp/session/delete.server.ts +5 -0
- package/src/server/lib/omp/session/goal-auditor.server.ts +10 -48
- package/src/server/lib/realtime/topics/session-data.server.ts +6 -14
- package/src/server/routes/fs/git-message.test.ts +101 -0
- package/src/server/routes/fs/git-message.ts +60 -0
- package/src/server/routes/fs/index.ts +2 -0
- package/src/server/routes/omp/artifact.ts +4 -3
- package/src/server/routes/sessions/mcp.test.ts +65 -1
- package/src/server/routes/sessions/mcp.ts +77 -5
- package/src/server/routes/settings/git-identity.test.ts +77 -0
- package/src/server/routes/settings/git-identity.ts +47 -0
- package/src/server/routes/settings/index.ts +2 -0
- package/src/server/routes/telemetry/acp-telemetry.test.ts +149 -0
- package/src/server/routes/telemetry/context.ts +31 -0
- package/src/server/routes/telemetry/raw-messages.ts +34 -0
- package/src/shared/lib/chat/tool/artifact.test.ts +4 -2
- package/src/shared/lib/chat/tool/artifact.ts +6 -1
- package/src/shared/lib/chat/tool/proc-facts.ts +2 -1
- package/src/shared/lib/fs/paths.test.ts +2 -0
- package/src/shared/lib/fs/repo-label.test.ts +22 -1
- package/src/shared/lib/fs/repo-label.ts +29 -0
- package/src/shared/lib/git/commit-prompt.test.ts +47 -0
- package/src/shared/lib/git/commit-prompt.ts +72 -0
- package/src/shared/lib/git/identity.test.ts +46 -0
- package/src/shared/lib/git/identity.ts +70 -0
- package/src/shared/lib/harness/brand-color.ts +3 -0
- package/src/shared/lib/harness/catalog.test.ts +14 -0
- package/src/shared/lib/harness/catalog.ts +9 -1
- package/src/shared/lib/harness/mcp-facts.ts +4 -0
- package/src/shared/lib/harness/provider-facts.test.ts +11 -0
- package/src/shared/lib/harness/provider-facts.ts +14 -0
- package/src/shared/lib/harness/providers.ts +2 -2
- package/src/shared/lib/harness/updates.test.ts +8 -0
- package/src/shared/lib/harness/updates.ts +9 -0
- package/src/shared/lib/omp/session/proc-daemon.ts +124 -0
- package/src/shared/lib/omp/session/proc.test.ts +30 -3
- package/src/shared/lib/omp/session/proc.ts +6 -82
- package/src/shared/lib/omp/session/wait-idle.test.ts +15 -4
- package/src/shared/lib/omp/session/wait-idle.ts +11 -4
- package/src/shared/lib/settings/defaults.ts +5 -0
- package/src/shared/lib/workspace/new-workspace.ts +20 -0
- package/src/shared/types/omp/agent.ts +14 -5
- package/src/shared/types/settings/mcp.ts +2 -2
- package/src/shared/types/settings/state.ts +16 -0
- package/src/test-support/preload.ts +1 -0
- package/dist/client/static/js/ImageView-bxqw3t4k.js +0 -1
- package/dist/client/static/js/LayoutWrapper-zt14rv9m.js +0 -2
- package/dist/client/static/js/Modal-cm35g20x.js +0 -38
- package/dist/client/static/js/SessionsView-gn53zyn7.js +0 -1
- package/dist/client/static/js/architecture-7GRP2DOG-cagtcfhk.js +0 -1
- package/dist/client/static/js/bash-fjzhxy10.js +0 -1
- package/dist/client/static/js/c-wqtyezvw.js +0 -1
- package/dist/client/static/js/cpp-y0nzwner.js +0 -1
- package/dist/client/static/js/css-n2waj098.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-6g2ydrss.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-b774qbn2.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-nznq0n36.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-b047d6vk.js +0 -1
- package/dist/client/static/js/graphql-gvb7e2eb.js +0 -1
- package/dist/client/static/js/html-tbz83eke.js +0 -1
- package/dist/client/static/js/index-0gbj4270.js +0 -2
- package/dist/client/static/js/index-38xv8h4t.js +0 -1
- package/dist/client/static/js/index-f4vr1c6e.css +0 -1
- package/dist/client/static/js/index-fb6pw9xb.js +0 -2
- package/dist/client/static/js/index-pzvr1699.js +0 -478
- package/dist/client/static/js/index-rf29f3fq.js +0 -9
- package/dist/client/static/js/index-zw621xez.js +0 -4
- package/dist/client/static/js/info-A6RAGUB7-n495k952.js +0 -1
- package/dist/client/static/js/ini-2gvjwh83.js +0 -1
- package/dist/client/static/js/java-1xwcq79s.js +0 -1
- package/dist/client/static/js/json-4pqjabgq.js +0 -1
- package/dist/client/static/js/jsx-wcsss15s.js +0 -1
- package/dist/client/static/js/lua-h7vjcn0h.js +0 -1
- package/dist/client/static/js/markdown-f30jjjh9.js +0 -1
- package/dist/client/static/js/one-dark-pro-qmyne0tn.js +0 -1
- package/dist/client/static/js/one-light-dj0ecjcj.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-zajj62z6.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-1ve78y5f.js +0 -1
- package/dist/client/static/js/properties-ymexza6q.js +0 -1
- package/dist/client/static/js/python-31ycwa66.js +0 -1
- package/dist/client/static/js/r-t2nne4xp.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-8rqadb58.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-v6ppm8dy.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-9j6bae14.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-56cpyt0g.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-yfdmspf4.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-qr5hdxm4.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-vwpg3wp8.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-htfxwd32.js +0 -1
- package/dist/client/static/js/typescript-p3syh43m.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-hapfjkzq.js +0 -1
- package/dist/client/static/js/xml-4enq788a.js +0 -1
- package/dist/client/static/js/yaml-pjtt3jsc.js +0 -1
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The two verdicts a CLOSED assistant message supplies when a turn ends, split
|
|
8
|
+
* out of `turn.ts` so that file stays inside the size ceiling.
|
|
9
|
+
*
|
|
10
|
+
* Both are about what the agent actually sent, not about the envelope's
|
|
11
|
+
* `stopReason`: an agent records the provider's failure on the message, and a
|
|
12
|
+
* message whose blocks render nothing is the same operator-visible failure as no
|
|
13
|
+
* message at all.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
import { deriveTurnError } from '@/shared/lib/omp/session/turn-error';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The reason the CLOSED message names, when it named one.
|
|
20
|
+
*
|
|
21
|
+
* The same rule as omp's: an agent records `stopReason` / `errorMessage` flat on
|
|
22
|
+
* the assistant message, and reading only the envelope's stop reason threw the
|
|
23
|
+
* provider's own words away — a coordinator was told "the agent ended the turn
|
|
24
|
+
* with an error" over a transcript that said which.
|
|
25
|
+
*/
|
|
26
|
+
export function closedFailure(message: unknown): string | null {
|
|
27
|
+
if (!message || typeof message !== 'object' || Array.isArray(message)) return null;
|
|
28
|
+
const error = deriveTurnError(message as Record<string, unknown>);
|
|
29
|
+
return error?.message?.trim() || null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Does the closed message carry anything the timeline draws? A whitespace-only
|
|
33
|
+
* chunk (or one that carried only an empty text block) opens a message row
|
|
34
|
+
* that renders nothing, which is the same operator-visible failure as no frame
|
|
35
|
+
* at all. Thinking and tool calls are content: they render as their own
|
|
36
|
+
* blocks. */
|
|
37
|
+
export function hasRenderableAnswer(message: unknown): boolean {
|
|
38
|
+
if (!message || typeof message !== 'object' || !('content' in message)) return false;
|
|
39
|
+
const content = message.content;
|
|
40
|
+
if (!Array.isArray(content)) return false;
|
|
41
|
+
return content.some((block) => {
|
|
42
|
+
if (!block || typeof block !== 'object') return false;
|
|
43
|
+
if ('text' in block && typeof block.text === 'string') return block.text.trim().length > 0;
|
|
44
|
+
if ('thinking' in block && typeof block.thinking === 'string') return block.thinking.trim().length > 0;
|
|
45
|
+
return 'type' in block && block.type === 'toolCall';
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** What one finished turn reports as its outcome. */
|
|
50
|
+
export interface TurnVerdict {
|
|
51
|
+
failed: boolean;
|
|
52
|
+
cancelled: boolean;
|
|
53
|
+
reason: string | null;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** The verdict for a closed turn.
|
|
57
|
+
*
|
|
58
|
+
* A prompt that ends with no message and no tool call is a SILENT failure on
|
|
59
|
+
* most agents (measured on pi-acp: it answers `session/prompt` with `{}` and
|
|
60
|
+
* sends no frames when its provider call fails). Whitespace-only chunks are the
|
|
61
|
+
* same failure with a frame attached. Slash commands are exempt — an extension
|
|
62
|
+
* command is answered locally and correctly produces nothing — and a user's Stop
|
|
63
|
+
* is not a failure either.
|
|
64
|
+
*
|
|
65
|
+
* `stopReason: 'error'` is a failure even when the agent DID send a partial
|
|
66
|
+
* message: a v1 agent answers `{stopReason:'error'}` with whatever it streamed,
|
|
67
|
+
* and reading only "did it answer" told a coordinator its failed worker had
|
|
68
|
+
* finished. v2 cannot infer failure from an idle without a stop reason, so the
|
|
69
|
+
* silent-turn rule is gated to `completion === 'response'`. */
|
|
70
|
+
export function turnVerdict(args: {
|
|
71
|
+
closed: unknown;
|
|
72
|
+
abandoned: number;
|
|
73
|
+
result: { stopReason?: string } | undefined;
|
|
74
|
+
reported: boolean;
|
|
75
|
+
stranded: boolean;
|
|
76
|
+
/** The prompt text, to exempt slash commands. */
|
|
77
|
+
promptText: string;
|
|
78
|
+
completion: 'response' | 'state';
|
|
79
|
+
strandedReason: string;
|
|
80
|
+
/** A reason the caller already knows and reported. */
|
|
81
|
+
failure?: string;
|
|
82
|
+
}): TurnVerdict {
|
|
83
|
+
const answered = hasRenderableAnswer(args.closed) || args.abandoned > 0;
|
|
84
|
+
const cancelled = args.result?.stopReason === 'cancelled';
|
|
85
|
+
const slash = args.promptText.trimStart().startsWith('/');
|
|
86
|
+
const failed = !cancelled && !slash
|
|
87
|
+
&& (args.stranded || args.reported || args.result?.stopReason === 'error' || (args.completion === 'response' && !answered));
|
|
88
|
+
const reason = failed
|
|
89
|
+
? (args.failure ?? (args.stranded
|
|
90
|
+
? args.strandedReason
|
|
91
|
+
: closedFailure(args.closed) ?? (args.result?.stopReason === 'error'
|
|
92
|
+
? 'The agent ended the turn with an error'
|
|
93
|
+
: 'The agent ended the turn without sending an answer')))
|
|
94
|
+
: null;
|
|
95
|
+
return { failed, cancelled, reason };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** A slash command is answered locally and correctly produces nothing, so the
|
|
99
|
+
* silent-turn verdict never applies to one. */
|
|
100
|
+
export function reasonSuppressed(promptText: string): boolean {
|
|
101
|
+
return promptText.trimStart().startsWith('/');
|
|
102
|
+
}
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* The life of an ACP turn: one prompt, its frames, and how it ends.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
* each to learn, and a session that also owns spawning, config selectors and
|
|
11
|
-
* client requests buried them:
|
|
9
|
+
* Three rules, each a bug that had to be learned:
|
|
12
10
|
*
|
|
13
11
|
* - **a prompt is CHAINED, never raced.** ACP has no queue: a second
|
|
14
12
|
* `session/prompt` while one is open CANCELS the first (measured, twice).
|
|
@@ -22,7 +20,10 @@ import type { AgentEvent } from '@/server/lib/omp/rpc/constants';
|
|
|
22
20
|
import { AcpRequestError } from '@/server/lib/harness/acp/calls';
|
|
23
21
|
import { turnEndFrame } from '@/server/lib/harness/acp/frames';
|
|
24
22
|
import { TurnSilence } from '@/server/lib/harness/acp/turn-silence';
|
|
25
|
-
import {
|
|
23
|
+
import { CancelSettle } from '@/server/lib/harness/acp/turn-cancel';
|
|
24
|
+
import { TurnQueue } from '@/server/lib/harness/acp/turn-queue';
|
|
25
|
+
import { promptWithBusyRetry, SESSION_BUSY_WAIT_MS } from '@/server/lib/harness/acp/turn-dispatch';
|
|
26
|
+
import { reasonSuppressed, turnVerdict } from '@/server/lib/harness/acp/turn-verdict';
|
|
26
27
|
|
|
27
28
|
const STRANDED_REASON = 'The agent stopped reporting progress; the turn was closed after a long silence.';
|
|
28
29
|
|
|
@@ -83,9 +84,16 @@ export class AcpTurns {
|
|
|
83
84
|
private awaitingCancellation = false;
|
|
84
85
|
/** The silence ceiling for the open turn — see `turn-silence.ts`. */
|
|
85
86
|
readonly #silence: TurnSilence;
|
|
87
|
+
/** Settles the prompt after a cancel the agent never answered. */
|
|
88
|
+
readonly #cancelSettle: CancelSettle;
|
|
89
|
+
/** Inputs held for an agent with no mid-turn channel. */
|
|
90
|
+
readonly #queue = new TurnQueue();
|
|
91
|
+
readonly #busyWaitMs: number;
|
|
86
92
|
|
|
87
|
-
constructor(private readonly seams: AcpTurnSeams, options: { silenceMs?: number } = {}) {
|
|
93
|
+
constructor(private readonly seams: AcpTurnSeams, options: { silenceMs?: number; busyWaitMs?: number } = {}) {
|
|
88
94
|
this.#silence = new TurnSilence(() => this.strand(), options.silenceMs);
|
|
95
|
+
this.#cancelSettle = new CancelSettle(() => this.seams.abandonPrompt());
|
|
96
|
+
this.#busyWaitMs = options.busyWaitMs ?? SESSION_BUSY_WAIT_MS;
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
/** Any frame from the agent defers the silence ceiling. */
|
|
@@ -111,6 +119,9 @@ export class AcpTurns {
|
|
|
111
119
|
}
|
|
112
120
|
this.seq += 1;
|
|
113
121
|
const turnId = this.seq;
|
|
122
|
+
// A new prompt IS the decision that a cancelled turn is over: free the chain
|
|
123
|
+
// now rather than waiting out the grace window.
|
|
124
|
+
this.#cancelSettle.flush();
|
|
114
125
|
this.promptText = message;
|
|
115
126
|
this.awaitingCancellation = false;
|
|
116
127
|
this.isPromptRunning = true;
|
|
@@ -122,9 +133,18 @@ export class AcpTurns {
|
|
|
122
133
|
const request = (this.request ?? Promise.resolve())
|
|
123
134
|
.catch(() => undefined)
|
|
124
135
|
.then(() => {
|
|
136
|
+
// Stop pressed while this turn queued behind the previous prompt: the
|
|
137
|
+
// flags were cleared, so the prompt must never reach the agent.
|
|
138
|
+
if (!this.isPromptRunning || !this.isStreaming) return undefined;
|
|
125
139
|
this.open = turnId;
|
|
126
140
|
this.seams.resetMapper();
|
|
127
|
-
|
|
141
|
+
// `-32003 session_busy` is the agent still finishing its previous turn,
|
|
142
|
+
// not a failure: wait for it instead of reporting an error the operator
|
|
143
|
+
// can only work around by waiting.
|
|
144
|
+
return promptWithBusyRetry(() => this.seams.prompt(message, images), {
|
|
145
|
+
waitMs: this.#busyWaitMs,
|
|
146
|
+
isActive: () => this.open === turnId && this.isPromptRunning,
|
|
147
|
+
});
|
|
128
148
|
});
|
|
129
149
|
this.request = request;
|
|
130
150
|
void request
|
|
@@ -158,30 +178,60 @@ export class AcpTurns {
|
|
|
158
178
|
return { agentInvoked: true };
|
|
159
179
|
}
|
|
160
180
|
|
|
161
|
-
/**
|
|
162
|
-
* Stop the turn AND close it here.
|
|
181
|
+
/** Stop the turn AND close it here.
|
|
163
182
|
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
*
|
|
168
|
-
* turn is chained behind.
|
|
169
|
-
*/
|
|
183
|
+
* Nothing guarantees the agent answers the cancel, and a session whose agent
|
|
184
|
+
* never does stays `isStreaming` forever — the NEXT prompt is refused as
|
|
185
|
+
* "already processing". The outstanding prompt is settled after a grace
|
|
186
|
+
* window for the same reason: it is what the next turn is chained behind. */
|
|
170
187
|
cancel(): void {
|
|
171
188
|
this.awaitingCancellation = true;
|
|
189
|
+
this.#cancelSettle.disarm();
|
|
172
190
|
if (this.open === null) {
|
|
173
|
-
//
|
|
174
|
-
//
|
|
175
|
-
// "processing"
|
|
191
|
+
// The prompt is still queued behind the previous request (or was never
|
|
192
|
+
// dispatched): clear the flags or Stop leaves the session permanently
|
|
193
|
+
// "processing", and tell the agent anyway — a cancel with nothing to stop
|
|
194
|
+
// is a no-op, while a prompt that slips out afterwards is what hangs the
|
|
195
|
+
// NEXT send.
|
|
196
|
+
if (this.isPromptRunning || this.isStreaming) {
|
|
197
|
+
this.abandonOnStop();
|
|
198
|
+
this.finish({ stopReason: 'cancelled' });
|
|
199
|
+
}
|
|
176
200
|
this.isPromptRunning = false;
|
|
177
201
|
this.isStreaming = false;
|
|
202
|
+
this.#silence.stop();
|
|
178
203
|
return;
|
|
179
204
|
}
|
|
180
205
|
this.open = null;
|
|
181
206
|
this.#silence.stop();
|
|
182
207
|
this.seams.cancelAgent();
|
|
183
|
-
this.seams.abandonPrompt();
|
|
184
208
|
this.finish({ stopReason: 'cancelled' });
|
|
209
|
+
// A held input is the operator's NEXT intent and must not wait out the
|
|
210
|
+
// grace window; otherwise let the agent end its own turn first.
|
|
211
|
+
if (this.#queue.size > 0) this.seams.abandonPrompt();
|
|
212
|
+
else this.#cancelSettle.arm();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** Hold an input until the running turn ends. */
|
|
216
|
+
queue(message: string, images: unknown): void {
|
|
217
|
+
this.#queue.push({ message, images });
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Take the next held input; the SESSION dispatches it, so counters and the
|
|
221
|
+
* run marker stay on its own path. */
|
|
222
|
+
takeQueued(): { message: string; images: unknown } | undefined {
|
|
223
|
+
return this.#queue.shift();
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
/** The grace window is still open: a Stop that has not been answered yet. */
|
|
227
|
+
pendingCancel(): boolean {
|
|
228
|
+
return this.#cancelSettle.pending();
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/** The prompt that a Stop must free, dispatched or still queued. */
|
|
232
|
+
private abandonOnStop(): void {
|
|
233
|
+
this.seams.cancelAgent();
|
|
234
|
+
this.seams.abandonPrompt();
|
|
185
235
|
}
|
|
186
236
|
|
|
187
237
|
/** Is a turn accepting the agent's frames right now? */
|
|
@@ -189,23 +239,18 @@ export class AcpTurns {
|
|
|
189
239
|
return this.open !== null;
|
|
190
240
|
}
|
|
191
241
|
|
|
192
|
-
/**
|
|
193
|
-
* v2's turn boundary: an idle `state_update` ends foreground work.
|
|
242
|
+
/** v2's turn boundary: an idle `state_update` ends foreground work.
|
|
194
243
|
*
|
|
195
|
-
*
|
|
196
|
-
*
|
|
197
|
-
*
|
|
198
|
-
* matches the turn id.
|
|
199
|
-
*/
|
|
244
|
+
* `running`/`requires_action` do not open a turn when a prompt is still being
|
|
245
|
+
* inserted; agent-initiated work with no prompt does. Repeats are idempotent
|
|
246
|
+
* because `settle` matches the turn id. */
|
|
200
247
|
onStateUpdate(update: Record<string, unknown>): void {
|
|
201
248
|
if (this.completion !== 'state') return;
|
|
202
249
|
const state = typeof update.state === 'string' ? update.state : '';
|
|
203
250
|
if (state !== 'idle') {
|
|
204
|
-
//
|
|
205
|
-
//
|
|
251
|
+
// A cancelled run's running/requires_action is not a new interval;
|
|
252
|
+
// foreground work with no prompt (a goal) does open one.
|
|
206
253
|
if (this.awaitingCancellation) return;
|
|
207
|
-
// v2 allows foreground work with no prompt (a goal, a follow-up on a
|
|
208
|
-
// background task). Open a turn so its frames are accepted and rendered.
|
|
209
254
|
if (this.open === null && !this.isPromptRunning && !this.isStreaming) this.beginAgentTurn();
|
|
210
255
|
return;
|
|
211
256
|
}
|
|
@@ -270,34 +315,18 @@ export class AcpTurns {
|
|
|
270
315
|
for (const toolCallId of abandoned) {
|
|
271
316
|
this.seams.emit({ type: 'tool_execution_end', toolCallId, isError: true, result: { output: 'Cancelled' } });
|
|
272
317
|
}
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
// the "silent answer is a failure" rule is a v1 agent behaviour (pi-acp).
|
|
286
|
-
// `stopReason: 'error'` is a failure even when the agent DID send a partial
|
|
287
|
-
// message: a v1 agent answers `{stopReason: 'error'}` with whatever it had
|
|
288
|
-
// streamed, and reading only "did it answer" reported that turn as
|
|
289
|
-
// completed — so a delegated worker whose provider failed mid-answer told
|
|
290
|
-
// its coordinator it had finished.
|
|
291
|
-
const failed = !cancelled && !slash
|
|
292
|
-
&& (stranded || reported || result?.stopReason === 'error' || (this.completion === 'response' && !answered));
|
|
293
|
-
const reason = failed
|
|
294
|
-
? failure ?? (stranded
|
|
295
|
-
? STRANDED_REASON
|
|
296
|
-
: closedFailure(closed) ?? (result?.stopReason === 'error'
|
|
297
|
-
? 'The agent ended the turn with an error'
|
|
298
|
-
: 'The agent ended the turn without sending an answer'))
|
|
299
|
-
: null;
|
|
300
|
-
if (failed && !reported && !slash) {
|
|
318
|
+
const { failed, cancelled, reason } = turnVerdict({
|
|
319
|
+
closed,
|
|
320
|
+
abandoned: abandoned.length,
|
|
321
|
+
result,
|
|
322
|
+
reported,
|
|
323
|
+
stranded,
|
|
324
|
+
promptText: this.promptText,
|
|
325
|
+
completion: this.completion,
|
|
326
|
+
strandedReason: STRANDED_REASON,
|
|
327
|
+
...(failure ? { failure } : {}),
|
|
328
|
+
});
|
|
329
|
+
if (failed && !reported && !reasonSuppressed(this.promptText)) {
|
|
301
330
|
this.seams.emit({
|
|
302
331
|
type: 'prompt_error',
|
|
303
332
|
errorMessage: reason ?? 'The agent ended the turn without sending an answer',
|
|
@@ -316,34 +345,3 @@ export class AcpTurns {
|
|
|
316
345
|
});
|
|
317
346
|
}
|
|
318
347
|
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* The reason the CLOSED message names, when it named one.
|
|
322
|
-
*
|
|
323
|
-
* The same rule as omp's: an agent records `stopReason` / `errorMessage` flat on
|
|
324
|
-
* the assistant message, and reading only the envelope's stop reason threw the
|
|
325
|
-
* provider's own words away — a coordinator was told "the agent ended the turn
|
|
326
|
-
* with an error" over a transcript that said which.
|
|
327
|
-
*/
|
|
328
|
-
function closedFailure(message: unknown): string | null {
|
|
329
|
-
if (!message || typeof message !== 'object' || Array.isArray(message)) return null;
|
|
330
|
-
const error = deriveTurnError(message as Record<string, unknown>);
|
|
331
|
-
return error?.message?.trim() || null;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
/** Does the closed message carry anything the timeline draws? A whitespace-only
|
|
335
|
-
* chunk (or one that carried only an empty text block) opens a message row
|
|
336
|
-
* that renders nothing, which is the same operator-visible failure as no frame
|
|
337
|
-
* at all. Thinking and tool calls are content: they render as their own
|
|
338
|
-
* blocks. */
|
|
339
|
-
function hasRenderableAnswer(message: unknown): boolean {
|
|
340
|
-
if (!message || typeof message !== 'object' || !('content' in message)) return false;
|
|
341
|
-
const content = message.content;
|
|
342
|
-
if (!Array.isArray(content)) return false;
|
|
343
|
-
return content.some((block) => {
|
|
344
|
-
if (!block || typeof block !== 'object') return false;
|
|
345
|
-
if ('text' in block && typeof block.text === 'string') return block.text.trim().length > 0;
|
|
346
|
-
if ('thinking' in block && typeof block.thinking === 'string') return block.thinking.trim().length > 0;
|
|
347
|
-
return 'type' in block && block.type === 'toolCall';
|
|
348
|
-
});
|
|
349
|
-
}
|
|
@@ -68,6 +68,15 @@ describe('normalizeInitializeResult', () => {
|
|
|
68
68
|
const v1 = { protocolVersion: 1, agentCapabilities: { loadSession: true } };
|
|
69
69
|
expect(normalizeInitializeResult(v1)).toBe(v1 as never);
|
|
70
70
|
});
|
|
71
|
+
|
|
72
|
+
test('a peer that reports 2 but answers in v1 shape is spoken to as v1', () => {
|
|
73
|
+
const init = normalizeInitializeResult({
|
|
74
|
+
protocolVersion: 2,
|
|
75
|
+
agentCapabilities: { loadSession: true, promptCapabilities: { image: true } },
|
|
76
|
+
});
|
|
77
|
+
expect(init.protocolVersion).toBe(1);
|
|
78
|
+
expect(init.agentCapabilities?.loadSession).toBe(true);
|
|
79
|
+
});
|
|
71
80
|
});
|
|
72
81
|
|
|
73
82
|
describe('normalizeConfigOptions', () => {
|
|
@@ -51,6 +51,15 @@ function advertised(value: unknown): boolean {
|
|
|
51
51
|
export function normalizeInitializeResult(raw: Record<string, unknown>): AcpInitializeResult {
|
|
52
52
|
const version = typeof raw.protocolVersion === 'number' ? raw.protocolVersion : 1;
|
|
53
53
|
if (version !== 2) return raw as unknown as AcpInitializeResult;
|
|
54
|
+
// A peer that REPORTS 2 but answers with v1's keys (`agentCapabilities`, and
|
|
55
|
+
// no `capabilities`) is speaking v1. Reading it as v2 finds no capabilities
|
|
56
|
+
// at all and, worse, sets the turn machine's completion mode to `state` — so
|
|
57
|
+
// the `session/prompt` answer that ends every v1 turn is ignored and the run
|
|
58
|
+
// hangs until the silence ceiling. bb's heuristic is the same: the shape, not
|
|
59
|
+
// the number, decides which generation a result is written in.
|
|
60
|
+
if (asRecord(raw.agentCapabilities) !== undefined && asRecord(raw.capabilities) === undefined) {
|
|
61
|
+
return { ...raw, protocolVersion: 1 } as AcpInitializeResult;
|
|
62
|
+
}
|
|
54
63
|
|
|
55
64
|
const capabilities = asRecord(raw.capabilities) ?? {};
|
|
56
65
|
const session = asRecord(capabilities.session);
|
|
@@ -112,6 +121,10 @@ export function normalizeAuthMethods(value: unknown): AcpInitializeResult['authM
|
|
|
112
121
|
name: asString(method?.name) ?? id,
|
|
113
122
|
...(asString(method?.description) ? { description: asString(method?.description) } : {}),
|
|
114
123
|
...(asString(method?.type) ? { type: asString(method?.type) } : {}),
|
|
124
|
+
...(Array.isArray(method?.args)
|
|
125
|
+
? { args: method.args.filter((arg): arg is string => typeof arg === 'string') }
|
|
126
|
+
: {}),
|
|
127
|
+
...(asRecord(method?.env) ? { env: asRecord(method?.env) as Record<string, string> } : {}),
|
|
115
128
|
}];
|
|
116
129
|
});
|
|
117
130
|
}
|
|
@@ -28,14 +28,20 @@ export type AcpNotify = (method: string, params: unknown) => void;
|
|
|
28
28
|
/** The negotiated major, so a verb can shape its params and normalize its answer. */
|
|
29
29
|
export type AcpDialect = 1 | 2;
|
|
30
30
|
|
|
31
|
+
/** The extra roots one setup request carries, when the agent advertised them. */
|
|
32
|
+
export interface SessionDirs {
|
|
33
|
+
additionalDirectories?: string[];
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
export async function newSession(
|
|
32
37
|
invoke: AcpInvoke,
|
|
33
38
|
cwd: string,
|
|
34
39
|
timeoutMs = 120_000,
|
|
35
40
|
dialect: AcpDialect = 1,
|
|
36
41
|
mcpServers: AcpMcpServerWire[] = [],
|
|
42
|
+
dirs: SessionDirs = {},
|
|
37
43
|
): Promise<AcpSessionNewResult> {
|
|
38
|
-
const result = await invoke<Record<string, unknown>>('session/new', { cwd, mcpServers }, timeoutMs);
|
|
44
|
+
const result = await invoke<Record<string, unknown>>('session/new', { cwd, mcpServers, ...dirs }, timeoutMs);
|
|
39
45
|
return dialect === 2 ? normalizeSessionResult(result) : (result as unknown as AcpSessionNewResult);
|
|
40
46
|
}
|
|
41
47
|
|
|
@@ -45,8 +51,9 @@ export async function loadSession(
|
|
|
45
51
|
cwd: string,
|
|
46
52
|
timeoutMs = 120_000,
|
|
47
53
|
mcpServers: AcpMcpServerWire[] = [],
|
|
54
|
+
dirs: SessionDirs = {},
|
|
48
55
|
): Promise<unknown> {
|
|
49
|
-
return invoke('session/load', { sessionId, cwd, mcpServers }, timeoutMs);
|
|
56
|
+
return invoke('session/load', { sessionId, cwd, mcpServers, ...dirs }, timeoutMs);
|
|
50
57
|
}
|
|
51
58
|
|
|
52
59
|
export async function resumeSession(
|
|
@@ -60,10 +67,11 @@ export async function resumeSession(
|
|
|
60
67
|
* `session/update` frames before the reply. v1 peers replay through
|
|
61
68
|
* `session/load` instead. */
|
|
62
69
|
replayFrom?: { type: 'start' },
|
|
70
|
+
dirs: SessionDirs = {},
|
|
63
71
|
): Promise<unknown> {
|
|
64
72
|
const result = await invoke<Record<string, unknown>>(
|
|
65
73
|
'session/resume',
|
|
66
|
-
{ sessionId, cwd, mcpServers, ...(dialect === 2 && replayFrom ? { replayFrom } : {}) },
|
|
74
|
+
{ sessionId, cwd, mcpServers, ...(dialect === 2 && replayFrom ? { replayFrom } : {}), ...dirs },
|
|
67
75
|
timeoutMs,
|
|
68
76
|
);
|
|
69
77
|
return dialect === 2 ? normalizeSessionResult(result) : result;
|
|
@@ -77,10 +85,11 @@ export async function forkSession(
|
|
|
77
85
|
target?: Record<string, unknown>,
|
|
78
86
|
meta?: Record<string, unknown>,
|
|
79
87
|
mcpServers: AcpMcpServerWire[] = [],
|
|
88
|
+
dirs: SessionDirs = {},
|
|
80
89
|
): Promise<AcpSessionNewResult> {
|
|
81
90
|
return invoke<AcpSessionNewResult>(
|
|
82
91
|
'session/fork',
|
|
83
|
-
{ sessionId, cwd, mcpServers, ...(target ? { target } : {}), ...(meta ? { _meta: meta } : {}) },
|
|
92
|
+
{ sessionId, cwd, mcpServers, ...dirs, ...(target ? { target } : {}), ...(meta ? { _meta: meta } : {}) },
|
|
84
93
|
timeoutMs,
|
|
85
94
|
);
|
|
86
95
|
}
|
|
@@ -187,6 +196,28 @@ export async function setMode(
|
|
|
187
196
|
return invoke('session/set_mode', { sessionId, modeId }, timeoutMs);
|
|
188
197
|
}
|
|
189
198
|
|
|
199
|
+
/** Sign this client in with one of the agent's advertised `authMethods`.
|
|
200
|
+
* `_meta.headless` tells the agent no interactive terminal is attached, so a
|
|
201
|
+
* method that needs one refuses instead of parking the spawn. */
|
|
202
|
+
export async function authenticate(
|
|
203
|
+
invoke: AcpInvoke,
|
|
204
|
+
methodId: string,
|
|
205
|
+
timeoutMs = 120_000,
|
|
206
|
+
): Promise<unknown> {
|
|
207
|
+
return invoke('authenticate', { methodId, _meta: { headless: true } }, timeoutMs);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/** `session/set_model`: select a model on an agent that publishes a `models`
|
|
211
|
+
* block instead of a `model` config option (measured on grok). */
|
|
212
|
+
export async function setModel(
|
|
213
|
+
invoke: AcpInvoke,
|
|
214
|
+
sessionId: string,
|
|
215
|
+
modelId: string,
|
|
216
|
+
timeoutMs = 30_000,
|
|
217
|
+
): Promise<unknown> {
|
|
218
|
+
return invoke('session/set_model', { sessionId, modelId }, timeoutMs);
|
|
219
|
+
}
|
|
220
|
+
|
|
190
221
|
/** Remove one session from the agent's own history (`sessionCapabilities.delete`). */
|
|
191
222
|
export async function deleteSession(invoke: AcpInvoke, sessionId: string, timeoutMs = 30_000): Promise<unknown> {
|
|
192
223
|
return invoke('session/delete', { sessionId }, timeoutMs);
|
|
@@ -32,6 +32,16 @@ export interface HarnessCapabilities {
|
|
|
32
32
|
hasPlan: boolean;
|
|
33
33
|
/** How mid-turn input works, or null when the agent has no way to take it. */
|
|
34
34
|
steerMode: 'steer' | 'follow-up' | null;
|
|
35
|
+
/**
|
|
36
|
+
* The MCP transports the agent advertised beyond the stdio baseline.
|
|
37
|
+
*
|
|
38
|
+
* ACP's `mcpCapabilities` is optional: stdio is always accepted, while
|
|
39
|
+
* `http`/`sse` are only real when the agent says so. The navbar list and the
|
|
40
|
+
* handshake both read this, so a server the agent cannot accept is neither
|
|
41
|
+
* sent nor shown as delivered. Absent on a probe recorded before this field
|
|
42
|
+
* existed, which the readers treat as "not advertised".
|
|
43
|
+
*/
|
|
44
|
+
mcpCapabilities?: { http: boolean; sse: boolean };
|
|
35
45
|
agentName?: string;
|
|
36
46
|
agentVersion?: string;
|
|
37
47
|
/** Why the harness is unusable, when it is: an auth method id, a missing
|
|
@@ -53,6 +63,7 @@ export const UNPROBED_CAPABILITIES: HarnessCapabilities = {
|
|
|
53
63
|
hasUsage: false,
|
|
54
64
|
hasPlan: false,
|
|
55
65
|
steerMode: null,
|
|
66
|
+
mcpCapabilities: { http: false, sse: false },
|
|
56
67
|
};
|
|
57
68
|
|
|
58
69
|
/** Spawn-time capability read: one ACP session, then dispose. */
|
|
@@ -222,4 +222,23 @@ export const HARNESS_LAUNCH: Readonly<Partial<Record<HarnessId, HarnessLaunch>>>
|
|
|
222
222
|
install: 'curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash # then: cd ~/.hermes/hermes-agent && python -c "import pm; pm.sync_venv([\'acp\'], explicit=True)"',
|
|
223
223
|
note: 'native ACP (`hermes acp`); the `acp` extra must be synced once or the subcommand does not exist. Configure a provider with `hermes model` (or ~/.hermes/config.yaml / .env) before a turn succeeds; models are published as `provider:model`',
|
|
224
224
|
},
|
|
225
|
+
// OmO Native ships no ACP server of its own (measured against 5.1.x: no
|
|
226
|
+
// `acp` subcommand). It is a senpi (pi fork) engine, so the `pi-acp` adapter
|
|
227
|
+
// drives it over `omo --mode rpc`; `PI_ACP_PI_COMMAND` is the adapter's own
|
|
228
|
+
// override for the binary it spawns. Measured through Kabmo's ACP client on
|
|
229
|
+
// 5.1.9: initialize + session/new answered, 69 models · 3 thought levels,
|
|
230
|
+
// list/delete advertised.
|
|
231
|
+
omo: {
|
|
232
|
+
id: 'omo',
|
|
233
|
+
command: ['npx', '-y', 'pi-acp@0.0.34'],
|
|
234
|
+
env: { PI_ACP_PI_COMMAND: 'omo' },
|
|
235
|
+
// The adapter spawns `omo`; `npx` being present says nothing about whether
|
|
236
|
+
// a chat can run.
|
|
237
|
+
requires: {
|
|
238
|
+
binary: 'omo',
|
|
239
|
+
label: 'OmO Native (`omo`)',
|
|
240
|
+
},
|
|
241
|
+
install: 'curl -fsSL https://get.omo.dev/install.sh | bash # then run `omo setup` once',
|
|
242
|
+
note: 'bridges `omo --mode rpc` through pi-acp; OmO Native is a senpi (pi fork) engine. Run `omo setup` (or `/login`) once before a turn succeeds; models are published as `provider/model`',
|
|
243
|
+
},
|
|
225
244
|
};
|
|
@@ -100,6 +100,10 @@ export function capabilitiesFrom(
|
|
|
100
100
|
hasUsage: observed.usage,
|
|
101
101
|
hasPlan: observed.plan,
|
|
102
102
|
steerMode: steeringSupported ? 'steer' : null,
|
|
103
|
+
mcpCapabilities: {
|
|
104
|
+
http: caps.mcpCapabilities?.http === true,
|
|
105
|
+
sse: caps.mcpCapabilities?.sse === true,
|
|
106
|
+
},
|
|
103
107
|
...(init.agentInfo?.name ? { agentName: init.agentInfo.name } : {}),
|
|
104
108
|
...(init.agentInfo?.version ? { agentVersion: init.agentInfo.version } : {}),
|
|
105
109
|
};
|
|
@@ -158,6 +158,28 @@ const ACP_TRANSCRIPTS_SQL = `
|
|
|
158
158
|
);
|
|
159
159
|
`;
|
|
160
160
|
|
|
161
|
+
/**
|
|
162
|
+
* The raw `session/update` notifications an ACP session received.
|
|
163
|
+
*
|
|
164
|
+
* The transcript is Kabmo's REFACTORED view (one row per message, tool calls
|
|
165
|
+
* folded in). The raw panel is the place a user checks what the agent actually
|
|
166
|
+
* sent, so it reads these frames — the original ACP payloads — not the fold.
|
|
167
|
+
* `kind`/`role` are denormalized at write time so the panel can page and filter
|
|
168
|
+
* without parsing every payload.
|
|
169
|
+
*/
|
|
170
|
+
const ACP_FRAMES_SQL = `
|
|
171
|
+
CREATE TABLE IF NOT EXISTS acp_frames (
|
|
172
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
173
|
+
session_id TEXT NOT NULL,
|
|
174
|
+
method TEXT NOT NULL,
|
|
175
|
+
kind TEXT NOT NULL,
|
|
176
|
+
role TEXT NOT NULL,
|
|
177
|
+
payload TEXT NOT NULL,
|
|
178
|
+
created_at INTEGER NOT NULL
|
|
179
|
+
);
|
|
180
|
+
CREATE INDEX IF NOT EXISTS acp_frames_session ON acp_frames(session_id, id);
|
|
181
|
+
`;
|
|
182
|
+
|
|
161
183
|
/** Idempotent: created on every database open, like every other feature table. */
|
|
162
184
|
export async function ensureHarnessSchema(db: DbClient): Promise<void> {
|
|
163
185
|
await db.exec(HARNESS_SESSIONS_SQL);
|
|
@@ -166,6 +188,7 @@ export async function ensureHarnessSchema(db: DbClient): Promise<void> {
|
|
|
166
188
|
await db.exec(HARNESS_GOAL_STATE_SQL);
|
|
167
189
|
await db.exec(HARNESS_USAGE_STATE_SQL);
|
|
168
190
|
await db.exec(ACP_TRANSCRIPTS_SQL);
|
|
191
|
+
await db.exec(ACP_FRAMES_SQL);
|
|
169
192
|
for (const migration of HARNESS_SESSIONS_MIGRATIONS) {
|
|
170
193
|
try {
|
|
171
194
|
await db.exec(migration);
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
import { AcpSession } from '@/server/lib/harness/acp/session';
|
|
24
24
|
import { AcpTranscriptRecorder } from '@/server/lib/harness/acp/session-transcript.server';
|
|
25
|
+
import { AcpFrameRecorder } from '@/server/lib/harness/acp/acp-frames.server';
|
|
25
26
|
import { claimPrewarmedAcpSession } from '@/server/lib/harness/acp/prewarm.server';
|
|
26
27
|
import { rememberAgentToken } from '@/server/lib/sessions/agent-token.server';
|
|
27
28
|
import { loadHarnessConfig, resolveLaunch } from '@/server/lib/harness/config.server';
|
|
@@ -36,6 +37,7 @@ import { emitRealtimeSignal } from '@/server/lib/realtime/signals.server';
|
|
|
36
37
|
import { harnessDescriptor, type HarnessId } from '@/shared/lib/harness/catalog';
|
|
37
38
|
import { mcpDelivery } from '@/shared/lib/harness/mcp-facts';
|
|
38
39
|
import { mcpServersFor, toAcpMcpServers } from '@/server/lib/mcp/registry.server';
|
|
40
|
+
import { resolveMcpDefinition } from '@/server/lib/mcp/secrets.server';
|
|
39
41
|
import { readSessionMcpOverrides } from '@/server/lib/mcp/session-state.server';
|
|
40
42
|
import { ensureCustomHarnesses } from '@/server/lib/harness/custom.server';
|
|
41
43
|
import type { HarnessConfig } from '@/shared/lib/harness/config';
|
|
@@ -138,9 +140,18 @@ export async function openAcpSession(
|
|
|
138
140
|
// The session's own overrides are applied here, which is what makes a toggle
|
|
139
141
|
// per-session: the list is an argument to `session/new|load`, not a file.
|
|
140
142
|
const overrides = await readSessionMcpOverrides(request.sessionId);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
+
// `!command` and bare-env values are omp's own indirection; an ACP agent
|
|
144
|
+
// receives the list as JSON and would get the literal string. Resolve them
|
|
145
|
+
// here, before the wire shape, so the agent gets the header omp would have
|
|
146
|
+
// sent — and so the navbar's probe answers for the same server.
|
|
147
|
+
const definitions = mcpDelivery(request.harness) === 'acp'
|
|
148
|
+
? await Promise.all(
|
|
149
|
+
(await mcpServersFor(request.cwd, { overrides })).map((definition) =>
|
|
150
|
+
resolveMcpDefinition(definition, request.cwd),
|
|
151
|
+
),
|
|
152
|
+
)
|
|
143
153
|
: [];
|
|
154
|
+
const mcpServers = toAcpMcpServers(definitions);
|
|
144
155
|
// Built here rather than behind a factory in the session module: this is the
|
|
145
156
|
// only place a session is constructed, and the handshake it runs (load vs
|
|
146
157
|
// new) is decided by the request this function already holds.
|
|
@@ -229,6 +240,10 @@ export async function startAcpSession(
|
|
|
229
240
|
await recorder.hydrate();
|
|
230
241
|
session.onEvent((event) => recorder.record(event));
|
|
231
242
|
}
|
|
243
|
+
// The raw panel reads the original `session/update` payloads, not the fold
|
|
244
|
+
// above. A restore replays the agent's history and must not duplicate it.
|
|
245
|
+
const frameRecorder = request.replay ? null : new AcpFrameRecorder(() => realSessionId);
|
|
246
|
+
if (frameRecorder) session.onRawNotification((method, params) => frameRecorder.record(method, params));
|
|
232
247
|
if (warm) {
|
|
233
248
|
// The process's environment already carries the credential minted at
|
|
234
249
|
// prewarm; recording a different one here would authenticate its callbacks
|
|
@@ -246,6 +261,7 @@ export async function startAcpSession(
|
|
|
246
261
|
registerAcpSession(session, request.sessionId, () => {
|
|
247
262
|
if (pid) removeHarnessLease(pid);
|
|
248
263
|
recorder?.dispose();
|
|
264
|
+
frameRecorder?.dispose();
|
|
249
265
|
});
|
|
250
266
|
// Record the ownership BEFORE the first frame is forwarded: the sidebar reads
|
|
251
267
|
// this table, not the live registry, so a row written late would draw the row
|