@dxos/plugin-assistant 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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 (556) 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-RUV2WOQH.mjs +154 -0
  9. package/dist/lib/browser/chunk-RUV2WOQH.mjs.map +7 -0
  10. package/dist/lib/browser/create-chat-DF5TG5XC.mjs +82 -0
  11. package/dist/lib/browser/create-chat-DF5TG5XC.mjs.map +7 -0
  12. package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs +65 -0
  13. package/dist/lib/browser/ensure-companion-chat-FR4AWZ2P.mjs.map +7 -0
  14. package/dist/lib/browser/index.mjs +3062 -322
  15. package/dist/lib/browser/index.mjs.map +4 -4
  16. package/dist/lib/browser/meta.json +1 -1
  17. package/dist/lib/browser/on-create-space-54RNX5JI.mjs +22 -0
  18. package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +7 -0
  19. package/dist/lib/browser/operations/index.mjs +13 -0
  20. package/dist/lib/browser/operations/index.mjs.map +7 -0
  21. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs +22 -0
  22. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +7 -0
  23. package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs +136 -0
  24. package/dist/lib/browser/run-prompt-in-new-chat-4YQ37XIS.mjs.map +7 -0
  25. package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs +54 -0
  26. package/dist/lib/browser/set-current-chat-WJI3WAVM.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +5 -4
  28. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs +71 -0
  29. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +7 -0
  30. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +98 -0
  31. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +7 -0
  32. package/dist/lib/node-esm/blueprints/index.mjs +9 -0
  33. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +32 -0
  34. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +177 -0
  36. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-PY4X6FJT.mjs +155 -0
  38. package/dist/lib/node-esm/chunk-PY4X6FJT.mjs.map +7 -0
  39. package/dist/lib/node-esm/create-chat-RAV7IX2S.mjs +83 -0
  40. package/dist/lib/node-esm/create-chat-RAV7IX2S.mjs.map +7 -0
  41. package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs +66 -0
  42. package/dist/lib/node-esm/ensure-companion-chat-BLP7NT32.mjs.map +7 -0
  43. package/dist/lib/node-esm/index.mjs +3062 -322
  44. package/dist/lib/node-esm/index.mjs.map +4 -4
  45. package/dist/lib/node-esm/meta.json +1 -1
  46. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +23 -0
  47. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +7 -0
  48. package/dist/lib/node-esm/operations/index.mjs +14 -0
  49. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  50. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +23 -0
  51. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +7 -0
  52. package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs +137 -0
  53. package/dist/lib/node-esm/run-prompt-in-new-chat-2IJBSDTM.mjs.map +7 -0
  54. package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs +55 -0
  55. package/dist/lib/node-esm/set-current-chat-KBMMZULR.mjs.map +7 -0
  56. package/dist/lib/node-esm/types/index.mjs +5 -4
  57. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +72 -0
  58. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +7 -0
  59. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  60. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  61. package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
  62. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
  63. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
  64. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
  66. package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/index.d.ts +2 -0
  68. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/ai-service.d.ts +4 -2
  70. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  71. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  72. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/blueprint-definition.d.ts +4 -6
  74. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
  76. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/edge-model-resolver.d.ts +6 -3
  78. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/index.d.ts +41 -12
  80. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/local-model-resolver.d.ts +6 -3
  82. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/markdown.d.ts +5 -0
  84. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  86. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  88. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  90. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/settings.d.ts +16 -2
  92. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  93. package/dist/types/src/capabilities/state.d.ts +19 -2
  94. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/toolkit.d.ts +4 -2
  96. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  97. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
  98. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  99. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +517 -0
  100. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
  101. package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
  102. package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
  103. package/dist/types/src/components/Chat/Chat.d.ts +30 -19
  104. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  105. package/dist/types/src/components/Chat/events.d.ts +1 -1
  106. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  107. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +6 -3
  108. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  109. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
  110. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  111. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
  112. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  113. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
  114. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  115. package/dist/types/src/components/ChatThread/ChatStream.stories.d.ts +530 -0
  116. package/dist/types/src/components/ChatThread/ChatStream.stories.d.ts.map +1 -0
  117. package/dist/types/src/components/ChatThread/ChatThread.d.ts +4 -4
  118. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  119. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +502 -300
  120. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  121. package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
  122. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  123. package/dist/types/src/components/ChatThread/sync.d.ts +6 -6
  124. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  125. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
  126. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
  127. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +14 -0
  128. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +1 -0
  129. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
  130. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
  131. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
  132. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
  133. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
  134. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
  135. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
  136. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
  137. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
  138. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
  139. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
  140. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
  141. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
  142. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
  143. package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
  144. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
  145. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +14 -0
  146. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
  147. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +8 -0
  148. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
  149. package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
  150. package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
  151. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +9 -4
  152. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  153. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +493 -290
  154. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  155. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
  156. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  157. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +494 -291
  158. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  159. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  160. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +1 -10
  161. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  162. package/dist/types/src/components/Toolbox/Toolbox.d.ts +17 -12
  163. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  164. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +493 -290
  165. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  166. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
  167. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
  168. package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
  169. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
  170. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
  171. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
  172. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
  173. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
  174. package/dist/types/src/components/Typewriter/index.d.ts +2 -0
  175. package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
  176. package/dist/types/src/components/index.d.ts +3 -6
  177. package/dist/types/src/components/index.d.ts.map +1 -1
  178. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
  179. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
  180. package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
  181. package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
  182. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
  183. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
  184. package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
  185. package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
  186. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
  187. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
  188. package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
  189. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
  190. package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
  191. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
  192. package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
  193. package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
  194. package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts +6 -0
  195. package/dist/types/src/containers/ProjectArticle/ProjectArticle.d.ts.map +1 -0
  196. package/dist/types/src/containers/ProjectArticle/index.d.ts +2 -0
  197. package/dist/types/src/containers/ProjectArticle/index.d.ts.map +1 -0
  198. package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts +6 -0
  199. package/dist/types/src/containers/ProjectSettings/ProjectSettings.d.ts.map +1 -0
  200. package/dist/types/src/containers/ProjectSettings/index.d.ts +2 -0
  201. package/dist/types/src/containers/ProjectSettings/index.d.ts.map +1 -0
  202. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +6 -0
  203. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +1 -0
  204. package/dist/types/src/containers/PromptArticle/index.d.ts +2 -0
  205. package/dist/types/src/containers/PromptArticle/index.d.ts.map +1 -0
  206. package/dist/types/src/containers/PromptList/PromptList.d.ts +6 -0
  207. package/dist/types/src/containers/PromptList/PromptList.d.ts.map +1 -0
  208. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts +523 -0
  209. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +1 -0
  210. package/dist/types/src/containers/PromptList/index.d.ts +2 -0
  211. package/dist/types/src/containers/PromptList/index.d.ts.map +1 -0
  212. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +6 -0
  213. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
  214. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
  215. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
  216. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
  217. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
  218. package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
  219. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
  220. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +4 -0
  221. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  222. package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
  223. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
  224. package/dist/types/src/containers/index.d.ts +12 -0
  225. package/dist/types/src/containers/index.d.ts.map +1 -0
  226. package/dist/types/src/extensions/index.d.ts +2 -0
  227. package/dist/types/src/extensions/index.d.ts.map +1 -0
  228. package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
  229. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
  230. package/dist/types/src/hooks/index.d.ts +1 -1
  231. package/dist/types/src/hooks/index.d.ts.map +1 -1
  232. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
  233. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  234. package/dist/types/src/hooks/useChatProcessor.d.ts +7 -6
  235. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  236. package/dist/types/src/hooks/useChatServices.d.ts +5 -8
  237. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  238. package/dist/types/src/hooks/useChatToolbarActions.d.ts +3 -3
  239. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  240. package/dist/types/src/hooks/useContextBinder.d.ts +3 -2
  241. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  242. package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
  243. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  244. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  245. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  246. package/dist/types/src/hooks/usePresets.d.ts +1 -1
  247. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  248. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  249. package/dist/types/src/index.d.ts +1 -2
  250. package/dist/types/src/index.d.ts.map +1 -1
  251. package/dist/types/src/meta.d.ts +4 -2
  252. package/dist/types/src/meta.d.ts.map +1 -1
  253. package/dist/types/src/operations/create-chat.d.ts +5 -0
  254. package/dist/types/src/operations/create-chat.d.ts.map +1 -0
  255. package/dist/types/src/operations/definitions.d.ts +135 -0
  256. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  257. package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
  258. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
  259. package/dist/types/src/operations/index.d.ts +4 -0
  260. package/dist/types/src/operations/index.d.ts.map +1 -0
  261. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  262. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  263. package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
  264. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
  265. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
  266. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
  267. package/dist/types/src/operations/set-current-chat.d.ts +5 -0
  268. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
  269. package/dist/types/src/operations/update-chat-name.d.ts +5 -0
  270. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
  271. package/dist/types/src/processor/index.d.ts +0 -1
  272. package/dist/types/src/processor/index.d.ts.map +1 -1
  273. package/dist/types/src/processor/processor.d.ts +34 -28
  274. package/dist/types/src/processor/processor.d.ts.map +1 -1
  275. package/dist/types/src/queue-logger.d.ts.map +1 -1
  276. package/dist/types/src/testing/test-generator.d.ts +3 -2
  277. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  278. package/dist/types/src/testing/test-services.d.ts +1 -1
  279. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  280. package/dist/types/src/translations.d.ts +493 -290
  281. package/dist/types/src/translations.d.ts.map +1 -1
  282. package/dist/types/src/types/Assistant.d.ts +18 -46
  283. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  284. package/dist/types/src/types/Settings.d.ts +10 -0
  285. package/dist/types/src/types/Settings.d.ts.map +1 -0
  286. package/dist/types/src/types/capabilities.d.ts +44 -0
  287. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  288. package/dist/types/src/types/events.d.ts +5 -0
  289. package/dist/types/src/types/events.d.ts.map +1 -0
  290. package/dist/types/src/types/index.d.ts +3 -1
  291. package/dist/types/src/types/index.d.ts.map +1 -1
  292. package/dist/types/src/types/service.d.ts +10 -218
  293. package/dist/types/src/types/service.d.ts.map +1 -1
  294. package/dist/types/tsconfig.tsbuildinfo +1 -1
  295. package/package.json +139 -93
  296. package/src/AssistantPlugin.tsx +182 -132
  297. package/src/blueprints/assistant/blueprint.conversations.json +1 -0
  298. package/src/blueprints/assistant/blueprint.test.ts +46 -0
  299. package/src/blueprints/assistant/blueprint.ts +31 -0
  300. package/src/blueprints/assistant/index.ts +5 -0
  301. package/src/blueprints/index.ts +5 -0
  302. package/src/capabilities/ai-service.ts +20 -17
  303. package/src/capabilities/app-graph-builder.ts +190 -183
  304. package/src/capabilities/blueprint-definition.ts +47 -55
  305. package/src/capabilities/companion-chat-provisioner.ts +164 -0
  306. package/src/capabilities/edge-model-resolver.ts +22 -14
  307. package/src/capabilities/index.ts +21 -14
  308. package/src/capabilities/local-model-resolver.ts +21 -13
  309. package/src/capabilities/markdown.ts +40 -0
  310. package/src/capabilities/migrations.ts +34 -0
  311. package/src/capabilities/operation-handler.ts +16 -0
  312. package/src/capabilities/react-surface.tsx +138 -68
  313. package/src/capabilities/settings.ts +24 -12
  314. package/src/capabilities/state.ts +26 -13
  315. package/src/capabilities/toolkit.ts +7 -11
  316. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +34 -0
  317. package/src/components/AssistantSettings/AssistantSettings.tsx +105 -85
  318. package/src/components/AssistantSettings/index.ts +2 -2
  319. package/src/components/Chat/Chat.tsx +147 -104
  320. package/src/components/Chat/events.ts +1 -1
  321. package/src/components/ChatProgress/ChatProgress.tsx +11 -22
  322. package/src/components/ChatPrompt/ChatActions.tsx +26 -6
  323. package/src/components/ChatPrompt/ChatOptions.tsx +103 -79
  324. package/src/components/ChatPrompt/ChatReferences.tsx +21 -12
  325. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
  326. package/src/components/ChatThread/ChatStream.stories.tsx +168 -0
  327. package/src/components/ChatThread/ChatThread.stories.tsx +30 -45
  328. package/src/components/ChatThread/ChatThread.tsx +29 -18
  329. package/src/components/ChatThread/Link.tsx +4 -4
  330. package/src/components/ChatThread/registry.tsx +74 -40
  331. package/src/components/ChatThread/sync.test.ts +19 -9
  332. package/src/components/ChatThread/sync.ts +27 -27
  333. package/src/components/ChatThread/testing/thread-1.md +17 -0
  334. package/src/components/ChatThread/widgets/FallbackWidget.tsx +24 -0
  335. package/src/components/ChatThread/widgets/PromptWidget.ts +28 -0
  336. package/src/components/ChatThread/widgets/ReasoningWidget.ts +120 -0
  337. package/src/components/ChatThread/widgets/ReferenceWidget.ts +31 -0
  338. package/src/components/ChatThread/widgets/SelectWidget.ts +37 -0
  339. package/src/components/ChatThread/widgets/StatsWidget.ts +29 -0
  340. package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
  341. package/src/components/ChatThread/widgets/SummaryWidget.tsx +28 -0
  342. package/src/components/ChatThread/widgets/ToolWidget.tsx +143 -0
  343. package/src/components/ChatThread/widgets/index.ts +13 -0
  344. package/src/components/ProcessTree/ProcessTree.stories.tsx +109 -0
  345. package/src/components/ProcessTree/ProcessTree.tsx +85 -0
  346. package/src/components/ProcessTree/index.ts +5 -0
  347. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +5 -10
  348. package/src/components/TemplateEditor/TemplateEditor.tsx +53 -42
  349. package/src/components/TemplateEditor/TemplateForm.stories.tsx +20 -11
  350. package/src/components/TemplateEditor/TemplateForm.tsx +83 -37
  351. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +14 -9
  352. package/src/components/ToolBlock/ToolBlock.tsx +25 -24
  353. package/src/components/Toolbox/Toolbox.stories.tsx +11 -14
  354. package/src/components/Toolbox/Toolbox.tsx +72 -67
  355. package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
  356. package/src/components/Typewriter/Typewriter.stories.tsx +86 -0
  357. package/src/components/Typewriter/Typewriter.tsx +50 -0
  358. package/src/components/Typewriter/assistant-extension.tsx +141 -0
  359. package/src/components/Typewriter/index.ts +5 -0
  360. package/src/components/index.ts +3 -7
  361. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
  362. package/src/containers/BlueprintArticle/index.ts +5 -0
  363. package/src/containers/ChatCompanion/ChatCompanion.tsx +142 -0
  364. package/src/containers/ChatCompanion/index.ts +5 -0
  365. package/src/containers/ChatContainer/ChatContainer.tsx +95 -0
  366. package/src/containers/ChatContainer/index.ts +5 -0
  367. package/src/{components → containers/ChatDialog}/ChatDialog.tsx +13 -16
  368. package/src/containers/ChatDialog/index.ts +5 -0
  369. package/src/containers/ProjectArticle/ProjectArticle.tsx +131 -0
  370. package/src/containers/ProjectArticle/index.ts +5 -0
  371. package/src/containers/ProjectSettings/ProjectSettings.tsx +139 -0
  372. package/src/containers/ProjectSettings/index.ts +5 -0
  373. package/src/containers/PromptArticle/PromptArticle.tsx +59 -0
  374. package/src/containers/PromptArticle/index.ts +5 -0
  375. package/src/containers/PromptList/PromptList.stories.tsx +129 -0
  376. package/src/containers/PromptList/PromptList.tsx +49 -0
  377. package/src/containers/PromptList/index.ts +5 -0
  378. package/src/containers/TracePanel/TracePanel.tsx +305 -0
  379. package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
  380. package/src/containers/TracePanel/dxn-extractor.ts +178 -0
  381. package/src/containers/TracePanel/index.ts +9 -0
  382. package/src/containers/TriggerStatus/TriggerStatus.tsx +144 -0
  383. package/src/containers/TriggerStatus/index.ts +5 -0
  384. package/src/containers/index.ts +16 -0
  385. package/src/extensions/index.ts +5 -0
  386. package/src/extensions/prompt-extension.ts +111 -0
  387. package/src/hooks/index.ts +1 -1
  388. package/src/hooks/useBlueprintRegistry.ts +36 -22
  389. package/src/hooks/useChatProcessor.ts +34 -18
  390. package/src/hooks/useChatServices.ts +9 -34
  391. package/src/hooks/useChatToolbarActions.ts +34 -34
  392. package/src/hooks/useContextBinder.ts +20 -7
  393. package/src/hooks/useContextObjects.ts +16 -24
  394. package/src/hooks/useFilteredTypes.ts +37 -0
  395. package/src/hooks/usePresets.ts +2 -1
  396. package/src/hooks/useReferencesProvider.ts +5 -9
  397. package/src/index.ts +1 -2
  398. package/src/meta.ts +7 -4
  399. package/src/operations/create-chat.ts +80 -0
  400. package/src/operations/definitions.ts +127 -0
  401. package/src/operations/ensure-companion-chat.ts +61 -0
  402. package/src/operations/index.ts +17 -0
  403. package/src/operations/on-create-space.ts +24 -0
  404. package/src/operations/resolve-navigation-targets.ts +26 -0
  405. package/src/operations/run-prompt-in-new-chat.ts +113 -0
  406. package/src/operations/set-current-chat.ts +50 -0
  407. package/src/operations/update-chat-name.ts +61 -0
  408. package/src/processor/index.ts +0 -1
  409. package/src/processor/processor.test.ts +20 -51
  410. package/src/processor/processor.ts +196 -137
  411. package/src/queue-logger.ts +4 -1
  412. package/src/testing/test-generator.ts +17 -16
  413. package/src/testing/test-sequence.ts +3 -3
  414. package/src/testing/test-services.ts +9 -7
  415. package/src/translations.ts +126 -79
  416. package/src/types/Assistant.ts +8 -57
  417. package/src/types/Settings.ts +21 -0
  418. package/src/types/capabilities.ts +35 -0
  419. package/src/types/events.ts +11 -0
  420. package/src/types/index.ts +5 -1
  421. package/src/types/service.ts +14 -11
  422. package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs +0 -36
  423. package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +0 -7
  424. package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs +0 -158
  425. package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs.map +0 -7
  426. package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs +0 -77
  427. package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs.map +0 -7
  428. package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs +0 -90
  429. package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs.map +0 -7
  430. package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +0 -59
  431. package/dist/lib/browser/PromptArticle-45QX25Y5.mjs.map +0 -7
  432. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
  433. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
  434. package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs +0 -199
  435. package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +0 -7
  436. package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs +0 -12
  437. package/dist/lib/browser/chunk-2BOE3OTW.mjs +0 -262
  438. package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
  439. package/dist/lib/browser/chunk-BNTPFZ7O.mjs +0 -229
  440. package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +0 -7
  441. package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs +0 -335
  442. package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +0 -7
  443. package/dist/lib/browser/chunk-IXIIS4QA.mjs +0 -176
  444. package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +0 -7
  445. package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
  446. package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
  447. package/dist/lib/browser/chunk-U62BTGDF.mjs +0 -1929
  448. package/dist/lib/browser/chunk-U62BTGDF.mjs.map +0 -7
  449. package/dist/lib/browser/chunk-WBG5PTSX.mjs +0 -23
  450. package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
  451. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
  452. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
  453. package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs +0 -143
  454. package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs.map +0 -7
  455. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
  456. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
  457. package/dist/lib/browser/react-surface-YCSR2MSR.mjs +0 -98
  458. package/dist/lib/browser/react-surface-YCSR2MSR.mjs.map +0 -7
  459. package/dist/lib/browser/settings-NYJGNQ5I.mjs +0 -23
  460. package/dist/lib/browser/settings-NYJGNQ5I.mjs.map +0 -7
  461. package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
  462. package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
  463. package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
  464. package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
  465. package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs +0 -37
  466. package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +0 -7
  467. package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs +0 -159
  468. package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs.map +0 -7
  469. package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs +0 -78
  470. package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs.map +0 -7
  471. package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs +0 -91
  472. package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs.map +0 -7
  473. package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +0 -60
  474. package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs.map +0 -7
  475. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
  476. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
  477. package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs +0 -200
  478. package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +0 -7
  479. package/dist/lib/node-esm/blueprint-definition-XW6QQVLV.mjs +0 -13
  480. package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +0 -264
  481. package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
  482. package/dist/lib/node-esm/chunk-AB74FOA2.mjs +0 -230
  483. package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +0 -7
  484. package/dist/lib/node-esm/chunk-BHS747K7.mjs +0 -1930
  485. package/dist/lib/node-esm/chunk-BHS747K7.mjs.map +0 -7
  486. package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs +0 -336
  487. package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +0 -7
  488. package/dist/lib/node-esm/chunk-UXTUHH24.mjs +0 -178
  489. package/dist/lib/node-esm/chunk-UXTUHH24.mjs.map +0 -7
  490. package/dist/lib/node-esm/chunk-WE6KTH72.mjs +0 -25
  491. package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
  492. package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
  493. package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
  494. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
  495. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
  496. package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs +0 -144
  497. package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs.map +0 -7
  498. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
  499. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
  500. package/dist/lib/node-esm/react-surface-CTW44GEM.mjs +0 -99
  501. package/dist/lib/node-esm/react-surface-CTW44GEM.mjs.map +0 -7
  502. package/dist/lib/node-esm/settings-RRHYI5KO.mjs +0 -24
  503. package/dist/lib/node-esm/settings-RRHYI5KO.mjs.map +0 -7
  504. package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
  505. package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
  506. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
  507. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
  508. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  509. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  510. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  511. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  512. package/dist/types/src/components/BlueprintArticle.d.ts +0 -7
  513. package/dist/types/src/components/BlueprintArticle.d.ts.map +0 -1
  514. package/dist/types/src/components/ChatCompanion.d.ts +0 -13
  515. package/dist/types/src/components/ChatCompanion.d.ts.map +0 -1
  516. package/dist/types/src/components/ChatContainer.d.ts +0 -14
  517. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  518. package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
  519. package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
  520. package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
  521. package/dist/types/src/components/PromptArticle.d.ts +0 -7
  522. package/dist/types/src/components/PromptArticle.d.ts.map +0 -1
  523. package/dist/types/src/events.d.ts +0 -4
  524. package/dist/types/src/events.d.ts.map +0 -1
  525. package/dist/types/src/functions/analysis.d.ts +0 -5
  526. package/dist/types/src/functions/analysis.d.ts.map +0 -1
  527. package/dist/types/src/functions/index.d.ts +0 -4
  528. package/dist/types/src/functions/index.d.ts.map +0 -1
  529. package/dist/types/src/functions/object-list.d.ts +0 -10
  530. package/dist/types/src/functions/object-list.d.ts.map +0 -1
  531. package/dist/types/src/functions/object-load.d.ts +0 -8
  532. package/dist/types/src/functions/object-load.d.ts.map +0 -1
  533. package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
  534. package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
  535. package/dist/types/src/processor/update-name.d.ts +0 -10
  536. package/dist/types/src/processor/update-name.d.ts.map +0 -1
  537. package/dist/types/src/types/AssistantAction.d.ts +0 -132
  538. package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
  539. package/src/capabilities/capabilities.ts +0 -17
  540. package/src/capabilities/intent-resolver.ts +0 -147
  541. package/src/components/BlueprintArticle.tsx +0 -29
  542. package/src/components/ChatCompanion.tsx +0 -155
  543. package/src/components/ChatContainer.tsx +0 -61
  544. package/src/components/ChatThread/reducers.ts +0 -151
  545. package/src/components/PromptArticle.tsx +0 -51
  546. package/src/events.ts +0 -11
  547. package/src/functions/analysis.ts +0 -22
  548. package/src/functions/index.ts +0 -7
  549. package/src/functions/object-list.ts +0 -48
  550. package/src/functions/object-load.ts +0 -45
  551. package/src/hooks/useItemTypes.ts +0 -37
  552. package/src/processor/update-name.ts +0 -56
  553. package/src/types/AssistantAction.ts +0 -79
  554. /package/dist/lib/browser/{blueprint-definition-5FT5JGPY.mjs.map → blueprints/index.mjs.map} +0 -0
  555. /package/dist/lib/node-esm/{blueprint-definition-XW6QQVLV.mjs.map → blueprints/index.mjs.map} +0 -0
  556. /package/src/components/ChatThread/testing/{thread.md → thread-2.md} +0 -0
