collabmd 0.1.39 → 0.1.41

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 (502) hide show
  1. package/README.md +75 -1
  2. package/dist/client/assets/{CodeMirrorEditor-UCMRAMCV-75Zi8U_A.js → CodeMirrorEditor-UCMRAMCV-DHEFSr_E.js} +1 -1
  3. package/dist/client/assets/{ar-SA-NXDWD63E-CTf_wpt3.js → ar-SA-NXDWD63E-S8m2UyIj.js} +1 -1
  4. package/dist/client/assets/{arc-DD8jaAGl.js → arc-OeTCl9Oy.js} +1 -1
  5. package/dist/client/assets/architecture-7EHR7CIX-BQpCYB3J.js +1 -0
  6. package/dist/client/assets/{architectureDiagram-Q4EWVU46-BftXiJA8.js → architectureDiagram-3BPJPVTR-CDqq0KA0.js} +3 -3
  7. package/dist/client/assets/{az-AZ-MXSORGZV-C_C9i9u3.js → az-AZ-MXSORGZV-DSzWvZBB.js} +1 -1
  8. package/dist/client/assets/bases-preview-controller-CBHDzzot.js +143 -0
  9. package/dist/client/assets/{bg-BG-O6MV2KSF-YmfvQf63.js → bg-BG-O6MV2KSF-C5nBekx3.js} +1 -1
  10. package/dist/client/assets/blockDiagram-GPEHLZMM-Z9jBLpGg.js +132 -0
  11. package/dist/client/assets/{bn-IN-MMW2ORAC-BTEFR4Ed.js → bn-BD-T2VJNT7N-D-8xXOzM.js} +1 -1
  12. package/dist/client/assets/{bn-BD-T2VJNT7N-BD0ob0JE.js → bn-IN-MMW2ORAC-D-8xXOzM.js} +1 -1
  13. package/dist/client/assets/button-2ZnWQkWV.js +1 -0
  14. package/dist/client/assets/{c4Diagram-AHTNJAMY-Gz7ZAK0d.js → c4Diagram-AAUBKEIU-UA_Eopag.js} +2 -2
  15. package/dist/client/assets/{ca-ES-MKBCGNOG-aLX_cjA0.js → ca-ES-MKBCGNOG-B3Ly68p3.js} +1 -1
  16. package/dist/client/assets/channel-CpvwJaGK.js +1 -0
  17. package/dist/client/assets/{chunk-EDXVE4YY-M4QxyGNt.js → chunk-2J33WTMH-DjYq2kZ3.js} +1 -1
  18. package/dist/client/assets/chunk-3OPIFGDE-DucrRywM.js +62 -0
  19. package/dist/client/assets/{chunk-4BX2VUAB-D5YiFdu1.js → chunk-4BX2VUAB-DcdHBPEH.js} +1 -1
  20. package/dist/client/assets/chunk-4EGX6M5U-BfCFom1o.js +1 -0
  21. package/dist/client/assets/{chunk-55IACEB6-VHgZjidg.js → chunk-55IACEB6-B7ycySPI.js} +1 -1
  22. package/dist/client/assets/chunk-5DO6E6H7-DP8QnaJj.js +1 -0
  23. package/dist/client/assets/chunk-5ZQYHXKU-C4q4UVKa.js +2 -0
  24. package/dist/client/assets/chunk-727SXJPM-DdWH2cfs.js +206 -0
  25. package/dist/client/assets/chunk-AQP2D5EJ-D8o8QwFY.js +231 -0
  26. package/dist/client/assets/{chunk-LIHQZDEY-DtYrHuCi.js → chunk-BR22UD5L-CT6fcRkN.js} +1 -1
  27. package/dist/client/assets/{chunk-BSJP7CBP-D2KkrA_B.js → chunk-BSJP7CBP-COmh28sk.js} +1 -1
  28. package/dist/client/assets/chunk-CSCIHK7Q-D0bHjxCO.js +123 -0
  29. package/dist/client/assets/chunk-FHYWG6QK-Ce318laP.js +1 -0
  30. package/dist/client/assets/{chunk-FMBD7UC4-qQT7MtX2.js → chunk-FMBD7UC4-CM39cCCr.js} +1 -1
  31. package/dist/client/assets/chunk-KSCS5N6A-Bk33m7yK.js +10 -0
  32. package/dist/client/assets/{chunk-ZZ45TVLE-DGIhE_ST.js → chunk-L5ZTLDWV-J2sQu4Os.js} +1 -1
  33. package/dist/client/assets/chunk-LZXEDZCA-CTmBbzaL.js +2 -0
  34. package/dist/client/assets/chunk-MMN3DZ5N-pTRxhVYl.js +35 -0
  35. package/dist/client/assets/chunk-MPE355IW-C_vkbqLj.js +1 -0
  36. package/dist/client/assets/chunk-MZUSXYTE-BnVcgphH.js +1 -0
  37. package/dist/client/assets/chunk-N66VUXT2-B6CG-CnY.js +1 -0
  38. package/dist/client/assets/{chunk-YZCP3GAM-D1jf1WUI.js → chunk-ND2GUHAM-D-_vkA5V.js} +1 -1
  39. package/dist/client/assets/chunk-NNHCCRGN-DlpIbxXb.js +159 -0
  40. package/dist/client/assets/{chunk-X2U36JSP-D3OEPG7k.js → chunk-NZK2D7GU-Dc42C0Jt.js} +1 -1
  41. package/dist/client/assets/{chunk-U2HBQHQK-BBXgsocS.js → chunk-O5CBEL6O-DdEDfb8z.js} +4 -4
  42. package/dist/client/assets/chunk-PUPMXCY4-BZ88kQjK.js +1 -0
  43. package/dist/client/assets/chunk-QZHKN3VN-D5YLQvjj.js +1 -0
  44. package/dist/client/assets/{chunk-SRAX5OIU-yDw8XRsi.js → chunk-SRAX5OIU-CiRgnkYo.js} +1 -1
  45. package/dist/client/assets/chunk-UIBZB4QT-r8p3pBHw.js +1 -0
  46. package/dist/client/assets/chunk-WCWK7LTN-DrKYkgXF.js +1 -0
  47. package/dist/client/assets/chunk-WU5MYG2G-Cg2iUbET.js +1 -0
  48. package/dist/client/assets/{chunk-XPW4576I-BUfyrOtN.js → chunk-XPW4576I-BZyvtu42.js} +1 -1
  49. package/dist/client/assets/{chunk-Z5NKEFVG-Vu8zBV4H.js → chunk-Z5NKEFVG-Dknufskm.js} +7 -7
  50. package/dist/client/assets/chunk-aKtaBQYM.js +1 -0
  51. package/dist/client/assets/classDiagram-4FO5ZUOK-CGWY0cfg.js +1 -0
  52. package/dist/client/assets/classDiagram-v2-Q7XG4LA2-CGWY0cfg.js +1 -0
  53. package/dist/client/assets/{cose-bilkent-S5V4N54A-A8ssRFyt.js → cose-bilkent-S5V4N54A-BuQb9WEM.js} +1 -1
  54. package/dist/client/assets/{cs-CZ-V77HGUP7-Du3y53BB.js → cs-CZ-V77HGUP7-6BCNHMpz.js} +1 -1
  55. package/dist/client/assets/{cytoscape.esm-BurByw8X.js → cytoscape.esm-DelgaX4f.js} +2 -2
  56. package/dist/client/assets/{da-DK-I5RFNTM4-CDJtjf5s.js → da-DK-I5RFNTM4-CVeCWpi2.js} +1 -1
  57. package/dist/client/assets/dagre-BM42HDAG-ux5hA7G6.js +4 -0
  58. package/dist/client/assets/dagre-Bx709z4p.js +1 -0
  59. package/dist/client/assets/{de-CH-WLRDEVBV-CLV2tVw6.js → de-CH-WLRDEVBV-CV-FNCkY.js} +1 -1
  60. package/dist/client/assets/{de-DE-DTI4WUSC-B53J0BQ8.js → de-DE-DTI4WUSC-CV-FNCkY.js} +1 -1
  61. package/dist/client/assets/diagram-2AECGRRQ-Cx-EPj3F.js +43 -0
  62. package/dist/client/assets/{diagram-5BDNPKRD-BuK-UBuN.js → diagram-5GNKFQAL-B6qUTxVg.js} +2 -2
  63. package/dist/client/assets/diagram-KO2AKTUF-BedClayW.js +3 -0
  64. package/dist/client/assets/{diagram-TYMM5635-CT8BdT4s.js → diagram-LMA3HP47-DCwyG0i5.js} +1 -1
  65. package/dist/client/assets/diagram-OG6HWLK6-BZD0jSxR.js +24 -0
  66. package/dist/client/assets/diagram-action-icons-aa_KOv9h.js +36 -0
  67. package/dist/client/assets/{dist-BXiFOexW.js → dist-B-m0-H59.js} +1 -1
  68. package/dist/client/assets/dist-B6Q0y0J8.js +1 -0
  69. package/dist/client/assets/dist-BCQCG0we.js +1 -0
  70. package/dist/client/assets/{dist-Bz-8_JmE.js → dist-BEyxdnUD.js} +1 -1
  71. package/dist/client/assets/{dist-eAgBpkKv.js → dist-BYneHrvV.js} +1 -1
  72. package/dist/client/assets/dist-BsPHL5xw2.js +1 -0
  73. package/dist/client/assets/{dist-CRyP6okk.js → dist-CX-kKEdL.js} +1 -1
  74. package/dist/client/assets/{dist-Bp_j2hKC.js → dist-CaLooK5r.js} +1 -1
  75. package/dist/client/assets/{dist-CQZDuOJ9.js → dist-Cd4FT8TV.js} +1 -1
  76. package/dist/client/assets/{dist-CIt_ogHO.js → dist-ClWZ99Dh.js} +1 -1
  77. package/dist/client/assets/{dist-D8d0IGSI.js → dist-D01mg-Uh.js} +1 -1
  78. package/dist/client/assets/{dist-fpFkgu34.js → dist-D36UTodj.js} +1 -1
  79. package/dist/client/assets/{dist-bkoMCmF7.js → dist-D6YOhZ_d.js} +1 -1
  80. package/dist/client/assets/{dist-CH3l6nVf.js → dist-D8jTFU06.js} +1 -1
  81. package/dist/client/assets/dist-DGI-0uwF.js +1 -0
  82. package/dist/client/assets/{dist-Das5WX49.js → dist-DGO-wCq8.js} +1 -1
  83. package/dist/client/assets/dist-DMKYvLqD.js +1 -0
  84. package/dist/client/assets/{dist-8EAyH6_p.js → dist-DRQhk99i.js} +1 -1
  85. package/dist/client/assets/{dist-uyVGTnZh.js → dist-DScq22KK.js} +1 -1
  86. package/dist/client/assets/{dist-wkd-N1L5.js → dist-DbpddOpB.js} +1 -1
  87. package/dist/client/assets/{dist-1SMeCZhf.js → dist-Dl5uZm2T.js} +1 -1
  88. package/dist/client/assets/{dist-_THc9HiJ.js → dist-DvpEZjAN.js} +1 -1
  89. package/dist/client/assets/dist-Dw8hKOQm.js +1 -0
  90. package/dist/client/assets/{dist-NcJIpTJ8.js → dist-G7j-noyR.js} +1 -1
  91. package/dist/client/assets/dist-PItC1DRE.js +1 -0
  92. package/dist/client/assets/{dist-QktK6LIH.js → dist-cMoydUa-.js} +1 -1
  93. package/dist/client/assets/dist-cTuGB1EW.js +9 -0
  94. package/dist/client/assets/{dist-yy8SO13g.js → dist-efgaKpVU.js} +1 -1
  95. package/dist/client/assets/{dist-B7XQNod9.js → dist-nx-MGJIM.js} +1 -1
  96. package/dist/client/assets/{dist-DplP0BiK.js → dist-pww3cL4Q.js} +7 -7
  97. package/dist/client/assets/dist-uhQ-mkuh.js +2 -0
  98. package/dist/client/assets/{dockerfile-D8_6_FRV.js → dockerfile-BLkNEvjs.js} +1 -1
  99. package/dist/client/assets/drawio-editor-BM_W6Lkj.js +9 -0
  100. package/dist/client/assets/drawio-embed-controller-BKHnRnaj.js +1 -0
  101. package/dist/client/assets/drawioEditor-DBfHYCO5.js +2 -0
  102. package/dist/client/assets/editor-session-VueuoR_r.js +16 -0
  103. package/dist/client/assets/{el-GR-ZXDJ2OS4-DFmRQv0o.js → el-GR-ZXDJ2OS4-DzgGVibO.js} +1 -1
  104. package/dist/client/assets/{en-CMP6EMR6-D9x8hVSu.js → en-CMP6EMR6-l-4iz8RC.js} +1 -1
  105. package/dist/client/assets/{erDiagram-SMLLAGMA-6VFZA3Qb.js → erDiagram-TEJ5UH35-7XmGIzui.js} +2 -2
  106. package/dist/client/assets/{es-ES-DYQHAD43-BiGWIrBG.js → es-ES-DYQHAD43-DP98e8ox.js} +1 -1
  107. package/dist/client/assets/{eu-ES-QDSYU5Y3-BjwS0kZi.js → eu-ES-QDSYU5Y3-DrEfH-2N.js} +1 -1
  108. package/dist/client/assets/eventmodeling-FCH6USID-D-VxYsbw.js +1 -0
  109. package/dist/client/assets/excalidraw-editor-B3ffLqi6.css +1 -0
  110. package/dist/client/assets/excalidraw-editor-C6fTkMBx.js +9 -0
  111. package/dist/client/assets/excalidraw-embed-controller-BKx05cjZ.js +1 -0
  112. package/dist/client/assets/excalidraw-embed-reconciler-DGiagExg.js +1 -0
  113. package/dist/client/assets/{excalidraw-mermaid-stub-Df0Q2qkW.js → excalidraw-mermaid-stub-DE5FTiZB.js} +1 -1
  114. package/dist/client/assets/excalidraw-scene-DjODomMW.js +176 -0
  115. package/dist/client/assets/excalidrawEditor-DQD_lLF4.js +2 -0
  116. package/dist/client/assets/{export-page-Bnk-YQp-.js → export-page-D0iHYSPi.js} +4 -4
  117. package/dist/client/assets/exportDocument-Ct-Zvf7_.js +2 -0
  118. package/dist/client/assets/{fa-IR-26LZG4PM-BgANg2TD.js → fa-IR-26LZG4PM-CEwnMxEY.js} +1 -1
  119. package/dist/client/assets/{factor-Cz-hzBGH.js → factor-D7LVTn2l.js} +1 -1
  120. package/dist/client/assets/{fi-FI-6YS4KDE4-CBL5f3oN.js → fi-FI-6YS4KDE4-DPKGe_vC.js} +1 -1
  121. package/dist/client/assets/file-history-view-controller-CK3oHDCT.js +112 -0
  122. package/dist/client/assets/{flowDiagram-DWJPFMVM-DO9RH8YQ.js → flowDiagram-I6XJVG4X-DgTAG2K2.js} +6 -6
  123. package/dist/client/assets/{fr-FR-BRLLPTZC-CRibNSLG.js → fr-FR-BRLLPTZC-CgMmN9yd.js} +1 -1
  124. package/dist/client/assets/ganttDiagram-6RSMTGT7-Curra433.js +292 -0
  125. package/dist/client/assets/git-diff-view-controller-qorJ_Quo.js +150 -0
  126. package/dist/client/assets/git-panel-controller-DG8ws6B_.js +203 -0
  127. package/dist/client/assets/gitGraph-WXDBUCRP-CRS5XD98.js +1 -0
  128. package/dist/client/assets/gitGraphDiagram-PVQCEYII-DVf7-iH0.js +106 -0
  129. package/dist/client/assets/{gl-ES-OKUZTLYG-DEDwa_xt.js → gl-ES-OKUZTLYG-qCIGpEXP.js} +1 -1
  130. package/dist/client/assets/graphlib-B8gBHxth.js +1 -0
  131. package/dist/client/assets/{haxe-CcPA1xnA.js → haxe-DjVOVvNP.js} +1 -1
  132. package/dist/client/assets/{he-IL-26MGYIU7-47wxy70N.js → he-IL-26MGYIU7-_Pd-m9Sj.js} +1 -1
  133. package/dist/client/assets/{hi-IN-Q4ZOGTP2-bhV7c3dK.js → hi-IN-Q4ZOGTP2-B4kd5rva.js} +1 -1
  134. package/dist/client/assets/{hu-HU-P2OXPSN5-xG-gBMzE.js → hu-HU-P2OXPSN5-DL2sEPhQ.js} +1 -1
  135. package/dist/client/assets/{id-ID-2EIKXYN6-MQuYaNHo.js → id-ID-2EIKXYN6-DqXHubyc.js} +1 -1
  136. package/dist/client/assets/image-MLCQRF34-BT938jMR.js +1 -0
  137. package/dist/client/assets/index-AdGl0Mjr.js +2 -0
  138. package/dist/client/assets/index-V7z92VYK.css +1 -0
  139. package/dist/client/assets/info-J43DQDTF-CdrjkAmK.js +1 -0
  140. package/dist/client/assets/{infoDiagram-42DDH7IO-C77Pt7T1.js → infoDiagram-5YYISTIA-DT8NjvZp.js} +1 -1
  141. package/dist/client/assets/input-CXk9Zxz9.js +1 -0
  142. package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-Cy1fwvvg.js → ishikawaDiagram-YF4QCWOH-axeWdm72.js} +2 -2
  143. package/dist/client/assets/{it-IT-4CFKVXI2-v2kj-y7j.js → it-IT-4CFKVXI2-CyToZF8R.js} +1 -1
  144. package/dist/client/assets/{ja-JP-MAND2Z4V-BahXSQz-.js → ja-JP-MAND2Z4V-CdMMUzyq.js} +1 -1
  145. package/dist/client/assets/{javascript-gTK9fxz6.js → javascript-B9TABJff.js} +1 -1
  146. package/dist/client/assets/javascript-BRzqD9BA.js +1 -0
  147. package/dist/client/assets/{journeyDiagram-VCZTEJTY-CYWaI6re.js → journeyDiagram-JHISSGLW-_K7qmGID.js} +3 -3
  148. package/dist/client/assets/{jsx-runtime-1KUJVfx8.js → jsx-runtime-DqMcooe2.js} +1 -1
  149. package/dist/client/assets/{kaa-HQRTCXTJ-BF26ydFa.js → kaa-HQRTCXTJ-D6kVHP9w.js} +1 -1
  150. package/dist/client/assets/{kab-KAB-JKIKKTGH-CEIH0F80.js → kab-KAB-JKIKKTGH-XYCYTUmV.js} +1 -1
  151. package/dist/client/assets/{kanban-definition-6JOO6SKY-DY1xE7tm.js → kanban-definition-UN3LZRKU-DaPREf-3.js} +6 -6
  152. package/dist/client/assets/keyboard-shortcuts-Ctp9_GHy.js +1 -0
  153. package/dist/client/assets/{kk-KZ-HXQ63ZFC-CxWjc9Sf.js → kk-KZ-HXQ63ZFC-Du2sGLmI.js} +1 -1
  154. package/dist/client/assets/{km-KH-PKL3LSGX-DJlCteEp.js → km-KH-PKL3LSGX-B2OnEat4.js} +1 -1
  155. package/dist/client/assets/{ko-KR-KXLREZX3-B1gtI_ci.js → ko-KR-KXLREZX3-CcxALsEE.js} +1 -1
  156. package/dist/client/assets/{ku-TR-MJ4IER3X-Bf41y2v2.js → ku-TR-MJ4IER3X-HDyr9f4z.js} +1 -1
  157. package/dist/client/assets/line-CbpIuf9e.js +1 -0
  158. package/dist/client/assets/{linear-dsIQT_iU.js → linear-BGe2G4b5.js} +1 -1
  159. package/dist/client/assets/{lt-LT-H6WFQ6FJ-DA1or-Eo.js → lt-LT-H6WFQ6FJ-BzZe8pg9.js} +1 -1
  160. package/dist/client/assets/{lv-LV-GOCK6SJW-qa0BoYMm.js → lv-LV-GOCK6SJW-CMspwH0q.js} +1 -1
  161. package/dist/client/assets/main-C8f6FlSO.js +789 -0
  162. package/dist/client/assets/mermaid-parser.core-C4gZtCl9.js +4 -0
  163. package/dist/client/assets/mermaid-runtime-CX_vmg3J.js +9 -0
  164. package/dist/client/assets/{mindmap-definition-QFDTVHPH-DB_M5r-j.js → mindmap-definition-RKZ34NQL-DB1uitpo.js} +23 -23
  165. package/dist/client/assets/{mr-IN-IXVLDMEQ-DXFRgvgb.js → mr-IN-IXVLDMEQ-C6mqoMmX.js} +1 -1
  166. package/dist/client/assets/{my-MM-YG6MYTTD-BKDIfalJ.js → my-MM-YG6MYTTD-Q33bVx2B.js} +1 -1
  167. package/dist/client/assets/navigation-D173qvIt.css +1 -0
  168. package/dist/client/assets/{nb-NO-XGWJISD2-DbwbopH8.js → nb-NO-XGWJISD2-B1jdnBFb.js} +1 -1
  169. package/dist/client/assets/{nl-NL-XVDVCPNC-ChSneTSU.js → nl-NL-XVDVCPNC-DoQkA2lu.js} +1 -1
  170. package/dist/client/assets/{nn-NO-EMX5MJX5-Cf7ZWKWZ.js → nn-NO-EMX5MJX5-Db3tHf5b.js} +1 -1
  171. package/dist/client/assets/{nsis-QPGhLAeY.js → nsis-AQ_alPln.js} +1 -1
  172. package/dist/client/assets/{oc-FR-ROEINTVO-lM7Nl7hD.js → oc-FR-ROEINTVO-DLu-4Ze0.js} +1 -1
  173. package/dist/client/assets/{ordinal-Dz3y_j0K.js → ordinal-hYBb2elL.js} +1 -1
  174. package/dist/client/assets/{pa-IN-ZYN6SUDY-C9WNUTeR.js → pa-IN-ZYN6SUDY-XvJuMxJR.js} +1 -1
  175. package/dist/client/assets/packet-YPE3B663-r4oAflYS.js +1 -0
  176. package/dist/client/assets/percentages-5DKR754L-D_KAYeu8.js +1 -0
  177. package/dist/client/assets/{pica-CgGaIJly.js → pica-DjQMjoX_.js} +1 -1
  178. package/dist/client/assets/pie-LRSECV5Y-DkaVktH1.js +1 -0
  179. package/dist/client/assets/pieDiagram-4H26LBE5-CdDwk3iQ.js +30 -0
  180. package/dist/client/assets/{pl-PL-6VTG7PHC-DqRVepnC.js → pl-PL-6VTG7PHC-DjJq8QfA.js} +1 -1
  181. package/dist/client/assets/preview-diagram-utils-DnqteI9Q.js +1 -0
  182. package/dist/client/assets/preview-render-compiler-Dts88fM3.js +35 -0
  183. package/dist/client/assets/preview-render-compiler-VKNqrOZN.js +1 -0
  184. package/dist/client/assets/preview-render-profile-CU6rvKx3.js +23 -0
  185. package/dist/client/assets/preview-render-worker-CFKBP7xz.js +59 -0
  186. package/dist/client/assets/{pt-BR-5YFKRR5G-CopLYEA6.js → pt-BR-5YFKRR5G-Dg2lIz1V.js} +1 -1
  187. package/dist/client/assets/{pt-PT-GEIXXZ67-BjZ_Lphg.js → pt-PT-GEIXXZ67-COIg15TS.js} +1 -1
  188. package/dist/client/assets/{pug-lkTEco3G.js → pug-Ck0YjsGM.js} +1 -1
  189. package/dist/client/assets/quadrantDiagram-W4KKPZXB-C6n3eYzo.js +7 -0
  190. package/dist/client/assets/quick-switcher-controller-CVRUPEKp.js +12 -0
  191. package/dist/client/assets/radar-GUYGQ44K-Bjhhjq-k.js +1 -0
  192. package/dist/client/assets/{requirementDiagram-MS252O5E-CtUIQnWa.js → requirementDiagram-4Y6WPE33-B-sVI-jx.js} +4 -4
  193. package/dist/client/assets/{ro-RO-E2P6TFZI-DakDz5Xu.js → ro-RO-E2P6TFZI-CdCIa8N3.js} +1 -1
  194. package/dist/client/assets/{room-z2w9b96b.js → room-CpCcgtG8.js} +1 -1
  195. package/dist/client/assets/{ru-RU-YBIIY43T-BMvCT-XT.js → ru-RU-YBIIY43T-C5TT1jTX.js} +1 -1
  196. package/dist/client/assets/runtime-config-CDgeuPWN.js +1 -0
  197. package/dist/client/assets/runtime-paths-DvpihCEq.js +1 -0
  198. package/dist/client/assets/{sankeyDiagram-XADWPNL6-tcSeuifE.js → sankeyDiagram-5OEKKPKP-EY2cdbUV.js} +36 -6
  199. package/dist/client/assets/segmented-control-DhUkW6ro.js +1 -0
  200. package/dist/client/assets/sequenceDiagram-3UESZ5HK-D6h6knAb.js +162 -0
  201. package/dist/client/assets/{si-LK-673C2CI2-hGdH1S9E.js → si-LK-673C2CI2-f_5ZzunQ.js} +1 -1
  202. package/dist/client/assets/{sk-SK-CKZHQ4AP-DiRA-fj8.js → sk-SK-CKZHQ4AP-4jimlXp1.js} +1 -1
  203. package/dist/client/assets/{sl-SI-557H2GWM-DN94n_1-.js → sl-SI-557H2GWM-BnZ04ZfX.js} +1 -1
  204. package/dist/client/assets/{src-BuiVcSz-.js → src-DSz_pbBa.js} +1 -1
  205. package/dist/client/assets/stateDiagram-AJRCARHV-Ca8ZuIR2.js +1 -0
  206. package/dist/client/assets/stateDiagram-v2-BHNVJYJU-DGRDwQhE.js +1 -0
  207. package/dist/client/assets/subset-shared.chunk-DcaFK0zo.js +1 -0
  208. package/dist/client/assets/{subset-worker.chunk-kj1e3wjW.js → subset-worker.chunk-CVu8sQYq.js} +1 -1
  209. package/dist/client/assets/{sv-SE-XOPKKDWS-CkHUNABj.js → sv-SE-XOPKKDWS-B2uKmd06.js} +1 -1
  210. package/dist/client/assets/{ta-IN-XBH7DQI3-W-157oVK.js → ta-IN-XBH7DQI3-Bld4KtCz.js} +1 -1
  211. package/dist/client/assets/{th-TH-TOCWH3R4-BsU-Pydr.js → th-TH-TOCWH3R4-DUlvnJTX.js} +1 -1
  212. package/dist/client/assets/{timeline-definition-GMOUNBTQ-Bs6U53Mo.js → timeline-definition-PNZ67QCA-BAhvj49M.js} +5 -5
  213. package/dist/client/assets/{tr-TR-GXW6CYY5-CTddyq89.js → tr-TR-GXW6CYY5-BXTTqJlZ.js} +1 -1
  214. package/dist/client/assets/treeView-BLDUP644-DbX5QpdZ.js +1 -0
  215. package/dist/client/assets/treemap-LRROVOQU-DT4YRX1p.js +1 -0
  216. package/dist/client/assets/turtle-Cx3rYX2g.js +1 -0
  217. package/dist/client/assets/{uk-UA-IJKTNUDG-1LzXkII3.js → uk-UA-IJKTNUDG-DbQpa2ug.js} +1 -1
  218. package/dist/client/assets/{uz-UZ-TBZZEA4V-kqm-qcUj.js → uz-UZ-TBZZEA4V-Dt35hEMk.js} +1 -1
  219. package/dist/client/assets/vault-api-client-BPVNCJZC.js +1 -0
  220. package/dist/client/assets/vault-api-client-VAfZ8okg.js +1 -0
  221. package/dist/client/assets/{vault-utils-CRpy8MQz.js → vault-utils-kIbqyWPm.js} +1 -1
  222. package/dist/client/assets/vennDiagram-CIIHVFJN-GGrxyoPK.js +34 -0
  223. package/dist/client/assets/{vi-VN-MULSGNVB-C3H2AUhm.js → vi-VN-MULSGNVB-BgxNIE1N.js} +1 -1
  224. package/dist/client/assets/wardley-L42UT6IY-Ba5lVG9E.js +1 -0
  225. package/dist/client/assets/{wardleyDiagram-NUSXRM2D-C-scJfPY.js → wardleyDiagram-YWT4CUSO-BgYuJM9o.js} +61 -3
  226. package/dist/client/assets/{xychartDiagram-5P7HB3ND-D3nQoxhz.js → xychartDiagram-2RQKCTM6-DKA6F9sv.js} +3 -3
  227. package/dist/client/assets/{yjs-provider-reset-guard-DSPzcvAO.js → yjs-provider-reset-guard-BicD2Ate.js} +1 -1
  228. package/dist/client/assets/{zh-CN-MVX3E32U-BULPbsyl.js → zh-CN-MVX3E32U-W0nclq-N.js} +1 -1
  229. package/dist/client/assets/{zh-HK-JNU5RLIE-bNGmeSaW.js → zh-HK-JNU5RLIE-C2VRLD9Z.js} +1 -1
  230. package/dist/client/assets/{zh-TW-LENVCA6T-CQDp064P.js → zh-TW-LENVCA6T-Ci7udZjZ.js} +1 -1
  231. package/dist/client/drawio-editor.html +3 -3
  232. package/dist/client/excalidraw-editor.html +3 -3
  233. package/dist/client/export-document.html +4 -4
  234. package/dist/client/index.html +5 -5
  235. package/package.json +21 -21
  236. package/src/client/application/app-shell/comments-feature.js +108 -0
  237. package/src/client/application/app-shell/git-feature.js +6 -1
  238. package/src/client/application/app-shell/ui-feature-shell.js +7 -4
  239. package/src/client/application/app-shell/ui-feature-sidebar.js +11 -2
  240. package/src/client/application/app-shell-elements.js +2 -0
  241. package/src/client/application/diagram-chrome.js +708 -0
  242. package/src/client/application/mermaid-preview-hydrator.js +44 -524
  243. package/src/client/application/plantuml-preview-hydrator.js +22 -518
  244. package/src/client/application/preview-renderer.js +21 -5
  245. package/src/client/application/quick-switcher-loader.js +14 -0
  246. package/src/client/application/workspace-route-controller.js +25 -1
  247. package/src/client/bootstrap/app-shell-feature-surface.js +67 -0
  248. package/src/client/bootstrap/collabmd-app-shell.js +111 -356
  249. package/src/client/bootstrap/lazy-controller-feature.js +434 -0
  250. package/src/client/domain/drawio-frame-load.js +28 -0
  251. package/src/client/domain/hash-routes.js +16 -1
  252. package/src/client/domain/runtime-paths.js +7 -0
  253. package/src/client/drawio-editor.js +23 -10
  254. package/src/client/excalidraw-editor.js +66 -13
  255. package/src/client/infrastructure/editor-session.js +4 -0
  256. package/src/client/infrastructure/editor-view-adapter.js +30 -0
  257. package/src/client/infrastructure/runtime-config.js +17 -2
  258. package/src/client/infrastructure/vault-api-client.js +16 -0
  259. package/src/client/presentation/app-shell-template.js +29 -12
  260. package/src/client/presentation/bases-preview-controller.js +33 -16
  261. package/src/client/presentation/comment-overview-controller.js +238 -0
  262. package/src/client/presentation/comment-ui/comment-ui-state.js +23 -0
  263. package/src/client/presentation/drawio-embed-controller.js +230 -64
  264. package/src/client/presentation/excalidraw-embed-controller.js +51 -60
  265. package/src/client/presentation/file-explorer-controller.js +9 -0
  266. package/src/client/presentation/file-explorer-view.js +11 -1
  267. package/src/client/presentation/quick-switcher-controller.js +217 -21
  268. package/src/client/presentation/quick-switcher-text-search.js +125 -0
  269. package/src/client/styles/components/navigation.css +43 -8
  270. package/src/client/styles/components/scrollbars.css +5 -0
  271. package/src/client/styles/features/comment-overview.css +196 -0
  272. package/src/client/styles/features/comments.css +1 -0
  273. package/src/client/styles/features/diagram-preview.css +43 -23
  274. package/src/client/styles/features/quick-switcher.css +153 -15
  275. package/src/client/styles/layout/responsive.css +3 -2
  276. package/src/client/styles/layout/shell.css +6 -3
  277. package/src/client/styles/surfaces/excalidraw-editor.css +4 -0
  278. package/src/server/application/workspace-reconciliation.js +446 -0
  279. package/src/server/config/env.js +74 -0
  280. package/src/server/create-app-server.js +68 -38
  281. package/src/server/domain/bases/base-expression-runtime.js +183 -147
  282. package/src/server/domain/bases/base-index-snapshot-store.js +53 -2
  283. package/src/server/domain/bases/base-query-service.js +55 -38
  284. package/src/server/domain/collaboration/collaboration-document-store.js +6 -2
  285. package/src/server/domain/collaboration/collaboration-room.js +66 -2
  286. package/src/server/domain/comment-overview.js +108 -0
  287. package/src/server/domain/hosted-workspace-contract.js +18 -0
  288. package/src/server/domain/hosted-workspace.js +744 -0
  289. package/src/server/domain/ripgrep-search-service.js +365 -0
  290. package/src/server/domain/workspace-state.js +848 -2
  291. package/src/server/infrastructure/github/github-app-client.js +205 -0
  292. package/src/server/infrastructure/github/github-setup-flow.js +86 -0
  293. package/src/server/infrastructure/http/create-git-api-command-handler.js +1 -1
  294. package/src/server/infrastructure/http/create-hosted-api-handler.js +200 -0
  295. package/src/server/infrastructure/http/create-request-handler.js +23 -1
  296. package/src/server/infrastructure/http/create-static-handler.js +14 -1
  297. package/src/server/infrastructure/http/create-vault-api-command-handler.js +44 -119
  298. package/src/server/infrastructure/http/create-vault-api-handler.js +2 -0
  299. package/src/server/infrastructure/http/create-vault-api-query-handler.js +56 -35
  300. package/src/server/infrastructure/http/request-body.js +12 -2
  301. package/src/server/infrastructure/persistence/hosted-metadata-store.js +500 -0
  302. package/src/server/infrastructure/persistence/sidecar-store.js +53 -2
  303. package/src/server/infrastructure/persistence/vault-content-adapter.js +8 -8
  304. package/src/server/infrastructure/persistence/vault-file-store.js +64 -135
  305. package/src/server/infrastructure/websocket/attach-collaboration-gateway.js +49 -5
  306. package/src/server/infrastructure/workspace/file-system-sync-service.js +28 -411
  307. package/src/server/infrastructure/workspace/workspace-mutation-coordinator.js +13 -621
  308. package/src/server/infrastructure/workspace/workspace-state-file-system-adapter.js +37 -0
  309. package/dist/client/assets/_baseFor-BSErPbF2.js +0 -1
  310. package/dist/client/assets/architecture-YZFGNWBL-DWWrde02.js +0 -1
  311. package/dist/client/assets/blockDiagram-DXYQGD6D-6UN-nR8-.js +0 -132
  312. package/dist/client/assets/channel-XGCkuPi6.js +0 -1
  313. package/dist/client/assets/chunk-2KRD3SAO-CFcF2aNP.js +0 -1
  314. package/dist/client/assets/chunk-336JU56O-DvrrHsJT.js +0 -2
  315. package/dist/client/assets/chunk-426QAEUC-CEbmCgux.js +0 -1
  316. package/dist/client/assets/chunk-4TB4RGXK-CoouNThi.js +0 -206
  317. package/dist/client/assets/chunk-5FUZZQ4R-CxIIxXPy.js +0 -62
  318. package/dist/client/assets/chunk-5PVQY5BW-ciE7eHID.js +0 -2
  319. package/dist/client/assets/chunk-67CJDMHE-CW-fbgQB.js +0 -1
  320. package/dist/client/assets/chunk-7N4EOEYR-DbAW6XnF.js +0 -1
  321. package/dist/client/assets/chunk-AA7GKIK3-ClDHDAza.js +0 -1
  322. package/dist/client/assets/chunk-CIAEETIT-BnB8a6HR.js +0 -1
  323. package/dist/client/assets/chunk-ENJZ2VHE-BQj_1YA_.js +0 -10
  324. package/dist/client/assets/chunk-FOC6F5B3-Bw6XfKDP.js +0 -1
  325. package/dist/client/assets/chunk-ICPOFSXX-DqJi89rc.js +0 -122
  326. package/dist/client/assets/chunk-K5T4RW27-CQtjKF2g.js +0 -94
  327. package/dist/client/assets/chunk-KGLVRYIC-BWSPiKjp.js +0 -1
  328. package/dist/client/assets/chunk-ORNJ4GCN-Csga44e5.js +0 -1
  329. package/dist/client/assets/chunk-OYMX7WX6-DvtmCasj.js +0 -231
  330. package/dist/client/assets/chunk-QZHKN3VN-CHVH9_3S.js +0 -1
  331. package/dist/client/assets/chunk-YHkbxXgt.js +0 -1
  332. package/dist/client/assets/chunk-YKPWT25G-GISHuloq.js +0 -35
  333. package/dist/client/assets/classDiagram-6PBFFD2Q-D1KhAUL3.js +0 -1
  334. package/dist/client/assets/classDiagram-v2-HSJHXN6E-BSyyJpnR.js +0 -1
  335. package/dist/client/assets/clone-DI0bYZ1L.js +0 -1
  336. package/dist/client/assets/dagre-Dn6rkrte.js +0 -1
  337. package/dist/client/assets/dagre-KV5264BT-COzej2en.js +0 -4
  338. package/dist/client/assets/diagram-G4DWMVQ6-CbswIU9X.js +0 -24
  339. package/dist/client/assets/diagram-MMDJMWI5-BE-yOVGX.js +0 -43
  340. package/dist/client/assets/dist-BCzW2jDH.js +0 -1
  341. package/dist/client/assets/dist-BEk5kTf_.js +0 -1
  342. package/dist/client/assets/dist-BOn786F3.js +0 -1
  343. package/dist/client/assets/dist-BwUX6zpo.js +0 -1
  344. package/dist/client/assets/dist-D-ixVAsS2.js +0 -1
  345. package/dist/client/assets/dist-DwgKARew.js +0 -2
  346. package/dist/client/assets/dist-GgGgSSbl.js +0 -1
  347. package/dist/client/assets/dist-ZuMKSK7c.js +0 -9
  348. package/dist/client/assets/dist-tRNsnttY.js +0 -1
  349. package/dist/client/assets/drawio-editor-B_Sr8Z_Z.js +0 -9
  350. package/dist/client/assets/drawioEditor-DBSyP3_d.js +0 -2
  351. package/dist/client/assets/editor-session-C1scHGLl.js +0 -16
  352. package/dist/client/assets/excalidraw-editor-B0XXVLHd.js +0 -9
  353. package/dist/client/assets/excalidraw-editor-BZCE9ydu.css +0 -1
  354. package/dist/client/assets/excalidraw-scene-wAbVSY1L.js +0 -176
  355. package/dist/client/assets/excalidrawEditor-37sk03H8.js +0 -2
  356. package/dist/client/assets/exportDocument-WQNApAbg.js +0 -2
  357. package/dist/client/assets/flatten-DjXjUsvv.js +0 -1
  358. package/dist/client/assets/ganttDiagram-T4ZO3ILL-B-NMvHWN.js +0 -292
  359. package/dist/client/assets/gitGraph-7Q5UKJZL-DWNinXu4.js +0 -1
  360. package/dist/client/assets/gitGraphDiagram-UUTBAWPF-B95qkCUx.js +0 -106
  361. package/dist/client/assets/graphlib-CAwOVCJc.js +0 -1
  362. package/dist/client/assets/image-J2CAS7OM-DD4DaQTs.js +0 -1
  363. package/dist/client/assets/index-BoKmcqkH.js +0 -2
  364. package/dist/client/assets/index-maPm_Kvk.css +0 -1
  365. package/dist/client/assets/info-OMHHGYJF-DtYG_rX0.js +0 -1
  366. package/dist/client/assets/isEmpty-CpfhGGBo.js +0 -1
  367. package/dist/client/assets/javascript-qUBHINSy.js +0 -1
  368. package/dist/client/assets/line-BCItEgq3.js +0 -1
  369. package/dist/client/assets/main-BKumyd95.js +0 -1410
  370. package/dist/client/assets/mermaid-parser.core-CsTVsPcD.js +0 -4
  371. package/dist/client/assets/mermaid-runtime-BGlnoUXY.js +0 -11
  372. package/dist/client/assets/navigation-Du6CLhvs.css +0 -1
  373. package/dist/client/assets/packet-4T2RLAQJ-CUVefhAv.js +0 -1
  374. package/dist/client/assets/percentages-5DKR754L-DuhOjTM2.js +0 -1
  375. package/dist/client/assets/pie-ZZUOXDRM-BHBJ1dLX.js +0 -1
  376. package/dist/client/assets/pieDiagram-DEJITSTG-BOo-WzjZ.js +0 -30
  377. package/dist/client/assets/preview-diagram-utils-Nqpp4FNV.js +0 -1
  378. package/dist/client/assets/preview-render-compiler-9SmLUP5V.js +0 -1
  379. package/dist/client/assets/preview-render-compiler-IUtgIlOM.js +0 -35
  380. package/dist/client/assets/preview-render-profile-Bf6R7v4w.js +0 -23
  381. package/dist/client/assets/preview-render-worker-BwQ5sPy9.js +0 -59
  382. package/dist/client/assets/quadrantDiagram-34T5L4WZ-2vfo0l5S.js +0 -7
  383. package/dist/client/assets/quick-switcher-controller-B1erSgJ1.js +0 -5
  384. package/dist/client/assets/radar-PYXPWWZC-2jR4qZNU.js +0 -1
  385. package/dist/client/assets/reduce-ChpYjEUB.js +0 -1
  386. package/dist/client/assets/runtime-config-BcUbZKho.js +0 -1
  387. package/dist/client/assets/sequenceDiagram-FGHM5R23-DtF-1Kt2.js +0 -157
  388. package/dist/client/assets/stateDiagram-FHFEXIEX-DKk7Sb0f.js +0 -1
  389. package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DJUaiADr.js +0 -1
  390. package/dist/client/assets/subset-shared.chunk-CWNYNLru.js +0 -1
  391. package/dist/client/assets/treeView-SZITEDCU-DN5dP2ol.js +0 -1
  392. package/dist/client/assets/treemap-W4RFUUIX-Dva7DBJR.js +0 -1
  393. package/dist/client/assets/turtle-BkP3ExOG.js +0 -1
  394. package/dist/client/assets/vault-api-client-BDKKvtOF.js +0 -1
  395. package/dist/client/assets/vennDiagram-DHZGUBPP-DNnIjRae.js +0 -34
  396. package/dist/client/assets/wardley-RL74JXVD-CDZW5uzY.js +0 -1
  397. /package/dist/client/assets/{apl-C1JYSI8J.js → apl-CnwPGSsG.js} +0 -0
  398. /package/dist/client/assets/{array-B3agRrCs.js → array-BifhSqXX.js} +0 -0
  399. /package/dist/client/assets/{asciiarmor-DHW75j1s.js → asciiarmor-qTkVPQu6.js} +0 -0
  400. /package/dist/client/assets/{asn1-CQiG40kG.js → asn1-Dr8qZg38.js} +0 -0
  401. /package/dist/client/assets/{asterisk-BWExh0n4.js → asterisk-Bja0s6e1.js} +0 -0
  402. /package/dist/client/assets/{base-h1uscjTi.js → base-CxPEiHuy.js} +0 -0
  403. /package/dist/client/assets/{brainfuck-CTNFyOLg.js → brainfuck-D5EjA2JK.js} +0 -0
  404. /package/dist/client/assets/{chunk-3PELD44J-DymL2rGq.js → chunk-3PELD44J-C625MXe_.js} +0 -0
  405. /package/dist/client/assets/{chunk-A66AFZZU-BFHL744F.js → chunk-A66AFZZU-BbU3ThId.js} +0 -0
  406. /package/dist/client/assets/{chunk-LOOWOR4L-C5BUwXgZ.js → chunk-LOOWOR4L-CGCAV5nC.js} +0 -0
  407. /package/dist/client/assets/{clike-BFTLRaGS.js → clike-DHH8Ad3s.js} +0 -0
  408. /package/dist/client/assets/{clojure-D-DYVqu7.js → clojure-BflJGmDX.js} +0 -0
  409. /package/dist/client/assets/{cmake-DtGL-Unu.js → cmake-CyVbuzPu.js} +0 -0
  410. /package/dist/client/assets/{cobol-DP4QggbL.js → cobol-B_OZ4V-R.js} +0 -0
  411. /package/dist/client/assets/{coffeescript-B7GZajzV.js → coffeescript-B2pKbFk8.js} +0 -0
  412. /package/dist/client/assets/{commonlisp-COlJYiQT.js → commonlisp-CcllspGY.js} +0 -0
  413. /package/dist/client/assets/{crystal-I_dE9xG-.js → crystal-M5-qzICs.js} +0 -0
  414. /package/dist/client/assets/{css-CmhPNxBE.js → css-CYpP4FRV.js} +0 -0
  415. /package/dist/client/assets/{cypher-DEGl2llJ.js → cypher-p9eYesGn.js} +0 -0
  416. /package/dist/client/assets/{d-BspB0dox.js → d-BhMjBjQP.js} +0 -0
  417. /package/dist/client/assets/{defaultLocale-B_FbTTbl.js → defaultLocale-C8Fc0cco.js} +0 -0
  418. /package/dist/client/assets/{diff-BWuPUsEo.js → diff-ChtP43wD.js} +0 -0
  419. /package/dist/client/assets/{drawio-room-1i6Nn0_Z.js → drawio-room-B3OZRHTH.js} +0 -0
  420. /package/dist/client/assets/{dtd-C6brJFPg.js → dtd-DTF72YNO.js} +0 -0
  421. /package/dist/client/assets/{dylan-Bft86ZSB.js → dylan-C6jEEEk-.js} +0 -0
  422. /package/dist/client/assets/{ebnf-D6ifG44A.js → ebnf-D4c0_ac3.js} +0 -0
  423. /package/dist/client/assets/{ecl-D9rhJ9-u.js → ecl-BSZaIHnp.js} +0 -0
  424. /package/dist/client/assets/{eiffel-DwxtewZF.js → eiffel-BEjRio4Q.js} +0 -0
  425. /package/dist/client/assets/{elm-B1TncobV.js → elm-Cshzl8qu.js} +0 -0
  426. /package/dist/client/assets/{erlang-BDJZNtt8.js → erlang-DaB2Rkuy.js} +0 -0
  427. /package/dist/client/assets/{excalidraw-mermaid-stub-DzxtBcQW.js → excalidraw-mermaid-stub-BNckbX2n.js} +0 -0
  428. /package/dist/client/assets/{fcl-CUXJFJn1.js → fcl-ClOhbFR7.js} +0 -0
  429. /package/dist/client/assets/{file-kind-DmKq2MvD.js → file-kind-BKPOIRPE.js} +0 -0
  430. /package/dist/client/assets/{forth-nvhcMz63.js → forth-Cezjo90N.js} +0 -0
  431. /package/dist/client/assets/{fortran-BZID-z10.js → fortran-Bt6PBEDR.js} +0 -0
  432. /package/dist/client/assets/{gas-DjQsZDGE.js → gas-BHEdbvp9.js} +0 -0
  433. /package/dist/client/assets/{gherkin-S0kHlzux.js → gherkin-oBAE_ms0.js} +0 -0
  434. /package/dist/client/assets/{groovy-Di--Vb9Z.js → groovy-BC3IOsC8.js} +0 -0
  435. /package/dist/client/assets/{haskell-C6qH3-aI.js → haskell-BRsoo5mP.js} +0 -0
  436. /package/dist/client/assets/{http-DG1Y9fpK.js → http-CLVgA2GD.js} +0 -0
  437. /package/dist/client/assets/{idl-B64p3NTJ.js → idl-BUZw3wgd.js} +0 -0
  438. /package/dist/client/assets/{image-blob-reduce.esm-D8JQdTFk.js → image-blob-reduce.esm-NzmDxm1v.js} +0 -0
  439. /package/dist/client/assets/{init-DtLQcSuO.js → init-D6jRqBbL.js} +0 -0
  440. /package/dist/client/assets/{julia-B22G9Bym.js → julia-CQfgDRfP.js} +0 -0
  441. /package/dist/client/assets/{katex-CXYULLWy.js → katex-C7GtLiLd.js} +0 -0
  442. /package/dist/client/assets/{vault-api-client-D7Ck0CvR.css → keyboard-shortcuts-D7Ck0CvR.css} +0 -0
  443. /package/dist/client/assets/{livescript-CkcuHqeS.js → livescript-BXxG0Yva.js} +0 -0
  444. /package/dist/client/assets/{lua-Cg0FqIlO.js → lua-CL1SqxuB.js} +0 -0
  445. /package/dist/client/assets/{mathematica-CKVhKnoY.js → mathematica-u8YMmbU0.js} +0 -0
  446. /package/dist/client/assets/{mbox-DANyzFJ2.js → mbox-BEMVcqjs.js} +0 -0
  447. /package/dist/client/assets/{mirc-BVG2S5rO.js → mirc-C9zpzAZU.js} +0 -0
  448. /package/dist/client/assets/{mllike-C0p7lv48.js → mllike-B45xgp2S.js} +0 -0
  449. /package/dist/client/assets/{modelica-vJ-Qa9jV.js → modelica-CqHI_q-D.js} +0 -0
  450. /package/dist/client/assets/{mscgen-vUD-SWGJ.js → mscgen-qgSLujhx.js} +0 -0
  451. /package/dist/client/assets/{mumps-D0KfUTSd.js → mumps-CW_TBmxz.js} +0 -0
  452. /package/dist/client/assets/{nginx-DkVceJrH.js → nginx-BMaDbqW3.js} +0 -0
  453. /package/dist/client/assets/{ntriples-BBuCIfS0.js → ntriples-d28e9m0E.js} +0 -0
  454. /package/dist/client/assets/{octave-BTv2CqSQ.js → octave-D2Q8cUp1.js} +0 -0
  455. /package/dist/client/assets/{oz-D8SjVDNU.js → oz-BwTct_5T.js} +0 -0
  456. /package/dist/client/assets/{pascal-T-tfhVyx.js → pascal-Dp_KdFgX.js} +0 -0
  457. /package/dist/client/assets/{path-DIlZIGue.js → path-BWPyau1x.js} +0 -0
  458. /package/dist/client/assets/{perl-BDrCkHRd.js → perl-CdEHsPfU.js} +0 -0
  459. /package/dist/client/assets/{pig-BEyI4fPq.js → pig-AF4Hwhju.js} +0 -0
  460. /package/dist/client/assets/{powershell-DtnFc6GG.js → powershell-CzG71I4L.js} +0 -0
  461. /package/dist/client/assets/{preload-helper-Bo9GmnuQ.js → preload-helper-kNaey6uv.js} +0 -0
  462. /package/dist/client/assets/{properties-DWUvbxV9.js → properties-C357ku5U.js} +0 -0
  463. /package/dist/client/assets/{protobuf-CQGoYyfE.js → protobuf-D1ij_kNL.js} +0 -0
  464. /package/dist/client/assets/{puppet-Dd-qWO3p.js → puppet-B4hC2X4m.js} +0 -0
  465. /package/dist/client/assets/{python-BUyhM0Ew.js → python-BqYw9LYJ.js} +0 -0
  466. /package/dist/client/assets/{q-Dls1OX0D.js → q-B9NhS7L_.js} +0 -0
  467. /package/dist/client/assets/{r-DeZ8Mdev.js → r-DADKenSm.js} +0 -0
  468. /package/dist/client/assets/{rough.esm-BU2knLt9.js → rough.esm-CSKSodPl.js} +0 -0
  469. /package/dist/client/assets/{roundRect-BzEouiv_.js → roundRect-D01gJrlt.js} +0 -0
  470. /package/dist/client/assets/{rpm-CjWxLM68.js → rpm-gpDK5sbt.js} +0 -0
  471. /package/dist/client/assets/{ruby-CB34f2Gf.js → ruby-DsYpTuWg.js} +0 -0
  472. /package/dist/client/assets/{runtime-config-loader-_D2KZKn-.js → runtime-config-loader-BUK56BZz.js} +0 -0
  473. /package/dist/client/assets/{sas-Bji4HDQq.js → sas-C2OyD2Y6.js} +0 -0
  474. /package/dist/client/assets/{scheme-C3elI80V.js → scheme-CyDdOh7e.js} +0 -0
  475. /package/dist/client/assets/{shell-DUveK2Hb.js → shell-Du5Qg9im.js} +0 -0
  476. /package/dist/client/assets/{sieve-2ogwMVx4.js → sieve-BAxa3IjF.js} +0 -0
  477. /package/dist/client/assets/{simple-mode-pOKc0mfx.js → simple-mode-DRpGK0lJ.js} +0 -0
  478. /package/dist/client/assets/{smalltalk-BuGhc6lW.js → smalltalk-BLp5-jwC.js} +0 -0
  479. /package/dist/client/assets/{solr-DTxshpm8.js → solr-BBopId9w.js} +0 -0
  480. /package/dist/client/assets/{sparql-vm8qNO8J.js → sparql-Dz-mlCAC.js} +0 -0
  481. /package/dist/client/assets/{spreadsheet-C6Vbtl9-.js → spreadsheet-CTIncYxj.js} +0 -0
  482. /package/dist/client/assets/{sql-GL7dVWcd.js → sql-DcCJ9jop.js} +0 -0
  483. /package/dist/client/assets/{stex-CEwW0Q_0.js → stex-sDrdk2BW.js} +0 -0
  484. /package/dist/client/assets/{stylus-D1SZIMDs.js → stylus-DLLZ8dgm.js} +0 -0
  485. /package/dist/client/assets/{swift-CKcKnWv9.js → swift-DKB6_1j6.js} +0 -0
  486. /package/dist/client/assets/{tcl-SPk7uiDB.js → tcl-BGfruO1u.js} +0 -0
  487. /package/dist/client/assets/{textile-C48beRus.js → textile-DWBqthVk.js} +0 -0
  488. /package/dist/client/assets/{tiddlywiki-CiImjFLN.js → tiddlywiki-VlUiK86J.js} +0 -0
  489. /package/dist/client/assets/{tiki-HkXZ4BIW.js → tiki-CxVlf5KZ.js} +0 -0
  490. /package/dist/client/assets/{toml-BmfpMy1_.js → toml-LvoKBwCs.js} +0 -0
  491. /package/dist/client/assets/{troff-BjbEOT5E.js → troff-C2dAgh7P.js} +0 -0
  492. /package/dist/client/assets/{ttcn-NA-V4KnY.js → ttcn-BePYh-hG.js} +0 -0
  493. /package/dist/client/assets/{ttcn-cfg-TPHncdGN.js → ttcn-cfg-CY0aot7Q.js} +0 -0
  494. /package/dist/client/assets/{vb-C19AQWqO.js → vb-BthdM_4N.js} +0 -0
  495. /package/dist/client/assets/{vbscript-CHJk3s95.js → vbscript-D9f6rSsU.js} +0 -0
  496. /package/dist/client/assets/{velocity-Ya0P4sQU.js → velocity-CqftRsjg.js} +0 -0
  497. /package/dist/client/assets/{verilog-DSARZZPc.js → verilog-D-x6ne0Z.js} +0 -0
  498. /package/dist/client/assets/{vhdl-CnYyYTpa.js → vhdl-CMrOq2q1.js} +0 -0
  499. /package/dist/client/assets/{webidl-DttrYZRT.js → webidl-D5jiJvOU.js} +0 -0
  500. /package/dist/client/assets/{xquery-CEDTd8qs.js → xquery-fj_R-kMw.js} +0 -0
  501. /package/dist/client/assets/{yacas-C7dxlPB0.js → yacas-CXXgtw0p.js} +0 -0
  502. /package/dist/client/assets/{z80-BqEfFSnA.js → z80-CL1naaMV.js} +0 -0
