@dxos/plugin-assistant 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8

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 (751) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +439 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/AgentArticle-K7XM46OQ.mjs +160 -0
  5. package/dist/lib/neutral/AgentArticle-K7XM46OQ.mjs.map +7 -0
  6. package/dist/lib/neutral/AgentProperties-LFTEYJ54.mjs +40 -0
  7. package/dist/lib/neutral/AgentProperties-LFTEYJ54.mjs.map +7 -0
  8. package/dist/lib/neutral/AssistantPlugin.mjs +10 -0
  9. package/dist/lib/neutral/AssistantPlugin.node.mjs +72 -0
  10. package/dist/lib/neutral/AssistantPlugin.node.mjs.map +7 -0
  11. package/dist/lib/neutral/AssistantPlugin.workerd.mjs +40 -0
  12. package/dist/lib/neutral/AssistantPlugin.workerd.mjs.map +7 -0
  13. package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs +40 -0
  14. package/dist/lib/neutral/AssistantSettings-GG52BLKS.mjs.map +7 -0
  15. package/dist/lib/neutral/BlueprintArticle-ZBOZNZM7.mjs +27 -0
  16. package/dist/lib/neutral/BlueprintArticle-ZBOZNZM7.mjs.map +7 -0
  17. package/dist/lib/neutral/ChatArticle-VNVZCDUR.mjs +8 -0
  18. package/dist/lib/neutral/ChatCompanion-LBUHYWQG.mjs +128 -0
  19. package/dist/lib/neutral/ChatCompanion-LBUHYWQG.mjs.map +7 -0
  20. package/dist/lib/neutral/ChatDialog-DCA6FLOV.mjs +73 -0
  21. package/dist/lib/neutral/ChatDialog-DCA6FLOV.mjs.map +7 -0
  22. package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs +28 -0
  23. package/dist/lib/neutral/PlanArticle-TS5ULWYS.mjs.map +7 -0
  24. package/dist/lib/neutral/RoutineArticle-5NYXHRG6.mjs +119 -0
  25. package/dist/lib/neutral/RoutineArticle-5NYXHRG6.mjs.map +7 -0
  26. package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs +48 -0
  27. package/dist/lib/neutral/RoutineList-SO5ETHNT.mjs.map +7 -0
  28. package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs +17 -0
  29. package/dist/lib/neutral/RoutineProperties-FISLMW2R.mjs.map +7 -0
  30. package/dist/lib/neutral/TracePanel-KTZJ6JNR.mjs +167 -0
  31. package/dist/lib/neutral/TracePanel-KTZJ6JNR.mjs.map +7 -0
  32. package/dist/lib/neutral/TriggerStatus-X7Y5JFZJ.mjs +93 -0
  33. package/dist/lib/neutral/TriggerStatus-X7Y5JFZJ.mjs.map +7 -0
  34. package/dist/lib/neutral/agent-hydrator-PJBYVMBW.mjs +24 -0
  35. package/dist/lib/neutral/agent-hydrator-PJBYVMBW.mjs.map +7 -0
  36. package/dist/lib/neutral/agent-service-WCAP5MLI.mjs +32 -0
  37. package/dist/lib/neutral/agent-service-WCAP5MLI.mjs.map +7 -0
  38. package/dist/lib/neutral/ai-context-7WRHWYXY.mjs +42 -0
  39. package/dist/lib/neutral/ai-context-7WRHWYXY.mjs.map +7 -0
  40. package/dist/lib/neutral/ai-service-AADUIKBY.mjs +40 -0
  41. package/dist/lib/neutral/ai-service-AADUIKBY.mjs.map +7 -0
  42. package/dist/lib/neutral/app-graph-builder-WUFHQH3Y.mjs +232 -0
  43. package/dist/lib/neutral/app-graph-builder-WUFHQH3Y.mjs.map +7 -0
  44. package/dist/lib/neutral/automation-templates-M2XQWGR6.mjs +115 -0
  45. package/dist/lib/neutral/automation-templates-M2XQWGR6.mjs.map +7 -0
  46. package/dist/lib/neutral/blueprint-definition-MH2QLYQH.mjs +39 -0
  47. package/dist/lib/neutral/blueprint-definition-MH2QLYQH.mjs.map +7 -0
  48. package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -1
  49. package/dist/lib/neutral/capabilities/index.mjs +45 -0
  50. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  51. package/dist/lib/{browser/chunk-EZRS3J25.mjs → neutral/chunk-5H6UJHLF.mjs} +3 -3
  52. package/dist/lib/neutral/chunk-5H6UJHLF.mjs.map +7 -0
  53. package/dist/lib/neutral/chunk-HLANPOBA.mjs +10 -0
  54. package/dist/lib/neutral/chunk-HLANPOBA.mjs.map +7 -0
  55. package/dist/lib/neutral/chunk-KLYLW4WH.mjs +9 -0
  56. package/dist/lib/neutral/chunk-KLYLW4WH.mjs.map +7 -0
  57. package/dist/lib/neutral/chunk-QAZMOFPI.mjs +130 -0
  58. package/dist/lib/neutral/chunk-QAZMOFPI.mjs.map +7 -0
  59. package/dist/lib/neutral/chunk-RKVVK3R3.mjs +110 -0
  60. package/dist/lib/neutral/chunk-RKVVK3R3.mjs.map +7 -0
  61. package/dist/lib/neutral/chunk-SMFJD7BP.mjs +8 -0
  62. package/dist/lib/neutral/chunk-SMFJD7BP.mjs.map +7 -0
  63. package/dist/lib/neutral/chunk-VTK5R4H3.mjs +9 -0
  64. package/dist/lib/neutral/chunk-VTK5R4H3.mjs.map +7 -0
  65. package/dist/lib/neutral/chunk-XYHPOGTK.mjs +43 -0
  66. package/dist/lib/neutral/chunk-XYHPOGTK.mjs.map +7 -0
  67. package/dist/lib/neutral/chunk-YXRGZYYH.mjs +392 -0
  68. package/dist/lib/neutral/chunk-YXRGZYYH.mjs.map +7 -0
  69. package/dist/lib/neutral/companion-chat-provisioner-YZZ73P6E.mjs +120 -0
  70. package/dist/lib/neutral/companion-chat-provisioner-YZZ73P6E.mjs.map +7 -0
  71. package/dist/lib/neutral/components/index.mjs +2410 -0
  72. package/dist/lib/neutral/components/index.mjs.map +7 -0
  73. package/dist/lib/neutral/containers/index.mjs +29 -0
  74. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  75. package/dist/lib/neutral/create-chat-SGGQ6HVN.mjs +54 -0
  76. package/dist/lib/neutral/create-chat-SGGQ6HVN.mjs.map +7 -0
  77. package/dist/lib/neutral/create-object-U2SOFZLR.mjs +92 -0
  78. package/dist/lib/neutral/create-object-U2SOFZLR.mjs.map +7 -0
  79. package/dist/lib/neutral/edge-model-resolver-BBVOJBGJ.mjs +55 -0
  80. package/dist/lib/neutral/edge-model-resolver-BBVOJBGJ.mjs.map +7 -0
  81. package/dist/lib/{browser/ensure-companion-chat-ZEZA34MZ.mjs → neutral/ensure-companion-chat-AMOF3C66.mjs} +14 -21
  82. package/dist/lib/neutral/ensure-companion-chat-AMOF3C66.mjs.map +7 -0
  83. package/dist/lib/neutral/execution-graph/index.mjs +703 -0
  84. package/dist/lib/neutral/execution-graph/index.mjs.map +7 -0
  85. package/dist/lib/neutral/fork-chat-34KEF4ZJ.mjs +95 -0
  86. package/dist/lib/neutral/fork-chat-34KEF4ZJ.mjs.map +7 -0
  87. package/dist/lib/neutral/hooks/index.mjs +992 -0
  88. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  89. package/dist/lib/neutral/index.mjs +38 -0
  90. package/dist/lib/neutral/integration-provider-RBD3AFJU.mjs +71 -0
  91. package/dist/lib/neutral/integration-provider-RBD3AFJU.mjs.map +7 -0
  92. package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs +24 -0
  93. package/dist/lib/neutral/local-model-resolver-I2BENFFS.mjs.map +7 -0
  94. package/dist/lib/neutral/markdown-extension-YMIFDMYF.mjs +110 -0
  95. package/dist/lib/neutral/markdown-extension-YMIFDMYF.mjs.map +7 -0
  96. package/dist/lib/neutral/meta.json +1 -0
  97. package/dist/lib/neutral/meta.mjs +12 -0
  98. package/dist/lib/neutral/migrations-7DEMVBOG.mjs +28 -0
  99. package/dist/lib/neutral/migrations-7DEMVBOG.mjs.map +7 -0
  100. package/dist/lib/neutral/operation-handler-SF36MOB5.mjs +13 -0
  101. package/dist/lib/neutral/operation-handler-SF36MOB5.mjs.map +7 -0
  102. package/dist/lib/neutral/operations/index.mjs +8 -0
  103. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  104. package/dist/lib/neutral/plugin.mjs +16 -0
  105. package/dist/lib/neutral/plugin.mjs.map +7 -0
  106. package/dist/lib/neutral/react-surface-XRTBW5OJ.mjs +174 -0
  107. package/dist/lib/neutral/react-surface-XRTBW5OJ.mjs.map +7 -0
  108. package/dist/lib/{browser/resolve-navigation-targets-NZOD66NY.mjs → neutral/resolve-navigation-targets-ZHIMMH7L.mjs} +6 -6
  109. package/dist/lib/neutral/resolve-navigation-targets-ZHIMMH7L.mjs.map +7 -0
  110. package/dist/lib/{browser/run-prompt-in-new-chat-THLK5YQC.mjs → neutral/run-prompt-in-new-chat-D5IIE2C7.mjs} +22 -56
  111. package/dist/lib/neutral/run-prompt-in-new-chat-D5IIE2C7.mjs.map +7 -0
  112. package/dist/lib/{browser/set-current-chat-LRS3VFSH.mjs → neutral/set-current-chat-VWBPSIMZ.mjs} +7 -13
  113. package/dist/lib/neutral/set-current-chat-VWBPSIMZ.mjs.map +7 -0
  114. package/dist/lib/neutral/settings-W4BLWQ53.mjs +28 -0
  115. package/dist/lib/neutral/settings-W4BLWQ53.mjs.map +7 -0
  116. package/dist/lib/neutral/state-H3G7QCU6.mjs +28 -0
  117. package/dist/lib/neutral/state-H3G7QCU6.mjs.map +7 -0
  118. package/dist/lib/neutral/testing.mjs +8 -0
  119. package/dist/lib/neutral/testing.mjs.map +7 -0
  120. package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs +21 -0
  121. package/dist/lib/neutral/toggle-trace-panel-debug-JGTB6KVJ.mjs.map +7 -0
  122. package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs +14 -0
  123. package/dist/lib/neutral/toolkit-GVWXPDLJ.mjs.map +7 -0
  124. package/dist/lib/neutral/translations.mjs +179 -0
  125. package/dist/lib/neutral/translations.mjs.map +7 -0
  126. package/dist/lib/neutral/types/index.mjs +20 -0
  127. package/dist/lib/neutral/types/index.mjs.map +7 -0
  128. package/dist/lib/{browser/update-chat-name-3Y36KFAS.mjs → neutral/update-chat-name-Y7JWIP64.mjs} +26 -36
  129. package/dist/lib/neutral/update-chat-name-Y7JWIP64.mjs.map +7 -0
  130. package/dist/types/src/AssistantPlugin.d.ts +3 -1
  131. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  132. package/dist/types/src/AssistantPlugin.node.d.ts +5 -0
  133. package/dist/types/src/AssistantPlugin.node.d.ts.map +1 -0
  134. package/dist/types/src/AssistantPlugin.test.d.ts +2 -0
  135. package/dist/types/src/AssistantPlugin.test.d.ts.map +1 -0
  136. package/dist/types/src/AssistantPlugin.workerd.d.ts +4 -0
  137. package/dist/types/src/AssistantPlugin.workerd.d.ts.map +1 -0
  138. package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
  139. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
  140. package/dist/types/src/blueprints/assistant/blueprint.node.test.d.ts +2 -0
  141. package/dist/types/src/blueprints/assistant/blueprint.node.test.d.ts.map +1 -0
  142. package/dist/types/src/capabilities/agent-hydrator.d.ts +5 -0
  143. package/dist/types/src/capabilities/agent-hydrator.d.ts.map +1 -0
  144. package/dist/types/src/capabilities/agent-service.d.ts +6 -0
  145. package/dist/types/src/capabilities/agent-service.d.ts.map +1 -0
  146. package/dist/types/src/capabilities/ai-context.d.ts +6 -0
  147. package/dist/types/src/capabilities/ai-context.d.ts.map +1 -0
  148. package/dist/types/src/capabilities/ai-service.d.ts +2 -2
  149. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  150. package/dist/types/src/capabilities/app-graph-builder.d.ts +2 -1
  151. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  152. package/dist/types/src/capabilities/automation-templates.d.ts +6 -0
  153. package/dist/types/src/capabilities/automation-templates.d.ts.map +1 -0
  154. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  155. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -1
  156. package/dist/types/src/capabilities/create-object.d.ts +31 -0
  157. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  158. package/dist/types/src/capabilities/edge-model-resolver.d.ts +1 -1
  159. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  160. package/dist/types/src/capabilities/index.d.ts +36 -3
  161. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  162. package/dist/types/src/capabilities/integration-provider.d.ts +5 -0
  163. package/dist/types/src/capabilities/integration-provider.d.ts.map +1 -0
  164. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  165. package/dist/types/src/capabilities/{markdown.d.ts → markdown-extension.d.ts} +1 -1
  166. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  167. package/dist/types/src/capabilities/migrations.d.ts +2 -1
  168. package/dist/types/src/capabilities/migrations.d.ts.map +1 -1
  169. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  170. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  171. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  172. package/dist/types/src/capabilities/settings.d.ts.map +1 -1
  173. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  174. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  175. package/dist/types/src/components/AgentProperties/AgentProperties.d.ts +7 -0
  176. package/dist/types/src/components/AgentProperties/AgentProperties.d.ts.map +1 -0
  177. package/dist/types/src/{containers → components}/AgentProperties/AgentProperties.stories.d.ts +1 -2
  178. package/dist/types/src/components/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
  179. package/dist/types/src/components/AgentProperties/index.d.ts +2 -0
  180. package/dist/types/src/components/AgentProperties/index.d.ts.map +1 -0
  181. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +1 -1
  182. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  183. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -1
  184. package/dist/types/src/components/Chat/Chat.d.ts +44 -42
  185. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  186. package/dist/types/src/components/Chat/context.d.ts +29 -0
  187. package/dist/types/src/components/Chat/context.d.ts.map +1 -0
  188. package/dist/types/src/components/Chat/events.d.ts +3 -0
  189. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  190. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +1 -1
  191. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  192. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts +12 -0
  193. package/dist/types/src/components/ChatPrompt/ChatMcpErrors.d.ts.map +1 -0
  194. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +10 -14
  195. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  196. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +1 -1
  197. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -1
  198. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts +2 -9
  199. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  200. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +27 -0
  201. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
  202. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +2 -2
  203. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  204. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
  205. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
  206. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +1 -1
  207. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  208. package/dist/types/src/components/ChatPrompt/index.d.ts +3 -0
  209. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  210. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
  211. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
  212. package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
  213. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  214. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +5 -5
  215. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  216. package/dist/types/src/components/ChatThread/Link.d.ts +2 -2
  217. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  218. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +8 -1
  219. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -1
  220. package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
  221. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  222. package/dist/types/src/components/ChatThread/sync.d.ts +42 -16
  223. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  224. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -1
  225. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +4 -4
  226. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -1
  227. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -1
  228. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -1
  229. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -1
  230. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -1
  231. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -1
  232. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +2 -15
  233. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -1
  234. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -1
  235. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -1
  236. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -1
  237. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -1
  238. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
  239. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
  240. package/dist/types/src/components/ChatThread/widgets/index.d.ts +1 -2
  241. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -1
  242. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +4 -3
  243. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -1
  244. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +0 -1
  245. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -1
  246. package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts +7 -0
  247. package/dist/types/src/components/RoutineProperties/RoutineProperties.d.ts.map +1 -0
  248. package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts +15 -0
  249. package/dist/types/src/components/RoutineProperties/RoutineProperties.stories.d.ts.map +1 -0
  250. package/dist/types/src/components/RoutineProperties/index.d.ts +2 -0
  251. package/dist/types/src/components/RoutineProperties/index.d.ts.map +1 -0
  252. package/dist/types/src/components/TaskList/TaskList.d.ts +10 -0
  253. package/dist/types/src/components/TaskList/TaskList.d.ts.map +1 -0
  254. package/dist/types/src/components/TaskList/TaskList.stories.d.ts +16 -0
  255. package/dist/types/src/components/TaskList/TaskList.stories.d.ts.map +1 -0
  256. package/dist/types/src/components/TaskList/index.d.ts +2 -0
  257. package/dist/types/src/components/TaskList/index.d.ts.map +1 -0
  258. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +5 -3
  259. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  260. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  261. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +4 -5
  262. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  263. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -1
  264. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  265. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  266. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
  267. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -4
  268. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  269. package/dist/types/src/components/Toolbox/Toolbox.d.ts +3 -3
  270. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  271. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  272. package/dist/types/src/components/index.d.ts +4 -0
  273. package/dist/types/src/components/index.d.ts.map +1 -1
  274. package/dist/types/src/constants.d.ts +5 -0
  275. package/dist/types/src/constants.d.ts.map +1 -0
  276. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -1
  277. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +0 -2
  278. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -1
  279. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -1
  280. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +1 -1
  281. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
  282. package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts +25 -0
  283. package/dist/types/src/containers/ChatArticle/ChatArticle.d.ts.map +1 -0
  284. package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts +15 -0
  285. package/dist/types/src/containers/ChatArticle/ChatArticle.stories.d.ts.map +1 -0
  286. package/dist/types/src/containers/ChatArticle/index.d.ts +2 -0
  287. package/dist/types/src/containers/ChatArticle/index.d.ts.map +1 -0
  288. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +11 -3
  289. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
  290. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
  291. package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts +6 -0
  292. package/dist/types/src/containers/PlanArticle/PlanArticle.d.ts.map +1 -0
  293. package/dist/types/src/containers/PlanArticle/index.d.ts +2 -0
  294. package/dist/types/src/containers/PlanArticle/index.d.ts.map +1 -0
  295. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
  296. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
  297. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts +15 -0
  298. package/dist/types/src/containers/RoutineArticle/RoutineArticle.stories.d.ts.map +1 -0
  299. package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
  300. package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
  301. package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
  302. package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
  303. package/dist/types/src/containers/{PromptList/PromptList.stories.d.ts → RoutineList/RoutineList.stories.d.ts} +1 -1
  304. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
  305. package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
  306. package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
  307. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +4 -5
  308. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -1
  309. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +4 -3
  310. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -1
  311. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +6 -6
  312. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -1
  313. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -1
  314. package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
  315. package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
  316. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
  317. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
  318. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
  319. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
  320. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +3 -2
  321. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
  322. package/dist/types/src/containers/TriggerStatus/index.d.ts +1 -1
  323. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -1
  324. package/dist/types/src/containers/index.d.ts +6 -5
  325. package/dist/types/src/containers/index.d.ts.map +1 -1
  326. package/dist/types/src/execution-graph/execution-graph.d.ts +108 -0
  327. package/dist/types/src/execution-graph/execution-graph.d.ts.map +1 -0
  328. package/dist/types/src/execution-graph/execution-graph.test.d.ts +2 -0
  329. package/dist/types/src/execution-graph/execution-graph.test.d.ts.map +1 -0
  330. package/dist/types/src/execution-graph/index.d.ts +3 -0
  331. package/dist/types/src/execution-graph/index.d.ts.map +1 -0
  332. package/dist/types/src/execution-graph/remote-snapshot.test.d.ts +2 -0
  333. package/dist/types/src/execution-graph/remote-snapshot.test.d.ts.map +1 -0
  334. package/dist/types/src/execution-graph/span-tree.d.ts +76 -0
  335. package/dist/types/src/execution-graph/span-tree.d.ts.map +1 -0
  336. package/dist/types/src/execution-graph/span-tree.test.d.ts +2 -0
  337. package/dist/types/src/execution-graph/span-tree.test.d.ts.map +1 -0
  338. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts +2 -0
  339. package/dist/types/src/execution-graph/sub-agent-delegation.test.d.ts.map +1 -0
  340. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts +40 -0
  341. package/dist/types/src/execution-graph/testing/collect-trace-events.d.ts.map +1 -0
  342. package/dist/types/src/execution-graph/testing/index.d.ts +2 -0
  343. package/dist/types/src/execution-graph/testing/index.d.ts.map +1 -0
  344. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -1
  345. package/dist/types/src/feed-logger.d.ts +13 -0
  346. package/dist/types/src/feed-logger.d.ts.map +1 -0
  347. package/dist/types/src/functions/services.test.d.ts +2 -0
  348. package/dist/types/src/functions/services.test.d.ts.map +1 -0
  349. package/dist/types/src/hooks/index.d.ts +3 -0
  350. package/dist/types/src/hooks/index.d.ts.map +1 -1
  351. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +56 -15
  352. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  353. package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
  354. package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
  355. package/dist/types/src/hooks/useChatProcessor.d.ts +5 -5
  356. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  357. package/dist/types/src/hooks/useChatServices.d.ts +7 -3
  358. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  359. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  360. package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
  361. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  362. package/dist/types/src/hooks/useContextObjects.d.ts +5 -4
  363. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  364. package/dist/types/src/hooks/useDebug.d.ts +10 -0
  365. package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
  366. package/dist/types/src/hooks/useFilteredTypes.d.ts +1 -1
  367. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
  368. package/dist/types/src/hooks/useFlush.d.ts +1 -1
  369. package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
  370. package/dist/types/src/hooks/usePresets.d.ts +2 -2
  371. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  372. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  373. package/dist/types/src/index.d.ts +1 -4
  374. package/dist/types/src/index.d.ts.map +1 -1
  375. package/dist/types/src/meta.d.ts +3 -2
  376. package/dist/types/src/meta.d.ts.map +1 -1
  377. package/dist/types/src/operations/create-chat.d.ts +3 -3
  378. package/dist/types/src/operations/create-chat.d.ts.map +1 -1
  379. package/dist/types/src/operations/ensure-companion-chat.d.ts +3 -3
  380. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -1
  381. package/dist/types/src/operations/fork-chat.d.ts +5 -0
  382. package/dist/types/src/operations/fork-chat.d.ts.map +1 -0
  383. package/dist/types/src/operations/index.d.ts +1 -2
  384. package/dist/types/src/operations/index.d.ts.map +1 -1
  385. package/dist/types/src/operations/prompt.node.test.d.ts +2 -0
  386. package/dist/types/src/operations/prompt.node.test.d.ts.map +1 -0
  387. package/dist/types/src/operations/resolve-navigation-targets.d.ts +4 -2
  388. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -1
  389. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +3 -3
  390. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -1
  391. package/dist/types/src/operations/set-current-chat.d.ts +3 -3
  392. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -1
  393. package/dist/types/src/operations/toggle-trace-panel-debug.d.ts +5 -0
  394. package/dist/types/src/operations/toggle-trace-panel-debug.d.ts.map +1 -0
  395. package/dist/types/src/operations/update-chat-name.d.ts +3 -3
  396. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -1
  397. package/dist/types/src/paths.d.ts +3 -0
  398. package/dist/types/src/paths.d.ts.map +1 -0
  399. package/dist/types/src/plugin.d.ts +4 -0
  400. package/dist/types/src/plugin.d.ts.map +1 -0
  401. package/dist/types/src/processor/presets.d.ts.map +1 -1
  402. package/dist/types/src/processor/processor.d.ts +263 -26
  403. package/dist/types/src/processor/processor.d.ts.map +1 -1
  404. package/dist/types/src/processor/processor.node.test.d.ts +2 -0
  405. package/dist/types/src/processor/processor.node.test.d.ts.map +1 -0
  406. package/dist/types/src/templates/automation-templates.test.d.ts +2 -0
  407. package/dist/types/src/templates/automation-templates.test.d.ts.map +1 -0
  408. package/dist/types/src/templates/daily-digest.d.ts +3 -0
  409. package/dist/types/src/templates/daily-digest.d.ts.map +1 -0
  410. package/dist/types/src/templates/index.d.ts +4 -0
  411. package/dist/types/src/templates/index.d.ts.map +1 -0
  412. package/dist/types/src/templates/research-brief.d.ts +3 -0
  413. package/dist/types/src/templates/research-brief.d.ts.map +1 -0
  414. package/dist/types/src/templates/scaffold.d.ts +17 -0
  415. package/dist/types/src/templates/scaffold.d.ts.map +1 -0
  416. package/dist/types/src/testing/index.d.ts +2 -0
  417. package/dist/types/src/testing/index.d.ts.map +1 -1
  418. package/dist/types/src/testing/snapshot.d.ts +21 -0
  419. package/dist/types/src/testing/snapshot.d.ts.map +1 -0
  420. package/dist/types/src/testing/test-generator.d.ts +2 -3
  421. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  422. package/dist/types/src/testing/test-generator.test.d.ts +2 -0
  423. package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
  424. package/dist/types/src/testing/test-sequence.d.ts +10 -3
  425. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  426. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  427. package/dist/types/src/testing/test-trace.d.ts +5 -0
  428. package/dist/types/src/testing/test-trace.d.ts.map +1 -0
  429. package/dist/types/src/testing/trace-timeline.node.test.d.ts +2 -0
  430. package/dist/types/src/testing/trace-timeline.node.test.d.ts.map +1 -0
  431. package/dist/types/src/testing.d.ts +2 -0
  432. package/dist/types/src/testing.d.ts.map +1 -0
  433. package/dist/types/src/translations.d.ts.map +1 -1
  434. package/dist/types/src/types/Assistant.d.ts +25 -8
  435. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  436. package/dist/types/src/types/AssistantCapabilities.d.ts +30 -0
  437. package/dist/types/src/types/AssistantCapabilities.d.ts.map +1 -0
  438. package/dist/types/src/types/AssistantEvents.d.ts +3 -0
  439. package/dist/types/src/types/AssistantEvents.d.ts.map +1 -0
  440. package/dist/types/src/types/AssistantOperation.d.ts +153 -0
  441. package/dist/types/src/types/AssistantOperation.d.ts.map +1 -0
  442. package/dist/types/src/types/Settings.d.ts +21 -5
  443. package/dist/types/src/types/Settings.d.ts.map +1 -1
  444. package/dist/types/src/types/index.d.ts +8 -3
  445. package/dist/types/src/types/index.d.ts.map +1 -1
  446. package/dist/types/src/types/preset.d.ts +12 -0
  447. package/dist/types/src/types/preset.d.ts.map +1 -0
  448. package/dist/types/src/types/service.d.ts +2 -3
  449. package/dist/types/src/types/service.d.ts.map +1 -1
  450. package/dist/types/src/util/suggestions.d.ts +9 -0
  451. package/dist/types/src/util/suggestions.d.ts.map +1 -0
  452. package/dist/types/src/util/suggestions.test.d.ts +2 -0
  453. package/dist/types/src/util/suggestions.test.d.ts.map +1 -0
  454. package/dist/types/tsconfig.tsbuildinfo +1 -1
  455. package/package.json +177 -146
  456. package/src/AssistantPlugin.conversations.json +1 -0
  457. package/src/AssistantPlugin.node.ts +90 -0
  458. package/src/AssistantPlugin.test.ts +213 -0
  459. package/src/AssistantPlugin.ts +158 -0
  460. package/src/AssistantPlugin.workerd.ts +41 -0
  461. package/src/blueprints/assistant/{blueprint.test.ts → blueprint.node.test.ts} +5 -5
  462. package/src/blueprints/assistant/blueprint.ts +4 -4
  463. package/src/capabilities/agent-hydrator.ts +37 -0
  464. package/src/capabilities/agent-service.ts +38 -0
  465. package/src/capabilities/ai-context.ts +48 -0
  466. package/src/capabilities/ai-service.ts +31 -11
  467. package/src/capabilities/app-graph-builder.ts +106 -86
  468. package/src/capabilities/automation-templates.ts +16 -0
  469. package/src/capabilities/blueprint-definition.ts +15 -8
  470. package/src/capabilities/companion-chat-provisioner.ts +5 -5
  471. package/src/capabilities/create-object.ts +100 -0
  472. package/src/capabilities/edge-model-resolver.ts +53 -16
  473. package/src/capabilities/index.ts +23 -3
  474. package/src/capabilities/integration-provider.ts +86 -0
  475. package/src/capabilities/{markdown.ts → markdown-extension.ts} +3 -3
  476. package/src/capabilities/migrations.ts +4 -11
  477. package/src/capabilities/operation-handler.ts +1 -1
  478. package/src/capabilities/react-surface.tsx +41 -21
  479. package/src/components/AgentProperties/AgentProperties.stories.tsx +74 -0
  480. package/src/components/AgentProperties/AgentProperties.tsx +103 -0
  481. package/src/components/AgentProperties/index.ts +5 -0
  482. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +3 -2
  483. package/src/components/AssistantSettings/AssistantSettings.tsx +22 -111
  484. package/src/components/Chat/Chat.tsx +145 -277
  485. package/src/components/Chat/context.ts +39 -0
  486. package/src/components/Chat/events.ts +7 -0
  487. package/src/components/ChatPrompt/ChatActions.tsx +11 -11
  488. package/src/components/ChatPrompt/ChatMcpErrors.tsx +50 -0
  489. package/src/components/ChatPrompt/ChatOptions.stories.tsx +32 -18
  490. package/src/components/ChatPrompt/ChatOptions.tsx +121 -103
  491. package/src/components/ChatPrompt/ChatPresets.tsx +3 -7
  492. package/src/components/ChatPrompt/ChatPrompt.tsx +180 -0
  493. package/src/components/ChatPrompt/ChatReferences.tsx +9 -13
  494. package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
  495. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +2 -2
  496. package/src/components/ChatPrompt/index.ts +3 -0
  497. package/src/components/ChatThread/Anchor.stories.tsx +95 -0
  498. package/src/components/ChatThread/ChatThread.stories.tsx +33 -37
  499. package/src/components/ChatThread/ChatThread.tsx +47 -23
  500. package/src/components/ChatThread/DEBUG.md +41 -0
  501. package/src/components/ChatThread/Link.tsx +5 -5
  502. package/src/components/ChatThread/MarkdownStream.stories.tsx +43 -5
  503. package/src/components/ChatThread/registry.tsx +80 -28
  504. package/src/components/ChatThread/sync.test.ts +180 -22
  505. package/src/components/ChatThread/sync.ts +89 -104
  506. package/src/components/ChatThread/testing/reasoning.md +25 -0
  507. package/src/components/ChatThread/widgets/FallbackWidget.tsx +8 -6
  508. package/src/components/ChatThread/widgets/ReasoningWidget.ts +13 -7
  509. package/src/components/ChatThread/widgets/ReferenceWidget.ts +3 -1
  510. package/src/components/ChatThread/widgets/SelectWidget.ts +4 -2
  511. package/src/components/ChatThread/widgets/StatsWidget.ts +3 -1
  512. package/src/components/ChatThread/widgets/StatusWidget.ts +6 -86
  513. package/src/components/ChatThread/widgets/SuggestionWidget.ts +2 -2
  514. package/src/components/ChatThread/widgets/SummaryWidget.tsx +7 -6
  515. package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +2 -1
  516. package/src/components/ChatThread/widgets/ToolWidget.tsx +42 -25
  517. package/src/components/ChatThread/widgets/defaults.ts +8 -0
  518. package/src/components/ChatThread/widgets/index.ts +1 -2
  519. package/src/components/ProcessTree/ProcessTree.stories.tsx +13 -39
  520. package/src/components/ProcessTree/ProcessTree.tsx +101 -67
  521. package/src/components/RoutineProperties/RoutineProperties.stories.tsx +59 -0
  522. package/src/components/RoutineProperties/RoutineProperties.tsx +23 -0
  523. package/src/components/RoutineProperties/index.ts +5 -0
  524. package/src/components/TaskList/TaskList.stories.tsx +44 -0
  525. package/src/components/TaskList/TaskList.tsx +45 -0
  526. package/src/components/TaskList/index.ts +5 -0
  527. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +6 -5
  528. package/src/components/TemplateEditor/TemplateEditor.tsx +12 -10
  529. package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -9
  530. package/src/components/TemplateEditor/TemplateForm.tsx +52 -73
  531. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +2 -2
  532. package/src/components/ToolBlock/ToolBlock.tsx +25 -17
  533. package/src/components/Toolbox/Toolbox.stories.tsx +6 -5
  534. package/src/components/Toolbox/Toolbox.tsx +6 -5
  535. package/src/components/index.ts +6 -0
  536. package/src/constants.ts +9 -0
  537. package/src/containers/AgentArticle/AgentArticle.stories.tsx +19 -15
  538. package/src/containers/AgentArticle/AgentArticle.tsx +47 -53
  539. package/src/containers/AgentProperties/AgentProperties.tsx +20 -135
  540. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +2 -2
  541. package/src/containers/ChatArticle/ChatArticle.stories.tsx +78 -0
  542. package/src/containers/ChatArticle/ChatArticle.tsx +112 -0
  543. package/src/containers/ChatArticle/index.ts +5 -0
  544. package/src/containers/ChatCompanion/ChatCompanion.tsx +94 -109
  545. package/src/containers/ChatDialog/ChatDialog.tsx +6 -11
  546. package/src/containers/PlanArticle/PlanArticle.tsx +33 -0
  547. package/src/containers/PlanArticle/index.ts +5 -0
  548. package/src/containers/RoutineArticle/RoutineArticle.stories.tsx +75 -0
  549. package/src/containers/RoutineArticle/RoutineArticle.tsx +109 -0
  550. package/src/containers/RoutineArticle/index.ts +5 -0
  551. package/src/containers/{PromptList/PromptList.stories.tsx → RoutineList/RoutineList.stories.tsx} +14 -13
  552. package/src/containers/{PromptList/PromptList.tsx → RoutineList/RoutineList.tsx} +9 -8
  553. package/src/containers/RoutineList/index.ts +5 -0
  554. package/src/containers/TracePanel/TracePanel.stories.tsx +285 -168
  555. package/src/containers/TracePanel/TracePanel.tsx +220 -77
  556. package/src/containers/TracePanel/dxn-extractor.test.ts +32 -32
  557. package/src/containers/TracePanel/dxn-extractor.ts +52 -64
  558. package/src/containers/TracePanel/testing/index.ts +6 -0
  559. package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
  560. package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
  561. package/src/containers/TriggerStatus/TriggerStatus.tsx +20 -34
  562. package/src/containers/TriggerStatus/index.ts +1 -1
  563. package/src/containers/index.ts +6 -5
  564. package/src/execution-graph/SPEC.md +690 -0
  565. package/src/execution-graph/execution-graph.test.ts +891 -0
  566. package/src/execution-graph/execution-graph.ts +777 -0
  567. package/src/execution-graph/index.ts +24 -0
  568. package/src/execution-graph/remote-snapshot.test.ts +116 -0
  569. package/src/execution-graph/span-tree.test.ts +249 -0
  570. package/src/execution-graph/span-tree.ts +269 -0
  571. package/src/execution-graph/sub-agent-delegation.test.ts +50 -0
  572. package/src/execution-graph/testing/collect-trace-events.ts +74 -0
  573. package/src/execution-graph/testing/index.ts +5 -0
  574. package/src/execution-graph/testing/sub-agent-delegation.json +1285 -0
  575. package/src/{queue-logger.ts → feed-logger.ts} +39 -25
  576. package/src/functions/services.test.ts +53 -0
  577. package/src/hooks/index.ts +5 -0
  578. package/src/hooks/useBlueprintRegistry.ts +62 -46
  579. package/src/hooks/useChatKeymap.ts +52 -0
  580. package/src/hooks/useChatProcessor.ts +33 -17
  581. package/src/hooks/useChatServices.ts +8 -6
  582. package/src/hooks/useChatToolbarActions.ts +98 -96
  583. package/src/hooks/useContextBinder.ts +7 -7
  584. package/src/hooks/useContextObjects.ts +6 -5
  585. package/src/hooks/useDebug.ts +38 -0
  586. package/src/hooks/useFilteredTypes.ts +18 -16
  587. package/src/hooks/usePresets.ts +5 -3
  588. package/src/hooks/useReferencesProvider.ts +7 -15
  589. package/src/index.ts +1 -5
  590. package/src/meta.ts +27 -8
  591. package/src/operations/create-chat.ts +15 -38
  592. package/src/operations/ensure-companion-chat.ts +49 -47
  593. package/src/operations/fork-chat.ts +112 -0
  594. package/src/operations/index.ts +3 -4
  595. package/src/operations/prompt.node.test.ts +82 -0
  596. package/src/operations/resolve-navigation-targets.ts +8 -3
  597. package/src/operations/run-prompt-in-new-chat.ts +87 -87
  598. package/src/operations/set-current-chat.ts +6 -7
  599. package/src/operations/toggle-trace-panel-debug.ts +27 -0
  600. package/src/operations/update-chat-name.ts +24 -20
  601. package/src/paths.ts +10 -0
  602. package/src/plugin.ts +11 -0
  603. package/src/processor/presets.ts +15 -11
  604. package/src/processor/{processor.test.ts → processor.node.test.ts} +7 -7
  605. package/src/processor/processor.ts +160 -58
  606. package/src/templates/automation-templates.test.ts +66 -0
  607. package/src/templates/daily-digest.ts +37 -0
  608. package/src/templates/index.ts +11 -0
  609. package/src/templates/research-brief.ts +40 -0
  610. package/src/templates/scaffold.ts +74 -0
  611. package/src/testing/data/trace-timeline-multiple.dx.json +1 -0
  612. package/src/testing/data/trace-timeline-remote.dx.json +1 -0
  613. package/src/testing/data/trace-timeline.dx.json +4657 -0
  614. package/src/testing/index.ts +2 -0
  615. package/src/testing/snapshot.ts +35 -0
  616. package/src/testing/test-generator.test.ts +71 -0
  617. package/src/testing/test-generator.ts +196 -205
  618. package/src/testing/test-sequence.ts +3 -3
  619. package/src/testing/test-services.ts +1 -1
  620. package/src/testing/test-trace.ts +20 -0
  621. package/src/testing/trace-timeline.node.conversations.json +1 -0
  622. package/src/testing/{trace-timeline.test.ts → trace-timeline.node.test.ts} +45 -50
  623. package/src/testing.ts +9 -0
  624. package/src/translations.ts +40 -38
  625. package/src/types/Assistant.ts +13 -1
  626. package/src/types/AssistantCapabilities.ts +35 -0
  627. package/src/types/AssistantEvents.ts +11 -0
  628. package/src/{operations/definitions.ts → types/AssistantOperation.ts} +66 -29
  629. package/src/types/Settings.ts +68 -7
  630. package/src/types/index.ts +12 -3
  631. package/src/types/preset.ts +16 -0
  632. package/src/types/service.ts +5 -10
  633. package/src/util/suggestions.test.ts +52 -0
  634. package/src/util/suggestions.ts +42 -0
  635. package/src/vite-env.d.ts +5 -0
  636. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs +0 -97
  637. package/dist/lib/browser/AssistantSettings-7QMO3LGF.mjs.map +0 -7
  638. package/dist/lib/browser/chunk-ATHYBVGN.mjs +0 -176
  639. package/dist/lib/browser/chunk-ATHYBVGN.mjs.map +0 -7
  640. package/dist/lib/browser/chunk-EZRS3J25.mjs.map +0 -7
  641. package/dist/lib/browser/chunk-LMVTXH54.mjs +0 -154
  642. package/dist/lib/browser/chunk-LMVTXH54.mjs.map +0 -7
  643. package/dist/lib/browser/create-chat-LBZHGVSN.mjs +0 -82
  644. package/dist/lib/browser/create-chat-LBZHGVSN.mjs.map +0 -7
  645. package/dist/lib/browser/ensure-companion-chat-ZEZA34MZ.mjs.map +0 -7
  646. package/dist/lib/browser/index.mjs +0 -3452
  647. package/dist/lib/browser/index.mjs.map +0 -7
  648. package/dist/lib/browser/meta.json +0 -1
  649. package/dist/lib/browser/on-create-space-54RNX5JI.mjs +0 -22
  650. package/dist/lib/browser/on-create-space-54RNX5JI.mjs.map +0 -7
  651. package/dist/lib/browser/operations/index.mjs +0 -13
  652. package/dist/lib/browser/operations/index.mjs.map +0 -7
  653. package/dist/lib/browser/resolve-navigation-targets-NZOD66NY.mjs.map +0 -7
  654. package/dist/lib/browser/run-prompt-in-new-chat-THLK5YQC.mjs.map +0 -7
  655. package/dist/lib/browser/set-current-chat-LRS3VFSH.mjs.map +0 -7
  656. package/dist/lib/browser/types/index.mjs +0 -20
  657. package/dist/lib/browser/update-chat-name-3Y36KFAS.mjs.map +0 -7
  658. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs +0 -98
  659. package/dist/lib/node-esm/AssistantSettings-UVUTKO7E.mjs.map +0 -7
  660. package/dist/lib/node-esm/blueprints/index.mjs +0 -9
  661. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  662. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs +0 -32
  663. package/dist/lib/node-esm/chunk-NZIKC7AN.mjs.map +0 -7
  664. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs +0 -177
  665. package/dist/lib/node-esm/chunk-PXAJSTGZ.mjs.map +0 -7
  666. package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs +0 -155
  667. package/dist/lib/node-esm/chunk-W3JZ2F4T.mjs.map +0 -7
  668. package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs +0 -83
  669. package/dist/lib/node-esm/create-chat-3BEG4R6J.mjs.map +0 -7
  670. package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs +0 -66
  671. package/dist/lib/node-esm/ensure-companion-chat-6K2WEWFP.mjs.map +0 -7
  672. package/dist/lib/node-esm/index.mjs +0 -3453
  673. package/dist/lib/node-esm/index.mjs.map +0 -7
  674. package/dist/lib/node-esm/meta.json +0 -1
  675. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs +0 -23
  676. package/dist/lib/node-esm/on-create-space-YRPZ6HZY.mjs.map +0 -7
  677. package/dist/lib/node-esm/operations/index.mjs +0 -14
  678. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  679. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs +0 -23
  680. package/dist/lib/node-esm/resolve-navigation-targets-3PPK7XLH.mjs.map +0 -7
  681. package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs +0 -137
  682. package/dist/lib/node-esm/run-prompt-in-new-chat-OUYKCMQ7.mjs.map +0 -7
  683. package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs +0 -55
  684. package/dist/lib/node-esm/set-current-chat-SMXZJD3F.mjs.map +0 -7
  685. package/dist/lib/node-esm/types/index.mjs +0 -21
  686. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs +0 -72
  687. package/dist/lib/node-esm/update-chat-name-HM2P4NSI.mjs.map +0 -7
  688. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts +0 -2
  689. package/dist/types/src/blueprints/assistant/blueprint.test.d.ts.map +0 -1
  690. package/dist/types/src/capabilities/markdown.d.ts.map +0 -1
  691. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -10
  692. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
  693. package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
  694. package/dist/types/src/components/ChatProgress/index.d.ts.map +0 -1
  695. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts +0 -14
  696. package/dist/types/src/components/ChatThread/widgets/PromptWidget.d.ts.map +0 -1
  697. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +0 -1
  698. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +0 -12
  699. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +0 -1
  700. package/dist/types/src/containers/ChatContainer/index.d.ts +0 -2
  701. package/dist/types/src/containers/ChatContainer/index.d.ts.map +0 -1
  702. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
  703. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
  704. package/dist/types/src/containers/PromptArticle/index.d.ts +0 -2
  705. package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
  706. package/dist/types/src/containers/PromptList/PromptList.d.ts +0 -6
  707. package/dist/types/src/containers/PromptList/PromptList.d.ts.map +0 -1
  708. package/dist/types/src/containers/PromptList/PromptList.stories.d.ts.map +0 -1
  709. package/dist/types/src/containers/PromptList/index.d.ts +0 -2
  710. package/dist/types/src/containers/PromptList/index.d.ts.map +0 -1
  711. package/dist/types/src/containers/TracePanel/execution-graph.d.ts +0 -17
  712. package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +0 -1
  713. package/dist/types/src/operations/definitions.d.ts +0 -135
  714. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  715. package/dist/types/src/operations/on-create-space.d.ts +0 -5
  716. package/dist/types/src/operations/on-create-space.d.ts.map +0 -1
  717. package/dist/types/src/processor/processor.test.d.ts +0 -2
  718. package/dist/types/src/processor/processor.test.d.ts.map +0 -1
  719. package/dist/types/src/queue-logger.d.ts +0 -11
  720. package/dist/types/src/queue-logger.d.ts.map +0 -1
  721. package/dist/types/src/testing/trace-timeline.test.d.ts +0 -2
  722. package/dist/types/src/testing/trace-timeline.test.d.ts.map +0 -1
  723. package/dist/types/src/types/capabilities.d.ts +0 -32
  724. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  725. package/dist/types/src/types/defs.d.ts +0 -2
  726. package/dist/types/src/types/defs.d.ts.map +0 -1
  727. package/dist/types/src/types/events.d.ts +0 -5
  728. package/dist/types/src/types/events.d.ts.map +0 -1
  729. package/src/AssistantPlugin.tsx +0 -233
  730. package/src/components/ChatProgress/ChatProgress.tsx +0 -56
  731. package/src/components/ChatProgress/index.ts +0 -5
  732. package/src/components/ChatThread/widgets/PromptWidget.ts +0 -28
  733. package/src/containers/AgentProperties/AgentProperties.stories.tsx +0 -100
  734. package/src/containers/ChatContainer/ChatContainer.tsx +0 -95
  735. package/src/containers/ChatContainer/index.ts +0 -5
  736. package/src/containers/PromptArticle/PromptArticle.tsx +0 -59
  737. package/src/containers/PromptArticle/index.ts +0 -5
  738. package/src/containers/PromptList/index.ts +0 -5
  739. package/src/containers/TracePanel/execution-graph.ts +0 -425
  740. package/src/operations/on-create-space.ts +0 -24
  741. package/src/testing/trace-timeline.conversations.json +0 -1
  742. package/src/types/capabilities.ts +0 -35
  743. package/src/types/defs.ts +0 -5
  744. package/src/types/events.ts +0 -11
  745. /package/dist/lib/{browser/blueprints/index.mjs.map → neutral/AssistantPlugin.mjs.map} +0 -0
  746. /package/dist/lib/{browser/chunk-J5LGTIGS.mjs.map → neutral/ChatArticle-VNVZCDUR.mjs.map} +0 -0
  747. /package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  748. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  749. /package/dist/lib/{node-esm/blueprints/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  750. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
  751. /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
@@ -0,0 +1,180 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useAtomValue } from '@effect-atom/atom-react';
6
+ import * as Option from 'effect/Option';
7
+ import React, { useCallback, useEffect, useRef, useState } from 'react';
8
+
9
+ import { type Chat } from '@dxos/assistant-toolkit';
10
+ import { type Event } from '@dxos/async';
11
+ import { type Database } from '@dxos/echo';
12
+ import { type Merge } from '@dxos/effect';
13
+ import { useVoiceInput } from '@dxos/plugin-transcription';
14
+ import { Input, type ThemedClassName, useDynamicRef, useTranslation } from '@dxos/react-ui';
15
+ import { ChatEditor, type ChatEditorController, type ChatEditorProps } from '@dxos/react-ui-chat';
16
+ import { mx } from '@dxos/ui-theme';
17
+
18
+ import { useChatKeymapExtensions } from '#hooks';
19
+ import { meta } from '#meta';
20
+ import { type ChatPresetProps } from '#types';
21
+
22
+ import { type AiChatProcessor } from '../../processor';
23
+ import { type ChatEvent } from '../Chat/events';
24
+ import { ChatActions, type ChatActionsProps } from './ChatActions';
25
+ import { ChatMcpErrors } from './ChatMcpErrors';
26
+ import { ChatOptions } from './ChatOptions';
27
+ import { ChatReferences } from './ChatReferences';
28
+ import { ChatStatusIndicator } from './ChatStatusIndicator';
29
+
30
+ export type ChatPromptProps = ThemedClassName<
31
+ Merge<
32
+ {
33
+ outline?: boolean;
34
+ settings?: boolean;
35
+ expandable?: boolean;
36
+ db?: Database.Database;
37
+ chat?: Chat.Chat;
38
+ processor: AiChatProcessor;
39
+ event: Event<ChatEvent>;
40
+ online?: boolean;
41
+ placeholder?: ChatEditorProps['placeholder'];
42
+ onOnlineChange?: (online: boolean) => void;
43
+ },
44
+ ChatPresetProps
45
+ >
46
+ >;
47
+
48
+ export const ChatPrompt = ({
49
+ classNames,
50
+ outline,
51
+ db,
52
+ chat,
53
+ processor,
54
+ event,
55
+ online,
56
+ placeholder,
57
+ onOnlineChange,
58
+ onPresetChange,
59
+ settings = true,
60
+ presets,
61
+ preset,
62
+ }: ChatPromptProps) => {
63
+ const { t } = useTranslation(meta.id);
64
+
65
+ const error = useAtomValue(processor.error).pipe(Option.getOrUndefined);
66
+ const streaming = useAtomValue(processor.streaming);
67
+ const active = useAtomValue(processor.active);
68
+ const activeRef = useDynamicRef(active);
69
+
70
+ const editorRef = useRef<ChatEditorController>(null);
71
+ const [recordingState, setRecordingState] = useState(false);
72
+ useEffect(() => {
73
+ return event.on((ev) => {
74
+ switch (ev.type) {
75
+ case 'update-prompt':
76
+ if (!editorRef.current?.getText()?.length) {
77
+ editorRef.current?.setText(ev.text);
78
+ editorRef.current?.focus();
79
+ }
80
+ break;
81
+ case 'record-start':
82
+ setRecordingState(true);
83
+ break;
84
+ case 'record-stop':
85
+ setRecordingState(false);
86
+ break;
87
+ }
88
+ });
89
+ }, [event]);
90
+
91
+ // TODO(burdon): Configure capability in TranscriptionPlugin.
92
+ const { recording } = useVoiceInput({
93
+ active: recordingState,
94
+ onUpdate: (text) => {
95
+ editorRef.current?.setText(text);
96
+ editorRef.current?.focus();
97
+ },
98
+ });
99
+
100
+ const extensions = useChatKeymapExtensions({ event });
101
+
102
+ const handleSubmit = useCallback<NonNullable<ChatEditorProps['onSubmit']>>(
103
+ (text) => {
104
+ if (!activeRef.current) {
105
+ event.emit({ type: 'submit', text });
106
+ return true;
107
+ }
108
+ },
109
+ [event],
110
+ );
111
+
112
+ const handleEvent = useCallback<NonNullable<ChatActionsProps['onEvent']>>(
113
+ (ev) => {
114
+ event.emit(ev);
115
+ },
116
+ [event],
117
+ );
118
+
119
+ return (
120
+ <div
121
+ role='group'
122
+ className={mx(
123
+ 'flex flex-col w-full dx-density-md',
124
+ outline &&
125
+ 'bg-group-surface rounded-sm border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator',
126
+ classNames,
127
+ )}
128
+ >
129
+ <ChatMcpErrors processor={processor} />
130
+
131
+ <div className='flex p-2 gap-2'>
132
+ <ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
133
+ <ChatEditor
134
+ ref={editorRef}
135
+ autoFocus
136
+ lineWrapping
137
+ classNames='col-span-2 pt-0.5'
138
+ placeholder={placeholder ?? t('prompt.placeholder')}
139
+ extensions={extensions}
140
+ onSubmit={handleSubmit}
141
+ />
142
+ </div>
143
+
144
+ {db && settings && (
145
+ <div className='flex items-center overflow-hidden p-1.5'>
146
+ <ChatOptions
147
+ chat={chat}
148
+ db={db}
149
+ registry={processor.registry}
150
+ context={processor.context}
151
+ preset={preset}
152
+ presets={presets}
153
+ onPresetChange={onPresetChange}
154
+ />
155
+
156
+ <div className='flex h-6 grow overflow-x-auto scrollbar-none'>
157
+ <ChatReferences db={db} context={processor.context} />
158
+ </div>
159
+
160
+ <ChatActions
161
+ classNames='col-span-2'
162
+ microphone={true}
163
+ recording={recording}
164
+ processing={streaming}
165
+ onEvent={handleEvent}
166
+ >
167
+ {online !== undefined && (
168
+ <Input.Root>
169
+ <Input.Label srOnly>{t('online-switch.label')}</Input.Label>
170
+ <Input.Switch classNames='mx-1' checked={online} onCheckedChange={onOnlineChange} />
171
+ </Input.Root>
172
+ )}
173
+ </ChatActions>
174
+ </div>
175
+ )}
176
+ </div>
177
+ );
178
+ };
179
+
180
+ ChatPrompt.displayName = 'Chat.Prompt';
@@ -2,11 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Option from 'effect/Option';
6
5
  import React from 'react';
