@dxos/plugin-assistant 0.8.4-main.4a85c3132b → 0.8.4-main.51f1e5ca51

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 (696) 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 +26 -3
  4. package/dist/lib/browser/blueprints/index.mjs.map +4 -4
  5. package/dist/lib/browser/chunk-RIJNPAYC.mjs +176 -0
  6. package/dist/lib/browser/chunk-RIJNPAYC.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-SEMCG4ZK.mjs +195 -0
  8. package/dist/lib/browser/chunk-SEMCG4ZK.mjs.map +7 -0
  9. package/dist/lib/browser/cli/index.mjs +73 -0
  10. package/dist/lib/browser/cli/index.mjs.map +7 -0
  11. package/dist/lib/browser/create-chat-FZJASOQS.mjs +74 -0
  12. package/dist/lib/browser/create-chat-FZJASOQS.mjs.map +7 -0
  13. package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs +65 -0
  14. package/dist/lib/browser/ensure-companion-chat-PHUWWFVY.mjs.map +7 -0
  15. package/dist/lib/browser/index.mjs +3258 -274
  16. package/dist/lib/browser/index.mjs.map +4 -4
  17. package/dist/lib/browser/meta.json +1 -1
  18. package/dist/lib/browser/on-create-space-OQNCM7NC.mjs +22 -0
  19. package/dist/lib/browser/on-create-space-OQNCM7NC.mjs.map +7 -0
  20. package/dist/lib/browser/operations/index.mjs +13 -0
  21. package/dist/lib/browser/operations/index.mjs.map +7 -0
  22. package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs +22 -0
  23. package/dist/lib/browser/resolve-navigation-targets-PMNR7D3P.mjs.map +7 -0
  24. package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs +107 -0
  25. package/dist/lib/browser/run-prompt-in-new-chat-4XDYFKCV.mjs.map +7 -0
  26. package/dist/lib/browser/set-current-chat-7V4DA66I.mjs +54 -0
  27. package/dist/lib/browser/set-current-chat-7V4DA66I.mjs.map +7 -0
  28. package/dist/lib/browser/translations.mjs +171 -0
  29. package/dist/lib/browser/translations.mjs.map +7 -0
  30. package/dist/lib/browser/types/index.mjs +1 -6
  31. package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs +56 -0
  32. package/dist/lib/browser/update-chat-name-ZGMU2UGN.mjs.map +7 -0
  33. package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs +41 -0
  34. package/dist/lib/node-esm/AssistantSettings-23A5IMHS.mjs.map +7 -0
  35. package/dist/lib/node-esm/blueprints/index.mjs +26 -3
  36. package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
  37. package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs +177 -0
  38. package/dist/lib/node-esm/chunk-NCIZY5ZV.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs +196 -0
  40. package/dist/lib/node-esm/chunk-XAFVSEUJ.mjs.map +7 -0
  41. package/dist/lib/node-esm/cli/index.mjs +74 -0
  42. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  43. package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs +75 -0
  44. package/dist/lib/node-esm/create-chat-RY6A4WUV.mjs.map +7 -0
  45. package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs +66 -0
  46. package/dist/lib/node-esm/ensure-companion-chat-BTDU5TS2.mjs.map +7 -0
  47. package/dist/lib/node-esm/index.mjs +3258 -274
  48. package/dist/lib/node-esm/index.mjs.map +4 -4
  49. package/dist/lib/node-esm/meta.json +1 -1
  50. package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs +23 -0
  51. package/dist/lib/node-esm/on-create-space-4LWCYT3H.mjs.map +7 -0
  52. package/dist/lib/node-esm/operations/index.mjs +14 -0
  53. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  54. package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs +23 -0
  55. package/dist/lib/node-esm/resolve-navigation-targets-GHS3XPVP.mjs.map +7 -0
  56. package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs +108 -0
  57. package/dist/lib/node-esm/run-prompt-in-new-chat-UF54E34O.mjs.map +7 -0
  58. package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs +55 -0
  59. package/dist/lib/node-esm/set-current-chat-SWPAOLZL.mjs.map +7 -0
  60. package/dist/lib/node-esm/translations.mjs +172 -0
  61. package/dist/lib/node-esm/translations.mjs.map +7 -0
  62. package/dist/lib/node-esm/types/index.mjs +1 -6
  63. package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs +57 -0
  64. package/dist/lib/node-esm/update-chat-name-CW6K5M37.mjs.map +7 -0
  65. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  66. package/dist/types/src/blueprints/assistant/blueprint.d.ts +2 -2
  67. package/dist/types/src/blueprints/assistant/blueprint.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -0
  71. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts +9 -0
  73. package/dist/types/src/capabilities/companion-chat-provisioner.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/index.d.ts +29 -11
  76. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/local-model-resolver.d.ts +16 -0
  78. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/{repair/repair.d.ts → markdown.d.ts} +2 -3
  80. package/dist/types/src/capabilities/markdown.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/migrations.d.ts +5 -0
  82. package/dist/types/src/capabilities/migrations.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  84. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  86. package/dist/types/src/capabilities/settings.d.ts +6 -0
  87. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/state.d.ts +21 -0
  89. package/dist/types/src/capabilities/state.d.ts.map +1 -0
  90. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -0
  91. package/dist/types/src/cli/index.d.ts +2 -0
  92. package/dist/types/src/cli/index.d.ts.map +1 -0
  93. package/dist/types/src/cli/plugin.d.ts +10 -0
  94. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  95. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +6 -0
  96. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -0
  97. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts +15 -0
  98. package/dist/types/src/components/AssistantSettings/AssistantSettings.stories.d.ts.map +1 -0
  99. package/dist/types/src/components/AssistantSettings/index.d.ts +2 -0
  100. package/dist/types/src/components/AssistantSettings/index.d.ts.map +1 -0
  101. package/dist/types/src/components/Chat/Chat.d.ts +37 -47
  102. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  103. package/dist/types/src/components/Chat/context.d.ts +29 -0
  104. package/dist/types/src/components/Chat/context.d.ts.map +1 -0
  105. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts +2 -1
  106. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  107. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +6 -2
  108. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  109. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts +19 -0
  110. package/dist/types/src/components/ChatPrompt/ChatOptions.stories.d.ts.map +1 -0
  111. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  112. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts +28 -0
  113. package/dist/types/src/components/ChatPrompt/ChatPrompt.d.ts.map +1 -0
  114. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  115. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts +20 -0
  116. package/dist/types/src/components/ChatPrompt/ChatStatus.d.ts.map +1 -0
  117. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  118. package/dist/types/src/components/ChatPrompt/index.d.ts +2 -0
  119. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  120. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts +14 -0
  121. package/dist/types/src/components/ChatThread/Anchor.stories.d.ts.map +1 -0
  122. package/dist/types/src/components/ChatThread/ChatThread.d.ts +6 -3
  123. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  124. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +9 -428
  125. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  126. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  127. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts +42 -0
  128. package/dist/types/src/components/ChatThread/MarkdownStream.stories.d.ts.map +1 -0
  129. package/dist/types/src/components/ChatThread/registry.d.ts +18 -0
  130. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  131. package/dist/types/src/components/ChatThread/sync.d.ts +44 -17
  132. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  133. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts +18 -0
  134. package/dist/types/src/components/ChatThread/tool-widget-state.d.ts.map +1 -0
  135. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts +2 -0
  136. package/dist/types/src/components/ChatThread/tool-widget-state.test.d.ts.map +1 -0
  137. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts +8 -0
  138. package/dist/types/src/components/ChatThread/widgets/FallbackWidget.d.ts.map +1 -0
  139. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts +25 -0
  140. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.d.ts.map +1 -0
  141. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts +18 -0
  142. package/dist/types/src/components/ChatThread/widgets/ReasoningWidget.stories.d.ts.map +1 -0
  143. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts +9 -0
  144. package/dist/types/src/components/ChatThread/widgets/ReferenceWidget.d.ts.map +1 -0
  145. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts +14 -0
  146. package/dist/types/src/components/ChatThread/widgets/SelectWidget.d.ts.map +1 -0
  147. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts +12 -0
  148. package/dist/types/src/components/ChatThread/widgets/StatsWidget.d.ts.map +1 -0
  149. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts +25 -0
  150. package/dist/types/src/components/ChatThread/widgets/StatusWidget.d.ts.map +1 -0
  151. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts +11 -0
  152. package/dist/types/src/components/ChatThread/widgets/SuggestionWidget.d.ts.map +1 -0
  153. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts +5 -0
  154. package/dist/types/src/components/ChatThread/widgets/SummaryWidget.d.ts.map +1 -0
  155. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts +9 -0
  156. package/dist/types/src/components/ChatThread/widgets/ToolWidget.d.ts.map +1 -0
  157. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts +15 -0
  158. package/dist/types/src/components/ChatThread/widgets/ToolWidget.stories.d.ts.map +1 -0
  159. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts +5 -0
  160. package/dist/types/src/components/ChatThread/widgets/defaults.d.ts.map +1 -0
  161. package/dist/types/src/components/ChatThread/widgets/index.d.ts +10 -0
  162. package/dist/types/src/components/ChatThread/widgets/index.d.ts.map +1 -0
  163. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts +11 -0
  164. package/dist/types/src/components/ProcessTree/ProcessTree.d.ts.map +1 -0
  165. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts +7 -0
  166. package/dist/types/src/components/ProcessTree/ProcessTree.stories.d.ts.map +1 -0
  167. package/dist/types/src/components/ProcessTree/index.d.ts +2 -0
  168. package/dist/types/src/components/ProcessTree/index.d.ts.map +1 -0
  169. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +6 -5
  170. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  171. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +1 -419
  172. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  173. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +3 -3
  174. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  175. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +1 -419
  176. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  177. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  178. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -1
  179. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +4 -13
  180. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  181. package/dist/types/src/components/Toolbox/Toolbox.d.ts +11 -9
  182. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  183. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +1 -419
  184. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  185. package/dist/types/src/components/index.d.ts +3 -0
  186. package/dist/types/src/components/index.d.ts.map +1 -1
  187. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts +6 -0
  188. package/dist/types/src/containers/AgentArticle/AgentArticle.d.ts.map +1 -0
  189. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts +21 -0
  190. package/dist/types/src/containers/AgentArticle/AgentArticle.stories.d.ts.map +1 -0
  191. package/dist/types/src/containers/AgentArticle/index.d.ts +2 -0
  192. package/dist/types/src/containers/AgentArticle/index.d.ts.map +1 -0
  193. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts +6 -0
  194. package/dist/types/src/containers/AgentProperties/AgentProperties.d.ts.map +1 -0
  195. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts +16 -0
  196. package/dist/types/src/containers/AgentProperties/AgentProperties.stories.d.ts.map +1 -0
  197. package/dist/types/src/containers/AgentProperties/index.d.ts +2 -0
  198. package/dist/types/src/containers/AgentProperties/index.d.ts.map +1 -0
  199. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts +4 -4
  200. package/dist/types/src/containers/BlueprintArticle/BlueprintArticle.d.ts.map +1 -1
  201. package/dist/types/src/containers/BlueprintArticle/index.d.ts +1 -2
  202. package/dist/types/src/containers/BlueprintArticle/index.d.ts.map +1 -1
  203. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts +14 -8
  204. package/dist/types/src/containers/ChatCompanion/ChatCompanion.d.ts.map +1 -1
  205. package/dist/types/src/containers/ChatCompanion/index.d.ts +1 -2
  206. package/dist/types/src/containers/ChatCompanion/index.d.ts.map +1 -1
  207. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts +6 -12
  208. package/dist/types/src/containers/ChatContainer/ChatContainer.d.ts.map +1 -1
  209. package/dist/types/src/containers/ChatContainer/index.d.ts +1 -2
  210. package/dist/types/src/containers/ChatContainer/index.d.ts.map +1 -1
  211. package/dist/types/src/containers/ChatDialog/ChatDialog.d.ts.map +1 -1
  212. package/dist/types/src/containers/ChatDialog/index.d.ts +1 -2
  213. package/dist/types/src/containers/ChatDialog/index.d.ts.map +1 -1
  214. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts +6 -0
  215. package/dist/types/src/containers/RoutineArticle/RoutineArticle.d.ts.map +1 -0
  216. package/dist/types/src/containers/RoutineArticle/index.d.ts +2 -0
  217. package/dist/types/src/containers/RoutineArticle/index.d.ts.map +1 -0
  218. package/dist/types/src/containers/RoutineList/RoutineList.d.ts +6 -0
  219. package/dist/types/src/containers/RoutineList/RoutineList.d.ts.map +1 -0
  220. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts +21 -0
  221. package/dist/types/src/containers/RoutineList/RoutineList.stories.d.ts.map +1 -0
  222. package/dist/types/src/containers/RoutineList/index.d.ts +2 -0
  223. package/dist/types/src/containers/RoutineList/index.d.ts.map +1 -0
  224. package/dist/types/src/containers/TracePanel/TracePanel.d.ts +8 -0
  225. package/dist/types/src/containers/TracePanel/TracePanel.d.ts.map +1 -0
  226. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts +13 -0
  227. package/dist/types/src/containers/TracePanel/TracePanel.stories.d.ts.map +1 -0
  228. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts +19 -0
  229. package/dist/types/src/containers/TracePanel/dxn-extractor.d.ts.map +1 -0
  230. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts +2 -0
  231. package/dist/types/src/containers/TracePanel/dxn-extractor.test.d.ts.map +1 -0
  232. package/dist/types/src/containers/TracePanel/execution-graph.d.ts +97 -0
  233. package/dist/types/src/containers/TracePanel/execution-graph.d.ts.map +1 -0
  234. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts +2 -0
  235. package/dist/types/src/containers/TracePanel/execution-graph.test.d.ts.map +1 -0
  236. package/dist/types/src/containers/TracePanel/index.d.ts +4 -0
  237. package/dist/types/src/containers/TracePanel/index.d.ts.map +1 -0
  238. package/dist/types/src/containers/TracePanel/testing/index.d.ts +3 -0
  239. package/dist/types/src/containers/TracePanel/testing/index.d.ts.map +1 -0
  240. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts +14 -0
  241. package/dist/types/src/containers/TracePanel/testing/simulated-agent.d.ts.map +1 -0
  242. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts +12 -0
  243. package/dist/types/src/containers/TracePanel/testing/snapshot-playback.d.ts.map +1 -0
  244. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts +3 -2
  245. package/dist/types/src/containers/TriggerStatus/TriggerStatus.d.ts.map +1 -1
  246. package/dist/types/src/containers/TriggerStatus/index.d.ts +1 -2
  247. package/dist/types/src/containers/TriggerStatus/index.d.ts.map +1 -1
  248. package/dist/types/src/containers/index.d.ts +5 -3
  249. package/dist/types/src/containers/index.d.ts.map +1 -1
  250. package/dist/types/src/extensions/index.d.ts +2 -0
  251. package/dist/types/src/extensions/index.d.ts.map +1 -0
  252. package/dist/types/src/extensions/prompt-extension.d.ts +10 -0
  253. package/dist/types/src/extensions/prompt-extension.d.ts.map +1 -0
  254. package/dist/types/src/hooks/index.d.ts +2 -0
  255. package/dist/types/src/hooks/index.d.ts.map +1 -1
  256. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +1 -1
  257. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  258. package/dist/types/src/hooks/useChatKeymap.d.ts +12 -0
  259. package/dist/types/src/hooks/useChatKeymap.d.ts.map +1 -0
  260. package/dist/types/src/hooks/useChatProcessor.d.ts +6 -6
  261. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  262. package/dist/types/src/hooks/useChatServices.d.ts +3 -6
  263. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  264. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  265. package/dist/types/src/hooks/useContextBinder.d.ts +3 -2
  266. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  267. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  268. package/dist/types/src/hooks/useDebug.d.ts +10 -0
  269. package/dist/types/src/hooks/useDebug.d.ts.map +1 -0
  270. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -1
  271. package/dist/types/src/hooks/useFlush.d.ts +1 -1
  272. package/dist/types/src/hooks/useFlush.d.ts.map +1 -1
  273. package/dist/types/src/hooks/usePresets.d.ts +1 -1
  274. package/dist/types/src/hooks/usePresets.d.ts.map +1 -1
  275. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  276. package/dist/types/src/index.d.ts +0 -4
  277. package/dist/types/src/index.d.ts.map +1 -1
  278. package/dist/types/src/meta.d.ts +2 -0
  279. package/dist/types/src/meta.d.ts.map +1 -1
  280. package/dist/types/src/operations/create-chat.d.ts +5 -0
  281. package/dist/types/src/operations/create-chat.d.ts.map +1 -0
  282. package/dist/types/src/operations/definitions.d.ts +140 -0
  283. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  284. package/dist/types/src/operations/ensure-companion-chat.d.ts +5 -0
  285. package/dist/types/src/operations/ensure-companion-chat.d.ts.map +1 -0
  286. package/dist/types/src/operations/index.d.ts +4 -0
  287. package/dist/types/src/operations/index.d.ts.map +1 -0
  288. package/dist/types/src/operations/on-create-space.d.ts +5 -0
  289. package/dist/types/src/operations/on-create-space.d.ts.map +1 -0
  290. package/dist/types/src/operations/prompt.test.d.ts +2 -0
  291. package/dist/types/src/operations/prompt.test.d.ts.map +1 -0
  292. package/dist/types/src/operations/resolve-navigation-targets.d.ts +15 -0
  293. package/dist/types/src/operations/resolve-navigation-targets.d.ts.map +1 -0
  294. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts +5 -0
  295. package/dist/types/src/operations/run-prompt-in-new-chat.d.ts.map +1 -0
  296. package/dist/types/src/operations/set-current-chat.d.ts +5 -0
  297. package/dist/types/src/operations/set-current-chat.d.ts.map +1 -0
  298. package/dist/types/src/operations/update-chat-name.d.ts +5 -0
  299. package/dist/types/src/operations/update-chat-name.d.ts.map +1 -0
  300. package/dist/types/src/processor/index.d.ts +0 -1
  301. package/dist/types/src/processor/index.d.ts.map +1 -1
  302. package/dist/types/src/processor/presets.d.ts +1 -1
  303. package/dist/types/src/processor/presets.d.ts.map +1 -1
  304. package/dist/types/src/processor/processor.d.ts +31 -30
  305. package/dist/types/src/processor/processor.d.ts.map +1 -1
  306. package/dist/types/src/queue-logger.d.ts.map +1 -1
  307. package/dist/types/src/testing/index.d.ts +1 -0
  308. package/dist/types/src/testing/index.d.ts.map +1 -1
  309. package/dist/types/src/testing/test-generator.d.ts +1 -1
  310. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  311. package/dist/types/src/testing/test-generator.test.d.ts +2 -0
  312. package/dist/types/src/testing/test-generator.test.d.ts.map +1 -0
  313. package/dist/types/src/testing/test-services.d.ts +1 -1
  314. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  315. package/dist/types/src/testing/test-trace.d.ts +5 -0
  316. package/dist/types/src/testing/test-trace.d.ts.map +1 -0
  317. package/dist/types/src/testing/trace-timeline.test.d.ts +2 -0
  318. package/dist/types/src/testing/trace-timeline.test.d.ts.map +1 -0
  319. package/dist/types/src/translations.d.ts +2 -419
  320. package/dist/types/src/translations.d.ts.map +1 -1
  321. package/dist/types/src/types/Assistant.d.ts +30 -14
  322. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  323. package/dist/types/src/types/Settings.d.ts +26 -0
  324. package/dist/types/src/types/Settings.d.ts.map +1 -0
  325. package/dist/types/src/types/capabilities.d.ts +12 -13
  326. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  327. package/dist/types/src/types/events.d.ts.map +1 -1
  328. package/dist/types/src/types/index.d.ts +0 -2
  329. package/dist/types/src/types/index.d.ts.map +1 -1
  330. package/dist/types/src/types/service.d.ts +1 -1
  331. package/dist/types/src/types/service.d.ts.map +1 -1
  332. package/dist/types/tsconfig.tsbuildinfo +1 -1
  333. package/package.json +116 -95
  334. package/src/AssistantPlugin.tsx +117 -53
  335. package/src/blueprints/assistant/blueprint.test.ts +15 -17
  336. package/src/blueprints/assistant/blueprint.ts +11 -7
  337. package/src/capabilities/app-graph-builder.ts +162 -0
  338. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +22 -18
  339. package/src/capabilities/companion-chat-provisioner.ts +164 -0
  340. package/src/capabilities/index.ts +22 -11
  341. package/src/capabilities/{local-model-resolver/local-model-resolver.ts → local-model-resolver.ts} +14 -4
  342. package/src/capabilities/markdown.ts +40 -0
  343. package/src/capabilities/migrations.ts +28 -0
  344. package/src/capabilities/operation-handler.ts +16 -0
  345. package/src/capabilities/react-surface.tsx +167 -0
  346. package/src/capabilities/{settings/settings.ts → settings.ts} +2 -2
  347. package/src/capabilities/{state/state.ts → state.ts} +11 -3
  348. package/src/capabilities/{toolkit/toolkit.ts → toolkit.ts} +2 -4
  349. package/src/{components/Typewriter → cli}/index.ts +1 -1
  350. package/src/cli/plugin.ts +83 -0
  351. package/src/components/AssistantSettings/AssistantSettings.stories.tsx +35 -0
  352. package/src/components/AssistantSettings/AssistantSettings.tsx +43 -0
  353. package/src/components/AssistantSettings/index.ts +5 -0
  354. package/src/components/Chat/Chat.tsx +96 -294
  355. package/src/components/Chat/context.ts +39 -0
  356. package/src/components/ChatPrompt/ChatActions.tsx +28 -16
  357. package/src/components/ChatPrompt/ChatOptions.stories.tsx +136 -0
  358. package/src/components/ChatPrompt/ChatOptions.tsx +228 -53
  359. package/src/components/ChatPrompt/ChatPrompt.tsx +179 -0
  360. package/src/components/ChatPrompt/ChatReferences.tsx +4 -4
  361. package/src/components/ChatPrompt/ChatStatus.tsx +123 -0
  362. package/src/components/ChatPrompt/index.ts +2 -0
  363. package/src/components/ChatThread/Anchor.stories.tsx +95 -0
  364. package/src/components/ChatThread/ChatThread.stories.tsx +61 -68
  365. package/src/components/ChatThread/ChatThread.tsx +46 -29
  366. package/src/components/ChatThread/DEBUG.md +41 -0
  367. package/src/components/ChatThread/MarkdownStream.stories.tsx +281 -0
  368. package/src/components/ChatThread/registry.tsx +144 -65
  369. package/src/components/ChatThread/sync.test.ts +182 -22
  370. package/src/components/ChatThread/sync.ts +93 -103
  371. package/src/components/ChatThread/testing/reasoning.md +25 -0
  372. package/src/components/ChatThread/testing/thinking.md +21 -0
  373. package/src/components/ChatThread/testing/thread-1.md +30 -0
  374. package/src/components/ChatThread/testing/{thread.md → thread-2.md} +19 -0
  375. package/src/components/ChatThread/testing/thread-widgets.md +79 -0
  376. package/src/components/ChatThread/tool-widget-state.test.ts +34 -0
  377. package/src/components/ChatThread/tool-widget-state.ts +48 -0
  378. package/src/components/ChatThread/widgets/FallbackWidget.tsx +26 -0
  379. package/src/components/ChatThread/widgets/ReasoningWidget.stories.tsx +68 -0
  380. package/src/components/ChatThread/widgets/ReasoningWidget.ts +133 -0
  381. package/src/components/ChatThread/widgets/ReferenceWidget.ts +33 -0
  382. package/src/components/ChatThread/widgets/SelectWidget.ts +39 -0
  383. package/src/components/ChatThread/widgets/StatsWidget.ts +31 -0
  384. package/src/components/ChatThread/widgets/StatusWidget.ts +133 -0
  385. package/src/components/ChatThread/widgets/SuggestionWidget.ts +41 -0
  386. package/src/components/ChatThread/widgets/SummaryWidget.tsx +29 -0
  387. package/src/components/ChatThread/widgets/ToolWidget.stories.tsx +55 -0
  388. package/src/components/ChatThread/widgets/ToolWidget.tsx +156 -0
  389. package/src/components/ChatThread/widgets/defaults.ts +8 -0
  390. package/src/components/ChatThread/widgets/index.ts +13 -0
  391. package/src/components/ProcessTree/ProcessTree.stories.tsx +83 -0
  392. package/src/components/ProcessTree/ProcessTree.tsx +118 -0
  393. package/src/components/ProcessTree/index.ts +5 -0
  394. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +4 -8
  395. package/src/components/TemplateEditor/TemplateEditor.tsx +51 -43
  396. package/src/components/TemplateEditor/TemplateForm.stories.tsx +6 -4
  397. package/src/components/TemplateEditor/TemplateForm.tsx +6 -6
  398. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +1 -1
  399. package/src/components/ToolBlock/ToolBlock.tsx +20 -19
  400. package/src/components/Toolbox/Toolbox.stories.tsx +3 -4
  401. package/src/components/Toolbox/Toolbox.tsx +64 -57
  402. package/src/components/index.ts +5 -0
  403. package/src/containers/AgentArticle/AgentArticle.stories.tsx +120 -0
  404. package/src/containers/AgentArticle/AgentArticle.tsx +200 -0
  405. package/src/containers/AgentArticle/index.ts +5 -0
  406. package/src/containers/AgentProperties/AgentProperties.stories.tsx +101 -0
  407. package/src/containers/AgentProperties/AgentProperties.tsx +127 -0
  408. package/src/containers/AgentProperties/index.ts +5 -0
  409. package/src/containers/BlueprintArticle/BlueprintArticle.tsx +7 -8
  410. package/src/containers/BlueprintArticle/index.ts +1 -3
  411. package/src/containers/ChatCompanion/ChatCompanion.tsx +18 -101
  412. package/src/containers/ChatCompanion/index.ts +1 -3
  413. package/src/containers/ChatContainer/ChatContainer.tsx +61 -25
  414. package/src/containers/ChatContainer/index.ts +1 -3
  415. package/src/containers/ChatDialog/ChatDialog.tsx +8 -14
  416. package/src/containers/ChatDialog/index.ts +1 -3
  417. package/src/containers/{PromptArticle/PromptArticle.tsx → RoutineArticle/RoutineArticle.tsx} +14 -14
  418. package/src/containers/RoutineArticle/index.ts +5 -0
  419. package/src/containers/RoutineList/RoutineList.stories.tsx +130 -0
  420. package/src/containers/RoutineList/RoutineList.tsx +50 -0
  421. package/src/containers/RoutineList/index.ts +5 -0
  422. package/src/containers/TracePanel/TracePanel.stories.tsx +278 -0
  423. package/src/containers/TracePanel/TracePanel.tsx +138 -0
  424. package/src/containers/TracePanel/dxn-extractor.test.ts +153 -0
  425. package/src/containers/TracePanel/dxn-extractor.ts +178 -0
  426. package/src/containers/TracePanel/execution-graph.test.ts +382 -0
  427. package/src/containers/TracePanel/execution-graph.ts +579 -0
  428. package/src/containers/TracePanel/index.ts +9 -0
  429. package/src/containers/TracePanel/testing/index.ts +6 -0
  430. package/src/containers/TracePanel/testing/simulated-agent.ts +114 -0
  431. package/src/containers/TracePanel/testing/snapshot-playback.ts +45 -0
  432. package/src/containers/TriggerStatus/TriggerStatus.tsx +40 -61
  433. package/src/containers/TriggerStatus/index.ts +1 -3
  434. package/src/containers/index.ts +5 -4
  435. package/src/extensions/index.ts +5 -0
  436. package/src/extensions/prompt-extension.ts +111 -0
  437. package/src/hooks/index.ts +2 -0
  438. package/src/hooks/useBlueprintRegistry.ts +2 -1
  439. package/src/hooks/useChatKeymap.ts +52 -0
  440. package/src/hooks/useChatProcessor.ts +36 -24
  441. package/src/hooks/useChatServices.ts +6 -27
  442. package/src/hooks/useChatToolbarActions.ts +9 -9
  443. package/src/hooks/useContextBinder.ts +17 -6
  444. package/src/hooks/useContextObjects.ts +8 -4
  445. package/src/hooks/useDebug.ts +38 -0
  446. package/src/hooks/useFilteredTypes.ts +1 -1
  447. package/src/hooks/usePresets.ts +2 -1
  448. package/src/index.ts +0 -4
  449. package/src/meta.ts +6 -3
  450. package/src/operations/create-chat.ts +80 -0
  451. package/src/operations/definitions.ts +127 -0
  452. package/src/operations/ensure-companion-chat.ts +61 -0
  453. package/src/operations/index.ts +17 -0
  454. package/src/operations/on-create-space.ts +24 -0
  455. package/src/operations/prompt.test.ts +78 -0
  456. package/src/operations/resolve-navigation-targets.ts +26 -0
  457. package/src/operations/run-prompt-in-new-chat.ts +113 -0
  458. package/src/operations/set-current-chat.ts +50 -0
  459. package/src/operations/update-chat-name.ts +61 -0
  460. package/src/processor/index.ts +0 -1
  461. package/src/processor/presets.ts +11 -3
  462. package/src/processor/processor.test.ts +18 -51
  463. package/src/processor/processor.ts +182 -157
  464. package/src/queue-logger.ts +19 -8
  465. package/src/testing/data/trace-timeline.dx.json +4657 -0
  466. package/src/testing/index.ts +1 -0
  467. package/src/testing/test-generator.test.ts +81 -0
  468. package/src/testing/test-generator.ts +80 -43
  469. package/src/testing/test-services.ts +1 -1
  470. package/src/testing/test-trace.ts +20 -0
  471. package/src/testing/trace-timeline.conversations.json +1 -0
  472. package/src/testing/trace-timeline.test.ts +250 -0
  473. package/src/translations.ts +150 -106
  474. package/src/types/Assistant.ts +14 -17
  475. package/src/types/Settings.ts +76 -0
  476. package/src/types/capabilities.ts +11 -3
  477. package/src/types/events.ts +2 -2
  478. package/src/types/index.ts +0 -2
  479. package/src/types/service.ts +3 -3
  480. package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs +0 -93
  481. package/dist/lib/browser/AssistantSettings-2LFAG5OQ.mjs.map +0 -7
  482. package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs +0 -36
  483. package/dist/lib/browser/BlueprintArticle-CCS25MNW.mjs.map +0 -7
  484. package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs +0 -202
  485. package/dist/lib/browser/ChatCompanion-UGD4V34A.mjs.map +0 -7
  486. package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs +0 -12
  487. package/dist/lib/browser/ChatContainer-ZGRSZ5EU.mjs.map +0 -7
  488. package/dist/lib/browser/ChatDialog-AET7GVIB.mjs +0 -85
  489. package/dist/lib/browser/ChatDialog-AET7GVIB.mjs.map +0 -7
  490. package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs +0 -91
  491. package/dist/lib/browser/ProjectArticle-QDBTIFNE.mjs.map +0 -7
  492. package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs +0 -194
  493. package/dist/lib/browser/ProjectSettings-R6RRARLO.mjs.map +0 -7
  494. package/dist/lib/browser/PromptArticle-USQO4WX6.mjs +0 -71
  495. package/dist/lib/browser/PromptArticle-USQO4WX6.mjs.map +0 -7
  496. package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs +0 -122
  497. package/dist/lib/browser/TriggerStatus-65X3EUSN.mjs.map +0 -7
  498. package/dist/lib/browser/ai-service-CY2BYPH6.mjs +0 -22
  499. package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +0 -7
  500. package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs +0 -234
  501. package/dist/lib/browser/app-graph-builder-SFYYUKTT.mjs.map +0 -7
  502. package/dist/lib/browser/blueprint-definition-5LQNBZON.mjs +0 -35
  503. package/dist/lib/browser/blueprint-definition-5LQNBZON.mjs.map +0 -7
  504. package/dist/lib/browser/chunk-7DXYAXLZ.mjs +0 -230
  505. package/dist/lib/browser/chunk-7DXYAXLZ.mjs.map +0 -7
  506. package/dist/lib/browser/chunk-EXVT7D4B.mjs +0 -23
  507. package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +0 -7
  508. package/dist/lib/browser/chunk-JYY5AD65.mjs +0 -286
  509. package/dist/lib/browser/chunk-JYY5AD65.mjs.map +0 -7
  510. package/dist/lib/browser/chunk-LEXIQDXZ.mjs +0 -26
  511. package/dist/lib/browser/chunk-LEXIQDXZ.mjs.map +0 -7
  512. package/dist/lib/browser/chunk-RU4G5NY4.mjs +0 -69
  513. package/dist/lib/browser/chunk-RU4G5NY4.mjs.map +0 -7
  514. package/dist/lib/browser/chunk-UUA6GNGG.mjs +0 -2125
  515. package/dist/lib/browser/chunk-UUA6GNGG.mjs.map +0 -7
  516. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +0 -21
  517. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +0 -7
  518. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +0 -20
  519. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +0 -7
  520. package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs +0 -136
  521. package/dist/lib/browser/operation-resolver-ELXDQZEG.mjs.map +0 -7
  522. package/dist/lib/browser/react-surface-KYQSZO2I.mjs +0 -144
  523. package/dist/lib/browser/react-surface-KYQSZO2I.mjs.map +0 -7
  524. package/dist/lib/browser/repair-ZFZWZALX.mjs +0 -52
  525. package/dist/lib/browser/repair-ZFZWZALX.mjs.map +0 -7
  526. package/dist/lib/browser/settings-YREVQAZ5.mjs +0 -33
  527. package/dist/lib/browser/settings-YREVQAZ5.mjs.map +0 -7
  528. package/dist/lib/browser/state-MPG42ZO4.mjs +0 -26
  529. package/dist/lib/browser/state-MPG42ZO4.mjs.map +0 -7
  530. package/dist/lib/browser/toolkit-XRSBBB3L.mjs +0 -16
  531. package/dist/lib/browser/toolkit-XRSBBB3L.mjs.map +0 -7
  532. package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs +0 -94
  533. package/dist/lib/node-esm/AssistantSettings-QWFEMJG7.mjs.map +0 -7
  534. package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs +0 -37
  535. package/dist/lib/node-esm/BlueprintArticle-SNEN6LOY.mjs.map +0 -7
  536. package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs +0 -203
  537. package/dist/lib/node-esm/ChatCompanion-NP4R5BFE.mjs.map +0 -7
  538. package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs +0 -13
  539. package/dist/lib/node-esm/ChatContainer-IFHDIFJH.mjs.map +0 -7
  540. package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs +0 -86
  541. package/dist/lib/node-esm/ChatDialog-UZNQBTKZ.mjs.map +0 -7
  542. package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs +0 -92
  543. package/dist/lib/node-esm/ProjectArticle-BCIBESJN.mjs.map +0 -7
  544. package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs +0 -195
  545. package/dist/lib/node-esm/ProjectSettings-Q5QY6BYS.mjs.map +0 -7
  546. package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs +0 -72
  547. package/dist/lib/node-esm/PromptArticle-PGMJMQK7.mjs.map +0 -7
  548. package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs +0 -123
  549. package/dist/lib/node-esm/TriggerStatus-UR5S7PXJ.mjs.map +0 -7
  550. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +0 -23
  551. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +0 -7
  552. package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs +0 -235
  553. package/dist/lib/node-esm/app-graph-builder-E25JXI34.mjs.map +0 -7
  554. package/dist/lib/node-esm/blueprint-definition-CMJWGGJO.mjs +0 -36
  555. package/dist/lib/node-esm/blueprint-definition-CMJWGGJO.mjs.map +0 -7
  556. package/dist/lib/node-esm/chunk-3QBVFAYO.mjs +0 -28
  557. package/dist/lib/node-esm/chunk-3QBVFAYO.mjs.map +0 -7
  558. package/dist/lib/node-esm/chunk-6NCLKQCL.mjs +0 -70
  559. package/dist/lib/node-esm/chunk-6NCLKQCL.mjs.map +0 -7
  560. package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs +0 -2126
  561. package/dist/lib/node-esm/chunk-GZ4ERNT2.mjs.map +0 -7
  562. package/dist/lib/node-esm/chunk-JMBYVUD6.mjs +0 -288
  563. package/dist/lib/node-esm/chunk-JMBYVUD6.mjs.map +0 -7
  564. package/dist/lib/node-esm/chunk-MWYYLALM.mjs +0 -231
  565. package/dist/lib/node-esm/chunk-MWYYLALM.mjs.map +0 -7
  566. package/dist/lib/node-esm/chunk-POWB2BPC.mjs +0 -25
  567. package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +0 -7
  568. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +0 -22
  569. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +0 -7
  570. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +0 -21
  571. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +0 -7
  572. package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs +0 -137
  573. package/dist/lib/node-esm/operation-resolver-Q5GNP2GH.mjs.map +0 -7
  574. package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs +0 -145
  575. package/dist/lib/node-esm/react-surface-JJRGVGKD.mjs.map +0 -7
  576. package/dist/lib/node-esm/repair-LXFVOK4B.mjs +0 -53
  577. package/dist/lib/node-esm/repair-LXFVOK4B.mjs.map +0 -7
  578. package/dist/lib/node-esm/settings-N452OW6Y.mjs +0 -34
  579. package/dist/lib/node-esm/settings-N452OW6Y.mjs.map +0 -7
  580. package/dist/lib/node-esm/state-WHZFKIEL.mjs +0 -27
  581. package/dist/lib/node-esm/state-WHZFKIEL.mjs.map +0 -7
  582. package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs +0 -17
  583. package/dist/lib/node-esm/toolkit-5IWGLUF4.mjs.map +0 -7
  584. package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +0 -1
  585. package/dist/types/src/capabilities/ai-service/index.d.ts +0 -3
  586. package/dist/types/src/capabilities/ai-service/index.d.ts.map +0 -1
  587. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  588. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  589. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  590. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
  591. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  592. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  593. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  594. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +0 -1
  595. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +0 -3
  596. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +0 -1
  597. package/dist/types/src/capabilities/local-model-resolver/index.d.ts +0 -3
  598. package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +0 -1
  599. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +0 -13
  600. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +0 -1
  601. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  602. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  603. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  604. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  605. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  606. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  607. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  608. package/dist/types/src/capabilities/repair/index.d.ts +0 -3
  609. package/dist/types/src/capabilities/repair/index.d.ts.map +0 -1
  610. package/dist/types/src/capabilities/repair/repair.d.ts.map +0 -1
  611. package/dist/types/src/capabilities/settings/index.d.ts +0 -15
  612. package/dist/types/src/capabilities/settings/index.d.ts.map +0 -1
  613. package/dist/types/src/capabilities/settings/settings.d.ts +0 -18
  614. package/dist/types/src/capabilities/settings/settings.d.ts.map +0 -1
  615. package/dist/types/src/capabilities/state/index.d.ts +0 -11
  616. package/dist/types/src/capabilities/state/index.d.ts.map +0 -1
  617. package/dist/types/src/capabilities/state/state.d.ts +0 -13
  618. package/dist/types/src/capabilities/state/state.d.ts.map +0 -1
  619. package/dist/types/src/capabilities/toolkit/index.d.ts +0 -3
  620. package/dist/types/src/capabilities/toolkit/index.d.ts.map +0 -1
  621. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +0 -1
  622. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +0 -7
  623. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +0 -1
  624. package/dist/types/src/components/ChatProgress/index.d.ts +0 -2
  625. package/dist/types/src/components/ChatProgress/index.d.ts.map +0 -1
  626. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +0 -12
  627. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +0 -1
  628. package/dist/types/src/components/Typewriter/Typewriter.d.ts +0 -11
  629. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +0 -1
  630. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +0 -7
  631. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +0 -1
  632. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +0 -5
  633. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +0 -1
  634. package/dist/types/src/components/Typewriter/index.d.ts +0 -2
  635. package/dist/types/src/components/Typewriter/index.d.ts.map +0 -1
  636. package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts +0 -8
  637. package/dist/types/src/containers/AssistantSettings/AssistantSettings.d.ts.map +0 -1
  638. package/dist/types/src/containers/AssistantSettings/index.d.ts +0 -3
  639. package/dist/types/src/containers/AssistantSettings/index.d.ts.map +0 -1
  640. package/dist/types/src/containers/Project/ProjectArticle.d.ts +0 -7
  641. package/dist/types/src/containers/Project/ProjectArticle.d.ts.map +0 -1
  642. package/dist/types/src/containers/Project/ProjectSettings.d.ts +0 -6
  643. package/dist/types/src/containers/Project/ProjectSettings.d.ts.map +0 -1
  644. package/dist/types/src/containers/Project/index.d.ts +0 -7
  645. package/dist/types/src/containers/Project/index.d.ts.map +0 -1
  646. package/dist/types/src/containers/Project/triggers.d.ts +0 -6
  647. package/dist/types/src/containers/Project/triggers.d.ts.map +0 -1
  648. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts +0 -6
  649. package/dist/types/src/containers/PromptArticle/PromptArticle.d.ts.map +0 -1
  650. package/dist/types/src/containers/PromptArticle/index.d.ts +0 -3
  651. package/dist/types/src/containers/PromptArticle/index.d.ts.map +0 -1
  652. package/dist/types/src/processor/update-name.d.ts +0 -10
  653. package/dist/types/src/processor/update-name.d.ts.map +0 -1
  654. package/dist/types/src/types/AssistantAction.d.ts +0 -93
  655. package/dist/types/src/types/AssistantAction.d.ts.map +0 -1
  656. package/dist/types/src/types/defs.d.ts +0 -2
  657. package/dist/types/src/types/defs.d.ts.map +0 -1
  658. package/src/blueprints/assistant/blueprint.conversations.json +0 -1
  659. package/src/capabilities/ai-service/index.ts +0 -7
  660. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -198
  661. package/src/capabilities/app-graph-builder/index.ts +0 -7
  662. package/src/capabilities/blueprint-definition/index.ts +0 -7
  663. package/src/capabilities/edge-model-resolver/index.ts +0 -7
  664. package/src/capabilities/local-model-resolver/index.ts +0 -7
  665. package/src/capabilities/operation-resolver/index.ts +0 -7
  666. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -121
  667. package/src/capabilities/react-surface/index.ts +0 -7
  668. package/src/capabilities/react-surface/react-surface.tsx +0 -121
  669. package/src/capabilities/repair/index.ts +0 -7
  670. package/src/capabilities/repair/repair.ts +0 -69
  671. package/src/capabilities/settings/index.ts +0 -7
  672. package/src/capabilities/state/index.ts +0 -7
  673. package/src/capabilities/toolkit/index.ts +0 -7
  674. package/src/components/ChatProgress/ChatProgress.tsx +0 -53
  675. package/src/components/ChatProgress/index.ts +0 -5
  676. package/src/components/Typewriter/AssistantToolbar.tsx +0 -161
  677. package/src/components/Typewriter/Typewriter.stories.tsx +0 -86
  678. package/src/components/Typewriter/Typewriter.tsx +0 -54
  679. package/src/components/Typewriter/assistant-extension.tsx +0 -142
  680. package/src/containers/AssistantSettings/AssistantSettings.tsx +0 -120
  681. package/src/containers/AssistantSettings/index.ts +0 -7
  682. package/src/containers/Project/ProjectArticle.tsx +0 -117
  683. package/src/containers/Project/ProjectSettings.tsx +0 -118
  684. package/src/containers/Project/index.ts +0 -16
  685. package/src/containers/Project/triggers.ts +0 -131
  686. package/src/containers/PromptArticle/index.ts +0 -7
  687. package/src/processor/update-name.ts +0 -58
  688. package/src/types/AssistantAction.ts +0 -76
  689. package/src/types/defs.ts +0 -5
  690. /package/dist/types/src/capabilities/{ai-service/ai-service.d.ts → ai-service.d.ts} +0 -0
  691. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  692. /package/dist/types/src/capabilities/{edge-model-resolver/edge-model-resolver.d.ts → edge-model-resolver.d.ts} +0 -0
  693. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  694. /package/dist/types/src/capabilities/{toolkit/toolkit.d.ts → toolkit.d.ts} +0 -0
  695. /package/src/capabilities/{ai-service/ai-service.ts → ai-service.ts} +0 -0
  696. /package/src/capabilities/{edge-model-resolver/edge-model-resolver.ts → edge-model-resolver.ts} +0 -0
