@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
|
@@ -4,11 +4,12 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* Reading the raw stream behind
|
|
7
|
+
* Reading the raw stream behind a spilled tool result.
|
|
8
8
|
*
|
|
9
|
-
* omp spills a long tool result to `<sessionDir>/<sessionId>/<id
|
|
10
|
-
* and leaves only a truncated body in the
|
|
11
|
-
*
|
|
9
|
+
* omp 19.0.0 spills a long tool result to `<sessionDir>/<sessionId>/<id>.log`
|
|
10
|
+
* (a `local://<id>.log` file) and leaves only a truncated body in the
|
|
11
|
+
* transcript; before it the file was `<id>.<kind>.log`. Nothing in Kabmo read
|
|
12
|
+
* either, so 65 real results (the longest in the corpus) stopped at the 768
|
|
12
13
|
* bytes the transcript kept.
|
|
13
14
|
*
|
|
14
15
|
* The id and kind reach this module from a session transcript — a document the
|
|
@@ -48,6 +49,8 @@ beforeAll(async () => {
|
|
|
48
49
|
await fsp.writeFile(path.join(sessionDir, '420.bash.log'), 'full build log\nsecond line\n');
|
|
49
50
|
await fsp.writeFile(path.join(sessionDir, '213.eval.log'), 'eval output\n');
|
|
50
51
|
await fsp.writeFile(path.join(sessionDir, '420.read.log'), 'read output\n');
|
|
52
|
+
// 19.0.0: the spill is `<id>.log` at the session's local:// root, no kind.
|
|
53
|
+
await fsp.writeFile(path.join(sessionDir, '500.log'), 'spilled by 19.0.0\n');
|
|
51
54
|
clearSessionFileCaches();
|
|
52
55
|
});
|
|
53
56
|
|
|
@@ -69,7 +72,14 @@ describe('isArtifactKind', () => {
|
|
|
69
72
|
});
|
|
70
73
|
|
|
71
74
|
describe('readArtifact', () => {
|
|
72
|
-
test('reads
|
|
75
|
+
test('reads a 19.0.0 local:// spill, which carries no kind in its name', async () => {
|
|
76
|
+
const artifact = await readArtifact(SESSION_ID, '500', 'bash');
|
|
77
|
+
expect(artifact?.text).toBe('spilled by 19.0.0\n');
|
|
78
|
+
expect(artifact?.kind).toBe('spill');
|
|
79
|
+
expect(artifact?.truncated).toBe(false);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
test('reads the legacy stream omp spilled for the id', async () => {
|
|
73
83
|
const artifact = await readArtifact(SESSION_ID, '420', 'bash');
|
|
74
84
|
expect(artifact?.text).toBe('full build log\nsecond line\n');
|
|
75
85
|
expect(artifact?.kind).toBe('bash');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The raw output behind
|
|
7
|
+
* The raw output behind a spilled tool result.
|
|
8
8
|
*
|
|
9
9
|
* When a tool result is too long to keep inline omp spills the whole stream to
|
|
10
10
|
* a file beside the session and leaves a `columnTruncated.artifactId` in the
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
* served none of it, so those results were truncated at 768 bytes with no way
|
|
15
15
|
* to see the rest.
|
|
16
16
|
*
|
|
17
|
-
*
|
|
17
|
+
* omp 19.0.0 replaced `artifact://<id>` with a `local://<id>.log` file at the
|
|
18
|
+
* session's `local://` root, so the layout is now:
|
|
18
19
|
* <sessionsDir>/<cwd-dir>/<sessionFile>.jsonl the transcript
|
|
19
|
-
* <sessionsDir>/<cwd-dir>/<
|
|
20
|
-
*
|
|
21
|
-
* and
|
|
20
|
+
* <sessionsDir>/<cwd-dir>/<sessionFile>/<id>.log the spilled stream
|
|
21
|
+
* Before 19.0.0 the file carried the tool's kind in its name
|
|
22
|
+
* (`<id>.<kind>.log`), and sessions recorded then still name one, so both
|
|
23
|
+
* layouts are read. The kind is no longer part of the path; a new spill is
|
|
24
|
+
* reported as `spill`.
|
|
22
25
|
*
|
|
23
26
|
* Every guard here is a path boundary: the id must be digits, the kind must be
|
|
24
27
|
* one of omp's own, and the resolved path must still sit inside the session's
|
|
@@ -33,9 +36,9 @@ import * as path from 'node:path';
|
|
|
33
36
|
import { findSessionFileById } from '@/server/lib/omp/session/locator';
|
|
34
37
|
import { siblingDirForSession } from '@/server/lib/omp/subagent/history/paths';
|
|
35
38
|
|
|
36
|
-
/** omp's
|
|
39
|
+
/** omp's legacy artifact kinds, from the filenames it wrote before 19.0.0. */
|
|
37
40
|
export const ARTIFACT_KINDS = ['bash', 'bash-original', 'eval', 'read', 'async'] as const;
|
|
38
|
-
export type ArtifactKind = (typeof ARTIFACT_KINDS)[number];
|
|
41
|
+
export type ArtifactKind = (typeof ARTIFACT_KINDS)[number] | 'spill';
|
|
39
42
|
|
|
40
43
|
/** A numeric artifact id; anything else never reaches a path join. */
|
|
41
44
|
const ARTIFACT_ID_RE = /^\d+$/;
|
|
@@ -49,20 +52,38 @@ export interface ArtifactText {
|
|
|
49
52
|
truncated: boolean;
|
|
50
53
|
/** Total file size in bytes, so a caller can say how much was elided. */
|
|
51
54
|
size: number;
|
|
52
|
-
/** The kind the artifact was found under. */
|
|
55
|
+
/** The kind the artifact was found under; `spill` for a 19.0.0 `local://` file. */
|
|
53
56
|
kind: ArtifactKind;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
/** True when `kind` is
|
|
57
|
-
export function isArtifactKind(kind: string): kind is
|
|
59
|
+
/** True when `kind` is a legacy kind omp actually wrote into a filename. */
|
|
60
|
+
export function isArtifactKind(kind: string): kind is (typeof ARTIFACT_KINDS)[number] {
|
|
58
61
|
return (ARTIFACT_KINDS as readonly string[]).includes(kind);
|
|
59
62
|
}
|
|
60
63
|
|
|
64
|
+
/** Read one file, keeping the tail when it exceeds the cap. */
|
|
65
|
+
async function readCapped(filePath: string, size: number, kind: ArtifactKind): Promise<ArtifactText> {
|
|
66
|
+
if (size <= MAX_ARTIFACT_BYTES) {
|
|
67
|
+
return { text: await fsp.readFile(filePath, 'utf8'), truncated: false, size, kind };
|
|
68
|
+
}
|
|
69
|
+
// Too big to serve whole: keep the tail, which is where a log's answer is.
|
|
70
|
+
const handle = await fsp.open(filePath, 'r');
|
|
71
|
+
try {
|
|
72
|
+
const buffer = Buffer.alloc(MAX_ARTIFACT_BYTES);
|
|
73
|
+
await handle.read(buffer, 0, MAX_ARTIFACT_BYTES, size - MAX_ARTIFACT_BYTES);
|
|
74
|
+
return { text: buffer.toString('utf8'), truncated: true, size, kind };
|
|
75
|
+
} finally {
|
|
76
|
+
await handle.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
61
80
|
/**
|
|
62
81
|
* Read one spilled tool output, or null when the session, the id or the file
|
|
63
82
|
* cannot be resolved.
|
|
64
83
|
*
|
|
65
|
-
* The
|
|
84
|
+
* The 19.0.0 layout is probed first: `<id>.log` at the session's `local://`
|
|
85
|
+
* root. A session recorded before the pin keeps `<id>.<kind>.log`, where the
|
|
86
|
+
* kind is probed rather than required — a caller reading a transcript sees
|
|
66
87
|
* `artifactId` without the kind that produced it, and a session can hold an
|
|
67
88
|
* `eval` and a `bash` artifact under the same id (they are numbered per tool).
|
|
68
89
|
* The caller may pass the kind it knows; otherwise the first match in
|
|
@@ -80,27 +101,21 @@ export async function readArtifact(
|
|
|
80
101
|
const dir = siblingDirForSession(sessionFile);
|
|
81
102
|
if (!existsSync(dir)) return null;
|
|
82
103
|
|
|
104
|
+
const spillPath = path.join(dir, `${artifactId}.log`);
|
|
105
|
+
// Boundary check: the id is digits, but the resolved path is what actually
|
|
106
|
+
// reaches the filesystem.
|
|
107
|
+
if (spillPath.startsWith(`${dir}${path.sep}`)) {
|
|
108
|
+
const stat = await fsp.stat(spillPath).catch(() => null);
|
|
109
|
+
if (stat?.isFile()) return readCapped(spillPath, stat.size, 'spill');
|
|
110
|
+
}
|
|
111
|
+
|
|
83
112
|
const candidates = kind && isArtifactKind(kind) ? [kind] : [...ARTIFACT_KINDS];
|
|
84
113
|
for (const candidate of candidates) {
|
|
85
114
|
const filePath = path.join(dir, `${artifactId}.${candidate}.log`);
|
|
86
|
-
// Boundary check: the id is digits and the kind is from the table, but the
|
|
87
|
-
// resolved path is what actually reaches the filesystem.
|
|
88
115
|
if (!filePath.startsWith(`${dir}${path.sep}`)) continue;
|
|
89
116
|
const stat = await fsp.stat(filePath).catch(() => null);
|
|
90
117
|
if (!stat?.isFile()) continue;
|
|
91
|
-
|
|
92
|
-
if (stat.size <= MAX_ARTIFACT_BYTES) {
|
|
93
|
-
return { text: await fsp.readFile(filePath, 'utf8'), truncated: false, size: stat.size, kind: candidate };
|
|
94
|
-
}
|
|
95
|
-
// Too big to serve whole: keep the tail, which is where a log's answer is.
|
|
96
|
-
const handle = await fsp.open(filePath, 'r');
|
|
97
|
-
try {
|
|
98
|
-
const buffer = Buffer.alloc(MAX_ARTIFACT_BYTES);
|
|
99
|
-
await handle.read(buffer, 0, MAX_ARTIFACT_BYTES, stat.size - MAX_ARTIFACT_BYTES);
|
|
100
|
-
return { text: buffer.toString('utf8'), truncated: true, size: stat.size, kind: candidate };
|
|
101
|
-
} finally {
|
|
102
|
-
await handle.close();
|
|
103
|
-
}
|
|
118
|
+
return readCapped(filePath, stat.size, candidate);
|
|
104
119
|
}
|
|
105
120
|
return null;
|
|
106
121
|
}
|
|
@@ -74,6 +74,8 @@ const SESSION_ROW_DELETES: readonly (readonly [string, string])[] = [
|
|
|
74
74
|
// second copy of the same conversation, so a delete that left it behind would
|
|
75
75
|
// resurrect the transcript on the next open.
|
|
76
76
|
['acp_transcripts', 'session_id'],
|
|
77
|
+
// The raw `session/update` log the context panel's Raw Messages view reads.
|
|
78
|
+
['acp_frames', 'session_id'],
|
|
77
79
|
['files', 'session_id'],
|
|
78
80
|
// An ACP chat has no transcript for the scan to lose: `harness_sessions` IS
|
|
79
81
|
// its row, so leaving it behind both refused the delete as "not found" (nothing
|
|
@@ -86,6 +88,9 @@ const SESSION_ROW_DELETES: readonly (readonly [string, string])[] = [
|
|
|
86
88
|
// The per-session MCP overrides and the agent-dir overlay they build. The
|
|
87
89
|
// row is keyed to the id; the directory is removed below.
|
|
88
90
|
['session_mcp_state', 'session_id'],
|
|
91
|
+
// An ACP chat's standing "always allow" decisions. A deleted chat that kept
|
|
92
|
+
// them would re-approve the same commands if its id were ever reused.
|
|
93
|
+
['acp_permission_grants', 'session_id'],
|
|
89
94
|
];
|
|
90
95
|
|
|
91
96
|
async function purgeKabmoRows(db: DbClient, sessionId: string): Promise<number> {
|
|
@@ -26,8 +26,7 @@
|
|
|
26
26
|
* window it occupies is real time the UI can honestly report as "evaluating".
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import {
|
|
30
|
-
import { resolveOmpBin } from '@/server/lib/omp/core/cli';
|
|
29
|
+
import { runOmpPrint } from '@/server/lib/omp/core/print.server';
|
|
31
30
|
|
|
32
31
|
export interface GoalAuditAnswers {
|
|
33
32
|
allDone: boolean;
|
|
@@ -127,10 +126,6 @@ export function decideGoalProgress(answers: GoalAuditAnswers): GoalVerdict {
|
|
|
127
126
|
return 'continue';
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
async function readStream(stream: ReadableStream<Uint8Array>): Promise<string> {
|
|
131
|
-
return await new Response(stream).text();
|
|
132
|
-
}
|
|
133
|
-
|
|
134
129
|
export interface GoalAuditDeps {
|
|
135
130
|
resolveBin?: () => string | null;
|
|
136
131
|
}
|
|
@@ -141,47 +136,14 @@ export async function runGoalAudit(
|
|
|
141
136
|
request: GoalAuditRequest,
|
|
142
137
|
deps: GoalAuditDeps = {},
|
|
143
138
|
): Promise<GoalAuditAnswers | null> {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// `--thinking off` is not a shortcut, it is the audit's whole cost profile:
|
|
148
|
-
// measured on this machine, a one-line reply took 26.7 s with reasoning on
|
|
149
|
-
// and 4.5 s with it off — and the auditor is a classification, not a task.
|
|
150
|
-
const args = ['-p', '--no-session', '--no-tools', '--no-lsp', '--thinking', 'off', '--cwd', request.cwd];
|
|
151
|
-
if (request.model) args.push('--model', request.model);
|
|
152
|
-
|
|
153
|
-
try {
|
|
154
|
-
const proc = Bun.spawn({
|
|
155
|
-
cmd: [bin, ...args],
|
|
139
|
+
const outcome = await runOmpPrint(
|
|
140
|
+
{
|
|
141
|
+
prompt: buildGoalAuditPrompt(request.objective, request.answer),
|
|
156
142
|
cwd: request.cwd,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
windowsHide: true,
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
const killer = setTimeout(() => {
|
|
167
|
-
void proc.kill();
|
|
168
|
-
}, request.timeoutMs ?? GOAL_AUDIT_TIMEOUT_MS);
|
|
169
|
-
|
|
170
|
-
try {
|
|
171
|
-
// The prompt goes on stdin, not on the command line: an excerpt can be
|
|
172
|
-
// 10 KB, and `omp -p` reads stdin when no message argument is given.
|
|
173
|
-
proc.stdin.write(buildGoalAuditPrompt(request.objective, request.answer));
|
|
174
|
-
await proc.stdin.end();
|
|
175
|
-
const [stdout, exitCode] = await Promise.all([readStream(proc.stdout), proc.exited]);
|
|
176
|
-
if (exitCode !== 0) return null;
|
|
177
|
-
return readGoalAuditAnswers(stdout);
|
|
178
|
-
} finally {
|
|
179
|
-
clearTimeout(killer);
|
|
180
|
-
void readStream(proc.stderr).catch(() => '');
|
|
181
|
-
}
|
|
182
|
-
} catch {
|
|
183
|
-
// A spawn failure (out of descriptors) is an audit that could not be
|
|
184
|
-
// taken, not a verdict.
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
143
|
+
...(request.model ? { model: request.model } : {}),
|
|
144
|
+
...(request.timeoutMs !== undefined ? { timeoutMs: request.timeoutMs } : {}),
|
|
145
|
+
},
|
|
146
|
+
deps,
|
|
147
|
+
);
|
|
148
|
+
return outcome.ok ? readGoalAuditAnswers(outcome.text) : null;
|
|
187
149
|
}
|
|
@@ -27,7 +27,7 @@ import { loadSessionSource } from '@/server/lib/chat/session-store.server';
|
|
|
27
27
|
import { computeRealSessionTelemetry } from '@/server/lib/omp/session/telemetry';
|
|
28
28
|
import { getLiveSession, harnessOfSession } from '@/server/lib/omp/rpc/session-registry';
|
|
29
29
|
import { loadAcpSessions } from '@/server/lib/harness/session-store.server';
|
|
30
|
-
import {
|
|
30
|
+
import { acpTelemetryFor } from '@/server/lib/harness/acp/acp-telemetry.server';
|
|
31
31
|
import { buildAcpTodos } from '@/server/lib/harness/acp/acp-todos.server';
|
|
32
32
|
import { isMockMode } from '@/server/mock.server';
|
|
33
33
|
import type { SessionTodosPayload } from '@/shared/types/todo';
|
|
@@ -96,19 +96,11 @@ function telemetryDescriptor(sessionId: string): TopicDescriptor {
|
|
|
96
96
|
if (isMockMode()) return null;
|
|
97
97
|
// A live ACP session reports usage itself; there is no transcript to
|
|
98
98
|
// compute from, and returning null left the ring and the Context panel
|
|
99
|
-
// saying "not started" over a running chat.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
// The process is gone, but the last usage it reported is on disk. omp
|
|
106
|
-
// recomputes from its JSONL; this is the ACP equivalent.
|
|
107
|
-
const stored = await loadAcpUsage(sessionId);
|
|
108
|
-
if (stored) {
|
|
109
|
-
const row = (await loadAcpSessions().catch(() => [])).find((entry) => entry.sessionId === sessionId);
|
|
110
|
-
if (row) return buildAcpTelemetry(stored, row.title);
|
|
111
|
-
}
|
|
99
|
+
// saying "not started" over a running chat. The same resolver answers
|
|
100
|
+
// the HTTP fallback, so the two paths cannot disagree.
|
|
101
|
+
const row = (await loadAcpSessions().catch(() => [])).find((entry) => entry.sessionId === sessionId);
|
|
102
|
+
const acp = await acpTelemetryFor(sessionId, row?.title);
|
|
103
|
+
if (acp) return acp;
|
|
112
104
|
const source = await loadSessionSource(sessionId);
|
|
113
105
|
// The real computation reads the session's JSONL; the in-memory source
|
|
114
106
|
// has no file to point at, so those sessions answer nothing here and the
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
7
|
+
import fs from 'node:fs';
|
|
8
|
+
import path from 'node:path';
|
|
9
|
+
import { action } from '@/server/routes/fs/git-message';
|
|
10
|
+
import { getDb } from '@/server/db.server';
|
|
11
|
+
import { writeSettingsJson } from '@/server/lib/db/settings-store';
|
|
12
|
+
import { SETTINGS_BLOB_KEY } from '@/shared/lib/settings/keys';
|
|
13
|
+
import { isolateDb, releaseDb } from '@/test-support/isolated-db';
|
|
14
|
+
import { removeDir } from '@/test-support/remove-dir';
|
|
15
|
+
|
|
16
|
+
const FIXTURE_ROOT = path.join(process.cwd(), 'tmp-test-git-message');
|
|
17
|
+
const repos: string[] = [];
|
|
18
|
+
|
|
19
|
+
function makeRepo(): string {
|
|
20
|
+
fs.mkdirSync(FIXTURE_ROOT, { recursive: true });
|
|
21
|
+
const dir = fs.mkdtempSync(path.join(FIXTURE_ROOT, 'repo-'));
|
|
22
|
+
repos.push(dir);
|
|
23
|
+
const result = Bun.spawnSync({ cmd: ['git', 'init', '-q', '-b', 'main'], cwd: dir });
|
|
24
|
+
if (result.exitCode !== 0) throw new Error(result.stderr.toString());
|
|
25
|
+
return dir;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function post(body: unknown): Promise<{ status: number; body: { error?: string; code?: string } }> {
|
|
29
|
+
const response = await action({
|
|
30
|
+
request: new Request('http://localhost/api/fs/git-message', {
|
|
31
|
+
method: 'POST',
|
|
32
|
+
headers: { 'content-type': 'application/json' },
|
|
33
|
+
body: JSON.stringify(body),
|
|
34
|
+
}),
|
|
35
|
+
} as never) as Response;
|
|
36
|
+
return { status: response.status, body: (await response.json()) as { error?: string; code?: string } };
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
beforeEach(async () => {
|
|
40
|
+
await isolateDb();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
afterEach(async () => {
|
|
44
|
+
await releaseDb();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
afterAll(() => {
|
|
48
|
+
for (const dir of repos) removeDir(dir);
|
|
49
|
+
removeDir(FIXTURE_ROOT);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe('POST /api/fs/git-message', () => {
|
|
53
|
+
test('GET is a 405, not a 404', async () => {
|
|
54
|
+
const response = await action({
|
|
55
|
+
request: new Request('http://localhost/api/fs/git-message'),
|
|
56
|
+
} as never) as Response;
|
|
57
|
+
expect(response.status).toBe(405);
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
test('an unreadable body is a 400', async () => {
|
|
61
|
+
const response = await action({
|
|
62
|
+
request: new Request('http://localhost/api/fs/git-message', {
|
|
63
|
+
method: 'POST',
|
|
64
|
+
headers: { 'content-type': 'application/json' },
|
|
65
|
+
body: '{',
|
|
66
|
+
}),
|
|
67
|
+
} as never) as Response;
|
|
68
|
+
expect(response.status).toBe(400);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
test('a repo path outside the root is a 403', async () => {
|
|
72
|
+
const dir = makeRepo();
|
|
73
|
+
const result = await post({ root: dir, repo: '../escape' });
|
|
74
|
+
expect(result.status).toBe(403);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
test('an empty change set is a 409 before any model call', async () => {
|
|
78
|
+
const dir = makeRepo();
|
|
79
|
+
const db = await getDb();
|
|
80
|
+
await writeSettingsJson(db, SETTINGS_BLOB_KEY, {
|
|
81
|
+
commitMessageMode: 'omp',
|
|
82
|
+
commitMessageModel: 'p/t',
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const result = await post({ root: dir, repo: '.' });
|
|
86
|
+
|
|
87
|
+
expect(result.status).toBe(409);
|
|
88
|
+
expect(result.body.code).toBe('nothing_staged');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
test('off is a 409 with the settings reason', async () => {
|
|
92
|
+
const dir = makeRepo();
|
|
93
|
+
const db = await getDb();
|
|
94
|
+
await writeSettingsJson(db, SETTINGS_BLOB_KEY, { commitMessageMode: 'off' });
|
|
95
|
+
|
|
96
|
+
const result = await post({ root: dir, repo: '.' });
|
|
97
|
+
|
|
98
|
+
expect(result.status).toBe(409);
|
|
99
|
+
expect(result.body.code).toBe('commit_message_off');
|
|
100
|
+
});
|
|
101
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `POST /api/fs/git-message` — write a commit message from the staged change
|
|
8
|
+
* set, through the harness the user runs.
|
|
9
|
+
*
|
|
10
|
+
* A separate route from `/api/fs/git` on purpose: that module's `action` is a
|
|
11
|
+
* dispatch table of GIT mutations, and this is a model call. Keeping it out of
|
|
12
|
+
* the table means a generation failure cannot be mistaken for a failed commit,
|
|
13
|
+
* and the route can answer its own status codes (409 for "nothing staged",
|
|
14
|
+
* 504 for a timeout) without teaching the git action envelope about them.
|
|
15
|
+
*
|
|
16
|
+
* The body is JSON, not form data: the request carries no file operand, and the
|
|
17
|
+
* only fields are the scope (`root`, `repo`), the optional `sessionId` that
|
|
18
|
+
* decides the `auto` harness, and the amend flag.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import path from 'path';
|
|
22
|
+
import { json, type ActionFunctionArgs } from '@/server/lib/remix-compat';
|
|
23
|
+
import { methodNotAllowed } from '@/server/lib/route-adapter';
|
|
24
|
+
import { getDefaultFsRoot, resolveRoot } from '@/server/lib/fs/root';
|
|
25
|
+
import { isMockMode } from '@/server/mock.server';
|
|
26
|
+
import { generateCommitMessage } from '@/server/lib/fs/git-commit-message.server';
|
|
27
|
+
import { readCommitMessageSettings } from '@/server/lib/fs/git-commit-settings.server';
|
|
28
|
+
|
|
29
|
+
export async function action({ request, params }: ActionFunctionArgs) {
|
|
30
|
+
if (request.method !== 'POST') {
|
|
31
|
+
return methodNotAllowed({ request, params });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const body = await request.json().catch(() => null) as Record<string, unknown> | null;
|
|
35
|
+
if (!body || typeof body !== 'object' || Array.isArray(body)) {
|
|
36
|
+
return json({ error: 'Invalid JSON body' }, { status: 400 });
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const rootDir = await resolveRoot(
|
|
40
|
+
typeof body.root === 'string' ? body.root : null,
|
|
41
|
+
await getDefaultFsRoot(isMockMode()),
|
|
42
|
+
);
|
|
43
|
+
const repo = typeof body.repo === 'string' && body.repo.trim() ? body.repo.trim() : '.';
|
|
44
|
+
const targetDir = repo === '.' ? rootDir : path.join(rootDir, repo);
|
|
45
|
+
if (targetDir !== rootDir && !targetDir.startsWith(rootDir + path.sep)) {
|
|
46
|
+
return json({ error: 'Invalid repo path' }, { status: 403 });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const sessionId = typeof body.sessionId === 'string' && body.sessionId.trim()
|
|
50
|
+
? body.sessionId.trim()
|
|
51
|
+
: null;
|
|
52
|
+
const amend = body.amend === true || body.amend === '1';
|
|
53
|
+
const settings = await readCommitMessageSettings();
|
|
54
|
+
|
|
55
|
+
const result = await generateCommitMessage({ targetDir, sessionId, amend, settings });
|
|
56
|
+
if (!result.ok) {
|
|
57
|
+
return json({ error: result.error, code: result.code }, { status: result.status });
|
|
58
|
+
}
|
|
59
|
+
return json({ success: true, message: result.message, target: result.target });
|
|
60
|
+
}
|
|
@@ -7,6 +7,7 @@ import { serveRawFile } from '@/server/routes/fs/raw';
|
|
|
7
7
|
import * as fsAction from '@/server/routes/fs/action';
|
|
8
8
|
import * as fsArchive from '@/server/routes/fs/archive';
|
|
9
9
|
import * as fsGit from '@/server/routes/fs/git';
|
|
10
|
+
import * as fsGitMessage from '@/server/routes/fs/git-message';
|
|
10
11
|
import * as fsGrant from '@/server/routes/fs/grant';
|
|
11
12
|
import * as fsReplace from '@/server/routes/fs/replace';
|
|
12
13
|
import * as fsSearch from '@/server/routes/fs/search';
|
|
@@ -16,6 +17,7 @@ export const fsBindings: HandlerBinding[] = [
|
|
|
16
17
|
...bindingsFor(fsAction, '/api/fs/action'),
|
|
17
18
|
...bindingsFor(fsArchive, '/api/fs/archive'),
|
|
18
19
|
...bindingsFor(fsGit, '/api/fs/git'),
|
|
20
|
+
...bindingsFor(fsGitMessage, '/api/fs/git-message'),
|
|
19
21
|
...bindingsFor(fsGrant, '/api/fs/grant', { mutating: ['POST'] }),
|
|
20
22
|
...bindingsFor(fsReplace, '/api/fs/replace'),
|
|
21
23
|
...bindingsFor(fsSearch, '/api/fs/search'),
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
*
|
|
10
10
|
* The transcript keeps only a truncated body plus
|
|
11
11
|
* `details.meta.limits.columnTruncated.artifactId`; the rest lives in a file
|
|
12
|
-
* beside the session
|
|
13
|
-
* owns every path guard — a numeric id,
|
|
14
|
-
* the session directory — so this route
|
|
12
|
+
* beside the session — `<sessionDir>/<sessionId>/<id>.log` since omp 19.0.0,
|
|
13
|
+
* `<id>.<kind>.log` before it. The reader owns every path guard — a numeric id,
|
|
14
|
+
* a known kind, a resolved path inside the session directory — so this route
|
|
15
|
+
* only turns its answer into a response.
|
|
15
16
|
*
|
|
16
17
|
* `no-store`, like the blob route: a session copied between machines can leave
|
|
17
18
|
* an artifact missing, and a 404 that later becomes available must not stay
|
|
@@ -19,6 +19,8 @@ import path from 'path';
|
|
|
19
19
|
import { isolateDb, releaseDb } from '@/test-support/isolated-db';
|
|
20
20
|
import { removeDir } from '@/test-support/remove-dir';
|
|
21
21
|
import { saveHarnessSession } from '@/server/lib/harness/session-store.server';
|
|
22
|
+
import { forgetProbe, rememberProbe } from '@/server/lib/harness/probe-cache.server';
|
|
23
|
+
import { UNPROBED_CAPABILITIES } from '@/server/lib/harness/capabilities';
|
|
22
24
|
import { getSessionMcp, probeSessionMcp, setSessionMcp } from '@/server/routes/sessions/mcp';
|
|
23
25
|
import type { ActionFunctionArgs, LoaderFunctionArgs } from '@/server/lib/remix-compat';
|
|
24
26
|
import type { SessionMcpPayload } from '@/shared/types';
|
|
@@ -26,8 +28,11 @@ import type { SessionMcpPayload } from '@/shared/types';
|
|
|
26
28
|
const ROOT = path.join(os.tmpdir(), `kabmo-session-mcp-route-${process.pid}`);
|
|
27
29
|
const AGENT = path.join(ROOT, 'agent');
|
|
28
30
|
const PROJECT = path.join(ROOT, 'project');
|
|
31
|
+
const XDG = path.join(ROOT, 'xdg');
|
|
29
32
|
const SESSION = '11111111-2222-3333-4444-555555555555';
|
|
33
|
+
const ACP_SESSION = '99999999-8888-7777-6666-555555555555';
|
|
30
34
|
const previousAgentDir = Bun.env.PI_CODING_AGENT_DIR;
|
|
35
|
+
const previousXdg = Bun.env.XDG_CONFIG_HOME;
|
|
31
36
|
|
|
32
37
|
/** The POST answer: the list plus what the server did with the change. */
|
|
33
38
|
interface SetSessionMcpResponse extends SessionMcpPayload {
|
|
@@ -40,13 +45,16 @@ beforeAll(async () => {
|
|
|
40
45
|
removeDir(ROOT);
|
|
41
46
|
fs.mkdirSync(AGENT, { recursive: true });
|
|
42
47
|
fs.mkdirSync(path.join(PROJECT, '.omp'), { recursive: true });
|
|
48
|
+
fs.mkdirSync(path.join(XDG, 'opencode'), { recursive: true });
|
|
43
49
|
Bun.env.PI_CODING_AGENT_DIR = AGENT;
|
|
50
|
+
Bun.env.XDG_CONFIG_HOME = XDG;
|
|
44
51
|
fs.writeFileSync(
|
|
45
52
|
path.join(AGENT, 'mcp.json'),
|
|
46
53
|
JSON.stringify({
|
|
47
54
|
mcpServers: {
|
|
48
55
|
alpha: { command: 'alpha-cmd' },
|
|
49
56
|
beta: { command: 'beta-cmd' },
|
|
57
|
+
delta: { type: 'http', url: 'http://127.0.0.1:1/mcp' },
|
|
50
58
|
},
|
|
51
59
|
}),
|
|
52
60
|
);
|
|
@@ -54,12 +62,21 @@ beforeAll(async () => {
|
|
|
54
62
|
path.join(PROJECT, '.omp', 'mcp.json'),
|
|
55
63
|
JSON.stringify({ mcpServers: { gamma: { command: 'gamma-cmd' } } }),
|
|
56
64
|
);
|
|
65
|
+
// opencode's own config: a server Kabmo never injects, which the list must
|
|
66
|
+
// still show for an ACP chat. `opencode.json` is not one of Kabmo's sources.
|
|
67
|
+
fs.writeFileSync(
|
|
68
|
+
path.join(XDG, 'opencode', 'opencode.json'),
|
|
69
|
+
JSON.stringify({ mcp: { agentOnly: { type: 'local', command: ['agent-cmd'] } } }),
|
|
70
|
+
);
|
|
57
71
|
});
|
|
58
72
|
|
|
59
73
|
afterAll(async () => {
|
|
74
|
+
await forgetProbe('opencode');
|
|
60
75
|
await releaseDb();
|
|
61
76
|
if (previousAgentDir === undefined) delete Bun.env.PI_CODING_AGENT_DIR;
|
|
62
77
|
else Bun.env.PI_CODING_AGENT_DIR = previousAgentDir;
|
|
78
|
+
if (previousXdg === undefined) delete Bun.env.XDG_CONFIG_HOME;
|
|
79
|
+
else Bun.env.XDG_CONFIG_HOME = previousXdg;
|
|
63
80
|
removeDir(ROOT);
|
|
64
81
|
});
|
|
65
82
|
|
|
@@ -97,12 +114,59 @@ describe('GET /api/sessions/:sessionId/mcp', () => {
|
|
|
97
114
|
const data = await readList();
|
|
98
115
|
expect(data.delivery).toBe('omp-config');
|
|
99
116
|
expect(data.harness).toBe('omp-rpc');
|
|
100
|
-
expect(data.servers.map((server) => server.name)).toEqual(['alpha', 'beta', 'gamma']);
|
|
117
|
+
expect(data.servers.map((server) => server.name)).toEqual(['alpha', 'beta', 'delta', 'gamma']);
|
|
101
118
|
expect(data.servers.every((server) => server.enabled)).toBe(true);
|
|
102
119
|
// Nothing has been probed yet: the status is unknown, never a green dot.
|
|
103
120
|
expect(data.servers.every((server) => server.probe === null)).toBe(true);
|
|
104
121
|
expect(data.servers.find((server) => server.name === 'gamma')?.source).toBe('project');
|
|
105
122
|
});
|
|
123
|
+
|
|
124
|
+
test('an ACP harness lists only the transports its agent advertised', async () => {
|
|
125
|
+
await saveHarnessSession({ sessionId: ACP_SESSION, harness: 'opencode', agentSessionId: '', cwd: PROJECT });
|
|
126
|
+
const acpArgs = {
|
|
127
|
+
params: { sessionId: ACP_SESSION },
|
|
128
|
+
request: new Request(`http://localhost/api/sessions/${ACP_SESSION}/mcp`),
|
|
129
|
+
} as LoaderFunctionArgs;
|
|
130
|
+
|
|
131
|
+
await rememberProbe('opencode', {
|
|
132
|
+
harness: 'opencode',
|
|
133
|
+
capabilities: { ...UNPROBED_CAPABILITIES, mcpCapabilities: { http: false, sse: false } },
|
|
134
|
+
models: [],
|
|
135
|
+
thinking: [],
|
|
136
|
+
modes: [],
|
|
137
|
+
probedAt: Date.now(),
|
|
138
|
+
});
|
|
139
|
+
const withoutHttp = (await (await getSessionMcp(acpArgs)).json()) as SessionMcpPayload;
|
|
140
|
+
expect(withoutHttp.delivery).toBe('acp');
|
|
141
|
+
expect(withoutHttp.servers.map((server) => server.name)).toEqual(['alpha', 'beta', 'gamma', 'agentOnly']);
|
|
142
|
+
expect(withoutHttp.servers.find((server) => server.name === 'agentOnly')?.source).toBe('agent');
|
|
143
|
+
|
|
144
|
+
await rememberProbe('opencode', {
|
|
145
|
+
harness: 'opencode',
|
|
146
|
+
capabilities: { ...UNPROBED_CAPABILITIES, mcpCapabilities: { http: true, sse: false } },
|
|
147
|
+
models: [],
|
|
148
|
+
thinking: [],
|
|
149
|
+
modes: [],
|
|
150
|
+
probedAt: Date.now(),
|
|
151
|
+
});
|
|
152
|
+
const withHttp = (await (await getSessionMcp(acpArgs)).json()) as SessionMcpPayload;
|
|
153
|
+
expect(withHttp.servers.map((server) => server.name)).toEqual(['alpha', 'beta', 'delta', 'gamma', 'agentOnly']);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
test('an agent-owned server cannot be toggled from Kabmo', async () => {
|
|
157
|
+
await saveHarnessSession({ sessionId: ACP_SESSION, harness: 'opencode', agentSessionId: '', cwd: PROJECT });
|
|
158
|
+
const response = await setSessionMcp({
|
|
159
|
+
params: { sessionId: ACP_SESSION },
|
|
160
|
+
request: new Request(`http://localhost/api/sessions/${ACP_SESSION}/mcp`, {
|
|
161
|
+
method: 'POST',
|
|
162
|
+
headers: { 'Content-Type': 'application/json' },
|
|
163
|
+
body: JSON.stringify({ name: 'agentOnly', enabled: false }),
|
|
164
|
+
}),
|
|
165
|
+
} as ActionFunctionArgs);
|
|
166
|
+
expect(response.status).toBe(409);
|
|
167
|
+
const data = (await response.json()) as { error: string };
|
|
168
|
+
expect(data.error).toContain('configured by the agent');
|
|
169
|
+
});
|
|
106
170
|
});
|
|
107
171
|
|
|
108
172
|
describe('POST /api/sessions/:sessionId/mcp', () => {
|