@dxos/plugin-assistant 0.8.4-main.74a063c4e0 → 0.8.4-main.765dc60934

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 (640) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs +169 -0
  4. package/dist/lib/neutral/AgentArticle-5XDDEXMP.mjs.map +7 -0
  5. package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs +100 -0
  6. package/dist/lib/neutral/AgentProperties-CNH4JMDZ.mjs.map +7 -0
  7. package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
  8. package/dist/lib/neutral/AssistantPlugin.node.mjs +46 -0
  9. package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
  10. package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
  11. package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
  12. package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs +27 -0
  13. package/dist/lib/neutral/BlueprintArticle-U7LUBFOS.mjs.map +7 -0
  14. package/dist/lib/neutral/ChatArticle-WVAFZPVI.mjs +8 -0
  15. package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs +133 -0
  16. package/dist/lib/neutral/ChatCompanion-DFRMRUK3.mjs.map +7 -0
  17. package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs +72 -0
  18. package/dist/lib/neutral/ChatDialog-QKZLG7SQ.mjs.map +7 -0
  19. package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
  20. package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
  21. package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs +116 -0
  22. package/dist/lib/neutral/RoutineArticle-H7ECM7AH.mjs.map +7 -0
  23. package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs +48 -0
  24. package/dist/lib/neutral/RoutineList-CLDXGQUD.mjs.map +7 -0
  25. package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs +565 -0
  26. package/dist/lib/neutral/TracePanel-HYVPDIAA.mjs.map +7 -0
  27. package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs +92 -0
  28. package/dist/lib/neutral/TriggerStatus-WTFYUIG5.mjs.map +7 -0
  29. package/dist/lib/neutral/ai-service-GJXMI5OI.mjs +22 -0
  30. package/dist/lib/neutral/ai-service-GJXMI5OI.mjs.map +7 -0
  31. package/dist/lib/neutral/app-graph-builder-QNKVSPPG.mjs +187 -0
  32. package/dist/lib/neutral/app-graph-builder-QNKVSPPG.mjs.map +7 -0
  33. package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs +32 -0
  34. package/dist/lib/neutral/blueprint-definition-VXJYQ5AE.mjs.map +7 -0
  35. package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
  36. package/dist/lib/neutral/capabilities/index.mjs +35 -0
  37. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  38. package/dist/lib/neutral/chunk-4CQZCMRP.mjs +25 -0
  39. package/dist/lib/neutral/chunk-4CQZCMRP.mjs.map +7 -0
  40. package/dist/lib/{browser/chunk-EZRS3J25.mjs → neutral/chunk-5H6UJHLF.mjs} +3 -3
  41. package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
  42. package/dist/lib/neutral/chunk-CU5S7SGF.mjs +8 -0
  43. package/dist/lib/neutral/chunk-CU5S7SGF.mjs.map +7 -0
  44. package/dist/lib/neutral/chunk-ITJX2YZZ.mjs +98 -0
  45. package/dist/lib/neutral/chunk-ITJX2YZZ.mjs.map +7 -0
  46. package/dist/lib/neutral/chunk-SLIPV6NN.mjs +106 -0
  47. package/dist/lib/neutral/chunk-SLIPV6NN.mjs.map +7 -0
  48. package/dist/lib/neutral/chunk-VHPTYKYD.mjs +361 -0
  49. package/dist/lib/neutral/chunk-VHPTYKYD.mjs.map +7 -0
  50. package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs +116 -0
  51. package/dist/lib/neutral/companion-chat-provisioner-2Y6PRSDK.mjs.map +7 -0
  52. package/dist/lib/neutral/components/index.mjs +2298 -0
  53. package/dist/lib/neutral/components/index.mjs.map +7 -0
  54. package/dist/lib/neutral/containers/index.mjs +29 -0
  55. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  56. package/dist/lib/{browser/create-chat-DF5TG5XC.mjs → neutral/create-chat-QQZURUBW.mjs} +16 -27
  57. package/dist/lib/neutral/create-chat-QQZURUBW.mjs.map +7 -0
  58. package/dist/lib/neutral/create-object-UZCJCPWM.mjs +93 -0
  59. package/dist/lib/neutral/create-object-UZCJCPWM.mjs.map +7 -0
  60. package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs +21 -0
  61. package/dist/lib/neutral/edge-model-resolver-XDNBZ3US.mjs.map +7 -0
  62. package/dist/lib/{browser/ensure-companion-chat-FR4AWZ2P.mjs → neutral/ensure-companion-chat-5S4LZM2H.mjs} +10 -17
  63. package/dist/lib/neutral/ensure-companion-chat-5S4LZM2H.mjs.map +7 -0
  64. package/dist/lib/neutral/hooks/index.mjs +927 -0
  65. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  66. package/dist/lib/neutral/index.mjs +32 -0
  67. package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
  68. package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
  69. package/dist/lib/neutral/markdown-KTBFOMFM.mjs +110 -0
  70. package/dist/lib/neutral/markdown-KTBFOMFM.mjs.map +7 -0
  71. package/dist/lib/neutral/meta.json +1 -0
  72. package/dist/lib/neutral/meta.mjs +12 -0
  73. package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
  74. package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
  75. package/dist/lib/{browser/on-create-space-54RNX5JI.mjs → neutral/on-create-space-Q2R7OSP6.mjs} +5 -8
  76. package/dist/lib/neutral/on-create-space-Q2R7OSP6.mjs.map +7 -0
  77. package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
  78. package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
  79. package/dist/lib/neutral/operations/index.mjs +8 -0
  80. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  81. package/dist/lib/neutral/plugin.mjs +16 -0
  82. package/dist/lib/neutral/plugin.mjs.map +7 -0
  83. package/dist/lib/neutral/react-surface-T4R65UJU.mjs +174 -0
  84. package/dist/lib/neutral/react-surface-T4R65UJU.mjs.map +7 -0
  85. package/dist/lib/{browser/resolve-navigation-targets-NZOD66NY.mjs → neutral/resolve-navigation-targets-VXBSWV5L.mjs} +4 -6
  86. package/dist/lib/neutral/resolve-navigation-targets-VXBSWV5L.mjs.map +7 -0
  87. package/dist/lib/{browser/run-prompt-in-new-chat-4YQ37XIS.mjs → neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs} +18 -51
  88. package/dist/lib/neutral/run-prompt-in-new-chat-VJXXZ6SI.mjs.map +7 -0
  89. package/dist/lib/{browser/set-current-chat-WJI3WAVM.mjs → neutral/set-current-chat-ZFDCYK5I.mjs} +5 -11
  90. package/dist/lib/neutral/set-current-chat-ZFDCYK5I.mjs.map +7 -0
  91. package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
  92. package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
  93. package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
  94. package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
  95. package/dist/lib/neutral/testing.mjs +8 -0
  96. package/dist/lib/neutral/testing.mjs.map +7 -0
  97. package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
  98. package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
  99. package/dist/lib/neutral/translations.mjs +174 -0
  100. package/dist/lib/neutral/translations.mjs.map +7 -0
  101. package/dist/lib/neutral/types/index.mjs +20 -0
  102. package/dist/lib/neutral/types/index.mjs.map +7 -0
  103. package/dist/lib/{browser/update-chat-name-3Y36KFAS.mjs → neutral/update-chat-name-ENXRUMDJ.mjs} +8 -25
  104. package/dist/lib/neutral/update-chat-name-ENXRUMDJ.mjs.map +7 -0
  105. package/dist/types/src/AssistantPlugin.d.ts +1 -0
  106. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  107. package/dist/types/src/AssistantPlugin.node.d.ts +4 -0
  108. package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
  109. package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
  110. package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
  111. package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
  112. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  114. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  116. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/create-object.d.ts +31 -0
  118. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  120. package/dist/types/src/capabilities/index.d.ts +30 -16
  121. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  122. package/dist/types/src/capabilities/local-model-resolver.d.ts +6 -3
  123. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  124. package/dist/types/src/capabilities/markdown.d.ts.map +1 -1
  125. package/dist/types/src/capabilities/migrations.d.ts +2 -1
  126. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  127. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  128. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  129. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  130. package/dist/types/src/capabilities/settings.d.ts +1 -13
  131. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  132. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  133. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  134. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
  135. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  136. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +1 -503
  137. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
  138. package/dist/types/src/components/Chat/Chat.d.ts +38 -50
  139. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  140. package/dist/types/src/components/Chat/context.d.ts +29 -0
  141. package/dist/types/src/components/Chat/context.d.ts.map +1 -0
  142. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  143. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
  144. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
  145. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +8 -4
  146. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  147. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
  148. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
  149. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  150. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
  151. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
  152. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
  153. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  154. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
  155. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
  156. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  157. package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
  158. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  159. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
  160. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
  161. package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
  162. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  163. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +7 -509
  164. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  165. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  166. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
  167. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
  168. package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
  169. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  170. package/dist/types/src/components/ChatThread/sync.d.ts +40 -13
  171. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  172. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
  173. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
  174. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
  175. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
  176. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
  177. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
  178. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
  179. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
  180. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
  181. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
  182. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
  183. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
  184. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +12 -0
  185. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
  186. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
  187. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
  188. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
  189. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
  190. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
  191. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
  192. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
  193. package/dist/types/src/components/ChatThread/widgets/index.d.ts +1 -1
  194. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
  195. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +2 -5
  196. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
  197. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
  198. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
  199. package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
  200. package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
  201. package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
  202. package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
  203. package/dist/types/src/components/TaskList/index.d.ts +2 -0
  204. package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
  205. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -6
  206. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  207. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -503
  208. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  209. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +4 -5
  210. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  211. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +2 -504
  212. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  213. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  214. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
  215. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
  216. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  217. package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -7
  218. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  219. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -503
  220. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  221. package/dist/types/src/components/index.d.ts +1 -0
  222. package/dist/types/src/components/index.d.ts.map +1 -1
  223. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
  224. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
  225. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
  226. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
  227. package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
  228. package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
  229. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
  230. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
  231. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
  232. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
  233. package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
  234. package/dist/types/src/containers/{ProjectSettings → AgentProperties}/index.d.ts.map +1 -1
  235. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
  236. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
  237. package/dist/types/src/containers/{ChatContainer/ChatContainer.d.ts → ChatArticle/ChatArticle.d.ts} +3 -3
  238. package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
  239. package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
  240. package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
  241. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +1 -1
  242. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
  243. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
  244. package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
  245. package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
  246. package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
  247. package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
  248. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
  249. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
  250. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
  251. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
  252. package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
  253. package/dist/types/src/containers/{ProjectArticle → RoutineArticle}/index.d.ts.map +1 -1
  254. package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
  255. package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
  256. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
  257. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
  258. package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
  259. package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
  260. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +6 -4
  261. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
  262. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +13 -0
  263. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
  264. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +1 -1
  265. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
  266. package/dist/types/src/containers/TracePanel/execution-graph.d.ts +97 -0
  267. package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
  268. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
  269. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
  270. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
  271. package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
  272. package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
  273. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
  274. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
  275. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
  276. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
  277. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +3 -2
  278. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
  279. package/dist/types/src/containers/TriggerStatus/index.d.ts +1 -1
  280. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -1
  281. package/dist/types/src/containers/index.d.ts +6 -5
  282. package/dist/types/src/containers/index.d.ts.map +1 -1
  283. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
  284. package/dist/types/src/feed-logger.d.ts +13 -0
  285. package/dist/types/src/feed-logger.d.ts.map +1 -0
  286. package/dist/types/src/hooks/index.d.ts +2 -0
  287. package/dist/types/src/hooks/index.d.ts.map +1 -1
  288. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +4 -4
  289. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  290. package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
  291. package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
  292. package/dist/types/src/hooks/useChatProcessor.d.ts +2 -2
  293. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  294. package/dist/types/src/hooks/useChatServices.d.ts +1 -1
  295. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  296. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  297. package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
  298. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  299. package/dist/types/src/hooks/useContextObjects.d.ts +2 -2
  300. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  301. package/dist/types/src/hooks/useDebug.d.ts +10 -0
  302. package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
  303. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
  304. package/dist/types/src/hooks/useFlush.d.ts +1 -1
  305. package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
  306. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  307. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  308. package/dist/types/src/index.d.ts +0 -4
  309. package/dist/types/src/index.d.ts.map +1 -1
  310. package/dist/types/src/operations/create-chat.d.ts +3 -3
  311. package/dist/types/src/operations/create-chat.d.ts.map +1 -1
  312. package/dist/types/src/operations/ensure-companion-chat.d.ts +3 -3
  313. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
  314. package/dist/types/src/operations/index.d.ts +1 -2
  315. package/dist/types/src/operations/index.d.ts.map +1 -1
  316. package/dist/types/src/operations/on-create-space.d.ts +3 -3
  317. package/dist/types/src/operations/on-create-space.d.ts.map +1 -1
  318. package/dist/types/src/operations/prompt.test.d.ts +2 -0
  319. package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
  320. package/dist/types/src/operations/resolve-navigation-targets.d.ts +1 -1
  321. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
  322. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +3 -3
  323. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
  324. package/dist/types/src/operations/set-current-chat.d.ts +3 -3
  325. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
  326. package/dist/types/src/operations/update-chat-name.d.ts +3 -3
  327. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
  328. package/dist/types/src/plugin.d.ts +4 -0
  329. package/dist/types/src/plugin.d.ts.map +1 -0
  330. package/dist/types/src/processor/presets.d.ts +1 -1
  331. package/dist/types/src/processor/presets.d.ts.map +1 -1
  332. package/dist/types/src/processor/processor.d.ts +31 -13
  333. package/dist/types/src/processor/processor.d.ts.map +1 -1
  334. package/dist/types/src/testing/index.d.ts +1 -0
  335. package/dist/types/src/testing/index.d.ts.map +1 -1
  336. package/dist/types/src/testing/test-generator.d.ts +2 -3
  337. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  338. package/dist/types/src/testing/test-generator.test.d.ts +2 -0
  339. package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
  340. package/dist/types/src/testing/test-sequence.d.ts +3 -3
  341. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  342. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  343. package/dist/types/src/testing/test-trace.d.ts +5 -0
  344. package/dist/types/src/testing/test-trace.d.ts.map +1 -0
  345. package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
  346. package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
  347. package/dist/types/src/testing.d.ts +2 -0
  348. package/dist/types/src/testing.d.ts.map +1 -0
  349. package/dist/types/src/translations.d.ts +2 -503
  350. package/dist/types/src/translations.d.ts.map +1 -1
  351. package/dist/types/src/types/Assistant.d.ts +22 -6
  352. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  353. package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
  354. package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
  355. package/dist/types/src/types/AssistantEvents.d.ts +3 -0
  356. package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
  357. package/dist/types/src/{operations/definitions.d.ts → types/AssistantOperation.d.ts} +26 -20
  358. package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
  359. package/dist/types/src/types/Settings.d.ts +22 -6
  360. package/dist/types/src/types/Settings.d.ts.map +1 -1
  361. package/dist/types/src/types/index.d.ts +3 -3
  362. package/dist/types/src/types/index.d.ts.map +1 -1
  363. package/dist/types/src/types/service.d.ts +1 -1
  364. package/dist/types/src/types/service.d.ts.map +1 -1
  365. package/dist/types/src/util/suggestions.d.ts +9 -0
  366. package/dist/types/src/util/suggestions.d.ts.map +1 -0
  367. package/dist/types/src/util/suggestions.test.d.ts +2 -0
  368. package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
  369. package/dist/types/tsconfig.tsbuildinfo +1 -1
  370. package/package.json +163 -124
  371. package/src/AssistantPlugin.node.ts +44 -0
  372. package/src/AssistantPlugin.test.ts +35 -0
  373. package/src/AssistantPlugin.ts +126 -0
  374. package/src/blueprints/assistant/blueprint.test.ts +3 -3
  375. package/src/blueprints/assistant/blueprint.ts +4 -4
  376. package/src/capabilities/app-graph-builder.ts +32 -57
  377. package/src/capabilities/blueprint-definition.ts +10 -12
  378. package/src/capabilities/companion-chat-provisioner.ts +4 -5
  379. package/src/capabilities/create-object.ts +107 -0
  380. package/src/capabilities/index.ts +3 -1
  381. package/src/capabilities/local-model-resolver.ts +14 -4
  382. package/src/capabilities/markdown.ts +1 -1
  383. package/src/capabilities/migrations.ts +4 -10
  384. package/src/capabilities/operation-handler.ts +1 -1
  385. package/src/capabilities/react-surface.tsx +57 -39
  386. package/src/capabilities/toolkit.ts +2 -2
  387. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
  388. package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
  389. package/src/components/Chat/Chat.tsx +105 -279
  390. package/src/components/Chat/context.ts +39 -0
  391. package/src/components/ChatPrompt/ChatActions.tsx +10 -10
  392. package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
  393. package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
  394. package/src/components/ChatPrompt/ChatOptions.tsx +238 -45
  395. package/src/components/ChatPrompt/ChatPrompt.tsx +182 -0
  396. package/src/components/ChatPrompt/ChatReferences.tsx +4 -4
  397. package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
  398. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
  399. package/src/components/ChatPrompt/index.ts +3 -0
  400. package/src/components/ChatThread/Anchor.stories.tsx +95 -0
  401. package/src/components/ChatThread/ChatThread.stories.tsx +48 -42
  402. package/src/components/ChatThread/ChatThread.tsx +36 -21
  403. package/src/components/ChatThread/DEBUG.md +41 -0
  404. package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
  405. package/src/components/ChatThread/registry.tsx +106 -24
  406. package/src/components/ChatThread/sync.test.ts +179 -21
  407. package/src/components/ChatThread/sync.ts +89 -87
  408. package/src/components/ChatThread/testing/reasoning.md +25 -0
  409. package/src/components/ChatThread/testing/thinking.md +21 -0
  410. package/src/components/ChatThread/testing/thread-1.md +13 -0
  411. package/src/components/ChatThread/testing/thread-2.md +19 -0
  412. package/src/components/ChatThread/testing/thread-widgets.md +79 -0
  413. package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
  414. package/src/components/ChatThread/tool-widget-state.ts +48 -0
  415. package/src/components/ChatThread/widgets/FallbackWidget.tsx +5 -3
  416. package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
  417. package/src/components/ChatThread/widgets/ReasoningWidget.ts +19 -6
  418. package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
  419. package/src/components/ChatThread/widgets/SelectWidget.ts +3 -1
  420. package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
  421. package/src/components/ChatThread/widgets/StatusWidget.ts +53 -0
  422. package/src/components/ChatThread/widgets/SuggestionWidget.ts +1 -1
  423. package/src/components/ChatThread/widgets/SummaryWidget.tsx +3 -4
  424. package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
  425. package/src/components/ChatThread/widgets/ToolWidget.tsx +26 -13
  426. package/src/components/ChatThread/widgets/defaults.ts +8 -0
  427. package/src/components/ChatThread/widgets/index.ts +1 -1
  428. package/src/components/ProcessTree/ProcessTree.stories.tsx +12 -38
  429. package/src/components/ProcessTree/ProcessTree.tsx +72 -38
  430. package/src/components/TaskList/TaskList.stories.tsx +44 -0
  431. package/src/components/TaskList/TaskList.tsx +45 -0
  432. package/src/components/{Typewriter → TaskList}/index.ts +1 -1
  433. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -3
  434. package/src/components/TemplateEditor/TemplateEditor.tsx +5 -5
  435. package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -9
  436. package/src/components/TemplateEditor/TemplateForm.tsx +51 -72
  437. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +1 -1
  438. package/src/components/ToolBlock/ToolBlock.tsx +2 -2
  439. package/src/components/Toolbox/Toolbox.stories.tsx +6 -5
  440. package/src/components/Toolbox/Toolbox.tsx +4 -4
  441. package/src/components/index.ts +1 -0
  442. package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
  443. package/src/containers/AgentArticle/AgentArticle.tsx +204 -0
  444. package/src/containers/AgentArticle/index.ts +5 -0
  445. package/src/containers/AgentProperties/AgentProperties.stories.tsx +101 -0
  446. package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
  447. package/src/containers/AgentProperties/index.ts +5 -0
  448. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +1 -1
  449. package/src/containers/{ChatContainer/ChatContainer.tsx → ChatArticle/ChatArticle.tsx} +22 -10
  450. package/src/containers/ChatArticle/index.ts +5 -0
  451. package/src/containers/ChatCompanion/ChatCompanion.tsx +21 -30
  452. package/src/containers/ChatDialog/ChatDialog.tsx +3 -9
  453. package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
  454. package/src/containers/PlanArticle/index.ts +5 -0
  455. package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
  456. package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
  457. package/src/containers/RoutineArticle/index.ts +5 -0
  458. package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +14 -13
  459. package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +8 -7
  460. package/src/containers/RoutineList/index.ts +5 -0
  461. package/src/containers/TracePanel/TracePanel.stories.tsx +285 -0
  462. package/src/containers/TracePanel/TracePanel.tsx +128 -266
  463. package/src/containers/TracePanel/dxn-extractor.test.ts +7 -7
  464. package/src/containers/TracePanel/dxn-extractor.ts +11 -11
  465. package/src/containers/TracePanel/execution-graph.test.ts +382 -0
  466. package/src/containers/TracePanel/execution-graph.ts +621 -0
  467. package/src/containers/TracePanel/testing/index.ts +6 -0
  468. package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
  469. package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
  470. package/src/containers/TriggerStatus/TriggerStatus.tsx +19 -34
  471. package/src/containers/TriggerStatus/index.ts +1 -1
  472. package/src/containers/index.ts +6 -5
  473. package/src/{queue-logger.ts → feed-logger.ts} +45 -24
  474. package/src/hooks/index.ts +2 -0
  475. package/src/hooks/useBlueprintRegistry.ts +13 -7
  476. package/src/hooks/useChatKeymap.ts +52 -0
  477. package/src/hooks/useChatProcessor.ts +12 -12
  478. package/src/hooks/useChatServices.ts +1 -1
  479. package/src/hooks/useChatToolbarActions.ts +86 -88
  480. package/src/hooks/useContextBinder.ts +4 -4
  481. package/src/hooks/useContextObjects.ts +2 -2
  482. package/src/hooks/useDebug.ts +38 -0
  483. package/src/index.ts +0 -5
  484. package/src/meta.ts +1 -1
  485. package/src/operations/create-chat.ts +21 -17
  486. package/src/operations/ensure-companion-chat.ts +49 -47
  487. package/src/operations/index.ts +1 -3
  488. package/src/operations/on-create-space.ts +4 -4
  489. package/src/operations/prompt.test.ts +77 -0
  490. package/src/operations/resolve-navigation-targets.ts +3 -3
  491. package/src/operations/run-prompt-in-new-chat.ts +86 -86
  492. package/src/operations/set-current-chat.ts +4 -5
  493. package/src/operations/update-chat-name.ts +4 -4
  494. package/src/plugin.ts +11 -0
  495. package/src/processor/presets.ts +11 -3
  496. package/src/processor/processor.test.ts +4 -4
  497. package/src/processor/processor.ts +54 -38
  498. package/src/testing/data/trace-timeline.dx.json +4657 -0
  499. package/src/testing/index.ts +1 -0
  500. package/src/testing/test-generator.test.ts +70 -0
  501. package/src/testing/test-generator.ts +213 -191
  502. package/src/testing/test-sequence.ts +3 -3
  503. package/src/testing/test-trace.ts +20 -0
  504. package/src/testing/trace-timeline.conversations.json +1 -0
  505. package/src/testing/trace-timeline.test.ts +250 -0
  506. package/src/testing.ts +7 -0
  507. package/src/translations.ts +74 -49
  508. package/src/types/Assistant.ts +13 -1
  509. package/src/types/AssistantCapabilities.ts +35 -0
  510. package/src/types/AssistantEvents.ts +11 -0
  511. package/src/{operations/definitions.ts → types/AssistantOperation.ts} +5 -4
  512. package/src/types/Settings.ts +63 -8
  513. package/src/types/index.ts +5 -3
  514. package/src/types/service.ts +1 -1
  515. package/src/util/suggestions.test.ts +52 -0
  516. package/src/util/suggestions.ts +42 -0
  517. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
  518. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
  519. package/dist/lib/browser/chunk-ATHYBVGN.mjs +0 -176
  520. package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
  521. package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
  522. package/dist/lib/browser/chunk-RUV2WOQH.mjs +0 -154
  523. package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +0 -7
  524. package/dist/lib/browser/create-chat-DF5TG5XC.mjs.map +0 -7
  525. package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +0 -7
  526. package/dist/lib/browser/index.mjs +0 -3122
  527. package/dist/lib/browser/index.mjs.map +0 -7
  528. package/dist/lib/browser/meta.json +0 -1
  529. package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +0 -7
  530. package/dist/lib/browser/operations/index.mjs +0 -13
  531. package/dist/lib/browser/operations/index.mjs.map +0 -7
  532. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +0 -7
  533. package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +0 -7
  534. package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +0 -7
  535. package/dist/lib/browser/types/index.mjs +0 -20
  536. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
  537. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
  538. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
  539. package/dist/lib/node-esm/blueprints/index.mjs +0 -9
  540. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  541. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
  542. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
  543. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +0 -177
  544. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
  545. package/dist/lib/node-esm/chunk-PY4X6FJT.mjs +0 -155
  546. package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +0 -7
  547. package/dist/lib/node-esm/create-chat-RAV7IX2S.mjs +0 -83
  548. package/dist/lib/node-esm/create-chat-RAV7IX2S.mjs.map +0 -7
  549. package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs +0 -66
  550. package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +0 -7
  551. package/dist/lib/node-esm/index.mjs +0 -3123
  552. package/dist/lib/node-esm/index.mjs.map +0 -7
  553. package/dist/lib/node-esm/meta.json +0 -1
  554. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +0 -23
  555. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +0 -7
  556. package/dist/lib/node-esm/operations/index.mjs +0 -14
  557. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  558. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +0 -23
  559. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +0 -7
  560. package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs +0 -137
  561. package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +0 -7
  562. package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs +0 -55
  563. package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +0 -7
  564. package/dist/lib/node-esm/types/index.mjs +0 -21
  565. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +0 -72
  566. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
  567. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
  568. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
  569. package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
  570. package/dist/types/src/components/ChatProgress/index.d.ts.map +0 -1
  571. package/dist/types/src/components/ChatThread/ChatStream.stories.d.ts +0 -530
  572. package/dist/types/src/components/ChatThread/ChatStream.stories.d.ts.map +0 -1
  573. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +0 -14
  574. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
  575. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +0 -12
  576. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +0 -1
  577. package/dist/types/src/components/Typewriter/Typewriter.d.ts +0 -11
  578. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +0 -1
  579. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +0 -7
  580. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +0 -1
  581. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +0 -5
  582. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +0 -1
  583. package/dist/types/src/components/Typewriter/index.d.ts +0 -2
  584. package/dist/types/src/components/Typewriter/index.d.ts.map +0 -1
  585. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
  586. package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
  587. package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
  588. package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts +0 -6
  589. package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts.map +0 -1
  590. package/dist/types/src/containers/ProjectArticle/index.d.ts +0 -2
  591. package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts +0 -6
  592. package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts.map +0 -1
  593. package/dist/types/src/containers/ProjectSettings/index.d.ts +0 -2
  594. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
  595. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
  596. package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
  597. package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
  598. package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
  599. package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
  600. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +0 -523
  601. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
  602. package/dist/types/src/containers/PromptList/index.d.ts +0 -2
  603. package/dist/types/src/containers/PromptList/index.d.ts.map +0 -1
  604. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  605. package/dist/types/src/queue-logger.d.ts +0 -11
  606. package/dist/types/src/queue-logger.d.ts.map +0 -1
  607. package/dist/types/src/types/capabilities.d.ts +0 -44
  608. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  609. package/dist/types/src/types/defs.d.ts +0 -2
  610. package/dist/types/src/types/defs.d.ts.map +0 -1
  611. package/dist/types/src/types/events.d.ts +0 -5
  612. package/dist/types/src/types/events.d.ts.map +0 -1
  613. package/src/AssistantPlugin.tsx +0 -235
  614. package/src/blueprints/assistant/blueprint.conversations.json +0 -1
  615. package/src/components/ChatProgress/ChatProgress.tsx +0 -56
  616. package/src/components/ChatProgress/index.ts +0 -5
  617. package/src/components/ChatThread/ChatStream.stories.tsx +0 -168
  618. package/src/components/ChatThread/widgets/PromptWidget.ts +0 -28
  619. package/src/components/Typewriter/AssistantToolbar.tsx +0 -161
  620. package/src/components/Typewriter/Typewriter.stories.tsx +0 -86
  621. package/src/components/Typewriter/Typewriter.tsx +0 -50
  622. package/src/components/Typewriter/assistant-extension.tsx +0 -141
  623. package/src/containers/ChatContainer/index.ts +0 -5
  624. package/src/containers/ProjectArticle/ProjectArticle.tsx +0 -131
  625. package/src/containers/ProjectArticle/index.ts +0 -5
  626. package/src/containers/ProjectSettings/ProjectSettings.tsx +0 -139
  627. package/src/containers/ProjectSettings/index.ts +0 -5
  628. package/src/containers/PromptArticle/PromptArticle.tsx +0 -59
  629. package/src/containers/PromptArticle/index.ts +0 -5
  630. package/src/containers/PromptList/index.ts +0 -5
  631. package/src/types/capabilities.ts +0 -35
  632. package/src/types/defs.ts +0 -5
  633. package/src/types/events.ts +0 -11
  634. /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
  635. /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChatArticle-WVAFZPVI.mjs.map} +0 -0
  636. /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  637. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  638. /package/dist/lib/{node-esm/blueprints/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  639. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
  640. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
@@ -0,0 +1,182 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useAtomValue } from '@effect-atom/atom-react';
6
+ import * as Option from 'effect/Option';
7
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
8
+
9
+ import { type Chat } from '@dxos/assistant-toolkit';
10
+ import { type Event } from '@dxos/async';
11
+ import { type Database } from '@dxos/echo';
12
+ import { type Merge } from '@dxos/effect';
13
+ import { useVoiceInput } from '@dxos/plugin-transcription';
14
+ import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
15
+ import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
16
+ import { mx } from '@dxos/ui-theme';
17
+
18
+ import { useChatKeymapExtensions } from '#hooks';
19
+ import { meta } from '#meta';
20
+
21
+ import { type AiChatProcessor } from '../../processor';
22
+ import { type ChatEvent } from '../Chat/events';
23
+ import { ChatActions, type ChatActionsProps } from './ChatActions';
24
+ import { ChatMcpErrors } from './ChatMcpErrors';
25
+ import { ChatOptions } from './ChatOptions';
26
+ import { type ChatPresetsProps } from './ChatPresets';
27
+ import { ChatReferences } from './ChatReferences';
28
+ import { ChatStatusIndicator } from './ChatStatusIndicator';
29
+
30
+ export type ChatPromptProps = ThemedClassName<
31
+ Merge<
32
+ {
33
+ outline?: boolean;
34
+ settings?: boolean;
35
+ expandable?: boolean;
36
+ chat?: Chat.Chat;
37
+ db?: Database.Database;
38
+ processor: AiChatProcessor;
39
+ event: Event<ChatEvent>;
40
+ online?: boolean;
41
+ placeholder?: ChatEditorProps['placeholder'];
42
+ onOnlineChange?: (online: boolean) => void;
43
+ onPresetChange?: ChatPresetsProps['onChange'];
44
+ },
45
+ Omit<ChatPresetsProps, 'onChange'>
46
+ >
47
+ >;
48
+
49
+ export const ChatPrompt = ({
50
+ classNames,
51
+ outline,
52
+ chat,
53
+ db,
54
+ processor,
55
+ event,
56
+ online,
57
+ placeholder,
58
+ onOnlineChange,
59
+ onPresetChange,
60
+ settings = true,
61
+ presets,
62
+ preset,
63
+ }: ChatPromptProps) => {
64
+ const { t } = useTranslation(meta.id);
65
+
66
+ const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
67
+ const streaming = useAtomValue(processor.streaming);
68
+ const active = useAtomValue(processor.active);
69
+ const activeRef = useDynamicRef(active);
70
+
71
+ const editorRef = useRef<ChatEditorController>(null);
72
+ const [recordingState, setRecordingState] = useState(false);
73
+ useEffect(() => {
74
+ return event.on((ev) => {
75
+ switch (ev.type) {
76
+ case 'update-prompt':
77
+ if (!editorRef.current?.getText()?.length) {
78
+ editorRef.current?.setText(ev.text);
79
+ editorRef.current?.focus();
80
+ }
81
+ break;
82
+ case 'record-start':
83
+ setRecordingState(true);
84
+ break;
85
+ case 'record-stop':
86
+ setRecordingState(false);
87
+ break;
88
+ }
89
+ });
90
+ }, [event]);
91
+
92
+ // TODO(burdon): Configure capability in TranscriptionPlugin.
93
+ const { recording } = useVoiceInput({
94
+ active: recordingState,
95
+ onUpdate: (text) => {
96
+ editorRef.current?.setText(text);
97
+ editorRef.current?.focus();
98
+ },
99
+ });
100
+
101
+ const extensions = useChatKeymapExtensions({ event });
102
+
103
+ const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
104
+ (text) => {
105
+ if (!activeRef.current) {
106
+ event.emit({ type: 'submit', text });
107
+ return true;
108
+ }
109
+ },
110
+ [event],
111
+ );
112
+
113
+ const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
114
+ (ev) => {
115
+ event.emit(ev);
116
+ },
117
+ [event],
118
+ );
119
+
120
+ return (
121
+ <div
122
+ role='group'
123
+ className={mx(
124
+ 'flex flex-col w-full dx-density-fine',
125
+ outline &&
126
+ 'bg-group-surface rounded-sm! border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator',
127
+ classNames,
128
+ )}
129
+ >
130
+ <ChatMcpErrors processor={processor} />
131
+
132
+ <div className='flex p-2 gap-2'>
133
+ <ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
134
+ <ChatEditor
135
+ ref={editorRef}
136
+ autoFocus
137
+ lineWrapping
138
+ classNames='col-span-2 pt-0.5'
139
+ placeholder={placeholder ?? t('prompt.placeholder')}
140
+ extensions={extensions}
141
+ onSubmit={handleSubmit}
142
+ />
143
+ </div>
144
+
145
+ {db && settings && (
146
+ <div className='flex items-center overflow-hidden p-1.5'>
147
+ <ChatOptions
148
+ chat={chat}
149
+ db={db}
150
+ blueprintRegistry={processor.blueprintRegistry}
151
+ context={processor.context}
152
+ preset={preset}
153
+ presets={presets}
154
+ onPresetChange={onPresetChange}
155
+ />
156
+
157
+ <div className='flex h-8 grow overflow-x-auto scrollbar-none'>
158
+ <ChatReferences db={db} context={processor.context} />
159
+ </div>
160
+
161
+ <ChatActions
162
+ classNames='col-span-2'
163
+ microphone={true}
164
+ recording={recording}
165
+ processing={streaming}
166
+ onEvent={handleEvent}
167
+ >
168
+ {/* TODO(burdon): Move offline switch into dialog. */}
169
+ {online !== undefined && (
170
+ <Input.Root>
171
+ <Input.Label srOnly>{t('online-switch.label')}</Input.Label>
172
+ <Input.Switch classNames='mx-1' checked={online} onCheckedChange={onOnlineChange} />
173
+ </Input.Root>
174
+ )}
175
+ </ChatActions>
176
+ </div>
177
+ )}
178
+ </div>
179
+ );
180
+ };
181
+
182
+ ChatPrompt.displayName = 'Chat.Prompt';
@@ -5,7 +5,7 @@
5
5
  import * as Option from 'effect/Option';
