@dxos/plugin-assistant 0.8.4-main.3c1ae3b → 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 (481) 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/blueprints/index.mjs +12 -0
  19. package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
  20. package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
  22. package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-7ZJIXQ2Y.mjs → chunk-DKQMSMBN.mjs} +54 -63
  24. package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
  25. package/dist/lib/browser/{chunk-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
  26. package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
  27. package/dist/lib/browser/{chunk-F6YX2HHA.mjs → chunk-IJYAKPEU.mjs} +45 -21
  28. package/dist/lib/browser/chunk-IJYAKPEU.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-JA7PUZC7.mjs +1974 -0
  30. package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
  31. package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
  32. package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
  33. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
  34. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
  35. package/dist/lib/browser/index.mjs +205 -177
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
  38. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
  39. package/dist/lib/browser/meta.json +1 -1
  40. package/dist/lib/browser/operation-resolver-2673CFJS.mjs +133 -0
  41. package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
  42. package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
  43. package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
  44. package/dist/lib/browser/{repair-3MZXLUHO.mjs → repair-IRXDYF4R.mjs} +24 -17
  45. package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
  46. package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
  47. package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
  48. package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
  49. package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
  50. package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
  51. package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
  52. package/dist/lib/browser/types/index.mjs +8 -4
  53. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
  54. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
  55. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
  56. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
  57. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
  58. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
  59. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
  60. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
  61. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
  62. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
  63. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
  64. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
  65. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
  66. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
  67. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
  68. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
  69. package/dist/lib/node-esm/{blueprint-definition-S3DNWJFV.mjs → blueprint-definition-H3LFAEK2.mjs} +6 -4
  70. package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
  71. package/dist/lib/node-esm/blueprints/index.mjs +13 -0
  72. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
  74. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
  76. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
  77. package/dist/lib/node-esm/{chunk-CKW4IYLY.mjs → chunk-75PHXBN3.mjs} +54 -63
  78. package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
  79. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
  80. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +7 -0
  81. package/dist/lib/node-esm/chunk-LB72WG6R.mjs +231 -0
  82. package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
  83. package/dist/lib/node-esm/{chunk-GWKWQSEQ.mjs → chunk-MJD5XWQV.mjs} +45 -21
  84. package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
  85. package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
  86. package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
  87. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
  88. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
  89. package/dist/lib/node-esm/index.mjs +205 -177
  90. package/dist/lib/node-esm/index.mjs.map +4 -4
  91. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
  92. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
  93. package/dist/lib/node-esm/meta.json +1 -1
  94. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs +134 -0
  95. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
  96. package/dist/lib/node-esm/{react-surface-AOBQALOV.mjs → react-surface-T4VMCCKZ.mjs} +57 -32
  97. package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
  98. package/dist/lib/node-esm/{repair-RER5H7Y6.mjs → repair-DMI55PON.mjs} +24 -17
  99. package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
  100. package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
  101. package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
  102. package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
  103. package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
  104. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
  105. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
  106. package/dist/lib/node-esm/types/index.mjs +8 -4
  107. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  108. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  109. package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
  110. package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
  111. package/dist/types/src/blueprints/index.d.ts +7 -0
  112. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
  114. package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
  116. package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  118. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  120. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
  122. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
  124. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
  126. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
  128. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/index.d.ts +10 -12
  130. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  131. package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
  132. package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
  134. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  136. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  138. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  140. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  142. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  144. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  146. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/settings/index.d.ts +15 -0
  148. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
  150. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  152. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  153. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  154. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  155. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  156. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  157. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
  158. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  159. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
  160. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  161. package/dist/types/src/components/BlueprintArticle.d.ts +2 -2
  162. package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
  163. package/dist/types/src/components/Chat/Chat.d.ts +13 -11
  164. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  165. package/dist/types/src/components/Chat/events.d.ts +1 -1
  166. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  167. package/dist/types/src/components/ChatCompanion.d.ts +3 -3
  168. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
  169. package/dist/types/src/components/ChatContainer.d.ts +8 -8
  170. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  171. package/dist/types/src/components/ChatDialog.d.ts +2 -2
  172. package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
  173. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +2 -2
  174. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  175. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  176. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
  177. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  178. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
  179. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  180. package/dist/types/src/components/ChatThread/ChatThread.d.ts +2 -2
  181. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  182. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +116 -2
  183. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  184. package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
  185. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  186. package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
  187. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  188. package/dist/types/src/components/InitiativeContainer.d.ts +9 -0
  189. package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
  190. package/dist/types/src/components/PromptArticle.d.ts +2 -2
  191. package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
  192. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  193. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +114 -0
  194. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  195. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
  196. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  197. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +115 -1
  198. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  199. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  200. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
  201. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  202. package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
  203. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  204. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +114 -0
  205. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  206. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
  207. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  208. package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
  209. package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
  210. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
  211. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
  212. package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
  213. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
  214. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
  215. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
  216. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
  217. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
  218. package/dist/types/src/components/Typewriter/index.d.ts +2 -0
  219. package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
  220. package/dist/types/src/components/index.d.ts +10 -10
  221. package/dist/types/src/components/index.d.ts.map +1 -1
  222. package/dist/types/src/functions/index.d.ts +1 -1
  223. package/dist/types/src/functions/index.d.ts.map +1 -1
  224. package/dist/types/src/functions/object-list.d.ts +1 -1
  225. package/dist/types/src/functions/object-load.d.ts +1 -1
  226. package/dist/types/src/functions/object-load.d.ts.map +1 -1
  227. package/dist/types/src/functions/object-search.d.ts +10 -0
  228. package/dist/types/src/functions/object-search.d.ts.map +1 -0
  229. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
  230. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  231. package/dist/types/src/hooks/useChatProcessor.d.ts +2 -1
  232. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  233. package/dist/types/src/hooks/useChatServices.d.ts +5 -5
  234. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  235. package/dist/types/src/hooks/useChatToolbarActions.d.ts +3 -3
  236. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  237. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  238. package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
  239. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  240. package/dist/types/src/hooks/useFilteredTypes.d.ts +2 -3
  241. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
  242. package/dist/types/src/index.d.ts +0 -1
  243. package/dist/types/src/index.d.ts.map +1 -1
  244. package/dist/types/src/meta.d.ts +2 -2
  245. package/dist/types/src/meta.d.ts.map +1 -1
  246. package/dist/types/src/processor/processor.d.ts +13 -9
  247. package/dist/types/src/processor/processor.d.ts.map +1 -1
  248. package/dist/types/src/processor/update-name.d.ts +2 -2
  249. package/dist/types/src/processor/update-name.d.ts.map +1 -1
  250. package/dist/types/src/queue-logger.d.ts.map +1 -1
  251. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  252. package/dist/types/src/translations.d.ts +114 -0
  253. package/dist/types/src/translations.d.ts.map +1 -1
  254. package/dist/types/src/types/Assistant.d.ts +7 -32
  255. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  256. package/dist/types/src/types/AssistantAction.d.ts +90 -122
  257. package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
  258. package/dist/types/src/types/capabilities.d.ts +33 -0
  259. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  260. package/dist/types/src/types/events.d.ts +5 -0
  261. package/dist/types/src/types/events.d.ts.map +1 -0
  262. package/dist/types/src/types/index.d.ts +4 -1
  263. package/dist/types/src/types/index.d.ts.map +1 -1
  264. package/dist/types/src/types/service.d.ts +11 -260
  265. package/dist/types/src/types/service.d.ts.map +1 -1
  266. package/dist/types/tsconfig.tsbuildinfo +1 -1
  267. package/package.json +116 -93
  268. package/src/AssistantPlugin.tsx +104 -99
  269. package/src/blueprints/assistant-blueprint.ts +57 -0
  270. package/src/blueprints/index.ts +12 -0
  271. package/src/capabilities/ai-service/ai-service.ts +30 -0
  272. package/src/capabilities/ai-service/index.ts +7 -0
  273. package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
  274. package/src/capabilities/app-graph-builder/index.ts +7 -0
  275. package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
  276. package/src/capabilities/blueprint-definition/index.ts +8 -0
  277. package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
  278. package/src/capabilities/edge-model-resolver/index.ts +7 -0
  279. package/src/capabilities/index.ts +10 -15
  280. package/src/capabilities/local-model-resolver/index.ts +7 -0
  281. package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
  282. package/src/capabilities/operation-resolver/index.ts +7 -0
  283. package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
  284. package/src/capabilities/react-surface/index.ts +7 -0
  285. package/src/capabilities/react-surface/react-surface.tsx +111 -0
  286. package/src/capabilities/repair/index.ts +7 -0
  287. package/src/capabilities/{repair.ts → repair/repair.ts} +24 -11
  288. package/src/capabilities/settings/index.ts +7 -0
  289. package/src/capabilities/settings/settings.ts +31 -0
  290. package/src/capabilities/state/index.ts +7 -0
  291. package/src/capabilities/state/state.ts +27 -0
  292. package/src/capabilities/toolkit/index.ts +7 -0
  293. package/src/capabilities/toolkit/toolkit.ts +27 -0
  294. package/src/components/AssistantSettings/AssistantSettings.tsx +28 -20
  295. package/src/components/BlueprintArticle.tsx +5 -6
  296. package/src/components/Chat/Chat.tsx +104 -77
  297. package/src/components/Chat/events.ts +1 -1
  298. package/src/components/ChatCompanion.tsx +103 -43
  299. package/src/components/ChatContainer.tsx +30 -24
  300. package/src/components/ChatDialog.tsx +8 -8
  301. package/src/components/ChatProgress/ChatProgress.tsx +5 -19
  302. package/src/components/ChatPrompt/ChatActions.tsx +9 -1
  303. package/src/components/ChatPrompt/ChatOptions.tsx +62 -58
  304. package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
  305. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
  306. package/src/components/ChatThread/ChatThread.stories.tsx +9 -8
  307. package/src/components/ChatThread/ChatThread.tsx +14 -5
  308. package/src/components/ChatThread/Link.tsx +3 -3
  309. package/src/components/ChatThread/registry.tsx +1 -1
  310. package/src/components/ChatThread/sync.test.ts +13 -5
  311. package/src/components/ChatThread/sync.ts +8 -2
  312. package/src/components/InitiativeContainer.tsx +340 -0
  313. package/src/components/PromptArticle.tsx +9 -11
  314. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +3 -3
  315. package/src/components/TemplateEditor/TemplateEditor.tsx +7 -4
  316. package/src/components/TemplateEditor/TemplateForm.stories.tsx +15 -7
  317. package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
  318. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
  319. package/src/components/ToolBlock/ToolBlock.tsx +6 -6
  320. package/src/components/Toolbox/Toolbox.stories.tsx +10 -11
  321. package/src/components/Toolbox/Toolbox.tsx +50 -52
  322. package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
  323. package/src/components/TriggerStatus/index.ts +5 -0
  324. package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
  325. package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
  326. package/src/components/Typewriter/Typewriter.tsx +54 -0
  327. package/src/components/Typewriter/assistant-extension.tsx +144 -0
  328. package/src/components/Typewriter/index.ts +5 -0
  329. package/src/components/index.ts +11 -2
  330. package/src/functions/index.ts +1 -1
  331. package/src/functions/object-list.ts +2 -2
  332. package/src/functions/object-load.ts +9 -11
  333. package/src/functions/object-search.ts +46 -0
  334. package/src/hooks/useBlueprintRegistry.ts +31 -21
  335. package/src/hooks/useChatProcessor.ts +7 -3
  336. package/src/hooks/useChatServices.ts +14 -18
  337. package/src/hooks/useChatToolbarActions.ts +27 -27
  338. package/src/hooks/useContextBinder.ts +4 -2
  339. package/src/hooks/useContextObjects.ts +13 -25
  340. package/src/hooks/useFilteredTypes.ts +6 -7
  341. package/src/hooks/useReferencesProvider.ts +4 -4
  342. package/src/index.ts +0 -1
  343. package/src/meta.ts +2 -2
  344. package/src/processor/processor.test.ts +8 -8
  345. package/src/processor/processor.ts +49 -25
  346. package/src/processor/update-name.ts +6 -4
  347. package/src/queue-logger.ts +4 -1
  348. package/src/testing/test-services.ts +8 -6
  349. package/src/translations.ts +23 -2
  350. package/src/types/Assistant.ts +4 -39
  351. package/src/types/AssistantAction.ts +61 -64
  352. package/src/types/capabilities.ts +27 -0
  353. package/src/types/events.ts +11 -0
  354. package/src/types/index.ts +6 -1
  355. package/src/types/service.ts +10 -7
  356. package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs +0 -36
  357. package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +0 -7
  358. package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs +0 -159
  359. package/dist/lib/browser/ChatCompanion-U7VMDYO6.mjs.map +0 -7
  360. package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs +0 -79
  361. package/dist/lib/browser/ChatContainer-JXDZQ2EY.mjs.map +0 -7
  362. package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs +0 -90
  363. package/dist/lib/browser/ChatDialog-5NNGCRKJ.mjs.map +0 -7
  364. package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +0 -59
  365. package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs.map +0 -7
  366. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
  367. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
  368. package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs +0 -199
  369. package/dist/lib/browser/app-graph-builder-ADZRPJ3V.mjs.map +0 -7
  370. package/dist/lib/browser/blueprint-definition-7HPQPCL7.mjs +0 -12
  371. package/dist/lib/browser/chunk-5JZRYQZL.mjs +0 -229
  372. package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +0 -7
  373. package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +0 -7
  374. package/dist/lib/browser/chunk-F6YX2HHA.mjs.map +0 -7
  375. package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
  376. package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
  377. package/dist/lib/browser/chunk-SWEOO227.mjs +0 -1930
  378. package/dist/lib/browser/chunk-SWEOO227.mjs.map +0 -7
  379. package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
  380. package/dist/lib/browser/chunk-YDSFERCV.mjs +0 -178
  381. package/dist/lib/browser/chunk-YDSFERCV.mjs.map +0 -7
  382. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
  383. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
  384. package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs +0 -143
  385. package/dist/lib/browser/intent-resolver-Q7TX3MV7.mjs.map +0 -7
  386. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
  387. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
  388. package/dist/lib/browser/react-surface-VXXS6ZVC.mjs +0 -100
  389. package/dist/lib/browser/react-surface-VXXS6ZVC.mjs.map +0 -7
  390. package/dist/lib/browser/repair-3MZXLUHO.mjs.map +0 -7
  391. package/dist/lib/browser/settings-HD5WA24I.mjs +0 -23
  392. package/dist/lib/browser/settings-HD5WA24I.mjs.map +0 -7
  393. package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
  394. package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
  395. package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
  396. package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
  397. package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +0 -37
  398. package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +0 -7
  399. package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs +0 -160
  400. package/dist/lib/node-esm/ChatCompanion-O4T7PMMC.mjs.map +0 -7
  401. package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs +0 -80
  402. package/dist/lib/node-esm/ChatContainer-OWAZI6ZF.mjs.map +0 -7
  403. package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs +0 -91
  404. package/dist/lib/node-esm/ChatDialog-IBXH5FRI.mjs.map +0 -7
  405. package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +0 -60
  406. package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs.map +0 -7
  407. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
  408. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
  409. package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs +0 -200
  410. package/dist/lib/node-esm/app-graph-builder-26KXQ5ZY.mjs.map +0 -7
  411. package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +0 -7
  412. package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs +0 -230
  413. package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +0 -7
  414. package/dist/lib/node-esm/chunk-GWKWQSEQ.mjs.map +0 -7
  415. package/dist/lib/node-esm/chunk-VGSP5WMV.mjs +0 -180
  416. package/dist/lib/node-esm/chunk-VGSP5WMV.mjs.map +0 -7
  417. package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
  418. package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
  419. package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
  420. package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs +0 -1931
  421. package/dist/lib/node-esm/chunk-ZNSHGWE4.mjs.map +0 -7
  422. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +0 -19
  423. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
  424. package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs +0 -144
  425. package/dist/lib/node-esm/intent-resolver-LTKMN3YB.mjs.map +0 -7
  426. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
  427. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
  428. package/dist/lib/node-esm/react-surface-AOBQALOV.mjs.map +0 -7
  429. package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +0 -7
  430. package/dist/lib/node-esm/settings-YJQVKHH5.mjs +0 -24
  431. package/dist/lib/node-esm/settings-YJQVKHH5.mjs.map +0 -7
  432. package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
  433. package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
  434. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
  435. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
  436. package/dist/types/src/capabilities/ai-service.d.ts +0 -4
  437. package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
  438. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  439. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  440. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
  441. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  442. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  443. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  444. package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
  445. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +0 -1
  446. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  447. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  448. package/dist/types/src/capabilities/local-model-resolver.d.ts +0 -10
  449. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
  450. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  451. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  452. package/dist/types/src/capabilities/repair.d.ts +0 -4
  453. package/dist/types/src/capabilities/repair.d.ts.map +0 -1
  454. package/dist/types/src/capabilities/settings.d.ts +0 -4
  455. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  456. package/dist/types/src/capabilities/state.d.ts +0 -4
  457. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  458. package/dist/types/src/capabilities/toolkit.d.ts +0 -4
  459. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  460. package/dist/types/src/components/ChatThread/reducers.d.ts +0 -40
  461. package/dist/types/src/components/ChatThread/reducers.d.ts.map +0 -1
  462. package/dist/types/src/events.d.ts +0 -4
  463. package/dist/types/src/events.d.ts.map +0 -1
  464. package/dist/types/src/functions/analysis.d.ts +0 -5
  465. package/dist/types/src/functions/analysis.d.ts.map +0 -1
  466. package/src/capabilities/ai-service.ts +0 -27
  467. package/src/capabilities/app-graph-builder.ts +0 -208
  468. package/src/capabilities/blueprint-definition.ts +0 -66
  469. package/src/capabilities/capabilities.ts +0 -17
  470. package/src/capabilities/edge-model-resolver.ts +0 -25
  471. package/src/capabilities/intent-resolver.ts +0 -135
  472. package/src/capabilities/local-model-resolver.ts +0 -30
  473. package/src/capabilities/react-surface.tsx +0 -87
  474. package/src/capabilities/settings.ts +0 -19
  475. package/src/capabilities/state.ts +0 -22
  476. package/src/capabilities/toolkit.ts +0 -17
  477. package/src/components/ChatThread/reducers.ts +0 -151
  478. package/src/events.ts +0 -11
  479. package/src/functions/analysis.ts +0 -22
  480. /package/dist/lib/browser/{blueprint-definition-7HPQPCL7.mjs.map → blueprint-definition-YAGWYVCL.mjs.map} +0 -0
  481. /package/dist/lib/{node-esm/blueprint-definition-S3DNWJFV.mjs.map → browser/blueprints/index.mjs.map} +0 -0
@@ -2,6 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import type * as Tool from '@effect/ai/Tool';
5
6
  import { Atom, Registry } from '@effect-atom/atom-react';
6
7
  import * as Cause from 'effect/Cause';
7
8
  import * as Effect from 'effect/Effect';
@@ -19,16 +20,19 @@ import {
19
20
  type ToolResolverService,
20
21
  } from '@dxos/ai';
21
22
  import {
23
+ AiContextService,
22
24
  type AiConversation,
23
- type AiConversationRunParams,
25
+ type AiConversationRunProps,
24
26
  ArtifactDiffResolver,
25
27
  GenerationObserver,
26
28
  createSystemPrompt,
27
29
  } from '@dxos/assistant';
30
+ import { formatSystemPrompt } from '@dxos/assistant';
31
+ import { type Chat } from '@dxos/assistant-toolkit';
28
32
  import { type Blueprint } from '@dxos/blueprints';
29
33
  import { Obj } from '@dxos/echo';
30
34
  import { type Database } from '@dxos/echo';
31
- import { throwCause } from '@dxos/effect';
35
+ import { runAndForwardErrors, throwCause, unwrapExit } from '@dxos/effect';
32
36
  import {
33
37
  type CredentialsService,
34
38
  type FunctionInvocationService,
@@ -38,8 +42,6 @@ import {
38
42
  import { log } from '@dxos/log';
39
43
  import { type ContentBlock, Message } from '@dxos/types';
40
44
 
41
- import { type Assistant } from '../types';
42
-
43
45
  import { updateName } from './update-name';
44
46
 
45
47
  export type AiChatServices =
@@ -58,7 +60,7 @@ export type AiChatProcessorOptions = {
58
60
  blueprintRegistry?: Blueprint.Registry;
59
61
  observableRegistry?: Registry.Registry;
60
62
  extensions?: ToolContextExtensions;
61
- } & Pick<AiConversationRunParams, 'system'>;
63
+ } & Pick<AiConversationRunProps, 'system'>;
62
64
 
63
65
  const defaultOptions: Partial<AiChatProcessorOptions> = {
64
66
  model: DEFAULT_EDGE_MODEL,
@@ -82,18 +84,18 @@ export class AiChatProcessor {
82
84
  /** External observer. */
83
85
  private readonly _observer: GenerationObserver;
84
86
 
85
- /** Currently active request fiber. */
86
- private _fiber: Fiber.Fiber<void, any> | undefined;
87
-
88
- /** Last request (for retries). */
89
- private _lastRequest: AiRequest | undefined;
90
-
91
87
  /** Pending messages (incl. the current user request). */
92
88
  private readonly _pending = Atom.make<Message.Message[]>([]);
93
89
 
94
90
  /** Currently streaming message (from the AI service). */
95
91
  private readonly _streaming = Atom.make<Option.Option<Message.Message>>(Option.none());
96
92
 
93
+ /** Currently active request fiber. */
94
+ private _fiber: Fiber.Fiber<void, any> | undefined;
95
+
96
+ /** Last request (for retries). */
97
+ private _lastRequest: AiRequest | undefined;
98
+
97
99
  /** Streaming state. */
98
100
  public readonly streaming = Atom.make<boolean>((get) => Option.isSome(get(this._streaming)));
99
101
 
@@ -141,37 +143,59 @@ export class AiChatProcessor {
141
143
  return this._options.blueprintRegistry;
142
144
  }
143
145
 
146
+ get system(): string {
147
+ return this._options.system ?? '';
148
+ }
149
+
150
+ async getTools(): Promise<Record<string, Tool.Any>> {
151
+ return unwrapExit(await this._conversation.getTools().pipe(await Runtime.runPromiseExit(await this._services())));
152
+ }
153
+
154
+ async getSystemPrompt(): Promise<string> {
155
+ return unwrapExit(
156
+ await Effect.gen(this, function* () {
157
+ const blueprints = this.context.getBlueprints();
158
+ const objects = this.context.getObjects();
159
+ const system = yield* formatSystemPrompt({ system: this._options.system, blueprints, objects });
160
+ return system;
161
+ }).pipe(
162
+ Effect.provideService(AiContextService, {
163
+ binder: this.context,
164
+ }),
165
+ await Runtime.runPromiseExit(await this._services()),
166
+ ),
167
+ );
168
+ }
169
+
144
170
  /**
145
171
  * Initiates a new request.
146
172
  */
147
- async request(requestParam: AiRequest): Promise<void> {
173
+ async request(requestProp: AiRequest): Promise<void> {
148
174
  if (this._fiber) {
149
175
  await this.cancel();
150
176
  }
151
177
 
152
178
  try {
153
- this._lastRequest = requestParam;
179
+ this._lastRequest = requestProp;
154
180
  this._registry.set(this.error, Option.none());
155
181
  this._registry.set(this.active, true);
156
182
 
183
+ const services = await this._services();
184
+
157
185
  // Create request.
158
186
  const request = this._conversation.createRequest({
159
187
  system: this._options.system,
160
- prompt: requestParam.message,
188
+ prompt: requestProp.message,
161
189
  observer: this._observer,
162
190
  });
163
191
 
164
- const runtime = await this._services();
165
-
166
192
  // Create fiber.
167
193
  this._fiber = request.pipe(
168
194
  Effect.provide(AiService.model(this._options.model ?? DEFAULT_EDGE_MODEL)),
169
-
170
195
  // TODO(dmaretskyi): Move ArtifactDiffResolver upstream.
171
196
  Effect.provideService(ArtifactDiffResolver, this._artifactDiffResolver),
172
-
173
197
  Effect.asVoid,
174
- Runtime.runFork(runtime), // Runs in the background.
198
+ Runtime.runFork(services), // Runs in the background.
175
199
  );
176
200
 
177
201
  // Execute request.
@@ -183,12 +207,12 @@ export class AiChatProcessor {
183
207
  this._registry.set(this.error, Option.none());
184
208
  this._lastRequest = undefined;
185
209
  this._fiber = undefined;
186
- } catch (error) {
187
- log.error('request failed', { error });
188
- this._registry.set(this.error, Option.some(new Error('AI service error', { cause: error })));
210
+ } catch (err) {
211
+ log.error('request failed', { error: err });
212
+ this._registry.set(this.error, Option.some(new Error('AI service error', { cause: err })));
189
213
  } finally {
190
- this._fiber = undefined;
191
214
  this._registry.set(this.active, false);
215
+ this._fiber = undefined;
192
216
  }
193
217
  }
194
218
 
@@ -196,7 +220,7 @@ export class AiChatProcessor {
196
220
  * Cancels the current request.
197
221
  */
198
222
  async cancel(): Promise<void> {
199
- await Effect.runPromise(
223
+ await runAndForwardErrors(
200
224
  Effect.gen(this, function* () {
201
225
  if (this._fiber) {
202
226
  yield* this._fiber.pipe(Fiber.interrupt);
@@ -220,7 +244,7 @@ export class AiChatProcessor {
220
244
  /**
221
245
  * Update the current chat's name.
222
246
  */
223
- async updateName(chat: Assistant.Chat): Promise<void> {
247
+ async updateName(chat: Chat.Chat): Promise<void> {
224
248
  const runtime = await this._services();
225
249
  await updateName(runtime, this._conversation, chat, this._options.model);
226
250
  }
@@ -9,11 +9,11 @@ import * as Runtime from 'effect/Runtime';
9
9
 
10
10
  import { AiService, DEFAULT_EDGE_MODEL, type ModelName } from '@dxos/ai';
11
11
  import { type AiConversation, AiSession } from '@dxos/assistant';
12
+ import { type Chat } from '@dxos/assistant-toolkit';
13
+ import { Obj } from '@dxos/echo';
12
14
  import { throwCause } from '@dxos/effect';
13
15
  import { trim } from '@dxos/util';
14
16
 
15
- import { type Assistant } from '../types';
16
-
17
17
  import { type AiChatServices } from './processor';
18
18
 
19
19
  /**
@@ -23,7 +23,7 @@ import { type AiChatServices } from './processor';
23
23
  export const updateName = async (
24
24
  runtime: Runtime.Runtime<AiChatServices>,
25
25
  conversation: AiConversation,
26
- chat: Assistant.Chat,
26
+ chat: Chat.Chat,
27
27
  model: ModelName = DEFAULT_EDGE_MODEL,
28
28
  ): Promise<void> => {
29
29
  const history = await conversation.getHistory();
@@ -43,7 +43,9 @@ export const updateName = async (
43
43
  const message = messages.find((message) => message.sender.role === 'assistant');
44
44
  const title = message?.blocks.find((block) => block._tag === 'text')?.text;
45
45
  if (title) {
46
- chat.name = title;
46
+ Obj.change(chat, (c) => {
47
+ c.name = title;
48
+ });
47
49
  }
48
50
  }),
49
51
  Runtime.runFork(runtime), // Run in the background.
@@ -23,7 +23,10 @@ export class QueueLogger implements SequenceLogger {
23
23
  let dxn = this._space.properties.invocationTraceQueue?.dxn;
24
24
  if (!dxn) {
25
25
  dxn = DXN.fromQueue(QueueSubspaceTags.TRACE, this._space.id, Key.ObjectId.random());
26
- this._space.properties.invocationTraceQueue = Ref.fromDXN(dxn);
26
+ const newDxn = dxn;
27
+ Obj.change(this._space.properties, (p) => {
28
+ p.invocationTraceQueue = Ref.fromDXN(newDxn);
29
+ });
27
30
  }
28
31
  this._invocationTraceQueue = this._space.queues.get(dxn);
29
32
  }
@@ -2,10 +2,12 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Obj } from '@dxos/echo';
5
+ import { Obj, type Type } from '@dxos/echo';
6
6
 
7
7
  import { type ApiAuthorization, type BaseServiceRegistry, ServiceType, categoryIcons } from '../types';
8
8
 
9
+ const ServiceTypeSchema = ServiceType as unknown as Type.Obj.Any;
10
+
9
11
  export class MockServiceRegistry implements BaseServiceRegistry {
10
12
  async queryServices(): Promise<ServiceType[]> {
11
13
  return TEST_SERVICES;
@@ -48,7 +50,7 @@ const VISUAL_CROSSING_CREDENTIALS: ApiAuthorization = {
48
50
  // - e.g., https://github.com/konfig-sdks/openapi-examples/blob/main/xkcd/openapi.yaml
49
51
 
50
52
  const TEST_SERVICES: ServiceType[] = [
51
- Obj.make(ServiceType, {
53
+ Obj.make(ServiceTypeSchema, {
52
54
  serviceId: 'amadeus.com/service/FlightSearch',
53
55
  name: 'Amadeus Flight Search',
54
56
  description: 'Search for local and international flights.',
@@ -62,7 +64,7 @@ const TEST_SERVICES: ServiceType[] = [
62
64
  ],
63
65
  }),
64
66
 
65
- Obj.make(ServiceType, {
67
+ Obj.make(ServiceTypeSchema, {
66
68
  serviceId: 'amadeus.com/service/HotelSearch',
67
69
  name: 'Amadeus Hotel Search',
68
70
  description: 'Search for local and international hotels.',
@@ -76,7 +78,7 @@ const TEST_SERVICES: ServiceType[] = [
76
78
  ],
77
79
  }),
78
80
 
79
- Obj.make(ServiceType, {
81
+ Obj.make(ServiceTypeSchema, {
80
82
  serviceId: 'visualcrossing.com/service/Weather',
81
83
  name: 'Visual Crossing Weather',
82
84
  description: 'Search for global weather forecasts.',
@@ -91,7 +93,7 @@ const TEST_SERVICES: ServiceType[] = [
91
93
  }),
92
94
 
93
95
  // TODO(burdon): Needs auth.
94
- Obj.make(ServiceType, {
96
+ Obj.make(ServiceTypeSchema, {
95
97
  serviceId: 'abstractapi.com/service/GeoLocation',
96
98
  name: 'Abstract GeoLocation',
97
99
  description: 'Get the location of any IP address.',
@@ -109,7 +111,7 @@ const TEST_SERVICES: ServiceType[] = [
109
111
  //
110
112
 
111
113
  ...Array.from({ length: 20 }, (_, i) =>
112
- Obj.make(ServiceType, {
114
+ Obj.make(ServiceTypeSchema, {
113
115
  serviceId: `example.com/service/test-${i}`,
114
116
  name: `Test ${i}`,
115
117
  description: `Test ${i}`,
@@ -2,13 +2,13 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { Chat, Initiative } from '@dxos/assistant-toolkit';
5
6
  import { Blueprint, Prompt } from '@dxos/blueprints';
6
7
  import { Sequence } from '@dxos/conductor';
7
8
  import { Type } from '@dxos/echo';
8
9
  import { type Resource } from '@dxos/react-ui';
9
10
 
10
11
  import { meta } from './meta';
11
- import { Assistant } from './types';
12
12
 
13
13
  // TODO(burdon): Standardize translation names.
14
14
  export const translations = [
@@ -46,13 +46,23 @@ export const translations = [
46
46
  'delete object label': 'Delete sequence',
47
47
  'object deleted label': 'Sequence deleted',
48
48
  },
49
- [Assistant.Chat.typename]: {
49
+ [Chat.Chat.typename]: {
50
50
  'typename label': 'AI Chat',
51
51
  'object name placeholder': 'New AI Chat',
52
52
  'rename object label': 'Rename AI Chat',
53
53
  'delete object label': 'Delete AI Chat',
54
54
  'object deleted label': 'AI Chat deleted',
55
55
  },
56
+ [Initiative.Initiative.typename]: {
57
+ 'typename label': 'Initiative',
58
+ 'typename label_zero': 'Initiatives',
59
+ 'typename label_one': 'Initiative',
60
+ 'typename label_other': 'Initiatives',
61
+ 'object name placeholder': 'New initiative',
62
+ 'rename object label': 'Rename initiative',
63
+ 'delete object label': 'Delete initiative',
64
+ 'object deleted label': 'Initiative deleted',
65
+ },
56
66
  // TODO(burdon): Reconcile with react-ui-chat.
57
67
  [meta.id]: {
58
68
  'templates label': 'Templates',
@@ -83,6 +93,7 @@ export const translations = [
83
93
 
84
94
  'assistant dialog title': 'Assistant',
85
95
  'open assistant label': 'Open assistant',
96
+ 'reset blueprints label': 'Reset blueprints',
86
97
 
87
98
  'no tools': 'No tools are configured',
88
99
  'no results': 'No results',
@@ -113,6 +124,16 @@ export const translations = [
113
124
  'settings llm provider label': 'LLM provider',
114
125
  'settings edge llm model label': 'Remote language model',
115
126
  'settings ollama llm model label': 'Ollama language model',
127
+
128
+ // Trigger status
129
+ 'trigger status disabled label': 'Triggers disabled',
130
+ 'trigger status idle label': 'Triggers idle',
131
+ 'trigger status running label': 'Trigger running',
132
+ 'trigger status error label': 'Trigger error',
133
+ 'trigger runtime label': 'Trigger Runtime',
134
+ 'trigger runtime description': 'Enable automatic trigger execution',
135
+ 'trigger last invocation label': 'Last run',
136
+ 'trigger duration label': 'Duration',
116
137
  },
117
138
  },
118
139
  },
@@ -4,48 +4,13 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Obj, Ref, Type } from '@dxos/echo';
8
- import { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/internal';
9
- import { Queue } from '@dxos/echo-db';
7
+ import { Chat as ChatModule } from '@dxos/assistant-toolkit';
10
8
 
11
9
  import { LLM_PROVIDERS } from './defs';
12
10
 
13
- /**
14
- * AI chat.
15
- */
16
- export const Chat = Schema.Struct({
17
- name: Schema.String.pipe(Schema.optional),
18
- queue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false)),
19
- // TODO(dmaretskyi): Eventually this and the message queue will be the same.
20
- traceQueue: Type.Ref(Queue).pipe(FormInputAnnotation.set(false), Schema.optional),
21
- }).pipe(
22
- Type.Obj({
23
- typename: 'dxos.org/type/assistant/Chat',
24
- version: '0.2.0',
25
- }),
26
- LabelAnnotation.set(['name']),
27
- );
28
-
29
- export interface Chat extends Schema.Schema.Type<typeof Chat> {}
30
-
31
- export const makeChat = ({ name, queue }: { name?: string; queue: Queue }) =>
32
- Obj.make(Chat, { name, queue: Ref.fromDXN(queue.dxn) });
33
-
34
- /**
35
- * Relation between a Chat and companion objects (e.g., artifacts).
36
- */
37
- export const CompanionTo = Schema.Struct({
38
- id: Obj.ID,
39
- }).pipe(
40
- Type.Relation({
41
- typename: 'dxos.org/relation/assistant/CompanionTo',
42
- version: '0.1.0',
43
- source: Chat,
44
- target: Type.Expando,
45
- }),
46
- );
47
-
48
- export interface CompanionTo extends Schema.Schema.Type<typeof CompanionTo> {}
11
+ // Re-export Chat schema for backward compatibility.
12
+ export const Chat = ChatModule.Chat;
13
+ export type Chat = ChatModule.Chat;
49
14
 
50
15
  /**
51
16
  * Plugin settings.
@@ -4,76 +4,73 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { Blueprint, Prompt } from '@dxos/blueprints';
8
- import { EchoObjectSchema, SpaceSchema } from '@dxos/client/echo';
9
- import { Sequence } from '@dxos/conductor';
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Chat } from '@dxos/assistant-toolkit';
9
+ import { SpaceSchema } from '@dxos/client/echo';
10
+ import { Database, Type } from '@dxos/echo';
11
+ import { Operation } from '@dxos/operation';
10
12
  import { Collection } from '@dxos/schema';
11
13
 
12
14
  import { meta } from '../meta';
13
15
 
14
- import { Chat } from './Assistant';
16
+ // Operations
17
+ const ASSISTANT_OPERATION = `${meta.id}/operation`;
15
18
 
16
- // TODO(burdon): Name?
17
- export class OnCreateSpace extends Schema.TaggedClass<OnCreateSpace>()(`${meta.id}/on-space-created`, {
18
- input: Schema.Struct({
19
- space: SpaceSchema,
20
- rootCollection: Collection.Collection,
21
- }),
22
- output: Schema.Void,
23
- }) {}
19
+ export namespace AssistantOperation {
20
+ export const OnCreateSpace = Operation.make({
21
+ meta: { key: `${ASSISTANT_OPERATION}/on-create-space`, name: 'On Create Space' },
22
+ services: [Capability.Service],
23
+ schema: {
24
+ input: Schema.Struct({
25
+ space: SpaceSchema,
26
+ rootCollection: Collection.Collection,
27
+ }),
28
+ output: Schema.Void,
29
+ },
30
+ });
24
31
 
25
- export class CreateChat extends Schema.TaggedClass<CreateChat>()(`${meta.id}/action/create-chat`, {
26
- input: Schema.Struct({
27
- space: SpaceSchema,
28
- name: Schema.optional(Schema.String),
29
- }),
30
- output: Schema.Struct({
31
- object: Chat,
32
- }),
33
- }) {}
32
+ export const CreateChat = Operation.make({
33
+ meta: { key: `${ASSISTANT_OPERATION}/create-chat`, name: 'Create Chat' },
34
+ services: [Capability.Service],
35
+ schema: {
36
+ input: Schema.Struct({
37
+ db: Database.Database,
38
+ name: Schema.optional(Schema.String),
39
+ /** If false, chat is created in-memory only and not added to space. Defaults to true. */
40
+ addToSpace: Schema.optional(Schema.Boolean),
41
+ }),
42
+ output: Schema.Struct({
43
+ object: Chat.Chat,
44
+ }),
45
+ },
46
+ });
34
47
 
35
- export class UpdateChatName extends Schema.TaggedClass<UpdateChatName>()(`${meta.id}/action/update-name`, {
36
- input: Schema.Struct({
37
- chat: Chat,
38
- }),
39
- output: Schema.Void,
40
- }) {}
48
+ export const UpdateChatName = Operation.make({
49
+ meta: { key: `${ASSISTANT_OPERATION}/update-chat-name`, name: 'Update Chat Name' },
50
+ services: [Capability.Service],
51
+ schema: {
52
+ input: Schema.Struct({
53
+ chat: Chat.Chat,
54
+ }),
55
+ output: Schema.Void,
56
+ },
57
+ });
41
58
 
42
- export const BlueprintForm = Schema.Struct({
43
- key: Schema.String,
44
- name: Schema.String,
45
- description: Schema.optional(Schema.String),
46
- });
59
+ export const SetCurrentChat = Operation.make({
60
+ meta: { key: `${ASSISTANT_OPERATION}/set-current-chat`, name: 'Set Current Chat' },
61
+ services: [Capability.Service],
62
+ schema: {
63
+ input: Schema.Struct({
64
+ companionTo: Type.Obj,
65
+ chat: Chat.Chat.pipe(Schema.optional),
66
+ }),
67
+ output: Schema.Void,
68
+ },
69
+ });
47
70
 
48
- export class CreateBlueprint extends Schema.TaggedClass<CreateBlueprint>()(`${meta.id}/action/create-blueprint`, {
49
- input: BlueprintForm,
50
- output: Schema.Struct({
51
- object: Blueprint.Blueprint,
52
- }),
53
- }) {}
54
-
55
- export class CreatePrompt extends Schema.TaggedClass<CreatePrompt>()(`${meta.id}/action/create-prompt`, {
56
- input: Schema.Struct({
57
- name: Schema.optional(Schema.String),
58
- }),
59
- output: Schema.Struct({
60
- object: Prompt.Prompt,
61
- }),
62
- }) {}
63
-
64
- export class CreateSequence extends Schema.TaggedClass<CreateSequence>()(`${meta.id}/action/create-sequence`, {
65
- input: Schema.Struct({
66
- name: Schema.optional(Schema.String),
67
- }),
68
- output: Schema.Struct({
69
- object: Sequence,
70
- }),
71
- }) {}
72
-
73
- export class SetCurrentChat extends Schema.TaggedClass<SetCurrentChat>()(`${meta.id}/action/set-current-chat`, {
74
- input: Schema.Struct({
75
- companionTo: EchoObjectSchema,
76
- chat: Chat.pipe(Schema.optional),
77
- }),
78
- output: Schema.Void,
79
- }) {}
71
+ export const BlueprintForm = Schema.Struct({
72
+ key: Schema.String,
73
+ name: Schema.String,
74
+ description: Schema.optional(Schema.String),
75
+ });
76
+ }
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Atom } from '@effect-atom/atom-react';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { Capability } from '@dxos/app-framework';
9
+
10
+ import { meta } from '../meta';
11
+
12
+ import { type Assistant } from './';
13
+
14
+ export namespace AssistantCapabilities {
15
+ export const Settings = Capability.make<Atom.Writable<Assistant.Settings>>(`${meta.id}/capability/settings`);
16
+
17
+ export const StateSchema = Schema.mutable(
18
+ Schema.Struct({
19
+ /** Map of primary object dxn to current chat dxn. */
20
+ currentChat: Schema.Record({ key: Schema.String, value: Schema.UndefinedOr(Schema.String) }),
21
+ }),
22
+ );
23
+
24
+ export type AssistantState = Schema.Schema.Type<typeof StateSchema>;
25
+
26
+ export const State = Capability.make<Atom.Writable<AssistantState>>(`${meta.id}/capability/state`);
27
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { ActivationEvent } from '@dxos/app-framework';
6
+
7
+ import { meta } from '../meta';
8
+
9
+ export namespace AssistantEvents {
10
+ export const SetupAiServiceProviders = ActivationEvent.make(`${meta.id}/event/setup-ai-service-providers`);
11
+ }
@@ -2,8 +2,13 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
+ // Re-export Chat type from assistant-toolkit for public API type declarations.
6
+ export type { Chat as ChatType } from '@dxos/assistant-toolkit';
7
+
5
8
  export * as Assistant from './Assistant';
6
- export * as AssistantAction from './AssistantAction';
9
+ export { AssistantOperation } from './AssistantAction';
7
10
 
11
+ export * from './capabilities';
8
12
  export * from './defs';
13
+ export * from './events';
9
14
  export * from './service';
@@ -6,7 +6,6 @@ import * as Schema from 'effect/Schema';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
8
  import { Type } from '@dxos/echo';
9
- import { TypedObject } from '@dxos/echo/internal';
10
9
  import { Function } from '@dxos/functions';
11
10
 
12
11
  // TODO(burdon): Factor out and reconcile with https://github.com/dxos/dxos/blob/main/packages/plugins/plugin-token-manager/src/defs/presets.ts#L7
@@ -70,14 +69,11 @@ const ServiceInterface = Schema.Union(
70
69
  ServiceInterfaceFunction,
71
70
  ServiceInterfaceWorkflow,
72
71
  ServiceInterfaceApi,
73
- );
72
+ ) as any;
74
73
 
75
74
  export type ServiceInterface = Schema.Schema.Type<typeof ServiceInterface>;
76
75
 
77
- export class ServiceType extends TypedObject({
78
- typename: 'dxos.org/type/ServiceType',
79
- version: '0.1.0',
80
- })({
76
+ export const ServiceType = Schema.Struct({
81
77
  serviceId: Schema.String,
82
78
  name: Schema.optional(Schema.String),
83
79
  description: Schema.optional(Schema.String),
@@ -88,7 +84,14 @@ export class ServiceType extends TypedObject({
88
84
  * Entries exposed: functions, workflows, and APIs.
89
85
  */
90
86
  interfaces: Schema.optional(Schema.Array(ServiceInterface)),
91
- }) {}
87
+ }).pipe(
88
+ Type.object({
89
+ typename: 'dxos.org/type/ServiceType',
90
+ version: '0.1.0',
91
+ }),
92
+ );
93
+
94
+ export interface ServiceType extends Schema.Schema.Type<typeof ServiceType> {}
92
95
 
93
96
  //
94
97
  // Service Registry
@@ -1,36 +0,0 @@
1
- import {
2
- TemplateEditor
3
- } from "./chunk-7ZJIXQ2Y.mjs";
4
- import "./chunk-WBG5PTSX.mjs";
5
- import "./chunk-J5LGTIGS.mjs";
6
-
7
- // src/components/BlueprintArticle.tsx
8
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
9
- import React from "react";
10
- import { Obj } from "@dxos/echo";
11
- import { Toolbar } from "@dxos/react-ui";
12
- import { useAttention } from "@dxos/react-ui-attention";
13
- import { StackItem } from "@dxos/react-ui-stack";
14
- var BlueprintArticle = ({ subject }) => {
15
- var _effect = _useSignals();
16
- try {
17
- const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
18
- return /* @__PURE__ */ React.createElement(StackItem.Content, {
19
- toolbar: true
20
- }, /* @__PURE__ */ React.createElement(Toolbar.Root, {
21
- disabled: !hasAttention
22
- }), /* @__PURE__ */ React.createElement(TemplateEditor, {
23
- id: subject.id,
24
- template: subject.instructions,
25
- classNames: "container-max-width"
26
- }));
27
- } finally {
28
- _effect.f();
29
- }
30
- };
31
- var BlueprintArticle_default = BlueprintArticle;
32
- export {
33
- BlueprintArticle,
34
- BlueprintArticle_default as default
35
- };
36
- //# sourceMappingURL=BlueprintArticle-BWSLH6LG.mjs.map