@dxos/plugin-thread 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51

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 (489) hide show
  1. package/dist/lib/browser/add-message-OC4QB4I2.mjs +89 -0
  2. package/dist/lib/browser/add-message-OC4QB4I2.mjs.map +7 -0
  3. package/dist/lib/browser/blueprints/index.mjs +32 -3
  4. package/dist/lib/browser/blueprints/index.mjs.map +4 -4
  5. package/dist/lib/browser/chunk-J67QAUIW.mjs +61 -0
  6. package/dist/lib/browser/chunk-J67QAUIW.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-KCMJ7H7F.mjs +259 -0
  8. package/dist/lib/browser/chunk-KCMJ7H7F.mjs.map +7 -0
  9. package/dist/lib/browser/create-IUWQEW74.mjs +55 -0
  10. package/dist/lib/browser/create-IUWQEW74.mjs.map +7 -0
  11. package/dist/lib/browser/create-channel-CBC5WEFG.mjs +21 -0
  12. package/dist/lib/browser/create-channel-CBC5WEFG.mjs.map +7 -0
  13. package/dist/lib/browser/create-channel-thread-JJ5LQ3OZ.mjs +28 -0
  14. package/dist/lib/browser/create-channel-thread-JJ5LQ3OZ.mjs.map +7 -0
  15. package/dist/lib/browser/create-proposals-RHLVRJZ4.mjs +57 -0
  16. package/dist/lib/browser/create-proposals-RHLVRJZ4.mjs.map +7 -0
  17. package/dist/lib/browser/delete-PVIEGTTY.mjs +59 -0
  18. package/dist/lib/browser/delete-PVIEGTTY.mjs.map +7 -0
  19. package/dist/lib/browser/delete-message-TLVRPLJF.mjs +56 -0
  20. package/dist/lib/browser/delete-message-TLVRPLJF.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +1811 -171
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/meta.json +1 -1
  24. package/dist/lib/browser/on-create-space-KRTKYRFU.mjs +25 -0
  25. package/dist/lib/browser/on-create-space-KRTKYRFU.mjs.map +7 -0
  26. package/dist/lib/browser/operations/index.mjs +14 -0
  27. package/dist/lib/browser/operations/index.mjs.map +7 -0
  28. package/dist/lib/browser/restore-AVE55SJF.mjs +33 -0
  29. package/dist/lib/browser/restore-AVE55SJF.mjs.map +7 -0
  30. package/dist/lib/browser/restore-message-F57RMGDJ.mjs +34 -0
  31. package/dist/lib/browser/restore-message-F57RMGDJ.mjs.map +7 -0
  32. package/dist/lib/browser/select-BJDZJI64.mjs +26 -0
  33. package/dist/lib/browser/select-BJDZJI64.mjs.map +7 -0
  34. package/dist/lib/browser/toggle-resolved-HQE5P7BV.mjs +37 -0
  35. package/dist/lib/browser/toggle-resolved-HQE5P7BV.mjs.map +7 -0
  36. package/dist/lib/browser/translations.mjs +90 -0
  37. package/dist/lib/browser/translations.mjs.map +7 -0
  38. package/dist/lib/browser/types/index.mjs +5 -8
  39. package/dist/lib/node-esm/add-message-HJXNAILW.mjs +90 -0
  40. package/dist/lib/node-esm/add-message-HJXNAILW.mjs.map +7 -0
  41. package/dist/lib/node-esm/blueprints/index.mjs +32 -3
  42. package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
  43. package/dist/lib/node-esm/chunk-2Q6V7NGK.mjs +62 -0
  44. package/dist/lib/node-esm/chunk-2Q6V7NGK.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-4KRVIOPC.mjs +260 -0
  46. package/dist/lib/node-esm/chunk-4KRVIOPC.mjs.map +7 -0
  47. package/dist/lib/node-esm/create-NALJT67D.mjs +56 -0
  48. package/dist/lib/node-esm/create-NALJT67D.mjs.map +7 -0
  49. package/dist/lib/node-esm/create-channel-CS2EAYJF.mjs +22 -0
  50. package/dist/lib/node-esm/create-channel-CS2EAYJF.mjs.map +7 -0
  51. package/dist/lib/node-esm/create-channel-thread-KZZFZDTU.mjs +29 -0
  52. package/dist/lib/node-esm/create-channel-thread-KZZFZDTU.mjs.map +7 -0
  53. package/dist/lib/node-esm/create-proposals-AFAYZQBI.mjs +58 -0
  54. package/dist/lib/node-esm/create-proposals-AFAYZQBI.mjs.map +7 -0
  55. package/dist/lib/node-esm/delete-HQJVZY7Q.mjs +60 -0
  56. package/dist/lib/node-esm/delete-HQJVZY7Q.mjs.map +7 -0
  57. package/dist/lib/node-esm/delete-message-VVPEYLV4.mjs +57 -0
  58. package/dist/lib/node-esm/delete-message-VVPEYLV4.mjs.map +7 -0
  59. package/dist/lib/node-esm/index.mjs +1811 -171
  60. package/dist/lib/node-esm/index.mjs.map +4 -4
  61. package/dist/lib/node-esm/meta.json +1 -1
  62. package/dist/lib/node-esm/on-create-space-2UX7Z5EQ.mjs +26 -0
  63. package/dist/lib/node-esm/on-create-space-2UX7Z5EQ.mjs.map +7 -0
  64. package/dist/lib/node-esm/operations/index.mjs +15 -0
  65. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  66. package/dist/lib/node-esm/restore-FMIWJR5T.mjs +34 -0
  67. package/dist/lib/node-esm/restore-FMIWJR5T.mjs.map +7 -0
  68. package/dist/lib/node-esm/restore-message-3L7AMQMG.mjs +35 -0
  69. package/dist/lib/node-esm/restore-message-3L7AMQMG.mjs.map +7 -0
  70. package/dist/lib/node-esm/select-VCAFISBK.mjs +27 -0
  71. package/dist/lib/node-esm/select-VCAFISBK.mjs.map +7 -0
  72. package/dist/lib/node-esm/toggle-resolved-JDZZ257P.mjs +38 -0
  73. package/dist/lib/node-esm/toggle-resolved-JDZZ257P.mjs.map +7 -0
  74. package/dist/lib/node-esm/translations.mjs +91 -0
  75. package/dist/lib/node-esm/translations.mjs.map +7 -0
  76. package/dist/lib/node-esm/types/index.mjs +5 -8
  77. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  78. package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
  79. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
  80. package/dist/types/src/calls/call-manager.d.ts.map +1 -1
  81. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +1 -1
  82. package/dist/types/src/calls/media-manager.d.ts.map +1 -1
  83. package/dist/types/src/calls/speaking-monitor.d.ts +0 -3
  84. package/dist/types/src/calls/speaking-monitor.d.ts.map +1 -1
  85. package/dist/types/src/calls/types.d.ts.map +1 -1
  86. package/dist/types/src/calls/util/audio.d.ts.map +1 -1
  87. package/dist/types/src/calls/util/calls-service.d.ts +2 -2
  88. package/dist/types/src/calls/util/calls-service.d.ts.map +1 -1
  89. package/dist/types/src/calls/util/history-cache.d.ts.map +1 -1
  90. package/dist/types/src/calls/util/media.d.ts.map +1 -1
  91. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +1 -1
  92. package/dist/types/src/calls/util/task-scheduling.d.ts.map +1 -1
  93. package/dist/types/src/calls-service.stories.d.ts +2 -2
  94. package/dist/types/src/calls-service.stories.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  96. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
  97. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  98. package/dist/types/src/capabilities/{call-manager/call-manager.d.ts → call-manager.d.ts} +1 -1
  99. package/dist/types/src/capabilities/call-manager.d.ts.map +1 -0
  100. package/dist/types/src/capabilities/index.d.ts +15 -10
  101. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  102. package/dist/types/src/capabilities/{markdown/markdown.d.ts → markdown.d.ts} +1 -1
  103. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  104. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  105. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  106. package/dist/types/src/capabilities/react-root.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  108. package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
  109. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  110. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
  111. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  112. package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
  113. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  114. package/dist/types/src/components/Call/Call.d.ts +32 -4
  115. package/dist/types/src/components/Call/Call.d.ts.map +1 -1
  116. package/dist/types/src/components/Call/Toolbar.d.ts +5 -5
  117. package/dist/types/src/components/Call/Toolbar.d.ts.map +1 -1
  118. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
  119. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
  120. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
  121. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
  122. package/dist/types/src/components/{CommentsThreadContainer.d.ts → CommentsPanel/CommentsThread.d.ts} +3 -3
  123. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
  124. package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
  125. package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
  126. package/dist/types/src/components/Lobby/Lobby.d.ts +24 -3
  127. package/dist/types/src/components/Lobby/Lobby.d.ts.map +1 -1
  128. package/dist/types/src/components/Media/VideoObject.d.ts +1 -1
  129. package/dist/types/src/components/Media/VideoObject.stories.d.ts +1 -1
  130. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +1 -1
  131. package/dist/types/src/components/{MessageContainer.d.ts → MessagePanel/MessagePanel.d.ts} +3 -3
  132. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
  133. package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
  134. package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
  135. package/dist/types/src/components/Participant/Participant.d.ts.map +1 -1
  136. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +1 -1
  137. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +1 -1
  138. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +142 -144
  139. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +1 -1
  140. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +1 -1
  141. package/dist/types/src/components/ResponsiveGrid/{ResponsiveContainer.d.ts → ResponsivePanel.d.ts} +4 -4
  142. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.d.ts.map +1 -0
  143. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts +164 -0
  144. package/dist/types/src/components/ResponsiveGrid/ResponsivePanel.stories.d.ts.map +1 -0
  145. package/dist/types/src/components/ResponsiveGrid/index.d.ts +1 -1
  146. package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +1 -1
  147. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts +6 -0
  148. package/dist/types/src/components/ThreadSettings/ThreadSettings.d.ts.map +1 -0
  149. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts +161 -0
  150. package/dist/types/src/components/ThreadSettings/ThreadSettings.stories.d.ts.map +1 -0
  151. package/dist/types/src/components/ThreadSettings/index.d.ts +2 -0
  152. package/dist/types/src/components/ThreadSettings/index.d.ts.map +1 -0
  153. package/dist/types/src/components/index.d.ts +4 -3
  154. package/dist/types/src/components/index.d.ts.map +1 -1
  155. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +1 -1
  156. package/dist/types/src/containers/CallDebugPanel/index.d.ts +1 -2
  157. package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +1 -1
  158. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +1 -1
  159. package/dist/types/src/containers/CallSidebar/index.d.ts +1 -2
  160. package/dist/types/src/containers/CallSidebar/index.d.ts.map +1 -1
  161. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +4 -4
  162. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +1 -1
  163. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +142 -144
  164. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +1 -1
  165. package/dist/types/src/containers/ChannelContainer/index.d.ts +1 -2
  166. package/dist/types/src/containers/ChannelContainer/index.d.ts.map +1 -1
  167. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +3 -4
  168. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
  169. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +141 -143
  170. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +1 -1
  171. package/dist/types/src/containers/ChatContainer/index.d.ts +1 -0
  172. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -1
  173. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +6 -3
  174. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +1 -1
  175. package/dist/types/src/containers/ThreadCompanion/index.d.ts +1 -2
  176. package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +1 -1
  177. package/dist/types/src/containers/index.d.ts +0 -1
  178. package/dist/types/src/containers/index.d.ts.map +1 -1
  179. package/dist/types/src/{components/command-extension.d.ts → extensions/command.d.ts} +1 -1
  180. package/dist/types/src/extensions/command.d.ts.map +1 -0
  181. package/dist/types/src/extensions/index.d.ts +1 -0
  182. package/dist/types/src/extensions/index.d.ts.map +1 -1
  183. package/dist/types/src/extensions/threads.d.ts +3 -3
  184. package/dist/types/src/extensions/threads.d.ts.map +1 -1
  185. package/dist/types/src/hooks/analytics.d.ts.map +1 -1
  186. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  187. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +1 -1
  188. package/dist/types/src/operations/add-message.d.ts +5 -0
  189. package/dist/types/src/operations/add-message.d.ts.map +1 -0
  190. package/dist/types/src/operations/create-channel-thread.d.ts +5 -0
  191. package/dist/types/src/operations/create-channel-thread.d.ts.map +1 -0
  192. package/dist/types/src/operations/create-channel.d.ts +5 -0
  193. package/dist/types/src/operations/create-channel.d.ts.map +1 -0
  194. package/dist/types/src/operations/create-proposals.d.ts +5 -0
  195. package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
  196. package/dist/types/src/operations/create.d.ts +5 -0
  197. package/dist/types/src/operations/create.d.ts.map +1 -0
  198. package/dist/types/src/operations/definitions.d.ts +2804 -0
  199. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  200. package/dist/types/src/operations/delete-message.d.ts +5 -0
  201. package/dist/types/src/operations/delete-message.d.ts.map +1 -0
  202. package/dist/types/src/operations/delete.d.ts +5 -0
  203. package/dist/types/src/operations/delete.d.ts.map +1 -0
  204. package/dist/types/src/operations/index.d.ts +4 -0
  205. package/dist/types/src/operations/index.d.ts.map +1 -0
  206. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  207. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  208. package/dist/types/src/operations/restore-message.d.ts +5 -0
  209. package/dist/types/src/operations/restore-message.d.ts.map +1 -0
  210. package/dist/types/src/operations/restore.d.ts +5 -0
  211. package/dist/types/src/operations/restore.d.ts.map +1 -0
  212. package/dist/types/src/operations/select.d.ts +5 -0
  213. package/dist/types/src/operations/select.d.ts.map +1 -0
  214. package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
  215. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
  216. package/dist/types/src/{components/testing.d.ts → testing/data.d.ts} +1 -1
  217. package/dist/types/src/testing/data.d.ts.map +1 -0
  218. package/dist/types/src/testing/index.d.ts +1 -1
  219. package/dist/types/src/testing/index.d.ts.map +1 -1
  220. package/dist/types/src/translations.d.ts +140 -142
  221. package/dist/types/src/translations.d.ts.map +1 -1
  222. package/dist/types/src/types/Channel.d.ts +181 -177
  223. package/dist/types/src/types/Channel.d.ts.map +1 -1
  224. package/dist/types/src/types/Settings.d.ts +5 -0
  225. package/dist/types/src/types/Settings.d.ts.map +1 -0
  226. package/dist/types/src/types/capabilities.d.ts +2 -1
  227. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  228. package/dist/types/src/types/types.d.ts +1 -3304
  229. package/dist/types/src/types/types.d.ts.map +1 -1
  230. package/dist/types/src/util.d.ts +2 -2
  231. package/dist/types/src/util.d.ts.map +1 -1
  232. package/dist/types/tsconfig.tsbuildinfo +1 -1
  233. package/package.json +79 -67
  234. package/src/ThreadPlugin.tsx +30 -22
  235. package/src/blueprints/thread-blueprint.ts +5 -9
  236. package/src/calls/util/calls-service.ts +3 -2
  237. package/src/calls/util/stub-media-streams.ts +3 -1
  238. package/src/calls-service.stories.tsx +8 -7
  239. package/src/capabilities/{app-graph-builder/app-graph-builder.ts → app-graph-builder.ts} +40 -49
  240. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +1 -1
  241. package/src/capabilities/{call-manager/call-manager.ts → call-manager.ts} +4 -3
  242. package/src/capabilities/index.ts +16 -10
  243. package/src/capabilities/{markdown/markdown.ts → markdown.ts} +17 -13
  244. package/src/capabilities/operation-handler.ts +16 -0
  245. package/src/capabilities/{react-root/react-root.tsx → react-root.tsx} +2 -2
  246. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +28 -35
  247. package/src/capabilities/{settings/settings.ts → settings.ts} +6 -5
  248. package/src/capabilities/{state/state.ts → state.ts} +1 -1
  249. package/src/capabilities/undo-mappings.ts +46 -0
  250. package/src/components/Call/Call.tsx +9 -9
  251. package/src/components/Call/Toolbar.tsx +24 -14
  252. package/src/components/{Comments.stories.tsx → CommentsPanel/CommentsPanel.stories.tsx} +14 -13
  253. package/src/components/{CommentsContainer.tsx → CommentsPanel/CommentsPanel.tsx} +6 -6
  254. package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +16 -16
  255. package/src/components/CommentsPanel/index.ts +6 -0
  256. package/src/components/Lobby/Lobby.tsx +12 -10
  257. package/src/components/Media/VideoObject.stories.tsx +3 -4
  258. package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +16 -10
  259. package/src/components/MessagePanel/index.ts +5 -0
  260. package/src/components/Participant/Participant.tsx +2 -1
  261. package/src/components/Participant/ParticipantGrid.tsx +0 -1
  262. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +7 -7
  263. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +4 -4
  264. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +5 -5
  265. package/src/components/ResponsiveGrid/{ResponsiveContainer.stories.tsx → ResponsivePanel.stories.tsx} +7 -7
  266. package/src/components/ResponsiveGrid/{ResponsiveContainer.tsx → ResponsivePanel.tsx} +4 -4
  267. package/src/components/ResponsiveGrid/index.ts +1 -1
  268. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
  269. package/src/components/ThreadSettings/ThreadSettings.tsx +20 -0
  270. package/src/components/ThreadSettings/index.ts +5 -0
  271. package/src/components/index.ts +6 -3
  272. package/src/containers/CallDebugPanel/CallDebugPanel.tsx +5 -4
  273. package/src/containers/CallDebugPanel/index.ts +1 -3
  274. package/src/containers/CallSidebar/CallSidebar.tsx +3 -2
  275. package/src/containers/CallSidebar/index.ts +1 -3
  276. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +45 -12
  277. package/src/containers/ChannelContainer/ChannelContainer.tsx +42 -36
  278. package/src/containers/ChannelContainer/index.ts +1 -3
  279. package/src/containers/ChatContainer/ChatContainer.stories.tsx +10 -11
  280. package/src/containers/ChatContainer/ChatContainer.tsx +95 -118
  281. package/src/containers/ChatContainer/index.ts +1 -0
  282. package/src/containers/ThreadCompanion/ThreadCompanion.tsx +48 -28
  283. package/src/containers/ThreadCompanion/index.ts +1 -3
  284. package/src/containers/index.ts +0 -1
  285. package/src/extensions/index.ts +1 -0
  286. package/src/extensions/threads.ts +15 -14
  287. package/src/hooks/analytics.ts +1 -1
  288. package/src/meta.ts +2 -2
  289. package/src/operations/add-message.ts +81 -0
  290. package/src/operations/create-channel-thread.ts +26 -0
  291. package/src/operations/create-channel.ts +20 -0
  292. package/src/operations/create-proposals.ts +49 -0
  293. package/src/operations/create.ts +48 -0
  294. package/src/operations/definitions.ts +177 -0
  295. package/src/operations/delete-message.ts +53 -0
  296. package/src/operations/delete.ts +63 -0
  297. package/src/operations/index.ts +22 -0
  298. package/src/operations/on-create-space.ts +27 -0
  299. package/src/operations/restore-message.ts +38 -0
  300. package/src/operations/restore.ts +38 -0
  301. package/src/operations/select.ts +24 -0
  302. package/src/operations/toggle-resolved.ts +41 -0
  303. package/src/{components/testing.ts → testing/data.ts} +7 -7
  304. package/src/testing/index.ts +1 -1
  305. package/src/translations.ts +72 -76
  306. package/src/types/Channel.ts +9 -2
  307. package/src/types/Settings.ts +10 -0
  308. package/src/types/capabilities.ts +9 -7
  309. package/src/types/types.ts +2 -184
  310. package/src/util.ts +1 -1
  311. package/dist/lib/browser/CallDebugPanel-FGCTY7Q4.mjs +0 -182
  312. package/dist/lib/browser/CallDebugPanel-FGCTY7Q4.mjs.map +0 -7
  313. package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs +0 -33
  314. package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs.map +0 -7
  315. package/dist/lib/browser/ChannelContainer-EPYG4QAC.mjs +0 -15
  316. package/dist/lib/browser/ChannelContainer-EPYG4QAC.mjs.map +0 -7
  317. package/dist/lib/browser/ChatContainer-2243UD2M.mjs +0 -14
  318. package/dist/lib/browser/ChatContainer-2243UD2M.mjs.map +0 -7
  319. package/dist/lib/browser/ThreadCompanion-2CMLJH76.mjs +0 -204
  320. package/dist/lib/browser/ThreadCompanion-2CMLJH76.mjs.map +0 -7
  321. package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs +0 -20
  322. package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs.map +0 -7
  323. package/dist/lib/browser/app-graph-builder-5LCAM746.mjs +0 -191
  324. package/dist/lib/browser/app-graph-builder-5LCAM746.mjs.map +0 -7
  325. package/dist/lib/browser/blueprint-definition-42M2EJ2Y.mjs +0 -17
  326. package/dist/lib/browser/blueprint-definition-42M2EJ2Y.mjs.map +0 -7
  327. package/dist/lib/browser/call-manager-2PRP4QVZ.mjs +0 -27
  328. package/dist/lib/browser/call-manager-2PRP4QVZ.mjs.map +0 -7
  329. package/dist/lib/browser/chunk-CP7E2HRE.mjs +0 -31
  330. package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +0 -7
  331. package/dist/lib/browser/chunk-ERK254BS.mjs +0 -1810
  332. package/dist/lib/browser/chunk-ERK254BS.mjs.map +0 -7
  333. package/dist/lib/browser/chunk-G6FJBSXX.mjs +0 -1123
  334. package/dist/lib/browser/chunk-G6FJBSXX.mjs.map +0 -7
  335. package/dist/lib/browser/chunk-HDLDMR54.mjs +0 -184
  336. package/dist/lib/browser/chunk-HDLDMR54.mjs.map +0 -7
  337. package/dist/lib/browser/chunk-ISCHODBV.mjs +0 -106
  338. package/dist/lib/browser/chunk-ISCHODBV.mjs.map +0 -7
  339. package/dist/lib/browser/chunk-LUK4UNFA.mjs +0 -20
  340. package/dist/lib/browser/chunk-LUK4UNFA.mjs.map +0 -7
  341. package/dist/lib/browser/chunk-PDHCY236.mjs +0 -223
  342. package/dist/lib/browser/chunk-PDHCY236.mjs.map +0 -7
  343. package/dist/lib/browser/chunk-PL5LIVP4.mjs +0 -105
  344. package/dist/lib/browser/chunk-PL5LIVP4.mjs.map +0 -7
  345. package/dist/lib/browser/chunk-U32R23JO.mjs +0 -277
  346. package/dist/lib/browser/chunk-U32R23JO.mjs.map +0 -7
  347. package/dist/lib/browser/chunk-UVUCB7QO.mjs +0 -125
  348. package/dist/lib/browser/chunk-UVUCB7QO.mjs.map +0 -7
  349. package/dist/lib/browser/markdown-GRRPCZHJ.mjs +0 -210
  350. package/dist/lib/browser/markdown-GRRPCZHJ.mjs.map +0 -7
  351. package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs +0 -442
  352. package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs.map +0 -7
  353. package/dist/lib/browser/react-root-7UFFPPRD.mjs +0 -26
  354. package/dist/lib/browser/react-root-7UFFPPRD.mjs.map +0 -7
  355. package/dist/lib/browser/react-surface-TIHBSZPD.mjs +0 -113
  356. package/dist/lib/browser/react-surface-TIHBSZPD.mjs.map +0 -7
  357. package/dist/lib/browser/repair-TBU45SBG.mjs +0 -40
  358. package/dist/lib/browser/repair-TBU45SBG.mjs.map +0 -7
  359. package/dist/lib/browser/settings-Y75FG6XR.mjs +0 -35
  360. package/dist/lib/browser/settings-Y75FG6XR.mjs.map +0 -7
  361. package/dist/lib/browser/state-OBTMMEUZ.mjs +0 -25
  362. package/dist/lib/browser/state-OBTMMEUZ.mjs.map +0 -7
  363. package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs +0 -183
  364. package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs.map +0 -7
  365. package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs +0 -34
  366. package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs.map +0 -7
  367. package/dist/lib/node-esm/ChannelContainer-NU4LSLB4.mjs +0 -16
  368. package/dist/lib/node-esm/ChannelContainer-NU4LSLB4.mjs.map +0 -7
  369. package/dist/lib/node-esm/ChatContainer-FPNIG33R.mjs +0 -15
  370. package/dist/lib/node-esm/ChatContainer-FPNIG33R.mjs.map +0 -7
  371. package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs +0 -205
  372. package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs.map +0 -7
  373. package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs +0 -21
  374. package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs.map +0 -7
  375. package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs +0 -192
  376. package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs.map +0 -7
  377. package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs +0 -18
  378. package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs.map +0 -7
  379. package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs +0 -28
  380. package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs.map +0 -7
  381. package/dist/lib/node-esm/chunk-6K5ACCGB.mjs +0 -107
  382. package/dist/lib/node-esm/chunk-6K5ACCGB.mjs.map +0 -7
  383. package/dist/lib/node-esm/chunk-7SZBKQUU.mjs +0 -224
  384. package/dist/lib/node-esm/chunk-7SZBKQUU.mjs.map +0 -7
  385. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs +0 -33
  386. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
  387. package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs +0 -22
  388. package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs.map +0 -7
  389. package/dist/lib/node-esm/chunk-IQUV7DR6.mjs +0 -1124
  390. package/dist/lib/node-esm/chunk-IQUV7DR6.mjs.map +0 -7
  391. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs +0 -1811
  392. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +0 -7
  393. package/dist/lib/node-esm/chunk-QYAVWNVM.mjs +0 -278
  394. package/dist/lib/node-esm/chunk-QYAVWNVM.mjs.map +0 -7
  395. package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs +0 -126
  396. package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs.map +0 -7
  397. package/dist/lib/node-esm/chunk-VBI32FGI.mjs +0 -108
  398. package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +0 -7
  399. package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs +0 -185
  400. package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs.map +0 -7
  401. package/dist/lib/node-esm/markdown-WHWUESF7.mjs +0 -211
  402. package/dist/lib/node-esm/markdown-WHWUESF7.mjs.map +0 -7
  403. package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs +0 -443
  404. package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs.map +0 -7
  405. package/dist/lib/node-esm/react-root-D7CWS5XP.mjs +0 -27
  406. package/dist/lib/node-esm/react-root-D7CWS5XP.mjs.map +0 -7
  407. package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs +0 -114
  408. package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs.map +0 -7
  409. package/dist/lib/node-esm/repair-7JEKRNR3.mjs +0 -41
  410. package/dist/lib/node-esm/repair-7JEKRNR3.mjs.map +0 -7
  411. package/dist/lib/node-esm/settings-W4JN2YKJ.mjs +0 -36
  412. package/dist/lib/node-esm/settings-W4JN2YKJ.mjs.map +0 -7
  413. package/dist/lib/node-esm/state-7UWCSIWQ.mjs +0 -26
  414. package/dist/lib/node-esm/state-7UWCSIWQ.mjs.map +0 -7
  415. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  416. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  417. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  418. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
  419. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  420. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  421. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  422. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +0 -1
  423. package/dist/types/src/capabilities/call-manager/index.d.ts +0 -3
  424. package/dist/types/src/capabilities/call-manager/index.d.ts.map +0 -1
  425. package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
  426. package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
  427. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
  428. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  429. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  430. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  431. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  432. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  433. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  434. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  435. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  436. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  437. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  438. package/dist/types/src/capabilities/repair/index.d.ts +0 -3
  439. package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
  440. package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
  441. package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
  442. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  443. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  444. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  445. package/dist/types/src/capabilities/state/index.d.ts +0 -3
  446. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  447. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  448. package/dist/types/src/components/Comments.stories.d.ts +0 -162
  449. package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
  450. package/dist/types/src/components/CommentsContainer.d.ts +0 -13
  451. package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
  452. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
  453. package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
  454. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
  455. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -166
  456. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
  457. package/dist/types/src/components/command-extension.d.ts.map +0 -1
  458. package/dist/types/src/components/testing.d.ts.map +0 -1
  459. package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts +0 -8
  460. package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts.map +0 -1
  461. package/dist/types/src/containers/ThreadSettings/index.d.ts +0 -3
  462. package/dist/types/src/containers/ThreadSettings/index.d.ts.map +0 -1
  463. package/dist/types/src/functions/create-proposals.d.ts +0 -13
  464. package/dist/types/src/functions/create-proposals.d.ts.map +0 -1
  465. package/dist/types/src/functions/index.d.ts +0 -14
  466. package/dist/types/src/functions/index.d.ts.map +0 -1
  467. package/dist/types/src/testing/stories.d.ts +0 -3
  468. package/dist/types/src/testing/stories.d.ts.map +0 -1
  469. package/src/capabilities/app-graph-builder/index.ts +0 -7
  470. package/src/capabilities/blueprint-definition/index.ts +0 -7
  471. package/src/capabilities/call-manager/index.ts +0 -7
  472. package/src/capabilities/markdown/index.ts +0 -7
  473. package/src/capabilities/operation-resolver/index.ts +0 -7
  474. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -399
  475. package/src/capabilities/react-root/index.ts +0 -7
  476. package/src/capabilities/react-surface/index.ts +0 -7
  477. package/src/capabilities/repair/index.ts +0 -7
  478. package/src/capabilities/repair/repair.ts +0 -55
  479. package/src/capabilities/settings/index.ts +0 -7
  480. package/src/capabilities/state/index.ts +0 -7
  481. package/src/containers/ThreadSettings/ThreadSettings.tsx +0 -22
  482. package/src/containers/ThreadSettings/index.ts +0 -7
  483. package/src/functions/create-proposals.ts +0 -57
  484. package/src/functions/index.ts +0 -9
  485. package/src/testing/stories.ts +0 -56
  486. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  487. /package/dist/types/src/capabilities/{react-root/react-root.d.ts → react-root.d.ts} +0 -0
  488. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  489. /package/src/{components/command-extension.ts → extensions/command.ts} +0 -0
