@dxos/plugin-assistant 0.8.4-main.2e9d522 → 0.8.4-main.3eb6e50203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs +30 -0
  2. package/dist/lib/browser/BlueprintArticle-6SP2ZWJ2.mjs.map +7 -0
  3. package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs +200 -0
  4. package/dist/lib/browser/ChatCompanion-CAKFZAWN.mjs.map +7 -0
  5. package/dist/lib/browser/ChatContainer-QB37VONJ.mjs +73 -0
  6. package/dist/lib/browser/ChatContainer-QB37VONJ.mjs.map +7 -0
  7. package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs +85 -0
  8. package/dist/lib/browser/ChatDialog-ASVBLOOS.mjs.map +7 -0
  9. package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs +266 -0
  10. package/dist/lib/browser/InitiativeContainer-V522FCYH.mjs.map +7 -0
  11. package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs +52 -0
  12. package/dist/lib/browser/PromptArticle-PK3CBRUB.mjs.map +7 -0
  13. package/dist/lib/browser/ai-service-CY2BYPH6.mjs +22 -0
  14. package/dist/lib/browser/ai-service-CY2BYPH6.mjs.map +7 -0
  15. package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs +234 -0
  16. package/dist/lib/browser/app-graph-builder-MUZGUQSC.mjs.map +7 -0
  17. package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs +14 -0
  18. package/dist/lib/browser/blueprint-definition-YAGWYVCL.mjs.map +7 -0
  19. package/dist/lib/browser/blueprints/index.mjs +12 -0
  20. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-3ETBCBMH.mjs +47 -0
  22. package/dist/lib/browser/chunk-3ETBCBMH.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-6BVCG5SJ.mjs +230 -0
  24. package/dist/lib/browser/chunk-6BVCG5SJ.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-DKQMSMBN.mjs +326 -0
  26. package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-EXVT7D4B.mjs +23 -0
  28. package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-IJYAKPEU.mjs +286 -0
  30. package/dist/lib/browser/chunk-IJYAKPEU.mjs.map +7 -0
  31. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  32. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  33. package/dist/lib/browser/chunk-JA7PUZC7.mjs +1974 -0
  34. package/dist/lib/browser/chunk-JA7PUZC7.mjs.map +7 -0
  35. package/dist/lib/browser/chunk-POPBT2AQ.mjs +198 -0
  36. package/dist/lib/browser/chunk-POPBT2AQ.mjs.map +7 -0
  37. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs +21 -0
  38. package/dist/lib/browser/edge-model-resolver-YTMFQEN5.mjs.map +7 -0
  39. package/dist/lib/browser/index.mjs +310 -156
  40. package/dist/lib/browser/index.mjs.map +4 -4
  41. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs +20 -0
  42. package/dist/lib/browser/local-model-resolver-CGRQH37T.mjs.map +7 -0
  43. package/dist/lib/browser/meta.json +1 -1
  44. package/dist/lib/browser/operation-resolver-2673CFJS.mjs +133 -0
  45. package/dist/lib/browser/operation-resolver-2673CFJS.mjs.map +7 -0
  46. package/dist/lib/browser/react-surface-T3FN4GVP.mjs +125 -0
  47. package/dist/lib/browser/react-surface-T3FN4GVP.mjs.map +7 -0
  48. package/dist/lib/browser/repair-IRXDYF4R.mjs +51 -0
  49. package/dist/lib/browser/repair-IRXDYF4R.mjs.map +7 -0
  50. package/dist/lib/browser/settings-XF6GKHCG.mjs +33 -0
  51. package/dist/lib/browser/settings-XF6GKHCG.mjs.map +7 -0
  52. package/dist/lib/browser/state-OYDPWLKA.mjs +26 -0
  53. package/dist/lib/browser/state-OYDPWLKA.mjs.map +7 -0
  54. package/dist/lib/browser/toolkit-IDXQCSTX.mjs +19 -0
  55. package/dist/lib/browser/toolkit-IDXQCSTX.mjs.map +7 -0
  56. package/dist/lib/browser/types/index.mjs +11 -4
  57. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs +31 -0
  58. package/dist/lib/node-esm/BlueprintArticle-7LI6UXKZ.mjs.map +7 -0
  59. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs +201 -0
  60. package/dist/lib/node-esm/ChatCompanion-W4PGOCGR.mjs.map +7 -0
  61. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs +74 -0
  62. package/dist/lib/node-esm/ChatContainer-ECFQVH6O.mjs.map +7 -0
  63. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs +86 -0
  64. package/dist/lib/node-esm/ChatDialog-AFLPYSIU.mjs.map +7 -0
  65. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs +267 -0
  66. package/dist/lib/node-esm/InitiativeContainer-U4LGO3BW.mjs.map +7 -0
  67. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs +53 -0
  68. package/dist/lib/node-esm/PromptArticle-BHPABYLT.mjs.map +7 -0
  69. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs +23 -0
  70. package/dist/lib/node-esm/ai-service-ZI3A6RVG.mjs.map +7 -0
  71. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs +235 -0
  72. package/dist/lib/node-esm/app-graph-builder-4QN5M6PD.mjs.map +7 -0
  73. package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs +15 -0
  74. package/dist/lib/node-esm/blueprint-definition-H3LFAEK2.mjs.map +7 -0
  75. package/dist/lib/node-esm/blueprints/index.mjs +13 -0
  76. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs +48 -0
  78. package/dist/lib/node-esm/chunk-2LEN26ZQ.mjs.map +7 -0
  79. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs +1975 -0
  80. package/dist/lib/node-esm/chunk-3XC7LQSO.mjs.map +7 -0
  81. package/dist/lib/node-esm/chunk-75PHXBN3.mjs +327 -0
  82. package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
  83. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs +199 -0
  84. package/dist/lib/node-esm/chunk-F6LA7XNS.mjs.map +7 -0
  85. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  86. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  87. package/dist/lib/node-esm/chunk-LB72WG6R.mjs +231 -0
  88. package/dist/lib/node-esm/chunk-LB72WG6R.mjs.map +7 -0
  89. package/dist/lib/node-esm/chunk-MJD5XWQV.mjs +288 -0
  90. package/dist/lib/node-esm/chunk-MJD5XWQV.mjs.map +7 -0
  91. package/dist/lib/node-esm/chunk-POWB2BPC.mjs +25 -0
  92. package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
  93. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs +22 -0
  94. package/dist/lib/node-esm/edge-model-resolver-CMJ3KNLQ.mjs.map +7 -0
  95. package/dist/lib/node-esm/index.mjs +310 -156
  96. package/dist/lib/node-esm/index.mjs.map +4 -4
  97. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs +21 -0
  98. package/dist/lib/node-esm/local-model-resolver-FFDAKOXN.mjs.map +7 -0
  99. package/dist/lib/node-esm/meta.json +1 -1
  100. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs +134 -0
  101. package/dist/lib/node-esm/operation-resolver-2ZD2DXOU.mjs.map +7 -0
  102. package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs +126 -0
  103. package/dist/lib/node-esm/react-surface-T4VMCCKZ.mjs.map +7 -0
  104. package/dist/lib/node-esm/repair-DMI55PON.mjs +52 -0
  105. package/dist/lib/node-esm/repair-DMI55PON.mjs.map +7 -0
  106. package/dist/lib/node-esm/settings-NGGZA7S7.mjs +34 -0
  107. package/dist/lib/node-esm/settings-NGGZA7S7.mjs.map +7 -0
  108. package/dist/lib/node-esm/state-VSCPGN7R.mjs +27 -0
  109. package/dist/lib/node-esm/state-VSCPGN7R.mjs.map +7 -0
  110. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs +20 -0
  111. package/dist/lib/node-esm/toolkit-JPRJRDDB.mjs.map +7 -0
  112. package/dist/lib/node-esm/types/index.mjs +11 -4
  113. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  114. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  115. package/dist/types/src/blueprints/assistant-blueprint.d.ts +11 -0
  116. package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
  117. package/dist/types/src/blueprints/index.d.ts +7 -0
  118. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/ai-service/ai-service.d.ts +6 -0
  120. package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
  122. package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  124. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  126. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  127. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +26 -0
  128. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
  130. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +7 -0
  132. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
  134. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/index.d.ts +11 -4
  136. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  137. package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
  138. package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +13 -0
  140. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  142. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  144. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  146. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  148. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  150. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  152. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  153. package/dist/types/src/capabilities/settings/index.d.ts +15 -0
  154. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  155. package/dist/types/src/capabilities/settings/settings.d.ts +18 -0
  156. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  157. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  158. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  159. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  160. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  161. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  162. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  163. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +6 -0
  164. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  165. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
  166. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  167. package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
  168. package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
  169. package/dist/types/src/components/Chat/Chat.d.ts +37 -21
  170. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  171. package/dist/types/src/components/Chat/events.d.ts +10 -1
  172. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  173. package/dist/types/src/components/ChatCompanion.d.ts +13 -0
  174. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -0
  175. package/dist/types/src/components/ChatContainer.d.ts +16 -8
  176. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  177. package/dist/types/src/components/ChatDialog.d.ts +2 -2
  178. package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
  179. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts +7 -0
  180. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -0
  181. package/dist/types/src/components/ChatProgress/index.d.ts +2 -0
  182. package/dist/types/src/components/ChatProgress/index.d.ts.map +1 -0
  183. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  184. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +20 -0
  185. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -0
  186. package/dist/types/src/components/ChatPrompt/ChatPresets.d.ts.map +1 -1
  187. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +5 -6
  188. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  189. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts +6 -4
  190. package/dist/types/src/components/ChatPrompt/ChatStatusIndicator.d.ts.map +1 -1
  191. package/dist/types/src/components/ChatPrompt/index.d.ts +1 -1
  192. package/dist/types/src/components/ChatPrompt/index.d.ts.map +1 -1
  193. package/dist/types/src/components/ChatThread/ChatThread.d.ts +13 -11
  194. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  195. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +285 -71
  196. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  197. package/dist/types/src/components/ChatThread/Link.d.ts +9 -0
  198. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -0
  199. package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
  200. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  201. package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
  202. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  203. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  204. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  205. package/dist/types/src/components/InitiativeContainer.d.ts +9 -0
  206. package/dist/types/src/components/InitiativeContainer.d.ts.map +1 -0
  207. package/dist/types/src/components/PromptArticle.d.ts +7 -0
  208. package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
  209. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +3 -6
  210. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  211. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +431 -7
  212. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  213. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +13 -2
  214. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  215. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +428 -2
  216. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  217. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts +12 -0
  218. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  219. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  220. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  221. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  222. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  223. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
  224. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  225. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  226. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  227. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  228. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  229. package/dist/types/src/components/Toolbox/Toolbox.d.ts +9 -15
  230. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  231. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +432 -5
  232. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  233. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts +4 -0
  234. package/dist/types/src/components/TriggerStatus/TriggerStatus.d.ts.map +1 -0
  235. package/dist/types/src/components/TriggerStatus/index.d.ts +2 -0
  236. package/dist/types/src/components/TriggerStatus/index.d.ts.map +1 -0
  237. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
  238. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
  239. package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
  240. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
  241. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
  242. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
  243. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
  244. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
  245. package/dist/types/src/components/Typewriter/index.d.ts +2 -0
  246. package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
  247. package/dist/types/src/components/index.d.ts +10 -7
  248. package/dist/types/src/components/index.d.ts.map +1 -1
  249. package/dist/types/src/functions/index.d.ts +4 -0
  250. package/dist/types/src/functions/index.d.ts.map +1 -0
  251. package/dist/types/src/functions/object-list.d.ts +10 -0
  252. package/dist/types/src/functions/object-list.d.ts.map +1 -0
  253. package/dist/types/src/functions/object-load.d.ts +8 -0
  254. package/dist/types/src/functions/object-load.d.ts.map +1 -0
  255. package/dist/types/src/functions/object-search.d.ts +10 -0
  256. package/dist/types/src/functions/object-search.d.ts.map +1 -0
  257. package/dist/types/src/hooks/index.d.ts +8 -3
  258. package/dist/types/src/hooks/index.d.ts.map +1 -1
  259. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +25 -0
  260. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -0
  261. package/dist/types/src/hooks/useChatProcessor.d.ts +10 -20
  262. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  263. package/dist/types/src/hooks/useChatServices.d.ts +7 -8
  264. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  265. package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
  266. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
  267. package/dist/types/src/hooks/useContextBinder.d.ts +4 -0
  268. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -0
  269. package/dist/types/src/hooks/useContextObjects.d.ts +15 -0
  270. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -0
  271. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  272. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  273. package/dist/types/src/hooks/useFlush.d.ts +6 -0
  274. package/dist/types/src/hooks/useFlush.d.ts.map +1 -0
  275. package/dist/types/src/hooks/useOnline.d.ts +3 -0
  276. package/dist/types/src/hooks/useOnline.d.ts.map +1 -0
  277. package/dist/types/src/hooks/usePresets.d.ts +7 -0
  278. package/dist/types/src/hooks/usePresets.d.ts.map +1 -0
  279. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  280. package/dist/types/src/index.d.ts +2 -1
  281. package/dist/types/src/index.d.ts.map +1 -1
  282. package/dist/types/src/meta.d.ts +3 -4
  283. package/dist/types/src/meta.d.ts.map +1 -1
  284. package/dist/types/src/processor/index.d.ts +4 -0
  285. package/dist/types/src/processor/index.d.ts.map +1 -0
  286. package/dist/types/src/{hooks → processor}/presets.d.ts +3 -3
  287. package/dist/types/src/processor/presets.d.ts.map +1 -0
  288. package/dist/types/src/processor/processor.d.ts +79 -0
  289. package/dist/types/src/processor/processor.d.ts.map +1 -0
  290. package/dist/types/src/processor/processor.test.d.ts +2 -0
  291. package/dist/types/src/processor/processor.test.d.ts.map +1 -0
  292. package/dist/types/src/processor/update-name.d.ts +10 -0
  293. package/dist/types/src/processor/update-name.d.ts.map +1 -0
  294. package/dist/types/src/queue-logger.d.ts.map +1 -1
  295. package/dist/types/src/testing/index.d.ts +1 -1
  296. package/dist/types/src/testing/index.d.ts.map +1 -1
  297. package/dist/types/src/testing/test-generator.d.ts +8 -0
  298. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  299. package/dist/types/src/testing/test-sequence.d.ts +0 -4
  300. package/dist/types/src/testing/test-sequence.d.ts.map +1 -1
  301. package/dist/types/src/testing/test-services.d.ts +2 -2
  302. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  303. package/dist/types/src/translations.d.ts +376 -37
  304. package/dist/types/src/translations.d.ts.map +1 -1
  305. package/dist/types/src/types/Assistant.d.ts +20 -0
  306. package/dist/types/src/types/Assistant.d.ts.map +1 -0
  307. package/dist/types/src/types/AssistantAction.d.ts +97 -0
  308. package/dist/types/src/types/AssistantAction.d.ts.map +1 -0
  309. package/dist/types/src/types/capabilities.d.ts +33 -0
  310. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  311. package/dist/types/src/types/defs.d.ts +2 -0
  312. package/dist/types/src/types/defs.d.ts.map +1 -0
  313. package/dist/types/src/types/events.d.ts +5 -0
  314. package/dist/types/src/types/events.d.ts.map +1 -0
  315. package/dist/types/src/types/index.d.ts +6 -1
  316. package/dist/types/src/types/index.d.ts.map +1 -1
  317. package/dist/types/src/types/service.d.ts +14 -213
  318. package/dist/types/src/types/service.d.ts.map +1 -1
  319. package/dist/types/tsconfig.tsbuildinfo +1 -1
  320. package/package.json +125 -96
  321. package/src/AssistantPlugin.tsx +159 -88
  322. package/src/blueprints/assistant-blueprint.ts +57 -0
  323. package/src/blueprints/index.ts +12 -0
  324. package/src/capabilities/ai-service/ai-service.ts +30 -0
  325. package/src/capabilities/ai-service/index.ts +7 -0
  326. package/src/capabilities/app-graph-builder/app-graph-builder.ts +200 -0
  327. package/src/capabilities/app-graph-builder/index.ts +7 -0
  328. package/src/capabilities/blueprint-definition/blueprint-definition.ts +74 -0
  329. package/src/capabilities/blueprint-definition/index.ts +8 -0
  330. package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +33 -0
  331. package/src/capabilities/edge-model-resolver/index.ts +7 -0
  332. package/src/capabilities/index.ts +11 -6
  333. package/src/capabilities/local-model-resolver/index.ts +7 -0
  334. package/src/capabilities/local-model-resolver/local-model-resolver.ts +38 -0
  335. package/src/capabilities/operation-resolver/index.ts +7 -0
  336. package/src/capabilities/operation-resolver/operation-resolver.ts +112 -0
  337. package/src/capabilities/react-surface/index.ts +7 -0
  338. package/src/capabilities/react-surface/react-surface.tsx +111 -0
  339. package/src/capabilities/repair/index.ts +7 -0
  340. package/src/capabilities/repair/repair.ts +62 -0
  341. package/src/capabilities/settings/index.ts +7 -0
  342. package/src/capabilities/settings/settings.ts +31 -0
  343. package/src/capabilities/state/index.ts +7 -0
  344. package/src/capabilities/state/state.ts +27 -0
  345. package/src/capabilities/toolkit/index.ts +7 -0
  346. package/src/capabilities/toolkit/toolkit.ts +27 -0
  347. package/src/components/AssistantSettings/AssistantSettings.tsx +92 -77
  348. package/src/components/BlueprintArticle.tsx +28 -0
  349. package/src/components/Chat/Chat.tsx +267 -197
  350. package/src/components/Chat/events.ts +14 -1
  351. package/src/components/ChatCompanion.tsx +226 -0
  352. package/src/components/ChatContainer.tsx +56 -33
  353. package/src/components/ChatDialog.tsx +30 -19
  354. package/src/components/ChatProgress/ChatProgress.tsx +53 -0
  355. package/src/components/{SequenceEditor → ChatProgress}/index.ts +1 -1
  356. package/src/components/ChatPrompt/ChatActions.tsx +19 -27
  357. package/src/components/ChatPrompt/ChatOptions.tsx +238 -0
  358. package/src/components/ChatPrompt/ChatPresets.tsx +1 -0
  359. package/src/components/ChatPrompt/ChatReferences.tsx +32 -38
  360. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +25 -22
  361. package/src/components/ChatPrompt/index.ts +1 -1
  362. package/src/components/ChatThread/ChatThread.stories.tsx +123 -116
  363. package/src/components/ChatThread/ChatThread.tsx +75 -36
  364. package/src/components/ChatThread/Link.tsx +26 -0
  365. package/src/components/ChatThread/registry.tsx +174 -0
  366. package/src/components/ChatThread/sync.test.ts +97 -0
  367. package/src/components/ChatThread/sync.ts +154 -0
  368. package/src/components/ChatThread/testing/thread.md +37 -0
  369. package/src/components/InitiativeContainer.tsx +340 -0
  370. package/src/components/PromptArticle.tsx +49 -0
  371. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +40 -19
  372. package/src/components/TemplateEditor/TemplateEditor.tsx +33 -52
  373. package/src/components/TemplateEditor/TemplateForm.stories.tsx +30 -17
  374. package/src/components/TemplateEditor/TemplateForm.tsx +82 -32
  375. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +274 -0
  376. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  377. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  378. package/src/components/ToolBlock/ToolBlock.tsx +143 -0
  379. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  380. package/src/components/ToolBlock/index.ts +6 -0
  381. package/src/components/Toolbox/Toolbox.stories.tsx +18 -28
  382. package/src/components/Toolbox/Toolbox.tsx +70 -102
  383. package/src/components/TriggerStatus/TriggerStatus.tsx +142 -0
  384. package/src/components/TriggerStatus/index.ts +5 -0
  385. package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
  386. package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
  387. package/src/components/Typewriter/Typewriter.tsx +54 -0
  388. package/src/components/Typewriter/assistant-extension.tsx +144 -0
  389. package/src/components/Typewriter/index.ts +5 -0
  390. package/src/components/index.ts +14 -9
  391. package/src/functions/index.ts +7 -0
  392. package/src/functions/object-list.ts +49 -0
  393. package/src/functions/object-load.ts +44 -0
  394. package/src/functions/object-search.ts +46 -0
  395. package/src/hooks/index.ts +8 -4
  396. package/src/hooks/useBlueprintRegistry.ts +105 -0
  397. package/src/hooks/useChatProcessor.ts +40 -105
  398. package/src/hooks/useChatServices.ts +31 -75
  399. package/src/hooks/useChatToolbarActions.ts +122 -0
  400. package/src/hooks/useContextBinder.ts +32 -0
  401. package/src/hooks/useContextObjects.ts +46 -0
  402. package/src/hooks/useFilteredTypes.ts +37 -0
  403. package/src/hooks/useFlush.ts +35 -0
  404. package/src/hooks/useOnline.ts +10 -0
  405. package/src/hooks/usePresets.ts +44 -0
  406. package/src/hooks/useReferencesProvider.ts +15 -12
  407. package/src/index.ts +2 -1
  408. package/src/meta.ts +11 -8
  409. package/src/processor/index.ts +7 -0
  410. package/src/{hooks → processor}/presets.ts +16 -8
  411. package/src/processor/processor.test.ts +72 -0
  412. package/src/processor/processor.ts +301 -0
  413. package/src/processor/update-name.ts +58 -0
  414. package/src/queue-logger.ts +17 -18
  415. package/src/testing/index.ts +1 -1
  416. package/src/testing/test-generator.ts +262 -0
  417. package/src/testing/test-sequence.ts +2 -27
  418. package/src/testing/test-services.ts +10 -14
  419. package/src/translations.ts +71 -28
  420. package/src/types/Assistant.ts +28 -0
  421. package/src/types/AssistantAction.ts +76 -0
  422. package/src/types/capabilities.ts +27 -0
  423. package/src/types/defs.ts +5 -0
  424. package/src/types/events.ts +11 -0
  425. package/src/types/index.ts +9 -1
  426. package/src/types/service.ts +25 -14
  427. package/src/vite-env.d.ts +30 -0
  428. package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs +0 -54
  429. package/dist/lib/browser/ChatContainer-M3IHQLRS.mjs.map +0 -7
  430. package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs +0 -72
  431. package/dist/lib/browser/ChatDialog-X6VN6QZI.mjs.map +0 -7
  432. package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs +0 -162
  433. package/dist/lib/browser/SequenceContainer-3UDVKWPA.mjs.map +0 -7
  434. package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs +0 -27
  435. package/dist/lib/browser/TemplateContainer-RPJ2LBOB.mjs.map +0 -7
  436. package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs +0 -223
  437. package/dist/lib/browser/app-graph-builder-JTXBKE7O.mjs.map +0 -7
  438. package/dist/lib/browser/chunk-AEAEKWOC.mjs +0 -98
  439. package/dist/lib/browser/chunk-AEAEKWOC.mjs.map +0 -7
  440. package/dist/lib/browser/chunk-EQDW6BYQ.mjs +0 -108
  441. package/dist/lib/browser/chunk-EQDW6BYQ.mjs.map +0 -7
  442. package/dist/lib/browser/chunk-FDCJSQYF.mjs +0 -40
  443. package/dist/lib/browser/chunk-FDCJSQYF.mjs.map +0 -7
  444. package/dist/lib/browser/chunk-JQBVLTM5.mjs +0 -158
  445. package/dist/lib/browser/chunk-JQBVLTM5.mjs.map +0 -7
  446. package/dist/lib/browser/chunk-OWY4CUQY.mjs +0 -2245
  447. package/dist/lib/browser/chunk-OWY4CUQY.mjs.map +0 -7
  448. package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs +0 -60
  449. package/dist/lib/browser/intent-resolver-5RMMCMXG.mjs.map +0 -7
  450. package/dist/lib/browser/react-surface-66VY37YQ.mjs +0 -150
  451. package/dist/lib/browser/react-surface-66VY37YQ.mjs.map +0 -7
  452. package/dist/lib/browser/settings-2DGP3UTS.mjs +0 -22
  453. package/dist/lib/browser/settings-2DGP3UTS.mjs.map +0 -7
  454. package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs +0 -55
  455. package/dist/lib/node-esm/ChatContainer-VZT74PO2.mjs.map +0 -7
  456. package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs +0 -73
  457. package/dist/lib/node-esm/ChatDialog-RJ6FDX4Q.mjs.map +0 -7
  458. package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs +0 -163
  459. package/dist/lib/node-esm/SequenceContainer-RQQH5XOC.mjs.map +0 -7
  460. package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs +0 -28
  461. package/dist/lib/node-esm/TemplateContainer-A3NAQCZE.mjs.map +0 -7
  462. package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs +0 -224
  463. package/dist/lib/node-esm/app-graph-builder-OWSOXFTD.mjs.map +0 -7
  464. package/dist/lib/node-esm/chunk-2XL6MNPE.mjs +0 -99
  465. package/dist/lib/node-esm/chunk-2XL6MNPE.mjs.map +0 -7
  466. package/dist/lib/node-esm/chunk-BISJDTBK.mjs +0 -159
  467. package/dist/lib/node-esm/chunk-BISJDTBK.mjs.map +0 -7
  468. package/dist/lib/node-esm/chunk-E33DNNDW.mjs +0 -109
  469. package/dist/lib/node-esm/chunk-E33DNNDW.mjs.map +0 -7
  470. package/dist/lib/node-esm/chunk-QN2H2EHV.mjs +0 -41
  471. package/dist/lib/node-esm/chunk-QN2H2EHV.mjs.map +0 -7
  472. package/dist/lib/node-esm/chunk-SENTQAEO.mjs +0 -2246
  473. package/dist/lib/node-esm/chunk-SENTQAEO.mjs.map +0 -7
  474. package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs +0 -61
  475. package/dist/lib/node-esm/intent-resolver-YPPYELY3.mjs.map +0 -7
  476. package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs +0 -151
  477. package/dist/lib/node-esm/react-surface-RJMRBR2M.mjs.map +0 -7
  478. package/dist/lib/node-esm/settings-47RYZOU4.mjs +0 -23
  479. package/dist/lib/node-esm/settings-47RYZOU4.mjs.map +0 -7
  480. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  481. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  482. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  483. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  484. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  485. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  486. package/dist/types/src/capabilities/settings.d.ts +0 -4
  487. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  488. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts +0 -9
  489. package/dist/types/src/components/ChatPrompt/ChatOptionsMenu.d.ts.map +0 -1
  490. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -17
  491. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  492. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
  493. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  494. package/dist/types/src/components/ChatThread/reducer.d.ts +0 -12
  495. package/dist/types/src/components/ChatThread/reducer.d.ts.map +0 -1
  496. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  497. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  498. package/dist/types/src/components/SequenceContainer.d.ts +0 -8
  499. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  500. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  501. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  502. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -8
  503. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  504. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  505. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  506. package/dist/types/src/components/TemplateContainer.d.ts +0 -8
  507. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  508. package/dist/types/src/events.d.ts +0 -4
  509. package/dist/types/src/events.d.ts.map +0 -1
  510. package/dist/types/src/hooks/chat-processor.d.ts +0 -86
  511. package/dist/types/src/hooks/chat-processor.d.ts.map +0 -1
  512. package/dist/types/src/hooks/chat-processor.test.d.ts +0 -2
  513. package/dist/types/src/hooks/chat-processor.test.d.ts.map +0 -1
  514. package/dist/types/src/hooks/presets.d.ts.map +0 -1
  515. package/dist/types/src/hooks/useBlueprints.d.ts +0 -9
  516. package/dist/types/src/hooks/useBlueprints.d.ts.map +0 -1
  517. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  518. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  519. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  520. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  521. package/dist/types/src/parser/index.d.ts +0 -4
  522. package/dist/types/src/parser/index.d.ts.map +0 -1
  523. package/dist/types/src/parser/query-parser.d.ts +0 -15
  524. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  525. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  526. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  527. package/dist/types/src/parser/types.d.ts +0 -24
  528. package/dist/types/src/parser/types.d.ts.map +0 -1
  529. package/dist/types/src/stories/Chat.stories.d.ts +0 -249
  530. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  531. package/dist/types/src/testing/test-functions.d.ts +0 -3
  532. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  533. package/dist/types/src/tools/function.d.ts +0 -5
  534. package/dist/types/src/tools/function.d.ts.map +0 -1
  535. package/dist/types/src/tools/index.d.ts +0 -3
  536. package/dist/types/src/tools/index.d.ts.map +0 -1
  537. package/dist/types/src/tools/openapi.d.ts +0 -10
  538. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  539. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  540. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  541. package/dist/types/src/types/schema.d.ts +0 -88
  542. package/dist/types/src/types/schema.d.ts.map +0 -1
  543. package/src/capabilities/app-graph-builder.ts +0 -253
  544. package/src/capabilities/intent-resolver.ts +0 -58
  545. package/src/capabilities/react-surface.tsx +0 -138
  546. package/src/capabilities/settings.ts +0 -19
  547. package/src/components/ChatPrompt/ChatOptionsMenu.tsx +0 -52
  548. package/src/components/ChatThread/ChatMessage.tsx +0 -268
  549. package/src/components/ChatThread/ToolBlock.tsx +0 -121
  550. package/src/components/ChatThread/reducer.ts +0 -52
  551. package/src/components/PromptSettings.tsx +0 -89
  552. package/src/components/SequenceContainer.tsx +0 -132
  553. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -32
  554. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  555. package/src/components/TemplateContainer.tsx +0 -24
  556. package/src/events.ts +0 -11
  557. package/src/hooks/chat-processor.test.ts +0 -16
  558. package/src/hooks/chat-processor.ts +0 -314
  559. package/src/hooks/useBlueprints.ts +0 -57
  560. package/src/parser/filter-generator.test.ts +0 -32
  561. package/src/parser/filter-generator.ts +0 -81
  562. package/src/parser/index.ts +0 -7
  563. package/src/parser/query-parser.test.ts +0 -139
  564. package/src/parser/query-parser.ts +0 -199
  565. package/src/parser/types.ts +0 -34
  566. package/src/shims.d.ts +0 -8
  567. package/src/stories/Chat.stories.tsx +0 -378
  568. package/src/testing/test-functions.ts +0 -11
  569. package/src/tools/function.ts +0 -46
  570. package/src/tools/index.ts +0 -6
  571. package/src/tools/openapi.test.ts +0 -217
  572. package/src/tools/openapi.ts +0 -338
  573. package/src/types/schema.ts +0 -95
  574. package/src/typings.d.ts +0 -9
