@dxos/plugin-thread 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc

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 (431) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs +28 -0
  4. package/dist/lib/neutral/ChannelArticle-ACZD7YFT.mjs.map +7 -0
  5. package/dist/lib/neutral/ChannelChat-6YTD5HWL.mjs +10 -0
  6. package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs +208 -0
  7. package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs.map +7 -0
  8. package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs +61 -0
  9. package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs.map +7 -0
  10. package/dist/lib/neutral/ThreadPlugin.mjs +80 -0
  11. package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
  12. package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
  13. package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
  14. package/dist/lib/neutral/ThreadPlugin.workerd.mjs +24 -0
  15. package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
  16. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs +15 -0
  17. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
  18. package/dist/lib/{browser/add-message-LRVGIHDH.mjs → neutral/add-message-FBIROBEZ.mjs} +8 -10
  19. package/dist/lib/neutral/add-message-FBIROBEZ.mjs.map +7 -0
  20. package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs +120 -0
  21. package/dist/lib/neutral/app-graph-builder-7Q6MA6RT.mjs.map +7 -0
  22. package/dist/lib/{browser/append-channel-message-CO3M6FSA.mjs → neutral/append-channel-message-FTFAD3PK.mjs} +5 -5
  23. package/dist/lib/neutral/append-channel-message-FTFAD3PK.mjs.map +7 -0
  24. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs +15 -0
  25. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
  26. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  27. package/dist/lib/neutral/capabilities/index.mjs +25 -0
  28. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  29. package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +4 -5
  30. package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-7GHUS3IX.mjs +20 -0
  32. package/dist/lib/neutral/chunk-7GHUS3IX.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-D5LGFCUY.mjs +55 -0
  34. package/dist/lib/neutral/chunk-D5LGFCUY.mjs.map +7 -0
  35. package/dist/lib/neutral/chunk-JLY4NVTA.mjs +38 -0
  36. package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
  37. package/dist/lib/neutral/chunk-KRXHIW4P.mjs +164 -0
  38. package/dist/lib/neutral/chunk-KRXHIW4P.mjs.map +7 -0
  39. package/dist/lib/{browser/chunk-TPNZ43NB.mjs → neutral/chunk-PE7IH7EL.mjs} +86 -73
  40. package/dist/lib/neutral/chunk-PE7IH7EL.mjs.map +7 -0
  41. package/dist/lib/neutral/chunk-QFDT33VT.mjs +69 -0
  42. package/dist/lib/neutral/chunk-QFDT33VT.mjs.map +7 -0
  43. package/dist/lib/neutral/chunk-QMLVLKE3.mjs +8 -0
  44. package/dist/lib/neutral/chunk-QMLVLKE3.mjs.map +7 -0
  45. package/dist/lib/neutral/components/index.mjs +539 -0
  46. package/dist/lib/neutral/components/index.mjs.map +7 -0
  47. package/dist/lib/neutral/containers/index.mjs +15 -0
  48. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  49. package/dist/lib/{browser/create-BTGLHLBA.mjs → neutral/create-OAQJ6LXN.mjs} +7 -10
  50. package/dist/lib/neutral/create-OAQJ6LXN.mjs.map +7 -0
  51. package/dist/lib/{browser/create-channel-ZXKSLHGN.mjs → neutral/create-channel-3E4FJ662.mjs} +4 -4
  52. package/dist/lib/neutral/create-channel-3E4FJ662.mjs.map +7 -0
  53. package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
  54. package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
  55. package/dist/lib/{browser/create-proposals-AV5CREPV.mjs → neutral/create-proposals-GRYZXRMV.mjs} +4 -4
  56. package/dist/lib/neutral/create-proposals-GRYZXRMV.mjs.map +7 -0
  57. package/dist/lib/{browser/delete-GLYEP7NE.mjs → neutral/delete-HCCG5RVR.mjs} +7 -9
  58. package/dist/lib/neutral/delete-HCCG5RVR.mjs.map +7 -0
  59. package/dist/lib/{browser/delete-message-RQ72ZY5D.mjs → neutral/delete-message-DHFRACB4.mjs} +6 -7
  60. package/dist/lib/neutral/delete-message-DHFRACB4.mjs.map +7 -0
  61. package/dist/lib/neutral/hooks/index.mjs +10 -0
  62. package/dist/lib/neutral/index.mjs +28 -0
  63. package/dist/lib/neutral/index.mjs.map +7 -0
  64. package/dist/lib/neutral/markdown-BUORNCPG.mjs +83 -0
  65. package/dist/lib/neutral/markdown-BUORNCPG.mjs.map +7 -0
  66. package/dist/lib/neutral/meta.json +1 -0
  67. package/dist/lib/neutral/meta.mjs +10 -0
  68. package/dist/lib/neutral/meta.mjs.map +7 -0
  69. package/dist/lib/{browser/on-create-space-SPE3QVFZ.mjs → neutral/on-create-space-OEBRKOAM.mjs} +5 -6
  70. package/dist/lib/neutral/on-create-space-OEBRKOAM.mjs.map +7 -0
  71. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
  72. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
  73. package/dist/lib/neutral/operations/index.mjs +8 -0
  74. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  75. package/dist/lib/neutral/plugin.mjs +16 -0
  76. package/dist/lib/neutral/plugin.mjs.map +7 -0
  77. package/dist/lib/neutral/react-surface-XY23GVZH.mjs +76 -0
  78. package/dist/lib/neutral/react-surface-XY23GVZH.mjs.map +7 -0
  79. package/dist/lib/{browser/restore-VX7FLZOZ.mjs → neutral/restore-P4ZLXLF7.mjs} +5 -5
  80. package/dist/lib/neutral/restore-P4ZLXLF7.mjs.map +7 -0
  81. package/dist/lib/{browser/restore-message-D65NSWUA.mjs → neutral/restore-message-AUBOP2DF.mjs} +5 -5
  82. package/dist/lib/neutral/restore-message-AUBOP2DF.mjs.map +7 -0
  83. package/dist/lib/{browser/select-AT4L7EBU.mjs → neutral/select-LIVAMBCE.mjs} +6 -8
  84. package/dist/lib/neutral/select-LIVAMBCE.mjs.map +7 -0
  85. package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
  86. package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
  87. package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
  88. package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
  89. package/dist/lib/neutral/testing/index.mjs +58 -0
  90. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  91. package/dist/lib/{browser/toggle-resolved-JD3D4WBZ.mjs → neutral/toggle-resolved-RQBDQZSV.mjs} +5 -5
  92. package/dist/lib/neutral/toggle-resolved-RQBDQZSV.mjs.map +7 -0
  93. package/dist/lib/{browser → neutral}/translations.mjs +2 -2
  94. package/dist/lib/neutral/translations.mjs.map +7 -0
  95. package/dist/lib/neutral/types/index.mjs +12 -0
  96. package/dist/lib/neutral/types/index.mjs.map +7 -0
  97. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
  98. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
  99. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  100. package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -1
  101. package/dist/types/src/ThreadPlugin.workerd.d.ts +4 -0
  102. package/dist/types/src/ThreadPlugin.workerd.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  104. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/index.d.ts +7 -6
  106. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/markdown.d.ts +1 -1
  108. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  109. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  110. package/dist/types/src/components/Chat/Chat.d.ts +8 -1
  111. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  112. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
  113. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
  114. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
  115. package/dist/types/src/components/index.d.ts +0 -1
  116. package/dist/types/src/components/index.d.ts.map +1 -1
  117. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +13 -0
  118. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
  119. package/dist/types/src/containers/{ChannelContainer/ChannelContainer.stories.d.ts → ChannelArticle/ChannelArticle.stories.d.ts} +4 -4
  120. package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
  121. package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
  122. package/dist/types/src/containers/{CallDebugPanel → ChannelArticle}/index.d.ts.map +1 -1
  123. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +4 -0
  124. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -1
  125. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
  126. package/dist/types/src/containers/index.d.ts +1 -3
  127. package/dist/types/src/containers/index.d.ts.map +1 -1
  128. package/dist/types/src/extensions/threads.d.ts +1 -1
  129. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  130. package/dist/types/src/hooks/index.d.ts +0 -4
  131. package/dist/types/src/hooks/index.d.ts.map +1 -1
  132. package/dist/types/src/index.d.ts +3 -5
  133. package/dist/types/src/index.d.ts.map +1 -1
  134. package/dist/types/src/meta.d.ts.map +1 -1
  135. package/dist/types/src/operations/add-message.d.ts +2 -2
  136. package/dist/types/src/operations/add-message.d.ts.map +1 -1
  137. package/dist/types/src/operations/append-channel-message.d.ts +2 -2
  138. package/dist/types/src/operations/append-channel-message.d.ts.map +1 -1
  139. package/dist/types/src/operations/create-channel.d.ts +2 -2
  140. package/dist/types/src/operations/create-channel.d.ts.map +1 -1
  141. package/dist/types/src/operations/create-proposals.d.ts +2 -2
  142. package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
  143. package/dist/types/src/operations/create.d.ts +2 -2
  144. package/dist/types/src/operations/create.d.ts.map +1 -1
  145. package/dist/types/src/operations/delete-message.d.ts +2 -2
  146. package/dist/types/src/operations/delete-message.d.ts.map +1 -1
  147. package/dist/types/src/operations/delete.d.ts +2 -2
  148. package/dist/types/src/operations/delete.d.ts.map +1 -1
  149. package/dist/types/src/operations/index.d.ts +0 -1
  150. package/dist/types/src/operations/index.d.ts.map +1 -1
  151. package/dist/types/src/operations/on-create-space.d.ts +2 -2
  152. package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
  153. package/dist/types/src/operations/restore-message.d.ts +2 -2
  154. package/dist/types/src/operations/restore-message.d.ts.map +1 -1
  155. package/dist/types/src/operations/restore.d.ts +2 -2
  156. package/dist/types/src/operations/restore.d.ts.map +1 -1
  157. package/dist/types/src/operations/select.d.ts +2 -2
  158. package/dist/types/src/operations/select.d.ts.map +1 -1
  159. package/dist/types/src/operations/toggle-resolved.d.ts +2 -2
  160. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
  161. package/dist/types/src/plugin.d.ts +4 -0
  162. package/dist/types/src/plugin.d.ts.map +1 -0
  163. package/dist/types/src/translations.d.ts.map +1 -1
  164. package/dist/types/src/types/ThreadCapabilities.d.ts +13 -0
  165. package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
  166. package/dist/types/src/{operations/definitions.d.ts → types/ThreadOperation.d.ts} +1 -1
  167. package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
  168. package/dist/types/src/types/index.d.ts +3 -1
  169. package/dist/types/src/types/index.d.ts.map +1 -1
  170. package/dist/types/src/types/types.d.ts +1 -1
  171. package/dist/types/src/types/types.d.ts.map +1 -1
  172. package/dist/types/src/util.d.ts +4 -1
  173. package/dist/types/src/util.d.ts.map +1 -1
  174. package/dist/types/tsconfig.tsbuildinfo +1 -1
  175. package/package.json +123 -99
  176. package/src/ThreadPlugin.node.ts +5 -50
  177. package/src/ThreadPlugin.test.ts +3 -3
  178. package/src/ThreadPlugin.tsx +6 -59
  179. package/src/ThreadPlugin.workerd.ts +20 -0
  180. package/src/blueprints/thread-blueprint.ts +1 -1
  181. package/src/capabilities/app-graph-builder.ts +18 -69
  182. package/src/capabilities/create-object.ts +29 -0
  183. package/src/capabilities/index.ts +1 -2
  184. package/src/capabilities/markdown.ts +1 -1
  185. package/src/capabilities/react-surface.tsx +4 -26
  186. package/src/capabilities/settings.ts +1 -3
  187. package/src/capabilities/undo-mappings.ts +1 -1
  188. package/src/components/Chat/Chat.tsx +52 -12
  189. package/src/components/CommentsPanel/CommentsPanel.stories.tsx +1 -1
  190. package/src/components/CommentsPanel/CommentsPanel.tsx +4 -4
  191. package/src/components/CommentsPanel/CommentsThread.tsx +2 -3
  192. package/src/components/MessagePanel/MessagePanel.tsx +7 -8
  193. package/src/components/ThreadSettings/ThreadSettings.tsx +0 -1
  194. package/src/components/index.ts +0 -1
  195. package/src/containers/{ChannelContainer/ChannelContainer.stories.tsx → ChannelArticle/ChannelArticle.stories.tsx} +10 -10
  196. package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
  197. package/src/containers/ChannelArticle/index.ts +5 -0
  198. package/src/containers/ChannelChat/ChannelChat.tsx +12 -2
  199. package/src/containers/ThreadCompanion/ThreadCompanion.tsx +10 -12
  200. package/src/containers/index.ts +1 -3
  201. package/src/extensions/command.ts +1 -1
  202. package/src/extensions/threads.ts +2 -2
  203. package/src/hooks/analytics.ts +1 -1
  204. package/src/hooks/index.ts +0 -5
  205. package/src/index.ts +3 -10
  206. package/src/meta.ts +1 -2
  207. package/src/operations/add-message.ts +4 -4
  208. package/src/operations/append-channel-message.ts +20 -19
  209. package/src/operations/create-channel.ts +2 -2
  210. package/src/operations/create-proposals.ts +2 -2
  211. package/src/operations/create.ts +3 -3
  212. package/src/operations/delete-message.ts +4 -4
  213. package/src/operations/delete.ts +3 -3
  214. package/src/operations/index.ts +0 -2
  215. package/src/operations/on-create-space.ts +3 -3
  216. package/src/operations/restore-message.ts +3 -3
  217. package/src/operations/restore.ts +3 -3
  218. package/src/operations/select.ts +2 -2
  219. package/src/operations/toggle-resolved.ts +3 -3
  220. package/src/plugin.ts +11 -0
  221. package/src/translations.ts +2 -2
  222. package/src/types/ThreadCapabilities.ts +26 -0
  223. package/src/{operations/definitions.ts → types/ThreadOperation.ts} +5 -4
  224. package/src/types/index.ts +4 -1
  225. package/src/types/types.ts +0 -2
  226. package/src/util.ts +36 -4
  227. package/dist/lib/browser/add-message-LRVGIHDH.mjs.map +0 -7
  228. package/dist/lib/browser/append-channel-message-CO3M6FSA.mjs.map +0 -7
  229. package/dist/lib/browser/blueprints/index.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-E4GG3NX2.mjs +0 -29
  231. package/dist/lib/browser/chunk-E4GG3NX2.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-TPNZ43NB.mjs.map +0 -7
  233. package/dist/lib/browser/create-BTGLHLBA.mjs.map +0 -7
  234. package/dist/lib/browser/create-channel-ZXKSLHGN.mjs.map +0 -7
  235. package/dist/lib/browser/create-proposals-AV5CREPV.mjs.map +0 -7
  236. package/dist/lib/browser/delete-GLYEP7NE.mjs.map +0 -7
  237. package/dist/lib/browser/delete-message-RQ72ZY5D.mjs.map +0 -7
  238. package/dist/lib/browser/index.mjs +0 -1821
  239. package/dist/lib/browser/index.mjs.map +0 -7
  240. package/dist/lib/browser/meta.json +0 -1
  241. package/dist/lib/browser/on-create-space-SPE3QVFZ.mjs.map +0 -7
  242. package/dist/lib/browser/operations/index.mjs +0 -13
  243. package/dist/lib/browser/operations/index.mjs.map +0 -7
  244. package/dist/lib/browser/restore-VX7FLZOZ.mjs.map +0 -7
  245. package/dist/lib/browser/restore-message-D65NSWUA.mjs.map +0 -7
  246. package/dist/lib/browser/select-AT4L7EBU.mjs.map +0 -7
  247. package/dist/lib/browser/toggle-resolved-JD3D4WBZ.mjs.map +0 -7
  248. package/dist/lib/browser/translations.mjs.map +0 -7
  249. package/dist/lib/browser/types/index.mjs +0 -10
  250. package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs +0 -90
  251. package/dist/lib/node-esm/add-message-4EAQ2ZPI.mjs.map +0 -7
  252. package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs +0 -41
  253. package/dist/lib/node-esm/append-channel-message-F7KGBSWP.mjs.map +0 -7
  254. package/dist/lib/node-esm/blueprints/index.mjs +0 -38
  255. package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
  256. package/dist/lib/node-esm/chunk-BVEZBGIY.mjs +0 -30
  257. package/dist/lib/node-esm/chunk-BVEZBGIY.mjs.map +0 -7
  258. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  259. package/dist/lib/node-esm/chunk-XKUMDYGR.mjs +0 -259
  260. package/dist/lib/node-esm/chunk-XKUMDYGR.mjs.map +0 -7
  261. package/dist/lib/node-esm/create-DEZFPN2Y.mjs +0 -56
  262. package/dist/lib/node-esm/create-DEZFPN2Y.mjs.map +0 -7
  263. package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs +0 -20
  264. package/dist/lib/node-esm/create-channel-6VHTC2OR.mjs.map +0 -7
  265. package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs +0 -57
  266. package/dist/lib/node-esm/create-proposals-P5O2ICOL.mjs.map +0 -7
  267. package/dist/lib/node-esm/delete-QG45QLPY.mjs +0 -60
  268. package/dist/lib/node-esm/delete-QG45QLPY.mjs.map +0 -7
  269. package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs +0 -56
  270. package/dist/lib/node-esm/delete-message-PGNLB6TL.mjs.map +0 -7
  271. package/dist/lib/node-esm/index.mjs +0 -1822
  272. package/dist/lib/node-esm/index.mjs.map +0 -7
  273. package/dist/lib/node-esm/meta.json +0 -1
  274. package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs +0 -25
  275. package/dist/lib/node-esm/on-create-space-TFBSHWQ4.mjs.map +0 -7
  276. package/dist/lib/node-esm/operations/index.mjs +0 -14
  277. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  278. package/dist/lib/node-esm/restore-E27OAIFJ.mjs +0 -33
  279. package/dist/lib/node-esm/restore-E27OAIFJ.mjs.map +0 -7
  280. package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs +0 -34
  281. package/dist/lib/node-esm/restore-message-J3CH6NGI.mjs.map +0 -7
  282. package/dist/lib/node-esm/select-UU6Q2XAB.mjs +0 -27
  283. package/dist/lib/node-esm/select-UU6Q2XAB.mjs.map +0 -7
  284. package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs +0 -37
  285. package/dist/lib/node-esm/toggle-resolved-VS6NKXL3.mjs.map +0 -7
  286. package/dist/lib/node-esm/translations.mjs +0 -91
  287. package/dist/lib/node-esm/translations.mjs.map +0 -7
  288. package/dist/lib/node-esm/types/index.mjs +0 -11
  289. package/dist/types/src/calls/call-manager.d.ts +0 -87
  290. package/dist/types/src/calls/call-manager.d.ts.map +0 -1
  291. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
  292. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
  293. package/dist/types/src/calls/index.d.ts +0 -7
  294. package/dist/types/src/calls/index.d.ts.map +0 -1
  295. package/dist/types/src/calls/media-manager.d.ts +0 -60
  296. package/dist/types/src/calls/media-manager.d.ts.map +0 -1
  297. package/dist/types/src/calls/speaking-monitor.d.ts +0 -21
  298. package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
  299. package/dist/types/src/calls/types.d.ts +0 -45
  300. package/dist/types/src/calls/types.d.ts.map +0 -1
  301. package/dist/types/src/calls/util/audio.d.ts +0 -6
  302. package/dist/types/src/calls/util/audio.d.ts.map +0 -1
  303. package/dist/types/src/calls/util/calls-service.d.ts +0 -77
  304. package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
  305. package/dist/types/src/calls/util/history-cache.d.ts +0 -11
  306. package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
  307. package/dist/types/src/calls/util/index.d.ts +0 -5
  308. package/dist/types/src/calls/util/index.d.ts.map +0 -1
  309. package/dist/types/src/calls/util/media.d.ts +0 -6
  310. package/dist/types/src/calls/util/media.d.ts.map +0 -1
  311. package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
  312. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
  313. package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
  314. package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
  315. package/dist/types/src/calls-service.stories.d.ts +0 -23
  316. package/dist/types/src/calls-service.stories.d.ts.map +0 -1
  317. package/dist/types/src/capabilities/call-manager.d.ts +0 -6
  318. package/dist/types/src/capabilities/call-manager.d.ts.map +0 -1
  319. package/dist/types/src/capabilities/react-root.d.ts +0 -9
  320. package/dist/types/src/capabilities/react-root.d.ts.map +0 -1
  321. package/dist/types/src/components/Call/Call.d.ts +0 -45
  322. package/dist/types/src/components/Call/Call.d.ts.map +0 -1
  323. package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
  324. package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
  325. package/dist/types/src/components/Call/index.d.ts +0 -3
  326. package/dist/types/src/components/Call/index.d.ts.map +0 -1
  327. package/dist/types/src/components/Lobby/Lobby.d.ts +0 -36
  328. package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
  329. package/dist/types/src/components/Lobby/index.d.ts +0 -2
  330. package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
  331. package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
  332. package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
  333. package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
  334. package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
  335. package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -22
  336. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
  337. package/dist/types/src/components/Media/index.d.ts +0 -3
  338. package/dist/types/src/components/Media/index.d.ts.map +0 -1
  339. package/dist/types/src/components/Participant/Participant.d.ts +0 -6
  340. package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
  341. package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
  342. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
  343. package/dist/types/src/components/Participant/index.d.ts +0 -3
  344. package/dist/types/src/components/Participant/index.d.ts.map +0 -1
  345. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
  346. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
  347. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -178
  348. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
  349. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
  350. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
  351. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts +0 -12
  352. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +0 -1
  353. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +0 -164
  354. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +0 -1
  355. package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
  356. package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
  357. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
  358. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
  359. package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -2
  360. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
  361. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
  362. package/dist/types/src/containers/CallSidebar/index.d.ts +0 -2
  363. package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
  364. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
  365. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
  366. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
  367. package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -2
  368. package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
  369. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
  370. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
  371. package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
  372. package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
  373. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
  374. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
  375. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
  376. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
  377. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  378. package/dist/types/src/types/capabilities.d.ts +0 -25
  379. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  380. package/src/calls/call-manager.ts +0 -270
  381. package/src/calls/call-swarm-synchronizer.ts +0 -350
  382. package/src/calls/index.ts +0 -10
  383. package/src/calls/media-manager.ts +0 -378
  384. package/src/calls/speaking-monitor.ts +0 -85
  385. package/src/calls/types.ts +0 -74
  386. package/src/calls/util/audio.ts +0 -58
  387. package/src/calls/util/calls-service.ts +0 -582
  388. package/src/calls/util/history-cache.ts +0 -27
  389. package/src/calls/util/index.ts +0 -8
  390. package/src/calls/util/media.ts +0 -52
  391. package/src/calls/util/stub-media-streams.ts +0 -129
  392. package/src/calls/util/task-scheduling.ts +0 -92
  393. package/src/calls-service.stories.tsx +0 -230
  394. package/src/capabilities/call-manager.ts +0 -27
  395. package/src/capabilities/react-root.tsx +0 -20
  396. package/src/components/Call/Call.tsx +0 -93
  397. package/src/components/Call/Toolbar.tsx +0 -199
  398. package/src/components/Call/index.ts +0 -6
  399. package/src/components/Lobby/Lobby.tsx +0 -123
  400. package/src/components/Lobby/index.ts +0 -5
  401. package/src/components/Media/AudioStream.tsx +0 -67
  402. package/src/components/Media/VideoObject.stories.tsx +0 -59
  403. package/src/components/Media/VideoObject.tsx +0 -58
  404. package/src/components/Media/index.ts +0 -6
  405. package/src/components/Participant/Participant.tsx +0 -77
  406. package/src/components/Participant/ParticipantGrid.tsx +0 -88
  407. package/src/components/Participant/index.ts +0 -6
  408. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -158
  409. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
  410. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
  411. package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +0 -54
  412. package/src/components/ResponsiveGrid/ResponsivePanel.tsx +0 -31
  413. package/src/components/ResponsiveGrid/index.ts +0 -7
  414. package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -173
  415. package/src/containers/CallDebugPanel/index.ts +0 -5
  416. package/src/containers/CallSidebar/CallSidebar.tsx +0 -18
  417. package/src/containers/CallSidebar/index.ts +0 -5
  418. package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -223
  419. package/src/containers/ChannelContainer/index.ts +0 -5
  420. package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
  421. package/src/hooks/useDebugMode.ts +0 -25
  422. package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
  423. package/src/hooks/useVideoStreamTrack.tsx +0 -36
  424. package/src/types/capabilities.ts +0 -37
  425. package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
  426. package/src/typings.d.ts +0 -8
  427. /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChannelChat-6YTD5HWL.mjs.map} +0 -0
  428. /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  429. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  430. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  431. /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
