@dxos/plugin-thread 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393

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 (397) hide show
  1. package/dist/lib/neutral/CallDebugPanel-CXWTCS7A.mjs +172 -0
  2. package/dist/lib/neutral/CallDebugPanel-CXWTCS7A.mjs.map +7 -0
  3. package/dist/lib/neutral/CallSidebar-4USJZ2SB.mjs +25 -0
  4. package/dist/lib/neutral/CallSidebar-4USJZ2SB.mjs.map +7 -0
  5. package/dist/lib/neutral/ChannelChat-6YTD5HWL.mjs +10 -0
  6. package/dist/lib/neutral/ChannelContainer-XHBF2NCK.mjs +9 -0
  7. package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs +208 -0
  8. package/dist/lib/neutral/ThreadCompanion-NQWPS2H6.mjs.map +7 -0
  9. package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs +61 -0
  10. package/dist/lib/neutral/ThreadContainer-XYEPEOSD.mjs.map +7 -0
  11. package/dist/lib/neutral/ThreadPlugin.mjs +89 -0
  12. package/dist/lib/neutral/ThreadPlugin.mjs.map +7 -0
  13. package/dist/lib/neutral/ThreadPlugin.node.mjs +40 -0
  14. package/dist/lib/neutral/ThreadPlugin.node.mjs.map +7 -0
  15. package/dist/lib/neutral/ThreadSettings-5Z5XIHG3.mjs +15 -0
  16. package/dist/lib/neutral/ThreadSettings-5Z5XIHG3.mjs.map +7 -0
  17. package/dist/lib/{browser/add-message-VPPFFLFL.mjs → neutral/add-message-HV5R66K4.mjs} +12 -22
  18. package/dist/lib/neutral/add-message-HV5R66K4.mjs.map +7 -0
  19. package/dist/lib/neutral/app-graph-builder-JDLHZ4XO.mjs +173 -0
  20. package/dist/lib/neutral/app-graph-builder-JDLHZ4XO.mjs.map +7 -0
  21. package/dist/lib/neutral/append-channel-message-PO33DR5V.mjs +40 -0
  22. package/dist/lib/neutral/append-channel-message-PO33DR5V.mjs.map +7 -0
  23. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs +15 -0
  24. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
  25. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  26. package/dist/lib/neutral/call-manager-JFA4DLWR.mjs +24 -0
  27. package/dist/lib/neutral/call-manager-JFA4DLWR.mjs.map +7 -0
  28. package/dist/lib/neutral/capabilities/index.mjs +29 -0
  29. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-44D7D4ZX.mjs +20 -0
  31. package/dist/lib/neutral/chunk-44D7D4ZX.mjs.map +7 -0
  32. package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-5T5LPLBN.mjs} +5 -6
  33. package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-CROE4U4O.mjs +100 -0
  35. package/dist/lib/neutral/chunk-CROE4U4O.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-D5LGFCUY.mjs +55 -0
  37. package/dist/lib/neutral/chunk-D5LGFCUY.mjs.map +7 -0
  38. package/dist/lib/neutral/chunk-FWSMZWBO.mjs +178 -0
  39. package/dist/lib/neutral/chunk-FWSMZWBO.mjs.map +7 -0
  40. package/dist/lib/neutral/chunk-JLY4NVTA.mjs +38 -0
  41. package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
  42. package/dist/lib/neutral/chunk-KRXHIW4P.mjs +164 -0
  43. package/dist/lib/neutral/chunk-KRXHIW4P.mjs.map +7 -0
  44. package/dist/lib/neutral/chunk-MXJYXUS2.mjs +8 -0
  45. package/dist/lib/neutral/chunk-MXJYXUS2.mjs.map +7 -0
  46. package/dist/lib/{browser/chunk-VPM44Z35.mjs → neutral/chunk-OZRSYMYO.mjs} +101 -85
  47. package/dist/lib/neutral/chunk-OZRSYMYO.mjs.map +7 -0
  48. package/dist/lib/{browser/index.mjs → neutral/chunk-PZ7WTAA2.mjs} +88 -900
  49. package/dist/lib/neutral/chunk-PZ7WTAA2.mjs.map +7 -0
  50. package/dist/lib/neutral/chunk-S2AKEA2K.mjs +202 -0
  51. package/dist/lib/neutral/chunk-S2AKEA2K.mjs.map +7 -0
  52. package/dist/lib/neutral/components/index.mjs +1230 -0
  53. package/dist/lib/neutral/components/index.mjs.map +7 -0
  54. package/dist/lib/neutral/containers/index.mjs +19 -0
  55. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  56. package/dist/lib/{browser/create-UGT7V733.mjs → neutral/create-C3CICN35.mjs} +8 -11
  57. package/dist/lib/neutral/create-C3CICN35.mjs.map +7 -0
  58. package/dist/lib/neutral/create-channel-UEQESOFT.mjs +19 -0
  59. package/dist/lib/neutral/create-channel-UEQESOFT.mjs.map +7 -0
  60. package/dist/lib/neutral/create-object-HIEWSBZB.mjs +27 -0
  61. package/dist/lib/neutral/create-object-HIEWSBZB.mjs.map +7 -0
  62. package/dist/lib/{browser/create-proposals-CMK7S7VS.mjs → neutral/create-proposals-OZ4NCBBS.mjs} +5 -6
  63. package/dist/lib/neutral/create-proposals-OZ4NCBBS.mjs.map +7 -0
  64. package/dist/lib/{browser/delete-FSFVU6ZA.mjs → neutral/delete-AVFYFWMY.mjs} +8 -10
  65. package/dist/lib/neutral/delete-AVFYFWMY.mjs.map +7 -0
  66. package/dist/lib/{browser/delete-message-XL5M5J33.mjs → neutral/delete-message-EV2MKRTB.mjs} +9 -19
  67. package/dist/lib/neutral/delete-message-EV2MKRTB.mjs.map +7 -0
  68. package/dist/lib/neutral/hooks/index.mjs +19 -0
  69. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  70. package/dist/lib/neutral/index.mjs +68 -0
  71. package/dist/lib/neutral/index.mjs.map +7 -0
  72. package/dist/lib/neutral/markdown-BUORNCPG.mjs +83 -0
  73. package/dist/lib/neutral/markdown-BUORNCPG.mjs.map +7 -0
  74. package/dist/lib/neutral/meta.json +1 -0
  75. package/dist/lib/neutral/meta.mjs +10 -0
  76. package/dist/lib/neutral/meta.mjs.map +7 -0
  77. package/dist/lib/neutral/on-create-space-NQF7WGEB.mjs +23 -0
  78. package/dist/lib/neutral/on-create-space-NQF7WGEB.mjs.map +7 -0
  79. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
  80. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
  81. package/dist/lib/neutral/operations/index.mjs +8 -0
  82. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  83. package/dist/lib/neutral/plugin.mjs +16 -0
  84. package/dist/lib/neutral/plugin.mjs.map +7 -0
  85. package/dist/lib/neutral/react-root-VMMNUSSL.mjs +18 -0
  86. package/dist/lib/neutral/react-root-VMMNUSSL.mjs.map +7 -0
  87. package/dist/lib/neutral/react-surface-WPSVOTVG.mjs +94 -0
  88. package/dist/lib/neutral/react-surface-WPSVOTVG.mjs.map +7 -0
  89. package/dist/lib/{browser/restore-2ZGMKUSD.mjs → neutral/restore-MGLYOJ3Y.mjs} +6 -7
  90. package/dist/lib/neutral/restore-MGLYOJ3Y.mjs.map +7 -0
  91. package/dist/lib/{browser/restore-message-OYEGWPII.mjs → neutral/restore-message-ZIOA2MQJ.mjs} +8 -17
  92. package/dist/lib/neutral/restore-message-ZIOA2MQJ.mjs.map +7 -0
  93. package/dist/lib/{browser/select-VG2XLULE.mjs → neutral/select-CVCGBDHA.mjs} +7 -9
  94. package/dist/lib/neutral/select-CVCGBDHA.mjs.map +7 -0
  95. package/dist/lib/neutral/settings-HK4EB6TF.mjs +30 -0
  96. package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
  97. package/dist/lib/neutral/state-UU7VEAKV.mjs +22 -0
  98. package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
  99. package/dist/lib/neutral/testing/index.mjs +58 -0
  100. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  101. package/dist/lib/{browser/toggle-resolved-MM6YC5BU.mjs → neutral/toggle-resolved-ZM4BHON5.mjs} +8 -17
  102. package/dist/lib/neutral/toggle-resolved-ZM4BHON5.mjs.map +7 -0
  103. package/dist/lib/neutral/translations.mjs +90 -0
  104. package/dist/lib/neutral/translations.mjs.map +7 -0
  105. package/dist/lib/neutral/types/index.mjs +12 -0
  106. package/dist/lib/neutral/types/index.mjs.map +7 -0
  107. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
  108. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
  109. package/dist/types/src/ThreadPlugin.d.ts +1 -0
  110. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  111. package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
  112. package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
  113. package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
  114. package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
  115. package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
  116. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
  117. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  118. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  119. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  120. package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
  121. package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
  122. package/dist/types/src/calls/types.d.ts.map +1 -1
  123. package/dist/types/src/calls/util/audio.d.ts.map +1 -1
  124. package/dist/types/src/calls/util/calls-service.d.ts +2 -2
  125. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  126. package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
  127. package/dist/types/src/calls/util/media.d.ts.map +1 -1
  128. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  129. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  130. package/dist/types/src/calls-service.stories.d.ts.map +1 -1
  131. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  132. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  133. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  134. package/dist/types/src/capabilities/call-manager.d.ts.map +1 -1
  135. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  136. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/index.d.ts +9 -3
  138. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  139. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  140. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  141. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  142. package/dist/types/src/capabilities/react-root.d.ts.map +1 -1
  143. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  144. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  145. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  146. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -1
  147. package/dist/types/src/components/Call/Call.d.ts +32 -4
  148. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  149. package/dist/types/src/components/Call/Toolbar.d.ts +5 -5
  150. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  151. package/dist/types/src/components/Chat/Chat.d.ts +51 -0
  152. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
  153. package/dist/types/src/components/Chat/index.d.ts +2 -0
  154. package/dist/types/src/components/Chat/index.d.ts.map +1 -0
  155. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -1
  156. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +70 -70
  157. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -1
  158. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -1
  159. package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
  160. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  161. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  162. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  163. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  164. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -1
  165. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  166. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
  167. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +70 -70
  168. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  169. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  170. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -1
  171. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +70 -70
  172. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -1
  173. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -1
  174. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +70 -70
  175. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -1
  176. package/dist/types/src/components/index.d.ts +1 -0
  177. package/dist/types/src/components/index.d.ts.map +1 -1
  178. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -1
  179. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
  180. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
  181. package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
  182. package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
  183. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +1 -1
  184. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
  185. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +70 -70
  186. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
  187. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
  188. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
  189. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
  190. package/dist/types/src/containers/{ChatContainer/ChatContainer.stories.d.ts → ThreadContainer/ThreadContainer.stories.d.ts} +71 -71
  191. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
  192. package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
  193. package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
  194. package/dist/types/src/containers/index.d.ts +2 -1
  195. package/dist/types/src/containers/index.d.ts.map +1 -1
  196. package/dist/types/src/extensions/threads.d.ts +3 -3
  197. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  198. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  199. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  200. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
  201. package/dist/types/src/index.d.ts +2 -2
  202. package/dist/types/src/index.d.ts.map +1 -1
  203. package/dist/types/src/operations/add-message.d.ts +3 -3
  204. package/dist/types/src/operations/add-message.d.ts.map +1 -1
  205. package/dist/types/src/operations/append-channel-message.d.ts +5 -0
  206. package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
  207. package/dist/types/src/operations/create-channel.d.ts +3 -3
  208. package/dist/types/src/operations/create-channel.d.ts.map +1 -1
  209. package/dist/types/src/operations/create-proposals.d.ts +3 -3
  210. package/dist/types/src/operations/create-proposals.d.ts.map +1 -1
  211. package/dist/types/src/operations/create.d.ts +3 -3
  212. package/dist/types/src/operations/create.d.ts.map +1 -1
  213. package/dist/types/src/operations/delete-message.d.ts +3 -3
  214. package/dist/types/src/operations/delete-message.d.ts.map +1 -1
  215. package/dist/types/src/operations/delete.d.ts +3 -3
  216. package/dist/types/src/operations/delete.d.ts.map +1 -1
  217. package/dist/types/src/operations/index.d.ts +1 -2
  218. package/dist/types/src/operations/index.d.ts.map +1 -1
  219. package/dist/types/src/operations/on-create-space.d.ts +3 -3
  220. package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
  221. package/dist/types/src/operations/restore-message.d.ts +3 -3
  222. package/dist/types/src/operations/restore-message.d.ts.map +1 -1
  223. package/dist/types/src/operations/restore.d.ts +3 -3
  224. package/dist/types/src/operations/restore.d.ts.map +1 -1
  225. package/dist/types/src/operations/select.d.ts +3 -3
  226. package/dist/types/src/operations/select.d.ts.map +1 -1
  227. package/dist/types/src/operations/toggle-resolved.d.ts +3 -3
  228. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -1
  229. package/dist/types/src/plugin.d.ts +4 -0
  230. package/dist/types/src/plugin.d.ts.map +1 -0
  231. package/dist/types/src/testing/data.d.ts.map +1 -1
  232. package/dist/types/src/testing/index.d.ts +1 -1
  233. package/dist/types/src/testing/index.d.ts.map +1 -1
  234. package/dist/types/src/translations.d.ts +70 -70
  235. package/dist/types/src/translations.d.ts.map +1 -1
  236. package/dist/types/src/types/ThreadCapabilities.d.ts +26 -0
  237. package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
  238. package/dist/types/src/{operations/definitions.d.ts → types/ThreadOperation.d.ts} +864 -1673
  239. package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
  240. package/dist/types/src/types/index.d.ts +3 -2
  241. package/dist/types/src/types/index.d.ts.map +1 -1
  242. package/dist/types/src/types/types.d.ts +1 -1
  243. package/dist/types/src/types/types.d.ts.map +1 -1
  244. package/dist/types/src/util.d.ts +6 -3
  245. package/dist/types/src/util.d.ts.map +1 -1
  246. package/dist/types/tsconfig.tsbuildinfo +1 -1
  247. package/package.json +124 -86
  248. package/src/ThreadPlugin.node.ts +39 -0
  249. package/src/ThreadPlugin.test.ts +37 -0
  250. package/src/ThreadPlugin.tsx +13 -57
  251. package/src/blueprints/thread-blueprint.ts +3 -4
  252. package/src/calls/util/calls-service.ts +3 -1
  253. package/src/calls/util/stub-media-streams.ts +3 -1
  254. package/src/capabilities/app-graph-builder.ts +21 -19
  255. package/src/capabilities/blueprint-definition.ts +2 -0
  256. package/src/capabilities/call-manager.ts +1 -1
  257. package/src/capabilities/create-object.ts +29 -0
  258. package/src/capabilities/index.ts +3 -1
  259. package/src/capabilities/markdown.ts +6 -2
  260. package/src/capabilities/operation-handler.ts +1 -1
  261. package/src/capabilities/react-surface.tsx +13 -7
  262. package/src/capabilities/settings.ts +1 -3
  263. package/src/capabilities/undo-mappings.ts +1 -1
  264. package/src/components/Call/Call.tsx +5 -5
  265. package/src/components/Call/Toolbar.tsx +1 -1
  266. package/src/components/Chat/Chat.tsx +258 -0
  267. package/src/components/Chat/index.ts +5 -0
  268. package/src/components/CommentsPanel/CommentsPanel.stories.tsx +6 -4
  269. package/src/components/CommentsPanel/CommentsPanel.tsx +4 -4
  270. package/src/components/CommentsPanel/CommentsThread.tsx +2 -3
  271. package/src/components/Lobby/Lobby.tsx +5 -4
  272. package/src/components/MessagePanel/MessagePanel.tsx +8 -9
  273. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +2 -1
  274. package/src/components/ResponsiveGrid/ResponsivePanel.stories.tsx +2 -1
  275. package/src/components/ResponsiveGrid/ResponsivePanel.tsx +3 -5
  276. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +2 -1
  277. package/src/components/index.ts +1 -0
  278. package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
  279. package/src/containers/ChannelChat/index.ts +8 -0
  280. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +54 -10
  281. package/src/containers/ChannelContainer/ChannelContainer.tsx +4 -4
  282. package/src/containers/ThreadCompanion/ThreadCompanion.tsx +10 -12
  283. package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +10 -11
  284. package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
  285. package/src/containers/ThreadContainer/index.ts +8 -0
  286. package/src/containers/index.ts +2 -1
  287. package/src/extensions/command.ts +1 -1
  288. package/src/extensions/threads.ts +9 -9
  289. package/src/hooks/analytics.ts +1 -1
  290. package/src/index.ts +4 -3
  291. package/src/operations/add-message.ts +7 -7
  292. package/src/operations/append-channel-message.ts +37 -0
  293. package/src/operations/create-channel.ts +4 -4
  294. package/src/operations/create-proposals.ts +3 -3
  295. package/src/operations/create.ts +4 -4
  296. package/src/operations/delete-message.ts +6 -6
  297. package/src/operations/delete.ts +4 -4
  298. package/src/operations/index.ts +2 -4
  299. package/src/operations/on-create-space.ts +4 -4
  300. package/src/operations/restore-message.ts +5 -5
  301. package/src/operations/restore.ts +4 -4
  302. package/src/operations/select.ts +3 -3
  303. package/src/operations/toggle-resolved.ts +5 -5
  304. package/src/plugin.ts +11 -0
  305. package/src/testing/index.ts +1 -1
  306. package/src/translations.ts +1 -1
  307. package/src/types/ThreadCapabilities.ts +41 -0
  308. package/src/{operations/definitions.ts → types/ThreadOperation.ts} +14 -13
  309. package/src/types/index.ts +4 -2
  310. package/src/types/types.ts +0 -2
  311. package/src/util.ts +36 -4
  312. package/dist/lib/browser/add-message-VPPFFLFL.mjs.map +0 -7
  313. package/dist/lib/browser/blueprints/index.mjs.map +0 -7
  314. package/dist/lib/browser/chunk-MESW3R4Q.mjs +0 -61
  315. package/dist/lib/browser/chunk-MESW3R4Q.mjs.map +0 -7
  316. package/dist/lib/browser/chunk-VPM44Z35.mjs.map +0 -7
  317. package/dist/lib/browser/create-UGT7V733.mjs.map +0 -7
  318. package/dist/lib/browser/create-channel-EF67LCS6.mjs +0 -21
  319. package/dist/lib/browser/create-channel-EF67LCS6.mjs.map +0 -7
  320. package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs +0 -28
  321. package/dist/lib/browser/create-channel-thread-CCZTSWQ6.mjs.map +0 -7
  322. package/dist/lib/browser/create-proposals-CMK7S7VS.mjs.map +0 -7
  323. package/dist/lib/browser/delete-FSFVU6ZA.mjs.map +0 -7
  324. package/dist/lib/browser/delete-message-XL5M5J33.mjs.map +0 -7
  325. package/dist/lib/browser/index.mjs.map +0 -7
  326. package/dist/lib/browser/meta.json +0 -1
  327. package/dist/lib/browser/on-create-space-VYS2JGVT.mjs +0 -25
  328. package/dist/lib/browser/on-create-space-VYS2JGVT.mjs.map +0 -7
  329. package/dist/lib/browser/operations/index.mjs +0 -14
  330. package/dist/lib/browser/operations/index.mjs.map +0 -7
  331. package/dist/lib/browser/restore-2ZGMKUSD.mjs.map +0 -7
  332. package/dist/lib/browser/restore-message-OYEGWPII.mjs.map +0 -7
  333. package/dist/lib/browser/select-VG2XLULE.mjs.map +0 -7
  334. package/dist/lib/browser/toggle-resolved-MM6YC5BU.mjs.map +0 -7
  335. package/dist/lib/browser/types/index.mjs +0 -12
  336. package/dist/lib/node-esm/add-message-XWKHLNS6.mjs +0 -98
  337. package/dist/lib/node-esm/add-message-XWKHLNS6.mjs.map +0 -7
  338. package/dist/lib/node-esm/blueprints/index.mjs +0 -38
  339. package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
  340. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  341. package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs +0 -260
  342. package/dist/lib/node-esm/chunk-JTHXNWKJ.mjs.map +0 -7
  343. package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs +0 -62
  344. package/dist/lib/node-esm/chunk-SDRAQNSQ.mjs.map +0 -7
  345. package/dist/lib/node-esm/create-XAYNDVU2.mjs +0 -56
  346. package/dist/lib/node-esm/create-XAYNDVU2.mjs.map +0 -7
  347. package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs +0 -22
  348. package/dist/lib/node-esm/create-channel-UYWUNB3L.mjs.map +0 -7
  349. package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs +0 -29
  350. package/dist/lib/node-esm/create-channel-thread-UQF2SBHS.mjs.map +0 -7
  351. package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs +0 -58
  352. package/dist/lib/node-esm/create-proposals-5FJNURKH.mjs.map +0 -7
  353. package/dist/lib/node-esm/delete-WRODXR3E.mjs +0 -60
  354. package/dist/lib/node-esm/delete-WRODXR3E.mjs.map +0 -7
  355. package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs +0 -65
  356. package/dist/lib/node-esm/delete-message-TAHCYTW2.mjs.map +0 -7
  357. package/dist/lib/node-esm/index.mjs +0 -2335
  358. package/dist/lib/node-esm/index.mjs.map +0 -7
  359. package/dist/lib/node-esm/meta.json +0 -1
  360. package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs +0 -26
  361. package/dist/lib/node-esm/on-create-space-XDY2YXPV.mjs.map +0 -7
  362. package/dist/lib/node-esm/operations/index.mjs +0 -15
  363. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  364. package/dist/lib/node-esm/restore-T3QA7TSL.mjs +0 -34
  365. package/dist/lib/node-esm/restore-T3QA7TSL.mjs.map +0 -7
  366. package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs +0 -43
  367. package/dist/lib/node-esm/restore-message-WFTEVBEV.mjs.map +0 -7
  368. package/dist/lib/node-esm/select-Q4UDWJJF.mjs +0 -27
  369. package/dist/lib/node-esm/select-Q4UDWJJF.mjs.map +0 -7
  370. package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs +0 -46
  371. package/dist/lib/node-esm/toggle-resolved-33XTAK2H.mjs.map +0 -7
  372. package/dist/lib/node-esm/types/index.mjs +0 -13
  373. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -16
  374. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
  375. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
  376. package/dist/types/src/containers/ChatContainer/index.d.ts +0 -4
  377. package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
  378. package/dist/types/src/operations/create-channel-thread.d.ts +0 -5
  379. package/dist/types/src/operations/create-channel-thread.d.ts.map +0 -1
  380. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  381. package/dist/types/src/testing/stories.d.ts +0 -3
  382. package/dist/types/src/testing/stories.d.ts.map +0 -1
  383. package/dist/types/src/types/Channel.d.ts +0 -715
  384. package/dist/types/src/types/Channel.d.ts.map +0 -1
  385. package/dist/types/src/types/capabilities.d.ts +0 -24
  386. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  387. package/src/containers/ChatContainer/ChatContainer.tsx +0 -131
  388. package/src/containers/ChatContainer/index.ts +0 -8
  389. package/src/operations/create-channel-thread.ts +0 -26
  390. package/src/testing/stories.ts +0 -51
  391. package/src/types/Channel.ts +0 -37
  392. package/src/types/capabilities.ts +0 -36
  393. /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChannelChat-6YTD5HWL.mjs.map} +0 -0
  394. /package/dist/lib/{browser/types/index.mjs.map → neutral/ChannelContainer-XHBF2NCK.mjs.map} +0 -0
  395. /package/dist/lib/{node-esm/types → neutral/blueprints}/index.mjs.map +0 -0
  396. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  397. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
