@dxos/plugin-thread 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731

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 (668) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +271 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/ChannelArticle-UJHPOUWA.mjs +28 -0
  5. package/dist/lib/neutral/ChannelArticle-UJHPOUWA.mjs.map +7 -0
  6. package/dist/lib/neutral/ChannelChat-LZEDFJVD.mjs +10 -0
  7. package/dist/lib/{browser/ThreadCompanion-2CMLJH76.mjs → neutral/CommentsCompanion-FOUIGCEK.mjs} +59 -55
  8. package/dist/lib/neutral/CommentsCompanion-FOUIGCEK.mjs.map +7 -0
  9. package/dist/lib/neutral/ThreadContainer-QWB6WRMI.mjs +61 -0
  10. package/dist/lib/neutral/ThreadContainer-QWB6WRMI.mjs.map +7 -0
  11. package/dist/lib/neutral/ThreadPlugin.mjs +109 -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/ThreadPlugin.workerd.mjs +24 -0
  16. package/dist/lib/neutral/ThreadPlugin.workerd.mjs.map +7 -0
  17. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs +15 -0
  18. package/dist/lib/neutral/ThreadSettings-5MKTDK3A.mjs.map +7 -0
  19. package/dist/lib/neutral/add-message-RDIABSIX.mjs +122 -0
  20. package/dist/lib/neutral/add-message-RDIABSIX.mjs.map +7 -0
  21. package/dist/lib/neutral/agent-runner-RB7N5HLD.mjs +244 -0
  22. package/dist/lib/neutral/agent-runner-RB7N5HLD.mjs.map +7 -0
  23. package/dist/lib/neutral/app-graph-builder-PDLRFYSI.mjs +120 -0
  24. package/dist/lib/neutral/app-graph-builder-PDLRFYSI.mjs.map +7 -0
  25. package/dist/lib/neutral/append-channel-message-TBBQUVMH.mjs +40 -0
  26. package/dist/lib/neutral/append-channel-message-TBBQUVMH.mjs.map +7 -0
  27. package/dist/lib/{browser/blueprint-definition-42M2EJ2Y.mjs → neutral/blueprint-definition-S3EBOH4R.mjs} +4 -6
  28. package/dist/lib/neutral/blueprint-definition-S3EBOH4R.mjs.map +7 -0
  29. package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
  30. package/dist/lib/neutral/capabilities/index.mjs +27 -0
  31. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-35GUWXBB.mjs +48 -0
  33. package/dist/lib/neutral/chunk-35GUWXBB.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-5T5LPLBN.mjs +36 -0
  35. package/dist/lib/neutral/chunk-5T5LPLBN.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-BHEZLLXG.mjs +55 -0
  37. package/dist/lib/neutral/chunk-BHEZLLXG.mjs.map +7 -0
  38. package/dist/lib/{browser/markdown-GRRPCZHJ.mjs → neutral/chunk-HQZWTDJC.mjs} +48 -94
  39. package/dist/lib/neutral/chunk-HQZWTDJC.mjs.map +7 -0
  40. package/dist/lib/neutral/chunk-IQBZZAMX.mjs +335 -0
  41. package/dist/lib/neutral/chunk-IQBZZAMX.mjs.map +7 -0
  42. package/dist/lib/neutral/chunk-JJETHBAZ.mjs +8 -0
  43. package/dist/lib/neutral/chunk-JJETHBAZ.mjs.map +7 -0
  44. package/dist/lib/{node-esm/chunk-ABUFOZVX.mjs → neutral/chunk-JLY4NVTA.mjs} +12 -7
  45. package/dist/lib/neutral/chunk-JLY4NVTA.mjs.map +7 -0
  46. package/dist/lib/neutral/chunk-QFDT33VT.mjs +69 -0
  47. package/dist/lib/neutral/chunk-QFDT33VT.mjs.map +7 -0
  48. package/dist/lib/neutral/components/index.mjs +541 -0
  49. package/dist/lib/neutral/components/index.mjs.map +7 -0
  50. package/dist/lib/neutral/containers/index.mjs +15 -0
  51. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  52. package/dist/lib/neutral/create-VXM6HJMN.mjs +61 -0
  53. package/dist/lib/neutral/create-VXM6HJMN.mjs.map +7 -0
  54. package/dist/lib/neutral/create-channel-FSJOMRHF.mjs +19 -0
  55. package/dist/lib/neutral/create-channel-FSJOMRHF.mjs.map +7 -0
  56. package/dist/lib/neutral/create-object-D5XEG7MQ.mjs +28 -0
  57. package/dist/lib/neutral/create-object-D5XEG7MQ.mjs.map +7 -0
  58. package/dist/lib/neutral/create-proposals-ILYIYJEN.mjs +56 -0
  59. package/dist/lib/neutral/create-proposals-ILYIYJEN.mjs.map +7 -0
  60. package/dist/lib/neutral/delete-6KZERY6K.mjs +57 -0
  61. package/dist/lib/neutral/delete-6KZERY6K.mjs.map +7 -0
  62. package/dist/lib/neutral/delete-message-PATSHW36.mjs +54 -0
  63. package/dist/lib/neutral/delete-message-PATSHW36.mjs.map +7 -0
  64. package/dist/lib/neutral/hooks/index.mjs +10 -0
  65. package/dist/lib/neutral/index.mjs +32 -0
  66. package/dist/lib/neutral/markdown-5UHAAC5Z.mjs +83 -0
  67. package/dist/lib/neutral/markdown-5UHAAC5Z.mjs.map +7 -0
  68. package/dist/lib/neutral/meta.json +1 -0
  69. package/dist/lib/neutral/meta.mjs +10 -0
  70. package/dist/lib/neutral/on-create-space-6NLTBGGD.mjs +23 -0
  71. package/dist/lib/neutral/on-create-space-6NLTBGGD.mjs.map +7 -0
  72. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs +13 -0
  73. package/dist/lib/neutral/operation-handler-RU6K2S4L.mjs.map +7 -0
  74. package/dist/lib/neutral/operations/index.mjs +8 -0
  75. package/dist/lib/neutral/plugin.mjs +16 -0
  76. package/dist/lib/neutral/plugin.mjs.map +7 -0
  77. package/dist/lib/neutral/react-surface-TUMXARMI.mjs +76 -0
  78. package/dist/lib/neutral/react-surface-TUMXARMI.mjs.map +7 -0
  79. package/dist/lib/neutral/respond-to-thread-ROQA3B6U.mjs +32 -0
  80. package/dist/lib/neutral/respond-to-thread-ROQA3B6U.mjs.map +7 -0
  81. package/dist/lib/neutral/restore-SP4HADCE.mjs +32 -0
  82. package/dist/lib/neutral/restore-SP4HADCE.mjs.map +7 -0
  83. package/dist/lib/neutral/restore-message-TVIC66VL.mjs +33 -0
  84. package/dist/lib/neutral/restore-message-TVIC66VL.mjs.map +7 -0
  85. package/dist/lib/neutral/select-DLHPEKEA.mjs +24 -0
  86. package/dist/lib/neutral/select-DLHPEKEA.mjs.map +7 -0
  87. package/dist/lib/neutral/set-agent-config-7GEYCG7Y.mjs +20 -0
  88. package/dist/lib/neutral/set-agent-config-7GEYCG7Y.mjs.map +7 -0
  89. package/dist/lib/{browser/settings-Y75FG6XR.mjs → neutral/settings-HK4EB6TF.mjs} +6 -11
  90. package/dist/lib/neutral/settings-HK4EB6TF.mjs.map +7 -0
  91. package/dist/lib/{browser/state-OBTMMEUZ.mjs → neutral/state-UU7VEAKV.mjs} +3 -6
  92. package/dist/lib/neutral/state-UU7VEAKV.mjs.map +7 -0
  93. package/dist/lib/neutral/testing/index.mjs +58 -0
  94. package/dist/lib/neutral/testing/index.mjs.map +7 -0
  95. package/dist/lib/neutral/toggle-resolved-GMAD3SZ2.mjs +36 -0
  96. package/dist/lib/neutral/toggle-resolved-GMAD3SZ2.mjs.map +7 -0
  97. package/dist/lib/neutral/translations.mjs +91 -0
  98. package/dist/lib/neutral/translations.mjs.map +7 -0
  99. package/dist/lib/neutral/types/index.mjs +16 -0
  100. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs +54 -0
  101. package/dist/lib/neutral/undo-mappings-HOKL2L3M.mjs.map +7 -0
  102. package/dist/types/src/ThreadPlugin.d.ts +1 -0
  103. package/dist/types/src/ThreadPlugin.d.ts.map +1 -1
  104. package/dist/types/src/ThreadPlugin.node.d.ts +4 -0
  105. package/dist/types/src/ThreadPlugin.node.d.ts.map +1 -0
  106. package/dist/types/src/ThreadPlugin.test.d.ts +2 -0
  107. package/dist/types/src/ThreadPlugin.test.d.ts.map +1 -0
  108. package/dist/types/src/ThreadPlugin.workerd.d.ts +4 -0
  109. package/dist/types/src/ThreadPlugin.workerd.d.ts.map +1 -0
  110. package/dist/types/src/blueprints/thread-blueprint.d.ts +2 -2
  111. package/dist/types/src/blueprints/thread-blueprint.d.ts.map +1 -1
  112. package/dist/types/src/capabilities/agent-runner.d.ts +22 -0
  113. package/dist/types/src/capabilities/agent-runner.d.ts.map +1 -0
  114. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  116. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  118. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/index.d.ts +17 -10
  120. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  121. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  122. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  123. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  124. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/{settings/settings.d.ts → settings.d.ts} +2 -1
  126. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/{state/state.d.ts → state.d.ts} +1 -1
  128. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/undo-mappings.d.ts +5 -0
  130. package/dist/types/src/capabilities/undo-mappings.d.ts.map +1 -0
  131. package/dist/types/src/components/Chat/Chat.d.ts +51 -0
  132. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -0
  133. package/dist/types/src/components/Chat/index.d.ts +2 -0
  134. package/dist/types/src/components/Chat/index.d.ts.map +1 -0
  135. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts +13 -0
  136. package/dist/types/src/components/CommentsPanel/CommentsPanel.d.ts.map +1 -0
  137. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts +160 -0
  138. package/dist/types/src/components/CommentsPanel/CommentsPanel.stories.d.ts.map +1 -0
  139. package/dist/types/src/components/{CommentsThreadContainer.d.ts → CommentsPanel/CommentsThread.d.ts} +3 -3
  140. package/dist/types/src/components/CommentsPanel/CommentsThread.d.ts.map +1 -0
  141. package/dist/types/src/components/CommentsPanel/index.d.ts +3 -0
  142. package/dist/types/src/components/CommentsPanel/index.d.ts.map +1 -0
  143. package/dist/types/src/components/{MessageContainer.d.ts → MessagePanel/MessagePanel.d.ts} +3 -3
  144. package/dist/types/src/components/MessagePanel/MessagePanel.d.ts.map +1 -0
  145. package/dist/types/src/components/MessagePanel/index.d.ts +2 -0
  146. package/dist/types/src/components/MessagePanel/index.d.ts.map +1 -0
  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 +5 -4
  154. package/dist/types/src/components/index.d.ts.map +1 -1
  155. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts +13 -0
  156. package/dist/types/src/containers/ChannelArticle/ChannelArticle.d.ts.map +1 -0
  157. package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts +162 -0
  158. package/dist/types/src/containers/ChannelArticle/ChannelArticle.stories.d.ts.map +1 -0
  159. package/dist/types/src/containers/ChannelArticle/index.d.ts +2 -0
  160. package/dist/types/src/containers/ChannelArticle/index.d.ts.map +1 -0
  161. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts +20 -0
  162. package/dist/types/src/containers/ChannelChat/ChannelChat.d.ts.map +1 -0
  163. package/dist/types/src/containers/ChannelChat/index.d.ts +4 -0
  164. package/dist/types/src/containers/ChannelChat/index.d.ts.map +1 -0
  165. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.d.ts +11 -0
  166. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.d.ts.map +1 -0
  167. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.stories.d.ts +198 -0
  168. package/dist/types/src/containers/CommentsCompanion/CommentsCompanion.stories.d.ts.map +1 -0
  169. package/dist/types/src/containers/CommentsCompanion/index.d.ts +2 -0
  170. package/dist/types/src/containers/CommentsCompanion/index.d.ts.map +1 -0
  171. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts +20 -0
  172. package/dist/types/src/containers/ThreadContainer/ThreadContainer.d.ts.map +1 -0
  173. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts +162 -0
  174. package/dist/types/src/containers/ThreadContainer/ThreadContainer.stories.d.ts.map +1 -0
  175. package/dist/types/src/containers/ThreadContainer/index.d.ts +4 -0
  176. package/dist/types/src/containers/ThreadContainer/index.d.ts.map +1 -0
  177. package/dist/types/src/containers/index.d.ts +4 -6
  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 +4 -4
  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/index.d.ts +0 -4
  187. package/dist/types/src/hooks/index.d.ts.map +1 -1
  188. package/dist/types/src/hooks/useStatus.d.ts.map +1 -1
  189. package/dist/types/src/index.d.ts +2 -3
  190. package/dist/types/src/index.d.ts.map +1 -1
  191. package/dist/types/src/meta.d.ts +1 -1
  192. package/dist/types/src/meta.d.ts.map +1 -1
  193. package/dist/types/src/operations/add-message.d.ts +5 -0
  194. package/dist/types/src/operations/add-message.d.ts.map +1 -0
  195. package/dist/types/src/operations/append-channel-message.d.ts +5 -0
  196. package/dist/types/src/operations/append-channel-message.d.ts.map +1 -0
  197. package/dist/types/src/operations/create-channel.d.ts +5 -0
  198. package/dist/types/src/operations/create-channel.d.ts.map +1 -0
  199. package/dist/types/src/operations/create-proposals.d.ts +5 -0
  200. package/dist/types/src/operations/create-proposals.d.ts.map +1 -0
  201. package/dist/types/src/operations/create.d.ts +5 -0
  202. package/dist/types/src/operations/create.d.ts.map +1 -0
  203. package/dist/types/src/operations/delete-message.d.ts +5 -0
  204. package/dist/types/src/operations/delete-message.d.ts.map +1 -0
  205. package/dist/types/src/operations/delete.d.ts +5 -0
  206. package/dist/types/src/operations/delete.d.ts.map +1 -0
  207. package/dist/types/src/operations/index.d.ts +3 -0
  208. package/dist/types/src/operations/index.d.ts.map +1 -0
  209. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  210. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  211. package/dist/types/src/operations/respond-to-thread.d.ts +5 -0
  212. package/dist/types/src/operations/respond-to-thread.d.ts.map +1 -0
  213. package/dist/types/src/operations/restore-message.d.ts +5 -0
  214. package/dist/types/src/operations/restore-message.d.ts.map +1 -0
  215. package/dist/types/src/operations/restore.d.ts +5 -0
  216. package/dist/types/src/operations/restore.d.ts.map +1 -0
  217. package/dist/types/src/operations/select.d.ts +5 -0
  218. package/dist/types/src/operations/select.d.ts.map +1 -0
  219. package/dist/types/src/operations/set-agent-config.d.ts +5 -0
  220. package/dist/types/src/operations/set-agent-config.d.ts.map +1 -0
  221. package/dist/types/src/operations/toggle-resolved.d.ts +5 -0
  222. package/dist/types/src/operations/toggle-resolved.d.ts.map +1 -0
  223. package/dist/types/src/plugin.d.ts +4 -0
  224. package/dist/types/src/plugin.d.ts.map +1 -0
  225. package/dist/types/src/should-trigger-agent.d.ts +22 -0
  226. package/dist/types/src/should-trigger-agent.d.ts.map +1 -0
  227. package/dist/types/src/should-trigger-agent.test.d.ts +2 -0
  228. package/dist/types/src/should-trigger-agent.test.d.ts.map +1 -0
  229. package/dist/types/src/{components/testing.d.ts → testing/data.d.ts} +1 -1
  230. package/dist/types/src/testing/data.d.ts.map +1 -0
  231. package/dist/types/src/testing/index.d.ts +1 -1
  232. package/dist/types/src/testing/index.d.ts.map +1 -1
  233. package/dist/types/src/translations.d.ts +140 -142
  234. package/dist/types/src/translations.d.ts.map +1 -1
  235. package/dist/types/src/types/AgentIdentity.d.ts +27 -0
  236. package/dist/types/src/types/AgentIdentity.d.ts.map +1 -0
  237. package/dist/types/src/types/Settings.d.ts +5 -0
  238. package/dist/types/src/types/Settings.d.ts.map +1 -0
  239. package/dist/types/src/types/ThreadCapabilities.d.ts +34 -0
  240. package/dist/types/src/types/ThreadCapabilities.d.ts.map +1 -0
  241. package/dist/types/src/types/ThreadOperation.d.ts +2745 -0
  242. package/dist/types/src/types/ThreadOperation.d.ts.map +1 -0
  243. package/dist/types/src/types/index.d.ts +4 -2
  244. package/dist/types/src/types/index.d.ts.map +1 -1
  245. package/dist/types/src/types/types.d.ts +0 -3303
  246. package/dist/types/src/types/types.d.ts.map +1 -1
  247. package/dist/types/src/util.d.ts +6 -3
  248. package/dist/types/src/util.d.ts.map +1 -1
  249. package/dist/types/tsconfig.tsbuildinfo +1 -1
  250. package/package.json +136 -92
  251. package/src/ThreadPlugin.node.ts +39 -0
  252. package/src/ThreadPlugin.test.ts +37 -0
  253. package/src/ThreadPlugin.tsx +40 -61
  254. package/src/ThreadPlugin.workerd.ts +20 -0
  255. package/src/blueprints/thread-blueprint.ts +5 -9
  256. package/src/capabilities/agent-runner.ts +291 -0
  257. package/src/capabilities/app-graph-builder.ts +143 -0
  258. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
  259. package/src/capabilities/create-object.ts +30 -0
  260. package/src/capabilities/index.ts +17 -10
  261. package/src/capabilities/{markdown/markdown.ts → markdown.ts} +16 -12
  262. package/src/capabilities/operation-handler.ts +16 -0
  263. package/src/capabilities/react-surface.tsx +75 -0
  264. package/src/capabilities/{settings/settings.ts → settings.ts} +4 -5
  265. package/src/capabilities/{state/state.ts → state.ts} +1 -1
  266. package/src/capabilities/undo-mappings.ts +46 -0
  267. package/src/components/Chat/Chat.tsx +259 -0
  268. package/src/components/Chat/index.ts +5 -0
  269. package/src/components/{Comments.stories.tsx → CommentsPanel/CommentsPanel.stories.tsx} +17 -17
  270. package/src/components/{CommentsContainer.tsx → CommentsPanel/CommentsPanel.tsx} +11 -11
  271. package/src/components/{CommentsThreadContainer.tsx → CommentsPanel/CommentsThread.tsx} +32 -28
  272. package/src/components/CommentsPanel/index.ts +6 -0
  273. package/src/components/{MessageContainer.tsx → MessagePanel/MessagePanel.tsx} +24 -19
  274. package/src/components/MessagePanel/index.ts +5 -0
  275. package/src/components/ThreadSettings/ThreadSettings.stories.tsx +32 -0
  276. package/src/components/ThreadSettings/ThreadSettings.tsx +19 -0
  277. package/src/components/ThreadSettings/index.ts +5 -0
  278. package/src/components/index.ts +7 -4
  279. package/src/containers/ChannelArticle/ChannelArticle.stories.tsx +105 -0
  280. package/src/containers/ChannelArticle/ChannelArticle.tsx +42 -0
  281. package/src/containers/ChannelArticle/index.ts +5 -0
  282. package/src/containers/ChannelChat/ChannelChat.tsx +75 -0
  283. package/src/containers/ChannelChat/index.ts +8 -0
  284. package/src/containers/CommentsCompanion/CommentsCompanion.stories.tsx +355 -0
  285. package/src/containers/{ThreadCompanion/ThreadCompanion.tsx → CommentsCompanion/CommentsCompanion.tsx} +63 -44
  286. package/src/containers/CommentsCompanion/index.ts +5 -0
  287. package/src/containers/{ChatContainer/ChatContainer.stories.tsx → ThreadContainer/ThreadContainer.stories.tsx} +17 -19
  288. package/src/containers/ThreadContainer/ThreadContainer.tsx +75 -0
  289. package/src/containers/ThreadContainer/index.ts +8 -0
  290. package/src/containers/index.ts +4 -6
  291. package/src/{components/command-extension.ts → extensions/command.ts} +1 -1
  292. package/src/extensions/index.ts +1 -0
  293. package/src/extensions/threads.ts +20 -19
  294. package/src/hooks/analytics.ts +1 -1
  295. package/src/hooks/index.ts +0 -5
  296. package/src/index.ts +4 -4
  297. package/src/meta.ts +35 -9
  298. package/src/operations/add-message.ts +94 -0
  299. package/src/operations/append-channel-message.ts +37 -0
  300. package/src/operations/create-channel.ts +20 -0
  301. package/src/operations/create-proposals.ts +49 -0
  302. package/src/operations/create.ts +63 -0
  303. package/src/operations/delete-message.ts +53 -0
  304. package/src/operations/delete.ts +63 -0
  305. package/src/operations/index.ts +22 -0
  306. package/src/operations/on-create-space.ts +27 -0
  307. package/src/operations/respond-to-thread.ts +32 -0
  308. package/src/operations/restore-message.ts +38 -0
  309. package/src/operations/restore.ts +38 -0
  310. package/src/operations/select.ts +24 -0
  311. package/src/operations/set-agent-config.ts +24 -0
  312. package/src/operations/toggle-resolved.ts +41 -0
  313. package/src/plugin.ts +11 -0
  314. package/src/should-trigger-agent.test.ts +72 -0
  315. package/src/should-trigger-agent.ts +50 -0
  316. package/src/{components/testing.ts → testing/data.ts} +7 -7
  317. package/src/testing/index.ts +1 -1
  318. package/src/translations.ts +73 -76
  319. package/src/types/AgentIdentity.ts +35 -0
  320. package/src/types/Settings.ts +10 -0
  321. package/src/types/ThreadCapabilities.ts +46 -0
  322. package/src/types/ThreadOperation.ts +225 -0
  323. package/src/types/index.ts +5 -2
  324. package/src/types/types.ts +1 -185
  325. package/src/util.ts +37 -5
  326. package/src/vite-env.d.ts +10 -0
  327. package/dist/lib/browser/CallDebugPanel-FGCTY7Q4.mjs +0 -182
  328. package/dist/lib/browser/CallDebugPanel-FGCTY7Q4.mjs.map +0 -7
  329. package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs +0 -33
  330. package/dist/lib/browser/CallSidebar-PJCMNDIF.mjs.map +0 -7
  331. package/dist/lib/browser/ChannelContainer-EPYG4QAC.mjs +0 -15
  332. package/dist/lib/browser/ChatContainer-2243UD2M.mjs +0 -14
  333. package/dist/lib/browser/ThreadCompanion-2CMLJH76.mjs.map +0 -7
  334. package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs +0 -20
  335. package/dist/lib/browser/ThreadSettings-S55YVOGA.mjs.map +0 -7
  336. package/dist/lib/browser/app-graph-builder-5LCAM746.mjs +0 -191
  337. package/dist/lib/browser/app-graph-builder-5LCAM746.mjs.map +0 -7
  338. package/dist/lib/browser/blueprint-definition-42M2EJ2Y.mjs.map +0 -7
  339. package/dist/lib/browser/call-manager-2PRP4QVZ.mjs +0 -27
  340. package/dist/lib/browser/call-manager-2PRP4QVZ.mjs.map +0 -7
  341. package/dist/lib/browser/chunk-CP7E2HRE.mjs +0 -31
  342. package/dist/lib/browser/chunk-CP7E2HRE.mjs.map +0 -7
  343. package/dist/lib/browser/chunk-ERK254BS.mjs +0 -1810
  344. package/dist/lib/browser/chunk-ERK254BS.mjs.map +0 -7
  345. package/dist/lib/browser/chunk-G6FJBSXX.mjs +0 -1123
  346. package/dist/lib/browser/chunk-G6FJBSXX.mjs.map +0 -7
  347. package/dist/lib/browser/chunk-HDLDMR54.mjs +0 -184
  348. package/dist/lib/browser/chunk-HDLDMR54.mjs.map +0 -7
  349. package/dist/lib/browser/chunk-ISCHODBV.mjs +0 -106
  350. package/dist/lib/browser/chunk-ISCHODBV.mjs.map +0 -7
  351. package/dist/lib/browser/chunk-LUK4UNFA.mjs +0 -20
  352. package/dist/lib/browser/chunk-LUK4UNFA.mjs.map +0 -7
  353. package/dist/lib/browser/chunk-PDHCY236.mjs +0 -223
  354. package/dist/lib/browser/chunk-PDHCY236.mjs.map +0 -7
  355. package/dist/lib/browser/chunk-PL5LIVP4.mjs +0 -105
  356. package/dist/lib/browser/chunk-PL5LIVP4.mjs.map +0 -7
  357. package/dist/lib/browser/chunk-U32R23JO.mjs +0 -277
  358. package/dist/lib/browser/chunk-U32R23JO.mjs.map +0 -7
  359. package/dist/lib/browser/chunk-UVUCB7QO.mjs +0 -125
  360. package/dist/lib/browser/chunk-UVUCB7QO.mjs.map +0 -7
  361. package/dist/lib/browser/index.mjs +0 -308
  362. package/dist/lib/browser/index.mjs.map +0 -7
  363. package/dist/lib/browser/markdown-GRRPCZHJ.mjs.map +0 -7
  364. package/dist/lib/browser/meta.json +0 -1
  365. package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs +0 -442
  366. package/dist/lib/browser/operation-resolver-EP7FAYEB.mjs.map +0 -7
  367. package/dist/lib/browser/react-root-7UFFPPRD.mjs +0 -26
  368. package/dist/lib/browser/react-root-7UFFPPRD.mjs.map +0 -7
  369. package/dist/lib/browser/react-surface-TIHBSZPD.mjs +0 -113
  370. package/dist/lib/browser/react-surface-TIHBSZPD.mjs.map +0 -7
  371. package/dist/lib/browser/repair-TBU45SBG.mjs +0 -40
  372. package/dist/lib/browser/repair-TBU45SBG.mjs.map +0 -7
  373. package/dist/lib/browser/settings-Y75FG6XR.mjs.map +0 -7
  374. package/dist/lib/browser/state-OBTMMEUZ.mjs.map +0 -7
  375. package/dist/lib/browser/types/index.mjs +0 -15
  376. package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs +0 -183
  377. package/dist/lib/node-esm/CallDebugPanel-CYACANSP.mjs.map +0 -7
  378. package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs +0 -34
  379. package/dist/lib/node-esm/CallSidebar-XD7J7EQ6.mjs.map +0 -7
  380. package/dist/lib/node-esm/ChannelContainer-NU4LSLB4.mjs +0 -16
  381. package/dist/lib/node-esm/ChatContainer-FPNIG33R.mjs +0 -15
  382. package/dist/lib/node-esm/ChatContainer-FPNIG33R.mjs.map +0 -7
  383. package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs +0 -205
  384. package/dist/lib/node-esm/ThreadCompanion-TLWTONG6.mjs.map +0 -7
  385. package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs +0 -21
  386. package/dist/lib/node-esm/ThreadSettings-EUH4AGYV.mjs.map +0 -7
  387. package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs +0 -192
  388. package/dist/lib/node-esm/app-graph-builder-VBLHLX75.mjs.map +0 -7
  389. package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs +0 -18
  390. package/dist/lib/node-esm/blueprint-definition-PEXTS56K.mjs.map +0 -7
  391. package/dist/lib/node-esm/blueprints/index.mjs +0 -9
  392. package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs +0 -28
  393. package/dist/lib/node-esm/call-manager-BLQCEM2F.mjs.map +0 -7
  394. package/dist/lib/node-esm/chunk-6K5ACCGB.mjs +0 -107
  395. package/dist/lib/node-esm/chunk-6K5ACCGB.mjs.map +0 -7
  396. package/dist/lib/node-esm/chunk-7SZBKQUU.mjs +0 -224
  397. package/dist/lib/node-esm/chunk-7SZBKQUU.mjs.map +0 -7
  398. package/dist/lib/node-esm/chunk-ABUFOZVX.mjs.map +0 -7
  399. package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs +0 -22
  400. package/dist/lib/node-esm/chunk-GPPP2MZ3.mjs.map +0 -7
  401. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  402. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  403. package/dist/lib/node-esm/chunk-IQUV7DR6.mjs +0 -1124
  404. package/dist/lib/node-esm/chunk-IQUV7DR6.mjs.map +0 -7
  405. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs +0 -1811
  406. package/dist/lib/node-esm/chunk-QP3KQOPQ.mjs.map +0 -7
  407. package/dist/lib/node-esm/chunk-QYAVWNVM.mjs +0 -278
  408. package/dist/lib/node-esm/chunk-QYAVWNVM.mjs.map +0 -7
  409. package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs +0 -126
  410. package/dist/lib/node-esm/chunk-V2GXQ2UB.mjs.map +0 -7
  411. package/dist/lib/node-esm/chunk-VBI32FGI.mjs +0 -108
  412. package/dist/lib/node-esm/chunk-VBI32FGI.mjs.map +0 -7
  413. package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs +0 -185
  414. package/dist/lib/node-esm/chunk-YN2Y7GPW.mjs.map +0 -7
  415. package/dist/lib/node-esm/index.mjs +0 -309
  416. package/dist/lib/node-esm/index.mjs.map +0 -7
  417. package/dist/lib/node-esm/markdown-WHWUESF7.mjs +0 -211
  418. package/dist/lib/node-esm/markdown-WHWUESF7.mjs.map +0 -7
  419. package/dist/lib/node-esm/meta.json +0 -1
  420. package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs +0 -443
  421. package/dist/lib/node-esm/operation-resolver-R7QJW3TW.mjs.map +0 -7
  422. package/dist/lib/node-esm/react-root-D7CWS5XP.mjs +0 -27
  423. package/dist/lib/node-esm/react-root-D7CWS5XP.mjs.map +0 -7
  424. package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs +0 -114
  425. package/dist/lib/node-esm/react-surface-WWZFSK5Y.mjs.map +0 -7
  426. package/dist/lib/node-esm/repair-7JEKRNR3.mjs +0 -41
  427. package/dist/lib/node-esm/repair-7JEKRNR3.mjs.map +0 -7
  428. package/dist/lib/node-esm/settings-W4JN2YKJ.mjs +0 -36
  429. package/dist/lib/node-esm/settings-W4JN2YKJ.mjs.map +0 -7
  430. package/dist/lib/node-esm/state-7UWCSIWQ.mjs +0 -26
  431. package/dist/lib/node-esm/state-7UWCSIWQ.mjs.map +0 -7
  432. package/dist/lib/node-esm/types/index.mjs +0 -16
  433. package/dist/types/src/calls/call-manager.d.ts +0 -87
  434. package/dist/types/src/calls/call-manager.d.ts.map +0 -1
  435. package/dist/types/src/calls/call-swarm-synchronizer.d.ts +0 -66
  436. package/dist/types/src/calls/call-swarm-synchronizer.d.ts.map +0 -1
  437. package/dist/types/src/calls/index.d.ts +0 -7
  438. package/dist/types/src/calls/index.d.ts.map +0 -1
  439. package/dist/types/src/calls/media-manager.d.ts +0 -60
  440. package/dist/types/src/calls/media-manager.d.ts.map +0 -1
  441. package/dist/types/src/calls/speaking-monitor.d.ts +0 -24
  442. package/dist/types/src/calls/speaking-monitor.d.ts.map +0 -1
  443. package/dist/types/src/calls/types.d.ts +0 -45
  444. package/dist/types/src/calls/types.d.ts.map +0 -1
  445. package/dist/types/src/calls/util/audio.d.ts +0 -6
  446. package/dist/types/src/calls/util/audio.d.ts.map +0 -1
  447. package/dist/types/src/calls/util/calls-service.d.ts +0 -77
  448. package/dist/types/src/calls/util/calls-service.d.ts.map +0 -1
  449. package/dist/types/src/calls/util/history-cache.d.ts +0 -11
  450. package/dist/types/src/calls/util/history-cache.d.ts.map +0 -1
  451. package/dist/types/src/calls/util/index.d.ts +0 -5
  452. package/dist/types/src/calls/util/index.d.ts.map +0 -1
  453. package/dist/types/src/calls/util/media.d.ts +0 -6
  454. package/dist/types/src/calls/util/media.d.ts.map +0 -1
  455. package/dist/types/src/calls/util/stub-media-streams.d.ts +0 -18
  456. package/dist/types/src/calls/util/stub-media-streams.d.ts.map +0 -1
  457. package/dist/types/src/calls/util/task-scheduling.d.ts +0 -17
  458. package/dist/types/src/calls/util/task-scheduling.d.ts.map +0 -1
  459. package/dist/types/src/calls-service.stories.d.ts +0 -23
  460. package/dist/types/src/calls-service.stories.d.ts.map +0 -1
  461. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  462. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  463. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  464. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
  465. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  466. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  467. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  468. package/dist/types/src/capabilities/call-manager/call-manager.d.ts +0 -6
  469. package/dist/types/src/capabilities/call-manager/call-manager.d.ts.map +0 -1
  470. package/dist/types/src/capabilities/call-manager/index.d.ts +0 -3
  471. package/dist/types/src/capabilities/call-manager/index.d.ts.map +0 -1
  472. package/dist/types/src/capabilities/markdown/index.d.ts +0 -3
  473. package/dist/types/src/capabilities/markdown/index.d.ts.map +0 -1
  474. package/dist/types/src/capabilities/markdown/markdown.d.ts.map +0 -1
  475. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  476. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  477. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  478. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  479. package/dist/types/src/capabilities/react-root/index.d.ts +0 -6
  480. package/dist/types/src/capabilities/react-root/index.d.ts.map +0 -1
  481. package/dist/types/src/capabilities/react-root/react-root.d.ts +0 -9
  482. package/dist/types/src/capabilities/react-root/react-root.d.ts.map +0 -1
  483. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  484. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  485. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  486. package/dist/types/src/capabilities/repair/index.d.ts +0 -3
  487. package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
  488. package/dist/types/src/capabilities/repair/repair.d.ts +0 -6
  489. package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
  490. package/dist/types/src/capabilities/settings/index.d.ts +0 -3
  491. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  492. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  493. package/dist/types/src/capabilities/state/index.d.ts +0 -3
  494. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  495. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  496. package/dist/types/src/components/Call/Call.d.ts +0 -17
  497. package/dist/types/src/components/Call/Call.d.ts.map +0 -1
  498. package/dist/types/src/components/Call/Toolbar.d.ts +0 -16
  499. package/dist/types/src/components/Call/Toolbar.d.ts.map +0 -1
  500. package/dist/types/src/components/Call/index.d.ts +0 -3
  501. package/dist/types/src/components/Call/index.d.ts.map +0 -1
  502. package/dist/types/src/components/Comments.stories.d.ts +0 -162
  503. package/dist/types/src/components/Comments.stories.d.ts.map +0 -1
  504. package/dist/types/src/components/CommentsContainer.d.ts +0 -13
  505. package/dist/types/src/components/CommentsContainer.d.ts.map +0 -1
  506. package/dist/types/src/components/CommentsThreadContainer.d.ts.map +0 -1
  507. package/dist/types/src/components/Lobby/Lobby.d.ts +0 -15
  508. package/dist/types/src/components/Lobby/Lobby.d.ts.map +0 -1
  509. package/dist/types/src/components/Lobby/index.d.ts +0 -2
  510. package/dist/types/src/components/Lobby/index.d.ts.map +0 -1
  511. package/dist/types/src/components/Media/AudioStream.d.ts +0 -6
  512. package/dist/types/src/components/Media/AudioStream.d.ts.map +0 -1
  513. package/dist/types/src/components/Media/VideoObject.d.ts +0 -15
  514. package/dist/types/src/components/Media/VideoObject.d.ts.map +0 -1
  515. package/dist/types/src/components/Media/VideoObject.stories.d.ts +0 -22
  516. package/dist/types/src/components/Media/VideoObject.stories.d.ts.map +0 -1
  517. package/dist/types/src/components/Media/index.d.ts +0 -3
  518. package/dist/types/src/components/Media/index.d.ts.map +0 -1
  519. package/dist/types/src/components/MessageContainer.d.ts.map +0 -1
  520. package/dist/types/src/components/Participant/Participant.d.ts +0 -6
  521. package/dist/types/src/components/Participant/Participant.d.ts.map +0 -1
  522. package/dist/types/src/components/Participant/ParticipantGrid.d.ts +0 -11
  523. package/dist/types/src/components/Participant/ParticipantGrid.d.ts.map +0 -1
  524. package/dist/types/src/components/Participant/index.d.ts +0 -3
  525. package/dist/types/src/components/Participant/index.d.ts.map +0 -1
  526. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts +0 -12
  527. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.d.ts.map +0 -1
  528. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts +0 -166
  529. package/dist/types/src/components/ResponsiveGrid/ResponsiveContainer.stories.d.ts.map +0 -1
  530. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts +0 -32
  531. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.d.ts.map +0 -1
  532. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts +0 -180
  533. package/dist/types/src/components/ResponsiveGrid/ResponsiveGrid.stories.d.ts.map +0 -1
  534. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts +0 -21
  535. package/dist/types/src/components/ResponsiveGrid/ResponsiveGridItem.d.ts.map +0 -1
  536. package/dist/types/src/components/ResponsiveGrid/index.d.ts +0 -4
  537. package/dist/types/src/components/ResponsiveGrid/index.d.ts.map +0 -1
  538. package/dist/types/src/components/command-extension.d.ts.map +0 -1
  539. package/dist/types/src/components/testing.d.ts.map +0 -1
  540. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts +0 -15
  541. package/dist/types/src/containers/CallDebugPanel/CallDebugPanel.d.ts.map +0 -1
  542. package/dist/types/src/containers/CallDebugPanel/index.d.ts +0 -3
  543. package/dist/types/src/containers/CallDebugPanel/index.d.ts.map +0 -1
  544. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts +0 -3
  545. package/dist/types/src/containers/CallSidebar/CallSidebar.d.ts.map +0 -1
  546. package/dist/types/src/containers/CallSidebar/index.d.ts +0 -3
  547. package/dist/types/src/containers/CallSidebar/index.d.ts.map +0 -1
  548. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts +0 -12
  549. package/dist/types/src/containers/ChannelContainer/ChannelContainer.d.ts.map +0 -1
  550. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts +0 -164
  551. package/dist/types/src/containers/ChannelContainer/ChannelContainer.stories.d.ts.map +0 -1
  552. package/dist/types/src/containers/ChannelContainer/index.d.ts +0 -3
  553. package/dist/types/src/containers/ChannelContainer/index.d.ts.map +0 -1
  554. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -17
  555. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
  556. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts +0 -164
  557. package/dist/types/src/containers/ChatContainer/ChatContainer.stories.d.ts.map +0 -1
  558. package/dist/types/src/containers/ChatContainer/index.d.ts +0 -3
  559. package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
  560. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts +0 -5
  561. package/dist/types/src/containers/ThreadCompanion/ThreadCompanion.d.ts.map +0 -1
  562. package/dist/types/src/containers/ThreadCompanion/index.d.ts +0 -3
  563. package/dist/types/src/containers/ThreadCompanion/index.d.ts.map +0 -1
  564. package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts +0 -8
  565. package/dist/types/src/containers/ThreadSettings/ThreadSettings.d.ts.map +0 -1
  566. package/dist/types/src/containers/ThreadSettings/index.d.ts +0 -3
  567. package/dist/types/src/containers/ThreadSettings/index.d.ts.map +0 -1
  568. package/dist/types/src/functions/create-proposals.d.ts +0 -13
  569. package/dist/types/src/functions/create-proposals.d.ts.map +0 -1
  570. package/dist/types/src/functions/index.d.ts +0 -14
  571. package/dist/types/src/functions/index.d.ts.map +0 -1
  572. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts +0 -2
  573. package/dist/types/src/hooks/useBlackCanvasStreamTrack.d.ts.map +0 -1
  574. package/dist/types/src/hooks/useDebugMode.d.ts +0 -2
  575. package/dist/types/src/hooks/useDebugMode.d.ts.map +0 -1
  576. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts +0 -2
  577. package/dist/types/src/hooks/useInaudibleAudioStreamTrack.d.ts.map +0 -1
  578. package/dist/types/src/hooks/useVideoStreamTrack.d.ts +0 -3
  579. package/dist/types/src/hooks/useVideoStreamTrack.d.ts.map +0 -1
  580. package/dist/types/src/testing/stories.d.ts +0 -3
  581. package/dist/types/src/testing/stories.d.ts.map +0 -1
  582. package/dist/types/src/types/Channel.d.ts +0 -711
  583. package/dist/types/src/types/Channel.d.ts.map +0 -1
  584. package/dist/types/src/types/capabilities.d.ts +0 -23
  585. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  586. package/src/calls/call-manager.ts +0 -270
  587. package/src/calls/call-swarm-synchronizer.ts +0 -350
  588. package/src/calls/index.ts +0 -10
  589. package/src/calls/media-manager.ts +0 -378
  590. package/src/calls/speaking-monitor.ts +0 -85
  591. package/src/calls/types.ts +0 -74
  592. package/src/calls/util/audio.ts +0 -58
  593. package/src/calls/util/calls-service.ts +0 -581
  594. package/src/calls/util/history-cache.ts +0 -27
  595. package/src/calls/util/index.ts +0 -8
  596. package/src/calls/util/media.ts +0 -52
  597. package/src/calls/util/stub-media-streams.ts +0 -127
  598. package/src/calls/util/task-scheduling.ts +0 -92
  599. package/src/calls-service.stories.tsx +0 -229
  600. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -202
  601. package/src/capabilities/app-graph-builder/index.ts +0 -7
  602. package/src/capabilities/blueprint-definition/index.ts +0 -7
  603. package/src/capabilities/call-manager/call-manager.ts +0 -26
  604. package/src/capabilities/call-manager/index.ts +0 -7
  605. package/src/capabilities/markdown/index.ts +0 -7
  606. package/src/capabilities/operation-resolver/index.ts +0 -7
  607. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -399
  608. package/src/capabilities/react-root/index.ts +0 -7
  609. package/src/capabilities/react-root/react-root.tsx +0 -20
  610. package/src/capabilities/react-surface/index.ts +0 -7
  611. package/src/capabilities/react-surface/react-surface.tsx +0 -98
  612. package/src/capabilities/repair/index.ts +0 -7
  613. package/src/capabilities/repair/repair.ts +0 -55
  614. package/src/capabilities/settings/index.ts +0 -7
  615. package/src/capabilities/state/index.ts +0 -7
  616. package/src/components/Call/Call.tsx +0 -93
  617. package/src/components/Call/Toolbar.tsx +0 -189
  618. package/src/components/Call/index.ts +0 -6
  619. package/src/components/Lobby/Lobby.tsx +0 -121
  620. package/src/components/Lobby/index.ts +0 -5
  621. package/src/components/Media/AudioStream.tsx +0 -67
  622. package/src/components/Media/VideoObject.stories.tsx +0 -60
  623. package/src/components/Media/VideoObject.tsx +0 -58
  624. package/src/components/Media/index.ts +0 -6
  625. package/src/components/Participant/Participant.tsx +0 -76
  626. package/src/components/Participant/ParticipantGrid.tsx +0 -89
  627. package/src/components/Participant/index.ts +0 -6
  628. package/src/components/ResponsiveGrid/ResponsiveContainer.stories.tsx +0 -54
  629. package/src/components/ResponsiveGrid/ResponsiveContainer.tsx +0 -31
  630. package/src/components/ResponsiveGrid/ResponsiveGrid.stories.tsx +0 -158
  631. package/src/components/ResponsiveGrid/ResponsiveGrid.tsx +0 -341
  632. package/src/components/ResponsiveGrid/ResponsiveGridItem.tsx +0 -134
  633. package/src/components/ResponsiveGrid/index.ts +0 -7
  634. package/src/containers/CallDebugPanel/CallDebugPanel.tsx +0 -172
  635. package/src/containers/CallDebugPanel/index.ts +0 -7
  636. package/src/containers/CallSidebar/CallSidebar.tsx +0 -17
  637. package/src/containers/CallSidebar/index.ts +0 -7
  638. package/src/containers/ChannelContainer/ChannelContainer.stories.tsx +0 -60
  639. package/src/containers/ChannelContainer/ChannelContainer.tsx +0 -217
  640. package/src/containers/ChannelContainer/index.ts +0 -7
  641. package/src/containers/ChatContainer/ChatContainer.tsx +0 -149
  642. package/src/containers/ChatContainer/index.ts +0 -7
  643. package/src/containers/ThreadCompanion/index.ts +0 -7
  644. package/src/containers/ThreadSettings/ThreadSettings.tsx +0 -22
  645. package/src/containers/ThreadSettings/index.ts +0 -7
  646. package/src/functions/create-proposals.ts +0 -57
  647. package/src/functions/index.ts +0 -9
  648. package/src/hooks/useBlackCanvasStreamTrack.tsx +0 -27
  649. package/src/hooks/useDebugMode.ts +0 -25
  650. package/src/hooks/useInaudibleAudioStreamTrack.tsx +0 -27
  651. package/src/hooks/useVideoStreamTrack.tsx +0 -36
  652. package/src/testing/stories.ts +0 -56
  653. package/src/types/Channel.ts +0 -30
  654. package/src/types/capabilities.ts +0 -34
  655. package/src/typings/peermetrics-webrtc-stats.d.ts +0 -46
  656. package/src/typings.d.ts +0 -8
  657. /package/dist/lib/{browser/ChannelContainer-EPYG4QAC.mjs.map → neutral/ChannelChat-LZEDFJVD.mjs.map} +0 -0
  658. /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
  659. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  660. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  661. /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
  662. /package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
  663. /package/dist/lib/{browser/ChatContainer-2243UD2M.mjs.map → neutral/meta.mjs.map} +0 -0
  664. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  665. /package/dist/lib/{node-esm/ChannelContainer-NU4LSLB4.mjs.map → neutral/types/index.mjs.map} +0 -0
  666. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  667. /package/dist/types/src/capabilities/{markdown/markdown.d.ts → markdown.d.ts} +0 -0
  668. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