@@ -1,399 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capabilities, Capability, UndoMapping } from '@dxos/app-framework';
8
- import { sleep } from '@dxos/async';
9
- import { Obj, Relation, Type } from '@dxos/echo';
10
- import { invariant } from '@dxos/invariant';
11
- import { OperationResolver } from '@dxos/operation';
12
- import { Operation } from '@dxos/operation';
13
- import { ATTENDABLE_PATH_SEPARATOR, DeckOperation } from '@dxos/plugin-deck/types';
14
- import { ObservabilityOperation } from '@dxos/plugin-observability/types';
15
- import { SpaceOperation } from '@dxos/plugin-space/types';
16
- import { Ref } from '@dxos/react-client/echo';
17
- import { ManagedCollection } from '@dxos/schema';
18
- import { AnchoredTo, Message, Thread } from '@dxos/types';
19
-
20
- import { meta } from '../../meta';
21
- import { Channel, ThreadCapabilities, ThreadOperation } from '../../types';
22
-
23
- export default Capability.makeModule(
24
- Effect.fnUntraced(function* () {
25
- return [
26
- Capability.contributes(Capabilities.UndoMapping, [
27
- UndoMapping.make({
28
- operation: ThreadOperation.Delete,
29
- inverse: ThreadOperation.Restore,
30
- deriveContext: (_input, output) => {
31
- // Return undefined if not undoable (e.g., draft deletion or no db).
32
- if (!output.thread || !output.anchor) {
33
- return;
34
- }
35
- return {
36
- thread: output.thread,
37
- anchor: output.anchor,
38
- };
39
- },
40
- message: ['thread deleted label', { ns: meta.id }],
41
- }),
42
- UndoMapping.make({
43
- operation: ThreadOperation.DeleteMessage,
44
- inverse: ThreadOperation.RestoreMessage,
45
- deriveContext: (input, output) => {
46
- // Return undefined if not undoable (e.g., message not found or thread deleted).
47
- if (!output.message || output.messageIndex === undefined) {
48
- return;
49
- }
50
- return {
51
- anchor: input.anchor,
52
- message: output.message,
53
- messageIndex: output.messageIndex,
54
- };
55
- },
56
- message: ['message deleted label', { ns: meta.id }],
57
- }),
58
- ]),
59
- Capability.contributes(Capabilities.OperationResolver, [
60
- //
61
- // CreateChannel
62
- //
63
- OperationResolver.make({
64
- operation: ThreadOperation.CreateChannel,
65
- handler: (input) =>
66
- Effect.sync(() => ({
67
- object: Channel.make({ name: input.name }),
68
- })),
69
- }),
70
-
71
- //
72
- // CreateChannelThread
73
- //
74
- OperationResolver.make({
75
- operation: ThreadOperation.CreateChannelThread,
76
- handler: (input) =>
77
- Effect.sync(() => {
78
- const thread = Thread.make({ status: 'active' });
79
- const threadRef = Ref.make(thread);
80
- Obj.change(input.channel, (c) => {
81
- c.threads.push(threadRef);
82
- });
83
- return { object: thread };
84
- }),
85
- }),
86
-
87
- //
88
- // Select
89
- //
90
- OperationResolver.make({
91
- operation: ThreadOperation.Select,
92
- handler: Effect.fnUntraced(function* (input) {
93
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
94
- const stateAtom = yield* Capability.get(ThreadCapabilities.State);
95
- const current = registry.get(stateAtom);
96
- registry.set(stateAtom, { ...current, current: input.current });
97
- }),
98
- }),
99
-
100
- //
101
- // ToggleResolved
102
- //
103
- OperationResolver.make({
104
- operation: ThreadOperation.ToggleResolved,
105
- handler: Effect.fnUntraced(function* (input) {
106
- const thread = input.thread;
107
-
108
- Obj.change(thread, (t) => {
109
- if (t.status === 'active' || t.status === undefined) {
110
- t.status = 'resolved';
111
- } else if (t.status === 'resolved') {
112
- t.status = 'active';
113
- }
114
- });
115
-
116
- const db = Obj.getDatabase(thread);
117
- invariant(db, 'Database not found');
118
-
119
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
120
- name: 'threads.toggle-resolved',
121
- properties: {
122
- spaceId: db.spaceId,
123
- threadId: thread.id,
124
- },
125
- });
126
- }),
127
- }),
128
-
129
- //
130
- // OnCreateSpace
131
- //
132
- OperationResolver.make({
133
- operation: ThreadOperation.OnCreateSpace,
134
- handler: Effect.fnUntraced(function* ({ space, isDefault, rootCollection }) {
135
- if (isDefault) {
136
- return;
137
- }
138
-
139
- const collection = ManagedCollection.makeManagedCollection({ key: Type.getTypename(Channel.Channel) });
140
- Obj.change(rootCollection, (c) => {
141
- c.objects.push(Ref.make(collection));
142
- });
143
-
144
- const { object: channel } = yield* Operation.invoke(ThreadOperation.CreateChannel, {
145
- name: 'General',
146
- spaceId: space.id,
147
- });
148
- space.db.add(channel);
149
- }),
150
- }),
151
-
152
- //
153
- // Create
154
- //
155
- OperationResolver.make({
156
- operation: ThreadOperation.Create,
157
- handler: Effect.fnUntraced(function* ({ name, anchor: _anchor, subject }) {
158
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
159
- const stateAtom = yield* Capability.get(ThreadCapabilities.State);
160
- const subjectId = Obj.getDXN(subject).toString();
161
- const thread = Thread.make({ name });
162
- const anchor = Relation.make(AnchoredTo.AnchoredTo, {
163
- [Relation.Source]: thread,
164
- [Relation.Target]: subject,
165
- anchor: _anchor,
166
- });
167
-
168
- const state = registry.get(stateAtom);
169
- const existingDrafts = state.drafts[subjectId];
170
- registry.set(stateAtom, {
171
- ...state,
172
- drafts: {
173
- ...state.drafts,
174
- [subjectId]: existingDrafts ? [...existingDrafts, anchor] : [anchor],
175
- },
176
- });
177
-
178
- // Follow-up operations.
179
- yield* Operation.invoke(ThreadOperation.Select, { current: Obj.getDXN(thread).toString() });
180
- yield* Operation.invoke(DeckOperation.ChangeCompanion, {
181
- companion: `${subjectId}${ATTENDABLE_PATH_SEPARATOR}comments`,
182
- });
183
- }),
184
- }),
185
-
186
- //
187
- // Delete
188
- //
189
- OperationResolver.make({
190
- operation: ThreadOperation.Delete,
191
- handler: Effect.fnUntraced(function* ({ subject, anchor, thread: _thread }) {
192
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
193
- const stateAtom = yield* Capability.get(ThreadCapabilities.State);
194
- const thread = _thread ?? (Relation.getSource(anchor) as Thread.Thread);
195
- const subjectId = Obj.getDXN(subject).toString();
196
- const state = registry.get(stateAtom);
197
- const draft = state.drafts[subjectId];
198
- if (draft) {
199
- // Check if we're deleting a draft; if so, remove it.
200
- const index = draft.findIndex((a: { id: string }) => a.id === anchor.id);
201
- if (index !== -1) {
202
- registry.set(stateAtom, {
203
- ...state,
204
- drafts: {
205
- ...state.drafts,
206
- [subjectId]: state.drafts[subjectId]?.filter((_, i) => i !== index),
207
- },
208
- });
209
- // Draft deletion is not undoable.
210
- return {};
211
- }
212
- }
213
-
214
- const db = Obj.getDatabase(thread);
215
- if (!db) {
216
- return {};
217
- }
218
-
219
- // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
220
- db.remove(anchor);
221
- yield* Effect.promise(() => sleep(100));
222
- db.remove(thread);
223
-
224
- // Schedule analytics event as followup (doesn't block return).
225
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
226
- name: 'threads.delete',
227
- properties: {
228
- spaceId: db.spaceId,
229
- threadId: thread.id,
230
- },
231
- });
232
-
233
- // Return data needed for undo.
234
- return { thread, anchor };
235
- }),
236
- }),
237
-
238
- //
239
- // AddMessage
240
- //
241
- OperationResolver.make({
242
- operation: ThreadOperation.AddMessage,
243
- handler: Effect.fnUntraced(function* ({ anchor, subject, sender, text }) {
244
- const registry = yield* Capability.get(Capabilities.AtomRegistry);
245
- const stateAtom = yield* Capability.get(ThreadCapabilities.State);
246
- const thread = Relation.getSource(anchor) as Thread.Thread;
247
- const subjectId = Obj.getDXN(subject).toString();
248
- const db = Obj.getDatabase(subject);
249
- invariant(db, 'Database not found');
250
-
251
- const message = Obj.make(Message.Message, {
252
- created: new Date().toISOString(),
253
- sender,
254
- blocks: [{ _tag: 'text', text }],
255
- });
256
- Obj.change(thread, (t) => {
257
- t.messages.push(Ref.make(message));
258
- });
259
-
260
- const state = registry.get(stateAtom);
261
- const draft = state.drafts[subjectId]?.find((a: { id: string }) => a.id === anchor.id);
262
- if (draft) {
263
- // Move draft to document.
264
- Obj.change(thread, (t) => {
265
- t.status = 'active';
266
- });
267
- registry.set(stateAtom, {
268
- ...state,
269
- drafts: {
270
- ...state.drafts,
271
- [subjectId]: state.drafts[subjectId]?.filter((a: { id: string }) => a.id !== anchor.id),
272
- },
273
- });
274
- yield* Operation.invoke(SpaceOperation.AddObject, { object: thread, target: db, hidden: true });
275
- yield* Operation.invoke(SpaceOperation.AddRelation, {
276
- db,
277
- schema: AnchoredTo.AnchoredTo,
278
- source: thread,
279
- target: subject,
280
- fields: { anchor: draft.anchor },
281
- });
282
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
283
- name: 'threads.create',
284
- properties: {
285
- spaceId: db.spaceId,
286
- threadId: thread.id,
287
- },
288
- });
289
- }
290
-
291
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
292
- name: 'threads.message.add',
293
- properties: {
294
- spaceId: db.spaceId,
295
- threadId: thread.id,
296
- threadLength: thread.messages.length,
297
- messageId: message.id,
298
- messageLength: text.length,
299
- },
300
- });
301
- }),
302
- }),
303
-
304
- //
305
- // DeleteMessage
306
- //
307
- OperationResolver.make({
308
- operation: ThreadOperation.DeleteMessage,
309
- handler: Effect.fnUntraced(function* ({ subject, anchor, messageId }) {
310
- const thread = Relation.getSource(anchor) as Thread.Thread;
311
- const db = Obj.getDatabase(subject);
312
- invariant(db, 'Database not found');
313
-
314
- const msgIndex = thread.messages.findIndex((ref) => ref.target?.id === messageId);
315
- const msg = thread.messages[msgIndex]?.target;
316
- if (!msg) {
317
- return { messageIndex: -1 };
318
- }
319
-
320
- if (msgIndex === 0 && thread.messages.length === 1) {
321
- // TODO(wittjosiah): This doesn't support restoring the thread.
322
- yield* Operation.invoke(ThreadOperation.Delete, { subject, anchor });
323
- return { messageIndex: -1 };
324
- }
325
-
326
- Obj.change(thread, (t) => {
327
- t.messages.splice(msgIndex, 1);
328
- });
329
-
330
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
331
- name: 'threads.message.delete',
332
- properties: {
333
- spaceId: db.spaceId,
334
- threadId: thread.id,
335
- threadLength: thread.messages.length,
336
- messageId,
337
- },
338
- });
339
-
340
- // Return data needed for undo.
341
- return { message: msg, messageIndex: msgIndex };
342
- }),
343
- }),
344
-
345
- //
346
- // Restore (inverse of Delete)
347
- //
348
- OperationResolver.make({
349
- operation: ThreadOperation.Restore,
350
- handler: Effect.fnUntraced(function* ({ thread, anchor }) {
351
- const db = Obj.getDatabase(thread);
352
- if (!db) {
353
- return;
354
- }
355
-
356
- // TODO(wittjosiah): Without sleep, rendering crashes at `Relation.setSource(anchor)`.
357
- db.add(thread);
358
- yield* Effect.promise(() => sleep(100));
359
- db.add(anchor);
360
-
361
- // Schedule analytics event as followup (doesn't block return).
362
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
363
- name: 'threads.undo-delete',
364
- properties: {
365
- spaceId: db.spaceId,
366
- threadId: thread.id,
367
- },
368
- });
369
- }),
370
- }),
371
-
372
- //
373
- // RestoreMessage (inverse of DeleteMessage)
374
- //
375
- OperationResolver.make({
376
- operation: ThreadOperation.RestoreMessage,
377
- handler: Effect.fnUntraced(function* ({ anchor, message, messageIndex }) {
378
- const thread = Relation.getSource(anchor) as Thread.Thread;
379
- const db = Obj.getDatabase(thread);
380
- invariant(db, 'Database not found');
381
-
382
- Obj.change(thread, (t) => {
383
- t.messages.splice(messageIndex, 0, Ref.make(message));
384
- });
385
-
386
- yield* Operation.schedule(ObservabilityOperation.SendEvent, {
387
- name: 'threads.message.undo-delete',
388
- properties: {
389
- spaceId: db.spaceId,
390
- threadId: thread.id,
391
- messageId: message.id,
392
- },
393
- });
394
- }),
395
- }),
396
- ]),
397
- ];
398
- }),
399
- );
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ReactRoot = Capability.lazy('ReactRoot', () => import('./react-root'));
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const Repair = Capability.lazy('Repair', () => import('./repair'));
@@ -1,55 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capability } from '@dxos/app-framework';
8
- import { Obj, Ref, Type } from '@dxos/echo';
9
- import { Collection } from '@dxos/echo';
10
- import { SpaceCapabilities } from '@dxos/plugin-space';
11
- import { type Space } from '@dxos/react-client/echo';
12
- import { ManagedCollection } from '@dxos/schema';
13
-
14
- import { Channel } from '../../types';
15
-
16
- export default Capability.makeModule(() =>
17
- Effect.succeed(
18
- Capability.contributes(
19
- SpaceCapabilities.Repair,
20
- async ({ space, isDefault }: { space: Space; isDefault: boolean }) => {
21
- if (isDefault) {
22
- return;
23
- }
24
-
25
- await ensureSystemCollection(space);
26
- },
27
- ),
28
- ),
29
- );
30
-
31
- /**
32
- * Ensure the root collection has a system collection for Channels.
33
- */
34
- const ensureSystemCollection = async (space: Space) => {
35
- const rootCollection: Collection.Collection = await space.properties[Collection.Collection.typename]?.load();
36
- if (!rootCollection) {
37
- return;
38
- }
39
-
40
- const objects = await Promise.all(rootCollection.objects.map((ref) => ref.load()));
41
- const channels = objects.find(
42
- (object) =>
43
- Obj.instanceOf(ManagedCollection.ManagedCollection, object) && object.key === Type.getTypename(Channel.Channel),
44
- );
45
- if (channels) {
46
- return;
47
- }
48
-
49
- const channelCollectionRef = Ref.make(
50
- ManagedCollection.makeManagedCollection({ key: Type.getTypename(Channel.Channel) }),
51
- );
52
- Obj.change(rootCollection, (c) => {
53
- c.objects.push(channelCollectionRef);
54
- });
55
- };
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ThreadSettings = Capability.lazy('ThreadSettings', () => import('./settings'));
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Capability } from '@dxos/app-framework';
6
-
7
- export const ThreadState = Capability.lazy('ThreadState', () => import('./state'));
@@ -1,22 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { useTranslation } from '@dxos/react-ui';
8
- import { Settings } from '@dxos/react-ui-form';
9
-
10
- import { meta } from '../../meta';
11
- import type { ThreadSettingsProps } from '../../types';
12
-
13
- export type ThreadSettingsComponentProps = {
14
- settings: ThreadSettingsProps;
15
- onSettingsChange: (fn: (current: ThreadSettingsProps) => ThreadSettingsProps) => void;
16
- };
17
-
18
- // TODO(burdon): Settings.
19
- export const ThreadSettings = ({ settings: _settings }: ThreadSettingsComponentProps) => {
20
- const { t: _t } = useTranslation(meta.id);
21
- return <Settings.Root></Settings.Root>;
22
- };
@@ -1,7 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { ThreadSettings } from './ThreadSettings';
6
-
7
- export default ThreadSettings;
@@ -1,57 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Array from 'effect/Array';
6
- import * as Effect from 'effect/Effect';
7
- import * as Function from 'effect/Function';
8
- import * as Schema from 'effect/Schema';
9
-
10
- import { computeDiffsWithCursors } from '@dxos/assistant';
11
- import { Database, Obj, Ref, Relation } from '@dxos/echo';
12
- import { createDocAccessor } from '@dxos/echo-db';
13
- import { defineFunction } from '@dxos/functions';
14
- import { Markdown } from '@dxos/plugin-markdown/types';
15
- import { AnchoredTo, Message, Thread } from '@dxos/types';
16
-
17
- export default defineFunction({
18
- key: 'dxos.org/function/thread/create-proposals',
19
- name: 'Create Proposals',
20
- description: 'Proposes a set of changes to a document.',
21
- inputSchema: Schema.Struct({
22
- doc: Ref.Ref(Markdown.Document).annotations({
23
- description: 'The ID of the document.',
24
- }),
25
- diffs: Schema.Array(Schema.String).annotations({
26
- description: 'The diffs to propose for the document.',
27
- }),
28
- }),
29
- outputSchema: Schema.Void,
30
- handler: Effect.fn(function* ({ data: { doc, diffs: _diffs } }) {
31
- const object = yield* Database.load(doc);
32
- const content = yield* Effect.promise(() => object.content.load());
33
- const accessor = createDocAccessor(content, ['content']);
34
-
35
- yield* Function.pipe(
36
- computeDiffsWithCursors(accessor, _diffs),
37
- Array.map(
38
- Effect.fnUntraced(function* ({ cursor, text }) {
39
- const proposal = Obj.make(Message.Message, {
40
- created: new Date().toISOString(),
41
- sender: { role: 'assistant' },
42
- blocks: [{ _tag: 'proposal', text }],
43
- });
44
- const thread = Thread.make({ name: 'Proposal', messages: [Ref.make(proposal)], status: 'active' });
45
- const relation = Relation.make(AnchoredTo.AnchoredTo, {
46
- [Relation.Source]: thread,
47
- [Relation.Target]: object,
48
- anchor: cursor,
49
- });
50
- yield* Database.add(thread);
51
- yield* Database.add(relation);
52
- }),
53
- ),
54
- Effect.allWith({ concurrency: 'unbounded' }),
55
- );
56
- }),
57
- });
@@ -1,9 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import CreateProposals from './create-proposals';
6
-
7
- export const ThreadFunctions = {
8
- CreateProposals,
9
- };
@@ -1,56 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { OperationPlugin, type Plugin } from '@dxos/app-framework';
8
- import { ClientPlugin } from '@dxos/plugin-client';
9
- import { GraphPlugin } from '@dxos/plugin-graph';
10
- import { SettingsPlugin } from '@dxos/plugin-settings';
11
- import { SpacePlugin } from '@dxos/plugin-space';
12
- import { ThemePlugin } from '@dxos/plugin-theme';
13
- import { Config } from '@dxos/react-client';
14
- import { defaultTx } from '@dxos/ui-theme';
15
-
16
- import { ThreadPlugin } from '../ThreadPlugin';
17
- import { Channel } from '../types';
18
-
19
- export const createThreadPlugins = async (): Promise<Array<Plugin.Plugin>> => [
20
- ThemePlugin({ tx: defaultTx }),
21
- ClientPlugin({
22
- onClientInitialized: ({ client }) =>
23
- Effect.gen(function* () {
24
- yield* Effect.promise(() => client.halo.createIdentity({ displayName: 'Test User' }));
25
- }),
26
- onSpacesReady: ({ client }) =>
27
- Effect.gen(function* () {
28
- yield* Effect.promise(() => client.spaces.default.waitUntilReady());
29
- client.spaces.default.db.add(Channel.make());
30
- }),
31
- config: new Config({
32
- runtime: {
33
- client: {
34
- edgeFeatures: {
35
- signaling: true,
36
- },
37
- },
38
- services: {
39
- edge: {
40
- url: 'https://edge.dxos.workers.dev/',
41
- },
42
- iceProviders: [
43
- {
44
- urls: 'https://edge.dxos.workers.dev/ice',
45
- },
46
- ],
47
- },
48
- },
49
- }),
50
- }),
51
- SpacePlugin({}),
52
- OperationPlugin(),
53
- SettingsPlugin(),
54
- GraphPlugin(),
55
- ThreadPlugin(),
56
- ];