@dxos/plugin-assistant 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203

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 (574) hide show
  1. package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs +30 -0
  2. package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
  3. package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs +200 -0
  4. package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +7 -0
  5. package/dist/lib/browser/ChatContainer-QB37VONJ.mjs +73 -0
  6. package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +7 -0
  7. package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs +85 -0
  8. package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +7 -0
  9. package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +266 -0
  10. package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +7 -0
  11. package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +52 -0
  12. package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +7 -0
  13. package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
  14. package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
  15. package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs +234 -0
  16. package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
  17. package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +14 -0
  18. package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs.map +7 -0
  19. package/dist/lib/browser/blueprints/index.mjs +12 -0
  20. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
  22. package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
  24. package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-DKQMSMBN.mjs +326 -0
  26. package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
  28. package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-IJYAKPEU.mjs +286 -0
  30. package/dist/lib/browser/chunk-IJYAKPEU.mjs.map +7 -0
  31. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  32. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  33. package/dist/lib/browser/chunk-JA7PUZC7.mjs +1974 -0
  34. package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
  35. package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
  36. package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
  37. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
  38. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
  39. package/dist/lib/browser/index.mjs +310 -156
  40. package/dist/lib/browser/index.mjs.map +4 -4
  41. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
  42. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
  43. package/dist/lib/browser/meta.json +1 -1
  44. package/dist/lib/browser/operation-resolver-2673CFJS.mjs +133 -0
  45. package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
  46. package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
  47. package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
  48. package/dist/lib/browser/repair-IRXDYF4R.mjs +51 -0
  49. package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
  50. package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
  51. package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
  52. package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
  53. package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
  54. package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
  55. package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
  56. package/dist/lib/browser/types/index.mjs +11 -4
  57. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
  58. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
  59. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
  60. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
  61. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
  62. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
  63. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
  64. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
  65. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
  66. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
  67. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
  68. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
  69. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
  70. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
  71. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
  72. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
  73. package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs +15 -0
  74. package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
  75. package/dist/lib/node-esm/blueprints/index.mjs +13 -0
  76. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
  78. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
  79. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
  80. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
  81. package/dist/lib/node-esm/chunk-75PHXBN3.mjs +327 -0
  82. package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
  83. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
  84. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +7 -0
  85. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  86. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  87. package/dist/lib/node-esm/chunk-LB72WG6R.mjs +231 -0
  88. package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
  89. package/dist/lib/node-esm/chunk-MJD5XWQV.mjs +288 -0
  90. package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
  91. package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
  92. package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
  93. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
  94. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
  95. package/dist/lib/node-esm/index.mjs +310 -156
  96. package/dist/lib/node-esm/index.mjs.map +4 -4
  97. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
  98. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
  99. package/dist/lib/node-esm/meta.json +1 -1
  100. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs +134 -0
  101. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
  102. package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs +126 -0
  103. package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
  104. package/dist/lib/node-esm/repair-DMI55PON.mjs +52 -0
  105. package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
  106. package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
  107. package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
  108. package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
  109. package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
  110. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
  111. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
  112. package/dist/lib/node-esm/types/index.mjs +11 -4
  113. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  114. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  115. package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
  116. package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
  117. package/dist/types/src/blueprints/index.d.ts +7 -0
  118. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
  120. package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
  122. package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  124. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  126. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
  128. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
  130. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
  132. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
  134. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/index.d.ts +11 -4
  136. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  137. package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
  138. package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
  140. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  142. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  144. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  146. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  148. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  150. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  152. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  153. package/dist/types/src/capabilities/settings/index.d.ts +15 -0
  154. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  155. package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
  156. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  157. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  158. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  159. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  160. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  161. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  162. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  163. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
  164. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  165. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
  166. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  167. package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
  168. package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
  169. package/dist/types/src/components/Chat/Chat.d.ts +37 -21
  170. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  171. package/dist/types/src/components/Chat/events.d.ts +10 -1
  172. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  173. package/dist/types/src/components/ChatCompanion.d.ts +13 -0
  174. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
  175. package/dist/types/src/components/ChatContainer.d.ts +16 -8
  176. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  177. package/dist/types/src/components/ChatDialog.d.ts +2 -2
  178. package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
  179. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
  180. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
  181. package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
  182. package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
  183. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  184. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
  185. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
  186. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  187. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
  188. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  189. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
  190. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  191. package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
  192. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  193. package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
  194. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  195. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +285 -71
  196. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  197. package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
  198. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
  199. package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
  200. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  201. package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
  202. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  203. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  204. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  205. package/dist/types/src/components/InitiativeContainer.d.ts +9 -0
  206. package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
  207. package/dist/types/src/components/PromptArticle.d.ts +7 -0
  208. package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
  209. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +3 -6
  210. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  211. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +431 -7
  212. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  213. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +13 -2
  214. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  215. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +428 -2
  216. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  217. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
  218. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  219. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  220. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  221. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  222. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  223. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
  224. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  225. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  226. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  227. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  228. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  229. package/dist/types/src/components/Toolbox/Toolbox.d.ts +9 -15
  230. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  231. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +432 -5
  232. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  233. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
  234. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  235. package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
  236. package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
  237. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
  238. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
  239. package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
  240. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
  241. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
  242. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
  243. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
  244. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
  245. package/dist/types/src/components/Typewriter/index.d.ts +2 -0
  246. package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
  247. package/dist/types/src/components/index.d.ts +10 -7
  248. package/dist/types/src/components/index.d.ts.map +1 -1
  249. package/dist/types/src/functions/index.d.ts +4 -0
  250. package/dist/types/src/functions/index.d.ts.map +1 -0
  251. package/dist/types/src/functions/object-list.d.ts +10 -0
  252. package/dist/types/src/functions/object-list.d.ts.map +1 -0
  253. package/dist/types/src/functions/object-load.d.ts +8 -0
  254. package/dist/types/src/functions/object-load.d.ts.map +1 -0
  255. package/dist/types/src/functions/object-search.d.ts +10 -0
  256. package/dist/types/src/functions/object-search.d.ts.map +1 -0
  257. package/dist/types/src/hooks/index.d.ts +8 -3
  258. package/dist/types/src/hooks/index.d.ts.map +1 -1
  259. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
  260. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
  261. package/dist/types/src/hooks/useChatProcessor.d.ts +10 -20
  262. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  263. package/dist/types/src/hooks/useChatServices.d.ts +7 -8
  264. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  265. package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
  266. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
  267. package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
  268. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
  269. package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
  270. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
  271. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  272. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  273. package/dist/types/src/hooks/useFlush.d.ts +6 -0
  274. package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
  275. package/dist/types/src/hooks/useOnline.d.ts +3 -0
  276. package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
  277. package/dist/types/src/hooks/usePresets.d.ts +7 -0
  278. package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
  279. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  280. package/dist/types/src/index.d.ts +2 -1
  281. package/dist/types/src/index.d.ts.map +1 -1
  282. package/dist/types/src/meta.d.ts +3 -4
  283. package/dist/types/src/meta.d.ts.map +1 -1
  284. package/dist/types/src/processor/index.d.ts +4 -0
  285. package/dist/types/src/processor/index.d.ts.map +1 -0
  286. package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
  287. package/dist/types/src/processor/presets.d.ts.map +1 -0
  288. package/dist/types/src/processor/processor.d.ts +79 -0
  289. package/dist/types/src/processor/processor.d.ts.map +1 -0
  290. package/dist/types/src/processor/processor.test.d.ts +2 -0
  291. package/dist/types/src/processor/processor.test.d.ts.map +1 -0
  292. package/dist/types/src/processor/update-name.d.ts +10 -0
  293. package/dist/types/src/processor/update-name.d.ts.map +1 -0
  294. package/dist/types/src/queue-logger.d.ts.map +1 -1
  295. package/dist/types/src/testing/index.d.ts +1 -1
  296. package/dist/types/src/testing/index.d.ts.map +1 -1
  297. package/dist/types/src/testing/test-generator.d.ts +8 -0
  298. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  299. package/dist/types/src/testing/test-sequence.d.ts +0 -4
  300. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  301. package/dist/types/src/testing/test-services.d.ts +2 -2
  302. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  303. package/dist/types/src/translations.d.ts +376 -37
  304. package/dist/types/src/translations.d.ts.map +1 -1
  305. package/dist/types/src/types/Assistant.d.ts +20 -0
  306. package/dist/types/src/types/Assistant.d.ts.map +1 -0
  307. package/dist/types/src/types/AssistantAction.d.ts +97 -0
  308. package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
  309. package/dist/types/src/types/capabilities.d.ts +33 -0
  310. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  311. package/dist/types/src/types/defs.d.ts +2 -0
  312. package/dist/types/src/types/defs.d.ts.map +1 -0
  313. package/dist/types/src/types/events.d.ts +5 -0
  314. package/dist/types/src/types/events.d.ts.map +1 -0
  315. package/dist/types/src/types/index.d.ts +6 -1
  316. package/dist/types/src/types/index.d.ts.map +1 -1
  317. package/dist/types/src/types/service.d.ts +14 -213
  318. package/dist/types/src/types/service.d.ts.map +1 -1
  319. package/dist/types/tsconfig.tsbuildinfo +1 -1
  320. package/package.json +125 -96
  321. package/src/AssistantPlugin.tsx +159 -88
  322. package/src/blueprints/assistant-blueprint.ts +57 -0
  323. package/src/blueprints/index.ts +12 -0
  324. package/src/capabilities/ai-service/ai-service.ts +30 -0
  325. package/src/capabilities/ai-service/index.ts +7 -0
  326. package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
  327. package/src/capabilities/app-graph-builder/index.ts +7 -0
  328. package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
  329. package/src/capabilities/blueprint-definition/index.ts +8 -0
  330. package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
  331. package/src/capabilities/edge-model-resolver/index.ts +7 -0
  332. package/src/capabilities/index.ts +11 -6
  333. package/src/capabilities/local-model-resolver/index.ts +7 -0
  334. package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
  335. package/src/capabilities/operation-resolver/index.ts +7 -0
  336. package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
  337. package/src/capabilities/react-surface/index.ts +7 -0
  338. package/src/capabilities/react-surface/react-surface.tsx +111 -0
  339. package/src/capabilities/repair/index.ts +7 -0
  340. package/src/capabilities/repair/repair.ts +62 -0
  341. package/src/capabilities/settings/index.ts +7 -0
  342. package/src/capabilities/settings/settings.ts +31 -0
  343. package/src/capabilities/state/index.ts +7 -0
  344. package/src/capabilities/state/state.ts +27 -0
  345. package/src/capabilities/toolkit/index.ts +7 -0
  346. package/src/capabilities/toolkit/toolkit.ts +27 -0
  347. package/src/components/AssistantSettings/AssistantSettings.tsx +92 -77
  348. package/src/components/BlueprintArticle.tsx +28 -0
  349. package/src/components/Chat/Chat.tsx +267 -197
  350. package/src/components/Chat/events.ts +14 -1
  351. package/src/components/ChatCompanion.tsx +226 -0
  352. package/src/components/ChatContainer.tsx +56 -33
  353. package/src/components/ChatDialog.tsx +30 -19
  354. package/src/components/ChatProgress/ChatProgress.tsx +53 -0
  355. package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
  356. package/src/components/ChatPrompt/ChatActions.tsx +19 -27
  357. package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
  358. package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
  359. package/src/components/ChatPrompt/ChatReferences.tsx +32 -38
  360. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
  361. package/src/components/ChatPrompt/index.ts +1 -1
  362. package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
  363. package/src/components/ChatThread/ChatThread.tsx +75 -36
  364. package/src/components/ChatThread/Link.tsx +26 -0
  365. package/src/components/ChatThread/registry.tsx +174 -0
  366. package/src/components/ChatThread/sync.test.ts +97 -0
  367. package/src/components/ChatThread/sync.ts +154 -0
  368. package/src/components/ChatThread/testing/thread.md +37 -0
  369. package/src/components/InitiativeContainer.tsx +340 -0
  370. package/src/components/PromptArticle.tsx +49 -0
  371. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +40 -19
  372. package/src/components/TemplateEditor/TemplateEditor.tsx +33 -52
  373. package/src/components/TemplateEditor/TemplateForm.stories.tsx +30 -17
  374. package/src/components/TemplateEditor/TemplateForm.tsx +82 -32
  375. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
  376. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  377. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  378. package/src/components/ToolBlock/ToolBlock.tsx +143 -0
  379. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  380. package/src/components/ToolBlock/index.ts +6 -0
  381. package/src/components/Toolbox/Toolbox.stories.tsx +18 -28
  382. package/src/components/Toolbox/Toolbox.tsx +70 -102
  383. package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
  384. package/src/components/TriggerStatus/index.ts +5 -0
  385. package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
  386. package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
  387. package/src/components/Typewriter/Typewriter.tsx +54 -0
  388. package/src/components/Typewriter/assistant-extension.tsx +144 -0
  389. package/src/components/Typewriter/index.ts +5 -0
  390. package/src/components/index.ts +14 -9
  391. package/src/functions/index.ts +7 -0
  392. package/src/functions/object-list.ts +49 -0
  393. package/src/functions/object-load.ts +44 -0
  394. package/src/functions/object-search.ts +46 -0
  395. package/src/hooks/index.ts +8 -4
  396. package/src/hooks/useBlueprintRegistry.ts +105 -0
  397. package/src/hooks/useChatProcessor.ts +40 -105
  398. package/src/hooks/useChatServices.ts +31 -75
  399. package/src/hooks/useChatToolbarActions.ts +122 -0
  400. package/src/hooks/useContextBinder.ts +32 -0
  401. package/src/hooks/useContextObjects.ts +46 -0
  402. package/src/hooks/useFilteredTypes.ts +37 -0
  403. package/src/hooks/useFlush.ts +35 -0
  404. package/src/hooks/useOnline.ts +10 -0
  405. package/src/hooks/usePresets.ts +44 -0
  406. package/src/hooks/useReferencesProvider.ts +15 -12
  407. package/src/index.ts +2 -1
  408. package/src/meta.ts +11 -8
  409. package/src/processor/index.ts +7 -0
  410. package/src/{hooks → processor}/presets.ts +16 -8
  411. package/src/processor/processor.test.ts +72 -0
  412. package/src/processor/processor.ts +301 -0
  413. package/src/processor/update-name.ts +58 -0
  414. package/src/queue-logger.ts +17 -18
  415. package/src/testing/index.ts +1 -1
  416. package/src/testing/test-generator.ts +262 -0
  417. package/src/testing/test-sequence.ts +2 -27
  418. package/src/testing/test-services.ts +10 -14
  419. package/src/translations.ts +71 -28
  420. package/src/types/Assistant.ts +28 -0
  421. package/src/types/AssistantAction.ts +76 -0
  422. package/src/types/capabilities.ts +27 -0
  423. package/src/types/defs.ts +5 -0
  424. package/src/types/events.ts +11 -0
  425. package/src/types/index.ts +9 -1
  426. package/src/types/service.ts +25 -14
  427. package/src/vite-env.d.ts +30 -0
  428. package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs +0 -54
  429. package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
  430. package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs +0 -72
  431. package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
  432. package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
  433. package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
  434. package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs +0 -27
  435. package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
  436. package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs +0 -223
  437. package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
  438. package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
  439. package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
  440. package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
  441. package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
  442. package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
  443. package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
  444. package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
  445. package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
  446. package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
  447. package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
  448. package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
  449. package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
  450. package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
  451. package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
  452. package/dist/lib/browser/settings-2DGP3UTS.mjs +0 -22
  453. package/dist/lib/browser/settings-2DGP3UTS.mjs.map +0 -7
  454. package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs +0 -55
  455. package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
  456. package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs +0 -73
  457. package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
  458. package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
  459. package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
  460. package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs +0 -28
  461. package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
  462. package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs +0 -224
  463. package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
  464. package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
  465. package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
  466. package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
  467. package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
  468. package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
  469. package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
  470. package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
  471. package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
  472. package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
  473. package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
  474. package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
  475. package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
  476. package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
  477. package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
  478. package/dist/lib/node-esm/settings-47RYZOU4.mjs +0 -23
  479. package/dist/lib/node-esm/settings-47RYZOU4.mjs.map +0 -7
  480. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  481. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  482. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  483. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  484. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  485. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  486. package/dist/types/src/capabilities/settings.d.ts +0 -4
  487. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  488. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
  489. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
  490. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
  491. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  492. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
  493. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  494. package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
  495. package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
  496. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  497. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  498. package/dist/types/src/components/SequenceContainer.d.ts +0 -8
  499. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  500. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  501. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  502. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
  503. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  504. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  505. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  506. package/dist/types/src/components/TemplateContainer.d.ts +0 -8
  507. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  508. package/dist/types/src/events.d.ts +0 -4
  509. package/dist/types/src/events.d.ts.map +0 -1
  510. package/dist/types/src/hooks/chat-processor.d.ts +0 -86
  511. package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
  512. package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
  513. package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
  514. package/dist/types/src/hooks/presets.d.ts.map +0 -1
  515. package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
  516. package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
  517. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  518. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  519. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  520. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  521. package/dist/types/src/parser/index.d.ts +0 -4
  522. package/dist/types/src/parser/index.d.ts.map +0 -1
  523. package/dist/types/src/parser/query-parser.d.ts +0 -15
  524. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  525. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  526. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  527. package/dist/types/src/parser/types.d.ts +0 -24
  528. package/dist/types/src/parser/types.d.ts.map +0 -1
  529. package/dist/types/src/stories/Chat.stories.d.ts +0 -249
  530. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  531. package/dist/types/src/testing/test-functions.d.ts +0 -3
  532. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  533. package/dist/types/src/tools/function.d.ts +0 -5
  534. package/dist/types/src/tools/function.d.ts.map +0 -1
  535. package/dist/types/src/tools/index.d.ts +0 -3
  536. package/dist/types/src/tools/index.d.ts.map +0 -1
  537. package/dist/types/src/tools/openapi.d.ts +0 -10
  538. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  539. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  540. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  541. package/dist/types/src/types/schema.d.ts +0 -88
  542. package/dist/types/src/types/schema.d.ts.map +0 -1
  543. package/src/capabilities/app-graph-builder.ts +0 -253
  544. package/src/capabilities/intent-resolver.ts +0 -58
  545. package/src/capabilities/react-surface.tsx +0 -138
  546. package/src/capabilities/settings.ts +0 -19
  547. package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
  548. package/src/components/ChatThread/ChatMessage.tsx +0 -268
  549. package/src/components/ChatThread/ToolBlock.tsx +0 -121
  550. package/src/components/ChatThread/reducer.ts +0 -52
  551. package/src/components/PromptSettings.tsx +0 -89
  552. package/src/components/SequenceContainer.tsx +0 -132
  553. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
  554. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  555. package/src/components/TemplateContainer.tsx +0 -24
  556. package/src/events.ts +0 -11
  557. package/src/hooks/chat-processor.test.ts +0 -16
  558. package/src/hooks/chat-processor.ts +0 -314
  559. package/src/hooks/useBlueprints.ts +0 -57
  560. package/src/parser/filter-generator.test.ts +0 -32
  561. package/src/parser/filter-generator.ts +0 -81
  562. package/src/parser/index.ts +0 -7
  563. package/src/parser/query-parser.test.ts +0 -139
  564. package/src/parser/query-parser.ts +0 -199
  565. package/src/parser/types.ts +0 -34
  566. package/src/shims.d.ts +0 -8
  567. package/src/stories/Chat.stories.tsx +0 -378
  568. package/src/testing/test-functions.ts +0 -11
  569. package/src/tools/function.ts +0 -46
  570. package/src/tools/index.ts +0 -6
  571. package/src/tools/openapi.test.ts +0 -217
  572. package/src/tools/openapi.ts +0 -338
  573. package/src/types/schema.ts +0 -95
  574. package/src/typings.d.ts +0 -9