@@ -0,0 +1,355 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
6
+ import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
7
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
+ import * as Effect from 'effect/Effect';
9
+ import * as Layer from 'effect/Layer';
10
+ import React, { useEffect, useMemo } from 'react';
11
+
12
+ import { AiModelResolver } from '@dxos/ai';
13
+ import { AnthropicResolver } from '@dxos/ai/resolvers';
14
+ import { ActivationEvents, Capabilities, Capability, Plugin } from '@dxos/app-framework';
15
+ import { withPluginManager } from '@dxos/app-framework/testing';
16
+ import { Surface, useCapability } from '@dxos/app-framework/ui';
17
+ import {
18
+ AppActivationEvents,
19
+ AppCapabilities,
20
+ AppPlugin,
21
+ LayoutOperation,
22
+ createObjectNode,
23
+ getPersonalSpace,
24
+ } from '@dxos/app-toolkit';
25
+ import { AppSurface, useAppGraph } from '@dxos/app-toolkit/ui';
26
+ import { Operation, OperationHandlerSet } from '@dxos/compute';
27
+ import { Filter, Obj, Query, Ref } from '@dxos/echo';
28
+ import { AtomQuery } from '@dxos/echo-atom';
29
+ import { DXN } from '@dxos/keys';
30
+ import { ClientCapabilities } from '@dxos/plugin-client';
31
+ import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
32
+ import { Graph, GraphBuilder, Node, NodeMatcher, qualifyId } from '@dxos/plugin-graph';
33
+ import { Markdown, MarkdownCapabilities, MarkdownEvents } from '@dxos/plugin-markdown';
34
+ import { MarkdownPlugin } from '@dxos/plugin-markdown/testing';
35
+ import { SpacePlugin } from '@dxos/plugin-space/testing';
36
+ import { corePlugins } from '@dxos/plugin-testing';
37
+ import { random } from '@dxos/random';
38
+ import { useQuery, useSpaces } from '@dxos/react-client/echo';
39
+ import { useAttentionAttributes } from '@dxos/react-ui-attention';
40
+ import { Loading, withLayout } from '@dxos/react-ui/testing';
41
+ import { Text } from '@dxos/schema';
42
+ import { AnchoredTo, Message, Thread } from '@dxos/types';
43
+ import { isNonNullable } from '@dxos/util';
44
+
45
+ import { translations } from '#translations';
46
+
47
+ import { textOf } from '../../should-trigger-agent';
48
+ import { ThreadPlugin } from '../../ThreadPlugin';
49
+ import { AgentIdentity, ThreadCapabilities } from '../../types';
50
+
51
+ random.seed(1);
52
+
53
+ const STORY_AGENT_NAME = 'Kai';
54
+
55
+ /**
56
+ * Canned echo runner — never makes network calls. On each turn finds the
57
+ * last non-assistant message and appends an assistant message that quotes it.
58
+ * Used by the WithMentionAgent / WithAutoAgent variants.
59
+ */
60
+ const StubAgentRunner: ThreadCapabilities.AgentRunner = {
61
+ run: ({ thread }) =>
62
+ Effect.gen(function* () {
63
+ const identity = yield* Capability.get(AgentIdentity);
64
+ // User-authored messages have no role set; only assistant messages do.
65
+ const lastUser = [...thread.messages].reverse().find((ref) => ref.target?.sender.role !== 'assistant');
66
+ const echoText = textOf(lastUser?.target);
67
+ const reply = Obj.make(Message.Message, {
68
+ created: new Date().toISOString(),
69
+ sender: { role: 'assistant', name: identity.name, identityDid: identity.identityDid },
70
+ blocks: [{ _tag: 'text', text: `(${identity.name}) you said: "${echoText}"` }],
71
+ });
72
+ Obj.update(thread, (thread) => {
73
+ (thread.messages as Ref.Ref<Message.Message>[]).push(Ref.make(reply));
74
+ });
75
+ }),
76
+ };
77
+
78
+ /**
79
+ * Live `AppCapabilities.AiServiceLayer` wired through the DXOS edge so
80
+ * `ThreadPlugin`'s default `AgentRunner` can call Claude. The edge endpoint is
81
+ * open in dev — no API key is needed for the storybook to round-trip a real
82
+ * LLM response. Used by the WithLiveAgent variant.
83
+ *
84
+ * Headless `test-storybook` runs render the story but don't submit a comment,
85
+ * so no network call is made there either.
86
+ */
87
+ const anthropicResolverLayer = AnthropicResolver.make().pipe(
88
+ Layer.provide(
89
+ AnthropicClient.layer({
90
+ apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
91
+ }),
92
+ ),
93
+ Layer.provide(FetchHttpClient.layer),
94
+ );
95
+
96
+ const aiServiceLayer = AiModelResolver.AiModelResolver.buildAiService.pipe(
97
+ Layer.provide(
98
+ anthropicResolverLayer.pipe(
99
+ Layer.provide(AiModelResolver.AiModelResolver.fromModelMap({ name: 'Fallback' }, Effect.succeed({}))),
100
+ ),
101
+ ),
102
+ );
103
+
104
+ /**
105
+ * Common story-only plugin:
106
+ * 1. Exposes Markdown documents in the personal space as direct children of the
107
+ * graph root, so ThreadPlugin's `comment-toolbar` extension can attach the
108
+ * `comment` action to the doc's node.
109
+ * 2. Stubs out plugin-deck's layout operations (`UpdateCompanion`,
110
+ * `ScrollIntoView`) that ThreadPlugin and the CommentsCompanion invoke —
111
+ * no handler errors otherwise.
112
+ * 3. Contributes a static `AgentIdentity` ("Kai") so any AgentRunner has a name
113
+ * to stamp on assistant messages.
114
+ *
115
+ * Agent runner / LLM hookup is contributed separately by `StoryStubAgentPlugin`
116
+ * (no network) or `StoryLiveAgentPlugin` (real Anthropic via DXOS edge),
117
+ * selected per-story via the `liveAgent` arg.
118
+ */
119
+ const StoryGraphPlugin = Plugin.define(
120
+ Plugin.makeMeta({
121
+ key: DXN.make('org.dxos.plugin.thread.story.storyGraph'),
122
+ name: 'Story Graph',
123
+ }),
124
+ ).pipe(
125
+ AppPlugin.addAppGraphModule({
126
+ activate: Effect.fnUntraced(function* () {
127
+ const capabilities = yield* Capability.Service;
128
+ const extensions = yield* GraphBuilder.createExtension({
129
+ id: 'storyDocs',
130
+ match: NodeMatcher.whenRoot,
131
+ connector: (_, get) =>
132
+ Effect.gen(function* () {
133
+ const client = capabilities.get(ClientCapabilities.Client);
134
+ const space = getPersonalSpace(client);
135
+ if (!space) {
136
+ return [];
137
+ }
138
+ const docs = get(AtomQuery.make(space.db, Filter.type(Markdown.Document)));
139
+ return docs
140
+ .map((object) => createObjectNode({ db: space.db, object, droppable: false }))
141
+ .filter(isNonNullable);
142
+ }),
143
+ });
144
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
145
+ }),
146
+ }),
147
+ AppPlugin.addOperationHandlerModule({
148
+ activate: () =>
149
+ Effect.succeed(
150
+ Capability.contributes(
151
+ Capabilities.OperationHandler,
152
+ OperationHandlerSet.make(
153
+ Operation.withHandler(LayoutOperation.UpdateCompanion, () => Effect.void),
154
+ Operation.withHandler(LayoutOperation.ScrollIntoView, () => Effect.void),
155
+ ),
156
+ ),
157
+ ),
158
+ }),
159
+ Plugin.addModule({
160
+ id: 'story-graph.identity',
161
+ activatesOn: ActivationEvents.Startup,
162
+ activate: () => Effect.succeed(Capability.contributes(AgentIdentity, { name: STORY_AGENT_NAME })),
163
+ }),
164
+ Plugin.make,
165
+ );
166
+
167
+ /**
168
+ * Stub agent runner — used by the WithMentionAgent / WithAutoAgent variants.
169
+ * Loaded BEFORE ThreadPlugin so its `AgentRunner` contribution wins over
170
+ * ThreadPlugin's default LLM-backed runner.
171
+ */
172
+ const StoryStubAgentPlugin = Plugin.define(
173
+ Plugin.makeMeta({
174
+ key: DXN.make('org.dxos.plugin.thread.story.storyStubAgent'),
175
+ name: 'Story Stub Agent',
176
+ }),
177
+ ).pipe(
178
+ Plugin.addModule({
179
+ id: 'story-stub-agent.runner',
180
+ activatesOn: ActivationEvents.Startup,
181
+ activate: () => Effect.succeed(Capability.contributes(ThreadCapabilities.AgentRunner, StubAgentRunner)),
182
+ }),
183
+ Plugin.make,
184
+ );
185
+
186
+ /**
187
+ * Live agent runner hookup — contributes `AppCapabilities.AiServiceLayer` so
188
+ * ThreadPlugin's default `AgentRunner` routes through Anthropic via the DXOS
189
+ * edge. Used by the WithLiveAgent variant.
190
+ */
191
+ const StoryLiveAgentPlugin = Plugin.define(
192
+ Plugin.makeMeta({
193
+ key: DXN.make('org.dxos.plugin.thread.story.storyLiveAgent'),
194
+ name: 'Story Live Agent',
195
+ }),
196
+ ).pipe(
197
+ Plugin.addModule({
198
+ id: 'story-live-agent.ai-service',
199
+ activatesOn: ActivationEvents.Startup,
200
+ activate: () => Effect.succeed(Capability.contributes(AppCapabilities.AiServiceLayer, aiServiceLayer)),
201
+ }),
202
+ Plugin.make,
203
+ );
204
+
205
+ type StoryArgs = {
206
+ /**
207
+ * Sets the Markdown plugin's `commentAgentMode` setting so newly-created
208
+ * comment threads on the seeded doc are stamped with the matching agent
209
+ * config by ThreadOperation.Create.
210
+ */
211
+ agentMode?: Markdown.Settings['commentAgentMode'];
212
+
213
+ /**
214
+ * When true, contributes a live `AiServiceLayer` (Anthropic via DXOS edge)
215
+ * so ThreadPlugin's default `AgentRunner` makes a real LLM call.
216
+ * Defaults to `false` — variants use the stub echo runner.
217
+ */
218
+ liveAgent?: boolean;
219
+ };
220
+
221
+ const DefaultStory = ({ agentMode }: StoryArgs) => {
222
+ const { graph } = useAppGraph();
223
+ const [space] = useSpaces();
224
+ const [doc] = useQuery(space?.db, Query.type(Markdown.Document));
225
+ const attendableId = doc && qualifyId(Node.RootId, doc.id);
226
+ const attentionAttrs = useAttentionAttributes(attendableId);
227
+
228
+ // Story renders surfaces directly (no deck), so expand graph actions for the doc node.
229
+ useEffect(() => {
230
+ if (attendableId) {
231
+ void Graph.expand(graph, attendableId, 'action');
232
+ }
233
+ }, [graph, attendableId]);
234
+
235
+ // Push the variant's `agentMode` into the markdown plugin settings so that
236
+ // ThreadOperation.Create stamps new threads with the matching agent config.
237
+ const markdownSettings = useCapability(MarkdownCapabilities.Settings);
238
+ const registry = useCapability(Capabilities.AtomRegistry);
239
+ useEffect(() => {
240
+ if (!markdownSettings) {
241
+ return;
242
+ }
243
+ registry.set(markdownSettings, { ...registry.get(markdownSettings), commentAgentMode: agentMode ?? 'off' });
244
+ }, [markdownSettings, registry, agentMode]);
245
+
246
+ const articleData = useMemo(() => ({ subject: doc, attendableId: attendableId ?? 'story' }), [doc, attendableId]);
247
+ const companionData = useMemo(
248
+ () => ({ subject: 'comments', companionTo: doc, attendableId: attendableId ?? 'story' }),
249
+ [doc, attendableId],
250
+ );
251
+
252
+ if (!doc) {
253
+ return <Loading data={{ doc: !!doc }} />;
254
+ }
255
+
256
+ return (
257
+ <div className='dx-container grid grid-cols-[3fr_2fr] gap-4' {...attentionAttrs}>
258
+ <Surface.Surface type={AppSurface.Article} data={articleData} limit={1} />
259
+ <Surface.Surface type={AppSurface.Article} data={companionData} limit={1} />
260
+ </div>
261
+ );
262
+ };
263
+
264
+ const meta = {
265
+ title: 'plugins/plugin-thread/containers/CommentsCompanion',
266
+ render: DefaultStory,
267
+ decorators: [
268
+ withLayout({ layout: 'fullscreen' }),
269
+ withPluginManager<StoryArgs>((context) => ({
270
+ setupEvents: [AppActivationEvents.SetupSettings, MarkdownEvents.SetupExtensions],
271
+ plugins: [
272
+ ...corePlugins(),
273
+ ClientPlugin({
274
+ types: [Markdown.Document, Text.Text, Thread.Thread, Message.Message, AnchoredTo.AnchoredTo],
275
+ onClientInitialized: ({ client }) =>
276
+ Effect.gen(function* () {
277
+ const { personalSpace } = yield* initializeIdentity(client);
278
+ personalSpace.db.add(
279
+ Markdown.make({
280
+ name: 'Sample',
281
+ content: [
282
+ '# Sample',
283
+ '',
284
+ 'This document has comment threads attached to it.',
285
+ '',
286
+ 'Select text in the editor to add a new comment, or view existing threads in the companion.',
287
+ '',
288
+ ].join('\n'),
289
+ }),
290
+ );
291
+
292
+ yield* Effect.promise(() => personalSpace.db.flush({ indexes: true }));
293
+ }),
294
+ }),
295
+ SpacePlugin({}),
296
+ MarkdownPlugin(),
297
+ StoryGraphPlugin(),
298
+ // The stub agent plugin must come BEFORE ThreadPlugin so its
299
+ // `AgentRunner` contribution wins over ThreadPlugin's default
300
+ // (LLM-backed) runner — `Capability.get` returns the first match.
301
+ // The live variant simply doesn't contribute a stub, letting the
302
+ // default runner reach Anthropic via the AiServiceLayer.
303
+ ...(context.args.liveAgent ? [] : [StoryStubAgentPlugin()]),
304
+ ThreadPlugin(),
305
+ ...(context.args.liveAgent ? [StoryLiveAgentPlugin()] : []),
306
+ ],
307
+ })),
308
+ ],
309
+ parameters: {
310
+ layout: 'fullscreen',
311
+ controls: { disable: true },
312
+ translations,
313
+ },
314
+ } satisfies Meta<typeof DefaultStory>;
315
+
316
+ export default meta;
317
+
318
+ type Story = StoryObj<typeof meta>;
319
+
320
+ export const Default: Story = {};
321
+
322
+ /**
323
+ * Thread opted in to the AI agent in `mention` mode.
324
+ * Type `@Kai …` in the comment input to trigger the stub runner; plain messages are ignored.
325
+ */
326
+ export const WithMentionAgent: Story = {
327
+ args: {
328
+ agentMode: 'mention',
329
+ },
330
+ };
331
+
332
+ /**
333
+ * Thread opted in to the AI agent in `auto` mode.
334
+ * Each user message triggers the stub runner, which appends a canned echo reply.
335
+ */
336
+ export const WithAutoAgent: Story = {
337
+ args: {
338
+ agentMode: 'auto',
339
+ },
340
+ };
341
+
342
+ /**
343
+ * Thread opted in to the AI agent in `auto` mode with the LIVE runner —
344
+ * ThreadPlugin's default `AgentRunner` calls Anthropic Claude via the DXOS
345
+ * edge proxy. Each user message triggers a real LLM response.
346
+ *
347
+ * Note: headless `test-storybook` only renders the story (no comment is
348
+ * submitted) so this variant does not make a network call in CI.
349
+ */
350
+ export const WithLiveAgent: Story = {
351
+ args: {
352
+ agentMode: 'auto',
353
+ liveAgent: true,
354
+ },
355
+ };
@@ -8,25 +8,35 @@ import React, { useCallback, useMemo } from 'react';
8
8
  import { Capabilities } from '@dxos/app-framework';