@@ -0,0 +1,24 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/ThreadPlugin.workerd.ts
4
+ import { Plugin } from "@dxos/app-framework";
5
+ import { AppPlugin } from "@dxos/app-toolkit";
6
+ import { AnchoredTo, Channel, Message, Thread } from "@dxos/types";
7
+ import { OperationHandler } from "#capabilities";
8
+ import { meta } from "#meta";
9
+ var ThreadPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({
10
+ activate: OperationHandler
11
+ }), AppPlugin.addSchemaModule({
12
+ schema: [
13
+ AnchoredTo.AnchoredTo,
14
+ Channel.Channel,
15
+ Message.Message,
16
+ Thread.Thread
17
+ ]
18
+ }), Plugin.make);
19
+ var ThreadPlugin_workerd_default = ThreadPlugin;
20
+ export {
21
+ ThreadPlugin,
22
+ ThreadPlugin_workerd_default as default
23
+ };
24
+ //# sourceMappingURL=ThreadPlugin.workerd.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ThreadPlugin.workerd.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { AnchoredTo, Channel, Message, Thread } from '@dxos/types';\n\nimport { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const ThreadPlugin = Plugin.define(meta).pipe(\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({\n schema: [AnchoredTo.AnchoredTo, Channel.Channel, Message.Message, Thread.Thread],\n }),\n Plugin.make,\n);\n\nexport default ThreadPlugin;\n"],
5
+ "mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,YAAYC,SAASC,SAASC,cAAc;AAErD,SAASC,wBAAwB;AACjC,SAASC,YAAY;AAEd,IAAMC,eAAeR,OAAOS,OAAOF,IAAAA,EAAMG,KAC9CT,UAAUU,0BAA0B;EAAEC,UAAUN;AAAiB,CAAA,GACjEL,UAAUY,gBAAgB;EACxBC,QAAQ;IAACZ,WAAWA;IAAYC,QAAQA;IAASC,QAAQA;IAASC,OAAOA;;AAC3E,CAAA,GACAL,OAAOe,IAAI;AAGb,IAAA,+BAAeP;",
6
+ "names": ["Plugin", "AppPlugin", "AnchoredTo", "Channel", "Message", "Thread", "OperationHandler", "meta", "ThreadPlugin", "define", "pipe", "addOperationHandlerModule", "activate", "addSchemaModule", "schema", "make"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/components/ThreadSettings/ThreadSettings.tsx
4
+ import React from "react";
5
+ import { useTranslation } from "@dxos/react-ui";
6
+ import { Settings as SettingsForm } from "@dxos/react-ui-form";
7
+ import { meta } from "#meta";
8
+ var ThreadSettings = ({ settings: _settings }) => {
9
+ const { t: _t } = useTranslation(meta.id);
10
+ return /* @__PURE__ */ React.createElement(SettingsForm.Viewport, null);
11
+ };
12
+ export {
13
+ ThreadSettings as default
14
+ };
15
+ //# sourceMappingURL=ThreadSettings-5MKTDK3A.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ThreadSettings/ThreadSettings.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Settings as SettingsForm } from '@dxos/react-ui-form';\n\nimport { meta } from '#meta';\nimport { type Settings } from '#types';\n\nexport type ThreadSettingsProps = AppSurface.SettingsArticleProps<Settings.Settings>;\n\nexport const ThreadSettings = ({ settings: _settings }: ThreadSettingsProps) => {\n const { t: _t } = useTranslation(meta.id);\n return <SettingsForm.Viewport></SettingsForm.Viewport>;\n};\n"],
5
+ "mappings": ";;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,oBAAoB;AAEzC,SAASC,YAAY;AAKd,IAAMC,iBAAiB,CAAC,EAAEC,UAAUC,UAAS,MAAuB;AACzE,QAAM,EAAEC,GAAGC,GAAE,IAAKR,eAAeG,KAAKM,EAAE;AACxC,SAAO,sBAAA,cAACP,aAAaQ,UAAQ,IAAA;AAC/B;",
6
+ "names": ["React", "useTranslation", "Settings", "SettingsForm", "meta", "ThreadSettings", "settings", "_settings", "t", "_t", "id", "Viewport"]
7
+ }
@@ -1,9 +1,7 @@
1
1
  import {
2
- ThreadCapabilities
3
- } from "./chunk-E4GG3NX2.mjs";
4
- import {
5
- AddMessage
6
- } from "./chunk-TPNZ43NB.mjs";
2
+ ThreadCapabilities_exports,
3
+ ThreadOperation_exports
4
+ } from "./chunk-PE7IH7EL.mjs";
7
5
  import "./chunk-J5LGTIGS.mjs";