@@ -6,15 +6,15 @@ import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
8
  import { LayoutOperation } from '@dxos/app-toolkit';
9
+ import { Operation } from '@dxos/compute';
9
10
  import { Obj, Relation } from '@dxos/echo';
10
- import { Operation } from '@dxos/operation';
11
11
  import { linkedSegment } from '@dxos/react-ui-attention';
12
12
  import { AnchoredTo, Thread } from '@dxos/types';
13
13
 
14
14
  import { ThreadCapabilities } from '../types';
15
- import { Create, Select } from './definitions';
15
+ import { ThreadOperation } from '../types';
16
16
 
17
- const handler: Operation.WithHandler<typeof Create> = Create.pipe(
17
+ const handler: Operation.WithHandler<typeof ThreadOperation.Create> = ThreadOperation.Create.pipe(
18
18
  Operation.withHandler(
19
19
  Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
20
20
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
@@ -37,7 +37,7 @@ const handler: Operation.WithHandler<typeof Create> = Create.pipe(
37
37
  },
38
38
  });
39
39
 
40
- yield* Operation.invoke(Select, { current: Obj.getDXN(thread).toString() });
40
+ yield* Operation.invoke(ThreadOperation.Select, { current: Obj.getDXN(thread).toString() });
41
41
  yield* Operation.invoke(LayoutOperation.UpdateCompanion, {
42
42
  subject: linkedSegment('comments'),
43
43
  });
@@ -4,15 +4,15 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
+ import { Operation } from '@dxos/compute';
7
8
  import { Obj, Relation } from '@dxos/echo';
8
9
  import { invariant } from '@dxos/invariant';
9
- import { Operation } from '@dxos/operation';
10
- import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
10
+ import { ObservabilityOperation } from '@dxos/plugin-observability';
11
11
  import { Thread } from '@dxos/types';
12
12
 
13
- import { Delete, DeleteMessage } from './definitions';
13
+ import { ThreadOperation } from '../types';
14
14
 
15
- const handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(
15
+ const handler: Operation.WithHandler<typeof ThreadOperation.DeleteMessage> = ThreadOperation.DeleteMessage.pipe(
16
16
  Operation.withHandler(
17
17
  Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
18
18
  const thread = Relation.getSource(anchor) as Thread.Thread;
@@ -27,11 +27,11 @@ const handler: Operation.WithHandler<typeof DeleteMessage> = DeleteMessage.pipe(
27
27
 
28
28
  if (msgIndex === 0 && thread.messages.length === 1) {
29
29
  // TODO(wittjosiah): This doesn't support restoring the thread.
30
- yield* Operation.invoke(Delete, { subject, anchor });
30
+ yield* Operation.invoke(ThreadOperation.Delete, { subject, anchor });
31
31
  return { messageIndex: -1 };
32
32
  }
33
33
 
34
- Obj.change(thread, (thread) => {
34
+ Obj.update(thread, (thread) => {
35
35
  thread.messages.splice(msgIndex, 1);
36
36
  });
37
37
 
@@ -6,15 +6,15 @@ import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
8
  import { sleep } from '@dxos/async';
9
+ import { Operation } from '@dxos/compute';
9
10
  import { Obj, Relation } from '@dxos/echo';
10
- import { Operation } from '@dxos/operation';
11
- import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
11
+ import { ObservabilityOperation } from '@dxos/plugin-observability';
12
12
  import { Thread } from '@dxos/types';
13
13
 
14
14
  import { ThreadCapabilities } from '../types';
15
- import { Delete } from './definitions';
15
+ import { ThreadOperation } from '../types';
16
16
 
17
- const handler: Operation.WithHandler<typeof Delete> = Delete.pipe(
17
+ const handler: Operation.WithHandler<typeof ThreadOperation.Delete> = ThreadOperation.Delete.pipe(
18
18
  Operation.withHandler(
19
19
  Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
20
20
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
@@ -2,15 +2,13 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { OperationHandlerSet } from '@dxos/operation';
6
-
7
- export * as ThreadOperation from './definitions';
5
+ import { OperationHandlerSet } from '@dxos/compute';
8
6
 
9
7
  export const ThreadOperationHandlerSet = OperationHandlerSet.lazy(
10
8
  () => import('./add-message'),
9
+ () => import('./append-channel-message'),
11
10
  () => import('./create'),
12
11
  () => import('./create-channel'),
13
- () => import('./create-channel-thread'),
14
12
  () => import('./create-proposals'),
15
13
  () => import('./delete'),
16
14
  () => import('./delete-message'),
@@ -4,18 +4,18 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Operation } from '@dxos/operation';
7
+ import { Operation } from '@dxos/compute';
8
8
 
9
- import { CreateChannel, OnCreateSpace } from './definitions';
9
+ import { ThreadOperation } from '../types';
10
10
 
11
- const handler: Operation.WithHandler<typeof OnCreateSpace> = OnCreateSpace.pipe(
11
+ const handler: Operation.WithHandler<typeof ThreadOperation.OnCreateSpace> = ThreadOperation.OnCreateSpace.pipe(
12
12
  Operation.withHandler(
13
13
  Effect.fnUntraced(function* ({ space, isDefault }) {
14
14
  if (isDefault) {
15
15
  return;
16
16
  }
17
17
 
18
- const { object: channel } = yield* Operation.invoke(CreateChannel, {
18
+ const { object: channel } = yield* Operation.invoke(ThreadOperation.CreateChannel, {
19
19
  name: 'General',
20
20
  spaceId: space.id,
21
21
  });
@@ -4,22 +4,22 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
+ import { Operation } from '@dxos/compute';
7
8
  import { Obj, Ref, Relation } from '@dxos/echo';
8
9
  import { invariant } from '@dxos/invariant';
9
- import { Operation } from '@dxos/operation';
10
- import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
10
+ import { ObservabilityOperation } from '@dxos/plugin-observability';
11
11
  import { Thread } from '@dxos/types';
12
12
 
13
- import { RestoreMessage } from './definitions';
13
+ import { ThreadOperation } from '../types';
14
14
 
15
- const handler: Operation.WithHandler<typeof RestoreMessage> = RestoreMessage.pipe(
15
+ const handler: Operation.WithHandler<typeof ThreadOperation.RestoreMessage> = ThreadOperation.RestoreMessage.pipe(
16
16
  Operation.withHandler(
17
17
  Effect.fnUntraced(function* ({ anchor, message, messageIndex }) {
18
18
  const thread = Relation.getSource(anchor) as Thread.Thread;
19
19
  const db = Obj.getDatabase(thread);
20
20
  invariant(db, 'Database not found');
21
21
 
22
- Obj.change(thread, (thread) => {
22
+ Obj.update(thread, (thread) => {
23
23
  thread.messages.splice(messageIndex, 0, Ref.make(message));
24
24
  });
25
25
 
@@ -5,13 +5,13 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { sleep } from '@dxos/async';
8
+ import { Operation } from '@dxos/compute';
8
9
  import { Obj } from '@dxos/echo';
9
- import { Operation } from '@dxos/operation';
10
- import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
10
+ import { ObservabilityOperation } from '@dxos/plugin-observability';
11
11
 
12
- import { Restore } from './definitions';
12
+ import { ThreadOperation } from '../types';
13
13
 
14
- const handler: Operation.WithHandler<typeof Restore> = Restore.pipe(
14
+ const handler: Operation.WithHandler<typeof ThreadOperation.Restore> = ThreadOperation.Restore.pipe(
15
15
  Operation.withHandler(
16
16
  Effect.fnUntraced(function* ({ thread, anchor }) {
17
17
  const db = Obj.getDatabase(thread);
@@ -5,12 +5,12 @@
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
7
  import { Capabilities, Capability } from '@dxos/app-framework';
8
- import { Operation } from '@dxos/operation';
8
+ import { Operation } from '@dxos/compute';
9
9
 
10
10
  import { ThreadCapabilities } from '../types';
11
- import { Select } from './definitions';
11
+ import { ThreadOperation } from '../types';
12
12
 
13
- const handler: Operation.WithHandler<typeof Select> = Select.pipe(
13
+ const handler: Operation.WithHandler<typeof ThreadOperation.Select> = ThreadOperation.Select.pipe(
14
14
  Operation.withHandler(
15
15
  Effect.fnUntraced(function* (input) {
16
16
  const registry = yield* Capability.get(Capabilities.AtomRegistry);
@@ -4,19 +4,19 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
+ import { Operation } from '@dxos/compute';
7
8
  import { Obj } from '@dxos/echo';
8
9
  import { invariant } from '@dxos/invariant';
9
- import { Operation } from '@dxos/operation';
10
- import { ObservabilityOperation } from '@dxos/plugin-observability/operations';
10
+ import { ObservabilityOperation } from '@dxos/plugin-observability';
11
11
 
12
- import { ToggleResolved } from './definitions';
12
+ import { ThreadOperation } from '../types';
13
13
 
14
- const handler: Operation.WithHandler<typeof ToggleResolved> = ToggleResolved.pipe(
14
+ const handler: Operation.WithHandler<typeof ThreadOperation.ToggleResolved> = ThreadOperation.ToggleResolved.pipe(
15
15
  Operation.withHandler(
16
16
  Effect.fnUntraced(function* (input) {
17
17
  const thread = input.thread;
18
18
 
19
- Obj.change(thread, (thread) => {
19
+ Obj.update(thread, (thread) => {
20
20
  if (thread.status === 'active' || thread.status === undefined) {
21
21
  thread.status = 'resolved';
22
22
  } else if (thread.status === 'resolved') {
package/src/plugin.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2023 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const ThreadPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { ThreadOperationHandlerSet } from './operations';
@@ -2,4 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './stories';
5
+ export * from './data';
@@ -4,9 +4,9 @@
4
4
 
5
5
  import { Type } from '@dxos/echo';
6
6
  import { type Resource } from '@dxos/react-ui';
7
+ import { Channel } from '@dxos/types';
7
8
 
8
9
  import { meta } from '#meta';
9
- import { Channel } from '#types';
10
10
 
11
11
  export const translations = [
12
12
  {
@@ -0,0 +1,41 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import { type Atom } from '@effect-atom/atom-react';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+ import { AppCapabilities } from '@dxos/app-toolkit';
11
+ import { type Channel } from '@dxos/types';
12
+
13
+ import { meta } from '#meta';
14
+
15
+ import { type CallManager as CallManagerImpl, type CallState, type MediaState } from '../calls';
16
+ import { type ThreadState, type ViewStore } from '../types';
17
+
18
+ export const Settings = Capability.make<Atom.Writable<import('./Settings').Settings>>(`${meta.id}.capability.settings`);
19
+ export const CallManager = Capability.make<CallManagerImpl>(`${meta.id}.capability.call-manager`);
20
+
21
+ /** Comment configuration contributed per typename by plugins that support commenting. */
22
+ export type CommentConfig = AppCapabilities.CommentConfig;
23
+ export const CommentConfig: Capability.InterfaceDef<AppCapabilities.CommentConfig> = AppCapabilities.CommentConfig;
24
+
25
+ // TODO(burdon): Better way to define specific extensions for meeting companions.
26
+ // TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?
27
+ // TODO(wittjosiah): These callbacks could be intents once we support broadcast.
28
+ export type CallProperties = {
29
+ onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;
30
+ onLeave: (roomId?: string) => Promise<void>;
31
+ onCallStateUpdated: (callState: CallState) => Promise<void>;
32
+ onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;
33
+ };
34
+
35
+ export const CallExtension = Capability.make<CallProperties>(`${meta.id}.capability.call-extension`);
36
+
37
+ /** Thread state (drafts, toolbar state, current selection). */
38
+ export const State = Capability.make<Atom.Writable<ThreadState>>(`${meta.id}.capability.state`);
39
+
40
+ /** Per-subject view state (e.g., showResolvedThreads). */
41
+ export const ViewState = Capability.make<Atom.Writable<ViewStore>>(`${meta.id}.capability.view-state`);
@@ -2,20 +2,19 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // @import-as-namespace
6
+
5
7
  import * as Schema from 'effect/Schema';
6
8
 
7
9
  import { Capability } from '@dxos/app-framework';
8
- import { Database, Key, Obj, Ref } from '@dxos/echo';
9
- import { Collection } from '@dxos/echo';
10
- import { Operation } from '@dxos/operation';
11
- import { Markdown } from '@dxos/plugin-markdown/types';
12
- import { SpaceSchema } from '@dxos/react-client/echo';
13
- import { Actor, AnchoredTo, Message, Thread } from '@dxos/types';
10
+ import { SpaceSchema } from '@dxos/client-protocol';
11
+ import { Operation } from '@dxos/compute';
12
+ import { Collection, Database, Key, Obj, Ref } from '@dxos/echo';
13
+ import { Markdown } from '@dxos/plugin-markdown';
14
+ import { Actor, AnchoredTo, Channel, Message, Thread } from '@dxos/types';
14
15
 
15
16
  import { meta } from '#meta';
16
17
 
17
- import { Channel } from '../types';
18
-
19
18
  const THREAD_OPERATION = `${meta.id}.operation`;
20
19
 
21
20
  export const OnCreateSpace = Operation.make({
@@ -41,15 +40,17 @@ export const CreateChannel = Operation.make({
41
40
  }),
42
41
  });
43
42
 
44
- export const CreateChannelThread = Operation.make({
45
- meta: { key: `${THREAD_OPERATION}.create-channel-thread`, name: 'Create Channel Thread' },
43
+ export const AppendChannelMessage = Operation.make({
44
+ meta: { key: `${THREAD_OPERATION}.append-channel-message`, name: 'Append Channel Message' },
45
+ // Note: Feed.FeedService is provided inside the handler from space.queues, not at the
46
+ // operation level — the runtime can't fulfill it without a space context.
46
47
  services: [Capability.Service],
47
48
  input: Schema.Struct({
48
49
  channel: Channel.Channel,
50
+ sender: Actor.Actor,
51
+ text: Schema.String,
49
52
  }),
50
- output: Schema.Struct({
51
- object: Thread.Thread,
52
- }),
53
+ output: Schema.Void,
53
54
  });
54
55
 
55
56
  export const Create = Operation.make({
@@ -2,6 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './capabilities';
6
- export * as Channel from './Channel';
7
5
  export * from './types';
6
+
7
+ export * as Settings from './Settings';
8
+ export * as ThreadCapabilities from './ThreadCapabilities';
9
+ export * as ThreadOperation from './ThreadOperation';
@@ -4,8 +4,6 @@
4
4
 
5
5
  import { AnchoredTo, Thread } from '@dxos/types';
6
6
 
7
- export * as Settings from './Settings';
8
-
9
7
  export interface ThreadModel {
10
8
  root: Thread.Thread;
11
9
  }
package/src/util.ts CHANGED
@@ -9,18 +9,50 @@ import { type PublicKey } from '@dxos/react-client';
9
9
  import { type Identity } from '@dxos/react-client/halo';
10
10
  import { type Selection } from '@dxos/react-ui-attention';
11
11
  import { type MessageMetadata } from '@dxos/react-ui-thread';
12
- import { hexToFallback } from '@dxos/util';
12
+ import { hexToFallback, toFallback } from '@dxos/util';
13
13
 
14
14
  export type MessagePropertiesProvider = (identityKey: PublicKey | undefined) => MessageMetadata;
15
15
 
16
- export const getMessageMetadata = (id: string, identity?: Identity): MessageMetadata => {
17
- const fallback = hexToFallback(identity?.identityKey.toHex() ?? '0');
16
+ /**
17
+ * Stable hash for an arbitrary string — used as the avatar-fallback seed for
18
+ * external senders who have no DXOS identity (e.g. Slack/Discord-synced
19
+ * messages). djb2-ish, only stability matters.
20
+ *
21
+ * Coerced to unsigned 32-bit via `>>> 0` because `toFallback` does a plain
22
+ * modulo against `idEmoji.length * idHue.length` and JavaScript's `%`
23
+ * preserves the sign of the dividend — a negative hash would index
24
+ * `idEmoji[-x]` and `idHue[-x]` to `undefined`, causing the avatar to fall
25
+ * through to `Avatar.Content`'s default red/ghost.
26
+ */
27
+ const hashString = (s: string): number => {
28
+ let h = 0;
29
+ for (let i = 0; i < s.length; i++) {
30
+ h = (h * 31 + s.charCodeAt(i)) | 0;
31
+ }
32
+ return h >>> 0;
33
+ };
34
+
35
+ export const getMessageMetadata = (
36
+ id: string,
37
+ identity?: Identity,
38
+ /**
39
+ * Externally-sourced sender info (Slack/Discord/etc). Used only when no
40
+ * matching DXOS `identity` is available — provides `name`/`email` for the
41
+ * author label and a stable seed for the avatar fallback.
42
+ */
43
+ fallbackSender?: { name?: string; email?: string },
44
+ ): MessageMetadata => {
45
+ const fallback = identity?.identityKey
46
+ ? hexToFallback(identity.identityKey.toHex())
47
+ : toFallback(hashString(fallbackSender?.name ?? fallbackSender?.email ?? '0'));
18
48
  return {
19
49
  id,
20
50
  authorId: identity?.did,
21
51
  authorName:
22
52
  identity?.profile?.displayName ??
23
- (identity?.identityKey ? generateName(identity.identityKey.toHex()) : undefined),
53
+ (identity?.identityKey ? generateName(identity.identityKey.toHex()) : undefined) ??
54
+ fallbackSender?.name ??
55
+ fallbackSender?.email,
24
56
  authorAvatarProps: {
25
57
  hue: identity?.profile?.data?.hue ?? fallback.hue,
26
58
  emoji: identity?.profile?.data?.emoji ?? fallback.emoji,
@@ -1,7 +0,0 @@
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 { Obj, Ref, Relation } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { Operation } from '@dxos/operation';\nimport { ObservabilityOperation } from '@dxos/plugin-observability/operations';\nimport { SpaceOperation } from '@dxos/plugin-space/operations';\nimport { AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { AddMessage } from './definitions';\n\nconst handler: Operation.WithHandler<typeof AddMessage> = 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.change(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.change(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,KAAKC,KAAKC,gBAAgB;AACnC,SAASC,iBAAiB;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,8BAA8B;AACvC,SAASC,sBAAsB;AAC/B,SAASC,YAAYC,eAAuB;;AAK5C,IAAMC,UAAoDC,WAAWC,KACnEC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,QAAQC,SAASC,QAAQC,KAAI,GAAE;AAC5D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,SAASC,SAASC,UAAUd,MAAAA;AAClC,QAAMe,YAAYC,IAAIC,OAAOhB,OAAAA,EAASiB,SAAQ;AAC9C,QAAMC,KAAKH,IAAII,YAAYnB,OAAAA;AAC3BoB,YAAUF,IAAI,sBAAA;;;;;;;;;AAEd,QAAMG,UAAUN,IAAIO,KAAKC,QAAQA,SAAS;IACxCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;IAC/BzB;IACA0B,QAAQ;MAAC;QAAEC,MAAM;QAAQ1B;MAAK;;EAChC,CAAA;AACAa,MAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,IAAAA,QAAOmB,SAASC,KAAKC,IAAIV,KAAKD,OAAAA,CAAAA;EAChC,CAAA;AAEA,QAAMY,QAAQ9B,SAASE,IAAIG,SAAAA;AAC3B,QAAM0B,QAAQD,MAAME,OAAOrB,SAAAA,GAAYsB,KAAK,CAACC,MAAsBA,EAAEC,OAAOvC,OAAOuC,EAAE;AACrF,MAAIJ,OAAO;AACTnB,QAAIc,OAAOlB,QAAQ,CAACA,YAAAA;AAClBA,MAAAA,QAAO4B,SAAS;IAClB,CAAA;AACApC,aAASqC,IAAIhC,WAAW;MACtB,GAAGyB;MACHE,QAAQ;QACN,GAAGF,MAAME;QACT,CAACrB,SAAAA,GAAYmB,MAAME,OAAOrB,SAAAA,GAAY2B,OAAO,CAACJ,MAAsBA,EAAEC,OAAOvC,OAAOuC,EAAE;MACxF;IACF,CAAA;AACA,WAAO1C,UAAU8C,OAAOC,eAAeC,WAAW;MAAEC,QAAQlC;MAAQmC,QAAQ5B;MAAI6B,QAAQ;IAAK,CAAA;AAC7F,WAAOnD,UAAU8C,OAAOC,eAAeK,aAAa;MAClD9B;MACA+B,QAAQC,WAAWA;MACnBC,QAAQxC;MACRmC,QAAQ9C;MACRoD,QAAQ;QAAErD,QAAQmC,MAAMnC;MAAO;IACjC,CAAA;AACA,WAAOH,UAAUyD,SAASC,uBAAuBC,WAAW;MAC1DC,MAAM;MACNC,YAAY;QACVC,SAASxC,GAAGwC;QACZC,UAAUhD,OAAO2B;MACnB;IACF,CAAA;EACF;AAEA,SAAO1C,UAAUyD,SAASC,uBAAuBC,WAAW;IAC1DC,MAAM;IACNC,YAAY;MACVC,SAASxC,GAAGwC;MACZC,UAAUhD,OAAO2B;MACjBsB,cAAcjD,OAAOmB,SAAS+B;MAC9BC,WAAWzC,QAAQiB;MACnByB,eAAe7D,KAAK2D;IACtB;EACF,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,sBAAepE;",
6
- "names": ["Effect", "Capabilities", "Capability", "Obj", "Ref", "Relation", "invariant", "Operation", "ObservabilityOperation", "SpaceOperation", "AnchoredTo", "Message", "handler", "AddMessage", "pipe", "Operation", "withHandler", "fnUntraced", "anchor", "subject", "sender", "text", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "thread", "Relation", "getSource", "subjectId", "Obj", "getDXN", "toString", "db", "getDatabase", "invariant", "message", "make", "Message", "created", "Date", "toISOString", "blocks", "_tag", "change", "messages", "push", "Ref", "state", "draft", "drafts", "find", "a", "id", "status", "set", "filter", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "AddRelation", "schema", "AnchoredTo", "source", "fields", "schedule", "ObservabilityOperation", "SendEvent", "name", "properties", "spaceId", "threadId", "threadLength", "length", "messageId", "messageLength"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../src/blueprints/thread-blueprint.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { ThreadOperation } from '#operations';\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: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
5
- "mappings": ";;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,uBAAuB;AAEhC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEC,YAAY;MAACC,gBAAgBC;;EAAiB,CAAA;EACjFC,cAAcC,SAASV,KAAK;;IAE1BW,QAAQC;;;;;;;;;EASV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDX,KAAKH;EACLC;AACF;AAEA,IAAA,2BAAea;",
6
- "names": ["Blueprint", "Template", "trim", "ThreadOperation", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "operations", "ThreadOperation", "CreateProposals", "instructions", "Template", "source", "trim", "blueprint"]
7
- }
@@ -1,61 +0,0 @@
1
- import {
2
- __export
3
- } from "./chunk-J5LGTIGS.mjs";
4
-
5
- // src/types/capabilities.ts
6
- import { Capability } from "@dxos/app-framework";
7
- import { meta } from "#meta";
8
- (function(ThreadCapabilities2) {
9
- ThreadCapabilities2.Settings = Capability.make(`${meta.id}.capability.settings`);
10
- ThreadCapabilities2.CallManager = Capability.make(`${meta.id}.capability.call-manager`);
11
- ThreadCapabilities2.CallExtension = Capability.make(`${meta.id}.capability.call-extension`);
12
- ThreadCapabilities2.State = Capability.make(`${meta.id}.capability.state`);
13
- ThreadCapabilities2.ViewState = Capability.make(`${meta.id}.capability.view-state`);
14
- })(ThreadCapabilities || (ThreadCapabilities = {}));
15
- var ThreadCapabilities;
16
-
17
- // src/types/Channel.ts
18
- var Channel_exports = {};
19
- __export(Channel_exports, {
20
- Channel: () => Channel,
21
- make: () => make
22
- });
23
- import * as Schema from "effect/Schema";
24
- import { Annotation, Obj, Ref, Type } from "@dxos/echo";
25
- import { FormInputAnnotation } from "@dxos/echo/internal";
26
- import { Thread } from "@dxos/types";
27
- var Channel = Schema.Struct({
28
- name: Schema.optional(Schema.String),
29
- defaultThread: Ref.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),
30
- // TODO(wittjosiah): Should be an "ordered collection".
31
- threads: Ref.Ref(Thread.Thread).pipe(Schema.Array, FormInputAnnotation.set(false))
32
- }).pipe(Type.object({
33
- typename: "org.dxos.type.channel",
34
- version: "0.1.0"
35
- }), Annotation.IconAnnotation.set({
36
- icon: "ph--hash--regular",
37
- hue: "rose"
38
- }));
39
- var make = (props = {}) => Obj.make(Channel, {
40
- ...props,
41
- defaultThread: Ref.make(Obj.make(Thread.Thread, {
42
- messages: [],
43
- status: "active"
44
- })),
45
- threads: []
46
- });
47
-
48
- // src/types/Settings.ts
49
- var Settings_exports = {};
50
- __export(Settings_exports, {
51
- Settings: () => Settings
52
- });
53
- import * as Schema2 from "effect/Schema";
54
- var Settings = Schema2.mutable(Schema2.Struct({}));
55
-
56
- export {
57
- ThreadCapabilities,
58
- Channel_exports,
59
- Settings_exports
60
- };
61
- //# sourceMappingURL=chunk-MESW3R4Q.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/capabilities.ts", "../../../src/types/Channel.ts", "../../../src/types/Settings.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Atom } from '@effect-atom/atom-react';\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport { type CallManager, type CallState, type MediaState } from '../calls';\nimport { type Channel, type ThreadState, type ViewStore } from '../types';\nimport * as Settings from './Settings';\n\nexport namespace ThreadCapabilities {\n export const Settings = Capability.make<Atom.Writable<Settings.Settings>>(`${meta.id}.capability.settings`);\n export const CallManager = Capability.make<CallManager>(`${meta.id}.capability.call-manager`);\n\n // TODO(burdon): Better way to define specific extensions for meeting companions.\n // TODO(burdon): This brings in deps from ../calls; how should we manage/minimize explicit type exposure to other plugins?\n // TODO(wittjosiah): These callbacks could be intents once we support broadcast.\n export type CallProperties = {\n onJoin: (state: { channel?: Channel.Channel; roomId?: string }) => Promise<void>;\n onLeave: (roomId?: string) => Promise<void>;\n onCallStateUpdated: (callState: CallState) => Promise<void>;\n onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => Promise<void>;\n };\n\n export const CallExtension = Capability.make<CallProperties>(`${meta.id}.capability.call-extension`);\n\n /** Thread state (drafts, toolbar state, current selection). */\n export const State = Capability.make<Atom.Writable<ThreadState>>(`${meta.id}.capability.state`);\n\n /** Per-subject view state (e.g., showResolvedThreads). */\n export const ViewState = Capability.make<Atom.Writable<ViewStore>>(`${meta.id}.capability.view-state`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nimport { Annotation, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation } from '@dxos/echo/internal';\nimport { Thread } from '@dxos/types';\n\n// TODO(burdon): What is the difference between Thread and Channel.\nexport const Channel = Schema.Struct({\n name: Schema.optional(Schema.String),\n defaultThread: Ref.Ref(Thread.Thread).pipe(FormInputAnnotation.set(false)),\n // TODO(wittjosiah): Should be an \"ordered collection\".\n threads: Ref.Ref(Thread.Thread).pipe(Schema.Array, FormInputAnnotation.set(false)),\n}).pipe(\n Type.object({\n typename: 'org.dxos.type.channel',\n version: '0.1.0',\n }),\n Annotation.IconAnnotation.set({\n icon: 'ph--hash--regular',\n hue: 'rose',\n }),\n);\n\nexport interface Channel extends Schema.Schema.Type<typeof Channel> {}\n\nexport const make = (props: Pick<Obj.MakeProps<typeof Channel>, 'name'> = {}) =>\n Obj.make(Channel, {\n ...props,\n defaultThread: Ref.make(Obj.make(Thread.Thread, { messages: [], status: 'active' })),\n threads: [],\n });\n", "//\n// Copyright 2023 DXOS.org\n//\n\n// @import-as-namespace\n\nimport * as Schema from 'effect/Schema';\n\nexport const Settings = Schema.mutable(Schema.Struct({}));\nexport interface Settings extends Schema.Schema.Type<typeof Settings> {}\n"],
5
- "mappings": ";;;;;AAMA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAMJC,qBAAAA;sBACFC,WAAWC,WAAWC,KAAuC,GAAGC,KAAKC,EAAE,sBAAsB;sBAC7FC,cAAcJ,WAAWC,KAAkB,GAAGC,KAAKC,EAAE,0BAA0B;sBAY/EE,gBAAgBL,WAAWC,KAAqB,GAAGC,KAAKC,EAAE,4BAA4B;sBAGtFG,QAAQN,WAAWC,KAAiC,GAAGC,KAAKC,EAAE,mBAAmB;sBAGjFI,YAAYP,WAAWC,KAA+B,GAAGC,KAAKC,EAAE,wBAAwB;AACvG,GArBiBL,uBAAAA,qBAAAA,CAAAA,EAAAA;;;;ACdjB;;;;;AAMA,YAAYU,YAAY;AAExB,SAASC,YAAYC,KAAKC,KAAKC,YAAY;AAC3C,SAASC,2BAA2B;AACpC,SAASC,cAAc;AAGhB,IAAMC,UAAiBC,cAAO;EACnCC,MAAaC,gBAAgBC,aAAM;EACnCC,eAAeC,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAKC,oBAAoBC,IAAI,KAAA,CAAA;;EAEnEC,SAASL,IAAIA,IAAIC,OAAOA,MAAM,EAAEC,KAAYI,cAAOH,oBAAoBC,IAAI,KAAA,CAAA;AAC7E,CAAA,EAAGF,KACDK,KAAKC,OAAO;EACVC,UAAU;EACVC,SAAS;AACX,CAAA,GACAC,WAAWC,eAAeR,IAAI;EAC5BS,MAAM;EACNC,KAAK;AACP,CAAA,CAAA;AAKK,IAAMC,OAAO,CAACC,QAAqD,CAAC,MACzEC,IAAIF,KAAKrB,SAAS;EAChB,GAAGsB;EACHjB,eAAeC,IAAIe,KAAKE,IAAIF,KAAKd,OAAOA,QAAQ;IAAEiB,UAAU,CAAA;IAAIC,QAAQ;EAAS,CAAA,CAAA;EACjFd,SAAS,CAAA;AACX,CAAA;;;ACpCF;;;;AAMA,YAAYe,aAAY;AAEjB,IAAMC,WAAkBC,gBAAeC,eAAO,CAAC,CAAA,CAAA;",
6
- "names": ["Capability", "meta", "ThreadCapabilities", "Settings", "Capability", "make", "meta", "id", "CallManager", "CallExtension", "State", "ViewState", "Schema", "Annotation", "Obj", "Ref", "Type", "FormInputAnnotation", "Thread", "Channel", "Struct", "name", "optional", "String", "defaultThread", "Ref", "Thread", "pipe", "FormInputAnnotation", "set", "threads", "Array", "Type", "object", "typename", "version", "Annotation", "IconAnnotation", "icon", "hue", "make", "props", "Obj", "messages", "status", "Schema", "Settings", "mutable", "Struct"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/definitions.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Database, Key, Obj, Ref } from '@dxos/echo';\nimport { Collection } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Markdown } from '@dxos/plugin-markdown/types';\nimport { SpaceSchema } from '@dxos/react-client/echo';\nimport { Actor, AnchoredTo, Message, Thread } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nimport { Channel } from '../types';\n\nconst THREAD_OPERATION = `${meta.id}.operation`;\n\nexport const OnCreateSpace = Operation.make({\n meta: { key: `${THREAD_OPERATION}.on-create-space`, name: 'On Create Space' },\n services: [Capability.Service],\n input: Schema.Struct({\n space: SpaceSchema,\n rootCollection: Collection.Collection,\n isDefault: Schema.Boolean.pipe(Schema.optional),\n }),\n output: Schema.Void,\n});\n\nexport const CreateChannel = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create-channel`, name: 'Create Channel' },\n services: [Capability.Service],\n input: Schema.Struct({\n spaceId: Key.SpaceId,\n name: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Channel.Channel,\n }),\n});\n\nexport const CreateChannelThread = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create-channel-thread`, name: 'Create Channel Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n channel: Channel.Channel,\n }),\n output: Schema.Struct({\n object: Thread.Thread,\n }),\n});\n\nexport const Create = Operation.make({\n meta: { key: `${THREAD_OPERATION}.create`, name: 'Create Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n anchor: Schema.optional(Schema.String),\n subject: Obj.Unknown,\n }),\n output: Schema.Void,\n});\n\nexport const DeleteOutput = Schema.Struct({\n thread: Thread.Thread.annotations({ description: 'The deleted thread.' }),\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The deleted anchor.' }),\n}).pipe(Schema.partial);\n\nexport type DeleteOutput = Schema.Schema.Type<typeof DeleteOutput>;\n\nexport const Delete = Operation.make({\n meta: { key: `${THREAD_OPERATION}.delete`, name: 'Delete Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: Obj.Unknown,\n thread: Schema.optional(Thread.Thread),\n }),\n output: DeleteOutput,\n});\n\nexport const Select = Operation.make({\n meta: { key: `${THREAD_OPERATION}.select`, name: 'Select Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n current: Schema.String,\n }),\n output: Schema.Void,\n});\n\nexport const ToggleResolved = Operation.make({\n meta: { key: `${THREAD_OPERATION}.toggle-resolved`, name: 'Toggle Resolved' },\n services: [Capability.Service],\n input: Schema.Struct({\n thread: Thread.Thread,\n }),\n output: Schema.Void,\n});\n\nexport const AddMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.add-message`, name: 'Add Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n subject: Obj.Unknown,\n anchor: AnchoredTo.AnchoredTo,\n sender: Actor.Actor,\n text: Schema.String,\n }),\n output: Schema.Void,\n});\n\nexport const DeleteMessageOutput = Schema.partial(\n Schema.Struct({\n message: Message.Message.annotations({ description: 'The deleted message.' }),\n messageIndex: Schema.Number.annotations({ description: 'The index the message was at.' }),\n }),\n);\n\nexport type DeleteMessageOutput = Schema.Schema.Type<typeof DeleteMessageOutput>;\n\nexport const DeleteMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.delete-message`, name: 'Delete Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo,\n subject: Obj.Unknown,\n messageId: Schema.String,\n }),\n output: DeleteMessageOutput,\n});\n\n/**\n * Restore a deleted thread (inverse of Delete).\n */\nexport const Restore = Operation.make({\n meta: { key: `${THREAD_OPERATION}.restore`, name: 'Restore Thread' },\n services: [Capability.Service],\n input: Schema.Struct({\n thread: Thread.Thread.annotations({ description: 'The thread to restore.' }),\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The anchor relation to restore.' }),\n }),\n output: Schema.Void,\n});\n\n/**\n * Restore a deleted message (inverse of DeleteMessage).\n */\nexport const RestoreMessage = Operation.make({\n meta: { key: `${THREAD_OPERATION}.restore-message`, name: 'Restore Message' },\n services: [Capability.Service],\n input: Schema.Struct({\n anchor: AnchoredTo.AnchoredTo.annotations({ description: 'The anchor of the thread.' }),\n message: Message.Message.annotations({ description: 'The message to restore.' }),\n messageIndex: Schema.Number.annotations({ description: 'The index to restore the message at.' }),\n }),\n output: Schema.Void,\n});\n\nexport const CreateProposals = Operation.make({\n meta: {\n key: 'org.dxos.function.thread.create-proposals',\n name: 'Create Proposals',\n description: 'Proposes a set of changes to a document.',\n },\n input: Schema.Struct({\n doc: Ref.Ref(Markdown.Document).annotations({\n description: 'The ID of the document.',\n }),\n diffs: Schema.Array(Schema.String).annotations({\n description: 'The diffs to propose for the document.',\n }),\n }),\n output: Schema.Void,\n services: [Database.Service],\n});\n"],
5
- "mappings": "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",
6
- "names": ["Schema", "Capability", "Database", "Key", "Obj", "Ref", "Collection", "Operation", "Markdown", "SpaceSchema", "Actor", "AnchoredTo", "Message", "Thread", "meta", "THREAD_OPERATION", "meta", "id", "OnCreateSpace", "Operation", "make", "key", "name", "services", "Capability", "Service", "input", "Struct", "space", "SpaceSchema", "rootCollection", "Collection", "isDefault", "Boolean", "pipe", "optional", "output", "Void", "CreateChannel", "spaceId", "Key", "SpaceId", "String", "object", "Channel", "CreateChannelThread", "channel", "Thread", "Create", "anchor", "subject", "Obj", "Unknown", "DeleteOutput", "thread", "annotations", "description", "AnchoredTo", "partial", "Delete", "Select", "current", "ToggleResolved", "AddMessage", "sender", "Actor", "text", "DeleteMessageOutput", "message", "Message", "messageIndex", "Number", "DeleteMessage", "messageId", "Restore", "RestoreMessage", "CreateProposals", "doc", "Ref", "Markdown", "Document", "diffs", "Array", "Database"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/create.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 { LayoutOperation } from '@dxos/app-toolkit';\nimport { Obj, Relation } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { linkedSegment } from '@dxos/react-ui-attention';\nimport { AnchoredTo, Thread } from '@dxos/types';\n\nimport { ThreadCapabilities } from '../types';\nimport { Create, Select } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n const stateAtom = yield* Capability.get(ThreadCapabilities.State);\n const subjectId = Obj.getDXN(subject).toString();\n const thread = Thread.make({ name });\n const anchor = Relation.make(AnchoredTo.AnchoredTo, {\n [Relation.Source]: thread,\n [Relation.Target]: subject,\n anchor: _anchor,\n });\n\n const state = registry.get(stateAtom);\n const existingDrafts = state.drafts[subjectId];\n registry.set(stateAtom, {\n ...state,\n drafts: {\n ...state.drafts,\n [subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],\n },\n });\n\n yield* Operation.invoke(Select, { current: Obj.getDXN(thread).toString() });\n yield* Operation.invoke(LayoutOperation.UpdateCompanion, {\n subject: linkedSegment('comments'),\n });\n }),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,uBAAuB;AAChC,SAASC,KAAKC,gBAAgB;AAC9B,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAC9B,SAASC,YAAYC,cAAc;AAKnC,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,MAAMC,QAAQC,SAASC,QAAO,GAAE;AAC7D,QAAMC,WAAW,OAAOC,WAAWC,IAAIC,aAAaC,YAAY;AAChE,QAAMC,YAAY,OAAOJ,WAAWC,IAAII,mBAAmBC,KAAK;AAChE,QAAMC,YAAYC,IAAIC,OAAOX,OAAAA,EAASY,SAAQ;AAC9C,QAAMC,SAASC,OAAOC,KAAK;IAAElB;EAAK,CAAA;AAClC,QAAMC,SAASkB,SAASD,KAAKE,WAAWA,YAAY;IAClD,CAACD,SAASE,MAAM,GAAGL;IACnB,CAACG,SAASG,MAAM,GAAGnB;IACnBF,QAAQC;EACV,CAAA;AAEA,QAAMqB,QAAQnB,SAASE,IAAIG,SAAAA;AAC3B,QAAMe,iBAAiBD,MAAME,OAAOb,SAAAA;AACpCR,WAASsB,IAAIjB,WAAW;IACtB,GAAGc;IACHE,QAAQ;MACN,GAAGF,MAAME;MACT,CAACb,SAAAA,GAAYY,iBAAiB;WAAIA;QAAgBvB;UAAU;QAACA;;IAC/D;EACF,CAAA;AAEA,SAAOJ,UAAU8B,OAAOC,QAAQ;IAAEC,SAAShB,IAAIC,OAAOE,MAAAA,EAAQD,SAAQ;EAAG,CAAA;AACzE,SAAOlB,UAAU8B,OAAOG,gBAAgBC,iBAAiB;IACvD5B,SAAS6B,cAAc,UAAA;EACzB,CAAA;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAetC;",
6
- "names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "Obj", "Relation", "Operation", "linkedSegment", "AnchoredTo", "Thread", "handler", "Create", "pipe", "Operation", "withHandler", "fnUntraced", "name", "anchor", "_anchor", "subject", "registry", "Capability", "get", "Capabilities", "AtomRegistry", "stateAtom", "ThreadCapabilities", "State", "subjectId", "Obj", "getDXN", "toString", "thread", "Thread", "make", "Relation", "AnchoredTo", "Source", "Target", "state", "existingDrafts", "drafts", "set", "invoke", "Select", "current", "LayoutOperation", "UpdateCompanion", "linkedSegment"]
7
- }
@@ -1,21 +0,0 @@
1
- import {
2
- CreateChannel
3
- } from "./chunk-VPM44Z35.mjs";
4
- import {
5
- Channel_exports
6
- } from "./chunk-MESW3R4Q.mjs";
7
- import "./chunk-J5LGTIGS.mjs";
8
-
9
- // src/operations/create-channel.ts
10
- import * as Effect from "effect/Effect";
11
- import { Operation } from "@dxos/operation";
12
- var handler = CreateChannel.pipe(Operation.withHandler((input) => Effect.sync(() => ({
13
- object: Channel_exports.make({
14
- name: input.name
15
- })
16
- }))));
17
- var create_channel_default = handler;
18
- export {
19
- create_channel_default as default
20
- };
21
- //# sourceMappingURL=create-channel-EF67LCS6.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/operations/create-channel.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/operation';\n\nimport { Channel } from '../types';\nimport { CreateChannel } from './definitions';\n\nconst handler: Operation.WithHandler<typeof CreateChannel> = CreateChannel.pipe(\n Operation.withHandler((input) =>\n Effect.sync(() => ({\n object: Channel.make({ name: input.name }),\n })),\n ),\n);\n\nexport default handler;\n"],
5
- "mappings": ";;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAK1B,IAAMC,UAAuDC,cAAcC,KACzEC,UAAUC,YAAY,CAACC,UACdC,YAAK,OAAO;EACjBC,QAAQC,gBAAQC,KAAK;IAAEC,MAAML,MAAMK;EAAK,CAAA;AAC1C,EAAA,CAAA,CAAA;AAIJ,IAAA,yBAAeV;",
6
- "names": ["Effect", "Operation", "handler", "CreateChannel", "pipe", "Operation", "withHandler", "input", "sync", "object", "Channel", "make", "name"]
7
- }