9
9
  import { useCapabilities, useCapability, useOperationInvoker } from '@dxos/app-framework/ui';
10
10
  import { AppCapabilities, CollaborationOperation, LayoutOperation } from '@dxos/app-toolkit';
11
- import { Filter, Obj, Query, Relation } from '@dxos/echo';
12
- import { Ref, useQuery } from '@dxos/react-client/echo';
11
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
12
+ import { Filter, Obj, Query, Ref, Relation } from '@dxos/echo';
13
+ import { useQuery } from '@dxos/react-client/echo';
13
14
  import { useIdentity } from '@dxos/react-client/halo';
14
15
  import { Panel, ScrollArea, Toolbar, useTranslation } from '@dxos/react-ui';
15
- import { useAttended } from '@dxos/react-ui-attention';
16
+ import { getParentId, useAttention } from '@dxos/react-ui-attention';
16
17
  import { Tabs } from '@dxos/react-ui-tabs';
17
18
  import { AnchoredTo, Thread } from '@dxos/types';
18
19
 
19
- import { CommentsContainer, type CommentsContainerProps } from '../../components';
20
- import { meta } from '../../meta';
21
- import { ThreadCapabilities, ThreadOperation, type ViewState } from '../../types';
20
+ import { CommentsPanel, type CommentsPanelProps } from '#components';
21
+ import { meta } from '#meta';
22
+ import { ThreadOperation } from '#types';
23
+ import { ThreadCapabilities, type ViewState } from '#types';
22
24
 
