@dxos/plugin-assistant 0.8.4-main.72ec0f3 → 0.8.4-main.937b3ca

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 (462) hide show
  1. package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs +31 -0
  2. package/dist/lib/browser/BlueprintArticle-WP3G5GLG.mjs.map +7 -0
  3. package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs +153 -0
  4. package/dist/lib/browser/ChatCompanion-GFSJZTOT.mjs.map +7 -0
  5. package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs +72 -0
  6. package/dist/lib/browser/ChatContainer-IHAPBIZE.mjs.map +7 -0
  7. package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs +85 -0
  8. package/dist/lib/browser/ChatDialog-EGRMPCTL.mjs.map +7 -0
  9. package/dist/lib/browser/PromptArticle-K362ZPAE.mjs +53 -0
  10. package/dist/lib/browser/PromptArticle-K362ZPAE.mjs.map +7 -0
  11. package/dist/lib/browser/ai-service-5GUDOEWF.mjs +21 -0
  12. package/dist/lib/browser/ai-service-5GUDOEWF.mjs.map +7 -0
  13. package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs +212 -0
  14. package/dist/lib/browser/app-graph-builder-DSNH2OMY.mjs.map +7 -0
  15. package/dist/lib/browser/blueprint-definition-DGHH7MUU.mjs +14 -0
  16. package/dist/lib/browser/blueprints/index.mjs +12 -0
  17. package/dist/lib/browser/chunk-A75V4MOQ.mjs +1832 -0
  18. package/dist/lib/browser/chunk-A75V4MOQ.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-FJQ4ZRYJ.mjs → chunk-DKQMSMBN.mjs} +55 -64
  20. package/dist/lib/browser/chunk-DKQMSMBN.mjs.map +7 -0
  21. package/dist/lib/browser/{chunk-WBG5PTSX.mjs → chunk-EXVT7D4B.mjs} +1 -1
  22. package/dist/lib/browser/chunk-EXVT7D4B.mjs.map +7 -0
  23. package/dist/lib/browser/{chunk-2BOE3OTW.mjs → chunk-ML3QCFKA.mjs} +23 -20
  24. package/dist/lib/browser/chunk-ML3QCFKA.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-MRJVYGLU.mjs +208 -0
  26. package/dist/lib/browser/chunk-MRJVYGLU.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-V772AMZM.mjs +250 -0
  28. package/dist/lib/browser/chunk-V772AMZM.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-WGQTU6UJ.mjs +41 -0
  30. package/dist/lib/browser/chunk-WGQTU6UJ.mjs.map +7 -0
  31. package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs +20 -0
  32. package/dist/lib/browser/edge-model-resolver-26BOY6HY.mjs.map +7 -0
  33. package/dist/lib/browser/index.mjs +167 -193
  34. package/dist/lib/browser/index.mjs.map +4 -4
  35. package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs +19 -0
  36. package/dist/lib/browser/local-model-resolver-ZFIM6GGV.mjs.map +7 -0
  37. package/dist/lib/browser/meta.json +1 -1
  38. package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs +132 -0
  39. package/dist/lib/browser/operation-resolver-7XJLBRQY.mjs.map +7 -0
  40. package/dist/lib/browser/{react-surface-YCSR2MSR.mjs → react-surface-S7SBFOSW.mjs} +41 -30
  41. package/dist/lib/browser/react-surface-S7SBFOSW.mjs.map +7 -0
  42. package/dist/lib/browser/repair-6QGAKOVM.mjs +54 -0
  43. package/dist/lib/browser/repair-6QGAKOVM.mjs.map +7 -0
  44. package/dist/lib/browser/settings-4ZDLUMYE.mjs +32 -0
  45. package/dist/lib/browser/settings-4ZDLUMYE.mjs.map +7 -0
  46. package/dist/lib/browser/state-AN6336ZX.mjs +26 -0
  47. package/dist/lib/browser/state-AN6336ZX.mjs.map +7 -0
  48. package/dist/lib/browser/toolkit-7AVTEPMA.mjs +18 -0
  49. package/dist/lib/browser/toolkit-7AVTEPMA.mjs.map +7 -0
  50. package/dist/lib/browser/types/index.mjs +8 -4
  51. package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs +32 -0
  52. package/dist/lib/node-esm/BlueprintArticle-WZ76E2C4.mjs.map +7 -0
  53. package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs +154 -0
  54. package/dist/lib/node-esm/ChatCompanion-UR7DXZ54.mjs.map +7 -0
  55. package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs +73 -0
  56. package/dist/lib/node-esm/ChatContainer-YMLLGOZK.mjs.map +7 -0
  57. package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs +86 -0
  58. package/dist/lib/node-esm/ChatDialog-D24WJPK4.mjs.map +7 -0
  59. package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs +54 -0
  60. package/dist/lib/node-esm/PromptArticle-D4HAIIC6.mjs.map +7 -0
  61. package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs +22 -0
  62. package/dist/lib/node-esm/ai-service-PXKKCFIF.mjs.map +7 -0
  63. package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs +213 -0
  64. package/dist/lib/node-esm/app-graph-builder-TJCUEXW5.mjs.map +7 -0
  65. package/dist/lib/node-esm/{blueprint-definition-XW6QQVLV.mjs → blueprint-definition-SEMDEIYG.mjs} +6 -4
  66. package/dist/lib/node-esm/blueprint-definition-SEMDEIYG.mjs.map +7 -0
  67. package/dist/lib/node-esm/blueprints/index.mjs +13 -0
  68. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-355W5B27.mjs +251 -0
  70. package/dist/lib/node-esm/chunk-355W5B27.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-4BERCIES.mjs +1833 -0
  72. package/dist/lib/node-esm/chunk-4BERCIES.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-KJGD4EBJ.mjs → chunk-75PHXBN3.mjs} +55 -64
  74. package/dist/lib/node-esm/chunk-75PHXBN3.mjs.map +7 -0
  75. package/dist/lib/node-esm/chunk-DCA5QWQT.mjs +209 -0
  76. package/dist/lib/node-esm/chunk-DCA5QWQT.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs +42 -0
  78. package/dist/lib/node-esm/chunk-MSBPC4RJ.mjs.map +7 -0
  79. package/dist/lib/node-esm/{chunk-WE6KTH72.mjs → chunk-POWB2BPC.mjs} +1 -1
  80. package/dist/lib/node-esm/chunk-POWB2BPC.mjs.map +7 -0
  81. package/dist/lib/node-esm/{chunk-3Q22TTXW.mjs → chunk-ZRIPP7YF.mjs} +23 -20
  82. package/dist/lib/node-esm/chunk-ZRIPP7YF.mjs.map +7 -0
  83. package/dist/lib/node-esm/{edge-model-resolver-2ARXDOYS.mjs → edge-model-resolver-G5KMODPO.mjs} +9 -7
  84. package/dist/lib/node-esm/edge-model-resolver-G5KMODPO.mjs.map +7 -0
  85. package/dist/lib/node-esm/index.mjs +167 -193
  86. package/dist/lib/node-esm/index.mjs.map +4 -4
  87. package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs +20 -0
  88. package/dist/lib/node-esm/local-model-resolver-KDZLYI7Y.mjs.map +7 -0
  89. package/dist/lib/node-esm/meta.json +1 -1
  90. package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs +133 -0
  91. package/dist/lib/node-esm/operation-resolver-SX4WMNA7.mjs.map +7 -0
  92. package/dist/lib/node-esm/{react-surface-CTW44GEM.mjs → react-surface-ZR6FXGLF.mjs} +41 -30
  93. package/dist/lib/node-esm/react-surface-ZR6FXGLF.mjs.map +7 -0
  94. package/dist/lib/node-esm/repair-QJ7CQDKU.mjs +55 -0
  95. package/dist/lib/node-esm/repair-QJ7CQDKU.mjs.map +7 -0
  96. package/dist/lib/node-esm/settings-CQEOHR3R.mjs +33 -0
  97. package/dist/lib/node-esm/settings-CQEOHR3R.mjs.map +7 -0
  98. package/dist/lib/node-esm/state-HDON4REW.mjs +27 -0
  99. package/dist/lib/node-esm/state-HDON4REW.mjs.map +7 -0
  100. package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs +19 -0
  101. package/dist/lib/node-esm/toolkit-OWGCEKOO.mjs.map +7 -0
  102. package/dist/lib/node-esm/types/index.mjs +8 -4
  103. package/dist/types/src/AssistantPlugin.d.ts +2 -1
  104. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  105. package/dist/types/src/blueprints/assistant-blueprint.d.ts +209 -0
  106. package/dist/types/src/blueprints/assistant-blueprint.d.ts.map +1 -0
  107. package/dist/types/src/blueprints/index.d.ts +7 -0
  108. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/ai-service/ai-service.d.ts +5 -0
  110. package/dist/types/src/capabilities/ai-service/ai-service.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/ai-service/index.d.ts +3 -0
  112. package/dist/types/src/capabilities/ai-service/index.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  114. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  115. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  116. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +21 -0
  118. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +4 -0
  120. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts +6 -0
  122. package/dist/types/src/capabilities/edge-model-resolver/edge-model-resolver.d.ts.map +1 -0
  123. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts +3 -0
  124. package/dist/types/src/capabilities/edge-model-resolver/index.d.ts.map +1 -0
  125. package/dist/types/src/capabilities/index.d.ts +10 -11
  126. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  127. package/dist/types/src/capabilities/local-model-resolver/index.d.ts +3 -0
  128. package/dist/types/src/capabilities/local-model-resolver/index.d.ts.map +1 -0
  129. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts +12 -0
  130. package/dist/types/src/capabilities/local-model-resolver/local-model-resolver.d.ts.map +1 -0
  131. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  132. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  133. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  134. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  135. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  136. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  137. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  138. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  139. package/dist/types/src/capabilities/repair/index.d.ts +3 -0
  140. package/dist/types/src/capabilities/repair/index.d.ts.map +1 -0
  141. package/dist/types/src/capabilities/repair/repair.d.ts +6 -0
  142. package/dist/types/src/capabilities/repair/repair.d.ts.map +1 -0
  143. package/dist/types/src/capabilities/settings/index.d.ts +15 -0
  144. package/dist/types/src/capabilities/settings/index.d.ts.map +1 -0
  145. package/dist/types/src/capabilities/settings/settings.d.ts +17 -0
  146. package/dist/types/src/capabilities/settings/settings.d.ts.map +1 -0
  147. package/dist/types/src/capabilities/state/index.d.ts +11 -0
  148. package/dist/types/src/capabilities/state/index.d.ts.map +1 -0
  149. package/dist/types/src/capabilities/state/state.d.ts +13 -0
  150. package/dist/types/src/capabilities/state/state.d.ts.map +1 -0
  151. package/dist/types/src/capabilities/toolkit/index.d.ts +3 -0
  152. package/dist/types/src/capabilities/toolkit/index.d.ts.map +1 -0
  153. package/dist/types/src/capabilities/toolkit/toolkit.d.ts +5 -0
  154. package/dist/types/src/capabilities/toolkit/toolkit.d.ts.map +1 -0
  155. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts +4 -2
  156. package/dist/types/src/components/AssistantSettings/AssistantSettings.d.ts.map +1 -1
  157. package/dist/types/src/components/BlueprintArticle.d.ts +1 -1
  158. package/dist/types/src/components/BlueprintArticle.d.ts.map +1 -1
  159. package/dist/types/src/components/Chat/Chat.d.ts +9 -10
  160. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  161. package/dist/types/src/components/Chat/events.d.ts +1 -1
  162. package/dist/types/src/components/Chat/events.d.ts.map +1 -1
  163. package/dist/types/src/components/ChatCompanion.d.ts +2 -2
  164. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
  165. package/dist/types/src/components/ChatContainer.d.ts +10 -5
  166. package/dist/types/src/components/ChatContainer.d.ts.map +1 -1
  167. package/dist/types/src/components/ChatDialog.d.ts.map +1 -1
  168. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  169. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts +3 -3
  170. package/dist/types/src/components/ChatPrompt/ChatOptions.d.ts.map +1 -1
  171. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts +3 -3
  172. package/dist/types/src/components/ChatPrompt/ChatReferences.d.ts.map +1 -1
  173. package/dist/types/src/components/ChatThread/ChatThread.d.ts +1 -1
  174. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  175. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +9 -3
  176. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  177. package/dist/types/src/components/ChatThread/registry.d.ts +1 -1
  178. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -1
  179. package/dist/types/src/components/ChatThread/sync.d.ts +1 -1
  180. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -1
  181. package/dist/types/src/components/PromptArticle.d.ts +1 -1
  182. package/dist/types/src/components/PromptArticle.d.ts.map +1 -1
  183. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  184. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +5 -0
  185. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  186. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +11 -1
  187. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  188. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +6 -1
  189. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  190. package/dist/types/src/components/TemplateEditor/extensions/handlebars-extension.d.ts.map +1 -1
  191. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +3 -3
  192. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -1
  193. package/dist/types/src/components/Toolbox/Toolbox.d.ts +4 -5
  194. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  195. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +5 -0
  196. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  197. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts +12 -0
  198. package/dist/types/src/components/Typewriter/AssistantToolbar.d.ts.map +1 -0
  199. package/dist/types/src/components/Typewriter/Typewriter.d.ts +11 -0
  200. package/dist/types/src/components/Typewriter/Typewriter.d.ts.map +1 -0
  201. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts +7 -0
  202. package/dist/types/src/components/Typewriter/Typewriter.stories.d.ts.map +1 -0
  203. package/dist/types/src/components/Typewriter/assistant-extension.d.ts +5 -0
  204. package/dist/types/src/components/Typewriter/assistant-extension.d.ts.map +1 -0
  205. package/dist/types/src/components/Typewriter/index.d.ts +2 -0
  206. package/dist/types/src/components/Typewriter/index.d.ts.map +1 -0
  207. package/dist/types/src/components/index.d.ts +10 -4
  208. package/dist/types/src/components/index.d.ts.map +1 -1
  209. package/dist/types/src/functions/index.d.ts +1 -1
  210. package/dist/types/src/functions/index.d.ts.map +1 -1
  211. package/dist/types/src/functions/object-list.d.ts +1 -1
  212. package/dist/types/src/functions/object-list.d.ts.map +1 -1
  213. package/dist/types/src/functions/object-load.d.ts.map +1 -1
  214. package/dist/types/src/functions/object-search.d.ts +10 -0
  215. package/dist/types/src/functions/object-search.d.ts.map +1 -0
  216. package/dist/types/src/hooks/index.d.ts +1 -1
  217. package/dist/types/src/hooks/index.d.ts.map +1 -1
  218. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +5 -5
  219. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  220. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  221. package/dist/types/src/hooks/useChatServices.d.ts +3 -3
  222. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  223. package/dist/types/src/hooks/useChatToolbarActions.d.ts +1 -1
  224. package/dist/types/src/hooks/useChatToolbarActions.d.ts.map +1 -1
  225. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  226. package/dist/types/src/hooks/useContextObjects.d.ts +7 -7
  227. package/dist/types/src/hooks/useContextObjects.d.ts.map +1 -1
  228. package/dist/types/src/hooks/useFilteredTypes.d.ts +3 -0
  229. package/dist/types/src/hooks/useFilteredTypes.d.ts.map +1 -0
  230. package/dist/types/src/index.d.ts +0 -1
  231. package/dist/types/src/index.d.ts.map +1 -1
  232. package/dist/types/src/meta.d.ts +2 -2
  233. package/dist/types/src/meta.d.ts.map +1 -1
  234. package/dist/types/src/processor/processor.d.ts +10 -9
  235. package/dist/types/src/processor/processor.d.ts.map +1 -1
  236. package/dist/types/src/processor/update-name.d.ts.map +1 -1
  237. package/dist/types/src/queue-logger.d.ts.map +1 -1
  238. package/dist/types/src/testing/test-generator.d.ts +3 -2
  239. package/dist/types/src/testing/test-generator.d.ts.map +1 -1
  240. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  241. package/dist/types/src/translations.d.ts +5 -0
  242. package/dist/types/src/translations.d.ts.map +1 -1
  243. package/dist/types/src/types/Assistant.d.ts +16 -22
  244. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  245. package/dist/types/src/types/AssistantAction.d.ts +88 -125
  246. package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
  247. package/dist/types/src/types/capabilities.d.ts +33 -0
  248. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  249. package/dist/types/src/types/events.d.ts +5 -0
  250. package/dist/types/src/types/events.d.ts.map +1 -0
  251. package/dist/types/src/types/index.d.ts +3 -1
  252. package/dist/types/src/types/index.d.ts.map +1 -1
  253. package/dist/types/src/types/service.d.ts +10 -218
  254. package/dist/types/src/types/service.d.ts.map +1 -1
  255. package/dist/types/tsconfig.tsbuildinfo +1 -1
  256. package/package.json +113 -92
  257. package/src/AssistantPlugin.tsx +64 -113
  258. package/src/blueprints/assistant-blueprint.ts +62 -0
  259. package/src/blueprints/index.ts +12 -0
  260. package/src/capabilities/ai-service/ai-service.ts +29 -0
  261. package/src/capabilities/ai-service/index.ts +7 -0
  262. package/src/capabilities/app-graph-builder/app-graph-builder.ts +180 -0
  263. package/src/capabilities/app-graph-builder/index.ts +7 -0
  264. package/src/capabilities/blueprint-definition/blueprint-definition.ts +60 -0
  265. package/src/capabilities/blueprint-definition/index.ts +8 -0
  266. package/src/capabilities/edge-model-resolver/edge-model-resolver.ts +32 -0
  267. package/src/capabilities/edge-model-resolver/index.ts +7 -0
  268. package/src/capabilities/index.ts +10 -14
  269. package/src/capabilities/local-model-resolver/index.ts +7 -0
  270. package/src/capabilities/local-model-resolver/local-model-resolver.ts +37 -0
  271. package/src/capabilities/operation-resolver/index.ts +7 -0
  272. package/src/capabilities/operation-resolver/operation-resolver.ts +110 -0
  273. package/src/capabilities/react-surface/index.ts +7 -0
  274. package/src/capabilities/react-surface/react-surface.tsx +95 -0
  275. package/src/capabilities/repair/index.ts +7 -0
  276. package/src/capabilities/repair/repair.ts +63 -0
  277. package/src/capabilities/settings/index.ts +7 -0
  278. package/src/capabilities/settings/settings.ts +30 -0
  279. package/src/capabilities/state/index.ts +7 -0
  280. package/src/capabilities/state/state.ts +27 -0
  281. package/src/capabilities/toolkit/index.ts +7 -0
  282. package/src/capabilities/toolkit/toolkit.ts +26 -0
  283. package/src/components/AssistantSettings/AssistantSettings.tsx +13 -5
  284. package/src/components/BlueprintArticle.tsx +4 -4
  285. package/src/components/Chat/Chat.tsx +68 -68
  286. package/src/components/Chat/events.ts +1 -1
  287. package/src/components/ChatCompanion.tsx +125 -117
  288. package/src/components/ChatContainer.tsx +19 -19
  289. package/src/components/ChatDialog.tsx +6 -7
  290. package/src/components/ChatProgress/ChatProgress.tsx +3 -16
  291. package/src/components/ChatPrompt/ChatActions.tsx +1 -1
  292. package/src/components/ChatPrompt/ChatOptions.tsx +69 -59
  293. package/src/components/ChatPrompt/ChatReferences.tsx +5 -6
  294. package/src/components/ChatPrompt/ChatStatusIndicator.tsx +1 -1
  295. package/src/components/ChatThread/ChatThread.stories.tsx +10 -8
  296. package/src/components/ChatThread/ChatThread.tsx +1 -1
  297. package/src/components/ChatThread/Link.tsx +3 -3
  298. package/src/components/ChatThread/registry.tsx +2 -2
  299. package/src/components/ChatThread/sync.test.ts +12 -5
  300. package/src/components/ChatThread/sync.ts +8 -2
  301. package/src/components/PromptArticle.tsx +8 -9
  302. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +2 -2
  303. package/src/components/TemplateEditor/TemplateEditor.tsx +8 -5
  304. package/src/components/TemplateEditor/TemplateForm.stories.tsx +14 -6
  305. package/src/components/TemplateEditor/TemplateForm.tsx +75 -28
  306. package/src/components/TemplateEditor/extensions/handlebars-extension.ts +10 -5
  307. package/src/components/ToolBlock/ToolBlock.tsx +7 -7
  308. package/src/components/Toolbox/Toolbox.stories.tsx +8 -9
  309. package/src/components/Toolbox/Toolbox.tsx +14 -15
  310. package/src/components/Typewriter/AssistantToolbar.tsx +161 -0
  311. package/src/components/Typewriter/Typewriter.stories.tsx +83 -0
  312. package/src/components/Typewriter/Typewriter.tsx +54 -0
  313. package/src/components/Typewriter/assistant-extension.tsx +144 -0
  314. package/src/components/Typewriter/index.ts +5 -0
  315. package/src/functions/index.ts +1 -1
  316. package/src/functions/object-list.ts +4 -3
  317. package/src/functions/object-load.ts +7 -5
  318. package/src/functions/object-search.ts +46 -0
  319. package/src/hooks/index.ts +1 -1
  320. package/src/hooks/useBlueprintRegistry.ts +30 -20
  321. package/src/hooks/useChatProcessor.ts +5 -2
  322. package/src/hooks/useChatServices.ts +11 -15
  323. package/src/hooks/useChatToolbarActions.ts +24 -25
  324. package/src/hooks/useContextBinder.ts +4 -2
  325. package/src/hooks/useContextObjects.ts +13 -25
  326. package/src/hooks/useFilteredTypes.ts +37 -0
  327. package/src/hooks/useReferencesProvider.ts +6 -6
  328. package/src/index.ts +0 -1
  329. package/src/meta.ts +2 -2
  330. package/src/processor/processor.test.ts +3 -2
  331. package/src/processor/processor.ts +23 -25
  332. package/src/processor/update-name.ts +4 -1
  333. package/src/queue-logger.ts +4 -1
  334. package/src/testing/test-generator.ts +4 -3
  335. package/src/testing/test-services.ts +8 -6
  336. package/src/translations.ts +4 -0
  337. package/src/types/Assistant.ts +9 -10
  338. package/src/types/AssistantAction.ts +58 -62
  339. package/src/types/capabilities.ts +27 -0
  340. package/src/types/events.ts +11 -0
  341. package/src/types/index.ts +3 -1
  342. package/src/types/service.ts +10 -7
  343. package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs +0 -36
  344. package/dist/lib/browser/BlueprintArticle-IMCR3642.mjs.map +0 -7
  345. package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs +0 -158
  346. package/dist/lib/browser/ChatCompanion-JYD2RIBJ.mjs.map +0 -7
  347. package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs +0 -77
  348. package/dist/lib/browser/ChatContainer-XCPBWYIR.mjs.map +0 -7
  349. package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs +0 -90
  350. package/dist/lib/browser/ChatDialog-DT7KFCRL.mjs.map +0 -7
  351. package/dist/lib/browser/PromptArticle-45QX25Y5.mjs +0 -59
  352. package/dist/lib/browser/PromptArticle-45QX25Y5.mjs.map +0 -7
  353. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +0 -19
  354. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +0 -7
  355. package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs +0 -199
  356. package/dist/lib/browser/app-graph-builder-VZEXMDTY.mjs.map +0 -7
  357. package/dist/lib/browser/blueprint-definition-5FT5JGPY.mjs +0 -12
  358. package/dist/lib/browser/chunk-2BOE3OTW.mjs.map +0 -7
  359. package/dist/lib/browser/chunk-BNTPFZ7O.mjs +0 -229
  360. package/dist/lib/browser/chunk-BNTPFZ7O.mjs.map +0 -7
  361. package/dist/lib/browser/chunk-FJQ4ZRYJ.mjs.map +0 -7
  362. package/dist/lib/browser/chunk-IXIIS4QA.mjs +0 -176
  363. package/dist/lib/browser/chunk-IXIIS4QA.mjs.map +0 -7
  364. package/dist/lib/browser/chunk-LRE4VEZV.mjs +0 -16
  365. package/dist/lib/browser/chunk-LRE4VEZV.mjs.map +0 -7
  366. package/dist/lib/browser/chunk-U62BTGDF.mjs +0 -1929
  367. package/dist/lib/browser/chunk-U62BTGDF.mjs.map +0 -7
  368. package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +0 -7
  369. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +0 -18
  370. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +0 -7
  371. package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs +0 -143
  372. package/dist/lib/browser/intent-resolver-AK5O4GUW.mjs.map +0 -7
  373. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs +0 -17
  374. package/dist/lib/browser/local-model-resolver-34MVHRKD.mjs.map +0 -7
  375. package/dist/lib/browser/react-surface-YCSR2MSR.mjs.map +0 -7
  376. package/dist/lib/browser/settings-NYJGNQ5I.mjs +0 -23
  377. package/dist/lib/browser/settings-NYJGNQ5I.mjs.map +0 -7
  378. package/dist/lib/browser/state-GG7Z3NB7.mjs +0 -25
  379. package/dist/lib/browser/state-GG7Z3NB7.mjs.map +0 -7
  380. package/dist/lib/browser/toolkit-VYDAWNE4.mjs +0 -17
  381. package/dist/lib/browser/toolkit-VYDAWNE4.mjs.map +0 -7
  382. package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs +0 -37
  383. package/dist/lib/node-esm/BlueprintArticle-OL2HUY6Q.mjs.map +0 -7
  384. package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs +0 -159
  385. package/dist/lib/node-esm/ChatCompanion-AHKJS25S.mjs.map +0 -7
  386. package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs +0 -78
  387. package/dist/lib/node-esm/ChatContainer-K7OGPE3G.mjs.map +0 -7
  388. package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs +0 -91
  389. package/dist/lib/node-esm/ChatDialog-QT6ZBX45.mjs.map +0 -7
  390. package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs +0 -60
  391. package/dist/lib/node-esm/PromptArticle-OUKFSJQV.mjs.map +0 -7
  392. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs +0 -20
  393. package/dist/lib/node-esm/ai-service-MUYLV3NT.mjs.map +0 -7
  394. package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs +0 -200
  395. package/dist/lib/node-esm/app-graph-builder-VRN6ESRR.mjs.map +0 -7
  396. package/dist/lib/node-esm/chunk-3Q22TTXW.mjs.map +0 -7
  397. package/dist/lib/node-esm/chunk-AB74FOA2.mjs +0 -230
  398. package/dist/lib/node-esm/chunk-AB74FOA2.mjs.map +0 -7
  399. package/dist/lib/node-esm/chunk-BHS747K7.mjs +0 -1930
  400. package/dist/lib/node-esm/chunk-BHS747K7.mjs.map +0 -7
  401. package/dist/lib/node-esm/chunk-KJGD4EBJ.mjs.map +0 -7
  402. package/dist/lib/node-esm/chunk-UXTUHH24.mjs +0 -178
  403. package/dist/lib/node-esm/chunk-UXTUHH24.mjs.map +0 -7
  404. package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +0 -7
  405. package/dist/lib/node-esm/chunk-YWFWT57N.mjs +0 -17
  406. package/dist/lib/node-esm/chunk-YWFWT57N.mjs.map +0 -7
  407. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +0 -7
  408. package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs +0 -144
  409. package/dist/lib/node-esm/intent-resolver-L2F3N45L.mjs.map +0 -7
  410. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs +0 -18
  411. package/dist/lib/node-esm/local-model-resolver-TP2NTSAX.mjs.map +0 -7
  412. package/dist/lib/node-esm/react-surface-CTW44GEM.mjs.map +0 -7
  413. package/dist/lib/node-esm/settings-RRHYI5KO.mjs +0 -24
  414. package/dist/lib/node-esm/settings-RRHYI5KO.mjs.map +0 -7
  415. package/dist/lib/node-esm/state-FSUHFMDM.mjs +0 -26
  416. package/dist/lib/node-esm/state-FSUHFMDM.mjs.map +0 -7
  417. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs +0 -18
  418. package/dist/lib/node-esm/toolkit-HFJZLVIR.mjs.map +0 -7
  419. package/dist/types/src/capabilities/ai-service.d.ts +0 -4
  420. package/dist/types/src/capabilities/ai-service.d.ts.map +0 -1
  421. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  422. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  423. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -7
  424. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  425. package/dist/types/src/capabilities/capabilities.d.ts +0 -10
  426. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  427. package/dist/types/src/capabilities/edge-model-resolver.d.ts +0 -4
  428. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +0 -1
  429. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  430. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  431. package/dist/types/src/capabilities/local-model-resolver.d.ts +0 -10
  432. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +0 -1
  433. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  434. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  435. package/dist/types/src/capabilities/settings.d.ts +0 -4
  436. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  437. package/dist/types/src/capabilities/state.d.ts +0 -4
  438. package/dist/types/src/capabilities/state.d.ts.map +0 -1
  439. package/dist/types/src/capabilities/toolkit.d.ts +0 -4
  440. package/dist/types/src/capabilities/toolkit.d.ts.map +0 -1
  441. package/dist/types/src/events.d.ts +0 -4
  442. package/dist/types/src/events.d.ts.map +0 -1
  443. package/dist/types/src/functions/analysis.d.ts +0 -5
  444. package/dist/types/src/functions/analysis.d.ts.map +0 -1
  445. package/dist/types/src/hooks/useItemTypes.d.ts +0 -4
  446. package/dist/types/src/hooks/useItemTypes.d.ts.map +0 -1
  447. package/src/capabilities/ai-service.ts +0 -27
  448. package/src/capabilities/app-graph-builder.ts +0 -210
  449. package/src/capabilities/blueprint-definition.ts +0 -66
  450. package/src/capabilities/capabilities.ts +0 -17
  451. package/src/capabilities/edge-model-resolver.ts +0 -25
  452. package/src/capabilities/intent-resolver.ts +0 -147
  453. package/src/capabilities/local-model-resolver.ts +0 -30
  454. package/src/capabilities/react-surface.tsx +0 -87
  455. package/src/capabilities/settings.ts +0 -19
  456. package/src/capabilities/state.ts +0 -22
  457. package/src/capabilities/toolkit.ts +0 -17
  458. package/src/events.ts +0 -11
  459. package/src/functions/analysis.ts +0 -22
  460. package/src/hooks/useItemTypes.ts +0 -37
  461. /package/dist/lib/browser/{blueprint-definition-5FT5JGPY.mjs.map → blueprint-definition-DGHH7MUU.mjs.map} +0 -0
  462. /package/dist/lib/{node-esm/blueprint-definition-XW6QQVLV.mjs.map → browser/blueprints/index.mjs.map} +0 -0