@@ -0,0 +1,744 @@
1
+ import { randomUUID, timingSafeEqual, createHash } from 'node:crypto';
2
+
3
+ import {
4
+ HOSTED_ROLE_ADMIN,
5
+ HOSTED_ROLE_COLLABORATOR,
6
+ normalizeHostedEmail,
7
+ normalizeHostedRole,
8
+ } from './hosted-workspace-contract.js';
9
+
10
+ export {
11
+ HOSTED_ROLE_ADMIN,
12
+ HOSTED_ROLE_COLLABORATOR,
13
+ normalizeHostedEmail,
14
+ normalizeHostedRole,
15
+ } from './hosted-workspace-contract.js';
16
+
17
+ export const HOSTED_INVITATION_TTL_MS = 7 * 24 * 60 * 60 * 1000;
18
+ export const HOSTED_CLAIM_TTL_MS = 7 * 24 * 60 * 60 * 1000;
19
+
20
+ function nowMs() {
21
+ return Date.now();
22
+ }
23
+
24
+ export function hashHostedSecret(value) {
25
+ return createHash('sha256').update(String(value ?? ''), 'utf8').digest('hex');
26
+ }
27
+
28
+ function safeEqualHash(left, right) {
29
+ const leftBuffer = Buffer.from(String(left ?? ''), 'hex');
30
+ const rightBuffer = Buffer.from(String(right ?? ''), 'hex');
31
+ return leftBuffer.length === rightBuffer.length && timingSafeEqual(leftBuffer, rightBuffer);
32
+ }
33
+
34
+ function createHostedError(statusCode, message, code) {
35
+ const error = new Error(message);
36
+ error.statusCode = statusCode;
37
+ error.code = code;
38
+ return error;
39
+ }
40
+
41
+ function createAuditEvent({
42
+ actor,
43
+ metadata = {},
44
+ targetEmail = actor?.email,
45
+ targetRole = actor?.role ?? '',
46
+ timestamp,
47
+ type,
48
+ }) {
49
+ return {
50
+ actorEmail: actor?.email ?? '',
51
+ actorName: actor?.name ?? '',
52
+ createdAt: timestamp,
53
+ id: randomUUID(),
54
+ metadata,
55
+ targetEmail,
56
+ targetRole,
57
+ type,
58
+ };
59
+ }
60
+
61
+ function publicMembership(record = null) {
62
+ if (!record) {
63
+ return null;
64
+ }
65
+
66
+ return {
67
+ email: record.email,
68
+ id: record.id,
69
+ joinedAt: record.joinedAt,
70
+ name: record.name,
71
+ picture: record.picture,
72
+ role: record.role,
73
+ updatedAt: record.updatedAt,
74
+ };
75
+ }
76
+
77
+ function publicInvitation(record = null) {
78
+ if (!record) {
79
+ return null;
80
+ }
81
+
82
+ return {
83
+ createdAt: record.createdAt,
84
+ email: record.email,
85
+ expiresAt: record.expiresAt,
86
+ id: record.id,
87
+ invitedByEmail: record.invitedByEmail,
88
+ invitedByName: record.invitedByName,
89
+ role: record.role,
90
+ updatedAt: record.updatedAt,
91
+ };
92
+ }
93
+
94
+ function publicAuditEvent(record = null) {
95
+ if (!record) {
96
+ return null;
97
+ }
98
+
99
+ return {
100
+ actorEmail: record.actorEmail,
101
+ actorName: record.actorName,
102
+ createdAt: record.createdAt,
103
+ id: record.id,
104
+ metadata: record.metadata,
105
+ targetEmail: record.targetEmail,
106
+ targetRole: record.targetRole,
107
+ type: record.type,
108
+ };
109
+ }
110
+
111
+ function publicVaultSource(record = null) {
112
+ if (!record) {
113
+ return null;
114
+ }
115
+
116
+ return {
117
+ configuredAt: record.configuredAt,
118
+ configuredByEmail: record.configuredByEmail,
119
+ configuredByName: record.configuredByName,
120
+ defaultBranch: record.defaultBranch,
121
+ installationAccountLogin: record.installationAccountLogin,
122
+ provider: record.provider,
123
+ repositoryFullName: record.repositoryFullName,
124
+ repositoryId: record.repositoryId,
125
+ repositoryName: record.repositoryName,
126
+ repositoryOwner: record.repositoryOwner,
127
+ visibility: record.visibility,
128
+ };
129
+ }
130
+
131
+ function resolveUser(user = null) {
132
+ const email = normalizeHostedEmail(user?.email);
133
+ if (!email) {
134
+ return null;
135
+ }
136
+
137
+ return {
138
+ email,
139
+ name: String(user?.name ?? '').trim() || email,
140
+ picture: typeof user?.picture === 'string' ? user.picture : '',
141
+ sub: String(user?.sub ?? '').trim(),
142
+ };
143
+ }
144
+
145
+ function normalizeGithubVisibility(value) {
146
+ const normalized = String(value ?? '').trim().toLowerCase();
147
+ if (normalized === 'public' || normalized === 'private' || normalized === 'internal') {
148
+ return normalized;
149
+ }
150
+ return 'private';
151
+ }
152
+
153
+ function normalizeGithubVaultSource(input = {}, admin, timestamp) {
154
+ const repository = input.repository ?? {};
155
+ const installation = input.installation ?? {};
156
+ const repositoryId = String(repository.id ?? input.repositoryId ?? '').trim();
157
+ const repositoryOwner = String(repository.owner ?? input.repositoryOwner ?? '').trim();
158
+ const repositoryName = String(repository.name ?? input.repositoryName ?? '').trim();
159
+ const defaultBranch = String(repository.defaultBranch ?? input.defaultBranch ?? '').trim();
160
+ const installationId = String(installation.id ?? input.installationId ?? '').trim();
161
+ const installationAccountLogin = String(
162
+ installation.accountLogin
163
+ ?? input.installationAccountLogin
164
+ ?? repositoryOwner,
165
+ ).trim();
166
+ const repositoryFullName = String(
167
+ repository.fullName
168
+ ?? input.repositoryFullName
169
+ ?? (repositoryOwner && repositoryName ? `${repositoryOwner}/${repositoryName}` : ''),
170
+ ).trim();
171
+
172
+ if (!repositoryId || !repositoryOwner || !repositoryName || !repositoryFullName || !defaultBranch) {
173
+ throw createHostedError(400, 'GitHub repository id, owner, name, full name, and default branch are required.', 'HOSTED_GITHUB_REPOSITORY_REQUIRED');
174
+ }
175
+
176
+ if (!installationId || !installationAccountLogin) {
177
+ throw createHostedError(400, 'GitHub App installation id and account login are required.', 'HOSTED_GITHUB_INSTALLATION_REQUIRED');
178
+ }
179
+
180
+ return {
181
+ configuredAt: timestamp,
182
+ configuredByEmail: admin.email,
183
+ configuredByName: admin.name,
184
+ defaultBranch,
185
+ id: 'vault-source',
186
+ installationAccountLogin,
187
+ installationId,
188
+ provider: 'github',
189
+ repositoryFullName,
190
+ repositoryId,
191
+ repositoryName,
192
+ repositoryOwner,
193
+ visibility: normalizeGithubVisibility(repository.visibility ?? input.visibility),
194
+ };
195
+ }
196
+
197
+ export class HostedWorkspaceService {
198
+ constructor({
199
+ claim = null,
200
+ enabled = false,
201
+ store = null,
202
+ } = {}) {
203
+ this.claim = claim;
204
+ this.enabled = Boolean(enabled);
205
+ this.store = store;
206
+ this.accessListeners = new Set();
207
+ this.initialized = false;
208
+ }
209
+
210
+ async initialize() {
211
+ if (!this.enabled || this.initialized) {
212
+ return;
213
+ }
214
+
215
+ if (!this.store) {
216
+ throw new Error('Hosted workspace metadata store is required when hosted mode is enabled.');
217
+ }
218
+
219
+ await this.store.initialize();
220
+ await this.seedClaim();
221
+ this.initialized = true;
222
+ }
223
+
224
+ async close() {
225
+ await this.store?.close?.();
226
+ }
227
+
228
+ onAccessChanged(listener) {
229
+ if (typeof listener !== 'function') {
230
+ return () => {};
231
+ }
232
+
233
+ this.accessListeners.add(listener);
234
+ return () => this.accessListeners.delete(listener);
235
+ }
236
+
237
+ emitAccessChanged(email) {
238
+ const normalizedEmail = normalizeHostedEmail(email);
239
+ for (const listener of this.accessListeners) {
240
+ try {
241
+ listener({ email: normalizedEmail });
242
+ } catch (error) {
243
+ console.error('[hosted] Access-change listener failed:', error.message);
244
+ }
245
+ }
246
+ }
247
+
248
+ async seedClaim() {
249
+ const team = await this.store.getTeam();
250
+ if (team) {
251
+ return;
252
+ }
253
+
254
+ const email = normalizeHostedEmail(this.claim?.email);
255
+ const token = String(this.claim?.token ?? '');
256
+ if (!email || !token) {
257
+ return;
258
+ }
259
+
260
+ const timestamp = nowMs();
261
+ const existingClaim = await this.store.getActiveWorkspaceClaim(timestamp);
262
+ if (existingClaim) {
263
+ return;
264
+ }
265
+
266
+ await this.store.createWorkspaceClaim({
267
+ createdAt: timestamp,
268
+ email,
269
+ expiresAt: timestamp + HOSTED_CLAIM_TTL_MS,
270
+ id: randomUUID(),
271
+ tokenHash: hashHostedSecret(token),
272
+ });
273
+ }
274
+
275
+ async getStatus(user = null) {
276
+ if (!this.enabled) {
277
+ return {
278
+ enabled: false,
279
+ };
280
+ }
281
+
282
+ await this.initialize();
283
+ const team = await this.store.getTeam();
284
+ const resolvedUser = resolveUser(user);
285
+ const membership = resolvedUser
286
+ ? await this.store.getMembershipByEmail(resolvedUser.email)
287
+ : null;
288
+ const activeClaim = team ? null : await this.store.getActiveWorkspaceClaim(nowMs());
289
+ const vaultSource = team ? await this.store.getVaultSource() : null;
290
+
291
+ return {
292
+ activeClaim: Boolean(activeClaim),
293
+ claimed: Boolean(team),
294
+ enabled: true,
295
+ membership: publicMembership(membership),
296
+ setupComplete: Boolean(team?.setupCompletedAt),
297
+ team: team
298
+ ? {
299
+ claimedAt: team.claimedAt,
300
+ id: team.id,
301
+ name: team.name,
302
+ setupCompletedAt: team.setupCompletedAt,
303
+ }
304
+ : null,
305
+ vaultSource: publicVaultSource(vaultSource),
306
+ };
307
+ }
308
+
309
+ async claimWorkspace({ teamName = '', token = '', user = null } = {}) {
310
+ await this.initialize();
311
+ const existingTeam = await this.store.getTeam();
312
+ if (existingTeam) {
313
+ throw createHostedError(409, 'Workspace is already claimed.', 'HOSTED_ALREADY_CLAIMED');
314
+ }
315
+
316
+ const resolvedUser = resolveUser(user);
317
+ if (!resolvedUser) {
318
+ throw createHostedError(401, 'Google sign-in is required to claim this workspace.', 'HOSTED_AUTH_REQUIRED');
319
+ }
320
+
321
+ const activeClaim = await this.store.getActiveWorkspaceClaim(nowMs());
322
+ if (!activeClaim) {
323
+ throw createHostedError(404, 'No active workspace claim is available.', 'HOSTED_CLAIM_NOT_FOUND');
324
+ }
325
+
326
+ if (activeClaim.email !== resolvedUser.email) {
327
+ await this.store.createOperationalSecurityEvent({
328
+ createdAt: nowMs(),
329
+ email: resolvedUser.email,
330
+ id: randomUUID(),
331
+ metadata: { claimEmail: activeClaim.email, reason: 'email_mismatch' },
332
+ type: 'workspace_claim_failed',
333
+ });
334
+ throw createHostedError(403, 'This workspace claim is for a different Google account.', 'HOSTED_CLAIM_EMAIL_MISMATCH');
335
+ }
336
+
337
+ if (!safeEqualHash(activeClaim.tokenHash, hashHostedSecret(token))) {
338
+ await this.store.createOperationalSecurityEvent({
339
+ createdAt: nowMs(),
340
+ email: resolvedUser.email,
341
+ id: randomUUID(),
342
+ metadata: { reason: 'invalid_token' },
343
+ type: 'workspace_claim_failed',
344
+ });
345
+ throw createHostedError(403, 'Invalid workspace claim token.', 'HOSTED_CLAIM_INVALID');
346
+ }
347
+
348
+ const timestamp = nowMs();
349
+ const team = {
350
+ claimedAt: timestamp,
351
+ id: 'team',
352
+ name: String(teamName ?? '').trim() || 'CollabMD Team',
353
+ setupCompletedAt: null,
354
+ };
355
+ const membership = {
356
+ email: resolvedUser.email,
357
+ id: randomUUID(),
358
+ joinedAt: timestamp,
359
+ name: resolvedUser.name,
360
+ picture: resolvedUser.picture,
361
+ role: HOSTED_ROLE_ADMIN,
362
+ updatedAt: timestamp,
363
+ };
364
+
365
+ await this.store.claimWorkspace({
366
+ auditEvent: createAuditEvent({
367
+ actor: resolvedUser,
368
+ targetRole: HOSTED_ROLE_ADMIN,
369
+ timestamp,
370
+ type: 'workspace_claimed',
371
+ }),
372
+ claimId: activeClaim.id,
373
+ membership,
374
+ team,
375
+ });
376
+
377
+ return {
378
+ membership: publicMembership(membership),
379
+ ok: true,
380
+ team,
381
+ };
382
+ }
383
+
384
+ async completeWorkspaceSetup() {
385
+ await this.initialize();
386
+ const team = await this.store.getTeam();
387
+ if (!team) {
388
+ throw createHostedError(409, 'Workspace must be claimed before setup can complete.', 'HOSTED_UNCLAIMED');
389
+ }
390
+
391
+ const timestamp = nowMs();
392
+ const updatedTeam = {
393
+ ...team,
394
+ setupCompletedAt: team.setupCompletedAt || timestamp,
395
+ };
396
+ await this.store.updateTeam(updatedTeam);
397
+ return updatedTeam;
398
+ }
399
+
400
+ async getVaultSource(user) {
401
+ await this.requireAdmin(user);
402
+ return publicVaultSource(await this.store.getVaultSource());
403
+ }
404
+
405
+ async configureGithubVaultSource({ github = {}, user = null } = {}) {
406
+ const admin = await this.requireAdmin(user);
407
+ const team = await this.store.getTeam();
408
+ if (!team) {
409
+ throw createHostedError(409, 'Workspace must be claimed before configuring a vault source.', 'HOSTED_UNCLAIMED');
410
+ }
411
+ if (team.setupCompletedAt || await this.store.getVaultSource()) {
412
+ throw createHostedError(409, 'Vault source is already configured.', 'HOSTED_VAULT_SOURCE_ALREADY_CONFIGURED');
413
+ }
414
+
415
+ const timestamp = nowMs();
416
+ const vaultSource = normalizeGithubVaultSource(github, admin, timestamp);
417
+ const updatedTeam = {
418
+ ...team,
419
+ setupCompletedAt: timestamp,
420
+ };
421
+
422
+ await this.store.configureVaultSource({
423
+ auditEvent: createAuditEvent({
424
+ actor: admin,
425
+ metadata: {
426
+ defaultBranch: vaultSource.defaultBranch,
427
+ provider: vaultSource.provider,
428
+ repositoryFullName: vaultSource.repositoryFullName,
429
+ visibility: vaultSource.visibility,
430
+ },
431
+ timestamp,
432
+ type: 'vault_source_configured',
433
+ }),
434
+ team: updatedTeam,
435
+ vaultSource,
436
+ });
437
+
438
+ return {
439
+ setupComplete: true,
440
+ team: updatedTeam,
441
+ vaultSource: publicVaultSource(vaultSource),
442
+ };
443
+ }
444
+
445
+ async authorizeWorkspaceAccess({ requireSetupComplete = true, user = null } = {}) {
446
+ if (!this.enabled) {
447
+ return { ok: true };
448
+ }
449
+
450
+ await this.initialize();
451
+ const resolvedUser = resolveUser(user);
452
+ if (!resolvedUser) {
453
+ return {
454
+ body: { code: 'HOSTED_AUTH_REQUIRED', error: 'Google sign-in is required.' },
455
+ ok: false,
456
+ statusCode: 401,
457
+ };
458
+ }
459
+
460
+ const membership = await this.store.getMembershipByEmail(resolvedUser.email);
461
+ if (!membership) {
462
+ return {
463
+ body: { code: 'HOSTED_MEMBERSHIP_REQUIRED', error: 'Team membership is required.' },
464
+ ok: false,
465
+ statusCode: 403,
466
+ };
467
+ }
468
+
469
+ const team = await this.store.getTeam();
470
+ if (requireSetupComplete && !team?.setupCompletedAt) {
471
+ return {
472
+ body: { code: 'HOSTED_SETUP_INCOMPLETE', error: 'Workspace setup is incomplete.' },
473
+ ok: false,
474
+ statusCode: 423,
475
+ };
476
+ }
477
+
478
+ return {
479
+ membership,
480
+ ok: true,
481
+ role: membership.role,
482
+ };
483
+ }
484
+
485
+ async requireAdmin(user) {
486
+ const access = await this.authorizeWorkspaceAccess({
487
+ requireSetupComplete: false,
488
+ user,
489
+ });
490
+ if (!access.ok) {
491
+ throw createHostedError(access.statusCode, access.body.error, access.body.code);
492
+ }
493
+ if (access.role !== HOSTED_ROLE_ADMIN) {
494
+ throw createHostedError(403, 'Team Admin role is required.', 'HOSTED_ADMIN_REQUIRED');
495
+ }
496
+ return access.membership;
497
+ }
498
+
499
+ async listMemberships(user) {
500
+ await this.requireAdmin(user);
501
+ return (await this.store.listMemberships()).map(publicMembership);
502
+ }
503
+
504
+ async listInvitations(user) {
505
+ await this.requireAdmin(user);
506
+ return (await this.store.listPendingInvitations(nowMs())).map(publicInvitation);
507
+ }
508
+
509
+ async createInvitation({ email, role, user }) {
510
+ const admin = await this.requireAdmin(user);
511
+ const team = await this.store.getTeam();
512
+ if (!team?.setupCompletedAt) {
513
+ throw createHostedError(409, 'Workspace setup must complete before inviting collaborators.', 'HOSTED_SETUP_INCOMPLETE');
514
+ }
515
+
516
+ const normalizedEmail = normalizeHostedEmail(email);
517
+ const normalizedRole = normalizeHostedRole(role) || HOSTED_ROLE_COLLABORATOR;
518
+ if (!normalizedEmail) {
519
+ throw createHostedError(400, 'Invitation email is required.', 'HOSTED_EMAIL_REQUIRED');
520
+ }
521
+
522
+ if (await this.store.getMembershipByEmail(normalizedEmail)) {
523
+ throw createHostedError(409, 'This email is already a collaborator.', 'HOSTED_ALREADY_MEMBER');
524
+ }
525
+
526
+ const timestamp = nowMs();
527
+ const invitation = {
528
+ acceptedAt: null,
529
+ createdAt: timestamp,
530
+ email: normalizedEmail,
531
+ expiresAt: timestamp + HOSTED_INVITATION_TTL_MS,
532
+ id: randomUUID(),
533
+ invitedByEmail: admin.email,
534
+ invitedByName: admin.name,
535
+ revokedAt: null,
536
+ role: normalizedRole,
537
+ updatedAt: timestamp,
538
+ };
539
+
540
+ await this.store.upsertPendingInvitation(invitation);
541
+ await this.store.createAuditEvent(createAuditEvent({
542
+ actor: admin,
543
+ targetEmail: normalizedEmail,
544
+ targetRole: normalizedRole,
545
+ timestamp,
546
+ type: 'invitation_created',
547
+ }));
548
+
549
+ return publicInvitation(invitation);
550
+ }
551
+
552
+ async updateInvitationRole({ invitationId, role, user }) {
553
+ const admin = await this.requireAdmin(user);
554
+ const normalizedRole = normalizeHostedRole(role);
555
+ if (!normalizedRole) {
556
+ throw createHostedError(400, 'Invalid invitation role.', 'HOSTED_INVALID_ROLE');
557
+ }
558
+
559
+ const invitation = await this.store.getInvitationById(invitationId);
560
+ if (!invitation || invitation.revokedAt || invitation.acceptedAt || invitation.expiresAt <= nowMs()) {
561
+ throw createHostedError(404, 'Pending invitation was not found.', 'HOSTED_INVITATION_NOT_FOUND');
562
+ }
563
+
564
+ const timestamp = nowMs();
565
+ const updated = {
566
+ ...invitation,
567
+ role: normalizedRole,
568
+ updatedAt: timestamp,
569
+ };
570
+ await this.store.updateInvitation(updated);
571
+ await this.store.createAuditEvent(createAuditEvent({
572
+ actor: admin,
573
+ targetEmail: updated.email,
574
+ targetRole: normalizedRole,
575
+ timestamp,
576
+ type: 'invitation_role_changed',
577
+ }));
578
+ return publicInvitation(updated);
579
+ }
580
+
581
+ async revokeInvitation({ invitationId, user }) {
582
+ const admin = await this.requireAdmin(user);
583
+ const invitation = await this.store.getInvitationById(invitationId);
584
+ if (!invitation || invitation.revokedAt || invitation.acceptedAt) {
585
+ throw createHostedError(404, 'Pending invitation was not found.', 'HOSTED_INVITATION_NOT_FOUND');
586
+ }
587
+
588
+ const timestamp = nowMs();
589
+ const updated = {
590
+ ...invitation,
591
+ revokedAt: timestamp,
592
+ updatedAt: timestamp,
593
+ };
594
+ await this.store.updateInvitation(updated);
595
+ await this.store.createAuditEvent(createAuditEvent({
596
+ actor: admin,
597
+ targetEmail: updated.email,
598
+ targetRole: updated.role,
599
+ timestamp,
600
+ type: 'invitation_revoked',
601
+ }));
602
+ return { ok: true };
603
+ }
604
+
605
+ async acceptInvitation(user) {
606
+ await this.initialize();
607
+ const resolvedUser = resolveUser(user);
608
+ if (!resolvedUser) {
609
+ throw createHostedError(401, 'Google sign-in is required to accept an invitation.', 'HOSTED_AUTH_REQUIRED');
610
+ }
611
+
612
+ if (await this.store.getMembershipByEmail(resolvedUser.email)) {
613
+ throw createHostedError(409, 'This email is already a collaborator.', 'HOSTED_ALREADY_MEMBER');
614
+ }
615
+
616
+ const invitation = await this.store.getPendingInvitationByEmail(resolvedUser.email, nowMs());
617
+ if (!invitation) {
618
+ throw createHostedError(404, 'Pending invitation was not found.', 'HOSTED_INVITATION_NOT_FOUND');
619
+ }
620
+
621
+ const timestamp = nowMs();
622
+ const membership = {
623
+ email: resolvedUser.email,
624
+ id: randomUUID(),
625
+ joinedAt: timestamp,
626
+ name: resolvedUser.name,
627
+ picture: resolvedUser.picture,
628
+ role: invitation.role,
629
+ updatedAt: timestamp,
630
+ };
631
+
632
+ await this.store.acceptInvitation({
633
+ auditEvent: createAuditEvent({
634
+ actor: resolvedUser,
635
+ targetRole: invitation.role,
636
+ timestamp,
637
+ type: 'invitation_accepted',
638
+ }),
639
+ invitation: {
640
+ ...invitation,
641
+ acceptedAt: timestamp,
642
+ updatedAt: timestamp,
643
+ },
644
+ membership,
645
+ });
646
+
647
+ return publicMembership(membership);
648
+ }
649
+
650
+ async updateMembershipRole({ membershipId, role, user }) {
651
+ const admin = await this.requireAdmin(user);
652
+ const normalizedRole = normalizeHostedRole(role);
653
+ if (!normalizedRole) {
654
+ throw createHostedError(400, 'Invalid membership role.', 'HOSTED_INVALID_ROLE');
655
+ }
656
+
657
+ const membership = await this.store.getMembershipById(membershipId);
658
+ if (!membership) {
659
+ throw createHostedError(404, 'Membership was not found.', 'HOSTED_MEMBERSHIP_NOT_FOUND');
660
+ }
661
+
662
+ if (membership.role === HOSTED_ROLE_ADMIN && normalizedRole !== HOSTED_ROLE_ADMIN) {
663
+ await this.assertAnotherAdmin(membership.email);
664
+ }
665
+
666
+ const timestamp = nowMs();
667
+ const updated = {
668
+ ...membership,
669
+ role: normalizedRole,
670
+ updatedAt: timestamp,
671
+ };
672
+ await this.store.updateMembership(updated);
673
+ await this.store.createAuditEvent(createAuditEvent({
674
+ actor: admin,
675
+ targetEmail: updated.email,
676
+ targetRole: normalizedRole,
677
+ timestamp,
678
+ type: 'membership_role_changed',
679
+ }));
680
+ this.emitAccessChanged(updated.email);
681
+ return publicMembership(updated);
682
+ }
683
+
684
+ async removeMembership({ membershipId, user }) {
685
+ const admin = await this.requireAdmin(user);
686
+ const membership = await this.store.getMembershipById(membershipId);
687
+ if (!membership) {
688
+ throw createHostedError(404, 'Membership was not found.', 'HOSTED_MEMBERSHIP_NOT_FOUND');
689
+ }
690
+
691
+ if (membership.role === HOSTED_ROLE_ADMIN) {
692
+ await this.assertAnotherAdmin(membership.email);
693
+ }
694
+
695
+ const timestamp = nowMs();
696
+ await this.store.deleteMembership(membership.id);
697
+ await this.store.createAuditEvent(createAuditEvent({
698
+ actor: admin,
699
+ targetEmail: membership.email,
700
+ targetRole: membership.role,
701
+ timestamp,
702
+ type: 'membership_removed',
703
+ }));
704
+ this.emitAccessChanged(membership.email);
705
+ return { ok: true };
706
+ }
707
+
708
+ async leaveTeam(user) {
709
+ const access = await this.authorizeWorkspaceAccess({
710
+ requireSetupComplete: false,
711
+ user,
712
+ });
713
+ if (!access.ok) {
714
+ throw createHostedError(access.statusCode, access.body.error, access.body.code);
715
+ }
716
+
717
+ const membership = access.membership;
718
+ if (membership.role === HOSTED_ROLE_ADMIN) {
719
+ await this.assertAnotherAdmin(membership.email);
720
+ }
721
+
722
+ const timestamp = nowMs();
723
+ await this.store.deleteMembership(membership.id);
724
+ await this.store.createAuditEvent(createAuditEvent({
725
+ actor: membership,
726
+ timestamp,
727
+ type: 'membership_left',
728
+ }));
729
+ this.emitAccessChanged(membership.email);
730
+ return { ok: true };
731
+ }
732
+
733
+ async listAuditEvents(user) {
734
+ await this.requireAdmin(user);
735
+ return (await this.store.listAuditEvents()).map(publicAuditEvent);
736
+ }
737
+
738
+ async assertAnotherAdmin(email) {
739
+ const adminCount = await this.store.countAdminsExcept(normalizeHostedEmail(email));
740
+ if (adminCount < 1) {
741
+ throw createHostedError(409, 'A team must always have at least one Team Admin.', 'HOSTED_LAST_ADMIN');
742
+ }
743
+ }
744
+ }