23
25
  const initialViewState: ViewState = { showResolvedThreads: false };
24
26
 
25
- export const ThreadCompanion = ({ subject }: { subject: any }) => {
27
+ /**
28
+ * Subject is the host object being commented on (e.g. a Markdown.Document),
29
+ * not a Thread — the threads anchored to that host are discovered via the
30
+ * `AnchoredTo` query inside the component.
31
+ */
32
+ export type CommentsCompanionProps = AppSurface.ObjectArticleProps<Obj.Any>;
33
+
34
+ export const CommentsCompanion = ({ attendableId, subject }: CommentsCompanionProps) => {
26
35
  const { t } = useTranslation(meta.id);
27
36
  const { invokePromise } = useOperationInvoker();
28
37
  const identity = useIdentity();
29
- const subjectId = Obj.getDXN(subject).toString();
38
+ const subjectId = Obj.getURI(subject);
39
+ const parentId = attendableId ? getParentId(attendableId) : undefined;
30
40
  const registry = useCapability(Capabilities.AtomRegistry);
31
41
 
32
42
  const stateAtom = useCapability(ThreadCapabilities.State);
@@ -41,20 +51,12 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
41
51
  registry.set(viewStoreAtom, { ...viewStore, [subjectId]: { ...initialViewState } });
42
52
  return initialViewState;
43
53
  }
54
+
44
55
  return viewStore[subjectId];
45
56
  }, [viewStore, subjectId, registry, viewStoreAtom]);