8
6
 
9
7
  // src/operations/add-message.ts
@@ -12,13 +10,13 @@ import { Capabilities, Capability } from "@dxos/app-framework";
12
10
  import { Operation } from "@dxos/compute";
13
11
  import { Obj, Ref, Relation } from "@dxos/echo";
14
12
  import { invariant } from "@dxos/invariant";
15
- import { ObservabilityOperation } from "@dxos/plugin-observability/operations";
16
- import { SpaceOperation } from "@dxos/plugin-space/operations";
13
+ import { ObservabilityOperation } from "@dxos/plugin-observability";
14
+ import { SpaceOperation } from "@dxos/plugin-space";
17
15
  import { AnchoredTo, Message } from "@dxos/types";
18
16
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/add-message.ts";
19
- var handler = AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
17
+ var handler = ThreadOperation_exports.AddMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
20
18
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
21
- const stateAtom = yield* Capability.get(ThreadCapabilities.State);
19
+ const stateAtom = yield* Capability.get(ThreadCapabilities_exports.State);
22
20
  const thread = Relation.getSource(anchor);
23
21
  const subjectId = Obj.getDXN(subject).toString();
24
22
  const db = Obj.getDatabase(subject);
@@ -86,4 +84,4 @@ var add_message_default = handler;
86
84
  export {
87
85
  add_message_default as default
88
86
  };