6
6
  import React from 'react';
7
7
 
8
- import { type AiContextBinder } from '@dxos/assistant';
8
+ import { type AiContext } from '@dxos/assistant';
9
9
  import { Annotation, type Database, Obj } from '@dxos/echo';
10
10
  import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
11
11
  import { getStyles, mx } from '@dxos/ui-theme';
@@ -14,7 +14,7 @@ import { useContextObjects } from '#hooks';
14
14
  import { meta } from '#meta';
15
15
 
16
16
  export type ChatReferencesProps = ThemedClassName<{
17
- context: AiContextBinder;
17
+ context: AiContext.Binder;
18
18
  db: Database.Database;
19
19
  }>;
20
20
 
@@ -35,13 +35,13 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
35
35
  const styles = hue ? getStyles(hue) : undefined;
36
36
  return (
37
37
  <li key={dxn.toString()} className='dx-tag py-0 ps-2 flex items-center gap-1' data-hue='neutral'>
38
- <Icon icon={icon} size={4} classNames={styles?.surfaceText} />
38
+ <Icon icon={icon} size={4} classNames={styles?.foreground} />
39
39
  {toLocalizedString(label, t)}
40
40
  <IconButton
41
41
  icon='ph--x--bold'
42
42
  iconOnly
43
43
  variant='ghost'
44
- label={t('remove-object-in-context.label')}
44
+ label={t('remove-object.label')}
45
45
  classNames='p-0 hover:bg-transparent'
46
46
  size={3}
47
47
  onClick={() => onUpdateObject?.(dxn, false)}
@@ -0,0 +1,123 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import React, { useEffect, useMemo, useState } from 'react';
6
+
7
+ import { type ThemedClassName } from '@dxos/react-ui';
8
+ import { ChatStatus as NaturalChatStatus, formatElapsed } from '@dxos/react-ui-chat';
9
+ import { Matrix } from '@dxos/react-ui-sfx';
10
+ import { type ContentBlock } from '@dxos/types';
11
+ import { Unit } from '@dxos/util';
12
+
13
+ import { type ChatRequestTiming, useChatContext } from '../Chat/context';
14
+
15
+ const CHAT_STREAM_STATUS_NAME = 'Chat.StreamStatus';
16
+ const TICK_MS = 1_000;
17
+
18
+ export type ChatStreamStatusProps = ThemedClassName<{
19
+ icon?: boolean;
20
+ }>;
21
+
22
+ /**
23
+ * Live status pill rendered at the bottom of the chat thread.
24
+ *
25
+ * The block-widget host re-mounts this component each time wire's drip queue toggles
26
+ * (`wireDrainingEffect`) — so all visible state is derived from chat-context values that
27
+ * survive the unmount: the latest `stats` block on the chat context's `messages` for token counts,
28
+ * and `requestTiming` (start/end wall-clock timestamps) for the elapsed value.
29
+ *
30
+ * Shows:
31
+ * - elapsed seconds since the most recent request started (frozen at end-of-request)
32
+ * - last completed turn's output token count (from the most recent `stats` content block)
33
+ * - cumulative session total tokens across all `stats` content blocks
34
+ */
35
+ export const ChatStatus = ({ classNames, icon }: ChatStreamStatusProps) => {
36
+ // Read `messages` from the chat context (combines `useQuery(queue)` + the processor's
37
+ // pending atom) rather than `processor.messages` directly — the latter only contains
38
+ // blocks streamed via the ephemeral `PartialBlock` channel, while finalized blocks
39
+ // (including the per-turn `stats` block we read for token counts) are submitted to the
40
+ // feed via `_submitMessage` and only show up through `useQuery`.
41
+ const { messages, requestTiming } = useChatContext(CHAT_STREAM_STATUS_NAME);
42
+
43
+ const { lastOutputTokens, sessionTotalTokens } = useMemo(() => {
44
+ let last: number | undefined;
45
+ let total = 0;
46
+ for (const message of messages) {
47
+ for (const block of message.blocks) {
48
+ if (isStats(block) && block.usage) {
49
+ last = block.usage.outputTokens;
50
+ total += block.usage.totalTokens ?? 0;
51
+ }
52
+ }
53
+ }
54
+ return { lastOutputTokens: last, sessionTotalTokens: total };
55
+ }, [messages]);
56
+
57
+ const isRunning = requestTiming != null && requestTiming.endedAt == null;
58
+ const show = requestTiming || lastOutputTokens || sessionTotalTokens > 0;
59
+ if (!show) {
60
+ return null;
61
+ }
62
+
63
+ return (
64
+ <NaturalChatStatus.Root defaultRunning={false} classNames={['py-2 gap-2 text-sm', classNames]}>
65
+ {icon && (
66
+ <NaturalChatStatus.Icon>
67
+ <Matrix
68
+ classNames='w-5 h-5'
69
+ dotClassNames='bg-primary-500'
70
+ dim={4}
71
+ dotSize={3}
72
+ count={10}
73
+ interval={500}
74
+ active={isRunning}
75
+ />
76
+ </NaturalChatStatus.Icon>
77
+ )}
78
+ {show && (
79
+ <div className='flex items-center'>
80
+ {requestTiming && (
81
+ <NaturalChatStatus.Text>
82
+ <Elapsed timing={requestTiming} />
83
+ </NaturalChatStatus.Text>
84
+ )}
85
+ {lastOutputTokens != null && (
86
+ <>
87
+ {requestTiming && <NaturalChatStatus.Separator />}
88
+ <NaturalChatStatus.Text>↓ {Unit.Thousand(lastOutputTokens).toString()}</NaturalChatStatus.Text>
89
+ </>
90
+ )}
91
+ {sessionTotalTokens > 0 && (
92
+ <>
93
+ {(requestTiming || lastOutputTokens != null) && <NaturalChatStatus.Separator />}
94
+ <NaturalChatStatus.Text>Σ {Unit.Thousand(sessionTotalTokens).toString()}</NaturalChatStatus.Text>
95
+ </>
96
+ )}
97
+ </div>
98
+ )}
99
+ </NaturalChatStatus.Root>
100
+ );
101
+ };
102
+
103
+ /**
104
+ * Wall-clock-derived elapsed display. Tick interval forces a re-render every second while
105
+ * the request is active so the displayed value advances; once `endedAt` is set, the value
106
+ * is frozen and the interval is no longer scheduled.
107
+ */
108
+ const Elapsed = ({ timing }: { timing: ChatRequestTiming }) => {
109
+ const isRunning = timing.endedAt == null;
110
+ const [now, setNow] = useState(Date.now());
111
+ useEffect(() => {
112
+ if (!isRunning) {
113
+ return;
114
+ }
115
+
116
+ const id = setInterval(() => setNow(Date.now()), TICK_MS);
117
+ return () => clearInterval(id);
118
+ }, [isRunning]);
119
+
120
+ return <>{formatElapsed((timing.endedAt ?? now) - timing.startedAt)}</>;
121
+ };
122
+
123
+ const isStats = (block: ContentBlock.Any): block is ContentBlock.Stats => block._tag === 'stats';
@@ -30,7 +30,7 @@ export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...
30
30
  );
