@dxos/plugin-assistant 0.8.4-main.5ea62a8 → 0.8.4-main.66e292d

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 (486) hide show
  1. package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs +36 -0
  2. package/dist/lib/browser/BlueprintArticle-BWSLH6LG.mjs.map +7 -0
  3. package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs +158 -0
  4. package/dist/lib/browser/ChatCompanion-OSZZZSWV.mjs.map +7 -0
  5. package/dist/lib/browser/{ChatContainer-YBJBIVUZ.mjs → ChatContainer-2W6FNSJD.mjs} +22 -20
  6. package/dist/lib/browser/ChatContainer-2W6FNSJD.mjs.map +7 -0
  7. package/dist/lib/browser/{ChatDialog-MTPJLEHM.mjs → ChatDialog-XQ3KDYWE.mjs} +12 -11
  8. package/dist/lib/browser/ChatDialog-XQ3KDYWE.mjs.map +7 -0
  9. package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs +59 -0
  10. package/dist/lib/browser/PromptArticle-Q7JYGFQV.mjs.map +7 -0
  11. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
  12. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
  13. package/dist/lib/browser/{app-graph-builder-7AAWTWGA.mjs → app-graph-builder-LM6GVHQO.mjs} +67 -21
  14. package/dist/lib/browser/app-graph-builder-LM6GVHQO.mjs.map +7 -0
  15. package/dist/lib/browser/{blueprint-definition-CRZPIA5A.mjs → blueprint-definition-VBEOXNBS.mjs} +4 -4
  16. package/dist/lib/browser/chunk-2BOE3OTW.mjs +262 -0
  17. package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-SMIVXXAI.mjs → chunk-5JZRYQZL.mjs} +52 -25
  19. package/dist/lib/browser/chunk-5JZRYQZL.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs +335 -0
  21. package/dist/lib/browser/chunk-7ZJIXQ2Y.mjs.map +7 -0
  22. package/dist/lib/browser/{chunk-IJAJRAR7.mjs → chunk-LRE4VEZV.mjs} +2 -4
  23. package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +7 -0
  24. package/dist/lib/browser/{chunk-OYFQS7JM.mjs → chunk-NC2QNMBF.mjs} +60 -41
  25. package/dist/lib/browser/chunk-NC2QNMBF.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-PWSTPQUY.mjs +1929 -0
  27. package/dist/lib/browser/chunk-PWSTPQUY.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-WBG5PTSX.mjs +23 -0
  29. package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +7 -0
  30. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
  31. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
  32. package/dist/lib/browser/index.mjs +142 -103
  33. package/dist/lib/browser/index.mjs.map +4 -4
  34. package/dist/lib/browser/{intent-resolver-BQO5SVGI.mjs → intent-resolver-EEYS2GJF.mjs} +62 -31
  35. package/dist/lib/browser/intent-resolver-EEYS2GJF.mjs.map +7 -0
  36. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +17 -0
  37. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +7 -0
  38. package/dist/lib/browser/meta.json +1 -1
  39. package/dist/lib/browser/{react-surface-VNCD2H7C.mjs → react-surface-ECKZNDSU.mjs} +24 -35
  40. package/dist/lib/browser/react-surface-ECKZNDSU.mjs.map +7 -0
  41. package/dist/lib/browser/repair-3MZXLUHO.mjs +44 -0
  42. package/dist/lib/browser/repair-3MZXLUHO.mjs.map +7 -0
  43. package/dist/lib/browser/{settings-36V3VUMW.mjs → settings-HD5WA24I.mjs} +5 -5
  44. package/dist/lib/browser/{settings-36V3VUMW.mjs.map → settings-HD5WA24I.mjs.map} +1 -1
  45. package/dist/lib/browser/{state-D5IVKNYG.mjs → state-GG7Z3NB7.mjs} +9 -5
  46. package/dist/lib/browser/{state-D5IVKNYG.mjs.map → state-GG7Z3NB7.mjs.map} +3 -3
  47. package/dist/lib/browser/toolkit-VYDAWNE4.mjs +17 -0
  48. package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +7 -0
  49. package/dist/lib/browser/types/index.mjs +2 -2
  50. package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs +37 -0
  51. package/dist/lib/node-esm/BlueprintArticle-R2XYBRCK.mjs.map +7 -0
  52. package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs +159 -0
  53. package/dist/lib/node-esm/ChatCompanion-IUMU7WRQ.mjs.map +7 -0
  54. package/dist/lib/node-esm/{ChatContainer-TUCITJJW.mjs → ChatContainer-CTUNUEU3.mjs} +22 -20
  55. package/dist/lib/node-esm/ChatContainer-CTUNUEU3.mjs.map +7 -0
  56. package/dist/lib/node-esm/{ChatDialog-JLM7RDZQ.mjs → ChatDialog-X42ASXQD.mjs} +12 -11
  57. package/dist/lib/node-esm/ChatDialog-X42ASXQD.mjs.map +7 -0
  58. package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs +60 -0
  59. package/dist/lib/node-esm/PromptArticle-IV7O5UZ3.mjs.map +7 -0
  60. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +20 -0
  61. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +7 -0
  62. package/dist/lib/node-esm/{app-graph-builder-PNAFQUYT.mjs → app-graph-builder-6XUAGTRS.mjs} +67 -21
  63. package/dist/lib/node-esm/app-graph-builder-6XUAGTRS.mjs.map +7 -0
  64. package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs → blueprint-definition-RDCLLIQH.mjs} +4 -4
  65. package/dist/lib/node-esm/{chunk-CAQKGW3B.mjs → chunk-25GMMNY5.mjs} +60 -41
  66. package/dist/lib/node-esm/chunk-25GMMNY5.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-3Q22TTXW.mjs +264 -0
  68. package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-CKW4IYLY.mjs +336 -0
  70. package/dist/lib/node-esm/chunk-CKW4IYLY.mjs.map +7 -0
  71. package/dist/lib/node-esm/{chunk-7YOGZI66.mjs → chunk-E4JSYCWZ.mjs} +52 -25
  72. package/dist/lib/node-esm/chunk-E4JSYCWZ.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-WE6KTH72.mjs +25 -0
  74. package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +7 -0
  75. package/dist/lib/node-esm/{chunk-YPXEA46Q.mjs → chunk-YWFWT57N.mjs} +2 -4
  76. package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-Z37USO4K.mjs +1930 -0
  78. package/dist/lib/node-esm/chunk-Z37USO4K.mjs.map +7 -0
  79. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
  80. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
  81. package/dist/lib/node-esm/index.mjs +142 -103
  82. package/dist/lib/node-esm/index.mjs.map +4 -4
  83. package/dist/lib/node-esm/{intent-resolver-FIS3T5KP.mjs → intent-resolver-4SRYLDK5.mjs} +62 -31
  84. package/dist/lib/node-esm/intent-resolver-4SRYLDK5.mjs.map +7 -0
  85. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +18 -0
  86. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +7 -0
  87. package/dist/lib/node-esm/meta.json +1 -1
  88. package/dist/lib/node-esm/{react-surface-4NLRKNBU.mjs → react-surface-NLIG5VAI.mjs} +24 -35
  89. package/dist/lib/node-esm/react-surface-NLIG5VAI.mjs.map +7 -0
  90. package/dist/lib/node-esm/repair-RER5H7Y6.mjs +45 -0
  91. package/dist/lib/node-esm/repair-RER5H7Y6.mjs.map +7 -0
  92. package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs → settings-YJQVKHH5.mjs} +5 -5
  93. package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs.map → settings-YJQVKHH5.mjs.map} +1 -1
  94. package/dist/lib/node-esm/{state-4VLKPLW3.mjs → state-FSUHFMDM.mjs} +9 -5
  95. package/dist/lib/node-esm/{state-4VLKPLW3.mjs.map → state-FSUHFMDM.mjs.map} +3 -3
  96. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +18 -0
  97. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +7 -0
  98. package/dist/lib/node-esm/types/index.mjs +2 -2
  99. package/dist/types/src/AssistantPlugin.d.ts +1 -1
  100. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/ai-service.d.ts +2 -3
  102. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  103. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  104. package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
  105. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  106. package/dist/types/src/capabilities/capabilities.d.ts +2 -11
  107. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  108. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  109. package/dist/types/src/capabilities/index.d.ts +1 -0
  110. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  111. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  112. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  114. package/dist/types/src/capabilities/repair.d.ts +4 -0
  115. package/dist/types/src/capabilities/repair.d.ts.map +1 -0
  116. package/dist/types/src/capabilities/state.d.ts.map +1 -1
  117. package/dist/types/src/capabilities/toolkit.d.ts +1 -1
  118. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  119. package/dist/types/src/components/BlueprintArticle.d.ts +7 -0
  120. package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -0
  121. package/dist/types/src/components/Chat/Chat.d.ts +22 -11
  122. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  123. package/dist/types/src/components/Chat/events.d.ts +4 -0
  124. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  125. package/dist/types/src/components/ChatCompanion.d.ts +2 -2
  126. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
  127. package/dist/types/src/components/ChatContainer.d.ts +7 -4
  128. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  129. package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
  130. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  131. package/dist/types/src/components/ChatPrompt/ChatActions.d.ts.map +1 -1
  132. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  133. package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -8
  134. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  135. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +140 -77
  136. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  137. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  138. package/dist/types/src/components/ChatThread/reducers.d.ts +5 -5
  139. package/dist/types/src/components/ChatThread/reducers.d.ts.map +1 -1
  140. package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
  141. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  142. package/dist/types/src/components/ChatThread/sync.d.ts +42 -0
  143. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  144. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  145. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  146. package/dist/types/src/components/PromptArticle.d.ts +7 -0
  147. package/dist/types/src/components/PromptArticle.d.ts.map +1 -0
  148. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
  149. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  150. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +121 -62
  151. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  152. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +1 -1
  153. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  154. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +121 -62
  155. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -0
  157. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts +3 -0
  158. package/dist/types/src/components/TemplateEditor/extensions/index.d.ts.map +1 -0
  159. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts +8 -0
  160. package/dist/types/src/components/TemplateEditor/extensions/xml-extension.d.ts.map +1 -0
  161. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +21 -0
  162. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  163. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  164. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  165. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  166. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  167. package/dist/types/src/components/Toolbox/Toolbox.d.ts +2 -2
  168. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  169. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +121 -62
  170. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  171. package/dist/types/src/components/index.d.ts +4 -9
  172. package/dist/types/src/components/index.d.ts.map +1 -1
  173. package/dist/types/src/functions/analysis.d.ts +1 -1
  174. package/dist/types/src/functions/analysis.d.ts.map +1 -1
  175. package/dist/types/src/functions/index.d.ts +2 -2
  176. package/dist/types/src/functions/index.d.ts.map +1 -1
  177. package/dist/types/src/functions/{list.d.ts → object-list.d.ts} +2 -2
  178. package/dist/types/src/functions/object-list.d.ts.map +1 -0
  179. package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +2 -2
  180. package/dist/types/src/functions/object-load.d.ts.map +1 -0
  181. package/dist/types/src/hooks/index.d.ts +2 -4
  182. package/dist/types/src/hooks/index.d.ts.map +1 -1
  183. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +2 -1
  184. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  185. package/dist/types/src/hooks/useChatProcessor.d.ts +5 -3
  186. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  187. package/dist/types/src/hooks/useChatServices.d.ts +2 -2
  188. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  189. package/dist/types/src/hooks/useChatToolbarActions.d.ts +8 -0
  190. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -0
  191. package/dist/types/src/hooks/useContextBinder.d.ts +2 -2
  192. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  193. package/dist/types/src/hooks/useFilteredTypes.d.ts +4 -0
  194. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  195. package/dist/types/src/hooks/useReferencesProvider.d.ts.map +1 -1
  196. package/dist/types/src/index.d.ts +2 -0
  197. package/dist/types/src/index.d.ts.map +1 -1
  198. package/dist/types/src/meta.d.ts +1 -2
  199. package/dist/types/src/meta.d.ts.map +1 -1
  200. package/dist/types/src/processor/index.d.ts +1 -0
  201. package/dist/types/src/processor/index.d.ts.map +1 -1
  202. package/dist/types/src/processor/presets.d.ts +1 -1
  203. package/dist/types/src/processor/presets.d.ts.map +1 -1
  204. package/dist/types/src/processor/processor.d.ts +17 -23
  205. package/dist/types/src/processor/processor.d.ts.map +1 -1
  206. package/dist/types/src/processor/update-name.d.ts +10 -0
  207. package/dist/types/src/processor/update-name.d.ts.map +1 -0
  208. package/dist/types/src/queue-logger.d.ts.map +1 -1
  209. package/dist/types/src/testing/index.d.ts +1 -2
  210. package/dist/types/src/testing/index.d.ts.map +1 -1
  211. package/dist/types/src/testing/test-generator.d.ts +7 -0
  212. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  213. package/dist/types/src/testing/test-services.d.ts +2 -2
  214. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  215. package/dist/types/src/translations.d.ts +246 -27
  216. package/dist/types/src/translations.d.ts.map +1 -1
  217. package/dist/types/src/types/Assistant.d.ts +16 -13
  218. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  219. package/dist/types/src/types/AssistantAction.d.ts +38 -16
  220. package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
  221. package/dist/types/src/types/service.d.ts +129 -82
  222. package/dist/types/src/types/service.d.ts.map +1 -1
  223. package/dist/types/tsconfig.tsbuildinfo +1 -1
  224. package/package.json +96 -111
  225. package/src/AssistantPlugin.tsx +138 -134
  226. package/src/capabilities/ai-service.ts +6 -7
  227. package/src/capabilities/app-graph-builder.ts +69 -21
  228. package/src/capabilities/blueprint-definition.ts +39 -15
  229. package/src/capabilities/capabilities.ts +2 -16
  230. package/src/capabilities/edge-model-resolver.ts +5 -7
  231. package/src/capabilities/index.ts +1 -0
  232. package/src/capabilities/intent-resolver.ts +61 -20
  233. package/src/capabilities/local-model-resolver.ts +7 -9
  234. package/src/capabilities/react-surface.tsx +16 -20
  235. package/src/capabilities/repair.ts +49 -0
  236. package/src/capabilities/state.ts +2 -0
  237. package/src/capabilities/toolkit.ts +9 -155
  238. package/src/components/BlueprintArticle.tsx +29 -0
  239. package/src/components/Chat/Chat.tsx +177 -140
  240. package/src/components/Chat/events.ts +6 -0
  241. package/src/components/ChatCompanion.tsx +93 -49
  242. package/src/components/ChatContainer.tsx +27 -17
  243. package/src/components/ChatDialog.tsx +17 -10
  244. package/src/components/ChatProgress/ChatProgress.tsx +3 -4
  245. package/src/components/ChatPrompt/ChatActions.tsx +2 -4
  246. package/src/components/ChatPrompt/ChatOptions.tsx +48 -47
  247. package/src/components/ChatPrompt/ChatReferences.tsx +2 -2
  248. package/src/components/ChatThread/ChatThread.stories.tsx +90 -225
  249. package/src/components/ChatThread/ChatThread.tsx +59 -51
  250. package/src/components/ChatThread/Link.tsx +11 -8
  251. package/src/components/ChatThread/reducers.ts +6 -6
  252. package/src/components/ChatThread/registry.tsx +174 -0
  253. package/src/components/ChatThread/sync.test.ts +89 -0
  254. package/src/components/ChatThread/sync.ts +148 -0
  255. package/src/components/ChatThread/testing/thread.md +37 -0
  256. package/src/components/PromptArticle.tsx +51 -0
  257. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +15 -7
  258. package/src/components/TemplateEditor/TemplateEditor.tsx +21 -12
  259. package/src/components/TemplateEditor/TemplateForm.stories.tsx +4 -6
  260. package/src/components/TemplateEditor/TemplateForm.tsx +2 -2
  261. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +269 -0
  262. package/src/components/TemplateEditor/extensions/index.ts +6 -0
  263. package/src/components/TemplateEditor/extensions/xml-extension.ts +64 -0
  264. package/src/components/{ChatThread → ToolBlock}/ToolBlock.tsx +46 -50
  265. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  266. package/src/components/ToolBlock/index.ts +6 -0
  267. package/src/components/Toolbox/Toolbox.stories.tsx +5 -8
  268. package/src/components/Toolbox/Toolbox.tsx +5 -5
  269. package/src/components/index.ts +2 -5
  270. package/src/functions/analysis.ts +5 -3
  271. package/src/functions/index.ts +2 -2
  272. package/src/functions/{list.ts → object-list.ts} +6 -4
  273. package/src/functions/{load.ts → object-load.ts} +10 -8
  274. package/src/hooks/index.ts +2 -4
  275. package/src/hooks/useBlueprintRegistry.ts +19 -4
  276. package/src/hooks/useChatProcessor.ts +23 -15
  277. package/src/hooks/useChatServices.ts +29 -42
  278. package/src/hooks/useChatToolbarActions.ts +122 -0
  279. package/src/hooks/useContextBinder.ts +19 -7
  280. package/src/hooks/useContextObjects.ts +1 -1
  281. package/src/hooks/{useItemTypes.ts → useFilteredTypes.ts} +8 -7
  282. package/src/hooks/useReferencesProvider.ts +2 -1
  283. package/src/index.ts +2 -0
  284. package/src/meta.ts +9 -6
  285. package/src/processor/index.ts +1 -0
  286. package/src/processor/presets.ts +2 -2
  287. package/src/processor/processor.test.ts +21 -27
  288. package/src/processor/processor.ts +47 -74
  289. package/src/processor/update-name.ts +56 -0
  290. package/src/queue-logger.ts +9 -13
  291. package/src/testing/index.ts +1 -2
  292. package/src/testing/test-generator.ts +261 -0
  293. package/src/testing/test-services.ts +2 -8
  294. package/src/translations.ts +30 -18
  295. package/src/types/Assistant.ts +11 -9
  296. package/src/types/AssistantAction.ts +23 -6
  297. package/src/types/service.ts +17 -9
  298. package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs +0 -29
  299. package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs.map +0 -7
  300. package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs +0 -126
  301. package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs.map +0 -7
  302. package/dist/lib/browser/ChatContainer-YBJBIVUZ.mjs.map +0 -7
  303. package/dist/lib/browser/ChatDialog-MTPJLEHM.mjs.map +0 -7
  304. package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs +0 -150
  305. package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +0 -7
  306. package/dist/lib/browser/ai-service-NRZPTUHO.mjs +0 -22
  307. package/dist/lib/browser/ai-service-NRZPTUHO.mjs.map +0 -7
  308. package/dist/lib/browser/app-graph-builder-7AAWTWGA.mjs.map +0 -7
  309. package/dist/lib/browser/chunk-6QMISAU6.mjs +0 -167
  310. package/dist/lib/browser/chunk-6QMISAU6.mjs.map +0 -7
  311. package/dist/lib/browser/chunk-CFXXQM25.mjs +0 -182
  312. package/dist/lib/browser/chunk-CFXXQM25.mjs.map +0 -7
  313. package/dist/lib/browser/chunk-IJAJRAR7.mjs.map +0 -7
  314. package/dist/lib/browser/chunk-O4LUJEDV.mjs +0 -20
  315. package/dist/lib/browser/chunk-O4LUJEDV.mjs.map +0 -7
  316. package/dist/lib/browser/chunk-OYFQS7JM.mjs.map +0 -7
  317. package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +0 -7
  318. package/dist/lib/browser/chunk-V5H5CCZA.mjs +0 -218
  319. package/dist/lib/browser/chunk-V5H5CCZA.mjs.map +0 -7
  320. package/dist/lib/browser/chunk-XL557TXF.mjs +0 -2332
  321. package/dist/lib/browser/chunk-XL557TXF.mjs.map +0 -7
  322. package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs +0 -22
  323. package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs.map +0 -7
  324. package/dist/lib/browser/intent-resolver-BQO5SVGI.mjs.map +0 -7
  325. package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs +0 -21
  326. package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs.map +0 -7
  327. package/dist/lib/browser/react-surface-VNCD2H7C.mjs.map +0 -7
  328. package/dist/lib/browser/toolkit-Y5OYX5PO.mjs +0 -191
  329. package/dist/lib/browser/toolkit-Y5OYX5PO.mjs.map +0 -7
  330. package/dist/lib/node-esm/BlueprintContainer-UFVWCRN6.mjs +0 -30
  331. package/dist/lib/node-esm/BlueprintContainer-UFVWCRN6.mjs.map +0 -7
  332. package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs +0 -127
  333. package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs.map +0 -7
  334. package/dist/lib/node-esm/ChatContainer-TUCITJJW.mjs.map +0 -7
  335. package/dist/lib/node-esm/ChatDialog-JLM7RDZQ.mjs.map +0 -7
  336. package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs +0 -151
  337. package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +0 -7
  338. package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs +0 -23
  339. package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs.map +0 -7
  340. package/dist/lib/node-esm/app-graph-builder-PNAFQUYT.mjs.map +0 -7
  341. package/dist/lib/node-esm/chunk-2X6VEO32.mjs +0 -2333
  342. package/dist/lib/node-esm/chunk-2X6VEO32.mjs.map +0 -7
  343. package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +0 -7
  344. package/dist/lib/node-esm/chunk-CAQKGW3B.mjs.map +0 -7
  345. package/dist/lib/node-esm/chunk-FNZJJL7G.mjs +0 -183
  346. package/dist/lib/node-esm/chunk-FNZJJL7G.mjs.map +0 -7
  347. package/dist/lib/node-esm/chunk-RLBN4RNR.mjs +0 -168
  348. package/dist/lib/node-esm/chunk-RLBN4RNR.mjs.map +0 -7
  349. package/dist/lib/node-esm/chunk-UWUUZQWJ.mjs +0 -219
  350. package/dist/lib/node-esm/chunk-UWUUZQWJ.mjs.map +0 -7
  351. package/dist/lib/node-esm/chunk-VFY2JG62.mjs +0 -22
  352. package/dist/lib/node-esm/chunk-VFY2JG62.mjs.map +0 -7
  353. package/dist/lib/node-esm/chunk-YPXEA46Q.mjs.map +0 -7
  354. package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs +0 -23
  355. package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs.map +0 -7
  356. package/dist/lib/node-esm/intent-resolver-FIS3T5KP.mjs.map +0 -7
  357. package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs +0 -22
  358. package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs.map +0 -7
  359. package/dist/lib/node-esm/react-surface-4NLRKNBU.mjs.map +0 -7
  360. package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs +0 -192
  361. package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs.map +0 -7
  362. package/dist/types/src/components/BlueprintContainer.d.ts +0 -8
  363. package/dist/types/src/components/BlueprintContainer.d.ts.map +0 -1
  364. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -33
  365. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  366. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
  367. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  368. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  369. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  370. package/dist/types/src/components/SequenceContainer.d.ts +0 -8
  371. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  372. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  373. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  374. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -263
  375. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  376. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  377. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  378. package/dist/types/src/components/TemplateEditor/handlebars-extension.d.ts.map +0 -1
  379. package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -4
  380. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
  381. package/dist/types/src/components/Toolbar/index.d.ts +0 -2
  382. package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
  383. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts +0 -11
  384. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
  385. package/dist/types/src/execution-graph/execution-graph.d.ts +0 -21
  386. package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
  387. package/dist/types/src/execution-graph/index.d.ts +0 -2
  388. package/dist/types/src/execution-graph/index.d.ts.map +0 -1
  389. package/dist/types/src/functions/list.d.ts.map +0 -1
  390. package/dist/types/src/functions/load.d.ts.map +0 -1
  391. package/dist/types/src/hooks/useExecutionGraph.d.ts +0 -7
  392. package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
  393. package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
  394. package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
  395. package/dist/types/src/hooks/useMatcherExtension.d.ts +0 -3
  396. package/dist/types/src/hooks/useMatcherExtension.d.ts.map +0 -1
  397. package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
  398. package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
  399. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  400. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  401. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  402. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  403. package/dist/types/src/parser/index.d.ts +0 -4
  404. package/dist/types/src/parser/index.d.ts.map +0 -1
  405. package/dist/types/src/parser/query-parser.d.ts +0 -15
  406. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  407. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  408. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  409. package/dist/types/src/parser/types.d.ts +0 -24
  410. package/dist/types/src/parser/types.d.ts.map +0 -1
  411. package/dist/types/src/stories/Chat.stories.d.ts +0 -26
  412. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  413. package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -4
  414. package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
  415. package/dist/types/src/stories/components/ChatContainer.d.ts +0 -4
  416. package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
  417. package/dist/types/src/stories/components/CommentsContainer.d.ts +0 -4
  418. package/dist/types/src/stories/components/CommentsContainer.d.ts.map +0 -1
  419. package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
  420. package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
  421. package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -4
  422. package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
  423. package/dist/types/src/stories/components/MessageContainer.d.ts +0 -4
  424. package/dist/types/src/stories/components/MessageContainer.d.ts.map +0 -1
  425. package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
  426. package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
  427. package/dist/types/src/stories/components/TasksContainer.d.ts +0 -4
  428. package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
  429. package/dist/types/src/stories/components/TokenManagerContainer.d.ts +0 -3
  430. package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +0 -1
  431. package/dist/types/src/stories/components/index.d.ts +0 -11
  432. package/dist/types/src/stories/components/index.d.ts.map +0 -1
  433. package/dist/types/src/stories/components/types.d.ts +0 -7
  434. package/dist/types/src/stories/components/types.d.ts.map +0 -1
  435. package/dist/types/src/stories/testing/data.d.ts +0 -5
  436. package/dist/types/src/stories/testing/data.d.ts.map +0 -1
  437. package/dist/types/src/stories/testing/index.d.ts +0 -3
  438. package/dist/types/src/stories/testing/index.d.ts.map +0 -1
  439. package/dist/types/src/stories/testing/testing.d.ts +0 -44
  440. package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
  441. package/dist/types/src/testing/test-data.d.ts +0 -4
  442. package/dist/types/src/testing/test-data.d.ts.map +0 -1
  443. package/dist/types/src/testing/test-functions.d.ts +0 -6
  444. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  445. package/src/components/BlueprintContainer.tsx +0 -24
  446. package/src/components/ChatThread/ChatMessage.tsx +0 -334
  447. package/src/components/PromptSettings.tsx +0 -90
  448. package/src/components/SequenceContainer.tsx +0 -131
  449. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -33
  450. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  451. package/src/components/SequenceEditor/index.ts +0 -5
  452. package/src/components/TemplateEditor/handlebars-extension.ts +0 -165
  453. package/src/components/Toolbar/Toolbar.tsx +0 -20
  454. package/src/components/Toolbar/index.ts +0 -5
  455. package/src/components/Toolbar/useChatToolbarActions.ts +0 -125
  456. package/src/execution-graph/execution-graph.ts +0 -211
  457. package/src/execution-graph/index.ts +0 -5
  458. package/src/hooks/useExecutionGraph.ts +0 -20
  459. package/src/hooks/useMatcherExtension.ts +0 -45
  460. package/src/hooks/useResolveRef.ts +0 -33
  461. package/src/parser/filter-generator.test.ts +0 -32
  462. package/src/parser/filter-generator.ts +0 -76
  463. package/src/parser/index.ts +0 -7
  464. package/src/parser/query-parser.test.ts +0 -139
  465. package/src/parser/query-parser.ts +0 -199
  466. package/src/parser/types.ts +0 -36
  467. package/src/stories/Chat.stories.tsx +0 -469
  468. package/src/stories/components/BlueprintContainer.tsx +0 -32
  469. package/src/stories/components/ChatContainer.tsx +0 -57
  470. package/src/stories/components/CommentsContainer.tsx +0 -25
  471. package/src/stories/components/GraphContainer.tsx +0 -118
  472. package/src/stories/components/LoggingContainer.tsx +0 -21
  473. package/src/stories/components/MessageContainer.tsx +0 -27
  474. package/src/stories/components/SurfaceContainer.tsx +0 -52
  475. package/src/stories/components/TasksContainer.tsx +0 -49
  476. package/src/stories/components/TokenManagerContainer.tsx +0 -14
  477. package/src/stories/components/index.ts +0 -15
  478. package/src/stories/components/types.ts +0 -11
  479. package/src/stories/testing/data.ts +0 -142
  480. package/src/stories/testing/index.ts +0 -6
  481. package/src/stories/testing/testing.tsx +0 -254
  482. package/src/testing/test-data.ts +0 -109
  483. package/src/testing/test-functions.ts +0 -16
  484. /package/dist/lib/browser/{blueprint-definition-CRZPIA5A.mjs.map → blueprint-definition-VBEOXNBS.mjs.map} +0 -0
  485. /package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs.map → blueprint-definition-RDCLLIQH.mjs.map} +0 -0
  486. /package/dist/types/src/components/TemplateEditor/{handlebars-extension.d.ts → extensions/handlebars-extension.d.ts} +0 -0