@@ -0,0 +1,179 @@
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
+
21
+ import { type AiChatProcessor } from '../../processor';
22
+ import { type ChatEvent } from '../Chat/events';
23
+ import { ChatActions, type ChatActionsProps } from './ChatActions';
24
+ import { ChatOptions } from './ChatOptions';
25
+ import { type ChatPresetsProps } from './ChatPresets';
26
+ import { ChatReferences } from './ChatReferences';
27
+ import { ChatStatusIndicator } from './ChatStatusIndicator';
28
+
29
+ export type ChatPromptProps = ThemedClassName<
30
+ Merge<
31
+ {
32
+ outline?: boolean;
33
+ settings?: boolean;
34
+ expandable?: boolean;
35
+ chat?: Chat.Chat;
36
+ db?: Database.Database;
37
+ processor: AiChatProcessor;
38
+ event: Event<ChatEvent>;
39
+ online?: boolean;
40
+ placeholder?: ChatEditorProps['placeholder'];
41
+ onOnlineChange?: (online: boolean) => void;
42
+ onPresetChange?: ChatPresetsProps['onChange'];
43
+ },
44
+ Omit<ChatPresetsProps, 'onChange'>
45
+ >
46
+ >;
47
+
48
+ export const ChatPrompt = ({
49
+ classNames,
50
+ outline,
51
+ chat,
52
+ db,
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-fine',
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
+ <div role='none' className='flex p-2 gap-2'>
130
+ <ChatStatusIndicator classNames='p-1' preset={preset} error={error} processing={streaming} />
131
+ <ChatEditor
132
+ ref={editorRef}
133
+ autoFocus
134
+ lineWrapping
135
+ classNames='col-span-2 pt-0.5'
136
+ placeholder={placeholder ?? t('prompt.placeholder')}
137
+ extensions={extensions}
138
+ onSubmit={handleSubmit}
139
+ />
140
+ </div>
141
+
142
+ {db && settings && (
143
+ <div role='none' className='flex items-center overflow-hidden p-1.5'>
144
+ <ChatOptions
145
+ chat={chat}
146
+ db={db}
147
+ blueprintRegistry={processor.blueprintRegistry}
148
+ context={processor.context}
149
+ preset={preset}
150
+ presets={presets}
151
+ onPresetChange={onPresetChange}
152
+ />
153
+
154
+ <div role='none' className='flex h-8 grow overflow-x-auto scrollbar-none'>
155
+ <ChatReferences db={db} context={processor.context} />
156
+ </div>
157
+
158
+ <ChatActions
159
+ classNames='col-span-2'
160
+ microphone={true}
161
+ recording={recording}
162
+ processing={streaming}
163
+ onEvent={handleEvent}
164
+ >
165
+ {/* TODO(burdon): Move offline switch into dialog. */}
166
+ {online !== undefined && (
167
+ <Input.Root>
168
+ <Input.Label srOnly>{t('online-switch.label')}</Input.Label>
169
+ <Input.Switch classNames='mx-2' checked={online} onCheckedChange={onOnlineChange} />
170
+ </Input.Root>
171
+ )}
172
+ </ChatActions>
173
+ </div>
174
+ )}
175
+ </div>
176
+ );
177
+ };
178
+
179
+ ChatPrompt.displayName = 'Chat.Prompt';
@@ -10,8 +10,8 @@ import { Annotation, type Database, Obj } from '@dxos/echo';
10
10
  import { Icon, IconButton, type Label, type ThemedClassName, toLocalizedString, useTranslation } from '@dxos/react-ui';