@@ -0,0 +1,340 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Match from 'effect/Match';
8
+ import * as Option from 'effect/Option';
9
+ import type * as Record from 'effect/Record';
10
+ import React, { useCallback, useMemo, useState } from 'react';
11
+
12
+ import { Surface, useCapability } from '@dxos/app-framework/ui';
13
+ import { Initiative } from '@dxos/assistant-toolkit';
14
+ import { DXN, Filter, Obj, Query, Ref } from '@dxos/echo';
15
+ import { type JsonPath, splitJsonPath } from '@dxos/echo/internal';
16
+ import { AtomObj, AtomRef } from '@dxos/echo-atom';
17
+ import { FunctionDefinition, QueueService, Trigger } from '@dxos/functions';
18
+ import { AutomationCapabilities } from '@dxos/plugin-automation/types';
19
+ import { MarkdownEditor } from '@dxos/plugin-markdown';
20
+ import { useObject, useQuery } from '@dxos/react-client/echo';
21
+ import { Button, ButtonGroup, IconButton, Input, toLocalizedString, useTranslation } from '@dxos/react-ui';
22
+ import { Form, type FormFieldMap, omitId } from '@dxos/react-ui-form';
23
+ import { StackItem } from '@dxos/react-ui-stack';
24
+ import { type Text } from '@dxos/schema';
25
+
26
+ export type InitiativeContainerProps = {
27
+ role?: string;
28
+ initiative: Initiative.Initiative;
29
+ };
30
+
31
+ const TAB_INITATIVE = 'Initiative';
32
+ const TAB_CHAT = 'Chat';
33
+
34
+ export const InitiativeContainer = ({ role, initiative }: InitiativeContainerProps) => {
35
+ const [selectedTab, setSelectedTab] = useState<string>(TAB_INITATIVE);
36
+
37
+ const tabs = useAtomValue(
38
+ useMemo(
39
+ () =>
40
+ AtomObj.make(initiative).pipe((initiative) =>
41
+ Atom.make((get) => {
42
+ return [TAB_INITATIVE, TAB_CHAT, ...get(initiative).artifacts.map((artifact) => artifact.name)];
43
+ }),
44
+ ),
45
+ [initiative],
46
+ ),
47
+ );
48
+
49
+ const chat = useAtomValue(
50
+ useMemo(
51
+ () =>
52
+ AtomObj.make(initiative).pipe((initiative) =>
53
+ Atom.make((get) => {
54
+ const chat = get(initiative).chat;
55
+ return chat ? get(AtomRef.make(chat)) : undefined;
56
+ }),
57
+ ),
58
+ [initiative],
59
+ ),
60
+ );
61
+
62
+ const artifacts = useAtomValue(
63
+ useMemo(
64
+ () =>
65
+ AtomObj.make(initiative).pipe((initiative) =>
66
+ Atom.make((get) => {
67
+ return get(initiative).artifacts.map((artifact) => ({
68
+ name: artifact.name,
69
+ data: get(AtomRef.make(artifact.data)),
70
+ }));
71
+ }),
72
+ ),
73
+ [initiative],
74
+ ),
75
+ );
76
+
77
+ const selectedArtifact = artifacts.find((artifact) => artifact.name === selectedTab);
78
+
79
+ return (
80
+ <StackItem.Content toolbar>
81
+ <div
82
+ role='none'
83
+ className='flex-1 min-is-0 overflow-x-auto scrollbar-none flex gap-1 border-b border-subduedSeparator'
84
+ >
85
+ {tabs.map((tab) => (
86
+ <IconButton
87
+ key={tab}
88
+ icon={Match.value(tab).pipe(
89
+ Match.when(TAB_INITATIVE, () => 'ph--sparkle--regular'),
90
+ Match.when(TAB_CHAT, () => 'ph--chat--regular'),
91
+ Match.orElse(() => 'ph--file--regular'),
92
+ )}
93
+ label={tab}
94
+ variant={selectedTab === tab ? 'primary' : 'ghost'}
95
+ onClick={() => setSelectedTab(tab)}
96
+ />
97
+ ))}
98
+ </div>
99
+ {selectedTab === TAB_INITATIVE && <InitiativeForm initiative={initiative} />}
100
+ {selectedTab === TAB_CHAT && <Surface.Surface role='article' data={{ subject: chat }} limit={1} />}
101
+ {selectedArtifact && <Surface.Surface role='section' data={{ subject: selectedArtifact.data }} limit={1} />}
102
+ </StackItem.Content>
103
+ );
104
+ };
105
+
106
+ export default InitiativeContainer;
107
+
108
+ const InitiativeForm = ({ initiative }: { initiative: Initiative.Initiative }) => {
109
+ const handleChange = useCallback(
110
+ (
111
+ values: Omit<Initiative.Initiative, 'id'>,
112
+ { isValid, changed }: { isValid: boolean; changed: Record<string, boolean> },
113
+ ) => {
114
+ if (!isValid) {
115
+ return;
116
+ }
117
+
118
+ const changedPaths = Object.keys(changed).filter((path) => changed[path as string]) as JsonPath[];
119
+ // Handle other property changes.
120
+ if (changedPaths.length > 0) {
121
+ Obj.change(initiative, () => {
122
+ for (const path of changedPaths) {
123
+ const parts = splitJsonPath(path);
124
+ const value = Obj.getValue(values as any, parts);
125
+ Obj.setValue(initiative, parts, value);
126
+ }
127
+ });
128
+ }
129
+
130
+ queueMicrotask(() => syncTriggers(initiative));
131
+ },
132
+ [initiative],
133
+ );
134
+
135
+ const fieldMap = useMemo<FormFieldMap>(
136
+ () => ({
137
+ spec: ({ type, label, getValue, onValueChange }) => {
138
+ const { t } = useTranslation();
139
+
140
+ const value: Ref.Ref<Text.Text> = getValue();
141
+ const target = useAtomValue(AtomRef.make(value));
142
+ const [initialValue] = useObject(target, 'content');
143
+
144
+ return (
145
+ <Input.Root>
146
+ <div role='none'>
147
+ <Input.Label>{toLocalizedString(label, t)}</Input.Label>
148
+ </div>
149
+ <MarkdownEditor.Root id={target?.id ?? ''} object={target}>
150
+ <MarkdownEditor.Content initialValue={initialValue} />
151
+ </MarkdownEditor.Root>
152
+ </Input.Root>
153
+ );
154
+ },
155
+ plan: ({ type, label, getValue, onValueChange }) => {
156
+ const { t } = useTranslation();
157
+
158
+ const value: Ref.Ref<Initiative.Plan> = getValue();
159
+ const target = useAtomValue(AtomRef.make(value));
160
+
161
+ return (
162
+ <Input.Root>
163
+ <div role='none'>
164
+ <Input.Label>{toLocalizedString(label, t)}</Input.Label>
165
+ </div>
166
+ <MarkdownEditor.Root id={target?.id ?? ''}>
167
+ <MarkdownEditor.Content initialValue={target ? Initiative.formatPlan(target) : ''} />
168
+ </MarkdownEditor.Root>
169
+ </Input.Root>
170
+ );
171
+ },
172
+ }),
173
+ [],
174
+ );
175
+
176
+ const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
177
+
178
+ const handleResetHistory = useCallback(async () => {
179
+ const runtime = computeRuntime.getRuntime(Obj.getDatabase(initiative)!.spaceId);
180
+
181
+ await runtime.runPromise(Initiative.resetChatHistory(initiative));
182
+
183
+ if (!initiative.queue) {
184
+ await runtime.runPromise(
185
+ Effect.gen(function* () {
186
+ const queue = yield* QueueService.createQueue();
187
+ Obj.change(initiative, (initiative) => {
188
+ initiative.queue = Ref.fromDXN(queue.dxn);
189
+ });
190
+ }),
191
+ );
192
+ }
193
+ }, [initiative, computeRuntime]);
194
+
195
+ const inputQueue = useAtomValue(
196
+ AtomObj.make(initiative).pipe((_) =>
197
+ Atom.make((get) =>
198
+ Option.fromNullable(get(_).queue).pipe(Option.map(AtomRef.make), Option.map(get), Option.getOrUndefined),
199
+ ),
200
+ ),
201
+ );
202
+
203
+ const inputQueueItems = useQuery(inputQueue, Query.select(Filter.everything()));
204
+
205
+ // TODO(dmaretskyi): Form breaks if we provide the echo object directly.
206
+ const spreadValue = useMemo(() => ({ ...initiative }), [initiative]);
207
+ return (
208
+ <div className='flex flex-col gap-2'>
209
+ <ButtonGroup classNames='h-10'>
210
+ <Button onClick={handleResetHistory}>Reset History</Button>
211
+ </ButtonGroup>
212
+ <h3 className='mb-2'>Input Queue</h3>
213
+ <div className='border border-subduedSeparator rounded-md p-2 h-64 overflow-y-auto'>
214
+ {inputQueueItems.map((item) => (
215
+ <Surface.Surface key={item.id} role='section' data={{ subject: item }} limit={1} />
216
+ ))}
217
+ {inputQueueItems.length === 0 && <div className='text-subdued'>No items in queue</div>}
218
+ </div>
219
+ <Form.Root
220
+ schema={omitId(Initiative.Initiative)}
221
+ onValuesChanged={handleChange as any}
222
+ values={spreadValue}
223
+ db={Obj.getDatabase(initiative)}
224
+ fieldMap={fieldMap}
225
+ >
226
+ <Form.FieldSet />
227
+ </Form.Root>
228
+ </div>
229
+ );
230
+ };
231
+
232
+ // TODO(dmaretskyi): Perhaps the association is better done with a relation.
233
+
234
+ /**
235
+ * Foreign key {@link INITIATIVE_TRIGGER_EXTENSION_KEY} => <initative id : ObjectId>
236
+ */
237
+ const INITIATIVE_TRIGGER_EXTENSION_KEY = 'dxos.org/extension/InitiativeTrigger';
238
+
239
+ /**
240
+ * Foreign key {@link INITIATIVE_TRIGGER_EXTENSION_KEY} => <dxn string of subscription target>
241
+ */
242
+ const INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY = 'dxos.org/extension/InitiativeTriggerTarget';
243
+
244
+ /**
245
+ * Syncs triggers in the database with the initiative subscriptions.
246
+ */
247
+
248
+ const syncTriggers = async (initiative: Initiative.Initiative) => {
249
+ const db = Obj.getDatabase(initiative);
250
+ if (!db) {
251
+ return;
252
+ }
253
+
254
+ const triggers = await db
255
+ .query(Filter.foreignKeys(Trigger.Trigger, [{ source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id }]))
256
+ .run();
257
+
258
+ // Delete triggers that are not in subscriptions.
259
+ for (const trigger of triggers) {
260
+ const target = Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).at(0)?.id;
261
+
262
+ const exists = initiative.subscriptions.find((subscription) => subscription.dxn.toString() === target);
263
+ if (!exists && !(initiative.useQualifyingAgent && target === Obj.getDXN(initiative)?.toString())) {
264
+ db.remove(trigger);
265
+ }
266
+ }
267
+
268
+ // Add triggers that are not in the database.
269
+ for (const subscription of initiative.subscriptions) {
270
+ const relevantTrigger = triggers.find((trigger) =>
271
+ Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).some(
272
+ (key) => key.id === subscription.dxn.toString(),
273
+ ),
274
+ );
275
+ if (relevantTrigger) {
276
+ continue;
277
+ }
278
+
279
+ const target = await subscription.tryLoad();
280
+ if (!target || !target.queue || !(target.queue.dxn instanceof DXN) || target.queue.dxn.kind !== DXN.kind.QUEUE) {
281
+ continue;
282
+ }
283
+
284
+ db.add(
285
+ Trigger.make({
286
+ [Obj.Meta]: {
287
+ keys: [
288
+ { source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id },
289
+ { source: INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY, id: subscription.dxn.toString() },
290
+ ],
291
+ },
292
+ enabled: true,
293
+ spec: {
294
+ kind: 'queue',
295
+ queue: target.queue.dxn.toString(),
296
+ },
297
+ function: Ref.make(
298
+ FunctionDefinition.serialize(initiative.useQualifyingAgent ? Initiative.qualifier : Initiative.agent),
299
+ ),
300
+ input: {
301
+ initiative: Ref.make(initiative),
302
+ event: '{{event}}',
303
+ },
304
+ concurrency: initiative.useQualifyingAgent ? 5 : undefined,
305
+ }),
306
+ );
307
+ }
308
+
309
+ if (initiative.useQualifyingAgent) {
310
+ const qualifierTrigger = triggers.find((trigger) =>
311
+ Obj.getKeys(trigger, INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY).some(
312
+ (key) => key.id === Obj.getDXN(initiative)?.toString(),
313
+ ),
314
+ );
315
+ if (!qualifierTrigger && initiative.queue) {
316
+ db.add(
317
+ Trigger.make({
318
+ [Obj.Meta]: {
319
+ keys: [
320
+ { source: INITIATIVE_TRIGGER_EXTENSION_KEY, id: initiative.id },
321
+ { source: INITIATIVE_TRIGGER_TARGET_EXTENSION_KEY, id: Obj.getDXN(initiative)?.toString() ?? '' },
322
+ ],
323
+ },
324
+ function: Ref.make(FunctionDefinition.serialize(Initiative.agent)),
325
+ enabled: true,
326
+ spec: {
327
+ kind: 'queue',
328
+ queue: initiative.queue.dxn.toString(),
329
+ },
330
+ input: {
331
+ initiative: Ref.make(initiative),
332
+ event: '{{event}}',
333
+ },
334
+ }),
335
+ );
336
+ }
337
+ }
338
+
339
+ await db.flush({ indexes: true });
340
+ };
@@ -0,0 +1,49 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { useMemo } from 'react';
6
+
7
+ import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
8
+ import { Agent } from '@dxos/assistant-toolkit';
9
+ import { type Prompt } from '@dxos/blueprints';
10
+ import { Obj } from '@dxos/echo';
11
+ import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
12
+ import { Layout, Toolbar, useTranslation } from '@dxos/react-ui';
13
+ import { useAttention } from '@dxos/react-ui-attention';
14
+
15
+ import { meta } from '../meta';
16
+
17
+ import { TemplateEditor } from './TemplateEditor';
18
+
19
+ export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
20
+
21
+ export const PromptArticle = ({ role, subject }: PromptArticleProps) => {
22
+ const { t } = useTranslation(meta.id);
23
+ const db = Obj.getDatabase(subject);
24
+ const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
25
+
26
+ const inputData = useMemo(
27
+ () =>
28
+ subject && {
29
+ prompt: db?.makeRef(Obj.getDXN(subject)),
30
+ input: {},
31
+ },
32
+ [subject, db],
33
+ );
34
+
35
+ const handleRun = useComputeRuntimeCallback(db?.spaceId, () => invokeFunctionWithTracing(Agent.prompt, inputData), [
36
+ inputData,
37
+ ]);
38
+
39
+ return (
40
+ <Layout.Main role={role} toolbar>
41
+ <Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
42
+ <Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
43
+ </Toolbar.Root>
44
+ <TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
45
+ </Layout.Main>
46
+ );
47
+ };
48
+
49
+ export default PromptArticle;
@@ -2,68 +2,89 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react-vite';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React, { useState } from 'react';
9
7
 