@@ -1,10 +0,0 @@
1
- declare const _default: import("@dxos/functions").FunctionDefinition<{
2
- readonly typename: string;
3
- }, {
4
- readonly results: readonly {
5
- readonly dxn: string;
6
- readonly label?: string | undefined;
7
- }[];
8
- }, import("@dxos/functions").FunctionServices>;
9
- export default _default;
10
- //# sourceMappingURL=object-list.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object-list.d.ts","sourceRoot":"","sources":["../../../../src/functions/object-list.ts"],"names":[],"mappings":";;;;;;;;AAYA,wBAmCG"}
@@ -1,8 +0,0 @@
1
- declare const _default: import("@dxos/functions").FunctionDefinition<{
2
- readonly typename: string;
3
- readonly id: string;
4
- }, {
5
- readonly object: any;
6
- }, import("@dxos/functions").FunctionServices>;
7
- export default _default;
8
- //# sourceMappingURL=object-load.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"object-load.d.ts","sourceRoot":"","sources":["../../../../src/functions/object-load.ts"],"names":[],"mappings":";;;;;;AAcA,wBA8BG"}
@@ -1,4 +0,0 @@
1
- import { type Type } from '@dxos/echo';
2
- import { type Space } from '@dxos/react-client/echo';
3
- export declare const useItemTypes: (space?: Space) => Type.Obj.Any[];
4
- //# sourceMappingURL=useItemTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useItemTypes.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useItemTypes.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAIrD,eAAO,MAAM,YAAY,GAAI,QAAQ,KAAK,KAAG,IAAI,CAAC,GAAG,CAAC,GAAG,EAwBxD,CAAC"}
@@ -1,10 +0,0 @@
1
- import * as Runtime from 'effect/Runtime';
2
- import { type ModelName } from '@dxos/ai';
3
- import { type AiConversation } from '@dxos/assistant';
4
- import { type Assistant } from '../types';
5
- import { type AiChatServices } from './processor';
6
- /**
7
- * Update the current chat's name.
8
- */
9
- export declare const updateName: (runtime: Runtime.Runtime<AiChatServices>, conversation: AiConversation, chat: Assistant.Chat, model?: ModelName) => Promise<void>;
10
- //# sourceMappingURL=update-name.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-name.d.ts","sourceRoot":"","sources":["../../../../src/processor/update-name.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,OAAO,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AACzE,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,iBAAiB,CAAC;AAIjE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;GAEG;AAEH,eAAO,MAAM,UAAU,GACrB,SAAS,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,EACxC,cAAc,cAAc,EAC5B,MAAM,SAAS,CAAC,IAAI,EACpB,QAAO,SAA8B,KACpC,OAAO,CAAC,IAAI,CA4Bd,CAAC"}
@@ -1,132 +0,0 @@
1
- import * as Schema from 'effect/Schema';
2
- import { Prompt } from '@dxos/blueprints';
3
- declare const onCreateSpace_base: Schema.TaggedClass<onCreateSpace, `${string}/on-space-created`, {
4
- readonly _tag: Schema.tag<`${string}/on-space-created`>;
5
- } & {
6
- input: Schema.Struct<{
7
- space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
8
- rootCollection: import("@dxos/echo/Type").obj<Schema.Struct<{
9
- name: Schema.optional<typeof Schema.String>;
10
- objects: Schema.mutable<Schema.Array$<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo/Type").Expando, {
11
- [x: string]: any;
12
- id: string;
13
- }, never>>>>;
14
- }>>;
15
- }>;
16
- output: typeof Schema.Void;
17
- }>;
18
- export declare class onCreateSpace extends onCreateSpace_base {
19
- }
20
- declare const CreateChat_base: Schema.TaggedClass<CreateChat, `${string}/action/create-chat`, {
21
- readonly _tag: Schema.tag<`${string}/action/create-chat`>;
22
- } & {
23
- input: Schema.Struct<{
24
- space: Schema.Schema<import("@dxos/client-protocol").Space, import("@dxos/client-protocol").Space, never>;
25
- name: Schema.optional<typeof Schema.String>;
26
- }>;
27
- output: Schema.Struct<{
28
- object: import("@dxos/echo/Type").obj<Schema.Struct<{
29
- name: Schema.optional<typeof Schema.String>;
30
- queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
31
- traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
32
- }>>;
33
- }>;
34
- }>;
35
- export declare class CreateChat extends CreateChat_base {
36
- }
37
- declare const UpdateChatName_base: Schema.TaggedClass<UpdateChatName, `${string}/action/update-name`, {
38
- readonly _tag: Schema.tag<`${string}/action/update-name`>;
39
- } & {
40
- input: Schema.Struct<{
41
- chat: import("@dxos/echo/Type").obj<Schema.Struct<{
42
- name: Schema.optional<typeof Schema.String>;
43
- queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
44
- traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
45
- }>>;
46
- }>;
47
- output: typeof Schema.Void;
48
- }>;
49
- export declare class UpdateChatName extends UpdateChatName_base {
50
- }
51
- export declare const BlueprintForm: Schema.Struct<{
52
- key: typeof Schema.String;
53
- name: typeof Schema.String;
54
- description: Schema.optional<typeof Schema.String>;
55
- }>;
56
- declare const CreateBlueprint_base: Schema.TaggedClass<CreateBlueprint, `${string}/action/create-blueprint`, {
57
- readonly _tag: Schema.tag<`${string}/action/create-blueprint`>;
58
- } & {
59
- input: Schema.Struct<{
60
- key: typeof Schema.String;
61
- name: typeof Schema.String;
62
- description: Schema.optional<typeof Schema.String>;
63
- }>;
64
- output: Schema.Struct<{
65
- object: import("@dxos/echo/Type").obj<Schema.Struct<{
66
- key: Schema.SchemaClass<string, string, never>;
67
- name: Schema.SchemaClass<string, string, never>;
68
- description: Schema.optional<typeof Schema.String>;
69
- instructions: Schema.mutable<Schema.Struct<{
70
- source: Schema.SchemaClass<import("@dxos/echo/internal").Ref<import("@dxos/echo/Type").OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
71
- content: string;
72
- }>, import("@dxos/echo-protocol").EncodedReference, never>;
73
- inputs: Schema.optional<Schema.mutable<Schema.Array$<Schema.mutable<Schema.Struct<{
74
- name: typeof Schema.String;
75
- kind: Schema.optional<Schema.Literal<["value", "pass-through", "retriever", "function", "query", "resolver", "context", "schema"]>>;
76
- default: Schema.optional<typeof Schema.Any>;
77
- }>>>>>;
78
- }>>;
79
- tools: Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>;
80
- }>>;
81
- }>;
82
- }>;
83
- export declare class CreateBlueprint extends CreateBlueprint_base {
84
- }
85
- declare const CreatePrompt_base: Schema.TaggedClass<CreatePrompt, `${string}/action/create-prompt`, {
86
- readonly _tag: Schema.tag<`${string}/action/create-prompt`>;
87
- } & {
88
- input: Schema.Struct<{
89
- name: Schema.optional<typeof Schema.String>;
90
- }>;
91
- output: Schema.Struct<{
92
- object: Schema.Schema<Prompt.Prompt, Prompt.Prompt_Encoded, never>;
93
- }>;
94
- }>;
95
- export declare class CreatePrompt extends CreatePrompt_base {
96
- }
97
- declare const CreateSequence_base: Schema.TaggedClass<CreateSequence, `${string}/action/create-sequence`, {
98
- readonly _tag: Schema.tag<`${string}/action/create-sequence`>;
99
- } & {
100
- input: Schema.Struct<{
101
- name: Schema.optional<typeof Schema.String>;
102
- }>;
103
- output: Schema.Struct<{
104
- object: import("@dxos/echo/Type").obj<Schema.Struct<{
105
- name: Schema.optional<typeof Schema.String>;
106
- steps: Schema.Array$<Schema.Struct<{
107
- id: import("@dxos/keys").ObjectIdClass;
108
- instructions: typeof Schema.String;
109
- tools: Schema.optional<Schema.Array$<Schema.brand<typeof Schema.String, "ToolId">>>;
110
- }>>;
111
- }>>;
112
- }>;
113
- }>;
114
- export declare class CreateSequence extends CreateSequence_base {
115
- }
116
- declare const SetCurrentChat_base: Schema.TaggedClass<SetCurrentChat, `${string}/action/set-current-chat`, {
117
- readonly _tag: Schema.tag<`${string}/action/set-current-chat`>;
118
- } & {
119
- input: Schema.Struct<{
120
- companionTo: Schema.Schema<any, any, never>;
121
- chat: Schema.optional<import("@dxos/echo/Type").obj<Schema.Struct<{
122
- name: Schema.optional<typeof Schema.String>;
123
- queue: import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
124
- traceQueue: Schema.optional<import("@dxos/echo/Type").ref<Schema.Schema<import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, import("@dxos/echo-db").Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>>;
125
- }>>>;
126
- }>;
127
- output: typeof Schema.Void;
128
- }>;
129
- export declare class SetCurrentChat extends SetCurrentChat_base {
130
- }
131
- export {};
132
- //# sourceMappingURL=AssistantAction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AssistantAction.d.ts","sourceRoot":"","sources":["../../../../src/types/AssistantAction.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAa,MAAM,EAAE,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;AAUrD,qBAAa,aAAc,SAAQ,kBAMjC;CAAG;;;;;;;;;;;;;;;;AAEL,qBAAa,UAAW,SAAQ,eAQ9B;CAAG;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAKlC;CAAG;AAEL,eAAO,MAAM,aAAa;;;;EAIxB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,qBAAa,eAAgB,SAAQ,oBAKnC;CAAG;;;;;;;;;;;AAEL,qBAAa,YAAa,SAAQ,iBAOhC;CAAG;;;;;;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAOlC;CAAG;;;;;;;;;;;;;;AAEL,qBAAa,cAAe,SAAQ,mBAMlC;CAAG"}
@@ -1,17 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { defineCapability } from '@dxos/app-framework';
6
- import { type DeepReadonly } from '@dxos/util';
7
-
8
- import { meta } from '../meta';
9
-
10
- export namespace AssistantCapabilities {
11
- export type AssistantState = {
12
- /** Map of primary object dxn to current chat dxn. */
13
- currentChat: Record<string, string | undefined>;
14
- };
15
- export const State = defineCapability<DeepReadonly<AssistantState>>(`${meta.id}/capability/state`);
16
- export const MutableState = defineCapability<AssistantState>(`${meta.id}/capability/state`);
17
- }
@@ -1,147 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capabilities, type PluginContext, contributes, createIntent, createResolver } from '@dxos/app-framework';
8
- import { AiContextBinder, AiConversation } from '@dxos/assistant';
9
- import { Agent } from '@dxos/assistant-toolkit';
10
- import { Blueprint, Prompt, Template } from '@dxos/blueprints';
11
- import { type Queue } from '@dxos/client/echo';
12
- import { Sequence } from '@dxos/conductor';
13
- import { Filter, Key, Obj, Ref, Type } from '@dxos/echo';
14
- import { TracingService, serializeFunction } from '@dxos/functions';
15
- import { AutomationCapabilities } from '@dxos/plugin-automation';
16
- import { CollectionAction } from '@dxos/plugin-space/types';
17
- import { getSpace } from '@dxos/react-client/echo';
18
- import { type Message } from '@dxos/types';
19
-
20
- import { type AiChatServices, updateName } from '../processor';
21
- import { Assistant, AssistantAction } from '../types';
22
-
23
- import { ASSISTANT_BLUEPRINT_KEY, createBlueprint } from './blueprint-definition';
24
- import { AssistantCapabilities } from './capabilities';
25
-
26
- export default (context: PluginContext) => [
27
- contributes(Capabilities.IntentResolver, [
28
- createResolver({
29
- intent: AssistantAction.onCreateSpace,
30
- resolve: ({ space, rootCollection }) =>
31
- Effect.gen(function* () {
32
- const { dispatch } = context.getCapability(Capabilities.IntentDispatcher);
33
- const { object: chatCollection } = yield* dispatch(
34
- createIntent(CollectionAction.CreateQueryCollection, {
35
- typename: Assistant.Chat.typename,
36
- }),
37
- );
38
- const { object: blueprintCollection } = yield* dispatch(
39
- createIntent(CollectionAction.CreateQueryCollection, {
40
- typename: Blueprint.Blueprint.typename,
41
- }),
42
- );
43
- const { object: promptCollection } = yield* dispatch(
44
- createIntent(CollectionAction.CreateQueryCollection, {
45
- typename: Type.getTypename(Prompt.Prompt),
46
- }),
47
- );
48
- rootCollection.objects.push(
49
- Ref.make(chatCollection),
50
- Ref.make(blueprintCollection),
51
- Ref.make(promptCollection),
52
- );
53
-
54
- // TODO(wittjosiah): Remove once function registry is avaiable.
55
- space.db.add(serializeFunction(Agent.prompt));
56
-
57
- // Create default chat.
58
- const { object: chat } = yield* dispatch(createIntent(AssistantAction.CreateChat, { space }));
59
- space.db.add(chat);
60
- }),
61
- }),
62
- createResolver({
63
- intent: AssistantAction.CreateChat,
64
- resolve: async ({ space, name }) => {
65
- const queue = space.queues.create();
66
- const chat = Assistant.makeChat({ name, queue });
67
-
68
- // TODO(wittjosiah): This should be a space-level setting.
69
- // TODO(burdon): Clone when activated. Copy-on-write for template.
70
- const { objects: blueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
71
- let defaultBlueprint = blueprints.find((blueprint) => blueprint.key === ASSISTANT_BLUEPRINT_KEY);
72
- if (!defaultBlueprint) {
73
- defaultBlueprint = space.db.add(createBlueprint());
74
- }
75
-
76
- const binder = new AiContextBinder(queue);
77
- await binder.use((binder) => binder.bind({ blueprints: [Ref.make(defaultBlueprint)] }));
78
-
79
- return {
80
- data: { object: chat },
81
- };
82
- },
83
- }),
84
- createResolver({
85
- intent: AssistantAction.UpdateChatName,
86
- resolve: async ({ chat }) => {
87
- const space = getSpace(chat);
88
- const queue = chat.queue.target as Queue<Message.Message>;
89
- if (!space || !queue) {
90
- return;
91
- }
92
-
93
- const runtimeResolver = context.getCapability(AutomationCapabilities.ComputeRuntime);
94
- const runtime = await runtimeResolver
95
- .getRuntime(space.id)
96
- .runPromise(Effect.runtime<AiChatServices>().pipe(Effect.provide(TracingService.layerNoop)));
97
-
98
- await new AiConversation(queue).use(async (conversation) => updateName(runtime, conversation, chat));
99
- },
100
- }),
101
- createResolver({
102
- intent: AssistantAction.CreateBlueprint,
103
- resolve: ({ key, name, description }) => ({
104
- data: {
105
- object: Blueprint.make({
106
- key,
107
- name,
108
- description,
109
- instructions: Template.make(),
110
- }),
111
- },
112
- }),
113
- }),
114
- createResolver({
115
- intent: AssistantAction.CreatePrompt,
116
- resolve: ({ name }) => ({
117
- data: {
118
- object: Prompt.make({ name }),
119
- },
120
- }),
121
- }),
122
- createResolver({
123
- intent: AssistantAction.CreateSequence,
124
- resolve: ({ name }) => ({
125
- data: {
126
- object: Obj.make(Sequence, {
127
- name,
128
- steps: [
129
- {
130
- id: Key.ObjectId.random(),
131
- instructions: 'You are a helpful assistant.',
132
- },
133
- ],
134
- }),
135
- },
136
- }),
137
- }),
138
- createResolver({
139
- intent: AssistantAction.SetCurrentChat,
140
- resolve: ({ companionTo, chat }) =>
141
- Effect.gen(function* () {
142
- const state = context.getCapability(AssistantCapabilities.MutableState);
143
- state.currentChat[Obj.getDXN(companionTo).toString()] = chat && Obj.getDXN(chat).toString();
144
- }),
145
- }),
146
- ]),
147
- ];
@@ -1,29 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { type SurfaceComponentProps } from '@dxos/app-framework/react';
8
- import { type Blueprint } from '@dxos/blueprints';
9
- import { Obj } from '@dxos/echo';
10
- import { Toolbar } from '@dxos/react-ui';
11
- import { useAttention } from '@dxos/react-ui-attention';
12
- import { StackItem } from '@dxos/react-ui-stack';
13
-
14
- import { TemplateEditor } from './TemplateEditor';
15
-
16
- export type BlueprintArticleProps = SurfaceComponentProps<Blueprint.Blueprint>;
17
-
18
- export const BlueprintArticle = ({ subject }: BlueprintArticleProps) => {
19
- const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
20
-
21
- return (
22
- <StackItem.Content toolbar>
23
- <Toolbar.Root disabled={!hasAttention} />
24
- <TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
25
- </StackItem.Content>
26
- );
27
- };
28
-
29
- export default BlueprintArticle;
@@ -1,155 +0,0 @@
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, { useCallback, useEffect, useMemo, useState } from 'react';
9
-
10
- import { Capabilities, createIntent } from '@dxos/app-framework';
11
- import { useCapabilities, useIntentDispatcher } from '@dxos/app-framework/react';
12
- import { Blueprint } from '@dxos/blueprints';
13
- import { getSpace } from '@dxos/client/echo';
14
- import { Filter, Obj, Ref } from '@dxos/echo';
15
- import { SpaceAction } from '@dxos/plugin-space/types';
16
- import { useQuery } from '@dxos/react-client/echo';
17
- import { useAsyncEffect } from '@dxos/react-ui';
18
-
19
- import { ChatContainer, type ChatEvent } from '../components';
20
- import { useBlueprintRegistry, useContextBinder } from '../hooks';
21
- import { Assistant, AssistantAction } from '../types';
22
-
23
- export type ChatCompanionProps = {
24
- role?: string;
25
- data: { subject: Assistant.Chat | 'assistant-chat'; companionTo: Obj.Any };
26
- };
27
-
28
- export const ChatCompanion = ({ role, data }: ChatCompanionProps) => {
29
- const { dispatchPromise: dispatch } = useIntentDispatcher();
30
- const blueprintRegistry = useBlueprintRegistry();
31
- const companionTo = data.companionTo;
32
-
33
- const space = getSpace(companionTo);
34
- const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
35
- useEffect(() => {
36
- setChat(data.subject === 'assistant-chat' ? undefined : data.subject);
37
- }, [data.subject]);
38
-
39
- const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
40
- const binder = useContextBinder(chatQueue);
41
-
42
- // Initialize companion chat if it doesn't exist, but don't add it to the space immediately.
43
- useAsyncEffect(async () => {
44
- if (!space || chat) {
45
- return;
46
- }
47
-
48
- const { data } = await dispatch(createIntent(AssistantAction.CreateChat, { space }));
49
- setChat(data?.object);
50
- }, [chat, space]);
51
-
52
- // Add chat to space when user submits the first message.
53
- const handleEvent = useCallback(
54
- async (event: ChatEvent) => {
55
- const chatInSpace = !!getSpace(chat);
56
- if (chatInSpace || !chat || !space) {
57
- return;
58
- }
59
-
60
- if (event.type === 'submit') {
61
- await dispatch(
62
- createIntent(SpaceAction.AddObject, {
63
- object: chat,
64
- target: space,
65
- hidden: true,
66
- }),
67
- );
68
- await dispatch(
69
- createIntent(SpaceAction.AddRelation, {
70
- space,
71
- schema: Assistant.CompanionTo,
72
- source: chat,
73
- target: companionTo,
74
- }),
75
- );
76
- await dispatch(
77
- createIntent(AssistantAction.SetCurrentChat, {
78
- companionTo,
79
- chat,
80
- }),
81
- );
82
- }
83
- },
84
- [chat, space, companionTo, dispatch],
85
- );
86
-
87
- const metadata = useCapabilities(Capabilities.Metadata);
88
- const blueprintKeys = useMemo(
89
- () =>
90
- Function.pipe(
91
- metadata,
92
- Array.findFirst(
93
- (
94
- capability,
95
- ): capability is {
96
- id: string;
97
- metadata: { blueprints?: string[] };
98
- } => capability.id === Obj.getTypename(companionTo),
99
- ),
100
- Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
101
- Option.getOrElse(() => [] as string[]),
102
- ),
103
- [metadata, companionTo],
104
- );
105
- const existingBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
106
- const pluginBlueprints = useMemo(
107
- () => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
108
- [existingBlueprints, blueprintKeys],
109
- );
110
-
111
- // Initialize related blueprints that are not already in the space.
112
- useAsyncEffect(async () => {
113
- if (!space) {
114
- return;
115
- }
116
-
117
- // NOTE: This must be run instead of using the useQuery result to avoid duplicates.
118
- const { objects: existingBlueprints } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
119
- for (const key of blueprintKeys) {
120
- const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
121
- if (existingBlueprint) {
122
- continue;
123
- }
124
-
125
- const blueprint = blueprintRegistry.getByKey(key);
126
- if (!blueprint) {
127
- continue;
128
- }
129
-
130
- space.db.add(Obj.clone(blueprint));
131
- }
132
- }, [space, blueprintRegistry, blueprintKeys]);
133
-
134
- useAsyncEffect(async () => {
135
- if (!binder?.isOpen) {
136
- return;
137
- }
138
-
139
- if (pluginBlueprints.length > 0) {
140
- await binder.bind({
141
- blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
142
- });
143
- }
144
-
145
- if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
146
- await binder.bind({ blueprints: [Ref.make(companionTo)] });
147
- } else {
148
- await binder.bind({ objects: [Ref.make(companionTo)] });
149
- }
150
- }, [binder, companionTo, blueprintKeys]);
151
-
152
- return <ChatContainer role={role} space={space} chat={chat} companionTo={companionTo} onEvent={handleEvent} />;
153
- };
154
-
155
- export default ChatCompanion;
@@ -1,61 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { Capabilities } from '@dxos/app-framework';
8
- import { useCapability } from '@dxos/app-framework/react';
9
- import { type Space, getSpace } from '@dxos/client/echo';
10
- import { type Obj } from '@dxos/echo';
11
- import { StackItem } from '@dxos/react-ui-stack';
12
-
13
- import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
14
- import { meta } from '../meta';
15
- import { type Assistant } from '../types';
16
-
17
- import { Chat, type ChatRootProps } from './Chat';
18
-
19
- export type ChatContainerProps = {
20
- role?: string;
21
- space?: Space;
22
- chat?: Assistant.Chat;
23
- companionTo?: Obj.Any;
24
- } & Pick<ChatRootProps, 'onEvent'>;
25
-
26
- export const ChatContainer = ({ space: spaceProp, chat, companionTo, onEvent }: ChatContainerProps) => {
27
- const space = spaceProp ?? getSpace(chat);
28
- const settings = useCapability(Capabilities.SettingsStore).getStore<Assistant.Settings>(meta.id)?.value;
29
- const services = useChatServices({ space, chat });
30
- const [online, setOnline] = useOnline();
31
- const { preset, ...chatProps } = usePresets(online);
32
- const blueprintRegistry = useBlueprintRegistry();
33
- const processor = useChatProcessor({
34
- space,
35
- chat,
36
- preset,
37
- services,
38
- blueprintRegistry,
39
- settings,
40
- });
41
-
42
- if (!processor) {
43
- return null;
44
- }
45
-
46
- return (
47
- <StackItem.Content toolbar>
48
- <Chat.Root space={space} chat={chat} processor={processor} onEvent={onEvent}>
49
- <Chat.Toolbar companionTo={companionTo} />
50
- <Chat.Viewport classNames='container-max-width'>
51
- <Chat.Thread />
52
- <div role='none' className='p-4'>
53
- <Chat.Prompt {...chatProps} outline preset={preset?.id} online={online} onOnlineChange={setOnline} />
54
- </div>
55
- </Chat.Viewport>
56
- </Chat.Root>
57
- </StackItem.Content>
58
- );
59
- };
60
-
61
- export default ChatContainer;