@dxos/plugin-assistant 0.8.4-main.f9ba587 → 0.8.4-main.fcc0d83b33

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 (719) hide show
  1. package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs +40 -0
  2. package/dist/lib/browser/AssistantSettings-GG52BLKS.mjs.map +7 -0
  3. package/dist/lib/browser/blueprints/index.mjs +31 -0
  4. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-RIJNPAYC.mjs +176 -0
  8. package/dist/lib/browser/chunk-RIJNPAYC.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-SEMCG4ZK.mjs +195 -0
  10. package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
  11. package/dist/lib/browser/cli/index.mjs +73 -0
  12. package/dist/lib/browser/cli/index.mjs.map +7 -0
  13. package/dist/lib/browser/create-chat-FZJASOQS.mjs +74 -0
  14. package/dist/lib/browser/create-chat-FZJASOQS.mjs.map +7 -0
  15. package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs +65 -0
  16. package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs.map +7 -0
  17. package/dist/lib/browser/index.mjs +3347 -242
  18. package/dist/lib/browser/index.mjs.map +4 -4
  19. package/dist/lib/browser/meta.json +1 -1
  20. package/dist/lib/browser/on-create-space-OQNCM7NC.mjs +22 -0
  21. package/dist/lib/browser/on-create-space-OQNCM7NC.mjs.map +7 -0
  22. package/dist/lib/browser/operations/index.mjs +13 -0
  23. package/dist/lib/browser/operations/index.mjs.map +7 -0
  24. package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs +22 -0
  25. package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs.map +7 -0
  26. package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs +107 -0
  27. package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs.map +7 -0
  28. package/dist/lib/browser/set-current-chat-7V4DA66I.mjs +54 -0
  29. package/dist/lib/browser/set-current-chat-7V4DA66I.mjs.map +7 -0
  30. package/dist/lib/browser/translations.mjs +171 -0
  31. package/dist/lib/browser/translations.mjs.map +7 -0
  32. package/dist/lib/browser/types/index.mjs +8 -16
  33. package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs +56 -0
  34. package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs.map +7 -0
  35. package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
  36. package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
  37. package/dist/lib/node-esm/blueprints/index.mjs +32 -0
  38. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  40. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs +177 -0
  42. package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs.map +7 -0
  43. package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +196 -0
  44. package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
  45. package/dist/lib/node-esm/cli/index.mjs +74 -0
  46. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  47. package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs +75 -0
  48. package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs.map +7 -0
  49. package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs +66 -0
  50. package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs.map +7 -0
  51. package/dist/lib/node-esm/index.mjs +3347 -242
  52. package/dist/lib/node-esm/index.mjs.map +4 -4
  53. package/dist/lib/node-esm/meta.json +1 -1
  54. package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs +23 -0
  55. package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs.map +7 -0
  56. package/dist/lib/node-esm/operations/index.mjs +14 -0
  57. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  58. package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs +23 -0
  59. package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs.map +7 -0
  60. package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs +108 -0
  61. package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs.map +7 -0
  62. package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs +55 -0
  63. package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs.map +7 -0
  64. package/dist/lib/node-esm/translations.mjs +172 -0
  65. package/dist/lib/node-esm/translations.mjs.map +7 -0
  66. package/dist/lib/node-esm/types/index.mjs +8 -16
  67. package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs +57 -0
  68. package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs.map +7 -0
  69. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  70. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  71. package/dist/types/src/blueprints/assistant/blueprint.d.ts +4 -0
  72. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -0
  73. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +2 -0
  74. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +1 -0
  75. package/dist/types/src/blueprints/assistant/index.d.ts +2 -0
  76. package/dist/types/src/blueprints/assistant/index.d.ts.map +1 -0
  77. package/dist/types/src/blueprints/index.d.ts +2 -0
  78. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/ai-service.d.ts +6 -0
  80. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  82. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
  84. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
  86. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/edge-model-resolver.d.ts +7 -0
  88. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/index.d.ts +29 -6
  90. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -0
  92. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/markdown.d.ts +5 -0
  94. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  96. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  98. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  100. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/settings.d.ts +4 -2
  102. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/state.d.ts +21 -0
  104. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/toolkit.d.ts +6 -0
  106. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  107. package/dist/types/src/cli/index.d.ts +2 -0
  108. package/dist/types/src/cli/index.d.ts.map +1 -0
  109. package/dist/types/src/cli/plugin.d.ts +10 -0
  110. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  111. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -4
  112. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  113. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
  114. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
  115. package/dist/types/src/components/AssistantSettings/index.d.ts +1 -1
  116. package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -1
  117. package/dist/types/src/components/Chat/Chat.d.ts +41 -29
  118. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  119. package/dist/types/src/components/Chat/context.d.ts +29 -0
  120. package/dist/types/src/components/Chat/context.d.ts.map +1 -0
  121. package/dist/types/src/components/Chat/events.d.ts +39 -0
  122. package/dist/types/src/components/Chat/events.d.ts.map +1 -0
  123. package/dist/types/src/components/Chat/index.d.ts +1 -0
  124. package/dist/types/src/components/Chat/index.d.ts.map +1 -1
  125. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +7 -5
  126. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  127. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +24 -0
  128. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
  129. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
  130. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
  131. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +11 -0
  132. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -0
  133. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
  134. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
  135. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
  136. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  137. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
  138. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
  139. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +7 -4
  140. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  141. package/dist/types/src/components/ChatPrompt/index.d.ts +4 -2
  142. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  143. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
  144. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
  145. package/dist/types/src/components/ChatThread/ChatThread.d.ts +16 -17
  146. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  147. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +25 -221
  148. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  149. package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
  150. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
  151. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
  152. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
  153. package/dist/types/src/components/ChatThread/registry.d.ts +29 -0
  154. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  155. package/dist/types/src/components/ChatThread/sync.d.ts +69 -0
  156. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  157. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  158. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  159. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
  160. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
  161. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
  162. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
  163. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
  164. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
  165. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
  166. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
  167. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
  168. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
  169. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
  170. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
  171. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
  172. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
  173. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
  174. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
  175. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
  176. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
  177. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
  178. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
  179. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
  180. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
  181. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
  182. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
  183. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
  184. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
  185. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
  186. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
  187. package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
  188. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
  189. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
  190. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
  191. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -0
  192. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
  193. package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
  194. package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
  195. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +9 -11
  196. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  197. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +13 -7
  198. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  199. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +16 -5
  200. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  201. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +10 -2
  202. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  203. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
  204. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  205. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  206. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  207. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  208. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  209. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +12 -0
  210. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  211. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  212. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  213. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  214. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  215. package/dist/types/src/components/Toolbox/Toolbox.d.ts +17 -21
  216. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  217. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +14 -5
  218. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  219. package/dist/types/src/components/index.d.ts +3 -8
  220. package/dist/types/src/components/index.d.ts.map +1 -1
  221. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
  222. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
  223. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
  224. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
  225. package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
  226. package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
  227. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
  228. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
  229. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
  230. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
  231. package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
  232. package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
  233. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +6 -0
  234. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -0
  235. package/dist/types/src/containers/BlueprintArticle/index.d.ts +2 -0
  236. package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -0
  237. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +18 -0
  238. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -0
  239. package/dist/types/src/containers/ChatCompanion/index.d.ts +2 -0
  240. package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -0
  241. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +12 -0
  242. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -0
  243. package/dist/types/src/containers/ChatContainer/index.d.ts +2 -0
  244. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -0
  245. package/dist/types/src/{components → containers/ChatDialog}/ChatDialog.d.ts +2 -3
  246. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -0
  247. package/dist/types/src/containers/ChatDialog/index.d.ts +2 -0
  248. package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -0
  249. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
  250. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
  251. package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
  252. package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
  253. package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
  254. package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
  255. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
  256. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
  257. package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
  258. package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
  259. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +8 -0
  260. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
  261. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +13 -0
  262. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
  263. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
  264. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
  265. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
  266. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
  267. package/dist/types/src/containers/TracePanel/execution-graph.d.ts +97 -0
  268. package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
  269. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
  270. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
  271. package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
  272. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
  273. package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
  274. package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
  275. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
  276. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
  277. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
  278. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
  279. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +5 -0
  280. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  281. package/dist/types/src/containers/TriggerStatus/index.d.ts +2 -0
  282. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -0
  283. package/dist/types/src/containers/index.d.ts +12 -0
  284. package/dist/types/src/containers/index.d.ts.map +1 -0
  285. package/dist/types/src/extensions/index.d.ts +2 -0
  286. package/dist/types/src/extensions/index.d.ts.map +1 -0
  287. package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
  288. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
  289. package/dist/types/src/hooks/index.d.ts +12 -5
  290. package/dist/types/src/hooks/index.d.ts.map +1 -1
  291. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
  292. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
  293. package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
  294. package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
  295. package/dist/types/src/hooks/useChatProcessor.d.ts +12 -24
  296. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  297. package/dist/types/src/hooks/useChatServices.d.ts +10 -0
  298. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -0
  299. package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
  300. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
  301. package/dist/types/src/hooks/useContextBinder.d.ts +5 -0
  302. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
  303. package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
  304. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
  305. package/dist/types/src/hooks/useDebug.d.ts +10 -0
  306. package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
  307. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  308. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  309. package/dist/types/src/hooks/useFlush.d.ts +6 -0
  310. package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
  311. package/dist/types/src/hooks/useOnline.d.ts +3 -0
  312. package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
  313. package/dist/types/src/hooks/usePresets.d.ts +7 -0
  314. package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
  315. package/dist/types/src/hooks/useReferencesProvider.d.ts +7 -0
  316. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -0
  317. package/dist/types/src/index.d.ts +1 -3
  318. package/dist/types/src/index.d.ts.map +1 -1
  319. package/dist/types/src/meta.d.ts +5 -4
  320. package/dist/types/src/meta.d.ts.map +1 -1
  321. package/dist/types/src/operations/create-chat.d.ts +5 -0
  322. package/dist/types/src/operations/create-chat.d.ts.map +1 -0
  323. package/dist/types/src/operations/definitions.d.ts +140 -0
  324. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  325. package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
  326. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
  327. package/dist/types/src/operations/index.d.ts +4 -0
  328. package/dist/types/src/operations/index.d.ts.map +1 -0
  329. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  330. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  331. package/dist/types/src/operations/prompt.test.d.ts +2 -0
  332. package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
  333. package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
  334. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
  335. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
  336. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
  337. package/dist/types/src/operations/set-current-chat.d.ts +5 -0
  338. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
  339. package/dist/types/src/operations/update-chat-name.d.ts +5 -0
  340. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
  341. package/dist/types/src/processor/index.d.ts +3 -0
  342. package/dist/types/src/processor/index.d.ts.map +1 -0
  343. package/dist/types/src/processor/presets.d.ts +13 -0
  344. package/dist/types/src/processor/presets.d.ts.map +1 -0
  345. package/dist/types/src/processor/processor.d.ts +80 -0
  346. package/dist/types/src/processor/processor.d.ts.map +1 -0
  347. package/dist/types/src/processor/processor.test.d.ts +2 -0
  348. package/dist/types/src/processor/processor.test.d.ts.map +1 -0
  349. package/dist/types/src/queue-logger.d.ts.map +1 -1
  350. package/dist/types/src/testing/index.d.ts +2 -1
  351. package/dist/types/src/testing/index.d.ts.map +1 -1
  352. package/dist/types/src/testing/test-generator.d.ts +8 -0
  353. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  354. package/dist/types/src/testing/test-generator.test.d.ts +2 -0
  355. package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
  356. package/dist/types/src/testing/test-sequence.d.ts +0 -4
  357. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  358. package/dist/types/src/testing/test-services.d.ts +2 -2
  359. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  360. package/dist/types/src/testing/test-trace.d.ts +5 -0
  361. package/dist/types/src/testing/test-trace.d.ts.map +1 -0
  362. package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
  363. package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
  364. package/dist/types/src/translations.d.ts +2 -64
  365. package/dist/types/src/translations.d.ts.map +1 -1
  366. package/dist/types/src/types/Assistant.d.ts +36 -0
  367. package/dist/types/src/types/Assistant.d.ts.map +1 -0
  368. package/dist/types/src/types/Settings.d.ts +26 -0
  369. package/dist/types/src/types/Settings.d.ts.map +1 -0
  370. package/dist/types/src/types/capabilities.d.ts +32 -0
  371. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  372. package/dist/types/src/types/events.d.ts +5 -0
  373. package/dist/types/src/types/events.d.ts.map +1 -0
  374. package/dist/types/src/types/index.d.ts +4 -2
  375. package/dist/types/src/types/index.d.ts.map +1 -1
  376. package/dist/types/src/types/service.d.ts +14 -213
  377. package/dist/types/src/types/service.d.ts.map +1 -1
  378. package/dist/types/tsconfig.tsbuildinfo +1 -1
  379. package/package.json +154 -100
  380. package/src/AssistantPlugin.tsx +226 -115
  381. package/src/blueprints/assistant/blueprint.test.ts +46 -0
  382. package/src/blueprints/assistant/blueprint.ts +31 -0
  383. package/src/blueprints/assistant/index.ts +5 -0
  384. package/src/{components/SequenceEditor → blueprints}/index.ts +1 -1
  385. package/src/capabilities/ai-service.ts +30 -0
  386. package/src/capabilities/app-graph-builder.ts +148 -238
  387. package/src/capabilities/blueprint-definition.ts +54 -0
  388. package/src/capabilities/companion-chat-provisioner.ts +164 -0
  389. package/src/capabilities/edge-model-resolver.ts +33 -0
  390. package/src/capabilities/index.ts +21 -8
  391. package/src/capabilities/local-model-resolver.ts +48 -0
  392. package/src/capabilities/markdown.ts +40 -0
  393. package/src/capabilities/migrations.ts +28 -0
  394. package/src/capabilities/operation-handler.ts +16 -0
  395. package/src/capabilities/react-surface.tsx +151 -121
  396. package/src/capabilities/settings.ts +24 -12
  397. package/src/capabilities/state.ts +35 -0
  398. package/src/capabilities/toolkit.ts +13 -0
  399. package/src/cli/index.ts +5 -0
  400. package/src/cli/plugin.ts +83 -0
  401. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
  402. package/src/components/AssistantSettings/AssistantSettings.tsx +29 -91
  403. package/src/components/AssistantSettings/index.ts +2 -2
  404. package/src/components/Chat/Chat.tsx +175 -253
  405. package/src/components/Chat/context.ts +39 -0
  406. package/src/components/Chat/events.ts +63 -0
  407. package/src/components/Chat/index.ts +2 -0
  408. package/src/components/ChatPrompt/ChatActions.tsx +47 -48
  409. package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
  410. package/src/components/ChatPrompt/ChatOptions.tsx +433 -0
  411. package/src/components/ChatPrompt/ChatPresets.tsx +29 -0
  412. package/src/components/ChatPrompt/ChatPrompt.tsx +179 -0
  413. package/src/components/ChatPrompt/ChatReferences.tsx +42 -37
  414. package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
  415. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +33 -17
  416. package/src/components/ChatPrompt/index.ts +4 -3
  417. package/src/components/ChatThread/Anchor.stories.tsx +95 -0
  418. package/src/components/ChatThread/ChatThread.stories.tsx +125 -130
  419. package/src/components/ChatThread/ChatThread.tsx +95 -50
  420. package/src/components/ChatThread/DEBUG.md +41 -0
  421. package/src/components/ChatThread/Link.tsx +26 -0
  422. package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
  423. package/src/components/ChatThread/registry.tsx +286 -0
  424. package/src/components/ChatThread/sync.test.ts +259 -0
  425. package/src/components/ChatThread/sync.ts +150 -0
  426. package/src/components/ChatThread/testing/reasoning.md +25 -0
  427. package/src/components/ChatThread/testing/thinking.md +21 -0
  428. package/src/components/ChatThread/testing/thread-1.md +30 -0
  429. package/src/components/ChatThread/testing/thread-2.md +56 -0
  430. package/src/components/ChatThread/testing/thread-widgets.md +79 -0
  431. package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
  432. package/src/components/ChatThread/tool-widget-state.ts +48 -0
  433. package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
  434. package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
  435. package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
  436. package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
  437. package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
  438. package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
  439. package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
  440. package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
  441. package/src/components/ChatThread/widgets/SummaryWidget.tsx +29 -0
  442. package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
  443. package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
  444. package/src/components/ChatThread/widgets/defaults.ts +8 -0
  445. package/src/components/ChatThread/widgets/index.ts +13 -0
  446. package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
  447. package/src/components/ProcessTree/ProcessTree.tsx +118 -0
  448. package/src/components/ProcessTree/index.ts +5 -0
  449. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +55 -43
  450. package/src/components/TemplateEditor/TemplateEditor.tsx +62 -60
  451. package/src/components/TemplateEditor/TemplateForm.stories.tsx +41 -26
  452. package/src/components/TemplateEditor/TemplateForm.tsx +123 -81
  453. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
  454. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  455. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  456. package/src/components/ToolBlock/ToolBlock.tsx +144 -0
  457. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  458. package/src/components/ToolBlock/index.ts +6 -0
  459. package/src/components/Toolbox/Toolbox.stories.tsx +18 -29
  460. package/src/components/Toolbox/Toolbox.tsx +88 -110
  461. package/src/components/index.ts +3 -11
  462. package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
  463. package/src/containers/AgentArticle/AgentArticle.tsx +200 -0
  464. package/src/containers/AgentArticle/index.ts +5 -0
  465. package/src/containers/AgentProperties/AgentProperties.stories.tsx +101 -0
  466. package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
  467. package/src/containers/AgentProperties/index.ts +5 -0
  468. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +29 -0
  469. package/src/containers/BlueprintArticle/index.ts +5 -0
  470. package/src/containers/ChatCompanion/ChatCompanion.tsx +142 -0
  471. package/src/containers/ChatCompanion/index.ts +5 -0
  472. package/src/containers/ChatContainer/ChatContainer.tsx +105 -0
  473. package/src/containers/ChatContainer/index.ts +5 -0
  474. package/src/containers/ChatDialog/ChatDialog.tsx +66 -0
  475. package/src/containers/ChatDialog/index.ts +5 -0
  476. package/src/containers/RoutineArticle/RoutineArticle.tsx +59 -0
  477. package/src/containers/RoutineArticle/index.ts +5 -0
  478. package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
  479. package/src/containers/RoutineList/RoutineList.tsx +50 -0
  480. package/src/containers/RoutineList/index.ts +5 -0
  481. package/src/containers/TracePanel/TracePanel.stories.tsx +278 -0
  482. package/src/containers/TracePanel/TracePanel.tsx +138 -0
  483. package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
  484. package/src/containers/TracePanel/dxn-extractor.ts +178 -0
  485. package/src/containers/TracePanel/execution-graph.test.ts +382 -0
  486. package/src/containers/TracePanel/execution-graph.ts +579 -0
  487. package/src/containers/TracePanel/index.ts +9 -0
  488. package/src/containers/TracePanel/testing/index.ts +6 -0
  489. package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
  490. package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
  491. package/src/containers/TriggerStatus/TriggerStatus.tsx +129 -0
  492. package/src/containers/TriggerStatus/index.ts +5 -0
  493. package/src/containers/index.ts +16 -0
  494. package/src/extensions/index.ts +5 -0
  495. package/src/extensions/prompt-extension.ts +111 -0
  496. package/src/hooks/index.ts +12 -6
  497. package/src/hooks/useBlueprintRegistry.ts +109 -0
  498. package/src/hooks/useChatKeymap.ts +52 -0
  499. package/src/hooks/useChatProcessor.ts +90 -0
  500. package/src/hooks/useChatServices.ts +26 -0
  501. package/src/hooks/useChatToolbarActions.ts +122 -0
  502. package/src/hooks/useContextBinder.ts +43 -0
  503. package/src/hooks/useContextObjects.ts +50 -0
  504. package/src/hooks/useDebug.ts +38 -0
  505. package/src/hooks/useFilteredTypes.ts +37 -0
  506. package/src/hooks/useFlush.ts +35 -0
  507. package/src/hooks/useOnline.ts +10 -0
  508. package/src/hooks/usePresets.ts +45 -0
  509. package/src/hooks/useReferencesProvider.ts +54 -0
  510. package/src/index.ts +1 -3
  511. package/src/meta.ts +15 -9
  512. package/src/operations/create-chat.ts +80 -0
  513. package/src/operations/definitions.ts +127 -0
  514. package/src/operations/ensure-companion-chat.ts +61 -0
  515. package/src/operations/index.ts +17 -0
  516. package/src/operations/on-create-space.ts +24 -0
  517. package/src/operations/prompt.test.ts +78 -0
  518. package/src/operations/resolve-navigation-targets.ts +26 -0
  519. package/src/operations/run-prompt-in-new-chat.ts +113 -0
  520. package/src/operations/set-current-chat.ts +50 -0
  521. package/src/operations/update-chat-name.ts +61 -0
  522. package/src/processor/index.ts +6 -0
  523. package/src/processor/presets.ts +68 -0
  524. package/src/processor/processor.test.ts +40 -0
  525. package/src/processor/processor.ts +321 -0
  526. package/src/queue-logger.ts +33 -23
  527. package/src/testing/data/trace-timeline.dx.json +4657 -0
  528. package/src/testing/index.ts +2 -1
  529. package/src/testing/test-generator.test.ts +81 -0
  530. package/src/testing/test-generator.ts +299 -0
  531. package/src/testing/test-sequence.ts +5 -32
  532. package/src/testing/test-services.ts +10 -14
  533. package/src/testing/test-trace.ts +20 -0
  534. package/src/testing/trace-timeline.conversations.json +1 -0
  535. package/src/testing/trace-timeline.test.ts +250 -0
  536. package/src/translations.ts +160 -55
  537. package/src/types/Assistant.ts +25 -0
  538. package/src/types/Settings.ts +76 -0
  539. package/src/types/capabilities.ts +35 -0
  540. package/src/types/events.ts +11 -0
  541. package/src/types/index.ts +7 -2
  542. package/src/types/service.ts +27 -16
  543. package/src/vite-env.d.ts +30 -0
  544. package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs +0 -57
  545. package/dist/lib/browser/ChatContainer-6XNB5NEI.mjs.map +0 -7
  546. package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs +0 -74
  547. package/dist/lib/browser/ChatDialog-IMWPRXTO.mjs.map +0 -7
  548. package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs +0 -322
  549. package/dist/lib/browser/SequenceContainer-6XOYB2RN.mjs.map +0 -7
  550. package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs +0 -28
  551. package/dist/lib/browser/TemplateContainer-6ZGGH5T4.mjs.map +0 -7
  552. package/dist/lib/browser/ai-client-ML7OQWAO.mjs +0 -39
  553. package/dist/lib/browser/ai-client-ML7OQWAO.mjs.map +0 -7
  554. package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs +0 -223
  555. package/dist/lib/browser/app-graph-builder-UJ5NHRGK.mjs.map +0 -7
  556. package/dist/lib/browser/chunk-44HZKIAW.mjs +0 -87
  557. package/dist/lib/browser/chunk-44HZKIAW.mjs.map +0 -7
  558. package/dist/lib/browser/chunk-LKP65RPA.mjs +0 -20
  559. package/dist/lib/browser/chunk-LKP65RPA.mjs.map +0 -7
  560. package/dist/lib/browser/chunk-NTBGTFTV.mjs +0 -15
  561. package/dist/lib/browser/chunk-NTBGTFTV.mjs.map +0 -7
  562. package/dist/lib/browser/chunk-OZL4OHTU.mjs +0 -157
  563. package/dist/lib/browser/chunk-OZL4OHTU.mjs.map +0 -7
  564. package/dist/lib/browser/chunk-TQ3QW3HJ.mjs +0 -2072
  565. package/dist/lib/browser/chunk-TQ3QW3HJ.mjs.map +0 -7
  566. package/dist/lib/browser/chunk-TU7UUGWQ.mjs +0 -203
  567. package/dist/lib/browser/chunk-TU7UUGWQ.mjs.map +0 -7
  568. package/dist/lib/browser/chunk-WPZ4UANI.mjs +0 -16
  569. package/dist/lib/browser/chunk-WPZ4UANI.mjs.map +0 -7
  570. package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs +0 -42
  571. package/dist/lib/browser/intent-resolver-LEAPB55Q.mjs.map +0 -7
  572. package/dist/lib/browser/react-surface-TMF7JJA4.mjs +0 -156
  573. package/dist/lib/browser/react-surface-TMF7JJA4.mjs.map +0 -7
  574. package/dist/lib/browser/settings-N4HEXADL.mjs +0 -22
  575. package/dist/lib/browser/settings-N4HEXADL.mjs.map +0 -7
  576. package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs +0 -58
  577. package/dist/lib/node-esm/ChatContainer-VOLG7J6N.mjs.map +0 -7
  578. package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs +0 -75
  579. package/dist/lib/node-esm/ChatDialog-B2XNUNRM.mjs.map +0 -7
  580. package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs +0 -323
  581. package/dist/lib/node-esm/SequenceContainer-WWG6IMN3.mjs.map +0 -7
  582. package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs +0 -29
  583. package/dist/lib/node-esm/TemplateContainer-6KRNEMVE.mjs.map +0 -7
  584. package/dist/lib/node-esm/ai-client-2FQ434CT.mjs +0 -40
  585. package/dist/lib/node-esm/ai-client-2FQ434CT.mjs.map +0 -7
  586. package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs +0 -224
  587. package/dist/lib/node-esm/app-graph-builder-MEQ5CYNI.mjs.map +0 -7
  588. package/dist/lib/node-esm/chunk-D3HTVK5D.mjs +0 -2073
  589. package/dist/lib/node-esm/chunk-D3HTVK5D.mjs.map +0 -7
  590. package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs +0 -16
  591. package/dist/lib/node-esm/chunk-E6V2RUQ2.mjs.map +0 -7
  592. package/dist/lib/node-esm/chunk-HVMVHP4R.mjs +0 -158
  593. package/dist/lib/node-esm/chunk-HVMVHP4R.mjs.map +0 -7
  594. package/dist/lib/node-esm/chunk-HXKRKIN2.mjs +0 -18
  595. package/dist/lib/node-esm/chunk-HXKRKIN2.mjs.map +0 -7
  596. package/dist/lib/node-esm/chunk-KOC6ESG7.mjs +0 -22
  597. package/dist/lib/node-esm/chunk-KOC6ESG7.mjs.map +0 -7
  598. package/dist/lib/node-esm/chunk-VESVUAOS.mjs +0 -88
  599. package/dist/lib/node-esm/chunk-VESVUAOS.mjs.map +0 -7
  600. package/dist/lib/node-esm/chunk-YYUVTTVK.mjs +0 -204
  601. package/dist/lib/node-esm/chunk-YYUVTTVK.mjs.map +0 -7
  602. package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs +0 -43
  603. package/dist/lib/node-esm/intent-resolver-4ULF3F7U.mjs.map +0 -7
  604. package/dist/lib/node-esm/react-surface-6XL6SWL2.mjs +0 -157
  605. package/dist/lib/node-esm/react-surface-6XL6SWL2.mjs.map +0 -7
  606. package/dist/lib/node-esm/settings-WQ76EG6O.mjs +0 -23
  607. package/dist/lib/node-esm/settings-WQ76EG6O.mjs.map +0 -7
  608. package/dist/types/src/capabilities/ai-client.d.ts +0 -5
  609. package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
  610. package/dist/types/src/capabilities/capabilities.d.ts +0 -6
  611. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  612. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  613. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  614. package/dist/types/src/components/ChatContainer.d.ts +0 -11
  615. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  616. package/dist/types/src/components/ChatDialog.d.ts.map +0 -1
  617. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
  618. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
  619. package/dist/types/src/components/ChatPrompt/events.d.ts +0 -17
  620. package/dist/types/src/components/ChatPrompt/events.d.ts.map +0 -1
  621. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -18
  622. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  623. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -18
  624. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  625. package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
  626. package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
  627. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  628. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  629. package/dist/types/src/components/SequenceContainer.d.ts +0 -9
  630. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  631. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  632. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  633. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
  634. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  635. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  636. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  637. package/dist/types/src/components/TemplateContainer.d.ts +0 -9
  638. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  639. package/dist/types/src/events.d.ts +0 -4
  640. package/dist/types/src/events.d.ts.map +0 -1
  641. package/dist/types/src/hooks/chat-processor.d.ts +0 -82
  642. package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
  643. package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
  644. package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
  645. package/dist/types/src/hooks/useBlueprints.d.ts +0 -4
  646. package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
  647. package/dist/types/src/hooks/useContextProvider.d.ts +0 -23
  648. package/dist/types/src/hooks/useContextProvider.d.ts.map +0 -1
  649. package/dist/types/src/hooks/useServiceContainer.d.ts +0 -8
  650. package/dist/types/src/hooks/useServiceContainer.d.ts.map +0 -1
  651. package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
  652. package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
  653. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  654. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  655. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  656. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  657. package/dist/types/src/parser/index.d.ts +0 -4
  658. package/dist/types/src/parser/index.d.ts.map +0 -1
  659. package/dist/types/src/parser/query-parser.d.ts +0 -15
  660. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  661. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  662. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  663. package/dist/types/src/parser/types.d.ts +0 -24
  664. package/dist/types/src/parser/types.d.ts.map +0 -1
  665. package/dist/types/src/stories/Chat.stories.d.ts +0 -199
  666. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  667. package/dist/types/src/testing/test-functions.d.ts +0 -3
  668. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  669. package/dist/types/src/tools/function.d.ts +0 -5
  670. package/dist/types/src/tools/function.d.ts.map +0 -1
  671. package/dist/types/src/tools/index.d.ts +0 -3
  672. package/dist/types/src/tools/index.d.ts.map +0 -1
  673. package/dist/types/src/tools/openapi.d.ts +0 -10
  674. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  675. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  676. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  677. package/dist/types/src/types/schema.d.ts +0 -71
  678. package/dist/types/src/types/schema.d.ts.map +0 -1
  679. package/dist/types/src/types/template.d.ts +0 -56
  680. package/dist/types/src/types/template.d.ts.map +0 -1
  681. package/src/capabilities/ai-client.ts +0 -39
  682. package/src/capabilities/capabilities.ts +0 -14
  683. package/src/capabilities/intent-resolver.ts +0 -45
  684. package/src/components/ChatContainer.tsx +0 -45
  685. package/src/components/ChatDialog.tsx +0 -65
  686. package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
  687. package/src/components/ChatPrompt/events.ts +0 -12
  688. package/src/components/ChatThread/ChatMessage.tsx +0 -238
  689. package/src/components/ChatThread/ToolBlock.tsx +0 -111
  690. package/src/components/ChatThread/reducer.ts +0 -52
  691. package/src/components/PromptSettings.tsx +0 -91
  692. package/src/components/SequenceContainer.tsx +0 -139
  693. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
  694. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  695. package/src/components/TemplateContainer.tsx +0 -25
  696. package/src/events.ts +0 -11
  697. package/src/hooks/chat-processor.test.ts +0 -15
  698. package/src/hooks/chat-processor.ts +0 -281
  699. package/src/hooks/useBlueprints.ts +0 -31
  700. package/src/hooks/useChatProcessor.tsx +0 -142
  701. package/src/hooks/useContextProvider.ts +0 -61
  702. package/src/hooks/useServiceContainer.ts +0 -42
  703. package/src/hooks/useTextInputEvents.ts +0 -49
  704. package/src/parser/filter-generator.test.ts +0 -32
  705. package/src/parser/filter-generator.ts +0 -81
  706. package/src/parser/index.ts +0 -7
  707. package/src/parser/query-parser.test.ts +0 -139
  708. package/src/parser/query-parser.ts +0 -199
  709. package/src/parser/types.ts +0 -34
  710. package/src/shims.d.ts +0 -8
  711. package/src/stories/Chat.stories.tsx +0 -269
  712. package/src/testing/test-functions.ts +0 -11
  713. package/src/tools/function.ts +0 -46
  714. package/src/tools/index.ts +0 -6
  715. package/src/tools/openapi.test.ts +0 -217
  716. package/src/tools/openapi.ts +0 -338
  717. package/src/types/schema.ts +0 -86
  718. package/src/types/template.ts +0 -66
  719. package/src/typings.d.ts +0 -9