7
6
 
8
- import { type AiContextBinder } from '@dxos/assistant';
9
- import { Annotation, type Database, Obj } from '@dxos/echo';
7
+ import { type AiContext } from '@dxos/assistant';
8
+ import { type Database, Obj } from '@dxos/echo';
10
9
  import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
11
10
  import { getStyles, mx } from '@dxos/ui-theme';
12
11
 
@@ -14,7 +13,7 @@ import { useContextObjects } from '#hooks';
14
13
  import { meta } from '#meta';
15
14
 
16
15
  export type ChatReferencesProps = ThemedClassName<{
17
- context: AiContextBinder;
16
+ context: AiContext.Binder;
18
17
  db: Database.Database;
19
18
  }>;
20
19
 
@@ -25,26 +24,23 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
25
24
  return (
26
25
  <ul className={mx('flex', classNames)}>
27
26
  {objects.map((obj) => {
28
- const dxn = Obj.getDXN(obj);
27
+ const uri = Obj.getURI(obj);
29
28
  const typename = Obj.getTypename(obj);
30
29
  const label: Label = Obj.getLabel(obj) ?? (typename ? ['object-name.placeholder', { ns: typename }] : obj.id);
31
- const { icon, hue } = Option.fromNullable(Obj.getSchema(obj)).pipe(
32
- Option.flatMap(Annotation.IconAnnotation.get),
33
- Option.getOrElse(() => ({ icon: DEFAULT_OBJECT_ICON, hue: undefined as string | undefined })),
34
- );
30
+ const { icon, hue } = Obj.getIcon(obj) ?? { icon: DEFAULT_OBJECT_ICON, hue: undefined };
35
31
  const styles = hue ? getStyles(hue) : undefined;
36
32
  return (
37
- <li key={dxn.toString()} className='dx-tag py-0 ps-2 flex items-center gap-1' data-hue='neutral'>
38
- <Icon icon={icon} size={4} classNames={styles?.surfaceText} />
33
+ <li key={uri.toString()} className='dx-tag py-0 flex items-center gap-1' data-hue='neutral'>
34
+ <Icon icon={icon} size={4} />
39
35
  {toLocalizedString(label, t)}
40
36
  <IconButton
41
37
  icon='ph--x--bold'
42
38
  iconOnly
43
39
  variant='ghost'
44
- label={t('remove-object-in-context.label')}
40
+ label={t('remove-object.label')}
45
41
  classNames='p-0 hover:bg-transparent'
46
42
  size={3}
47
- onClick={() => onUpdateObject?.(dxn, false)}
43
+ onClick={() => onUpdateObject?.(uri, false)}
48
44
  />
49
45
  </li>
50
46
  );
@@ -0,0 +1,123 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import React, { useEffect, useMemo, useState } from 'react';
6
+
7
+ import { type ThemedClassName } from '@dxos/react-ui';
8
+ import { ChatStatus as NaturalChatStatus, formatElapsed } from '@dxos/react-ui-chat';
9
+ import { Matrix } from '@dxos/react-ui-components';
10
+ import { type ContentBlock } from '@dxos/types';
11
+ import { Unit } from '@dxos/util';
12
+
13
+ import { type ChatRequestTiming, useChatContext } from '../Chat/context';
14
+
15
+ const CHAT_STREAM_STATUS_NAME = 'Chat.StreamStatus';
16
+ const TICK_MS = 1_000;
17
+
18
+ export type ChatStreamStatusProps = ThemedClassName<{
19
+ icon?: boolean;
20
+ }>;
21
+
22
+ /**
23
+ * Live status pill rendered at the bottom of the chat thread.
24
+ *
25
+ * The block-widget host re-mounts this component each time wire's drip queue toggles
26
+ * (`wireDrainingEffect`) — so all visible state is derived from chat-context values that
27
+ * survive the unmount: the latest `stats` block on the chat context's `messages` for token counts,
28
+ * and `requestTiming` (start/end wall-clock timestamps) for the elapsed value.
29
+ *
30
+ * Shows:
31
+ * - elapsed seconds since the most recent request started (frozen at end-of-request)
32
+ * - last completed turn's output token count (from the most recent `stats` content block)
33
+ * - cumulative session total tokens across all `stats` content blocks
34
+ */
35
+ export const ChatStatus = ({ classNames, icon }: ChatStreamStatusProps) => {
36
+ // Read `messages` from the chat context (combines `useQuery(queue)` + the processor's
37
+ // pending atom) rather than `processor.messages` directly — the latter only contains
38
+ // blocks streamed via the ephemeral `PartialBlock` channel, while finalized blocks
39
+ // (including the per-turn `stats` block we read for token counts) are submitted to the
40
+ // feed via `_submitMessage` and only show up through `useQuery`.
41
+ const { messages, requestTiming } = useChatContext(CHAT_STREAM_STATUS_NAME);
42
+
43
+ const { lastOutputTokens, sessionTotalTokens } = useMemo(() => {
44
+ let last: number | undefined;
45
+ let total = 0;
46
+ for (const message of messages) {
47
+ for (const block of message.blocks) {
48
+ if (isStats(block) && block.usage) {
49
+ last = block.usage.outputTokens;
50
+ total += block.usage.totalTokens ?? 0;
51
+ }
52
+ }
53
+ }
54
+ return { lastOutputTokens: last, sessionTotalTokens: total };
55
+ }, [messages]);
56
+
57
+ const isRunning = requestTiming != null && requestTiming.endedAt == null;
58
+ const show = requestTiming || lastOutputTokens || sessionTotalTokens > 0;
59
+ if (!show) {
60
+ return null;
61
+ }
62
+
63
+ return (
64
+ <NaturalChatStatus.Root defaultRunning={false} classNames={['py-2 gap-2 text-sm', classNames]}>
65
+ {icon && (
66
+ <NaturalChatStatus.Icon>
67
+ <Matrix
68
+ classNames='w-5 h-5'
69
+ dotClassNames='bg-primary-500'
70
+ dim={4}
71
+ dotSize={3}
72
+ count={10}
73
+ interval={500}
74
+ active={isRunning}
75
+ />
76
+ </NaturalChatStatus.Icon>
77
+ )}
78
+ {show && (
79
+ <div className='flex items-center'>
80
+ {requestTiming && (
81
+ <NaturalChatStatus.Text>
82
+ <Elapsed timing={requestTiming} />
83
+ </NaturalChatStatus.Text>
84
+ )}
85
+ {lastOutputTokens != null && (
86
+ <>
87
+ {requestTiming && <NaturalChatStatus.Separator />}
88
+ <NaturalChatStatus.Text>↓ {Unit.Thousand(lastOutputTokens).toString()}</NaturalChatStatus.Text>
89
+ </>
90
+ )}
91
+ {sessionTotalTokens > 0 && (
92
+ <>
93
+ {(requestTiming || lastOutputTokens != null) && <NaturalChatStatus.Separator />}
94
+ <NaturalChatStatus.Text>Σ {Unit.Thousand(sessionTotalTokens).toString()}</NaturalChatStatus.Text>
95
+ </>
96
+ )}
97
+ </div>
98
+ )}
99
+ </NaturalChatStatus.Root>
100
+ );
101
+ };
102
+
103
+ /**
104
+ * Wall-clock-derived elapsed display. Tick interval forces a re-render every second while
105
+ * the request is active so the displayed value advances; once `endedAt` is set, the value
106
+ * is frozen and the interval is no longer scheduled.
107
+ */
108
+ const Elapsed = ({ timing }: { timing: ChatRequestTiming }) => {
109
+ const isRunning = timing.endedAt == null;
110
+ const [now, setNow] = useState(Date.now());
111
+ useEffect(() => {
112
+ if (!isRunning) {
113
+ return;
114
+ }
115
+
116
+ const id = setInterval(() => setNow(Date.now()), TICK_MS);
117
+ return () => clearInterval(id);
118
+ }, [isRunning]);
119
+
120
+ return <>{formatElapsed((timing.endedAt ?? now) - timing.startedAt)}</>;
121
+ };
122
+
123
+ const isStats = (block: ContentBlock.Any): block is ContentBlock.Stats => block._tag === 'stats';
@@ -5,7 +5,7 @@
5
5
  import React, { useEffect, useState } from 'react';
6
6
 
7
7
  import { type ThemedClassName, Tooltip, useTimeout } from '@dxos/react-ui';
8
- import { Spinner, type SpinnerProps } from '@dxos/react-ui-sfx';
8
+ import { Spinner, type SpinnerProps } from '@dxos/react-ui-components';
9
9
  import { mx } from '@dxos/ui-theme';
10
10
 
11
11
  const period = 3_000;
@@ -30,7 +30,7 @@ export const ChatStatusIndicator = ({ classNames, preset, processing, error, ...
30
30
  );
31
31
 
32
32
  return (
33
- <div role='none' className={mx('relative flex', classNames)}>
33
+ <div className={mx('relative flex', classNames)}>
34
34
  <Spinner duration={period} state={!init ? 'flash' : error ? 'error' : processing ? 'spin' : 'pulse'} {...props} />
35
35
  {error && (
36
36
  <Tooltip.Trigger asChild content={error.message}>
@@ -3,7 +3,10 @@
3
3
  //
4
4
 
5
5
  export * from './ChatActions';
6
+ export * from './ChatMcpErrors';
6
7
  export * from './ChatOptions';
7
8
  export * from './ChatPresets';
9
+ export * from './ChatPrompt';
8
10
  export * from './ChatReferences';
9
11
  export * from './ChatStatusIndicator';
12
+ export * from './ChatStatus';
@@ -0,0 +1,95 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import React from 'react';
8
+
9
+ import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { Database, Filter, Obj } from '@dxos/echo';
11
+ import { DxAnchor } from '@dxos/lit-ui/react';
12
+ import { ClientPlugin } from '@dxos/plugin-client/testing';
13
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
14
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
15
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
16
+ import { useQuery, useSpaces } from '@dxos/react-client/echo';
17
+ import { Loading, withLayout } from '@dxos/react-ui/testing';
18
+ import { Organization } from '@dxos/types';
19
+
20
+ /**
21
+ * Production-style click → popover demo.
22
+ *
23
+ * Wires up the same chain Composer uses:
24
+ * - `<DxAnchor uri=…>label</DxAnchor>` fires `DxAnchorActivate` on click.
25
+ * - `PreviewPlugin`'s `preview-popover` capability listens for the event, resolves the DXN
26
+ * to a real ECHO object via `space.db.makeRef(uri).load()`, then invokes
27
+ * `LayoutOperation.UpdatePopover`.
28
+ * - `StorybookPlugin` provides both the `LayoutOperation.UpdatePopover` handler (mutating
29
+ * the layout-state atom) and the `<Layout>` shell that renders the popover via
30
+ * `<Surface.Surface type={AppSurface.Card} data={popoverContent}>`.
31
+ * - `PreviewPlugin` also registers Card-role surfaces (Organization, Person, Task, …); the
32
+ * Surface system picks the matching one based on the resolved object's type.
33
+ *
34
+ * Click the anchor — the matching Card surface (from plugin-preview) renders inside the
35
+ * popover, anchored to the trigger.
36
+ */
37
+ const DefaultStory = () => {
38
+ const [space] = useSpaces();
39
+ const [organization] = useQuery(space?.db, Filter.type(Organization.Organization));
40
+ if (!organization) {
41
+ return <Loading />;
42
+ }
43
+
44
+ const uri = Obj.getURI(organization);
45
+ return (
46
+ <div className='flex flex-col gap-2 p-4'>
47
+ <p>
48
+ Click{' '}
49
+ <DxAnchor className='dx-tag--anchor' dxn={uri}>
50
+ {organization.name}
51
+ </DxAnchor>{' '}
52
+ to open the popover.
53
+ </p>
54
+ </div>
55
+ );
56
+ };
57
+
58
+ const meta = {
59
+ title: 'plugins/plugin-assistant/components/ChatThread/Anchor',
60
+ render: DefaultStory,
61
+ decorators: [
62
+ withLayout({ layout: 'centered' }),
63
+ withPluginManager({
64
+ plugins: [
65
+ ...corePlugins(),
66
+ StorybookPlugin({}),
67
+ PreviewPlugin(),
68
+ ClientPlugin({
69
+ types: [Organization.Organization],
70
+ onClientInitialized: Effect.fnUntraced(function* ({ client }) {
71
+ const { personalSpace } = yield* initializeIdentity(client);
72
+ yield* Effect.gen(function* () {
73
+ yield* Database.add(
74
+ Obj.make(Organization.Organization, {
75
+ name: 'DXOS',
76
+ website: 'https://dxos.org',
77
+ description: 'A decentralized network for collaborative applications.',
78
+ }),
79
+ );
80
+ }).pipe(Effect.provide(Database.layer(personalSpace.db)));
81
+ }),
82
+ }),
83
+ ],
84
+ }),
85
+ ],
86
+ parameters: {
87
+ layout: 'centered',
88
+ },
89
+ } satisfies Meta<typeof DefaultStory>;
90
+
91
+ export default meta;
92
+
93
+ type Story = StoryObj<typeof meta>;
94
+
95
+ export const Default: Story = {};
@@ -9,39 +9,44 @@ import * as Layer from 'effect/Layer';
9
9
  import React, { useEffect, useMemo, useState } from 'react';
10
10
 
11
11
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { Database, Filter } from '@dxos/echo';
13
- import { runAndForwardErrors } from '@dxos/effect';
14
- import { ContextQueueService } from '@dxos/functions';
15
- import { ClientPlugin } from '@dxos/plugin-client';
16
- import { initializeIdentity } from '@dxos/plugin-client/testing';
17
- import { corePlugins } from '@dxos/plugin-testing';
12
+ import { createFeedServiceLayer } from '@dxos/client/echo';
13
+ import { Database, Feed, Filter, Query } from '@dxos/echo';
14
+ import { EffectEx } from '@dxos/effect';
15
+ import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
16
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
17
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
18
18
  import { random } from '@dxos/random';
19
- import { type Queue, useQuery, useSpaces } from '@dxos/react-client/echo';
20
- import { Card, Popover } from '@dxos/react-ui';
21
- import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
19
+ import { useQuery, useSpaces } from '@dxos/react-client/echo';
20
+ import { EditorPreviewProvider } from '@dxos/react-ui-editor';
22
21
  import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
23
22
  import { Message, Organization, Person } from '@dxos/types';
24
23
 
25
24
  import { createMessageGenerator } from '#testing';
25
+ import { translations } from '#translations';
26
26
 
27
- import { translations } from '../../translations';
28
27
  import { ChatThread, type ChatThreadProps } from './ChatThread';
29
28
 
30
29
  random.seed(1);
31
30
 
32
- type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
31
+ type MessageGenerator = Effect.Effect<void, never, Database.Service | Feed.ContextFeedService | Feed.FeedService>;
33
32
 
34
33
  type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
35
34
 
36
35
  const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
37
36
  const [space] = useSpaces();
38
- const queue = useMemo<Queue<Message.Message> | undefined>(() => space?.queues.create(), [space]);
39
- const messages = useQuery(queue, Filter.type(Message.Message));
37
+ const feed = useMemo<Feed.Feed | undefined>(
38
+ () => (space ? space.db.add(Feed.make({ name: 'chat' })) : undefined),
39
+ [space],
40
+ );
41
+ const messages = useQuery(
42
+ space?.db,
43
+ feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
44
+ );
40
45
  const [done, setDone] = useState(false);
41
46
 
42
47
  // Generate messages.
43
48
  useEffect(() => {
44
- if (!space || !queue) {
49
+ if (!space || !feed) {
45
50
  return;
46
51
  }
47
52
 
@@ -55,13 +60,21 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
55
60
  }
56
61
 
57
62
  setDone(true);
58
- }).pipe(Effect.provide(Layer.mergeAll(Database.layer(space.db), ContextQueueService.layer(queue)))),
63
+ }).pipe(
64
+ Effect.provide(
65
+ Layer.mergeAll(
66
+ Database.layer(space.db),
67
+ Feed.ContextFeedService.layer(feed),
68
+ createFeedServiceLayer(space.queues),
69
+ ),
70
+ ),
71
+ ),
59
72
  );
60
73
 
61
74
  return () => {
62
- void runAndForwardErrors(Fiber.interrupt(fiber));
75
+ void EffectEx.runAndForwardErrors(Fiber.interrupt(fiber));
63
76
  };
64
- }, [space, queue, generator]);
77
+ }, [space, feed, generator, delay]);
65
78
 
66
79
  if (wait && !done) {
67
80
  return <Loading data={{ wait, done }} />;
@@ -70,29 +83,10 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStor
70
83
  return (
71
84
  <EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
72
85
  <ChatThread {...props} messages={messages} />
73
- <PreviewCard />
74
86
  </EditorPreviewProvider>
75
87
  );
76
88
  };
77
89
 
78
- const PreviewCard = () => {
79
- const { target } = useEditorPreview('PreviewCard');
80
-
81
- return (
82
- <Popover.Portal>
83
- <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
84
- <Popover.Viewport>
85
- <Card.Root>
86
- <Card.Heading>{target?.label}</Card.Heading>
87
- {target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
88
- </Card.Root>
89
- </Popover.Viewport>
90
- <Popover.Arrow />
91
- </Popover.Content>
92
- </Popover.Portal>
93
- );
94
- };
95
-
96
90
  const meta = {
97
91
  title: 'plugins/plugin-assistant/components/ChatThread',
98
92
  component: ChatThread,
@@ -103,6 +97,8 @@ const meta = {
103
97
  withPluginManager({
104
98
  plugins: [
105
99
  ...corePlugins(),
100
+ StorybookPlugin({}),
101
+ PreviewPlugin(),
106
102
  ClientPlugin({
107
103
  types: [Organization.Organization, Person.Person],
108
104
  onClientInitialized: ({ client }) =>
@@ -136,7 +132,7 @@ export const Delayed: Story = {
136
132
  delay: 500,
137
133
  options: {
138
134
  autoScroll: true,
139
- wire: true,
135
+ typewriter: true,
140
136
  cursor: true,
141
137
  },
142
138
  },