@kabmo-labs/kabmo 0.42.2 → 0.43.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +619 -582
- package/dist/client/static/js/{CsvGrid-g6rek8y9.js → CsvGrid-3fr85032.js} +2 -2
- package/dist/client/static/js/{DocxView-41t9ryws.js → DocxView-pqbp2fpd.js} +4 -4
- package/dist/client/static/js/{DrawioView-mfxhfz1h.js → DrawioView-m0vecq1m.js} +2 -2
- package/dist/client/static/js/ImageView-rbejbjwg.js +1 -0
- package/dist/client/static/js/LayoutWrapper-mxfsqh57.js +2 -0
- package/dist/client/static/js/Modal-vnwg4xn3.js +59 -0
- package/dist/client/static/js/{PdfView-bek8k888.js → PdfView-wmg0vk2p.js} +1 -1
- package/dist/client/static/js/SessionsView-90z2t4qe.js +1 -0
- package/dist/client/static/js/{SheetView-vezssf6b.js → SheetView-rg5gkcd7.js} +13 -13
- package/dist/client/static/js/{SvgPreview-f1qaw73k.js → SvgPreview-wpb7b0ez.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-4qn94h52.js → abnfDiagram-O67JEVCF-4pxqt66j.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-kwt1va5y.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-hbj5v7n7.js} +7 -7
- package/dist/client/static/js/c-8jf64j6h.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-f58pcvbk.js → c4Diagram-YGBWAQC7-epfzh8dw.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-52g73vyw.js → classDiagram-v2-NBCMYWYE-kbks4qgz.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-ptdnshzh.js → cose-bilkent-JH36ORCC-dvdmckrf.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-r084stj5.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-kyf5jetf.js → dagre-6A5THRUB-64qc51n1.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-bxrsjtv9.js → diagram-22UHCM2B-70qtb1rm.js} +16 -16
- package/dist/client/static/js/{diagram-3UASUU5V-0f41s00j.js → diagram-3UASUU5V-dgkvnsme.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-0z1zx9h1.js → diagram-ATOU4E4O-rnpsp26v.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-znrmr6bk.js → diagram-CDSNMT55-26hthh60.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-jfe2jhk0.js → diagram-MLGK6HIB-nc1s85r5.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-2kaawmwa.js → diagram-MPIPVDR6-e4dckqhv.js} +3 -3
- package/dist/client/static/js/{dockerfile-12exatm9.js → dockerfile-rxtyyhr1.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-s5n37rfp.js → ebnfDiagram-ZINNZB2B-3w9h8qk7.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-httpkyb1.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-key6ah0b.js → erDiagram-OPXOYQCR-3qhvf7se.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-1jat076e.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-4efkhmca.js → ganttDiagram-FUAMR5RP-t53m50e5.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-b5wn9eht.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-p0ez6hqd.js → index-181p91hf.js} +1 -1
- package/dist/client/static/js/{index-s4gv0rpk.js → index-1dwdgp27.js} +1 -1
- package/dist/client/static/js/{index-0e9nkc0g.js → index-2q23dwrs.js} +2 -2
- package/dist/client/static/js/{index-4cncqz8j.js → index-38v0781h.js} +2 -2
- package/dist/client/static/js/{index-zs7sjv6x.js → index-4banz7gr.js} +1 -1
- package/dist/client/static/js/{index-nh29fkk9.js → index-7dp90ad1.js} +2 -2
- package/dist/client/static/js/{index-yjmm73jm.js → index-7z9tz4ze.js} +2 -2
- package/dist/client/static/js/{index-zs73zwjz.js → index-7zc1z9z9.js} +4 -4
- package/dist/client/static/js/{index-z78bzryw.js → index-8y51kgan.js} +3 -3
- package/dist/client/static/js/{index-gp57dx2v.js → index-axszsg7a.js} +1 -1
- package/dist/client/static/js/{index-pxtff3ez.js → index-bvjct7sp.js} +2 -2
- package/dist/client/static/js/{index-8b3t2y77.js → index-cqnpsw2m.js} +2 -2
- package/dist/client/static/js/{index-yzda8j2d.js → index-d8r84zjd.js} +12 -12
- package/dist/client/static/js/{index-02543wk3.js → index-dg3b0mfk.js} +2 -2
- package/dist/client/static/js/index-dkqgmacr.js +4 -0
- package/dist/client/static/js/{index-pkes9492.js → index-e7yf273s.js} +2 -2
- package/dist/client/static/js/{index-8k7vjp8b.js → index-egd0vfey.js} +1 -1
- package/dist/client/static/js/{index-dzmar8jr.js → index-enb6chty.js} +1 -1
- package/dist/client/static/js/{index-v3f7we4n.js → index-f4fqvct6.js} +22 -22
- package/dist/client/static/js/{index-pysqpc5n.js → index-fg965t62.js} +2 -2
- package/dist/client/static/js/{index-raca8tsh.js → index-fgyenbv8.js} +4 -4
- package/dist/client/static/js/{index-qsw5edtk.js → index-fjnkzk12.js} +5 -5
- package/dist/client/static/js/{index-50mdqev0.js → index-g3a9j9hf.js} +1 -1
- package/dist/client/static/js/{index-1t5ybx9v.js → index-g4rsmakg.js} +3 -3
- package/dist/client/static/js/{index-qx6x4z0y.js → index-gmnmnfm0.js} +2 -2
- package/dist/client/static/js/{index-f33c4paw.js → index-gwqb7m8g.js} +1 -1
- package/dist/client/static/js/{index-ykfd2fyj.js → index-j60gtvw8.js} +1 -1
- package/dist/client/static/js/index-jvs2fvqz.js +2 -0
- package/dist/client/static/js/{index-r8cc80w5.js → index-jz93j0at.js} +2 -2
- package/dist/client/static/js/{index-82vk27q1.js → index-k9ws464d.js} +2 -2
- package/dist/client/static/js/{index-0pabfaac.js → index-kc3c2gzb.js} +1 -1
- package/dist/client/static/js/{index-5jnvz9hw.js → index-kccp6tgd.js} +2 -2
- package/dist/client/static/js/{index-1y3rzw6b.js → index-kmzd0adv.js} +1 -1
- package/dist/client/static/js/{index-77t0nvt1.js → index-ksph3kpr.js} +2 -2
- 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-7a2efrbj.js → index-q1gwgmxt.js} +2 -2
- 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-qzw4jnnv.js +1 -0
- package/dist/client/static/js/{index-cz50ha6x.js → index-r11bbnek.js} +78 -78
- package/dist/client/static/js/{index-zndbhb9w.js → index-rv4qs3wm.js} +2 -2
- package/dist/client/static/js/{index-hga3e13s.js → index-s78n0dtv.js} +2 -2
- package/dist/client/static/js/{index-03pyvmcz.js → index-sesghshh.js} +2 -2
- package/dist/client/static/js/index-tnv3dryk.js +9 -0
- package/dist/client/static/js/{index-dtj73vs1.js → index-tzbzehqd.js} +1 -1
- package/dist/client/static/js/index-vcrh95gf.css +1 -0
- package/dist/client/static/js/{index-8kbp24xg.js → index-vmgzhp41.js} +1 -1
- package/dist/client/static/js/{index-r9db1gsf.js → index-wmv3crye.js} +2 -2
- 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/index-zqthmaxq.js +478 -0
- package/dist/client/static/js/info-A6RAGUB7-m6qz24p8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-4e7ej63f.js → infoDiagram-VRGFBTTK-qv7438m3.js} +1 -1
- package/dist/client/static/js/ini-1x0ad976.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-k3yet1ec.js → ishikawaDiagram-OU5B5YK6-p1w6zg5y.js} +4 -4
- package/dist/client/static/js/java-3944nq02.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-qe352kyd.js → journeyDiagram-ZHPQQLJL-ywk6xqxr.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-gtrmhggc.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-5s24b4hh.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-ncsam2fm.js → mindmap-definition-NLK3R4M7-3wx7abqn.js} +4 -4
- package/dist/client/static/js/one-dark-pro-3vya9z02.js +1 -0
- package/dist/client/static/js/one-light-1yrwn9my.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-yvyqnjya.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-26x6pj38.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-qhe8h0j9.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-dwy3k2jx.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-7kf8bmk9.js → requirementDiagram-PLB6GJNP-hcmgfesg.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-bmb4ee5w.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-bcb9f54a.js → sankeyDiagram-IPEJSGJF-s6d3k4zs.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-0fcmzgdy.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-p9bsf5dc.js → sizeCapture-INFHLROL-t8fcm7rq.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-1ecfb3fs.js → stateDiagram-v2-GCMORJYK-jr80hfeg.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-x1ay6w39.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-xj123xrp.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-4csxwmn2.js → timeline-definition-EJHVYXUP-qz0g6msb.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-sxzrv8ht.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-y1hgdet4.js → vennDiagram-UO4OBE2U-qsqgnjcv.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-rvwxn458.js} +4 -4
- package/dist/client/static/js/xml-6ct32gys.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-b08b4ah0.js → xychartDiagram-PMCCYNJV-nb4w7rcg.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/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/Wait.tsx +3 -2
- 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/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/chat/session-store.server.ts +22 -1
- 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/one-shot.server.ts +141 -0
- package/src/server/lib/harness/acp/raw-listeners.ts +30 -0
- package/src/server/lib/harness/acp/session-handshake.ts +11 -3
- package/src/server/lib/harness/acp/session.test-util.ts +2 -0
- package/src/server/lib/harness/acp/session.ts +8 -0
- 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 +2 -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/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,111 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The servers an ACP agent loads from its own config.
|
|
8
|
+
*
|
|
9
|
+
* The navbar used to show only Kabmo's injected list, which is why an ACP chat
|
|
10
|
+
* looked identical to an omp-rpc one. These cases pin the three measured
|
|
11
|
+
* shapes (opencode's `mcp`, Claude's `mcpServers`, Codex's `[mcp_servers]`) and
|
|
12
|
+
* the rule that a harness with no measured file contributes nothing.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
16
|
+
import fs from 'fs';
|
|
17
|
+
import os from 'os';
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import { removeDir } from '@/test-support/remove-dir';
|
|
20
|
+
import { agentMcpEntriesFor } from '@/server/lib/mcp/agent-config.server';
|
|
21
|
+
|
|
22
|
+
const ROOT = path.join(os.tmpdir(), `kabmo-agent-mcp-${process.pid}`);
|
|
23
|
+
const XDG = path.join(ROOT, 'xdg');
|
|
24
|
+
const PROJECT = path.join(ROOT, 'project');
|
|
25
|
+
const previousXdg = Bun.env.XDG_CONFIG_HOME;
|
|
26
|
+
|
|
27
|
+
beforeAll(() => {
|
|
28
|
+
removeDir(ROOT);
|
|
29
|
+
fs.mkdirSync(path.join(XDG, 'opencode'), { recursive: true });
|
|
30
|
+
fs.mkdirSync(path.join(PROJECT, '.codex'), { recursive: true });
|
|
31
|
+
Bun.env.XDG_CONFIG_HOME = XDG;
|
|
32
|
+
fs.writeFileSync(
|
|
33
|
+
path.join(XDG, 'opencode', 'opencode.json'),
|
|
34
|
+
JSON.stringify({
|
|
35
|
+
mcp: {
|
|
36
|
+
local: { type: 'local', command: ['codegraph', 'serve', '--mcp'] },
|
|
37
|
+
remote: { type: 'remote', url: 'https://example/mcp', headers: { 'X-Key': 'v' } },
|
|
38
|
+
off: { type: 'local', command: ['nope'], enabled: false },
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
);
|
|
42
|
+
fs.writeFileSync(
|
|
43
|
+
path.join(PROJECT, '.mcp.json'),
|
|
44
|
+
JSON.stringify({
|
|
45
|
+
mcpServers: {
|
|
46
|
+
claudeLocal: { command: 'npx', args: ['-y', 'server'] },
|
|
47
|
+
claudeRemote: { type: 'sse', url: 'https://example/sse' },
|
|
48
|
+
},
|
|
49
|
+
}),
|
|
50
|
+
);
|
|
51
|
+
fs.writeFileSync(
|
|
52
|
+
path.join(PROJECT, '.codex', 'config.toml'),
|
|
53
|
+
[
|
|
54
|
+
'[mcp_servers.codexLocal]',
|
|
55
|
+
'command = "npx"',
|
|
56
|
+
'args = ["-y", "server"]',
|
|
57
|
+
'',
|
|
58
|
+
'[mcp_servers.codexRemote]',
|
|
59
|
+
'url = "https://example/mcp"',
|
|
60
|
+
'http_headers = { "X-Key" = "v" }',
|
|
61
|
+
'',
|
|
62
|
+
].join('\n'),
|
|
63
|
+
);
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
afterAll(() => {
|
|
67
|
+
if (previousXdg === undefined) delete Bun.env.XDG_CONFIG_HOME;
|
|
68
|
+
else Bun.env.XDG_CONFIG_HOME = previousXdg;
|
|
69
|
+
removeDir(ROOT);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
describe('agentMcpEntriesFor', () => {
|
|
73
|
+
test('reads opencode local/remote entries and keeps a disabled one disabled', async () => {
|
|
74
|
+
const entries = await agentMcpEntriesFor('opencode', PROJECT);
|
|
75
|
+
expect(entries.map((entry) => entry.name)).toEqual(['local', 'remote', 'off']);
|
|
76
|
+
expect(entries.every((entry) => entry.source === 'agent')).toBe(true);
|
|
77
|
+
expect(entries.find((entry) => entry.name === 'local')?.transport).toBe('stdio');
|
|
78
|
+
expect(entries.find((entry) => entry.name === 'remote')?.transport).toBe('http');
|
|
79
|
+
expect(entries.find((entry) => entry.name === 'off')?.enabled).toBe(false);
|
|
80
|
+
expect(entries.find((entry) => entry.name === 'remote')?.config).toEqual({
|
|
81
|
+
type: 'http',
|
|
82
|
+
url: 'https://example/mcp',
|
|
83
|
+
headers: { 'X-Key': 'v' },
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
test('reads Claude project .mcp.json in the native shape', async () => {
|
|
88
|
+
const entries = await agentMcpEntriesFor('claude', PROJECT);
|
|
89
|
+
expect(entries.map((entry) => entry.name)).toEqual(['claudeLocal', 'claudeRemote']);
|
|
90
|
+
expect(entries.find((entry) => entry.name === 'claudeLocal')?.config).toEqual({
|
|
91
|
+
command: 'npx',
|
|
92
|
+
args: ['-y', 'server'],
|
|
93
|
+
});
|
|
94
|
+
expect(entries.find((entry) => entry.name === 'claudeRemote')?.transport).toBe('sse');
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
test('reads Codex [mcp_servers] from TOML', async () => {
|
|
98
|
+
const entries = await agentMcpEntriesFor('codex', PROJECT);
|
|
99
|
+
expect(entries.map((entry) => entry.name)).toEqual(['codexLocal', 'codexRemote']);
|
|
100
|
+
expect(entries.find((entry) => entry.name === 'codexLocal')?.transport).toBe('stdio');
|
|
101
|
+
expect(entries.find((entry) => entry.name === 'codexRemote')?.config).toEqual({
|
|
102
|
+
type: 'http',
|
|
103
|
+
url: 'https://example/mcp',
|
|
104
|
+
headers: { 'X-Key': 'v' },
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('a harness with no measured file contributes nothing', async () => {
|
|
109
|
+
expect(await agentMcpEntriesFor('dsh', PROJECT)).toEqual([]);
|
|
110
|
+
});
|
|
111
|
+
});
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The MCP servers an ACP agent loads from its OWN config.
|
|
8
|
+
*
|
|
9
|
+
* Kabmo's merge (`registry.server.ts`) is the list Kabmo INJECTS on
|
|
10
|
+
* `session/new`. An ACP agent also reads its own config — opencode's
|
|
11
|
+
* `opencode.json`, Claude's `~/.claude.json`, Codex's `config.toml`,
|
|
12
|
+
* Antigravity's `mcp_config.json` — and those servers are invisible to the
|
|
13
|
+
* navbar unless they are read here. The list is the union: injected first,
|
|
14
|
+
* then the agent's own names that the injection did not already cover.
|
|
15
|
+
*
|
|
16
|
+
* Only the formats measured on a real install are listed. A harness with no
|
|
17
|
+
* row has no agent-native list Kabmo can name, and the panel shows the
|
|
18
|
+
* injected list alone rather than guessing at a file.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
import { homedir } from 'node:os';
|
|
22
|
+
import { join } from 'node:path';
|
|
23
|
+
import { parse as parseToml } from 'smol-toml';
|
|
24
|
+
import { transportOf, type McpServerEntry } from '@/server/lib/mcp/registry.server';
|
|
25
|
+
import type { McpServer } from '@/server/lib/omp/config/mcp-shared';
|
|
26
|
+
import type { HarnessId } from '@/shared/lib/harness/catalog';
|
|
27
|
+
|
|
28
|
+
type AgentMcpShape = 'native' | 'opencode' | 'codex';
|
|
29
|
+
|
|
30
|
+
interface AgentMcpSource {
|
|
31
|
+
/** Where the file lives: the user's home, the project, or `$XDG_CONFIG_HOME`. */
|
|
32
|
+
scope: 'home' | 'project' | 'xdg';
|
|
33
|
+
/** Path relative to the scope root. */
|
|
34
|
+
file: string;
|
|
35
|
+
format: 'json' | 'toml';
|
|
36
|
+
/** The key that holds the server map. */
|
|
37
|
+
pointer: string;
|
|
38
|
+
shape: AgentMcpShape;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The measured config files. `opencode` and `antigravity` were read on this
|
|
43
|
+
* machine; `claude` and `codex` are their vendors' documented MCP locations.
|
|
44
|
+
* `omp-acp` is absent on purpose: its `~/.omp/agent/mcp.json` is already the
|
|
45
|
+
* `user` source of Kabmo's own merge, and a second row would duplicate it.
|
|
46
|
+
*/
|
|
47
|
+
const AGENT_MCP_SOURCES: Partial<Record<HarnessId, readonly AgentMcpSource[]>> = {
|
|
48
|
+
// opencode deep-merges project over user, and `.opencode/` over the project
|
|
49
|
+
// root; the first entry wins here, so the list names the config the agent
|
|
50
|
+
// actually uses.
|
|
51
|
+
opencode: [
|
|
52
|
+
{ scope: 'project', file: '.opencode/opencode.json', format: 'json', pointer: 'mcp', shape: 'opencode' },
|
|
53
|
+
{ scope: 'project', file: 'opencode.json', format: 'json', pointer: 'mcp', shape: 'opencode' },
|
|
54
|
+
{ scope: 'xdg', file: 'opencode/opencode.json', format: 'json', pointer: 'mcp', shape: 'opencode' },
|
|
55
|
+
],
|
|
56
|
+
// Claude and Codex both encounter the project entry before the user entry.
|
|
57
|
+
claude: [
|
|
58
|
+
{ scope: 'project', file: '.mcp.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
59
|
+
{ scope: 'project', file: '.claude/mcp.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
60
|
+
{ scope: 'home', file: '.claude.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
61
|
+
],
|
|
62
|
+
codex: [
|
|
63
|
+
{ scope: 'project', file: '.codex/config.toml', format: 'toml', pointer: 'mcp_servers', shape: 'codex' },
|
|
64
|
+
{ scope: 'home', file: '.codex/config.toml', format: 'toml', pointer: 'mcp_servers', shape: 'codex' },
|
|
65
|
+
],
|
|
66
|
+
antigravity: [
|
|
67
|
+
{ scope: 'home', file: '.gemini/config/mcp_config.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
68
|
+
],
|
|
69
|
+
grok: [
|
|
70
|
+
{ scope: 'project', file: '.mcp.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
71
|
+
{ scope: 'home', file: '.claude.json', format: 'json', pointer: 'mcpServers', shape: 'native' },
|
|
72
|
+
],
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
function stringRecord(value: unknown): Record<string, string> | undefined {
|
|
76
|
+
if (!value || typeof value !== 'object' || Array.isArray(value)) return undefined;
|
|
77
|
+
const entries = Object.entries(value).filter((entry): entry is [string, string] => typeof entry[1] === 'string');
|
|
78
|
+
return entries.length > 0 ? Object.fromEntries(entries) : undefined;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function stringList(value: unknown): string[] {
|
|
82
|
+
return Array.isArray(value) ? value.filter((item): item is string => typeof item === 'string') : [];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** One agent-native entry in omp's `mcp.json` shape, or null when malformed. */
|
|
86
|
+
function nativeFromAgentEntry(shape: AgentMcpShape, raw: unknown): McpServer | null {
|
|
87
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) return null;
|
|
88
|
+
const entry = raw as Record<string, unknown>;
|
|
89
|
+
if (shape === 'opencode') {
|
|
90
|
+
if (entry.type === 'remote') {
|
|
91
|
+
const url = typeof entry.url === 'string' ? entry.url.trim() : '';
|
|
92
|
+
if (!url) return null;
|
|
93
|
+
const headers = stringRecord(entry.headers);
|
|
94
|
+
return {
|
|
95
|
+
type: 'http',
|
|
96
|
+
url,
|
|
97
|
+
...(headers ? { headers } : {}),
|
|
98
|
+
...(entry.enabled === false ? { enabled: false } : {}),
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const command = stringList(entry.command);
|
|
102
|
+
if (command.length === 0) return null;
|
|
103
|
+
const env = stringRecord(entry.environment);
|
|
104
|
+
return {
|
|
105
|
+
command: command[0],
|
|
106
|
+
...(command.length > 1 ? { args: command.slice(1) } : {}),
|
|
107
|
+
...(env ? { env } : {}),
|
|
108
|
+
...(entry.enabled === false ? { enabled: false } : {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (shape === 'codex') {
|
|
112
|
+
if (typeof entry.url === 'string' && entry.url.trim()) {
|
|
113
|
+
const headers = stringRecord(entry.http_headers);
|
|
114
|
+
return { type: 'http', url: entry.url.trim(), ...(headers ? { headers } : {}) };
|
|
115
|
+
}
|
|
116
|
+
if (typeof entry.command === 'string' && entry.command.trim()) {
|
|
117
|
+
const args = stringList(entry.args);
|
|
118
|
+
const env = stringRecord(entry.env);
|
|
119
|
+
return {
|
|
120
|
+
command: entry.command.trim(),
|
|
121
|
+
...(args.length > 0 ? { args } : {}),
|
|
122
|
+
...(env ? { env } : {}),
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
// `native`: Claude's `mcpServers` and Antigravity's `mcp_config.json`.
|
|
128
|
+
if (typeof entry.url === 'string' && entry.url.trim()) {
|
|
129
|
+
const headers = stringRecord(entry.headers);
|
|
130
|
+
return {
|
|
131
|
+
type: entry.type === 'sse' ? 'sse' : 'http',
|
|
132
|
+
url: entry.url.trim(),
|
|
133
|
+
...(headers ? { headers } : {}),
|
|
134
|
+
...(entry.enabled === false ? { enabled: false } : {}),
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
if (typeof entry.command === 'string' && entry.command.trim()) {
|
|
138
|
+
const args = stringList(entry.args);
|
|
139
|
+
const env = stringRecord(entry.env);
|
|
140
|
+
return {
|
|
141
|
+
command: entry.command.trim(),
|
|
142
|
+
...(args.length > 0 ? { args } : {}),
|
|
143
|
+
...(env ? { env } : {}),
|
|
144
|
+
...(entry.enabled === false ? { enabled: false } : {}),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
function sourcePath(source: AgentMcpSource, cwd: string): string {
|
|
151
|
+
if (source.scope === 'project') return join(cwd, source.file);
|
|
152
|
+
if (source.scope === 'xdg') {
|
|
153
|
+
const root = Bun.env.XDG_CONFIG_HOME || join(homedir(), '.config');
|
|
154
|
+
return join(root, source.file);
|
|
155
|
+
}
|
|
156
|
+
return join(homedir(), source.file);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
async function readDocument(path: string, format: 'json' | 'toml'): Promise<Record<string, unknown> | null> {
|
|
160
|
+
try {
|
|
161
|
+
const file = Bun.file(path);
|
|
162
|
+
if (!(await file.exists())) return null;
|
|
163
|
+
const text = await file.text();
|
|
164
|
+
const parsed: unknown = format === 'json' ? JSON.parse(text) : parseToml(text);
|
|
165
|
+
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
166
|
+
? (parsed as Record<string, unknown>)
|
|
167
|
+
: null;
|
|
168
|
+
} catch {
|
|
169
|
+
// A malformed or unreadable file is not a failed session: the injected
|
|
170
|
+
// list still answers, and the agent's own file is the agent's to fix.
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The servers the agent loads from its own config, in the same entry shape the
|
|
177
|
+
* injected list uses. First name wins across the agent's own files, matching
|
|
178
|
+
* the order the agent itself reads them (user before project).
|
|
179
|
+
*/
|
|
180
|
+
export async function agentMcpEntriesFor(harness: HarnessId, cwd: string): Promise<McpServerEntry[]> {
|
|
181
|
+
const sources = AGENT_MCP_SOURCES[harness];
|
|
182
|
+
if (!sources) return [];
|
|
183
|
+
const entries: McpServerEntry[] = [];
|
|
184
|
+
const seen = new Set<string>();
|
|
185
|
+
for (const source of sources) {
|
|
186
|
+
const doc = await readDocument(sourcePath(source, cwd), source.format);
|
|
187
|
+
const map = doc?.[source.pointer];
|
|
188
|
+
if (!map || typeof map !== 'object' || Array.isArray(map)) continue;
|
|
189
|
+
for (const [name, raw] of Object.entries(map as Record<string, unknown>)) {
|
|
190
|
+
const key = name.toLowerCase();
|
|
191
|
+
if (seen.has(key)) continue;
|
|
192
|
+
const config = nativeFromAgentEntry(source.shape, raw);
|
|
193
|
+
if (!config) continue;
|
|
194
|
+
seen.add(key);
|
|
195
|
+
entries.push({
|
|
196
|
+
name,
|
|
197
|
+
config,
|
|
198
|
+
transport: transportOf(config),
|
|
199
|
+
source: 'agent',
|
|
200
|
+
enabled: config.enabled !== false,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return entries;
|
|
205
|
+
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
import { nativeToServerItem } from '@/server/lib/omp/config/mcp';
|
|
23
23
|
import { testMcpServer } from '@/server/lib/omp/config/mcp-test';
|
|
24
|
+
import { resolveMcpConfig } from '@/server/lib/mcp/secrets.server';
|
|
24
25
|
import type { McpServerEntry } from '@/server/lib/mcp/registry.server';
|
|
25
26
|
import type { McpProbeResult } from '@/shared/types';
|
|
26
27
|
|
|
@@ -49,7 +50,12 @@ export async function probeMcpServer(
|
|
|
49
50
|
entry: McpServerEntry,
|
|
50
51
|
cwd: string,
|
|
51
52
|
): Promise<McpProbeResult> {
|
|
52
|
-
|
|
53
|
+
// The probe must test the server the agent actually receives: a `!command`
|
|
54
|
+
// header is resolved by omp before connecting, and an ACP agent gets the
|
|
55
|
+
// resolved value from Kabmo. Probing the literal string would report a
|
|
56
|
+
// failure the agent never sees.
|
|
57
|
+
const config = await resolveMcpConfig(entry.config, cwd);
|
|
58
|
+
const item = nativeToServerItem(entry.name, config, 0, true);
|
|
53
59
|
// A spawn failure (ENOENT, a refused endpoint) is a RESULT, not a 500: the
|
|
54
60
|
// status icon has to say "failed" with the reason.
|
|
55
61
|
const result = await testMcpServer({ server: item, cwd }).catch((cause: unknown) => ({
|
|
@@ -120,8 +120,9 @@ export function definitionFromItem(item: McpServerItem): McpServerDefinition | n
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
/** Where a server was declared. The settings pane and the session list both
|
|
123
|
-
* need it, and a second derivation would drift from this one.
|
|
124
|
-
|
|
123
|
+
* need it, and a second derivation would drift from this one. `agent` is the
|
|
124
|
+
* harness's own config, which Kabmo can read but not toggle. */
|
|
125
|
+
export type McpServerSource = 'user' | 'project' | 'custom' | 'plugin' | 'agent';
|
|
125
126
|
|
|
126
127
|
/**
|
|
127
128
|
* One server as the session sees it: the native `mcp.json` shape (so a
|
|
@@ -137,7 +138,7 @@ export interface McpServerEntry {
|
|
|
137
138
|
}
|
|
138
139
|
|
|
139
140
|
/** The transport a native entry names, by the same rule `definitionFromNative` uses. */
|
|
140
|
-
function transportOf(config: McpServer): McpTransport {
|
|
141
|
+
export function transportOf(config: McpServer): McpTransport {
|
|
141
142
|
if (typeof config.url === 'string' && config.url.trim()) return config.type === 'sse' ? 'sse' : 'http';
|
|
142
143
|
return 'stdio';
|
|
143
144
|
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The `!command` / bare-env indirection omp applies to MCP env and headers.
|
|
8
|
+
*
|
|
9
|
+
* An ACP agent receives the list as JSON and does not run this resolution, so
|
|
10
|
+
* passing the raw value hands it the literal `!echo Bearer $(cat …)` — a header
|
|
11
|
+
* no server accepts. These cases pin the three branches and the omission rule.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { afterAll, beforeAll, describe, expect, test } from 'bun:test';
|
|
15
|
+
import fs from 'fs';
|
|
16
|
+
import os from 'os';
|
|
17
|
+
import path from 'path';
|
|
18
|
+
import { removeDir } from '@/test-support/remove-dir';
|
|
19
|
+
import { resolveMcpConfig, resolveMcpValue } from '@/server/lib/mcp/secrets.server';
|
|
20
|
+
|
|
21
|
+
const ROOT = path.join(os.tmpdir(), `kabmo-mcp-secrets-${process.pid}`);
|
|
22
|
+
const previous = Bun.env.KABMO_MCP_TEST_TOKEN;
|
|
23
|
+
|
|
24
|
+
beforeAll(() => {
|
|
25
|
+
removeDir(ROOT);
|
|
26
|
+
fs.mkdirSync(ROOT, { recursive: true });
|
|
27
|
+
Bun.env.KABMO_MCP_TEST_TOKEN = 'from-env';
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
afterAll(() => {
|
|
31
|
+
if (previous === undefined) delete Bun.env.KABMO_MCP_TEST_TOKEN;
|
|
32
|
+
else Bun.env.KABMO_MCP_TEST_TOKEN = previous;
|
|
33
|
+
removeDir(ROOT);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
describe('resolveMcpValue', () => {
|
|
37
|
+
test('runs a !command in the project directory and trims its stdout', async () => {
|
|
38
|
+
expect(await resolveMcpValue("!printf 'Bearer abc\\n'", ROOT)).toBe('Bearer abc');
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test('a failed command omits the entry', async () => {
|
|
42
|
+
expect(await resolveMcpValue('!false', ROOT)).toBeNull();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('a command that prints only whitespace omits the entry', async () => {
|
|
46
|
+
expect(await resolveMcpValue("!printf ' '", ROOT)).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('a bare environment-variable name reads the environment', async () => {
|
|
50
|
+
expect(await resolveMcpValue('KABMO_MCP_TEST_TOKEN', ROOT)).toBe('from-env');
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
test('anything else is literal', async () => {
|
|
54
|
+
expect(await resolveMcpValue('Bearer literal', ROOT)).toBe('Bearer literal');
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('resolveMcpConfig', () => {
|
|
59
|
+
test('resolves headers and env, and drops a value that cannot be minted', async () => {
|
|
60
|
+
const config = await resolveMcpConfig(
|
|
61
|
+
{
|
|
62
|
+
type: 'http',
|
|
63
|
+
url: 'http://127.0.0.1:1/mcp',
|
|
64
|
+
headers: { Authorization: "!printf 'Bearer abc'", 'X-Dead': '!false' },
|
|
65
|
+
env: { TOKEN: 'KABMO_MCP_TEST_TOKEN' },
|
|
66
|
+
},
|
|
67
|
+
ROOT,
|
|
68
|
+
);
|
|
69
|
+
expect(config.headers).toEqual({ Authorization: 'Bearer abc' });
|
|
70
|
+
expect(config.env).toEqual({ TOKEN: 'from-env' });
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('a config with no env or headers is unchanged', async () => {
|
|
74
|
+
const config = await resolveMcpConfig({ command: 'codegraph', args: ['serve'] }, ROOT);
|
|
75
|
+
expect(config).toEqual({ command: 'codegraph', args: ['serve'] });
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('a non-string value is dropped rather than crashing', async () => {
|
|
79
|
+
const config = await resolveMcpConfig(
|
|
80
|
+
{ type: 'http', url: 'http://127.0.0.1:1/mcp', headers: { 'X-Number': 5 as unknown as string } },
|
|
81
|
+
ROOT,
|
|
82
|
+
);
|
|
83
|
+
expect(config.headers).toBeUndefined();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Resolve the `!command` and bare-env indirections omp applies to MCP `env`
|
|
8
|
+
* and `headers` before it connects.
|
|
9
|
+
*
|
|
10
|
+
* omp's own loader runs a value that starts with `!` as a shell command in the
|
|
11
|
+
* project directory (10s timeout, trimmed stdout) and falls back to an
|
|
12
|
+
* environment variable when the whole value names one. An ACP agent receives
|
|
13
|
+
* the list as a JSON argument and does NOT run that resolution, so passing the
|
|
14
|
+
* raw value hands the agent the literal string `!echo Bearer $(cat …)` — a
|
|
15
|
+
* header no server accepts. The same resolution is what makes the navbar's
|
|
16
|
+
* probe answer for the server the agent actually got.
|
|
17
|
+
*
|
|
18
|
+
* A failed or empty command OMITS the entry, exactly as omp does: a header
|
|
19
|
+
* that cannot be minted is not a header.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import type { McpServer } from '@/server/lib/omp/config/mcp-shared';
|
|
23
|
+
import type { McpServerDefinition } from '@/server/lib/mcp/registry.server';
|
|
24
|
+
|
|
25
|
+
const COMMAND_TIMEOUT_MS = 10_000;
|
|
26
|
+
|
|
27
|
+
/** Run one `!command` and return its trimmed stdout, or null. */
|
|
28
|
+
async function runCommand(command: string, cwd: string): Promise<string | null> {
|
|
29
|
+
try {
|
|
30
|
+
const proc = Bun.spawn(['sh', '-c', command], {
|
|
31
|
+
cwd,
|
|
32
|
+
stdin: 'ignore',
|
|
33
|
+
stdout: 'pipe',
|
|
34
|
+
stderr: 'pipe',
|
|
35
|
+
signal: AbortSignal.timeout(COMMAND_TIMEOUT_MS),
|
|
36
|
+
});
|
|
37
|
+
const [stdout, exitCode] = await Promise.all([
|
|
38
|
+
new Response(proc.stdout).text(),
|
|
39
|
+
proc.exited,
|
|
40
|
+
]);
|
|
41
|
+
if (exitCode !== 0) return null;
|
|
42
|
+
const trimmed = stdout.trim();
|
|
43
|
+
return trimmed.length > 0 ? trimmed : null;
|
|
44
|
+
} catch {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* One env/header value, resolved the way omp resolves it before connecting.
|
|
51
|
+
* `null` means the entry must be omitted.
|
|
52
|
+
*/
|
|
53
|
+
export async function resolveMcpValue(value: string, cwd: string): Promise<string | null> {
|
|
54
|
+
if (value.startsWith('!')) return runCommand(value.slice(1), cwd);
|
|
55
|
+
const fromEnv = Bun.env[value];
|
|
56
|
+
if (typeof fromEnv === 'string' && fromEnv.length > 0) return fromEnv;
|
|
57
|
+
return value;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Resolve every string value of a map; a failed or non-string entry is dropped. */
|
|
61
|
+
async function resolveRecord(
|
|
62
|
+
record: Record<string, unknown>,
|
|
63
|
+
cwd: string,
|
|
64
|
+
): Promise<Record<string, string> | undefined> {
|
|
65
|
+
const entries = await Promise.all(
|
|
66
|
+
Object.entries(record).map(async ([key, value]) => {
|
|
67
|
+
if (typeof value !== 'string') return null;
|
|
68
|
+
const resolved = await resolveMcpValue(value, cwd);
|
|
69
|
+
return resolved === null ? null : ([key, resolved] as const);
|
|
70
|
+
}),
|
|
71
|
+
);
|
|
72
|
+
const kept = entries.filter((entry): entry is readonly [string, string] => entry !== null);
|
|
73
|
+
return kept.length > 0 ? Object.fromEntries(kept) : undefined;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A native `mcp.json` entry with its `env`/`headers` resolved. The rest of the
|
|
78
|
+
* config is copied verbatim, so a caller can still write it back or hand it to
|
|
79
|
+
* the ACP wire shape.
|
|
80
|
+
*/
|
|
81
|
+
export async function resolveMcpConfig(config: McpServer, cwd: string): Promise<McpServer> {
|
|
82
|
+
const env = config.env && typeof config.env === 'object' && !Array.isArray(config.env)
|
|
83
|
+
? await resolveRecord(config.env as Record<string, unknown>, cwd)
|
|
84
|
+
: undefined;
|
|
85
|
+
const headers = config.headers && typeof config.headers === 'object' && !Array.isArray(config.headers)
|
|
86
|
+
? await resolveRecord(config.headers as Record<string, unknown>, cwd)
|
|
87
|
+
: undefined;
|
|
88
|
+
const next: McpServer = { ...config };
|
|
89
|
+
if (env) next.env = env;
|
|
90
|
+
else delete next.env;
|
|
91
|
+
if (headers) next.headers = headers;
|
|
92
|
+
else delete next.headers;
|
|
93
|
+
return next;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/** The transport-neutral definition with its `env`/`headers` resolved. */
|
|
97
|
+
export async function resolveMcpDefinition(
|
|
98
|
+
definition: McpServerDefinition,
|
|
99
|
+
cwd: string,
|
|
100
|
+
): Promise<McpServerDefinition> {
|
|
101
|
+
const env = definition.env ? await resolveRecord(definition.env, cwd) : undefined;
|
|
102
|
+
const headers = definition.headers ? await resolveRecord(definition.headers, cwd) : undefined;
|
|
103
|
+
return {
|
|
104
|
+
...definition,
|
|
105
|
+
...(env ? { env } : {}),
|
|
106
|
+
...(headers ? { headers } : {}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* One-shot `omp -p` call: no session, no tools, no title.
|
|
8
|
+
*
|
|
9
|
+
* The goal auditor and the commit-message generator both need the same thing —
|
|
10
|
+
* a model answer with no conversation, no tool access and no session file — so
|
|
11
|
+
* the spawn lives here rather than in either caller. A second copy is how one
|
|
12
|
+
* of them would keep `--no-tools` while the other quietly gained tool access.
|
|
13
|
+
*
|
|
14
|
+
* `--thinking off` is not a shortcut, it is the cost profile: measured on this
|
|
15
|
+
* machine, a one-line reply took 26.7 s with reasoning on and 4.5 s with it
|
|
16
|
+
* off. Both callers ask for a short text answer, not a task.
|
|
17
|
+
*
|
|
18
|
+
* The prompt goes on stdin, not on the command line: a diff or an excerpt can
|
|
19
|
+
* be tens of kilobytes, and `omp -p` reads stdin when no message argument is
|
|
20
|
+
* given.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { stripKabmoHostEnv } from '@kabmo-labs/kabmo-sdk';
|
|
24
|
+
import { resolveOmpBin } from '@/server/lib/omp/core/cli';
|
|
25
|
+
|
|
26
|
+
export interface OmpPrintRequest {
|
|
27
|
+
prompt: string;
|
|
28
|
+
cwd: string;
|
|
29
|
+
/** `provider/modelId`; omp's own default when absent. */
|
|
30
|
+
model?: string;
|
|
31
|
+
timeoutMs?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type OmpPrintOutcome =
|
|
35
|
+
| { ok: true; text: string }
|
|
36
|
+
| { ok: false; reason: 'no-binary' | 'timeout' | 'exit' | 'spawn'; detail?: string };
|
|
37
|
+
|
|
38
|
+
export interface OmpPrintDeps {
|
|
39
|
+
resolveBin?: () => string | null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
43
|
+
/** Enough of git's/omp's own words to name the failure, not a whole log. */
|
|
44
|
+
const STDERR_LIMIT = 2_000;
|
|
45
|
+
|
|
46
|
+
export async function runOmpPrint(
|
|
47
|
+
request: OmpPrintRequest,
|
|
48
|
+
deps: OmpPrintDeps = {},
|
|
49
|
+
): Promise<OmpPrintOutcome> {
|
|
50
|
+
const bin = (deps.resolveBin ?? resolveOmpBin)();
|
|
51
|
+
if (!bin) return { ok: false, reason: 'no-binary' };
|
|
52
|
+
|
|
53
|
+
const args = ['-p', '--no-session', '--no-tools', '--no-lsp', '--thinking', 'off', '--cwd', request.cwd];
|
|
54
|
+
if (request.model) args.push('--model', request.model);
|
|
55
|
+
|
|
56
|
+
let timedOut = false;
|
|
57
|
+
try {
|
|
58
|
+
const proc = Bun.spawn({
|
|
59
|
+
cmd: [bin, ...args],
|
|
60
|
+
cwd: request.cwd,
|
|
61
|
+
// A reader: no session, no tools, no title, and Kabmo's own port/password
|
|
62
|
+
// must not leak into the child.
|
|
63
|
+
env: stripKabmoHostEnv({ ...Bun.env, PI_NO_TITLE: '1' }, process.platform),
|
|
64
|
+
stdin: 'pipe',
|
|
65
|
+
stdout: 'pipe',
|
|
66
|
+
stderr: 'pipe',
|
|
67
|
+
windowsHide: true,
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const killer = setTimeout(() => {
|
|
71
|
+
timedOut = true;
|
|
72
|
+
void proc.kill();
|
|
73
|
+
}, request.timeoutMs ?? DEFAULT_TIMEOUT_MS);
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
proc.stdin.write(request.prompt);
|
|
77
|
+
await proc.stdin.end();
|
|
78
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
79
|
+
new Response(proc.stdout).text(),
|
|
80
|
+
new Response(proc.stderr).text().catch(() => ''),
|
|
81
|
+
proc.exited,
|
|
82
|
+
]);
|
|
83
|
+
if (timedOut) return { ok: false, reason: 'timeout' };
|
|
84
|
+
if (exitCode !== 0) {
|
|
85
|
+
return { ok: false, reason: 'exit', detail: stderr.trim().slice(0, STDERR_LIMIT) };
|
|
86
|
+
}
|
|
87
|
+
return { ok: true, text: stdout.trim() };
|
|
88
|
+
} finally {
|
|
89
|
+
clearTimeout(killer);
|
|
90
|
+
}
|
|
91
|
+
} catch (error) {
|
|
92
|
+
// A spawn failure (out of descriptors, a bad cwd) is a call that could not
|
|
93
|
+
// be taken, not an answer.
|
|
94
|
+
return {
|
|
95
|
+
ok: false,
|
|
96
|
+
reason: 'spawn',
|
|
97
|
+
detail: error instanceof Error ? error.message : String(error),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -252,6 +252,10 @@ export function foldSessionFrame(host: SessionFrameHost, event: AgentEvent): Fra
|
|
|
252
252
|
// transcript, and a reset (or a command timeout's reset) could kill it —
|
|
253
253
|
// and the session-file caches were never dropped, so the sidebar and the
|
|
254
254
|
// timeline kept serving the pre-compaction read. Both pairs fold here.
|
|
255
|
+
// 19.0.0's `/handoff` is a manual compaction in `handoff` mode: it leaves
|
|
256
|
+
// live turns running and applies between turns, so the pair can arrive
|
|
257
|
+
// while `streaming` is true. `compacting` is still the right answer — a
|
|
258
|
+
// compaction is pending — and `_end` clears it either way.
|
|
255
259
|
case 'auto_compaction_start':
|
|
256
260
|
case 'manual_compaction_start':
|
|
257
261
|
host.compacting = true;
|