31
31
 
32
32
  return (
33
- <div role='none' className={mx('relative flex', classNames)}>
33
+ <div className={mx('relative flex', classNames)}>
34
34
  <Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
35
35
  {error && (
36
36
  <Tooltip.Trigger asChild content={error.message}>
@@ -3,7 +3,10 @@
3
3
  //
4
4
 
5
5
  export * from './ChatActions';
6
+ export * from './ChatMcpErrors';
6
7
  export * from './ChatOptions';
7
8
  export * from './ChatPresets';
9
+ export * from './ChatPrompt';
8
10
  export * from './ChatReferences';
9
11
  export * from './ChatStatusIndicator';
12
+ export * from './ChatStatus';
@@ -0,0 +1,95 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import React from 'react';
8
+
9
+ import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { Database, Filter, Obj } from '@dxos/echo';
11
+ import { DxAnchor } from '@dxos/lit-ui/react';
12
+ import { ClientPlugin } from '@dxos/plugin-client/testing';
13
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
14
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
15
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
16
+ import { useQuery, useSpaces } from '@dxos/react-client/echo';
17
+ import { Loading, withLayout } from '@dxos/react-ui/testing';
18
+ import { Organization } from '@dxos/types';
19
+
20
+ /**
21
+ * Production-style click → popover demo.
22
+ *
23
+ * Wires up the same chain Composer uses:
24
+ * - `<DxAnchor dxn=…>label</DxAnchor>` fires `DxAnchorActivate` on click.
25
+ * - `PreviewPlugin`'s `preview-popover` capability listens for the event, resolves the DXN
26
+ * to a real ECHO object via `space.db.makeRef(dxn).load()`, then invokes
27
+ * `LayoutOperation.UpdatePopover`.
28
+ * - `StorybookPlugin` provides both the `LayoutOperation.UpdatePopover` handler (mutating
29
+ * the layout-state atom) and the `<Layout>` shell that renders the popover via
30
+ * `<Surface.Surface type={AppSurface.Card} data={popoverContent}>`.
31
+ * - `PreviewPlugin` also registers Card-role surfaces (Organization, Person, Task, …); the
32
+ * Surface system picks the matching one based on the resolved object's type.
33
+ *
34
+ * Click the anchor — the matching Card surface (from plugin-preview) renders inside the
35
+ * popover, anchored to the trigger.
36
+ */
37
+ const DefaultStory = () => {
38
+ const [space] = useSpaces();
39
+ const [organization] = useQuery(space?.db, Filter.type(Organization.Organization));
40
+ if (!organization) {
41
+ return <Loading />;
42
+ }
43
+
44
+ const dxn = Obj.getDXN(organization).toString();
45
+ return (
46
+ <div className='flex flex-col gap-2 p-4'>
47
+ <p>
48
+ Click{' '}
49
+ <DxAnchor className='dx-tag--anchor' dxn={dxn}>
50
+ {organization.name}
51
+ </DxAnchor>{' '}
52
+ to open the popover.
53
+ </p>
54
+ </div>
55
+ );
56
+ };
57
+
58
+ const meta = {
59
+ title: 'plugins/plugin-assistant/components/ChatThread/Anchor',
60
+ render: DefaultStory,
61
+ decorators: [
62
+ withLayout({ layout: 'centered' }),
63
+ withPluginManager({
64
+ plugins: [
65
+ ...corePlugins(),
66
+ StorybookPlugin({}),
67
+ PreviewPlugin(),
68
+ ClientPlugin({
69
+ types: [Organization.Organization],
70
+ onClientInitialized: Effect.fnUntraced(function* ({ client }) {
71
+ const { personalSpace } = yield* initializeIdentity(client);
72
+ yield* Effect.gen(function* () {
73
+ yield* Database.add(
74
+ Obj.make(Organization.Organization, {
75
+ name: 'DXOS',
76
+ website: 'https://dxos.org',
77
+ description: 'A decentralized network for collaborative applications.',
78
+ }),
79
+ );
80
+ }).pipe(Effect.provide(Database.layer(personalSpace.db)));
81
+ }),
82
+ }),
83
+ ],
84
+ }),
85
+ ],
86
+ parameters: {
87
+ layout: 'centered',
88
+ },
89
+ } satisfies Meta<typeof DefaultStory>;
90
+
91
+ export default meta;
92
+
93
+ type Story = StoryObj<typeof meta>;
94
+
95
+ export const Default: Story = {};
@@ -8,38 +8,45 @@ import * as Fiber from 'effect/Fiber';
8
8
  import * as Layer from 'effect/Layer';
9
9
  import React, { useEffect, useMemo, useState } from 'react';
10
10
 
11
- import { Database } from '@dxos/echo';
11
+ import { withPluginManager } from '@dxos/app-framework/testing';
12
+ import { createFeedServiceLayer } from '@dxos/client/echo';
13
+ import { Database, Feed, Filter, Query } from '@dxos/echo';
12
14
  import { runAndForwardErrors } from '@dxos/effect';
13
- import { ContextQueueService } from '@dxos/functions';
15
+ import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
16
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
17
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
14
18
  import { random } from '@dxos/random';
15
- import { useQueue, useSpace } from '@dxos/react-client/echo';
16
- import { withClientProvider } from '@dxos/react-client/testing';
17
- import { Popover } from '@dxos/react-ui';
18
- import { Card } from '@dxos/react-ui';
19
- import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
19
+ import { useQuery, useSpaces } from '@dxos/react-client/echo';
20
+ import { EditorPreviewProvider } from '@dxos/react-ui-editor';
20
21
  import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
21
- import { type Message, Organization, Person } from '@dxos/types';
22
+ import { Message, Organization, Person } from '@dxos/types';
22
23
 
23
24
  import { createMessageGenerator } from '#testing';
25
+ import { translations } from '#translations';
24
26
 
25
- import { translations } from '../../translations';
26
27
  import { ChatThread, type ChatThreadProps } from './ChatThread';
27
28
 
28
29
  random.seed(1);
29
30
 
30
- type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
31
+ type MessageGenerator = Effect.Effect<void, never, Database.Service | Feed.ContextFeedService | Feed.FeedService>;
31
32
 
32
33
  type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
33
34
 
34
35
  const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
35
- const space = useSpace();
36
- const queueDxn = useMemo(() => space?.queues.create().dxn, [space]);
37
- const queue = useQueue<Message.Message>(queueDxn);
36
+ const [space] = useSpaces();
37
+ const feed = useMemo<Feed.Feed | undefined>(
38
+ () => (space ? space.db.add(Feed.make({ name: 'chat' })) : undefined),
39
+ [space],
40
+ );
41
+ const messages = useQuery(
42
+ space?.db,
43
+ feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
44
+ );
38
45
  const [done, setDone] = useState(false);
39
46
 
40
47
  // Generate messages.
41
48
  useEffect(() => {
42
- if (!space || !queue) {
49
+ if (!space || !feed) {
43
50
  return;
44
51
  }
45
52
 
@@ -51,14 +58,23 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
51
58
  yield* Effect.sleep(delay);
52
59
  }
53
60
  }
61
+
54
62
  setDone(true);
55
- }).pipe(Effect.provide(Layer.mergeAll(Database.layer(space.db), ContextQueueService.layer(queue)))),
63
+ }).pipe(
64
+ Effect.provide(
65
+ Layer.mergeAll(
66
+ Database.layer(space.db),
67
+ Feed.ContextFeedService.layer(feed),
68
+ createFeedServiceLayer(space.queues),
69
+ ),
70
+ ),
71
+ ),
56
72
  );