@@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react';
6
6
 
7
7
  import { type ThemedClassName, Tooltip, useTimeout } from '@dxos/react-ui';
8
8
  import { Spinner, type SpinnerProps } from '@dxos/react-ui-sfx';
9
- import { mx } from '@dxos/react-ui-theme';
9
+ import { mx } from '@dxos/ui-theme';
10
10
 
11
11
  const period = 3_000;
12
12
 
@@ -8,7 +8,9 @@ import * as Fiber from 'effect/Fiber';
8
8
  import * as Layer from 'effect/Layer';
9
9
  import React, { type CSSProperties, useEffect, useMemo, useState } from 'react';
10
10
 
11
- import { ContextQueueService, DatabaseService } from '@dxos/functions';
11
+ import { Database } from '@dxos/echo';
12
+ import { runAndForwardErrors } from '@dxos/effect';
13
+ import { ContextQueueService } from '@dxos/functions';
12
14
  import { faker } from '@dxos/random';
13
15
  import { useQueue, useSpace } from '@dxos/react-client/echo';
14
16
  import { withClientProvider } from '@dxos/react-client/testing';
@@ -16,7 +18,7 @@ import { Popover } from '@dxos/react-ui';
16
18
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
19
  import { MarkdownStream } from '@dxos/react-ui-components';
