@kabmo-labs/kabmo 0.42.1 → 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-8gdp5b49.js → CsvGrid-3fr85032.js} +2 -2
- package/dist/client/static/js/{DocxView-j9sphgra.js → DocxView-pqbp2fpd.js} +4 -4
- package/dist/client/static/js/{DrawioView-xsgjc7d8.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-afd5cg54.js → PdfView-wmg0vk2p.js} +1 -1
- package/dist/client/static/js/SessionsView-90z2t4qe.js +1 -0
- package/dist/client/static/js/{SheetView-gfzgxb4r.js → SheetView-rg5gkcd7.js} +13 -13
- package/dist/client/static/js/{SvgPreview-225pkb99.js → SvgPreview-wpb7b0ez.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-z70sk69m.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-pf1gpkje.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-sr25kbn6.js → blockDiagram-BEXU5L5S-hbj5v7n7.js} +7 -7
- package/dist/client/static/js/c-8jf64j6h.js +1 -0
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-znstpg86.js → c4Diagram-YGBWAQC7-epfzh8dw.js} +6 -6
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-7n0pdcd8.js → classDiagram-v2-NBCMYWYE-kbks4qgz.js} +6 -6
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-zn3qw4c4.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-3z41vtzs.js → cynefinDiagram-VND7K2PF-r084stj5.js} +2 -2
- package/dist/client/static/js/{dagre-6A5THRUB-5j3zn883.js → dagre-6A5THRUB-64qc51n1.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-ryw1w2kh.js → diagram-22UHCM2B-70qtb1rm.js} +16 -16
- package/dist/client/static/js/{diagram-3UASUU5V-p91q4gkh.js → diagram-3UASUU5V-dgkvnsme.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-22dn73g4.js → diagram-ATOU4E4O-rnpsp26v.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-589p9n53.js → diagram-CDSNMT55-26hthh60.js} +5 -5
- package/dist/client/static/js/{diagram-MLGK6HIB-ezw06wbx.js → diagram-MLGK6HIB-nc1s85r5.js} +2 -2
- package/dist/client/static/js/{diagram-MPIPVDR6-cfwrsvk1.js → diagram-MPIPVDR6-e4dckqhv.js} +3 -3
- package/dist/client/static/js/{dockerfile-r4k7q34y.js → dockerfile-rxtyyhr1.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-3rv2wvbf.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-ma40kneq.js → elk-276RUBZZ-httpkyb1.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-xwstsfqa.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-qxyx9tr9.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-v6sg7bkh.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-kh6vp5w5.js → index-1dwdgp27.js} +1 -1
- package/dist/client/static/js/{index-df4yxfzd.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-mvykbyhe.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-b37ewyvk.js → index-7z9tz4ze.js} +2 -2
- package/dist/client/static/js/{index-3d40c0a7.js → index-7zc1z9z9.js} +4 -4
- package/dist/client/static/js/{index-8pdz41yh.js → index-8y51kgan.js} +3 -3
- package/dist/client/static/js/{index-qh753ynv.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-869bpqcs.js → index-d8r84zjd.js} +12 -12
- package/dist/client/static/js/{index-mq6s2faf.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-0p43qr4k.js → index-egd0vfey.js} +1 -1
- package/dist/client/static/js/{index-x7m6dmt4.js → index-enb6chty.js} +1 -1
- package/dist/client/static/js/{index-6eq445nn.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-sr7sdm2t.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-0nca2nhp.js → index-g3a9j9hf.js} +1 -1
- package/dist/client/static/js/{index-x7a5jpvq.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-313ctswm.js → index-gwqb7m8g.js} +1 -1
- package/dist/client/static/js/{index-w5q9ymf4.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-2w9j2nj4.js → index-k9ws464d.js} +2 -2
- package/dist/client/static/js/{index-b3d2k7ec.js → index-kc3c2gzb.js} +1 -1
- package/dist/client/static/js/{index-9hzfvjrb.js → index-kccp6tgd.js} +2 -2
- package/dist/client/static/js/{index-9ss64g4g.js → index-kmzd0adv.js} +1 -1
- package/dist/client/static/js/{index-8fvmyv7t.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-mphhvgm9.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-xsts4pqm.js → index-r11bbnek.js} +78 -78
- package/dist/client/static/js/{index-q3qpm7jn.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-v5dbrq83.js → index-tzbzehqd.js} +1 -1
- package/dist/client/static/js/index-vcrh95gf.css +1 -0
- package/dist/client/static/js/{index-4y0ayjfx.js → index-vmgzhp41.js} +1 -1
- package/dist/client/static/js/{index-6dxs0tvg.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-0anekyhb.js → infoDiagram-VRGFBTTK-qv7438m3.js} +1 -1
- package/dist/client/static/js/ini-1x0ad976.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-zxpmfkjb.js → ishikawaDiagram-OU5B5YK6-p1w6zg5y.js} +4 -4
- package/dist/client/static/js/java-3944nq02.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-1e86fzra.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-e85hhmr1.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-jpcrnzyw.js → mermaid.core-5s24b4hh.js} +6 -6
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-xwy5928e.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-7dy6pw26.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-nrv2t5yn.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-3nt63xr8.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-evm05hzp.js → railroadDiagram-XR7U4H2S-dwy3k2jx.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-tzrcmktj.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-pcvgybk3.js → rust-bmb4ee5w.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-jvjd5rz8.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-0zvjwx29.js → sequenceDiagram-PO4LG4MO-0fcmzgdy.js} +19 -19
- package/dist/client/static/js/{sizeCapture-INFHLROL-6t6g0edv.js → sizeCapture-INFHLROL-t8fcm7rq.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-nb13b23a.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-ef8vmg6f.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-3bfph698.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-vj6yj6tc.js → usecaseDiagram-POWQR4AR-sxzrv8ht.js} +43 -43
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-9xyyabaq.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-zpcwgv9d.js → wardleyDiagram-VNRHLVJA-rvwxn458.js} +4 -4
- package/dist/client/static/js/xml-6ct32gys.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-pdr2rms2.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/chat-timeline/tool-renderers/shared/ToolBody.tsx +3 -3
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/ToolRowActions.tsx +45 -0
- package/src/client/components/workspace/chat-timeline/tool-renderers/shared/tool-view.ts +14 -4
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Card.tsx +2 -12
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Compact.tsx +42 -38
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Minimal.tsx +25 -21
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Trace.tsx +41 -29
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/Tui.tsx +47 -43
- package/src/client/components/workspace/chat-timeline/tool-renderers/styles/parity.test.tsx +136 -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/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/omp/session/scan.ts +15 -2
- package/src/server/lib/omp/session/session-discovery.test.ts +21 -0
- 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/timeline/tool-render-mode.ts +3 -3
- 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/operator-title.test.ts +21 -0
- package/src/shared/lib/omp/session/operator-title.ts +28 -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-ve9hc519.js +0 -1
- package/dist/client/static/js/LayoutWrapper-5mqffvkc.js +0 -2
- package/dist/client/static/js/Modal-50whypff.js +0 -38
- package/dist/client/static/js/SessionsView-7719nvy0.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-evp84v09.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-001vebsp.js +0 -2
- package/dist/client/static/js/index-5599dngt.js +0 -1
- package/dist/client/static/js/index-5asf5625.js +0 -4
- package/dist/client/static/js/index-cqaz1281.js +0 -2
- package/dist/client/static/js/index-f4vr1c6e.css +0 -1
- package/dist/client/static/js/index-rt6ac0kk.js +0 -478
- package/dist/client/static/js/index-y1p3bdsw.js +0 -9
- 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-r0tswz8r.js +0 -1
- package/dist/client/static/js/one-light-xzcfrptf.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-f4sx355z.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,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
|
+
import {
|
|
8
|
+
generateCommitMessage,
|
|
9
|
+
resolveCommitMessageTarget,
|
|
10
|
+
type CommitMessageDeps,
|
|
11
|
+
type CommitMessageSettings,
|
|
12
|
+
} from '@/server/lib/fs/git-commit-message.server';
|
|
13
|
+
|
|
14
|
+
const SETTINGS: CommitMessageSettings = { mode: 'auto', harness: '', model: '', prompt: '' };
|
|
15
|
+
|
|
16
|
+
const DEPS: CommitMessageDeps = {
|
|
17
|
+
readModelRoles: async () => ({ path: '', roles: { tiny: 'p/tiny' } }),
|
|
18
|
+
loadHarnessSession: async (id) => (id === 's1'
|
|
19
|
+
? { sessionId: 's1', harness: 'claude', agentSessionId: '', cwd: '/ws' }
|
|
20
|
+
: null),
|
|
21
|
+
loadHarnessConfig: async () => ({
|
|
22
|
+
command: '',
|
|
23
|
+
env: '',
|
|
24
|
+
provider: '',
|
|
25
|
+
model: 'anthropic/claude-sonnet',
|
|
26
|
+
thinking: '',
|
|
27
|
+
mode: '',
|
|
28
|
+
}),
|
|
29
|
+
harnessProbeModels: async () => [{ value: 'anthropic/claude-sonnet', name: 'Sonnet' }],
|
|
30
|
+
readContext: async () => ({
|
|
31
|
+
branch: 'main',
|
|
32
|
+
files: ['a.ts'],
|
|
33
|
+
diff: '+a',
|
|
34
|
+
recentCommits: ['base'],
|
|
35
|
+
truncated: false,
|
|
36
|
+
amend: false,
|
|
37
|
+
}),
|
|
38
|
+
runOmp: async () => ({ ok: true, text: 'feat: add a' }),
|
|
39
|
+
runAcp: async () => ({ ok: true, text: 'fix: correct b' }),
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
describe('resolveCommitMessageTarget', () => {
|
|
43
|
+
test('off has no target', async () => {
|
|
44
|
+
expect(await resolveCommitMessageTarget({ ...SETTINGS, mode: 'off' }, null, DEPS)).toBeNull();
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test('omp uses the explicit model, else the tiny role', async () => {
|
|
48
|
+
expect(await resolveCommitMessageTarget({ ...SETTINGS, mode: 'omp', model: 'x/y' }, null, DEPS))
|
|
49
|
+
.toEqual({ kind: 'omp', harness: 'omp-rpc', model: 'x/y' });
|
|
50
|
+
expect(await resolveCommitMessageTarget({ ...SETTINGS, mode: 'omp' }, null, DEPS))
|
|
51
|
+
.toEqual({ kind: 'omp', harness: 'omp-rpc', model: 'p/tiny' });
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test('omp prefers the commit role over tiny', async () => {
|
|
55
|
+
const target = await resolveCommitMessageTarget(
|
|
56
|
+
{ ...SETTINGS, mode: 'omp' },
|
|
57
|
+
null,
|
|
58
|
+
{
|
|
59
|
+
...DEPS,
|
|
60
|
+
readModelRoles: async () => ({ path: '', roles: { commit: 'p/commit', tiny: 'p/tiny' } }),
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
expect(target).toEqual({ kind: 'omp', harness: 'omp-rpc', model: 'p/commit' });
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('harness pins an ACP agent, and refuses an unknown id', async () => {
|
|
67
|
+
expect(await resolveCommitMessageTarget({ ...SETTINGS, mode: 'harness', harness: 'claude', model: 'a/b' }, null, DEPS))
|
|
68
|
+
.toEqual({ kind: 'acp', harness: 'claude', model: 'a/b' });
|
|
69
|
+
expect(await resolveCommitMessageTarget({ ...SETTINGS, mode: 'harness', harness: 'nope' }, null, DEPS))
|
|
70
|
+
.toBeNull();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test('auto follows the active chat, and falls back to omp without one', async () => {
|
|
74
|
+
expect(await resolveCommitMessageTarget(SETTINGS, 's1', DEPS))
|
|
75
|
+
.toEqual({ kind: 'acp', harness: 'claude', model: null });
|
|
76
|
+
expect(await resolveCommitMessageTarget(SETTINGS, 's2', DEPS))
|
|
77
|
+
.toEqual({ kind: 'omp', harness: 'omp-rpc', model: 'p/tiny' });
|
|
78
|
+
expect(await resolveCommitMessageTarget(SETTINGS, null, DEPS))
|
|
79
|
+
.toEqual({ kind: 'omp', harness: 'omp-rpc', model: 'p/tiny' });
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
describe('generateCommitMessage', () => {
|
|
84
|
+
test('returns the omp answer', async () => {
|
|
85
|
+
const result = await generateCommitMessage(
|
|
86
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'omp' } },
|
|
87
|
+
DEPS,
|
|
88
|
+
);
|
|
89
|
+
expect(result).toEqual({
|
|
90
|
+
ok: true,
|
|
91
|
+
message: 'feat: add a',
|
|
92
|
+
target: { kind: 'omp', harness: 'omp-rpc', model: 'p/tiny' },
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('maps a missing omp binary to an actionable 409', async () => {
|
|
97
|
+
const result = await generateCommitMessage(
|
|
98
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'omp' } },
|
|
99
|
+
{ ...DEPS, runOmp: async () => ({ ok: false, reason: 'no-binary' }) },
|
|
100
|
+
);
|
|
101
|
+
expect(result.ok).toBe(false);
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
expect(result.status).toBe(409);
|
|
104
|
+
expect(result.code).toBe('omp_missing');
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
test('refuses an empty change set before calling a model', async () => {
|
|
109
|
+
let called = false;
|
|
110
|
+
const result = await generateCommitMessage(
|
|
111
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'omp' } },
|
|
112
|
+
{
|
|
113
|
+
...DEPS,
|
|
114
|
+
readContext: async () => ({
|
|
115
|
+
branch: 'main',
|
|
116
|
+
files: [],
|
|
117
|
+
diff: '',
|
|
118
|
+
recentCommits: [],
|
|
119
|
+
truncated: false,
|
|
120
|
+
amend: false,
|
|
121
|
+
}),
|
|
122
|
+
runOmp: async () => {
|
|
123
|
+
called = true;
|
|
124
|
+
return { ok: true, text: 'feat: x' };
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
);
|
|
128
|
+
expect(called).toBe(false);
|
|
129
|
+
expect(result.ok).toBe(false);
|
|
130
|
+
if (!result.ok) expect(result.code).toBe('nothing_staged');
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
test('runs the ACP one-shot with the harness default model', async () => {
|
|
134
|
+
const seen: Array<{ provider: string; modelId: string } | null> = [];
|
|
135
|
+
const result = await generateCommitMessage(
|
|
136
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'harness', harness: 'claude' } },
|
|
137
|
+
{
|
|
138
|
+
...DEPS,
|
|
139
|
+
runAcp: async (request) => {
|
|
140
|
+
seen.push(request.model);
|
|
141
|
+
return { ok: true, text: 'fix: correct b' };
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
);
|
|
145
|
+
expect(seen).toEqual([{ provider: 'anthropic', modelId: 'anthropic/claude-sonnet' }]);
|
|
146
|
+
expect(result.ok).toBe(true);
|
|
147
|
+
if (result.ok) expect(result.message).toBe('fix: correct b');
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
test('maps an empty ACP reply to a 502', async () => {
|
|
151
|
+
const result = await generateCommitMessage(
|
|
152
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'harness', harness: 'claude' } },
|
|
153
|
+
{ ...DEPS, runAcp: async () => ({ ok: false, reason: 'no-reply' }) },
|
|
154
|
+
);
|
|
155
|
+
expect(result.ok).toBe(false);
|
|
156
|
+
if (!result.ok) {
|
|
157
|
+
expect(result.status).toBe(502);
|
|
158
|
+
expect(result.code).toBe('empty_reply');
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
test('off refuses before reading the repository', async () => {
|
|
163
|
+
const result = await generateCommitMessage(
|
|
164
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'off' } },
|
|
165
|
+
DEPS,
|
|
166
|
+
);
|
|
167
|
+
expect(result.ok).toBe(false);
|
|
168
|
+
if (!result.ok) expect(result.code).toBe('commit_message_off');
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('a harness mode with no harness names the setting to fix', async () => {
|
|
172
|
+
const result = await generateCommitMessage(
|
|
173
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'harness', harness: '' } },
|
|
174
|
+
DEPS,
|
|
175
|
+
);
|
|
176
|
+
expect(result.ok).toBe(false);
|
|
177
|
+
if (!result.ok) {
|
|
178
|
+
expect(result.status).toBe(409);
|
|
179
|
+
expect(result.code).toBe('commit_harness_missing');
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
test('a custom prompt without {{diff}} is refused', async () => {
|
|
184
|
+
const result = await generateCommitMessage(
|
|
185
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'omp', prompt: 'Write a commit message.' } },
|
|
186
|
+
DEPS,
|
|
187
|
+
);
|
|
188
|
+
expect(result.ok).toBe(false);
|
|
189
|
+
if (!result.ok) {
|
|
190
|
+
expect(result.status).toBe(409);
|
|
191
|
+
expect(result.code).toBe('prompt_missing_diff');
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test('a custom prompt with {{diff}} is sent to the model', async () => {
|
|
196
|
+
const prompts: string[] = [];
|
|
197
|
+
const result = await generateCommitMessage(
|
|
198
|
+
{ targetDir: '/ws', settings: { ...SETTINGS, mode: 'omp', prompt: 'CUSTOM MARKER\n\n{{diff}}' } },
|
|
199
|
+
{
|
|
200
|
+
...DEPS,
|
|
201
|
+
runOmp: async (request) => {
|
|
202
|
+
prompts.push(request.prompt);
|
|
203
|
+
return { ok: true, text: 'feat: x' };
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
);
|
|
207
|
+
expect(result.ok).toBe(true);
|
|
208
|
+
expect(prompts[0]).toContain('CUSTOM MARKER');
|
|
209
|
+
expect(prompts[0]).toContain('+a');
|
|
210
|
+
});
|
|
211
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
|
+
import { buildCommitMessagePrompt, cleanCommitMessage } from '@/server/lib/fs/git-commit-prompt';
|
|
8
|
+
import type { CommitContext } from '@/server/lib/fs/git-commit-context';
|
|
9
|
+
|
|
10
|
+
const CONTEXT: CommitContext = {
|
|
11
|
+
branch: 'feat/commit-message',
|
|
12
|
+
files: ['src/a.ts', 'src/b.ts'],
|
|
13
|
+
diff: 'diff --git a/src/a.ts b/src/a.ts\n+export const a = 1;',
|
|
14
|
+
recentCommits: ['feat: add a', 'fix: correct b'],
|
|
15
|
+
truncated: false,
|
|
16
|
+
amend: false,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
describe('buildCommitMessagePrompt', () => {
|
|
20
|
+
test('carries the branch, the recent style, the files and the diff', () => {
|
|
21
|
+
const prompt = buildCommitMessagePrompt(CONTEXT);
|
|
22
|
+
expect(prompt).toContain('Branch: feat/commit-message');
|
|
23
|
+
expect(prompt).toContain('- feat: add a');
|
|
24
|
+
expect(prompt).toContain('- src/a.ts');
|
|
25
|
+
expect(prompt).toContain('+export const a = 1;');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
test('names the staged set as the commit scope', () => {
|
|
29
|
+
expect(buildCommitMessagePrompt(CONTEXT)).toContain('the staged change set');
|
|
30
|
+
expect(buildCommitMessagePrompt({ ...CONTEXT, amend: true })).toContain('the commit being amended');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('says when the diff was truncated', () => {
|
|
34
|
+
expect(buildCommitMessagePrompt({ ...CONTEXT, truncated: true })).toContain('truncated');
|
|
35
|
+
expect(buildCommitMessagePrompt(CONTEXT)).not.toContain('truncated');
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test('an empty history and an empty diff still produce a prompt', () => {
|
|
39
|
+
const prompt = buildCommitMessagePrompt({
|
|
40
|
+
...CONTEXT,
|
|
41
|
+
files: [],
|
|
42
|
+
diff: '',
|
|
43
|
+
recentCommits: [],
|
|
44
|
+
});
|
|
45
|
+
expect(prompt).toContain('(no commits yet)');
|
|
46
|
+
expect(prompt).toContain('(no textual diff)');
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
test('a custom template replaces the built-in one', () => {
|
|
50
|
+
const prompt = buildCommitMessagePrompt(CONTEXT, 'CUSTOM MARKER\n\n{{diff}}');
|
|
51
|
+
expect(prompt).toContain('CUSTOM MARKER');
|
|
52
|
+
expect(prompt).toContain('+export const a = 1;');
|
|
53
|
+
expect(prompt).not.toContain('You write git commit messages');
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
describe('cleanCommitMessage', () => {
|
|
58
|
+
test('strips a code fence', () => {
|
|
59
|
+
expect(cleanCommitMessage('```text\nfeat: add a\n```')).toBe('feat: add a');
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
test('strips a leading label', () => {
|
|
63
|
+
expect(cleanCommitMessage('Commit message: fix: correct b')).toBe('fix: correct b');
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
test('keeps a multi-line body', () => {
|
|
67
|
+
expect(cleanCommitMessage('feat: add a\n\nWhy it matters.')).toBe('feat: add a\n\nWhy it matters.');
|
|
68
|
+
});
|
|
69
|
+
});
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The commit-message prompt, and the reader that turns a model's reply back
|
|
8
|
+
* into a message.
|
|
9
|
+
*
|
|
10
|
+
* The template lives in `shared/lib/git/commit-prompt.ts` because the settings
|
|
11
|
+
* page edits the same text. This module only fills it from a `CommitContext`
|
|
12
|
+
* and cleans the answer.
|
|
13
|
+
*
|
|
14
|
+
* The scope line is deliberate. A model that is handed a diff will describe
|
|
15
|
+
* everything it can see; if the prompt does not say this is the STAGED set, a
|
|
16
|
+
* message can mention work that is not in the commit.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
DEFAULT_COMMIT_MESSAGE_PROMPT,
|
|
21
|
+
renderCommitPrompt,
|
|
22
|
+
} from '@/shared/lib/git/commit-prompt';
|
|
23
|
+
import type { CommitContext } from '@/server/lib/fs/git-commit-context';
|
|
24
|
+
|
|
25
|
+
export function buildCommitMessagePrompt(context: CommitContext, template = ''): string {
|
|
26
|
+
const files = context.files.length > 0
|
|
27
|
+
? context.files.map((file) => `- ${file}`).join('\n')
|
|
28
|
+
: '(no files listed)';
|
|
29
|
+
const recent = context.recentCommits.length > 0
|
|
30
|
+
? context.recentCommits.map((subject) => `- ${subject}`).join('\n')
|
|
31
|
+
: '(no commits yet)';
|
|
32
|
+
const scope = context.amend
|
|
33
|
+
? 'the commit being amended'
|
|
34
|
+
: 'the staged change set';
|
|
35
|
+
|
|
36
|
+
return renderCommitPrompt(template.trim() || DEFAULT_COMMIT_MESSAGE_PROMPT, {
|
|
37
|
+
scope,
|
|
38
|
+
branch: context.branch,
|
|
39
|
+
recent_commits: recent,
|
|
40
|
+
files,
|
|
41
|
+
diff: context.diff || '(no textual diff)',
|
|
42
|
+
truncated: context.truncated
|
|
43
|
+
? 'The diff was truncated to fit the model context; describe only what is visible.'
|
|
44
|
+
: '',
|
|
45
|
+
}).trim();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* A reply as a commit message: code fences and a leading "Commit message:"
|
|
50
|
+
* label are the two wrappers models add despite being told not to.
|
|
51
|
+
*/
|
|
52
|
+
export function cleanCommitMessage(text: string): string {
|
|
53
|
+
let value = text.trim();
|
|
54
|
+
const fenced = /^```[a-zA-Z0-9_-]*\s*\n([\s\S]*?)\n```$/.exec(value);
|
|
55
|
+
if (fenced) value = fenced[1].trim();
|
|
56
|
+
return value.replace(/^(?:commit message|message)\s*:\s*/i, '').trim();
|
|
57
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The commit-message settings, read where the generation runs.
|
|
8
|
+
*
|
|
9
|
+
* They live in Kabmo's settings blob beside `autoSessionTitle` and the goal
|
|
10
|
+
* keys, and the server reads them on every request: the Source Control panel is
|
|
11
|
+
* global, so a cached read would keep an old harness alive for exactly the
|
|
12
|
+
* window the operator was changing it in.
|
|
13
|
+
*
|
|
14
|
+
* Every value has a default and the read swallows its errors: a settings lookup
|
|
15
|
+
* must never be the reason a commit message cannot be generated.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { readSettingsJson } from '@/server/lib/db/settings-store';
|
|
19
|
+
import { getDb } from '@/server/db.server';
|
|
20
|
+
import { SETTINGS_BLOB_KEY } from '@/shared/lib/settings/keys';
|
|
21
|
+
import type { CommitMessageMode, CommitMessageSettings } from '@/server/lib/fs/git-commit-message.server';
|
|
22
|
+
|
|
23
|
+
const MODES: readonly CommitMessageMode[] = ['auto', 'omp', 'harness', 'off'];
|
|
24
|
+
|
|
25
|
+
export async function readCommitMessageSettings(): Promise<CommitMessageSettings> {
|
|
26
|
+
try {
|
|
27
|
+
const db = await getDb();
|
|
28
|
+
const blob = await readSettingsJson<Record<string, unknown> | null>(db, SETTINGS_BLOB_KEY, null);
|
|
29
|
+
const mode = typeof blob?.commitMessageMode === 'string'
|
|
30
|
+
&& MODES.includes(blob.commitMessageMode as CommitMessageMode)
|
|
31
|
+
? blob.commitMessageMode as CommitMessageMode
|
|
32
|
+
: 'auto';
|
|
33
|
+
return {
|
|
34
|
+
mode,
|
|
35
|
+
harness: typeof blob?.commitMessageHarness === 'string' ? blob.commitMessageHarness.trim() : '',
|
|
36
|
+
model: typeof blob?.commitMessageModel === 'string' ? blob.commitMessageModel.trim() : '',
|
|
37
|
+
prompt: typeof blob?.commitMessagePrompt === 'string' ? blob.commitMessagePrompt : '',
|
|
38
|
+
};
|
|
39
|
+
} catch {
|
|
40
|
+
return { mode: 'auto', harness: '', model: '', prompt: '' };
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
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 os from 'node:os';
|
|
9
|
+
import path from 'node:path';
|
|
10
|
+
import { getDb } from '@/server/db.server';
|
|
11
|
+
import { writeSettingsJson } from '@/server/lib/db/settings-store';
|
|
12
|
+
import {
|
|
13
|
+
applyGitIdentity,
|
|
14
|
+
readGitIdentity,
|
|
15
|
+
readGitIdentitySettings,
|
|
16
|
+
type GitIdentityDeps,
|
|
17
|
+
} from '@/server/lib/fs/git-identity.server';
|
|
18
|
+
import { SETTINGS_BLOB_KEY } from '@/shared/lib/settings/keys';
|
|
19
|
+
import { isolateDb, releaseDb } from '@/test-support/isolated-db';
|
|
20
|
+
import { removeDir } from '@/test-support/remove-dir';
|
|
21
|
+
|
|
22
|
+
const dirs: string[] = [];
|
|
23
|
+
const WORK = { id: 'work', name: 'Work User', email: 'work@example.invalid' };
|
|
24
|
+
const PERSONAL = { id: 'personal', name: 'Personal', email: 'me@example.invalid' };
|
|
25
|
+
|
|
26
|
+
function gitConfig(file: string, ...args: string[]): string {
|
|
27
|
+
const result = Bun.spawnSync({ cmd: ['git', 'config', '--file', file, ...args] });
|
|
28
|
+
if (result.exitCode !== 0) {
|
|
29
|
+
throw new Error(`git config ${args.join(' ')} failed: ${result.stderr.toString()}`);
|
|
30
|
+
}
|
|
31
|
+
return result.stdout.toString().trim();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function makeConfig(local: { name: string; email: string } | null): GitIdentityDeps {
|
|
35
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'kabmo-identity-'));
|
|
36
|
+
dirs.push(dir);
|
|
37
|
+
const file = path.join(dir, 'gitconfig');
|
|
38
|
+
fs.writeFileSync(file, '');
|
|
39
|
+
if (local) {
|
|
40
|
+
gitConfig(file, 'user.name', local.name);
|
|
41
|
+
gitConfig(file, 'user.email', local.email);
|
|
42
|
+
}
|
|
43
|
+
return { configArgs: ['--file', file] };
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
beforeEach(async () => {
|
|
47
|
+
await isolateDb();
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
afterEach(async () => {
|
|
51
|
+
await releaseDb();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
afterAll(() => {
|
|
55
|
+
for (const dir of dirs) removeDir(dir);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
describe('readGitIdentitySettings', () => {
|
|
59
|
+
test('reads the saved list', async () => {
|
|
60
|
+
const db = await getDb();
|
|
61
|
+
await writeSettingsJson(db, SETTINGS_BLOB_KEY, {
|
|
62
|
+
gitIdentities: [WORK, PERSONAL],
|
|
63
|
+
});
|
|
64
|
+
expect(await readGitIdentitySettings()).toEqual({ identities: [WORK, PERSONAL] });
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
test('a malformed list is empty', async () => {
|
|
68
|
+
const db = await getDb();
|
|
69
|
+
await writeSettingsJson(db, SETTINGS_BLOB_KEY, {
|
|
70
|
+
gitIdentities: [{ id: 'bad', name: '', email: 'x@y' }],
|
|
71
|
+
});
|
|
72
|
+
expect(await readGitIdentitySettings()).toEqual({ identities: [] });
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
describe('readGitIdentity', () => {
|
|
77
|
+
test('reads the global config', async () => {
|
|
78
|
+
const deps = makeConfig({ name: 'Global User', email: 'global@example.invalid' });
|
|
79
|
+
|
|
80
|
+
const read = await readGitIdentity(deps);
|
|
81
|
+
|
|
82
|
+
expect(read.global).toEqual({ name: 'Global User', email: 'global@example.invalid' });
|
|
83
|
+
expect(read.appliedId).toBeNull();
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
describe('applyGitIdentity', () => {
|
|
88
|
+
test('writes the identity to the global config and marks it', async () => {
|
|
89
|
+
const deps = makeConfig({ name: 'Global User', email: 'global@example.invalid' });
|
|
90
|
+
|
|
91
|
+
const read = await applyGitIdentity(WORK, deps);
|
|
92
|
+
|
|
93
|
+
expect(read.global).toEqual({ name: WORK.name, email: WORK.email });
|
|
94
|
+
expect(read.appliedId).toBe(WORK.id);
|
|
95
|
+
expect(gitConfig(deps.configArgs![1], '--get', 'user.name')).toBe(WORK.name);
|
|
96
|
+
expect(gitConfig(deps.configArgs![1], '--get', 'user.email')).toBe(WORK.email);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
test('global config restores the previous values', async () => {
|
|
100
|
+
const deps = makeConfig({ name: 'Global User', email: 'global@example.invalid' });
|
|
101
|
+
await applyGitIdentity(WORK, deps);
|
|
102
|
+
|
|
103
|
+
const read = await applyGitIdentity(null, deps);
|
|
104
|
+
|
|
105
|
+
expect(read.global).toEqual({ name: 'Global User', email: 'global@example.invalid' });
|
|
106
|
+
expect(read.appliedId).toBeNull();
|
|
107
|
+
expect(gitConfig(deps.configArgs![1], '--get', 'user.name')).toBe('Global User');
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
test('a second apply keeps the original backup', async () => {
|
|
111
|
+
const deps = makeConfig({ name: 'Global User', email: 'global@example.invalid' });
|
|
112
|
+
await applyGitIdentity(WORK, deps);
|
|
113
|
+
await applyGitIdentity(PERSONAL, deps);
|
|
114
|
+
|
|
115
|
+
const read = await applyGitIdentity(null, deps);
|
|
116
|
+
|
|
117
|
+
expect(read.global).toEqual({ name: 'Global User', email: 'global@example.invalid' });
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
test('a config with no identity is restored to no identity', async () => {
|
|
121
|
+
const deps = makeConfig(null);
|
|
122
|
+
await applyGitIdentity(WORK, deps);
|
|
123
|
+
|
|
124
|
+
const read = await applyGitIdentity(null, deps);
|
|
125
|
+
|
|
126
|
+
expect(read.global).toBeNull();
|
|
127
|
+
expect(read.appliedId).toBeNull();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The commit identity, read from and written to the user's GLOBAL git config.
|
|
8
|
+
*
|
|
9
|
+
* The saved identities are a library; the global config is the source of truth.
|
|
10
|
+
* Applying one writes `user.name` / `user.email` with `git config --global`, so
|
|
11
|
+
* every repository that has no local override commits as that person. "Global
|
|
12
|
+
* config" restores what was there before Kabmo wrote — including "nothing",
|
|
13
|
+
* which unsets the key and lets git's own default answer.
|
|
14
|
+
*
|
|
15
|
+
* The previous values and the applied id live in the same config under
|
|
16
|
+
* `kabmo.identity.*`, so the backup survives a Kabmo restart and cannot be
|
|
17
|
+
* applied to the wrong scope.
|
|
18
|
+
*
|
|
19
|
+
* `configArgs` is the test seam: production passes `['--global']`, a test passes
|
|
20
|
+
* `['--file', tempPath]` so it never touches the developer's real config.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
import { readSettingsJson } from '@/server/lib/db/settings-store';
|
|
24
|
+
import { getDb } from '@/server/db.server';
|
|
25
|
+
import { runGit } from '@/server/lib/fs/git-run';
|
|
26
|
+
import { SETTINGS_BLOB_KEY } from '@/shared/lib/settings/keys';
|
|
27
|
+
import {
|
|
28
|
+
normalizeGitIdentities,
|
|
29
|
+
type GitIdentity,
|
|
30
|
+
type GitIdentityRead,
|
|
31
|
+
type GitIdentityValue,
|
|
32
|
+
} from '@/shared/lib/git/identity';
|
|
33
|
+
|
|
34
|
+
const MARKER = 'kabmo.identity.applied';
|
|
35
|
+
const PREVIOUS_NAME = 'kabmo.identity.previousName';
|
|
36
|
+
const PREVIOUS_EMAIL = 'kabmo.identity.previousEmail';
|
|
37
|
+
|
|
38
|
+
export interface GitIdentityDeps {
|
|
39
|
+
/** The config scope: `['--global']` in production, `['--file', path]` in tests. */
|
|
40
|
+
configArgs?: string[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function readGitIdentitySettings(): Promise<{ identities: GitIdentity[] }> {
|
|
44
|
+
try {
|
|
45
|
+
const db = await getDb();
|
|
46
|
+
const blob = await readSettingsJson<Record<string, unknown> | null>(db, SETTINGS_BLOB_KEY, null);
|
|
47
|
+
return { identities: normalizeGitIdentities(blob?.gitIdentities) };
|
|
48
|
+
} catch {
|
|
49
|
+
return { identities: [] };
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
async function configValue(configArgs: string[], key: string): Promise<string | null> {
|
|
54
|
+
const result = await runGit(['config', ...configArgs, '--get', key], {
|
|
55
|
+
cwd: process.cwd(),
|
|
56
|
+
timeout: 5_000,
|
|
57
|
+
});
|
|
58
|
+
if (result.error || result.exitCode !== 0) return null;
|
|
59
|
+
const value = result.stdout.trim();
|
|
60
|
+
return value.length > 0 ? value : null;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function setConfig(configArgs: string[], key: string, value: string | null): Promise<void> {
|
|
64
|
+
const result = await runGit(
|
|
65
|
+
value === null
|
|
66
|
+
? ['config', ...configArgs, '--unset', key]
|
|
67
|
+
: ['config', ...configArgs, key, value],
|
|
68
|
+
{ cwd: process.cwd(), timeout: 5_000 },
|
|
69
|
+
);
|
|
70
|
+
if (result.error) throw result.error;
|
|
71
|
+
// `--unset` exits 5 when the key is absent; that is the desired state.
|
|
72
|
+
if (result.exitCode !== 0 && !(value === null && result.exitCode === 5)) {
|
|
73
|
+
throw new Error(result.stderr.trim() || `git config ${key} failed`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function pair(name: string | null, email: string | null): GitIdentityValue | null {
|
|
78
|
+
return name && email ? { name, email } : null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export async function readGitIdentity(deps: GitIdentityDeps = {}): Promise<GitIdentityRead> {
|
|
82
|
+
const configArgs = deps.configArgs ?? ['--global'];
|
|
83
|
+
const [name, email, appliedId] = await Promise.all([
|
|
84
|
+
configValue(configArgs, 'user.name'),
|
|
85
|
+
configValue(configArgs, 'user.email'),
|
|
86
|
+
configValue(configArgs, MARKER),
|
|
87
|
+
]);
|
|
88
|
+
return { global: pair(name, email), appliedId };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Apply a saved identity to the global config, or restore the config when
|
|
93
|
+
* `identity` is null.
|
|
94
|
+
*
|
|
95
|
+
* The first apply backs up the global values; later applies keep that backup,
|
|
96
|
+
* so "Global config" always returns to what the user had before Kabmo touched
|
|
97
|
+
* it.
|
|
98
|
+
*/
|
|
99
|
+
export async function applyGitIdentity(
|
|
100
|
+
identity: GitIdentity | null,
|
|
101
|
+
deps: GitIdentityDeps = {},
|
|
102
|
+
): Promise<GitIdentityRead> {
|
|
103
|
+
const configArgs = deps.configArgs ?? ['--global'];
|
|
104
|
+
|
|
105
|
+
if (identity) {
|
|
106
|
+
const marker = await configValue(configArgs, MARKER);
|
|
107
|
+
if (!marker) {
|
|
108
|
+
const currentName = await configValue(configArgs, 'user.name');
|
|
109
|
+
const currentEmail = await configValue(configArgs, 'user.email');
|
|
110
|
+
await setConfig(configArgs, PREVIOUS_NAME, currentName);
|
|
111
|
+
await setConfig(configArgs, PREVIOUS_EMAIL, currentEmail);
|
|
112
|
+
}
|
|
113
|
+
await setConfig(configArgs, 'user.name', identity.name);
|
|
114
|
+
await setConfig(configArgs, 'user.email', identity.email);
|
|
115
|
+
await setConfig(configArgs, MARKER, identity.id);
|
|
116
|
+
return readGitIdentity(deps);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const marker = await configValue(configArgs, MARKER);
|
|
120
|
+
if (marker) {
|
|
121
|
+
const previousName = await configValue(configArgs, PREVIOUS_NAME);
|
|
122
|
+
const previousEmail = await configValue(configArgs, PREVIOUS_EMAIL);
|
|
123
|
+
await setConfig(configArgs, 'user.name', previousName);
|
|
124
|
+
await setConfig(configArgs, 'user.email', previousEmail);
|
|
125
|
+
await setConfig(configArgs, PREVIOUS_NAME, null);
|
|
126
|
+
await setConfig(configArgs, PREVIOUS_EMAIL, null);
|
|
127
|
+
await setConfig(configArgs, MARKER, null);
|
|
128
|
+
}
|
|
129
|
+
return readGitIdentity(deps);
|
|
130
|
+
}
|