@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,2410 @@
1
+ import {
2
+ ChatContextProvider,
3
+ useChatContext
4
+ } from "../chunk-VTK5R4H3.mjs";
5
+ import "../chunk-J5LGTIGS.mjs";
6
+
7
+ // src/components/index.ts
8
+ import { lazy } from "react";
9
+
10
+ // src/components/AgentProperties/AgentProperties.tsx
11
+ import { Atom } from "@effect-atom/atom";
12
+ import { useAtomValue } from "@effect-atom/atom-react";
13
+ import * as Option from "effect/Option";
14
+ import React, { useCallback, useMemo } from "react";
15
+ import { Filter, Obj, Ref, Type } from "@dxos/echo";
16
+ import { useQuery } from "@dxos/react-client/echo";
17
+ import { Input, useTranslation } from "@dxos/react-ui";
18
+ import { Form } from "@dxos/react-ui-form";
19
+ import { FeedAnnotation } from "@dxos/schema";
20
+ import { meta } from "#meta";
21
+ var AgentProperties = ({ agent }) => {
22
+ const { t } = useTranslation(meta.id);
23
+ const db = Obj.getDatabase(agent);
24
+ const feedFilter = useMemo(() => {
25
+ if (!db) {
26
+ return Filter.nothing();
27
+ }
28
+ const schemas = db.graph.registry.list().filter(Type.isType);
29
+ const feedSchemas = schemas.filter((type) => {
30
+ const annotation = FeedAnnotation.get(Type.getSchema(type));
31
+ return Option.isSome(annotation) && annotation.value === true;
32
+ });
33
+ return feedSchemas.length === 0 ? Filter.nothing() : Filter.or(...feedSchemas.map((schema) => Filter.type(schema)));
34
+ }, [
35
+ db
36
+ ]);
37
+ const subscribedObjects = useQuery(db, feedFilter);
38
+ const existingSubscriptions = useAtomValue(useMemo(() => Obj.atom(agent).pipe((_) => Atom.make((get) => {
39
+ const agentObj = get(_);
40
+ const selectedSubscriptions = subscribedObjects.filter((object) => agentObj.subscriptions.some((subscription) => subscription.uri === Obj.getURI(object)));
41
+ return selectedSubscriptions;
42
+ })), [
43
+ agent,
44
+ subscribedObjects
45
+ ]));
46
+ const handleSubscriptionChange = useCallback((object, checked) => {
47
+ Obj.update(agent, (agent2) => {
48
+ if (checked) {
49
+ agent2.subscriptions.push(Ref.fromURI(Obj.getURI(object)));
50
+ } else {
51
+ agent2.subscriptions = agent2.subscriptions.filter((subscription) => subscription.uri !== Obj.getURI(object));
52
+ }
53
+ });
54
+ }, [
55
+ agent
56
+ ]);
57
+ if (subscribedObjects.length === 0) {
58
+ return null;
59
+ }
60
+ return /* @__PURE__ */ React.createElement(Form.Section, null, /* @__PURE__ */ React.createElement(Input.Root, null, /* @__PURE__ */ React.createElement(Input.Label, {
61
+ classNames: "mt-form-gap"
62
+ }, t("subscriptions.label"))), subscribedObjects.map((object) => /* @__PURE__ */ React.createElement(Input.Root, {
63
+ key: object.id
64
+ }, /* @__PURE__ */ React.createElement("div", {
65
+ className: "flex items-center gap-2"
66
+ }, /* @__PURE__ */ React.createElement(Input.Checkbox, {
67
+ checked: existingSubscriptions.includes(object),
68
+ onCheckedChange: (checked) => {
69
+ handleSubscriptionChange(object, checked === true);
70
+ }
71
+ }), /* @__PURE__ */ React.createElement(Input.Label, null, Obj.getLabel(object) ?? object.id)))));
72
+ };
73
+
74
+ // src/components/Chat/Chat.tsx
75
+ import { useAtomValue as useAtomValue4 } from "@effect-atom/atom-react";
76
+ import * as Array from "effect/Array";
77
+ import * as Option3 from "effect/Option";
78
+ import React16, { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo6, useRef as useRef4, useState as useState7 } from "react";
79
+ import { Agent } from "@dxos/assistant-toolkit";
80
+ import { Event } from "@dxos/async";
81
+ import { Filter as Filter3, Obj as Obj4, Query } from "@dxos/echo";
82
+ import { useQuery as useQuery3 } from "@dxos/react-client/echo";
83
+ import { useIdentity } from "@dxos/react-client/halo";
84
+ import { Toast, composable as composable2, composableProps as composableProps2, useTranslation as useTranslation9 } from "@dxos/react-ui";
85
+ import { Menu } from "@dxos/react-ui-menu";
86
+ import { Message as Message2 } from "@dxos/types";
87
+ import { useChatKeymapExtensions as useChatKeymapExtensions2, useChatToolbarActions, useDebug } from "#hooks";
88
+ import { meta as meta9 } from "#meta";
89
+
90
+ // src/components/ChatPrompt/ChatActions.tsx
91
+ import React2 from "react";
92
+ import { IconButton, useTranslation as useTranslation2 } from "@dxos/react-ui";
93
+ import { mx } from "@dxos/ui-theme";
94
+ import { meta as meta2 } from "#meta";
95
+ var ChatActions = ({ classNames, children, microphone, recording, processing, debug, onEvent }) => {
96
+ const { t } = useTranslation2(meta2.id);
97
+ return /* @__PURE__ */ React2.createElement("div", {
98
+ className: mx("flex items-center", classNames)
99
+ }, children, microphone && /* @__PURE__ */ React2.createElement(IconButton, {
100
+ disabled: !processing,
101
+ classNames: mx(recording && "bg-primary-500"),
102
+ variant: "ghost",
103
+ icon: "ph--microphone--regular",
104
+ iconOnly: true,
105
+ noTooltip: true,
106
+ label: t("microphone.button"),
107
+ onMouseDown: () => onEvent?.({
108
+ type: "record-start"
109
+ }),
110
+ onMouseUp: () => onEvent?.({
111
+ type: "record-stop"
112
+ }),
113
+ onTouchStart: () => onEvent?.({
114
+ type: "record-start"
115
+ }),
116
+ onTouchEnd: () => onEvent?.({
117
+ type: "record-stop"
118
+ })
119
+ }), debug && /* @__PURE__ */ React2.createElement(IconButton, {
120
+ variant: "ghost",
121
+ icon: "ph--wrench--regular",
122
+ iconOnly: true,
123
+ label: t("debug.button"),
124
+ onClick: () => onEvent?.({
125
+ type: "toggle-debug"
126
+ })
127
+ }), /* @__PURE__ */ React2.createElement(IconButton, {
128
+ // disabled={!processing} // TODO(dmaretskyi): Set processing state correctly on rehydrated agents.
129
+ variant: "ghost",
130
+ icon: "ph--x--regular",
131
+ iconOnly: true,
132
+ label: t("cancel-processing.button"),
133
+ onClick: () => onEvent?.({
134
+ type: "cancel"
135
+ })
136
+ }));
137
+ };
138
+
139
+ // src/components/ChatPrompt/ChatMcpErrors.tsx
140
+ import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
141
+ import React3, { useCallback as useCallback2 } from "react";
142
+ import { Message, useTranslation as useTranslation3 } from "@dxos/react-ui";
143
+ import { meta as meta3 } from "#meta";
144
+ var ChatMcpErrors = ({ classNames, processor }) => {
145
+ const { t } = useTranslation3(meta3.id);
146
+ const errors = useAtomValue2(processor.mcpErrors);
147
+ const handleDismiss = useCallback2(() => {
148
+ processor.dismissMcpErrors();
149
+ }, [
150
+ processor
151
+ ]);
152
+ if (errors.length === 0) {
153
+ return null;
154
+ }
155
+ return /* @__PURE__ */ React3.createElement(Message.Root, {
156
+ classNames: [
157
+ "m-1",
158
+ classNames
159
+ ],
160
+ valence: "warning"
161
+ }, /* @__PURE__ */ React3.createElement(Message.Title, {
162
+ onClose: handleDismiss
163
+ }, t("mcp-server-error.label")), /* @__PURE__ */ React3.createElement(Message.Content, {
164
+ asChild: true
165
+ }, /* @__PURE__ */ React3.createElement("ul", {
166
+ className: "flex flex-col gap-0.5 text-sm"
167
+ }, errors.map((error) => /* @__PURE__ */ React3.createElement("li", {
168
+ key: `${error.url}::${error.protocol}`,
169
+ className: "truncate"
170
+ }, /* @__PURE__ */ React3.createElement("span", {
171
+ className: "font-mono"
172
+ }, error.url), " \u2014 ", /* @__PURE__ */ React3.createElement("span", null, error.message))))));
173
+ };
174
+
175
+ // src/components/ChatPrompt/ChatOptions.tsx
176
+ import React4, { useCallback as useCallback3, useMemo as useMemo2, useState } from "react";
177
+ import { McpServer } from "@dxos/assistant-toolkit";
178
+ import { Filter as Filter2, Obj as Obj2, Type as Type2 } from "@dxos/echo";
179
+ import { useObject, useQuery as useQuery2 } from "@dxos/react-client/echo";
180
+ import { IconButton as IconButton2, Input as Input2, Popover, Select, useTranslation as useTranslation4 } from "@dxos/react-ui";
181
+ import { Listbox } from "@dxos/react-ui-list";
182
+ import { SearchList, useSearchListResults } from "@dxos/react-ui-search";
183
+ import { Tabs } from "@dxos/react-ui-tabs";
184
+ import { getStyles, mx as mx2 } from "@dxos/ui-theme";
185
+ import { useActiveBlueprints, useBlueprintHandlers, useBlueprints, useContextObjects, useFilteredTypes } from "#hooks";
186
+ import { meta as meta4 } from "#meta";
187
+ import { Assistant } from "#types";
188
+ var styles = {
189
+ panel: "w-[calc(100dvw-.5rem)] sm:w-max max-w-document-width",
190
+ toolbar: "p-0! gap-0! border-t border-separator"
191
+ };
192
+ var ChatOptions = ({ chat, db, context, registry, presets, preset, onPresetChange }) => {
193
+ const { t } = useTranslation4(meta4.id);
194
+ return /* @__PURE__ */ React4.createElement("div", {
195
+ className: "flex"
196
+ }, /* @__PURE__ */ React4.createElement(Popover.Root, null, /* @__PURE__ */ React4.createElement(Popover.Trigger, {
197
+ asChild: true
198
+ }, /* @__PURE__ */ React4.createElement(IconButton2, {
199
+ variant: "ghost",
200
+ icon: "ph--plus--regular",
201
+ iconOnly: true,
202
+ label: t("context-objects.button")
203
+ })), /* @__PURE__ */ React4.createElement(Popover.Portal, null, /* @__PURE__ */ React4.createElement(Popover.Content, {
204
+ side: "top",
205
+ classNames: styles.panel
206
+ }, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, /* @__PURE__ */ React4.createElement(ObjectsPanel, {
207
+ db,
208
+ context
209
+ })), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)))), /* @__PURE__ */ React4.createElement(Popover.Root, null, /* @__PURE__ */ React4.createElement(Popover.Trigger, {
210
+ asChild: true
211
+ }, /* @__PURE__ */ React4.createElement(IconButton2, {
212
+ variant: "ghost",
213
+ icon: "ph--sliders-horizontal--regular",
214
+ iconOnly: true,
215
+ label: t("context-settings.button")
216
+ })), /* @__PURE__ */ React4.createElement(Popover.Portal, null, /* @__PURE__ */ React4.createElement(Popover.Content, {
217
+ side: "top",
218
+ classNames: styles.panel
219
+ }, /* @__PURE__ */ React4.createElement(Popover.Viewport, null, /* @__PURE__ */ React4.createElement(Tabs.Root, {
220
+ classNames: "flex",
221
+ orientation: "horizontal",
222
+ defaultValue: "view",
223
+ defaultActivePart: "list",
224
+ tabIndex: -1
225
+ }, /* @__PURE__ */ React4.createElement(Tabs.Viewport, {
226
+ classNames: mx2("grid grid-rows-[1fr_40px] w-full")
227
+ }, /* @__PURE__ */ React4.createElement(Tabs.Panel, {
228
+ tabIndex: -1,
229
+ classNames: "dx-focus-ring-inset overflow-hidden",
230
+ value: "view"
231
+ }, /* @__PURE__ */ React4.createElement(ViewPanel, {
232
+ chat
233
+ })), /* @__PURE__ */ React4.createElement(Tabs.Panel, {
234
+ tabIndex: -1,
235
+ classNames: "dx-focus-ring-inset overflow-hidden",
236
+ value: "blueprints"
237
+ }, /* @__PURE__ */ React4.createElement(BlueprintsPanel, {
238
+ registry,
239
+ db,
240
+ context
241
+ })), /* @__PURE__ */ React4.createElement(Tabs.Panel, {
242
+ tabIndex: -1,
243
+ classNames: "dx-focus-ring-inset overflow-hidden",
244
+ value: "mcp-servers"
245
+ }, /* @__PURE__ */ React4.createElement(McpServersPanel, {
246
+ db
247
+ })), /* @__PURE__ */ React4.createElement(Tabs.Panel, {
248
+ tabIndex: -1,
249
+ classNames: "dx-focus-ring-inset overflow-hidden",
250
+ value: "model"
251
+ }, /* @__PURE__ */ React4.createElement(ModelsPanel, {
252
+ presets,
253
+ preset,
254
+ onPresetChange
255
+ })), /* @__PURE__ */ React4.createElement(Tabs.Tablist, {
256
+ classNames: [
257
+ styles.toolbar
258
+ ]
259
+ }, /* @__PURE__ */ React4.createElement(Tabs.IconTab, {
260
+ value: "view",
261
+ icon: "ph--eye--regular",
262
+ label: t("chat-view.title")
263
+ }), /* @__PURE__ */ React4.createElement(Tabs.IconTab, {
264
+ value: "blueprints",
265
+ icon: "ph--blueprint--regular",
266
+ label: t("options.blueprints.title")
267
+ }), /* @__PURE__ */ React4.createElement(Tabs.IconTab, {
268
+ value: "mcp-servers",
269
+ icon: "ph--plugs-connected--regular",
270
+ label: t("options.mcp.title")
271
+ }), /* @__PURE__ */ React4.createElement(Tabs.IconTab, {
272
+ value: "model",
273
+ icon: "ph--cpu--regular",
274
+ label: t("options.chat-model.title")
275
+ }))))), /* @__PURE__ */ React4.createElement(Popover.Arrow, null)))));
276
+ };
277
+ var BlueprintsPanel = ({ registry, db, context }) => {
278
+ const { t } = useTranslation4(meta4.id);
279
+ const blueprints = useBlueprints({
280
+ registry,
281
+ db
282
+ });
283
+ const activeBlueprints = useActiveBlueprints({
284
+ context
285
+ });
286
+ const { onUpdateBlueprint } = useBlueprintHandlers({
287
+ db,
288
+ context,
289
+ registry
290
+ });
291
+ const { results, handleSearch } = useSearchListResults({
292
+ items: blueprints,
293
+ extract: (blueprint) => blueprint.name
294
+ });
295
+ return /* @__PURE__ */ React4.createElement(SearchList.Root, {
296
+ onSearch: handleSearch
297
+ }, /* @__PURE__ */ React4.createElement(SearchList.Content, {
298
+ classNames: "flex flex-col"
299
+ }, /* @__PURE__ */ React4.createElement(SearchList.Viewport, null, results.map((blueprint) => {
300
+ const blueprintKey = Obj2.getMeta(blueprint).key ?? blueprint.id;
301
+ const isActive = activeBlueprints.has(blueprintKey);
302
+ return /* @__PURE__ */ React4.createElement(SearchList.Item, {
303
+ classNames: "flex items-center overflow-hidden",
304
+ key: blueprintKey,
305
+ value: blueprintKey,
306
+ label: blueprint.name,
307
+ checked: isActive,
308
+ onSelect: () => onUpdateBlueprint?.(blueprintKey, !isActive)
309
+ });
310
+ })), /* @__PURE__ */ React4.createElement(SearchList.Input, {
311
+ placeholder: t("search.placeholder"),
312
+ classNames: "border-t border-separator",
313
+ autoFocus: true
314
+ })));
315
+ };
316
+ var ViewPanel = ({ chat }) => {
317
+ const { t } = useTranslation4(meta4.id);
318
+ const [view, setView] = useObject(chat, "view");
319
+ const value2 = view ?? "normal";
320
+ return /* @__PURE__ */ React4.createElement(Listbox.Root, {
321
+ value: value2,
322
+ onValueChange: setView,
323
+ autoFocus: true
324
+ }, Assistant.ChatViews.map((view2) => /* @__PURE__ */ React4.createElement(Listbox.Option, {
325
+ key: view2,
326
+ value: view2
327
+ }, /* @__PURE__ */ React4.createElement(Listbox.OptionLabel, null, t(`chat-view.${view2}.label`, {
328
+ defaultValue: view2
329
+ })), /* @__PURE__ */ React4.createElement(Listbox.OptionIndicator, null))));
330
+ };
331
+ var ModelsPanel = ({ presets, preset, onPresetChange }) => {
332
+ return /* @__PURE__ */ React4.createElement(Listbox.Root, {
333
+ value: preset,
334
+ onValueChange: onPresetChange,
335
+ autoFocus: true
336
+ }, presets?.map(({ id, label }) => {
337
+ return /* @__PURE__ */ React4.createElement(Listbox.Option, {
338
+ key: id,
339
+ value: id
340
+ }, /* @__PURE__ */ React4.createElement(Listbox.OptionLabel, null, label), /* @__PURE__ */ React4.createElement(Listbox.OptionIndicator, null));
341
+ }));
342
+ };
343
+ var McpServersPanel = ({ db }) => {
344
+ const { t } = useTranslation4(meta4.id);
345
+ const servers = useQuery2(db, Filter2.type(McpServer.McpServer));
346
+ const [adding, setAdding] = useState(false);
347
+ const handleAdd = useCallback3((name, url, protocol, apiKey) => {
348
+ db.add(Obj2.make(McpServer.McpServer, {
349
+ name,
350
+ url,
351
+ protocol,
352
+ apiKey,
353
+ enabled: true
354
+ }));
355
+ setAdding(false);
356
+ }, [
357
+ db
358
+ ]);
359
+ const handleRemove = useCallback3((server) => {
360
+ db.remove(server);
361
+ }, [
362
+ db
363
+ ]);
364
+ return /* @__PURE__ */ React4.createElement("div", {
365
+ className: "p-form-chrome"
366
+ }, servers.map((server) => /* @__PURE__ */ React4.createElement(McpServerRow, {
367
+ key: server.id,
368
+ server,
369
+ onRemove: handleRemove
370
+ })), adding ? /* @__PURE__ */ React4.createElement(McpServerForm, {
371
+ onSubmit: handleAdd,
372
+ onCancel: () => setAdding(false)
373
+ }) : /* @__PURE__ */ React4.createElement("div", null, /* @__PURE__ */ React4.createElement(IconButton2, {
374
+ variant: "ghost",
375
+ icon: "ph--plus--regular",
376
+ label: t("mcp-server-add.label"),
377
+ onClick: () => setAdding(true)
378
+ })));
379
+ };
380
+ var McpServerRow = ({ server, onRemove }) => {
381
+ const { t } = useTranslation4(meta4.id);
382
+ const [enabled, setEnabled] = useObject(server, "enabled");
383
+ return /* @__PURE__ */ React4.createElement("div", {
384
+ className: "flex items-center gap-2 px-form-chrome"
385
+ }, /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Label, {
386
+ srOnly: true
387
+ }, server.name), /* @__PURE__ */ React4.createElement(Input2.Switch, {
388
+ checked: enabled !== false,
389
+ onCheckedChange: (checked) => setEnabled(!!checked)
390
+ })), /* @__PURE__ */ React4.createElement("span", {
391
+ className: "flex-1 truncate text-sm"
392
+ }, server.name), /* @__PURE__ */ React4.createElement("span", {
393
+ className: "truncate text-xs text-description"
394
+ }, server.url), /* @__PURE__ */ React4.createElement(IconButton2, {
395
+ variant: "ghost",
396
+ icon: "ph--x--regular",
397
+ iconOnly: true,
398
+ label: t("mcp-server-remove.label"),
399
+ onClick: () => onRemove(server)
400
+ }));
401
+ };
402
+ var McpServerForm = ({ onSubmit, onCancel }) => {
403
+ const { t } = useTranslation4(meta4.id);
404
+ const [name, setName] = useState("");
405
+ const [url, setUrl] = useState("");
406
+ const [protocol, setProtocol] = useState("sse");
407
+ const [apiKey, setApiKey] = useState("");
408
+ const canSubmit = name.trim().length > 0 && url.trim().length > 0;
409
+ const handleSubmit = useCallback3(() => {
410
+ if (canSubmit) {
411
+ onSubmit(name.trim(), url.trim(), protocol, apiKey.trim() || void 0);
412
+ }
413
+ }, [
414
+ canSubmit,
415
+ name,
416
+ url,
417
+ protocol,
418
+ apiKey,
419
+ onSubmit
420
+ ]);
421
+ return /* @__PURE__ */ React4.createElement("div", {
422
+ className: "space-y-2 px-form-chrome"
423
+ }, /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Label, {
424
+ srOnly: true
425
+ }, t("mcp-server-name.label")), /* @__PURE__ */ React4.createElement(Input2.TextInput, {
426
+ placeholder: t("mcp-server-name.placeholder"),
427
+ value: name,
428
+ onChange: (event) => setName(event.target.value),
429
+ autoFocus: true
430
+ })), /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Label, {
431
+ srOnly: true
432
+ }, t("mcp-server-url.label")), /* @__PURE__ */ React4.createElement(Input2.TextInput, {
433
+ placeholder: t("mcp-server-url.placeholder"),
434
+ value: url,
435
+ onChange: (event) => setUrl(event.target.value)
436
+ })), /* @__PURE__ */ React4.createElement(Select.Root, {
437
+ value: protocol,
438
+ onValueChange: (value2) => setProtocol(value2)
439
+ }, /* @__PURE__ */ React4.createElement(Select.TriggerButton, {
440
+ placeholder: t("mcp-server-protocol.label")
441
+ }), /* @__PURE__ */ React4.createElement(Select.Portal, null, /* @__PURE__ */ React4.createElement(Select.Content, null, /* @__PURE__ */ React4.createElement(Select.Viewport, null, /* @__PURE__ */ React4.createElement(Select.Option, {
442
+ value: "sse"
443
+ }, "SSE"), /* @__PURE__ */ React4.createElement(Select.Option, {
444
+ value: "http"
445
+ }, "HTTP"))))), /* @__PURE__ */ React4.createElement(Input2.Root, null, /* @__PURE__ */ React4.createElement(Input2.Label, {
446
+ srOnly: true
447
+ }, t("mcp-server-api-key.label")), /* @__PURE__ */ React4.createElement(Input2.TextInput, {
448
+ type: "password",
449
+ placeholder: t("mcp-server-api-key.placeholder"),
450
+ value: apiKey,
451
+ onChange: (event) => setApiKey(event.target.value)
452
+ })), /* @__PURE__ */ React4.createElement("div", {
453
+ className: "flex gap-2"
454
+ }, /* @__PURE__ */ React4.createElement(IconButton2, {
455
+ variant: "ghost",
456
+ icon: "ph--check--regular",
457
+ iconOnly: true,
458
+ label: t("save.button"),
459
+ onClick: handleSubmit,
460
+ disabled: !canSubmit
461
+ }), /* @__PURE__ */ React4.createElement(IconButton2, {
462
+ variant: "ghost",
463
+ icon: "ph--x--regular",
464
+ iconOnly: true,
465
+ label: t("cancel.button"),
466
+ onClick: onCancel
467
+ })));
468
+ };
469
+ var ANY = "__any__";
470
+ var ObjectsPanel = ({ db, context }) => {
471
+ const { t } = useTranslation4(meta4.id);
472
+ const types = useFilteredTypes(db);
473
+ const typeOptions = useMemo2(() => {
474
+ const options = types.map((type) => {
475
+ const typename = Type2.getTypename(type);
476
+ return {
477
+ uri: Type2.getURI(type),
478
+ label: t("typename.label", {
479
+ ns: typename,
480
+ defaultValue: typename
481
+ })
482
+ };
483
+ });
484
+ options.sort((a, b) => a.label.localeCompare(b.label));
485
+ return options;
486
+ }, [
487
+ types,
488
+ t
489
+ ]);
490
+ const [selectedUri, setSelectedUri] = useState(ANY);
491
+ const anyFilter = useMemo2(() => Filter2.or(...typeOptions.map(({ uri }) => Filter2.type(uri))), [
492
+ typeOptions
493
+ ]);
494
+ const objects = useQuery2(db, selectedUri === ANY ? anyFilter : Filter2.type(selectedUri));
495
+ const { objects: contextObjects, onUpdateObject } = useContextObjects({
496
+ db,
497
+ context
498
+ });
499
+ const { results, handleSearch } = useSearchListResults({
500
+ items: objects,
501
+ extract: (object) => Obj2.getLabel(object) ?? Obj2.getTypename(object) ?? object.id
502
+ });
503
+ return /* @__PURE__ */ React4.createElement(SearchList.Root, {
504
+ onSearch: handleSearch
505
+ }, /* @__PURE__ */ React4.createElement(SearchList.Content, {
506
+ classNames: "p-form-chrome [&:has([cmdk-list-sizer]:empty)]:py-0"
507
+ }, /* @__PURE__ */ React4.createElement(SearchList.Viewport, null, results.length ? results.map((object) => {
508
+ const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
509
+ const { icon, hue } = Obj2.getIcon(object) ?? {
510
+ icon: "ph--cube--regular",
511
+ hue: void 0
512
+ };
513
+ const styles3 = hue ? getStyles(hue) : void 0;
514
+ return /* @__PURE__ */ React4.createElement(SearchList.Item, {
515
+ classNames: "flex items-center overflow-hidden",
516
+ key: object.id,
517
+ value: object.id,
518
+ icon,
519
+ iconClassNames: styles3?.text,
520
+ label: Obj2.getLabel(object) ?? Obj2.getTypename(object) ?? object.id,
521
+ checked: isActive,
522
+ onSelect: () => onUpdateObject?.(Obj2.getURI(object), !isActive)
523
+ });
524
+ }) : /* @__PURE__ */ React4.createElement(SearchList.Item, {
525
+ value: "__empty__",
526
+ label: t("no-results.message")
527
+ }))), /* @__PURE__ */ React4.createElement("div", {
528
+ className: mx2("flex flex-col", styles.toolbar)
529
+ }, /* @__PURE__ */ React4.createElement(Select.Root, {
530
+ value: selectedUri === ANY ? void 0 : selectedUri,
531
+ onValueChange: (val) => setSelectedUri(val)
532
+ }, /* @__PURE__ */ React4.createElement(Select.TriggerButton, {
533
+ placeholder: t("type-filter.placeholder")
534
+ }), /* @__PURE__ */ React4.createElement(Select.Portal, null, /* @__PURE__ */ React4.createElement(Select.Content, null, /* @__PURE__ */ React4.createElement(Select.ScrollUpButton, null), /* @__PURE__ */ React4.createElement(Select.Viewport, null, /* @__PURE__ */ React4.createElement(Select.Option, {
535
+ value: ANY
536
+ }, t("any-type-filter.label")), typeOptions.map(({ uri, label }) => /* @__PURE__ */ React4.createElement(Select.Option, {
537
+ key: uri,
538
+ value: uri
539
+ }, label))), /* @__PURE__ */ React4.createElement(Select.ScrollDownButton, null), /* @__PURE__ */ React4.createElement(Select.Arrow, null)))), /* @__PURE__ */ React4.createElement(SearchList.Input, {
540
+ placeholder: t("search.placeholder"),
541
+ autoFocus: true
542
+ })));
543
+ };
544
+
545
+ // src/components/ChatPrompt/ChatPresets.tsx
546
+ import React5 from "react";
547
+ import { Select as Select2 } from "@dxos/react-ui";
548
+
549
+ // src/components/ChatPrompt/ChatPrompt.tsx
550
+ import { useAtomValue as useAtomValue3 } from "@effect-atom/atom-react";
551
+ import * as Option2 from "effect/Option";
552
+ import React8, { useCallback as useCallback4, useEffect as useEffect2, useRef, useState as useState3 } from "react";
553
+ import { useVoiceInput } from "@dxos/plugin-transcription";
554
+ import { Input as Input3, useDynamicRef, useTranslation as useTranslation6 } from "@dxos/react-ui";
555
+ import { ChatEditor } from "@dxos/react-ui-chat";
556
+ import { mx as mx5 } from "@dxos/ui-theme";
557
+ import { useChatKeymapExtensions } from "#hooks";
558
+ import { meta as meta6 } from "#meta";
559
+
560
+ // src/components/ChatPrompt/ChatReferences.tsx
561
+ import React6 from "react";
562
+ import { Obj as Obj3 } from "@dxos/echo";
563
+ import { Icon, IconButton as IconButton3, toLocalizedString, useTranslation as useTranslation5 } from "@dxos/react-ui";
564
+ import { getStyles as getStyles2, mx as mx3 } from "@dxos/ui-theme";
565
+ import { useContextObjects as useContextObjects2 } from "#hooks";
566
+ import { meta as meta5 } from "#meta";
567
+ var ChatReferences = ({ classNames, context, db }) => {
568
+ const { t } = useTranslation5(meta5.id);
569
+ const { objects, onUpdateObject } = useContextObjects2({
570
+ db,
571
+ context
572
+ });
573
+ return /* @__PURE__ */ React6.createElement("ul", {
574
+ className: mx3("flex", classNames)
575
+ }, objects.map((obj) => {
576
+ const uri = Obj3.getURI(obj);
577
+ const typename = Obj3.getTypename(obj);
578
+ const label = Obj3.getLabel(obj) ?? (typename ? [
579
+ "object-name.placeholder",
580
+ {
581
+ ns: typename
582
+ }
583
+ ] : obj.id);
584
+ const { icon, hue } = Obj3.getIcon(obj) ?? {
585
+ icon: DEFAULT_OBJECT_ICON,
586
+ hue: void 0
587
+ };
588
+ const styles3 = hue ? getStyles2(hue) : void 0;
589
+ return /* @__PURE__ */ React6.createElement("li", {
590
+ key: uri.toString(),
591
+ className: "dx-tag py-0 flex items-center gap-1",
592
+ "data-hue": "neutral"
593
+ }, /* @__PURE__ */ React6.createElement(Icon, {
594
+ icon,
595
+ size: 4
596
+ }), toLocalizedString(label, t), /* @__PURE__ */ React6.createElement(IconButton3, {
597
+ icon: "ph--x--bold",
598
+ iconOnly: true,
599
+ variant: "ghost",
600
+ label: t("remove-object.label"),
601
+ classNames: "p-0 hover:bg-transparent",
602
+ size: 3,
603
+ onClick: () => onUpdateObject?.(uri, false)
604
+ }));
605
+ }));
606
+ };
607
+ var DEFAULT_OBJECT_ICON = "ph--cube--regular";
608
+
609
+ // src/components/ChatPrompt/ChatStatusIndicator.tsx
610
+ import React7, { useEffect, useState as useState2 } from "react";
611
+ import { Tooltip, useTimeout } from "@dxos/react-ui";
612
+ import { Spinner } from "@dxos/react-ui-components";
613
+ import { mx as mx4 } from "@dxos/ui-theme";
614
+ var period = 3e3;
615
+ var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }) => {
616
+ const [init, setInit] = useState2(false);
617
+ useEffect(() => setInit(false), [
618
+ preset
619
+ ]);
620
+ useTimeout(async () => {
621
+ setInit(true);
622
+ }, period / 2, [
623
+ preset
624
+ ]);
625
+ return /* @__PURE__ */ React7.createElement("div", {
626
+ className: mx4("relative flex", classNames)
627
+ }, /* @__PURE__ */ React7.createElement(Spinner, {
628
+ duration: period,
629
+ state: !init ? "flash" : error ? "error" : processing ? "spin" : "pulse",
630
+ ...props
631
+ }), error && /* @__PURE__ */ React7.createElement(Tooltip.Trigger, {
632
+ asChild: true,
633
+ content: error.message
634
+ }, /* @__PURE__ */ React7.createElement("div", {
635
+ className: "absolute inset-0"
636
+ })));
637
+ };
638
+
639
+ // src/components/ChatPrompt/ChatPrompt.tsx
640
+ var ChatPrompt = ({ classNames, outline, db, chat, processor, event, online, placeholder, onOnlineChange, onPresetChange, settings = true, presets, preset }) => {
641
+ const { t } = useTranslation6(meta6.id);
642
+ const error = useAtomValue3(processor.error).pipe(Option2.getOrUndefined);
643
+ const streaming = useAtomValue3(processor.streaming);
644
+ const active = useAtomValue3(processor.active);
645
+ const activeRef = useDynamicRef(active);
646
+ const editorRef = useRef(null);
647
+ const [recordingState, setRecordingState] = useState3(false);
648
+ useEffect2(() => {
649
+ return event.on((ev) => {
650
+ switch (ev.type) {
651
+ case "update-prompt":
652
+ if (!editorRef.current?.getText()?.length) {
653
+ editorRef.current?.setText(ev.text);
654
+ editorRef.current?.focus();
655
+ }
656
+ break;
657
+ case "record-start":
658
+ setRecordingState(true);
659
+ break;
660
+ case "record-stop":
661
+ setRecordingState(false);
662
+ break;
663
+ }
664
+ });
665
+ }, [
666
+ event
667
+ ]);
668
+ const { recording } = useVoiceInput({
669
+ active: recordingState,
670
+ onUpdate: (text) => {
671
+ editorRef.current?.setText(text);
672
+ editorRef.current?.focus();
673
+ }
674
+ });
675
+ const extensions = useChatKeymapExtensions({
676
+ event
677
+ });
678
+ const handleSubmit = useCallback4((text) => {
679
+ if (!activeRef.current) {
680
+ event.emit({
681
+ type: "submit",
682
+ text
683
+ });
684
+ return true;
685
+ }
686
+ }, [
687
+ event
688
+ ]);
689
+ const handleEvent = useCallback4((ev) => {
690
+ event.emit(ev);
691
+ }, [
692
+ event
693
+ ]);
694
+ return /* @__PURE__ */ React8.createElement("div", {
695
+ role: "group",
696
+ className: mx5("flex flex-col w-full dx-density-md", outline && "bg-group-surface rounded-sm border border-subdued-separator transition transition-border [&:has(.cm-content:focus)]:border-separator", classNames)
697
+ }, /* @__PURE__ */ React8.createElement(ChatMcpErrors, {
698
+ processor
699
+ }), /* @__PURE__ */ React8.createElement("div", {
700
+ className: "flex p-2 gap-2"
701
+ }, /* @__PURE__ */ React8.createElement(ChatStatusIndicator, {
702
+ classNames: "p-1",
703
+ preset,
704
+ error,
705
+ processing: streaming
706
+ }), /* @__PURE__ */ React8.createElement(ChatEditor, {
707
+ ref: editorRef,
708
+ autoFocus: true,
709
+ lineWrapping: true,
710
+ classNames: "col-span-2 pt-0.5",
711
+ placeholder: placeholder ?? t("prompt.placeholder"),
712
+ extensions,
713
+ onSubmit: handleSubmit
714
+ })), db && settings && /* @__PURE__ */ React8.createElement("div", {
715
+ className: "flex items-center overflow-hidden p-1.5"
716
+ }, /* @__PURE__ */ React8.createElement(ChatOptions, {
717
+ chat,
718
+ db,
719
+ registry: processor.registry,
720
+ context: processor.context,
721
+ preset,
722
+ presets,
723
+ onPresetChange
724
+ }), /* @__PURE__ */ React8.createElement("div", {
725
+ className: "flex h-6 grow overflow-x-auto scrollbar-none"
726
+ }, /* @__PURE__ */ React8.createElement(ChatReferences, {
727
+ db,
728
+ context: processor.context
729
+ })), /* @__PURE__ */ React8.createElement(ChatActions, {
730
+ classNames: "col-span-2",
731
+ microphone: true,
732
+ recording,
733
+ processing: streaming,
734
+ onEvent: handleEvent
735
+ }, online !== void 0 && /* @__PURE__ */ React8.createElement(Input3.Root, null, /* @__PURE__ */ React8.createElement(Input3.Label, {
736
+ srOnly: true
737
+ }, t("online-switch.label")), /* @__PURE__ */ React8.createElement(Input3.Switch, {
738
+ classNames: "mx-1",
739
+ checked: online,
740
+ onCheckedChange: onOnlineChange
741
+ })))));
742
+ };
743
+ ChatPrompt.displayName = "Chat.Prompt";
744
+
745
+ // src/components/ChatPrompt/ChatStatus.tsx
746
+ import React9, { useEffect as useEffect3, useMemo as useMemo3, useState as useState4 } from "react";
747
+ import { ChatStatus as NaturalChatStatus, formatElapsed } from "@dxos/react-ui-chat";
748
+ import { Matrix } from "@dxos/react-ui-components";
749
+ import { Unit } from "@dxos/util";
750
+ var CHAT_STREAM_STATUS_NAME = "Chat.StreamStatus";
751
+ var TICK_MS = 1e3;
752
+ var ChatStatus = ({ classNames, icon }) => {
753
+ const { messages, requestTiming } = useChatContext(CHAT_STREAM_STATUS_NAME);
754
+ const { lastOutputTokens, sessionTotalTokens } = useMemo3(() => {
755
+ let last;
756
+ let total = 0;
757
+ for (const message of messages) {
758
+ for (const block of message.blocks) {
759
+ if (isStats(block) && block.usage) {
760
+ last = block.usage.outputTokens;
761
+ total += block.usage.totalTokens ?? 0;
762
+ }
763
+ }
764
+ }
765
+ return {
766
+ lastOutputTokens: last,
767
+ sessionTotalTokens: total
768
+ };
769
+ }, [
770
+ messages
771
+ ]);
772
+ const isRunning = requestTiming != null && requestTiming.endedAt == null;
773
+ const show = requestTiming || lastOutputTokens || sessionTotalTokens > 0;
774
+ if (!show) {
775
+ return null;
776
+ }
777
+ return /* @__PURE__ */ React9.createElement(NaturalChatStatus.Root, {
778
+ defaultRunning: false,
779
+ classNames: [
780
+ "py-2 gap-2 text-sm",
781
+ classNames
782
+ ]
783
+ }, icon && /* @__PURE__ */ React9.createElement(NaturalChatStatus.Icon, null, /* @__PURE__ */ React9.createElement(Matrix, {
784
+ classNames: "w-5 h-5",
785
+ dotClassNames: "bg-primary-500",
786
+ dim: 4,
787
+ dotSize: 3,
788
+ count: 10,
789
+ interval: 500,
790
+ active: isRunning
791
+ })), show && /* @__PURE__ */ React9.createElement("div", {
792
+ className: "flex items-center"
793
+ }, requestTiming && /* @__PURE__ */ React9.createElement(NaturalChatStatus.Text, null, /* @__PURE__ */ React9.createElement(Elapsed, {
794
+ timing: requestTiming
795
+ })), lastOutputTokens != null && /* @__PURE__ */ React9.createElement(React9.Fragment, null, requestTiming && /* @__PURE__ */ React9.createElement(NaturalChatStatus.Separator, null), /* @__PURE__ */ React9.createElement(NaturalChatStatus.Text, null, "\u2193 ", Unit.Thousand(lastOutputTokens).toString())), sessionTotalTokens > 0 && /* @__PURE__ */ React9.createElement(React9.Fragment, null, (requestTiming || lastOutputTokens != null) && /* @__PURE__ */ React9.createElement(NaturalChatStatus.Separator, null), /* @__PURE__ */ React9.createElement(NaturalChatStatus.Text, null, "\u03A3 ", Unit.Thousand(sessionTotalTokens).toString()))));
796
+ };
797
+ var Elapsed = ({ timing }) => {
798
+ const isRunning = timing.endedAt == null;
799
+ const [now, setNow] = useState4(Date.now());
800
+ useEffect3(() => {
801
+ if (!isRunning) {
802
+ return;
803
+ }
804
+ const id = setInterval(() => setNow(Date.now()), TICK_MS);
805
+ return () => clearInterval(id);
806
+ }, [
807
+ isRunning
808
+ ]);
809
+ return /* @__PURE__ */ React9.createElement(React9.Fragment, null, formatElapsed((timing.endedAt ?? now) - timing.startedAt));
810
+ };
811
+ var isStats = (block) => block._tag === "stats";
812
+
813
+ // src/components/ChatThread/ChatThread.tsx
814
+ import React14, { forwardRef, useCallback as useCallback6, useEffect as useEffect5, useMemo as useMemo5, useRef as useRef3, useState as useState6 } from "react";
815
+ import { PublicKey } from "@dxos/keys";
816
+ import { setRef } from "@dxos/react-ui";
817
+ import { MarkdownStream } from "@dxos/react-ui-markdown";
818
+ import { keyToFallback } from "@dxos/util";
819
+
820
+ // src/components/ChatThread/registry.tsx
821
+ import React13 from "react";
822
+ import { log } from "@dxos/log";
823
+ import { getXmlTextChild } from "@dxos/ui-editor";
824
+
825
+ // src/components/ChatThread/tool-widget-state.ts
826
+ var applyToolBlockToWidgetState = (context, block) => {
827
+ switch (block._tag) {
828
+ case "toolCall": {
829
+ context.updateWidget(block.toolCallId, {
830
+ blocks: [
831
+ block
832
+ ]
833
+ });
834
+ break;
835
+ }
836
+ case "toolResult": {
837
+ context.updateWidget(block.toolCallId, ({ blocks = [] } = {
838
+ blocks: []
839
+ }) => ({
840
+ blocks: [
841
+ ...blocks,
842
+ block
843
+ ]
844
+ }));
845
+ break;
846
+ }
847
+ default: {
848
+ break;
849
+ }
850
+ }
851
+ };
852
+ var rehydrateToolWidgetsFromMessages = (context, messages) => {
853
+ for (const message of messages) {
854
+ for (const block of message.blocks) {
855
+ applyToolBlockToWidgetState(context, block);
856
+ }
857
+ }
858
+ };
859
+
860
+ // src/components/ChatThread/widgets/FallbackWidget.tsx
861
+ import React10 from "react";
862
+ import { TogglePanel } from "@dxos/react-ui-components";
863
+ import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
864
+ var FallbackWidget = ({ _tag, ...props }) => {
865
+ return /* @__PURE__ */ React10.createElement(TogglePanel.Root, null, /* @__PURE__ */ React10.createElement(TogglePanel.Content, null, /* @__PURE__ */ React10.createElement(TogglePanel.Header, {
866
+ classNames: "bg-group-surface"
867
+ }, _tag), /* @__PURE__ */ React10.createElement(TogglePanel.Body, {
868
+ classNames: "bg-modal-surface"
869
+ }, /* @__PURE__ */ React10.createElement(TogglePanel.Viewport, null, /* @__PURE__ */ React10.createElement(JsonHighlighter, {
870
+ classNames: "p-2! text-sm",
871
+ data: props
872
+ })))));
873
+ };
874
+ FallbackWidget.displayName = "Fallback";
875
+
876
+ // src/components/ChatThread/widgets/ReasoningWidget.ts
877
+ import { WidgetType } from "@codemirror/view";
878
+ import { Domino } from "@dxos/ui";
879
+
880
+ // src/components/ChatThread/widgets/defaults.ts
881
+ var styles2 = {
882
+ padding: "my-4",
883
+ border: "border border-subdued-separator rounded-sm"
884
+ };
885
+
886
+ // src/components/ChatThread/widgets/ReasoningWidget.ts
887
+ var ReasoningWidget = class extends WidgetType {
888
+ text;
889
+ #pos;
890
+ /** The timer id last registered for this instance (may differ from the map if superseded). */
891
+ #ownedTimerId = null;
892
+ constructor(text, pos) {
893
+ super(), this.text = text;
894
+ this.#pos = pos === void 0 || pos === "" ? "reasoning" : String(pos);
895
+ }
896
+ eq(other) {
897
+ return this.text === other.text && this.#pos === other.#pos;
898
+ }
899
+ toDOM() {
900
+ return Domino.of("div").classNames(styles2.padding).append(Domino.of("div").classNames("relative overflow-hidden p-px", styles2.border).attributes({
901
+ "data-trail-container": ""
902
+ }).append(Domino.of("div").classNames("relative z-10 bg-base-surface rounded-sm text-sm text-subdued py-1", "grid grid-cols-[24px_1fr] gap-x-0.5 items-start").append(Domino.of("div").classNames("flex h-5 w-full shrink-0 items-center justify-center self-start").append(Domino.svg("ph--brain--regular").classNames("shrink-0 size-4 opacity-70")), Domino.of("div").classNames("px-2 max-h-[5lh] overflow-y-auto dx-scrollbar-thin min-w-0").text(this.text).attributes({
903
+ "data-reasoning-text": ""
904
+ })), Domino.of("div").attributes({
905
+ "data-id": this.#pos
906
+ }))).root;
907
+ }
908
+ updateDOM(dom) {
909
+ dom.querySelector("[data-reasoning-text]")?.replaceChildren(this.text);
910
+ const container = dom.querySelector("[data-trail-container]");
911
+ let trailHost = container?.querySelector("[data-id]");
912
+ if (container && !trailHost) {
913
+ trailHost = Domino.of("div").attributes({
914
+ "data-id": this.#pos
915
+ }).root;
916
+ container.append(trailHost);
917
+ }
918
+ if (trailHost?.childElementCount === 0) {
919
+ trailHost.append(...createTrailLayers());
920
+ }
921
+ this.#scheduleTrailRemoval(dom);
922
+ return true;
923
+ }
924
+ destroy(_dom) {
925
+ this.#clearOwnedTrailTimer();
926
+ }
927
+ #scheduleTrailRemoval(dom) {
928
+ const previous = trailRemovalTimers.get(this.#pos);
929
+ if (previous !== void 0) {
930
+ clearTimeout(previous);
931
+ }
932
+ const timerId = setTimeout(() => {
933
+ if (trailRemovalTimers.get(this.#pos) !== timerId) {
934
+ return;
935
+ }
936
+ trailRemovalTimers.delete(this.#pos);
937
+ this.#ownedTimerId = null;
938
+ dom.querySelector("[data-id]")?.remove();
939
+ }, TRAIL_REMOVAL_DELAY_MS);
940
+ trailRemovalTimers.set(this.#pos, timerId);
941
+ this.#ownedTimerId = timerId;
942
+ }
943
+ #clearOwnedTrailTimer() {
944
+ const active = trailRemovalTimers.get(this.#pos);
945
+ if (active !== void 0 && active === this.#ownedTimerId) {
946
+ clearTimeout(active);
947
+ trailRemovalTimers.delete(this.#pos);
948
+ }
949
+ this.#ownedTimerId = null;
950
+ }
951
+ };
952
+ var trail = [
953
+ "absolute z-0 aspect-[2/1] w-16",
954
+ "bg-[radial-gradient(at_100%_50%,_theme(colors.green.700),_transparent_80%)]",
955
+ "[offset-anchor:100%_50%] [offset-path:border-box]"
956
+ ];
957
+ var TRAIL_REMOVAL_DELAY_MS = 1e3;
958
+ var trailRemovalTimers = /* @__PURE__ */ new Map();
959
+ var createTrailLayers = () => [
960
+ Domino.of("div").classNames(...trail, "animate-trail").root,
961
+ Domino.of("div").classNames(...trail, "animate-trail-offset").root
962
+ ];
963
+
964
+ // src/components/ChatThread/widgets/ReferenceWidget.ts
965
+ import { WidgetType as WidgetType2 } from "@codemirror/view";
966
+ import { Domino as Domino2 } from "@dxos/ui";
967
+ var ReferenceWidget = class extends WidgetType2 {
968
+ text;
969
+ dxn;
970
+ constructor(text, dxn) {
971
+ super(), this.text = text, this.dxn = dxn;
972
+ }
973
+ eq(other) {
974
+ return this.dxn === other.dxn;
975
+ }
976
+ toDOM() {
977
+ return Domino2.of("div").classNames(styles2.padding).append(Domino2.of("dx-anchor").classNames("dx-tag--anchor").attributes({
978
+ dxn: this.dxn
979
+ }).text(this.text)).root;
980
+ }
981
+ };
982
+
983
+ // src/components/ChatThread/widgets/SelectWidget.ts
984
+ import { WidgetType as WidgetType3 } from "@codemirror/view";
985
+ import { Domino as Domino3 } from "@dxos/ui";
986
+ var SelectWidget = class extends WidgetType3 {
987
+ options;
988
+ constructor(options) {
989
+ super(), this.options = options;
990
+ }
991
+ eq(other) {
992
+ return JSON.stringify(this.options) === JSON.stringify(other.options);
993
+ }
994
+ /**
995
+ * NOTE: Container must set var based on user's identity.
996
+ */
997
+ toDOM() {
998
+ return Domino3.of("div").attributes({
999
+ role: "group"
1000
+ }).classNames(styles2.padding, "flex flex-wrap gap-1").append(...this.options.map((option) => Domino3.of("button").classNames("dx-button inline-block max-w-[100cqi]").attributes({
1001
+ "data-action": "submit",
1002
+ "data-value": option,
1003
+ "data-density": "md"
1004
+ }).text(option))).root;
1005
+ }
1006
+ };
1007
+
1008
+ // src/components/ChatThread/widgets/StatsWidget.ts
1009
+ import { WidgetType as WidgetType4 } from "@codemirror/view";
1010
+ import { Domino as Domino4 } from "@dxos/ui";
1011
+ var StatsWidget = class extends WidgetType4 {
1012
+ text;
1013
+ constructor(text) {
1014
+ super(), this.text = text;
1015
+ }
1016
+ eq(other) {
1017
+ return this.text === other.text;
1018
+ }
1019
+ toDOM() {
1020
+ return Domino4.of("div").classNames(styles2.padding, "text-sm text-placeholder").text(this.text).root;
1021
+ }
1022
+ updateDOM(dom) {
1023
+ dom.textContent = this.text;
1024
+ return true;
1025
+ }
1026
+ };
1027
+
1028
+ // src/components/ChatThread/widgets/StatusWidget.ts
1029
+ import { WidgetType as WidgetType5 } from "@codemirror/view";
1030
+ import { Domino as Domino5 } from "@dxos/ui";
1031
+ var StatusWidget = class extends WidgetType5 {
1032
+ text;
1033
+ constructor(text) {
1034
+ super(), this.text = text;
1035
+ }
1036
+ eq(other) {
1037
+ return this.text === other.text;
1038
+ }
1039
+ toDOM() {
1040
+ return Domino5.of("div").classNames(styles2.padding).append(Domino5.of("div").classNames("relative overflow-hidden rounded-sm").append(Domino5.of("div").classNames("grid grid-cols-[24px_1fr] gap-x-0.5 gap-y-0 items-start px-0.5 py-0.5 text-placeholder").append(Domino5.of("div").classNames("flex h-5 w-full shrink-0 items-center justify-center self-start").append(Domino5.svg("ph--info--regular").classNames("shrink-0 size-4 opacity-70")), Domino5.of("div").classNames("relative min-w-0").append(Domino5.of("div").classNames("relative z-10 rounded-sm text-sm leading-5").attributes({
1041
+ "data-status-text": ""
1042
+ }).text(this.text))))).root;
1043
+ }
1044
+ updateDOM(dom) {
1045
+ dom.querySelector("[data-status-text]")?.replaceChildren(this.text);
1046
+ return true;
1047
+ }
1048
+ };
1049
+
1050
+ // src/components/ChatThread/widgets/SummaryWidget.tsx
1051
+ import React11 from "react";
1052
+ import { useTranslation as useTranslation7 } from "@dxos/react-ui";
1053
+ import { TogglePanel as TogglePanel2 } from "@dxos/react-ui-components";
1054
+ import { meta as meta7 } from "#meta";
1055
+ var SummaryWidget = ({ children }) => {
1056
+ const { t } = useTranslation7(meta7.id);
1057
+ return /* @__PURE__ */ React11.createElement(TogglePanel2.Root, null, /* @__PURE__ */ React11.createElement(TogglePanel2.Content, {
1058
+ classNames: styles2.border
1059
+ }, /* @__PURE__ */ React11.createElement(TogglePanel2.Header, {
1060
+ classNames: "text-sm bg-group-surface"
1061
+ }, t("summary.label")), /* @__PURE__ */ React11.createElement(TogglePanel2.Body, null, /* @__PURE__ */ React11.createElement("div", {
1062
+ className: "p-1 text-sm text-subdued"
1063
+ }, children))));
1064
+ };
1065
+
1066
+ // src/components/ChatThread/widgets/SuggestionWidget.ts
1067
+ import { WidgetType as WidgetType6 } from "@codemirror/view";
1068
+ import { Domino as Domino6, mx as mx6 } from "@dxos/ui";
1069
+ var SuggestionWidget = class extends WidgetType6 {
1070
+ text;
1071
+ constructor(text) {
1072
+ super(), this.text = text;
1073
+ }
1074
+ eq(other) {
1075
+ return this.text === other.text;
1076
+ }
1077
+ toDOM() {
1078
+ return Domino6.of("span").classNames(mx6("inline-flex max-w-[calc(100cqi-8px)] my-1 pe-2 overflow-hidden")).append(Domino6.of("button").attributes({
1079
+ "data-action": "submit",
1080
+ "data-density": "md",
1081
+ "data-value": this.text
1082
+ }).classNames(mx6("dx-button gap-2 w-full overflow-hidden")).append(Domino6.of("dx-icon").attributes({
1083
+ icon: "ph--lightning--regular"
1084
+ }), Domino6.of("span").classNames("flex-1 truncate min-w-0").text(this.text))).root;
1085
+ }
1086
+ };
1087
+
1088
+ // src/components/ChatThread/widgets/ToolWidget.tsx
1089
+ import React12, { useCallback as useCallback5, useEffect as useEffect4, useMemo as useMemo4, useRef as useRef2, useState as useState5 } from "react";
1090
+ import { Icon as Icon2, useTranslation as useTranslation8 } from "@dxos/react-ui";
1091
+ import { NumericTabs, TextCrawl, TogglePanel as TogglePanel3 } from "@dxos/react-ui-components";
1092
+ import { JsonHighlighter as JsonHighlighter2 } from "@dxos/react-ui-syntax-highlighter";
1093
+ import { isNonNullable, safeParseJson } from "@dxos/util";
1094
+ import { meta as meta8 } from "#meta";
1095
+ var ToolWidget = ({ view, blocks = [] }) => {
1096
+ const { t } = useTranslation8(meta8.id);
1097
+ const items = useMemo4(() => {
1098
+ let lastToolCall;
1099
+ const tools = [];
1100
+ return blocks.filter((block) => block._tag === "toolCall" || block._tag === "toolResult" || block._tag === "stats").map((block) => {
1101
+ switch (block._tag) {
1102
+ case "toolCall": {
1103
+ if (block.pending && lastToolCall?.block.toolCallId === block.toolCallId) {
1104
+ return null;
1105
+ }
1106
+ const tool = tools.find((tool2) => tool2.name === block.name);
1107
+ lastToolCall = {
1108
+ tool,
1109
+ block
1110
+ };
1111
+ return {
1112
+ title: tool?.description ?? [
1113
+ t("tool-call.label"),
1114
+ block.name
1115
+ ].filter(Boolean).join(" "),
1116
+ icon: block.operationIcon,
1117
+ content: {
1118
+ ...block,
1119
+ input: safeParseJson(block.input)
1120
+ }
1121
+ };
1122
+ }
1123
+ case "toolResult": {
1124
+ if (block.error) {
1125
+ return {
1126
+ title: t("tool-error.label"),
1127
+ icon: lastToolCall?.block.operationIcon,
1128
+ content: block
1129
+ };
1130
+ }
1131
+ const title = lastToolCall?.tool?.description ?? [
1132
+ t("tool-result.label"),
1133
+ lastToolCall?.block.name
1134
+ ].filter(Boolean).join(" ");
1135
+ const icon = lastToolCall?.block.operationIcon;
1136
+ lastToolCall = void 0;
1137
+ return {
1138
+ title,
1139
+ icon,
1140
+ content: {
1141
+ ...block,
1142
+ result: typeof block.result === "string" ? safeParseJson(block.result) : block.result
1143
+ }
1144
+ };
1145
+ }
1146
+ case "stats": {
1147
+ if (!lastToolCall) {
1148
+ return null;
1149
+ }
1150
+ return {
1151
+ title: t("stats.label"),
1152
+ icon: lastToolCall.block.operationIcon,
1153
+ content: block
1154
+ };
1155
+ }
1156
+ }
1157
+ }).filter(isNonNullable);
1158
+ }, [
1159
+ blocks,
1160
+ t
1161
+ ]);
1162
+ const handleChangeOpen = useCallback5(() => {
1163
+ setTimeout(() => {
1164
+ view?.requestMeasure();
1165
+ }, 1e3);
1166
+ }, [
1167
+ view
1168
+ ]);
1169
+ if (!items.length) {
1170
+ return null;
1171
+ }
1172
+ return /* @__PURE__ */ React12.createElement(ToolPanel, {
1173
+ items,
1174
+ onChangeOpen: handleChangeOpen
1175
+ });
1176
+ };
1177
+ var DEFAULT_TOOL_ICON = "ph--wrench--regular";
1178
+ var ToolPanel = ({ items, onChangeOpen }) => {
1179
+ const tabsRef = useRef2(null);
1180
+ const [selected, setSelected] = useState5(0);
1181
+ const [open, setOpen] = useState5(false);
1182
+ useEffect4(() => {
1183
+ setSelected((prev) => Math.min(prev, Math.max(0, items.length - 1)));
1184
+ }, [
1185
+ items.length
1186
+ ]);
1187
+ useEffect4(() => {
1188
+ onChangeOpen?.(open);
1189
+ if (open) {
1190
+ tabsRef.current?.focus();
1191
+ }
1192
+ }, [
1193
+ open,
1194
+ onChangeOpen
1195
+ ]);
1196
+ const handleSelect = useCallback5((index) => {
1197
+ setSelected(index);
1198
+ }, []);
1199
+ const headerIcon = items[items.length - 1]?.icon ?? items[0]?.icon ?? DEFAULT_TOOL_ICON;
1200
+ return /* @__PURE__ */ React12.createElement(TogglePanel3.Root, {
1201
+ open,
1202
+ onChangeOpen: setOpen
1203
+ }, /* @__PURE__ */ React12.createElement(TogglePanel3.Content, null, /* @__PURE__ */ React12.createElement(TogglePanel3.Header, {
1204
+ classNames: "flex items-center gap-2 text-sm text-placeholder"
1205
+ }, /* @__PURE__ */ React12.createElement(Icon2, {
1206
+ icon: headerIcon,
1207
+ size: 4,
1208
+ classNames: "shrink-0 opacity-70"
1209
+ }), /* @__PURE__ */ React12.createElement(TextCrawl, {
1210
+ key: "status-roll",
1211
+ lines: items.map((item) => item.title),
1212
+ autoAdvance: true,
1213
+ greedy: true
1214
+ })), /* @__PURE__ */ React12.createElement(TogglePanel3.Body, null, /* @__PURE__ */ React12.createElement(TogglePanel3.Viewport, {
1215
+ classNames: "grid grid-cols-[32px_1fr]"
1216
+ }, /* @__PURE__ */ React12.createElement(NumericTabs, {
1217
+ ref: tabsRef,
1218
+ classNames: "p-1",
1219
+ length: items.length,
1220
+ selected,
1221
+ onSelect: handleSelect
1222
+ }), /* @__PURE__ */ React12.createElement(JsonHighlighter2, {
1223
+ data: items[selected]?.content,
1224
+ classNames: "p-1 text-xs bg-transparent",
1225
+ replacer: {
1226
+ maxDepth: 3,
1227
+ maxArrayLen: 10,
1228
+ maxStringLen: 128
1229
+ }
1230
+ })))));
1231
+ };
1232
+
1233
+ // src/components/ChatThread/registry.tsx
1234
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/ChatThread/registry.tsx";
1235
+ var componentRegistry = {
1236
+ //
1237
+ // Block-only (no widget — see note above).
1238
+ //
1239
+ prompt: {
1240
+ block: true
1241
+ },
1242
+ //
1243
+ // DOM Widgets
1244
+ //
1245
+ synthetic: {
1246
+ block: true,
1247
+ factory: ({ children, range }) => {
1248
+ const text = getXmlTextChild(children);
1249
+ return text ? new ReasoningWidget(text, range.from) : null;
1250
+ }
1251
+ },
1252
+ reasoning: {
1253
+ block: true,
1254
+ streaming: true,
1255
+ factory: ({ children, range }) => {
1256
+ const text = getXmlTextChild(children);
1257
+ return text ? new ReasoningWidget(text, range.from) : null;
1258
+ }
1259
+ },
1260
+ reference: {
1261
+ block: false,
1262
+ factory: ({ children, ref }) => {
1263
+ const text = getXmlTextChild(children);
1264
+ return text && ref ? new ReferenceWidget(text, ref) : null;
1265
+ }
1266
+ },
1267
+ select: {
1268
+ block: true,
1269
+ factory: ({ children }) => {
1270
+ const options = children?.map((option) => option._tag === "option" && getXmlTextChild(option.children)).filter(Boolean);
1271
+ return options?.length ? new SelectWidget(options) : null;
1272
+ }
1273
+ },
1274
+ suggestion: {
1275
+ block: true,
1276
+ factory: ({ children }) => {
1277
+ const text = getXmlTextChild(children);
1278
+ return text ? new SuggestionWidget(text) : null;
1279
+ }
1280
+ },
1281
+ stats: {
1282
+ block: true,
1283
+ factory: ({ children }) => {
1284
+ const text = getXmlTextChild(children);
1285
+ return text ? new StatsWidget(text) : null;
1286
+ }
1287
+ },
1288
+ status: {
1289
+ block: true,
1290
+ streaming: true,
1291
+ factory: ({ children }) => {
1292
+ const text = getXmlTextChild(children);
1293
+ return text ? new StatusWidget(text) : null;
1294
+ }
1295
+ },
1296
+ //
1297
+ // React Widgets (portaled outside of the editor)
1298
+ //
1299
+ summary: {
1300
+ block: true,
1301
+ Component: SummaryWidget
1302
+ },
1303
+ toolCall: {
1304
+ block: true,
1305
+ Component: (props) => /* @__PURE__ */ React13.createElement("div", {
1306
+ className: "py-2"
1307
+ }, /* @__PURE__ */ React13.createElement(ToolWidget, props))
1308
+ },
1309
+ toolResult: {
1310
+ block: true,
1311
+ Component: FallbackWidget
1312
+ },
1313
+ toolkit: {
1314
+ block: true,
1315
+ Component: FallbackWidget
1316
+ },
1317
+ //
1318
+ // Fallback
1319
+ //
1320
+ json: {
1321
+ block: true,
1322
+ Component: FallbackWidget
1323
+ }
1324
+ };
1325
+ var blockToMarkdown = createBlockRenderer("normal");
1326
+ function createBlockRenderer(viewType) {
1327
+ return (context, message, block) => {
1328
+ if (!isBlockVisible(viewType, message, block)) {
1329
+ return;
1330
+ }
1331
+ let str = blockToMarkdownImpl(context, message, block);
1332
+ if (str && !block.pending) {
1333
+ return str += "\n";
1334
+ }
1335
+ return str;
1336
+ };
1337
+ }
1338
+ var isBlockVisible = (viewType, message, block) => {
1339
+ switch (viewType) {
1340
+ case "debug":
1341
+ return true;
1342
+ case "normal":
1343
+ return block._tag !== "reasoning";
1344
+ case "summary":
1345
+ return block._tag === "text" && block.disposition !== "synthetic";
1346
+ case "thinking":
1347
+ default:
1348
+ return true;
1349
+ }
1350
+ };
1351
+ var blockToMarkdownImpl = (context, message, block) => {
1352
+ log("blockToMarkdown", {
1353
+ block: JSON.stringify(block)
1354
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 154, S: void 0 });
1355
+ switch (block._tag) {
1356
+ case "text": {
1357
+ if (message.sender.role === "user") {
1358
+ if (block.disposition === "synthetic") {
1359
+ return renderXMLBlock("synthetic", {
1360
+ content: block.text,
1361
+ pending: block.pending
1362
+ });
1363
+ } else {
1364
+ return `
1365
+ <prompt>${block.text}</prompt>`;
1366
+ }
1367
+ } else {
1368
+ const text = block.text.trim();
1369
+ if (text.length > 0) {
1370
+ return text;
1371
+ }
1372
+ }
1373
+ break;
1374
+ }
1375
+ case "reference": {
1376
+ if (block.pending) {
1377
+ return;
1378
+ }
1379
+ const dxn = block.reference.uri;
1380
+ return `<reference ref="${dxn.toString()}">${context.getObjectLabel(dxn)}</reference>`;
1381
+ }
1382
+ case "suggestion": {
1383
+ if (block.pending) {
1384
+ return;
1385
+ }
1386
+ return `<suggestion>${block.text}</suggestion>`;
1387
+ }
1388
+ case "select": {
1389
+ if (block.pending || block.options.length === 0) {
1390
+ return;
1391
+ }
1392
+ return `<select>${block.options.map((option) => `<option>${option}</option>`).join("")}</select>`;
1393
+ }
1394
+ case "toolCall": {
1395
+ applyToolBlockToWidgetState(context, block);
1396
+ return `<toolCall id="${block.toolCallId}" />`;
1397
+ }
1398
+ case "toolResult": {
1399
+ applyToolBlockToWidgetState(context, block);
1400
+ break;
1401
+ }
1402
+ case "stats": {
1403
+ return "";
1404
+ }
1405
+ case "reasoning": {
1406
+ let text = block.reasoningText ?? block.redactedText;
1407
+ if (!text) {
1408
+ return;
1409
+ }
1410
+ return renderXMLBlock("reasoning", {
1411
+ content: text,
1412
+ pending: block.pending
1413
+ });
1414
+ }
1415
+ case "summary": {
1416
+ return renderXMLBlock("summary", {
1417
+ content: block.content,
1418
+ pending: block.pending
1419
+ });
1420
+ }
1421
+ case "status": {
1422
+ return renderXMLBlock("status", {
1423
+ content: block.statusText,
1424
+ pending: block.pending
1425
+ });
1426
+ }
1427
+ default: {
1428
+ return `<json id="${message.id}">
1429
+ ${JSON.stringify(block)}
1430
+ </json>`;
1431
+ }
1432
+ }
1433
+ };
1434
+ var escapeXmlTextContent = (raw) => raw.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1435
+ var renderXMLBlock = (tag, opts) => {
1436
+ const content = escapeXmlTextContent((opts.content ?? "").replace(/\n\n/g, " ").trim());
1437
+ if (opts.pending) {
1438
+ return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ""}>${content}`;
1439
+ } else {
1440
+ return `<${tag}${opts.attributes ? ` ${opts.attributes}` : ""}>${content}</${tag}>`;
1441
+ }
1442
+ };
1443
+
1444
+ // src/components/ChatThread/sync.ts
1445
+ var MessageThreadContext = class {
1446
+ _widgetState;
1447
+ constructor(_widgetState) {
1448
+ this._widgetState = _widgetState;
1449
+ }
1450
+ updateWidget(id, value2) {
1451
+ this._widgetState?.updateWidget(id, value2);
1452
+ }
1453
+ // TODO(burdon): Resolve name from hypergraph.
1454
+ getObjectLabel(_id) {
1455
+ return "Object";
1456
+ }
1457
+ };
1458
+ var MessageSyncer = class {
1459
+ _document;
1460
+ _renderer;
1461
+ _threadId;
1462
+ _completed = 0;
1463
+ _trailing = 0;
1464
+ _context;
1465
+ constructor(_document, _renderer) {
1466
+ this._document = _document;
1467
+ this._renderer = _renderer;
1468
+ this._context = new MessageThreadContext(this._document);
1469
+ }
1470
+ get context() {
1471
+ return this._context;
1472
+ }
1473
+ /**
1474
+ * Replace the document with the rendering of `messages`. Use on mount, on thread switch,
1475
+ * and from {@link update} when it detects an identity change in `messages[0]`.
1476
+ */
1477
+ reset(messages = []) {
1478
+ this._threadId = messages[0]?.id;
1479
+ this._completed = 0;
1480
+ this._trailing = 0;
1481
+ const buffer = this._walk(messages);
1482
+ void this._document.setContent(buffer).then(() => {
1483
+ rehydrateToolWidgetsFromMessages(this._context, messages);
1484
+ });
1485
+ }
1486
+ /**
1487
+ * Stream the suffix of the rendered messages into the document.
1488
+ * Returns `true` if the document was replaced (initial mount or thread switch), `false`
1489
+ * if the call was a streaming append (or a no-op).
1490
+ */
1491
+ update(messages) {
1492
+ if (messages[0]?.id !== this._threadId) {
1493
+ this.reset(messages);
1494
+ return true;
1495
+ }
1496
+ const buffer = this._walk(messages);
1497
+ if (buffer.length > 0) {
1498
+ void this._document.append(buffer);
1499
+ }
1500
+ return false;
1501
+ }
1502
+ /**
1503
+ * Walk flat blocks starting at `_completed`, advancing the cursors and returning the chars
1504
+ * to append. Blocks before `_completed` are skipped — their renderer is never re-invoked,
1505
+ * which preserves single-shot side effects (e.g. tool widget state mutation).
1506
+ */
1507
+ _walk(messages) {
1508
+ let buffer = "";
1509
+ let index = 0;
1510
+ outer: for (const message of messages) {
1511
+ for (const block of message.blocks) {
1512
+ if (index < this._completed) {
1513
+ index++;
1514
+ continue;
1515
+ }
1516
+ const rendered = this._renderer(this._context, message, block) ?? "";
1517
+ if (rendered.length > this._trailing) {
1518
+ buffer += rendered.slice(this._trailing);
1519
+ }
1520
+ if (block.pending) {
1521
+ if (rendered.length > this._trailing) {
1522
+ this._trailing = rendered.length;
1523
+ }
1524
+ break outer;
1525
+ }
1526
+ this._completed = index + 1;
1527
+ this._trailing = 0;
1528
+ index++;
1529
+ }
1530
+ }
1531
+ return buffer;
1532
+ }
1533
+ };
1534
+
1535
+ // src/components/ChatThread/ChatThread.tsx
1536
+ var defaultOptions = {
1537
+ autoScroll: true,
1538
+ cursor: false,
1539
+ fader: false,
1540
+ typewriter: true
1541
+ };
1542
+ var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages = [], error, options = defaultOptions, footer, debug = false, extensions, viewType, onEvent }, forwardedRef) => {
1543
+ const [controller, setController] = useState6(null);
1544
+ const handleMarkdownStreamRef = useCallback6((instance) => {
1545
+ setController(instance);
1546
+ setRef(forwardedRef, instance);
1547
+ }, [
1548
+ forwardedRef
1549
+ ]);
1550
+ const userHue = useMemo5(() => identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue, [
1551
+ identity
1552
+ ]);
1553
+ const initializedRef = useRef3(false);
1554
+ useEffect5(() => {
1555
+ if (!controller) {
1556
+ initializedRef.current = false;
1557
+ return;
1558
+ }
1559
+ controller.scrollToBottom(initializedRef.current ? "smooth" : "instant");
1560
+ initializedRef.current = true;
1561
+ }, [
1562
+ controller,
1563
+ error
1564
+ ]);
1565
+ const renderer = useMemo5(() => createBlockRenderer(viewType), [
1566
+ viewType
1567
+ ]);
1568
+ const syncer = useMemo5(() => controller && new MessageSyncer(controller, renderer), [
1569
+ controller,
1570
+ renderer
1571
+ ]);
1572
+ useEffect5(() => {
1573
+ if (!syncer) {
1574
+ return;
1575
+ }
1576
+ if (syncer.update(messages)) {
1577
+ controller?.scrollToBottom("instant");
1578
+ }
1579
+ }, [
1580
+ controller,
1581
+ syncer,
1582
+ messages
1583
+ ]);
1584
+ const handleEvent = useCallback6(({ type, value: value2 }) => {
1585
+ switch (type) {
1586
+ case "submit": {
1587
+ value2 && onEvent?.({
1588
+ type,
1589
+ text: value2
1590
+ });
1591
+ break;
1592
+ }
1593
+ }
1594
+ }, [
1595
+ onEvent
1596
+ ]);
1597
+ return /* @__PURE__ */ React14.createElement("div", {
1598
+ "data-hue": userHue,
1599
+ className: "contents"
1600
+ }, /* @__PURE__ */ React14.createElement(MarkdownStream, {
1601
+ key: viewType,
1602
+ classNames,
1603
+ registry: componentRegistry,
1604
+ options,
1605
+ debug,
1606
+ extensions,
1607
+ footer,
1608
+ onEvent: handleEvent,
1609
+ ref: handleMarkdownStreamRef
1610
+ }));
1611
+ });
1612
+
1613
+ // src/components/TaskList/TaskList.tsx
1614
+ import React15 from "react";
1615
+ import { useObject as useObject2 } from "@dxos/react-client/echo";
1616
+ import { Icon as Icon3, Tag } from "@dxos/react-ui";
1617
+ import { composable, composableProps } from "@dxos/react-ui";
1618
+ import { Row, RowList } from "@dxos/react-ui-list";
1619
+ var TaskList = composable(({ plan, ...props }, forwardedRef) => {
1620
+ const [snapshot] = useObject2(plan);
1621
+ const tasks = snapshot?.tasks ?? [];
1622
+ return /* @__PURE__ */ React15.createElement(RowList.Root, null, /* @__PURE__ */ React15.createElement(RowList.Viewport, {
1623
+ ...composableProps(props, {
1624
+ classNames: "dx-container"
1625
+ }),
1626
+ ref: forwardedRef
1627
+ }, /* @__PURE__ */ React15.createElement(RowList.Content, {
1628
+ "aria-label": "Tasks"
1629
+ }, tasks.map((task) => /* @__PURE__ */ React15.createElement(Row, {
1630
+ key: task.id,
1631
+ id: task.id,
1632
+ classNames: "py-0"
1633
+ }, /* @__PURE__ */ React15.createElement("div", {
1634
+ className: "flex items-center gap-2"
1635
+ }, /* @__PURE__ */ React15.createElement(Icon3, {
1636
+ icon: task.status === "done" ? "ph--check--regular" : "ph--circle--regular",
1637
+ classNames: task.status === "done" ? "text-success-text" : void 0,
1638
+ size: 4
1639
+ }), /* @__PURE__ */ React15.createElement("span", {
1640
+ className: "sr-only"
1641
+ }, task.status === "done" ? "done" : task.status === "in-progress" ? "in progress" : "to do"), /* @__PURE__ */ React15.createElement("span", {
1642
+ className: "truncate flex-1"
1643
+ }, task.title), task.status === "in-progress" && /* @__PURE__ */ React15.createElement(Tag, {
1644
+ palette: "info"
1645
+ }, "pending")))))));
1646
+ });
1647
+
1648
+ // src/components/Chat/Chat.tsx
1649
+ var ChatRoot = ({ children, chat, feed, processor, db: dbFallback, onEvent, onSubmit, ...props }) => {
1650
+ const [debug, setDebug] = useState7(false);
1651
+ const streaming = useAtomValue4(processor.streaming);
1652
+ const active = useAtomValue4(processor.active);
1653
+ const requestTiming = useRequestTiming({
1654
+ active
1655
+ });
1656
+ const lastPrompt = useRef4(void 0);
1657
+ const db = chat && Obj4.getDatabase(chat) || dbFallback;
1658
+ const event = useMemo6(() => new Event(), []);
1659
+ const feedMessages = useQuery3(db, feed ? Query.select(Filter3.type(Message2.Message)).from(feed) : Query.select(Filter3.nothing()));
1660
+ const pendingMessages = useAtomValue4(processor.messages);
1661
+ const messages = useMemo6(() => Array.dedupeWith([
1662
+ ...feedMessages,
1663
+ ...pendingMessages
1664
+ ], ({ id: a }, { id: b }) => a === b), [
1665
+ feedMessages,
1666
+ pendingMessages
1667
+ ]);
1668
+ const dump = useDebug({
1669
+ processor
1670
+ });
1671
+ const error = useAtomValue4(processor.error);
1672
+ useEffect6(() => {
1673
+ if (Option3.isSome(error)) {
1674
+ event.emit({
1675
+ type: "error",
1676
+ error: error.value
1677
+ });
1678
+ }
1679
+ }, [
1680
+ event,
1681
+ error
1682
+ ]);
1683
+ useEffect6(() => {
1684
+ return event.on((ev) => {
1685
+ switch (ev.type) {
1686
+ case "toggle-debug": {
1687
+ setDebug((debug2) => {
1688
+ if (debug2) {
1689
+ return false;
1690
+ } else {
1691
+ void dump();
1692
+ return true;
1693
+ }
1694
+ });
1695
+ break;
1696
+ }
1697
+ case "submit": {
1698
+ const text = ev.text.trim();
1699
+ if (!streaming && text.length) {
1700
+ lastPrompt.current = ev.text;
1701
+ void Promise.resolve(onSubmit?.(text)).then(() => processor.request({
1702
+ message: text
1703
+ }));
1704
+ }
1705
+ break;
1706
+ }
1707
+ case "retry": {
1708
+ if (!streaming) {
1709
+ void processor.retry();
1710
+ }
1711
+ break;
1712
+ }
1713
+ case "cancel": {
1714
+ void processor.cancel();
1715
+ if (streaming) {
1716
+ if (lastPrompt.current) {
1717
+ event.emit({
1718
+ type: "update-prompt",
1719
+ text: lastPrompt.current
1720
+ });
1721
+ }
1722
+ }
1723
+ break;
1724
+ }
1725
+ }
1726
+ onEvent?.(ev);
1727
+ });
1728
+ }, [
1729
+ event,
1730
+ dump,
1731
+ processor,
1732
+ streaming,
1733
+ onEvent,
1734
+ onSubmit
1735
+ ]);
1736
+ return /* @__PURE__ */ React16.createElement(ChatContextProvider, {
1737
+ debug,
1738
+ event,
1739
+ db,
1740
+ chat,
1741
+ messages,
1742
+ processor,
1743
+ requestTiming,
1744
+ ...props
1745
+ }, children);
1746
+ };
1747
+ ChatRoot.displayName = "Chat.Root";
1748
+ var useRequestTiming = ({ active }) => {
1749
+ const [requestTiming, setRequestTiming] = useState7(null);
1750
+ useEffect6(() => {
1751
+ if (active) {
1752
+ setRequestTiming({
1753
+ startedAt: Date.now(),
1754
+ endedAt: null
1755
+ });
1756
+ } else {
1757
+ setRequestTiming((prev) => prev && prev.endedAt == null ? {
1758
+ ...prev,
1759
+ endedAt: Date.now()
1760
+ } : prev);
1761
+ }
1762
+ }, [
1763
+ active
1764
+ ]);
1765
+ return requestTiming;
1766
+ };
1767
+ var CHAT_TOOLBAR_NAME = "Chat.Toolbar";
1768
+ var ChatToolbar = composable2(({ children, attendableId, alwaysActive, companionTo, ...props }, forwardedRef) => {
1769
+ const { chat } = useChatContext(CHAT_TOOLBAR_NAME);
1770
+ const menuActions = useChatToolbarActions({
1771
+ chat,
1772
+ companionTo
1773
+ });
1774
+ return /* @__PURE__ */ React16.createElement(Menu.Root, {
1775
+ ...menuActions,
1776
+ attendableId,
1777
+ alwaysActive
1778
+ }, /* @__PURE__ */ React16.createElement(Menu.Toolbar, {
1779
+ ...composableProps2(props),
1780
+ ref: forwardedRef
1781
+ }, children));
1782
+ });
1783
+ ChatToolbar.displayName = CHAT_TOOLBAR_NAME;
1784
+ var CHAT_CONTENT_NAME = "Chat.Content";
1785
+ var ChatContent = composable2(({ children, ...props }, forwardedRef) => {
1786
+ return /* @__PURE__ */ React16.createElement("div", {
1787
+ ...composableProps2(props, {
1788
+ classNames: "dx-expander flex flex-col"
1789
+ }),
1790
+ ref: forwardedRef
1791
+ }, children);
1792
+ });
1793
+ ChatContent.displayName = CHAT_CONTENT_NAME;
1794
+ var CHAT_THREAD_NAME = "Chat.Thread";
1795
+ var ChatThread2 = ({ viewType, debug: debugProp, ...props }) => {
1796
+ const { t } = useTranslation9(meta9.id);
1797
+ const { debug, event, messages, processor } = useChatContext(CHAT_THREAD_NAME);
1798
+ const extensions = useChatKeymapExtensions2({
1799
+ event
1800
+ });
1801
+ const identity = useIdentity();
1802
+ const error = useAtomValue4(processor.error).pipe(Option3.getOrUndefined);
1803
+ const [toastError, setToastError] = useState7(void 0);
1804
+ const debugView = viewType === "debug";
1805
+ const controllerRef = useRef4(null);
1806
+ useEffect6(() => {
1807
+ return event.on((event2) => {
1808
+ switch (event2.type) {
1809
+ case "submit":
1810
+ case "scroll-to-bottom":
1811
+ controllerRef.current?.scrollToBottom();
1812
+ break;
1813
+ case "nav-previous":
1814
+ controllerRef.current?.navigatePrevious();
1815
+ break;
1816
+ case "nav-next":
1817
+ controllerRef.current?.navigateNext();
1818
+ break;
1819
+ case "error":
1820
+ setToastError(event2.error);
1821
+ break;
1822
+ }
1823
+ });
1824
+ }, [
1825
+ event
1826
+ ]);
1827
+ const handleEvent = useCallback7((ev) => {
1828
+ event.emit(ev);
1829
+ }, [
1830
+ event
1831
+ ]);
1832
+ if (!identity) {
1833
+ return /* @__PURE__ */ React16.createElement("div", {
1834
+ className: "dx-expander"
1835
+ });
1836
+ }
1837
+ return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(ChatThread, {
1838
+ ...props,
1839
+ identity,
1840
+ messages,
1841
+ error,
1842
+ debug: debugProp ?? (debug || debugView),
1843
+ viewType,
1844
+ extensions,
1845
+ onEvent: handleEvent,
1846
+ ref: controllerRef
1847
+ }), /* @__PURE__ */ React16.createElement(Toast.Root, {
1848
+ type: "foreground",
1849
+ open: !!toastError,
1850
+ duration: 2e4,
1851
+ onOpenChange: (open) => !open && setToastError(void 0)
1852
+ }, /* @__PURE__ */ React16.createElement(Toast.Title, {
1853
+ icon: "ph--warning--regular",
1854
+ onClose: () => setToastError(void 0)
1855
+ }, t("ai-service-error.label")), /* @__PURE__ */ React16.createElement(Toast.Description, null, toastError?.message)));
1856
+ };
1857
+ ChatThread2.displayName = CHAT_THREAD_NAME;
1858
+ var CHAT_PROMPT_NAME = "Chat.Prompt";
1859
+ var ChatPrompt2 = (props) => {
1860
+ const { chat, db, processor, event } = useChatContext(CHAT_PROMPT_NAME);
1861
+ return /* @__PURE__ */ React16.createElement(ChatPrompt, {
1862
+ ...props,
1863
+ chat,
1864
+ db,
1865
+ processor,
1866
+ event
1867
+ });
1868
+ };
1869
+ ChatPrompt2.displayName = CHAT_PROMPT_NAME;
1870
+ var CHAT_TASK_LIST_NAME = "Chat.TaskList";
1871
+ var ChatTaskList = composable2(({ plan: planProp, ...props }, forwardedRef) => {
1872
+ const { chat } = useChatContext(CHAT_TASK_LIST_NAME);
1873
+ const parent = chat ? Obj4.getParent(chat) : void 0;
1874
+ const agent = parent && Obj4.instanceOf(Agent.Agent, parent) ? parent : void 0;
1875
+ const plan = planProp ?? agent?.plan.target;
1876
+ if (!plan) {
1877
+ return null;
1878
+ }
1879
+ return /* @__PURE__ */ React16.createElement(TaskList, {
1880
+ ...props,
1881
+ plan,
1882
+ ref: forwardedRef
1883
+ });
1884
+ });
1885
+ ChatTaskList.displayName = CHAT_TASK_LIST_NAME;
1886
+ var Chat = {
1887
+ Root: ChatRoot,
1888
+ Toolbar: ChatToolbar,
1889
+ Content: ChatContent,
1890
+ Prompt: ChatPrompt2,
1891
+ Status: ChatStatus,
1892
+ Thread: ChatThread2,
1893
+ TaskList: ChatTaskList
1894
+ };
1895
+
1896
+ // src/components/ProcessTree/ProcessTree.tsx
1897
+ import * as Match from "effect/Match";
1898
+ import * as Option4 from "effect/Option";
1899
+ import React17 from "react";
1900
+ import { Process } from "@dxos/compute";
1901
+ import { Icon as Icon4, IconButton as IconButton4, ScrollArea, Tooltip as Tooltip2, Treegrid } from "@dxos/react-ui";
1902
+ import { composable as composable3, composableProps as composableProps3 } from "@dxos/react-ui";
1903
+ import { mx as mx7 } from "@dxos/ui-theme";
1904
+ import { Unit as Unit2 } from "@dxos/util";
1905
+ var ProcessTree = /* @__PURE__ */ React17.memo(composable3(({ processes, onProcessSelect, onProcessTerminate, ...props }, forwardedRef) => {
1906
+ const sortedProcesses = [
1907
+ ...processes.filter((process) => [
1908
+ Process.State.RUNNING,
1909
+ Process.State.HYBERNATING
1910
+ ].includes(process.state)),
1911
+ ...processes.filter((process) => [
1912
+ Process.State.IDLE
1913
+ ].includes(process.state)).slice(0, 3),
1914
+ ...processes.filter((process) => [
1915
+ Process.State.SUCCEEDED,
1916
+ Process.State.FAILED,
1917
+ Process.State.TERMINATED
1918
+ ].includes(process.state))
1919
+ ].sort((a, b) => {
1920
+ const aCompletedAt = Option4.getOrElse(a.completedAt, () => Infinity);
1921
+ const bCompletedAt = Option4.getOrElse(b.completedAt, () => Infinity);
1922
+ return bCompletedAt - aCompletedAt;
1923
+ });
1924
+ return /* @__PURE__ */ React17.createElement(ScrollArea.Root, {
1925
+ ...composableProps3(props, {
1926
+ classNames: "dx-expander"
1927
+ }),
1928
+ thin: true,
1929
+ ref: forwardedRef
1930
+ }, /* @__PURE__ */ React17.createElement(ScrollArea.Viewport, null, /* @__PURE__ */ React17.createElement(Treegrid.Root, {
1931
+ classNames: "grid grid-cols-[min-content_1fr_min-content_min-content]"
1932
+ }, sortedProcesses.filter((process) => process.parentPid === null).map((process) => {
1933
+ const t = Unit2.Duration(process.metrics.wallTime);
1934
+ return /* @__PURE__ */ React17.createElement(Treegrid.Row, {
1935
+ key: process.pid.toString(),
1936
+ id: process.pid.toString(),
1937
+ parentOf: process.parentPid?.toString(),
1938
+ classNames: mx7("col-span-full grid grid-cols-subgrid gap-2 ps-1", onProcessSelect && "dx-hover")
1939
+ }, /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
1940
+ classNames: "grid place-items-center"
1941
+ }, /* @__PURE__ */ React17.createElement(Tooltip2.Trigger, {
1942
+ content: process.state.toString()
1943
+ }, /* @__PURE__ */ React17.createElement(Icon4, {
1944
+ size: 4,
1945
+ synchronized: true,
1946
+ classNames: mx7(process.state === Process.State.RUNNING && "animate-spin", process.state === Process.State.FAILED && "text-error-text", process.state === Process.State.SUCCEEDED && "text-success-text"),
1947
+ icon: Match.value(process.state).pipe(Match.when(Process.State.RUNNING, () => "ph--spinner-gap--regular"), Match.when(Process.State.SUCCEEDED, () => "ph--check-circle--regular"), Match.when(Process.State.FAILED, () => "ph--warning--regular"), Match.when(Process.State.HYBERNATING, () => "ph--spinner--regular"), Match.when(Process.State.IDLE, () => "ph--moon-stars--regular"), Match.when(Process.State.TERMINATING, () => "ph--x-circle--regular"), Match.when(Process.State.TERMINATED, () => "ph--x-circle--regular"), Match.orElse(() => "ph--spinner-gap--regular"))
1948
+ }))), /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
1949
+ classNames: "flex items-center truncate",
1950
+ onClick: () => onProcessSelect?.(process)
1951
+ }, /* @__PURE__ */ React17.createElement("span", {
1952
+ className: mx7("truncate text-sm", process.state !== Process.State.RUNNING && "text-description")
1953
+ }, process.params.name ?? process.pid.toString())), /* @__PURE__ */ React17.createElement(Treegrid.Cell, {
1954
+ classNames: "flex items-center justify-end text-xs text-description tabular-nums"
1955
+ }, [
1956
+ Process.State.FAILED,
1957
+ Process.State.SUCCEEDED
1958
+ ].includes(process.state) && /* @__PURE__ */ React17.createElement("span", {
1959
+ className: "whitespace-nowrap"
1960
+ }, t.toString())), /* @__PURE__ */ React17.createElement(Treegrid.Cell, null, onProcessTerminate && /* @__PURE__ */ React17.createElement(IconButton4, {
1961
+ classNames: "min-h-0 p-1",
1962
+ icon: "ph--x--regular",
1963
+ iconOnly: true,
1964
+ variant: "ghost",
1965
+ size: 4,
1966
+ label: "Actions",
1967
+ onClick: (event) => {
1968
+ event.stopPropagation();
1969
+ onProcessTerminate?.(process);
1970
+ }
1971
+ })));
1972
+ }))));
1973
+ }));
1974
+
1975
+ // src/components/TemplateEditor/TemplateEditor.tsx
1976
+ import { defaultHighlightStyle, syntaxHighlighting } from "@codemirror/language";
1977
+ import { composeRefs } from "@radix-ui/react-compose-refs";
1978
+ import React18 from "react";
1979
+ import { createDocAccessor } from "@dxos/echo-client";
1980
+ import { useThemeContext, useTranslation as useTranslation10 } from "@dxos/react-ui";
1981
+ import { composable as composable4, composableProps as composableProps4 } from "@dxos/react-ui";
1982
+ import { useTextEditor } from "@dxos/react-ui-editor";
1983
+ import { createBasicExtensions, createDataExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown } from "@dxos/ui-editor";
1984
+ import { isNonNullable as isNonNullable2 } from "@dxos/util";
1985
+ import { meta as meta10 } from "#meta";
1986
+
1987
+ // src/components/TemplateEditor/extensions/handlebars-extension.ts
1988
+ import { autocompletion, completionKeymap } from "@codemirror/autocomplete";
1989
+ import { RangeSetBuilder } from "@codemirror/state";
1990
+ import { Decoration, ViewPlugin, WidgetType as WidgetType7, keymap } from "@codemirror/view";
1991
+ import { Domino as Domino7, mx as mx8 } from "@dxos/ui";
1992
+ var handlebars = (_ = {}) => {
1993
+ return [
1994
+ handlebarsHighlightPlugin,
1995
+ autocompletion({
1996
+ activateOnTyping: true,
1997
+ aboveCursor: true,
1998
+ closeOnBlur: true,
1999
+ override: [
2000
+ handlebarsCompletions
2001
+ ]
2002
+ }),
2003
+ keymap.of(completionKeymap)
2004
+ ];
2005
+ };
2006
+ var regex = {
2007
+ // {{! comment }}
2008
+ comment: /\{\{!\s*[^}]*\}\}/g,
2009
+ // {{var}}
2010
+ brackets: /\{\{[^}]*\}\}/g,
2011
+ // {{#command}} {{/command}}
2012
+ command: /\{\{[#/]([^}]+)\}\}/g,
2013
+ // {{var}}
2014
+ var: /\{\{(?!\s*!)(\w[^}]*)\}\}/g,
2015
+ // @echo://space/id or @dxn:nsid
2016
+ dxn: /@?(?:echo:\/{1,3}[\w/]+|dxn:[\w.-]+)/g,
2017
+ // example.com/path/xxx
2018
+ url: /[\w.-]+\.[\w.-]+\/[\w/]+/g
2019
+ };
2020
+ var tagPadding = "mx-0.5 px-1 rounded-xs";
2021
+ var handlebarsHighlightPlugin = ViewPlugin.fromClass(class {
2022
+ decorations;
2023
+ constructor(view) {
2024
+ this.decorations = this.buildDecorations(view);
2025
+ }
2026
+ update(update) {
2027
+ if (update.docChanged || update.viewportChanged || update.selectionSet) {
2028
+ this.decorations = this.buildDecorations(update.view);
2029
+ }
2030
+ }
2031
+ // NOTE: Decorations may clash with other extensions (e.g., markdown).
2032
+ buildDecorations(view) {
2033
+ const selection = view.state.selection.main;
2034
+ const decorations = [];
2035
+ for (const { from, to } of view.visibleRanges) {
2036
+ const text = view.state.doc.sliceString(from, to);
2037
+ {
2038
+ let match;
2039
+ while ((match = regex.dxn.exec(text)) !== null) {
2040
+ const start = from + match.index;
2041
+ const end = start + match[0].length;
2042
+ const overlaps = selection.to > start && selection.from <= end;
2043
+ if (!overlaps) {
2044
+ decorations.push({
2045
+ from: start,
2046
+ to: end,
2047
+ decoration: Decoration.widget({
2048
+ widget: new DXNWidget(match[0])
2049
+ })
2050
+ });
2051
+ }
2052
+ }
2053
+ }
2054
+ {
2055
+ let match;
2056
+ while ((match = regex.url.exec(text)) !== null) {
2057
+ const start = from + match.index;
2058
+ const end = start + match[0].length;
2059
+ decorations.push({
2060
+ from: start,
2061
+ to: end,
2062
+ decoration: Decoration.mark({
2063
+ class: mx8("dx-tag--blue", tagPadding)
2064
+ })
2065
+ });
2066
+ }
2067
+ }
2068
+ {
2069
+ let match;
2070
+ while ((match = regex.brackets.exec(text)) !== null) {
2071
+ const start = from + match.index;
2072
+ const end = start + match[0].length;
2073
+ decorations.push({
2074
+ from: start,
2075
+ to: end,
2076
+ decoration: Decoration.mark({
2077
+ class: "text-subdued"
2078
+ })
2079
+ });
2080
+ }
2081
+ }
2082
+ {
2083
+ let match;
2084
+ while ((match = regex.command.exec(text)) !== null) {
2085
+ const start = from + match.index + 2;
2086
+ let end = start + match[0].length - 4;
2087
+ const text2 = view.state.doc.sliceString(start, end);
2088
+ const parts = text2.split(/\s+/);
2089
+ if (parts.length > 1) {
2090
+ const idx = start + parts[0].length;
2091
+ decorations.push({
2092
+ from: idx,
2093
+ to: end,
2094
+ decoration: Decoration.mark({
2095
+ class: "text-green-text"
2096
+ })
2097
+ });
2098
+ end = idx;
2099
+ }
2100
+ decorations.push({
2101
+ from: start,
2102
+ to: end,
2103
+ decoration: Decoration.mark({
2104
+ class: "text-blue-text"
2105
+ })
2106
+ });
2107
+ }
2108
+ }
2109
+ {
2110
+ let match;
2111
+ while ((match = regex.var.exec(text)) !== null) {
2112
+ const start = from + match.index + 2;
2113
+ const end = start + match[0].length - 4;
2114
+ decorations.push({
2115
+ from: start,
2116
+ to: end,
2117
+ decoration: Decoration.mark({
2118
+ class: "text-green-text"
2119
+ })
2120
+ });
2121
+ }
2122
+ }
2123
+ }
2124
+ decorations.sort((a, b) => a.from - b.from || a.to - b.to);
2125
+ const builder = new RangeSetBuilder();
2126
+ for (const { from, to, decoration } of decorations) {
2127
+ builder.add(from, to, decoration);
2128
+ }
2129
+ return builder.finish();
2130
+ }
2131
+ }, {
2132
+ decorations: (v) => v.decorations
2133
+ });
2134
+ var DXNWidget = class extends WidgetType7 {
2135
+ _identifier;
2136
+ constructor(_identifier) {
2137
+ super(), this._identifier = _identifier;
2138
+ }
2139
+ ignoreEvent() {
2140
+ return false;
2141
+ }
2142
+ eq(other) {
2143
+ return this._identifier === other._identifier;
2144
+ }
2145
+ toDOM() {
2146
+ const text = this._identifier.split(":").map((part) => {
2147
+ const len = 16;
2148
+ const plen = 4;
2149
+ if (part.length > len) {
2150
+ return `[${part.slice(0, plen)}\u2026${part.slice(-plen)}]`;
2151
+ }
2152
+ return part;
2153
+ }).join(":");
2154
+ return Domino7.of("span").classNames(mx8("font-mono dx-tag--blue", tagPadding)).text(text).root;
2155
+ }
2156
+ };
2157
+ var variables = [
2158
+ "this"
2159
+ ];
2160
+ var commands = [
2161
+ "this",
2162
+ "each",
2163
+ "if",
2164
+ "unless",
2165
+ "with"
2166
+ ];
2167
+ function handlebarsCompletions(context) {
2168
+ const match = context.matchBefore(/\{\{[^}]*/);
2169
+ if (!match || match.from === match.to) {
2170
+ return null;
2171
+ }
2172
+ let type = "variable";
2173
+ let text = match.text.slice(2);
2174
+ let from = match.from + 2;
2175
+ let matches = [];
2176
+ if (text.startsWith("#") || text.startsWith("/")) {
2177
+ const idx = text.lastIndexOf(" ");
2178
+ if (idx !== -1) {
2179
+ type = "variable";
2180
+ matches = variables;
2181
+ text = text.slice(idx + 1);
2182
+ from += idx + 1;
2183
+ } else {
2184
+ type = "command";
2185
+ text = text.slice(1);
2186
+ matches = commands;
2187
+ from += 1;
2188
+ }
2189
+ } else {
2190
+ type = "variable";
2191
+ matches = variables;
2192
+ }
2193
+ const options = matches.filter((name) => name.startsWith(text)).map((name) => ({
2194
+ type,
2195
+ label: name
2196
+ }));
2197
+ return {
2198
+ from,
2199
+ options
2200
+ };
2201
+ }
2202
+
2203
+ // src/components/TemplateEditor/extensions/xml-extension.ts
2204
+ import { syntaxTree } from "@codemirror/language";
2205
+ import { RangeSetBuilder as RangeSetBuilder2 } from "@codemirror/state";
2206
+ import { Decoration as Decoration2, ViewPlugin as ViewPlugin2 } from "@codemirror/view";
2207
+ var xmlDecorator = (_ = {}) => {
2208
+ return [
2209
+ xmlDecoratorPlugin
2210
+ ];
2211
+ };
2212
+ var xmlDecoratorPlugin = ViewPlugin2.fromClass(class {
2213
+ decorations;
2214
+ constructor(view) {
2215
+ this.decorations = this.buildDecorations(view);
2216
+ }
2217
+ update(update) {
2218
+ if (update.docChanged || update.viewportChanged) {
2219
+ this.decorations = this.buildDecorations(update.view);
2220
+ }
2221
+ }
2222
+ buildDecorations(view) {
2223
+ const builder = new RangeSetBuilder2();
2224
+ for (const { from, to } of view.visibleRanges) {
2225
+ syntaxTree(view.state).iterate({
2226
+ from,
2227
+ to,
2228
+ enter: (node) => {
2229
+ if (node.name === "HTMLTag" || node.name === "OpenTag" || node.name === "CloseTag" || node.name === "SelfClosingTag" || node.name === "Element") {
2230
+ builder.add(node.from, node.to, Decoration2.mark({
2231
+ class: "font-mono text-subdued"
2232
+ }));
2233
+ }
2234
+ }
2235
+ });
2236
+ }
2237
+ return builder.finish();
2238
+ }
2239
+ }, {
2240
+ decorations: (v) => v.decorations
2241
+ });
2242
+
2243
+ // src/components/TemplateEditor/TemplateEditor.tsx
2244
+ var TemplateEditor = composable4(({ classNames, id, source, lineNumbers = true, ...props }, forwardedRef) => {
2245
+ const { t } = useTranslation10(meta10.id);
2246
+ const { themeMode } = useThemeContext();
2247
+ const { parentRef } = useTextEditor(() => {
2248
+ const target = source?.target;
2249
+ if (!target) {
2250
+ return {};
2251
+ }
2252
+ return {
2253
+ initialValue: target.content ?? "",
2254
+ extensions: [
2255
+ createDataExtensions({
2256
+ id,
2257
+ text: createDocAccessor(target, [
2258
+ "content"
2259
+ ])
2260
+ }),
2261
+ createBasicExtensions({
2262
+ bracketMatching: false,
2263
+ lineNumbers,
2264
+ lineWrapping: true,
2265
+ placeholder: t("template.placeholder")
2266
+ }),
2267
+ createThemeExtensions({
2268
+ themeMode
2269
+ }),
2270
+ createMarkdownExtensions(),
2271
+ decorateMarkdown(),
2272
+ handlebars(),
2273
+ // xml(),
2274
+ // NOTE: Since we're using markdown only HTML nodes are parsed.
2275
+ xmlDecorator(),
2276
+ syntaxHighlighting(defaultHighlightStyle)
2277
+ ].filter(isNonNullable2)
2278
+ };
2279
+ }, [
2280
+ themeMode,
2281
+ source?.target,
2282
+ lineNumbers
2283
+ ]);
2284
+ return /* @__PURE__ */ React18.createElement("div", {
2285
+ ...composableProps4(props, {
2286
+ role: "none",
2287
+ classNames: [
2288
+ "h-full overflow-hidden",
2289
+ classNames
2290
+ ]
2291
+ }),
2292
+ ref: composeRefs(parentRef, forwardedRef)
2293
+ });
2294
+ });
2295
+
2296
+ // src/components/Toolbox/Toolbox.tsx
2297
+ import React19, { Fragment, useEffect as useEffect7, useState as useState8 } from "react";
2298
+ import { Operation } from "@dxos/compute";
2299
+ import { Filter as Filter4 } from "@dxos/echo";
2300
+ import { log as log2 } from "@dxos/log";
2301
+ import { useQuery as useQuery4 } from "@dxos/react-client/echo";
2302
+ import { ScrollArea as ScrollArea2 } from "@dxos/react-ui";
2303
+ import { composable as composable5, composableProps as composableProps5 } from "@dxos/react-ui";
2304
+ import { mx as mx9 } from "@dxos/ui-theme";
2305
+ import { ServiceType } from "#types";
2306
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/Toolbox/Toolbox.tsx";
2307
+ var Toolbox = composable5(({ functions, services, blueprints, activeBlueprints, ...props }, forwardedRef) => {
2308
+ return /* @__PURE__ */ React19.createElement(ScrollArea2.Root, {
2309
+ ...composableProps5(props),
2310
+ thin: true,
2311
+ orientation: "vertical",
2312
+ ref: forwardedRef
2313
+ }, /* @__PURE__ */ React19.createElement(ScrollArea2.Viewport, null, blueprints && blueprints.length > 0 && /* @__PURE__ */ React19.createElement(Section, {
2314
+ title: "Blueprints",
2315
+ items: blueprints.map(({ name, description, tools }) => ({
2316
+ name,
2317
+ description,
2318
+ subitems: tools.map((toolId) => ({
2319
+ name: `\u2219 ${safeToolId(toolId)}`
2320
+ }))
2321
+ }))
2322
+ }), activeBlueprints && activeBlueprints.length > 0 && /* @__PURE__ */ React19.createElement(Section, {
2323
+ title: "Blueprints",
2324
+ items: activeBlueprints.map(({ target }) => ({
2325
+ name: target?.name ?? "",
2326
+ description: target?.description ?? "",
2327
+ subitems: target?.tools.map((toolId) => ({
2328
+ name: `\u2219 ${safeToolId(toolId)}`
2329
+ }))
2330
+ }))
2331
+ }), services && services.length > 0 && /* @__PURE__ */ React19.createElement(Section, {
2332
+ title: "Services",
2333
+ items: services.map(({ service: { serviceId, name, description } }) => ({
2334
+ name: name ?? serviceId,
2335
+ description
2336
+ }))
2337
+ }), functions && functions.length > 0 && /* @__PURE__ */ React19.createElement(Section, {
2338
+ title: "Functions",
2339
+ items: functions.map(({ name, description }) => ({
2340
+ name,
2341
+ description
2342
+ }))
2343
+ })));
2344
+ });
2345
+ Toolbox.displayName = "Toolbox";
2346
+ var Section = ({ title, items, striped }) => {
2347
+ const stripeClassNames = "odd:bg-neutral-50 dark:odd:bg-neutral-800";
2348
+ const gridClassNames = "grid grid-cols-[8rem_1fr]";
2349
+ const subGridClassNames = mx9("col-span-full grid grid-cols-subgrid text-xs px-2", striped && stripeClassNames);
2350
+ return /* @__PURE__ */ React19.createElement("div", null, /* @__PURE__ */ React19.createElement("h1", {
2351
+ className: "px-2 text-sm"
2352
+ }, title), /* @__PURE__ */ React19.createElement("div", {
2353
+ className: gridClassNames
2354
+ }, items.map(({ name, description, subitems }, i) => /* @__PURE__ */ React19.createElement(Fragment, {
2355
+ key: i
2356
+ }, name && /* @__PURE__ */ React19.createElement("div", {
2357
+ className: subGridClassNames
2358
+ }, /* @__PURE__ */ React19.createElement("div", {
2359
+ className: "truncate text-primary-500"
2360
+ }, name), /* @__PURE__ */ React19.createElement("div", {
2361
+ className: "line-clamp-2"
2362
+ }, description)), subitems?.map(({ name: name2, description: description2 }, i2) => /* @__PURE__ */ React19.createElement("div", {
2363
+ key: i2,
2364
+ className: mx9(subGridClassNames, striped && stripeClassNames)
2365
+ }, /* @__PURE__ */ React19.createElement("div", {
2366
+ className: "truncate"
2367
+ }, name2), /* @__PURE__ */ React19.createElement("div", {
2368
+ className: "line-clamp-3 text-subdued"
2369
+ }, description2)))))));
2370
+ };
2371
+ var ToolboxPanel = ({ classNames, db, processor }) => {
2372
+ const services = useQuery4(db, Filter4.type(ServiceType));
2373
+ const [serviceTools, setServiceTools] = useState8([]);
2374
+ useEffect7(() => {
2375
+ log2("creating service tools...", {
2376
+ services: services.length
2377
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 82, S: void 0 });
2378
+ queueMicrotask(async () => {
2379
+ });
2380
+ }, [
2381
+ services
2382
+ ]);
2383
+ const functions = useQuery4(db, Filter4.type(Operation.PersistentOperation));
2384
+ return /* @__PURE__ */ React19.createElement(Toolbox, {
2385
+ classNames,
2386
+ blueprints: processor?.context.getBlueprints(),
2387
+ services: serviceTools,
2388
+ functions
2389
+ });
2390
+ };
2391
+ var safeToolId = (name) => {
2392
+ return name.split("_").pop();
2393
+ };
2394
+
2395
+ // src/components/index.ts
2396
+ var AssistantSettings = lazy(() => import("../AssistantSettings-GG52BLKS.mjs"));
2397
+ var RoutineProperties = lazy(() => import("../RoutineProperties-FISLMW2R.mjs"));
2398
+ export {
2399
+ AgentProperties,
2400
+ AssistantSettings,
2401
+ Chat,
2402
+ ChatPrompt,
2403
+ ProcessTree,
2404
+ RoutineProperties,
2405
+ TaskList,
2406
+ TemplateEditor,
2407
+ Toolbox,
2408
+ ToolboxPanel
2409
+ };
2410
+ //# sourceMappingURL=index.mjs.map