18
20
  import { EditorPreviewProvider, useEditorPreview } from '@dxos/react-ui-editor';
19
- import { Card } from '@dxos/react-ui-stack';
21
+ import { Card } from '@dxos/react-ui-mosaic';
20
22
  import { render } from '@dxos/storybook-utils';
21
23
  import { type Message, Organization, Person } from '@dxos/types';
22
24
 
@@ -29,7 +31,7 @@ import TEXT from './testing/thread.md?raw';
29
31
 
30
32
  faker.seed(1);
31
33
 
32
- type MessageGenerator = Effect.Effect<void, never, DatabaseService | ContextQueueService>;
34
+ type MessageGenerator = Effect.Effect<void, never, Database.Service | ContextQueueService>;
33
35
 
34
36
  type StoryProps = { generator?: MessageGenerator[]; delay?: number; wait?: boolean } & ChatThreadProps;
35
37
 
@@ -54,11 +56,11 @@ const DefaultStory = ({ generator = [], delay = 0, wait, ...props }: StoryProps)
54
56
  }
55
57
  }
56
58
  setDone(true);
57
- }).pipe(Effect.provide(Layer.mergeAll(DatabaseService.layer(space.db), ContextQueueService.layer(queue)))),
59
+ }).pipe(Effect.provide(Layer.mergeAll(Database.Service.layer(space.db), ContextQueueService.layer(queue)))),
58
60
  );