46
57
  const { showResolvedThreads } = viewState;
47
58
 
48
- const onChangeViewState = useCallback(
49
- (nextValue: string) => {
50
- registry.set(viewStoreAtom, {
51
- ...registry.get(viewStoreAtom),
52
- [subjectId]: { ...registry.get(viewStoreAtom)[subjectId], showResolvedThreads: nextValue === 'all' },
53
- });
54
- },
55
- [registry, viewStoreAtom, subjectId],
56
- );
57
-
59
+ const commentConfigs = useCapabilities(AppCapabilities.CommentConfig);
58
60
  const anchorSorts = useCapabilities(AppCapabilities.AnchorSort);
59
61
  const sort = useMemo(
60
62
  () => anchorSorts.find(({ key }) => key === Obj.getTypename(subject))?.sort,
@@ -68,27 +70,45 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
68
70
  .filter((anchor) => Obj.instanceOf(Thread.Thread, Relation.getSource(anchor)))
69
71
  .concat(drafts ?? []);
70
72
 
71
- const attended = useAttended();
73
+ const handleChangeViewState = useCallback(
74
+ (nextValue: string) => {
75
+ registry.set(viewStoreAtom, {
76
+ ...registry.get(viewStoreAtom),
77
+ [subjectId]: { ...registry.get(viewStoreAtom)[subjectId], showResolvedThreads: nextValue === 'all' },
78
+ });
79
+ },
80
+ [registry, viewStoreAtom, subjectId],
81
+ );
82
+
83
+ const { hasAttention, isAncestor, isRelated } = useAttention(parentId);
84
+ const isAttended = hasAttention || isAncestor || isRelated;
72
85
 
73
86
  const handleAttend = useCallback(
74
87
  (anchor: AnchoredTo.AnchoredTo) => {
75
88
  const thread = Relation.getSource(anchor) as Thread.Thread;
76
- const threadId = Obj.getDXN(thread).toString();
89
+ const threadId = Obj.getURI(thread);
77
90
 
78
91
  if (state.current !== threadId) {
79
92
  registry.set(stateAtom, { ...registry.get(stateAtom), current: threadId });
80
93
 
81
- // TODO(wittjosiah): Should this be a thread-specific intent?
82
- // The layout doesn't know about threads and this working depends on other plugins conditionally handling it.
83
- // This may be overloading this intent or highjacking its intended purpose.
84
- void invokePromise(LayoutOperation.ScrollIntoView, {
85
- subject: Obj.getDXN(subject).toString(),
86
- cursor: anchor.anchor,
87
- ref: threadId,
88
- });
94
+ // Scroll plank into view (deck handler).
95
+ void invokePromise(LayoutOperation.ScrollIntoView, { subject: parentId });
96
+
97
+ // Scroll within content to anchor (comment config per typename).
98
+ if (anchor.anchor && parentId) {
99
+ const typename = Obj.getTypename(subject);
100
+ const commentConfig = commentConfigs.find(({ id }) => id === typename);
101
+ if (commentConfig?.scrollToAnchor) {
102
+ void invokePromise(commentConfig.scrollToAnchor, {
103
+ subject: parentId,
104
+ cursor: anchor.anchor,
105
+ ref: threadId,
106
+ });
107
+ }
108
+ }
89
109
  }
90
110
  },
91
- [state.current, invokePromise, subject, registry, stateAtom],
111
+ [state.current, invokePromise, registry, stateAtom, parentId, subject, commentConfigs],
92
112
  );
93
113
 
94
114
  const handleComment = useCallback(
@@ -101,7 +121,7 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
101
121
  });
