@dxos/plugin-assistant 0.8.4-main.406dc2a → 0.8.4-main.422d1c7879

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 (627) hide show
  1. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +97 -0
  2. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +7 -0
  3. package/dist/lib/browser/blueprints/index.mjs +8 -0
  4. package/dist/lib/browser/chunk-ATHYBVGN.mjs +176 -0
  5. package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +7 -0
  6. package/dist/lib/browser/chunk-EZRS3J25.mjs +30 -0
  7. package/dist/lib/browser/chunk-EZRS3J25.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-LMVTXH54.mjs +154 -0
  9. package/dist/lib/browser/chunk-LMVTXH54.mjs.map +7 -0
  10. package/dist/lib/browser/cli/index.mjs +74 -0
  11. package/dist/lib/browser/cli/index.mjs.map +7 -0
  12. package/dist/lib/browser/create-chat-LBZHGVSN.mjs +82 -0
  13. package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +7 -0
  14. package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs +65 -0
  15. package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +7 -0
  16. package/dist/lib/browser/index.mjs +3388 -308
  17. package/dist/lib/browser/index.mjs.map +4 -4
  18. package/dist/lib/browser/meta.json +1 -1
  19. package/dist/lib/browser/on-create-space-54RNX5JI.mjs +22 -0
  20. package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +7 -0
  21. package/dist/lib/browser/operations/index.mjs +13 -0
  22. package/dist/lib/browser/operations/index.mjs.map +7 -0
  23. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs +22 -0
  24. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +7 -0
  25. package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs +136 -0
  26. package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +7 -0
  27. package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs +54 -0
  28. package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +7 -0
  29. package/dist/lib/browser/types/index.mjs +5 -4
  30. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs +71 -0
  31. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +7 -0
  32. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +98 -0
  33. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +7 -0
  34. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  35. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +32 -0
  36. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +177 -0
  38. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs +155 -0
  40. package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +7 -0
  41. package/dist/lib/node-esm/cli/index.mjs +75 -0
  42. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  43. package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +83 -0
  44. package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +7 -0
  45. package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs +66 -0
  46. package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +7 -0
  47. package/dist/lib/node-esm/index.mjs +3388 -308
  48. package/dist/lib/node-esm/index.mjs.map +4 -4
  49. package/dist/lib/node-esm/meta.json +1 -1
  50. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +23 -0
  51. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +7 -0
  52. package/dist/lib/node-esm/operations/index.mjs +14 -0
  53. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  54. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +23 -0
  55. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +7 -0
  56. package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs +137 -0
  57. package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +7 -0
  58. package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +55 -0
  59. package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +7 -0
  60. package/dist/lib/node-esm/types/index.mjs +5 -4
  61. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +72 -0
  62. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +7 -0
  63. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  64. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  65. package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
  66. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
  68. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
  69. package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
  70. package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
  71. package/dist/types/src/blueprints/index.d.ts +2 -0
  72. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/ai-service.d.ts +4 -2
  74. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  76. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -6
  78. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
  80. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -3
  82. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/index.d.ts +29 -12
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/local-model-resolver.d.ts +9 -3
  86. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/markdown.d.ts +5 -0
  88. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  90. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  92. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  94. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/settings.d.ts +4 -2
  96. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  97. package/dist/types/src/capabilities/state.d.ts +19 -2
  98. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/toolkit.d.ts +4 -2
  100. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  101. package/dist/types/src/cli/index.d.ts +2 -0
  102. package/dist/types/src/cli/index.d.ts.map +1 -0
  103. package/dist/types/src/cli/plugin.d.ts +10 -0
  104. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  105. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
  106. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  107. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
  108. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
  109. package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
  110. package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
  111. package/dist/types/src/components/Chat/Chat.d.ts +28 -15
  112. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  113. package/dist/types/src/components/Chat/events.d.ts +5 -1
  114. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  115. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +6 -3
  116. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  117. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
  118. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  119. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +5 -3
  120. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  121. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
  122. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
  123. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
  124. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  125. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
  126. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
  127. package/dist/types/src/components/ChatThread/ChatThread.d.ts +7 -10
  128. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  129. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +15 -262
  130. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  131. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
  132. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
  133. package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
  134. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  135. package/dist/types/src/components/ChatThread/sync.d.ts +50 -17
  136. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  137. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
  138. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
  139. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
  140. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
  141. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
  142. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
  143. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +15 -0
  144. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +1 -0
  145. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
  146. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
  147. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
  148. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
  149. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
  150. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
  151. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
  152. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
  153. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
  154. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
  155. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
  156. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
  157. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
  158. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
  159. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
  160. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
  161. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
  162. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
  163. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
  164. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
  165. package/dist/types/src/components/ChatThread/widgets/index.d.ts +11 -0
  166. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
  167. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +10 -0
  168. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
  169. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
  170. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
  171. package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
  172. package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
  173. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +6 -4
  174. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  175. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -250
  176. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  177. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
  178. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  179. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +2 -251
  180. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  181. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  182. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  183. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  184. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  185. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  186. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +6 -13
  187. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  188. package/dist/types/src/components/Toolbox/Toolbox.d.ts +13 -12
  189. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  190. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -249
  191. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  192. package/dist/types/src/components/index.d.ts +3 -11
  193. package/dist/types/src/components/index.d.ts.map +1 -1
  194. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
  195. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
  196. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
  197. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
  198. package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
  199. package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
  200. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
  201. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
  202. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
  203. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
  204. package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
  205. package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
  206. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
  207. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
  208. package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
  209. package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
  210. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
  211. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
  212. package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
  213. package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
  214. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
  215. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
  216. package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
  217. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
  218. package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
  219. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
  220. package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
  221. package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
  222. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
  223. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
  224. package/dist/types/src/containers/PromptArticle/index.d.ts +2 -0
  225. package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
  226. package/dist/types/src/containers/PromptList/PromptList.d.ts +6 -0
  227. package/dist/types/src/containers/PromptList/PromptList.d.ts.map +1 -0
  228. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +21 -0
  229. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
  230. package/dist/types/src/containers/PromptList/index.d.ts +2 -0
  231. package/dist/types/src/containers/PromptList/index.d.ts.map +1 -0
  232. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +7 -0
  233. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
  234. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +16 -0
  235. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
  236. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
  237. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
  238. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
  239. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
  240. package/dist/types/src/containers/TracePanel/execution-graph.d.ts +17 -0
  241. package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
  242. package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
  243. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
  244. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +5 -0
  245. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  246. package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
  247. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
  248. package/dist/types/src/containers/index.d.ts +12 -0
  249. package/dist/types/src/containers/index.d.ts.map +1 -0
  250. package/dist/types/src/extensions/index.d.ts +2 -0
  251. package/dist/types/src/extensions/index.d.ts.map +1 -0
  252. package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
  253. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
  254. package/dist/types/src/hooks/index.d.ts +2 -1
  255. package/dist/types/src/hooks/index.d.ts.map +1 -1
  256. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
  257. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  258. package/dist/types/src/hooks/useChatProcessor.d.ts +9 -6
  259. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  260. package/dist/types/src/hooks/useChatServices.d.ts +5 -8
  261. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  262. package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
  263. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
  264. package/dist/types/src/hooks/useContextBinder.d.ts +3 -2
  265. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  266. package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
  267. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  268. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  269. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  270. package/dist/types/src/hooks/usePresets.d.ts +1 -1
  271. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  272. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  273. package/dist/types/src/index.d.ts +1 -2
  274. package/dist/types/src/index.d.ts.map +1 -1
  275. package/dist/types/src/meta.d.ts +4 -2
  276. package/dist/types/src/meta.d.ts.map +1 -1
  277. package/dist/types/src/operations/create-chat.d.ts +5 -0
  278. package/dist/types/src/operations/create-chat.d.ts.map +1 -0
  279. package/dist/types/src/operations/definitions.d.ts +135 -0
  280. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  281. package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
  282. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
  283. package/dist/types/src/operations/index.d.ts +4 -0
  284. package/dist/types/src/operations/index.d.ts.map +1 -0
  285. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  286. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  287. package/dist/types/src/operations/prompt.test.d.ts +2 -0
  288. package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
  289. package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
  290. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
  291. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
  292. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
  293. package/dist/types/src/operations/set-current-chat.d.ts +5 -0
  294. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
  295. package/dist/types/src/operations/update-chat-name.d.ts +5 -0
  296. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
  297. package/dist/types/src/processor/presets.d.ts +1 -1
  298. package/dist/types/src/processor/presets.d.ts.map +1 -1
  299. package/dist/types/src/processor/processor.d.ts +41 -35
  300. package/dist/types/src/processor/processor.d.ts.map +1 -1
  301. package/dist/types/src/queue-logger.d.ts.map +1 -1
  302. package/dist/types/src/testing/test-generator.d.ts +5 -4
  303. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  304. package/dist/types/src/testing/test-generator.test.d.ts +2 -0
  305. package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
  306. package/dist/types/src/testing/test-services.d.ts +1 -1
  307. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  308. package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
  309. package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
  310. package/dist/types/src/translations.d.ts +2 -87
  311. package/dist/types/src/translations.d.ts.map +1 -1
  312. package/dist/types/src/types/Assistant.d.ts +18 -49
  313. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  314. package/dist/types/src/types/Settings.d.ts +11 -0
  315. package/dist/types/src/types/Settings.d.ts.map +1 -0
  316. package/dist/types/src/types/capabilities.d.ts +32 -0
  317. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  318. package/dist/types/src/types/events.d.ts +5 -0
  319. package/dist/types/src/types/events.d.ts.map +1 -0
  320. package/dist/types/src/types/index.d.ts +3 -1
  321. package/dist/types/src/types/index.d.ts.map +1 -1
  322. package/dist/types/src/types/service.d.ts +10 -212
  323. package/dist/types/src/types/service.d.ts.map +1 -1
  324. package/dist/types/tsconfig.tsbuildinfo +1 -1
  325. package/package.json +144 -98
  326. package/src/AssistantPlugin.tsx +190 -119
  327. package/src/blueprints/assistant/blueprint.test.ts +46 -0
  328. package/src/blueprints/assistant/blueprint.ts +31 -0
  329. package/src/blueprints/assistant/index.ts +5 -0
  330. package/src/{components/Toolbar → blueprints}/index.ts +1 -1
  331. package/src/capabilities/ai-service.ts +20 -17
  332. package/src/capabilities/app-graph-builder.ts +143 -144
  333. package/src/capabilities/blueprint-definition.ts +49 -55
  334. package/src/capabilities/companion-chat-provisioner.ts +164 -0
  335. package/src/capabilities/edge-model-resolver.ts +22 -14
  336. package/src/capabilities/index.ts +21 -14
  337. package/src/capabilities/local-model-resolver.ts +31 -13
  338. package/src/capabilities/markdown.ts +40 -0
  339. package/src/capabilities/migrations.ts +35 -0
  340. package/src/capabilities/operation-handler.ts +16 -0
  341. package/src/capabilities/react-surface.tsx +147 -77
  342. package/src/capabilities/settings.ts +24 -12
  343. package/src/capabilities/state.ts +27 -12
  344. package/src/capabilities/toolkit.ts +6 -161
  345. package/src/cli/index.ts +5 -0
  346. package/src/cli/plugin.ts +84 -0
  347. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
  348. package/src/components/AssistantSettings/AssistantSettings.tsx +105 -85
  349. package/src/components/AssistantSettings/index.ts +2 -2
  350. package/src/components/Chat/Chat.tsx +225 -147
  351. package/src/components/Chat/events.ts +7 -1
  352. package/src/components/ChatProgress/ChatProgress.tsx +11 -22
  353. package/src/components/ChatPrompt/ChatActions.tsx +26 -8
  354. package/src/components/ChatPrompt/ChatOptions.stories.tsx +122 -0
  355. package/src/components/ChatPrompt/ChatOptions.tsx +272 -93
  356. package/src/components/ChatPrompt/ChatReferences.tsx +23 -14
  357. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
  358. package/src/components/ChatThread/Anchor.stories.tsx +95 -0
  359. package/src/components/ChatThread/ChatThread.stories.tsx +76 -62
  360. package/src/components/ChatThread/ChatThread.tsx +47 -44
  361. package/src/components/ChatThread/Link.tsx +4 -4
  362. package/src/components/ChatThread/MarkdownStream.stories.tsx +280 -0
  363. package/src/components/ChatThread/registry.tsx +132 -69
  364. package/src/components/ChatThread/sync.test.ts +130 -20
  365. package/src/components/ChatThread/sync.ts +104 -67
  366. package/src/components/ChatThread/testing/reasoning.md +25 -0
  367. package/src/components/ChatThread/testing/thinking.md +21 -0
  368. package/src/components/ChatThread/testing/thread-1.md +30 -0
  369. package/src/components/ChatThread/testing/thread-2.md +56 -0
  370. package/src/components/ChatThread/testing/thread-widgets.md +79 -0
  371. package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
  372. package/src/components/ChatThread/tool-widget-state.ts +48 -0
  373. package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
  374. package/src/components/ChatThread/widgets/PromptWidget.ts +30 -0
  375. package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
  376. package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
  377. package/src/components/ChatThread/widgets/ReferenceWidget.ts +31 -0
  378. package/src/components/ChatThread/widgets/SelectWidget.ts +37 -0
  379. package/src/components/ChatThread/widgets/StatsWidget.ts +29 -0
  380. package/src/components/ChatThread/widgets/StatusWidget.ts +131 -0
  381. package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
  382. package/src/components/ChatThread/widgets/SummaryWidget.tsx +28 -0
  383. package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +54 -0
  384. package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
  385. package/src/components/ChatThread/widgets/index.ts +14 -0
  386. package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
  387. package/src/components/ProcessTree/ProcessTree.tsx +86 -0
  388. package/src/components/ProcessTree/index.ts +5 -0
  389. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +18 -13
  390. package/src/components/TemplateEditor/TemplateEditor.tsx +59 -39
  391. package/src/components/TemplateEditor/TemplateForm.stories.tsx +20 -11
  392. package/src/components/TemplateEditor/TemplateForm.tsx +83 -37
  393. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
  394. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  395. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  396. package/src/components/ToolBlock/ToolBlock.tsx +46 -54
  397. package/src/components/Toolbox/Toolbox.stories.tsx +11 -14
  398. package/src/components/Toolbox/Toolbox.tsx +70 -65
  399. package/src/components/index.ts +3 -10
  400. package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
  401. package/src/containers/AgentArticle/AgentArticle.tsx +200 -0
  402. package/src/containers/AgentArticle/index.ts +5 -0
  403. package/src/containers/AgentProperties/AgentProperties.stories.tsx +100 -0
  404. package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
  405. package/src/containers/AgentProperties/index.ts +5 -0
  406. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
  407. package/src/containers/BlueprintArticle/index.ts +5 -0
  408. package/src/containers/ChatCompanion/ChatCompanion.tsx +142 -0
  409. package/src/containers/ChatCompanion/index.ts +5 -0
  410. package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
  411. package/src/containers/ChatContainer/index.ts +5 -0
  412. package/src/{components → containers/ChatDialog}/ChatDialog.tsx +19 -15
  413. package/src/containers/ChatDialog/index.ts +5 -0
  414. package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
  415. package/src/containers/PromptArticle/index.ts +5 -0
  416. package/src/containers/PromptList/PromptList.stories.tsx +129 -0
  417. package/src/containers/PromptList/PromptList.tsx +49 -0
  418. package/src/containers/PromptList/index.ts +5 -0
  419. package/src/containers/TracePanel/TracePanel.stories.tsx +272 -0
  420. package/src/containers/TracePanel/TracePanel.tsx +113 -0
  421. package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
  422. package/src/containers/TracePanel/dxn-extractor.ts +178 -0
  423. package/src/containers/TracePanel/execution-graph.ts +452 -0
  424. package/src/containers/TracePanel/index.ts +9 -0
  425. package/src/containers/TriggerStatus/TriggerStatus.tsx +129 -0
  426. package/src/containers/TriggerStatus/index.ts +5 -0
  427. package/src/containers/index.ts +16 -0
  428. package/src/extensions/index.ts +5 -0
  429. package/src/extensions/prompt-extension.ts +111 -0
  430. package/src/hooks/index.ts +2 -1
  431. package/src/hooks/useBlueprintRegistry.ts +36 -21
  432. package/src/hooks/useChatProcessor.ts +44 -28
  433. package/src/hooks/useChatServices.ts +10 -33
  434. package/src/hooks/useChatToolbarActions.ts +122 -0
  435. package/src/hooks/useContextBinder.ts +20 -7
  436. package/src/hooks/useContextObjects.ts +16 -24
  437. package/src/hooks/useFilteredTypes.ts +37 -0
  438. package/src/hooks/usePresets.ts +2 -1
  439. package/src/hooks/useReferencesProvider.ts +5 -8
  440. package/src/index.ts +1 -2
  441. package/src/meta.ts +14 -6
  442. package/src/operations/create-chat.ts +80 -0
  443. package/src/operations/definitions.ts +127 -0
  444. package/src/operations/ensure-companion-chat.ts +61 -0
  445. package/src/operations/index.ts +17 -0
  446. package/src/operations/on-create-space.ts +24 -0
  447. package/src/operations/prompt.test.ts +79 -0
  448. package/src/operations/resolve-navigation-targets.ts +26 -0
  449. package/src/operations/run-prompt-in-new-chat.ts +113 -0
  450. package/src/operations/set-current-chat.ts +50 -0
  451. package/src/operations/update-chat-name.ts +61 -0
  452. package/src/processor/presets.ts +12 -4
  453. package/src/processor/processor.test.ts +20 -61
  454. package/src/processor/processor.ts +200 -181
  455. package/src/queue-logger.ts +24 -14
  456. package/src/testing/data/trace-timeline.dx.json +2120 -0
  457. package/src/testing/test-generator.test.ts +81 -0
  458. package/src/testing/test-generator.ts +86 -48
  459. package/src/testing/test-sequence.ts +3 -3
  460. package/src/testing/test-services.ts +9 -7
  461. package/src/testing/trace-timeline.conversations.json +1 -0
  462. package/src/testing/trace-timeline.test.ts +246 -0
  463. package/src/translations.ts +161 -77
  464. package/src/types/Assistant.ts +8 -58
  465. package/src/types/Settings.ts +21 -0
  466. package/src/types/capabilities.ts +35 -0
  467. package/src/types/events.ts +11 -0
  468. package/src/types/index.ts +5 -1
  469. package/src/types/service.ts +14 -11
  470. package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs +0 -28
  471. package/dist/lib/browser/BlueprintContainer-WX2SSDVI.mjs.map +0 -7
  472. package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs +0 -150
  473. package/dist/lib/browser/ChatCompanion-BDZ55ZRF.mjs.map +0 -7
  474. package/dist/lib/browser/ChatContainer-RYGNN73X.mjs +0 -73
  475. package/dist/lib/browser/ChatContainer-RYGNN73X.mjs.map +0 -7
  476. package/dist/lib/browser/ChatDialog-MVHH2U66.mjs +0 -86
  477. package/dist/lib/browser/ChatDialog-MVHH2U66.mjs.map +0 -7
  478. package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs +0 -150
  479. package/dist/lib/browser/SequenceContainer-2FEWMQGW.mjs.map +0 -7
  480. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
  481. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
  482. package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs +0 -154
  483. package/dist/lib/browser/app-graph-builder-2U7SLCRX.mjs.map +0 -7
  484. package/dist/lib/browser/blueprint-definition-NSJARW5U.mjs +0 -12
  485. package/dist/lib/browser/chunk-2CE2KPKZ.mjs +0 -175
  486. package/dist/lib/browser/chunk-2CE2KPKZ.mjs.map +0 -7
  487. package/dist/lib/browser/chunk-43I2LR6O.mjs +0 -216
  488. package/dist/lib/browser/chunk-43I2LR6O.mjs.map +0 -7
  489. package/dist/lib/browser/chunk-5EGXHCAZ.mjs +0 -16
  490. package/dist/lib/browser/chunk-5EGXHCAZ.mjs.map +0 -7
  491. package/dist/lib/browser/chunk-5RICKAMN.mjs +0 -18
  492. package/dist/lib/browser/chunk-5RICKAMN.mjs.map +0 -7
  493. package/dist/lib/browser/chunk-CQ7UHYTT.mjs +0 -296
  494. package/dist/lib/browser/chunk-CQ7UHYTT.mjs.map +0 -7
  495. package/dist/lib/browser/chunk-FP56WB24.mjs +0 -212
  496. package/dist/lib/browser/chunk-FP56WB24.mjs.map +0 -7
  497. package/dist/lib/browser/chunk-JZRZVB2A.mjs +0 -170
  498. package/dist/lib/browser/chunk-JZRZVB2A.mjs.map +0 -7
  499. package/dist/lib/browser/chunk-WRJGOT5P.mjs +0 -1794
  500. package/dist/lib/browser/chunk-WRJGOT5P.mjs.map +0 -7
  501. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
  502. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
  503. package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs +0 -114
  504. package/dist/lib/browser/intent-resolver-3GOJMBXJ.mjs.map +0 -7
  505. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +0 -17
  506. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +0 -7
  507. package/dist/lib/browser/react-surface-FTKCE6GG.mjs +0 -107
  508. package/dist/lib/browser/react-surface-FTKCE6GG.mjs.map +0 -7
  509. package/dist/lib/browser/settings-HBF32KV6.mjs +0 -23
  510. package/dist/lib/browser/settings-HBF32KV6.mjs.map +0 -7
  511. package/dist/lib/browser/state-LXTS54DI.mjs +0 -21
  512. package/dist/lib/browser/state-LXTS54DI.mjs.map +0 -7
  513. package/dist/lib/browser/toolkit-NQ2GXCF5.mjs +0 -199
  514. package/dist/lib/browser/toolkit-NQ2GXCF5.mjs.map +0 -7
  515. package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs +0 -29
  516. package/dist/lib/node-esm/BlueprintContainer-4MKN6ZRB.mjs.map +0 -7
  517. package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs +0 -151
  518. package/dist/lib/node-esm/ChatCompanion-XFNXVZIP.mjs.map +0 -7
  519. package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs +0 -74
  520. package/dist/lib/node-esm/ChatContainer-UTJGCQXF.mjs.map +0 -7
  521. package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs +0 -87
  522. package/dist/lib/node-esm/ChatDialog-QEYZ4IOV.mjs.map +0 -7
  523. package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs +0 -151
  524. package/dist/lib/node-esm/SequenceContainer-PGGJUQ46.mjs.map +0 -7
  525. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
  526. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
  527. package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs +0 -155
  528. package/dist/lib/node-esm/app-graph-builder-OKNLR7H2.mjs.map +0 -7
  529. package/dist/lib/node-esm/blueprint-definition-WD2IVMAI.mjs +0 -13
  530. package/dist/lib/node-esm/chunk-73ABYRYX.mjs +0 -20
  531. package/dist/lib/node-esm/chunk-73ABYRYX.mjs.map +0 -7
  532. package/dist/lib/node-esm/chunk-DSE2IILK.mjs +0 -217
  533. package/dist/lib/node-esm/chunk-DSE2IILK.mjs.map +0 -7
  534. package/dist/lib/node-esm/chunk-E2WXZND7.mjs +0 -297
  535. package/dist/lib/node-esm/chunk-E2WXZND7.mjs.map +0 -7
  536. package/dist/lib/node-esm/chunk-HXIBCBH4.mjs +0 -171
  537. package/dist/lib/node-esm/chunk-HXIBCBH4.mjs.map +0 -7
  538. package/dist/lib/node-esm/chunk-TNR46C3L.mjs +0 -213
  539. package/dist/lib/node-esm/chunk-TNR46C3L.mjs.map +0 -7
  540. package/dist/lib/node-esm/chunk-U2NYUS2N.mjs +0 -177
  541. package/dist/lib/node-esm/chunk-U2NYUS2N.mjs.map +0 -7
  542. package/dist/lib/node-esm/chunk-UFKLCEAE.mjs +0 -1795
  543. package/dist/lib/node-esm/chunk-UFKLCEAE.mjs.map +0 -7
  544. package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs +0 -17
  545. package/dist/lib/node-esm/chunk-XQGWSZ4T.mjs.map +0 -7
  546. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
  547. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
  548. package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs +0 -115
  549. package/dist/lib/node-esm/intent-resolver-6XLVTRDJ.mjs.map +0 -7
  550. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +0 -18
  551. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +0 -7
  552. package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs +0 -108
  553. package/dist/lib/node-esm/react-surface-K7ZXQLAP.mjs.map +0 -7
  554. package/dist/lib/node-esm/settings-CWP6MTWP.mjs +0 -24
  555. package/dist/lib/node-esm/settings-CWP6MTWP.mjs.map +0 -7
  556. package/dist/lib/node-esm/state-BO6GUFLB.mjs +0 -22
  557. package/dist/lib/node-esm/state-BO6GUFLB.mjs.map +0 -7
  558. package/dist/lib/node-esm/toolkit-V57PRJNG.mjs +0 -200
  559. package/dist/lib/node-esm/toolkit-V57PRJNG.mjs.map +0 -7
  560. package/dist/types/src/capabilities/capabilities.d.ts +0 -11
  561. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  562. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  563. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  564. package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
  565. package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
  566. package/dist/types/src/components/ChatCompanion.d.ts +0 -13
  567. package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
  568. package/dist/types/src/components/ChatContainer.d.ts +0 -11
  569. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  570. package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
  571. package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
  572. package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
  573. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  574. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  575. package/dist/types/src/components/SequenceContainer.d.ts +0 -8
  576. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  577. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  578. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  579. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -269
  580. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  581. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  582. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  583. package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
  584. package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -5
  585. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
  586. package/dist/types/src/components/Toolbar/index.d.ts +0 -2
  587. package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
  588. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
  589. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
  590. package/dist/types/src/events.d.ts +0 -4
  591. package/dist/types/src/events.d.ts.map +0 -1
  592. package/dist/types/src/functions/analysis.d.ts +0 -5
  593. package/dist/types/src/functions/analysis.d.ts.map +0 -1
  594. package/dist/types/src/functions/index.d.ts +0 -4
  595. package/dist/types/src/functions/index.d.ts.map +0 -1
  596. package/dist/types/src/functions/list.d.ts +0 -10
  597. package/dist/types/src/functions/list.d.ts.map +0 -1
  598. package/dist/types/src/functions/load.d.ts +0 -8
  599. package/dist/types/src/functions/load.d.ts.map +0 -1
  600. package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
  601. package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
  602. package/dist/types/src/types/AssistantAction.d.ts +0 -107
  603. package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
  604. package/src/capabilities/capabilities.ts +0 -18
  605. package/src/capabilities/intent-resolver.ts +0 -96
  606. package/src/components/BlueprintContainer.tsx +0 -24
  607. package/src/components/ChatCompanion.tsx +0 -136
  608. package/src/components/ChatContainer.tsx +0 -51
  609. package/src/components/ChatThread/reducers.ts +0 -151
  610. package/src/components/PromptSettings.tsx +0 -90
  611. package/src/components/SequenceContainer.tsx +0 -131
  612. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -35
  613. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  614. package/src/components/SequenceEditor/index.ts +0 -5
  615. package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
  616. package/src/components/Toolbar/Toolbar.tsx +0 -21
  617. package/src/components/Toolbar/useChatToolbarActions.ts +0 -126
  618. package/src/events.ts +0 -11
  619. package/src/functions/analysis.ts +0 -22
  620. package/src/functions/index.ts +0 -7
  621. package/src/functions/list.ts +0 -48
  622. package/src/functions/load.ts +0 -46
  623. package/src/hooks/useItemTypes.ts +0 -37
  624. package/src/types/AssistantAction.ts +0 -62
  625. /package/dist/lib/browser/{blueprint-definition-NSJARW5U.mjs.map → blueprints/index.mjs.map} +0 -0
  626. /package/dist/lib/node-esm/{blueprint-definition-WD2IVMAI.mjs.map → blueprints/index.mjs.map} +0 -0
  627. /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