59
61
 
60
62
  return () => {
61
- void Effect.runPromise(Fiber.interrupt(fiber));
63
+ void runAndForwardErrors(Fiber.interrupt(fiber));
62
64
  };
63
65
  }, [space, queue, generator]);
64
66
 
@@ -81,10 +83,10 @@ const PreviewCard = () => {
81
83
  <Popover.Portal>
82
84
  <Popover.Content onOpenAutoFocus={(event) => event.preventDefault()}>
83
85
  <Popover.Viewport>
84
- <Card.SurfaceRoot role='card--popover'>
86
+ <Card.Root>
85
87
  <Card.Heading>{target?.label}</Card.Heading>
86
88
  {target && <Card.Text classNames='truncate line-clamp-3'>{target.text}</Card.Text>}
87
- </Card.SurfaceRoot>
89
+ </Card.Root>
88
90
  </Popover.Viewport>
89
91
  <Popover.Arrow />
90
92
  </Popover.Content>
@@ -98,7 +100,7 @@ const meta = {
98
100
  render: render(DefaultStory),
99
101
  decorators: [
100
102
  withTheme,
101
- withLayout({ container: 'column' }),
103
+ withLayout({ layout: 'column' }),
102
104
  withClientProvider({
103
105
  createIdentity: true,
104
106
  createSpace: true,
@@ -8,8 +8,8 @@ import { PublicKey } from '@dxos/keys';
8
8
  import { type Identity } from '@dxos/react-client/halo';
9
9
  import { type ThemedClassName, useForwardedRef } from '@dxos/react-ui';
10
10
  import { MarkdownStream, type MarkdownStreamController, type MarkdownStreamProps } from '@dxos/react-ui-components';
11
- import { mx } from '@dxos/react-ui-theme';
12
11
  import { type Message } from '@dxos/types';
12
+ import { mx } from '@dxos/ui-theme';
13
13
  import { keyToFallback } from '@dxos/util';
14
14
 
15
15
  import { type ChatEvent } from '../Chat';
@@ -5,7 +5,7 @@
5
5
  import React, { useMemo } from 'react';
6
6
 
7
7
  import { type Space } from '@dxos/client/echo';
8
- import { Obj } from '@dxos/echo';
8
+ import { Entity } from '@dxos/echo';
9
9
  import { type DXN } from '@dxos/keys';
10
10
  import { DxAnchor } from '@dxos/lit-ui/react';
11
11
 
@@ -15,9 +15,9 @@ export type ObjectLinkProps = {
15
15
  };
16
16
 
17
17
  export const ObjectLink = ({ space, dxn }: ObjectLinkProps) => {
18
- const ref = useMemo(() => space.db.ref(dxn), [space, dxn.toString()]);
18
+ const ref = useMemo(() => space.db.makeRef(dxn), [space, dxn.toString()]);
19
19
 
20
- const title = Obj.getLabel(ref.target) ?? ref.target?.id ?? ref.dxn.toString();
20
+ const title = (ref.target && Entity.getLabel(ref.target)) ?? ref.target?.id ?? ref.dxn.toString();
21
21
  return (
22
22
  <DxAnchor rootclassname='dx-tag--anchor' refid={dxn.toString()}>
23
23
  {title}
@@ -5,17 +5,17 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { log } from '@dxos/log';
8
+ import { ToggleContainer } from '@dxos/react-ui-components';
8
9
  import {
9
10
  PromptWidget,
10
11
  ReferenceWidget,
11
12
  SelectWidget,
12
13
  SuggestionWidget,
13
14
  SummaryWidget,
14
- ToggleContainer,
15
15
  } from '@dxos/react-ui-components';
16
- import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/react-ui-editor';
17
16
  import { Json } from '@dxos/react-ui-syntax-highlighter';
18
17
  import { ContentBlock, type Message } from '@dxos/types';
18
+ import { type XmlWidgetProps, type XmlWidgetRegistry, getXmlTextChild } from '@dxos/ui-editor';
19
19
 
20
20
  import { ToolBlock } from '../ToolBlock';
21
21
 
@@ -6,6 +6,7 @@ import { EditorView } from '@codemirror/view';
6
6
  import { describe, it } from '@effect/vitest';
7
7
  import * as Effect from 'effect/Effect';
8
8
 
9
+ import { Obj } from '@dxos/echo';
9
10
  import { type ContentBlock } from '@dxos/types';
10
11
 
11
12
  import { createMessage } from '../../testing';
@@ -54,7 +55,9 @@ describe('reducers', () => {
54
55
  syncer.append(messages);
55
56
  expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', ''].join('\n'));
56
57
 
57
- messages[1].blocks.push({ _tag: 'text', text: 'How can I help?' });
58
+ Obj.change(messages[1], (m) => {
59
+ m.blocks.push({ _tag: 'text', text: 'How can I help?' });
60
+ });
58
61
  syncer.append(messages);
59
62
  expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!', 'How can I help?', ''].join('\n'));
60
63
  }),
@@ -74,12 +77,16 @@ describe('reducers', () => {
74
77
  syncer.append(messages);
75
78
  expect(doc.content).toEqual(['<prompt>Hello</prompt>', 'Hi there!'].join('\n'));
76
79
 
77
- const block = messages[1].blocks[0] as ContentBlock.Text;
78
- block.text = 'Hi there! How are you?';
79
- block.pending = false;
80
+ Obj.change(messages[1], (m) => {
81
+ const block = m.blocks[0] as ContentBlock.Text;
82
+ block.text = 'Hi there! How are you?';
83
+ block.pending = false;
84
+ });
80
85
  syncer.append(messages);
81
86
 
82
- messages[1].blocks.push({ _tag: 'text', text: 'How can I help?' });
87
+ Obj.change(messages[1], (m) => {
88
+ m.blocks.push({ _tag: 'text', text: 'How can I help?' });
89
+ });
83
90
  syncer.append(messages);
84
91
  expect(doc.content).toEqual(
85
92
  ['<prompt>Hello</prompt>', 'Hi there! How are you?', 'How can I help?', ''].join('\n'),
@@ -5,8 +5,8 @@
5
5
  import { type DXN } from '@dxos/echo';
6
6
  import { log } from '@dxos/log';
7
7
  import { type MarkdownStreamController } from '@dxos/react-ui-components';
8
- import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/react-ui-editor';
9
8
  import { type ContentBlock, type Message } from '@dxos/types';
9
+ import { type StateDispatch, type XmlWidgetStateManager } from '@dxos/ui-editor';
10
10
 
11
11
  /**
12
12
  * Update document.
@@ -87,7 +87,13 @@ export class MessageSyncer {
87
87
 
88
88
  const content = buffer.join('');
89
89
  this._model.view?.dispatch({
90
- changes: [{ from: 0, to: this._model.view?.state.doc.length ?? 0, insert: content }],
90
+ changes: [
91
+ {
92
+ from: 0,
93
+ to: this._model.view?.state.doc.length ?? 0,
94
+ insert: content,
95
+ },
96
+ ],
91
97
  selection: { anchor: content.length },
92
98
  });
93
99
 
@@ -9,10 +9,9 @@ import { Agent } from '@dxos/assistant-toolkit';
9
9
  import { type Prompt } from '@dxos/blueprints';
10
10
  import { Obj } from '@dxos/echo';
11
11
  import { invokeFunctionWithTracing, useComputeRuntimeCallback } from '@dxos/plugin-automation';
12
- import { getSpace } from '@dxos/react-client/echo';
13
12
  import { Toolbar, useTranslation } from '@dxos/react-ui';
14
13
  import { useAttention } from '@dxos/react-ui-attention';
15
- import { StackItem } from '@dxos/react-ui-stack';
14
+ import { Layout } from '@dxos/react-ui-mosaic';
16
15
 
17
16
  import { meta } from '../meta';
18
17
 
@@ -20,31 +19,31 @@ import { TemplateEditor } from './TemplateEditor';
20
19
 
21
20
  export type PromptArticleProps = SurfaceComponentProps<Prompt.Prompt>;
22
21
 
23
- export const PromptArticle = ({ subject }: PromptArticleProps) => {
22
+ export const PromptArticle = ({ role, subject }: PromptArticleProps) => {
24
23
  const { t } = useTranslation(meta.id);
25
- const space = getSpace(subject);
24
+ const db = Obj.getDatabase(subject);
26
25
  const { hasAttention } = useAttention(Obj.getDXN(subject).toString());
27
26
 
28
27
  const inputData = useMemo(
29
28
  () =>
30
29
  subject && {
31
- prompt: space?.db.ref(Obj.getDXN(subject)),
30
+ prompt: db?.makeRef(Obj.getDXN(subject)),
32
31
  input: {},
33
32
  },
34
- [subject, space],
33
+ [subject, db],
35
34
  );
36
35
 
37
- const handleRun = useComputeRuntimeCallback(space, () => invokeFunctionWithTracing(Agent.prompt, inputData), [
36
+ const handleRun = useComputeRuntimeCallback(db?.spaceId, () => invokeFunctionWithTracing(Agent.prompt, inputData), [
38
37
  inputData,
39
38
  ]);
40
39
 
41
40
  return (
42
- <StackItem.Content toolbar>
41
+ <Layout.Main role={role} toolbar>
43
42
  <Toolbar.Root disabled={!hasAttention} onClick={handleRun}>
44
43
  <Toolbar.IconButton iconOnly icon='ph--play--regular' label={t('run prompt label')} onClick={handleRun} />
45
44
  </Toolbar.Root>
46
45
  <TemplateEditor id={subject.id} template={subject.instructions} classNames='container-max-width' />
47
- </StackItem.Content>
46
+ </Layout.Main>
48
47
  );
49
48
  };
50
49
 
@@ -57,7 +57,7 @@ const DefaultStory = ({ source }: TemplateEditorProps & { source: string }) => {
57
57
 
58
58
  return (
59
59
  <TemplateEditor
60
- classNames='bg-baseSurface max-is-prose is-full'
60
+ classNames='bg-baseSurface is-full max-is-proseMaxWidth'
61
61
  id={blueprint.id}
62
62
  template={blueprint.instructions}
63
63
  />
@@ -70,7 +70,7 @@ const meta = {
70
70
  render: DefaultStory,
71
71
  decorators: [
72
72
  withTheme,
73
- withLayout({ container: 'column' }),
73
+ withLayout({ layout: 'column' }),
74
74
  withClientProvider({
75
75
  types: [Blueprint.Blueprint],
76
76
  createIdentity: true,
@@ -6,17 +6,17 @@ import { defaultHighlightStyle, syntaxHighlighting } from '@codemirror/language'
6
6
  import React from 'react';
7
7
 
8
8
  import { type Template } from '@dxos/blueprints';
9
- import { createDocAccessor } from '@dxos/react-client/echo';
9
+ import { createDocAccessor } from '@dxos/echo-db';
10
10
  import { type ThemedClassName, useThemeContext, useTranslation } from '@dxos/react-ui';
11
+ import { useTextEditor } from '@dxos/react-ui-editor';
11
12
  import {
12
13
  createBasicExtensions,
13
14
  createDataExtensions,
14
15
  createMarkdownExtensions,
15
16
  createThemeExtensions,
16
17
  decorateMarkdown,
17
- useTextEditor,
18
- } from '@dxos/react-ui-editor';
19
- import { mx } from '@dxos/react-ui-theme';
18
+ } from '@dxos/ui-editor';
19
+ import { mx } from '@dxos/ui-theme';
20
20
  import { isNonNullable } from '@dxos/util';
21
21
 
22
22
  import { meta } from '../../meta';
@@ -51,7 +51,10 @@ export const TemplateEditor = ({ id, classNames, template, lineNumbers = true }:
51
51
  lineWrapping: true,
52
52
  placeholder: t('template placeholder'),
53
53
  }),
54
- createThemeExtensions({ themeMode, slots: { content: { className: '!pie-4' } } }),
54
+ createThemeExtensions({
55
+ themeMode,
56
+ slots: { content: { className: '!pie-4' } },
57
+ }),
55
58
  createMarkdownExtensions(),
56
59
  decorateMarkdown(),
57
60
  handlebars(),
@@ -3,9 +3,10 @@
3
3
  //
4
4
 
5
5
  import { type Meta } from '@storybook/react-vite';
6
- import React, { useState } from 'react';
6
+ import React, { useCallback, useState } from 'react';
7
7
 
8
8
  import { Blueprint, Template } from '@dxos/blueprints';
9
+ import { Obj } from '@dxos/echo';
9
10
  import { useClient } from '@dxos/react-client';
10
11
  import { withClientProvider } from '@dxos/react-client/testing';
11
12
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
@@ -13,15 +14,15 @@ import { trim } from '@dxos/util';
13
14
 
14
15
  import { translations } from '../../translations';
15
16
 
16
- import { TemplateForm } from './TemplateForm';
17
+ import { type TemplateChangeCallback, TemplateForm } from './TemplateForm';
17
18
 
18
19
  const TEMPLATE = trim`
19
20
  You are a machine that is an expert chess player.
20
21
  The move history of the current game is: {{history}}
21
22
  If asked to suggest a move explain why it is a good move.
22
-
23
+
23
24
  ---
24
-
25
+
25
26
  {{input}},
26
27
  `;
27
28
 
@@ -38,9 +39,16 @@ const DefaultStory = () => {
38
39
  );
39
40
  });
40
41
 
42
+ const handleChange: TemplateChangeCallback = useCallback(
43
+ (mutate) => {
44
+ Obj.change(blueprint, (b) => mutate(b.instructions));
45
+ },
46
+ [blueprint],
47
+ );
48
+
41
49
  return (
42
50
  <div role='none' className='flex is-[40rem] border border-separator overflow-hidden'>
43
- <TemplateForm id={blueprint.id} template={blueprint.instructions} />
51
+ <TemplateForm id={blueprint.id} template={blueprint.instructions} onChange={handleChange} />
44
52
  </div>
45
53
  );
46
54
  };
@@ -51,7 +59,7 @@ const meta = {
51
59
  render: DefaultStory,
52
60
  decorators: [
53
61
  withTheme,
54
- withLayout({ container: 'column' }),
62
+ withLayout({ layout: 'column' }),
55
63
  withClientProvider({
56
64
  types: [Blueprint.Blueprint],
57
65
  createIdentity: true,
@@ -3,27 +3,62 @@
3
3
  //
4
4
 
5
5
  import type * as Schema from 'effect/Schema';
6
- import React, { Fragment, useEffect } from 'react';
6
+ import React, { Fragment, useCallback, useEffect } from 'react';
7
7
 
8
8
  import { type Template } from '@dxos/blueprints';
9
+ import { type Obj } from '@dxos/echo';
9
10
  import { Input, Select, useTranslation } from '@dxos/react-ui';
10
- import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
11
+ import { attentionSurface, groupBorder, mx } from '@dxos/ui-theme';
11
12
  import { isNonNullable } from '@dxos/util';
12
13
 
13
14
  import { meta } from '../../meta';
14
15
 
15
16
  import { TemplateEditor } from './TemplateEditor';
16
17
 
18
+ /**
19
+ * Callback type for mutating template within a parent object's Obj.change context.
20
+ */
21
+ export type TemplateChangeCallback = (mutate: (template: Obj.Mutable<Template.Template>) => void) => void;
22
+
17
23
  export type TemplateFormProps = {
18
24
  id: string;
19
25
  template: Template.Template;
20
26
  schema?: Schema.Schema<any, any, any>;
21
27
  commandEditable?: boolean;
28
+ /**
29
+ * Callback to mutate the template. Should wrap mutations in parent's Obj.change.
30
+ * If not provided, the component is read-only.
31
+ */
32
+ onChange?: TemplateChangeCallback;
22
33
  };
23
34
 
24
- export const TemplateForm = ({ id, template, commandEditable = true }: TemplateFormProps) => {
35
+ export const TemplateForm = ({ id, template, commandEditable = true, onChange }: TemplateFormProps) => {
25
36
  const { t } = useTranslation(meta.id);
26
- usePromptInputs(template);
37
+ usePromptInputs(template, onChange);
38
+
39
+ const handleInputKindChange = useCallback(
40
+ (inputName: string, kind: Template.InputKind) => {
41
+ onChange?.((t) => {
42
+ const input = t.inputs?.find((i) => i?.name === inputName);
43
+ if (input) {
44
+ input.kind = kind;
45
+ }
46
+ });
47
+ },
48
+ [onChange],
49
+ );
50
+
51
+ const handleInputDefaultChange = useCallback(
52
+ (inputName: string, value: string) => {
53
+ onChange?.((t) => {
54
+ const input = t.inputs?.find((i) => i?.name === inputName);
55
+ if (input) {
56
+ input.default = value;
57
+ }
58
+ });
59
+ },
60
+ [onChange],
61
+ );
27
62
 
28
63
  return (
29
64
  <div className={mx('flex flex-col is-full overflow-hidden gap-4', groupBorder)}>
@@ -36,7 +71,9 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
36
71
  classNames='is-full bg-transparent m-2'
37
72
  value={template.command ?? ''}
38
73
  onChange={(event) => {
39
- template.command = event.target.value.replace(/\w/g, '');
74
+ onChange?.((t) => {
75
+ t.command = event.target.value.replace(/\w/g, '');
76
+ });
40
77
  }}
41
78
  />
42
79
  </Input.Root>
@@ -54,9 +91,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
54
91
  <Input.Root>
55
92
  <Select.Root
56
93
  value={input.kind}
57
- onValueChange={(kind) => {
58
- input.kind = kind as Template.InputKind;
59
- }}
94
+ onValueChange={(kind) => handleInputKindChange(input.name, kind as Template.InputKind)}
60
95
  >
61
96
  <Select.TriggerButton placeholder='Type' classNames='is-full' />
62
97
  <Select.Portal>
@@ -82,9 +117,7 @@ export const TemplateForm = ({ id, template, commandEditable = true }: TemplateF
82
117
  placeholder={t('command placeholder')}
83
118
  classNames='is-full bg-transparent'
84
119
  value={input.default ?? ''}
85
- onChange={(event) => {
86
- input.default = event.target.value;
87
- }}
120
+ onChange={(event) => handleInputDefaultChange(input.name, event.target.value)}
88
121
  />
89
122
  </Input.Root>
90
123
  </div>
@@ -136,13 +169,14 @@ const inputs: { kind: Template.InputKind; label: string }[] = [
136
169
 
137
170
  export const NAME_REGEXP = /\{\{([\w-]+)\}\}/;
138
171
 
139
- const usePromptInputs = (template: Template.Template) => {
172
+ const usePromptInputs = (template: Template.Template, onChange?: TemplateChangeCallback) => {
140
173
  useEffect(() => {
141
- const text = template.source ?? '';
142
- if (!template.inputs) {
143
- template.inputs = []; // TODO(burdon): Required?
174
+ if (!onChange) {
175
+ return;
144
176
  }
145
177
 
178
+ const text = template.source ?? '';
179
+
146
180
  const regex = new RegExp(NAME_REGEXP, 'g');
147
181
  const variables = new Set<string>([...(text.target?.content.matchAll(regex) ?? [])].map((m) => m[1]));
148
182
 
@@ -161,19 +195,32 @@ const usePromptInputs = (template: Template.Template) => {
161
195
 
162
196
  // Match or create new inputs.
163
197
  const values = unclaimed.values();
164
- missing.forEach((name) => {
165
- const next = values.next().value;
166
- if (next) {
167
- next.name = name;
168
- } else {
169
- template.inputs?.push({ name });
198
+ onChange((t) => {
199
+ if (!t.inputs) {
200
+ t.inputs = [];
170
201
  }
171
- });
172
202
 
173
- // Remove unclaimed (deleted) inputs.
174
- // TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
175
- for (const input of values) {
176
- template.inputs.splice(template.inputs.indexOf(input), 1);
177
- }
178
- }, [template.source]);
203
+ missing.forEach((name) => {
204
+ const next = values.next().value;
205
+ if (next) {
206
+ // Find the input in the mutable draft and update it.
207
+ const inputIndex = t.inputs!.findIndex((i) => i?.name === next.name);
208
+ if (inputIndex !== -1) {
209
+ t.inputs![inputIndex].name = name;
210
+ }
211
+ } else {
212
+ t.inputs!.push({ name });
213
+ }
214
+ });
215
+
216
+ // Remove unclaimed (deleted) inputs.
217
+ // TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
218
+ for (const input of values) {
219
+ const inputIndex = t.inputs!.findIndex((i) => i?.name === input.name);
220
+ if (inputIndex !== -1) {
221
+ t.inputs!.splice(inputIndex, 1);
222
+ }
223
+ }
224
+ });
225
+ }, [template.source, onChange]);
179
226
  };
@@ -19,8 +19,7 @@ import {
19
19
  keymap,
20
20
  } from '@codemirror/view';
21
21
 
22
- import { Domino } from '@dxos/react-ui';
23
- import { mx } from '@dxos/react-ui-theme';
22
+ import { Domino, mx } from '@dxos/ui';
24
23
 
25
24
  export type HandlebarsOptions = {};
26
25
 
@@ -87,7 +86,11 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
87
86
  // NOTE: Decorations may clash with other extensions (e.g., markdown).
88
87
  buildDecorations(view: EditorView) {
89
88
  const selection = view.state.selection.main;
90
- const decorations: Array<{ from: number; to: number; decoration: Decoration }> = [];
89
+ const decorations: Array<{
90
+ from: number;
91
+ to: number;
92
+ decoration: Decoration;
93
+ }> = [];
91
94
 
92
95
  for (const { from, to } of view.visibleRanges) {
93
96
  const text = view.state.doc.sliceString(from, to);
@@ -121,7 +124,9 @@ const handlebarsHighlightPlugin = ViewPlugin.fromClass(
121
124
  decorations.push({
122
125
  from: start,
123
126
  to: end,
124
- decoration: Decoration.mark({ class: mx('dx-tag--blue', tagPadding) }),
127
+ decoration: Decoration.mark({
128
+ class: mx('dx-tag--blue', tagPadding),
129
+ }),
125
130
  });
126
131
  }
127
132
  }
@@ -222,7 +227,7 @@ class DXNWidget extends WidgetType {
222
227
  return part;
223
228
  })
224
229
  .join(':');
225
- return Domino.of('span').classNames(['font-mono dx-tag--blue', tagPadding]).text(text).build();
230
+ return Domino.of('span').classNames(mx('font-mono dx-tag--blue', tagPadding)).text(text).root;
226
231
  }
227
232
  }
228
233
 
@@ -7,9 +7,9 @@ import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
7
7
 
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { NumericTabs, TextCrawl, ToggleContainer, type ToggleContainerRootProps } from '@dxos/react-ui-components';
10
- import { type XmlWidgetProps } from '@dxos/react-ui-editor';
11
10
  import { Json } from '@dxos/react-ui-syntax-highlighter';
12
11
  import { type ContentBlock, type Message } from '@dxos/types';
12
+ import { type XmlWidgetProps } from '@dxos/ui-editor';
13
13
  import { isNonNullable, safeParseJson } from '@dxos/util';
14
14
 
15
15
  import { meta } from '../../meta';
@@ -25,7 +25,7 @@ export type ToolBlockProps = XmlWidgetProps<{
25
25
  export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
26
26
  const { t } = useTranslation(meta.id);
27
27
 
28
- const items = useMemo<ToolContainerParams['items']>(() => {
28
+ const items = useMemo<ToolContainerProps['items']>(() => {
29
29
  let lastToolCall: { tool: Tool.Any | undefined; block: ContentBlock.ToolCall } | undefined;
30
30
  // TODO(burdon): Get from context?
31
31
  const tools: Tool.Any[] = []; //processor.conversation.toolkit?.tools ?? [];
@@ -101,11 +101,11 @@ export const ToolBlock = ({ view, blocks = [] }: ToolBlockProps) => {
101
101
 
102
102
  ToolBlock.displayName = 'ToolBlock';
103
103
 
104
- type ToolContainerParams = {
104
+ type ToolContainerProps = {
105
105
  items: { title: string; content: any }[];
106
106
  } & Pick<ToggleContainerRootProps, 'onChangeOpen'>;
107
107
 
108
- export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
108
+ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerProps) => {
109
109
  const tabsRef = useRef<HTMLDivElement>(null);
110
110
  const [selected, setSelected] = useState(0);
111
111
  const [open, setOpen] = useState(false);
@@ -115,11 +115,11 @@ export const ToolContainer = ({ items, onChangeOpen }: ToolContainerParams) => {
115
115
  if (open) {
116
116
  tabsRef.current?.focus();
117
117
  }
118
- }, [onChangeOpen, open]);
118
+ }, [open, onChangeOpen]);
119
119
 
120
- const handleSelect = (index: number) => {
120
+ const handleSelect = useCallback((index: number) => {
121
121
  setSelected(index);
122
- };
122
+ }, []);
123
123
 
124
124
  return (
125
125
  <ToggleContainer.Root classNames='mbs-2 is-full rounded-sm' open={open} onChangeOpen={setOpen}>
@@ -3,16 +3,16 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
6
7
  import React from 'react';
7
8
 
8
- import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { capabilities } from '@dxos/assistant-toolkit';
10
+ import { capabilities } from '@dxos/assistant-toolkit/testing';
11
11
  import { ChessPlugin } from '@dxos/plugin-chess';
12
12
  import { ClientPlugin } from '@dxos/plugin-client';
13
13
  import { MapPlugin } from '@dxos/plugin-map';
14
- import { SpacePlugin } from '@dxos/plugin-space';
15
14
  import { TablePlugin } from '@dxos/plugin-table';
15
+ import { corePlugins } from '@dxos/plugin-testing';
16
16
  import { withTheme } from '@dxos/react-ui/testing';
17
17
 
18
18
  import { translations } from '../../translations';
@@ -31,14 +31,13 @@ const meta = {
31
31
  withTheme,
32
32
  withPluginManager({
33
33
  plugins: [
34
+ ...corePlugins(),
34
35
  ClientPlugin({
35
- onClientInitialized: async ({ client }) => {
36
- await client.halo.createIdentity();
37
- },
36
+ onClientInitialized: ({ client }) =>
37
+ Effect.gen(function* () {
38
+ yield* Effect.promise(() => client.halo.createIdentity());
39
+ }),
38
40
  }),
39
- SpacePlugin({}),
40
- SettingsPlugin(),
41
- IntentPlugin(),
42
41
  ChessPlugin(),
43
42
  MapPlugin(),
44
43
  TablePlugin(),