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.
Files changed (430) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +453 -0
  3. package/bin/collabmd.js +241 -0
  4. package/docker-compose.yml +43 -0
  5. package/package.json +93 -0
  6. package/public/assets/css/base.css +1 -0
  7. package/public/assets/css/style.css +1 -0
  8. package/public/assets/js/assets/Assistant-Bold-ZDZZ6JHA.woff2 +0 -0
  9. package/public/assets/js/assets/Assistant-Medium-DZ25RZU3.woff2 +0 -0
  10. package/public/assets/js/assets/Assistant-Regular-PLF2XOGW.woff2 +0 -0
  11. package/public/assets/js/assets/Assistant-SemiBold-CZ5MX6FK.woff2 +0 -0
  12. package/public/assets/js/chunks/CodeMirrorEditor-UCMRAMCV-MAKZFDBE.js +12 -0
  13. package/public/assets/js/chunks/apl-C5P5JBDI.js +1 -0
  14. package/public/assets/js/chunks/ar-SA-NXDWD63E-MF6HMEA4.js +8 -0
  15. package/public/assets/js/chunks/architecture-PBZL5I3N-55LDZ5WS.js +1 -0
  16. package/public/assets/js/chunks/architectureDiagram-2XIMDMQ5-2VP562X7.js +36 -0
  17. package/public/assets/js/chunks/asciiarmor-3NCLLELT.js +1 -0
  18. package/public/assets/js/chunks/asn1-KF4WXU3M.js +1 -0
  19. package/public/assets/js/chunks/asterisk-EA3VIN65.js +1 -0
  20. package/public/assets/js/chunks/az-AZ-MXSORGZV-AIGO4TNU.js +1 -0
  21. package/public/assets/js/chunks/bg-BG-O6MV2KSF-X6AVO2AF.js +5 -0
  22. package/public/assets/js/chunks/blockDiagram-WCTKOSBZ-KM56WWDE.js +132 -0
  23. package/public/assets/js/chunks/bn-BD-T2VJNT7N-7OMHRIGC.js +3 -0
  24. package/public/assets/js/chunks/bn-IN-MMW2ORAC-EPKMNKG7.js +3 -0
  25. package/public/assets/js/chunks/brainfuck-A3CTQVFD.js +1 -0
  26. package/public/assets/js/chunks/c4Diagram-IC4MRINW-KX6UEGQZ.js +10 -0
  27. package/public/assets/js/chunks/ca-ES-MKBCGNOG-U44SUUTN.js +8 -0
  28. package/public/assets/js/chunks/chunk-2NTQWLZD.js +25 -0
  29. package/public/assets/js/chunks/chunk-2YRP2AWD.js +1 -0
  30. package/public/assets/js/chunks/chunk-3BUCGSSJ.js +1 -0
  31. package/public/assets/js/chunks/chunk-47L7JGE3.js +1 -0
  32. package/public/assets/js/chunks/chunk-4BCHPULB.js +1 -0
  33. package/public/assets/js/chunks/chunk-4NKM6YFO.js +161 -0
  34. package/public/assets/js/chunks/chunk-4WGMPBK5.js +1 -0
  35. package/public/assets/js/chunks/chunk-55WF6Y2Q.js +1 -0
  36. package/public/assets/js/chunks/chunk-775E65SU.js +1 -0
  37. package/public/assets/js/chunks/chunk-AJRGTECU.js +70 -0
  38. package/public/assets/js/chunks/chunk-B2J3PHGY.js +1 -0
  39. package/public/assets/js/chunks/chunk-B4JKB3BC.js +1 -0
  40. package/public/assets/js/chunks/chunk-BBHPYU2R.js +1 -0
  41. package/public/assets/js/chunks/chunk-CGVY4PKT.js +13 -0
  42. package/public/assets/js/chunks/chunk-CVTRX3TE.js +220 -0
  43. package/public/assets/js/chunks/chunk-DW6KK6VF.js +1 -0
  44. package/public/assets/js/chunks/chunk-E2HMNOQL.js +189 -0
  45. package/public/assets/js/chunks/chunk-EPTJZP5H.js +7 -0
  46. package/public/assets/js/chunks/chunk-G7NUGGE7.js +13 -0
  47. package/public/assets/js/chunks/chunk-GI7LBIBP.js +1 -0
  48. package/public/assets/js/chunks/chunk-GXRL27M7.js +1 -0
  49. package/public/assets/js/chunks/chunk-H6EYDHRW.js +1 -0
  50. package/public/assets/js/chunks/chunk-HOCBCDA5.js +1 -0
  51. package/public/assets/js/chunks/chunk-HS2CUOC6.js +1 -0
  52. package/public/assets/js/chunks/chunk-HUAS4BYI.js +12 -0
  53. package/public/assets/js/chunks/chunk-HVNNEPP5.js +2 -0
  54. package/public/assets/js/chunks/chunk-I2GVZI7W.js +38 -0
  55. package/public/assets/js/chunks/chunk-I6PVWGBN.js +14 -0
  56. package/public/assets/js/chunks/chunk-IR2DOYV4.js +7 -0
  57. package/public/assets/js/chunks/chunk-IZ3V3F2A.js +1 -0
  58. package/public/assets/js/chunks/chunk-KPAQHIOI.js +1 -0
  59. package/public/assets/js/chunks/chunk-M3EW4V74.js +1 -0
  60. package/public/assets/js/chunks/chunk-MK3AFU3C.js +90 -0
  61. package/public/assets/js/chunks/chunk-NM6J3ND7.js +1 -0
  62. package/public/assets/js/chunks/chunk-NO7UPWTU.js +1 -0
  63. package/public/assets/js/chunks/chunk-OG2TNZEU.js +9 -0
  64. package/public/assets/js/chunks/chunk-OHGDMMWM.js +1 -0
  65. package/public/assets/js/chunks/chunk-OOT2HALX.js +1 -0
  66. package/public/assets/js/chunks/chunk-OQLLZFFN.js +1 -0
  67. package/public/assets/js/chunks/chunk-PF6TP4EI.js +1 -0
  68. package/public/assets/js/chunks/chunk-PMOZMECZ.js +85 -0
  69. package/public/assets/js/chunks/chunk-QBGS6DJR.js +1 -0
  70. package/public/assets/js/chunks/chunk-QF3ZQ6UQ.js +1 -0
  71. package/public/assets/js/chunks/chunk-QFXMAUW4.js +1 -0
  72. package/public/assets/js/chunks/chunk-QSTBGTWJ.js +1 -0
  73. package/public/assets/js/chunks/chunk-QYKIT2IH.js +41 -0
  74. package/public/assets/js/chunks/chunk-S75BI2UQ.js +1 -0
  75. package/public/assets/js/chunks/chunk-SKEZZ3H6.js +1 -0
  76. package/public/assets/js/chunks/chunk-SO6QBCB6.js +1 -0
  77. package/public/assets/js/chunks/chunk-SR3U53EQ.js +1 -0
  78. package/public/assets/js/chunks/chunk-TFP6LRYJ.js +53 -0
  79. package/public/assets/js/chunks/chunk-U6APNHAF.js +15 -0
  80. package/public/assets/js/chunks/chunk-VOODXHXA.js +1 -0
  81. package/public/assets/js/chunks/chunk-W7WJUTSA.js +3 -0
  82. package/public/assets/js/chunks/chunk-WNXFO2F2.js +1 -0
  83. package/public/assets/js/chunks/chunk-X6EEYWV4.js +6 -0
  84. package/public/assets/js/chunks/chunk-YVW3ZETS.js +1 -0
  85. package/public/assets/js/chunks/chunk-ZR2QRTBG.js +339 -0
  86. package/public/assets/js/chunks/chunk-ZZJX4LQ2.js +1 -0
  87. package/public/assets/js/chunks/classDiagram-VBA2DB6C-IYW4O2RM.js +1 -0
  88. package/public/assets/js/chunks/classDiagram-v2-RAHNMMFH-DNKVN2WD.js +1 -0
  89. package/public/assets/js/chunks/clike-RTBH33GE.js +1 -0
  90. package/public/assets/js/chunks/clojure-BR2VJ2JI.js +1 -0
  91. package/public/assets/js/chunks/cmake-2HEWVFEE.js +1 -0
  92. package/public/assets/js/chunks/cobol-V6EIK6DN.js +1 -0
  93. package/public/assets/js/chunks/coffeescript-JW3ZOGMD.js +1 -0
  94. package/public/assets/js/chunks/commonlisp-UCWSIHYK.js +1 -0
  95. package/public/assets/js/chunks/cose-bilkent-S5V4N54A-QVYRFFNC.js +1 -0
  96. package/public/assets/js/chunks/crystal-GR4VLC3M.js +1 -0
  97. package/public/assets/js/chunks/cs-CZ-V77HGUP7-OLBAKFG5.js +7 -0
  98. package/public/assets/js/chunks/css-C5DVWGB4.js +1 -0
  99. package/public/assets/js/chunks/cypher-K7FZM5GC.js +1 -0
  100. package/public/assets/js/chunks/d-CF3QNNH5.js +1 -0
  101. package/public/assets/js/chunks/da-DK-I5RFNTM4-QJIG2SEZ.js +2 -0
  102. package/public/assets/js/chunks/dagre-KLK3FWXG-KVNBUDOY.js +4 -0
  103. package/public/assets/js/chunks/de-CH-WLRDEVBV-4MMJDMVD.js +7 -0
  104. package/public/assets/js/chunks/de-DE-DTI4WUSC-ML7C46TT.js +7 -0
  105. package/public/assets/js/chunks/diagram-E7M64L7V-ZP33VRUC.js +24 -0
  106. package/public/assets/js/chunks/diagram-IFDJBPK2-ZG35YWOD.js +43 -0
  107. package/public/assets/js/chunks/diagram-P4PSJMXO-ZGIGM7D2.js +24 -0
  108. package/public/assets/js/chunks/diff-KOMSZU7O.js +1 -0
  109. package/public/assets/js/chunks/dist-7RQKSOUX.js +7 -0
  110. package/public/assets/js/chunks/dist-ARWGZ6MN.js +1 -0
  111. package/public/assets/js/chunks/dist-DPBSGC3Y.js +2 -0
  112. package/public/assets/js/chunks/dist-E36PJE5M.js +1 -0
  113. package/public/assets/js/chunks/dist-E5NM7OBW.js +1 -0
  114. package/public/assets/js/chunks/dist-ERADYPEK.js +1 -0
  115. package/public/assets/js/chunks/dist-F43RIHBZ.js +1 -0
  116. package/public/assets/js/chunks/dist-HAB5NIXI.js +1 -0
  117. package/public/assets/js/chunks/dist-HG23OLRA.js +1 -0
  118. package/public/assets/js/chunks/dist-IEJXBSDJ.js +1 -0
  119. package/public/assets/js/chunks/dist-IQA4KVJK.js +1 -0
  120. package/public/assets/js/chunks/dist-OIQTNVT2.js +3 -0
  121. package/public/assets/js/chunks/dist-PMZJ734S.js +1 -0
  122. package/public/assets/js/chunks/dist-RCQFQRLD.js +1 -0
  123. package/public/assets/js/chunks/dist-RQLC4GVI.js +1 -0
  124. package/public/assets/js/chunks/dist-RSJGLSKC.js +1 -0
  125. package/public/assets/js/chunks/dist-SGNQZVVX.js +1 -0
  126. package/public/assets/js/chunks/dist-VCFTF7Z6.js +1 -0
  127. package/public/assets/js/chunks/dist-VTO23SHH.js +1 -0
  128. package/public/assets/js/chunks/dist-XOODBV4L.js +1 -0
  129. package/public/assets/js/chunks/dist-ZFZNCRZY.js +1 -0
  130. package/public/assets/js/chunks/dockerfile-XCIKYOSI.js +1 -0
  131. package/public/assets/js/chunks/dtd-3XFH7W6Z.js +1 -0
  132. package/public/assets/js/chunks/dylan-3UWPKVOR.js +1 -0
  133. package/public/assets/js/chunks/ebnf-OLHTL3VN.js +1 -0
  134. package/public/assets/js/chunks/ecl-43LZ3ZRM.js +1 -0
  135. package/public/assets/js/chunks/editor-session-IHFTYG5D.js +22 -0
  136. package/public/assets/js/chunks/eiffel-ISPO2UJF.js +1 -0
  137. package/public/assets/js/chunks/el-GR-ZXDJ2OS4-WSCEIO6J.js +7 -0
  138. package/public/assets/js/chunks/elm-CLK576PK.js +1 -0
  139. package/public/assets/js/chunks/en-CTDJDZ6K-IC3QAUOI.js +1 -0
  140. package/public/assets/js/chunks/erDiagram-INFDFZHY-ZMS6H2TH.js +70 -0
  141. package/public/assets/js/chunks/erlang-AVQXQFOT.js +1 -0
  142. package/public/assets/js/chunks/es-ES-DYQHAD43-XGB5X5IM.js +7 -0
  143. package/public/assets/js/chunks/eu-ES-QDSYU5Y3-LA3JTIJ2.js +7 -0
  144. package/public/assets/js/chunks/excalidraw-mermaid-stub-NYXTOJ4H.js +1 -0
  145. package/public/assets/js/chunks/fa-IR-26LZG4PM-PFALMEDX.js +9 -0
  146. package/public/assets/js/chunks/factor-CRTVBD6Q.js +1 -0
  147. package/public/assets/js/chunks/fcl-FX24LKTH.js +1 -0
  148. package/public/assets/js/chunks/fi-FI-6YS4KDE4-ES5MV6P4.js +6 -0
  149. package/public/assets/js/chunks/flowDiagram-PKNHOUZH-QD4L5IE5.js +162 -0
  150. package/public/assets/js/chunks/forth-YKDKCTVS.js +1 -0
  151. package/public/assets/js/chunks/fortran-UJWC6SLU.js +1 -0
  152. package/public/assets/js/chunks/fr-FR-BRLLPTZC-VMFE22YV.js +12 -0
  153. package/public/assets/js/chunks/ganttDiagram-A5KZAMGK-VTMTQESP.js +292 -0
  154. package/public/assets/js/chunks/gas-MYEMWGRE.js +1 -0
  155. package/public/assets/js/chunks/gherkin-JWHAU2YG.js +1 -0
  156. package/public/assets/js/chunks/gitGraph-HDMCJU4V-YPHS74XX.js +1 -0
  157. package/public/assets/js/chunks/gitGraphDiagram-K3NZZRJ6-Z3EZ634T.js +65 -0
  158. package/public/assets/js/chunks/gl-ES-OKUZTLYG-GPT42ZHV.js +6 -0
  159. package/public/assets/js/chunks/groovy-QZIZQIAK.js +1 -0
  160. package/public/assets/js/chunks/haskell-JR3G7YNW.js +1 -0
  161. package/public/assets/js/chunks/haxe-TVLAIYEN.js +1 -0
  162. package/public/assets/js/chunks/he-IL-26MGYIU7-VQ5XQYYY.js +8 -0
  163. package/public/assets/js/chunks/hi-IN-Q4ZOGTP2-2Z766MXA.js +3 -0
  164. package/public/assets/js/chunks/http-YXQRE77G.js +1 -0
  165. package/public/assets/js/chunks/hu-HU-P2OXPSN5-6XDVPGTE.js +3 -0
  166. package/public/assets/js/chunks/id-ID-2EIKXYN6-J5GWSY2S.js +8 -0
  167. package/public/assets/js/chunks/idl-RAQGJ6LJ.js +1 -0
  168. package/public/assets/js/chunks/image-32MOCVDX-JN2EUMQG.js +1 -0
  169. package/public/assets/js/chunks/image-blob-reduce.esm-K5OWL55S.js +13 -0
  170. package/public/assets/js/chunks/info-3K5VOQVL-CXJSPNNP.js +1 -0
  171. package/public/assets/js/chunks/infoDiagram-LFFYTUFH-WQ34MUJA.js +2 -0
  172. package/public/assets/js/chunks/ishikawaDiagram-PHBUUO56-4IARWKJK.js +70 -0
  173. package/public/assets/js/chunks/it-IT-4CFKVXI2-NMBWUWFF.js +12 -0
  174. package/public/assets/js/chunks/ja-JP-MAND2Z4V-GQZYXXOC.js +7 -0
  175. package/public/assets/js/chunks/javascript-NM7KDJUE.js +1 -0
  176. package/public/assets/js/chunks/journeyDiagram-4ABVD52K-FJ4LF4SX.js +139 -0
  177. package/public/assets/js/chunks/julia-LG3BH25B.js +1 -0
  178. package/public/assets/js/chunks/kaa-HQRTCXTJ-7D6PAKDJ.js +1 -0
  179. package/public/assets/js/chunks/kab-KAB-JKIKKTGH-TNKFXNAX.js +4 -0
  180. package/public/assets/js/chunks/kanban-definition-K7BYSVSG-TY4EVYI3.js +89 -0
  181. package/public/assets/js/chunks/katex-5YJCUCFD.js +261 -0
  182. package/public/assets/js/chunks/kk-KZ-HXQ63ZFC-T4HCMWED.js +1 -0
  183. package/public/assets/js/chunks/km-KH-PKL3LSGX-HTLHEJV6.js +7 -0
  184. package/public/assets/js/chunks/ko-KR-KXLREZX3-QMR52QVI.js +5 -0
  185. package/public/assets/js/chunks/ku-TR-MJ4IER3X-K5CNY4UO.js +6 -0
  186. package/public/assets/js/chunks/livescript-4CVWVI4M.js +1 -0
  187. package/public/assets/js/chunks/lt-LT-H6WFQ6FJ-IW25FAGX.js +3 -0
  188. package/public/assets/js/chunks/lua-VWGE7DQ7.js +1 -0
  189. package/public/assets/js/chunks/lv-LV-GOCK6SJW-KTDFW5OH.js +4 -0
  190. package/public/assets/js/chunks/mathematica-D7APQSEU.js +1 -0
  191. package/public/assets/js/chunks/mbox-BN3XQBYX.js +1 -0
  192. package/public/assets/js/chunks/mermaid-runtime-BIFNJ2CT.js +18 -0
  193. package/public/assets/js/chunks/mindmap-definition-YRQLILUH-5B565RNP.js +68 -0
  194. package/public/assets/js/chunks/mirc-565WBI76.js +1 -0
  195. package/public/assets/js/chunks/mllike-VV3KS46B.js +1 -0
  196. package/public/assets/js/chunks/modelica-EGX44FZV.js +1 -0
  197. package/public/assets/js/chunks/mr-IN-IXVLDMEQ-PHM5DT7Q.js +9 -0
  198. package/public/assets/js/chunks/mscgen-GFGTHENT.js +1 -0
  199. package/public/assets/js/chunks/mumps-POZYWSMI.js +1 -0
  200. package/public/assets/js/chunks/my-MM-YG6MYTTD-ZHLCMEVA.js +1 -0
  201. package/public/assets/js/chunks/nb-NO-XGWJISD2-KSDFG6YU.js +8 -0
  202. package/public/assets/js/chunks/nginx-JUBX55EU.js +1 -0
  203. package/public/assets/js/chunks/nl-NL-XVDVCPNC-KVF3ZO2R.js +13 -0
  204. package/public/assets/js/chunks/nn-NO-EMX5MJX5-34QKSHNR.js +4 -0
  205. package/public/assets/js/chunks/nsis-RC4CREGM.js +1 -0
  206. package/public/assets/js/chunks/ntriples-4WK6CNVE.js +1 -0
  207. package/public/assets/js/chunks/oc-FR-ROEINTVO-5GP4AOYO.js +4 -0
  208. package/public/assets/js/chunks/octave-GOKFN2V7.js +1 -0
  209. package/public/assets/js/chunks/oz-OQUMNC63.js +1 -0
  210. package/public/assets/js/chunks/pa-IN-ZYN6SUDY-MVL7O44W.js +4 -0
  211. package/public/assets/js/chunks/packet-RMMSAZCW-D7XTR5TT.js +1 -0
  212. package/public/assets/js/chunks/pascal-BBWQWWWD.js +1 -0
  213. package/public/assets/js/chunks/percentages-5DKR754L-DG7W23CV.js +1 -0
  214. package/public/assets/js/chunks/perl-KTPJTTAM.js +1 -0
  215. package/public/assets/js/chunks/pica-6G3NROWT.js +17 -0
  216. package/public/assets/js/chunks/pie-UPGHQEXC-KGC3O6LN.js +1 -0
  217. package/public/assets/js/chunks/pieDiagram-SKSYHLDU-KWKRDEZS.js +30 -0
  218. package/public/assets/js/chunks/pig-IJMBS4FZ.js +1 -0
  219. package/public/assets/js/chunks/pl-PL-6VTG7PHC-VADRWSX4.js +12 -0
  220. package/public/assets/js/chunks/powershell-6YGCBHDP.js +1 -0
  221. package/public/assets/js/chunks/preview-render-compiler-WD3A76I6.js +25 -0
  222. package/public/assets/js/chunks/properties-5QTD3364.js +1 -0
  223. package/public/assets/js/chunks/protobuf-LTRWBIK3.js +1 -0
  224. package/public/assets/js/chunks/pt-BR-5YFKRR5G-HHF4UPO4.js +6 -0
  225. package/public/assets/js/chunks/pt-PT-GEIXXZ67-TUTAUZJK.js +8 -0
  226. package/public/assets/js/chunks/pug-U4PV3WLG.js +1 -0
  227. package/public/assets/js/chunks/puppet-WGYJPR3Y.js +1 -0
  228. package/public/assets/js/chunks/python-6YGH4S47.js +1 -0
  229. package/public/assets/js/chunks/q-VIG4IJLI.js +1 -0
  230. package/public/assets/js/chunks/quadrantDiagram-337W2JSQ-GWQRUFHQ.js +7 -0
  231. package/public/assets/js/chunks/quick-switcher-controller-JYDIJVAJ.js +5 -0
  232. package/public/assets/js/chunks/r-NVPCXGTR.js +1 -0
  233. package/public/assets/js/chunks/radar-KQ55EAFF-OPO64DRI.js +1 -0
  234. package/public/assets/js/chunks/requirementDiagram-Z7DCOOCP-ASW7IPJL.js +73 -0
  235. package/public/assets/js/chunks/ro-RO-E2P6TFZI-RJFCULYF.js +12 -0
  236. package/public/assets/js/chunks/roundRect-Z3DX3W5S.js +1 -0
  237. package/public/assets/js/chunks/rpm-UEA257HD.js +1 -0
  238. package/public/assets/js/chunks/ru-RU-YBIIY43T-BF27TNVK.js +10 -0
  239. package/public/assets/js/chunks/ruby-KPQRAJGE.js +1 -0
  240. package/public/assets/js/chunks/sankeyDiagram-WA2Y5GQK-W6BBWCLW.js +10 -0
  241. package/public/assets/js/chunks/sas-L7VATVH5.js +1 -0
  242. package/public/assets/js/chunks/scheme-T2NOWR3P.js +1 -0
  243. package/public/assets/js/chunks/sequenceDiagram-2WXFIKYE-H4G3ISLN.js +145 -0
  244. package/public/assets/js/chunks/shell-DLVDUNFA.js +1 -0
  245. package/public/assets/js/chunks/si-LK-673C2CI2-IOFGU4U2.js +1 -0
  246. package/public/assets/js/chunks/sieve-BKBZYDBU.js +1 -0
  247. package/public/assets/js/chunks/sk-SK-CKZHQ4AP-6O5JGN26.js +7 -0
  248. package/public/assets/js/chunks/sl-SI-557H2GWM-2NEHLV7W.js +6 -0
  249. package/public/assets/js/chunks/smalltalk-WRJQKJSD.js +1 -0
  250. package/public/assets/js/chunks/solr-66B3BIDL.js +1 -0
  251. package/public/assets/js/chunks/sparql-S25Z47JG.js +1 -0
  252. package/public/assets/js/chunks/spreadsheet-B272EF7Y.js +1 -0
  253. package/public/assets/js/chunks/sql-BPLIIUYC.js +1 -0
  254. package/public/assets/js/chunks/stateDiagram-RAJIS63D-OF5XXRUS.js +1 -0
  255. package/public/assets/js/chunks/stateDiagram-v2-FVOUBMTO-IV2CSQSQ.js +1 -0
  256. package/public/assets/js/chunks/stex-4IJY64QX.js +1 -0
  257. package/public/assets/js/chunks/stylus-PJUHLGPT.js +1 -0
  258. package/public/assets/js/chunks/subset-shared.chunk-4NMWHS4D.js +1 -0
  259. package/public/assets/js/chunks/subset-worker.chunk-NTLP7Y66.js +1 -0
  260. package/public/assets/js/chunks/sv-SE-XOPKKDWS-Q2L6KGFV.js +8 -0
  261. package/public/assets/js/chunks/swift-UYHTO4SX.js +1 -0
  262. package/public/assets/js/chunks/ta-IN-XBH7DQI3-ISSUGZAK.js +6 -0
  263. package/public/assets/js/chunks/tcl-OQ5J3VO2.js +1 -0
  264. package/public/assets/js/chunks/textile-NOGVBEYF.js +1 -0
  265. package/public/assets/js/chunks/th-TH-TOCWH3R4-TABEAMJA.js +1 -0
  266. package/public/assets/js/chunks/tiddlywiki-SYTK4QUE.js +1 -0
  267. package/public/assets/js/chunks/tiki-P7K4ZLOM.js +1 -0
  268. package/public/assets/js/chunks/timeline-definition-YZTLITO2-HBCANIUC.js +61 -0
  269. package/public/assets/js/chunks/toml-AUZYRP36.js +1 -0
  270. package/public/assets/js/chunks/tr-TR-GXW6CYY5-5NQRN52Y.js +4 -0
  271. package/public/assets/js/chunks/treemap-KZPCXAKY-WYMCT5F7.js +1 -0
  272. package/public/assets/js/chunks/troff-XFYJNQOJ.js +1 -0
  273. package/public/assets/js/chunks/ttcn-AK2IXWU6.js +1 -0
  274. package/public/assets/js/chunks/ttcn-cfg-3IDPIYPU.js +1 -0
  275. package/public/assets/js/chunks/turtle-OIDMF46P.js +1 -0
  276. package/public/assets/js/chunks/uk-UA-IJKTNUDG-2IIL3TO5.js +6 -0
  277. package/public/assets/js/chunks/uz-UZ-TBZZEA4V-X22KVKBP.js +1 -0
  278. package/public/assets/js/chunks/vb-J6K4XVA2.js +1 -0
  279. package/public/assets/js/chunks/vbscript-FM7DDZZE.js +1 -0
  280. package/public/assets/js/chunks/velocity-6KZFEOFD.js +1 -0
  281. package/public/assets/js/chunks/vennDiagram-LZ73GAT5-EBRF3MZR.js +34 -0
  282. package/public/assets/js/chunks/verilog-EWWQPMNN.js +1 -0
  283. package/public/assets/js/chunks/vhdl-CJ3M4IHI.js +1 -0
  284. package/public/assets/js/chunks/vi-VN-MULSGNVB-TENM65C7.js +7 -0
  285. package/public/assets/js/chunks/webidl-XVBHXCRV.js +1 -0
  286. package/public/assets/js/chunks/xquery-7WZOZ4UK.js +1 -0
  287. package/public/assets/js/chunks/xychartDiagram-JWTSCODW-WIFVRQPR.js +7 -0
  288. package/public/assets/js/chunks/yacas-MZ2ZZPF3.js +1 -0
  289. package/public/assets/js/chunks/z80-I447CBF7.js +1 -0
  290. package/public/assets/js/chunks/zh-CN-MVX3E32U-S5VA2BA5.js +11 -0
  291. package/public/assets/js/chunks/zh-HK-JNU5RLIE-A4VUKZFV.js +1 -0
  292. package/public/assets/js/chunks/zh-TW-LENVCA6T-KFB6KHMM.js +9 -0
  293. package/public/assets/js/excalidraw-editor-7ORML5YA.css +1 -0
  294. package/public/assets/js/excalidraw-editor-LKW2AZBU.js +347 -0
  295. package/public/assets/js/excalidraw-editor.css +1 -0
  296. package/public/assets/js/excalidraw-editor.js +1 -0
  297. package/public/assets/js/main.js +354 -0
  298. package/public/assets/js/preview-render-worker.js +30 -0
  299. package/public/assets/vendor/highlight/github-dark.min.css +10 -0
  300. package/public/assets/vendor/highlight/github.min.css +10 -0
  301. package/public/excalidraw-editor.html +31 -0
  302. package/public/index.html +549 -0
  303. package/scripts/cloudflare-tunnel.mjs +145 -0
  304. package/scripts/local-plantuml-compose.mjs +92 -0
  305. package/server.js +1 -0
  306. package/src/client/application/app-shell/chat-feature.js +363 -0
  307. package/src/client/application/app-shell/comments-feature.js +33 -0
  308. package/src/client/application/app-shell/git-feature.js +394 -0
  309. package/src/client/application/app-shell/presence-feature.js +229 -0
  310. package/src/client/application/app-shell/ui-feature.js +535 -0
  311. package/src/client/application/app-shell/workspace-feature.js +132 -0
  312. package/src/client/application/app-shell-elements.js +78 -0
  313. package/src/client/application/diagram-preview-hydrator.js +382 -0
  314. package/src/client/application/file-open-lifecycle.js +26 -0
  315. package/src/client/application/mermaid-preview-hydrator.js +570 -0
  316. package/src/client/application/plantuml-preview-hydrator.js +563 -0
  317. package/src/client/application/preview-diagram-utils.js +223 -0
  318. package/src/client/application/preview-render-compiler.js +426 -0
  319. package/src/client/application/preview-render-executor.js +153 -0
  320. package/src/client/application/preview-render-profile.js +63 -0
  321. package/src/client/application/preview-render-scheduler.js +73 -0
  322. package/src/client/application/preview-render-worker.js +19 -0
  323. package/src/client/application/preview-renderer.js +452 -0
  324. package/src/client/application/wiki-link-file-controller.js +58 -0
  325. package/src/client/application/workspace-chrome-controller.js +84 -0
  326. package/src/client/application/workspace-coordinator.js +238 -0
  327. package/src/client/application/workspace-preview-controller.js +237 -0
  328. package/src/client/application/workspace-route-controller.js +170 -0
  329. package/src/client/application/workspace-state-store.js +46 -0
  330. package/src/client/bootstrap/collabmd-app-shell.js +479 -0
  331. package/src/client/domain/diagram-action-icons.js +41 -0
  332. package/src/client/domain/excalidraw-collaboration.js +153 -0
  333. package/src/client/domain/excalidraw-scene.js +87 -0
  334. package/src/client/domain/markdown-formatting.js +370 -0
  335. package/src/client/domain/plantuml-language.js +226 -0
  336. package/src/client/domain/room.js +49 -0
  337. package/src/client/domain/runtime-paths.js +136 -0
  338. package/src/client/domain/vault-api-client.js +1 -0
  339. package/src/client/domain/vault-paths.js +80 -0
  340. package/src/client/domain/vault-utils.js +49 -0
  341. package/src/client/domain/wiki-link-completions.js +78 -0
  342. package/src/client/excalidraw-editor.js +630 -0
  343. package/src/client/excalidraw-mermaid-stub.js +7 -0
  344. package/src/client/infrastructure/auth-client.js +383 -0
  345. package/src/client/infrastructure/browser-navigation-port.js +19 -0
  346. package/src/client/infrastructure/browser-notification-port.js +40 -0
  347. package/src/client/infrastructure/browser-preferences-port.js +79 -0
  348. package/src/client/infrastructure/comment-thread-store.js +293 -0
  349. package/src/client/infrastructure/editor-collaboration-client.js +240 -0
  350. package/src/client/infrastructure/editor-session.js +255 -0
  351. package/src/client/infrastructure/editor-view-adapter.js +578 -0
  352. package/src/client/infrastructure/excalidraw-room-client.js +651 -0
  353. package/src/client/infrastructure/lobby-presence.js +304 -0
  354. package/src/client/infrastructure/runtime-config.js +65 -0
  355. package/src/client/infrastructure/tab-activity-lock.js +193 -0
  356. package/src/client/infrastructure/vault-api-client.js +61 -0
  357. package/src/client/infrastructure/yjs-provider-reset-guard.js +19 -0
  358. package/src/client/main.js +16 -0
  359. package/src/client/mermaid-runtime.js +3 -0
  360. package/src/client/presentation/backlinks-panel.js +188 -0
  361. package/src/client/presentation/comment-ui-controller.js +1235 -0
  362. package/src/client/presentation/comments-panel.js +531 -0
  363. package/src/client/presentation/excalidraw-embed-controller.js +968 -0
  364. package/src/client/presentation/excalidraw-embed-reconciler.js +37 -0
  365. package/src/client/presentation/file-action-controller.js +596 -0
  366. package/src/client/presentation/file-explorer-controller.js +81 -0
  367. package/src/client/presentation/file-explorer-view.js +256 -0
  368. package/src/client/presentation/file-tree-state.js +77 -0
  369. package/src/client/presentation/git-diff-view-controller.js +656 -0
  370. package/src/client/presentation/git-panel-controller.js +516 -0
  371. package/src/client/presentation/layout-controller.js +222 -0
  372. package/src/client/presentation/outline-controller.js +239 -0
  373. package/src/client/presentation/quick-switcher-controller.js +300 -0
  374. package/src/client/presentation/scroll-sync-controller.js +500 -0
  375. package/src/client/presentation/theme-controller.js +64 -0
  376. package/src/client/presentation/toast-controller.js +21 -0
  377. package/src/client/presentation/video-embed-controller.js +264 -0
  378. package/src/client/styles/base.css +58 -0
  379. package/src/client/styles/style.css +4245 -0
  380. package/src/domain/comment-threads.js +233 -0
  381. package/src/domain/excalidraw-room-codec.js +427 -0
  382. package/src/domain/file-kind.js +104 -0
  383. package/src/domain/wiki-link-resolver.js +75 -0
  384. package/src/server/auth/create-auth-service.js +272 -0
  385. package/src/server/auth/session-cookie.js +125 -0
  386. package/src/server/config/env.js +186 -0
  387. package/src/server/create-app-server.js +143 -0
  388. package/src/server/domain/backlink-index.js +291 -0
  389. package/src/server/domain/collaboration/collaboration-document-store.js +155 -0
  390. package/src/server/domain/collaboration/collaboration-room.js +603 -0
  391. package/src/server/domain/collaboration/protocol.js +2 -0
  392. package/src/server/domain/collaboration/room-client-state-store.js +28 -0
  393. package/src/server/domain/collaboration/room-persistence-controller.js +80 -0
  394. package/src/server/domain/collaboration/room-registry.js +94 -0
  395. package/src/server/domain/git-service.js +1 -0
  396. package/src/server/domain/plantuml-encoder.js +49 -0
  397. package/src/server/domain/plantuml-renderer.js +1 -0
  398. package/src/server/index.js +72 -0
  399. package/src/server/infrastructure/git/command-runner.js +48 -0
  400. package/src/server/infrastructure/git/concurrency.js +19 -0
  401. package/src/server/infrastructure/git/diff-service.js +389 -0
  402. package/src/server/infrastructure/git/errors.js +5 -0
  403. package/src/server/infrastructure/git/git-service.js +216 -0
  404. package/src/server/infrastructure/git/parsers.js +401 -0
  405. package/src/server/infrastructure/git/path-utils.js +65 -0
  406. package/src/server/infrastructure/git/responses.js +108 -0
  407. package/src/server/infrastructure/git/status-service.js +99 -0
  408. package/src/server/infrastructure/git/untracked-files.js +101 -0
  409. package/src/server/infrastructure/http/create-auth-api-handler.js +48 -0
  410. package/src/server/infrastructure/http/create-esm-proxy-handler.js +130 -0
  411. package/src/server/infrastructure/http/create-git-api-command-handler.js +170 -0
  412. package/src/server/infrastructure/http/create-git-api-handler.js +40 -0
  413. package/src/server/infrastructure/http/create-git-api-query-handler.js +62 -0
  414. package/src/server/infrastructure/http/create-plantuml-api-handler.js +43 -0
  415. package/src/server/infrastructure/http/create-request-handler.js +138 -0
  416. package/src/server/infrastructure/http/create-static-handler.js +167 -0
  417. package/src/server/infrastructure/http/create-vault-api-command-handler.js +161 -0
  418. package/src/server/infrastructure/http/create-vault-api-handler.js +43 -0
  419. package/src/server/infrastructure/http/create-vault-api-query-handler.js +82 -0
  420. package/src/server/infrastructure/http/http-errors.js +13 -0
  421. package/src/server/infrastructure/http/http-response.js +167 -0
  422. package/src/server/infrastructure/http/request-body.js +56 -0
  423. package/src/server/infrastructure/persistence/path-utils.js +90 -0
  424. package/src/server/infrastructure/persistence/sidecar-store.js +150 -0
  425. package/src/server/infrastructure/persistence/vault-content-adapter.js +49 -0
  426. package/src/server/infrastructure/persistence/vault-file-store.js +435 -0
  427. package/src/server/infrastructure/plantuml/plantuml-renderer.js +56 -0
  428. package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +194 -0
  429. package/src/server/infrastructure/websocket/client-socket-session.js +151 -0
  430. package/src/server/startup/git-remote-bootstrap.js +435 -0