102
122
 
103
123
  const thread = Relation.getSource(anchor) as Thread.Thread;
104
- registry.set(stateAtom, { ...registry.get(stateAtom), current: Obj.getDXN(thread).toString() });
124
+ registry.set(stateAtom, { ...registry.get(stateAtom), current: Obj.getURI(thread) });
105
125
  },
106
126
  [invokePromise, identity, subject, registry, stateAtom],
107
127
  );
@@ -129,10 +149,10 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
129
149
  [invokePromise, subject],
130
150
  );
131
151
 
132
- const handleAcceptProposal = useCallback<NonNullable<CommentsContainerProps['onAcceptProposal']>>(
152
+ const handleAcceptProposal = useCallback<NonNullable<CommentsPanelProps['onAcceptProposal']>>(
133
153
  async (anchor, messageId) => {
134
154
  const thread = Relation.getSource(anchor) as Thread.Thread;
135
- const messageIndex = thread.messages.findIndex(Ref.hasObjectId(messageId));
155
+ const messageIndex = thread.messages.findIndex(Ref.hasEntityId(messageId));
136
156
  const message = thread.messages[messageIndex]?.target;
137
157
  const proposal = message?.blocks.find((block) => block._tag === 'proposal');
138
158
  if (!proposal || !anchor.anchor) {
@@ -150,9 +170,9 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
150
170
  );
151
171
 
152
172
  const comments = (
153
- <CommentsContainer
173
+ <CommentsPanel
154
174
  anchors={anchors}
155
- currentId={attended.includes(subjectId) ? state.current : undefined}
175
+ currentId={isAttended ? state.current : undefined}
156
176
  showResolvedThreads={showResolvedThreads}
157
177
  onAttend={handleAttend}
158
178
  onComment={handleComment}
@@ -163,22 +183,21 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
163
183
  />
164
184
  );
165
185
 
166
- // TODO(burdon): Root should be headless.
167
186
  return (
168
187
  <Tabs.Root
169
- value={showResolvedThreads ? 'all' : 'unresolved'}
170
188
  orientation='horizontal'
171
- onValueChange={onChangeViewState}
189
+ value={showResolvedThreads ? 'all' : 'unresolved'}
190
+ onValueChange={handleChangeViewState}
172
191
  >
173
192
  <Panel.Root>
174
193
  <Panel.Toolbar asChild>
175
194
  <Toolbar.Root>
176
- <Tabs.Tablist>
177
- <Tabs.Tab value='unresolved' classNames='text-sm'>
178
- {t('show unresolved label')}
195
+ <Tabs.Tablist classNames='p-0'>
196
+ <Tabs.Tab classNames='text-sm' value='unresolved'>
197
+ {t('show-unresolved.label')}
179
198
  </Tabs.Tab>
180
- <Tabs.Tab value='all' classNames='text-sm'>
181
- {t('show all label')}
199
+ <Tabs.Tab classNames='text-sm' value='all'>
200
+ {t('show-all.label')}
182
201
  </Tabs.Tab>
183
202
  </Tabs.Tablist>
184
203
  </Toolbar.Root>
@@ -186,8 +205,8 @@ export const ThreadCompanion = ({ subject }: { subject: any }) => {
186
205
  <Panel.Content asChild>
187
206
  <ScrollArea.Root thin>
188
207
  <ScrollArea.Viewport>
189
- <Tabs.Tabpanel value='all'>{showResolvedThreads && comments}</Tabs.Tabpanel>
190
- <Tabs.Tabpanel value='unresolved'>{!showResolvedThreads && comments}</Tabs.Tabpanel>
208
+ <Tabs.Panel value='all'>{showResolvedThreads && comments}</Tabs.Panel>
209
+ <Tabs.Panel value='unresolved'>{!showResolvedThreads && comments}</Tabs.Panel>
191
210
  </ScrollArea.Viewport>
192
211
  </ScrollArea.Root>
193
212
  </Panel.Content>
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ export { CommentsCompanion as default } from './CommentsCompanion';
@@ -5,60 +5,58 @@
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
- import { Capabilities, Capability, OperationPlugin, RuntimePlugin } from '@dxos/app-framework';
8
+ import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
10
  import { Surface } from '@dxos/app-framework/ui';
11
- import { faker } from '@dxos/random';
11
+ import { corePlugins } from '@dxos/plugin-testing';
12
+ import { random } from '@dxos/random';
12
13
  import { useClient } from '@dxos/react-client';
13
14
  import { type Space } from '@dxos/react-client/echo';
14
15
  import { useIdentity } from '@dxos/react-client/halo';
15
16
  import { withClientProvider } from '@dxos/react-client/testing';
16
17
  import { useAsyncEffect } from '@dxos/react-ui';
17
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
18
  import { Thread as ThreadComponent } from '@dxos/react-ui-thread';
19
- import { render } from '@dxos/storybook-utils';
19
+ import { withLayout, Loading } from '@dxos/react-ui/testing';
20
20
  import { Message, Thread } from '@dxos/types';
21
21
 
22
- import { translations } from '../../translations';
23
- import { Channel } from '../../types';
22
+ import { translations } from '#translations';
24
23
 
25
- import { ChatContainer } from './ChatContainer';
24
+ import { ThreadContainer } from './ThreadContainer';
26
25
 
27
- faker.seed(1);
26
+ random.seed(1);
28
27
 
29
28
  const DefaultStory = () => {
30
29
  const client = useClient();
31
30
  const identity = useIdentity();
32
31
  const [space, setSpace] = useState<Space>();
33
- const [channel, setChannel] = useState<Channel.Channel | null>();
32
+ const [thread, setThread] = useState<Thread.Thread | null>();
34
33
 
35
34
  useAsyncEffect(async () => {
36
35
  if (identity) {
37
36
  const space = await client.spaces.create();
38
- const channel = space.db.add(Channel.make());
37
+ const thread = space.db.add(Thread.make({ status: 'active' }));
39
38
  setSpace(space);
40
- setChannel(channel);
39
+ setThread(thread);
41
40
  }
42
41
  }, [identity]);
43
42
 
44
- if (!identity || !channel || !space || !channel.defaultThread.target) {
45
- return null;
43
+ if (!identity || !thread || !space) {
44
+ return <Loading data={{ identity: !!identity, space: !!space, thread: !!thread }} />;
46
45
  }
47
46
 
48
- return <ChatContainer space={space} thread={channel.defaultThread.target} />;
47
+ return <ThreadContainer space={space} thread={thread} />;
49
48
  };
50
49
 
51
50
  const meta = {
52
- title: 'plugins/plugin-thread/containers/ChatContainer',
51
+ title: 'plugins/plugin-thread/containers/ThreadContainer',
53
52
  component: ThreadComponent.Root as any,
54
- render: render(DefaultStory),
53
+ render: DefaultStory,
55
54
  decorators: [
56
- withTheme(),
57
55
  withLayout({ layout: 'column' }),
58
56
  // TODO(wittjosiah): This shouldn't depend on app framework (use withClientProvider instead).
59
57
  // Currently this is required due to useOnEditAnalytics.
60
58
  withPluginManager({
61
- plugins: [OperationPlugin(), RuntimePlugin()],
59
+ plugins: corePlugins(),
62
60
  capabilities: [
63
61
  Capability.contributes(
64
62
  Capabilities.ReactSurface,
@@ -72,7 +70,7 @@ const meta = {
72
70
  }),
73
71
  withClientProvider({
74
72
  createSpace: true,
75
- types: [Thread.Thread, Channel.Channel, Message.Message],
73
+ types: [Thread.Thread, Message.Message],
76
74
  }),
77
75
  ],
78
76
  parameters: {