11
11
  import { getStyles, mx } from '@dxos/ui-theme';
12
12
 
13
- import { useContextObjects } from '../../hooks';
14
- import { meta } from '../../meta';
13
+ import { useContextObjects } from '#hooks';
14
+ import { meta } from '#meta';
15
15
 
16
16
  export type ChatReferencesProps = ThemedClassName<{
17
17
  context: AiContextBinder;
@@ -27,7 +27,7 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
27
27
  {objects.map((obj) => {
28
28
  const dxn = Obj.getDXN(obj);
29
29
  const typename = Obj.getTypename(obj);
30
- const label: Label = Obj.getLabel(obj) ?? (typename ? ['object name placeholder', { ns: typename }] : obj.id);
30
+ const label: Label = Obj.getLabel(obj) ?? (typename ? ['object-name.placeholder', { ns: typename }] : obj.id);
31
31
  const { icon, hue } = Option.fromNullable(Obj.getSchema(obj)).pipe(
32
32
  Option.flatMap(Annotation.IconAnnotation.get),
33
33
  Option.getOrElse(() => ({ icon: DEFAULT_OBJECT_ICON, hue: undefined as string | undefined })),
@@ -41,7 +41,7 @@ export const ChatReferences = ({ classNames, context, db }: ChatReferencesProps)
41
41
  icon='ph--x--bold'
42
42
  iconOnly
43
43
  variant='ghost'
44
- label={t('remove object in context label')}
44
+ label={t('remove-object.label')}
45
45
  classNames='p-0 hover:bg-transparent'
46
46
  size={3}
47
47
  onClick={() => onUpdateObject?.(dxn, false)}
@@ -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-sfx';
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 role='none' 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,5 +5,7 @@
5
5
  export * from './ChatActions';
6
6
  export * from './ChatOptions';
7
7
  export * from './ChatPresets';
8
+ export * from './ChatPrompt';
8
9
  export * from './ChatReferences';
9
10
  export * from './ChatStatusIndicator';
11
+ 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';
13
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
14
+ import { PreviewPlugin } from '@dxos/plugin-preview';
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 dxn=…>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(dxn).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 dxn = Obj.getDXN(organization).toString();
45
+ return (
46
+ <div role='none' className='flex flex-col gap-2 p-4'>
47
+ <p>
48
+ Click{' '}
49
+ <DxAnchor className='dx-tag--anchor' dxn={dxn}>
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 = {};
@@ -6,39 +6,37 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import * as Fiber from 'effect/Fiber';
8
8
  import * as Layer from 'effect/Layer';
9
- import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
9
+ import React, { useEffect, useMemo, useState } from 'react';
10
10
 
11
+ import { withPluginManager } from '@dxos/app-framework/testing';
12
+ import { ContextQueueService } from '@dxos/compute';
11
13
  import { Database } from '@dxos/echo';
12
14
  import { runAndForwardErrors } from '@dxos/effect';
13
- import { ContextQueueService } from '@dxos/functions';
14
- import { faker } from '@dxos/random';
15
- import { useQueue, useSpace } from '@dxos/react-client/echo';
16
- import { withClientProvider } from '@dxos/react-client/testing';
17
- import { Popover } from '@dxos/react-ui';
18
- import { Card } from '@dxos/react-ui';
19
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
20
- import { MarkdownStream } from '@dxos/react-ui-components';
21
- import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
22
- import { render } from '@dxos/storybook-utils';
23
- import { type Message, Organization, Person } from '@dxos/types';
24
-
25
- import { createMessageGenerator } from '../../testing';
26
- import { translations } from '../../translations';
15
+ import { ClientPlugin } from '@dxos/plugin-client';
16
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
17
+ import { PreviewPlugin } from '@dxos/plugin-preview';
18
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
19
+ import { random } from '@dxos/random';
20
+ import { type Queue, useSpaces } from '@dxos/react-client/echo';
21
+ import { EditorPreviewProvider } from '@dxos/react-ui-editor';
22
+ import { Loading, withLayout, withTheme } from '@dxos/react-ui/testing';
23
+ import { Message, Organization, Person } from '@dxos/types';
24
+
25
+ import { createMessageGenerator } from '#testing';
26
+ import { translations } from '#translations';
27
27
 
28
28
  import { ChatThread, type ChatThreadProps } from './ChatThread';
29
- import { componentRegistry } from './registry';
30
- import TEXT from './testing/thread.md?raw';
31
29
 
32
- faker.seed(1);
30
+ random.seed(1);
33
31
 
34
32
  type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
35
33
 
36
- type StoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
34
+ type DefaultStoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
37
35
 
38
- const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps) => {
39
- const space = useSpace();
40
- const queueDxn = useMemo(() => space?.queues.create().dxn, [space]);
41
- const queue = useQueue<Message.Message>(queueDxn);
36
+ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: DefaultStoryProps) => {
37
+ const [space] = useSpaces();
38
+ const queue = useMemo<Queue<Message.Message> | undefined>(() => space?.queues.create(), [space]);
39
+ const messages = useQueueMessages(queue);
42
40
  const [done, setDone] = useState(false);
43
41
 
44
42
  // Generate messages.
@@ -55,6 +53,7 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
55
53
  yield* Effect.sleep(delay);
56
54
  }
57
55
  }
56
+
58
57
  setDone(true);
59
58
  }).pipe(Effect.provide(Layer.mergeAll(Database.layer(space.db), ContextQueueService.layer(queue)))),
60
59
  );
@@ -62,60 +61,67 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
62
61
  return () => {
63
62
  void runAndForwardErrors(Fiber.interrupt(fiber));
64
63
  };
65
- }, [space, queue, generator]);
64
+ }, [space, queue, generator, delay]);
66
65
 