89
- //# sourceMappingURL=add-message-LRVGIHDH.mjs.map
87
+ //# sourceMappingURL=add-message-FBIROBEZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/add-message.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { ObservabilityOperation } from '@dxos/plugin-observability';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { ThreadOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof ThreadOperation.AddMessage> = ThreadOperation.AddMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const thread = Relation.getSource(anchor) as Thread.Thread;\n const subjectId = Obj.getDXN(subject).toString();\n const db = Obj.getDatabase(subject);\n invariant(db, 'Database not found');\n\n const message = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n sender,\n blocks: [{ _tag: 'text', text }],\n });\n Obj.update(thread, (thread) => {\n thread.messages.push(Ref.make(message));\n });\n\n const state = registry.get(stateAtom);\n const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);\n if (draft) {\n Obj.update(thread, (thread) => {\n thread.status = 'active';\n });\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),\n },\n });\n yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });\n yield* Operation.invoke(SpaceOperation.AddRelation, {\n db,\n schema: AnchoredTo.AnchoredTo,\n source: thread,\n target: subject,\n fields: { anchor: draft.anchor },\n });\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.create',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n },\n });\n }\n\n yield* Operation.schedule(ObservabilityOperation.SendEvent, {\n name: 'threads.message.add',\n properties: {\n spaceId: db.spaceId,\n threadId: thread.id,\n threadLength: thread.messages.length,\n messageId: message.id,\n messageLength: text.length,\n },\n });\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiB;AAC1B,SAASC,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;AAK5C,IAAA,eAA0EC;IAIpE,UAAMC,wBAAmBC,WAAc,KAACC,UAAAA,YAAwB,kBAAA,WAAA,EAAA,QAAA,SAAA,QAAA,KAAA,GAAA;AAChE,QAAMC,WAASC,OAASC,WAAUC,IAAAA,aAAAA,YAAAA;AAClC,QAAMC,YAAYC,OAAIC,WAAOC,IAASC,2BAAQ,KAAA;AAC9C,QAAMC,SAASC,SAAAA,UAAYH,MAAAA;AAC3BI,QAAAA,YAAc,IAAA,OAAA,OAAA,EAAA,SAAA;AAEd,QAAMC,KAAAA,IAAAA,YAAmBC,OAAQA;YAC/BC,IAAS,sBAAsB,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;QAC/BC,UAAAA,IAAAA,KAAAA,QAAAA,SAAAA;IACAC,UAAQ,oBAAA,KAAA,GAAA,YAAA;;YAAGC;;QAAmB,MAAA;QAAE;MAClC;IACIC;;AAEJ,MAAA,OAAA,QAAA,CAAAlB,YAAA;AAEA,IAAAA,QAAMmB,SAAQC,KAASC,IAAIxB,KAAAA,OAAAA,CAAAA;EAC3B,CAAA;AACA,QAAIyB,QAAO,SAAA,IAAA,SAAA;QACTjB,QAAU,MAACL,OAASA,SAAAA,GAAAA,KAAAA,CAAAA,MAAAA,EAAAA,OAAAA,OAAAA,EAAAA;aAClBA;AACF,QAAA,OAAA,QAAA,CAAAA,YAAA;AACAoB,MAAAA,QAASG,SAAI1B;;aAEX2B,IAAQ,WAAA;;cAELpB;QACH,GAAA,MAAA;QACF,CAAA,SAAA,GAAA,MAAA,OAAA,SAAA,GAAA,OAAA,CAAA,MAAA,EAAA,OAAA,OAAA,EAAA;MACA;;WAAoEqB,UAAQhB,OAAAA,eAAAA,WAAAA;MAAIiB,QAAQ;MAAK,QAAA;MAC7F,QAAOC;;WAELC,UAAQC,OAAWA,eAAU,aAAA;MAC7BC;MACAL,QAAQlB,WAAAA;MACRwB,QAAQ;cAAE5B;MAAqB,QAAA;QACjC,QAAA,MAAA;MACA;;WAEE6B,UAAY,SAAA,uBAAA,WAAA;YACVC;kBACAC;QACF,SAAA,GAAA;QACF,UAAA,OAAA;MACF;IAEA,CAAA;;SAEEF,UAAY,SAAA,uBAAA,WAAA;UACVC;gBACAC;MACAC,SAAAA,GAAAA;MACAC,UAAAA,OAAWxB;MACXyB,cAAAA,OAAoBC,SAAM;MAC5B,WAAA,QAAA;MACF,eAAA,KAAA;IACF;EAIJ,CAAA;;;",
6
+ "names": ["Effect", "Capabilities", "Capability", "Operation", "Obj", "Ref", "Relation", "invariant", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "ThreadOperation", "stateAtom", "Capability", "ThreadCapabilities", "thread", "Relation", "getSource", "anchor", "subjectId", "Obj", "getDXN", "subject", "toString", "db", "getDatabase", "invariant", "message", "Message", "created", "sender", "blocks", "_tag", "update", "state", "registry", "get", "draft", "set", "drafts", "target", "hidden", "Operation", "schema", "AnchoredTo", "source", "fields", "properties", "spaceId", "threadId", "threadLength", "messageId", "messageLength", "length"]
7
+ }
@@ -0,0 +1,120 @@
1
+ import {
2
+ getAnchor
3
+ } from "./chunk-JLY4NVTA.mjs";
4
+ import "./chunk-J5LGTIGS.mjs";
5
+
6
+ // src/capabilities/app-graph-builder.ts
7
+ import { Atom } from "@effect-atom/atom-react";
8
+ import * as Effect from "effect/Effect";
9
+ import * as Option from "effect/Option";
10
+ import { Capability } from "@dxos/app-framework";
11
+ import { AppCapabilities, AppNode } from "@dxos/app-toolkit";
12
+ import { Operation } from "@dxos/compute";
13
+ import { Obj } from "@dxos/echo";
14
+ import { AttentionCapabilities } from "@dxos/plugin-attention";
15
+ import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
16
+ import { linkedSegment } from "@dxos/react-ui-attention";
17
+ import { defaultSelection } from "@dxos/react-ui-attention";
18
+ import { Channel } from "@dxos/types";
19
+ import { meta } from "#meta";
20
+ import { ThreadOperation } from "#types";
21
+ import { ThreadCapabilities } from "#types";
22
+ var commentDisabledFamily = Atom.family(({ stateAtom, selectionManager, objectId, commentsType, selectionMode }) => Atom.make((get) => {
23
+ const stateAtoms = get(stateAtom);
24
+ const state = stateAtoms[0] ? get(stateAtoms[0]) : void 0;
25
+ const toolbar = state?.toolbar ?? {};
26
+ const selectionState = get(selectionManager.state);
27
+ const selection = selectionState.selections[objectId] ?? (selectionMode ? defaultSelection(selectionMode) : void 0);
28
+ const anchor = getAnchor(selection);
29
+ const invalidSelection = !anchor;
30
+ const overlappingComment = toolbar[objectId];
31
+ return commentsType === "anchored" && invalidSelection || overlappingComment;
32
+ }));
33
+ var whenCommentableObject = NodeMatcher.whenAll(NodeMatcher.whenEchoObjectMatches, NodeMatcher.whenNot(NodeMatcher.whenEchoTypeMatches(Channel.Channel)));
34
+ var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
35
+ const capabilities = yield* Capability.Service;
36
+ const getCommentConfig = (typename) => capabilities.getAll(AppCapabilities.CommentConfig).find(({ id }) => id === typename);
37
+ const extensions = yield* Effect.all([
38
+ GraphBuilder.createExtension({
39
+ id: "comments-companion",
40
+ match: (node) => {
41
+ if (!Obj.isObject(node.data) || Option.isNone(whenCommentableObject(node))) {
42
+ return Option.none();
43
+ }
44
+ const commentConfig = getCommentConfig(Obj.getTypename(node.data));
45
+ return commentConfig ? Option.some(node) : Option.none();
46
+ },
47
+ connector: () => Effect.succeed([
48
+ AppNode.makeCompanion({
49
+ id: linkedSegment("comments"),
50
+ label: [
51
+ "comments.label",
52
+ {
53
+ ns: meta.id
54
+ }
55
+ ],
56
+ icon: "ph--chat-text--regular",
57
+ data: "comments",
58
+ position: "hoist"
59
+ })
60
+ ])
61
+ }),
62
+ GraphBuilder.createExtension({
63
+ id: "comment-toolbar",
64
+ match: (node) => {
65
+ if (!Obj.isObject(node.data) || Option.isNone(whenCommentableObject(node))) {
66
+ return Option.none();
67
+ }
68
+ const commentConfig = getCommentConfig(Obj.getTypename(node.data));
69
+ return commentConfig ? Option.some(node) : Option.none();
70
+ },
71
+ actions: (matched, get) => {
72
+ const object = matched.data;
73
+ const objectDXN = Obj.getDXN(object).toString();
74
+ const stateAtom = capabilities.atom(ThreadCapabilities.State);
75
+ const selectionManager = capabilities.get(AttentionCapabilities.Selection);
76
+ const commentConfig = getCommentConfig(Obj.getTypename(object));
77
+ const disabled = get(commentDisabledFamily({
78
+ stateAtom,
79
+ selectionManager,
80
+ objectId: objectDXN,
81
+ commentsType: commentConfig.comments,
82
+ selectionMode: commentConfig.selectionMode
83
+ }));
84
+ return Effect.succeed([
85
+ {
86
+ id: "comment",
87
+ data: Effect.fnUntraced(function* () {
88
+ const config = getCommentConfig(Obj.getTypename(object));
89
+ const selection = selectionManager.getSelection(objectDXN);
90
+ const anchor = (config.comments === "anchored" ? getAnchor(selection) : void 0) ?? Date.now().toString();
91
+ const name = config.getAnchorLabel?.(object, anchor);
92
+ yield* Operation.invoke(ThreadOperation.Create, {
93
+ anchor,
94
+ name,
95
+ subject: object
96
+ });
97
+ }),
98
+ properties: {
99
+ label: [
100
+ "add-comment.label",
101
+ {
102
+ ns: meta.id
103
+ }
104
+ ],
105
+ icon: "ph--chat-text--regular",
106
+ disposition: "toolbar",
107
+ disabled,
108
+ testId: "thread.comment.add"
109
+ }
110
+ }
111
+ ]);
112
+ }
113
+ })
114
+ ]);
115
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
116
+ }));
117
+ export {
118
+ app_graph_builder_default as default
119
+ };
120
+ //# sourceMappingURL=app-graph-builder-7Q6MA6RT.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom } from '@effect-atom/atom-react';\nimport * as Effect from 'effect/Effect';\nimport * as Option from 'effect/Option';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode } from '@dxos/app-toolkit';\nimport { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { AttentionCapabilities } from '@dxos/plugin-attention';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { linkedSegment } from '@dxos/react-ui-attention';\nimport { type SelectionManager, type SelectionMode, defaultSelection } from '@dxos/react-ui-attention';\nimport { Channel } from '@dxos/types';\n\nimport { meta } from '#meta';\nimport { ThreadOperation } from '#types';\nimport { ThreadCapabilities, type ThreadState } from '#types';\n\nimport { getAnchor } from '../util';\n\ntype CommentDisabledParams = {\n stateAtom: Atom.Atom<Atom.Writable<ThreadState>[]>;\n selectionManager: SelectionManager;\n objectId: string;\n commentsType: string;\n selectionMode: SelectionMode | undefined;\n};\n\n/**\n * Atom family to derive whether the comment button should be disabled.\n * Uses a composite key to ensure proper caching.\n */\nconst commentDisabledFamily = Atom.family(\n ({ stateAtom, selectionManager, objectId, commentsType, selectionMode }: CommentDisabledParams) =>\n Atom.make((get) => {\n const stateAtoms = get(stateAtom);\n const state = stateAtoms[0] ? get(stateAtoms[0]) : undefined;\n const toolbar = state?.toolbar ?? {};\n const selectionState = get(selectionManager.state);\n const selection =\n selectionState.selections[objectId] ?? (selectionMode ? defaultSelection(selectionMode) : undefined);\n const anchor = getAnchor(selection);\n const invalidSelection = !anchor;\n const overlappingComment = toolbar[objectId];\n return (commentsType === 'anchored' && invalidSelection) || overlappingComment;\n }),\n);\n\n/** Match ECHO objects that are NOT Channels (i.e. objects that can have comments). */\nconst whenCommentableObject = NodeMatcher.whenAll(\n NodeMatcher.whenEchoObjectMatches,\n NodeMatcher.whenNot(NodeMatcher.whenEchoTypeMatches(Channel.Channel)),\n);\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n\n const getCommentConfig = (typename: string) =>\n capabilities.getAll(AppCapabilities.CommentConfig).find(({ id }) => id === typename);\n\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: 'comments-companion',\n match: (node) => {\n if (!Obj.isObject(node.data) || Option.isNone(whenCommentableObject(node))) {\n return Option.none();\n }\n const commentConfig = getCommentConfig(Obj.getTypename(node.data)!);\n return commentConfig ? Option.some(node) : Option.none();\n },\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n id: linkedSegment('comments'),\n label: ['comments.label', { ns: meta.id }],\n icon: 'ph--chat-text--regular',\n data: 'comments',\n position: 'hoist',\n }),\n ]),\n }),\n GraphBuilder.createExtension({\n id: 'comment-toolbar',\n match: (node) => {\n if (!Obj.isObject(node.data) || Option.isNone(whenCommentableObject(node))) {\n return Option.none();\n }\n const commentConfig = getCommentConfig(Obj.getTypename(node.data)!);\n return commentConfig ? Option.some(node) : Option.none();\n },\n actions: (matched, get) => {\n const object = matched.data;\n const objectDXN = Obj.getDXN(object).toString();\n const stateAtom = capabilities.atom(ThreadCapabilities.State);\n const selectionManager = capabilities.get(AttentionCapabilities.Selection);\n const commentConfig = getCommentConfig(Obj.getTypename(object)!)!;\n\n const disabled = get(\n commentDisabledFamily({\n stateAtom,\n selectionManager,\n objectId: objectDXN,\n commentsType: commentConfig.comments,\n selectionMode: commentConfig.selectionMode as SelectionMode | undefined,\n }),\n );\n\n return Effect.succeed([\n {\n id: 'comment',\n data: Effect.fnUntraced(function* () {\n const config = getCommentConfig(Obj.getTypename(object)!)!;\n const selection = selectionManager.getSelection(objectDXN);\n const anchor =\n (config.comments === 'anchored' ? getAnchor(selection) : undefined) ?? Date.now().toString();\n const name = config.getAnchorLabel?.(object, anchor);\n yield* Operation.invoke(ThreadOperation.Create, {\n anchor,\n name,\n subject: object,\n });\n }),\n properties: {\n label: ['add-comment.label', { ns: meta.id }],\n icon: 'ph--chat-text--regular',\n disposition: 'toolbar',\n disabled,\n testId: 'thread.comment.add',\n },\n },\n ]);\n },\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,YAAY;AACrB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiBC,eAAe;AACzC,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,6BAA6B;AACtC,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,qBAAqB;AAC9B,SAAoDC,wBAAwB;AAC5E,SAASC,eAAe;AAExB,SAASC,YAAY;AACrB,SAASC,uBAAuB;AAChC,SAASC,0BAA4C;AAgBrD,IAAMC,wBAAwBC,KAAKC,OACjC,CAAC,EAAEC,WAAWC,kBAAkBC,UAAUC,cAAcC,cAAa,MACnEN,KAAKO,KAAK,CAACC,QAAAA;AACT,QAAMC,aAAaD,IAAIN,SAAAA;AACvB,QAAMQ,QAAQD,WAAW,CAAA,IAAKD,IAAIC,WAAW,CAAA,CAAE,IAAIE;AACnD,QAAMC,UAAUF,OAAOE,WAAW,CAAC;AACnC,QAAMC,iBAAiBL,IAAIL,iBAAiBO,KAAK;AACjD,QAAMI,YACJD,eAAeE,WAAWX,QAAAA,MAAcE,gBAAgBU,iBAAiBV,aAAAA,IAAiBK;AAC5F,QAAMM,SAASC,UAAUJ,SAAAA;AACzB,QAAMK,mBAAmB,CAACF;AAC1B,QAAMG,qBAAqBR,QAAQR,QAAAA;AACnC,SAAQC,iBAAiB,cAAcc,oBAAqBC;AAC9D,CAAA,CAAA;AAIJ,IAAMC,wBAAwBC,YAAYC,QACxCD,YAAYE,uBACZF,YAAYG,QAAQH,YAAYI,oBAAoBC,QAAQA,OAAO,CAAA,CAAA;AAGrE,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,eAAe,OAAOH,WAAWI;AAEvC,QAAMC,mBAAmB,CAACC,aACxBH,aAAaI,OAAOC,gBAAgBC,aAAa,EAAEC,KAAK,CAAC,EAAEC,GAAE,MAAOA,OAAOL,QAAAA;AAE7E,QAAMM,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BJ,IAAI;MACJK,OAAO,CAACC,SAAAA;AACN,YAAI,CAACC,IAAIC,SAASF,KAAKG,IAAI,KAAYC,cAAO5B,sBAAsBwB,IAAAA,CAAAA,GAAQ;AAC1E,iBAAcK,YAAI;QACpB;AACA,cAAMC,gBAAgBlB,iBAAiBa,IAAIM,YAAYP,KAAKG,IAAI,CAAA;AAChE,eAAOG,gBAAuBE,YAAKR,IAAAA,IAAeK,YAAI;MACxD;MACAI,WAAW,MACFC,eAAQ;QACbC,QAAQC,cAAc;UACpBlB,IAAImB,cAAc,UAAA;UAClBC,OAAO;YAAC;YAAkB;cAAEC,IAAIC,KAAKtB;YAAG;;UACxCuB,MAAM;UACNd,MAAM;UACNe,UAAU;QACZ,CAAA;OACD;IACL,CAAA;IACArB,aAAaC,gBAAgB;MAC3BJ,IAAI;MACJK,OAAO,CAACC,SAAAA;AACN,YAAI,CAACC,IAAIC,SAASF,KAAKG,IAAI,KAAYC,cAAO5B,sBAAsBwB,IAAAA,CAAAA,GAAQ;AAC1E,iBAAcK,YAAI;QACpB;AACA,cAAMC,gBAAgBlB,iBAAiBa,IAAIM,YAAYP,KAAKG,IAAI,CAAA;AAChE,eAAOG,gBAAuBE,YAAKR,IAAAA,IAAeK,YAAI;MACxD;MACAc,SAAS,CAACC,SAASzD,QAAAA;AACjB,cAAM0D,SAASD,QAAQjB;AACvB,cAAMmB,YAAYrB,IAAIsB,OAAOF,MAAAA,EAAQG,SAAQ;AAC7C,cAAMnE,YAAY6B,aAAauC,KAAKC,mBAAmBC,KAAK;AAC5D,cAAMrE,mBAAmB4B,aAAavB,IAAIiE,sBAAsBC,SAAS;AACzE,cAAMvB,gBAAgBlB,iBAAiBa,IAAIM,YAAYc,MAAAA,CAAAA;AAEvD,cAAMS,WAAWnE,IACfT,sBAAsB;UACpBG;UACAC;UACAC,UAAU+D;UACV9D,cAAc8C,cAAcyB;UAC5BtE,eAAe6C,cAAc7C;QAC/B,CAAA,CAAA;AAGF,eAAciD,eAAQ;UACpB;YACEhB,IAAI;YACJS,MAAalB,kBAAW,aAAA;AACtB,oBAAM+C,SAAS5C,iBAAiBa,IAAIM,YAAYc,MAAAA,CAAAA;AAChD,oBAAMpD,YAAYX,iBAAiB2E,aAAaX,SAAAA;AAChD,oBAAMlD,UACH4D,OAAOD,aAAa,aAAa1D,UAAUJ,SAAAA,IAAaH,WAAcoE,KAAKC,IAAG,EAAGX,SAAQ;AAC5F,oBAAMY,OAAOJ,OAAOK,iBAAiBhB,QAAQjD,MAAAA;AAC7C,qBAAOkE,UAAUC,OAAOC,gBAAgBC,QAAQ;gBAC9CrE;gBACAgE;gBACAM,SAASrB;cACX,CAAA;YACF,CAAA;YACAsB,YAAY;cACV7B,OAAO;gBAAC;gBAAqB;kBAAEC,IAAIC,KAAKtB;gBAAG;;cAC3CuB,MAAM;cACN2B,aAAa;cACbd;cACAe,QAAQ;YACV;UACF;SACD;MACH;IACF,CAAA;GACD;AAED,SAAO9D,WAAW+D,YAAYvD,gBAAgBwD,iBAAiBpD,UAAAA;AACjE,CAAA,CAAA;",
6
+ "names": ["Atom", "Effect", "Option", "Capability", "AppCapabilities", "AppNode", "Operation", "Obj", "AttentionCapabilities", "GraphBuilder", "NodeMatcher", "linkedSegment", "defaultSelection", "Channel", "meta", "ThreadOperation", "ThreadCapabilities", "commentDisabledFamily", "Atom", "family", "stateAtom", "selectionManager", "objectId", "commentsType", "selectionMode", "make", "get", "stateAtoms", "state", "undefined", "toolbar", "selectionState", "selection", "selections", "defaultSelection", "anchor", "getAnchor", "invalidSelection", "overlappingComment", "whenCommentableObject", "NodeMatcher", "whenAll", "whenEchoObjectMatches", "whenNot", "whenEchoTypeMatches", "Channel", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "getCommentConfig", "typename", "getAll", "AppCapabilities", "CommentConfig", "find", "id", "extensions", "all", "GraphBuilder", "createExtension", "match", "node", "Obj", "isObject", "data", "isNone", "none", "commentConfig", "getTypename", "some", "connector", "succeed", "AppNode", "makeCompanion", "linkedSegment", "label", "ns", "meta", "icon", "position", "actions", "matched", "object", "objectDXN", "getDXN", "toString", "atom", "ThreadCapabilities", "State", "AttentionCapabilities", "Selection", "disabled", "comments", "config", "getSelection", "Date", "now", "name", "getAnchorLabel", "Operation", "invoke", "ThreadOperation", "Create", "subject", "properties", "disposition", "testId", "contributes", "AppGraphBuilder"]
7
+ }
@@ -1,6 +1,6 @@
1
1
  import {
2
- AppendChannelMessage
3
- } from "./chunk-TPNZ43NB.mjs";
2
+ ThreadOperation_exports
3
+ } from "./chunk-PE7IH7EL.mjs";
4
4
  import "./chunk-J5LGTIGS.mjs";
