collabmd 0.1.49 → 0.1.51
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 +10 -659
- package/bin/collabmd.js +36 -20
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-Crf9Y3Q6.js +1 -0
- package/dist/client/assets/{abnfDiagram-VCTEODGH-CdVZqicp.js → abnfDiagram-VCTEODGH-PuinKbSQ.js} +1 -1
- package/dist/client/assets/ar-SA-5WIASEJP-Di7OimCN.js +10 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-wUo0bXif.js → architectureDiagram-5GKGNRK7-46hPkrZv.js} +1 -1
- package/dist/client/assets/az-AZ-V5EUQD6C-C19OGTT_.js +1 -0
- package/dist/client/assets/bg-BG-EXASCMTR-BIt0xWyb.js +5 -0
- package/dist/client/assets/{blockDiagram-I7D4REHJ-BRSK3m49.js → blockDiagram-I7D4REHJ-C1S5Bzf8.js} +1 -1
- package/dist/client/assets/bn-BD-U4SYNFCO-CdNaPy4Q.js +3 -0
- package/dist/client/assets/bn-IN-HKDJIITE-CdNaPy4Q.js +3 -0
- package/dist/client/assets/{browser-BKLM0ThC-IxjwuOIz-BBqQnUEb.js → browser-BKLM0ThC-IxjwuOIz-DyJcVMFR.js} +1 -1
- package/dist/client/assets/{c4Diagram-7LVT6UL2-yD2poxqw.js → c4Diagram-7LVT6UL2-VAk1HPmz.js} +1 -1
- package/dist/client/assets/ca-ES-2KGUU5XB-C9t-c0cH.js +8 -0
- package/dist/client/assets/channel-jwdhnPiV.js +1 -0
- package/dist/client/assets/chunk-2E4U76K2-Ba8Wf22k.js +1 -0
- package/dist/client/assets/{chunk-4HAMMTFA-DStbIfJ1.js → chunk-4HAMMTFA-Ht-73lsT.js} +1 -1
- package/dist/client/assets/chunk-5XKZK2GL-D4UAZSOJ.js +1 -0
- package/dist/client/assets/{chunk-75Z2AOVW-C5pGd3W9.js → chunk-75Z2AOVW-B2cZexqK.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-BMeArk03.js → chunk-CLGD4ZFX-Cmtx89ht.js} +1 -1
- package/dist/client/assets/{chunk-DU6HZSFF-Zkp69c6c.js → chunk-DU6HZSFF-C6d6PJfE.js} +1 -1
- package/dist/client/assets/{chunk-F27PBJKO-D4xNct1r.js → chunk-F27PBJKO-Dg3H6KLL.js} +1 -1
- package/dist/client/assets/{chunk-GMAD6QVW-NZ6WpDb8.js → chunk-GMAD6QVW-DUfjx_d5.js} +1 -1
- package/dist/client/assets/{chunk-GVQU2GXP-D8SDprfX.js → chunk-GVQU2GXP-D1l7oRGR.js} +1 -1
- package/dist/client/assets/{chunk-IMKFNOWR-D8jEuU3Q.js → chunk-IMKFNOWR-3F6NhHUP.js} +1 -1
- package/dist/client/assets/{chunk-L3NEJ4N5-aijKP-eh.js → chunk-L3NEJ4N5-BmCVn4y-.js} +1 -1
- package/dist/client/assets/{chunk-OSK3NFVY-CCbLQAMa.js → chunk-OSK3NFVY-CWHXAmfx.js} +1 -1
- package/dist/client/assets/{chunk-P2QGCYS3-Oag_FdCq.js → chunk-P2QGCYS3-Du8EtwOa.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-CYnpIgXT.js → chunk-POPQ4Y6H-B5yJIrZE.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-JSNrcBmP.js → chunk-PWAF6VOD-B3gML4ps.js} +1 -1
- package/dist/client/assets/{chunk-SHT3W25Y-BiQGljao.js → chunk-SHT3W25Y-BKaI8jZO.js} +1 -1
- package/dist/client/assets/{chunk-SVP7TREG-DB485R5x.js → chunk-SVP7TREG-XlsB_ZMZ.js} +1 -1
- package/dist/client/assets/{chunk-TICWLB2K-8rAVvoS3.js → chunk-TICWLB2K-Cpp2z8yK.js} +1 -1
- package/dist/client/assets/chunk-TLUHSLCS-Yl7B0Vrz.js +1 -0
- package/dist/client/assets/chunk-ZNVOA63L-BmCQjhx-.js +40 -0
- package/dist/client/assets/{chunk-FLYJHZSQ-Be7lKF17.js → chunk-ZPMXAHWN-Dt0TxJa6.js} +2 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BRw9vo8U.js +1 -0
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BRw9vo8U.js +1 -0
- package/dist/client/assets/comment-markdown-renderer-B9_vPc3F.js +1 -0
- package/dist/client/assets/comment-thread-store-NNHqRVsX.js +1 -0
- package/dist/client/assets/comment-threads-nJhK1yfc.js +4 -0
- package/dist/client/assets/cs-CZ-VUCGPRML-BfCoYAgj.js +7 -0
- package/dist/client/assets/{cynefinDiagram-5FMLGOSQ-rTz9RhFH.js → cynefinDiagram-5FMLGOSQ-BRoCEoZM.js} +1 -1
- package/dist/client/assets/da-DK-NNDP2IVP-DBw9ZNTR.js +2 -0
- package/dist/client/assets/{dagre-GXQ25YYZ-Cr67wLpQ.js → dagre-GXQ25YYZ-BSfKCfy7.js} +1 -1
- package/dist/client/assets/de-CH-I7RAVIZN-DYW18Vsr.js +11 -0
- package/dist/client/assets/de-DE-WBQ3DQLR-DYW18Vsr.js +11 -0
- package/dist/client/assets/deferred-collab-rBe4nuQ2.css +1 -0
- package/dist/client/assets/deferred-git-BHKtkFYi.css +1 -0
- package/dist/client/assets/deferred-preview-pe7Iwwx3.css +1 -0
- package/dist/client/assets/{diagram-S7CK7UJ4-DywERe__.js → diagram-S7CK7UJ4-D7KaM9yj.js} +1 -1
- package/dist/client/assets/{diagram-UQ7AKVKN-CNYlXtu4.js → diagram-UQ7AKVKN-JevUZuYi.js} +1 -1
- package/dist/client/assets/{diagram-VSXAHHWV-0H1a61Bn.js → diagram-VSXAHHWV-B3-U-Q2E.js} +1 -1
- package/dist/client/assets/{diagram-VX7I27RA-CsJbsx5F.js → diagram-VX7I27RA-pSD4HMh1.js} +1 -1
- package/dist/client/assets/{diagram-Z3DM3KII-D0mLxEgI.js → diagram-Z3DM3KII-D8r1_CIb.js} +1 -1
- package/dist/client/assets/{direct-engine-DdrQKpgq-CtKfQzCt.js → direct-engine-DdrQKpgq-B5zIoeQw.js} +1 -1
- package/dist/client/assets/dist-B3HdUPsK.js +1 -0
- package/dist/client/assets/{dist-Tw-Fxpeb.js → dist-B7XMN9AT.js} +1 -1
- package/dist/client/assets/dist-BIRygGYH.js +1 -0
- package/dist/client/assets/dist-BPyOlNLY.js +2 -0
- package/dist/client/assets/{dist-D5wCC32z.js → dist-BR81yxMt.js} +1 -1
- package/dist/client/assets/{dist-TW8iFRyW.js → dist-B_B4XLmq.js} +1 -1
- package/dist/client/assets/dist-Bdy9ZRzd.js +9 -0
- package/dist/client/assets/{dist-netZOQtD.js → dist-Bfxzlnrf.js} +1 -1
- package/dist/client/assets/{dist-DzNmC81X.js → dist-Bx3QkS-3.js} +1 -1
- package/dist/client/assets/{dist-mj2Ht75J.js → dist-By7ieqAf.js} +1 -1
- package/dist/client/assets/dist-ByhQbe-x.js +1 -0
- package/dist/client/assets/{dist-CdmKGRGr.js → dist-BzFSJM0U.js} +1 -1
- package/dist/client/assets/dist-C5NkYKAa.js +1 -0
- package/dist/client/assets/{dist-D3fehAZ2.js → dist-CELhfKzh.js} +1 -1
- package/dist/client/assets/dist-CEirJSxk.js +1 -0
- package/dist/client/assets/dist-CO0-4CuV.js +39 -0
- package/dist/client/assets/dist-CRnJ0D9h.js +1 -0
- package/dist/client/assets/{dist-GvvCNBe4.js → dist-CbDyXgCo.js} +1 -1
- package/dist/client/assets/{dist-BeajGMhO.js → dist-CqXVyYoH.js} +1 -1
- package/dist/client/assets/{dist-LQ4kDCKz.js → dist-CrWzIWEE.js} +1 -1
- package/dist/client/assets/dist-CyNrloSI.js +1 -0
- package/dist/client/assets/dist-D60_kdpQ.js +1 -0
- package/dist/client/assets/{dist-DuH3ZrHo.js → dist-DCpIH3-_.js} +1 -1
- package/dist/client/assets/{dist-BPHLJ09L.js → dist-DJAMplZI.js} +2 -2
- package/dist/client/assets/{dist-DGEbEfw4.js → dist-DVXzbeDx.js} +1 -1
- package/dist/client/assets/{dist-C5NgpdG5.js → dist-Drv_wZYC.js} +1 -1
- package/dist/client/assets/{dist-DVy5woUy.js → dist-EWJYvBK1.js} +1 -1
- package/dist/client/assets/dist-Hdhj3L3t.js +1 -0
- package/dist/client/assets/{dist-DpYDHR9p.js → dist-gRRhmB-2.js} +3 -3
- package/dist/client/assets/dist-kWb2d1CH.js +1 -0
- package/dist/client/assets/dist-kiD2GIsD.js +13 -0
- package/dist/client/assets/{dist-JaU3aRlD.js → dist-l-56SowH.js} +1 -1
- package/dist/client/assets/{dist-BK9QvQrc.js → dist-nxQErAaK.js} +2 -2
- package/dist/client/assets/dist-sLzRQQk7.js +1 -0
- package/dist/client/assets/document-formatter-Qdiq9uJs.js +1 -0
- package/dist/client/assets/drawioEditor-CHf1vtdQ.js +9 -0
- package/dist/client/assets/{ebnfDiagram-PWID7BFC-HeTxHpCU.js → ebnfDiagram-PWID7BFC-UJ0Fz5ci.js} +1 -1
- package/dist/client/assets/editor-session-4Bn81iWm.js +14 -0
- package/dist/client/assets/el-GR-TYQHVGXW-Dx82YYAS.js +7 -0
- package/dist/client/assets/embedded-editor-base-jK221GC8.css +1 -0
- package/dist/client/assets/{embedpdf-DA4bA119-BPqZxwjc.js → embedpdf-DA4bA119-E8wZ11J2.js} +2 -3
- package/dist/client/assets/{embedpdf-BmE13ZZ0.js → embedpdf-LUXDBD3-.js} +1 -1
- package/dist/client/assets/{en-SJ2YIMFF-CJBL3nkq.js → en-2RFA324Y-BsuNJTcL.js} +1 -1
- package/dist/client/assets/{erDiagram-RLTQ6QDP-CbrDdd5P.js → erDiagram-RLTQ6QDP-CWrH1UJ9.js} +1 -1
- package/dist/client/assets/es-ES-JEUOREKJ-Rx0NUQDl.js +12 -0
- package/dist/client/assets/eu-ES-SO5DEEAN-CDYm-BcK.js +8 -0
- package/dist/client/assets/excalidraw-element-link-iA6zo0_f.js +7 -0
- package/dist/client/assets/{excalidrawEditor-BbSbI80a.css → excalidrawEditor-DDE0n1Pk.css} +1 -1
- package/dist/client/assets/excalidrawEditor-WIuguTz7.js +9 -0
- package/dist/client/assets/export-page-AN-wI5p4.js +56 -0
- package/dist/client/assets/exportDocument-B7IagJhQ.css +1 -0
- package/dist/client/assets/exportDocument-B9xNKpQe.js +2 -0
- package/dist/client/assets/fa-IR-FIYUE2GQ-C865Nx3X.js +9 -0
- package/dist/client/assets/fi-FI-REAEF6HQ-BIpjJqIb.js +6 -0
- package/dist/client/assets/flowDiagram-HODETNUW-kb1lUSBo.js +1 -0
- package/dist/client/assets/fr-FR-SUCL7J6B-DGAKE8jH.js +12 -0
- package/dist/client/assets/{ganttDiagram-EL5Y4UJY-BHgOYiZz.js → ganttDiagram-EL5Y4UJY-BBNzDfaV.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-Dl__X3Sk.js → gitGraphDiagram-WWUBYQGX-Csf0Dm_1.js} +1 -1
- package/dist/client/assets/gl-ES-KHCSOGVH-DWKh0CMu.js +6 -0
- package/dist/client/assets/he-IL-JYXVXV2Q-zqbcM-4g.js +9 -0
- package/dist/client/assets/hi-IN-BU52H3BO-CY8v6eG9.js +3 -0
- package/dist/client/assets/highlight-theme-CzNkO-IJ.js +1 -0
- package/dist/client/assets/hu-HU-OWADXDQ3-CEl6Udfh.js +3 -0
- package/dist/client/assets/id-ID-EOMR5R3I-CGQwUjoL.js +8 -0
- package/dist/client/assets/image-2QKV3NAF-BUbX0y5Y.js +1 -0
- package/dist/client/assets/index-BAmZnTFV.css +1 -0
- package/dist/client/assets/index-mWiw418b.js +1111 -0
- package/dist/client/assets/{infoDiagram-27XIBGKW-DBpoANC9.js → infoDiagram-27XIBGKW-Bzy6kCbb.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BMPC6hfp.js → ishikawaDiagram-5VMMS53U-CRy9vIS5.js} +1 -1
- package/dist/client/assets/it-IT-FC2VTM3L-KTijNcUe.js +12 -0
- package/dist/client/assets/ja-JP-JBNTKYP4-BflWlGhw.js +12 -0
- package/dist/client/assets/{journeyDiagram-3NMN7TZE-B1sApUmM.js → journeyDiagram-3NMN7TZE-D4ZR_s9J.js} +1 -1
- package/dist/client/assets/kaa-TC3VIB7V-B-xtZfy0.js +1 -0
- package/dist/client/assets/kab-KAB-UOUDSQKM-BmO0O4Y4.js +4 -0
- package/dist/client/assets/{kanban-definition-UXKFOSKX-C9yP4td1.js → kanban-definition-UXKFOSKX-CIDTmu5g.js} +1 -1
- package/dist/client/assets/kk-KZ-P5H2X7YS-CSQFB8IN.js +1 -0
- package/dist/client/assets/{km-KH-PCWDKPHP-DSmy5shj.js → km-KH-IHMV2US7-BxrjuEzr.js} +4 -4
- package/dist/client/assets/ko-KR-ZTMANIDF-BnNRXd5J.js +5 -0
- package/dist/client/assets/ku-TR-GPJTRB5G-BZM7f2aT.js +6 -0
- package/dist/client/assets/{line-BFl3ujec.js → line-DSWLHgpx.js} +1 -1
- package/dist/client/assets/lobby-presence-Rdjnc0_0.js +1 -0
- package/dist/client/assets/lt-LT-V3XDOK3P-MVQBOHmF.js +3 -0
- package/dist/client/assets/lv-LV-DVQ3FADO-CrenwAhS.js +4 -0
- package/dist/client/assets/markdown-it-CocJWnjv.js +13 -0
- package/dist/client/assets/mermaid-parser.core-DrdLA3p0.js +3 -0
- package/dist/client/assets/mermaid.core-C_FK-7n4.js +1 -0
- package/dist/client/assets/{mermaid.core-BrY09czX.js → mermaid.core-D0cMM4Rl.js} +2 -3
- package/dist/client/assets/{mindmap-definition-YA3MSWOX-BUQHcYbK.js → mindmap-definition-YA3MSWOX-DO8NB9VH.js} +1 -1
- package/dist/client/assets/mr-IN-VZ6HH5FE-B-PHPglH.js +9 -0
- package/dist/client/assets/my-MM-XYKWHRK6-Be5sYp5q.js +1 -0
- package/dist/client/assets/nb-NO-UNO2GGZJ-BvSKGdja.js +8 -0
- package/dist/client/assets/nl-NL-76EFHT4P-C2yNx1Cj.js +13 -0
- package/dist/client/assets/nn-NO-CFKD7ABE-4NsqlDRP.js +4 -0
- package/dist/client/assets/oc-FR-YBJTCJ3J-B4OTQsWW.js +4 -0
- package/dist/client/assets/pa-IN-SNOXSMRV-CKj_sOG7.js +4 -0
- package/dist/client/assets/{pegDiagram-XKGWAZYB-Bi2Iml7Z.js → pegDiagram-XKGWAZYB-DS6Ab21R.js} +1 -1
- package/dist/client/assets/percentages-Q7USCRWZ-DWE6uvTs.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-_gYXnMoi.js → pieDiagram-E7YTZNPT-BbFe6Tgs.js} +1 -1
- package/dist/client/assets/pl-PL-BSY6YFZ3-CFuzA6L0.js +12 -0
- package/dist/client/assets/preload-helper-CtT0-S4g.js +1 -0
- package/dist/client/assets/preview-render-compiler-C_7J7eia.js +43 -0
- package/dist/client/assets/preview-render-compiler-DzJ1KR_M.js +1 -0
- package/dist/client/assets/preview-render-worker-1DoIDllV.js +59 -0
- package/dist/client/assets/prod-D5TxmmoB.js +1 -0
- package/dist/client/assets/prod-pbFU4TaM.js +145 -0
- package/dist/client/assets/pt-BR-CZDV62R3-CkPMtyNx.js +10 -0
- package/dist/client/assets/pt-PT-JO57XJJW-CBSnfGtF.js +12 -0
- package/dist/client/assets/{quadrantDiagram-AXDQQJYC-DwexhEhd.js → quadrantDiagram-AXDQQJYC-fJE7iAxt.js} +1 -1
- package/dist/client/assets/quick-switcher-De4PjZFC.css +1 -0
- package/dist/client/assets/quick-switcher-controller-CUajuy78.js +1 -0
- package/dist/client/assets/{railroadDiagram-O6MQD6OU-BVA5UbMu.js → railroadDiagram-O6MQD6OU-CUQKqbCK.js} +1 -1
- package/dist/client/assets/{requirementDiagram-BXWQKSXE-C4cKwiIw.js → requirementDiagram-BXWQKSXE-Balm0WW8.js} +1 -1
- package/dist/client/assets/ro-RO-UZ5ICYYN-BOuntc_r.js +12 -0
- package/dist/client/assets/room-DX7lIfnu.js +1 -0
- package/dist/client/assets/ru-RU-AN7JPREC-D-ow3SNR.js +10 -0
- package/dist/client/assets/runtime-config-BFVdhnJu.js +1 -0
- package/dist/client/assets/runtime-paths-Cn0snt_9.js +1 -0
- package/dist/client/assets/{sankeyDiagram-P5KCCOFB-B5HHkRT2.js → sankeyDiagram-P5KCCOFB-CcbMqrlQ.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-BX6jqJFD.js → sequenceDiagram-WJ2MYXX4-BL1j3Sn-.js} +1 -1
- package/dist/client/assets/si-LK-7CBLD6QQ-c91EepX0.js +1 -0
- package/dist/client/assets/sk-SK-SWR6DKBI-D5vFMIL6.js +7 -0
- package/dist/client/assets/sl-SI-JRML4FIH-D53L_0S2.js +6 -0
- package/dist/client/assets/{stateDiagram-D77RDMKH-CmqxyRGx.js → stateDiagram-D77RDMKH-DNi924hh.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-C62JEwak.js +1 -0
- package/dist/client/assets/sv-SE-4ZPKFFXF-DT-G7RCI.js +12 -0
- package/dist/client/assets/{swimlanes-42K2YHIH-Bmgb9Zld.js → swimlanes-42K2YHIH-ColgjSH4.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-B9UZhEj4.js +8 -0
- package/dist/client/assets/ta-IN-V6NHHU6Z-D5jy7_AE.js +6 -0
- package/dist/client/assets/th-TH-P7CTMGDK-6sy0NO7K.js +1 -0
- package/dist/client/assets/{timeline-definition-24CTP7MA-BA-lVH6P.js → timeline-definition-24CTP7MA-7pch5JAr.js} +1 -1
- package/dist/client/assets/tr-TR-GUFYG22B-ClVaf8h1.js +4 -0
- package/dist/client/assets/uk-UA-K6SV5NFQ-BLTTtyNB.js +6 -0
- package/dist/client/assets/uz-UZ-TVKTZO2G-Bm02Eg3D.js +1 -0
- package/dist/client/assets/vault-api-client-QjZ_T03l.js +7 -0
- package/dist/client/assets/vault-utils-Bct69Xw2.js +1 -0
- package/dist/client/assets/{vennDiagram-4TSXK5OY-DNdUC_Xj.js → vennDiagram-4TSXK5OY-C5taziCX.js} +1 -1
- package/dist/client/assets/vi-VN-7FKFXJNO-CL3WPhmG.js +7 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-C2oY-YbF.js → wardleyDiagram-VM6X3IG4-BbSlUwuM.js} +1 -1
- package/dist/client/assets/{wiki-link-resolver-DFIwErjc.js → wiki-link-resolver-C2P_WmTV.js} +1 -1
- package/dist/client/assets/{worker-engine-m0rlHn8R-S8mpn_O0.js → worker-engine-m0rlHn8R-eSDcDGEI.js} +1 -1
- package/dist/client/assets/workspace-change-CVA9dVmy.js +1 -0
- package/dist/client/assets/workspace-sync-client-D4nblH_2.js +1 -0
- package/dist/client/assets/{xychartDiagram-S5SC5T6Z-CoIR8CBX.js → xychartDiagram-S5SC5T6Z-D06X1arY.js} +1 -1
- package/dist/client/assets/yjs-B41tM6Sz.js +4 -0
- package/dist/client/assets/yjs-provider-reset-guard-R43MnLNc.js +1 -0
- package/dist/client/assets/zh-CN-AOKVLNNK-DGidDH2b.js +11 -0
- package/dist/client/assets/zh-HK-CDKPF5DC-CRcNR3rk.js +1 -0
- package/dist/client/assets/zh-TW-ZVGYESGW-C7Qji1y6.js +13 -0
- package/dist/client/drawio-editor.html +7 -8
- package/dist/client/excalidraw-editor.html +31 -33
- package/dist/client/export-document.html +5 -7
- package/dist/client/index.html +30 -26
- package/package.json +14 -20
- package/src/client/app/drawio-editor.html +1 -1
- package/src/client/app/excalidraw-editor.html +1 -1
- package/src/client/app/export-document.html +1 -1
- package/src/client/app/index.html +28 -4
- package/src/client/app/main-entry.js +1 -19
- package/src/client/application/app-shell/comments-feature.js +6 -0
- package/src/client/application/app-shell/ui-feature-shell.js +136 -58
- package/src/client/application/app-shell/ui-feature-tab-activity.js +8 -3
- package/src/client/application/app-shell-elements.js +5 -0
- package/src/client/application/highlight-theme.js +16 -0
- package/src/client/application/preview-render-compiler.js +43 -20
- package/src/client/application/preview-render-executor.js +0 -26
- package/src/client/application/preview-renderer.js +24 -7
- package/src/client/application/workspace-coordinator.js +20 -21
- package/src/client/bootstrap/collabmd-app-shell.js +71 -35
- package/src/client/bootstrap/lazy-collab-clients.js +90 -0
- package/src/client/domain/excalidraw-scene-reconcile.js +5 -2
- package/src/client/domain/hash-routes.js +5 -0
- package/src/client/domain/highlight-runtime.js +47 -0
- package/src/client/domain/lobby-chat.js +2 -0
- package/src/client/domain/runtime-paths.js +56 -7
- package/src/client/domain/vault-utils.js +11 -0
- package/src/client/excalidraw-editor.js +20 -4
- package/src/client/infrastructure/auth-client.js +1 -2
- package/src/client/infrastructure/browser-preferences-port.js +16 -0
- package/src/client/infrastructure/editor-view-adapter.js +43 -8
- package/src/client/infrastructure/excalidraw-room-client.js +9 -1
- package/src/client/infrastructure/hosted-api-client.js +60 -0
- package/src/client/infrastructure/lobby-presence.js +2 -2
- package/src/client/infrastructure/runtime-config.js +3 -1
- package/src/client/infrastructure/webmcp-tool-registry.js +16 -2
- package/src/client/presentation/comment-markdown-renderer.js +2 -14
- package/src/client/presentation/comment-overview-controller.js +1 -2
- package/src/client/presentation/comment-ui/comment-ui-shared.js +5 -2
- package/src/client/presentation/file-explorer-controller.js +3 -0
- package/src/client/presentation/file-explorer-view.js +272 -174
- package/src/client/presentation/git-panel-controller.js +1 -1
- package/src/client/presentation/hosted-workspace-gate-controller.js +180 -0
- package/src/client/presentation/layout-controller.js +10 -1
- package/src/client/presentation/team-settings-controller.js +228 -0
- package/src/client/styles/deferred-collab.css +5 -0
- package/src/client/styles/deferred-git.css +7 -0
- package/src/client/styles/deferred-preview.css +6 -0
- package/src/client/styles/features/diagram-preview.css +0 -15
- package/src/client/styles/features/outline.css +4 -2
- package/src/client/styles/features/preview-markdown.css +25 -11
- package/src/client/styles/features/team-settings.css +162 -0
- package/src/client/styles/foundation/tokens.css +2 -2
- package/src/client/styles/layout/editor-page.css +0 -13
- package/src/client/styles/layout/overlays.css +16 -0
- package/src/client/styles/layout/responsive.css +5 -5
- package/src/client/styles/layout/shell.css +20 -1
- package/src/client/styles/layout/sidebar.css +92 -3
- package/src/client/styles/style.css +3 -19
- package/src/domain/agent-tool-definitions.js +139 -63
- package/src/domain/collabmd-content-capabilities.js +4 -4
- package/src/domain/excalidraw-agent-scene.js +108 -6
- package/src/domain/excalidraw-agent-verification.js +95 -1
- package/src/domain/excalidraw-room-codec.js +12 -1
- package/src/domain/literal-text-search.js +13 -0
- package/src/server/application/agent-content-service.js +142 -74
- package/src/server/config/env.js +96 -5
- package/src/server/create-app-server.js +23 -153
- package/src/server/domain/hosted-workspace.js +10 -1
- package/src/server/domain/ripgrep-search-service.js +68 -21
- package/src/server/infrastructure/git/local-exclude.js +13 -1
- package/src/server/infrastructure/http/create-agent-api-handler.js +1 -1
- package/src/server/infrastructure/http/create-hosted-api-handler.js +5 -0
- package/src/server/infrastructure/http/create-request-handler.js +95 -26
- package/src/server/infrastructure/http/create-static-handler.js +3 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +15 -2
- package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +2 -1
- package/src/server/infrastructure/persistence/sidecar-store.js +12 -5
- package/src/server/infrastructure/persistence/vault-file-store.js +2 -3
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +48 -22
- package/src/server/shared/agent-tool-rate-limiter.js +7 -0
- package/src/server/startup/git-remote-bootstrap.js +56 -49
- package/src/server/vault-registry.js +251 -0
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-C-nmgL5g.js +0 -1
- package/dist/client/assets/ar-SA-PQUY64WN-xjXgbW6d.js +0 -10
- package/dist/client/assets/az-AZ-OXJXL76K-4JkO4Pca.js +0 -1
- package/dist/client/assets/base-CaIEJUF9.css +0 -1
- package/dist/client/assets/bg-BG-W2GKIJDF-DnkH_o81.js +0 -5
- package/dist/client/assets/bn-BD-TGL7M4PJ-CG4JkmtP.js +0 -3
- package/dist/client/assets/bn-IN-BKETKYEH-CG4JkmtP.js +0 -3
- package/dist/client/assets/ca-ES-LD5SCRVV-U6_TVMX9.js +0 -8
- package/dist/client/assets/channel-Fa4GS_-F.js +0 -1
- package/dist/client/assets/chunk-2E4U76K2-BPnTT-J3.js +0 -2
- package/dist/client/assets/chunk-7XWMRXBY-CfMzEq80.js +0 -1
- package/dist/client/assets/chunk-RM4UPSZO-DOWllDY8.js +0 -41
- package/dist/client/assets/chunk-TLUHSLCS-DTY5v0aj.js +0 -2
- package/dist/client/assets/classDiagram-ZZMXUADV-BsQWoR3Q.js +0 -1
- package/dist/client/assets/classDiagram-v2-VYDZK3BY-BsQWoR3Q.js +0 -1
- package/dist/client/assets/comment-thread-store-CX98zR6q.js +0 -1
- package/dist/client/assets/comment-threads-BnRwo5B9.js +0 -4
- package/dist/client/assets/cs-CZ-OFPU5DBV-BmFAIhqX.js +0 -7
- package/dist/client/assets/da-DK-FRDJFYWF-H387Jw8B.js +0 -2
- package/dist/client/assets/de-CH-ZG7H3QK3-C_groygo.js +0 -11
- package/dist/client/assets/de-DE-SIJYH4IH-C_groygo.js +0 -11
- package/dist/client/assets/dist--hk9I5HQ.js +0 -1
- package/dist/client/assets/dist-B1XEa-Zs.js +0 -1
- package/dist/client/assets/dist-BJ1bJs33.js +0 -1
- package/dist/client/assets/dist-Bd1JucQF.js +0 -1
- package/dist/client/assets/dist-ByrG2qBA.js +0 -1
- package/dist/client/assets/dist-C0G3AaXG.js +0 -1
- package/dist/client/assets/dist-CKS_-are.js +0 -1
- package/dist/client/assets/dist-D37Hyu3h.js +0 -9
- package/dist/client/assets/dist-Dl_tpDSr.js +0 -1
- package/dist/client/assets/dist-Dm4w5UId.js +0 -1
- package/dist/client/assets/dist-RKBTaQMb.js +0 -13
- package/dist/client/assets/dist-eBx8q6Sy.js +0 -1
- package/dist/client/assets/dist-jVU5Be5P.js +0 -1
- package/dist/client/assets/document-formatter-rDDjRfZ2.js +0 -2
- package/dist/client/assets/drawioEditor-JubEEha7.js +0 -9
- package/dist/client/assets/editor-session-Bk6oIvSr.js +0 -54
- package/dist/client/assets/el-GR-IEE2CGI2-BkT6YT54.js +0 -7
- package/dist/client/assets/embedded-editor-base-BlCgz6mw.css +0 -1
- package/dist/client/assets/es-Bfdp096f.js +0 -22
- package/dist/client/assets/es-ES-TVVPWKV5-CpPKJXTM.js +0 -12
- package/dist/client/assets/eu-ES-CGBMFQDT-Bu3N2493.js +0 -8
- package/dist/client/assets/excalidraw-element-link-YLIaTnVF.js +0 -7
- package/dist/client/assets/excalidrawEditor-dBMbRX_S.js +0 -9
- package/dist/client/assets/export-page-CRRQ2NEl.js +0 -57
- package/dist/client/assets/exportDocument-BlQRd9_m.js +0 -2
- package/dist/client/assets/exportDocument-CNSbjZwu.css +0 -1
- package/dist/client/assets/fa-IR-IE6XAPR4-BEvLCORD.js +0 -9
- package/dist/client/assets/fi-FI-P7TKNHRM-DI0q8iSX.js +0 -6
- package/dist/client/assets/file-icon-svg-Y_kpF957.js +0 -1
- package/dist/client/assets/flowDiagram-HODETNUW-D5Gy0wmg.js +0 -1
- package/dist/client/assets/fr-FR-QI2XZNT7-y8kXd8LA.js +0 -12
- package/dist/client/assets/gl-ES-TLYCNOZZ-Br-Fhff-.js +0 -6
- package/dist/client/assets/he-IL-ZX43XLGP-qKQq6V9X.js +0 -9
- package/dist/client/assets/hi-IN-UTYRMTUF-DOUcwrDO.js +0 -3
- package/dist/client/assets/hu-HU-AJOSEBW6-FqTyvHlD.js +0 -3
- package/dist/client/assets/id-ID-ETLTVG6C-CQqh3CLS.js +0 -8
- package/dist/client/assets/image-ZVKINSPA-DgzW5zAy.js +0 -1
- package/dist/client/assets/index-D3RER1SZ.js +0 -1023
- package/dist/client/assets/index-DREVKl_K.css +0 -1
- package/dist/client/assets/it-IT-B4B6TP6L-V-yK3SZz.js +0 -12
- package/dist/client/assets/ja-JP-IYKVURR5-BQKBXRpX.js +0 -12
- package/dist/client/assets/kaa-SE2BUIKX-CZ5kfwPg.js +0 -1
- package/dist/client/assets/kab-KAB-Y3GLKXLR-Do7GWfuN.js +0 -4
- package/dist/client/assets/kk-KZ-ABWUFVOH-BpqVciQz.js +0 -1
- package/dist/client/assets/ko-KR-7JQDXKGM-N42lep78.js +0 -5
- package/dist/client/assets/ku-TR-NAH2Q5B7-K8LLl9fk.js +0 -6
- package/dist/client/assets/lt-LT-VQFYRSNQ-BmOd0ALn.js +0 -3
- package/dist/client/assets/lv-LV-T62VSYUM-B22WdPhp.js +0 -4
- package/dist/client/assets/mermaid-parser.core-Bl0efOMt.js +0 -4
- package/dist/client/assets/mermaid.core-DfcNfOTv.js +0 -1
- package/dist/client/assets/modulepreload-polyfill-P2Xu9kJm.js +0 -1
- package/dist/client/assets/mr-IN-V4FHLCJE-XX069tpm.js +0 -9
- package/dist/client/assets/my-MM-E3SQ6E54-cst_-5SB.js +0 -1
- package/dist/client/assets/nb-NO-MLNOFN5H-Bu2URWko.js +0 -8
- package/dist/client/assets/nl-NL-D5L3ZV4M-BqrV0btt.js +0 -13
- package/dist/client/assets/nn-NO-NNHDGPKB-DK-xZaWM.js +0 -4
- package/dist/client/assets/oc-FR-DWCRF55G-BZ5Po5R6.js +0 -4
- package/dist/client/assets/pa-IN-3JSAY44M-BZQSjKrS.js +0 -4
- package/dist/client/assets/percentages-ETZPVQEE-DFxFqXgH.js +0 -1
- package/dist/client/assets/pl-PL-ACURYKP3-qcEOSfCk.js +0 -12
- package/dist/client/assets/preload-helper-HclGiUj8.js +0 -1
- package/dist/client/assets/preview-render-compiler-CfxJYldJ.js +0 -41
- package/dist/client/assets/preview-render-compiler-Cu8_i9iS.js +0 -1
- package/dist/client/assets/preview-render-worker-c4Yi93qW.js +0 -66
- package/dist/client/assets/prod-BiJL30sl.js +0 -1
- package/dist/client/assets/prod-qAk7rHa4.js +0 -177
- package/dist/client/assets/pt-BR-LOX7MLGD-DLueHSyZ.js +0 -10
- package/dist/client/assets/pt-PT-CZ2U2RFQ-BJ-GAEm6.js +0 -12
- package/dist/client/assets/quick-switcher-controller-BoIK_wuG.js +0 -1
- package/dist/client/assets/ro-RO-2HECL2X6-CJUvKAf0.js +0 -12
- package/dist/client/assets/ru-RU-HAYNXO46-BWSlvTrt.js +0 -10
- package/dist/client/assets/runtime-config-DcmnGcXU.js +0 -1
- package/dist/client/assets/si-LK-W5KNS4H6-DGGCsn7k.js +0 -1
- package/dist/client/assets/sk-SK-7K2CFGDV-CY4uTYgQ.js +0 -7
- package/dist/client/assets/sl-SI-OXV2QZWW-2-weqaBY.js +0 -6
- package/dist/client/assets/stateDiagram-v2-MP3YSRHH-zoLLQVyh.js +0 -1
- package/dist/client/assets/sv-SE-JTOBZRGL-9-IUtVkO.js +0 -12
- package/dist/client/assets/swimlanesDiagram-VR7AAH4N-DS-KQN37.js +0 -8
- package/dist/client/assets/ta-IN-KFAVKXGT-gHO6Q_DH.js +0 -6
- package/dist/client/assets/th-TH-VDMSCPDL-BvJuw6PJ.js +0 -1
- package/dist/client/assets/tr-TR-CEZ6GX45-CG6UU3Su.js +0 -4
- package/dist/client/assets/uk-UA-Q3H3OXQC-CSuIg_DY.js +0 -6
- package/dist/client/assets/uz-UZ-NGCSWWPX-mom7rxSP.js +0 -1
- package/dist/client/assets/vault-api-client-iZLhMJKe.js +0 -6
- package/dist/client/assets/vi-VN-P3NDEVPS-BB0Fu9ck.js +0 -7
- package/dist/client/assets/yjs-provider-reset-guard-9ul1qF6k.js +0 -4
- package/dist/client/assets/zh-CN-SS3O57GA-Bj8wsiMe.js +0 -11
- package/dist/client/assets/zh-HK-LWJT3VCF-DOTquTCh.js +0 -1
- package/dist/client/assets/zh-TW-VJXC72RT-B48PRo-l.js +0 -13
- package/integrations/pi/index.ts +0 -94
- /package/dist/client/assets/{vault-api-client-C3mlS_4N.css → auth-gate-C3mlS_4N.css} +0 -0
- /package/dist/client/assets/{base-BYODPHdS.js → github.min-DBihDoic.js} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { MermaidPreviewHydrator } from './mermaid-preview-hydrator.js';
|
|
2
2
|
import { PlantUmlPreviewHydrator } from './plantuml-preview-hydrator.js';
|
|
3
3
|
import { DiagramChrome } from './diagram-chrome.js';
|
|
4
|
-
import { IDLE_RENDER_TIMEOUT_MS } from './preview-diagram-utils.js';
|
|
5
4
|
import { PreviewRenderExecutor } from './preview-render-executor.js';
|
|
6
5
|
import { isLargeDocumentStats } from './preview-render-profile.js';
|
|
7
6
|
import { PreviewRenderScheduler } from './preview-render-scheduler.js';
|
|
8
7
|
import { resolveApiUrl } from '../domain/runtime-paths.js';
|
|
9
|
-
|
|
10
8
|
export class PreviewRenderer {
|
|
11
9
|
constructor({
|
|
12
10
|
getContent,
|
|
13
11
|
getFileList,
|
|
12
|
+
getPreviewVisible = null,
|
|
14
13
|
getSourceFilePath,
|
|
14
|
+
getTheme = null,
|
|
15
15
|
getWikiLinkAutoCreate = null,
|
|
16
16
|
loadFileSource = null,
|
|
17
17
|
onAfterRenderCommit,
|
|
@@ -26,7 +26,9 @@ export class PreviewRenderer {
|
|
|
26
26
|
}) {
|
|
27
27
|
this.getContent = getContent;
|
|
28
28
|
this.getFileList = getFileList;
|
|
29
|
+
this.getPreviewVisible = getPreviewVisible;
|
|
29
30
|
this.getSourceFilePath = getSourceFilePath;
|
|
31
|
+
this.getTheme = getTheme;
|
|
30
32
|
this.getWikiLinkAutoCreate = getWikiLinkAutoCreate;
|
|
31
33
|
this.loadFileSource = loadFileSource;
|
|
32
34
|
this.onAfterRenderCommit = onAfterRenderCommit;
|
|
@@ -47,6 +49,7 @@ export class PreviewRenderer {
|
|
|
47
49
|
this.isLargeDocument = false;
|
|
48
50
|
this.hydrationPaused = false;
|
|
49
51
|
this.frontmatterCollapsed = false;
|
|
52
|
+
this.previewRenderStale = false;
|
|
50
53
|
|
|
51
54
|
this.handlePreviewClick = (event) => {
|
|
52
55
|
const frontmatterToggle = event.target.closest('.frontmatter-toggle');
|
|
@@ -111,7 +114,6 @@ export class PreviewRenderer {
|
|
|
111
114
|
getFileList: () => this.getFileList?.() ?? [],
|
|
112
115
|
getSourceFilePath: () => this.getSourceFilePath?.() ?? '',
|
|
113
116
|
getWikiLinkAutoCreate: () => this.getWikiLinkAutoCreate?.() ?? true,
|
|
114
|
-
idleTimeoutMs: IDLE_RENDER_TIMEOUT_MS,
|
|
115
117
|
});
|
|
116
118
|
|
|
117
119
|
this.previewElement?.addEventListener('click', this.handlePreviewClick);
|
|
@@ -204,8 +206,25 @@ export class PreviewRenderer {
|
|
|
204
206
|
}
|
|
205
207
|
this.mermaidHydrator.applyTheme(theme);
|
|
206
208
|
}
|
|
209
|
+
markStale() {
|
|
210
|
+
this.previewRenderStale = true;
|
|
211
|
+
this.renderScheduler.cancel();
|
|
212
|
+
}
|
|
207
213
|
|
|
208
214
|
queueRender() {
|
|
215
|
+
if (!(this.getPreviewVisible?.() ?? true)) {
|
|
216
|
+
this.markStale();
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
this.previewRenderStale = false;
|
|
221
|
+
this._deferredPreviewStylesPromise ??= Promise.all([
|
|
222
|
+
import('./highlight-theme.js').then(({ ensureHighlightThemeStylesheet }) => {
|
|
223
|
+
ensureHighlightThemeStylesheet();
|
|
224
|
+
this.applyTheme(this.getTheme?.() ?? 'dark');
|
|
225
|
+
}),
|
|
226
|
+
import('../styles/deferred-preview.css'),
|
|
227
|
+
]);
|
|
209
228
|
const markdownText = this.getContent();
|
|
210
229
|
this.renderScheduler.cancel();
|
|
211
230
|
this.mermaidHydrator.markPending();
|
|
@@ -215,12 +234,13 @@ export class PreviewRenderer {
|
|
|
215
234
|
this.renderScheduler.queue({
|
|
216
235
|
markdownText,
|
|
217
236
|
onRenderRequested: (queuedText, renderVersion) => {
|
|
218
|
-
void this.render(queuedText, renderVersion);
|
|
237
|
+
void this._deferredPreviewStylesPromise.then(() => this.render(queuedText, renderVersion));
|
|
219
238
|
},
|
|
220
239
|
renderVersion: scheduledVersion,
|
|
221
240
|
});
|
|
222
241
|
}
|
|
223
242
|
|
|
243
|
+
|
|
224
244
|
async render(markdownText = this.getContent(), renderVersion = this.pendingRenderVersion) {
|
|
225
245
|
if (!this.previewElement) {
|
|
226
246
|
return;
|
|
@@ -291,9 +311,6 @@ export class PreviewRenderer {
|
|
|
291
311
|
this.updateHydrationPhase();
|
|
292
312
|
}
|
|
293
313
|
|
|
294
|
-
scheduleWorkerPrewarm({ timeout = IDLE_RENDER_TIMEOUT_MS } = {}) {
|
|
295
|
-
this.renderExecutor.schedulePrewarm({ timeout });
|
|
296
|
-
}
|
|
297
314
|
|
|
298
315
|
commitBaseRender({ html, stats }, renderVersion) {
|
|
299
316
|
this.activeRenderVersion = renderVersion;
|
|
@@ -269,6 +269,26 @@ export class WorkspaceCoordinator {
|
|
|
269
269
|
});
|
|
270
270
|
return true;
|
|
271
271
|
}
|
|
272
|
+
let fileOpenReady = false;
|
|
273
|
+
let liveSyncComplete = false;
|
|
274
|
+
const bootstrapPromise = this.loadBootstrapContent
|
|
275
|
+
? (async () => {
|
|
276
|
+
this.reportFileOpenMetric('bootstrap_fetch_started', loadToken);
|
|
277
|
+
try {
|
|
278
|
+
const content = await this.loadBootstrapContent(filePath);
|
|
279
|
+
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
280
|
+
found: content !== null,
|
|
281
|
+
});
|
|
282
|
+
return content;
|
|
283
|
+
} catch (error) {
|
|
284
|
+
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
285
|
+
error: error.message,
|
|
286
|
+
found: false,
|
|
287
|
+
});
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
})()
|
|
291
|
+
: Promise.resolve(null);
|
|
272
292
|
|
|
273
293
|
const EditorSession = await this.loadEditorSessionClass();
|
|
274
294
|
const session = this.createEditorSession(EditorSession, {
|
|
@@ -303,10 +323,7 @@ export class WorkspaceCoordinator {
|
|
|
303
323
|
this.onSessionAssigned?.(session);
|
|
304
324
|
|
|
305
325
|
try {
|
|
306
|
-
let fileOpenReady = false;
|
|
307
326
|
let fileOpenFinalized = false;
|
|
308
|
-
let liveSyncComplete = false;
|
|
309
|
-
|
|
310
327
|
const readySession = async (reason) => {
|
|
311
328
|
if (fileOpenReady || loadToken !== this.stateStore.sessionLoadToken) {
|
|
312
329
|
return;
|
|
@@ -335,24 +352,6 @@ export class WorkspaceCoordinator {
|
|
|
335
352
|
});
|
|
336
353
|
};
|
|
337
354
|
|
|
338
|
-
const bootstrapPromise = this.loadBootstrapContent
|
|
339
|
-
? (async () => {
|
|
340
|
-
this.reportFileOpenMetric('bootstrap_fetch_started', loadToken);
|
|
341
|
-
try {
|
|
342
|
-
const content = await this.loadBootstrapContent(filePath);
|
|
343
|
-
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
344
|
-
found: content !== null,
|
|
345
|
-
});
|
|
346
|
-
return content;
|
|
347
|
-
} catch (error) {
|
|
348
|
-
this.reportFileOpenMetric('bootstrap_fetch_completed', loadToken, {
|
|
349
|
-
error: error.message,
|
|
350
|
-
found: false,
|
|
351
|
-
});
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
})()
|
|
355
|
-
: Promise.resolve(null);
|
|
356
355
|
|
|
357
356
|
const initializePromise = session.initialize(filePath);
|
|
358
357
|
const liveSyncPromise = (async () => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PdfPreviewController } from '../application/pdf-preview-controller.js';
|
|
2
|
+
import { analyzeMarkdownComplexity, isLargeDocumentStats } from '../application/preview-render-profile.js';
|
|
2
3
|
import { PreviewRenderer } from '../application/preview-renderer.js';
|
|
3
4
|
import { renderWebMcpDiagram } from '../application/webmcp-diagram-renderer.js';
|
|
4
5
|
import { ensureQuickSwitcherInstance, toggleQuickSwitcherInstance } from '../application/quick-switcher-loader.js';
|
|
@@ -19,15 +20,18 @@ import { uiFeatureSidebarMethods } from '../application/app-shell/ui-feature-sid
|
|
|
19
20
|
import { uiFeatureTabActivityMethods } from '../application/app-shell/ui-feature-tab-activity.js';
|
|
20
21
|
import { uiFeatureToolbarMethods } from '../application/app-shell/ui-feature-toolbar.js';
|
|
21
22
|
import { workspaceFeature } from '../application/app-shell/workspace-feature.js';
|
|
23
|
+
import { LOBBY_CHAT_MESSAGE_MAX_LENGTH } from '../domain/lobby-chat.js';
|
|
22
24
|
import { agentConnectionApiClient } from '../infrastructure/agent-connection-api-client.js';
|
|
23
|
-
import { LOBBY_CHAT_MESSAGE_MAX_LENGTH, LobbyPresence } from '../infrastructure/lobby-presence.js';
|
|
24
25
|
import { BrowserPreferencesPort } from '../infrastructure/browser-preferences-port.js';
|
|
26
|
+
import { hostedApiClient } from '../infrastructure/hosted-api-client.js';
|
|
25
27
|
import { BrowserNotificationPort } from '../infrastructure/browser-notification-port.js';
|
|
26
28
|
import { AppVersionMonitor } from '../infrastructure/app-version-monitor.js';
|
|
27
29
|
import { gitApiClient } from '../infrastructure/git-api-client.js';
|
|
28
30
|
import {
|
|
31
|
+
getActiveVaultId,
|
|
29
32
|
getHashRoute,
|
|
30
33
|
getRuntimeConfig,
|
|
34
|
+
setActiveVaultId,
|
|
31
35
|
navigateToFile,
|
|
32
36
|
navigateToGitCommit,
|
|
33
37
|
navigateToGitDiff,
|
|
@@ -38,9 +42,11 @@ import {
|
|
|
38
42
|
import { TabActivityLock } from '../infrastructure/tab-activity-lock.js';
|
|
39
43
|
import { vaultApiClient } from '../infrastructure/vault-api-client.js';
|
|
40
44
|
import { WebMcpToolRegistry } from '../infrastructure/webmcp-tool-registry.js';
|
|
41
|
-
import {
|
|
45
|
+
import { createLazyLobbyPresence, createLazyWorkspaceSyncClient } from './lazy-collab-clients.js';
|
|
42
46
|
import { AgentConnectionController } from '../presentation/agent-connection-controller.js';
|
|
43
47
|
import { BacklinksPanel } from '../presentation/backlinks-panel.js';
|
|
48
|
+
import { HostedWorkspaceGateController } from '../presentation/hosted-workspace-gate-controller.js';
|
|
49
|
+
import { TeamSettingsController } from '../presentation/team-settings-controller.js';
|
|
44
50
|
import { CommentOverviewController } from '../presentation/comment-overview-controller.js';
|
|
45
51
|
import { CommentUiController } from '../presentation/comment-ui-controller.js';
|
|
46
52
|
import { FileExplorerController } from '../presentation/file-explorer-controller.js';
|
|
@@ -152,12 +158,12 @@ export class CollabMdAppShell {
|
|
|
152
158
|
runtimeConfig: this.runtimeConfig,
|
|
153
159
|
});
|
|
154
160
|
|
|
155
|
-
this.lobby =
|
|
161
|
+
this.lobby = createLazyLobbyPresence({
|
|
156
162
|
preferredUserName: this.getStoredUserName(),
|
|
157
163
|
onChange: (users) => this.updateGlobalUsers(users),
|
|
158
164
|
onChatChange: (messages, meta) => this.updateChatMessages(messages, meta),
|
|
159
165
|
});
|
|
160
|
-
this.workspaceSync =
|
|
166
|
+
this.workspaceSync = createLazyWorkspaceSyncClient({
|
|
161
167
|
onTreeChange: (tree, metadata = {}) => {
|
|
162
168
|
this.fileExplorer.setTree(tree, metadata);
|
|
163
169
|
this.handleCommentOverviewWorkspaceTreeChange?.();
|
|
@@ -179,6 +185,21 @@ export class CollabMdAppShell {
|
|
|
179
185
|
toastController: this.toastController,
|
|
180
186
|
trigger: this.elements.connectAgentButton,
|
|
181
187
|
});
|
|
188
|
+
this.teamSettingsController = new TeamSettingsController({
|
|
189
|
+
apiClient: hostedApiClient,
|
|
190
|
+
closeToolbarMenu: () => this.closeToolbarOverflowMenu(),
|
|
191
|
+
content: this.elements.teamSettingsContent,
|
|
192
|
+
dialog: this.elements.teamSettingsDialog,
|
|
193
|
+
toastController: this.toastController,
|
|
194
|
+
trigger: this.elements.teamSettingsButton,
|
|
195
|
+
});
|
|
196
|
+
this.hostedGateController = new HostedWorkspaceGateController({
|
|
197
|
+
apiClient: hostedApiClient,
|
|
198
|
+
appRoot: this.elements.appShell,
|
|
199
|
+
gate: this.elements.hostedGate,
|
|
200
|
+
runtimeConfig: this.runtimeConfig,
|
|
201
|
+
teamSettingsController: this.teamSettingsController,
|
|
202
|
+
});
|
|
182
203
|
const callAgentTool = (...args) => this.vaultApiClient.callAgentTool(...args);
|
|
183
204
|
this.webMcpTools = new WebMcpToolRegistry({
|
|
184
205
|
acknowledgeToolCall: ({ input, name, preparation, result, signal }) => {
|
|
@@ -216,7 +237,6 @@ export class CollabMdAppShell {
|
|
|
216
237
|
'edit_excalidraw',
|
|
217
238
|
'inspect_excalidraw',
|
|
218
239
|
'read_document',
|
|
219
|
-
'render_excalidraw',
|
|
220
240
|
'verify_excalidraw',
|
|
221
241
|
].includes(name)
|
|
222
242
|
|| input.path !== this.currentFilePath
|
|
@@ -244,6 +264,18 @@ export class CollabMdAppShell {
|
|
|
244
264
|
showFileExtensions: this.preferences.getFileTreeShowExtensions(),
|
|
245
265
|
toastController: this.toastController,
|
|
246
266
|
vaultClient: this.vaultApiClient,
|
|
267
|
+
// ponytail: reload keeps the file hash, so the same path reopens in the new vault
|
|
268
|
+
vaultSwitcher: {
|
|
269
|
+
activeVaultId: getActiveVaultId(this.runtimeConfig),
|
|
270
|
+
vaults: this.runtimeConfig.vaults ?? [],
|
|
271
|
+
onVaultSelect: (vaultId) => {
|
|
272
|
+
if (!vaultId || vaultId === getActiveVaultId(this.runtimeConfig)) {
|
|
273
|
+
return;
|
|
274
|
+
}
|
|
275
|
+
setActiveVaultId(vaultId);
|
|
276
|
+
window.location.reload();
|
|
277
|
+
},
|
|
278
|
+
},
|
|
247
279
|
});
|
|
248
280
|
this.commentsOverview = new CommentOverviewController({
|
|
249
281
|
onOverviewChange: (_overview, { threadCounts }) => {
|
|
@@ -308,6 +340,11 @@ export class CollabMdAppShell {
|
|
|
308
340
|
this.previewRenderer = new PreviewRenderer({
|
|
309
341
|
getContent: () => this.getPreviewSource(),
|
|
310
342
|
getFileList: () => this.fileExplorer.flatDocumentFiles,
|
|
343
|
+
getPreviewVisible: () => (
|
|
344
|
+
Boolean(this._staticPreviewDocument)
|
|
345
|
+
|| this.layoutController?.currentView !== 'editor'
|
|
346
|
+
),
|
|
347
|
+
getTheme: () => this.themeController?.getTheme?.() ?? 'dark',
|
|
311
348
|
getWikiLinkAutoCreate: () => this.runtimeConfig.wikiLinkAutoCreate !== false,
|
|
312
349
|
loadFileSource: async (filePath) => {
|
|
313
350
|
const payload = await this.vaultApiClient.readFile(filePath);
|
|
@@ -324,10 +361,10 @@ export class CollabMdAppShell {
|
|
|
324
361
|
this.drawioEmbed.reconcileEmbeds(this.elements.previewContent);
|
|
325
362
|
this.excalidrawEmbed.reconcileEmbeds(this.elements.previewContent, { isLargeDocument: stats.isLargeDocument });
|
|
326
363
|
this.scrollSyncController.setLargeDocumentMode(stats.isLargeDocument);
|
|
327
|
-
this.syncPreviewCodeCopyButtons();
|
|
328
364
|
this.syncPreviewHeadingFoldButtons();
|
|
329
365
|
this.syncPreviewHeadingLinkButtons();
|
|
330
366
|
this.applyPendingPreviewRouteAnchor({ behavior: 'auto', clearMissing: true });
|
|
367
|
+
|
|
331
368
|
this.schedulePreviewLayoutSync({ delayMs: 0 });
|
|
332
369
|
this.refreshCommentUiLayout();
|
|
333
370
|
},
|
|
@@ -342,11 +379,6 @@ export class CollabMdAppShell {
|
|
|
342
379
|
this.schedulePreviewLayoutSync({ delayMs: 0 });
|
|
343
380
|
this.refreshCommentUiLayout();
|
|
344
381
|
},
|
|
345
|
-
onRenderComplete: () => {
|
|
346
|
-
this.applyPendingPreviewRouteAnchor({ allowExpired: true, behavior: 'auto', clearMissing: true });
|
|
347
|
-
this.schedulePreviewLayoutSync({ delayMs: 0 });
|
|
348
|
-
this.refreshCommentUiLayout();
|
|
349
|
-
},
|
|
350
382
|
outlineController: this.outlineController,
|
|
351
383
|
plantUmlRenderClient: this.vaultApiClient,
|
|
352
384
|
previewContainer: this.elements.previewContainer,
|
|
@@ -355,8 +387,16 @@ export class CollabMdAppShell {
|
|
|
355
387
|
});
|
|
356
388
|
this.themeController = new ThemeController({ onChange: (theme) => this.handleThemeChange(theme) });
|
|
357
389
|
this.layoutController = new LayoutController({
|
|
390
|
+
preferredView: this.preferences.getViewMode() || 'split',
|
|
358
391
|
mobileBreakpointQuery: this.mobileBreakpointQuery,
|
|
359
392
|
onMeasureEditor: () => this.session?.requestMeasure(),
|
|
393
|
+
onPreferredViewChange: (view) => this.preferences.setViewMode(view),
|
|
394
|
+
onViewChange: () => {
|
|
395
|
+
if (!this.currentFilePath && !this._staticPreviewDocument) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
this.previewRenderer.queueRender();
|
|
399
|
+
},
|
|
360
400
|
onViewRequest: (view) => this.handleLayoutViewRequest(view),
|
|
361
401
|
});
|
|
362
402
|
this.scrollSyncController = new ScrollSyncController({
|
|
@@ -416,7 +456,10 @@ export class CollabMdAppShell {
|
|
|
416
456
|
commentsDrawerList: this.elements.commentsDrawerList,
|
|
417
457
|
commentsToggleButton: this.elements.commentsToggleButton,
|
|
418
458
|
editorContainer: this.elements.editorContainer,
|
|
419
|
-
onWillOpenDrawer: () =>
|
|
459
|
+
onWillOpenDrawer: () => {
|
|
460
|
+
this._deferredCollabStylesPromise ??= import('../styles/deferred-collab.css');
|
|
461
|
+
this.outlineController.close();
|
|
462
|
+
},
|
|
420
463
|
previewContainer: this.elements.previewContainer,
|
|
421
464
|
previewElement: this.elements.previewContent,
|
|
422
465
|
onCreateThread: ({ anchor, body }) => this.createCommentThread({ anchor, body }),
|
|
@@ -569,6 +612,7 @@ export class CollabMdAppShell {
|
|
|
569
612
|
onBeforeFileOpen: () => {
|
|
570
613
|
clearTimeout(this._basePreviewRenderTimer);
|
|
571
614
|
this._basePreviewRenderTimer = null;
|
|
615
|
+
this.connectWorkspaceSync?.();
|
|
572
616
|
this.session = null;
|
|
573
617
|
this.commentUi.attachSession(null);
|
|
574
618
|
this.layoutController.reset();
|
|
@@ -579,7 +623,7 @@ export class CollabMdAppShell {
|
|
|
579
623
|
this.clearInitialFileBootstrap();
|
|
580
624
|
},
|
|
581
625
|
onConnectionChange: (state) => this.handleConnectionChange(state),
|
|
582
|
-
onContentChange: ({ isBase, isHtml,
|
|
626
|
+
onContentChange: ({ isBase, isHtml, isStructurizrWorkspace }) => {
|
|
583
627
|
void this.webMcpTools.refresh();
|
|
584
628
|
this.handleCommentEditorContentChange();
|
|
585
629
|
if (isHtml) {
|
|
@@ -604,10 +648,16 @@ export class CollabMdAppShell {
|
|
|
604
648
|
return;
|
|
605
649
|
}
|
|
606
650
|
|
|
607
|
-
this.
|
|
608
|
-
if (
|
|
609
|
-
this.
|
|
651
|
+
const markdownText = this.session?.getText?.() ?? '';
|
|
652
|
+
if (
|
|
653
|
+
!this.preferences.getViewMode()
|
|
654
|
+
&& this.layoutController.currentView === 'split'
|
|
655
|
+
&& isLargeDocumentStats(analyzeMarkdownComplexity(markdownText))
|
|
656
|
+
) {
|
|
657
|
+
this.layoutController.setView('editor', { persist: false });
|
|
610
658
|
}
|
|
659
|
+
|
|
660
|
+
this.previewRenderer.queueRender();
|
|
611
661
|
},
|
|
612
662
|
onCommentsChange: (threads) => this.handleCommentThreadsChange(threads),
|
|
613
663
|
onFileAwarenessChange: (users) => this.updateFileAwareness(users),
|
|
@@ -782,29 +832,15 @@ export class CollabMdAppShell {
|
|
|
782
832
|
return this._editorSessionModulePromise;
|
|
783
833
|
}
|
|
784
834
|
|
|
785
|
-
scheduleEditorSessionPrewarm({ timeout = 1500 } = {}) {
|
|
786
|
-
if (this._editorSessionModulePromise || this._editorSessionPrewarmHandle) {
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
const runPrewarm = () => {
|
|
791
|
-
this._editorSessionPrewarmHandle = null;
|
|
792
|
-
void this.loadEditorSessionClass();
|
|
793
|
-
};
|
|
794
|
-
|
|
795
|
-
if (typeof window.requestIdleCallback === 'function') {
|
|
796
|
-
this._editorSessionPrewarmHandle = window.requestIdleCallback(runPrewarm, { timeout });
|
|
797
|
-
return;
|
|
798
|
-
}
|
|
799
|
-
|
|
800
|
-
this._editorSessionPrewarmHandle = window.setTimeout(runPrewarm, 0);
|
|
801
|
-
}
|
|
802
835
|
|
|
803
836
|
loadQuickSwitcherController() {
|
|
804
|
-
return
|
|
805
|
-
|
|
837
|
+
return Promise.all([
|
|
838
|
+
import('../presentation/quick-switcher-controller.js'),
|
|
839
|
+
import('../styles/features/quick-switcher.css'),
|
|
840
|
+
]).then(([module]) => module.QuickSwitcherController);
|
|
806
841
|
}
|
|
807
842
|
|
|
843
|
+
|
|
808
844
|
async ensureQuickSwitcher() {
|
|
809
845
|
return ensureQuickSwitcherInstance(this);
|
|
810
846
|
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { createRandomUser } from '../domain/room.js';
|
|
2
|
+
|
|
3
|
+
function createLazyClient(load) {
|
|
4
|
+
let impl = null;
|
|
5
|
+
let loadPromise = null;
|
|
6
|
+
|
|
7
|
+
function ensure() {
|
|
8
|
+
loadPromise ??= Promise.resolve().then(load).then((created) => {
|
|
9
|
+
impl = created;
|
|
10
|
+
return created;
|
|
11
|
+
});
|
|
12
|
+
return loadPromise;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return {
|
|
16
|
+
ensure,
|
|
17
|
+
getImpl: () => impl,
|
|
18
|
+
get provider() {
|
|
19
|
+
return impl?.provider ?? null;
|
|
20
|
+
},
|
|
21
|
+
connect() {
|
|
22
|
+
void ensure().then((client) => {
|
|
23
|
+
client.connect();
|
|
24
|
+
});
|
|
25
|
+
},
|
|
26
|
+
disconnect() {
|
|
27
|
+
impl?.disconnect();
|
|
28
|
+
},
|
|
29
|
+
destroy() {
|
|
30
|
+
impl?.destroy();
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function createLazyLobbyPresence(options = {}) {
|
|
36
|
+
let currentFile = null;
|
|
37
|
+
let localUser = createRandomUser(options.preferredUserName);
|
|
38
|
+
const client = createLazyClient(async () => {
|
|
39
|
+
const { LobbyPresence } = await import('../infrastructure/lobby-presence.js');
|
|
40
|
+
const impl = new LobbyPresence({
|
|
41
|
+
...options,
|
|
42
|
+
preferredUserName: localUser.name,
|
|
43
|
+
});
|
|
44
|
+
impl.localUser = localUser;
|
|
45
|
+
if (currentFile) {
|
|
46
|
+
impl.setCurrentFile(currentFile);
|
|
47
|
+
}
|
|
48
|
+
return impl;
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
get provider() {
|
|
53
|
+
return client.provider;
|
|
54
|
+
},
|
|
55
|
+
connect: () => client.connect(),
|
|
56
|
+
disconnect: () => client.disconnect(),
|
|
57
|
+
destroy: () => client.destroy(),
|
|
58
|
+
getConnectionState() {
|
|
59
|
+
return client.getImpl()?.getConnectionState?.()
|
|
60
|
+
?? { status: 'connecting', unreachable: false };
|
|
61
|
+
},
|
|
62
|
+
setCurrentFile(filePath) {
|
|
63
|
+
currentFile = filePath;
|
|
64
|
+
client.getImpl()?.setCurrentFile(filePath);
|
|
65
|
+
},
|
|
66
|
+
setUserName(name) {
|
|
67
|
+
if (!name) {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
localUser = { ...localUser, name };
|
|
71
|
+
client.getImpl()?.setUserName(name);
|
|
72
|
+
},
|
|
73
|
+
getLocalUser() {
|
|
74
|
+
return client.getImpl()?.getLocalUser() ?? localUser;
|
|
75
|
+
},
|
|
76
|
+
sendChatMessage(text) {
|
|
77
|
+
return client.getImpl()?.sendChatMessage(text) ?? null;
|
|
78
|
+
},
|
|
79
|
+
sendWorkspaceEvent(payload) {
|
|
80
|
+
return client.getImpl()?.sendWorkspaceEvent(payload);
|
|
81
|
+
},
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function createLazyWorkspaceSyncClient(options = {}) {
|
|
86
|
+
return createLazyClient(async () => {
|
|
87
|
+
const { WorkspaceSyncClient } = await import('../infrastructure/workspace-sync-client.js');
|
|
88
|
+
return new WorkspaceSyncClient(options);
|
|
89
|
+
});
|
|
90
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export function buildReconciledExcalidrawSceneUpdate({
|
|
2
2
|
appStateOverrides = {},
|
|
3
|
+
authoritative = false,
|
|
3
4
|
currentAppState,
|
|
4
5
|
currentElements = [],
|
|
5
6
|
documentViewState = {},
|
|
@@ -10,7 +11,7 @@ export function buildReconciledExcalidrawSceneUpdate({
|
|
|
10
11
|
scene,
|
|
11
12
|
theme = 'dark',
|
|
12
13
|
} = {}) {
|
|
13
|
-
const restoredElements = restoreElementsFn(scene?.elements || [], currentElements, {
|
|
14
|
+
const restoredElements = restoreElementsFn(scene?.elements || [], authoritative ? [] : currentElements, {
|
|
14
15
|
repairBindings: true,
|
|
15
16
|
});
|
|
16
17
|
const restoredAppState = restoreAppStateFn(scene?.appState || {}, currentAppState);
|
|
@@ -27,7 +28,9 @@ export function buildReconciledExcalidrawSceneUpdate({
|
|
|
27
28
|
)),
|
|
28
29
|
);
|
|
29
30
|
const update = {
|
|
30
|
-
elements:
|
|
31
|
+
elements: authoritative
|
|
32
|
+
? restoredElements
|
|
33
|
+
: reconcileElementsFn(currentElements, restoredElements, currentAppState),
|
|
31
34
|
};
|
|
32
35
|
|
|
33
36
|
if (Object.keys(appStateUpdate).length > 0) {
|
|
@@ -9,6 +9,11 @@ export const HASH_ROUTE_KEYS = Object.freeze({
|
|
|
9
9
|
gitHistory: 'git-history',
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
+
export function isGitHashRouteType(type) {
|
|
13
|
+
return String(type ?? '').startsWith('git-');
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
12
17
|
export function getHashParamsFromRaw(hash = '') {
|
|
13
18
|
const rawHash = String(hash ?? '');
|
|
14
19
|
const normalizedHash = rawHash.startsWith('#')
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import hljs from 'highlight.js/lib/core';
|
|
2
|
+
import bash from 'highlight.js/lib/languages/bash';
|
|
3
|
+
import css from 'highlight.js/lib/languages/css';
|
|
4
|
+
import javascript from 'highlight.js/lib/languages/javascript';
|
|
5
|
+
import json from 'highlight.js/lib/languages/json';
|
|
6
|
+
import markdown from 'highlight.js/lib/languages/markdown';
|
|
7
|
+
import python from 'highlight.js/lib/languages/python';
|
|
8
|
+
import sql from 'highlight.js/lib/languages/sql';
|
|
9
|
+
import typescript from 'highlight.js/lib/languages/typescript';
|
|
10
|
+
import xml from 'highlight.js/lib/languages/xml';
|
|
11
|
+
import yaml from 'highlight.js/lib/languages/yaml';
|
|
12
|
+
|
|
13
|
+
export const AUTO_HIGHLIGHT_LANGUAGES = [
|
|
14
|
+
'bash',
|
|
15
|
+
'css',
|
|
16
|
+
'javascript',
|
|
17
|
+
'json',
|
|
18
|
+
'markdown',
|
|
19
|
+
'python',
|
|
20
|
+
'sql',
|
|
21
|
+
'typescript',
|
|
22
|
+
'xml',
|
|
23
|
+
'yaml',
|
|
24
|
+
];
|
|
25
|
+
|
|
26
|
+
hljs.registerLanguage('bash', bash);
|
|
27
|
+
hljs.registerLanguage('css', css);
|
|
28
|
+
hljs.registerLanguage('javascript', javascript);
|
|
29
|
+
hljs.registerLanguage('json', json);
|
|
30
|
+
hljs.registerLanguage('markdown', markdown);
|
|
31
|
+
hljs.registerLanguage('python', python);
|
|
32
|
+
hljs.registerLanguage('sql', sql);
|
|
33
|
+
hljs.registerLanguage('typescript', typescript);
|
|
34
|
+
hljs.registerLanguage('xml', xml);
|
|
35
|
+
hljs.registerLanguage('yaml', yaml);
|
|
36
|
+
hljs.registerAliases(['cql', 'mariadb', 'mssql', 'mysql', 'plsql', 'sqlite'], { languageName: 'sql' });
|
|
37
|
+
hljs.registerAliases(['ecmascript', 'node'], { languageName: 'javascript' });
|
|
38
|
+
|
|
39
|
+
export { hljs };
|
|
40
|
+
|
|
41
|
+
export function highlightFence(source, language, { ignoreIllegals = false } = {}) {
|
|
42
|
+
if (language && hljs.getLanguage(language)) {
|
|
43
|
+
return hljs.highlight(source, { ignoreIllegals, language }).value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return hljs.highlightAuto(source, AUTO_HIGHLIGHT_LANGUAGES).value;
|
|
47
|
+
}
|
|
@@ -58,8 +58,48 @@ function applyBasePath(basePath, pathValue) {
|
|
|
58
58
|
return normalizedBasePath ? `${normalizedBasePath}/${normalizedPath}` : `/${normalizedPath}`;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
export const ACTIVE_VAULT_STORAGE_KEY = 'collabmd.activeVault';
|
|
62
|
+
|
|
63
|
+
// ponytail: agent/hosted/auth/plantuml/structurizr/test stay global; everything else is vault-scoped
|
|
64
|
+
const VAULT_UNSCOPED_API_PATHS = ['/auth/', '/hosted/', '/agent/', '/test/', '/plantuml/', '/structurizr/'];
|
|
65
|
+
|
|
66
|
+
function isVaultScopedApiPath(pathname) {
|
|
67
|
+
if (pathname === '/api' || pathname === '/api/' || pathname === '/api/vaults') {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const sub = pathname.startsWith('/api/') ? pathname.slice('/api'.length) : pathname;
|
|
71
|
+
return !VAULT_UNSCOPED_API_PATHS.some((prefix) => sub === prefix.slice(0, -1) || sub.startsWith(prefix));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function getActiveVaultId(config = getClientRuntimeConfig()) {
|
|
75
|
+
const vaults = Array.isArray(config?.vaults) ? config.vaults.map((vault) => vault?.id).filter(Boolean) : [];
|
|
76
|
+
if (vaults.length === 0) {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const stored = globalThis.window?.localStorage?.getItem(ACTIVE_VAULT_STORAGE_KEY);
|
|
81
|
+
if (stored && vaults.includes(stored)) {
|
|
82
|
+
return stored;
|
|
83
|
+
}
|
|
84
|
+
} catch {
|
|
85
|
+
// Ignore storage failures and fall back to the server default.
|
|
86
|
+
}
|
|
87
|
+
if (config?.activeVault && vaults.includes(config.activeVault)) {
|
|
88
|
+
return config.activeVault;
|
|
89
|
+
}
|
|
90
|
+
return vaults[0] ?? null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function setActiveVaultId(vaultId) {
|
|
94
|
+
try {
|
|
95
|
+
globalThis.window?.localStorage?.setItem(ACTIVE_VAULT_STORAGE_KEY, String(vaultId ?? ''));
|
|
96
|
+
} catch {
|
|
97
|
+
// Ignore storage failures; the server default still applies.
|
|
98
|
+
}
|
|
99
|
+
}
|
|
61
100
|
export function getClientRuntimeConfig() {
|
|
62
101
|
const rawConfig = {
|
|
102
|
+
activeVault: '',
|
|
63
103
|
agentAccess: {
|
|
64
104
|
enabled: false,
|
|
65
105
|
endpoint: '',
|
|
@@ -92,6 +132,7 @@ export function getClientRuntimeConfig() {
|
|
|
92
132
|
version: '',
|
|
93
133
|
},
|
|
94
134
|
structurizrEnabled: false,
|
|
135
|
+
vaults: [],
|
|
95
136
|
wikiLinkAutoCreate: true,
|
|
96
137
|
wsBasePath: '/ws',
|
|
97
138
|
...(window.__COLLABMD_CONFIG__ ?? {}),
|
|
@@ -142,11 +183,17 @@ export function resolveApiUrl(pathValue = '/', config = getClientRuntimeConfig()
|
|
|
142
183
|
return resolveAppPath('/api', config);
|
|
143
184
|
}
|
|
144
185
|
|
|
145
|
-
|
|
146
|
-
|
|
186
|
+
const apiPath = normalizedPath.startsWith('/api')
|
|
187
|
+
? normalizedPath
|
|
188
|
+
: `/api${normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`}`;
|
|
189
|
+
const queryIndex = apiPath.indexOf('?');
|
|
190
|
+
const pathname = queryIndex === -1 ? apiPath : apiPath.slice(0, queryIndex);
|
|
191
|
+
const query = queryIndex === -1 ? '' : apiPath.slice(queryIndex);
|
|
192
|
+
const vaultId = getActiveVaultId(config);
|
|
193
|
+
if (vaultId && isVaultScopedApiPath(pathname)) {
|
|
194
|
+
return resolveAppPath(`/api/v/${vaultId}${pathname.slice('/api'.length)}${query}`, config);
|
|
147
195
|
}
|
|
148
|
-
|
|
149
|
-
return resolveAppPath(`/api${normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`}`, config);
|
|
196
|
+
return resolveAppPath(`${pathname}${query}`, config);
|
|
150
197
|
}
|
|
151
198
|
|
|
152
199
|
export function resolveWsServerOverride(config = getClientRuntimeConfig()) {
|
|
@@ -172,15 +219,17 @@ export function resolveWsServerOverride(config = getClientRuntimeConfig()) {
|
|
|
172
219
|
}
|
|
173
220
|
|
|
174
221
|
export function resolveWsBaseUrl(config = getClientRuntimeConfig()) {
|
|
222
|
+
const vaultId = getActiveVaultId(config);
|
|
223
|
+
const vaultSuffix = vaultId ? `/v/${vaultId}` : '';
|
|
175
224
|
const serverOverride = resolveWsServerOverride(config);
|
|
176
225
|
if (serverOverride) {
|
|
177
|
-
return serverOverride
|
|
226
|
+
return `${serverOverride}${vaultSuffix}`;
|
|
178
227
|
}
|
|
179
228
|
|
|
180
229
|
if (config.publicWsBaseUrl) {
|
|
181
|
-
return trimTrailingSlash(config.publicWsBaseUrl)
|
|
230
|
+
return `${trimTrailingSlash(config.publicWsBaseUrl)}${vaultSuffix}`;
|
|
182
231
|
}
|
|
183
232
|
|
|
184
233
|
const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:';
|
|
185
|
-
return `${protocol}//${window.location.host}${resolveAppPath(config.wsBasePath
|
|
234
|
+
return `${protocol}//${window.location.host}${resolveAppPath(`${config.wsBasePath}${vaultSuffix}`, config)}`;
|
|
186
235
|
}
|