@@ -2,251 +2,161 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Rx } from '@effect-rx/rx-react';
6
- import { Option, pipe } from 'effect';
7
-
8
- import {
9
- Capabilities,
10
- contributes,
11
- createIntent,
12
- LayoutAction,
13
- type PromiseIntentDispatcher,
14
- type PluginContext,
15
- } from '@dxos/app-framework';
5
+ import * as Effect from 'effect/Effect';
6
+ import { pipe } from 'effect/Function';
7
+ import * as Option from 'effect/Option';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+ import { AppCapabilities, AppNode, getActiveSpace, getPersonalSpace } from '@dxos/app-toolkit';
11
+ import { Chat } from '@dxos/assistant-toolkit';
12
+ import { Blueprint, Routine } from '@dxos/compute';
13
+ import { Operation } from '@dxos/compute';
16
14
  import { Sequence } from '@dxos/conductor';
17
- import { Obj } from '@dxos/echo';
15
+ import { DXN, Database, Filter, Obj, type Ref } from '@dxos/echo';
16
+ import { AtomObj } from '@dxos/echo-atom';
18
17
  import { invariant } from '@dxos/invariant';
19
- import { ClientCapabilities } from '@dxos/plugin-client';
20
- import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
21
- import { createExtension, ROOT_ID } from '@dxos/plugin-graph';
22
- import { getActiveSpace, rxFromQuery } from '@dxos/plugin-space';
23
- import { SPACE_TYPE, SpaceAction } from '@dxos/plugin-space/types';
24
- import {
25
- type Space,
26
- Filter,
27
- Query,
28
- type QueryResult,
29
- fullyQualifiedId,
30
- getSpace,
31
- isSpace,
32
- } from '@dxos/react-client/echo';
33
-
34
- import { ASSISTANT_DIALOG, meta } from '../meta';
35
- import { Assistant, TemplateType } from '../types';
36
-
37
- export default (context: PluginContext) =>
38
- contributes(Capabilities.AppGraphBuilder, [
39
- createExtension({
40
- id: `${meta.id}/assistant`,
41
- actions: (node) =>
42
- Rx.make((get) =>
43
- pipe(
44
- get(node),
45
- Option.flatMap((node) => (node.id === ROOT_ID ? Option.some(node) : Option.none())),
46
- Option.map(() => [
47
- {
48
- id: `${LayoutAction.UpdateDialog._tag}/assistant/open`,
49
- data: async () => {
50
- const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
51
- const client = context.getCapability(ClientCapabilities.Client);
52
- const space = getActiveSpace(context) ?? client.spaces.default;
53
- const chat = await getOrCreateChat(dispatch, space);
54
- if (!chat) {
55
- return;
56
- }
57
-
58
- await dispatch(
59
- createIntent(LayoutAction.UpdateDialog, {
60
- part: 'dialog',
61
- subject: ASSISTANT_DIALOG,
62
- options: {
63
- state: true,
64
- blockAlign: 'end',
65
- props: {
66
- chat,
67
- },
68
- },
69
- }),
70
- );
71
- },
72
- properties: {
73
- label: ['open assistant label', { ns: meta.id }],
74
- icon: 'ph--sparkle--regular',
75
- disposition: 'pin-end',
76
- position: 'hoist',
77
- keyBinding: {
78
- macos: 'shift+meta+k',
79
- windows: 'shift+ctrl+k',
80
- },
81
- },
18
+ import { AutomationCapabilities } from '@dxos/plugin-automation/types';
19
+ import { ClientCapabilities } from '@dxos/plugin-client/types';
20
+ import { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';
21
+ import { linkedSegment } from '@dxos/react-ui-attention';
22
+
23
+ import { ASSISTANT_COMPANION_VARIANT, meta } from '#meta';
24
+ import { AssistantOperation } from '#operations';
25
+ import { AssistantCapabilities } from '#types';
26
+
27
+ /** Match ECHO objects that are NOT chats. */
28
+ const whenNonChatObject = NodeMatcher.whenAll(
29
+ NodeMatcher.whenEchoObject,
30
+ NodeMatcher.whenNot(NodeMatcher.whenEchoTypeMatches(Chat.Chat)),
31
+ );
32
+
33
+ export default Capability.makeModule(
34
+ Effect.fnUntraced(function* () {
35
+ const capabilities = yield* Capability.Service;
36
+
37
+ const extensions = yield* Effect.all([
38
+ GraphBuilder.createTypeExtension({
39
+ id: 'root',
40
+ type: Chat.Chat,
41
+ actions: (chat) => {
42
+ return Effect.succeed([
43
+ Node.makeAction({
44
+ id: AssistantOperation.UpdateChatName.meta.key,
45
+ data: () =>
46
+ Effect.gen(function* () {
47
+ // TODO(dmaretskyi): This goes away when composer will have unified operation invocations.
48
+ const computeRuntime = yield* Capability.get(AutomationCapabilities.ComputeRuntime);
49
+ const db = Obj.getDatabase(chat);
50
+ invariant(db);
51
+ const runtime = yield* computeRuntime.getRuntime(db.spaceId).runtimeEffect;
52
+ yield* Operation.invoke(AssistantOperation.UpdateChatName, { chat }).pipe(Effect.provide(runtime));
53
+ }),
54
+ properties: {
55
+ label: ['chat-update-name.label', { ns: meta.id }],
56
+ icon: 'ph--magic-wand--regular',
57
+ disposition: 'list-item',
82
58
  },
83
- ]),
84
- Option.getOrElse(() => []),
85
- ),
86
- ),
87
- }),
88
-
89
- createExtension({
90
- id: `${meta.id}/object-chat-companion`,
91
- connector: (node) => {
92
- let query: QueryResult<Assistant.Chat> | undefined;
93
- return Rx.make((get) => {
94
- const nodeOption = get(node);
95
- if (Option.isNone(nodeOption)) {
96
- return [];
97
- }
98
-
99
- const object = nodeOption.value.data;
100
- if (!Obj.isObject(object)) {
101
- return [];
102
- }
103
-
104
- const space = getSpace(object);
105
- if (!space) {
106
- return [];
107
- }
108
-
109
- if (!query) {
110
- query = space.db.query(Query.select(Filter.ids(object.id)).targetOf(Assistant.CompanionTo).source());
111
- }
112
-
113
- const chat = get(rxFromQuery(query))[0];
114
- return [
115
- {
116
- id: [fullyQualifiedId(object), 'assistant-chat'].join(ATTENDABLE_PATH_SEPARATOR),
117
- type: PLANK_COMPANION_TYPE,
118
- data: chat ?? 'assistant-chat',
59
+ }),
60
+ ]);
61
+ },
62
+ }),
63
+
64
+ GraphBuilder.createExtension({
65
+ id: 'assistant',
66
+ match: NodeMatcher.whenRoot,
67
+ actions: () =>
68
+ Effect.succeed([
69
+ Node.makeAction({
70
+ id: 'reset-blueprints',
71
+ data: Effect.fnUntraced(function* () {
72
+ const capabilities = yield* Capability.Service;
73
+ const client = yield* Capability.get(ClientCapabilities.Client);
74
+ const space = getActiveSpace(client, capabilities) ?? getPersonalSpace(client);
75
+ if (!space) {
76
+ return;
77
+ }
78
+ const blueprints = yield* Effect.promise(
79
+ (): Promise<Blueprint.Blueprint[]> => space.db.query(Filter.type(Blueprint.Blueprint)).run(),
80
+ );
81
+ for (const blueprint of blueprints) {
82
+ space.db.remove(blueprint);
83
+ }
84
+ yield* Database.flush();
85
+ }),
119
86
  properties: {
120
- label: ['assistant chat label', { ns: meta.id }],
87
+ label: ['reset-blueprints.label', { ns: meta.id }],
88
+ icon: 'ph--arrow-clockwise--regular',
89
+ },
90
+ }),
91
+ ]),
92
+ }),
93
+
94
+ // Don't show assistant companion when a chat is already the primary object.
95
+ GraphBuilder.createExtension({
96
+ id: 'companion-chat',
97
+ match: whenNonChatObject,
98
+ connector: (object, get) =>
99
+ Effect.gen(function* () {
100
+ const state = get(yield* Capability.get(AssistantCapabilities.State));
101
+ const cache = get(yield* Capability.get(AssistantCapabilities.CompanionChatCache));
102
+ const objectDxn = Obj.getDXN(object).toString();
103
+
104
+ // Resolve chat from persisted state or transient cache.
105
+ const chat = pipe(
106
+ Option.fromNullable(state.currentChat[objectDxn]),
107
+ Option.flatMap((dxnStr) => Option.fromNullable(DXN.tryParse(dxnStr))),
108
+ Option.flatMap((dxn) => Option.fromNullable(Obj.getDatabase(object)?.makeRef(dxn))),
109
+ Option.map((ref) => get(AtomObj.make(ref as Ref.Ref<Obj.Unknown>))),
110
+ Option.filter(Obj.isObject),
111
+ Option.orElse(() => pipe(Option.fromNullable(cache[objectDxn]), Option.filter(Obj.isObject))),
112
+ Option.getOrNull,
113
+ );
114
+
115
+ return [
116
+ AppNode.makeCompanion({
117
+ id: linkedSegment(ASSISTANT_COMPANION_VARIANT),
118
+ label: ['assistant-chat.label', { ns: meta.id }],
121
119
  icon: 'ph--sparkle--regular',
120
+ data: chat,
122
121
  position: 'hoist',
123
- disposition: 'hidden',
124
- },
125
- },
126
- ];
127
- });
128
- },
129
- }),
130
-
131
- createExtension({
132
- id: `${meta.id}/sequence-logs`,
133
- connector: (node) =>
134
- Rx.make((get) =>
135
- pipe(
136
- get(node),
137
- Option.flatMap((node) => (Obj.instanceOf(Sequence, node.data) ? Option.some(node) : Option.none())),
138
- Option.map((node) => [
139
- {
140
- id: [node.id, 'logs'].join(ATTENDABLE_PATH_SEPARATOR),
141
- type: PLANK_COMPANION_TYPE,
142
- data: 'logs',
143
- properties: {
144
- label: ['sequence logs label', { ns: meta.id }],
145
- icon: 'ph--clock-countdown--regular',
146
- disposition: 'hidden',
147
- },
148
- },
149
- ]),
150
- Option.getOrElse(() => []),
151
- ),
122
+ }),
123
+ ];
124
+ }),
125
+ }),
126
+
127
+ GraphBuilder.createExtension({
128
+ id: 'invocations',
129
+ match: NodeMatcher.whenAny(
130
+ NodeMatcher.whenEchoTypeMatches(Sequence),
131
+ NodeMatcher.whenEchoTypeMatches(Routine.Routine),
152
132
  ),
153
- }),
154
-
155
- createExtension({
156
- id: `${meta.id}/root`,
157
- connector: (node) => {
158
- let query: QueryResult<TemplateType> | undefined;
159
- return Rx.make((get) =>
160
- pipe(
161
- get(node),
162
- Option.flatMap((node) =>
163
- node.type === SPACE_TYPE && isSpace(node.data) ? Option.some(node.data) : Option.none(),
164
- ),
165
- Option.map((space) => {
166
- if (!query) {
167
- query = space.db.query(Query.type(TemplateType));
168
- }
169
-
170
- const templates = get(rxFromQuery(query));
171
- return templates.length > 0
172
- ? [
173
- {
174
- id: `${meta.id}/templates`,
175
- type: `${meta.id}/templates`,
176
- data: null,
177
- properties: {
178
- label: ['templates label', { ns: meta.id }],
179
- icon: 'ph--file-code--regular',
180
- space,
181
- },
182
- },
183
- ]
184
- : [];
133
+ connector: () =>
134
+ Effect.succeed([
135
+ AppNode.makeCompanion({
136
+ id: 'invocations',
137
+ label: ['invocations.label', { ns: meta.id }],
138
+ icon: 'ph--clock-countdown--regular',
139
+ data: 'invocations',
185
140
  }),
186
- Option.getOrElse(() => []),
187
- ),
188
- );
189
- },
190
- }),
191
-
192
- createExtension({
193
- id: `${meta.id}/templates`,
194
- connector: (node) => {
195
- let query: QueryResult<TemplateType> | undefined;
196
- return Rx.make((get) =>
197
- pipe(
198
- get(node),
199
- Option.flatMap((node) =>
200
- node.id === `${meta.id}/templates` && isSpace(node.properties.space)
201
- ? Option.some(node.properties.space)
202
- : Option.none(),
203
- ),
204
- Option.map((space) => {
205
- if (!query) {
206
- query = space.db.query(Query.type(TemplateType));
207
- }
208
- return get(rxFromQuery(query))
209
- .toSorted((a, b) => {
210
- const nameA = a.name ?? '';
211
- const nameB = b.name ?? '';
212
- return nameA.localeCompare(nameB);
213
- })
214
- .map((template) => ({
215
- id: fullyQualifiedId(template),
216
- type: `${meta.id}/template`,
217
- data: template,
218
- properties: {
219
- label: template.name ?? ['object placeholder', { ns: meta.id }],
220
- icon: 'ph--file-code--regular',
221
- },
222
- }));
141
+ ]),
142
+ }),
143
+
144
+ GraphBuilder.createExtension({
145
+ id: 'trace',
146
+ match: NodeMatcher.whenRoot,
147
+ connector: () =>
148
+ Effect.succeed([
149
+ AppNode.makeDeckCompanion({
150
+ id: linkedSegment('trace'),
151
+ label: ['trace.label', { ns: meta.id }],
152
+ icon: 'ph--line-segments--regular',
153
+ data: 'trace' as const,
154
+ position: 'fallback',
223
155
  }),
224
- Option.getOrElse(() => []),
225
- ),
226
- );
227
- },
228
- }),
229
- ]);
230
-
231
- // TODO(burdon): Factor out.
232
- const getOrCreateChat = async (
233
- dispatch: PromiseIntentDispatcher,
234
- space: Space,
235
- ): Promise<Assistant.Chat | undefined> => {
236
- // TODO(wittjosiah): This should be possible with a single query.
237
- const { objects: allChats } = await space.db.query(Query.type(Assistant.Chat)).run();
238
- const { objects: relatedChats } = await space.db
239
- .query(Query.type(Assistant.Chat).sourceOf(Assistant.CompanionTo).source())
240
- .run();
241
- const chats = allChats.filter((chat) => !relatedChats.includes(chat));
242
- // console.log('objects', JSON.stringify(objects, null, 2));
243
- if (chats.length > 0) {
244
- // TODO(burdon): Is this the most recent?
245
- return chats[chats.length - 1];
246
- }
156
+ ]),
157
+ }),
158
+ ]);
247
159
 
248
- const { data } = await dispatch(createIntent(Assistant.CreateChat, { space }));
249
- invariant(Obj.instanceOf(Assistant.Chat, data?.object));
250
- await dispatch(createIntent(SpaceAction.AddObject, { target: space, object: data.object }));
251
- return data.object;
252
- };
160
+ return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
161
+ }),
162
+ );
@@ -0,0 +1,54 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import { AppCapabilities } from '@dxos/app-toolkit';
9
+ import {
10
+ AgentBlueprint,
11
+ AgentBlueprintHandlers,
12
+ AgentHandlers,
13
+ AgentWizardBlueprint,
14
+ AgentWizardHandlers,
15
+ BlueprintManagerBlueprint,
16
+ BlueprintManagerHandlers,
17
+ BrowserBlueprint,
18
+ DatabaseBlueprint,
19
+ DatabaseHandlers,
20
+ DiscordBlueprint,
21
+ LinearBlueprint,
22
+ PlanningBlueprint,
23
+ WebSearchBlueprint,
24
+ MemoryBlueprint,
25
+ AutomationBlueprint,
26
+ } from '@dxos/assistant-toolkit';
27
+
28
+ import { AssistantBlueprint } from '#blueprints';
29
+
30
+ // TODO(dmaretskyi): Force this type for all Capability.makeModule calls.
31
+ const blueprintDefinition: () => Effect.Effect<Capability.Capability<unknown>[]> = Capability.makeModule(() =>
32
+ Effect.succeed([
33
+ Capability.contributes(AppCapabilities.BlueprintDefinition, AssistantBlueprint),
34
+ Capability.contributes(AppCapabilities.BlueprintDefinition, BrowserBlueprint),
35
+ Capability.contributes(AppCapabilities.BlueprintDefinition, DatabaseBlueprint),
36
+ Capability.contributes(AppCapabilities.BlueprintDefinition, WebSearchBlueprint),
37
+ Capability.contributes(AppCapabilities.BlueprintDefinition, DiscordBlueprint),
38
+ Capability.contributes(AppCapabilities.BlueprintDefinition, LinearBlueprint),
39
+ Capability.contributes(AppCapabilities.BlueprintDefinition, AgentBlueprint),
40
+ Capability.contributes(AppCapabilities.BlueprintDefinition, PlanningBlueprint),
41
+ Capability.contributes(AppCapabilities.BlueprintDefinition, MemoryBlueprint),
42
+ Capability.contributes(AppCapabilities.BlueprintDefinition, AutomationBlueprint),
43
+ Capability.contributes(AppCapabilities.BlueprintDefinition, BlueprintManagerBlueprint),
44
+ Capability.contributes(AppCapabilities.BlueprintDefinition, AgentWizardBlueprint),
45
+
46
+ Capability.contributes(Capabilities.OperationHandler, AgentHandlers),
47
+ Capability.contributes(Capabilities.OperationHandler, AgentBlueprintHandlers),
48
+ Capability.contributes(Capabilities.OperationHandler, BlueprintManagerHandlers),
49
+ Capability.contributes(Capabilities.OperationHandler, DatabaseHandlers),
50
+ Capability.contributes(Capabilities.OperationHandler, AgentWizardHandlers),
51
+ ]),
52
+ );
53
+
54
+ export default blueprintDefinition;
@@ -0,0 +1,164 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type Registry } from '@effect-atom/atom-react';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Option from 'effect/Option';
8
+
9
+ import { Capabilities, Capability } from '@dxos/app-framework';
10
+ import { Graph, type Node } from '@dxos/app-graph';
11
+ import { AppCapabilities } from '@dxos/app-toolkit';
12
+ import { Chat } from '@dxos/assistant-toolkit';
13
+ import { Obj } from '@dxos/echo';
14
+ import { log } from '@dxos/log';
15
+ import { DeckCapabilities, PLANK_COMPANION_TYPE, type StoredDeckState } from '@dxos/plugin-deck/types';
16
+ import { getLinkedVariant } from '@dxos/react-ui-attention';
17
+ import { byPosition } from '@dxos/util';
18
+
19
+ import { ASSISTANT_COMPANION_VARIANT } from '#meta';
20
+ import { AssistantOperation } from '#operations';
21
+ import { AssistantCapabilities } from '#types';
22
+
23
+ /**
24
+ * Non-React capability that watches deck companion state and provisions transient chats
25
+ * for active planks when the assistant companion is selected.
26
+ */
27
+ export default Capability.makeModule(
28
+ Effect.fnUntraced(function* () {
29
+ const operationInvoker = yield* Capability.get(Capabilities.OperationInvoker);
30
+ const { graph } = yield* Capability.get(AppCapabilities.AppGraph);
31
+ const registry: Registry.Registry = yield* Capability.get(Capabilities.AtomRegistry);
32
+ const deckStateAtom = yield* Capability.get(DeckCapabilities.State);
33
+ const cacheAtom = yield* Capability.get(AssistantCapabilities.CompanionChatCache);
34
+ const stateAtom = yield* Capability.get(AssistantCapabilities.State);
35
+
36
+ const plankSubs = new Map<string, () => void>();
37
+
38
+ /** Unsubscribe a single plank and remove it from the map. */
39
+ const unsubPlank = (plankId: string) => {
40
+ plankSubs.get(plankId)?.();
41
+ plankSubs.delete(plankId);
42
+ };
43
+
44
+ /** Unsubscribe all per-plank subscriptions. */
45
+ const unsubAllPlanks = () => {
46
+ for (const unsub of plankSubs.values()) {
47
+ unsub();
48
+ }
49
+ plankSubs.clear();
50
+ };
51
+
52
+ /**
53
+ * Attempt to provision for a single plank.
54
+ * Returns true when the plank is resolved (provisioned or already cached)
55
+ * so the caller can tear down the connection subscription.
56
+ */
57
+ const provisionForPlank = (plankId: string, companionVariant: string | undefined): boolean => {
58
+ const node: Node.Node | null = Graph.getNode(graph, plankId).pipe(Option.getOrNull);
59
+ if (!node || !Obj.isObject(node.data) || Obj.instanceOf(Chat.Chat, node.data)) {
60
+ return false;
61
+ }
62
+
63
+ if (resolveEffectiveVariant(graph, plankId, companionVariant) !== ASSISTANT_COMPANION_VARIANT) {
64
+ return false;
65
+ }
66
+
67
+ const object = node.data;
68
+ const companionDxn = Obj.getDXN(object).toString();
69
+ const cache = registry.get(cacheAtom);
70
+ if (cache[companionDxn]) {
71
+ return true;
72
+ }
73
+
74
+ const db = Obj.getDatabase(object);
75
+ if (!db) {
76
+ return false;
77
+ }
78
+
79
+ void operationInvoker
80
+ .invokePromise(AssistantOperation.EnsureCompanionChat, { db, companionTo: object })
81
+ .catch((error) => log.warn('Failed to provision companion chat', { plankId, error }));
82
+
83
+ return false;
84
+ };
85
+
86
+ const provision = () => {
87
+ const deckState: StoredDeckState = registry.get(deckStateAtom);
88
+ const deck = deckState.decks[deckState.activeDeck];
89
+ if (!deck?.companionOpen) {
90
+ unsubAllPlanks();
91
+ return;
92
+ }
93
+
94
+ const plankIds = new Set(deck.solo ? [deck.solo] : deck.active);
95
+
96
+ // Remove subscriptions for planks that are no longer active.
97
+ for (const trackedId of plankSubs.keys()) {
98
+ if (!plankIds.has(trackedId)) {
99
+ unsubPlank(trackedId);
100
+ }
101
+ }
102
+
103
+ for (const plankId of plankIds) {
104
+ const resolved = provisionForPlank(plankId, deck.companionVariant);
105
+
106
+ if (resolved) {
107
+ // Already provisioned — no need to watch connections.
108
+ unsubPlank(plankId);
109
+ } else if (!plankSubs.has(plankId)) {
110
+ // Not yet resolved — subscribe to child connections so we re-try
111
+ // when graph builder extensions add companion nodes (after expand).
112
+ plankSubs.set(
113
+ plankId,
114
+ registry.subscribe(graph.connections(plankId, 'child'), () => {
115
+ if (provisionForPlank(plankId, deck.companionVariant)) {
116
+ unsubPlank(plankId);
117
+ }
118
+ }),
119
+ );
120
+ }
121
+ }
122
+ };
123
+
124
+ provision();
125
+
126
+ const unsub1 = registry.subscribe(deckStateAtom, provision);
127
+ const unsub2 = registry.subscribe(stateAtom, provision);
128
+
129
+ return Capability.contributes(Capabilities.Null, null, () =>
130
+ Effect.sync(() => {
131
+ unsub1();
132
+ unsub2();
133
+ unsubAllPlanks();
134
+ }),
135
+ );
136
+ }),
137
+ );
138
+
139
+ /**
140
+ * Mirrors useSelectedCompanion fallback logic outside of React.
141
+ * Returns the variant that would actually be rendered for a given plank.
142
+ */
143
+ const resolveEffectiveVariant = (
144
+ graph: Graph.BaseGraph,
145
+ plankId: string,
146
+ preferredVariant: string | undefined,
147
+ ): string | undefined => {
148
+ const companions = Graph.getConnections(graph, plankId, 'child')
149
+ .filter((node) => node.type === PLANK_COMPANION_TYPE)
150
+ .toSorted((a, b) => byPosition(a.properties, b.properties));
151
+
152
+ if (companions.length === 0) {
153
+ return undefined;
154
+ }
155
+
156
+ if (preferredVariant) {
157
+ const preferred = companions.find((companion) => getLinkedVariant(companion.id) === preferredVariant);
158
+ if (preferred) {
159
+ return getLinkedVariant(preferred.id);
160
+ }
161
+ }
162
+
163
+ return getLinkedVariant(companions[0].id);
164
+ };
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as AnthropicClient from '@effect/ai-anthropic/AnthropicClient';
6
+ import * as FetchHttpClient from '@effect/platform/FetchHttpClient';
7
+ import * as Effect from 'effect/Effect';
8
+ import * as Layer from 'effect/Layer';
9
+
10
+ import { AnthropicResolver } from '@dxos/ai/resolvers';
11
+ import { Capability } from '@dxos/app-framework';
12
+ import { AppCapabilities } from '@dxos/app-toolkit';
13
+
14
+ export type EdgeModelResolverCapabilities = [Capability.Capability<typeof AppCapabilities.AiModelResolver>];
15
+
16
+ const edgeModelResolver = Capability.makeModule<[], EdgeModelResolverCapabilities>(() =>
17
+ Effect.succeed([
18
+ Capability.contributes(
19
+ AppCapabilities.AiModelResolver,
20
+ AnthropicResolver.make().pipe(
21
+ Layer.provide(
22
+ AnthropicClient.layer({
23
+ // TODO(dmaretskyi): Read endpoint from config/settings.
24
+ apiUrl: 'https://ai-service.dxos.workers.dev/provider/anthropic',
25
+ }),
26
+ ),
27
+ Layer.provide(FetchHttpClient.layer),
28
+ ),
29
+ ),
30
+ ]),
31
+ );
32
+
33
+ export default edgeModelResolver;