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,435 @@
|
|
|
1
|
+
import { mkdir, readFile, readdir, rename, rm, stat, writeFile } from 'fs/promises';
|
|
2
|
+
import { dirname, join, resolve } from 'path';
|
|
3
|
+
|
|
4
|
+
import { getVaultTreeNodeType, isVaultFilePath } from '../../../domain/file-kind.js';
|
|
5
|
+
import { getVaultContentAdapter } from './vault-content-adapter.js';
|
|
6
|
+
import {
|
|
7
|
+
INVALID_VAULT_FILE_PATH_ERROR,
|
|
8
|
+
isIgnoredVaultEntry,
|
|
9
|
+
resolveVaultDirectoryPath,
|
|
10
|
+
resolveVaultFilePath,
|
|
11
|
+
resolveVaultRenamePaths,
|
|
12
|
+
sanitizeVaultPath,
|
|
13
|
+
toVaultRelativePath,
|
|
14
|
+
} from './path-utils.js';
|
|
15
|
+
import { SidecarStore } from './sidecar-store.js';
|
|
16
|
+
|
|
17
|
+
function createTransactionalPath(targetPath, label) {
|
|
18
|
+
return `${targetPath}.collabmd-${label}-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2, 10)}`;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function createCommentThreadsPayload(threads = []) {
|
|
22
|
+
return `${JSON.stringify({
|
|
23
|
+
threads,
|
|
24
|
+
version: 1,
|
|
25
|
+
}, null, 2)}\n`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function pathExists(pathValue) {
|
|
29
|
+
try {
|
|
30
|
+
await stat(pathValue);
|
|
31
|
+
return true;
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (error.code === 'ENOENT') {
|
|
34
|
+
return false;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
throw error;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async function cleanupPaths(paths = []) {
|
|
42
|
+
await Promise.allSettled(paths.filter(Boolean).map((pathValue) => rm(pathValue, { force: true })));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class VaultFileStore {
|
|
46
|
+
constructor({ vaultDir }) {
|
|
47
|
+
this.vaultDir = resolve(vaultDir);
|
|
48
|
+
this.sidecarStore = new SidecarStore({ vaultDir: this.vaultDir });
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async tree() {
|
|
52
|
+
return this.readDirectory(this.vaultDir);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async readDirectory(dirPath) {
|
|
56
|
+
const entries = [];
|
|
57
|
+
|
|
58
|
+
let dirEntries;
|
|
59
|
+
try {
|
|
60
|
+
dirEntries = await readdir(dirPath, { withFileTypes: true });
|
|
61
|
+
} catch {
|
|
62
|
+
return entries;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const sorted = dirEntries.sort((a, b) => {
|
|
66
|
+
if (a.isDirectory() && !b.isDirectory()) return -1;
|
|
67
|
+
if (!a.isDirectory() && b.isDirectory()) return 1;
|
|
68
|
+
return a.name.localeCompare(b.name, undefined, { sensitivity: 'base' });
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
for (const entry of sorted) {
|
|
72
|
+
if (isIgnoredVaultEntry(entry.name)) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const fullPath = join(dirPath, entry.name);
|
|
77
|
+
const relativePath = toVaultRelativePath(this.vaultDir, fullPath);
|
|
78
|
+
|
|
79
|
+
if (entry.isDirectory()) {
|
|
80
|
+
entries.push({
|
|
81
|
+
children: await this.readDirectory(fullPath),
|
|
82
|
+
name: entry.name,
|
|
83
|
+
path: relativePath,
|
|
84
|
+
type: 'directory',
|
|
85
|
+
});
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
if (isVaultFilePath(entry.name)) {
|
|
90
|
+
entries.push({
|
|
91
|
+
name: entry.name,
|
|
92
|
+
path: relativePath,
|
|
93
|
+
type: getVaultTreeNodeType(entry.name),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
return entries;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
resolveContentPath(filePath, { requireVaultFile = true } = {}) {
|
|
102
|
+
if (!requireVaultFile) {
|
|
103
|
+
return sanitizeVaultPath(this.vaultDir, filePath);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return resolveVaultFilePath(this.vaultDir, filePath).absolute;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
resolveAdapter(filePath) {
|
|
110
|
+
const absolute = this.resolveContentPath(filePath);
|
|
111
|
+
if (!absolute) {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const adapter = getVaultContentAdapter(absolute);
|
|
116
|
+
if (!adapter) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return { absolute, adapter };
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async readContentFile(filePath, expectedKind) {
|
|
124
|
+
const resolved = this.resolveAdapter(filePath);
|
|
125
|
+
if (!resolved || resolved.adapter.kind !== expectedKind) {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
try {
|
|
130
|
+
return await readFile(resolved.absolute, 'utf-8');
|
|
131
|
+
} catch (error) {
|
|
132
|
+
if (error.code === 'ENOENT') {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
throw error;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
async writeContentFile(filePath, content, expectedKind, { invalidateCollaborationSnapshot = true } = {}) {
|
|
141
|
+
const resolved = this.resolveAdapter(filePath);
|
|
142
|
+
if (!resolved || resolved.adapter.kind !== expectedKind) {
|
|
143
|
+
return {
|
|
144
|
+
ok: false,
|
|
145
|
+
error: resolved?.adapter?.invalidPathError ?? getVaultContentAdapter(filePath)?.invalidPathError ?? INVALID_VAULT_FILE_PATH_ERROR,
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
try {
|
|
150
|
+
await mkdir(dirname(resolved.absolute), { recursive: true });
|
|
151
|
+
await writeFile(resolved.absolute, content, 'utf-8');
|
|
152
|
+
if (invalidateCollaborationSnapshot) {
|
|
153
|
+
await this.deleteCollaborationSnapshot(filePath);
|
|
154
|
+
}
|
|
155
|
+
return { ok: true };
|
|
156
|
+
} catch (error) {
|
|
157
|
+
return { ok: false, error: error.message };
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
async readMarkdownFile(filePath) {
|
|
162
|
+
return this.readContentFile(filePath, 'markdown');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
async readExcalidrawFile(filePath) {
|
|
166
|
+
return this.readContentFile(filePath, 'excalidraw');
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
async readMermaidFile(filePath) {
|
|
170
|
+
return this.readContentFile(filePath, 'mermaid');
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
async readPlantUmlFile(filePath) {
|
|
174
|
+
return this.readContentFile(filePath, 'plantuml');
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
async writeMarkdownFile(filePath, content, options = {}) {
|
|
178
|
+
return this.writeContentFile(filePath, content, 'markdown', options);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async writeExcalidrawFile(filePath, content, options = {}) {
|
|
182
|
+
return this.writeContentFile(filePath, content, 'excalidraw', options);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
async writeMermaidFile(filePath, content, options = {}) {
|
|
186
|
+
return this.writeContentFile(filePath, content, 'mermaid', options);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
async writePlantUmlFile(filePath, content, options = {}) {
|
|
190
|
+
return this.writeContentFile(filePath, content, 'plantuml', options);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async persistCollaborationState(filePath, {
|
|
194
|
+
commentThreads = [],
|
|
195
|
+
content = '',
|
|
196
|
+
snapshot = null,
|
|
197
|
+
} = {}) {
|
|
198
|
+
const resolved = this.resolveAdapter(filePath);
|
|
199
|
+
if (!resolved) {
|
|
200
|
+
return {
|
|
201
|
+
ok: false,
|
|
202
|
+
error: getVaultContentAdapter(filePath)?.invalidPathError ?? INVALID_VAULT_FILE_PATH_ERROR,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
const operations = [
|
|
207
|
+
{
|
|
208
|
+
kind: Array.isArray(commentThreads) && commentThreads.length > 0 ? 'write' : 'delete',
|
|
209
|
+
targetPath: this.sidecarStore.getCommentThreadPath(filePath),
|
|
210
|
+
value: createCommentThreadsPayload(commentThreads),
|
|
211
|
+
writeOptions: 'utf-8',
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
kind: snapshot ? 'write' : 'delete',
|
|
215
|
+
targetPath: this.sidecarStore.getSnapshotPath(filePath),
|
|
216
|
+
value: snapshot ? Buffer.from(snapshot) : null,
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
kind: 'write',
|
|
220
|
+
targetPath: resolved.absolute,
|
|
221
|
+
value: content,
|
|
222
|
+
writeOptions: 'utf-8',
|
|
223
|
+
},
|
|
224
|
+
].filter((operation) => operation.targetPath);
|
|
225
|
+
|
|
226
|
+
const stagedWrites = [];
|
|
227
|
+
const committedOperations = [];
|
|
228
|
+
|
|
229
|
+
try {
|
|
230
|
+
for (const operation of operations) {
|
|
231
|
+
if (operation.kind !== 'write') {
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
const tempPath = createTransactionalPath(operation.targetPath, 'tmp');
|
|
236
|
+
await mkdir(dirname(operation.targetPath), { recursive: true });
|
|
237
|
+
await writeFile(tempPath, operation.value, operation.writeOptions);
|
|
238
|
+
operation.tempPath = tempPath;
|
|
239
|
+
stagedWrites.push(tempPath);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
for (const operation of operations) {
|
|
243
|
+
const hadExistingTarget = await pathExists(operation.targetPath);
|
|
244
|
+
const backupPath = hadExistingTarget
|
|
245
|
+
? createTransactionalPath(operation.targetPath, 'bak')
|
|
246
|
+
: null;
|
|
247
|
+
|
|
248
|
+
if (backupPath) {
|
|
249
|
+
await rename(operation.targetPath, backupPath);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
try {
|
|
253
|
+
if (operation.kind === 'write') {
|
|
254
|
+
await rename(operation.tempPath, operation.targetPath);
|
|
255
|
+
const stagedIndex = stagedWrites.indexOf(operation.tempPath);
|
|
256
|
+
if (stagedIndex >= 0) {
|
|
257
|
+
stagedWrites.splice(stagedIndex, 1);
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
} catch (error) {
|
|
261
|
+
if (backupPath) {
|
|
262
|
+
await rename(backupPath, operation.targetPath);
|
|
263
|
+
}
|
|
264
|
+
throw error;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
committedOperations.push({
|
|
268
|
+
backupPath,
|
|
269
|
+
kind: operation.kind,
|
|
270
|
+
targetPath: operation.targetPath,
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
await cleanupPaths(committedOperations.map((operation) => operation.backupPath));
|
|
275
|
+
return { ok: true };
|
|
276
|
+
} catch (error) {
|
|
277
|
+
for (const operation of committedOperations.reverse()) {
|
|
278
|
+
if (operation.kind === 'write') {
|
|
279
|
+
await rm(operation.targetPath, { force: true });
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (operation.backupPath) {
|
|
283
|
+
await rename(operation.backupPath, operation.targetPath);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
await cleanupPaths(stagedWrites);
|
|
288
|
+
await cleanupPaths(committedOperations.map((operation) => operation.backupPath));
|
|
289
|
+
return { ok: false, error: error.message };
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
async readCommentThreads(filePath) {
|
|
294
|
+
return this.sidecarStore.readCommentThreads(filePath);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
async writeCommentThreads(filePath, threads = []) {
|
|
298
|
+
return this.sidecarStore.writeCommentThreads(filePath, threads);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
async readCollaborationSnapshot(filePath) {
|
|
302
|
+
return this.sidecarStore.readSnapshot(filePath);
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
async writeCollaborationSnapshot(filePath, snapshot) {
|
|
306
|
+
return this.sidecarStore.writeSnapshot(filePath, snapshot);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
async deleteCollaborationSnapshot(filePath) {
|
|
310
|
+
return this.sidecarStore.deleteSnapshot(filePath);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
async createFile(filePath, content = '') {
|
|
314
|
+
const { absolute, error } = resolveVaultFilePath(this.vaultDir, filePath);
|
|
315
|
+
if (!absolute) {
|
|
316
|
+
return { ok: false, error };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
try {
|
|
320
|
+
await stat(absolute);
|
|
321
|
+
return { ok: false, error: 'File already exists' };
|
|
322
|
+
} catch (error) {
|
|
323
|
+
if (error.code !== 'ENOENT') {
|
|
324
|
+
throw error;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
await mkdir(dirname(absolute), { recursive: true });
|
|
329
|
+
await writeFile(absolute, content, 'utf-8');
|
|
330
|
+
await this.deleteCollaborationSnapshot(filePath);
|
|
331
|
+
return { ok: true };
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
async deleteFile(filePath) {
|
|
335
|
+
const { absolute, error } = resolveVaultFilePath(this.vaultDir, filePath);
|
|
336
|
+
if (!absolute) {
|
|
337
|
+
return { ok: false, error };
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
try {
|
|
341
|
+
await rm(absolute, { force: true });
|
|
342
|
+
await this.sidecarStore.deleteAllForFile(filePath);
|
|
343
|
+
return { ok: true };
|
|
344
|
+
} catch (error) {
|
|
345
|
+
return { ok: false, error: error.message };
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
async renameFile(oldPath, newPath) {
|
|
350
|
+
const { absoluteNew, absoluteOld, error } = resolveVaultRenamePaths(this.vaultDir, oldPath, newPath);
|
|
351
|
+
if (!absoluteOld || !absoluteNew) {
|
|
352
|
+
return { ok: false, error };
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
try {
|
|
356
|
+
await mkdir(dirname(absoluteNew), { recursive: true });
|
|
357
|
+
await rename(absoluteOld, absoluteNew);
|
|
358
|
+
await this.sidecarStore.renameAllForFile(oldPath, newPath);
|
|
359
|
+
return { ok: true };
|
|
360
|
+
} catch (error) {
|
|
361
|
+
return { ok: false, error: error.message };
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
async createDirectory(dirPath) {
|
|
366
|
+
const { absolute, error } = resolveVaultDirectoryPath(this.vaultDir, dirPath);
|
|
367
|
+
if (!absolute) {
|
|
368
|
+
return { ok: false, error };
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
try {
|
|
372
|
+
await mkdir(absolute, { recursive: true });
|
|
373
|
+
return { ok: true };
|
|
374
|
+
} catch (error) {
|
|
375
|
+
return { ok: false, error: error.message };
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
async countVaultFiles() {
|
|
380
|
+
return this.countFilesInDir(this.vaultDir);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
async reconcileSidecars({
|
|
384
|
+
deletedPaths = [],
|
|
385
|
+
renamedPaths = [],
|
|
386
|
+
} = {}) {
|
|
387
|
+
await Promise.allSettled([
|
|
388
|
+
...Array.from(new Set((deletedPaths ?? []).filter(Boolean)), (filePath) => this.sidecarStore.deleteAllForFile(filePath)),
|
|
389
|
+
...Array.from(
|
|
390
|
+
new Map(
|
|
391
|
+
(renamedPaths ?? [])
|
|
392
|
+
.filter((entry) => entry?.oldPath && entry?.newPath && entry.oldPath !== entry.newPath)
|
|
393
|
+
.map((entry) => [`${entry.oldPath}:${entry.newPath}`, entry]),
|
|
394
|
+
).values(),
|
|
395
|
+
(entry) => this.sidecarStore.renameAllForFile(entry.oldPath, entry.newPath),
|
|
396
|
+
),
|
|
397
|
+
]);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
async countFilesInDir(dirPath) {
|
|
401
|
+
let count = 0;
|
|
402
|
+
|
|
403
|
+
let entries;
|
|
404
|
+
try {
|
|
405
|
+
entries = await readdir(dirPath, { withFileTypes: true });
|
|
406
|
+
} catch {
|
|
407
|
+
return 0;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
for (const entry of entries) {
|
|
411
|
+
if (isIgnoredVaultEntry(entry.name)) {
|
|
412
|
+
continue;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
const fullPath = join(dirPath, entry.name);
|
|
416
|
+
if (entry.isDirectory()) {
|
|
417
|
+
count += await this.countFilesInDir(fullPath);
|
|
418
|
+
} else if (isVaultFilePath(entry.name)) {
|
|
419
|
+
count += 1;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return count;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
resolveWikiLink(linkTarget) {
|
|
427
|
+
const normalized = linkTarget.endsWith('.md') ? linkTarget : `${linkTarget}.md`;
|
|
428
|
+
const absolute = this.resolveContentPath(normalized, { requireVaultFile: false });
|
|
429
|
+
if (!absolute) {
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return toVaultRelativePath(this.vaultDir, absolute);
|
|
434
|
+
}
|
|
435
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { encodePlantUmlText } from '../../domain/plantuml-encoder.js';
|
|
2
|
+
|
|
3
|
+
function normalizeServerUrl(serverUrl) {
|
|
4
|
+
const value = String(serverUrl || '').trim();
|
|
5
|
+
if (!value) {
|
|
6
|
+
return 'https://www.plantuml.com/plantuml';
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return value.endsWith('/') ? value.slice(0, -1) : value;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function normalizeSvgPayload(body = '') {
|
|
13
|
+
const normalized = String(body)
|
|
14
|
+
.replace(/^\uFEFF/, '')
|
|
15
|
+
.trim()
|
|
16
|
+
.replace(/^(?:<\?[\s\S]*?\?>\s*|<!--[\s\S]*?-->\s*)+/i, '');
|
|
17
|
+
|
|
18
|
+
return normalized;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export class PlantUmlRenderer {
|
|
22
|
+
constructor({ fetchImpl = fetch, serverUrl } = {}) {
|
|
23
|
+
this.fetchImpl = fetchImpl;
|
|
24
|
+
this.serverUrl = normalizeServerUrl(serverUrl);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async renderSvg(source = '') {
|
|
28
|
+
const encoded = encodePlantUmlText(source);
|
|
29
|
+
const requestUrl = `${this.serverUrl}/svg/${encoded}`;
|
|
30
|
+
|
|
31
|
+
const response = await this.fetchImpl(requestUrl, {
|
|
32
|
+
headers: {
|
|
33
|
+
Accept: 'image/svg+xml, text/plain;q=0.9, */*;q=0.1',
|
|
34
|
+
},
|
|
35
|
+
signal: AbortSignal.timeout(20_000),
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
const body = await response.text();
|
|
39
|
+
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
const detail = body.trim() || `Upstream renderer returned ${response.status}`;
|
|
42
|
+
const error = new Error(detail);
|
|
43
|
+
error.statusCode = 502;
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const normalizedSvg = normalizeSvgPayload(body);
|
|
48
|
+
if (!normalizedSvg.startsWith('<svg')) {
|
|
49
|
+
const error = new Error('Upstream renderer returned an invalid SVG payload');
|
|
50
|
+
error.statusCode = 502;
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return normalizedSvg;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { WebSocketServer } from 'ws';
|
|
2
|
+
|
|
3
|
+
import { ClientSocketSession } from './client-socket-session.js';
|
|
4
|
+
|
|
5
|
+
function rejectUpgrade(socket, statusCode, statusMessage, {
|
|
6
|
+
body = '',
|
|
7
|
+
headers = {},
|
|
8
|
+
} = {}) {
|
|
9
|
+
const headerLines = Object.entries(headers)
|
|
10
|
+
.map(([key, value]) => `${key}: ${value}`)
|
|
11
|
+
.join('\r\n');
|
|
12
|
+
const responseBody = String(body ?? '');
|
|
13
|
+
const contentLengthHeader = responseBody
|
|
14
|
+
? `Content-Length: ${Buffer.byteLength(responseBody, 'utf8')}\r\n`
|
|
15
|
+
: '';
|
|
16
|
+
socket.write(
|
|
17
|
+
`HTTP/1.1 ${statusCode} ${statusMessage}\r\n${headerLines}${headerLines ? '\r\n' : ''}${contentLengthHeader}\r\n${responseBody}`,
|
|
18
|
+
);
|
|
19
|
+
socket.destroy();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function extractRoomName(pathname, wsBasePath) {
|
|
23
|
+
const roomSegment = pathname.slice(wsBasePath.length + 1);
|
|
24
|
+
return decodeURIComponent(roomSegment || 'default');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function stripBasePath(pathname, basePath) {
|
|
28
|
+
if (!basePath) {
|
|
29
|
+
return pathname;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (pathname === basePath) {
|
|
33
|
+
return '/';
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (pathname.startsWith(`${basePath}/`)) {
|
|
37
|
+
return pathname.slice(basePath.length) || '/';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return pathname;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function createRequestUrlWithPathname(requestUrl, pathname) {
|
|
44
|
+
const nextUrl = new URL(requestUrl.toString());
|
|
45
|
+
nextUrl.pathname = pathname || '/';
|
|
46
|
+
return nextUrl;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function attachCollaborationGateway({
|
|
50
|
+
authService,
|
|
51
|
+
basePath = '',
|
|
52
|
+
heartbeatIntervalMs,
|
|
53
|
+
httpServer,
|
|
54
|
+
maxPayload,
|
|
55
|
+
roomRegistry,
|
|
56
|
+
wsBasePath,
|
|
57
|
+
}) {
|
|
58
|
+
const websocketServer = new WebSocketServer({
|
|
59
|
+
maxPayload,
|
|
60
|
+
noServer: true,
|
|
61
|
+
perMessageDeflate: false,
|
|
62
|
+
});
|
|
63
|
+
const socketSessions = new Map();
|
|
64
|
+
let isShuttingDown = false;
|
|
65
|
+
let closePromise = null;
|
|
66
|
+
const heartbeatTimer = setInterval(() => {
|
|
67
|
+
websocketServer.clients.forEach((client) => {
|
|
68
|
+
const session = socketSessions.get(client);
|
|
69
|
+
if (!session) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (session.isAlive === false) {
|
|
74
|
+
try {
|
|
75
|
+
client.terminate();
|
|
76
|
+
} catch {
|
|
77
|
+
// Ignore termination errors while collecting dead clients.
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
session.markHeartbeatPending();
|
|
83
|
+
|
|
84
|
+
try {
|
|
85
|
+
client.ping();
|
|
86
|
+
} catch {
|
|
87
|
+
try {
|
|
88
|
+
client.terminate();
|
|
89
|
+
} catch {
|
|
90
|
+
// Ignore termination errors while pinging clients.
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}, heartbeatIntervalMs);
|
|
95
|
+
heartbeatTimer.unref?.();
|
|
96
|
+
|
|
97
|
+
websocketServer.on('connection', (ws, req, requestUrl) => {
|
|
98
|
+
const roomName = extractRoomName(requestUrl.pathname, wsBasePath);
|
|
99
|
+
const room = roomRegistry.getOrCreate(roomName);
|
|
100
|
+
const session = new ClientSocketSession({
|
|
101
|
+
onDisconnected: (disconnectedRoomName) => {
|
|
102
|
+
socketSessions.delete(ws);
|
|
103
|
+
const remaining = roomRegistry.rooms.get(disconnectedRoomName)?.clients.size ?? 0;
|
|
104
|
+
console.log(`[ws] "${disconnectedRoomName}" disconnected (${remaining} active client(s))`);
|
|
105
|
+
},
|
|
106
|
+
onFailed: () => {
|
|
107
|
+
socketSessions.delete(ws);
|
|
108
|
+
},
|
|
109
|
+
room,
|
|
110
|
+
roomName,
|
|
111
|
+
ws,
|
|
112
|
+
});
|
|
113
|
+
socketSessions.set(ws, session);
|
|
114
|
+
void session.initialize();
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
httpServer.on('upgrade', (req, socket, head) => {
|
|
118
|
+
if (isShuttingDown) {
|
|
119
|
+
rejectUpgrade(socket, 503, 'Server Shutting Down');
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const originalRequestUrl = new URL(req.url || '/', `http://${req.headers.host || 'localhost'}`);
|
|
124
|
+
const requestUrl = createRequestUrlWithPathname(
|
|
125
|
+
originalRequestUrl,
|
|
126
|
+
stripBasePath(originalRequestUrl.pathname, basePath),
|
|
127
|
+
);
|
|
128
|
+
const matchesRealtimeRoute =
|
|
129
|
+
requestUrl.pathname === wsBasePath || requestUrl.pathname.startsWith(`${wsBasePath}/`);
|
|
130
|
+
|
|
131
|
+
if (!matchesRealtimeRoute || requestUrl.pathname === wsBasePath) {
|
|
132
|
+
rejectUpgrade(socket, 404, 'Not Found');
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const authResult = authService.authorizeWebSocketRequest(req, requestUrl);
|
|
137
|
+
if (!authResult.ok) {
|
|
138
|
+
rejectUpgrade(socket, authResult.statusCode, authResult.statusMessage, authResult);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
websocketServer.handleUpgrade(req, socket, head, (ws) => {
|
|
143
|
+
websocketServer.emit('connection', ws, req, requestUrl);
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
async function close() {
|
|
148
|
+
if (closePromise) {
|
|
149
|
+
return closePromise;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
isShuttingDown = true;
|
|
153
|
+
clearInterval(heartbeatTimer);
|
|
154
|
+
|
|
155
|
+
closePromise = new Promise((resolve, reject) => {
|
|
156
|
+
const forceCloseTimer = setTimeout(() => {
|
|
157
|
+
websocketServer.clients.forEach((client) => {
|
|
158
|
+
try {
|
|
159
|
+
client.terminate();
|
|
160
|
+
} catch {
|
|
161
|
+
// Ignore termination errors during forced shutdown.
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
}, 1000);
|
|
165
|
+
forceCloseTimer.unref?.();
|
|
166
|
+
|
|
167
|
+
websocketServer.close((error) => {
|
|
168
|
+
clearTimeout(forceCloseTimer);
|
|
169
|
+
|
|
170
|
+
if (error) {
|
|
171
|
+
reject(error);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
resolve();
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
websocketServer.clients.forEach((client) => {
|
|
179
|
+
try {
|
|
180
|
+
client.close(1001, 'Server shutting down');
|
|
181
|
+
} catch {
|
|
182
|
+
// Ignore close errors during shutdown.
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
return closePromise;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return {
|
|
191
|
+
close,
|
|
192
|
+
websocketServer,
|
|
193
|
+
};
|
|
194
|
+
}
|