5
5
 
6
6
  // src/operations/append-channel-message.ts
@@ -10,10 +10,10 @@ import { Operation } from "@dxos/compute";
10
10
  import { Database, Feed, Obj } from "@dxos/echo";
11
11
  import { createFeedServiceLayer } from "@dxos/echo-db";
12
12
  import { invariant } from "@dxos/invariant";
13
- import { ClientCapabilities } from "@dxos/plugin-client/types";
13
+ import { ClientCapabilities } from "@dxos/plugin-client";
14
14
  import { Message } from "@dxos/types";
15
15
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-thread/src/operations/append-channel-message.ts";
16
- var handler = AppendChannelMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ channel, sender, text }) {
16
+ var handler = ThreadOperation_exports.AppendChannelMessage.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ channel, sender, text }) {
17
17
  const db = Obj.getDatabase(channel);
18
18
  invariant(db, "Database not found", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 15, S: this, A: ["db", "'Database not found'"] });
19
19
  const client = yield* Capability.get(ClientCapabilities.Client);
@@ -37,4 +37,4 @@ var append_channel_message_default = handler;
37
37
  export {
38
38
  append_channel_message_default as default
39
39
  };
40
- //# sourceMappingURL=append-channel-message-CO3M6FSA.mjs.map
40
+ //# sourceMappingURL=append-channel-message-FTFAD3PK.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/append-channel-message.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Obj } from '@dxos/echo';\nimport { createFeedServiceLayer } from '@dxos/echo-db';\nimport { invariant } from '@dxos/invariant';\nimport { ClientCapabilities } from '@dxos/plugin-client';\nimport { Message } from '@dxos/types';\n\nimport { ThreadOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof ThreadOperation.AppendChannelMessage> =\n ThreadOperation.AppendChannelMessage.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ channel, sender, text }) {\n const db = Obj.getDatabase(channel);\n invariant(db, 'Database not found');\n const client = yield* Capability.get(ClientCapabilities.Client);\n const space = client.spaces.get(db.spaceId);\n invariant(space, 'Space not found');\n\n const feed = yield* Database.load(channel.feed);\n const message = Message.make({\n sender,\n blocks: [{ _tag: 'text', text }],\n });\n yield* Feed.append(feed, [message]).pipe(Effect.provide(createFeedServiceLayer(space.queues)));\n }),\n ),\n );\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,8BAA8B;AACvC,SAASC,iBAAiB;AAC1B,SAASC,0BAA0B;AACnC,SAASC,eAAe;AAIxB,IAAA,eACEC;IAIMC,UAAUC,wBAAI,qBAAA,KAAA,UAAA,YAAA,kBAAA,WAAA,EAAA,SAAA,QAAA,KAAA,GAAA;AACd,QAAMC,KAAAA,IAAS,YAAOC,OAAWC;AACjC,YAAMC,IAAQH,sBAAqBI,EAAAA,YAAO,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,MAAA,sBAAA,EAAA,CAAA;AAC1CN,QAAAA,SAAUK,OAAO,WAAA,IAAA,mBAAA,MAAA;AAEjB,QAAME,QAAO,OAAOC,OAAAA,IAASC,GAAKC,OAAQH;AAC1C,YAAMI,OAAUC,mBAAa,EAAA,YAAA,YAAA,GAAA,cAAA,GAAA,IAAA,GAAA,MAAA,GAAA,CAAA,SAAA,mBAAA,EAAA,CAAA;QAC3BC,OAAAA,OAAAA,SAAAA,KAAAA,QAAAA,IAAAA;QACAC,UAAQ,QAAA,KAAA;;YAAGC;;QAAmB,MAAA;QAAE;MAClC;IACA;;SAAwC,KAACC,OAAOC,MAAQC;IAC1D;EAIN,CAAA,EAAA,KAAeC,eAAQ,uBAAA,MAAA,MAAA,CAAA,CAAA;;;",
6
+ "names": ["Effect", "Capability", "Operation", "Database", "Feed", "Obj", "createFeedServiceLayer", "invariant", "ClientCapabilities", "Message", "ThreadOperation", "invariant", "db", "client", "Capability", "get", "space", "spaceId", "feed", "Database", "load", "channel", "message", "Message", "sender", "blocks", "_tag", "Effect", "provide", "createFeedServiceLayer", "handler"]
7
+ }
@@ -0,0 +1,15 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/blueprint-definition.ts
4
+ import * as Effect from "effect/Effect";
5
+ import { Capability } from "@dxos/app-framework";
6
+ import { AppCapabilities } from "@dxos/app-toolkit";
7
+ import { ThreadBlueprint } from "#blueprints";
8
+ var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
9
+ Capability.contributes(AppCapabilities.BlueprintDefinition, ThreadBlueprint)
10
+ ]));
11
+ var blueprint_definition_default = blueprintDefinition;
12
+ export {
13
+ blueprint_definition_default as default
14
+ };
15
+ //# sourceMappingURL=blueprint-definition-S3EBOH4R.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/blueprint-definition.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport type { Blueprint } from '@dxos/compute';\n\nimport { ThreadBlueprint } from '#blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, ThreadBlueprint)]));\n\nexport default blueprintDefinition;\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,SAASC,uBAAuB;AAEhC,IAAMC,sBAAsBH,WAAWI,WAGrC,MAAaC,eAAQ;EAACL,WAAWM,YAAYL,gBAAgBM,qBAAqBL,eAAAA;CAAiB,CAAA;AAErG,IAAA,+BAAeC;",
6
+ "names": ["Effect", "Capability", "AppCapabilities", "ThreadBlueprint", "blueprintDefinition", "makeModule", "succeed", "contributes", "BlueprintDefinition"]
7
+ }
@@ -0,0 +1,8 @@
1
+ import {
2
+ thread_blueprint_default
3
+ } from "../chunk-5T5LPLBN.mjs";
4
+ import "../chunk-J5LGTIGS.mjs";
5
+ export {
6
+ thread_blueprint_default as ThreadBlueprint
7
+ };
8
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,25 @@
1
+ import "../chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/index.ts
4
+ import { Capability } from "@dxos/app-framework";
5
+ var AppGraphBuilder = Capability.lazy("AppGraphBuilder", () => import("../app-graph-builder-7Q6MA6RT.mjs"));
6
+ var BlueprintDefinition = Capability.lazy("BlueprintDefinition", () => import("../blueprint-definition-S3EBOH4R.mjs"));
7
+ var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-HIEWSBZB.mjs"));
8
+ var Markdown = Capability.lazy("Markdown", () => import("../markdown-BUORNCPG.mjs"));
9
+ var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-RU6K2S4L.mjs"));
10
+ var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-XY23GVZH.mjs"));
11
+ var ThreadSettings = Capability.lazy("ThreadSettings", () => import("../settings-HK4EB6TF.mjs"));
12
+ var ThreadState = Capability.lazy("ThreadState", () => import("../state-UU7VEAKV.mjs"));
13
+ var UndoMappings = Capability.lazy("UndoMappings", () => import("../undo-mappings-HOKL2L3M.mjs"));
14
+ export {
15
+ AppGraphBuilder,
16
+ BlueprintDefinition,
17
+ CreateObject,
18
+ Markdown,
19
+ OperationHandler,
20
+ ReactSurface,
21
+ ThreadSettings,
22
+ ThreadState,
23
+ UndoMappings
24
+ };
25
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/capabilities/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport type { Blueprint, OperationHandlerSet } from '@dxos/compute';\n\nexport const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));\nexport const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const Markdown = Capability.lazy('Markdown', () => import('./markdown'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const ThreadSettings = Capability.lazy('ThreadSettings', () => import('./settings'));\nexport const ThreadState = Capability.lazy('ThreadState', () => import('./state'));\nexport const UndoMappings = Capability.lazy('UndoMappings', () => import('./undo-mappings'));\n"],
5
+ "mappings": ";;;AAIA,SAASA,kBAAkB;AAIpB,IAAMC,kBAAkBD,WAAWE,KAAK,mBAAmB,MAAM,OAAO,mCAAA,CAAA;AACxE,IAAMC,sBAAsBH,WAAWE,KAAK,uBAAuB,MAAM,OAAO,sCAAA,CAAA;AAChF,IAAME,eAAeJ,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMG,WAAWL,WAAWE,KAAK,YAAY,MAAM,OAAO,0BAAA,CAAA;AAC1D,IAAMI,mBAAmBN,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMK,eAAeP,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMM,iBAAiBR,WAAWE,KAAK,kBAAkB,MAAM,OAAO,0BAAA,CAAA;AACtE,IAAMO,cAAcT,WAAWE,KAAK,eAAe,MAAM,OAAO,uBAAA,CAAA;AAChE,IAAMQ,eAAeV,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
6
+ "names": ["Capability", "AppGraphBuilder", "lazy", "BlueprintDefinition", "CreateObject", "Markdown", "OperationHandler", "ReactSurface", "ThreadSettings", "ThreadState", "UndoMappings"]
7
+ }
@@ -1,9 +1,7 @@
1
- import "../chunk-J5LGTIGS.mjs";
2
-
3
1
  // src/blueprints/thread-blueprint.ts
4
2
  import { Blueprint, Template } from "@dxos/compute";
5
3
  import { trim } from "@dxos/util";
6
- import { ThreadOperation } from "#operations";
4
+ import { ThreadOperation } from "#types";
7
5
  var BLUEPRINT_KEY = "org.dxos.blueprint.thread";
8
6
  var make = () => Blueprint.make({
9
7
  key: BLUEPRINT_KEY,
@@ -31,7 +29,8 @@ var blueprint = {
31
29
  make
32
30
  };
33
31
  var thread_blueprint_default = blueprint;
32
+
34
33
  export {
35
- thread_blueprint_default as ThreadBlueprint
34
+ thread_blueprint_default
36
35
  };
37
- //# sourceMappingURL=index.mjs.map
36
+ //# sourceMappingURL=chunk-5T5LPLBN.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/blueprints/thread-blueprint.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/compute';\nimport { trim } from '@dxos/util';\n\nimport { ThreadOperation } from '#types';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.thread';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Thread',\n tools: Blueprint.toolDefinitions({ operations: [ThreadOperation.CreateProposals] }),\n instructions: Template.make({\n // TODO(wittjosiah): Move example to function input schema annotation.\n source: trim`\n You can update markdown documents via proposals.\n For each diff, respond with the smallest possible matching span.\n For example:\n - \"There is a tyop in this sentence.\"\n + \"There is a typo in this sentence.\"\n - \"This id goof.\"\n + \"This is good.\"\n `,\n }),\n });\n\nconst blueprint: Blueprint.Definition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
5
+ "mappings": ";AAIA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,uBAAuB;AAEhC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXL,UAAUK,KAAK;EACbC,KAAKF;EACLG,MAAM;EACNC,OAAOR,UAAUS,gBAAgB;IAAEC,YAAY;MAACP,gBAAgBQ;;EAAiB,CAAA;EACjFC,cAAcX,SAASI,KAAK;;IAE1BQ,QAAQX;;;;;;;;;EASV,CAAA;AACF,CAAA;AAEF,IAAMY,YAAkC;EACtCR,KAAKF;EACLC;AACF;AAEA,IAAA,2BAAeS;",
6
+ "names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "key", "name", "tools", "toolDefinitions", "operations", "CreateProposals", "instructions", "source", "blueprint"]
7
+ }
@@ -0,0 +1,20 @@
1
+ // src/meta.ts
2
+ import { trim } from "@dxos/util";
3
+ var meta = {
4
+ id: "org.dxos.plugin.thread",
5
+ name: "Threads",
6
+ description: trim`
7
+ Multi-modal communication platform supporting text chat, voice, and video conferencing.
8
+ Create threaded conversations and add contextual comments directly on any workspace object.
9
+ `,
10
+ icon: "ph--video-conference--regular",
11
+ iconHue: "rose",
12
+ source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread"
13
+ };
14
+ var THREAD_ITEM = `${meta.id}.item`;
15
+
16
+ export {
17
+ meta,
18
+ THREAD_ITEM
19
+ };
20
+ //# sourceMappingURL=chunk-7GHUS3IX.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.thread',\n name: 'Threads',\n description: trim`\n Multi-modal communication platform supporting text chat, voice, and video conferencing.\n Create threaded conversations and add contextual comments directly on any workspace object.\n `,\n icon: 'ph--video-conference--regular',\n iconHue: 'rose',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-thread',\n};\n\nexport const THREAD_ITEM = `${meta.id}.item`;\n"],
5
+ "mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;AACV;AAEO,IAAMC,cAAc,GAAGP,KAAKC,EAAE;",
6
+ "names": ["trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "THREAD_ITEM"]
7
+ }
@@ -0,0 +1,55 @@
1
+ // src/containers/ChannelChat/ChannelChat.tsx
2
+ import React from "react";
3
+ import { useOperationInvoker } from "@dxos/app-framework/ui";
4
+ import { Filter, Obj, Query } from "@dxos/echo";
5
+ import { useMembers, useQuery } from "@dxos/react-client/echo";
6
+ import { useIdentity } from "@dxos/react-client/halo";
7
+ import { Message } from "@dxos/types";
8
+ import { composable, composableProps } from "@dxos/ui-theme";
9
+ import { Chat } from "#components";
10
+ import { useStatus } from "#hooks";
11
+ import { ThreadOperation } from "#types";
12
+ var ChannelChat = composable(({ space, channel, ...props }, forwardedRef) => {
13
+ const identity = useIdentity();
14
+ const members = useMembers(space.id);
15
+ const id = Obj.getDXN(channel).toString();
16
+ const activity = useStatus(space, id);
17
+ const { invokePromise } = useOperationInvoker();
18
+ const feed = channel.feed?.target;
19
+ const messages = useQuery(space.db, feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()));
20
+ const readOnly = Obj.getMeta(channel).keys.length > 0;
21
+ const handleSend = (text) => {
22
+ if (readOnly) {
23
+ return false;
24
+ }
25
+ void invokePromise(ThreadOperation.AppendChannelMessage, {
26
+ channel,
27
+ sender: {
28
+ identityDid: identity.did
29
+ },
30
+ text
31
+ });
32
+ return true;
33
+ };
34
+ return /* @__PURE__ */ React.createElement(Chat, {
35
+ ...composableProps(props),
36
+ id,
37
+ identity,
38
+ members,
39
+ messages,
40
+ activity,
41
+ onSend: handleSend,
42
+ orientation: "bottom",
43
+ readOnly,
44
+ ref: forwardedRef
45
+ });
46
+ });
47
+
48
+ // src/containers/ChannelChat/index.ts
49
+ var ChannelChat_default = ChannelChat;
50
+
51
+ export {
52
+ ChannelChat,
53
+ ChannelChat_default
54
+ };
55
+ //# sourceMappingURL=chunk-D5LGFCUY.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/containers/ChannelChat/ChannelChat.tsx", "../../../src/containers/ChannelChat/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { Filter, Obj, Query } from '@dxos/echo';\nimport { type Space, useMembers, useQuery } from '@dxos/react-client/echo';\nimport { useIdentity } from '@dxos/react-client/halo';\nimport { type Channel, Message } from '@dxos/types';\nimport { composable, composableProps } from '@dxos/ui-theme';\n\nimport { Chat } from '#components';\nimport { useStatus } from '#hooks';\nimport { ThreadOperation } from '#types';\n\nexport type ChannelChatProps = {\n space: Space;\n channel: Channel.Channel;\n};\n\n/**\n * Channel chat: composer pinned to the bottom of the panel, messages scrolling\n * above it (newest at the bottom). Threading via `Message.threadId` is\n * intentionally not reconstructed in this round.\n *\n * Externally-synced channels (any Channel carrying foreign-key `Obj.Meta`,\n * e.g. Slack/Discord-sourced rooms) render read-only — the composer is\n * suppressed because there's no local-write path back to the source.\n */\nexport const ChannelChat = composable<HTMLDivElement, ChannelChatProps>(\n ({ space, channel, ...props }, forwardedRef) => {\n const identity = useIdentity()!;\n const members = useMembers(space.id);\n const id = Obj.getDXN(channel).toString();\n const activity = useStatus(space, id);\n const { invokePromise } = useOperationInvoker();\n\n const feed = channel.feed?.target;\n const messages = useQuery(\n space.db,\n feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),\n );\n\n const readOnly = Obj.getMeta(channel).keys.length > 0;\n\n const handleSend = (text: string) => {\n if (readOnly) {\n return false;\n }\n void invokePromise(ThreadOperation.AppendChannelMessage, {\n channel,\n sender: { identityDid: identity.did },\n text,\n });\n return true;\n };\n\n return (\n <Chat\n {...composableProps(props)}\n id={id}\n identity={identity}\n members={members}\n messages={messages}\n activity={activity}\n onSend={handleSend}\n orientation='bottom'\n readOnly={readOnly}\n ref={forwardedRef}\n />\n );\n },\n);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { ChannelChat } from './ChannelChat';\n\nexport { ChannelChat };\nexport default ChannelChat;\n"],
5
+ "mappings": ";AAIA,OAAOA,WAAW;AAElB,SAASC,2BAA2B;AACpC,SAASC,QAAQC,KAAKC,aAAa;AACnC,SAAqBC,YAAYC,gBAAgB;AACjD,SAASC,mBAAmB;AAC5B,SAAuBC,eAAe;AACtC,SAASC,YAAYC,uBAAuB;AAE5C,SAASC,YAAY;AACrB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB;AAgBzB,IAAMC,cAAcL,WACzB,CAAC,EAAEM,OAAOC,SAAS,GAAGC,MAAAA,GAASC,iBAAAA;AAC7B,QAAMC,WAAWZ,YAAAA;AACjB,QAAMa,UAAUf,WAAWU,MAAMM,EAAE;AACnC,QAAMA,KAAKlB,IAAImB,OAAON,OAAAA,EAASO,SAAQ;AACvC,QAAMC,WAAWZ,UAAUG,OAAOM,EAAAA;AAClC,QAAM,EAAEI,cAAa,IAAKxB,oBAAAA;AAE1B,QAAMyB,OAAOV,QAAQU,MAAMC;AAC3B,QAAMC,WAAWtB,SACfS,MAAMc,IACNH,OAAOtB,MAAM0B,OAAO5B,OAAO6B,KAAKvB,QAAQA,OAAO,CAAA,EAAGwB,KAAKN,IAAAA,IAAQtB,MAAM0B,OAAO5B,OAAO+B,QAAO,CAAA,CAAA;AAG5F,QAAMC,WAAW/B,IAAIgC,QAAQnB,OAAAA,EAASoB,KAAKC,SAAS;AAEpD,QAAMC,aAAa,CAACC,SAAAA;AAClB,QAAIL,UAAU;AACZ,aAAO;IACT;AACA,SAAKT,cAAcZ,gBAAgB2B,sBAAsB;MACvDxB;MACAyB,QAAQ;QAAEC,aAAavB,SAASwB;MAAI;MACpCJ;IACF,CAAA;AACA,WAAO;EACT;AAEA,SACE,sBAAA,cAAC5B,MAAAA;IACE,GAAGD,gBAAgBO,KAAAA;IACpBI;IACAF;IACAC;IACAQ;IACAJ;IACAoB,QAAQN;IACRO,aAAY;IACZX;IACAY,KAAK5B;;AAGX,CAAA;;;AClEF,IAAA,sBAAe6B;",
6
+ "names": ["React", "useOperationInvoker", "Filter", "Obj", "Query", "useMembers", "useQuery", "useIdentity", "Message", "composable", "composableProps", "Chat", "useStatus", "ThreadOperation", "ChannelChat", "space", "channel", "props", "forwardedRef", "identity", "members", "id", "getDXN", "toString", "activity", "invokePromise", "feed", "target", "messages", "db", "select", "type", "from", "nothing", "readOnly", "getMeta", "keys", "length", "handleSend", "text", "AppendChannelMessage", "sender", "identityDid", "did", "onSend", "orientation", "ref", "ChannelChat"]
7
+ }
@@ -0,0 +1,38 @@
1
+ // src/util.ts
2
+ import * as Match from "effect/Match";
3
+ import { generateName } from "@dxos/display-name";
4
+ import { hexToFallback, toFallback } from "@dxos/util";
5
+ var hashString = (s) => {
6
+ let h = 0;
7
+ for (let i = 0; i < s.length; i++) {
8
+ h = h * 31 + s.charCodeAt(i) | 0;
9
+ }
10
+ return h >>> 0;
11
+ };
12
+ var getMessageMetadata = (id, identity, fallbackSender) => {
13
+ const fallback = identity?.identityKey ? hexToFallback(identity.identityKey.toHex()) : toFallback(hashString(fallbackSender?.name ?? fallbackSender?.email ?? "0"));
14
+ return {
15
+ id,
16
+ authorId: identity?.did,
17
+ authorName: identity?.profile?.displayName ?? (identity?.identityKey ? generateName(identity.identityKey.toHex()) : void 0) ?? fallbackSender?.name ?? fallbackSender?.email,
18
+ authorAvatarProps: {
19
+ hue: identity?.profile?.data?.hue ?? fallback.hue,
20
+ emoji: identity?.profile?.data?.emoji ?? fallback.emoji
21
+ }
22
+ };
23
+ };
24
+ var getAnchor = Match.type().pipe(Match.when({
25
+ mode: "single"
26
+ }, (s) => s.id), Match.when({
27
+ mode: "multi"
28
+ }, (s) => s.ids.length > 0 ? s.ids.join(",") : void 0), Match.when({
29
+ mode: "range"
30
+ }, (s) => s.from && s.to ? `${s.from}:${s.to}` : void 0), Match.when({
31
+ mode: "multi-range"
32
+ }, (s) => s.ranges[0] && `${s.ranges[0].from}:${s.ranges[0].to}`), Match.when(void 0, () => void 0), Match.exhaustive);
33
+
34
+ export {
35
+ getMessageMetadata,
36
+ getAnchor
37
+ };
38
+ //# sourceMappingURL=chunk-JLY4NVTA.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/util.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport * as Match from 'effect/Match';\n\nimport { generateName } from '@dxos/display-name';\nimport { type PublicKey } from '@dxos/react-client';\nimport { type Identity } from '@dxos/react-client/halo';\nimport { type Selection } from '@dxos/react-ui-attention';\nimport { type MessageMetadata } from '@dxos/react-ui-thread';\nimport { hexToFallback, toFallback } from '@dxos/util';\n\nexport type MessagePropertiesProvider = (identityKey: PublicKey | undefined) => MessageMetadata;\n\n/**\n * Stable hash for an arbitrary string — used as the avatar-fallback seed for\n * external senders who have no DXOS identity (e.g. Slack/Discord-synced\n * messages). djb2-ish, only stability matters.\n *\n * Coerced to unsigned 32-bit via `>>> 0` because `toFallback` does a plain\n * modulo against `idEmoji.length * idHue.length` and JavaScript's `%`\n * preserves the sign of the dividend — a negative hash would index\n * `idEmoji[-x]` and `idHue[-x]` to `undefined`, causing the avatar to fall\n * through to `Avatar.Content`'s default red/ghost.\n */\nconst hashString = (s: string): number => {\n let h = 0;\n for (let i = 0; i < s.length; i++) {\n h = (h * 31 + s.charCodeAt(i)) | 0;\n }\n return h >>> 0;\n};\n\nexport const getMessageMetadata = (\n id: string,\n identity?: Identity,\n /**\n * Externally-sourced sender info (Slack/Discord/etc). Used only when no\n * matching DXOS `identity` is available — provides `name`/`email` for the\n * author label and a stable seed for the avatar fallback.\n */\n fallbackSender?: { name?: string; email?: string },\n): MessageMetadata => {\n const fallback = identity?.identityKey\n ? hexToFallback(identity.identityKey.toHex())\n : toFallback(hashString(fallbackSender?.name ?? fallbackSender?.email ?? '0'));\n return {\n id,\n authorId: identity?.did,\n authorName:\n identity?.profile?.displayName ??\n (identity?.identityKey ? generateName(identity.identityKey.toHex()) : undefined) ??\n fallbackSender?.name ??\n fallbackSender?.email,\n authorAvatarProps: {\n hue: identity?.profile?.data?.hue ?? fallback.hue,\n emoji: identity?.profile?.data?.emoji ?? fallback.emoji,\n },\n };\n};\n\nexport const getAnchor = Match.type<Selection | undefined>().pipe(\n Match.when({ mode: 'single' }, (s) => s.id),\n Match.when({ mode: 'multi' }, (s) => (s.ids.length > 0 ? s.ids.join(',') : undefined)),\n Match.when({ mode: 'range' }, (s) => (s.from && s.to ? `${s.from}:${s.to}` : undefined)),\n Match.when({ mode: 'multi-range' }, (s) => s.ranges[0] && `${s.ranges[0].from}:${s.ranges[0].to}`),\n Match.when(undefined, () => undefined),\n Match.exhaustive,\n);\n"],
5
+ "mappings": ";AAIA,YAAYA,WAAW;AAEvB,SAASC,oBAAoB;AAK7B,SAASC,eAAeC,kBAAkB;AAe1C,IAAMC,aAAa,CAACC,MAAAA;AAClB,MAAIC,IAAI;AACR,WAASC,IAAI,GAAGA,IAAIF,EAAEG,QAAQD,KAAK;AACjCD,QAAKA,IAAI,KAAKD,EAAEI,WAAWF,CAAAA,IAAM;EACnC;AACA,SAAOD,MAAM;AACf;AAEO,IAAMI,qBAAqB,CAChCC,IACAC,UAMAC,mBAAAA;AAEA,QAAMC,WAAWF,UAAUG,cACvBb,cAAcU,SAASG,YAAYC,MAAK,CAAA,IACxCb,WAAWC,WAAWS,gBAAgBI,QAAQJ,gBAAgBK,SAAS,GAAA,CAAA;AAC3E,SAAO;IACLP;IACAQ,UAAUP,UAAUQ;IACpBC,YACET,UAAUU,SAASC,gBAClBX,UAAUG,cAAcd,aAAaW,SAASG,YAAYC,MAAK,CAAA,IAAMQ,WACtEX,gBAAgBI,QAChBJ,gBAAgBK;IAClBO,mBAAmB;MACjBC,KAAKd,UAAUU,SAASK,MAAMD,OAAOZ,SAASY;MAC9CE,OAAOhB,UAAUU,SAASK,MAAMC,SAASd,SAASc;IACpD;EACF;AACF;AAEO,IAAMC,YAAkBC,WAAI,EAA0BC,KACrDC,WAAK;EAAEC,MAAM;AAAS,GAAG,CAAC5B,MAAMA,EAAEM,EAAE,GACpCqB,WAAK;EAAEC,MAAM;AAAQ,GAAG,CAAC5B,MAAOA,EAAE6B,IAAI1B,SAAS,IAAIH,EAAE6B,IAAIC,KAAK,GAAA,IAAOX,MAAAA,GACrEQ,WAAK;EAAEC,MAAM;AAAQ,GAAG,CAAC5B,MAAOA,EAAE+B,QAAQ/B,EAAEgC,KAAK,GAAGhC,EAAE+B,IAAI,IAAI/B,EAAEgC,EAAE,KAAKb,MAAAA,GACvEQ,WAAK;EAAEC,MAAM;AAAc,GAAG,CAAC5B,MAAMA,EAAEiC,OAAO,CAAA,KAAM,GAAGjC,EAAEiC,OAAO,CAAA,EAAGF,IAAI,IAAI/B,EAAEiC,OAAO,CAAA,EAAGD,EAAE,EAAE,GAC3FL,WAAKR,QAAW,MAAMA,MAAAA,GACtBe,gBAAU;",
6
+ "names": ["Match", "generateName", "hexToFallback", "toFallback", "hashString", "s", "h", "i", "length", "charCodeAt", "getMessageMetadata", "id", "identity", "fallbackSender", "fallback", "identityKey", "toHex", "name", "email", "authorId", "did", "authorName", "profile", "displayName", "undefined", "authorAvatarProps", "hue", "data", "emoji", "getAnchor", "type", "pipe", "when", "mode", "ids", "join", "from", "to", "ranges", "exhaustive"]
7
+ }