@kabmo-labs/kabmo 0.46.1 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.html +1 -1
- package/dist/client/index.js +439 -435
- package/dist/client/static/js/{CsvGrid-qdkmv8bj.js → CsvGrid-vfgttmym.js} +2 -2
- package/dist/client/static/js/{DocxView-k84ns803.js → DocxView-dc41t6rp.js} +2 -2
- package/dist/client/static/js/{DrawioView-r1n717f7.js → DrawioView-wpwr38d9.js} +2 -2
- package/dist/client/static/js/HtmlPreview-23n7t5cs.js +1 -0
- package/dist/client/static/js/ImageView-mvjb3qh1.js +1 -0
- package/dist/client/static/js/LayoutWrapper-eenx0hp2.js +2 -0
- package/dist/client/static/js/{Modal-xe6h99jn.js → Modal-dsqhas10.js} +13 -13
- package/dist/client/static/js/{PdfView-ffg4mccg.js → PdfView-cpvsbfk0.js} +1 -1
- package/dist/client/static/js/{SessionsView-cdcbsee9.js → SessionsView-s0crtcm8.js} +1 -1
- package/dist/client/static/js/{SheetView-89sscpz6.js → SheetView-n6mst0hq.js} +13 -13
- package/dist/client/static/js/{SvgPreview-68c0ccbv.js → SvgPreview-g2aqq812.js} +1 -1
- package/dist/client/static/js/{abnfDiagram-O67JEVCF-h3a5s259.js → abnfDiagram-O67JEVCF-3vac8sq4.js} +1 -1
- package/dist/client/static/js/architecture-7GRP2DOG-b5w9mnn5.js +1 -0
- package/dist/client/static/js/{architectureDiagram-NJMV4G6O-983p0jgn.js → architectureDiagram-NJMV4G6O-1nh4htz2.js} +3 -3
- package/dist/client/static/js/{astro-hyj5wege.js → astro-63zcysj7.js} +1 -1
- package/dist/client/static/js/bash-hv3167gh.js +1 -0
- package/dist/client/static/js/{blockDiagram-BEXU5L5S-16pse5mh.js → blockDiagram-BEXU5L5S-62z6kaar.js} +2 -2
- package/dist/client/static/js/{c4Diagram-YGBWAQC7-mvnb00zt.js → c4Diagram-YGBWAQC7-rts5zgx4.js} +3 -3
- package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-kmpd91xb.js → classDiagram-v2-NBCMYWYE-tnpww186.js} +1 -1
- package/dist/client/static/js/{cose-bilkent-JH36ORCC-3ek5r5se.js → cose-bilkent-JH36ORCC-8vsjbzwa.js} +1 -1
- package/dist/client/static/js/cpp-v2mqp8j7.js +1 -0
- package/dist/client/static/js/css-x7gyc3ta.js +1 -0
- package/dist/client/static/js/cynefin-OW5HDTMX-kdj8rjc1.js +1 -0
- package/dist/client/static/js/{cynefinDiagram-VND7K2PF-jkbh84zn.js → cynefinDiagram-VND7K2PF-005gc8km.js} +1 -1
- package/dist/client/static/js/{dagre-6A5THRUB-4fdc0sgn.js → dagre-6A5THRUB-41zsteyd.js} +2 -2
- package/dist/client/static/js/{diagram-22UHCM2B-hbk61nq9.js → diagram-22UHCM2B-prsm18a1.js} +3 -3
- package/dist/client/static/js/{diagram-3UASUU5V-hfpbr9qh.js → diagram-3UASUU5V-5nx9wf04.js} +1 -1
- package/dist/client/static/js/{diagram-ATOU4E4O-fn0nt71a.js → diagram-ATOU4E4O-k3d4z3aq.js} +3 -3
- package/dist/client/static/js/{diagram-CDSNMT55-ssswxjeb.js → diagram-CDSNMT55-x2c5x5j2.js} +2 -2
- package/dist/client/static/js/{diagram-MLGK6HIB-whnzxv6f.js → diagram-MLGK6HIB-nvr76jqh.js} +1 -1
- package/dist/client/static/js/{diagram-MPIPVDR6-hk1chzxk.js → diagram-MPIPVDR6-v1jpzp9p.js} +1 -1
- package/dist/client/static/js/{dockerfile-zmsj8r4g.js → dockerfile-vz6va73h.js} +1 -1
- package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-q1vkg5mr.js → ebnfDiagram-ZINNZB2B-0v4tqr9v.js} +1 -1
- package/dist/client/static/js/{elk-276RUBZZ-kt98vg8j.js → elk-276RUBZZ-qfn4r7xj.js} +1 -1
- package/dist/client/static/js/{erDiagram-OPXOYQCR-ey3avsn9.js → erDiagram-OPXOYQCR-cd667n9f.js} +4 -4
- package/dist/client/static/js/{erlang-814e8qy5.js → erlang-vk66vt7q.js} +1 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-m57b7ytw.js +1 -0
- package/dist/client/static/js/flowDiagram-KWPJA3E3-fasj2gxy.js +1 -0
- package/dist/client/static/js/{ganttDiagram-FUAMR5RP-a9k1at43.js → ganttDiagram-FUAMR5RP-ps0h3drm.js} +1 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-wvzsc4ph.js +1 -0
- package/dist/client/static/js/{gitGraphDiagram-X574FWY7-gnekjfym.js → gitGraphDiagram-X574FWY7-fts23jer.js} +2 -2
- package/dist/client/static/js/graphql-a4gbqpj9.js +1 -0
- package/dist/client/static/js/{index-xq5f3nxa.js → index-0dkc6z8e.js} +2 -2
- package/dist/client/static/js/{index-m4k054wz.js → index-1d8bxjsz.js} +3 -3
- package/dist/client/static/js/{index-kty4ncsr.js → index-1whzs9kb.js} +2 -2
- package/dist/client/static/js/{index-qfxn7yh5.js → index-396r53n0.js} +2 -2
- package/dist/client/static/js/{index-kbhrvep8.js → index-39d8zbkx.js} +3 -3
- package/dist/client/static/js/{index-dn7hg4em.js → index-3nsrnyqr.js} +2 -2
- package/dist/client/static/js/{index-1ax52p0q.js → index-4jzsr1ky.js} +2 -2
- package/dist/client/static/js/{index-2a6qp9y6.js → index-4wnzs76g.js} +1 -1
- package/dist/client/static/js/{index-hgzntg2j.js → index-4x9p7hf9.js} +2 -2
- package/dist/client/static/js/{index-fzngzhww.js → index-52nd4hgm.js} +1 -1
- package/dist/client/static/js/{index-pavvxrsz.js → index-54mkp2r2.js} +1 -1
- package/dist/client/static/js/{index-abs635a1.js → index-56rtb871.js} +25 -25
- package/dist/client/static/js/{index-dxvtjn6a.js → index-5f4b44ay.js} +2 -2
- package/dist/client/static/js/{index-q9ytjey8.js → index-6009v8jf.js} +1 -1
- package/dist/client/static/js/{index-e9cxje00.js → index-62jgcgfd.js} +5 -5
- package/dist/client/static/js/{index-nw5mvcaj.js → index-64p1dncg.js} +2 -2
- package/dist/client/static/js/{index-fj5rsp5v.js → index-6d6hxwb5.js} +2 -2
- package/dist/client/static/js/{index-19x11s5w.js → index-70g527sb.js} +2 -2
- package/dist/client/static/js/{index-ykm7a3cp.js → index-7zeah164.js} +2 -2
- package/dist/client/static/js/{index-z25ss7xj.js → index-7zedprz3.js} +1 -1
- package/dist/client/static/js/{index-g7s0wsag.js → index-9ab6xaxd.js} +2 -2
- package/dist/client/static/js/index-9vqkyj58.js +3 -0
- package/dist/client/static/js/{index-60v30k5h.js → index-9xsf8162.js} +35 -35
- package/dist/client/static/js/{index-3x7h2eqj.js → index-a4h5np9r.js} +2 -2
- package/dist/client/static/js/{index-9vv7wr1n.js → index-an2wv33f.js} +2 -2
- package/dist/client/static/js/{index-64sqfr4a.js → index-c5hjht5e.js} +2 -2
- package/dist/client/static/js/{index-84fyq5a6.js → index-c63qyysm.js} +1 -1
- package/dist/client/static/js/{index-atq9q1s7.js → index-ccgzzydx.js} +1 -1
- package/dist/client/static/js/{index-b5dfvget.js → index-cra9mgkq.js} +4 -4
- package/dist/client/static/js/index-cvyqp8nz.css +1 -0
- package/dist/client/static/js/index-d2xtbabt.js +2 -0
- package/dist/client/static/js/{index-wrcdc9vz.js → index-dxkefysk.js} +1 -1
- package/dist/client/static/js/index-dxp2yvy7.js +2 -0
- package/dist/client/static/js/{index-vjmg7kn5.js → index-dyc886cc.js} +1 -1
- package/dist/client/static/js/{index-5wz0y88c.js → index-dzeyd153.js} +2 -2
- package/dist/client/static/js/{index-qf3y3ahx.js → index-e5j5gc4h.js} +2 -2
- package/dist/client/static/js/{index-2ks0m8ss.js → index-evmcc5qh.js} +2 -2
- package/dist/client/static/js/{index-b2e5pwx7.js → index-f2ahkev0.js} +5 -5
- package/dist/client/static/js/{index-65afr75v.js → index-fjex1y0t.js} +2 -2
- package/dist/client/static/js/{index-kb14dhrx.js → index-fxd8dfj4.js} +2 -2
- package/dist/client/static/js/{index-trvqvb1v.js → index-g4kkapka.js} +2 -2
- package/dist/client/static/js/{index-561gkvve.js → index-gzkzwgzv.js} +2 -2
- package/dist/client/static/js/{index-yf93db65.js → index-n1yr4khe.js} +1 -1
- package/dist/client/static/js/{index-d23eacf2.js → index-nkahe229.js} +2 -2
- package/dist/client/static/js/{index-dt6q3rws.js → index-p6s3fz6b.js} +11 -11
- package/dist/client/static/js/{index-hnb66d3s.js → index-q4ke39rh.js} +2 -2
- package/dist/client/static/js/index-qtd0e38d.js +1 -0
- package/dist/client/static/js/{index-x9r7zfp4.js → index-tqgj7rd9.js} +2 -2
- package/dist/client/static/js/{index-wbws16ag.js → index-x0xspam4.js} +2 -2
- package/dist/client/static/js/{index-4cag7w6k.js → index-x2v1zmth.js} +185 -185
- package/dist/client/static/js/{index-amsa0tfs.js → index-x9hfvbz6.js} +1 -1
- package/dist/client/static/js/{index-8g7q8mz4.js → index-xk1cqjkn.js} +3 -3
- package/dist/client/static/js/{index-c9e417cs.js → index-y6ke70e6.js} +2 -2
- package/dist/client/static/js/{index-bsr7wmj2.js → index-zhjjpvcc.js} +1 -1
- package/dist/client/static/js/info-A6RAGUB7-ym2xevn8.js +1 -0
- package/dist/client/static/js/{infoDiagram-VRGFBTTK-r1p25738.js → infoDiagram-VRGFBTTK-88qbtpq5.js} +1 -1
- package/dist/client/static/js/ini-80p6sp79.js +1 -0
- package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-afgrqdrt.js → ishikawaDiagram-OU5B5YK6-s8bagk00.js} +1 -1
- package/dist/client/static/js/java-mm2b3s9b.js +1 -0
- package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-hepa4wk7.js → journeyDiagram-ZHPQQLJL-hz8z0b9x.js} +2 -2
- package/dist/client/static/js/json-fzy76fkw.js +1 -0
- package/dist/client/static/js/jsx-c7v2f8s7.js +1 -0
- package/dist/client/static/js/{julia-yv2j8qd0.js → julia-dm0j9apa.js} +1 -1
- package/dist/client/static/js/{kanban-definition-PNTS6WVX-jysft8ya.js → kanban-definition-PNTS6WVX-sjjnjb51.js} +1 -1
- package/dist/client/static/js/lua-ppfdxrmv.js +1 -0
- package/dist/client/static/js/markdown-xed7y3ds.js +1 -0
- package/dist/client/static/js/{mermaid.core-0m90b0s8.js → mermaid.core-zvwygxbh.js} +7 -7
- package/dist/client/static/js/{mindmap-definition-NLK3R4M7-x2rrzpvr.js → mindmap-definition-NLK3R4M7-kgj8enan.js} +2 -2
- package/dist/client/static/js/one-dark-pro-mq6sn6a2.js +1 -0
- package/dist/client/static/js/one-light-pt6t6vax.js +1 -0
- package/dist/client/static/js/packet-AYTQ26CC-01vcsy6x.js +1 -0
- package/dist/client/static/js/{pegDiagram-GJSIUBJH-z7vb7f1z.js → pegDiagram-GJSIUBJH-gxzw1qwa.js} +1 -1
- package/dist/client/static/js/{perl-917pjq5a.js → perl-4jcm2jxv.js} +1 -1
- package/dist/client/static/js/{php-hwz75qzt.js → php-q32mec74.js} +1 -1
- package/dist/client/static/js/pie-WAS4IAKB-053gzkmh.js +1 -0
- package/dist/client/static/js/{pieDiagram-5QR66LMP-jqv6v4e6.js → pieDiagram-5QR66LMP-pdqwyqcm.js} +1 -1
- package/dist/client/static/js/properties-8ysbq2n2.js +1 -0
- package/dist/client/static/js/python-4ysexc8s.js +1 -0
- package/dist/client/static/js/{quadrantDiagram-O4NWA36T-w2h8yxrv.js → quadrantDiagram-O4NWA36T-yx2t364p.js} +1 -1
- package/dist/client/static/js/r-hrsw5arc.js +1 -0
- package/dist/client/static/js/radar-RG4KPBEZ-bkpby8am.js +1 -0
- package/dist/client/static/js/railroad-74A4TZTK-67bxrjgw.js +1 -0
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-xj9ymacg.js +1 -0
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-2xxpbnf6.js +1 -0
- package/dist/client/static/js/railroad-peg-WCYAUIDC-78w88znz.js +1 -0
- package/dist/client/static/js/{railroadDiagram-XR7U4H2S-nd09yac3.js → railroadDiagram-XR7U4H2S-800fdzkr.js} +1 -1
- package/dist/client/static/js/{requirementDiagram-PLB6GJNP-t61zxh5v.js → requirementDiagram-PLB6GJNP-vc5rpgtm.js} +1 -1
- package/dist/client/static/js/{ruby-er7ayhte.js → ruby-npmpb290.js} +1 -1
- package/dist/client/static/js/{rust-avnkhh0p.js → rust-waks43wh.js} +1 -1
- package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-2f7h2cmw.js → sankeyDiagram-IPEJSGJF-ccjk8zgn.js} +2 -2
- package/dist/client/static/js/{sass-n47tt136.js → sass-502a4r7y.js} +1 -1
- package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-kfb5d7zd.js → sequenceDiagram-PO4LG4MO-c0tk7gfn.js} +6 -6
- package/dist/client/static/js/{sizeCapture-INFHLROL-amfg19se.js → sizeCapture-INFHLROL-fma9p1vy.js} +1 -1
- package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-k5hx7btx.js → stateDiagram-v2-GCMORJYK-d8f24b7j.js} +2 -2
- package/dist/client/static/js/{svelte-2pmz35vx.js → svelte-c15d0421.js} +1 -1
- package/dist/client/static/js/{swimlanes-2SLR337P-wv3rp8kk.js → swimlanes-2SLR337P-sdt7qy36.js} +1 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-rz309qrx.js +8 -0
- package/dist/client/static/js/{timeline-definition-EJHVYXUP-0re95wtn.js → timeline-definition-EJHVYXUP-rv8qyr8b.js} +2 -2
- package/dist/client/static/js/treeView-Q6P3EWNA-g2bkjr4z.js +1 -0
- package/dist/client/static/js/treemap-WGGIJYW6-pj7yw9rw.js +1 -0
- package/dist/client/static/js/tsx-xjp2ds8g.js +1 -0
- package/dist/client/static/js/typescript-yg97da8h.js +1 -0
- package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yrje14qp.js → usecaseDiagram-POWQR4AR-w6ew1red.js} +2 -2
- package/dist/client/static/js/{vennDiagram-UO4OBE2U-jxkmrfy5.js → vennDiagram-UO4OBE2U-p9axw7ch.js} +1 -1
- package/dist/client/static/js/{vue-d5gpjfgn.js → vue-xpemy62d.js} +1 -1
- package/dist/client/static/js/wardley-WFR3VGLG-c7ekf8r2.js +1 -0
- package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-d3v2m9b1.js → wardleyDiagram-VNRHLVJA-5ewc8s4p.js} +1 -1
- package/dist/client/static/js/xml-nrb23phz.js +1 -0
- package/dist/client/static/js/{xychartDiagram-PMCCYNJV-9a1s1rjt.js → xychartDiagram-PMCCYNJV-7n4gn7k6.js} +2 -2
- package/dist/client/static/js/yaml-sqs6pjpx.js +1 -0
- package/marketplace/marketplace.json +34 -7
- package/marketplace/plugins/kanban/README.md +143 -0
- package/marketplace/plugins/kanban/icon.svg +5 -0
- package/marketplace/plugins/kanban/package.json +30 -0
- package/marketplace/plugins/kanban/src/app.tsx +34 -0
- package/marketplace/plugins/kanban/src/mcp-tools.ts +296 -0
- package/marketplace/plugins/kanban/src/mcp.test.ts +199 -0
- package/marketplace/plugins/kanban/src/mcp.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/CardSheet.tsx +319 -0
- package/marketplace/plugins/kanban/src/panel/CardTile.tsx +97 -0
- package/marketplace/plugins/kanban/src/panel/StageColumn.tsx +116 -0
- package/marketplace/plugins/kanban/src/panel/StageSheet.tsx +249 -0
- package/marketplace/plugins/kanban/src/panel/catalogs.ts +114 -0
- package/marketplace/plugins/kanban/src/panel/index.tsx +327 -0
- package/marketplace/plugins/kanban/src/panel/panel.test.ts +219 -0
- package/marketplace/plugins/kanban/src/panel/start-work.ts +132 -0
- package/marketplace/plugins/kanban/src/panel/use-board.ts +148 -0
- package/marketplace/plugins/kanban/src/panel/use-card-detail.ts +70 -0
- package/marketplace/plugins/kanban/src/panel/use-writes.ts +123 -0
- package/marketplace/plugins/kanban/src/protocol.ts +180 -0
- package/marketplace/plugins/kanban/src/server.test.ts +113 -0
- package/marketplace/plugins/kanban/src/server.ts +227 -0
- package/marketplace/plugins/kanban/src/store/board.test.ts +311 -0
- package/marketplace/plugins/kanban/src/store/board.ts +147 -0
- package/marketplace/plugins/kanban/src/store/cards.ts +228 -0
- package/marketplace/plugins/kanban/src/store/fs.ts +159 -0
- package/marketplace/plugins/kanban/src/store/ops.ts +245 -0
- package/marketplace/plugins/kanban/src/store/resolve.test.ts +82 -0
- package/marketplace/plugins/kanban/src/store/resolve.ts +135 -0
- package/marketplace/plugins/kanban/tsconfig.json +26 -0
- package/package.json +2 -2
- package/src/client/components/common/file-icon/index.tsx +1 -1
- package/src/client/components/layout/desktop-layout/LeftColumn.tsx +12 -3
- package/src/client/components/layout/desktop-layout/WorkspacePanels.tsx +34 -7
- package/src/client/components/layout/desktop-layout/index.tsx +17 -22
- package/src/client/components/mobile/mobile-right-sidebar/EditorSurface.tsx +2 -0
- package/src/client/components/mobile/mobile-right-sidebar/FullEditor.tsx +11 -3
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.test.tsx +21 -0
- package/src/client/components/settings/categories/appearance-settings/EditorThemeSection.tsx +8 -4
- package/src/client/components/settings/categories/appearance-settings/ThemeCard.tsx +8 -2
- package/src/client/components/settings/categories/appearance-settings/ThemeGrid.tsx +15 -4
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.test.ts +21 -0
- package/src/client/components/workspace/chat-timeline/chat-input/AccessDropdown.tsx +7 -1
- package/src/client/components/workspace/chat-timeline/chat-input/ThinkingLevelDropdown.tsx +3 -1
- package/src/client/components/workspace/chat-timeline/tool-renderers/panels/Read.tsx +1 -1
- package/src/client/components/workspace/editor/FilePane.tsx +4 -2
- package/src/client/components/workspace/editor/Tabs.tsx +7 -1
- package/src/client/components/workspace/editor/Toolbar.tsx +7 -1
- package/src/client/components/workspace/editor/chrome-rows.test.tsx +126 -0
- package/src/client/components/workspace/editor/viewers/HtmlPreview.test.tsx +94 -0
- package/src/client/components/workspace/editor/viewers/HtmlPreview.tsx +71 -0
- package/src/client/components/workspace/editor/viewers/bytes.ts +1 -1
- package/src/client/components/workspace/editor/viewers/dispatch.tsx +18 -2
- package/src/client/components/workspace/editor/viewers/viewers.test.ts +14 -1
- package/src/client/components/workspace/panel-header/index.test.tsx +2 -1
- package/src/client/components/workspace/panel-header/index.tsx +6 -4
- package/src/client/hooks/editor/resolve-viewer.ts +1 -1
- package/src/client/hooks/editor/use-editor-drop.ts +14 -0
- package/src/client/hooks/editor/use-editor-tab-state.ts +5 -4
- package/src/client/hooks/ui/media-query.ts +27 -0
- package/src/client/hooks/workspace/file-tabs.ts +10 -0
- package/src/client/hooks/workspace/right-panel-presence.test.ts +152 -0
- package/src/client/hooks/workspace/right-panel-presence.ts +119 -0
- package/src/client/lib/router/search-params.test.ts +83 -0
- package/src/client/lib/router/search-params.ts +14 -3
- package/src/server/lib/mcp/session-mcp.test.ts +64 -1
- package/src/server/lib/mcp/session-overlay.server.ts +7 -4
- package/src/server/lib/omp/rpc/constants.test.ts +31 -0
- package/src/server/lib/omp/rpc/constants.ts +19 -0
- package/src/server/lib/omp/rpc/session-new.ts +78 -0
- package/src/server/lib/omp/rpc/session-registry.ts +22 -49
- package/src/server/lib/omp/rpc/spawn-mcp.ts +8 -1
- package/src/server/lib/omp/session/blobs.server.ts +2 -1
- package/src/server/lib/plugins/e2e.test.ts +71 -2
- package/src/server/lib/plugins/loader.server.ts +20 -1
- package/src/server/lib/plugins/module-import.server.ts +45 -0
- package/src/server/routes/agent/new-prompt.test.ts +81 -0
- package/src/server/routes/agent/new.ts +78 -4
- package/src/server/routes/fs/raw.test.ts +12 -0
- package/src/server/routes/fs/raw.ts +2 -6
- package/src/server/routes/wiki/asset.ts +1 -1
- package/src/shared/lib/fs/document-kind.test.ts +39 -2
- package/src/shared/lib/fs/document-kind.ts +49 -1
- package/src/shared/lib/fs/file-kind.test.ts +30 -3
- package/src/shared/lib/fs/file-kind.ts +7 -104
- package/src/shared/lib/fs/mime.ts +159 -0
- package/src/shared/lib/workspace/sidebar-width.test.ts +34 -0
- package/src/shared/lib/workspace/sidebar-width.ts +33 -0
- package/src/shared/lib/workspace/workspace-panel-widths.test.ts +124 -0
- package/src/shared/lib/workspace/workspace-panel-widths.ts +115 -18
- package/dist/client/static/js/ImageView-jkrdrq8v.js +0 -1
- package/dist/client/static/js/LayoutWrapper-sh634350.js +0 -2
- package/dist/client/static/js/architecture-7GRP2DOG-pvb4d65d.js +0 -1
- package/dist/client/static/js/bash-8d8z8zrg.js +0 -1
- package/dist/client/static/js/cpp-620mvjkk.js +0 -1
- package/dist/client/static/js/css-bt76kxbq.js +0 -1
- package/dist/client/static/js/cynefin-OW5HDTMX-gmx4vean.js +0 -1
- package/dist/client/static/js/eventmodeling-NTZA5JFV-vrnheyh7.js +0 -1
- package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +0 -1
- package/dist/client/static/js/gitGraph-4MIJSDKK-n6wnc8st.js +0 -1
- package/dist/client/static/js/graphql-j1a6zp7m.js +0 -1
- package/dist/client/static/js/index-5ka2tyf9.js +0 -3
- package/dist/client/static/js/index-83rkg916.js +0 -2
- package/dist/client/static/js/index-dpy3ewrn.css +0 -1
- package/dist/client/static/js/index-vkqb4dnt.js +0 -1
- package/dist/client/static/js/index-xwjbq003.js +0 -2
- package/dist/client/static/js/info-A6RAGUB7-1xtdxjz2.js +0 -1
- package/dist/client/static/js/ini-5f4zqtqr.js +0 -1
- package/dist/client/static/js/java-jj41mty3.js +0 -1
- package/dist/client/static/js/json-rnh2h17x.js +0 -1
- package/dist/client/static/js/jsx-4gecrt29.js +0 -1
- package/dist/client/static/js/lua-zszaw2f7.js +0 -1
- package/dist/client/static/js/markdown-nm6gw4v4.js +0 -1
- package/dist/client/static/js/one-dark-pro-09d8p5vy.js +0 -1
- package/dist/client/static/js/one-light-g3ednt6p.js +0 -1
- package/dist/client/static/js/packet-AYTQ26CC-zm1r82x5.js +0 -1
- package/dist/client/static/js/pie-WAS4IAKB-sqa7321j.js +0 -1
- package/dist/client/static/js/properties-rkptax7r.js +0 -1
- package/dist/client/static/js/python-qf1se1mj.js +0 -1
- package/dist/client/static/js/r-ms0cygq2.js +0 -1
- package/dist/client/static/js/radar-RG4KPBEZ-z3z82syp.js +0 -1
- package/dist/client/static/js/railroad-74A4TZTK-z6swcqq2.js +0 -1
- package/dist/client/static/js/railroad-abnf-HS5TGJTU-33km6py4.js +0 -1
- package/dist/client/static/js/railroad-ebnf-LZEXJU2U-1zbf1xmq.js +0 -1
- package/dist/client/static/js/railroad-peg-WCYAUIDC-wte1xzzy.js +0 -1
- package/dist/client/static/js/swimlanesDiagram-TC7HE7FX-6y8zdbm4.js +0 -8
- package/dist/client/static/js/treeView-Q6P3EWNA-pvgx6n22.js +0 -1
- package/dist/client/static/js/treemap-WGGIJYW6-3n9zm628.js +0 -1
- package/dist/client/static/js/tsx-gx7td06z.js +0 -1
- package/dist/client/static/js/typescript-1a808spn.js +0 -1
- package/dist/client/static/js/wardley-WFR3VGLG-7m07ewc4.js +0 -1
- package/dist/client/static/js/xml-3117mxd9.js +0 -1
- package/dist/client/static/js/yaml-dmvh8vyt.js +0 -1
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `useRightPanelPresence` — the side's toggle, and the refusal that answers it.
|
|
8
|
+
*
|
|
9
|
+
* The panel is the only part of the side that can be refused (the editor column
|
|
10
|
+
* keeps its width whenever it is open), so the toggle has to read PRESENCE
|
|
11
|
+
* rather than its own `hidden` flag, and a click that could only flip a flag the
|
|
12
|
+
* layout is ignoring must be answered out loud. Three behaviours, each a bug
|
|
13
|
+
* that shipped before this hook existed:
|
|
14
|
+
*
|
|
15
|
+
* - a load that starts narrow does not warn — the panel was never on screen, and
|
|
16
|
+
* a toast on every 900px load is noise;
|
|
17
|
+
* - a crossing AFTER the load does warn, once, naming what would make it fit;
|
|
18
|
+
* - a click on a side with nothing on screen is answered even though no crossing
|
|
19
|
+
* happened.
|
|
20
|
+
*
|
|
21
|
+
* The settle window is a clock read (`Date.now()`), so time is driven with
|
|
22
|
+
* `setSystemTime` rather than by sleeping through it.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { afterAll, afterEach, beforeEach, describe, expect, setSystemTime, test } from 'bun:test';
|
|
26
|
+
import { Window } from 'happy-dom';
|
|
27
|
+
import { h, render } from 'preact';
|
|
28
|
+
import { act } from 'preact/test-utils';
|
|
29
|
+
import {
|
|
30
|
+
useRightPanelPresence,
|
|
31
|
+
type RightPanelPresence,
|
|
32
|
+
} from '@/client/hooks/workspace/right-panel-presence';
|
|
33
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
34
|
+
|
|
35
|
+
interface ProbeProps {
|
|
36
|
+
showEditor: boolean;
|
|
37
|
+
sideShown: boolean;
|
|
38
|
+
toggleSide: () => void;
|
|
39
|
+
pushToast: (message: string, tone?: 'success' | 'error' | 'warning') => void;
|
|
40
|
+
expose: (value: RightPanelPresence) => void;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let toasts: string[] = [];
|
|
44
|
+
let toggles = 0;
|
|
45
|
+
let container: HTMLElement;
|
|
46
|
+
/** Past the hook's 1500ms settle window, without waiting for it. */
|
|
47
|
+
const AFTER_SETTLE = 5_000;
|
|
48
|
+
|
|
49
|
+
beforeEach(() => {
|
|
50
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
51
|
+
setSystemTime(new Date('2026-01-01T00:00:00Z'));
|
|
52
|
+
toasts = [];
|
|
53
|
+
toggles = 0;
|
|
54
|
+
container = document.createElement('div');
|
|
55
|
+
document.body.appendChild(container);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
afterEach(() => {
|
|
59
|
+
render(null, container);
|
|
60
|
+
container.remove();
|
|
61
|
+
restoreDomGlobals();
|
|
62
|
+
setSystemTime();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
afterAll(() => {
|
|
66
|
+
restoreDomGlobals();
|
|
67
|
+
setSystemTime();
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
function Probe({ showEditor, sideShown, toggleSide, pushToast, expose }: ProbeProps) {
|
|
71
|
+
expose(useRightPanelPresence({ showEditor, sideShown, toggleSide, pushToast }));
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const BASE = { showEditor: true, sideShown: true, toggleSide: () => { toggles += 1; } };
|
|
76
|
+
|
|
77
|
+
function mount() {
|
|
78
|
+
let current: RightPanelPresence | null = null;
|
|
79
|
+
const draw = async (next: Omit<ProbeProps, 'expose' | 'pushToast'>) => {
|
|
80
|
+
await act(async () => {
|
|
81
|
+
render(
|
|
82
|
+
h(Probe, {
|
|
83
|
+
...next,
|
|
84
|
+
pushToast: (message: string) => toasts.push(message),
|
|
85
|
+
expose: (value) => {
|
|
86
|
+
current = value;
|
|
87
|
+
},
|
|
88
|
+
}),
|
|
89
|
+
container,
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
return {
|
|
94
|
+
draw,
|
|
95
|
+
get: () => current!,
|
|
96
|
+
/** Move the clock past the settle window, so a report counts as a crossing. */
|
|
97
|
+
passSettleWindow: () => setSystemTime(new Date(Date.now() + AFTER_SETTLE)),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
describe('useRightPanelPresence', () => {
|
|
102
|
+
test('a load that starts narrow does not warn about the panel it never drew', async () => {
|
|
103
|
+
const probe = mount();
|
|
104
|
+
await probe.draw(BASE);
|
|
105
|
+
await act(async () => probe.get().report(true));
|
|
106
|
+
|
|
107
|
+
expect(toasts).toEqual([]);
|
|
108
|
+
expect(probe.get().suppressed).toBe(true);
|
|
109
|
+
// The editor column is still on screen, so the side reads visible.
|
|
110
|
+
expect(probe.get().sideVisible).toBe(true);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
test('a crossing after the settle window warns once, and stops repeating', async () => {
|
|
114
|
+
const probe = mount();
|
|
115
|
+
await probe.draw(BASE);
|
|
116
|
+
probe.passSettleWindow();
|
|
117
|
+
|
|
118
|
+
await act(async () => probe.get().report(true));
|
|
119
|
+
await act(async () => probe.get().report(true));
|
|
120
|
+
expect(toasts).toHaveLength(1);
|
|
121
|
+
expect(toasts[0]).toContain('right panel needs more room');
|
|
122
|
+
|
|
123
|
+
// Coming back and losing it again is a second crossing, so it may speak.
|
|
124
|
+
await act(async () => probe.get().report(false));
|
|
125
|
+
await act(async () => probe.get().report(true));
|
|
126
|
+
expect(toasts).toHaveLength(2);
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
test('a click on a side with nothing on screen is refused out loud', async () => {
|
|
130
|
+
const probe = mount();
|
|
131
|
+
await probe.draw({ ...BASE, showEditor: false });
|
|
132
|
+
probe.passSettleWindow();
|
|
133
|
+
await act(async () => probe.get().report(true));
|
|
134
|
+
|
|
135
|
+
// Nothing of the side is on screen: the editor is closed and the panel is
|
|
136
|
+
// suppressed, so the toggle must explain instead of flipping a dead flag.
|
|
137
|
+
expect(probe.get().sideVisible).toBe(false);
|
|
138
|
+
await act(async () => probe.get().toggle());
|
|
139
|
+
expect(toggles).toBe(0);
|
|
140
|
+
expect(toasts).toHaveLength(1);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
test('a click with something on screen still toggles', async () => {
|
|
144
|
+
const probe = mount();
|
|
145
|
+
await probe.draw(BASE);
|
|
146
|
+
probe.passSettleWindow();
|
|
147
|
+
await act(async () => probe.get().toggle());
|
|
148
|
+
|
|
149
|
+
expect(toggles).toBe(1);
|
|
150
|
+
expect(toasts).toEqual([]);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The right side of the workspace: is anything of it on screen, and what happens
|
|
8
|
+
* when the panel it was asked to show cannot fit.
|
|
9
|
+
*
|
|
10
|
+
* Two facts, one owner, because they are the same question asked twice. The
|
|
11
|
+
* editor column keeps its width even while the right panel is suppressed, so
|
|
12
|
+
* "the side is on" means "the editor, the panel, or both" — and a toggle that
|
|
13
|
+
* reads its own `hidden` flag instead would either claim a side is on screen
|
|
14
|
+
* when nothing is, or hide a visible column on the next click.
|
|
15
|
+
*
|
|
16
|
+
* `WorkspacePanels` is the only place that measures the group, so it is the only
|
|
17
|
+
* place that can answer whether the panel fits; the answer travels up here
|
|
18
|
+
* because the control that asked (the navbar's toggle, the `⌥⌘J` chord) is the
|
|
19
|
+
* layout's. A panel that silently fails to appear is the defect: the flag the
|
|
20
|
+
* click flipped stays true, so the next click looks like it does nothing.
|
|
21
|
+
*
|
|
22
|
+
* Three ways the refusal is announced, and each is once:
|
|
23
|
+
*
|
|
24
|
+
* - **The FIRST suppression of a load is silent.** A window that is narrow from
|
|
25
|
+
* the start never had the panel on screen, so nothing was lost; a warning
|
|
26
|
+
* toast on every load at 900px is noise, not information.
|
|
27
|
+
* - **The panel DISAPPEARING is announced** — a resize, or an editor column the
|
|
28
|
+
* user just opened — because the message names what would make it fit.
|
|
29
|
+
* - **A click on a side that has nothing on screen is answered on demand**: the
|
|
30
|
+
* crossing rule cannot see it, since the suppression was already true.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
|
34
|
+
import type { ToastTone } from '@/shared/lib/ui/toast-duration';
|
|
35
|
+
|
|
36
|
+
const REFUSAL =
|
|
37
|
+
'The right panel needs more room: widen the window, close the editor column, or pick the phone layout.';
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* How long after mount a suppression is still the LOAD settling rather than the
|
|
41
|
+
* panel being taken away.
|
|
42
|
+
*
|
|
43
|
+
* A session restores its stored layout in several passes — the panel widths, the
|
|
44
|
+
* editor's tab list, the right side's own flags — so a 900px window draws the
|
|
45
|
+
* panel for a frame and then drops it. That is not a loss the user can see, and
|
|
46
|
+
* warning about it put a toast on every narrow-window load. A crossing after
|
|
47
|
+
* this window is a real one: a resize, or an editor column the user opened.
|
|
48
|
+
*/
|
|
49
|
+
const SETTLE_MS = 1500;
|
|
50
|
+
|
|
51
|
+
export interface RightPanelPresenceArgs {
|
|
52
|
+
pushToast: (message: string, tone?: ToastTone) => void;
|
|
53
|
+
/** The editor column is on screen and holds its width. */
|
|
54
|
+
showEditor: boolean;
|
|
55
|
+
/** The side is not put away (`!rightSide.hidden`). */
|
|
56
|
+
sideShown: boolean;
|
|
57
|
+
/** The side's own switch, used when a click has something to do. */
|
|
58
|
+
toggleSide: () => void;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface RightPanelPresence {
|
|
62
|
+
/** The panel is asked for and there is no room for it. */
|
|
63
|
+
suppressed: boolean;
|
|
64
|
+
/** Something of the side — the editor, the panel, or both — is on screen. */
|
|
65
|
+
sideVisible: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Handed to `WorkspacePanels`; it reports the fit decision every render, and
|
|
68
|
+
* `null` until the group has been measured.
|
|
69
|
+
*
|
|
70
|
+
* The `null` is what makes "the first suppression of a load is silent"
|
|
71
|
+
* possible: the resolver answers "fits" before it has an area, so without it
|
|
72
|
+
* the first measured frame looked like a panel being taken away and warned on
|
|
73
|
+
* every load at a narrow window.
|
|
74
|
+
*/
|
|
75
|
+
report: (suppressed: boolean | null) => void;
|
|
76
|
+
/** The navbar's control and the chord: reads `sideVisible`, refuses out loud. */
|
|
77
|
+
toggle: () => void;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function useRightPanelPresence({
|
|
81
|
+
pushToast,
|
|
82
|
+
showEditor,
|
|
83
|
+
sideShown,
|
|
84
|
+
toggleSide,
|
|
85
|
+
}: RightPanelPresenceArgs): RightPanelPresence {
|
|
86
|
+
const [suppressed, setSuppressed] = useState<boolean | null>(null);
|
|
87
|
+
const announced = useRef(false);
|
|
88
|
+
const mountedAt = useRef(Date.now());
|
|
89
|
+
|
|
90
|
+
const announce = useCallback(() => {
|
|
91
|
+
if (announced.current) return;
|
|
92
|
+
if (Date.now() - mountedAt.current < SETTLE_MS) return;
|
|
93
|
+
announced.current = true;
|
|
94
|
+
pushToast(REFUSAL, 'warning');
|
|
95
|
+
}, [pushToast]);
|
|
96
|
+
|
|
97
|
+
useEffect(() => {
|
|
98
|
+
if (suppressed !== true) {
|
|
99
|
+
// A panel that came back clears the "already said so" mark, so losing it
|
|
100
|
+
// again is a new crossing the user may need to hear about.
|
|
101
|
+
if (suppressed === false) announced.current = false;
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
announce();
|
|
105
|
+
}, [suppressed, announce]);
|
|
106
|
+
|
|
107
|
+
const report = useCallback((next: boolean | null) => setSuppressed(next), []);
|
|
108
|
+
const sideVisible = showEditor || suppressed !== true;
|
|
109
|
+
|
|
110
|
+
const toggle = useCallback(() => {
|
|
111
|
+
if (sideShown && !sideVisible) {
|
|
112
|
+
announce();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
toggleSide();
|
|
116
|
+
}, [announce, sideShown, sideVisible, toggleSide]);
|
|
117
|
+
|
|
118
|
+
return { suppressed: suppressed === true, sideVisible, report, toggle };
|
|
119
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `useSearchParams` reads the window IN SCOPE, and a window that carries no
|
|
8
|
+
* `location` is a shape the app has to survive.
|
|
9
|
+
*
|
|
10
|
+
* The store is module-level, so a component mounted by one suite can be
|
|
11
|
+
* re-rendered after that suite restored the globals — and `installDomGlobals({})`
|
|
12
|
+
* builds a window without a `location` on purpose (the SSR case). Reading
|
|
13
|
+
* `window.location.search` there threw a `TypeError` that named none of the
|
|
14
|
+
* files involved: measured on the Windows gate, where it killed every case in
|
|
15
|
+
* `list-slots.test.ts` and one in `plugin-contributions.test.ts`, whose stacks
|
|
16
|
+
* named neither file. The answer for a window that cannot describe a URL is
|
|
17
|
+
* "no query string", not an exception.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { afterAll, afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
21
|
+
import { Window } from 'happy-dom';
|
|
22
|
+
import { h, render } from 'preact';
|
|
23
|
+
import { act } from 'preact/test-utils';
|
|
24
|
+
import { useSearchParams } from '@/client/lib/router/search-params';
|
|
25
|
+
import { installDomGlobals, restoreDomGlobals } from '@/test-support/pristine-globals';
|
|
26
|
+
|
|
27
|
+
let container: HTMLElement;
|
|
28
|
+
let seen: string | null = null;
|
|
29
|
+
|
|
30
|
+
function Probe() {
|
|
31
|
+
const [params] = useSearchParams();
|
|
32
|
+
seen = params.toString();
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
beforeEach(() => {
|
|
37
|
+
// A base DOM, so the container exists before a case replaces the window: a
|
|
38
|
+
// case that installs a location-less window still renders into real nodes.
|
|
39
|
+
installDomGlobals(new Window({ url: 'http://localhost' }));
|
|
40
|
+
container = document.createElement('div');
|
|
41
|
+
document.body.appendChild(container);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
afterEach(() => {
|
|
45
|
+
render(null, container);
|
|
46
|
+
container.remove();
|
|
47
|
+
seen = null;
|
|
48
|
+
restoreDomGlobals();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
afterAll(() => restoreDomGlobals());
|
|
52
|
+
|
|
53
|
+
function mount(): void {
|
|
54
|
+
act(() => {
|
|
55
|
+
render(h(Probe, null), container);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
describe('useSearchParams', () => {
|
|
60
|
+
test('reads the window it is mounted under, not the one that existed at import', () => {
|
|
61
|
+
installDomGlobals(new Window({ url: 'http://localhost/?sessionId=first' }));
|
|
62
|
+
mount();
|
|
63
|
+
expect(seen).toBe('sessionId=first');
|
|
64
|
+
|
|
65
|
+
installDomGlobals(new Window({ url: 'http://localhost/?sessionId=second' }));
|
|
66
|
+
mount();
|
|
67
|
+
expect(seen).toBe('sessionId=second');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
test('a window with no location reads as no query string instead of throwing', () => {
|
|
71
|
+
// Exactly the shape `installDomGlobals({})` installs: `window` exists, the
|
|
72
|
+
// DOM does not. It used to throw out of the component's render.
|
|
73
|
+
installDomGlobals({});
|
|
74
|
+
expect(() => mount()).not.toThrow();
|
|
75
|
+
expect(seen).toBe('');
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
test('a window whose location has no search is the same answer', () => {
|
|
79
|
+
installDomGlobals({ location: {} });
|
|
80
|
+
expect(() => mount()).not.toThrow();
|
|
81
|
+
expect(seen).toBe('');
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -42,7 +42,15 @@ function emit(): void {
|
|
|
42
42
|
* landing, failing a case that passes when its file runs alone.
|
|
43
43
|
*/
|
|
44
44
|
function liveSearch(): string {
|
|
45
|
-
|
|
45
|
+
// `window` present but carrying no `location` is a real runtime shape, not a
|
|
46
|
+
// typo: `installDomGlobals({})` builds one on purpose (the SSR case), and a
|
|
47
|
+
// suite that restored its globals leaves a `globalThis`-as-window stand-in
|
|
48
|
+
// behind. Reading through the chain answers "no query string" there instead of
|
|
49
|
+
// throwing a TypeError — measured on the Windows gate, where exactly that
|
|
50
|
+
// killed `list-slots.test.ts` and `plugin-contributions.test.ts` with a stack
|
|
51
|
+
// naming neither of them.
|
|
52
|
+
const search = typeof window === 'undefined' ? undefined : window.location?.search;
|
|
53
|
+
return typeof search === 'string' ? search : '';
|
|
46
54
|
}
|
|
47
55
|
|
|
48
56
|
/**
|
|
@@ -60,11 +68,14 @@ function onPopState(): void {
|
|
|
60
68
|
function bindToCurrentWindow(): void {
|
|
61
69
|
const next = typeof window === 'undefined' ? undefined : window;
|
|
62
70
|
if (next === boundWindow) return;
|
|
63
|
-
|
|
71
|
+
// Both calls are guarded the same way `liveSearch` is: a stub window (the
|
|
72
|
+
// SSR `{}`, a `globalThis` stand-in) has no listener API, and subscribing a
|
|
73
|
+
// component must not throw because the suite that owns the globals has ended.
|
|
74
|
+
if (typeof boundWindow?.removeEventListener === 'function') boundWindow.removeEventListener('popstate', onPopState);
|
|
64
75
|
boundWindow = next;
|
|
65
76
|
// Back/forward navigation. `pushState`/`replaceState` do NOT fire popstate,
|
|
66
77
|
// so setParams notifies directly.
|
|
67
|
-
next?.addEventListener('popstate', onPopState);
|
|
78
|
+
if (typeof next?.addEventListener === 'function') next.addEventListener('popstate', onPopState);
|
|
68
79
|
}
|
|
69
80
|
|
|
70
81
|
function subscribe(listener: () => void): () => void {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* merged list, and the project's own file switched off for the child.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
import { afterAll, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
15
|
+
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, test } from 'bun:test';
|
|
16
16
|
import fs from 'fs';
|
|
17
17
|
import os from 'os';
|
|
18
18
|
import path from 'path';
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from '@/server/lib/mcp/session-overlay.server';
|
|
31
31
|
import { sessionMcpSpawn } from '@/server/lib/omp/rpc/spawn-mcp';
|
|
32
32
|
import { cachedMcpProbe, probeMcpServer } from '@/server/lib/mcp/probe.server';
|
|
33
|
+
import { clearPluginMcp, createPluginMcp } from '@/server/lib/plugins/mcp.server';
|
|
33
34
|
import { mcpServerEntriesFor } from '@/server/lib/mcp/registry.server';
|
|
34
35
|
|
|
35
36
|
const ROOT = path.join(os.tmpdir(), `kabmo-session-mcp-${process.pid}`);
|
|
@@ -162,3 +163,65 @@ describe('session MCP probe', () => {
|
|
|
162
163
|
expect(cachedMcpProbe(SESSION, 'broken')).toEqual(result);
|
|
163
164
|
});
|
|
164
165
|
});
|
|
166
|
+
|
|
167
|
+
describe('plugin MCP delivery', () => {
|
|
168
|
+
// The bug these pin: `api.mcp.register` reached ACP harnesses only. omp's RPC
|
|
169
|
+
// child reads ONE `mcp.json`, and the overlay that writes it listed
|
|
170
|
+
// `user`/`project` sources and was skipped entirely without per-session
|
|
171
|
+
// overrides — so an `omp-rpc` chat saw none of a plugin's tools.
|
|
172
|
+
const PLUGIN = 'kanban-test';
|
|
173
|
+
|
|
174
|
+
afterEach(() => {
|
|
175
|
+
clearPluginMcp(PLUGIN);
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
test('a plugin server is part of the merged list only when plugin is asked for', async () => {
|
|
179
|
+
createPluginMcp(PLUGIN).register({
|
|
180
|
+
id: 'board',
|
|
181
|
+
transport: 'stdio',
|
|
182
|
+
command: 'bun',
|
|
183
|
+
args: ['/tmp/board.js', '--mcp'],
|
|
184
|
+
env: { KANBAN_DIR: '/tmp/kanban' },
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
const withPlugin = await mcpServerEntriesFor(PROJECT, { sources: ['user', 'project', 'plugin'] });
|
|
188
|
+
const board = withPlugin.find((entry) => entry.name === `${PLUGIN}:board`);
|
|
189
|
+
expect(board?.source).toBe('plugin');
|
|
190
|
+
expect(board?.config).toEqual({
|
|
191
|
+
command: 'bun',
|
|
192
|
+
args: ['/tmp/board.js', '--mcp'],
|
|
193
|
+
env: { KANBAN_DIR: '/tmp/kanban' },
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
// The pre-fix source list proves the delivery gap rather than assuming it.
|
|
197
|
+
const withoutPlugin = await mcpServerEntriesFor(PROJECT, { sources: ['user', 'project'] });
|
|
198
|
+
expect(withoutPlugin.some((entry) => entry.name === `${PLUGIN}:board`)).toBe(false);
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
test('a session with NO overrides still gets an overlay when a plugin contributes', async () => {
|
|
202
|
+
createPluginMcp(PLUGIN).register({ id: 'board', transport: 'stdio', command: 'bun', args: ['/tmp/board.js'] });
|
|
203
|
+
|
|
204
|
+
const spawn = await sessionMcpSpawn(SESSION, PROJECT, undefined);
|
|
205
|
+
const overlay = spawn.overlay;
|
|
206
|
+
if (!overlay) throw new Error('expected an overlay because a plugin contributes a server');
|
|
207
|
+
expect(spawn.extraArgs).toEqual(['--config', overlay.configPath]);
|
|
208
|
+
|
|
209
|
+
const written = JSON.parse(fs.readFileSync(path.join(overlay.dir, 'mcp.json'), 'utf8')) as {
|
|
210
|
+
mcpServers: Record<string, { command?: string; args?: string[] }>;
|
|
211
|
+
};
|
|
212
|
+
expect(written.mcpServers[`${PLUGIN}:board`]).toEqual({ command: 'bun', args: ['/tmp/board.js'] });
|
|
213
|
+
// The user's own servers still ride along, so the plugin does not replace them.
|
|
214
|
+
expect(written.mcpServers.alpha).toEqual({ command: 'alpha-cmd' });
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
test('a session override can switch a plugin server off', async () => {
|
|
218
|
+
createPluginMcp(PLUGIN).register({ id: 'board', transport: 'stdio', command: 'bun' });
|
|
219
|
+
await writeSessionMcpOverrides(SESSION, { [`${PLUGIN}:board`]: false });
|
|
220
|
+
|
|
221
|
+
const overlay = await ensureSessionMcpOverlay(SESSION, PROJECT, { [`${PLUGIN}:board`]: false });
|
|
222
|
+
const written = JSON.parse(fs.readFileSync(path.join(overlay?.dir ?? '', 'mcp.json'), 'utf8')) as {
|
|
223
|
+
mcpServers: Record<string, { enabled?: boolean }>;
|
|
224
|
+
};
|
|
225
|
+
expect(written.mcpServers[`${PLUGIN}:board`]?.enabled).toBe(false);
|
|
226
|
+
});
|
|
227
|
+
});
|
|
@@ -114,10 +114,13 @@ export async function ensureSessionMcpOverlay(
|
|
|
114
114
|
|
|
115
115
|
const servers = await mcpServerEntriesFor(cwd, {
|
|
116
116
|
overrides,
|
|
117
|
-
//
|
|
118
|
-
//
|
|
119
|
-
//
|
|
120
|
-
|
|
117
|
+
// omp's RPC mode reads ONE `mcp.json`, so anything a session should see
|
|
118
|
+
// has to be materialized into this file. `plugin` is included because a
|
|
119
|
+
// plugin's `api.mcp.register` is the only way a third party contributes a
|
|
120
|
+
// tool server, and ACP-only delivery meant an `omp-rpc` chat silently had
|
|
121
|
+
// none of it. App-local rows (`custom`) stay out: they are the settings
|
|
122
|
+
// pane's own list and ACP-only by design.
|
|
123
|
+
sources: ['user', 'project', 'plugin'],
|
|
121
124
|
});
|
|
122
125
|
const mcpServers: Record<string, unknown> = {};
|
|
123
126
|
for (const server of servers) {
|
|
@@ -228,6 +228,37 @@ describe('buildSessionSpawnArgs', () => {
|
|
|
228
228
|
expect(buildSessionSpawnArgs('')).toEqual(['--config', titleModelOverlayPath(), ...kabmoExtensionArgs()]);
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
+
test('a stage prompt is APPENDED, never substituted, and rides before the extension load', () => {
|
|
232
|
+
// `--system-prompt` would replace omp's own coding prompt and with it the
|
|
233
|
+
// tool contract; only `--append-system-prompt` keeps the agent usable.
|
|
234
|
+
expect(buildSessionSpawnArgs('', 'write', undefined, { systemPrompt: 'Review the change.' })).toEqual([
|
|
235
|
+
'--config',
|
|
236
|
+
titleModelOverlayPath(),
|
|
237
|
+
'--approval-mode',
|
|
238
|
+
'write',
|
|
239
|
+
'--append-system-prompt',
|
|
240
|
+
'Review the change.',
|
|
241
|
+
...kabmoExtensionArgs(),
|
|
242
|
+
]);
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test('skill globs narrow the catalog in one comma-separated flag', () => {
|
|
246
|
+
expect(buildSessionSpawnArgs('', undefined, undefined, { skills: ['review-*', 'pr-*'] })).toEqual([
|
|
247
|
+
'--config',
|
|
248
|
+
titleModelOverlayPath(),
|
|
249
|
+
'--skills=review-*,pr-*',
|
|
250
|
+
...kabmoExtensionArgs(),
|
|
251
|
+
]);
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
test('an empty prompt and an empty glob list add no argv at all', () => {
|
|
255
|
+
expect(buildSessionSpawnArgs('', undefined, undefined, { systemPrompt: '', skills: [] })).toEqual([
|
|
256
|
+
'--config',
|
|
257
|
+
titleModelOverlayPath(),
|
|
258
|
+
...kabmoExtensionArgs(),
|
|
259
|
+
]);
|
|
260
|
+
});
|
|
261
|
+
|
|
231
262
|
test('the overlay file EXISTS by the time the argv names it', () => {
|
|
232
263
|
// omp's `--config` loader is strict: a missing file is a hard error, so the
|
|
233
264
|
// file has to be there before the spawn reads the argv.
|
|
@@ -295,10 +295,19 @@ export async function resolveSpawnCwd(recordedCwd?: string | null): Promise<stri
|
|
|
295
295
|
* reaches omp's title generation: the child watches that path, so
|
|
296
296
|
* `rename-with-ai` rewrites the `tiny` role for the duration of one request.
|
|
297
297
|
* See `session/title-model-overlay.server.ts`. */
|
|
298
|
+
/** A spawn-time system prompt and skill filter, for a session born from a stage. */
|
|
299
|
+
export interface SessionPromptArgs {
|
|
300
|
+
/** Appended to omp's own coding-assistant prompt. */
|
|
301
|
+
systemPrompt?: string;
|
|
302
|
+
/** Comma-separated globs that narrow the skill catalog. */
|
|
303
|
+
skills?: readonly string[];
|
|
304
|
+
}
|
|
305
|
+
|
|
298
306
|
export function buildSessionSpawnArgs(
|
|
299
307
|
sessionFile: string,
|
|
300
308
|
approvalMode?: ApprovalMode,
|
|
301
309
|
resumeModel?: SelectedModel,
|
|
310
|
+
promptArgs?: SessionPromptArgs,
|
|
302
311
|
): string[] {
|
|
303
312
|
const args: string[] = [];
|
|
304
313
|
ensureTitleModelOverlay();
|
|
@@ -323,6 +332,16 @@ export function buildSessionSpawnArgs(
|
|
|
323
332
|
// mode, so the flag is the sole lever. It works with or without --resume.
|
|
324
333
|
args.push('--approval-mode', approvalMode);
|
|
325
334
|
}
|
|
335
|
+
// A stage's system prompt is APPENDED, not substituted: omp's own coding
|
|
336
|
+
// prompt carries the tool contract, and replacing it is how an agent stops
|
|
337
|
+
// using its tools correctly. Measured on omp 19.1.0: both flags are accepted
|
|
338
|
+
// in `--mode rpc-ui` and the child reaches `ready`.
|
|
339
|
+
if (promptArgs?.systemPrompt) {
|
|
340
|
+
args.push('--append-system-prompt', promptArgs.systemPrompt);
|
|
341
|
+
}
|
|
342
|
+
if (promptArgs?.skills && promptArgs.skills.length > 0) {
|
|
343
|
+
args.push(`--skills=${promptArgs.skills.join(',')}`);
|
|
344
|
+
}
|
|
326
345
|
args.push(...kabmoExtensionArgs());
|
|
327
346
|
return args;
|
|
328
347
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A brand-new omp session: adopt the prewarmed child, or cold-spawn one.
|
|
8
|
+
*
|
|
9
|
+
* Split out of `session-registry.ts` (which owns the live map and the spawn
|
|
10
|
+
* path) because this is the ONE place a prewarmed process is consumed, and it
|
|
11
|
+
* carries a rule the cold path does not: a spawn-time system prompt or skill
|
|
12
|
+
* filter makes a warm child UNUSABLE. omp reads both flags only at spawn, so
|
|
13
|
+
* adopting one would silently drop a stage's instructions — the same class of
|
|
14
|
+
* bug as adopting a child with the wrong approval mode.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type { ApprovalMode } from '@/shared/lib/omp/config/access-mode';
|
|
18
|
+
import { DEFAULT_APPROVAL_MODE } from '@/shared/lib/omp/config/access-mode';
|
|
19
|
+
import type { AgentSessionWrapper } from '@/server/lib/omp/rpc/manager';
|
|
20
|
+
import type { SessionPromptArgs } from '@/server/lib/omp/rpc/constants';
|
|
21
|
+
import { claimPrewarmedSession } from '@/server/lib/omp/rpc/prewarm-pool';
|
|
22
|
+
import { ompSessionRegistry, startRpcSession } from '@/server/lib/omp/rpc/session-registry';
|
|
23
|
+
import { registerSpawnedSession } from '@/server/lib/omp/rpc/session-registration';
|
|
24
|
+
import { syncDiscoveryRootsWatch } from '@/server/lib/omp/config/roots-watch.server';
|
|
25
|
+
import { emitRealtimeSignal } from '@/server/lib/realtime/signals.server';
|
|
26
|
+
import { mintAgentEnvironment, rememberAgentToken } from '@/server/lib/sessions/agent-token.server';
|
|
27
|
+
|
|
28
|
+
/** Consume the prewarmed process for `cwd` when its approval mode matches, or
|
|
29
|
+
* spawn a fresh session. The returned wrapper is already registered under its
|
|
30
|
+
* real session id, mirroring startRpcSession's bookkeeping. */
|
|
31
|
+
export async function startNewRpcSession(
|
|
32
|
+
cwd: string,
|
|
33
|
+
approvalMode?: ApprovalMode,
|
|
34
|
+
modeEnv?: Record<string, string>,
|
|
35
|
+
promptArgs?: SessionPromptArgs,
|
|
36
|
+
): Promise<{ session: AgentSessionWrapper; realSessionId: string }> {
|
|
37
|
+
const mode = approvalMode ?? DEFAULT_APPROVAL_MODE;
|
|
38
|
+
// Mint here, not at the route: the prewarmed entry and the cold spawn both
|
|
39
|
+
// get a callback credential, and no caller can forget it.
|
|
40
|
+
const { token, env: agentEnv } = mintAgentEnvironment();
|
|
41
|
+
const env = { ...(modeEnv ?? {}), ...agentEnv };
|
|
42
|
+
// A prewarmed child was spawned with no `--append-system-prompt` and no
|
|
43
|
+
// `--skills`, and omp reads both ONLY at spawn. Adopting it would silently
|
|
44
|
+
// drop the stage's instructions, so a caller that names either gets a cold
|
|
45
|
+
// spawn — the same reason a differing mode selection kills the warm entry.
|
|
46
|
+
const needsColdSpawn = Boolean(promptArgs?.systemPrompt) || Boolean(promptArgs?.skills?.length);
|
|
47
|
+
const wrapper = needsColdSpawn ? undefined : await claimPrewarmedSession(cwd, mode, env);
|
|
48
|
+
|
|
49
|
+
if (!wrapper) {
|
|
50
|
+
const started = await startRpcSession(
|
|
51
|
+
`__new__${Bun.randomUUIDv7()}`, '', cwd, undefined, mode, env, undefined, promptArgs,
|
|
52
|
+
);
|
|
53
|
+
await rememberAgentToken(started.realSessionId, token).catch((cause: unknown) => {
|
|
54
|
+
console.error(`[sessions] could not record the agent token for ${started.realSessionId}:`, cause);
|
|
55
|
+
});
|
|
56
|
+
return started;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// A claimed prewarmed process recorded its own token before entering the
|
|
60
|
+
// pool; recording this call's token would invalidate the child's environment.
|
|
61
|
+
|
|
62
|
+
const registry = ompSessionRegistry();
|
|
63
|
+
const realSessionId = wrapper.sessionId;
|
|
64
|
+
// The same registration the cold path uses: it installs the destroy cleanup
|
|
65
|
+
// AND starts the change journal, so a prewarmed session is not a second
|
|
66
|
+
// convention.
|
|
67
|
+
registerSpawnedSession(registry, wrapper, realSessionId, realSessionId);
|
|
68
|
+
// A prewarmed process is adopted here, not in `startRpcSession`, so this is
|
|
69
|
+
// the only spawn path that sees it — a session's cwd may sit outside every
|
|
70
|
+
// registered workspace, and the discovery watcher has to learn it. Awaited
|
|
71
|
+
// for the same reason as in `startRpcSession`: the attach is asynchronous,
|
|
72
|
+
// and the caller's first write must not land before the watch exists.
|
|
73
|
+
await syncDiscoveryRootsWatch();
|
|
74
|
+
// Same as `startRpcSession`: a topic subscribed against the pre-spawn id (or
|
|
75
|
+
// a placeholder) needs a fresh snapshot now that a child is reachable.
|
|
76
|
+
emitRealtimeSignal('session-attached', realSessionId);
|
|
77
|
+
return { session: wrapper, realSessionId };
|
|
78
|
+
}
|