57
73
 
58
74
  return () => {
59
75
  void runAndForwardErrors(Fiber.interrupt(fiber));
60
76
  };
61
- }, [space, queue, generator]);
77
+ }, [space, feed, generator, delay]);
62
78
 
63
79
  if (wait && !done) {
64
80
  return <Loading data={{ wait, done }} />;
@@ -66,30 +82,11 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
66
82
 
67
83
  return (
68
84
  <EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
69
- <ChatThread {...props} messages={queue?.objects} />
70
- <PreviewCard />
85
+ <ChatThread {...props} messages={messages} />
71
86
  </EditorPreviewProvider>
72
87
  );
73
88
  };
74
89
 
75
- const PreviewCard = () => {
76
- const { target } = useEditorPreview('PreviewCard');
77
-
78
- return (
79
- <Popover.Portal>
80
- <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
81
- <Popover.Viewport>
82
- <Card.Root>
83
- <Card.Heading>{target?.label}</Card.Heading>
84
- {target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
85
- </Card.Root>
86
- </Popover.Viewport>
87
- <Popover.Arrow />
88
- </Popover.Content>
89
- </Popover.Portal>
90
- );
91
- };
92
-
93
90
  const meta = {
94
91
  title: 'plugins/plugin-assistant/components/ChatThread',
95
92
  component: ChatThread,
@@ -97,10 +94,19 @@ const meta = {
97
94
  decorators: [
98
95
  withTheme(),
99
96
  withLayout({ layout: 'column' }),
100
- withClientProvider({
101
- createIdentity: true,
102
- createSpace: true,
103
- types: [Organization.Organization, Person.Person],
97
+ withPluginManager({
98
+ plugins: [
99
+ ...corePlugins(),
100
+ StorybookPlugin({}),
101
+ PreviewPlugin(),
102
+ ClientPlugin({
103
+ types: [Organization.Organization, Person.Person],
104
+ onClientInitialized: ({ client }) =>
105
+ Effect.gen(function* () {
106
+ yield* initializeIdentity(client);
107
+ }),
108
+ }),
109
+ ],
104
110
  }),
105
111
  ],
106
112
  parameters: {
@@ -123,10 +129,10 @@ export const Default: Story = {
123
129
  export const Delayed: Story = {
124
130
  args: {
125
131
  generator: createMessageGenerator(),
126
- delay: 1_000,
132
+ delay: 500,
127
133
  options: {
128
134
  autoScroll: true,
129
- wire: true,
135
+ typewriter: true,
130
136
  cursor: true,
131
137
  },
132
138
  },