10
8
  import { createSystemPrompt } from '@dxos/assistant';
11
- import { Template } from '@dxos/blueprints';
9
+ import { Blueprint, Template } from '@dxos/blueprints';
12
10
  import { useClient } from '@dxos/react-client';
13
11
  import { withClientProvider } from '@dxos/react-client/testing';
14
- import { ColumnContainer, withLayout, withTheme } from '@dxos/storybook-utils';
12
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
15
13
  import { trim } from '@dxos/util';
16
14
 
17
- import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
18
15
  import { translations } from '../../translations';
19
16
 
17
+ import { TemplateEditor, type TemplateEditorProps } from './TemplateEditor';
18
+
19
+ const FENCE = '```';
20
+
20
21
  const TEMPLATE = trim`
21
22
  {{! System Prompt }}
22
23
 
23
- You are a machine that is an expert chess player.
24
- The move history of the current game is: {{history}}
24
+ You are an expert chess player.
25
+ The move history of the current game is: {{history}}.
25
26
  If asked to suggest a move explain why it is a good move.
26
27
 
27
28
  {{#each artifacts}}
28
- - {{this}}
29
+ {{this}}
29
30
  {{/each}}
30
31
 
32
+ Reponse in the format: <suggestion>SUGGESTION</suggestion>
33
+
34
+ @dxn:queue:data:B6INSIBY3CBEF4M5VZRYBCMAHQMPYK5AJ:01K24XMVHSZHS97SG1VTVQDM5Z:01K24XPK464FSCKVQJAB2H662M
35
+
31
36
  ---
32
37
 
38
+ ${FENCE}ts
39
+ const x = 100;
40
+ ${FENCE}
41
+
33
42
  {{input}}
34
43
  `;