@@ -19,6 +19,9 @@ export type ChatEvent =
19
19
  type: 'submit';
20
20
  text: string;
21
21
  }
22
+ | {
23
+ type: 'retry';
24
+ }
22
25
  | {
23
26
  type: 'cancel';
24
27
  }
@@ -28,14 +31,24 @@ export type ChatEvent =
28
31
  }
29
32
  | {
30
33
  type: 'add';
31
- object: Obj.Any;
34
+ object: Obj.Unknown;
32
35
  }
33
36
  //
34
37
  // UX
35
38
  //
39
+ | {
40
+ type: 'update-prompt';
41
+ text: string;
42
+ }
36
43
  | {
37
44
  type: 'scroll-to-bottom';
38
45
  }
46
+ | {
47
+ type: 'nav-previous';
48
+ }
49
+ | {
50
+ type: 'nav-next';
51
+ }
39
52
  | {
40
53
  type: 'thread-open';
41
54
  }
@@ -0,0 +1,226 @@
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, useEffect, useMemo, useRef, useState } from 'react';
9
+
10
+ import { useAtomCapability, useCapabilities, useOperationInvoker } from '@dxos/app-framework/ui';
11
+ import { AppCapabilities } from '@dxos/app-toolkit';
12
+ import { Chat } from '@dxos/assistant-toolkit';
13
+ import { Blueprint } from '@dxos/blueprints';
14
+ import { getSpace } from '@dxos/client/echo';
15
+ import { DXN, Filter, Obj, Query, Ref } from '@dxos/echo';
16
+ import { SpaceOperation } from '@dxos/plugin-space/types';
17
+ import { useQuery } from '@dxos/react-client/echo';
18
+ import { useAsyncEffect } from '@dxos/react-ui';
19
+
20
+ import { ChatContainer, type ChatEvent } from '../components';
21
+ import { useBlueprintRegistry, useContextBinder } from '../hooks';
22
+ import { Assistant, AssistantCapabilities, AssistantOperation } from '../types';
23
+
24
+ export type ChatCompanionProps = {
25
+ role?: string;
26
+ data: {
27
+ subject: Chat.Chat | 'assistant-chat';
28
+ companionTo: Obj.Unknown;
29
+ };
30
+ };
31
+
32
+ export const ChatCompanion = forwardRef<HTMLDivElement, ChatCompanionProps>(
33
+ ({ role, data }: ChatCompanionProps, forwardedRef) => {
34
+ const { invokePromise } = useOperationInvoker();
35
+ const blueprintRegistry = useBlueprintRegistry();
36
+ const companionTo = data.companionTo;
37
+
38
+ const space = getSpace(companionTo);
39
+ const [chat, setChat] = useState(data.subject === 'assistant-chat' ? undefined : data.subject);
40
+
41
+ // Watch the state atom directly to detect when plus button clears the chat selection.
42
+ const state = useAtomCapability(AssistantCapabilities.State);
43
+ const companionToId = Obj.getDXN(companionTo).toString();
44
+ const currentChatState = state?.currentChat[companionToId];
45
+
46
+ // Track if initial setup has been done (to distinguish initial mount from plus button click).
47
+ // Reset when companionTo changes.
48
+ const initialSetupDoneRef = useRef(false);
49
+ const prevCompanionToIdRef = useRef(companionToId);
50
+ if (prevCompanionToIdRef.current !== companionToId) {
51
+ initialSetupDoneRef.current = false;
52
+ prevCompanionToIdRef.current = companionToId;
53
+ }
54
+
55
+ // Sync local chat state with the state atom.
56
+ // When currentChatState is undefined (plus button clicked), reset local chat.
57
+ // When data.subject is a Chat object, use it directly.
58
+ // When currentChatState is a different chat, fetch and set it.
59
+ useEffect(() => {
60
+ // If state says no chat selected AND current chat is persisted, reset local state (handles plus button click).
61
+ // Don't reset in-memory chats - they're expected to have currentChatState === undefined.
62
+ if (!currentChatState && chat && getSpace(chat)) {
63
+ setChat(undefined);
64
+ } else if (data.subject !== 'assistant-chat') {
65
+ // If data.subject is a Chat object (resolved from graph), use it.
66
+ setChat(data.subject);
67
+ } else if (currentChatState && space) {
68
+ // currentChatState is set but graph couldn't resolve it - fetch manually.
69
+ const currentChatDxnStr = chat ? Obj.getDXN(chat).toString() : undefined;
70
+ if (currentChatState !== currentChatDxnStr) {
71
+ // Parse DXN and fetch the chat object from the database.
72
+ const parsedDxn = DXN.tryParse(currentChatState);
73
+ if (parsedDxn) {
74
+ const chatRef = space.db.makeRef(parsedDxn);
75
+ const resolvedChat = chatRef?.target;
76
+ if (Obj.instanceOf(Assistant.Chat, resolvedChat)) {
77
+ setChat(resolvedChat);
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }, [currentChatState, data.subject, space, chat]);
83
+
84
+ const chatQueue = space && chat ? space.queues.get(chat.queue.dxn) : undefined;
85
+ const binder = useContextBinder(chatQueue);
86
+
87
+ // Initialize companion chat if it doesn't exist, but don't add it to the space immediately.
88
+ useAsyncEffect(async () => {
89
+ if (!space || chat) {
90
+ return;
91
+ }
92
+
93
+ // Only query for existing chats on initial mount, not when plus button is clicked.
94
+ if (!initialSetupDoneRef.current) {
95
+ // Query for existing companion chats linked to this object.
96
+ const existingChats = await space.db
97
+ .query(Query.select(Filter.id(companionTo.id)).targetOf(Chat.CompanionTo).source())
98
+ .run();
99
+
100
+ initialSetupDoneRef.current = true;
101
+
102
+ // Use existing chat if found on initial mount.
103
+ if (existingChats.length > 0) {
104
+ const existingChat = existingChats.at(-1) as Assistant.Chat;
105
+ setChat(existingChat);
106
+ await invokePromise(AssistantOperation.SetCurrentChat, { companionTo, chat: existingChat });
107
+ return;
108
+ }
109
+ }
110
+
111
+ // Create chat in-memory only - it will be added to space on first message.
112
+ const { data: createResult } = await invokePromise(AssistantOperation.CreateChat, {
113
+ db: space.db,
114
+ addToSpace: false,
115
+ });
116
+ setChat(createResult?.object);
117
+ }, [chat, space, companionTo, invokePromise]);
118
+
119
+ // Add chat to space and create relation when user submits the first message.
120
+ const handleEvent = useCallback(
121
+ async (event: ChatEvent) => {
122
+ if (!chat || !space) {
123
+ return;
124
+ }
125
+
126
+ // If chat is not in space yet, persist it on first submit.
127
+ if (event.type === 'submit' && !getSpace(chat)) {
128
+ await invokePromise(SpaceOperation.AddObject, {
129
+ object: chat,
130
+ target: space.db,
131
+ hidden: true,
132
+ });
133
+ await invokePromise(SpaceOperation.AddRelation, {
134
+ db: space.db,
135
+ schema: Chat.CompanionTo,
136
+ source: chat,
137
+ target: companionTo,
138
+ });
139
+ await invokePromise(AssistantOperation.SetCurrentChat, {
140
+ companionTo,
141
+ chat,
142
+ });
143
+ }
144
+ },
145
+ [chat, space, companionTo, invokePromise],
146
+ );
147
+
148
+ const metadata = useCapabilities(AppCapabilities.Metadata);
149
+ const blueprintKeys = useMemo(
150
+ () =>
151
+ Function.pipe(
152
+ metadata,
153
+ Array.findFirst(
154
+ (
155
+ capability,
156
+ ): capability is {
157
+ id: string;
158
+ metadata: { blueprints?: string[] };
159
+ } => capability.id === Obj.getTypename(companionTo),
160
+ ),
161
+ Option.flatMap((c) => Option.fromNullable(c.metadata.blueprints)),
162
+ Option.getOrElse(() => [] as string[]),
163
+ ),
164
+ [metadata, companionTo],
165
+ );
166
+ const existingBlueprints = useQuery(space?.db, Filter.type(Blueprint.Blueprint));
167
+ const pluginBlueprints = useMemo(
168
+ () => existingBlueprints.filter((blueprint) => blueprintKeys.includes(blueprint.key)),
169
+ [existingBlueprints, blueprintKeys],
170
+ );
171
+
172
+ // Initialize related blueprints that are not already in the space.
173
+ useAsyncEffect(async () => {
174
+ if (!space) {
175
+ return;
176
+ }
177
+
178
+ // NOTE: This must be run instead of using the useQuery result to avoid duplicates.
179
+ const existingBlueprints = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
180
+ for (const key of blueprintKeys) {
181
+ const existingBlueprint = existingBlueprints.find((blueprint) => blueprint.key === key);
182
+ if (existingBlueprint) {
183
+ continue;
184
+ }
185
+
186
+ const blueprint = blueprintRegistry.getByKey(key);
187
+ if (!blueprint) {
188
+ continue;
189
+ }
190
+
191
+ space.db.add(Obj.clone(blueprint, { deep: true }));
192
+ }
193
+ }, [space, blueprintRegistry, blueprintKeys]);
194
+
195
+ useAsyncEffect(async () => {
196
+ if (!binder?.isOpen) {
197
+ return;
198
+ }
199
+
200
+ if (pluginBlueprints.length > 0) {
201
+ await binder.bind({
202
+ blueprints: pluginBlueprints.map((blueprint) => Ref.make(blueprint)),
203
+ });
204
+ }
205
+
206
+ if (Obj.instanceOf(Blueprint.Blueprint, companionTo)) {
207
+ await binder.bind({ blueprints: [Ref.make(companionTo)] });
208
+ } else {
209
+ await binder.bind({ objects: [Ref.make(companionTo)] });
210
+ }
211
+ }, [binder, companionTo, blueprintKeys]);
212
+
213
+ return (
214
+ <ChatContainer
215
+ role={role}
216
+ space={space}
217
+ subject={chat}
218
+ companionTo={companionTo}
219
+ onEvent={handleEvent}
220
+ ref={forwardedRef}
221
+ />
222
+ );
223
+ },
224
+ );
225
+
226
+ export default ChatCompanion;
@@ -2,44 +2,67 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import React from 'react';
6
-
7
- import { Capabilities, useCapability } from '@dxos/app-framework';
8
- import { type AssociatedArtifact } from '@dxos/blueprints';
9
- import { getSpace } from '@dxos/client/echo';
10
- import { StackItem } from '@dxos/react-ui-stack';
11
-
12
- import { Chat } from './Chat';
13
- import { useChatProcessor, useChatServices } from '../hooks';
14
- import { meta } from '../meta';
15
- import { type Assistant } from '../types';
16
-
17
- export type ChatContainerProps = {
18
- role: string;
19
- chat: Assistant.Chat;
20
- artifact?: AssociatedArtifact;
21
- };
22
-
23
- export const ChatContainer = ({ role, chat, artifact }: ChatContainerProps) => {
24
- const space = getSpace(chat);
25
- const settings = useCapability(Capabilities.SettingsStore).getStore<Assistant.Settings>(meta.id)?.value;
26
- const services = useChatServices({ space });
27
- const processor = useChatProcessor({ chat, services, settings });
5
+ import React, { forwardRef } from 'react';
6
+
7
+ import { useAtomCapability } from '@dxos/app-framework/ui';
8
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
9
+ import { type Space, getSpace } from '@dxos/client/echo';
10
+ import { type Obj } from '@dxos/echo';
11
+ import { Layout } from '@dxos/react-ui';
12
+
13
+ import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
14
+ import { AssistantCapabilities, type ChatType } from '../types';
15
+
16
+ import { Chat as ChatComponent, type ChatRootProps } from './Chat';
17
+
18
+ export type ChatContainerProps = SurfaceComponentProps<
19
+ ChatType.Chat | undefined,
20
+ {
21
+ space?: Space;
22
+ companionTo?: Obj.Unknown;
23
+ } & Pick<ChatRootProps, 'onEvent'>
24
+ >;
25
+
26
+ export const ChatContainer = forwardRef<HTMLDivElement, ChatContainerProps>((props, forwardedRef) => {
27
+ const { role, subject: chat, space: spaceProp, companionTo, onEvent } = props;
28
+ const space = spaceProp ?? getSpace(chat);
29
+ const settings = useAtomCapability(AssistantCapabilities.Settings);
30
+ const services = useChatServices({ id: space?.id, chat });
31
+ const [online, setOnline] = useOnline();
32
+ const { preset, ...chatProps } = usePresets(online);
33
+ const blueprintRegistry = useBlueprintRegistry();
34
+ const processor = useChatProcessor({
35
+ space,
36
+ chat,
37
+ preset,
38
+ services,
39
+ blueprintRegistry,
40
+ settings,
41
+ });
42
+
28
43
  if (!processor) {
29
44
  return null;
30
45
  }
31
46
 
32
- // TODO(burdon): Add attention attributes.
33
47
  return (
34
- <StackItem.Content classNames='container-max-width'>
35
- <Chat.Root chat={chat} processor={processor} artifact={artifact}>
36
- <Chat.Thread />
37
- <div className='pbe-4 pis-2 pie-2'>
38
- <Chat.Prompt classNames='border border-subduedSeparator rounded-md' />
39
- </div>
40
- </Chat.Root>
41
- </StackItem.Content>
48
+ <Layout.Main toolbar role={role} ref={forwardedRef}>
49
+ <ChatComponent.Root db={space?.db} chat={chat} processor={processor} onEvent={onEvent}>
50
+ <ChatComponent.Toolbar companionTo={companionTo} />
51
+ <ChatComponent.Viewport classNames='container-max-width'>
52
+ <ChatComponent.Thread />
53
+ <div role='none' className='p-4'>
54
+ <ChatComponent.Prompt
55
+ {...chatProps}
56
+ outline
57
+ preset={preset?.id}
58
+ online={online}
59
+ onOnlineChange={setOnline}
60
+ />
61
+ </div>
62
+ </ChatComponent.Viewport>
63
+ </ChatComponent.Root>
64
+ </Layout.Main>
42
65
  );
43
- };
66
+ });
44
67
 
45
68
  export default ChatContainer;
@@ -4,27 +4,38 @@
4
4
 
5
5
  import React, { useCallback, useState } from 'react';
6
6
 
7
- import { useCapability, Capabilities } from '@dxos/app-framework';
8
- import { getSpace } from '@dxos/client/echo';
7
+ import { useAtomCapability } from '@dxos/app-framework/ui';
8
+ import { type Chat as ChatTypes } from '@dxos/assistant-toolkit';
9
+ import { Obj } from '@dxos/echo';
9
10
  import { useTranslation } from '@dxos/react-ui';
10
- import { ChatDialog as NativeChatDialog } from '@dxos/react-ui-chat';
11
+ import { ChatDialog as NaturalChatDialog } from '@dxos/react-ui-chat';
11
12
 
12
- import { Chat, type ChatRootProps } from './Chat';
13
- import { useChatProcessor, useChatServices } from '../hooks';
13
+ import { useBlueprintRegistry, useChatProcessor, useChatServices, useOnline, usePresets } from '../hooks';
14
14
  import { meta } from '../meta';
15
- import { type Assistant } from '../types';
15
+ import { AssistantCapabilities } from '../types';
16
+
17
+ import { Chat, type ChatRootProps } from './Chat';
16
18
 
17
19
  export type ChatDialogProps = {
18
- chat?: Assistant.Chat;
20
+ chat?: ChatTypes.Chat;
19
21
  };
20
22
 
21
23
  export const ChatDialog = ({ chat }: ChatDialogProps) => {
22
24
  const { t } = useTranslation(meta.id);
23
25
 
24
- const space = getSpace(chat);
25
- const settings = useCapability(Capabilities.SettingsStore).getStore<Assistant.Settings>(meta.id)?.value;
26
- const services = useChatServices({ space });
27
- const processor = useChatProcessor({ chat, services, settings });
26
+ const db = chat && Obj.getDatabase(chat);
27
+ const settings = useAtomCapability(AssistantCapabilities.Settings);
28
+ const services = useChatServices({ id: db?.spaceId, chat });
29
+ const [online, setOnline] = useOnline();
30
+ const { preset, ...chatProps } = usePresets(online);
31
+ const blueprintRegistry = useBlueprintRegistry();
32
+ const processor = useChatProcessor({
33
+ chat,
34
+ preset,
35
+ services,
36
+ blueprintRegistry,
37
+ settings,
38
+ });
28
39
 
29
40
  // TODO(burdon): Refocus when open.
30
41
  const [open, setOpen] = useState(true);
@@ -48,15 +59,15 @@ export const ChatDialog = ({ chat }: ChatDialogProps) => {
48
59
 
49
60
  return (
50
61
  <Chat.Root chat={chat} processor={processor} onEvent={handleEvent}>
51
- <NativeChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
52
- <NativeChatDialog.Header title={t('assistant dialog title')} />
53
- <NativeChatDialog.Content>
62
+ <NaturalChatDialog.Root open={open} expanded={expanded} onOpenChange={setOpen}>
63
+ <NaturalChatDialog.Header title={t('assistant dialog title')} />
64
+ <NaturalChatDialog.Content>
54
65
  <Chat.Thread />
55
- </NativeChatDialog.Content>
56
- <NativeChatDialog.Footer>
57
- <Chat.Prompt expandable />
58
- </NativeChatDialog.Footer>
59
- </NativeChatDialog.Root>
66
+ </NaturalChatDialog.Content>
67
+ <NaturalChatDialog.Footer classNames='p-1.5'>
68
+ <Chat.Prompt {...chatProps} preset={preset?.id} online={online} onOnlineChange={setOnline} expandable />
69
+ </NaturalChatDialog.Footer>
70
+ </NaturalChatDialog.Root>
60
71
  </Chat.Root>
61
72
  );
62
73
  };
@@ -0,0 +1,53 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
6
+
7
+ import { type Chat } from '@dxos/assistant-toolkit';
8
+ import { addEventListener } from '@dxos/async';
9
+ import { ProgressBar, type ProgressBarProps, TextCrawl, useExecutionGraph } from '@dxos/react-ui-components';
10
+
11
+ export type ChatProgressProps = {
12
+ chat: Chat.Chat;
13
+ };
14
+
15
+ export const ChatProgress = ({ chat }: ChatProgressProps) => {
16
+ const { commits } = useExecutionGraph(chat.traceQueue?.target, true);
17
+ const nodes = useMemo(() => commits.map((commit) => ({ id: commit.id, message: commit.message })), [commits]);
18
+ const lines = useMemo(() => commits.map((commit) => commit.message), [commits]);
19
+
20
+ const [index, setIndex] = useState<number | undefined>(undefined);
21
+ const handleSelect = useCallback<NonNullable<ProgressBarProps['onSelect']>>(({ index }) => {
22
+ setIndex((current) => {
23
+ return current === index ? undefined : index;
24
+ });
25
+ }, []);
26
+
27
+ const ref = useRef<HTMLDivElement>(null);
28
+ useEffect(() => {
29
+ if (!ref.current) {
30
+ return;
31
+ }
32
+
33
+ return addEventListener(ref.current, 'keydown', (event) => {
34
+ switch (event.key) {
35
+ case 'ArrowLeft': {
36
+ setIndex((current) => (current === undefined || current <= 0 ? 0 : current - 1));
37
+ break;
38
+ }
39
+ case 'ArrowRight': {
40
+ setIndex((current) => (current === undefined || current >= nodes.length ? nodes.length - 1 : current + 1));
41
+ break;
42
+ }
43
+ }
44
+ });
45
+ }, [nodes.length]);
46
+
47
+ return (
48
+ <div role='none' tabIndex={0} ref={ref} className='flex flex-col outline-none'>
49
+ <ProgressBar nodes={nodes} index={index} onSelect={handleSelect} />
50
+ <TextCrawl classNames='pis-4 text-sm text-description' lines={lines} autoAdvance />
51
+ </div>
52
+ );
53
+ };
@@ -2,4 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './SequenceEditor';
5
+ export * from './ChatProgress';
@@ -5,7 +5,7 @@
5
5
  import React, { type PropsWithChildren } from 'react';
6
6
 
7
7
  import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
8
- import { mx } from '@dxos/react-ui-theme';
8
+ import { mx } from '@dxos/ui-theme';
9
9
 
10
10
  import { meta } from '../../meta';
11
11
  import { type ChatEvent } from '../Chat';
@@ -26,46 +26,38 @@ export const ChatActions = ({ classNames, children, microphone, recording, proce
26
26
  <div className={mx('flex items-center mie-1', classNames)}>
27
27
  {children}
28
28
 
29
- {(processing && (
30
- <IconButton
31
- disabled={!processing}
32
- classNames='px-1.5'
33
- variant='ghost'
34
- size={5}
35
- icon='ph--x--regular'
36
- iconOnly
37
- label={t('button cancel processing')}
38
- onClick={() => onEvent?.({ type: 'cancel' })}
39
- />
40
- )) || (
41
- <IconButton
42
- disabled
43
- classNames='px-1.5'
44
- variant='ghost'
45
- size={5}
46
- icon='ph--arrow-down--regular'
47
- iconOnly
48
- label={t('button scroll down')}
49
- onClick={() => onEvent?.({ type: 'scroll-to-bottom' })}
50
- />
51
- )}
29
+ <IconButton
30
+ disabled={!processing}
31
+ variant='ghost'
32
+ icon='ph--x--regular'
33
+ iconOnly
34
+ label={t('cancel processing button')}
35
+ onClick={() => onEvent?.({ type: 'cancel' })}
36
+ />
52
37
 
53
38
  {microphone && (
54
39
  <IconButton
55
40
  disabled={!processing}
56
- classNames={mx('px-1.5', recording && 'bg-primary-500')}
41
+ classNames={mx(recording && 'bg-primary-500')}
57
42
  variant='ghost'
58
- size={5}
59
43
  icon='ph--microphone--regular'
60
44
  iconOnly
61
45
  noTooltip
62
- label={t('button microphone')}
46
+ label={t('microphone button')}
63
47
  onMouseDown={() => onEvent?.({ type: 'record-start' })}
64
48
  onMouseUp={() => onEvent?.({ type: 'record-stop' })}
65
49
  onTouchStart={() => onEvent?.({ type: 'record-start' })}
66
50
  onTouchEnd={() => onEvent?.({ type: 'record-stop' })}
67
51
  />
68
52
  )}
53
+
54
+ <IconButton
55
+ variant='ghost'
56
+ icon='ph--wrench--regular'
57
+ iconOnly
58
+ label={t('debug button')}
59
+ onClick={() => onEvent?.({ type: 'toggle-debug' })}
60
+ />
69
61
  </div>
70
62
  );
71
63
  };