67
66
  if (wait && !done) {
68
- return null;
67
+ return <Loading data={{ wait, done }} />;
69
68
  }
70
69
 
71
70
  return (
72
71
  <EditorPreviewProvider onLookup={async ({ dxn, label }) => ({ label, text: dxn })}>
73
- <ChatThread {...props} messages={queue?.objects} />
74
- <PreviewCard />
72
+ <ChatThread {...props} messages={messages} />
75
73
  </EditorPreviewProvider>
76
74
  );
77
75
  };
78
76
 
79
- const PreviewCard = () => {
80
- const { target } = useEditorPreview('PreviewCard');
77
+ const useQueueMessages = (queue?: Queue<Message.Message>) => {
78
+ const [messages, setMessages] = useState<Message.Message[]>([]);
81
79
 
82
- return (
83
- <Popover.Portal>
84
- <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
85
- <Popover.Viewport>
86
- <Card.Root>
87
- <Card.Heading>{target?.label}</Card.Heading>
88
- {target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
89
- </Card.Root>
90
- </Popover.Viewport>
91
- <Popover.Arrow />
92
- </Popover.Content>
93
- </Popover.Portal>
94
- );
80
+ useEffect(() => {
81
+ if (!queue) {
82
+ setMessages([]);
83
+ return;
84
+ }
85
+
86
+ const update = () => setMessages([...queue.objects]);
87
+ update();
88
+ return queue.subscribe(update);
89
+ }, [queue]);
90
+
91
+ return messages;
95
92
  };
96
93
 
97
94
  const meta = {
98
95
  title: 'plugins/plugin-assistant/components/ChatThread',
99
96
  component: ChatThread,
100
- render: render(DefaultStory),
97
+ render: DefaultStory,
101
98
  decorators: [
102
99
  withTheme(),
103
100
  withLayout({ layout: 'column' }),
104
- withClientProvider({
105
- createIdentity: true,
106
- createSpace: true,
107
- types: [Organization.Organization, Person.Person],
101
+ withPluginManager({
102
+ plugins: [
103
+ ...corePlugins(),
104
+ StorybookPlugin({}),
105
+ PreviewPlugin(),
106
+ ClientPlugin({
107
+ types: [Organization.Organization, Person.Person],
108
+ onClientInitialized: ({ client }) =>
109
+ Effect.gen(function* () {
110
+ yield* initializeIdentity(client);
111
+ }),
112
+ }),
113
+ ],
108
114
  }),
109
115
  ],
110
116
  parameters: {
111
117
  layout: 'fullscreen',
112
118
  translations,
113
119
  },
114
- } satisfies Meta<StoryProps>;
120
+ } satisfies Meta<DefaultStoryProps>;
115
121
 
116
122
  export default meta;
117
123
 
118
- type Story = StoryObj<StoryProps>;
124
+ type Story = StoryObj<DefaultStoryProps>;
119
125
 
120
126
  export const Default: Story = {
121
127
  args: {
@@ -127,24 +133,11 @@ export const Default: Story = {
127
133
  export const Delayed: Story = {
128
134
  args: {
129
135
  generator: createMessageGenerator(),
130
- delay: 1_000,
131
- fadeIn: true,
132
- cursor: false,
136
+ delay: 500,
137
+ options: {
138
+ autoScroll: true,
139
+ typewriter: true,
140
+ cursor: true,
141
+ },
133
142
  },
134
143
  };
135
-
136
- export const Raw: Story = {
137
- render: () => (
138
- <div className='contents' style={{ '--user-fill': 'var(--color-amber-fill)' } as CSSProperties}>
139
- <MarkdownStream content={TEXT} />
140
- </div>
141
- ),
142
- };
143
-
144
- export const Static: Story = {
145
- render: () => (
146
- <div className='contents' style={{ '--user-fill': 'var(--color-amber-fill)' } as CSSProperties}>
147
- <MarkdownStream content={TEXT} registry={componentRegistry} />
148
- </div>
149
- ),
150
- };