@@ -0,0 +1,200 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Function from 'effect/Function';
8
+ import * as Option from 'effect/Option';
9
+ import React, { forwardRef, useCallback, useMemo, useState } from 'react';
10
+
11
+ import { Surface, useCapabilities } from '@dxos/app-framework/ui';
12
+ import { AppSurface, useObjectMenuItems } from '@dxos/app-toolkit/ui';
13
+ import { Agent } from '@dxos/assistant-toolkit';
14
+ import { Annotation, Filter, Obj, Query, Ref } from '@dxos/echo';
15
+ import { AtomObj, AtomRef } from '@dxos/echo-atom';
16
+ import { QueueService } from '@dxos/functions';
17
+ import { AutomationCapabilities } from '@dxos/plugin-automation/types';
18
+ import { useQuery } from '@dxos/react-client/echo';
19
+ import { Card, Message, Panel, ScrollArea, Toolbar, useTranslation } from '@dxos/react-ui';
20
+ import { Masonry } from '@dxos/react-ui-masonry';
21
+ import { Menu } from '@dxos/react-ui-menu';
22
+ import { Focus, Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';
23
+ import { composable } from '@dxos/ui-theme';
24
+ import { isNonNullable } from '@dxos/util';
25
+
26
+ import { meta } from '#meta';
27
+
28
+ type Tab = 'artifacts' | 'inputs';
29
+
30
+ export type AgentArticleProps = AppSurface.ObjectArticleProps<Agent.Agent>;
31
+
32
+ export const AgentArticle = ({ role, subject: agent }: AgentArticleProps) => {
33
+ const { t } = useTranslation(meta.id);
34
+ const [tab, setTab] = useState<Tab>('artifacts');
35
+ const [viewport, setViewport] = useState<HTMLElement | null>(null);
36
+
37
+ const [computeRuntime] = useCapabilities(AutomationCapabilities.ComputeRuntime);
38
+ // TODO(burdon): Clear input queue also.
39
+ const handleResetHistory = useCallback(async () => {
40
+ if (!computeRuntime) {
41
+ return;
42
+ }
43
+
44
+ const space = Obj.getDatabase(agent);
45
+ if (!space) {
46
+ return;
47
+ }
48
+
49
+ const runtime = computeRuntime.getRuntime(space.spaceId);
50
+ await runtime.runPromise(Agent.resetChatHistory(agent));
51
+ if (!agent.queue) {
52
+ await runtime.runPromise(
53
+ Effect.gen(function* () {
54
+ const queue = yield* QueueService.createQueue();
55
+ Obj.change(agent, (agent) => {
56
+ agent.queue = Ref.fromDXN(queue.dxn);
57
+ });
58
+ }),
59
+ );
60
+ }
61
+ }, [agent, computeRuntime]);
62
+
63
+ const artifacts = useAtomValue(
64
+ useMemo(
65
+ () =>
66
+ AtomObj.make(agent).pipe((agent) =>
67
+ Atom.make((get) => {
68
+ return get(agent)
69
+ .artifacts.map((artifact) => get(AtomRef.make(artifact.data)))
70
+ .filter(isNonNullable);
71
+ }),
72
+ ),
73
+ [agent],
74
+ ),
75
+ );
76
+
77
+ const inputQueue = useAtomValue(
78
+ AtomObj.make(agent).pipe((_) =>
79
+ Atom.make((get) =>
80
+ Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
81
+ ),
82
+ ),
83
+ );
84
+
85
+ const inputObjects = useQuery(inputQueue, Query.select(Filter.everything()));
86
+
87
+ return (
88
+ <Panel.Root role={role}>
89
+ <Panel.Toolbar asChild>
90
+ <Toolbar.Root>
91
+ <Toolbar.ToggleGroup type='single' value={tab} onValueChange={(value) => value && setTab(value as Tab)}>
92
+ <Toolbar.ToggleGroupIconItem value='artifacts' label={t('artifacts.label')} icon='ph--cube--regular' />
93
+ <Toolbar.ToggleGroupIconItem value='inputs' label={t('input-queue.label')} icon='ph--queue--regular' />
94
+ </Toolbar.ToggleGroup>
95
+ <Toolbar.Separator />
96
+ <Toolbar.IconButton
97
+ icon='ph--trash--regular'
98
+ label={t('reset-history.button')}
99
+ onCanPlay={handleResetHistory}
100
+ />
101
+ </Toolbar.Root>
102
+ </Panel.Toolbar>
103
+ <Panel.Content className='dx-container flex flex-col'>
104
+ {tab === 'artifacts' && (
105
+ <>
106
+ {artifacts.length === 0 && (
107
+ <Message.Root classNames='m-2' valence='info'>
108
+ <Message.Title>{t('project-empty-spec.message')}</Message.Title>
109
+ <Message.Content>{t('project-empty-spec.description')}</Message.Content>
110
+ </Message.Root>
111
+ )}
112
+
113
+ <Masonry.Root Tile={MasonryArtifactTile}>
114
+ <Masonry.Content padding thin centered>
115
+ <Masonry.Viewport items={artifacts} getId={(item: Obj.Unknown) => item.id} />
116
+ </Masonry.Content>
117
+ </Masonry.Root>
118
+ </>
119
+ )}
120
+
121
+ {tab === 'inputs' && (
122
+ <Mosaic.Container asChild withFocus autoScroll={viewport} classNames='dx-document'>
123
+ <ScrollArea.Root orientation='vertical' padding thin centered>
124
+ <ScrollArea.Viewport ref={setViewport}>
125
+ <Mosaic.VirtualStack
126
+ Tile={StackTile}
127
+ classNames='gap-2'
128
+ draggable={false}
129
+ estimateSize={() => 160}
130
+ gap={8}
131
+ getId={(item: Obj.Unknown) => item.id}
132
+ getScrollElement={() => viewport}
133
+ items={inputObjects}
134
+ />
135
+ </ScrollArea.Viewport>
136
+ </ScrollArea.Root>
137
+ </Mosaic.Container>
138
+ )}
139
+ </Panel.Content>
140
+ </Panel.Root>
141
+ );
142
+ };
143
+
144
+ const ArtifactTileCard = composable<HTMLDivElement, { data: Obj.Unknown }>(({ data, ...props }, forwardedRef) => {
145
+ const objectMenuItems = useObjectMenuItems(data);
146
+ const icon = Function.pipe(
147
+ Obj.getSchema(data),
148
+ Option.fromNullable,
149
+ Option.flatMap(Annotation.IconAnnotation.get),
150
+ Option.map(({ icon }) => icon),
151
+ Option.getOrElse(() => 'ph--placeholder--regular'),
152
+ );
153
+
154
+ return (
155
+ <Card.Root {...props} ref={forwardedRef} data-testid='board-item' fullWidth>
156
+ <Card.Toolbar>
157
+ <Card.IconBlock padding>
158
+ <Card.Icon icon={icon} />
159
+ </Card.IconBlock>
160
+ <Card.Title>{Obj.getLabel(data)}</Card.Title>
161
+ {/* TODO(wittjosiah): Reconcile with Card.Menu. */}
162
+ <Card.IconBlock padding>
163
+ <Menu.Trigger asChild disabled={!objectMenuItems?.length}>
164
+ <Toolbar.IconButton iconOnly variant='ghost' icon='ph--dots-three-vertical--regular' label='Actions' />
165
+ </Menu.Trigger>
166
+ <Menu.Content items={objectMenuItems} />
167
+ </Card.IconBlock>
168
+ </Card.Toolbar>
169
+ <Card.Content>
170
+ <Surface.Surface
171
+ type={AppSurface.Card}
172
+ limit={1}
173
+ data={{ subject: data } satisfies AppSurface.ObjectCardData}
174
+ />
175
+ </Card.Content>
176
+ </Card.Root>
177
+ );
178
+ });
179
+
180
+ ArtifactTileCard.displayName = 'ArtifactTileCard';
181
+
182
+ const MasonryArtifactTile = ({ data }: { data: Obj.Unknown; index: number }) => (
183
+ <Menu.Root>
184
+ <ArtifactTileCard data={data} />
185
+ </Menu.Root>
186
+ );
187
+
188
+ const StackTile = forwardRef<HTMLDivElement, MosaicTileProps<Obj.Unknown>>(
189
+ ({ data, location, debug, current }, forwardedRef) => (
190
+ <Menu.Root>
191
+ <Mosaic.Tile asChild id={data.id} data={data} location={location} debug={debug}>
192
+ <Focus.Item asChild current={current}>
193
+ <ArtifactTileCard ref={forwardedRef} data={data} />
194
+ </Focus.Item>
195
+ </Mosaic.Tile>
196
+ </Menu.Root>
197
+ ),
198
+ );
199
+
200
+ StackTile.displayName = 'StackTile';
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export { AgentArticle as default } from './AgentArticle';
@@ -0,0 +1,100 @@
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 { Plan, Agent } from '@dxos/assistant-toolkit';
11
+ import { Obj, Ref } from '@dxos/echo';
12
+ import { log } from '@dxos/log';
13
+ import { AutomationPlugin } from '@dxos/plugin-automation';
14
+ import { ClientPlugin } from '@dxos/plugin-client';
15
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
16
+ import { corePlugins } from '@dxos/plugin-testing';
17
+ import { Filter, useQuery, useSpaces } from '@dxos/react-client/echo';
18
+ import { Button } from '@dxos/react-ui';
19
+ import { ObjectProperties } from '@dxos/react-ui-form';
20
+ import { Loading, withLayout } from '@dxos/react-ui/testing';
21
+ import { Text } from '@dxos/schema';
22
+ import { Organization } from '@dxos/types';
23
+
24
+ import { AssistantPlugin } from '../../AssistantPlugin';
25
+ import { translations } from '../../translations';
26
+ import { AgentProperties } from './AgentProperties';
27
+
28
+ type DefaultStoryProps = {};
29
+
30
+ const DefaultStory = (_: DefaultStoryProps) => {
31
+ const [space] = useSpaces();
32
+ const [agent] = useQuery(space?.db, Filter.type(Agent.Agent));
33
+ if (!agent) {
34
+ return <Loading />;
35
+ }
36
+
37
+ return (
38
+ <ObjectProperties object={agent}>
39
+ <AgentProperties role='object-properties' subject={agent} />
40
+ <Button
41
+ classNames='mt-form-gap'
42
+ onClick={() => {
43
+ log.info('agent', { agent, instructions: agent.instructions.target });
44
+ }}
45
+ >
46
+ Debug
47
+ </Button>
48
+ </ObjectProperties>
49
+ );
50
+ };
51
+
52
+ const meta = {
53
+ title: 'plugins/plugin-assistant/containers/AgentProperties',
54
+ render: DefaultStory,
55
+ decorators: [
56
+ withLayout({ layout: 'column' }),
57
+ withPluginManager({
58
+ plugins: [
59
+ ...corePlugins(),
60
+ ClientPlugin({
61
+ types: [Agent.Agent, Plan.Plan, Text.Text, Organization.Organization],
62
+ onClientInitialized: ({ client }) =>
63
+ Effect.gen(function* () {
64
+ yield* initializeIdentity(client);
65
+ const [space] = client.spaces.get();
66
+ yield* Effect.promise(() => space.waitUntilReady());
67
+
68
+ const organization = space.db.add(
69
+ Obj.make(Organization.Organization, {
70
+ name: 'Acme Corp',
71
+ description: 'Sample organization for the story.',
72
+ }),
73
+ );
74
+
75
+ space.db.add(
76
+ Obj.make(Agent.Agent, {
77
+ instructions: Ref.make(Text.make()),
78
+ plan: Ref.make(Plan.makePlan({ tasks: [] })),
79
+ artifacts: [{ name: 'Organization', data: Ref.make(organization) }],
80
+ subscriptions: [],
81
+ }),
82
+ );
83
+ }),
84
+ }),
85
+ AutomationPlugin(),
86
+ AssistantPlugin(),
87
+ ],
88
+ }),
89
+ ],
90
+ parameters: {
91
+ layout: 'fullscreen',
92
+ translations,
93
+ },
94
+ } satisfies Meta<DefaultStoryProps>;
95
+
96
+ export default meta;
97
+
98
+ type Story = StoryObj<typeof meta>;
99
+
100
+ export const Default: Story = {};
@@ -0,0 +1,127 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Atom } from '@effect-atom/atom';
6
+ import { useAtomValue } from '@effect-atom/atom-react';
7
+ import * as Option from 'effect/Option';
8
+ import React, { useCallback, useEffect, useMemo } from 'react';
9
+
10
+ import { useCapability } from '@dxos/app-framework/ui';
11
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
12
+ import { Agent, SyncTriggers } from '@dxos/assistant-toolkit';
13
+ import { DXN, Obj, Ref } from '@dxos/echo';
14
+ import { AtomObj } from '@dxos/echo-atom';
15
+ import { log } from '@dxos/log';
16
+ import { Operation } from '@dxos/operation';
17
+ import { AutomationCapabilities } from '@dxos/plugin-automation/types';
18
+ import { Filter, useQuery } from '@dxos/react-client/echo';
19
+ import { Input, useTranslation } from '@dxos/react-ui';
20
+ import { FeedAnnotation } from '@dxos/schema';
21
+
22
+ import { meta } from '#meta';
23
+
24
+ export type AgentPropertiesProps = AppSurface.ObjectPropertiesProps<Agent.Agent>;
25
+
26
+ export const AgentProperties = ({ subject: agent }: AgentPropertiesProps) => {
27
+ const { t } = useTranslation(meta.id);
28
+ const db = Obj.getDatabase(agent);
29
+
30
+ // TODO(burdon): Factor out (separate component from container)?
31
+ const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
32
+ useEffect(() => {
33
+ if (!db) {
34
+ return;
35
+ }
36
+
37
+ return Obj.subscribe(agent, () => {
38
+ queueMicrotask(() => {
39
+ const runtime = computeRuntime.getRuntime(db.spaceId);
40
+ runtime
41
+ .runPromise(
42
+ Operation.invoke(SyncTriggers, {
43
+ agent: Ref.make(agent),
44
+ }),
45
+ )
46
+ .catch((err) => log.catch(err));
47
+ });
48
+ });
49
+ }, [db, agent, computeRuntime]);
50
+
51
+ // Build a filter matching objects of any schema annotated as a feed.
52
+ const feedFilter = useMemo(() => {
53
+ if (!db) {
54
+ return Filter.nothing();
55
+ }
56
+
57
+ const schemas = db.schemaRegistry.query({ location: ['database', 'runtime'] }).runSync();
58
+ const feedSchemas = schemas.filter((schema) => {
59
+ const annotation = FeedAnnotation.get(schema);
60
+ return Option.isSome(annotation) && annotation.value === true;
61
+ });
62
+
63
+ return feedSchemas.length === 0 ? Filter.nothing() : Filter.or(...feedSchemas.map((schema) => Filter.type(schema)));
64
+ }, [db]);
65
+
66
+ const subscribedObjects = useQuery(db, feedFilter);
67
+
68
+ // Query all existing subscriptions (e.g., mail, calendar, etc.)
69
+ const existingSubscriptions = useAtomValue(
70
+ useMemo(
71
+ () =>
72
+ AtomObj.make(agent).pipe((_) =>
73
+ Atom.make((get) => {
74
+ const agentObj = get(_);
75
+ const selectedSubscriptions: Obj.Unknown[] = subscribedObjects.filter((object) =>
76
+ agentObj.subscriptions.some((subscription) => DXN.equals(subscription.dxn, Obj.getDXN(object))),
77
+ );
78
+
79
+ return selectedSubscriptions;
80
+ }),
81
+ ),
82
+ [agent, subscribedObjects],
83
+ ),
84
+ );
85
+
86
+ // Create/remove agent subscription.
87
+ const handleSubscriptionChange = useCallback(
88
+ (object: Obj.Unknown, checked: boolean) => {
89
+ Obj.change(agent, (agent) => {
90
+ if (checked) {
91
+ agent.subscriptions.push(Ref.fromDXN(Obj.getDXN(object)));
92
+ } else {
93
+ agent.subscriptions = agent.subscriptions.filter(
94
+ (subscription) => !DXN.equals(subscription.dxn, Obj.getDXN(object)),
95
+ );
96
+ }
97
+ });
98
+ },
99
+ [agent],
100
+ );
101
+
102
+ if (subscribedObjects.length === 0) {
103
+ return null;
104
+ }
105
+
106
+ return (
107
+ <div role='none' className='dx-expander flex flex-col'>
108
+ <Input.Root>
109
+ <Input.Label classNames='mt-form-gap'>{t('subscriptions.label')}</Input.Label>
110
+ </Input.Root>
111
+
112
+ {subscribedObjects.map((object) => (
113
+ <Input.Root key={object.id}>
114
+ <div className='flex items-center gap-2'>
115
+ <Input.Checkbox
116
+ checked={existingSubscriptions.includes(object)}
117
+ onCheckedChange={(checked) => {
118
+ handleSubscriptionChange(object, checked === true);
119
+ }}
120
+ />
121
+ <Input.Label>{Obj.getLabel(object) ?? object.id}</Input.Label>
122
+ </div>
123
+ </Input.Root>
124
+ ))}
125
+ </div>
126
+ );
127
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ export { AgentProperties as default } from './AgentProperties';
@@ -0,0 +1,29 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { type Blueprint } from '@dxos/blueprints';
9
+ import { Panel, Toolbar } from '@dxos/react-ui';
10
+ import { useAttention } from '@dxos/react-ui-attention';
11
+
12
+ import { TemplateEditor } from '#components';
13
+
14
+ export type BlueprintArticleProps = AppSurface.ObjectArticleProps<Blueprint.Blueprint>;
15
+
16
+ export const BlueprintArticle = ({ role, attendableId, subject }: BlueprintArticleProps) => {
17
+ const { hasAttention } = useAttention(attendableId);
18
+
19
+ return (
20
+ <Panel.Root role={role} classNames='dx-document'>
21
+ <Panel.Toolbar asChild>
22
+ <Toolbar.Root disabled={!hasAttention} />
23
+ </Panel.Toolbar>
24
+ <Panel.Content asChild>
25
+ <TemplateEditor id={subject.id} template={subject.instructions} />
26
+ </Panel.Content>
27
+ </Panel.Root>
28
+ );
29
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { BlueprintArticle as default } from './BlueprintArticle';
@@ -0,0 +1,142 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Array from 'effect/Array';
6
+ import * as Function from 'effect/Function';
7
+ import * as Option from 'effect/Option';
8
+ import React, { forwardRef, useCallback, useMemo } from 'react';
9
+
10
+ import { useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
11
+ import { AppCapabilities } from '@dxos/app-toolkit';
12
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
13
+ import { Chat } from '@dxos/assistant-toolkit';
14
+ import { Blueprint } from '@dxos/blueprints';
15
+ import { getSpace } from '@dxos/client/echo';
16
+ import { Filter, Obj, Ref } from '@dxos/echo';
17
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
18
+ import { useQuery } from '@dxos/react-client/echo';
19
+ import { useAsyncEffect } from '@dxos/react-ui';
20
+
21
+ import { type ChatEvent } from '#components';
22
+ import { useBlueprintRegistry, useContextBinder } from '#hooks';
23
+ import { AssistantOperation } from '#operations';
24
+
25
+ import ChatContainer from '../ChatContainer';
26
+
27
+ export type ChatCompanionProps = AppSurface.ArticleProps<Chat.Chat, {}, Obj.Unknown>;
28
+
29
+ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
30
+ ({ role, subject: chat, companionTo, attendableId }, forwardedRef) => {
31
+ const { invokePromise } = useOperationInvoker();
32
+ const blueprintRegistry = useBlueprintRegistry();
33
+ const space = getSpace(companionTo);
34
+ const feedTarget = chat?.feed.target;
35
+ const binder = useContextBinder(space, feedTarget);
36
+
37
+ // Persist chat on first submit.
38
+ const handleEvent = useCallback(
39
+ async (event: ChatEvent) => {
40
+ if (!space || !chat) {
41
+ return;
42
+ }
43
+
44
+ if (event.type === 'submit' && !getSpace(chat)) {
45
+ await invokePromise(SpaceOperation.AddObject, {
46
+ object: chat,
47
+ target: space.db,
48
+ hidden: true,
49
+ });
50
+ await invokePromise(SpaceOperation.AddRelation, {
51
+ db: space.db,
52
+ schema: Chat.CompanionTo,
53
+ source: chat,
54
+ target: companionTo,
55
+ });
56
+ await invokePromise(AssistantOperation.SetCurrentChat, {
57
+ companionTo,
58
+ chat,
59
+ });
60
+ }
61
+ },
62
+ [chat, space, companionTo, invokePromise],
63
+ );
64
+
65
+ const metadata = useCapabilities(AppCapabilities.Metadata);
66
+ const blueprintKeys = useMemo(
67
+ () =>
68
+ Function.pipe(
69
+ metadata,
70
+ Array.findFirst(
71
+ (
72
+ capability,
73
+ ): capability is {
74
+ id: string;
75
+ metadata: { blueprints?: string[] };
76
+ } => capability.id === Obj.getTypename(companionTo),
77
+ ),
78
+ Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
79
+ Option.getOrElse(() => [] as string[]),
80
+ ),
81
+ [metadata, companionTo],
82
+ );
83
+ const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
84
+ const pluginBlueprints = useMemo(
85
+ () => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
86
+ [existingBlueprints, blueprintKeys],
87
+ );
88
+
89
+ // Initialize related blueprints that are not already in the space.
90
+ useAsyncEffect(async () => {
91
+ if (!space) {
92
+ return;
93
+ }
94
+
95
+ // NOTE: This must be run instead of using the useQuery result to avoid duplicates.
96
+ const existingBlueprints = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
97
+ for (const key of blueprintKeys) {
98
+ const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
99
+ if (existingBlueprint) {
100
+ continue;
101
+ }
102
+
103
+ const blueprint = blueprintRegistry.getByKey(key);
104
+ if (!blueprint) {
105
+ continue;
106
+ }
107
+
108
+ space.db.add(Obj.clone(blueprint, { deep: true }));
109
+ }
110
+ }, [space, blueprintRegistry, blueprintKeys]);
111
+
112
+ useAsyncEffect(async () => {
113
+ if (!binder?.isOpen) {
114
+ return;
115
+ }
116
+
117
+ if (pluginBlueprints.length > 0) {
118
+ await binder.bind({
119
+ blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
120
+ });
121
+ }
122
+
123
+ if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
124
+ await binder.bind({ blueprints: [Ref.make(companionTo)] });
125
+ } else {
126
+ await binder.bind({ objects: [Ref.make(companionTo)] });
127
+ }
128
+ }, [binder, companionTo, blueprintKeys]);
129
+
130
+ return (
131
+ <ChatContainer
132
+ role={role ?? 'article'}
133
+ space={space}
134
+ subject={chat}
135
+ attendableId={attendableId}
136
+ companionTo={companionTo}
137
+ onEvent={handleEvent}
138
+ ref={forwardedRef}
139
+ />
140
+ );
141
+ },
142
+ );
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { ChatCompanion as default } from './ChatCompanion';