@@ -2,7 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Schema } from 'effect';
5
+ import type * as Schema from 'effect/Schema';
6
6
  import React, { Fragment, useEffect } from 'react';
7
7
 
8
8
  import { type Template } from '@dxos/blueprints';
@@ -26,7 +26,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
26
26
  usePromptInputs(template);
27
27
 
28
28
  return (
29
- <div className={mx('flex flex-col w-full overflow-hidden gap-4', groupBorder)}>
29
+ <div className={mx('flex flex-col is-full overflow-hidden gap-4', groupBorder)}>
30
30
  {/* {commandEditable && (
31
31
  <div className='flex items-center pl-4'>
32
32
  <span className='text-neutral-500'>/</span>
@@ -0,0 +1,269 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import {
6
+ type CompletionContext,
7
+ type CompletionResult,
8
+ autocompletion,
9
+ completionKeymap,
10
+ } from '@codemirror/autocomplete';
11
+ import { type Extension, RangeSetBuilder } from '@codemirror/state';
12
+ import {
13
+ Decoration,
14
+ type DecorationSet,
15
+ type EditorView,
16
+ ViewPlugin,
17
+ type ViewUpdate,
18
+ WidgetType,
19
+ keymap,
20
+ } from '@codemirror/view';
21
+
22
+ import { Domino } from '@dxos/react-ui';
23
+ import { mx } from '@dxos/react-ui-theme';
24
+
25
+ export type HandlebarsOptions = {};
26
+
27
+ /**
28
+ * Simple Handlebars plugin for CodeMirror.
29
+ * Supports:
30
+ * - Comments: {{! comment }}
31
+ * - Commands: {{#command}} {{/command}}
32
+ * - Variables: {{var}}
33
+ * - Commands with variables: {{#each items}} {{/each}}
34
+ */
35
+ export const handlebars = (_: HandlebarsOptions = {}): Extension => {
36
+ return [
37
+ handlebarsHighlightPlugin,
38
+ autocompletion({
39
+ activateOnTyping: true,
40
+ aboveCursor: true,
41
+ closeOnBlur: true,
42
+ override: [handlebarsCompletions],
43
+ }),
44
+ keymap.of(completionKeymap),
45
+ ];
46
+ };
47
+
48
+ const regex = {
49
+ // {{! comment }}
50
+ comment: /\{\{!\s*[^}]*\}\}/g,
51
+
52
+ // {{var}}
53
+ brackets: /\{\{[^}]*\}\}/g,
54
+
55
+ // {{#command}} {{/command}}
56
+ command: /\{\{[#/]([^}]+)\}\}/g,
57
+
58
+ // {{var}}
59
+ var: /\{\{(?!\s*!)(\w[^}]*)\}\}/g,
60
+
61
+ // @dxn:queue:data:xxx
62
+ dxn: /@?dxn:[\w@:]+/g,
63
+
64
+ // dxos.org/type/xxx
65
+ url: /[\w.-]+\.[\w.-]+\/[\w/]+/g,
66
+ };
67
+
68
+ const tagPadding = 'mli-0.5 pli-1 rounded-sm';
69
+
70
+ /**
71
+ * ViewPlugin that decorates Handlebars syntax.
72
+ */
73
+ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
74
+ class {
75
+ decorations: DecorationSet;
76
+
77
+ constructor(view: EditorView) {
78
+ this.decorations = this.buildDecorations(view);
79
+ }
80
+
81
+ update(update: ViewUpdate) {
82
+ if (update.docChanged || update.viewportChanged || update.selectionSet) {
83
+ this.decorations = this.buildDecorations(update.view);
84
+ }
85
+ }
86
+
87
+ // NOTE: Decorations may clash with other extensions (e.g., markdown).
88
+ buildDecorations(view: EditorView) {
89
+ const selection = view.state.selection.main;
90
+ const decorations: Array<{ from: number; to: number; decoration: Decoration }> = [];
91
+
92
+ for (const { from, to } of view.visibleRanges) {
93
+ const text = view.state.doc.sliceString(from, to);
94
+
95
+ // Match DXN.
96
+ {
97
+ let match;
98
+ while ((match = regex.dxn.exec(text)) !== null) {
99
+ const start = from + match.index;
100
+ const end = start + match[0].length;
101
+ // Only show widget if selection doesn't overlap with the match range.
102
+ const overlaps = selection.to > start && selection.from <= end;
103
+ if (!overlaps) {
104
+ decorations.push({
105
+ from: start,
106
+ to: end,
107
+ decoration: Decoration.widget({
108
+ widget: new DXNWidget(match[0]),
109
+ }),
110
+ });
111
+ }
112
+ }
113
+ }
114
+
115
+ // Match URLs.
116
+ {
117
+ let match;
118
+ while ((match = regex.url.exec(text)) !== null) {
119
+ const start = from + match.index;
120
+ const end = start + match[0].length;
121
+ decorations.push({
122
+ from: start,
123
+ to: end,
124
+ decoration: Decoration.mark({ class: mx('dx-tag--blue', tagPadding) }),
125
+ });
126
+ }
127
+ }
128
+
129
+ // Match brackets: {{ and }}.
130
+ {
131
+ let match;
132
+ while ((match = regex.brackets.exec(text)) !== null) {
133
+ const start = from + match.index;
134
+ const end = start + match[0].length;
135
+ decorations.push({
136
+ from: start,
137
+ to: end,
138
+ decoration: Decoration.mark({ class: 'text-subdued' }),
139
+ });
140
+ }
141
+ }
142
+
143
+ // Match commands: {{#command}} and {{/command}}.
144
+ {
145
+ let match;
146
+ while ((match = regex.command.exec(text)) !== null) {
147
+ const start = from + match.index + 2;
148
+ let end = start + match[0].length - 4;
149
+ const text = view.state.doc.sliceString(start, end);
150
+ const parts = text.split(/\s+/);
151
+ if (parts.length > 1) {
152
+ const idx = start + parts[0].length;
153
+ decorations.push({
154
+ from: idx,
155
+ to: end,
156
+ decoration: Decoration.mark({ class: 'text-greenText' }),
157
+ });
158
+ end = idx;
159
+ }
160
+ decorations.push({
161
+ from: start,
162
+ to: end,
163
+ decoration: Decoration.mark({ class: 'text-blueText' }),
164
+ });
165
+ }
166
+ }
167
+
168
+ // Match variables: {{var}}.
169
+ {
170
+ let match;
171
+ while ((match = regex.var.exec(text)) !== null) {
172
+ const start = from + match.index + 2;
173
+ const end = start + match[0].length - 4;
174
+ decorations.push({
175
+ from: start,
176
+ to: end,
177
+ decoration: Decoration.mark({ class: 'text-greenText' }),
178
+ });
179
+ }
180
+ }
181
+ }
182
+
183
+ // Sort decorations by position to satisfy RangeSetBuilder requirements.
184
+ decorations.sort((a, b) => a.from - b.from || a.to - b.to);
185
+
186
+ // Add sorted decorations to builder.
187
+ const builder = new RangeSetBuilder<Decoration>();
188
+ for (const { from, to, decoration } of decorations) {
189
+ builder.add(from, to, decoration);
190
+ }
191
+
192
+ return builder.finish();
193
+ }
194
+ },
195
+ {
196
+ decorations: (v) => v.decorations,
197
+ },
198
+ );
199
+
200
+ class DXNWidget extends WidgetType {
201
+ constructor(private readonly _identifier: string) {
202
+ super();
203
+ }
204
+
205
+ override ignoreEvent() {
206
+ return false;
207
+ }
208
+
209
+ override eq(other: this) {
210
+ return this._identifier === other._identifier;
211
+ }
212
+
213
+ override toDOM() {
214
+ const text = this._identifier
215
+ .split(':')
216
+ .map((part) => {
217
+ const len = 16;
218
+ const plen = 4;
219
+ if (part.length > len) {
220
+ return `[${part.slice(0, plen)}…${part.slice(-plen)}]`;
221
+ }
222
+ return part;
223
+ })
224
+ .join(':');
225
+ return Domino.of('span').classNames(['font-mono dx-tag--blue', tagPadding]).text(text).build();
226
+ }
227
+ }
228
+
229
+ // TODO(burdon): Pass in variables.
230
+ const variables = ['this'];
231
+ const commands = ['this', 'each', 'if', 'unless', 'with'];
232
+
233
+ /**
234
+ * Provides completions for Handlebars variables.
235
+ */
236
+ function handlebarsCompletions(context: CompletionContext): CompletionResult | null {
237
+ const match = context.matchBefore(/\{\{[^}]*/);
238
+ if (!match || match.from === match.to) {
239
+ return null;
240
+ }
241
+
242
+ let type = 'variable';
243
+ let text = match.text.slice(2);
244
+ let from = match.from + 2;
245
+ let matches = [];
246
+ if (text.startsWith('#') || text.startsWith('/')) {
247
+ const idx = text.lastIndexOf(' ');
248
+ if (idx !== -1) {
249
+ type = 'variable';
250
+ matches = variables;
251
+ text = text.slice(idx + 1);
252
+ from += idx + 1;
253
+ } else {
254
+ type = 'command';
255
+ text = text.slice(1);
256
+ matches = commands;
257
+ from += 1;
258
+ }
259
+ } else {
260
+ type = 'variable';
261
+ matches = variables;
262
+ }
263
+
264
+ const options = matches.filter((name) => name.startsWith(text)).map((name) => ({ type, label: name }));
265
+ return {
266
+ from,
267
+ options,
268
+ };
269
+ }
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './handlebars-extension';
6
+ export * from './xml-extension';
@@ -0,0 +1,64 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { syntaxTree } from '@codemirror/language';
6
+ import { type Extension, RangeSetBuilder } from '@codemirror/state';
7
+ import { Decoration, type DecorationSet, type EditorView, ViewPlugin, type ViewUpdate } from '@codemirror/view';
8
+
9
+ export type XmlOptions = {};
10
+
11
+ /**
12
+ * XML decorator plugin for CodeMirror.
13
+ * Decorates XML tags with monospace font using the XML language grammar.
14
+ */
15
+ export const xmlDecorator = (_: XmlOptions = {}): Extension => {
16
+ return [xmlDecoratorPlugin];
17
+ };
18
+
19
+ /**
20
+ * ViewPlugin that decorates XML tags using syntax tree.
21
+ */
22
+ const xmlDecoratorPlugin = ViewPlugin.fromClass(
23
+ class {
24
+ decorations: DecorationSet;
25
+
26
+ constructor(view: EditorView) {
27
+ this.decorations = this.buildDecorations(view);
28
+ }
29
+
30
+ update(update: ViewUpdate) {
31
+ if (update.docChanged || update.viewportChanged) {
32
+ this.decorations = this.buildDecorations(update.view);
33
+ }
34
+ }
35
+
36
+ buildDecorations(view: EditorView) {
37
+ const builder = new RangeSetBuilder<Decoration>();
38
+
39
+ for (const { from, to } of view.visibleRanges) {
40
+ syntaxTree(view.state).iterate({
41
+ from,
42
+ to,
43
+ enter: (node) => {
44
+ // Decorate XML elements (opening tags, closing tags, self-closing tags).
45
+ if (
46
+ node.name === 'HTMLTag' ||
47
+ node.name === 'OpenTag' ||
48
+ node.name === 'CloseTag' ||
49
+ node.name === 'SelfClosingTag' ||
50
+ node.name === 'Element'
51
+ ) {
52
+ builder.add(node.from, node.to, Decoration.mark({ class: 'font-mono text-subdued' }));
53
+ }
54
+ },
55
+ });
56
+ }
57
+
58
+ return builder.finish();
59
+ }
60
+ },
61
+ {
62
+ decorations: (v) => v.decorations,
63
+ },
64
+ );
@@ -2,48 +2,33 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { type AiTool } from '@effect/ai';
6
- import React, { useEffect, useMemo, useRef, useState } from 'react';
5
+ import type * as Tool from '@effect/ai/Tool';
6
+ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
7
 
8
- import { type AgentStatus } from '@dxos/ai';
9
8
  import { useTranslation } from '@dxos/react-ui';
10
- import { NumericTabs, TextCrawl, ToggleContainer } from '@dxos/react-ui-components';
9
+ import { NumericTabs, TextCrawl, ToggleContainer, type ToggleContainerRootProps } from '@dxos/react-ui-components';
10
+ import { type XmlWidgetProps } from '@dxos/react-ui-editor';
11
11
  import { Json } from '@dxos/react-ui-syntax-highlighter';
12
- import { type ContentBlock, type DataType } from '@dxos/schema';
13
- import { isNonNullable, isNotFalsy } from '@dxos/util';
14
- import { safeParseJson } from '@dxos/util';
12
+ import { type ContentBlock, type Message } from '@dxos/types';
13
+ import { isNonNullable, safeParseJson } from '@dxos/util';
15
14
 
16
15
  import { meta } from '../../meta';
17
16
 
18
- import { styles } from './ChatMessage';
19
-
20
- export const isToolMessage = (message: DataType.Message) => {
21
- return message.blocks.some((block) => block._tag === 'toolCall' || block._tag === 'toolResult');
17
+ export const isToolMessage = (message: Message.Message) => {
18
+ return message.blocks.some((block: ContentBlock.Any) => block._tag === 'toolCall' || block._tag === 'toolResult');
22
19
  };
23
20
 
24
- export type AiToolProvider = () => readonly AiTool.Any[];
25
-
26
- export type ToolBlockProps = {
27
- message: DataType.Message;
28
- toolProvider: AiToolProvider;
29
- };
21
+ export type ToolBlockProps = XmlWidgetProps<{
22
+ blocks: ContentBlock.Any[];
23
+ }>;
30
24
 
31
- // TODO(burdon): Pass in blocks.
32
- export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
25
+ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
33
26
  const { t } = useTranslation(meta.id);
34
- const { blocks = [] } = message;
35
-
36
- const getToolCaption = (tool?: AiTool.Any, status?: AgentStatus) => {
37
- if (!tool) {
38
- return t('calling tool label');
39
- }
40
-
41
- return status?.message ?? tool.description ?? [t('calling label'), tool.name].join(' ');
42
- };
43
27
 
44
- const items = useMemo(() => {
45
- let lastToolCall: { tool: AiTool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
46
- const tools = toolProvider();
28
+ const items = useMemo<ToolContainerParams['items']>(() => {
29
+ let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
30
+ // TODO(burdon): Get from context?
31
+ const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
47
32
  return blocks
48
33
  .filter((block) => block._tag === 'toolCall' || block._tag === 'toolResult' || block._tag === 'summary')
49
34
  .map((block) => {
@@ -56,7 +41,7 @@ export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
56
41
  const tool = tools.find((tool) => tool.name === block.name);
57
42
  lastToolCall = { tool, block };
58
43
  return {
59
- title: getToolCaption(lastToolCall?.tool),
44
+ title: tool?.description ?? [t('tool call label'), tool?.name].join(' '),
60
45
  content: {
61
46
  ...block,
62
47
  input: safeParseJson(block.input),
@@ -68,12 +53,13 @@ export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
68
53
  // TODO(burdon): Parse error type.
69
54
  if (block.error) {
70
55
  return {
71
- title: t('error label'),
56
+ title: t('tool error label'),
72
57
  content: block,
73
58
  };
74
59
  }
75
60
 
76
- const title = getToolCaption(lastToolCall?.tool ?? t('tool result label'));
61
+ const title =
62
+ lastToolCall?.tool?.description ?? [t('tool result label'), lastToolCall?.tool?.name].join(' ');
77
63
  lastToolCall = undefined;
78
64
  return {
79
65
  title,
@@ -99,42 +85,52 @@ export const ToolBlock = ({ message, toolProvider }: ToolBlockProps) => {
99
85
  .filter(isNonNullable);
100
86
  }, [blocks]);
101
87
 
102
- return <ToolContainer items={items} />;
88
+ const handleChangeOpen = useCallback(() => {
89
+ setTimeout(() => {
90
+ // Measure after animation.
91
+ view?.requestMeasure();
92
+ }, 1_000);
93
+ }, [view]);
94
+
95
+ if (!items.length) {
96
+ return null;
97
+ }
98
+
99
+ return <ToolContainer items={items} onChangeOpen={handleChangeOpen} />;
103
100
  };
104
101
 
102
+ ToolBlock.displayName = 'ToolBlock';
103
+
105
104
  type ToolContainerParams = {
106
105
  items: { title: string; content: any }[];
107
- };
106
+ } & Pick<ToggleContainerRootProps, 'onChangeOpen'>;
108
107
 
109
- export const ToolContainer = ({ items }: ToolContainerParams) => {
108
+ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
110
109
  const tabsRef = useRef<HTMLDivElement>(null);
111
110
  const [selected, setSelected] = useState(0);
112
111
  const [open, setOpen] = useState(false);
112
+
113
113
  useEffect(() => {
114
+ onChangeOpen?.(open);
114
115
  if (open) {
115
116
  tabsRef.current?.focus();
116
117
  }
117
- }, [open]);
118
+ }, [open, onChangeOpen]);
118
119
 
119
120
  const handleSelect = (index: number) => {
120
121
  setSelected(index);
121
122
  };
122
123
 
123
- const title = useMemo(() => {
124
- const lines = items.map((item) => item.title).filter(isNotFalsy);
125
- return <TextCrawl key='status-roll' lines={lines} autoAdvance />;
126
- }, [items]);
127
-
128
- const data = items[selected].content;
129
-
130
124
  return (
131
- <ToggleContainer.Root classNames={styles.panel} open={open} onChangeOpen={setOpen}>
132
- <ToggleContainer.Header classNames={styles.panelHeader} title={title} />
133
- <ToggleContainer.Content classNames={['grid grid-cols-[32px_1fr]', styles.panelContent]}>
125
+ <ToggleContainer.Root classNames='mbs-2 is-full rounded-sm' open={open} onChangeOpen={setOpen}>
126
+ <ToggleContainer.Header classNames='text-sm text-placeholder'>
127
+ <TextCrawl key='status-roll' lines={items.map((item) => item.title)} autoAdvance greedy />
128
+ </ToggleContainer.Header>
129
+ <ToggleContainer.Content classNames='grid grid-cols-[32px_1fr]'>
134
130
  <NumericTabs ref={tabsRef} classNames='p-1' length={items.length} selected={selected} onSelect={handleSelect} />
135
131
  <Json
136
- data={data}
137
- classNames={styles.json}
132
+ data={items[selected]?.content}
133
+ classNames='p-1 text-xs bg-transparent'
138
134
  replacer={{
139
135
  maxDepth: 3,
140
136
  maxArrayLen: 10,
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export const ToolBlockWidget = () => {};
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './ToolBlock';
6
+ export * from './ToolBlockWidget';
@@ -2,27 +2,25 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
10
8
  import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
11
9
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { capabilities } from '@dxos/assistant-testing';
10
+ import { capabilities } from '@dxos/assistant-toolkit';
13
11
  import { ChessPlugin } from '@dxos/plugin-chess';
14
12
  import { ClientPlugin } from '@dxos/plugin-client';
15
13
  import { MapPlugin } from '@dxos/plugin-map';
16
14
  import { SpacePlugin } from '@dxos/plugin-space';
17
15
  import { TablePlugin } from '@dxos/plugin-table';
18
- import { withLayout, withTheme } from '@dxos/storybook-utils';
16
+ import { withTheme } from '@dxos/react-ui/testing';
19
17
 
20
18
  import { translations } from '../../translations';
21
19
 
22
20
  import { Toolbox, type ToolboxProps } from './Toolbox';
23
21
 
24
22
  const DefaultStory = (props: ToolboxProps) => {
25
- return <Toolbox {...props} classNames='w-[30rem] h-[15rem] rounded-sm border border-separator py-1' />;
23
+ return <Toolbox {...props} classNames='is-[30rem] bs-[15rem] rounded-sm border border-separator plb-1' />;
26
24
  };
27
25
 
28
26
  const meta = {
@@ -30,6 +28,7 @@ const meta = {
30
28
  component: Toolbox as any,
31
29
  render: DefaultStory,
32
30
  decorators: [
31
+ withTheme,
33
32
  withPluginManager({
34
33
  plugins: [
35
34
  ClientPlugin({
@@ -37,7 +36,7 @@ const meta = {
37
36
  await client.halo.createIdentity();
38
37
  },
39
38
  }),
40
- SpacePlugin(),
39
+ SpacePlugin({}),
41
40
  SettingsPlugin(),
42
41
  IntentPlugin(),
43
42
  ChessPlugin(),
@@ -46,8 +45,6 @@ const meta = {
46
45
  ],
47
46
  capabilities,
48
47
  }),
49
- withTheme,
50
- withLayout(),
51
48
  ],
52
49
  parameters: {
53
50
  layout: 'centered',
@@ -6,7 +6,7 @@ import React, { type FC, Fragment, useEffect, useState } from 'react';
6
6
 
7
7
  import { type Blueprint } from '@dxos/blueprints';
8
8
  import { type Ref } from '@dxos/echo';
9
- import { FunctionType } from '@dxos/functions';
9
+ import { Function } from '@dxos/functions';
10
10
  import { log } from '@dxos/log';
11
11
  import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
12
12
  import { type ThemedClassName } from '@dxos/react-ui';
@@ -19,7 +19,7 @@ import { ServiceType } from '../../types';
19
19
 
20
20
  export type ToolboxProps = ThemedClassName<{
21
21
  services?: { service: ServiceType }[];
22
- functions?: FunctionType[];
22
+ functions?: Function.Function[];
23
23
  // TODO(burdon): Combine into single array.
24
24
  blueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
25
25
  activeBlueprints?: readonly Ref.Ref<Blueprint.Blueprint>[];
@@ -77,11 +77,11 @@ const Section: FC<{
77
77
  }> = ({ title, items, striped }) => {
78
78
  const stripeClassNames = 'odd:bg-neutral-50 dark:odd:bg-neutral-800';
79
79
  const gridClassNames = 'grid grid-cols-[8rem_1fr]';
80
- const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs px-2', striped && stripeClassNames);
80
+ const subGridClassNames = mx('col-span-full grid grid-cols-subgrid text-xs pli-2', striped && stripeClassNames);
81
81
 
82
82
  return (
83
83
  <div>
84
- <h1 className='px-2 text-sm'>{title}</h1>
84
+ <h1 className='pli-2 text-sm'>{title}</h1>
85
85
  <div className={gridClassNames}>
86
86
  {items.map(({ name, description, subitems }, i) => (
87
87
  <Fragment key={i}>
@@ -125,7 +125,7 @@ export const ToolboxContainer = ({ classNames, space, processor }: ToolboxContai
125
125
  }, [services]);
126
126
 
127
127
  // Deployed functions.
128
- const functions = useQuery(space, Filter.type(FunctionType));
128
+ const functions = useQuery(space, Filter.type(Function.Function));
129
129
 
130
130
  return (
131
131
  <Toolbox
@@ -6,14 +6,11 @@ import { lazy } from 'react';
6
6
 
7
7
  export * from './AssistantSettings';
8
8
  export * from './Chat';
9
- export * from './ChatProgress';
10
- export * from './PromptSettings';
11
9
  export * from './TemplateEditor';
12
- export * from './Toolbar';
13
10
  export * from './Toolbox';
14
11
 
15
- export const BlueprintContainer = lazy(() => import('./BlueprintContainer'));
12
+ export const BlueprintArticle = lazy(() => import('./BlueprintArticle'));
16
13
  export const ChatCompanion = lazy(() => import('./ChatCompanion'));
17
14
  export const ChatContainer = lazy(() => import('./ChatContainer'));
18
15
  export const ChatDialog = lazy(() => import('./ChatDialog'));
19
- export const SequenceContainer = lazy(() => import('./SequenceContainer'));
16
+ export const PromptArticle = lazy(() => import('./PromptArticle'));
@@ -2,19 +2,21 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Effect, Schema } from 'effect';
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Schema from 'effect/Schema';
6
7
 
7
8
  import { defineFunction } from '@dxos/functions';
8
9
  import { log } from '@dxos/log';
9
10
 
10
11
  export default defineFunction({
11
- name: 'dxos.org/function/assistant-analysis',
12
+ key: 'dxos.org/function/assistant-analysis',
13
+ name: 'Assistant analysis',
12
14
  description: 'Enter analysis analysis mode.',
13
15
  inputSchema: Schema.Struct({
14
16
  enable: Schema.Boolean.annotations({ description: 'Enable or disable analysis mode.' }),
15
17
  }),
16
18
  outputSchema: Schema.Void,
17
19
  handler: Effect.fn(function* ({ context, data: { enable } }) {
18
- log.info('analysis mode', { space: context.space?.id, enable });
20
+ log.info('analysis mode', { enable });
19
21
  }),
20
22
  });
@@ -3,5 +3,5 @@
3
3
  //
4
4
 
5
5
  export { default as analysis } from './analysis';
6
- export { default as list } from './list';
7
- export { default as load } from './load';
6
+ export { default as list } from './object-list';
7
+ export { default as load } from './object-load';