collabmd 0.1.18
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/LICENSE +21 -0
- package/README.md +453 -0
- package/bin/collabmd.js +241 -0
- package/docker-compose.yml +43 -0
- package/package.json +93 -0
- package/public/assets/css/base.css +1 -0
- package/public/assets/css/style.css +1 -0
- package/public/assets/js/assets/Assistant-Bold-ZDZZ6JHA.woff2 +0 -0
- package/public/assets/js/assets/Assistant-Medium-DZ25RZU3.woff2 +0 -0
- package/public/assets/js/assets/Assistant-Regular-PLF2XOGW.woff2 +0 -0
- package/public/assets/js/assets/Assistant-SemiBold-CZ5MX6FK.woff2 +0 -0
- package/public/assets/js/chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js +12 -0
- package/public/assets/js/chunks/apl-C5P5JBDI.js +1 -0
- package/public/assets/js/chunks/ar-SA-NXDWD63E-MF6HMEA4.js +8 -0
- package/public/assets/js/chunks/architecture-PBZL5I3N-55LDZ5WS.js +1 -0
- package/public/assets/js/chunks/architectureDiagram-2XIMDMQ5-2VP562X7.js +36 -0
- package/public/assets/js/chunks/asciiarmor-3NCLLELT.js +1 -0
- package/public/assets/js/chunks/asn1-KF4WXU3M.js +1 -0
- package/public/assets/js/chunks/asterisk-EA3VIN65.js +1 -0
- package/public/assets/js/chunks/az-AZ-MXSORGZV-AIGO4TNU.js +1 -0
- package/public/assets/js/chunks/bg-BG-O6MV2KSF-X6AVO2AF.js +5 -0
- package/public/assets/js/chunks/blockDiagram-WCTKOSBZ-KM56WWDE.js +132 -0
- package/public/assets/js/chunks/bn-BD-T2VJNT7N-7OMHRIGC.js +3 -0
- package/public/assets/js/chunks/bn-IN-MMW2ORAC-EPKMNKG7.js +3 -0
- package/public/assets/js/chunks/brainfuck-A3CTQVFD.js +1 -0
- package/public/assets/js/chunks/c4Diagram-IC4MRINW-KX6UEGQZ.js +10 -0
- package/public/assets/js/chunks/ca-ES-MKBCGNOG-U44SUUTN.js +8 -0
- package/public/assets/js/chunks/chunk-2NTQWLZD.js +25 -0
- package/public/assets/js/chunks/chunk-2YRP2AWD.js +1 -0
- package/public/assets/js/chunks/chunk-3BUCGSSJ.js +1 -0
- package/public/assets/js/chunks/chunk-47L7JGE3.js +1 -0
- package/public/assets/js/chunks/chunk-4BCHPULB.js +1 -0
- package/public/assets/js/chunks/chunk-4NKM6YFO.js +161 -0
- package/public/assets/js/chunks/chunk-4WGMPBK5.js +1 -0
- package/public/assets/js/chunks/chunk-55WF6Y2Q.js +1 -0
- package/public/assets/js/chunks/chunk-775E65SU.js +1 -0
- package/public/assets/js/chunks/chunk-AJRGTECU.js +70 -0
- package/public/assets/js/chunks/chunk-B2J3PHGY.js +1 -0
- package/public/assets/js/chunks/chunk-B4JKB3BC.js +1 -0
- package/public/assets/js/chunks/chunk-BBHPYU2R.js +1 -0
- package/public/assets/js/chunks/chunk-CGVY4PKT.js +13 -0
- package/public/assets/js/chunks/chunk-CVTRX3TE.js +220 -0
- package/public/assets/js/chunks/chunk-DW6KK6VF.js +1 -0
- package/public/assets/js/chunks/chunk-E2HMNOQL.js +189 -0
- package/public/assets/js/chunks/chunk-EPTJZP5H.js +7 -0
- package/public/assets/js/chunks/chunk-G7NUGGE7.js +13 -0
- package/public/assets/js/chunks/chunk-GI7LBIBP.js +1 -0
- package/public/assets/js/chunks/chunk-GXRL27M7.js +1 -0
- package/public/assets/js/chunks/chunk-H6EYDHRW.js +1 -0
- package/public/assets/js/chunks/chunk-HOCBCDA5.js +1 -0
- package/public/assets/js/chunks/chunk-HS2CUOC6.js +1 -0
- package/public/assets/js/chunks/chunk-HUAS4BYI.js +12 -0
- package/public/assets/js/chunks/chunk-HVNNEPP5.js +2 -0
- package/public/assets/js/chunks/chunk-I2GVZI7W.js +38 -0
- package/public/assets/js/chunks/chunk-I6PVWGBN.js +14 -0
- package/public/assets/js/chunks/chunk-IR2DOYV4.js +7 -0
- package/public/assets/js/chunks/chunk-IZ3V3F2A.js +1 -0
- package/public/assets/js/chunks/chunk-KPAQHIOI.js +1 -0
- package/public/assets/js/chunks/chunk-M3EW4V74.js +1 -0
- package/public/assets/js/chunks/chunk-MK3AFU3C.js +90 -0
- package/public/assets/js/chunks/chunk-NM6J3ND7.js +1 -0
- package/public/assets/js/chunks/chunk-NO7UPWTU.js +1 -0
- package/public/assets/js/chunks/chunk-OG2TNZEU.js +9 -0
- package/public/assets/js/chunks/chunk-OHGDMMWM.js +1 -0
- package/public/assets/js/chunks/chunk-OOT2HALX.js +1 -0
- package/public/assets/js/chunks/chunk-OQLLZFFN.js +1 -0
- package/public/assets/js/chunks/chunk-PF6TP4EI.js +1 -0
- package/public/assets/js/chunks/chunk-PMOZMECZ.js +85 -0
- package/public/assets/js/chunks/chunk-QBGS6DJR.js +1 -0
- package/public/assets/js/chunks/chunk-QF3ZQ6UQ.js +1 -0
- package/public/assets/js/chunks/chunk-QFXMAUW4.js +1 -0
- package/public/assets/js/chunks/chunk-QSTBGTWJ.js +1 -0
- package/public/assets/js/chunks/chunk-QYKIT2IH.js +41 -0
- package/public/assets/js/chunks/chunk-S75BI2UQ.js +1 -0
- package/public/assets/js/chunks/chunk-SKEZZ3H6.js +1 -0
- package/public/assets/js/chunks/chunk-SO6QBCB6.js +1 -0
- package/public/assets/js/chunks/chunk-SR3U53EQ.js +1 -0
- package/public/assets/js/chunks/chunk-TFP6LRYJ.js +53 -0
- package/public/assets/js/chunks/chunk-U6APNHAF.js +15 -0
- package/public/assets/js/chunks/chunk-VOODXHXA.js +1 -0
- package/public/assets/js/chunks/chunk-W7WJUTSA.js +3 -0
- package/public/assets/js/chunks/chunk-WNXFO2F2.js +1 -0
- package/public/assets/js/chunks/chunk-X6EEYWV4.js +6 -0
- package/public/assets/js/chunks/chunk-YVW3ZETS.js +1 -0
- package/public/assets/js/chunks/chunk-ZR2QRTBG.js +339 -0
- package/public/assets/js/chunks/chunk-ZZJX4LQ2.js +1 -0
- package/public/assets/js/chunks/classDiagram-VBA2DB6C-IYW4O2RM.js +1 -0
- package/public/assets/js/chunks/classDiagram-v2-RAHNMMFH-DNKVN2WD.js +1 -0
- package/public/assets/js/chunks/clike-RTBH33GE.js +1 -0
- package/public/assets/js/chunks/clojure-BR2VJ2JI.js +1 -0
- package/public/assets/js/chunks/cmake-2HEWVFEE.js +1 -0
- package/public/assets/js/chunks/cobol-V6EIK6DN.js +1 -0
- package/public/assets/js/chunks/coffeescript-JW3ZOGMD.js +1 -0
- package/public/assets/js/chunks/commonlisp-UCWSIHYK.js +1 -0
- package/public/assets/js/chunks/cose-bilkent-S5V4N54A-QVYRFFNC.js +1 -0
- package/public/assets/js/chunks/crystal-GR4VLC3M.js +1 -0
- package/public/assets/js/chunks/cs-CZ-V77HGUP7-OLBAKFG5.js +7 -0
- package/public/assets/js/chunks/css-C5DVWGB4.js +1 -0
- package/public/assets/js/chunks/cypher-K7FZM5GC.js +1 -0
- package/public/assets/js/chunks/d-CF3QNNH5.js +1 -0
- package/public/assets/js/chunks/da-DK-I5RFNTM4-QJIG2SEZ.js +2 -0
- package/public/assets/js/chunks/dagre-KLK3FWXG-KVNBUDOY.js +4 -0
- package/public/assets/js/chunks/de-CH-WLRDEVBV-4MMJDMVD.js +7 -0
- package/public/assets/js/chunks/de-DE-DTI4WUSC-ML7C46TT.js +7 -0
- package/public/assets/js/chunks/diagram-E7M64L7V-ZP33VRUC.js +24 -0
- package/public/assets/js/chunks/diagram-IFDJBPK2-ZG35YWOD.js +43 -0
- package/public/assets/js/chunks/diagram-P4PSJMXO-ZGIGM7D2.js +24 -0
- package/public/assets/js/chunks/diff-KOMSZU7O.js +1 -0
- package/public/assets/js/chunks/dist-7RQKSOUX.js +7 -0
- package/public/assets/js/chunks/dist-ARWGZ6MN.js +1 -0
- package/public/assets/js/chunks/dist-DPBSGC3Y.js +2 -0
- package/public/assets/js/chunks/dist-E36PJE5M.js +1 -0
- package/public/assets/js/chunks/dist-E5NM7OBW.js +1 -0
- package/public/assets/js/chunks/dist-ERADYPEK.js +1 -0
- package/public/assets/js/chunks/dist-F43RIHBZ.js +1 -0
- package/public/assets/js/chunks/dist-HAB5NIXI.js +1 -0
- package/public/assets/js/chunks/dist-HG23OLRA.js +1 -0
- package/public/assets/js/chunks/dist-IEJXBSDJ.js +1 -0
- package/public/assets/js/chunks/dist-IQA4KVJK.js +1 -0
- package/public/assets/js/chunks/dist-OIQTNVT2.js +3 -0
- package/public/assets/js/chunks/dist-PMZJ734S.js +1 -0
- package/public/assets/js/chunks/dist-RCQFQRLD.js +1 -0
- package/public/assets/js/chunks/dist-RQLC4GVI.js +1 -0
- package/public/assets/js/chunks/dist-RSJGLSKC.js +1 -0
- package/public/assets/js/chunks/dist-SGNQZVVX.js +1 -0
- package/public/assets/js/chunks/dist-VCFTF7Z6.js +1 -0
- package/public/assets/js/chunks/dist-VTO23SHH.js +1 -0
- package/public/assets/js/chunks/dist-XOODBV4L.js +1 -0
- package/public/assets/js/chunks/dist-ZFZNCRZY.js +1 -0
- package/public/assets/js/chunks/dockerfile-XCIKYOSI.js +1 -0
- package/public/assets/js/chunks/dtd-3XFH7W6Z.js +1 -0
- package/public/assets/js/chunks/dylan-3UWPKVOR.js +1 -0
- package/public/assets/js/chunks/ebnf-OLHTL3VN.js +1 -0
- package/public/assets/js/chunks/ecl-43LZ3ZRM.js +1 -0
- package/public/assets/js/chunks/editor-session-IHFTYG5D.js +22 -0
- package/public/assets/js/chunks/eiffel-ISPO2UJF.js +1 -0
- package/public/assets/js/chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js +7 -0
- package/public/assets/js/chunks/elm-CLK576PK.js +1 -0
- package/public/assets/js/chunks/en-CTDJDZ6K-IC3QAUOI.js +1 -0
- package/public/assets/js/chunks/erDiagram-INFDFZHY-ZMS6H2TH.js +70 -0
- package/public/assets/js/chunks/erlang-AVQXQFOT.js +1 -0
- package/public/assets/js/chunks/es-ES-DYQHAD43-XGB5X5IM.js +7 -0
- package/public/assets/js/chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js +7 -0
- package/public/assets/js/chunks/excalidraw-mermaid-stub-NYXTOJ4H.js +1 -0
- package/public/assets/js/chunks/fa-IR-26LZG4PM-PFALMEDX.js +9 -0
- package/public/assets/js/chunks/factor-CRTVBD6Q.js +1 -0
- package/public/assets/js/chunks/fcl-FX24LKTH.js +1 -0
- package/public/assets/js/chunks/fi-FI-6YS4KDE4-ES5MV6P4.js +6 -0
- package/public/assets/js/chunks/flowDiagram-PKNHOUZH-QD4L5IE5.js +162 -0
- package/public/assets/js/chunks/forth-YKDKCTVS.js +1 -0
- package/public/assets/js/chunks/fortran-UJWC6SLU.js +1 -0
- package/public/assets/js/chunks/fr-FR-BRLLPTZC-VMFE22YV.js +12 -0
- package/public/assets/js/chunks/ganttDiagram-A5KZAMGK-VTMTQESP.js +292 -0
- package/public/assets/js/chunks/gas-MYEMWGRE.js +1 -0
- package/public/assets/js/chunks/gherkin-JWHAU2YG.js +1 -0
- package/public/assets/js/chunks/gitGraph-HDMCJU4V-YPHS74XX.js +1 -0
- package/public/assets/js/chunks/gitGraphDiagram-K3NZZRJ6-Z3EZ634T.js +65 -0
- package/public/assets/js/chunks/gl-ES-OKUZTLYG-GPT42ZHV.js +6 -0
- package/public/assets/js/chunks/groovy-QZIZQIAK.js +1 -0
- package/public/assets/js/chunks/haskell-JR3G7YNW.js +1 -0
- package/public/assets/js/chunks/haxe-TVLAIYEN.js +1 -0
- package/public/assets/js/chunks/he-IL-26MGYIU7-VQ5XQYYY.js +8 -0
- package/public/assets/js/chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js +3 -0
- package/public/assets/js/chunks/http-YXQRE77G.js +1 -0
- package/public/assets/js/chunks/hu-HU-P2OXPSN5-6XDVPGTE.js +3 -0
- package/public/assets/js/chunks/id-ID-2EIKXYN6-J5GWSY2S.js +8 -0
- package/public/assets/js/chunks/idl-RAQGJ6LJ.js +1 -0
- package/public/assets/js/chunks/image-32MOCVDX-JN2EUMQG.js +1 -0
- package/public/assets/js/chunks/image-blob-reduce.esm-K5OWL55S.js +13 -0
- package/public/assets/js/chunks/info-3K5VOQVL-CXJSPNNP.js +1 -0
- package/public/assets/js/chunks/infoDiagram-LFFYTUFH-WQ34MUJA.js +2 -0
- package/public/assets/js/chunks/ishikawaDiagram-PHBUUO56-4IARWKJK.js +70 -0
- package/public/assets/js/chunks/it-IT-4CFKVXI2-NMBWUWFF.js +12 -0
- package/public/assets/js/chunks/ja-JP-MAND2Z4V-GQZYXXOC.js +7 -0
- package/public/assets/js/chunks/javascript-NM7KDJUE.js +1 -0
- package/public/assets/js/chunks/journeyDiagram-4ABVD52K-FJ4LF4SX.js +139 -0
- package/public/assets/js/chunks/julia-LG3BH25B.js +1 -0
- package/public/assets/js/chunks/kaa-HQRTCXTJ-7D6PAKDJ.js +1 -0
- package/public/assets/js/chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js +4 -0
- package/public/assets/js/chunks/kanban-definition-K7BYSVSG-TY4EVYI3.js +89 -0
- package/public/assets/js/chunks/katex-5YJCUCFD.js +261 -0
- package/public/assets/js/chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js +1 -0
- package/public/assets/js/chunks/km-KH-PKL3LSGX-HTLHEJV6.js +7 -0
- package/public/assets/js/chunks/ko-KR-KXLREZX3-QMR52QVI.js +5 -0
- package/public/assets/js/chunks/ku-TR-MJ4IER3X-K5CNY4UO.js +6 -0
- package/public/assets/js/chunks/livescript-4CVWVI4M.js +1 -0
- package/public/assets/js/chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js +3 -0
- package/public/assets/js/chunks/lua-VWGE7DQ7.js +1 -0
- package/public/assets/js/chunks/lv-LV-GOCK6SJW-KTDFW5OH.js +4 -0
- package/public/assets/js/chunks/mathematica-D7APQSEU.js +1 -0
- package/public/assets/js/chunks/mbox-BN3XQBYX.js +1 -0
- package/public/assets/js/chunks/mermaid-runtime-BIFNJ2CT.js +18 -0
- package/public/assets/js/chunks/mindmap-definition-YRQLILUH-5B565RNP.js +68 -0
- package/public/assets/js/chunks/mirc-565WBI76.js +1 -0
- package/public/assets/js/chunks/mllike-VV3KS46B.js +1 -0
- package/public/assets/js/chunks/modelica-EGX44FZV.js +1 -0
- package/public/assets/js/chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js +9 -0
- package/public/assets/js/chunks/mscgen-GFGTHENT.js +1 -0
- package/public/assets/js/chunks/mumps-POZYWSMI.js +1 -0
- package/public/assets/js/chunks/my-MM-YG6MYTTD-ZHLCMEVA.js +1 -0
- package/public/assets/js/chunks/nb-NO-XGWJISD2-KSDFG6YU.js +8 -0
- package/public/assets/js/chunks/nginx-JUBX55EU.js +1 -0
- package/public/assets/js/chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js +13 -0
- package/public/assets/js/chunks/nn-NO-EMX5MJX5-34QKSHNR.js +4 -0
- package/public/assets/js/chunks/nsis-RC4CREGM.js +1 -0
- package/public/assets/js/chunks/ntriples-4WK6CNVE.js +1 -0
- package/public/assets/js/chunks/oc-FR-ROEINTVO-5GP4AOYO.js +4 -0
- package/public/assets/js/chunks/octave-GOKFN2V7.js +1 -0
- package/public/assets/js/chunks/oz-OQUMNC63.js +1 -0
- package/public/assets/js/chunks/pa-IN-ZYN6SUDY-MVL7O44W.js +4 -0
- package/public/assets/js/chunks/packet-RMMSAZCW-D7XTR5TT.js +1 -0
- package/public/assets/js/chunks/pascal-BBWQWWWD.js +1 -0
- package/public/assets/js/chunks/percentages-5DKR754L-DG7W23CV.js +1 -0
- package/public/assets/js/chunks/perl-KTPJTTAM.js +1 -0
- package/public/assets/js/chunks/pica-6G3NROWT.js +17 -0
- package/public/assets/js/chunks/pie-UPGHQEXC-KGC3O6LN.js +1 -0
- package/public/assets/js/chunks/pieDiagram-SKSYHLDU-KWKRDEZS.js +30 -0
- package/public/assets/js/chunks/pig-IJMBS4FZ.js +1 -0
- package/public/assets/js/chunks/pl-PL-6VTG7PHC-VADRWSX4.js +12 -0
- package/public/assets/js/chunks/powershell-6YGCBHDP.js +1 -0
- package/public/assets/js/chunks/preview-render-compiler-WD3A76I6.js +25 -0
- package/public/assets/js/chunks/properties-5QTD3364.js +1 -0
- package/public/assets/js/chunks/protobuf-LTRWBIK3.js +1 -0
- package/public/assets/js/chunks/pt-BR-5YFKRR5G-HHF4UPO4.js +6 -0
- package/public/assets/js/chunks/pt-PT-GEIXXZ67-TUTAUZJK.js +8 -0
- package/public/assets/js/chunks/pug-U4PV3WLG.js +1 -0
- package/public/assets/js/chunks/puppet-WGYJPR3Y.js +1 -0
- package/public/assets/js/chunks/python-6YGH4S47.js +1 -0
- package/public/assets/js/chunks/q-VIG4IJLI.js +1 -0
- package/public/assets/js/chunks/quadrantDiagram-337W2JSQ-GWQRUFHQ.js +7 -0
- package/public/assets/js/chunks/quick-switcher-controller-JYDIJVAJ.js +5 -0
- package/public/assets/js/chunks/r-NVPCXGTR.js +1 -0
- package/public/assets/js/chunks/radar-KQ55EAFF-OPO64DRI.js +1 -0
- package/public/assets/js/chunks/requirementDiagram-Z7DCOOCP-ASW7IPJL.js +73 -0
- package/public/assets/js/chunks/ro-RO-E2P6TFZI-RJFCULYF.js +12 -0
- package/public/assets/js/chunks/roundRect-Z3DX3W5S.js +1 -0
- package/public/assets/js/chunks/rpm-UEA257HD.js +1 -0
- package/public/assets/js/chunks/ru-RU-YBIIY43T-BF27TNVK.js +10 -0
- package/public/assets/js/chunks/ruby-KPQRAJGE.js +1 -0
- package/public/assets/js/chunks/sankeyDiagram-WA2Y5GQK-W6BBWCLW.js +10 -0
- package/public/assets/js/chunks/sas-L7VATVH5.js +1 -0
- package/public/assets/js/chunks/scheme-T2NOWR3P.js +1 -0
- package/public/assets/js/chunks/sequenceDiagram-2WXFIKYE-H4G3ISLN.js +145 -0
- package/public/assets/js/chunks/shell-DLVDUNFA.js +1 -0
- package/public/assets/js/chunks/si-LK-673C2CI2-IOFGU4U2.js +1 -0
- package/public/assets/js/chunks/sieve-BKBZYDBU.js +1 -0
- package/public/assets/js/chunks/sk-SK-CKZHQ4AP-6O5JGN26.js +7 -0
- package/public/assets/js/chunks/sl-SI-557H2GWM-2NEHLV7W.js +6 -0
- package/public/assets/js/chunks/smalltalk-WRJQKJSD.js +1 -0
- package/public/assets/js/chunks/solr-66B3BIDL.js +1 -0
- package/public/assets/js/chunks/sparql-S25Z47JG.js +1 -0
- package/public/assets/js/chunks/spreadsheet-B272EF7Y.js +1 -0
- package/public/assets/js/chunks/sql-BPLIIUYC.js +1 -0
- package/public/assets/js/chunks/stateDiagram-RAJIS63D-OF5XXRUS.js +1 -0
- package/public/assets/js/chunks/stateDiagram-v2-FVOUBMTO-IV2CSQSQ.js +1 -0
- package/public/assets/js/chunks/stex-4IJY64QX.js +1 -0
- package/public/assets/js/chunks/stylus-PJUHLGPT.js +1 -0
- package/public/assets/js/chunks/subset-shared.chunk-4NMWHS4D.js +1 -0
- package/public/assets/js/chunks/subset-worker.chunk-NTLP7Y66.js +1 -0
- package/public/assets/js/chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js +8 -0
- package/public/assets/js/chunks/swift-UYHTO4SX.js +1 -0
- package/public/assets/js/chunks/ta-IN-XBH7DQI3-ISSUGZAK.js +6 -0
- package/public/assets/js/chunks/tcl-OQ5J3VO2.js +1 -0
- package/public/assets/js/chunks/textile-NOGVBEYF.js +1 -0
- package/public/assets/js/chunks/th-TH-TOCWH3R4-TABEAMJA.js +1 -0
- package/public/assets/js/chunks/tiddlywiki-SYTK4QUE.js +1 -0
- package/public/assets/js/chunks/tiki-P7K4ZLOM.js +1 -0
- package/public/assets/js/chunks/timeline-definition-YZTLITO2-HBCANIUC.js +61 -0
- package/public/assets/js/chunks/toml-AUZYRP36.js +1 -0
- package/public/assets/js/chunks/tr-TR-GXW6CYY5-5NQRN52Y.js +4 -0
- package/public/assets/js/chunks/treemap-KZPCXAKY-WYMCT5F7.js +1 -0
- package/public/assets/js/chunks/troff-XFYJNQOJ.js +1 -0
- package/public/assets/js/chunks/ttcn-AK2IXWU6.js +1 -0
- package/public/assets/js/chunks/ttcn-cfg-3IDPIYPU.js +1 -0
- package/public/assets/js/chunks/turtle-OIDMF46P.js +1 -0
- package/public/assets/js/chunks/uk-UA-IJKTNUDG-2IIL3TO5.js +6 -0
- package/public/assets/js/chunks/uz-UZ-TBZZEA4V-X22KVKBP.js +1 -0
- package/public/assets/js/chunks/vb-J6K4XVA2.js +1 -0
- package/public/assets/js/chunks/vbscript-FM7DDZZE.js +1 -0
- package/public/assets/js/chunks/velocity-6KZFEOFD.js +1 -0
- package/public/assets/js/chunks/vennDiagram-LZ73GAT5-EBRF3MZR.js +34 -0
- package/public/assets/js/chunks/verilog-EWWQPMNN.js +1 -0
- package/public/assets/js/chunks/vhdl-CJ3M4IHI.js +1 -0
- package/public/assets/js/chunks/vi-VN-MULSGNVB-TENM65C7.js +7 -0
- package/public/assets/js/chunks/webidl-XVBHXCRV.js +1 -0
- package/public/assets/js/chunks/xquery-7WZOZ4UK.js +1 -0
- package/public/assets/js/chunks/xychartDiagram-JWTSCODW-WIFVRQPR.js +7 -0
- package/public/assets/js/chunks/yacas-MZ2ZZPF3.js +1 -0
- package/public/assets/js/chunks/z80-I447CBF7.js +1 -0
- package/public/assets/js/chunks/zh-CN-MVX3E32U-S5VA2BA5.js +11 -0
- package/public/assets/js/chunks/zh-HK-JNU5RLIE-A4VUKZFV.js +1 -0
- package/public/assets/js/chunks/zh-TW-LENVCA6T-KFB6KHMM.js +9 -0
- package/public/assets/js/excalidraw-editor-7ORML5YA.css +1 -0
- package/public/assets/js/excalidraw-editor-LKW2AZBU.js +347 -0
- package/public/assets/js/excalidraw-editor.css +1 -0
- package/public/assets/js/excalidraw-editor.js +1 -0
- package/public/assets/js/main.js +354 -0
- package/public/assets/js/preview-render-worker.js +30 -0
- package/public/assets/vendor/highlight/github-dark.min.css +10 -0
- package/public/assets/vendor/highlight/github.min.css +10 -0
- package/public/excalidraw-editor.html +31 -0
- package/public/index.html +549 -0
- package/scripts/cloudflare-tunnel.mjs +145 -0
- package/scripts/local-plantuml-compose.mjs +92 -0
- package/server.js +1 -0
- package/src/client/application/app-shell/chat-feature.js +363 -0
- package/src/client/application/app-shell/comments-feature.js +33 -0
- package/src/client/application/app-shell/git-feature.js +394 -0
- package/src/client/application/app-shell/presence-feature.js +229 -0
- package/src/client/application/app-shell/ui-feature.js +535 -0
- package/src/client/application/app-shell/workspace-feature.js +132 -0
- package/src/client/application/app-shell-elements.js +78 -0
- package/src/client/application/diagram-preview-hydrator.js +382 -0
- package/src/client/application/file-open-lifecycle.js +26 -0
- package/src/client/application/mermaid-preview-hydrator.js +570 -0
- package/src/client/application/plantuml-preview-hydrator.js +563 -0
- package/src/client/application/preview-diagram-utils.js +223 -0
- package/src/client/application/preview-render-compiler.js +426 -0
- package/src/client/application/preview-render-executor.js +153 -0
- package/src/client/application/preview-render-profile.js +63 -0
- package/src/client/application/preview-render-scheduler.js +73 -0
- package/src/client/application/preview-render-worker.js +19 -0
- package/src/client/application/preview-renderer.js +452 -0
- package/src/client/application/wiki-link-file-controller.js +58 -0
- package/src/client/application/workspace-chrome-controller.js +84 -0
- package/src/client/application/workspace-coordinator.js +238 -0
- package/src/client/application/workspace-preview-controller.js +237 -0
- package/src/client/application/workspace-route-controller.js +170 -0
- package/src/client/application/workspace-state-store.js +46 -0
- package/src/client/bootstrap/collabmd-app-shell.js +479 -0
- package/src/client/domain/diagram-action-icons.js +41 -0
- package/src/client/domain/excalidraw-collaboration.js +153 -0
- package/src/client/domain/excalidraw-scene.js +87 -0
- package/src/client/domain/markdown-formatting.js +370 -0
- package/src/client/domain/plantuml-language.js +226 -0
- package/src/client/domain/room.js +49 -0
- package/src/client/domain/runtime-paths.js +136 -0
- package/src/client/domain/vault-api-client.js +1 -0
- package/src/client/domain/vault-paths.js +80 -0
- package/src/client/domain/vault-utils.js +49 -0
- package/src/client/domain/wiki-link-completions.js +78 -0
- package/src/client/excalidraw-editor.js +630 -0
- package/src/client/excalidraw-mermaid-stub.js +7 -0
- package/src/client/infrastructure/auth-client.js +383 -0
- package/src/client/infrastructure/browser-navigation-port.js +19 -0
- package/src/client/infrastructure/browser-notification-port.js +40 -0
- package/src/client/infrastructure/browser-preferences-port.js +79 -0
- package/src/client/infrastructure/comment-thread-store.js +293 -0
- package/src/client/infrastructure/editor-collaboration-client.js +240 -0
- package/src/client/infrastructure/editor-session.js +255 -0
- package/src/client/infrastructure/editor-view-adapter.js +578 -0
- package/src/client/infrastructure/excalidraw-room-client.js +651 -0
- package/src/client/infrastructure/lobby-presence.js +304 -0
- package/src/client/infrastructure/runtime-config.js +65 -0
- package/src/client/infrastructure/tab-activity-lock.js +193 -0
- package/src/client/infrastructure/vault-api-client.js +61 -0
- package/src/client/infrastructure/yjs-provider-reset-guard.js +19 -0
- package/src/client/main.js +16 -0
- package/src/client/mermaid-runtime.js +3 -0
- package/src/client/presentation/backlinks-panel.js +188 -0
- package/src/client/presentation/comment-ui-controller.js +1235 -0
- package/src/client/presentation/comments-panel.js +531 -0
- package/src/client/presentation/excalidraw-embed-controller.js +968 -0
- package/src/client/presentation/excalidraw-embed-reconciler.js +37 -0
- package/src/client/presentation/file-action-controller.js +596 -0
- package/src/client/presentation/file-explorer-controller.js +81 -0
- package/src/client/presentation/file-explorer-view.js +256 -0
- package/src/client/presentation/file-tree-state.js +77 -0
- package/src/client/presentation/git-diff-view-controller.js +656 -0
- package/src/client/presentation/git-panel-controller.js +516 -0
- package/src/client/presentation/layout-controller.js +222 -0
- package/src/client/presentation/outline-controller.js +239 -0
- package/src/client/presentation/quick-switcher-controller.js +300 -0
- package/src/client/presentation/scroll-sync-controller.js +500 -0
- package/src/client/presentation/theme-controller.js +64 -0
- package/src/client/presentation/toast-controller.js +21 -0
- package/src/client/presentation/video-embed-controller.js +264 -0
- package/src/client/styles/base.css +58 -0
- package/src/client/styles/style.css +4245 -0
- package/src/domain/comment-threads.js +233 -0
- package/src/domain/excalidraw-room-codec.js +427 -0
- package/src/domain/file-kind.js +104 -0
- package/src/domain/wiki-link-resolver.js +75 -0
- package/src/server/auth/create-auth-service.js +272 -0
- package/src/server/auth/session-cookie.js +125 -0
- package/src/server/config/env.js +186 -0
- package/src/server/create-app-server.js +143 -0
- package/src/server/domain/backlink-index.js +291 -0
- package/src/server/domain/collaboration/collaboration-document-store.js +155 -0
- package/src/server/domain/collaboration/collaboration-room.js +603 -0
- package/src/server/domain/collaboration/protocol.js +2 -0
- package/src/server/domain/collaboration/room-client-state-store.js +28 -0
- package/src/server/domain/collaboration/room-persistence-controller.js +80 -0
- package/src/server/domain/collaboration/room-registry.js +94 -0
- package/src/server/domain/git-service.js +1 -0
- package/src/server/domain/plantuml-encoder.js +49 -0
- package/src/server/domain/plantuml-renderer.js +1 -0
- package/src/server/index.js +72 -0
- package/src/server/infrastructure/git/command-runner.js +48 -0
- package/src/server/infrastructure/git/concurrency.js +19 -0
- package/src/server/infrastructure/git/diff-service.js +389 -0
- package/src/server/infrastructure/git/errors.js +5 -0
- package/src/server/infrastructure/git/git-service.js +216 -0
- package/src/server/infrastructure/git/parsers.js +401 -0
- package/src/server/infrastructure/git/path-utils.js +65 -0
- package/src/server/infrastructure/git/responses.js +108 -0
- package/src/server/infrastructure/git/status-service.js +99 -0
- package/src/server/infrastructure/git/untracked-files.js +101 -0
- package/src/server/infrastructure/http/create-auth-api-handler.js +48 -0
- package/src/server/infrastructure/http/create-esm-proxy-handler.js +130 -0
- package/src/server/infrastructure/http/create-git-api-command-handler.js +170 -0
- package/src/server/infrastructure/http/create-git-api-handler.js +40 -0
- package/src/server/infrastructure/http/create-git-api-query-handler.js +62 -0
- package/src/server/infrastructure/http/create-plantuml-api-handler.js +43 -0
- package/src/server/infrastructure/http/create-request-handler.js +138 -0
- package/src/server/infrastructure/http/create-static-handler.js +167 -0
- package/src/server/infrastructure/http/create-vault-api-command-handler.js +161 -0
- package/src/server/infrastructure/http/create-vault-api-handler.js +43 -0
- package/src/server/infrastructure/http/create-vault-api-query-handler.js +82 -0
- package/src/server/infrastructure/http/http-errors.js +13 -0
- package/src/server/infrastructure/http/http-response.js +167 -0
- package/src/server/infrastructure/http/request-body.js +56 -0
- package/src/server/infrastructure/persistence/path-utils.js +90 -0
- package/src/server/infrastructure/persistence/sidecar-store.js +150 -0
- package/src/server/infrastructure/persistence/vault-content-adapter.js +49 -0
- package/src/server/infrastructure/persistence/vault-file-store.js +435 -0
- package/src/server/infrastructure/plantuml/plantuml-renderer.js +56 -0
- package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +194 -0
- package/src/server/infrastructure/websocket/client-socket-session.js +151 -0
- package/src/server/startup/git-remote-bootstrap.js +435 -0
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { resolve } from 'path';
|
|
2
|
+
import { fileURLToPath } from 'url';
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AUTH_STRATEGY_NONE,
|
|
6
|
+
AUTH_STRATEGY_PASSWORD,
|
|
7
|
+
SUPPORTED_AUTH_STRATEGIES,
|
|
8
|
+
createRandomAuthPassword,
|
|
9
|
+
createRandomSessionSecret,
|
|
10
|
+
} from '../auth/create-auth-service.js';
|
|
11
|
+
|
|
12
|
+
function parsePositiveInt(rawValue, fallbackValue) {
|
|
13
|
+
const parsed = Number.parseInt(rawValue ?? '', 10);
|
|
14
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : fallbackValue;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function parsePort(rawPort, fallbackPort) {
|
|
18
|
+
return parsePositiveInt(rawPort, fallbackPort);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function normalizeOptionalString(value) {
|
|
22
|
+
const normalized = String(value ?? '').trim();
|
|
23
|
+
return normalized.length > 0 ? normalized : '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function normalizeAppBasePath(basePath) {
|
|
27
|
+
const normalized = normalizeOptionalString(basePath);
|
|
28
|
+
if (!normalized || normalized === '/') {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (/^[a-zA-Z][a-zA-Z\d+.-]*:/u.test(normalized)) {
|
|
33
|
+
try {
|
|
34
|
+
return normalizeAppBasePath(new URL(normalized).pathname);
|
|
35
|
+
} catch {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const trimmed = normalized.startsWith('/') ? normalized : `/${normalized}`;
|
|
41
|
+
return trimmed.endsWith('/') ? trimmed.slice(0, -1) : trimmed;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function normalizeRoutePath(routePath, fallbackPath) {
|
|
45
|
+
if (!routePath || routePath === '/') {
|
|
46
|
+
return fallbackPath;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const trimmed = routePath.startsWith('/') ? routePath : `/${routePath}`;
|
|
50
|
+
return trimmed.endsWith('/') ? trimmed.slice(0, -1) : trimmed;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function normalizeWsBasePath(basePath) {
|
|
54
|
+
return normalizeRoutePath(basePath, '/ws');
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function normalizeAuthStrategy(rawStrategy) {
|
|
58
|
+
const normalized = String(rawStrategy ?? AUTH_STRATEGY_NONE).trim().toLowerCase();
|
|
59
|
+
if (!SUPPORTED_AUTH_STRATEGIES.has(normalized)) {
|
|
60
|
+
throw new Error(
|
|
61
|
+
`Unsupported auth strategy "${rawStrategy}". Supported values: ${Array.from(SUPPORTED_AUTH_STRATEGIES).join(', ')}`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return normalized;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const projectRoot = resolve(fileURLToPath(new URL('../../../', import.meta.url)));
|
|
69
|
+
|
|
70
|
+
function getDefaultHost(nodeEnv) {
|
|
71
|
+
return nodeEnv === 'production' ? '0.0.0.0' : '127.0.0.1';
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function resolveOptionalPath(filePath) {
|
|
75
|
+
const normalized = normalizeOptionalString(filePath);
|
|
76
|
+
return normalized ? resolve(normalized) : '';
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function loadGitConfig(overrides = {}) {
|
|
80
|
+
const remoteOverrides = overrides.remote ?? {};
|
|
81
|
+
const identityOverrides = overrides.identity ?? {};
|
|
82
|
+
const enabled = overrides.enabled ?? (process.env.COLLABMD_GIT_ENABLED !== 'false');
|
|
83
|
+
const repoUrl = normalizeOptionalString(
|
|
84
|
+
remoteOverrides.repoUrl
|
|
85
|
+
?? process.env.COLLABMD_GIT_REPO_URL,
|
|
86
|
+
);
|
|
87
|
+
const identityName = normalizeOptionalString(
|
|
88
|
+
identityOverrides.name
|
|
89
|
+
?? process.env.COLLABMD_GIT_USER_NAME
|
|
90
|
+
?? process.env.GIT_AUTHOR_NAME
|
|
91
|
+
?? process.env.GIT_COMMITTER_NAME,
|
|
92
|
+
);
|
|
93
|
+
const identityEmail = normalizeOptionalString(
|
|
94
|
+
identityOverrides.email
|
|
95
|
+
?? process.env.COLLABMD_GIT_USER_EMAIL
|
|
96
|
+
?? process.env.GIT_AUTHOR_EMAIL
|
|
97
|
+
?? process.env.GIT_COMMITTER_EMAIL,
|
|
98
|
+
);
|
|
99
|
+
const sshPrivateKeyFile = resolveOptionalPath(
|
|
100
|
+
remoteOverrides.sshPrivateKeyFile
|
|
101
|
+
?? process.env.COLLABMD_GIT_SSH_PRIVATE_KEY_FILE,
|
|
102
|
+
);
|
|
103
|
+
const sshPrivateKeyBase64 = normalizeOptionalString(
|
|
104
|
+
remoteOverrides.sshPrivateKeyBase64
|
|
105
|
+
?? process.env.COLLABMD_GIT_SSH_PRIVATE_KEY_B64,
|
|
106
|
+
);
|
|
107
|
+
const sshKnownHostsFile = resolveOptionalPath(
|
|
108
|
+
remoteOverrides.sshKnownHostsFile
|
|
109
|
+
?? process.env.COLLABMD_GIT_SSH_KNOWN_HOSTS_FILE,
|
|
110
|
+
);
|
|
111
|
+
const remoteEnabled = repoUrl.length > 0;
|
|
112
|
+
|
|
113
|
+
if (remoteEnabled && !sshPrivateKeyFile && !sshPrivateKeyBase64) {
|
|
114
|
+
throw new Error(
|
|
115
|
+
'Remote git bootstrap requires COLLABMD_GIT_SSH_PRIVATE_KEY_FILE or COLLABMD_GIT_SSH_PRIVATE_KEY_B64.',
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
cleanup: overrides.cleanup ?? null,
|
|
121
|
+
commandEnv: overrides.commandEnv ?? null,
|
|
122
|
+
enabled,
|
|
123
|
+
identity: {
|
|
124
|
+
email: identityEmail,
|
|
125
|
+
name: identityName,
|
|
126
|
+
},
|
|
127
|
+
remote: {
|
|
128
|
+
enabled: remoteEnabled,
|
|
129
|
+
repoUrl,
|
|
130
|
+
sshKnownHostsFile,
|
|
131
|
+
sshPrivateKeyBase64,
|
|
132
|
+
sshPrivateKeyFile,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function loadConfig(overrides = {}) {
|
|
138
|
+
const nodeEnv = process.env.NODE_ENV || 'development';
|
|
139
|
+
const vaultDir = overrides.vaultDir
|
|
140
|
+
|| process.env.COLLABMD_VAULT_DIR
|
|
141
|
+
|| resolve(projectRoot, 'data/vault');
|
|
142
|
+
const authOverrides = overrides.auth ?? {};
|
|
143
|
+
const authStrategy = normalizeAuthStrategy(
|
|
144
|
+
authOverrides.strategy
|
|
145
|
+
?? process.env.AUTH_STRATEGY
|
|
146
|
+
?? AUTH_STRATEGY_NONE,
|
|
147
|
+
);
|
|
148
|
+
const passwordWasGenerated = authStrategy === AUTH_STRATEGY_PASSWORD
|
|
149
|
+
&& !(authOverrides.password || process.env.AUTH_PASSWORD);
|
|
150
|
+
const password = authStrategy === AUTH_STRATEGY_PASSWORD
|
|
151
|
+
? (authOverrides.password || process.env.AUTH_PASSWORD || createRandomAuthPassword())
|
|
152
|
+
: '';
|
|
153
|
+
const git = loadGitConfig(overrides.git);
|
|
154
|
+
|
|
155
|
+
return {
|
|
156
|
+
auth: {
|
|
157
|
+
generatedPassword: passwordWasGenerated ? password : '',
|
|
158
|
+
password,
|
|
159
|
+
passwordWasGenerated,
|
|
160
|
+
sessionCookieName: authOverrides.sessionCookieName || process.env.AUTH_SESSION_COOKIE_NAME || 'collabmd_auth',
|
|
161
|
+
sessionSecret: authOverrides.sessionSecret || process.env.AUTH_SESSION_SECRET || createRandomSessionSecret(),
|
|
162
|
+
strategy: authStrategy,
|
|
163
|
+
},
|
|
164
|
+
basePath: normalizeAppBasePath(process.env.BASE_PATH || ''),
|
|
165
|
+
host: process.env.HOST || getDefaultHost(nodeEnv),
|
|
166
|
+
httpHeadersTimeoutMs: parsePositiveInt(process.env.HTTP_HEADERS_TIMEOUT_MS, 60_000),
|
|
167
|
+
httpKeepAliveTimeoutMs: parsePositiveInt(process.env.HTTP_KEEP_ALIVE_TIMEOUT_MS, 5_000),
|
|
168
|
+
httpRequestTimeoutMs: parsePositiveInt(process.env.HTTP_REQUEST_TIMEOUT_MS, 30_000),
|
|
169
|
+
git,
|
|
170
|
+
gitEnabled: git.enabled,
|
|
171
|
+
port: parsePort(process.env.PORT, 1234),
|
|
172
|
+
nodeEnv,
|
|
173
|
+
plantumlServerUrl: process.env.PLANTUML_SERVER_URL || 'https://www.plantuml.com/plantuml',
|
|
174
|
+
publicDir: resolve(projectRoot, 'public'),
|
|
175
|
+
vaultDir,
|
|
176
|
+
publicWsBaseUrl: process.env.PUBLIC_WS_BASE_URL || '',
|
|
177
|
+
wsHeartbeatIntervalMs: parsePositiveInt(process.env.WS_HEARTBEAT_INTERVAL_MS, 30_000),
|
|
178
|
+
wsRoomIdleGraceMs: parsePositiveInt(process.env.WS_ROOM_IDLE_GRACE_MS, 15_000),
|
|
179
|
+
wsBasePath: normalizeWsBasePath(process.env.WS_BASE_PATH || '/ws'),
|
|
180
|
+
wsMaxBufferedAmountBytes: parsePositiveInt(
|
|
181
|
+
process.env.WS_MAX_BUFFERED_AMOUNT_BYTES,
|
|
182
|
+
16_777_216,
|
|
183
|
+
),
|
|
184
|
+
wsMaxPayloadBytes: parsePositiveInt(process.env.WS_MAX_PAYLOAD_BYTES, 16_777_216),
|
|
185
|
+
};
|
|
186
|
+
}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { createServer } from 'http';
|
|
2
|
+
|
|
3
|
+
import { loadConfig } from './config/env.js';
|
|
4
|
+
import { createAuthService } from './auth/create-auth-service.js';
|
|
5
|
+
import { BacklinkIndex } from './domain/backlink-index.js';
|
|
6
|
+
import { CollaborationDocumentStore } from './domain/collaboration/collaboration-document-store.js';
|
|
7
|
+
import { CollaborationRoom } from './domain/collaboration/collaboration-room.js';
|
|
8
|
+
import { GitService } from './infrastructure/git/git-service.js';
|
|
9
|
+
import { PlantUmlRenderer } from './infrastructure/plantuml/plantuml-renderer.js';
|
|
10
|
+
import { RoomRegistry } from './domain/collaboration/room-registry.js';
|
|
11
|
+
import { createRequestHandler } from './infrastructure/http/create-request-handler.js';
|
|
12
|
+
import { VaultFileStore } from './infrastructure/persistence/vault-file-store.js';
|
|
13
|
+
import { attachCollaborationGateway } from './infrastructure/websocket/attach-collaboration-gateway.js';
|
|
14
|
+
|
|
15
|
+
function getDisplayHost(host) {
|
|
16
|
+
return host === '127.0.0.1' ? 'localhost' : host;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function closeHttpServer(httpServer) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
httpServer.close((error) => {
|
|
22
|
+
if (error) {
|
|
23
|
+
reject(error);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
resolve();
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (typeof httpServer.closeIdleConnections === 'function') {
|
|
31
|
+
httpServer.closeIdleConnections();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createAppServer(config = loadConfig()) {
|
|
37
|
+
const authService = createAuthService(config);
|
|
38
|
+
const vaultFileStore = new VaultFileStore({ vaultDir: config.vaultDir });
|
|
39
|
+
const backlinkIndex = new BacklinkIndex({ vaultFileStore });
|
|
40
|
+
const plantUmlRenderer = new PlantUmlRenderer({
|
|
41
|
+
serverUrl: config.plantumlServerUrl,
|
|
42
|
+
});
|
|
43
|
+
const gitService = new GitService({
|
|
44
|
+
commandEnv: config.git?.commandEnv,
|
|
45
|
+
enabled: config.gitEnabled,
|
|
46
|
+
vaultDir: config.vaultDir,
|
|
47
|
+
});
|
|
48
|
+
const roomRegistry = new RoomRegistry({
|
|
49
|
+
createRoom: ({ name, onEmpty }) => new CollaborationRoom({
|
|
50
|
+
documentStore: new CollaborationDocumentStore({
|
|
51
|
+
backlinkIndex: name === '__lobby__' ? null : backlinkIndex,
|
|
52
|
+
name,
|
|
53
|
+
vaultFileStore: name === '__lobby__' ? null : vaultFileStore,
|
|
54
|
+
}),
|
|
55
|
+
idleGraceMs: config.wsRoomIdleGraceMs,
|
|
56
|
+
maxBufferedAmountBytes: config.wsMaxBufferedAmountBytes,
|
|
57
|
+
name,
|
|
58
|
+
onEmpty,
|
|
59
|
+
}),
|
|
60
|
+
});
|
|
61
|
+
const requestHandler = createRequestHandler(
|
|
62
|
+
config,
|
|
63
|
+
authService,
|
|
64
|
+
vaultFileStore,
|
|
65
|
+
backlinkIndex,
|
|
66
|
+
roomRegistry,
|
|
67
|
+
plantUmlRenderer,
|
|
68
|
+
gitService,
|
|
69
|
+
);
|
|
70
|
+
const httpServer = createServer((req, res) => {
|
|
71
|
+
requestHandler(req, res).catch((error) => {
|
|
72
|
+
console.error('[http] Unhandled request error:', error.message);
|
|
73
|
+
if (!res.headersSent) {
|
|
74
|
+
res.writeHead(500, { 'Content-Type': 'text/plain; charset=utf-8' });
|
|
75
|
+
}
|
|
76
|
+
res.end('Internal Server Error');
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
httpServer.headersTimeout = config.httpHeadersTimeoutMs;
|
|
80
|
+
httpServer.keepAliveTimeout = config.httpKeepAliveTimeoutMs;
|
|
81
|
+
httpServer.requestTimeout = config.httpRequestTimeoutMs;
|
|
82
|
+
const collaborationGateway = attachCollaborationGateway({
|
|
83
|
+
authService,
|
|
84
|
+
basePath: config.basePath,
|
|
85
|
+
heartbeatIntervalMs: config.wsHeartbeatIntervalMs,
|
|
86
|
+
maxPayload: config.wsMaxPayloadBytes,
|
|
87
|
+
httpServer,
|
|
88
|
+
roomRegistry,
|
|
89
|
+
wsBasePath: config.wsBasePath,
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
let shutdownPromise = null;
|
|
93
|
+
let vaultFileCount = 0;
|
|
94
|
+
|
|
95
|
+
async function listen() {
|
|
96
|
+
vaultFileCount = await vaultFileStore.countVaultFiles();
|
|
97
|
+
await backlinkIndex.build();
|
|
98
|
+
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
httpServer.once('error', reject);
|
|
101
|
+
httpServer.listen(config.port, config.host, () => {
|
|
102
|
+
httpServer.off('error', reject);
|
|
103
|
+
const address = httpServer.address();
|
|
104
|
+
resolve({
|
|
105
|
+
address,
|
|
106
|
+
host: getDisplayHost(config.host),
|
|
107
|
+
port: typeof address === 'object' && address ? address.port : config.port,
|
|
108
|
+
wsPath: `${config.basePath || ''}${config.wsBasePath}/:file`,
|
|
109
|
+
});
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
async function close() {
|
|
115
|
+
if (shutdownPromise) {
|
|
116
|
+
return shutdownPromise;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
shutdownPromise = (async () => {
|
|
120
|
+
await collaborationGateway.close();
|
|
121
|
+
await roomRegistry.reset();
|
|
122
|
+
await Promise.all([
|
|
123
|
+
closeHttpServer(httpServer),
|
|
124
|
+
config.git?.cleanup?.(),
|
|
125
|
+
]);
|
|
126
|
+
})().then(() => undefined);
|
|
127
|
+
|
|
128
|
+
return shutdownPromise;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
close,
|
|
133
|
+
collaborationGateway,
|
|
134
|
+
config,
|
|
135
|
+
httpServer,
|
|
136
|
+
listen,
|
|
137
|
+
roomRegistry,
|
|
138
|
+
authService,
|
|
139
|
+
gitService,
|
|
140
|
+
vaultFileStore,
|
|
141
|
+
get vaultFileCount() { return vaultFileCount; },
|
|
142
|
+
};
|
|
143
|
+
}
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BacklinkIndex — an in-memory inverted index that tracks which files link
|
|
3
|
+
* to which other files via [[wiki links]].
|
|
4
|
+
*
|
|
5
|
+
* Maintains two maps:
|
|
6
|
+
* forward: sourcePath → Set<targetPath> (outgoing links from a file)
|
|
7
|
+
* reverse: targetPath → Set<sourcePath> (incoming links to a file — backlinks)
|
|
8
|
+
*
|
|
9
|
+
* The index is built from the vault at startup, then kept in sync
|
|
10
|
+
* incrementally whenever a file is persisted, created, deleted, or renamed.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { createWikiTargetIndex, resolveWikiTargetWithIndex } from '../../domain/wiki-link-resolver.js';
|
|
14
|
+
|
|
15
|
+
const WIKI_LINK_RE = /\[\[([^\]|]+)(?:\|[^\]]+)?\]\]/g;
|
|
16
|
+
|
|
17
|
+
export class BacklinkIndex {
|
|
18
|
+
constructor({ vaultFileStore }) {
|
|
19
|
+
this.vaultFileStore = vaultFileStore;
|
|
20
|
+
/** @type {Map<string, Set<string>>} sourcePath → set of resolved target paths */
|
|
21
|
+
this.forward = new Map();
|
|
22
|
+
/** @type {Map<string, Set<string>>} targetPath → set of source paths */
|
|
23
|
+
this.reverse = new Map();
|
|
24
|
+
/** @type {Map<string, Map<string, string[]>>} sourcePath → targetPath → contexts[] */
|
|
25
|
+
this.contextsBySource = new Map();
|
|
26
|
+
/** @type {string[]} cached flat file list for link resolution */
|
|
27
|
+
this._fileList = [];
|
|
28
|
+
/** @type {Set<string>} file path membership set */
|
|
29
|
+
this._fileSet = new Set();
|
|
30
|
+
this._wikiTargetIndex = createWikiTargetIndex(this._fileList);
|
|
31
|
+
this._built = false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Build the full index by scanning every markdown file in the vault.
|
|
36
|
+
* Called once at server startup.
|
|
37
|
+
*/
|
|
38
|
+
async build() {
|
|
39
|
+
this.forward.clear();
|
|
40
|
+
this.reverse.clear();
|
|
41
|
+
this.contextsBySource.clear();
|
|
42
|
+
|
|
43
|
+
const tree = await this.vaultFileStore.tree();
|
|
44
|
+
this._fileList = flattenTree(tree);
|
|
45
|
+
this._fileSet = new Set(this._fileList);
|
|
46
|
+
this._refreshWikiTargetIndex();
|
|
47
|
+
|
|
48
|
+
for (const filePath of this._fileList) {
|
|
49
|
+
const content = await this.vaultFileStore.readMarkdownFile(filePath);
|
|
50
|
+
if (content !== null) {
|
|
51
|
+
this._indexFile(filePath, content);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
this._built = true;
|
|
56
|
+
console.log(`[backlinks] Index built: ${this._fileList.length} files, ${this.reverse.size} targets with backlinks`);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Incrementally update the index when a file's content changes.
|
|
61
|
+
* Call this after every persist / write.
|
|
62
|
+
*/
|
|
63
|
+
updateFile(filePath, content) {
|
|
64
|
+
// Remove old forward links for this file
|
|
65
|
+
this._removeForwardLinks(filePath);
|
|
66
|
+
|
|
67
|
+
if (!this._fileSet.has(filePath)) {
|
|
68
|
+
this._fileSet.add(filePath);
|
|
69
|
+
this._fileList.push(filePath);
|
|
70
|
+
this._refreshWikiTargetIndex();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Re-index with new content
|
|
74
|
+
this._indexFile(filePath, content);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Handle file creation — add to file list and index its content.
|
|
79
|
+
*/
|
|
80
|
+
onFileCreated(filePath, content = '') {
|
|
81
|
+
if (!this._fileSet.has(filePath)) {
|
|
82
|
+
this._fileSet.add(filePath);
|
|
83
|
+
this._fileList.push(filePath);
|
|
84
|
+
this._refreshWikiTargetIndex();
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (content) {
|
|
88
|
+
this._indexFile(filePath, content);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Handle file deletion — remove from file list and all index entries.
|
|
94
|
+
*/
|
|
95
|
+
onFileDeleted(filePath) {
|
|
96
|
+
this._removeForwardLinks(filePath);
|
|
97
|
+
if (this._fileSet.delete(filePath)) {
|
|
98
|
+
this._fileList = this._fileList.filter((f) => f !== filePath);
|
|
99
|
+
this._refreshWikiTargetIndex();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Also remove this file as a reverse entry (no one can link to a deleted file)
|
|
103
|
+
this.reverse.delete(filePath);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Handle file rename — re-map all index entries from oldPath to newPath.
|
|
108
|
+
*/
|
|
109
|
+
onFileRenamed(oldPath, newPath) {
|
|
110
|
+
// Move cached contexts for the renamed source file.
|
|
111
|
+
if (this.contextsBySource.has(oldPath)) {
|
|
112
|
+
const sourceContexts = this.contextsBySource.get(oldPath);
|
|
113
|
+
this.contextsBySource.delete(oldPath);
|
|
114
|
+
this.contextsBySource.set(newPath, sourceContexts);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Move forward links
|
|
118
|
+
const oldForward = this.forward.get(oldPath);
|
|
119
|
+
if (oldForward) {
|
|
120
|
+
this.forward.delete(oldPath);
|
|
121
|
+
this.forward.set(newPath, oldForward);
|
|
122
|
+
|
|
123
|
+
// Update reverse entries: replace oldPath with newPath in all targets
|
|
124
|
+
for (const targetPath of oldForward) {
|
|
125
|
+
const sources = this.reverse.get(targetPath);
|
|
126
|
+
if (sources) {
|
|
127
|
+
sources.delete(oldPath);
|
|
128
|
+
sources.add(newPath);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// Move reverse links (files that linked to oldPath now link to newPath)
|
|
134
|
+
const oldReverse = this.reverse.get(oldPath);
|
|
135
|
+
if (oldReverse) {
|
|
136
|
+
this.reverse.delete(oldPath);
|
|
137
|
+
const mergedReverse = this.reverse.has(newPath)
|
|
138
|
+
? new Set([...this.reverse.get(newPath), ...oldReverse])
|
|
139
|
+
: oldReverse;
|
|
140
|
+
this.reverse.set(newPath, mergedReverse);
|
|
141
|
+
|
|
142
|
+
// Update forward entries: replace oldPath with newPath in all sources
|
|
143
|
+
for (const sourcePath of oldReverse) {
|
|
144
|
+
const targets = this.forward.get(sourcePath);
|
|
145
|
+
if (targets) {
|
|
146
|
+
targets.delete(oldPath);
|
|
147
|
+
targets.add(newPath);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const sourceContexts = this.contextsBySource.get(sourcePath);
|
|
151
|
+
if (sourceContexts?.has(oldPath)) {
|
|
152
|
+
const previous = sourceContexts.get(newPath) ?? [];
|
|
153
|
+
sourceContexts.set(newPath, [...previous, ...sourceContexts.get(oldPath)]);
|
|
154
|
+
sourceContexts.delete(oldPath);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Update file list
|
|
160
|
+
if (this._fileSet.delete(oldPath)) {
|
|
161
|
+
this._fileSet.add(newPath);
|
|
162
|
+
this._fileList = this._fileList.map((f) => (f === oldPath ? newPath : f));
|
|
163
|
+
this._refreshWikiTargetIndex();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Get all backlinks for a file, with context snippets.
|
|
169
|
+
* Returns: [{ file: string, contexts: string[] }]
|
|
170
|
+
*/
|
|
171
|
+
async getBacklinks(filePath) {
|
|
172
|
+
const sources = this.reverse.get(filePath);
|
|
173
|
+
if (!sources || sources.size === 0) {
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const results = [];
|
|
178
|
+
|
|
179
|
+
for (const sourcePath of sources) {
|
|
180
|
+
const sourceContexts = this.contextsBySource.get(sourcePath);
|
|
181
|
+
const relevantContexts = sourceContexts?.get(filePath) ?? [];
|
|
182
|
+
|
|
183
|
+
if (relevantContexts.length > 0) {
|
|
184
|
+
results.push({
|
|
185
|
+
file: sourcePath,
|
|
186
|
+
contexts: [...relevantContexts],
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Sort by filename for stable ordering
|
|
192
|
+
results.sort((a, b) => a.file.localeCompare(b.file));
|
|
193
|
+
return results;
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Get the count of backlinks for a file (cheap — no I/O).
|
|
198
|
+
*/
|
|
199
|
+
getBacklinkCount(filePath) {
|
|
200
|
+
return this.reverse.get(filePath)?.size ?? 0;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// --- Private methods ---
|
|
204
|
+
|
|
205
|
+
_indexFile(filePath, content) {
|
|
206
|
+
const resolvedTargets = new Set();
|
|
207
|
+
const contextsByTarget = new Map();
|
|
208
|
+
const lines = content.split('\n');
|
|
209
|
+
|
|
210
|
+
for (const line of lines) {
|
|
211
|
+
WIKI_LINK_RE.lastIndex = 0;
|
|
212
|
+
let match;
|
|
213
|
+
while ((match = WIKI_LINK_RE.exec(line)) !== null) {
|
|
214
|
+
const target = match[1].trim();
|
|
215
|
+
if (!target) {
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const resolved = this._resolveTarget(target);
|
|
220
|
+
if (!resolved || resolved === filePath) {
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
resolvedTargets.add(resolved);
|
|
225
|
+
|
|
226
|
+
if (!contextsByTarget.has(resolved)) {
|
|
227
|
+
contextsByTarget.set(resolved, []);
|
|
228
|
+
}
|
|
229
|
+
contextsByTarget.get(resolved).push(line.trim());
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
this.contextsBySource.delete(filePath);
|
|
234
|
+
|
|
235
|
+
if (resolvedTargets.size > 0) {
|
|
236
|
+
this.contextsBySource.set(filePath, contextsByTarget);
|
|
237
|
+
this.forward.set(filePath, resolvedTargets);
|
|
238
|
+
|
|
239
|
+
for (const targetPath of resolvedTargets) {
|
|
240
|
+
if (!this.reverse.has(targetPath)) {
|
|
241
|
+
this.reverse.set(targetPath, new Set());
|
|
242
|
+
}
|
|
243
|
+
this.reverse.get(targetPath).add(filePath);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
_removeForwardLinks(filePath) {
|
|
249
|
+
this.contextsBySource.delete(filePath);
|
|
250
|
+
|
|
251
|
+
const oldTargets = this.forward.get(filePath);
|
|
252
|
+
if (!oldTargets) return;
|
|
253
|
+
|
|
254
|
+
for (const targetPath of oldTargets) {
|
|
255
|
+
const sources = this.reverse.get(targetPath);
|
|
256
|
+
if (sources) {
|
|
257
|
+
sources.delete(filePath);
|
|
258
|
+
if (sources.size === 0) {
|
|
259
|
+
this.reverse.delete(targetPath);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
this.forward.delete(filePath);
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Resolve a wiki-link target string to a vault file path.
|
|
269
|
+
* Same logic as the client's resolveWikiTarget.
|
|
270
|
+
*/
|
|
271
|
+
_resolveTarget(target) {
|
|
272
|
+
return resolveWikiTargetWithIndex(target, this._wikiTargetIndex);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
_refreshWikiTargetIndex() {
|
|
276
|
+
this._wikiTargetIndex = createWikiTargetIndex(this._fileList);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/** Flatten a vault tree into an array of file paths. */
|
|
281
|
+
function flattenTree(nodes) {
|
|
282
|
+
const files = [];
|
|
283
|
+
for (const node of nodes) {
|
|
284
|
+
if (node.type === 'file') {
|
|
285
|
+
files.push(node.path);
|
|
286
|
+
} else if (node.children) {
|
|
287
|
+
files.push(...flattenTree(node.children));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
return files;
|
|
291
|
+
}
|