@@ -0,0 +1,216 @@
1
+ import { createGitRequestError } from './errors.js';
2
+ import { normalizeRelativeGitPath } from './path-utils.js';
3
+ import { GitCommandRunner } from './command-runner.js';
4
+ import { GitDiffService } from './diff-service.js';
5
+ import { parseNameStatusOutput } from './parsers.js';
6
+ import { createEmptyWorkspaceChange, createWorkspaceChange } from './responses.js';
7
+ import { GitStatusService } from './status-service.js';
8
+ import { GitUntrackedFileService } from './untracked-files.js';
9
+
10
+ export class GitService {
11
+ constructor({
12
+ commandEnv = null,
13
+ enabled = true,
14
+ execFileImpl,
15
+ maxInitialPatchBytes = 250_000,
16
+ maxInitialPatchLines = 1_500,
17
+ statusCacheTtlMs = 2_000,
18
+ vaultDir,
19
+ }) {
20
+ this.commandRunner = new GitCommandRunner({
21
+ commandEnv,
22
+ enabled,
23
+ execFileImpl,
24
+ vaultDir,
25
+ });
26
+ this.untrackedFileService = new GitUntrackedFileService({ vaultDir });
27
+ this.statusService = new GitStatusService({
28
+ commandRunner: this.commandRunner,
29
+ statusCacheTtlMs,
30
+ untrackedFileService: this.untrackedFileService,
31
+ });
32
+ this.diffService = new GitDiffService({
33
+ commandRunner: this.commandRunner,
34
+ maxInitialPatchBytes,
35
+ maxInitialPatchLines,
36
+ statusService: this.statusService,
37
+ untrackedFileService: this.untrackedFileService,
38
+ });
39
+ }
40
+
41
+ async isGitRepo() {
42
+ return this.commandRunner.isGitRepo();
43
+ }
44
+
45
+ async execGit(args) {
46
+ return this.commandRunner.execGit(args);
47
+ }
48
+
49
+ invalidateStatusCache() {
50
+ this.statusService.invalidate();
51
+ this.diffService.invalidate();
52
+ }
53
+
54
+ async getStatus(options = {}) {
55
+ return this.statusService.getStatus(options);
56
+ }
57
+
58
+ async stageFile(path) {
59
+ const normalizedPath = normalizeRelativeGitPath(path);
60
+ await this.commandRunner.execGit(['add', '-A', '--', normalizedPath]);
61
+ this.invalidateStatusCache();
62
+ return {
63
+ ok: true,
64
+ path: normalizedPath,
65
+ workspaceChange: createEmptyWorkspaceChange(),
66
+ };
67
+ }
68
+
69
+ async unstageFile(path) {
70
+ const normalizedPath = normalizeRelativeGitPath(path);
71
+ await this.commandRunner.execGit(['reset', 'HEAD', '--', normalizedPath]);
72
+ this.invalidateStatusCache();
73
+ return {
74
+ ok: true,
75
+ path: normalizedPath,
76
+ workspaceChange: createEmptyWorkspaceChange(),
77
+ };
78
+ }
79
+
80
+ async commitStaged({ message } = {}) {
81
+ const normalizedMessage = String(message ?? '').trim();
82
+ if (!normalizedMessage) {
83
+ throw createGitRequestError(400, 'Missing commit message');
84
+ }
85
+
86
+ const status = await this.getStatus({ force: true });
87
+ if (Number(status.summary?.staged || 0) === 0) {
88
+ throw createGitRequestError(409, 'No staged changes to commit');
89
+ }
90
+
91
+ await this.commandRunner.execGit(['commit', '-m', normalizedMessage]);
92
+ const hash = (await this.commandRunner.execGit(['rev-parse', 'HEAD'])).trim();
93
+ const shortHash = (await this.commandRunner.execGit(['rev-parse', '--short', 'HEAD'])).trim();
94
+ this.invalidateStatusCache();
95
+ return {
96
+ commit: {
97
+ hash,
98
+ message: normalizedMessage,
99
+ shortHash,
100
+ },
101
+ ok: true,
102
+ workspaceChange: createEmptyWorkspaceChange(),
103
+ };
104
+ }
105
+
106
+ async pushBranch() {
107
+ const status = await this.getStatus({ force: true });
108
+ if (status.branch?.detached) {
109
+ throw createGitRequestError(409, 'Cannot push from a detached HEAD');
110
+ }
111
+ if (!status.branch?.upstream) {
112
+ throw createGitRequestError(409, 'No upstream branch is configured for push');
113
+ }
114
+
115
+ const output = await this.commandRunner.execGit(['push']);
116
+ this.invalidateStatusCache();
117
+ return {
118
+ ok: true,
119
+ output: output.trim(),
120
+ workspaceChange: createEmptyWorkspaceChange(),
121
+ };
122
+ }
123
+
124
+ async pullBranch() {
125
+ const status = await this.getStatus({ force: true });
126
+ if (status.branch?.detached) {
127
+ throw createGitRequestError(409, 'Cannot pull from a detached HEAD');
128
+ }
129
+ if (!status.branch?.upstream) {
130
+ throw createGitRequestError(409, 'No upstream branch is configured for pull');
131
+ }
132
+
133
+ const beforeRef = await this.getHeadRef();
134
+ const output = await this.commandRunner.execGit(['pull', '--ff-only']);
135
+ const afterRef = await this.getHeadRef();
136
+ this.invalidateStatusCache();
137
+ return {
138
+ afterRef,
139
+ beforeRef,
140
+ ok: true,
141
+ output: output.trim(),
142
+ workspaceChange: await this.createWorkspaceChangeFromRefs(beforeRef, afterRef),
143
+ };
144
+ }
145
+
146
+ async resetFileToHead(path) {
147
+ const normalizedPath = normalizeRelativeGitPath(path);
148
+ const sourceRef = 'HEAD';
149
+ const existsOnSource = await this.pathExistsAtRef(sourceRef, normalizedPath);
150
+
151
+ if (existsOnSource) {
152
+ await this.commandRunner.execGit(['restore', '--source', sourceRef, '--staged', '--worktree', '--', normalizedPath]);
153
+ this.invalidateStatusCache();
154
+ return {
155
+ ok: true,
156
+ path: normalizedPath,
157
+ sourceRef,
158
+ workspaceChange: createWorkspaceChange({
159
+ changedPaths: [normalizedPath],
160
+ }),
161
+ };
162
+ }
163
+
164
+ await this.commandRunner.execGit(['rm', '-f', '--ignore-unmatch', '--', normalizedPath]);
165
+ await this.commandRunner.execGit(['clean', '-f', '--', normalizedPath]);
166
+ this.invalidateStatusCache();
167
+ return {
168
+ ok: true,
169
+ path: normalizedPath,
170
+ sourceRef,
171
+ workspaceChange: createWorkspaceChange({
172
+ deletedPaths: [normalizedPath],
173
+ }),
174
+ };
175
+ }
176
+
177
+ async getDiff({ allowLargePatch = false, metaOnly = false, path = null, scope = 'working-tree' } = {}) {
178
+ const normalizedPath = path ? normalizeRelativeGitPath(path) : null;
179
+ return this.diffService.getDiff({
180
+ allowLargePatch,
181
+ metaOnly,
182
+ path: normalizedPath,
183
+ scope,
184
+ });
185
+ }
186
+
187
+ async getHeadRef() {
188
+ try {
189
+ const output = await this.commandRunner.execGit(['rev-parse', 'HEAD']);
190
+ return output.trim() || null;
191
+ } catch {
192
+ return null;
193
+ }
194
+ }
195
+
196
+ async pathExistsAtRef(ref, path) {
197
+ try {
198
+ await this.commandRunner.execGit(['cat-file', '-e', `${ref}:${path}`]);
199
+ return true;
200
+ } catch {
201
+ return false;
202
+ }
203
+ }
204
+
205
+ async createWorkspaceChangeFromRefs(beforeRef, afterRef) {
206
+ if (!afterRef || beforeRef === afterRef) {
207
+ return createEmptyWorkspaceChange();
208
+ }
209
+
210
+ const args = beforeRef
211
+ ? ['diff', '--name-status', '--find-renames', beforeRef, afterRef]
212
+ : ['diff-tree', '--root', '--no-commit-id', '--name-status', '--find-renames', '-r', afterRef];
213
+ const parsed = parseNameStatusOutput(await this.commandRunner.execGit(args));
214
+ return createWorkspaceChange(parsed);
215
+ }
216
+ }
@@ -0,0 +1,401 @@
1
+ import { decodeQuotedPath, parseRenamePath, stripDiffPrefix } from './path-utils.js';
2
+ import { createEmptyBranchStatus, createStatusInfo } from './responses.js';
3
+
4
+ function parseBranchLine(line) {
5
+ const result = {
6
+ ...createEmptyBranchStatus(),
7
+ hasCommits: true,
8
+ };
9
+
10
+ if (!line.startsWith('## ')) {
11
+ return result;
12
+ }
13
+
14
+ const branchText = line.slice(3).trim();
15
+ if (!branchText) {
16
+ return result;
17
+ }
18
+
19
+ if (branchText.startsWith('No commits yet on ')) {
20
+ result.name = branchText.slice('No commits yet on '.length);
21
+ result.hasCommits = false;
22
+ return result;
23
+ }
24
+
25
+ if (branchText.startsWith('HEAD (no branch)')) {
26
+ result.name = 'HEAD';
27
+ result.detached = true;
28
+ return result;
29
+ }
30
+
31
+ const metadataIndex = branchText.indexOf(' [');
32
+ const branchSegment = metadataIndex === -1
33
+ ? branchText
34
+ : branchText.slice(0, metadataIndex);
35
+ const metadataSegment = metadataIndex === -1
36
+ ? ''
37
+ : branchText.slice(metadataIndex + 2, -1);
38
+ const [name, upstream] = branchSegment.split('...');
39
+
40
+ result.name = name || null;
41
+ result.upstream = upstream || null;
42
+
43
+ if (metadataSegment) {
44
+ for (const token of metadataSegment.split(',')) {
45
+ const value = token.trim();
46
+ if (value.startsWith('ahead ')) {
47
+ result.ahead = Number.parseInt(value.slice(6), 10) || 0;
48
+ } else if (value.startsWith('behind ')) {
49
+ result.behind = Number.parseInt(value.slice(7), 10) || 0;
50
+ }
51
+ }
52
+ }
53
+
54
+ return result;
55
+ }
56
+
57
+ function parseHunkHeader(line) {
58
+ const match = line.match(/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$/u);
59
+ if (!match) {
60
+ return null;
61
+ }
62
+
63
+ return {
64
+ header: line,
65
+ newLines: Number.parseInt(match[4] ?? '1', 10),
66
+ newStart: Number.parseInt(match[3], 10),
67
+ oldLines: Number.parseInt(match[2] ?? '1', 10),
68
+ oldStart: Number.parseInt(match[1], 10),
69
+ section: match[5]?.trim() || '',
70
+ };
71
+ }
72
+
73
+ function finalizeFile(file) {
74
+ if (!file) {
75
+ return null;
76
+ }
77
+
78
+ if (file.oldPath === file.path) {
79
+ file.oldPath = null;
80
+ }
81
+
82
+ return file;
83
+ }
84
+
85
+ export function splitContentLines(content) {
86
+ const lines = String(content ?? '').replace(/\r\n/g, '\n').split('\n');
87
+ if (lines.length > 0 && lines[lines.length - 1] === '') {
88
+ lines.pop();
89
+ }
90
+ return lines;
91
+ }
92
+
93
+ export function parseStatusOutput(output) {
94
+ const lines = String(output ?? '')
95
+ .split(/\r?\n/u)
96
+ .filter(Boolean);
97
+ const [branchLine = '', ...statusLines] = lines;
98
+ const branch = parseBranchLine(branchLine);
99
+ const sections = {
100
+ staged: [],
101
+ 'working-tree': [],
102
+ untracked: [],
103
+ };
104
+ const uniquePaths = new Set();
105
+
106
+ for (const line of statusLines) {
107
+ if (line.length < 3) {
108
+ continue;
109
+ }
110
+
111
+ const indexStatus = line[0];
112
+ const workTreeStatus = line[1];
113
+ const rawPath = line.slice(3);
114
+
115
+ if (indexStatus === '!' && workTreeStatus === '!') {
116
+ continue;
117
+ }
118
+
119
+ if (indexStatus === '?' && workTreeStatus === '?') {
120
+ const file = {
121
+ ...createStatusInfo('?'),
122
+ oldPath: null,
123
+ path: decodeQuotedPath(rawPath),
124
+ scope: 'untracked',
125
+ };
126
+ sections.untracked.push(file);
127
+ uniquePaths.add(file.path);
128
+ continue;
129
+ }
130
+
131
+ const parsedPath = parseRenamePath(rawPath);
132
+
133
+ if (indexStatus !== ' ') {
134
+ const file = {
135
+ ...createStatusInfo(indexStatus),
136
+ oldPath: parsedPath.oldPath,
137
+ path: parsedPath.path,
138
+ scope: 'staged',
139
+ };
140
+ sections.staged.push(file);
141
+ uniquePaths.add(file.path);
142
+ }
143
+
144
+ if (workTreeStatus !== ' ') {
145
+ const file = {
146
+ ...createStatusInfo(workTreeStatus),
147
+ oldPath: parsedPath.oldPath,
148
+ path: parsedPath.path,
149
+ scope: 'working-tree',
150
+ };
151
+ sections['working-tree'].push(file);
152
+ uniquePaths.add(file.path);
153
+ }
154
+ }
155
+
156
+ return {
157
+ branch,
158
+ sections,
159
+ summary: {
160
+ changedFiles: uniquePaths.size,
161
+ staged: sections.staged.length,
162
+ untracked: sections.untracked.length,
163
+ workingTree: sections['working-tree'].length,
164
+ },
165
+ };
166
+ }
167
+
168
+ export function parseNumstatOutput(output) {
169
+ return String(output ?? '')
170
+ .split(/\r?\n/u)
171
+ .filter(Boolean)
172
+ .reduce((summary, line) => {
173
+ const [rawAdditions = '0', rawDeletions = '0'] = line.split('\t');
174
+ const additions = rawAdditions === '-' ? 0 : Number.parseInt(rawAdditions, 10) || 0;
175
+ const deletions = rawDeletions === '-' ? 0 : Number.parseInt(rawDeletions, 10) || 0;
176
+
177
+ return {
178
+ additions: summary.additions + additions,
179
+ deletions: summary.deletions + deletions,
180
+ };
181
+ }, {
182
+ additions: 0,
183
+ deletions: 0,
184
+ });
185
+ }
186
+
187
+ export function parseNumstatEntries(output) {
188
+ return String(output ?? '')
189
+ .split(/\r?\n/u)
190
+ .filter(Boolean)
191
+ .map((line) => {
192
+ const [rawAdditions = '0', rawDeletions = '0', ...rest] = line.split('\t');
193
+ return {
194
+ additions: rawAdditions === '-' ? 0 : Number.parseInt(rawAdditions, 10) || 0,
195
+ deletions: rawDeletions === '-' ? 0 : Number.parseInt(rawDeletions, 10) || 0,
196
+ rawPath: rest.join('\t'),
197
+ };
198
+ });
199
+ }
200
+
201
+ export function parseNameStatusOutput(output) {
202
+ return String(output ?? '')
203
+ .split(/\r?\n/u)
204
+ .filter(Boolean)
205
+ .reduce((summary, line) => {
206
+ const [rawStatus = '', ...parts] = line.split('\t');
207
+ const status = rawStatus.trim().toUpperCase();
208
+ if (!status) {
209
+ return summary;
210
+ }
211
+
212
+ if (status.startsWith('R') || status.startsWith('C')) {
213
+ const [oldPath = '', newPath = ''] = parts.map((value) => decodeQuotedPath(value));
214
+ if (oldPath && newPath && oldPath !== newPath) {
215
+ summary.renamedPaths.push({ newPath, oldPath });
216
+ }
217
+ return summary;
218
+ }
219
+
220
+ const [path = ''] = parts.map((value) => decodeQuotedPath(value));
221
+ if (!path) {
222
+ return summary;
223
+ }
224
+
225
+ if (status.startsWith('D')) {
226
+ summary.deletedPaths.push(path);
227
+ return summary;
228
+ }
229
+
230
+ summary.changedPaths.push(path);
231
+ return summary;
232
+ }, {
233
+ changedPaths: [],
234
+ deletedPaths: [],
235
+ renamedPaths: [],
236
+ });
237
+ }
238
+
239
+ export function countPatchLines(file = null) {
240
+ return (file?.hunks ?? []).reduce((total, hunk) => total + (hunk.lines?.length ?? 0), 0);
241
+ }
242
+
243
+ export function parseUnifiedDiff(diffText) {
244
+ if (!diffText) {
245
+ return [];
246
+ }
247
+
248
+ const files = [];
249
+ const lines = String(diffText).split(/\r?\n/u);
250
+ let currentFile = null;
251
+ let currentHunk = null;
252
+ let oldLineNumber = 0;
253
+ let newLineNumber = 0;
254
+
255
+ for (const line of lines) {
256
+ if (line.startsWith('diff --git ')) {
257
+ const parts = line.split(' ');
258
+ const oldPath = stripDiffPrefix(parts[2]);
259
+ const newPath = stripDiffPrefix(parts[3]);
260
+ currentFile = {
261
+ code: 'M',
262
+ hunks: [],
263
+ isBinary: false,
264
+ oldPath,
265
+ path: newPath ?? oldPath,
266
+ stats: {
267
+ additions: 0,
268
+ deletions: 0,
269
+ },
270
+ status: 'modified',
271
+ };
272
+ currentHunk = null;
273
+ files.push(currentFile);
274
+ continue;
275
+ }
276
+
277
+ if (!currentFile) {
278
+ continue;
279
+ }
280
+
281
+ if (line.startsWith('new file mode ')) {
282
+ currentFile.code = 'A';
283
+ currentFile.status = 'added';
284
+ continue;
285
+ }
286
+
287
+ if (line.startsWith('deleted file mode ')) {
288
+ currentFile.code = 'D';
289
+ currentFile.status = 'deleted';
290
+ continue;
291
+ }
292
+
293
+ if (line.startsWith('rename from ')) {
294
+ currentFile.code = 'R';
295
+ currentFile.status = 'renamed';
296
+ currentFile.oldPath = line.slice('rename from '.length);
297
+ continue;
298
+ }
299
+
300
+ if (line.startsWith('rename to ')) {
301
+ currentFile.path = line.slice('rename to '.length);
302
+ continue;
303
+ }
304
+
305
+ if (line.startsWith('copy from ')) {
306
+ currentFile.code = 'C';
307
+ currentFile.status = 'copied';
308
+ currentFile.oldPath = line.slice('copy from '.length);
309
+ continue;
310
+ }
311
+
312
+ if (line.startsWith('copy to ')) {
313
+ currentFile.path = line.slice('copy to '.length);
314
+ continue;
315
+ }
316
+
317
+ if (line.startsWith('Binary files ')) {
318
+ currentFile.isBinary = true;
319
+ currentFile.binaryMessage = line;
320
+ continue;
321
+ }
322
+
323
+ if (line.startsWith('--- ')) {
324
+ currentFile.oldPath = stripDiffPrefix(line.slice(4));
325
+ continue;
326
+ }
327
+
328
+ if (line.startsWith('+++ ')) {
329
+ currentFile.path = stripDiffPrefix(line.slice(4)) ?? currentFile.path;
330
+ continue;
331
+ }
332
+
333
+ const hunk = parseHunkHeader(line);
334
+ if (hunk) {
335
+ currentHunk = {
336
+ ...hunk,
337
+ lines: [],
338
+ };
339
+ currentFile.hunks.push(currentHunk);
340
+ oldLineNumber = hunk.oldStart;
341
+ newLineNumber = hunk.newStart;
342
+ continue;
343
+ }
344
+
345
+ if (!currentHunk) {
346
+ continue;
347
+ }
348
+
349
+ const prefix = line[0];
350
+ const content = line.slice(1);
351
+
352
+ if (prefix === ' ') {
353
+ currentHunk.lines.push({
354
+ content,
355
+ newLine: newLineNumber,
356
+ oldLine: oldLineNumber,
357
+ type: 'context',
358
+ });
359
+ oldLineNumber += 1;
360
+ newLineNumber += 1;
361
+ continue;
362
+ }
363
+
364
+ if (prefix === '-') {
365
+ currentFile.stats.deletions += 1;
366
+ currentHunk.lines.push({
367
+ content,
368
+ newLine: null,
369
+ oldLine: oldLineNumber,
370
+ type: 'deletion',
371
+ });
372
+ oldLineNumber += 1;
373
+ continue;
374
+ }
375
+
376
+ if (prefix === '+') {
377
+ currentFile.stats.additions += 1;
378
+ currentHunk.lines.push({
379
+ content,
380
+ newLine: newLineNumber,
381
+ oldLine: null,
382
+ type: 'addition',
383
+ });
384
+ newLineNumber += 1;
385
+ continue;
386
+ }
387
+
388
+ if (prefix === '\\') {
389
+ currentHunk.lines.push({
390
+ content: line,
391
+ newLine: null,
392
+ oldLine: null,
393
+ type: 'note',
394
+ });
395
+ }
396
+ }
397
+
398
+ return files
399
+ .map((file) => finalizeFile(file))
400
+ .filter(Boolean);
401
+ }
@@ -0,0 +1,65 @@
1
+ import { createGitRequestError } from './errors.js';
2
+
3
+ export function decodeQuotedPath(pathValue) {
4
+ const rawValue = String(pathValue ?? '').trim();
5
+ if (!(rawValue.startsWith('"') && rawValue.endsWith('"'))) {
6
+ return rawValue;
7
+ }
8
+
9
+ return rawValue
10
+ .slice(1, -1)
11
+ .replace(/\\([\\"])/g, '$1')
12
+ .replace(/\\t/g, '\t')
13
+ .replace(/\\n/g, '\n')
14
+ .replace(/\\([0-7]{3})/g, (_match, value) => String.fromCharCode(Number.parseInt(value, 8)));
15
+ }
16
+
17
+ export function normalizeRelativeGitPath(pathValue) {
18
+ const normalized = decodeQuotedPath(pathValue)
19
+ .trim()
20
+ .replace(/\\/g, '/')
21
+ .replace(/^\/+/u, '')
22
+ .split('/')
23
+ .map((segment) => segment.trim())
24
+ .filter(Boolean);
25
+
26
+ if (normalized.length === 0) {
27
+ throw createGitRequestError(400, 'Missing path parameter');
28
+ }
29
+
30
+ if (normalized.some((segment) => segment === '.' || segment === '..')) {
31
+ throw createGitRequestError(400, 'Invalid path parameter');
32
+ }
33
+
34
+ return normalized.join('/');
35
+ }
36
+
37
+ export function parseRenamePath(rawPath) {
38
+ const decodedPath = decodeQuotedPath(rawPath);
39
+ const separator = ' -> ';
40
+ const separatorIndex = decodedPath.indexOf(separator);
41
+ if (separatorIndex === -1) {
42
+ return {
43
+ oldPath: null,
44
+ path: decodedPath,
45
+ };
46
+ }
47
+
48
+ return {
49
+ oldPath: decodedPath.slice(0, separatorIndex),
50
+ path: decodedPath.slice(separatorIndex + separator.length),
51
+ };
52
+ }
53
+
54
+ export function stripDiffPrefix(pathValue) {
55
+ const normalizedPath = String(pathValue ?? '').replace(/\s+$/u, '');
56
+ if (!normalizedPath || normalizedPath === '/dev/null') {
57
+ return null;
58
+ }
59
+
60
+ if (normalizedPath.startsWith('a/') || normalizedPath.startsWith('b/')) {
61
+ return normalizedPath.slice(2);
62
+ }
63
+
64
+ return normalizedPath;
65
+ }