35
44
 
36
45
  const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
37
46
  const client = useClient();
38
- const [template] = useState(() => {
47
+ const [blueprint] = useState(() => {
39
48
  const space = client.spaces.default;
40
- return space.db.add(Template.make({ source }));
49
+ return space.db.add(
50
+ Blueprint.make({
51
+ key: 'example.com/blueprint/test',
52
+ name: 'Test',
53
+ instructions: Template.make({ source }),
54
+ }),
55
+ );
41
56
  });
42
57
 
43
- return <TemplateEditor template={template} />;
58
+ return (
59
+ <TemplateEditor
60
+ classNames='bg-baseSurface is-full max-is-proseMaxWidth'
61
+ id={blueprint.id}
62
+ template={blueprint.instructions}
63
+ />
64
+ );
44
65
  };
45
66
 
46
- const meta: Meta<typeof DefaultStory> = {
67
+ const meta = {
47
68
  title: 'plugins/plugin-assistant/TemplateEditor',
48
- component: TemplateEditor,
69
+ component: TemplateEditor as any,
49
70
  render: DefaultStory,
50
71
  decorators: [
72
+ withTheme(),
73
+ withLayout({ layout: 'column' }),
51
74
  withClientProvider({
75
+ types: [Blueprint.Blueprint],
52
76
  createIdentity: true,
53
77
  createSpace: true,
54
- types: [Template.Template],
55
78
  }),
56
- withLayout({ fullscreen: true, Container: ColumnContainer }),
57
- withTheme,
58
79
  ],
59
80
  parameters: {
60
81
  translations,
61
82
  },
62
- };
83
+ } satisfies Meta<typeof DefaultStory>;
63
84
 
64
85
  export default meta;
65
86
 
66
- type Story = Meta<typeof DefaultStory>;
87
+ type Story = StoryObj<typeof meta>;
67
88
 
68
89
  export const Default: Story = {
69
90
  args: {
@@ -2,88 +2,69 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { HighlightStyle, LanguageSupport, syntaxHighlighting } from '@codemirror/language';
6
- import { styleTags, tags } from '@lezer/highlight';
7
- import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
5
+ import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language';
8
6
  import React from 'react';
9
7
 
10
8
  import { type Template } from '@dxos/blueprints';
11
- import { invariant } from '@dxos/invariant';
12
- import { createDocAccessor } from '@dxos/react-client/echo';
13
- import { useThemeContext, useTranslation, type ThemedClassName } from '@dxos/react-ui';
9
+ import { createDocAccessor } from '@dxos/echo-db';
10
+ import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
11
+ import { useTextEditor } from '@dxos/react-ui-editor';
14
12
  import {
15
13
  createBasicExtensions,
16
14
  createDataExtensions,
15
+ createMarkdownExtensions,
17
16
  createThemeExtensions,
18
- useTextEditor,
19
- } from '@dxos/react-ui-editor';
20
- import { mx } from '@dxos/react-ui-theme';
17
+ decorateMarkdown,
18
+ } from '@dxos/ui-editor';
19
+ import { mx } from '@dxos/ui-theme';
20
+ import { isNonNullable } from '@dxos/util';
21
21
 
22
22
  import { meta } from '../../meta';
23
23
 
24
- handlebarsLanguage.configure({
25
- props: [
26
- styleTags({
27
- '---': tags.lineComment,
28
- }),
29
- ],
30
- });
24
+ import { handlebars, xmlDecorator } from './extensions';
31
25
 
32
26
  export type TemplateEditorProps = ThemedClassName<{
27
+ id: string;
33
28
  template: Template.Template;
29
+ lineNumbers?: boolean;
34
30
  }>;
35
31
 
36
- export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
32
+ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }: TemplateEditorProps) => {
37
33
  const { t } = useTranslation(meta.id);
38
34
  const { themeMode } = useThemeContext();
39
35
  const { parentRef } = useTextEditor(() => {
40
- invariant(template.source.target);
36
+ const text = template.source?.target;
37
+ if (!text) {
38
+ return {};
39
+ }
40
+
41
41
  return {
42
- initialValue: template.source.target.content,
42
+ initialValue: text.content ?? '',
43
43
  extensions: [
44
44
  createDataExtensions({
45
- id: template.id,
46
- text: createDocAccessor(template.source.target, ['content']),
45
+ id,
46
+ text: createDocAccessor(text, ['content']),
47
47
  }),
48
48
  createBasicExtensions({
49
49
  bracketMatching: false,
50
- lineNumbers: true,
50
+ lineNumbers,
51
51
  lineWrapping: true,
52
- monospace: true,
53
52
  placeholder: t('template placeholder'),
54
53
  }),
55
54
  createThemeExtensions({
56
55
  themeMode,
56
+ slots: { content: { className: '!pie-4' } },
57
57
  }),
58
-
59
- // https://github.com/xiechao/lang-handlebars
60
- new LanguageSupport(handlebarsLanguage, syntaxHighlighting(handlebarsHighlightStyle)),
61
- ],
58
+ createMarkdownExtensions(),
59
+ decorateMarkdown(),
60
+ handlebars(),
61
+ // xml(),
62
+ // NOTE: Since we're using markdown only HTML nodes are parsed.
63
+ xmlDecorator(),
64
+ syntaxHighlighting(defaultHighlightStyle),
65
+ ].filter(isNonNullable),
62
66
  };
63
- }, [themeMode, template]);
67
+ }, [themeMode, template.source?.target, lineNumbers]);
64
68
 
65
- return <div ref={parentRef} className={mx('h-full', classNames)} />;
69
+ return <div ref={parentRef} className={mx('bs-full overflow-hidden', classNames)} />;
66
70
  };
67
-
68
- /**
69
- * https://github.com/xiechao/lang-handlebars/blob/direct/src/highlight.js
70
- */
71
- export const handlebarsHighlightStyle = HighlightStyle.define([
72
- {
73
- // Braces.
74
- tag: tags.tagName,
75
- class: 'text-redText',
76
- },
77
- {
78
- tag: tags.variableName,
79
- class: 'text-blueText',
80
- },
81
- {
82
- tag: tags.keyword,
83
- class: 'text-greenText',
84
- },
85
- {
86
- tag: tags.comment,
87
- class: 'text-subdued',
88
- },
89
- ]);