collabmd 0.1.48 → 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 +15 -608
- package/bin/collabmd.js +39 -20
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-Crf9Y3Q6.js +1 -0
- package/dist/client/assets/abnfDiagram-VCTEODGH-PuinKbSQ.js +1 -0
- package/dist/client/assets/ar-SA-5WIASEJP-Di7OimCN.js +10 -0
- package/dist/client/assets/{architectureDiagram-5GKGNRK7-I39sYjHI.js → architectureDiagram-5GKGNRK7-46hPkrZv.js} +3 -3
- 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-NRAW4CY4-C6DtJy5Y.js → blockDiagram-I7D4REHJ-C1S5Bzf8.js} +4 -4
- 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/browser-utils-DbXSMI-6.js +1 -0
- package/dist/client/assets/{c4Diagram-UCG6FXSJ-CtWtxS9_.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-TEH6E4GO-DVayPj-q.js → chunk-4HAMMTFA-Ht-73lsT.js} +20 -20
- package/dist/client/assets/chunk-5XKZK2GL-D4UAZSOJ.js +1 -0
- package/dist/client/assets/{chunk-75Z2AOVW-CdFSaPjz.js → chunk-75Z2AOVW-B2cZexqK.js} +1 -1
- package/dist/client/assets/{chunk-CLGD4ZFX-DQLgbQrv.js → chunk-CLGD4ZFX-Cmtx89ht.js} +1 -1
- package/dist/client/assets/chunk-DU6HZSFF-C6d6PJfE.js +127 -0
- package/dist/client/assets/{chunk-F27PBJKO-CNHIFhjo.js → chunk-F27PBJKO-Dg3H6KLL.js} +1 -1
- package/dist/client/assets/{chunk-GMAD6QVW-CbcBqPM5.js → chunk-GMAD6QVW-DUfjx_d5.js} +1 -1
- package/dist/client/assets/{chunk-OBVCFTLP-BJR7u1jh.js → chunk-GVQU2GXP-D1l7oRGR.js} +1 -1
- package/dist/client/assets/{chunk-G27WJ6UU-D9-eg537.js → chunk-IMKFNOWR-3F6NhHUP.js} +2 -2
- package/dist/client/assets/{chunk-JQ64N6SF-DSFNH4bh.js → chunk-L3NEJ4N5-BmCVn4y-.js} +1 -1
- package/dist/client/assets/chunk-OSK3NFVY-CWHXAmfx.js +10 -0
- package/dist/client/assets/{chunk-P2QGCYS3-BRpqY32H.js → chunk-P2QGCYS3-Du8EtwOa.js} +1 -1
- package/dist/client/assets/{chunk-POPQ4Y6H-Cb4SlVZF.js → chunk-POPQ4Y6H-B5yJIrZE.js} +1 -1
- package/dist/client/assets/{chunk-PWAF6VOD-Cz8IwBB5.js → chunk-PWAF6VOD-B3gML4ps.js} +1 -1
- package/dist/client/assets/{chunk-RHFEMEQ7-CWY8cf4H.js → chunk-SHT3W25Y-BKaI8jZO.js} +5 -5
- package/dist/client/assets/{chunk-SVP7TREG-CyHOmcac.js → chunk-SVP7TREG-XlsB_ZMZ.js} +1 -1
- package/dist/client/assets/{chunk-LCL6LL3I-DmDkVukh.js → chunk-TICWLB2K-Cpp2z8yK.js} +4 -4
- 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-CdTPi2yO.js → cynefinDiagram-5FMLGOSQ-BRoCEoZM.js} +1 -1
- package/dist/client/assets/da-DK-NNDP2IVP-DBw9ZNTR.js +2 -0
- package/dist/client/assets/{dagre-3AP2YEHR-5gtJtd0O.js → dagre-GXQ25YYZ-BSfKCfy7.js} +2 -2
- 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-BudWz9WU.js → diagram-S7CK7UJ4-D7KaM9yj.js} +2 -2
- package/dist/client/assets/{diagram-UQ7AKVKN-3v4rbH-s.js → diagram-UQ7AKVKN-JevUZuYi.js} +1 -1
- package/dist/client/assets/diagram-VSXAHHWV-B3-U-Q2E.js +3 -0
- package/dist/client/assets/{diagram-VX7I27RA-C_-rj0sw.js → diagram-VX7I27RA-pSD4HMh1.js} +1 -1
- package/dist/client/assets/{diagram-Z3DM3KII-B4yxavgj.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-Bw3VIE_v.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-CietwTVS.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-DDUn5zTz.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-B_yQaEv_.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-l-56SowH.js +19 -0
- 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-Dxl_a8XO.js → document-formatter-Qdiq9uJs.js} +1 -2
- package/dist/client/assets/drawioEditor-CHf1vtdQ.js +9 -0
- package/dist/client/assets/ebnfDiagram-PWID7BFC-UJ0Fz5ci.js +1 -0
- 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-SSCWMZ5O-C-iy6VkX.js → erDiagram-RLTQ6QDP-CWrH1UJ9.js} +2 -2
- 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/{excalidraw-scene-BOben2gr.js → excalidraw-scene-6uROebca.js} +1 -1
- package/dist/client/assets/{excalidraw-editor-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-DtKHAbez.js → ganttDiagram-EL5Y4UJY-BBNzDfaV.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-WWUBYQGX-oue8fQ5o.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-RXCK75RN-BMzo6KIn.js → infoDiagram-27XIBGKW-Bzy6kCbb.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-5VMMS53U-BIM3h287.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-EYS64GPL-mF6Lh8O-.js → journeyDiagram-3NMN7TZE-D4ZR_s9J.js} +2 -2
- 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-3QL26DDD-DLN2NyoR.js → kanban-definition-UXKFOSKX-CIDTmu5g.js} +4 -4
- 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-BfTWJmgf.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-D0cMM4Rl.js +10 -0
- package/dist/client/assets/{mindmap-definition-FBJOCRG2-CRyHaHTk.js → mindmap-definition-YA3MSWOX-DO8NB9VH.js} +8 -8
- 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-DS6Ab21R.js +1 -0
- package/dist/client/assets/percentages-Q7USCRWZ-DWE6uvTs.js +1 -0
- package/dist/client/assets/{pieDiagram-E7YTZNPT-B5OZPb88.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-Drrw14YH.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-CUQKqbCK.js +1 -0
- package/dist/client/assets/{requirementDiagram-EFPCY7ZU-CRZG6mRB.js → requirementDiagram-BXWQKSXE-Balm0WW8.js} +2 -2
- 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-DvarEJpo.js → sankeyDiagram-P5KCCOFB-CcbMqrlQ.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-WJ2MYXX4-B4oWlb-w.js → sequenceDiagram-WJ2MYXX4-BL1j3Sn-.js} +6 -6
- 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-HBIQ2CUA-qbHIIqRZ.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-XN3QIQJK-xB6CtUGj.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-Lj_yTNlY.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-BekRp5Y0.js → vennDiagram-4TSXK5OY-C5taziCX.js} +1 -1
- package/dist/client/assets/vi-VN-7FKFXJNO-CL3WPhmG.js +7 -0
- package/dist/client/assets/{wardleyDiagram-VM6X3IG4-kdnV_Hdm.js → wardleyDiagram-VM6X3IG4-BbSlUwuM.js} +1 -1
- package/dist/client/assets/wiki-link-resolver-C2P_WmTV.js +1 -0
- 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-DufGwNSB.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 +12 -5
- package/dist/client/excalidraw-editor.html +46 -5
- package/dist/client/export-document.html +6 -8
- package/dist/client/index.html +79 -43
- package/package.json +39 -36
- package/src/client/app/drawio-editor.html +3 -3
- package/src/client/app/excalidraw-editor.html +3 -3
- package/src/client/app/export-document.html +2 -2
- package/src/client/app/index.html +77 -37
- package/src/client/app/main-entry.js +13 -17
- package/src/client/application/app-shell/chat-feature.js +7 -22
- package/src/client/application/app-shell/comments-feature.js +6 -0
- package/src/client/application/app-shell/git-feature.js +23 -5
- package/src/client/application/app-shell/presence-feature.js +8 -25
- package/src/client/application/app-shell/ui-feature-shell.js +172 -149
- package/src/client/application/app-shell/ui-feature-sidebar.js +43 -7
- package/src/client/application/app-shell/ui-feature-tab-activity.js +27 -9
- package/src/client/application/app-shell/ui-feature-toolbar.js +16 -129
- package/src/client/application/app-shell-elements.js +9 -0
- package/src/client/application/highlight-theme.js +16 -0
- package/src/client/application/preview-render-compiler.js +44 -107
- package/src/client/application/preview-render-executor.js +0 -26
- package/src/client/application/preview-render-scheduler.js +8 -24
- package/src/client/application/preview-renderer.js +26 -9
- package/src/client/application/webmcp-diagram-renderer.js +47 -0
- package/src/client/application/workspace-coordinator.js +23 -22
- package/src/client/application/workspace-route-controller.js +7 -0
- package/src/client/bootstrap/collabmd-app-shell.js +148 -35
- package/src/client/bootstrap/lazy-collab-clients.js +90 -0
- package/src/client/domain/excalidraw-element-link.js +73 -0
- package/src/client/domain/excalidraw-scene-reconcile.js +5 -2
- package/src/client/domain/excalidraw-scene.js +21 -0
- package/src/client/domain/hash-routes.js +13 -0
- package/src/client/domain/highlight-runtime.js +47 -0
- package/src/client/domain/lobby-chat.js +2 -0
- package/src/client/domain/room.js +1 -5
- package/src/client/domain/runtime-paths.js +61 -7
- package/src/client/domain/vault-utils.js +11 -0
- package/src/client/excalidraw-editor.js +155 -14
- package/src/client/export/export-host.js +3 -1
- package/src/client/export/export-pipeline.js +4 -17
- package/src/client/infrastructure/agent-connection-api-client.js +23 -0
- package/src/client/infrastructure/auth-client.js +4 -15
- package/src/client/infrastructure/browser-preferences-port.js +16 -0
- package/src/client/infrastructure/editor-session.js +11 -0
- package/src/client/infrastructure/editor-view-adapter.js +56 -8
- package/src/client/infrastructure/excalidraw-room-client.js +89 -2
- package/src/client/infrastructure/git-api-client.js +39 -33
- package/src/client/infrastructure/hosted-api-client.js +60 -0
- package/src/client/infrastructure/lobby-presence.js +4 -7
- package/src/client/infrastructure/runtime-config.js +14 -2
- package/src/client/infrastructure/tab-activity-lock.js +2 -5
- package/src/client/infrastructure/vault-api-client.js +33 -26
- package/src/client/infrastructure/webmcp-tool-registry.js +297 -0
- package/src/client/infrastructure/workspace-sync-client.js +6 -4
- package/src/client/presentation/agent-connection-controller.js +255 -0
- package/src/client/presentation/backlinks-panel.js +3 -0
- package/src/client/presentation/bases-preview-controller.js +27 -18
- 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-card.js +4 -2
- package/src/client/presentation/comment-ui/comment-ui-shared.js +5 -2
- package/src/client/presentation/create-menu-presenter.js +19 -16
- package/src/client/presentation/excalidraw-embed-controller.js +164 -4
- package/src/client/presentation/file-explorer-controller.js +3 -0
- package/src/client/presentation/file-explorer-view.js +338 -182
- package/src/client/presentation/file-history-view-controller.js +13 -11
- package/src/client/presentation/git-diff-view-controller.js +35 -43
- package/src/client/presentation/git-panel-controller.js +78 -28
- package/src/client/presentation/hosted-workspace-gate-controller.js +180 -0
- package/src/client/presentation/image-lightbox-controller.js +20 -16
- package/src/client/presentation/layout-controller.js +13 -2
- package/src/client/presentation/quick-switcher-controller.js +20 -78
- package/src/client/presentation/quick-switcher-text-search.js +10 -14
- package/src/client/presentation/team-settings-controller.js +228 -0
- package/src/client/styles/components/navigation.css +1 -2
- 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/agent-connection.css +202 -0
- package/src/client/styles/features/collaboration-chat.css +8 -1
- package/src/client/styles/features/collaboration-dialogs.css +16 -1
- package/src/client/styles/features/collaboration-presence.css +17 -4
- package/src/client/styles/features/diagram-preview.css +0 -15
- package/src/client/styles/features/diff-toolbar.css +1 -1
- package/src/client/styles/features/media-lightbox.css +12 -3
- package/src/client/styles/features/outline.css +4 -2
- package/src/client/styles/features/preview-markdown.css +25 -11
- package/src/client/styles/features/quick-switcher.css +20 -11
- package/src/client/styles/features/team-settings.css +162 -0
- package/src/client/styles/foundation/themes.css +2 -0
- package/src/client/styles/foundation/tokens.css +2 -2
- package/src/client/styles/layout/editor-page.css +25 -24
- package/src/client/styles/layout/overlays.css +16 -0
- package/src/client/styles/layout/responsive.css +7 -25
- package/src/client/styles/layout/shell.css +21 -1
- package/src/client/styles/layout/sidebar.css +99 -7
- package/src/client/styles/primitives/controls.css +21 -54
- package/src/client/styles/style.css +4 -19
- package/src/domain/agent-tool-definitions.js +872 -0
- package/src/domain/collabmd-content-capabilities.js +149 -0
- package/src/domain/collaboration-protocol.js +2 -0
- package/src/domain/comment-threads.js +3 -5
- package/src/domain/diagram-source.js +50 -0
- package/src/domain/editable-content-revision.js +10 -0
- package/src/domain/editable-text.js +3 -0
- package/src/domain/exact-text-edits.js +69 -0
- package/src/domain/excalidraw-agent-scene.js +624 -0
- package/src/domain/excalidraw-agent-verification.js +554 -0
- package/src/domain/excalidraw-room-codec.js +13 -6
- package/src/domain/literal-text-search.js +13 -0
- package/src/domain/video-embed.js +76 -0
- package/src/server/application/agent-connection-service.js +178 -0
- package/src/server/application/agent-content-service.js +841 -0
- package/src/server/application/workspace-reconciliation.js +5 -7
- package/src/server/config/env.js +147 -6
- package/src/server/create-app-server.js +47 -141
- package/src/server/domain/bases/base-query-service.js +1 -5
- package/src/server/domain/collaboration/collaboration-room.js +121 -25
- package/src/server/domain/collaboration/protocol.js +4 -0
- package/src/server/domain/hosted-workspace.js +31 -1
- package/src/server/domain/markdown-reference-extractor.js +15 -1
- package/src/server/domain/ripgrep-search-service.js +68 -21
- package/src/server/infrastructure/git/git-service.js +19 -1
- package/src/server/infrastructure/git/history-service.js +1 -1
- package/src/server/infrastructure/git/local-exclude.js +37 -0
- package/src/server/infrastructure/git/parsers.js +19 -17
- package/src/server/infrastructure/git/path-utils.js +0 -16
- package/src/server/infrastructure/git/status-service.js +1 -1
- package/src/server/infrastructure/git/untracked-files.js +12 -21
- package/src/server/infrastructure/http/create-agent-api-handler.js +171 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +32 -0
- package/src/server/infrastructure/http/create-hosted-api-handler.js +5 -0
- package/src/server/infrastructure/http/create-request-handler.js +123 -26
- package/src/server/infrastructure/http/create-static-handler.js +9 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +15 -2
- package/src/server/infrastructure/mcp/create-agent-mcp-handler.js +200 -0
- package/src/server/infrastructure/persistence/agent-connection-store.js +120 -0
- package/src/server/infrastructure/persistence/pull-backup-store.js +2 -27
- package/src/server/infrastructure/persistence/sidecar-store.js +12 -5
- package/src/server/infrastructure/persistence/vault-file-store.js +11 -5
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +48 -22
- package/src/server/shared/agent-tool-image.js +22 -0
- package/src/server/shared/agent-tool-rate-limiter.js +27 -0
- package/src/server/startup/git-remote-bootstrap.js +58 -79
- package/src/server/vault-registry.js +251 -0
- package/dist/client/assets/CodeMirrorEditor-UCMRAMCV-BPH4FJkv.js +0 -1
- package/dist/client/assets/abnfDiagram-VCTEODGH-BNDLzJ7L.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/browser-utils--H_DkyEF.js +0 -1
- package/dist/client/assets/ca-ES-LD5SCRVV-U6_TVMX9.js +0 -8
- package/dist/client/assets/channel-CaoKA_We.js +0 -1
- package/dist/client/assets/chunk-7XWMRXBY-CfMzEq80.js +0 -1
- package/dist/client/assets/chunk-CKBBP62Z-DG26UiBv.js +0 -2
- package/dist/client/assets/chunk-DSNCTWBM-8xkug7fQ.js +0 -2
- package/dist/client/assets/chunk-DU6HZSFF-COXDzJK1.js +0 -127
- package/dist/client/assets/chunk-R7TYR2AO-CTd0Yj98.js +0 -10
- package/dist/client/assets/chunk-RM4UPSZO-CWRwxNWJ.js +0 -41
- package/dist/client/assets/classDiagram-DTDB5LWJ-7fEmn0zV.js +0 -1
- package/dist/client/assets/classDiagram-v2-JRS7N3AN-7fEmn0zV.js +0 -1
- package/dist/client/assets/comment-thread-store-CdcwrObc.js +0 -1
- package/dist/client/assets/comment-threads-9J6Em-_y.js +0 -4
- package/dist/client/assets/comment-ui-shared-DuoyznXW.js +0 -7
- 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/diagram-VSXAHHWV-CQRVEZR7.js +0 -3
- package/dist/client/assets/dist-73RPdcyU.js +0 -1
- package/dist/client/assets/dist-BJ1bJs33.js +0 -1
- package/dist/client/assets/dist-ByrG2qBA.js +0 -1
- package/dist/client/assets/dist-CH-sQu3r.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-DZAAWTG-.js +0 -1
- package/dist/client/assets/dist-Dir5dDKZ.js +0 -1
- package/dist/client/assets/dist-Dl_tpDSr.js +0 -1
- package/dist/client/assets/dist-DutPuFmC.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/drawio-editor-BVaNNtYp.js +0 -9
- package/dist/client/assets/drawioEditor-BkIBlXx0.js +0 -2
- package/dist/client/assets/ebnfDiagram-PWID7BFC-OXa8VEp1.js +0 -1
- package/dist/client/assets/editor-session-DMyVdHLj.js +0 -54
- package/dist/client/assets/el-GR-IEE2CGI2-BkT6YT54.js +0 -7
- package/dist/client/assets/embedded-editor-base-B3l6Xy65.css +0 -1
- 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-editor-BjYaNEMY.js +0 -9
- package/dist/client/assets/excalidraw-mermaid-stub-BNckbX2n.js +0 -1
- package/dist/client/assets/excalidraw-mermaid-stub-DE5FTiZB.js +0 -1
- package/dist/client/assets/excalidrawEditor-ChqF_d82.js +0 -2
- package/dist/client/assets/export-page-Dyu0XCbu.js +0 -57
- package/dist/client/assets/exportDocument-CJBx4Xjx.css +0 -1
- package/dist/client/assets/exportDocument-Dgvfa2Sd.js +0 -2
- 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-A5DVABFB-CiW1eN8C.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-0zXSnE7M.js +0 -1
- package/dist/client/assets/index-CSNIMyOP.css +0 -1
- package/dist/client/assets/index-DG3N2Ps-.js +0 -2
- 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/main-D0wCxpVn.js +0 -903
- package/dist/client/assets/mermaid-parser.core-Bl0efOMt.js +0 -4
- package/dist/client/assets/mermaid.core-BJRLUQZE.js +0 -11
- 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/pegDiagram-XKGWAZYB-B31fKPR2.js +0 -1
- 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-CrJIooVD.js +0 -35
- package/dist/client/assets/preview-render-compiler-O0JxBVNF.js +0 -1
- package/dist/client/assets/preview-render-profile-B4RWYWHt.js +0 -1
- package/dist/client/assets/preview-render-worker-_QTxqKvP.js +0 -60
- package/dist/client/assets/prod-BiYPMR1i.js +0 -177
- package/dist/client/assets/prod-VxdGZ5Ly.js +0 -1
- 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-CaEjEtq_.js +0 -1
- package/dist/client/assets/railroadDiagram-O6MQD6OU-BPifP0MB.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-BLrEKVO1.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-4QOOHH4V-B--gjrit.js +0 -1
- package/dist/client/assets/sv-SE-JTOBZRGL-9-IUtVkO.js +0 -12
- package/dist/client/assets/swimlanesDiagram-VK2B7HYN-DO8XNXEg.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-BkwdFjx0.js +0 -6
- package/dist/client/assets/vault-utils-DvoSftJT.js +0 -22
- package/dist/client/assets/vi-VN-P3NDEVPS-BB0Fu9ck.js +0 -7
- package/dist/client/assets/yjs-provider-reset-guard-DE0vINDP.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/src/client/app/drawio-editor-entry.js +0 -1
- package/src/client/app/excalidraw-editor-entry.js +0 -1
- package/src/client/excalidraw-mermaid-stub.js +0 -7
- package/src/client/main.js +0 -16
- /package/dist/client/assets/{vault-api-client-C3mlS_4N.css → auth-gate-C3mlS_4N.css} +0 -0
- /package/dist/client/assets/{drawio-editor-UQQ8XHou.css → drawioEditor-UQQ8XHou.css} +0 -0
- /package/dist/client/assets/{base-BYODPHdS.js → github.min-DBihDoic.js} +0 -0
- /package/dist/client/assets/{sizeCapture-X5ZJPWSS-B0uUizjq.js → sizeCapture-INFHLROL-B0uUizjq.js} +0 -0
|
@@ -16,11 +16,7 @@ import {
|
|
|
16
16
|
} from '../domain/workspace-state.js';
|
|
17
17
|
|
|
18
18
|
function createEventId() {
|
|
19
|
-
|
|
20
|
-
return globalThis.crypto.randomUUID();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return `workspace-${Date.now()}-${Math.random().toString(16).slice(2, 10)}`;
|
|
19
|
+
return globalThis.crypto.randomUUID();
|
|
24
20
|
}
|
|
25
21
|
|
|
26
22
|
function countWorkspacePaths(workspaceChange = {}) {
|
|
@@ -306,7 +302,7 @@ export class WorkspaceReconciliation {
|
|
|
306
302
|
});
|
|
307
303
|
}
|
|
308
304
|
|
|
309
|
-
async writeEditableContent({ content, origin = 'api', path, requestId = null } = {}) {
|
|
305
|
+
async writeEditableContent({ content, origin = 'api', path, requestId = null, sourceRef = null } = {}) {
|
|
310
306
|
const result = await this.vaultFileStore.writeEditableVaultContent(path, content);
|
|
311
307
|
if (!result.ok) {
|
|
312
308
|
return result;
|
|
@@ -316,6 +312,7 @@ export class WorkspaceReconciliation {
|
|
|
316
312
|
action: 'write-file',
|
|
317
313
|
origin,
|
|
318
314
|
requestId,
|
|
315
|
+
sourceRef,
|
|
319
316
|
workspaceChange: createWorkspaceChange({
|
|
320
317
|
changedPaths: [path],
|
|
321
318
|
}),
|
|
@@ -344,7 +341,7 @@ export class WorkspaceReconciliation {
|
|
|
344
341
|
return result;
|
|
345
342
|
}
|
|
346
343
|
|
|
347
|
-
async createFile({ content = '', origin = 'api', path, requestId = null } = {}) {
|
|
344
|
+
async createFile({ content = '', origin = 'api', path, requestId = null, sourceRef = null } = {}) {
|
|
348
345
|
const result = await this.vaultFileStore.createFile(path, content);
|
|
349
346
|
if (!result.ok) {
|
|
350
347
|
return result;
|
|
@@ -354,6 +351,7 @@ export class WorkspaceReconciliation {
|
|
|
354
351
|
action: 'create-file',
|
|
355
352
|
origin,
|
|
356
353
|
requestId,
|
|
354
|
+
sourceRef,
|
|
357
355
|
workspaceChange: createWorkspaceChange({
|
|
358
356
|
changedPaths: [path],
|
|
359
357
|
}),
|
package/src/server/config/env.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolve } from 'path';
|
|
1
|
+
import { basename, isAbsolute, relative, resolve } from 'path';
|
|
2
2
|
import { readFileSync } from 'node:fs';
|
|
3
3
|
import { fileURLToPath } from 'url';
|
|
4
4
|
|
|
@@ -199,6 +199,94 @@ export function resolveCliVaultDir(positionals = [], env = process.env) {
|
|
|
199
199
|
return resolve(positionals[0] || env.COLLABMD_VAULT_DIR || '.');
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
const VAULT_ID_PATTERN = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
|
|
203
|
+
|
|
204
|
+
const VAULT_ID_HINT = 'Use letters, numbers, ".", "_", or "-" starting with a letter or number.';
|
|
205
|
+
|
|
206
|
+
export function parseVaultList(rawValue) {
|
|
207
|
+
return normalizeCsvList(rawValue).map((entry) => {
|
|
208
|
+
const separatorIndex = entry.indexOf('=');
|
|
209
|
+
const hasName = separatorIndex > 0;
|
|
210
|
+
const rawDir = (hasName ? entry.slice(separatorIndex + 1) : entry).trim();
|
|
211
|
+
if (!rawDir) {
|
|
212
|
+
throw new Error(`Vault entry "${entry}" is missing a directory path.`);
|
|
213
|
+
}
|
|
214
|
+
const dir = resolve(rawDir);
|
|
215
|
+
const id = (hasName ? entry.slice(0, separatorIndex).trim() : basename(dir));
|
|
216
|
+
if (!VAULT_ID_PATTERN.test(id)) {
|
|
217
|
+
throw new Error(`Invalid vault id "${id}". ${VAULT_ID_HINT}`);
|
|
218
|
+
}
|
|
219
|
+
return { id, dir };
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function resolveConfiguredVaults(overrides = {}, env = process.env) {
|
|
224
|
+
if (Array.isArray(overrides.vaults)) {
|
|
225
|
+
return overrides.vaults.map(({ id, dir, repoUrl }) => {
|
|
226
|
+
if (!VAULT_ID_PATTERN.test(String(id ?? ''))) {
|
|
227
|
+
throw new Error(`Invalid vault id "${id}". ${VAULT_ID_HINT}`);
|
|
228
|
+
}
|
|
229
|
+
return { id, dir: resolve(dir), repoUrl: normalizeOptionalString(repoUrl) };
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
// ponytail: explicit directory (CLI positional) wins over the operator list
|
|
233
|
+
if (overrides.vaultDir) {
|
|
234
|
+
const dir = resolve(overrides.vaultDir);
|
|
235
|
+
return [{ id: basename(dir), dir }];
|
|
236
|
+
}
|
|
237
|
+
const rawList = normalizeOptionalString(env.COLLABMD_VAULTS);
|
|
238
|
+
if (!rawList) {
|
|
239
|
+
const dir = resolveConfiguredVaultDir(overrides, env);
|
|
240
|
+
return [{ id: basename(dir), dir }];
|
|
241
|
+
}
|
|
242
|
+
const vaults = parseVaultList(rawList);
|
|
243
|
+
const seenIds = new Set();
|
|
244
|
+
for (const vault of vaults) {
|
|
245
|
+
if (seenIds.has(vault.id)) {
|
|
246
|
+
throw new Error(`Duplicate vault id "${vault.id}" in COLLABMD_VAULTS.`);
|
|
247
|
+
}
|
|
248
|
+
seenIds.add(vault.id);
|
|
249
|
+
}
|
|
250
|
+
for (let i = 0; i < vaults.length; i += 1) {
|
|
251
|
+
for (let j = i + 1; j < vaults.length; j += 1) {
|
|
252
|
+
const between = relative(vaults[i].dir, vaults[j].dir);
|
|
253
|
+
if (between === '' || (!between.startsWith('..') && !isAbsolute(between))) {
|
|
254
|
+
throw new Error(`Vaults "${vaults[i].id}" and "${vaults[j].id}" overlap. Vault directories must not nest.`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return vaults;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function mangleVaultIdForEnv(vaultId) {
|
|
262
|
+
return String(vaultId ?? '').toUpperCase().replace(/[^A-Z0-9]/g, '_');
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// ponytail: explicit repoUrl wins, then COLLABMD_GIT_REPO_URL_<ID>, then the shared URL for the primary
|
|
266
|
+
export function resolveVaultRepoUrls(vaultDefs = [], overrides = {}, env = process.env) {
|
|
267
|
+
const globalRepoUrl = normalizeOptionalString(overrides.remote?.repoUrl ?? overrides.git?.remote?.repoUrl ?? env.COLLABMD_GIT_REPO_URL);
|
|
268
|
+
const bySuffix = new Map();
|
|
269
|
+
for (const def of vaultDefs) {
|
|
270
|
+
const suffix = mangleVaultIdForEnv(def.id);
|
|
271
|
+
if (!bySuffix.has(suffix)) {
|
|
272
|
+
bySuffix.set(suffix, []);
|
|
273
|
+
}
|
|
274
|
+
bySuffix.get(suffix).push(def.id);
|
|
275
|
+
}
|
|
276
|
+
return vaultDefs.map((def, index) => {
|
|
277
|
+
if (def.repoUrl) {
|
|
278
|
+
return def;
|
|
279
|
+
}
|
|
280
|
+
const suffix = mangleVaultIdForEnv(def.id);
|
|
281
|
+
const varName = `COLLABMD_GIT_REPO_URL_${suffix}`;
|
|
282
|
+
const perVaultUrl = normalizeOptionalString(env[varName]);
|
|
283
|
+
if (perVaultUrl && bySuffix.get(suffix).length > 1) {
|
|
284
|
+
throw new Error(`Ambiguous git remote: vaults ${bySuffix.get(suffix).map((id) => `"${id}"`).join(' and ')} share ${varName}.`);
|
|
285
|
+
}
|
|
286
|
+
return { ...def, repoUrl: perVaultUrl || (index === 0 ? globalRepoUrl : '') };
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
|
|
202
290
|
function getDefaultHost(nodeEnv) {
|
|
203
291
|
return nodeEnv === 'production' ? '0.0.0.0' : '127.0.0.1';
|
|
204
292
|
}
|
|
@@ -208,7 +296,7 @@ function resolveOptionalPath(filePath) {
|
|
|
208
296
|
return normalized ? resolve(normalized) : '';
|
|
209
297
|
}
|
|
210
298
|
|
|
211
|
-
function loadGitConfig(overrides = {}) {
|
|
299
|
+
function loadGitConfig(overrides = {}, { vaultRepoUrls = [] } = {}) {
|
|
212
300
|
const remoteOverrides = overrides.remote ?? {};
|
|
213
301
|
const identityOverrides = overrides.identity ?? {};
|
|
214
302
|
const enabled = overrides.enabled ?? (process.env.COLLABMD_GIT_ENABLED !== 'false');
|
|
@@ -240,7 +328,7 @@ function loadGitConfig(overrides = {}) {
|
|
|
240
328
|
remoteOverrides.sshKnownHostsFile
|
|
241
329
|
?? process.env.COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE,
|
|
242
330
|
);
|
|
243
|
-
const remoteEnabled = repoUrl.length > 0;
|
|
331
|
+
const remoteEnabled = repoUrl.length > 0 || vaultRepoUrls.some((entry) => String(entry ?? '').length > 0);
|
|
244
332
|
|
|
245
333
|
if (remoteEnabled && !sshPrivateKeyFile && !sshPrivateKeyBase64) {
|
|
246
334
|
throw new Error(
|
|
@@ -406,11 +494,57 @@ function loadHostedConfig(overrides = {}, { authStrategy, vaultDir } = {}) {
|
|
|
406
494
|
};
|
|
407
495
|
}
|
|
408
496
|
|
|
497
|
+
function loadAgentAccessConfig(overrides = {}, { basePath, oidc, vaultDir } = {}) {
|
|
498
|
+
const enabled = overrides.enabled ?? parseBooleanFlag(
|
|
499
|
+
process.env.COLLABMD_AGENT_ACCESS_ENABLED,
|
|
500
|
+
false,
|
|
501
|
+
);
|
|
502
|
+
const publicHostname = oidc?.publicBaseUrl
|
|
503
|
+
? new URL(oidc.publicBaseUrl).hostname.toLowerCase()
|
|
504
|
+
: '';
|
|
505
|
+
return {
|
|
506
|
+
allowedHosts: Array.from(new Set([
|
|
507
|
+
'localhost',
|
|
508
|
+
'127.0.0.1',
|
|
509
|
+
'::1',
|
|
510
|
+
publicHostname,
|
|
511
|
+
...normalizeCsvList(
|
|
512
|
+
overrides.allowedHosts ?? process.env.COLLABMD_AGENT_ALLOWED_HOSTS,
|
|
513
|
+
).map((host) => host.toLowerCase()),
|
|
514
|
+
].filter(Boolean))),
|
|
515
|
+
connectionTtlMs: parsePositiveInt(
|
|
516
|
+
overrides.connectionTtlMs ?? process.env.COLLABMD_AGENT_CONNECTION_TTL_MS,
|
|
517
|
+
30 * 24 * 60 * 60 * 1000,
|
|
518
|
+
),
|
|
519
|
+
dbPath: resolve(
|
|
520
|
+
overrides.dbPath
|
|
521
|
+
?? process.env.COLLABMD_AGENT_METADATA_DB_PATH
|
|
522
|
+
?? resolve(vaultDir, '.collabmd/agent-access.sqlite'),
|
|
523
|
+
),
|
|
524
|
+
requestsPerMinute: parsePositiveInt(
|
|
525
|
+
overrides.requestsPerMinute ?? process.env.COLLABMD_AGENT_REQUESTS_PER_MINUTE,
|
|
526
|
+
120,
|
|
527
|
+
),
|
|
528
|
+
enabled,
|
|
529
|
+
endpoint: `${basePath}/mcp`,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
function resolvePublicDir(nodeEnv) {
|
|
534
|
+
if (nodeEnv === 'test' && process.env.COLLABMD_E2E_PUBLIC_DIR) {
|
|
535
|
+
return resolve(process.env.COLLABMD_E2E_PUBLIC_DIR);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return resolve(projectRoot, 'dist/client');
|
|
539
|
+
}
|
|
540
|
+
|
|
409
541
|
export function loadConfig(overrides = {}) {
|
|
410
542
|
const nodeEnv = process.env.NODE_ENV || 'development';
|
|
411
|
-
const
|
|
543
|
+
const vaults = resolveVaultRepoUrls(resolveConfiguredVaults(overrides), overrides);
|
|
544
|
+
// ponytail: vaultDir stays the primary vault; other vaults resolve through the registry
|
|
545
|
+
const vaultDir = overrides.vaultDir || vaults[0].dir;
|
|
412
546
|
const basePath = normalizeAppBasePath(process.env.BASE_PATH || '');
|
|
413
|
-
const publicDir =
|
|
547
|
+
const publicDir = resolvePublicDir(nodeEnv);
|
|
414
548
|
const authOverrides = overrides.auth ?? {};
|
|
415
549
|
const authStrategy = normalizeAuthStrategy(
|
|
416
550
|
authOverrides.strategy
|
|
@@ -425,8 +559,13 @@ export function loadConfig(overrides = {}) {
|
|
|
425
559
|
const oidc = authStrategy === AUTH_STRATEGY_OIDC
|
|
426
560
|
? loadOidcConfig(authOverrides.oidc, { basePath })
|
|
427
561
|
: null;
|
|
428
|
-
const git = loadGitConfig(overrides.git);
|
|
562
|
+
const git = loadGitConfig(overrides.git, { vaultRepoUrls: vaults.map((vault) => vault.repoUrl) });
|
|
429
563
|
const hosted = loadHostedConfig(overrides.hosted, { authStrategy, vaultDir });
|
|
564
|
+
const agentAccess = loadAgentAccessConfig(overrides.agentAccess, {
|
|
565
|
+
basePath,
|
|
566
|
+
oidc,
|
|
567
|
+
vaultDir,
|
|
568
|
+
});
|
|
430
569
|
const structurizr = loadStructurizrConfig(overrides.structurizr, { vaultDir });
|
|
431
570
|
const build = loadBuildInfo({
|
|
432
571
|
explicitBuildId: process.env.COLLABMD_BUILD_ID,
|
|
@@ -435,6 +574,7 @@ export function loadConfig(overrides = {}) {
|
|
|
435
574
|
});
|
|
436
575
|
|
|
437
576
|
return {
|
|
577
|
+
agentAccess,
|
|
438
578
|
auth: {
|
|
439
579
|
generatedPassword: passwordWasGenerated ? password : '',
|
|
440
580
|
oidc,
|
|
@@ -481,6 +621,7 @@ export function loadConfig(overrides = {}) {
|
|
|
481
621
|
plantumlServerUrl: process.env.PLANTUML_SERVER_URL || 'https://www.plantuml.com/plantuml',
|
|
482
622
|
publicDir,
|
|
483
623
|
vaultDir,
|
|
624
|
+
vaults,
|
|
484
625
|
publicWsBaseUrl: process.env.PUBLIC_WS_BASE_URL || '',
|
|
485
626
|
testWsRoomHydrateDelayMs: parsePositiveInt(process.env.TEST_WS_ROOM_HYDRATE_DELAY_MS, 0),
|
|
486
627
|
wikiLinkAutoCreate: process.env.COLLABMD_WIKI_LINK_AUTO_CREATE !== 'false',
|
|
@@ -2,32 +2,22 @@ import { createServer } from 'http';
|
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
|
|
4
4
|
import { loadConfig } from './config/env.js';
|
|
5
|
+
import { AgentConnectionService } from './application/agent-connection-service.js';
|
|
6
|
+
import { AgentContentService } from './application/agent-content-service.js';
|
|
5
7
|
import { createAuthService } from './auth/create-auth-service.js';
|
|
6
8
|
import { logPerfEvent } from './config/perf-logging.js';
|
|
7
|
-
import { BacklinkIndex } from './domain/backlink-index.js';
|
|
8
|
-
import { BaseQueryService } from './domain/bases/base-query-service.js';
|
|
9
|
-
import { CollaborationDocumentStore } from './domain/collaboration/collaboration-document-store.js';
|
|
10
|
-
import { CollaborationRoom } from './domain/collaboration/collaboration-room.js';
|
|
11
9
|
import { renderDocx } from './domain/docx-exporter.js';
|
|
12
|
-
import { GitService } from './infrastructure/git/git-service.js';
|
|
13
10
|
import { GitHubAppClient } from './infrastructure/github/github-app-client.js';
|
|
14
11
|
import { GitHubSetupFlow } from './infrastructure/github/github-setup-flow.js';
|
|
15
12
|
import { HostedWorkspaceService } from './domain/hosted-workspace.js';
|
|
16
13
|
import { PlantUmlRenderer } from './infrastructure/plantuml/plantuml-renderer.js';
|
|
17
14
|
import { StructurizrWorkspaceService } from './infrastructure/structurizr/structurizr-workspace-service.js';
|
|
18
|
-
import { RoomRegistry } from './domain/collaboration/room-registry.js';
|
|
19
|
-
import { RipgrepSearchService } from './domain/ripgrep-search-service.js';
|
|
20
15
|
import { createRequestHandler } from './infrastructure/http/create-request-handler.js';
|
|
16
|
+
import { AgentConnectionStore } from './infrastructure/persistence/agent-connection-store.js';
|
|
21
17
|
import { HostedMetadataStore } from './infrastructure/persistence/hosted-metadata-store.js';
|
|
22
|
-
import { VaultFileStore } from './infrastructure/persistence/vault-file-store.js';
|
|
23
18
|
import { attachCollaborationGateway } from './infrastructure/websocket/attach-collaboration-gateway.js';
|
|
24
|
-
import { isDrawioLeaseRoom } from '../domain/drawio-room.js';
|
|
25
|
-
import { WORKSPACE_ROOM_NAME } from '../domain/workspace-room.js';
|
|
26
|
-
import { FileSystemSyncService } from './infrastructure/workspace/file-system-sync-service.js';
|
|
27
|
-
import { WorkspaceReconciliation } from './application/workspace-reconciliation.js';
|
|
28
|
-
import { createWorkspaceStateFileSystemAdapter } from './infrastructure/workspace/workspace-state-file-system-adapter.js';
|
|
29
19
|
import { createSignedCookieManager } from './auth/session-cookie.js';
|
|
30
|
-
import {
|
|
20
|
+
import { createVaultRegistry } from './vault-registry.js';
|
|
31
21
|
|
|
32
22
|
function getDisplayHost(host) {
|
|
33
23
|
return host === '127.0.0.1' ? 'localhost' : host;
|
|
@@ -72,16 +62,20 @@ export function createAppServer(config = loadConfig()) {
|
|
|
72
62
|
githubAppClient,
|
|
73
63
|
})
|
|
74
64
|
: null;
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
65
|
+
const testControls = {
|
|
66
|
+
wsRoomHydrateDelayMs: Math.max(0, Number(config.testWsRoomHydrateDelayMs || 0)),
|
|
67
|
+
};
|
|
68
|
+
// ponytail: one live context per vault; agent/hosted/structurizr stay on the primary this slice
|
|
69
|
+
const vaultRegistry = createVaultRegistry({ config, testControls });
|
|
70
|
+
const primary = vaultRegistry.getPrimaryContext();
|
|
71
|
+
const vaultFileStore = primary.vaultFileStore;
|
|
72
|
+
const backlinkIndex = primary.backlinkIndex;
|
|
73
|
+
const baseQueryService = primary.baseQueryService;
|
|
74
|
+
const gitService = primary.gitService;
|
|
75
|
+
const searchService = primary.searchService;
|
|
76
|
+
const roomRegistry = primary.roomRegistry;
|
|
77
|
+
const workspaceMutationCoordinator = primary.workspaceMutationCoordinator;
|
|
78
|
+
const fileSystemSyncService = primary.fileSystemSyncService;
|
|
85
79
|
const plantUmlRenderer = new PlantUmlRenderer({
|
|
86
80
|
serverUrl: config.plantumlServerUrl,
|
|
87
81
|
});
|
|
@@ -91,61 +85,23 @@ export function createAppServer(config = loadConfig()) {
|
|
|
91
85
|
trustedExecutableDsl: config.structurizr?.trustedExecutableDsl,
|
|
92
86
|
vaultDir: config.vaultDir,
|
|
93
87
|
});
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
enabled: config.gitEnabled,
|
|
97
|
-
vaultDir: config.vaultDir,
|
|
98
|
-
});
|
|
99
|
-
const searchService = new RipgrepSearchService({
|
|
100
|
-
maxBufferBytes: config.searchMaxBufferBytes,
|
|
101
|
-
maxFileSize: config.searchMaxFileSize,
|
|
102
|
-
perfLoggingEnabled: config.perfLoggingEnabled,
|
|
103
|
-
vaultDir: config.vaultDir,
|
|
88
|
+
const agentConnectionStore = new AgentConnectionStore({
|
|
89
|
+
dbPath: config.agentAccess.dbPath,
|
|
104
90
|
});
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const isTransientRoom = name === '__lobby__' || name === WORKSPACE_ROOM_NAME || isDrawioLeaseRoom(name);
|
|
111
|
-
const room = new CollaborationRoom({
|
|
112
|
-
documentStore: new CollaborationDocumentStore({
|
|
113
|
-
backlinkIndex: isTransientRoom ? null : backlinkIndex,
|
|
114
|
-
name,
|
|
115
|
-
vaultFileStore: isTransientRoom ? null : vaultFileStore,
|
|
116
|
-
}),
|
|
117
|
-
getHydrateDelayMs: () => testControls.wsRoomHydrateDelayMs,
|
|
118
|
-
idleGraceMs: config.wsRoomIdleGraceMs,
|
|
119
|
-
maxInitialSyncBytes: config.maxInitialSyncBytes,
|
|
120
|
-
maxBufferedAmountBytes: config.wsMaxBufferedAmountBytes,
|
|
121
|
-
name,
|
|
122
|
-
onEmpty,
|
|
123
|
-
perfLoggingEnabled: config.perfLoggingEnabled,
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
if (name === WORKSPACE_ROOM_NAME && workspaceMutationCoordinator?.workspaceState) {
|
|
127
|
-
room.replaceWorkspaceEntries(workspaceMutationCoordinator.workspaceState.entries, {
|
|
128
|
-
generatedAt: workspaceMutationCoordinator.workspaceState.scannedAt,
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return room;
|
|
133
|
-
},
|
|
91
|
+
const agentConnectionService = new AgentConnectionService({
|
|
92
|
+
authStrategy: config.auth.strategy,
|
|
93
|
+
connectionTtlMs: config.agentAccess.connectionTtlMs,
|
|
94
|
+
hostedWorkspaceService,
|
|
95
|
+
store: agentConnectionStore,
|
|
134
96
|
});
|
|
135
|
-
|
|
97
|
+
const agentContentService = new AgentContentService({
|
|
136
98
|
backlinkIndex,
|
|
137
99
|
baseQueryService,
|
|
100
|
+
plantUmlRenderer,
|
|
138
101
|
roomRegistry,
|
|
102
|
+
searchService,
|
|
139
103
|
vaultFileStore,
|
|
140
|
-
|
|
141
|
-
vaultDir: vaultFileStore.vaultDir,
|
|
142
|
-
}),
|
|
143
|
-
});
|
|
144
|
-
vaultFileStore.setManagedWriteTracker(workspaceMutationCoordinator);
|
|
145
|
-
fileSystemSyncService = new FileSystemSyncService({
|
|
146
|
-
mutationCoordinator: workspaceMutationCoordinator,
|
|
147
|
-
perfLoggingEnabled: config.perfLoggingEnabled,
|
|
148
|
-
vaultFileStore,
|
|
104
|
+
workspaceMutationCoordinator,
|
|
149
105
|
});
|
|
150
106
|
const requestHandler = createRequestHandler(
|
|
151
107
|
config,
|
|
@@ -164,6 +120,11 @@ export function createAppServer(config = loadConfig()) {
|
|
|
164
120
|
hostedWorkspaceService,
|
|
165
121
|
githubSetupFlow,
|
|
166
122
|
structurizrWorkspaceService,
|
|
123
|
+
{
|
|
124
|
+
connectionService: agentConnectionService,
|
|
125
|
+
contentService: agentContentService,
|
|
126
|
+
},
|
|
127
|
+
vaultRegistry,
|
|
167
128
|
);
|
|
168
129
|
const httpServer = createServer((req, res) => {
|
|
169
130
|
requestHandler(req, res).catch((error) => {
|
|
@@ -186,6 +147,7 @@ export function createAppServer(config = loadConfig()) {
|
|
|
186
147
|
roomRegistry,
|
|
187
148
|
wsBasePath: config.wsBasePath,
|
|
188
149
|
hostedWorkspaceService,
|
|
150
|
+
vaultRegistry,
|
|
189
151
|
});
|
|
190
152
|
|
|
191
153
|
let shutdownPromise = null;
|
|
@@ -195,74 +157,13 @@ export function createAppServer(config = loadConfig()) {
|
|
|
195
157
|
const startupStartedAt = Date.now();
|
|
196
158
|
|
|
197
159
|
await hostedWorkspaceService.initialize();
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
config.search = await searchService.initialize();
|
|
201
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
202
|
-
available: config.search.available,
|
|
203
|
-
durationMs: Date.now() - searchCapabilityStartedAt,
|
|
204
|
-
phase: 'search-capability',
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
const initialWorkspaceScanStartedAt = Date.now();
|
|
208
|
-
const initialWorkspaceSnapshot = await vaultFileStore.scanWorkspaceState();
|
|
209
|
-
vaultFileCount = initialWorkspaceSnapshot.vaultFileCount ?? 0;
|
|
210
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
211
|
-
durationMs: Date.now() - initialWorkspaceScanStartedAt,
|
|
212
|
-
phase: 'workspace-scan',
|
|
213
|
-
vaultFileCount,
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
const backlinkBuildStartedAt = Date.now();
|
|
217
|
-
await backlinkIndex.build({ workspaceState: initialWorkspaceSnapshot });
|
|
218
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
219
|
-
durationMs: Date.now() - backlinkBuildStartedAt,
|
|
220
|
-
markdownFileCount: initialWorkspaceSnapshot.markdownPaths?.length ?? 0,
|
|
221
|
-
phase: 'backlink-build',
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
const liveWorkspaceScanStartedAt = Date.now();
|
|
225
|
-
const liveWorkspaceSnapshot = await vaultFileStore.scanWorkspaceState();
|
|
226
|
-
const workspaceChangedDuringStartup = !workspaceStateMetadataEqual(initialWorkspaceSnapshot, liveWorkspaceSnapshot);
|
|
227
|
-
vaultFileCount = liveWorkspaceSnapshot.vaultFileCount ?? vaultFileCount;
|
|
228
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
229
|
-
changedDuringStartup: workspaceChangedDuringStartup,
|
|
230
|
-
durationMs: Date.now() - liveWorkspaceScanStartedAt,
|
|
231
|
-
phase: 'workspace-rescan',
|
|
232
|
-
vaultFileCount,
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
if (workspaceChangedDuringStartup) {
|
|
236
|
-
const backlinkRebuildStartedAt = Date.now();
|
|
237
|
-
await backlinkIndex.build({ workspaceState: liveWorkspaceSnapshot });
|
|
238
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
239
|
-
durationMs: Date.now() - backlinkRebuildStartedAt,
|
|
240
|
-
markdownFileCount: liveWorkspaceSnapshot.markdownPaths?.length ?? 0,
|
|
241
|
-
phase: 'backlink-rebuild',
|
|
242
|
-
});
|
|
160
|
+
if (config.agentAccess.enabled && config.auth.strategy !== 'none') {
|
|
161
|
+
await agentConnectionService.initialize();
|
|
243
162
|
}
|
|
244
163
|
|
|
245
|
-
const
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
durationMs: Date.now() - workspaceInitStartedAt,
|
|
249
|
-
phase: 'workspace-init',
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
if (config.fileWatcherEnabled !== false) {
|
|
253
|
-
const watcherStartStartedAt = Date.now();
|
|
254
|
-
await fileSystemSyncService.start({ snapshot: liveWorkspaceSnapshot });
|
|
255
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
256
|
-
durationMs: Date.now() - watcherStartStartedAt,
|
|
257
|
-
phase: 'watcher-start',
|
|
258
|
-
});
|
|
259
|
-
} else {
|
|
260
|
-
fileSystemSyncService.initializeFromSnapshot({ snapshot: liveWorkspaceSnapshot });
|
|
261
|
-
logPerfEvent(config.perfLoggingEnabled, 'startup', {
|
|
262
|
-
durationMs: 0,
|
|
263
|
-
phase: 'watcher-skipped',
|
|
264
|
-
});
|
|
265
|
-
}
|
|
164
|
+
const { searchCapability, snapshot: liveWorkspaceSnapshot, vaultFileCount: primaryFileCount } = await vaultRegistry.initializePrimary();
|
|
165
|
+
config.search = searchCapability;
|
|
166
|
+
vaultFileCount = primaryFileCount;
|
|
266
167
|
|
|
267
168
|
return new Promise((resolve, reject) => {
|
|
268
169
|
const listenStartedAt = Date.now();
|
|
@@ -300,12 +201,14 @@ export function createAppServer(config = loadConfig()) {
|
|
|
300
201
|
|
|
301
202
|
shutdownPromise = (async () => {
|
|
302
203
|
await collaborationGateway.close();
|
|
303
|
-
await
|
|
304
|
-
await roomRegistry.reset();
|
|
204
|
+
await vaultRegistry.closeAll();
|
|
305
205
|
await Promise.all([
|
|
306
206
|
closeHttpServer(httpServer),
|
|
307
207
|
config.git?.cleanup?.(),
|
|
308
208
|
hostedWorkspaceService.close(),
|
|
209
|
+
config.agentAccess.enabled && config.auth.strategy !== 'none'
|
|
210
|
+
? agentConnectionStore.close()
|
|
211
|
+
: Promise.resolve(),
|
|
309
212
|
]);
|
|
310
213
|
})().then(() => undefined);
|
|
311
214
|
|
|
@@ -314,6 +217,8 @@ export function createAppServer(config = loadConfig()) {
|
|
|
314
217
|
|
|
315
218
|
return {
|
|
316
219
|
close,
|
|
220
|
+
agentConnectionService,
|
|
221
|
+
agentContentService,
|
|
317
222
|
collaborationGateway,
|
|
318
223
|
config,
|
|
319
224
|
httpServer,
|
|
@@ -331,6 +236,7 @@ export function createAppServer(config = loadConfig()) {
|
|
|
331
236
|
testControls.wsRoomHydrateDelayMs = Math.max(0, Number(delayMs) || 0);
|
|
332
237
|
},
|
|
333
238
|
vaultFileStore,
|
|
239
|
+
vaultRegistry,
|
|
334
240
|
get vaultFileCount() { return vaultFileCount; },
|
|
335
241
|
};
|
|
336
242
|
}
|
|
@@ -87,17 +87,13 @@ function insertSortedBounded(rows, row, {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
function escapeRegExp(value = '') {
|
|
91
|
-
return String(value ?? '').replace(/[.*+?^${}()|[\]\\]/gu, '\\$&');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
90
|
function pruneFilterNodeForProperty(filterNode, propertyId = '') {
|
|
95
91
|
if (!propertyId || !filterNode) {
|
|
96
92
|
return filterNode;
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
if (typeof filterNode === 'string') {
|
|
100
|
-
const escapedPropertyId =
|
|
96
|
+
const escapedPropertyId = RegExp.escape(String(propertyId));
|
|
101
97
|
const propertyFilterPattern = new RegExp(
|
|
102
98
|
`^!?${escapedPropertyId}(?:\\.(?:contains|startsWith|endsWith|isEmpty)\\(.*\\)|\\s*(?:==|!=|>=|<=|>|<)\\s*.+)$`,
|
|
103
99
|
'u',
|