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

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 (441) hide show
  1. package/dist/lib/browser/{BlueprintContainer-OWUSKPRK.mjs → BlueprintContainer-GMSYKGSO.mjs} +13 -6
  2. package/dist/lib/browser/BlueprintContainer-GMSYKGSO.mjs.map +7 -0
  3. package/dist/lib/browser/{ChatCompanion-FRCVSLPP.mjs → ChatCompanion-M3FDKTQM.mjs} +39 -14
  4. package/dist/lib/browser/ChatCompanion-M3FDKTQM.mjs.map +7 -0
  5. package/dist/lib/browser/{ChatContainer-YBJBIVUZ.mjs → ChatContainer-KAH7XITI.mjs} +10 -11
  6. package/dist/lib/browser/ChatContainer-KAH7XITI.mjs.map +7 -0
  7. package/dist/lib/browser/{ChatDialog-MTPJLEHM.mjs → ChatDialog-ZWRGABW6.mjs} +8 -10
  8. package/dist/lib/browser/ChatDialog-ZWRGABW6.mjs.map +7 -0
  9. package/dist/lib/browser/ai-service-ERTZBTP3.mjs +19 -0
  10. package/dist/lib/browser/ai-service-ERTZBTP3.mjs.map +7 -0
  11. package/dist/lib/browser/{app-graph-builder-7AAWTWGA.mjs → app-graph-builder-R5T7BJPC.mjs} +41 -11
  12. package/dist/lib/browser/app-graph-builder-R5T7BJPC.mjs.map +7 -0
  13. package/dist/lib/browser/blueprint-definition-AGTDXTXO.mjs +13 -0
  14. package/dist/lib/browser/chunk-357IHWQL.mjs +1519 -0
  15. package/dist/lib/browser/chunk-357IHWQL.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-6QMISAU6.mjs → chunk-A2NVNXPL.mjs} +15 -12
  17. package/dist/lib/browser/chunk-A2NVNXPL.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-V5H5CCZA.mjs → chunk-CQW6UPJM.mjs} +24 -43
  19. package/dist/lib/browser/chunk-CQW6UPJM.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-SMIVXXAI.mjs → chunk-GNI6HL6G.mjs} +37 -20
  21. package/dist/lib/browser/chunk-GNI6HL6G.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-GXHZTOWJ.mjs +378 -0
  23. package/dist/lib/browser/chunk-GXHZTOWJ.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-L5OA5OGS.mjs +262 -0
  25. package/dist/lib/browser/chunk-L5OA5OGS.mjs.map +7 -0
  26. package/dist/lib/browser/{chunk-OYFQS7JM.mjs → chunk-MEN5WTLA.mjs} +64 -39
  27. package/dist/lib/browser/chunk-MEN5WTLA.mjs.map +7 -0
  28. package/dist/lib/browser/{chunk-CFXXQM25.mjs → chunk-PUG24BEC.mjs} +118 -23
  29. package/dist/lib/browser/chunk-PUG24BEC.mjs.map +7 -0
  30. package/dist/lib/browser/{chunk-IJAJRAR7.mjs → chunk-SJJV3HEX.mjs} +2 -4
  31. package/dist/lib/browser/chunk-SJJV3HEX.mjs.map +7 -0
  32. package/dist/lib/browser/chunk-WBG5PTSX.mjs +23 -0
  33. package/dist/lib/browser/chunk-WBG5PTSX.mjs.map +7 -0
  34. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs +18 -0
  35. package/dist/lib/browser/edge-model-resolver-O6OFYIO2.mjs.map +7 -0
  36. package/dist/lib/browser/index.mjs +85 -51
  37. package/dist/lib/browser/index.mjs.map +4 -4
  38. package/dist/lib/browser/{intent-resolver-BQO5SVGI.mjs → intent-resolver-3C5TABOX.mjs} +38 -14
  39. package/dist/lib/browser/intent-resolver-3C5TABOX.mjs.map +7 -0
  40. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs +17 -0
  41. package/dist/lib/browser/local-model-resolver-GO6ZEMLL.mjs.map +7 -0
  42. package/dist/lib/browser/meta.json +1 -1
  43. package/dist/lib/browser/{react-surface-VNCD2H7C.mjs → react-surface-EYKA5IFU.mjs} +11 -30
  44. package/dist/lib/browser/react-surface-EYKA5IFU.mjs.map +7 -0
  45. package/dist/lib/browser/{settings-36V3VUMW.mjs → settings-VMVBYZLN.mjs} +5 -5
  46. package/dist/lib/browser/{settings-36V3VUMW.mjs.map → settings-VMVBYZLN.mjs.map} +1 -1
  47. package/dist/lib/browser/{state-D5IVKNYG.mjs → state-CFREPBB6.mjs} +5 -5
  48. package/dist/lib/browser/{state-D5IVKNYG.mjs.map → state-CFREPBB6.mjs.map} +1 -1
  49. package/dist/lib/browser/toolkit-F3NQ7TSI.mjs +21 -0
  50. package/dist/lib/browser/toolkit-F3NQ7TSI.mjs.map +7 -0
  51. package/dist/lib/browser/types/index.mjs +2 -2
  52. package/dist/lib/node-esm/{BlueprintContainer-UFVWCRN6.mjs → BlueprintContainer-6GBLMK4Z.mjs} +13 -6
  53. package/dist/lib/node-esm/BlueprintContainer-6GBLMK4Z.mjs.map +7 -0
  54. package/dist/lib/node-esm/{ChatCompanion-ZNRZEKH5.mjs → ChatCompanion-OV426GCP.mjs} +39 -14
  55. package/dist/lib/node-esm/ChatCompanion-OV426GCP.mjs.map +7 -0
  56. package/dist/lib/node-esm/{ChatContainer-TUCITJJW.mjs → ChatContainer-UKY7NHFY.mjs} +10 -11
  57. package/dist/lib/node-esm/ChatContainer-UKY7NHFY.mjs.map +7 -0
  58. package/dist/lib/node-esm/{ChatDialog-JLM7RDZQ.mjs → ChatDialog-2BDQIEXH.mjs} +8 -10
  59. package/dist/lib/node-esm/ChatDialog-2BDQIEXH.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-I52RYVWH.mjs} +41 -11
  63. package/dist/lib/node-esm/app-graph-builder-I52RYVWH.mjs.map +7 -0
  64. package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs → blueprint-definition-CFCUD2VC.mjs} +5 -4
  65. package/dist/lib/node-esm/{chunk-CAQKGW3B.mjs → chunk-2CAETDW2.mjs} +63 -39
  66. package/dist/lib/node-esm/chunk-2CAETDW2.mjs.map +7 -0
  67. package/dist/lib/node-esm/{chunk-RLBN4RNR.mjs → chunk-4J5FYNNM.mjs} +15 -12
  68. package/dist/lib/node-esm/chunk-4J5FYNNM.mjs.map +7 -0
  69. package/dist/lib/node-esm/{chunk-7YOGZI66.mjs → chunk-5ARE4R2I.mjs} +37 -20
  70. package/dist/lib/node-esm/chunk-5ARE4R2I.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs +264 -0
  72. package/dist/lib/node-esm/chunk-7ZYOYW7F.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-HJPIYMWD.mjs +1520 -0
  74. package/dist/lib/node-esm/chunk-HJPIYMWD.mjs.map +7 -0
  75. package/dist/lib/node-esm/{chunk-UWUUZQWJ.mjs → chunk-O36P4LN5.mjs} +24 -43
  76. package/dist/lib/node-esm/chunk-O36P4LN5.mjs.map +7 -0
  77. package/dist/lib/node-esm/chunk-WE6KTH72.mjs +25 -0
  78. package/dist/lib/node-esm/chunk-WE6KTH72.mjs.map +7 -0
  79. package/dist/lib/node-esm/{chunk-FNZJJL7G.mjs → chunk-XM4BVQQR.mjs} +118 -23
  80. package/dist/lib/node-esm/chunk-XM4BVQQR.mjs.map +7 -0
  81. package/dist/lib/node-esm/{chunk-YPXEA46Q.mjs → chunk-XQBL2SBL.mjs} +2 -4
  82. package/dist/lib/node-esm/chunk-XQBL2SBL.mjs.map +7 -0
  83. package/dist/lib/node-esm/chunk-YIO5MEPR.mjs +380 -0
  84. package/dist/lib/node-esm/chunk-YIO5MEPR.mjs.map +7 -0
  85. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs +19 -0
  86. package/dist/lib/node-esm/edge-model-resolver-2ARXDOYS.mjs.map +7 -0
  87. package/dist/lib/node-esm/index.mjs +85 -51
  88. package/dist/lib/node-esm/index.mjs.map +4 -4
  89. package/dist/lib/node-esm/{intent-resolver-FIS3T5KP.mjs → intent-resolver-HQ27YALS.mjs} +38 -14
  90. package/dist/lib/node-esm/intent-resolver-HQ27YALS.mjs.map +7 -0
  91. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs +18 -0
  92. package/dist/lib/node-esm/local-model-resolver-WOQ2D2R2.mjs.map +7 -0
  93. package/dist/lib/node-esm/meta.json +1 -1
  94. package/dist/lib/node-esm/{react-surface-4NLRKNBU.mjs → react-surface-UOC3CBPH.mjs} +11 -30
  95. package/dist/lib/node-esm/react-surface-UOC3CBPH.mjs.map +7 -0
  96. package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs → settings-7AUVNDM2.mjs} +5 -5
  97. package/dist/lib/node-esm/{settings-7ZCZ6AS5.mjs.map → settings-7AUVNDM2.mjs.map} +1 -1
  98. package/dist/lib/node-esm/{state-4VLKPLW3.mjs → state-XXND44OW.mjs} +5 -5
  99. package/dist/lib/node-esm/{state-4VLKPLW3.mjs.map → state-XXND44OW.mjs.map} +1 -1
  100. package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs +22 -0
  101. package/dist/lib/node-esm/toolkit-7CH5UNSQ.mjs.map +7 -0
  102. package/dist/lib/node-esm/types/index.mjs +2 -2
  103. package/dist/types/src/AssistantPlugin.d.ts +1 -1
  104. package/dist/types/src/AssistantPlugin.d.ts.map +1 -1
  105. package/dist/types/src/capabilities/ai-service.d.ts +2 -3
  106. package/dist/types/src/capabilities/ai-service.d.ts.map +1 -1
  107. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  108. package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
  109. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  110. package/dist/types/src/capabilities/capabilities.d.ts +0 -8
  111. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
  112. package/dist/types/src/capabilities/edge-model-resolver.d.ts.map +1 -1
  113. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  114. package/dist/types/src/capabilities/local-model-resolver.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  116. package/dist/types/src/capabilities/toolkit.d.ts.map +1 -1
  117. package/dist/types/src/components/BlueprintContainer.d.ts.map +1 -1
  118. package/dist/types/src/components/Chat/Chat.d.ts +4 -3
  119. package/dist/types/src/components/Chat/Chat.d.ts.map +1 -1
  120. package/dist/types/src/components/ChatCompanion.d.ts.map +1 -1
  121. package/dist/types/src/components/ChatProgress/ChatProgress.d.ts.map +1 -1
  122. package/dist/types/src/components/ChatThread/ChatThread.d.ts +10 -5
  123. package/dist/types/src/components/ChatThread/ChatThread.d.ts.map +1 -1
  124. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts +35 -26
  125. package/dist/types/src/components/ChatThread/ChatThread.stories.d.ts.map +1 -1
  126. package/dist/types/src/components/ChatThread/Link.d.ts.map +1 -1
  127. package/dist/types/src/components/ChatThread/registry.d.ts +11 -0
  128. package/dist/types/src/components/ChatThread/registry.d.ts.map +1 -0
  129. package/dist/types/src/components/ChatThread/sync.d.ts +36 -0
  130. package/dist/types/src/components/ChatThread/sync.d.ts.map +1 -0
  131. package/dist/types/src/components/ChatThread/sync.test.d.ts +2 -0
  132. package/dist/types/src/components/ChatThread/sync.test.d.ts.map +1 -0
  133. package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts +6 -0
  134. package/dist/types/src/components/ChatToolbar/ChatToolbar.d.ts.map +1 -0
  135. package/dist/types/src/components/ChatToolbar/index.d.ts +2 -0
  136. package/dist/types/src/components/ChatToolbar/index.d.ts.map +1 -0
  137. package/dist/types/src/components/{Toolbar → ChatToolbar}/useChatToolbarActions.d.ts +1 -3
  138. package/dist/types/src/components/ChatToolbar/useChatToolbarActions.d.ts.map +1 -0
  139. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +2 -1
  140. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +1 -1
  141. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +21 -14
  142. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +1 -1
  143. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +1 -1
  144. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +1 -1
  145. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +21 -14
  146. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +1 -1
  147. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts +19 -0
  148. package/dist/types/src/components/ToolBlock/ToolBlock.d.ts.map +1 -0
  149. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts +2 -0
  150. package/dist/types/src/components/ToolBlock/ToolBlockWidget.d.ts.map +1 -0
  151. package/dist/types/src/components/ToolBlock/index.d.ts +3 -0
  152. package/dist/types/src/components/ToolBlock/index.d.ts.map +1 -0
  153. package/dist/types/src/components/Toolbox/Toolbox.d.ts +2 -2
  154. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -1
  155. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +21 -14
  156. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -1
  157. package/dist/types/src/components/index.d.ts +1 -5
  158. package/dist/types/src/components/index.d.ts.map +1 -1
  159. package/dist/types/src/functions/analysis.d.ts.map +1 -1
  160. package/dist/types/src/functions/index.d.ts +2 -2
  161. package/dist/types/src/functions/index.d.ts.map +1 -1
  162. package/dist/types/src/functions/{list.d.ts → object-list.d.ts} +1 -1
  163. package/dist/types/src/functions/object-list.d.ts.map +1 -0
  164. package/dist/types/src/functions/{load.d.ts → object-load.d.ts} +1 -1
  165. package/dist/types/src/functions/object-load.d.ts.map +1 -0
  166. package/dist/types/src/hooks/index.d.ts +0 -3
  167. package/dist/types/src/hooks/index.d.ts.map +1 -1
  168. package/dist/types/src/hooks/useBlueprintRegistry.d.ts +2 -1
  169. package/dist/types/src/hooks/useBlueprintRegistry.d.ts.map +1 -1
  170. package/dist/types/src/hooks/useChatProcessor.d.ts +2 -2
  171. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -1
  172. package/dist/types/src/hooks/useChatServices.d.ts +2 -2
  173. package/dist/types/src/hooks/useChatServices.d.ts.map +1 -1
  174. package/dist/types/src/hooks/useContextBinder.d.ts.map +1 -1
  175. package/dist/types/src/index.d.ts +2 -0
  176. package/dist/types/src/index.d.ts.map +1 -1
  177. package/dist/types/src/meta.d.ts +1 -2
  178. package/dist/types/src/meta.d.ts.map +1 -1
  179. package/dist/types/src/processor/index.d.ts +1 -0
  180. package/dist/types/src/processor/index.d.ts.map +1 -1
  181. package/dist/types/src/processor/presets.d.ts +1 -1
  182. package/dist/types/src/processor/presets.d.ts.map +1 -1
  183. package/dist/types/src/processor/processor.d.ts +11 -17
  184. package/dist/types/src/processor/processor.d.ts.map +1 -1
  185. package/dist/types/src/processor/update-name.d.ts +10 -0
  186. package/dist/types/src/processor/update-name.d.ts.map +1 -0
  187. package/dist/types/src/testing/index.d.ts +1 -2
  188. package/dist/types/src/testing/index.d.ts.map +1 -1
  189. package/dist/types/src/testing/test-generator.d.ts +7 -0
  190. package/dist/types/src/testing/test-generator.d.ts.map +1 -0
  191. package/dist/types/src/testing/test-services.d.ts +2 -2
  192. package/dist/types/src/testing/test-services.d.ts.map +1 -1
  193. package/dist/types/src/toolkits/AssistantToolkit.d.ts +21 -0
  194. package/dist/types/src/toolkits/AssistantToolkit.d.ts.map +1 -0
  195. package/dist/types/src/toolkits/SystemToolkit.d.ts +69 -0
  196. package/dist/types/src/toolkits/SystemToolkit.d.ts.map +1 -0
  197. package/dist/types/src/toolkits/index.d.ts +3 -0
  198. package/dist/types/src/toolkits/index.d.ts.map +1 -0
  199. package/dist/types/src/translations.d.ts +6 -4
  200. package/dist/types/src/translations.d.ts.map +1 -1
  201. package/dist/types/src/types/Assistant.d.ts +15 -9
  202. package/dist/types/src/types/Assistant.d.ts.map +1 -1
  203. package/dist/types/src/types/AssistantAction.d.ts +18 -6
  204. package/dist/types/src/types/AssistantAction.d.ts.map +1 -1
  205. package/dist/types/src/types/service.d.ts +12 -12
  206. package/dist/types/src/types/service.d.ts.map +1 -1
  207. package/dist/types/tsconfig.tsbuildinfo +1 -1
  208. package/package.json +93 -110
  209. package/src/AssistantPlugin.tsx +140 -129
  210. package/src/capabilities/ai-service.ts +6 -7
  211. package/src/capabilities/app-graph-builder.ts +36 -4
  212. package/src/capabilities/blueprint-definition.ts +39 -15
  213. package/src/capabilities/capabilities.ts +0 -13
  214. package/src/capabilities/edge-model-resolver.ts +5 -7
  215. package/src/capabilities/intent-resolver.ts +33 -6
  216. package/src/capabilities/local-model-resolver.ts +6 -8
  217. package/src/capabilities/react-surface.tsx +1 -21
  218. package/src/capabilities/toolkit.ts +10 -154
  219. package/src/components/BlueprintContainer.tsx +8 -2
  220. package/src/components/Chat/Chat.tsx +72 -70
  221. package/src/components/ChatCompanion.tsx +33 -8
  222. package/src/components/ChatContainer.tsx +4 -4
  223. package/src/components/ChatDialog.tsx +8 -8
  224. package/src/components/ChatProgress/ChatProgress.tsx +2 -3
  225. package/src/components/ChatPrompt/ChatOptions.tsx +17 -25
  226. package/src/components/ChatThread/ChatThread.stories.tsx +75 -229
  227. package/src/components/ChatThread/ChatThread.tsx +64 -46
  228. package/src/components/ChatThread/Link.tsx +11 -8
  229. package/src/components/ChatThread/registry.tsx +184 -0
  230. package/src/components/ChatThread/sync.test.ts +81 -0
  231. package/src/components/ChatThread/sync.ts +113 -0
  232. package/src/components/{Toolbar/Toolbar.tsx → ChatToolbar/ChatToolbar.tsx} +5 -2
  233. package/src/components/{Toolbar → ChatToolbar}/index.ts +1 -1
  234. package/src/components/{Toolbar → ChatToolbar}/useChatToolbarActions.ts +2 -1
  235. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +5 -5
  236. package/src/components/TemplateEditor/TemplateEditor.tsx +18 -10
  237. package/src/components/TemplateEditor/TemplateForm.stories.tsx +3 -5
  238. package/src/components/TemplateEditor/TemplateForm.tsx +1 -1
  239. package/src/components/TemplateEditor/handlebars-extension.ts +12 -11
  240. package/src/components/{ChatThread → ToolBlock}/ToolBlock.tsx +31 -26
  241. package/src/components/ToolBlock/ToolBlockWidget.tsx +5 -0
  242. package/src/components/ToolBlock/index.ts +6 -0
  243. package/src/components/Toolbox/Toolbox.stories.tsx +4 -7
  244. package/src/components/Toolbox/Toolbox.tsx +3 -3
  245. package/src/components/index.ts +1 -3
  246. package/src/functions/analysis.ts +4 -2
  247. package/src/functions/index.ts +2 -2
  248. package/src/functions/{list.ts → object-list.ts} +6 -4
  249. package/src/functions/{load.ts → object-load.ts} +9 -7
  250. package/src/hooks/index.ts +0 -3
  251. package/src/hooks/useBlueprintRegistry.ts +17 -3
  252. package/src/hooks/useChatProcessor.ts +13 -5
  253. package/src/hooks/useChatServices.ts +26 -42
  254. package/src/hooks/useContextBinder.ts +17 -5
  255. package/src/hooks/useItemTypes.ts +1 -1
  256. package/src/index.ts +2 -0
  257. package/src/meta.ts +9 -6
  258. package/src/processor/index.ts +1 -0
  259. package/src/processor/presets.ts +1 -1
  260. package/src/processor/processor.test.ts +21 -17
  261. package/src/processor/processor.ts +30 -57
  262. package/src/processor/update-name.ts +57 -0
  263. package/src/queue-logger.ts +5 -5
  264. package/src/testing/index.ts +1 -2
  265. package/src/testing/test-generator.ts +261 -0
  266. package/src/testing/test-services.ts +2 -8
  267. package/src/toolkits/AssistantToolkit.ts +55 -0
  268. package/src/toolkits/SystemToolkit.ts +292 -0
  269. package/src/toolkits/index.ts +6 -0
  270. package/src/translations.ts +6 -5
  271. package/src/types/Assistant.ts +10 -8
  272. package/src/types/AssistantAction.ts +10 -2
  273. package/src/types/service.ts +17 -9
  274. package/dist/lib/browser/BlueprintContainer-OWUSKPRK.mjs.map +0 -7
  275. package/dist/lib/browser/ChatCompanion-FRCVSLPP.mjs.map +0 -7
  276. package/dist/lib/browser/ChatContainer-YBJBIVUZ.mjs.map +0 -7
  277. package/dist/lib/browser/ChatDialog-MTPJLEHM.mjs.map +0 -7
  278. package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs +0 -150
  279. package/dist/lib/browser/SequenceContainer-TF5QNXYM.mjs.map +0 -7
  280. package/dist/lib/browser/ai-service-NRZPTUHO.mjs +0 -22
  281. package/dist/lib/browser/ai-service-NRZPTUHO.mjs.map +0 -7
  282. package/dist/lib/browser/app-graph-builder-7AAWTWGA.mjs.map +0 -7
  283. package/dist/lib/browser/blueprint-definition-CRZPIA5A.mjs +0 -12
  284. package/dist/lib/browser/chunk-6QMISAU6.mjs.map +0 -7
  285. package/dist/lib/browser/chunk-CFXXQM25.mjs.map +0 -7
  286. package/dist/lib/browser/chunk-IJAJRAR7.mjs.map +0 -7
  287. package/dist/lib/browser/chunk-O4LUJEDV.mjs +0 -20
  288. package/dist/lib/browser/chunk-O4LUJEDV.mjs.map +0 -7
  289. package/dist/lib/browser/chunk-OYFQS7JM.mjs.map +0 -7
  290. package/dist/lib/browser/chunk-SMIVXXAI.mjs.map +0 -7
  291. package/dist/lib/browser/chunk-V5H5CCZA.mjs.map +0 -7
  292. package/dist/lib/browser/chunk-XL557TXF.mjs +0 -2332
  293. package/dist/lib/browser/chunk-XL557TXF.mjs.map +0 -7
  294. package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs +0 -22
  295. package/dist/lib/browser/edge-model-resolver-E5M3CC46.mjs.map +0 -7
  296. package/dist/lib/browser/intent-resolver-BQO5SVGI.mjs.map +0 -7
  297. package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs +0 -21
  298. package/dist/lib/browser/local-model-resolver-VZ5WZQIC.mjs.map +0 -7
  299. package/dist/lib/browser/react-surface-VNCD2H7C.mjs.map +0 -7
  300. package/dist/lib/browser/toolkit-Y5OYX5PO.mjs +0 -191
  301. package/dist/lib/browser/toolkit-Y5OYX5PO.mjs.map +0 -7
  302. package/dist/lib/node-esm/BlueprintContainer-UFVWCRN6.mjs.map +0 -7
  303. package/dist/lib/node-esm/ChatCompanion-ZNRZEKH5.mjs.map +0 -7
  304. package/dist/lib/node-esm/ChatContainer-TUCITJJW.mjs.map +0 -7
  305. package/dist/lib/node-esm/ChatDialog-JLM7RDZQ.mjs.map +0 -7
  306. package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs +0 -151
  307. package/dist/lib/node-esm/SequenceContainer-UXOVZPZO.mjs.map +0 -7
  308. package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs +0 -23
  309. package/dist/lib/node-esm/ai-service-UDEPIPTO.mjs.map +0 -7
  310. package/dist/lib/node-esm/app-graph-builder-PNAFQUYT.mjs.map +0 -7
  311. package/dist/lib/node-esm/chunk-2X6VEO32.mjs +0 -2333
  312. package/dist/lib/node-esm/chunk-2X6VEO32.mjs.map +0 -7
  313. package/dist/lib/node-esm/chunk-7YOGZI66.mjs.map +0 -7
  314. package/dist/lib/node-esm/chunk-CAQKGW3B.mjs.map +0 -7
  315. package/dist/lib/node-esm/chunk-FNZJJL7G.mjs.map +0 -7
  316. package/dist/lib/node-esm/chunk-RLBN4RNR.mjs.map +0 -7
  317. package/dist/lib/node-esm/chunk-UWUUZQWJ.mjs.map +0 -7
  318. package/dist/lib/node-esm/chunk-VFY2JG62.mjs +0 -22
  319. package/dist/lib/node-esm/chunk-VFY2JG62.mjs.map +0 -7
  320. package/dist/lib/node-esm/chunk-YPXEA46Q.mjs.map +0 -7
  321. package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs +0 -23
  322. package/dist/lib/node-esm/edge-model-resolver-SZHDLXCT.mjs.map +0 -7
  323. package/dist/lib/node-esm/intent-resolver-FIS3T5KP.mjs.map +0 -7
  324. package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs +0 -22
  325. package/dist/lib/node-esm/local-model-resolver-2KCBKMYA.mjs.map +0 -7
  326. package/dist/lib/node-esm/react-surface-4NLRKNBU.mjs.map +0 -7
  327. package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs +0 -192
  328. package/dist/lib/node-esm/toolkit-2F2OL6WB.mjs.map +0 -7
  329. package/dist/types/src/components/ChatThread/ChatMessage.d.ts +0 -33
  330. package/dist/types/src/components/ChatThread/ChatMessage.d.ts.map +0 -1
  331. package/dist/types/src/components/ChatThread/ToolBlock.d.ts +0 -19
  332. package/dist/types/src/components/ChatThread/ToolBlock.d.ts.map +0 -1
  333. package/dist/types/src/components/PromptSettings.d.ts +0 -6
  334. package/dist/types/src/components/PromptSettings.d.ts.map +0 -1
  335. package/dist/types/src/components/SequenceContainer.d.ts +0 -8
  336. package/dist/types/src/components/SequenceContainer.d.ts.map +0 -1
  337. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts +0 -13
  338. package/dist/types/src/components/SequenceEditor/SequenceEditor.d.ts.map +0 -1
  339. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts +0 -263
  340. package/dist/types/src/components/SequenceEditor/SequenceEditor.stories.d.ts.map +0 -1
  341. package/dist/types/src/components/SequenceEditor/index.d.ts +0 -2
  342. package/dist/types/src/components/SequenceEditor/index.d.ts.map +0 -1
  343. package/dist/types/src/components/Toolbar/Toolbar.d.ts +0 -4
  344. package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +0 -1
  345. package/dist/types/src/components/Toolbar/index.d.ts +0 -2
  346. package/dist/types/src/components/Toolbar/index.d.ts.map +0 -1
  347. package/dist/types/src/components/Toolbar/useChatToolbarActions.d.ts.map +0 -1
  348. package/dist/types/src/execution-graph/execution-graph.d.ts +0 -21
  349. package/dist/types/src/execution-graph/execution-graph.d.ts.map +0 -1
  350. package/dist/types/src/execution-graph/index.d.ts +0 -2
  351. package/dist/types/src/execution-graph/index.d.ts.map +0 -1
  352. package/dist/types/src/functions/list.d.ts.map +0 -1
  353. package/dist/types/src/functions/load.d.ts.map +0 -1
  354. package/dist/types/src/hooks/useExecutionGraph.d.ts +0 -7
  355. package/dist/types/src/hooks/useExecutionGraph.d.ts.map +0 -1
  356. package/dist/types/src/hooks/useMatcherExtension.d.ts +0 -3
  357. package/dist/types/src/hooks/useMatcherExtension.d.ts.map +0 -1
  358. package/dist/types/src/hooks/useResolveRef.d.ts +0 -4
  359. package/dist/types/src/hooks/useResolveRef.d.ts.map +0 -1
  360. package/dist/types/src/parser/filter-generator.d.ts +0 -4
  361. package/dist/types/src/parser/filter-generator.d.ts.map +0 -1
  362. package/dist/types/src/parser/filter-generator.test.d.ts +0 -2
  363. package/dist/types/src/parser/filter-generator.test.d.ts.map +0 -1
  364. package/dist/types/src/parser/index.d.ts +0 -4
  365. package/dist/types/src/parser/index.d.ts.map +0 -1
  366. package/dist/types/src/parser/query-parser.d.ts +0 -15
  367. package/dist/types/src/parser/query-parser.d.ts.map +0 -1
  368. package/dist/types/src/parser/query-parser.test.d.ts +0 -2
  369. package/dist/types/src/parser/query-parser.test.d.ts.map +0 -1
  370. package/dist/types/src/parser/types.d.ts +0 -24
  371. package/dist/types/src/parser/types.d.ts.map +0 -1
  372. package/dist/types/src/stories/Chat.stories.d.ts +0 -26
  373. package/dist/types/src/stories/Chat.stories.d.ts.map +0 -1
  374. package/dist/types/src/stories/components/BlueprintContainer.d.ts +0 -4
  375. package/dist/types/src/stories/components/BlueprintContainer.d.ts.map +0 -1
  376. package/dist/types/src/stories/components/ChatContainer.d.ts +0 -4
  377. package/dist/types/src/stories/components/ChatContainer.d.ts.map +0 -1
  378. package/dist/types/src/stories/components/CommentsContainer.d.ts +0 -4
  379. package/dist/types/src/stories/components/CommentsContainer.d.ts.map +0 -1
  380. package/dist/types/src/stories/components/GraphContainer.d.ts +0 -6
  381. package/dist/types/src/stories/components/GraphContainer.d.ts.map +0 -1
  382. package/dist/types/src/stories/components/LoggingContainer.d.ts +0 -4
  383. package/dist/types/src/stories/components/LoggingContainer.d.ts.map +0 -1
  384. package/dist/types/src/stories/components/MessageContainer.d.ts +0 -4
  385. package/dist/types/src/stories/components/MessageContainer.d.ts.map +0 -1
  386. package/dist/types/src/stories/components/SurfaceContainer.d.ts +0 -8
  387. package/dist/types/src/stories/components/SurfaceContainer.d.ts.map +0 -1
  388. package/dist/types/src/stories/components/TasksContainer.d.ts +0 -4
  389. package/dist/types/src/stories/components/TasksContainer.d.ts.map +0 -1
  390. package/dist/types/src/stories/components/TokenManagerContainer.d.ts +0 -3
  391. package/dist/types/src/stories/components/TokenManagerContainer.d.ts.map +0 -1
  392. package/dist/types/src/stories/components/index.d.ts +0 -11
  393. package/dist/types/src/stories/components/index.d.ts.map +0 -1
  394. package/dist/types/src/stories/components/types.d.ts +0 -7
  395. package/dist/types/src/stories/components/types.d.ts.map +0 -1
  396. package/dist/types/src/stories/testing/data.d.ts +0 -5
  397. package/dist/types/src/stories/testing/data.d.ts.map +0 -1
  398. package/dist/types/src/stories/testing/index.d.ts +0 -3
  399. package/dist/types/src/stories/testing/index.d.ts.map +0 -1
  400. package/dist/types/src/stories/testing/testing.d.ts +0 -44
  401. package/dist/types/src/stories/testing/testing.d.ts.map +0 -1
  402. package/dist/types/src/testing/test-data.d.ts +0 -4
  403. package/dist/types/src/testing/test-data.d.ts.map +0 -1
  404. package/dist/types/src/testing/test-functions.d.ts +0 -6
  405. package/dist/types/src/testing/test-functions.d.ts.map +0 -1
  406. package/src/components/ChatThread/ChatMessage.tsx +0 -334
  407. package/src/components/PromptSettings.tsx +0 -90
  408. package/src/components/SequenceContainer.tsx +0 -131
  409. package/src/components/SequenceEditor/SequenceEditor.stories.tsx +0 -33
  410. package/src/components/SequenceEditor/SequenceEditor.tsx +0 -50
  411. package/src/components/SequenceEditor/index.ts +0 -5
  412. package/src/execution-graph/execution-graph.ts +0 -211
  413. package/src/execution-graph/index.ts +0 -5
  414. package/src/hooks/useExecutionGraph.ts +0 -20
  415. package/src/hooks/useMatcherExtension.ts +0 -45
  416. package/src/hooks/useResolveRef.ts +0 -33
  417. package/src/parser/filter-generator.test.ts +0 -32
  418. package/src/parser/filter-generator.ts +0 -76
  419. package/src/parser/index.ts +0 -7
  420. package/src/parser/query-parser.test.ts +0 -139
  421. package/src/parser/query-parser.ts +0 -199
  422. package/src/parser/types.ts +0 -36
  423. package/src/stories/Chat.stories.tsx +0 -469
  424. package/src/stories/components/BlueprintContainer.tsx +0 -32
  425. package/src/stories/components/ChatContainer.tsx +0 -57
  426. package/src/stories/components/CommentsContainer.tsx +0 -25
  427. package/src/stories/components/GraphContainer.tsx +0 -118
  428. package/src/stories/components/LoggingContainer.tsx +0 -21
  429. package/src/stories/components/MessageContainer.tsx +0 -27
  430. package/src/stories/components/SurfaceContainer.tsx +0 -52
  431. package/src/stories/components/TasksContainer.tsx +0 -49
  432. package/src/stories/components/TokenManagerContainer.tsx +0 -14
  433. package/src/stories/components/index.ts +0 -15
  434. package/src/stories/components/types.ts +0 -11
  435. package/src/stories/testing/data.ts +0 -142
  436. package/src/stories/testing/index.ts +0 -6
  437. package/src/stories/testing/testing.tsx +0 -254
  438. package/src/testing/test-data.ts +0 -109
  439. package/src/testing/test-functions.ts +0 -16
  440. /package/dist/lib/browser/{blueprint-definition-CRZPIA5A.mjs.map → blueprint-definition-AGTDXTXO.mjs.map} +0 -0
  441. /package/dist/lib/node-esm/{blueprint-definition-275J3XL2.mjs.map → blueprint-definition-CFCUD2VC.mjs.map} +0 -0
@@ -0,0 +1,1520 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ AiChatProcessor,
4
+ AiServicePresets
5
+ } from "./chunk-7ZYOYW7F.mjs";
6
+ import {
7
+ meta
8
+ } from "./chunk-WE6KTH72.mjs";
9
+
10
+ // src/hooks/useBlueprintRegistry.ts
11
+ import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
12
+ import { useSignalEffect } from "@preact/signals-react";
13
+ import { useCallback, useMemo, useState } from "react";
14
+ import { Capabilities, useCapabilities } from "@dxos/app-framework";
15
+ import { Blueprint } from "@dxos/blueprints";
16
+ import { Filter, Obj, Ref } from "@dxos/echo";
17
+ import { useQuery } from "@dxos/react-client/echo";
18
+ import { distinctBy, isNonNullable } from "@dxos/util";
19
+ var useBlueprintRegistry = () => {
20
+ const blueprints = useCapabilities(Capabilities.BlueprintDefinition);
21
+ return useMemo(() => new Blueprint.Registry(blueprints), [
22
+ blueprints
23
+ ]);
24
+ };
25
+ var useBlueprints = ({ blueprintRegistry, space }) => {
26
+ const staticBlueprints = useMemo(() => blueprintRegistry?.query() ?? [], [
27
+ blueprintRegistry
28
+ ]);
29
+ const spaceBlueprints = useQuery(space, Filter.type(Blueprint.Blueprint));
30
+ return useMemo(() => {
31
+ const blueprints = distinctBy([
32
+ ...staticBlueprints,
33
+ ...spaceBlueprints
34
+ ], (b) => b.key);
35
+ blueprints.sort(({ name: a }, { name: b }) => a.localeCompare(b));
36
+ return blueprints;
37
+ }, [
38
+ staticBlueprints,
39
+ spaceBlueprints
40
+ ]);
41
+ };
42
+ var useActiveBlueprints = ({ context }) => {
43
+ var _effect = _useSignals();
44
+ try {
45
+ const [active, setActive] = useState(/* @__PURE__ */ new Map());
46
+ useSignalEffect(() => {
47
+ const refs = [
48
+ ...context?.blueprints.value ?? []
49
+ ];
50
+ const blueprints = refs.map((ref) => ref.target).filter(isNonNullable);
51
+ setActive(new Map(blueprints.map((blueprint) => [
52
+ blueprint.key,
53
+ blueprint
54
+ ])));
55
+ });
56
+ return active;
57
+ } finally {
58
+ _effect.f();
59
+ }
60
+ };
61
+ var useBlueprintHandlers = ({ space, context, blueprintRegistry }) => {
62
+ const onUpdateBlueprint = useCallback(async (key, checked) => {
63
+ if (!context || !blueprintRegistry) {
64
+ return;
65
+ }
66
+ const { objects } = await space.db.query(Filter.type(Blueprint.Blueprint)).run();
67
+ let storedBlueprint = objects.find((blueprint) => blueprint.key === key);
68
+ if (checked) {
69
+ if (!storedBlueprint) {
70
+ const blueprint = blueprintRegistry.getByKey(key);
71
+ if (!blueprint) {
72
+ return;
73
+ }
74
+ storedBlueprint = space.db.add(Obj.clone(blueprint));
75
+ }
76
+ await context.bind({
77
+ blueprints: [
78
+ Ref.make(storedBlueprint)
79
+ ]
80
+ });
81
+ } else if (storedBlueprint) {
82
+ await context.unbind({
83
+ blueprints: [
84
+ Ref.make(storedBlueprint)
85
+ ]
86
+ });
87
+ }
88
+ }, [
89
+ space,
90
+ context,
91
+ blueprintRegistry
92
+ ]);
93
+ return {
94
+ onUpdateBlueprint
95
+ };
96
+ };
97
+
98
+ // src/hooks/useChatProcessor.ts
99
+ import { RegistryContext } from "@effect-rx/rx-react";
100
+ import { useContext, useMemo as useMemo2, useState as useState2 } from "react";
101
+ import { AiConversation } from "@dxos/assistant";
102
+ import { log } from "@dxos/log";
103
+ import { useAsyncEffect } from "@dxos/react-ui";
104
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useChatProcessor.ts";
105
+ var useChatProcessor = ({ chat, preset, services, blueprintRegistry, settings }) => {
106
+ const observableRegistry = useContext(RegistryContext);
107
+ const [conversation, setConversation] = useState2();
108
+ useAsyncEffect(async () => {
109
+ if (!chat?.queue.target) {
110
+ return;
111
+ }
112
+ const conversation2 = new AiConversation(chat.queue.target);
113
+ await conversation2.open();
114
+ setConversation(conversation2);
115
+ return () => {
116
+ void conversation2.close();
117
+ };
118
+ }, [
119
+ chat?.queue.target
120
+ ]);
121
+ const processor = useMemo2(() => {
122
+ if (!services || !conversation) {
123
+ return void 0;
124
+ }
125
+ log("creating processor", {
126
+ preset,
127
+ model: preset?.model,
128
+ settings
129
+ }, {
130
+ F: __dxlog_file,
131
+ L: 60,
132
+ S: void 0,
133
+ C: (f, a) => f(...a)
134
+ });
135
+ return new AiChatProcessor(conversation, services, {
136
+ observableRegistry,
137
+ blueprintRegistry,
138
+ model: preset?.model
139
+ });
140
+ }, [
141
+ services,
142
+ conversation,
143
+ blueprintRegistry,
144
+ preset
145
+ ]);
146
+ return processor;
147
+ };
148
+
149
+ // src/hooks/useChatServices.ts
150
+ import * as Effect from "effect/Effect";
151
+ import { useMemo as useMemo3 } from "react";
152
+ import { useCapability } from "@dxos/app-framework";
153
+ import { TracingService } from "@dxos/functions";
154
+ import { AutomationCapabilities } from "@dxos/plugin-automation";
155
+ import { useClient } from "@dxos/react-client";
156
+ var useChatServices = ({ space, chat }) => {
157
+ const client = useClient();
158
+ space ??= client.spaces.default;
159
+ const runtimeResolver = useCapability(AutomationCapabilities.ComputeRuntime);
160
+ return useMemo3(() => {
161
+ const runtime2 = runtimeResolver.getRuntime(space.id);
162
+ return () => runtime2.runPromise(Effect.gen(function* () {
163
+ return yield* Effect.runtime().pipe(Effect.provide(chat?.traceQueue?.target ? TracingService.layerQueue(chat.traceQueue?.target) : TracingService.layerNoop));
164
+ }));
165
+ }, [
166
+ space,
167
+ chat?.traceQueue?.target
168
+ ]);
169
+ };
170
+
171
+ // src/hooks/useContextBinder.ts
172
+ import { useState as useState3 } from "react";
173
+ import { AiContextBinder } from "@dxos/assistant";
174
+ import { useAsyncEffect as useAsyncEffect2 } from "@dxos/react-ui";
175
+ var useContextBinder = (chat) => {
176
+ const [binder, setBinder] = useState3();
177
+ useAsyncEffect2(async () => {
178
+ if (!chat?.queue.target) {
179
+ return;
180
+ }
181
+ const binder2 = new AiContextBinder(chat.queue.target);
182
+ await binder2.open();
183
+ setBinder(binder2);
184
+ return () => {
185
+ void binder2.close();
186
+ };
187
+ }, [
188
+ chat?.queue.target
189
+ ]);
190
+ return binder;
191
+ };
192
+
193
+ // src/hooks/useContextObjects.ts
194
+ import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
195
+ import { useCallback as useCallback2 } from "react";
196
+ import { Ref as Ref2 } from "@dxos/echo";
197
+ import { log as log2 } from "@dxos/log";
198
+ import { isNonNullable as isNonNullable2 } from "@dxos/util";
199
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/hooks/useContextObjects.ts";
200
+ var useContextObjects = ({ space, context }) => {
201
+ var _effect = _useSignals2();
202
+ try {
203
+ const objects = context?.objects.value.map((ref) => ref.target).filter(isNonNullable2) ?? [];
204
+ const handleUpdateObject = useCallback2(async (dxn, checked) => {
205
+ if (!space || !context) {
206
+ return;
207
+ }
208
+ const id = dxn.asEchoDXN();
209
+ const object = id && await space.db.getObjectById(id.echoId);
210
+ if (!object) {
211
+ log2.warn("Object not found", {
212
+ dxn,
213
+ id
214
+ }, {
215
+ F: __dxlog_file2,
216
+ L: 40,
217
+ S: void 0,
218
+ C: (f, a) => f(...a)
219
+ });
220
+ return;
221
+ }
222
+ const ref = Ref2.fromDXN(dxn);
223
+ if (checked) {
224
+ await context.bind({
225
+ objects: [
226
+ ref
227
+ ]
228
+ });
229
+ } else {
230
+ await context.unbind({
231
+ objects: [
232
+ ref
233
+ ]
234
+ });
235
+ }
236
+ }, [
237
+ space,
238
+ context
239
+ ]);
240
+ return {
241
+ objects,
242
+ onUpdateObject: handleUpdateObject
243
+ };
244
+ } finally {
245
+ _effect.f();
246
+ }
247
+ };
248
+
249
+ // src/hooks/useFlush.ts
250
+ import { useCallback as useCallback3, useRef, useState as useState4 } from "react";
251
+ var useFlush = (space) => {
252
+ const [state, setState] = useState4("idle");
253
+ const resetTimer = useRef(null);
254
+ const handleFlush = useCallback3(() => {
255
+ if (!space) {
256
+ return;
257
+ }
258
+ queueMicrotask(async () => {
259
+ if (resetTimer.current) {
260
+ clearTimeout(resetTimer.current);
261
+ }
262
+ setState("flushing");
263
+ await space.db.flush();
264
+ setState("flushed");
265
+ resetTimer.current = setTimeout(() => {
266
+ setState("idle");
267
+ resetTimer.current = null;
268
+ }, 1e3);
269
+ });
270
+ }, [
271
+ space
272
+ ]);
273
+ return {
274
+ state,
275
+ handleFlush
276
+ };
277
+ };
278
+
279
+ // src/hooks/useItemTypes.ts
280
+ import * as Option from "effect/Option";
281
+ import { useEffect, useState as useState5 } from "react";
282
+ import { ItemAnnotation } from "@dxos/schema";
283
+ var useItemTypes = (space) => {
284
+ const [types, setTypes] = useState5([]);
285
+ useEffect(() => {
286
+ if (!space) {
287
+ return;
288
+ }
289
+ return space.db.schemaRegistry.query().subscribe((query) => {
290
+ const types2 = Array.from(new Set([
291
+ ...space.db.graph.schemaRegistry.schemas,
292
+ ...query.results
293
+ ].filter((type) => Option.isSome(ItemAnnotation.get(type)))));
294
+ setTypes(types2);
295
+ }, {
296
+ fire: true
297
+ });
298
+ }, [
299
+ space
300
+ ]);
301
+ return types;
302
+ };
303
+
304
+ // src/hooks/useOnline.ts
305
+ import { useState as useState6 } from "react";
306
+ var useOnline = () => {
307
+ const [online, setOnline] = useState6(true);
308
+ return [
309
+ online,
310
+ setOnline
311
+ ];
312
+ };
313
+
314
+ // src/hooks/usePresets.ts
315
+ import { useCallback as useCallback4, useEffect as useEffect2, useMemo as useMemo4, useState as useState7 } from "react";
316
+ var usePresets = (online) => {
317
+ const [preset, setPreset] = useState7();
318
+ const presets = useMemo4(() => AiServicePresets.filter((preset2) => online === (preset2.provider === "dxos-remote")), [
319
+ online
320
+ ]);
321
+ const presetOptions = useMemo4(() => presets.map(({ id, model, label }) => ({
322
+ id,
323
+ label: label ?? model
324
+ })), [
325
+ presets
326
+ ]);
327
+ useEffect2(() => {
328
+ setPreset(presets[0]);
329
+ }, [
330
+ presets
331
+ ]);
332
+ const handlePresetChange = useCallback4((id) => {
333
+ const preset2 = presets.find((preset3) => preset3.id === id);
334
+ if (preset2) {
335
+ setPreset(preset2);
336
+ }
337
+ }, [
338
+ presets
339
+ ]);
340
+ return {
341
+ preset,
342
+ presets: presetOptions,
343
+ onPresetChange: handlePresetChange
344
+ };
345
+ };
346
+
347
+ // src/hooks/useReferencesProvider.ts
348
+ import { useMemo as useMemo5 } from "react";
349
+ import { Capabilities as Capabilities2, useCapabilities as useCapabilities2 } from "@dxos/app-framework";
350
+ import { Filter as Filter2, Obj as Obj2 } from "@dxos/echo";
351
+ var useReferencesProvider = (space) => {
352
+ const blueprints = useCapabilities2(Capabilities2.BlueprintDefinition);
353
+ return useMemo5(() => {
354
+ if (!space) {
355
+ return void 0;
356
+ }
357
+ return {
358
+ getReferences: async ({ query }) => {
359
+ const { objects } = await space.db.query(Filter2.everything()).run();
360
+ return objects.filter((object) => stringMatch(query, Obj2.getLabel(object) ?? "")).filter((object) => !!Obj2.getDXN(object)).map((object) => ({
361
+ uri: Obj2.getDXN(object).toString(),
362
+ label: Obj2.getLabel(object) ?? ""
363
+ }));
364
+ },
365
+ resolveReference: async ({ uri }) => {
366
+ const object = await space.db.query(Filter2.ids(uri)).first();
367
+ return {
368
+ uri,
369
+ label: Obj2.getLabel(object) ?? ""
370
+ };
371
+ }
372
+ };
373
+ }, [
374
+ space,
375
+ blueprints
376
+ ]);
377
+ };
378
+ var stringMatch = (query, label) => label.toLowerCase().startsWith(query.toLowerCase());
379
+
380
+ // src/components/Chat/Chat.tsx
381
+ import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
382
+ import { Prec } from "@codemirror/state";
383
+ import { keymap } from "@codemirror/view";
384
+ import { useRxValue } from "@effect-rx/rx-react";
385
+ import { createContext } from "@radix-ui/react-context";
386
+ import * as Array2 from "effect/Array";
387
+ import * as Option2 from "effect/Option";
388
+ import React9, { useCallback as useCallback6, useEffect as useEffect6, useMemo as useMemo9, useRef as useRef3, useState as useState12 } from "react";
389
+ import { Event } from "@dxos/async";
390
+ import { Obj as Obj5 } from "@dxos/echo";
391
+ import { useVoiceInput } from "@dxos/plugin-transcription";
392
+ import { getSpace, useQueue } from "@dxos/react-client/echo";
393
+ import { useIdentity } from "@dxos/react-client/halo";
394
+ import { Input, useDynamicRef, useTranslation as useTranslation5 } from "@dxos/react-ui";
395
+ import { ChatEditor, references } from "@dxos/react-ui-chat";
396
+ import { mx as mx5 } from "@dxos/react-ui-theme";
397
+ import { DataType } from "@dxos/schema";
398
+ import { isTruthy } from "@dxos/util";
399
+
400
+ // src/components/ChatPrompt/ChatActions.tsx
401
+ import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
402
+ import React from "react";
403
+ import { IconButton, useTranslation } from "@dxos/react-ui";
404
+ import { mx } from "@dxos/react-ui-theme";
405
+ var ChatActions = ({ classNames, children, microphone, recording, processing, onEvent }) => {
406
+ var _effect = _useSignals3();
407
+ try {
408
+ const { t } = useTranslation(meta.id);
409
+ return /* @__PURE__ */ React.createElement("div", {
410
+ className: mx("flex items-center mie-1", classNames)
411
+ }, children, /* @__PURE__ */ React.createElement(IconButton, {
412
+ disabled: !processing,
413
+ variant: "ghost",
414
+ size: 5,
415
+ icon: "ph--x--regular",
416
+ iconOnly: true,
417
+ label: t("button cancel processing"),
418
+ onClick: () => onEvent?.({
419
+ type: "cancel"
420
+ })
421
+ }), microphone && /* @__PURE__ */ React.createElement(IconButton, {
422
+ disabled: !processing,
423
+ classNames: mx(recording && "bg-primary-500"),
424
+ variant: "ghost",
425
+ size: 5,
426
+ icon: "ph--microphone--regular",
427
+ iconOnly: true,
428
+ noTooltip: true,
429
+ label: t("button microphone"),
430
+ onMouseDown: () => onEvent?.({
431
+ type: "record-start"
432
+ }),
433
+ onMouseUp: () => onEvent?.({
434
+ type: "record-stop"
435
+ }),
436
+ onTouchStart: () => onEvent?.({
437
+ type: "record-start"
438
+ }),
439
+ onTouchEnd: () => onEvent?.({
440
+ type: "record-stop"
441
+ })
442
+ }));
443
+ } finally {
444
+ _effect.f();
445
+ }
446
+ };
447
+
448
+ // src/components/ChatPrompt/ChatOptions.tsx
449
+ import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
450
+ import React2, { useMemo as useMemo6, useState as useState8 } from "react";
451
+ import { Filter as Filter3, Obj as Obj3, Type } from "@dxos/echo";
452
+ import { useQuery as useQuery2 } from "@dxos/react-client/echo";
453
+ import { Icon, IconButton as IconButton2, Popover, Select, useTranslation as useTranslation2 } from "@dxos/react-ui";
454
+ import { Listbox, SearchList } from "@dxos/react-ui-searchlist";
455
+ import { Tabs } from "@dxos/react-ui-tabs";
456
+ var panelClassNames = "is-[calc(100dvw-.5rem)] sm:is-max md:is-72 max-is-[--text-content]";
457
+ var ChatOptions = ({ space, context, blueprintRegistry, presets, preset, onPresetChange }) => {
458
+ var _effect = _useSignals4();
459
+ try {
460
+ const { t } = useTranslation2(meta.id);
461
+ return /* @__PURE__ */ React2.createElement("div", {
462
+ role: "none",
463
+ className: "flex gap-0.5"
464
+ }, /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
465
+ asChild: true
466
+ }, /* @__PURE__ */ React2.createElement(IconButton2, {
467
+ variant: "ghost",
468
+ icon: "ph--plus--regular",
469
+ iconOnly: true,
470
+ size: 5,
471
+ label: t("button context objects")
472
+ })), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
473
+ side: "top",
474
+ classNames: panelClassNames
475
+ }, /* @__PURE__ */ React2.createElement(ObjectsPanel, {
476
+ space,
477
+ context
478
+ }), /* @__PURE__ */ React2.createElement(Popover.Arrow, null)))), /* @__PURE__ */ React2.createElement(Popover.Root, null, /* @__PURE__ */ React2.createElement(Popover.Trigger, {
479
+ asChild: true
480
+ }, /* @__PURE__ */ React2.createElement(IconButton2, {
481
+ variant: "ghost",
482
+ icon: "ph--sliders-horizontal--regular",
483
+ iconOnly: true,
484
+ size: 5,
485
+ label: t("button context settings")
486
+ })), /* @__PURE__ */ React2.createElement(Popover.Portal, null, /* @__PURE__ */ React2.createElement(Popover.Content, {
487
+ side: "top",
488
+ classNames: panelClassNames
489
+ }, /* @__PURE__ */ React2.createElement(Tabs.Root, {
490
+ orientation: "horizontal",
491
+ defaultValue: "blueprints",
492
+ defaultActivePart: "list",
493
+ tabIndex: -1
494
+ }, /* @__PURE__ */ React2.createElement(Tabs.Viewport, {
495
+ classNames: 'max-bs-[--radix-popover-content-available-height] grid grid-rows-[1fr_min-content] [&_[cmdk-root]]:contents [&_[role="tabpanel"]]:grid [&_[role="tabpanel"]]:grid-rows-[1fr_min-content] [&_[role="listbox"]]:min-bs-0 [&_[role="listbox"]]:overflow-y-auto [&_[role="tabpanel"]]:min-bs-0 [&_[role="tabpanel"]]:pli-cardSpacingChrome [&_[role="tabpanel"][data-state="active"]]:order-first [&_[role="tabpanel"][data-state="inactive"]]:hidden'
496
+ }, /* @__PURE__ */ React2.createElement(Tabs.Tabpanel, {
497
+ value: "blueprints",
498
+ tabIndex: -1,
499
+ classNames: "dx-focus-ring-inset"
500
+ }, /* @__PURE__ */ React2.createElement(BlueprintsPanel, {
501
+ blueprintRegistry,
502
+ space,
503
+ context
504
+ })), /* @__PURE__ */ React2.createElement(Tabs.Tabpanel, {
505
+ value: "model",
506
+ tabIndex: -1,
507
+ classNames: "dx-focus-ring-inset !pli-0"
508
+ }, /* @__PURE__ */ React2.createElement(ModelsPanel, {
509
+ presets,
510
+ preset,
511
+ onPresetChange
512
+ })), /* @__PURE__ */ React2.createElement(Tabs.Tablist, {
513
+ classNames: "sm:overflow-x-hidden justify-center p-[--dx-cardSpacingChrome] border-bs border-subduedSeparator order-last"
514
+ }, /* @__PURE__ */ React2.createElement(Tabs.IconTab, {
515
+ value: "blueprints",
516
+ icon: "ph--blueprint--regular",
517
+ label: t("blueprints in context title")
518
+ }), /* @__PURE__ */ React2.createElement(Tabs.IconTab, {
519
+ value: "model",
520
+ label: t("chat model title"),
521
+ icon: "ph--cpu--regular"
522
+ })))), /* @__PURE__ */ React2.createElement(Popover.Arrow, null)))));
523
+ } finally {
524
+ _effect.f();
525
+ }
526
+ };
527
+ var BlueprintsPanel = ({ blueprintRegistry, space, context }) => {
528
+ var _effect = _useSignals4();
529
+ try {
530
+ const { t } = useTranslation2(meta.id);
531
+ const blueprints = useBlueprints({
532
+ blueprintRegistry,
533
+ space
534
+ });
535
+ const activeBlueprints = useActiveBlueprints({
536
+ context
537
+ });
538
+ const { onUpdateBlueprint } = useBlueprintHandlers({
539
+ space,
540
+ context,
541
+ blueprintRegistry
542
+ });
543
+ return /* @__PURE__ */ React2.createElement(SearchList.Root, null, /* @__PURE__ */ React2.createElement(SearchList.Content, {
544
+ classNames: "plb-cardSpacingChrome"
545
+ }, blueprints.map((blueprint) => {
546
+ const isActive = activeBlueprints.has(blueprint.key);
547
+ return /* @__PURE__ */ React2.createElement(SearchList.Item, {
548
+ classNames: "flex items-center overflow-hidden",
549
+ key: blueprint.key,
550
+ value: blueprint.name,
551
+ onSelect: () => onUpdateBlueprint?.(blueprint.key, !isActive)
552
+ }, /* @__PURE__ */ React2.createElement("div", {
553
+ className: "grow truncate"
554
+ }, blueprint.name), /* @__PURE__ */ React2.createElement(Icon, {
555
+ icon: "ph--check--regular",
556
+ classNames: [
557
+ !isActive && "invisible"
558
+ ]
559
+ }));
560
+ })), /* @__PURE__ */ React2.createElement(SearchList.Input, {
561
+ placeholder: t("search placeholder"),
562
+ classNames: "mbe-cardSpacingChrome",
563
+ autoFocus: true
564
+ }));
565
+ } finally {
566
+ _effect.f();
567
+ }
568
+ };
569
+ var ModelsPanel = ({ presets, preset, onPresetChange }) => {
570
+ var _effect = _useSignals4();
571
+ try {
572
+ return /* @__PURE__ */ React2.createElement(Listbox.Root, {
573
+ value: preset,
574
+ onValueChange: onPresetChange,
575
+ autoFocus: true
576
+ }, presets?.map(({ id, label }) => {
577
+ return /* @__PURE__ */ React2.createElement(Listbox.Option, {
578
+ key: id,
579
+ value: id
580
+ }, /* @__PURE__ */ React2.createElement(Listbox.OptionLabel, null, label), /* @__PURE__ */ React2.createElement(Listbox.OptionIndicator, null));
581
+ }));
582
+ } finally {
583
+ _effect.f();
584
+ }
585
+ };
586
+ var ANY = "__any__";
587
+ var ObjectsPanel = ({ space, context }) => {
588
+ var _effect = _useSignals4();
589
+ try {
590
+ const { t } = useTranslation2(meta.id);
591
+ const types = useItemTypes(space);
592
+ const typenames = useMemo6(() => {
593
+ const typenames2 = types.map((type) => {
594
+ const typename2 = Type.getTypename(type);
595
+ return {
596
+ typename: typename2,
597
+ label: t("typename label", {
598
+ ns: typename2,
599
+ defaultValue: typename2
600
+ })
601
+ };
602
+ });
603
+ typenames2.sort((a, b) => a.label.localeCompare(b.label));
604
+ return typenames2;
605
+ }, [
606
+ types
607
+ ]);
608
+ const [typename, setTypename] = useState8(ANY);
609
+ const anyFilter = useMemo6(() => Filter3.or(...typenames.map(({ typename: typename2 }) => Filter3.typename(typename2))), [
610
+ typenames
611
+ ]);
612
+ const objects = useQuery2(space, typename === ANY ? anyFilter : Filter3.typename(typename));
613
+ const { objects: contextObjects, onUpdateObject } = useContextObjects({
614
+ space,
615
+ context
616
+ });
617
+ return /* @__PURE__ */ React2.createElement(SearchList.Root, null, /* @__PURE__ */ React2.createElement(SearchList.Content, {
618
+ classNames: "p-cardSpacingChrome [&:has([cmdk-list-sizer]:empty)]:plb-0"
619
+ }, objects.length ? objects.map((object) => {
620
+ const label = Obj3.getLabel(object) ?? Obj3.getTypename(object) ?? object.id;
621
+ const isActive = contextObjects.findIndex((obj) => obj.id === object.id) !== -1;
622
+ return /* @__PURE__ */ React2.createElement(SearchList.Item, {
623
+ classNames: "flex items-center overflow-hidden",
624
+ key: object.id,
625
+ value: object.id,
626
+ onSelect: () => onUpdateObject?.(Obj3.getDXN(object), !isActive)
627
+ }, /* @__PURE__ */ React2.createElement("div", {
628
+ className: "grow truncate"
629
+ }, label), /* @__PURE__ */ React2.createElement(Icon, {
630
+ icon: "ph--check--regular",
631
+ classNames: [
632
+ !isActive && "invisible"
633
+ ]
634
+ }));
635
+ }) : /* @__PURE__ */ React2.createElement(SearchList.Item, null, t("no results"))), /* @__PURE__ */ React2.createElement("div", {
636
+ role: "none",
637
+ className: "grid grid-cols-[min-content_1fr] gap-2 pli-cardSpacingChrome mbe-cardSpacingChrome"
638
+ }, /* @__PURE__ */ React2.createElement(Select.Root, {
639
+ value: typename === ANY ? void 0 : typename,
640
+ onValueChange: setTypename
641
+ }, /* @__PURE__ */ React2.createElement(Select.TriggerButton, {
642
+ density: "fine",
643
+ placeholder: t("type filter placeholder")
644
+ }), /* @__PURE__ */ React2.createElement(Select.Portal, null, /* @__PURE__ */ React2.createElement(Select.Content, null, /* @__PURE__ */ React2.createElement(Select.ScrollUpButton, null), /* @__PURE__ */ React2.createElement(Select.Viewport, null, /* @__PURE__ */ React2.createElement(Select.Option, {
645
+ value: ANY
646
+ }, t("any type filter label")), typenames.map(({ typename: typename2, label }) => /* @__PURE__ */ React2.createElement(Select.Option, {
647
+ key: typename2,
648
+ value: typename2
649
+ }, label))), /* @__PURE__ */ React2.createElement(Select.ScrollDownButton, null), /* @__PURE__ */ React2.createElement(Select.Arrow, null)))), /* @__PURE__ */ React2.createElement(SearchList.Input, {
650
+ placeholder: t("search placeholder"),
651
+ classNames: "mbe-0",
652
+ autoFocus: true
653
+ })));
654
+ } finally {
655
+ _effect.f();
656
+ }
657
+ };
658
+
659
+ // src/components/ChatPrompt/ChatPresets.tsx
660
+ import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
661
+ import React3 from "react";
662
+ import { Select as Select2 } from "@dxos/react-ui";
663
+
664
+ // src/components/ChatPrompt/ChatReferences.tsx
665
+ import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
666
+ import React4 from "react";
667
+ import { Obj as Obj4 } from "@dxos/echo";
668
+ import { IconButton as IconButton3, toLocalizedString, useTranslation as useTranslation3 } from "@dxos/react-ui";
669
+ import { mx as mx2 } from "@dxos/react-ui-theme";
670
+ var ChatReferences = ({ classNames, context, space }) => {
671
+ var _effect = _useSignals6();
672
+ try {
673
+ const { t } = useTranslation3(meta.id);
674
+ const { objects, onUpdateObject } = useContextObjects({
675
+ space,
676
+ context
677
+ });
678
+ return /* @__PURE__ */ React4.createElement("ul", {
679
+ className: mx2("flex flex-wrap", classNames)
680
+ }, objects.map((obj) => {
681
+ const dxn = Obj4.getDXN(obj);
682
+ const typename = Obj4.getTypename(obj);
683
+ const label = Obj4.getLabel(obj) ?? (typename ? [
684
+ "object name placeholder",
685
+ {
686
+ ns: typename
687
+ }
688
+ ] : obj.id);
689
+ return /* @__PURE__ */ React4.createElement("li", {
690
+ key: dxn.toString(),
691
+ className: "dx-tag plb-0 pis-2 flex items-center",
692
+ "data-hue": "neutral"
693
+ }, toLocalizedString(label, t), /* @__PURE__ */ React4.createElement(IconButton3, {
694
+ iconOnly: true,
695
+ variant: "ghost",
696
+ label: t("remove object in context label"),
697
+ classNames: "p-0 hover:bg-transparent",
698
+ size: 3,
699
+ icon: "ph--x--bold",
700
+ onClick: () => onUpdateObject?.(dxn, false)
701
+ }));
702
+ }));
703
+ } finally {
704
+ _effect.f();
705
+ }
706
+ };
707
+
708
+ // src/components/ChatPrompt/ChatStatusIndicator.tsx
709
+ import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
710
+ import React5, { useEffect as useEffect3, useState as useState9 } from "react";
711
+ import { Tooltip, useTimeout } from "@dxos/react-ui";
712
+ import { Spinner } from "@dxos/react-ui-sfx";
713
+ import { mx as mx3 } from "@dxos/react-ui-theme";
714
+ var period = 3e3;
715
+ var ChatStatusIndicator = ({ classNames, preset, processing, error, ...props }) => {
716
+ var _effect = _useSignals7();
717
+ try {
718
+ const [init, setInit] = useState9(false);
719
+ useEffect3(() => setInit(false), [
720
+ preset
721
+ ]);
722
+ useTimeout(async () => {
723
+ setInit(true);
724
+ }, period / 2, [
725
+ preset
726
+ ]);
727
+ return /* @__PURE__ */ React5.createElement("div", {
728
+ role: "none",
729
+ className: mx3("relative flex", classNames)
730
+ }, /* @__PURE__ */ React5.createElement(Spinner, {
731
+ duration: period,
732
+ state: !init ? "flash" : error ? "error" : processing ? "spin" : "pulse",
733
+ ...props
734
+ }), error && /* @__PURE__ */ React5.createElement(Tooltip.Trigger, {
735
+ asChild: true,
736
+ content: error.message
737
+ }, /* @__PURE__ */ React5.createElement("div", {
738
+ className: "absolute inset-0"
739
+ })));
740
+ } finally {
741
+ _effect.f();
742
+ }
743
+ };
744
+
745
+ // src/components/ChatThread/ChatThread.tsx
746
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
747
+ import React8, { forwardRef, useCallback as useCallback5, useEffect as useEffect5, useImperativeHandle, useMemo as useMemo8, useState as useState11 } from "react";
748
+ import { PublicKey } from "@dxos/keys";
749
+ import { MarkdownStream } from "@dxos/react-ui-components";
750
+ import { mx as mx4 } from "@dxos/react-ui-theme";
751
+ import { keyToFallback } from "@dxos/util";
752
+
753
+ // src/components/ChatThread/registry.tsx
754
+ import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
755
+ import React7 from "react";
756
+ import { log as log3 } from "@dxos/log";
757
+ import { PromptWidget, ReferenceWidget, SelectWidget, SuggestionWidget, SummaryWidget, ToggleContainer as ToggleContainer2 } from "@dxos/react-ui-components";
758
+ import { getXmlTextChild } from "@dxos/react-ui-editor";
759
+ import { Json as Json2 } from "@dxos/react-ui-syntax-highlighter";
760
+ import { ContentBlock } from "@dxos/schema";
761
+
762
+ // src/components/ToolBlock/ToolBlock.tsx
763
+ import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
764
+ import React6, { useEffect as useEffect4, useMemo as useMemo7, useRef as useRef2, useState as useState10 } from "react";
765
+ import { useTranslation as useTranslation4 } from "@dxos/react-ui";
766
+ import { NumericTabs, TextCrawl, ToggleContainer, chatMessageJson, chatMessagePanel, chatMessagePanelContent, chatMessagePanelHeader } from "@dxos/react-ui-components";
767
+ import { Json } from "@dxos/react-ui-syntax-highlighter";
768
+ import { isNonNullable as isNonNullable3, safeParseJson } from "@dxos/util";
769
+ var ToolBlock = ({ blocks = [] }) => {
770
+ var _effect = _useSignals8();
771
+ try {
772
+ const { t } = useTranslation4(meta.id);
773
+ const getToolCaption = (tool, status) => {
774
+ if (!tool) {
775
+ return t("calling tool label");
776
+ }
777
+ return status?.message ?? tool.description ?? [
778
+ t("calling label"),
779
+ tool.name
780
+ ].join(" ");
781
+ };
782
+ const items = useMemo7(() => {
783
+ let lastToolCall;
784
+ const tools = [];
785
+ return blocks.filter((block) => block._tag === "toolCall" || block._tag === "toolResult" || block._tag === "summary").map((block) => {
786
+ switch (block._tag) {
787
+ case "toolCall": {
788
+ if (block.pending && lastToolCall?.block.toolCallId === block.toolCallId) {
789
+ return null;
790
+ }
791
+ const tool = tools.find((tool2) => tool2.name === block.name);
792
+ lastToolCall = {
793
+ tool,
794
+ block
795
+ };
796
+ return {
797
+ title: getToolCaption(lastToolCall?.tool),
798
+ content: {
799
+ ...block,
800
+ input: safeParseJson(block.input)
801
+ }
802
+ };
803
+ }
804
+ case "toolResult": {
805
+ if (block.error) {
806
+ return {
807
+ title: t("error label"),
808
+ content: block
809
+ };
810
+ }
811
+ const title = getToolCaption(lastToolCall?.tool ?? t("tool result label"));
812
+ lastToolCall = void 0;
813
+ return {
814
+ title,
815
+ content: {
816
+ ...block,
817
+ result: safeParseJson(block.result)
818
+ }
819
+ };
820
+ }
821
+ case "summary": {
822
+ if (!lastToolCall) {
823
+ return null;
824
+ }
825
+ return {
826
+ title: t("summary label"),
827
+ content: block
828
+ };
829
+ }
830
+ }
831
+ }).filter(isNonNullable3);
832
+ }, [
833
+ blocks
834
+ ]);
835
+ if (!items.length) {
836
+ return null;
837
+ }
838
+ return /* @__PURE__ */ React6.createElement(ToolContainer, {
839
+ items
840
+ });
841
+ } finally {
842
+ _effect.f();
843
+ }
844
+ };
845
+ ToolBlock.displayName = "ToolBlock";
846
+ var ToolContainer = ({ items }) => {
847
+ var _effect = _useSignals8();
848
+ try {
849
+ const tabsRef = useRef2(null);
850
+ const [selected, setSelected] = useState10(0);
851
+ const [open, setOpen] = useState10(false);
852
+ useEffect4(() => {
853
+ if (open) {
854
+ tabsRef.current?.focus();
855
+ }
856
+ }, [
857
+ open
858
+ ]);
859
+ const handleSelect = (index) => {
860
+ setSelected(index);
861
+ };
862
+ const data = items[selected]?.content;
863
+ return /* @__PURE__ */ React6.createElement(ToggleContainer.Root, {
864
+ classNames: chatMessagePanel,
865
+ open,
866
+ onChangeOpen: setOpen
867
+ }, /* @__PURE__ */ React6.createElement(ToggleContainer.Header, {
868
+ classNames: chatMessagePanelHeader
869
+ }, /* @__PURE__ */ React6.createElement(TextCrawl, {
870
+ key: "status-roll",
871
+ lines: items.map((item) => item.title)
872
+ })), /* @__PURE__ */ React6.createElement(ToggleContainer.Content, {
873
+ classNames: [
874
+ "grid grid-cols-[32px_1fr]",
875
+ chatMessagePanelContent
876
+ ]
877
+ }, /* @__PURE__ */ React6.createElement(NumericTabs, {
878
+ ref: tabsRef,
879
+ classNames: "p-1",
880
+ length: items.length,
881
+ selected,
882
+ onSelect: handleSelect
883
+ }), /* @__PURE__ */ React6.createElement(Json, {
884
+ data,
885
+ classNames: chatMessageJson,
886
+ replacer: {
887
+ maxDepth: 3,
888
+ maxArrayLen: 10,
889
+ maxStringLen: 128
890
+ }
891
+ })));
892
+ } finally {
893
+ _effect.f();
894
+ }
895
+ };
896
+
897
+ // src/components/ChatThread/registry.tsx
898
+ var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/ChatThread/registry.tsx";
899
+ var Fallback = ({ _tag, ...props }) => {
900
+ var _effect = _useSignals9();
901
+ try {
902
+ return /* @__PURE__ */ React7.createElement(ToggleContainer2.Root, {
903
+ classNames: "rounded-sm"
904
+ }, /* @__PURE__ */ React7.createElement(ToggleContainer2.Header, {
905
+ classNames: "bg-groupSurface"
906
+ }, _tag), /* @__PURE__ */ React7.createElement(ToggleContainer2.Content, {
907
+ classNames: "bg-modalSurface"
908
+ }, /* @__PURE__ */ React7.createElement(Json2, {
909
+ classNames: "!p-2 text-sm",
910
+ data: props
911
+ })));
912
+ } finally {
913
+ _effect.f();
914
+ }
915
+ };
916
+ var componentRegistry = {
917
+ //
918
+ // Widgets
919
+ //
920
+ ["prompt"]: {
921
+ block: true,
922
+ factory: (props) => {
923
+ const text = getXmlTextChild(props.children);
924
+ return text ? new PromptWidget(text) : null;
925
+ }
926
+ },
927
+ ["reference"]: {
928
+ block: false,
929
+ factory: (props) => {
930
+ const text = getXmlTextChild(props.children);
931
+ return text && props.ref ? new ReferenceWidget(text, props.ref) : null;
932
+ }
933
+ },
934
+ ["select"]: {
935
+ block: true,
936
+ factory: (props) => {
937
+ const options = props.children?.map((option) => option._tag === "option" && getXmlTextChild(option.children)).filter(Boolean);
938
+ return options?.length ? new SelectWidget(options) : null;
939
+ }
940
+ },
941
+ ["suggestion"]: {
942
+ block: true,
943
+ factory: (props) => {
944
+ const text = getXmlTextChild(props.children);
945
+ return text ? new SuggestionWidget(text) : null;
946
+ }
947
+ },
948
+ ["summary"]: {
949
+ block: true,
950
+ factory: (props) => {
951
+ const text = getXmlTextChild(props.children);
952
+ return text ? new SummaryWidget(text) : null;
953
+ }
954
+ },
955
+ //
956
+ // React
957
+ //
958
+ ["toolCall"]: {
959
+ block: true,
960
+ Component: ToolBlock
961
+ },
962
+ ["toolResult"]: {
963
+ block: true,
964
+ Component: Fallback
965
+ },
966
+ ["toolkit"]: {
967
+ block: true,
968
+ Component: Fallback
969
+ },
970
+ //
971
+ // Fallback
972
+ //
973
+ ["json"]: {
974
+ block: true,
975
+ Component: Fallback
976
+ }
977
+ };
978
+ var blockToMarkdown = (context, message, block) => {
979
+ let str = _blockToMarkdown(context, message, block);
980
+ if (str && !block.pending) {
981
+ return str += "\n";
982
+ }
983
+ return str;
984
+ };
985
+ var _blockToMarkdown = (context, message, block) => {
986
+ log3("blockToMarkdown", {
987
+ block: JSON.stringify(block)
988
+ }, {
989
+ F: __dxlog_file3,
990
+ L: 125,
991
+ S: void 0,
992
+ C: (f, a) => f(...a)
993
+ });
994
+ switch (block._tag) {
995
+ case "text": {
996
+ if (message.sender.role === "user") {
997
+ return `
998
+ <prompt>${block.text}</prompt>
999
+ `;
1000
+ } else {
1001
+ const text = block.text.trim();
1002
+ if (text.length > 0) {
1003
+ return text;
1004
+ }
1005
+ }
1006
+ break;
1007
+ }
1008
+ case "suggestion": {
1009
+ if (block.pending) {
1010
+ return;
1011
+ }
1012
+ return `<suggestion>${block.text}</suggestion>`;
1013
+ }
1014
+ case "select": {
1015
+ if (block.pending || block.options.length === 0) {
1016
+ return;
1017
+ }
1018
+ return `<select>${block.options.map((option) => `<option>${option}</option>`).join("")}</select>`;
1019
+ }
1020
+ // TODO(burdon): Need label.
1021
+ case "reference": {
1022
+ return `<reference ref="${block.reference.dxn.toString()}">Ref</reference>`;
1023
+ }
1024
+ // case 'toolkit': {
1025
+ // return `<toolkit />`;
1026
+ // }
1027
+ case "toolCall": {
1028
+ context.updateWidget(block.toolCallId, {
1029
+ blocks: [
1030
+ block
1031
+ ]
1032
+ });
1033
+ return `<toolCall id="${block.toolCallId}" />`;
1034
+ }
1035
+ case "toolResult": {
1036
+ context.updateWidget(block.toolCallId, ({ blocks = [] }) => ({
1037
+ blocks: [
1038
+ ...blocks,
1039
+ block
1040
+ ]
1041
+ }));
1042
+ break;
1043
+ }
1044
+ case "summary": {
1045
+ return `<summary>${ContentBlock.createSummaryMessage(block)}</summary>`;
1046
+ }
1047
+ // TODO(burdon): Need stable ID.
1048
+ default: {
1049
+ return `<json id="${message.id}">
1050
+ ${JSON.stringify(block)}
1051
+ </json>`;
1052
+ }
1053
+ }
1054
+ };
1055
+
1056
+ // src/components/ChatThread/sync.ts
1057
+ import { log as log4 } from "@dxos/log";
1058
+ var __dxlog_file4 = "/__w/dxos/dxos/packages/plugins/plugin-assistant/src/components/ChatThread/sync.ts";
1059
+ var MessageThreadContext = class {
1060
+ _widgetState;
1061
+ constructor(_widgetState) {
1062
+ this._widgetState = _widgetState;
1063
+ }
1064
+ updateWidget(id, value) {
1065
+ this._widgetState?.updateWidget(id, value);
1066
+ }
1067
+ };
1068
+ var MessageSyncer = class {
1069
+ _model;
1070
+ _blockRenderer;
1071
+ _initialMessageId;
1072
+ _currentMessageIndex = 0;
1073
+ _currentBlockIndex = 0;
1074
+ _currentBlockContent;
1075
+ _context;
1076
+ constructor(_model, _blockRenderer) {
1077
+ this._model = _model;
1078
+ this._blockRenderer = _blockRenderer;
1079
+ this._context = new MessageThreadContext(this._model);
1080
+ }
1081
+ get context() {
1082
+ return this._context;
1083
+ }
1084
+ reset() {
1085
+ log4("reset", void 0, {
1086
+ F: __dxlog_file4,
1087
+ L: 58,
1088
+ S: this,
1089
+ C: (f, a) => f(...a)
1090
+ });
1091
+ this._initialMessageId = void 0;
1092
+ this._currentMessageIndex = 0;
1093
+ this._currentBlockIndex = 0;
1094
+ this._currentBlockContent = void 0;
1095
+ void this._model.reset("");
1096
+ }
1097
+ sync(messages) {
1098
+ log4("sync", {
1099
+ messages: messages.map((message) => message.blocks.length),
1100
+ currentMessageIndex: this._currentMessageIndex,
1101
+ currentBlockIndex: this._currentBlockIndex,
1102
+ currentBlockContent: this._currentBlockContent
1103
+ }, {
1104
+ F: __dxlog_file4,
1105
+ L: 67,
1106
+ S: this,
1107
+ C: (f, a) => f(...a)
1108
+ });
1109
+ if (this._initialMessageId !== messages[0]?.id) {
1110
+ this.reset();
1111
+ this._initialMessageId = messages[0]?.id;
1112
+ }
1113
+ let i = this._currentMessageIndex;
1114
+ for (const message of messages.slice(this._currentMessageIndex)) {
1115
+ if (i > this._currentMessageIndex) {
1116
+ this._currentBlockIndex = 0;
1117
+ }
1118
+ this._currentMessageIndex = i;
1119
+ let j = this._currentBlockIndex;
1120
+ for (const block of message.blocks.slice(this._currentBlockIndex)) {
1121
+ this._currentBlockIndex = j;
1122
+ const currentBlockContent = this._blockRenderer(this._context, message, block);
1123
+ if (currentBlockContent) {
1124
+ let content = "";
1125
+ if (this._currentBlockContent && currentBlockContent.startsWith(this._currentBlockContent)) {
1126
+ content = currentBlockContent.slice(this._currentBlockContent.length);
1127
+ } else {
1128
+ content = currentBlockContent;
1129
+ }
1130
+ void this._model.append(content);
1131
+ this._currentBlockContent = currentBlockContent;
1132
+ log4("append", {
1133
+ message: i,
1134
+ block: j,
1135
+ content
1136
+ }, {
1137
+ F: __dxlog_file4,
1138
+ L: 99,
1139
+ S: this,
1140
+ C: (f, a) => f(...a)
1141
+ });
1142
+ }
1143
+ if (block.pending) {
1144
+ return;
1145
+ } else {
1146
+ this._currentBlockContent = void 0;
1147
+ this._currentBlockIndex++;
1148
+ }
1149
+ j++;
1150
+ }
1151
+ i++;
1152
+ }
1153
+ }
1154
+ };
1155
+
1156
+ // src/components/ChatThread/ChatThread.tsx
1157
+ var ChatThread = /* @__PURE__ */ forwardRef(({ classNames, identity, messages = [], error, cursor = false, fadeIn = true, overscroll, onEvent }, forwardedRef) => {
1158
+ var _effect = _useSignals10();
1159
+ try {
1160
+ const userHue = useMemo8(() => {
1161
+ return identity?.profile?.data?.hue || keyToFallback(identity?.identityKey ?? PublicKey.random()).hue;
1162
+ }, [
1163
+ identity
1164
+ ]);
1165
+ const [controller, setController] = useState11(null);
1166
+ useImperativeHandle(forwardedRef, () => controller ? controller : null, [
1167
+ controller
1168
+ ]);
1169
+ useEffect5(() => {
1170
+ controller?.scrollToBottom();
1171
+ }, [
1172
+ controller,
1173
+ error
1174
+ ]);
1175
+ const syncer = useMemo8(() => controller && new MessageSyncer(controller, blockToMarkdown), [
1176
+ controller
1177
+ ]);
1178
+ useEffect5(() => {
1179
+ syncer?.sync(messages);
1180
+ }, [
1181
+ syncer,
1182
+ messages
1183
+ ]);
1184
+ const handleEvent = useCallback5((ev) => {
1185
+ switch (ev.type) {
1186
+ case "submit": {
1187
+ ev.value && onEvent?.({
1188
+ type: "submit",
1189
+ text: ev.value
1190
+ });
1191
+ break;
1192
+ }
1193
+ }
1194
+ }, [
1195
+ onEvent
1196
+ ]);
1197
+ return /* @__PURE__ */ React8.createElement("div", {
1198
+ className: mx4("flex bs-full is-full justify-center overflow-hidden", classNames),
1199
+ style: {
1200
+ "--user-fill": `var(--dx-${userHue}Fill)`
1201
+ }
1202
+ }, /* @__PURE__ */ React8.createElement(MarkdownStream, {
1203
+ ref: setController,
1204
+ registry: componentRegistry,
1205
+ cursor,
1206
+ fadeIn,
1207
+ overscroll,
1208
+ onEvent: handleEvent
1209
+ }));
1210
+ } finally {
1211
+ _effect.f();
1212
+ }
1213
+ });
1214
+
1215
+ // src/components/Chat/Chat.tsx
1216
+ var [ChatContextProvider, useChatContext] = createContext("Chat");
1217
+ var ChatRoot = ({ classNames, children, chat, processor, onEvent, ...props }) => {
1218
+ var _effect = _useSignals11();
1219
+ try {
1220
+ const [debug, setDebug] = useState12(false);
1221
+ const space = getSpace(chat);
1222
+ const queue = useQueue(chat?.queue.dxn);
1223
+ const pending = useRxValue(processor.messages);
1224
+ const streaming = useRxValue(processor.streaming);
1225
+ const lastPrompt = useRef3(void 0);
1226
+ const messages = useMemo9(() => {
1227
+ const queueMessages = queue?.objects?.filter(Obj5.instanceOf(DataType.Message)) ?? [];
1228
+ return Array2.dedupeWith([
1229
+ ...queueMessages,
1230
+ ...pending
1231
+ ], (a, b) => a.id === b.id);
1232
+ }, [
1233
+ queue?.objects,
1234
+ pending
1235
+ ]);
1236
+ const event = useMemo9(() => new Event(), []);
1237
+ useEffect6(() => {
1238
+ return event.on((ev) => {
1239
+ switch (ev.type) {
1240
+ case "toggle-debug": {
1241
+ setDebug((current) => !current);
1242
+ break;
1243
+ }
1244
+ case "submit": {
1245
+ const text = ev.text.trim();
1246
+ if (!streaming && text.length) {
1247
+ lastPrompt.current = ev.text;
1248
+ void processor.request({
1249
+ message: text
1250
+ });
1251
+ }
1252
+ break;
1253
+ }
1254
+ case "retry": {
1255
+ if (!streaming) {
1256
+ void processor.retry();
1257
+ }
1258
+ break;
1259
+ }
1260
+ case "cancel": {
1261
+ if (streaming) {
1262
+ void processor.cancel();
1263
+ if (lastPrompt.current) {
1264
+ event.emit({
1265
+ type: "update-prompt",
1266
+ text: lastPrompt.current
1267
+ });
1268
+ }
1269
+ }
1270
+ break;
1271
+ }
1272
+ default: {
1273
+ onEvent?.(ev);
1274
+ }
1275
+ }
1276
+ });
1277
+ }, [
1278
+ event,
1279
+ processor,
1280
+ streaming,
1281
+ onEvent
1282
+ ]);
1283
+ if (!space) {
1284
+ return null;
1285
+ }
1286
+ return /* @__PURE__ */ React9.createElement(ChatContextProvider, {
1287
+ debug,
1288
+ event,
1289
+ chat,
1290
+ space,
1291
+ messages,
1292
+ processor,
1293
+ ...props
1294
+ }, /* @__PURE__ */ React9.createElement("div", {
1295
+ role: "none",
1296
+ className: mx5("flex flex-col bs-full is-full", classNames)
1297
+ }, children));
1298
+ } finally {
1299
+ _effect.f();
1300
+ }
1301
+ };
1302
+ ChatRoot.displayName = "Chat.Root";
1303
+ var ChatPrompt = ({ classNames, outline, settings = true, placeholder, expandable, online, presets, preset, onPresetChange, onOnlineChange }) => {
1304
+ var _effect = _useSignals11();
1305
+ try {
1306
+ const { t } = useTranslation5(meta.id);
1307
+ const { space, event, processor } = useChatContext(ChatPrompt.displayName);
1308
+ const error = useRxValue(processor.error).pipe(Option2.getOrUndefined);
1309
+ const streaming = useRxValue(processor.streaming);
1310
+ const active = useRxValue(processor.active);
1311
+ const activeRef = useDynamicRef(active);
1312
+ const editorRef = useRef3(null);
1313
+ const [recordingState, setRecordingState] = useState12(false);
1314
+ useEffect6(() => {
1315
+ return event.on((event2) => {
1316
+ switch (event2.type) {
1317
+ case "update-prompt":
1318
+ if (!editorRef.current?.getText()?.length) {
1319
+ editorRef.current?.setText(event2.text);
1320
+ editorRef.current?.focus();
1321
+ }
1322
+ break;
1323
+ case "record-start":
1324
+ setRecordingState(true);
1325
+ break;
1326
+ case "record-stop":
1327
+ setRecordingState(false);
1328
+ break;
1329
+ }
1330
+ });
1331
+ }, [
1332
+ event
1333
+ ]);
1334
+ const { recording } = useVoiceInput({
1335
+ active: recordingState,
1336
+ onUpdate: (text) => {
1337
+ editorRef.current?.setText(text);
1338
+ editorRef.current?.focus();
1339
+ }
1340
+ });
1341
+ const referencesProvider = useReferencesProvider(space);
1342
+ const extensions = useMemo9(() => {
1343
+ return [
1344
+ referencesProvider && references({
1345
+ provider: referencesProvider
1346
+ }),
1347
+ Prec.highest(keymap.of([
1348
+ {
1349
+ key: "cmd-d",
1350
+ preventDefault: true,
1351
+ run: () => {
1352
+ event.emit({
1353
+ type: "toggle-debug"
1354
+ });
1355
+ return true;
1356
+ }
1357
+ },
1358
+ expandable && {
1359
+ key: "cmd-ArrowUp",
1360
+ preventDefault: true,
1361
+ run: () => {
1362
+ event.emit({
1363
+ type: "thread-open"
1364
+ });
1365
+ return true;
1366
+ }
1367
+ },
1368
+ expandable && {
1369
+ key: "cmd-ArrowDown",
1370
+ preventDefault: true,
1371
+ run: () => {
1372
+ event.emit({
1373
+ type: "thread-close"
1374
+ });
1375
+ return true;
1376
+ }
1377
+ }
1378
+ ].filter(isTruthy)))
1379
+ ].filter(isTruthy);
1380
+ }, [
1381
+ event,
1382
+ expandable,
1383
+ referencesProvider
1384
+ ]);
1385
+ const handleSubmit = useCallback6((text) => {
1386
+ if (!activeRef.current) {
1387
+ event.emit({
1388
+ type: "submit",
1389
+ text
1390
+ });
1391
+ return true;
1392
+ }
1393
+ }, [
1394
+ event
1395
+ ]);
1396
+ const handleEvent = useCallback6((ev) => {
1397
+ event.emit(ev);
1398
+ }, [
1399
+ event
1400
+ ]);
1401
+ return /* @__PURE__ */ React9.createElement("div", {
1402
+ role: "group",
1403
+ className: mx5("flex flex-col is-full density-fine", outline && [
1404
+ "p-2 bg-groupSurface border border-subduedSeparator transition transition-border [&:has(.cm-content:focus)]:border-separator rounded"
1405
+ ], classNames)
1406
+ }, /* @__PURE__ */ React9.createElement("div", {
1407
+ role: "none",
1408
+ className: "flex gap-2"
1409
+ }, /* @__PURE__ */ React9.createElement(ChatStatusIndicator, {
1410
+ classNames: "p-1",
1411
+ preset,
1412
+ error,
1413
+ processing: streaming
1414
+ }), /* @__PURE__ */ React9.createElement(ChatEditor, {
1415
+ ref: editorRef,
1416
+ autoFocus: true,
1417
+ lineWrapping: true,
1418
+ classNames: "col-span-2 pbs-0.5",
1419
+ placeholder: placeholder ?? t("prompt placeholder"),
1420
+ extensions,
1421
+ onSubmit: handleSubmit
1422
+ })), settings && /* @__PURE__ */ React9.createElement("div", {
1423
+ role: "none",
1424
+ className: "flex pbs-2 items-center"
1425
+ }, /* @__PURE__ */ React9.createElement(ChatOptions, {
1426
+ space,
1427
+ blueprintRegistry: processor.blueprintRegistry,
1428
+ context: processor.context,
1429
+ preset,
1430
+ presets,
1431
+ onPresetChange
1432
+ }), /* @__PURE__ */ React9.createElement("div", {
1433
+ role: "none",
1434
+ className: "pli-cardSpacingChrome grow"
1435
+ }, /* @__PURE__ */ React9.createElement(ChatReferences, {
1436
+ space,
1437
+ context: processor.context
1438
+ })), /* @__PURE__ */ React9.createElement(ChatActions, {
1439
+ classNames: "col-span-2",
1440
+ microphone: true,
1441
+ recording,
1442
+ processing: streaming,
1443
+ onEvent: handleEvent
1444
+ }, online !== void 0 && /* @__PURE__ */ React9.createElement(Input.Root, null, /* @__PURE__ */ React9.createElement(Input.Label, {
1445
+ srOnly: true
1446
+ }, t("online switch label")), /* @__PURE__ */ React9.createElement(Input.Switch, {
1447
+ classNames: "mis-2 mie-2",
1448
+ checked: online,
1449
+ onCheckedChange: onOnlineChange
1450
+ })))));
1451
+ } finally {
1452
+ _effect.f();
1453
+ }
1454
+ };
1455
+ ChatPrompt.displayName = "Chat.Prompt";
1456
+ var ChatThread2 = (props) => {
1457
+ var _effect = _useSignals11();
1458
+ try {
1459
+ const { event, messages, processor } = useChatContext(ChatThread2.displayName);
1460
+ const identity = useIdentity();
1461
+ const error = useRxValue(processor.error).pipe(Option2.getOrUndefined);
1462
+ const scrollerRef = useRef3(null);
1463
+ useEffect6(() => {
1464
+ return event.on((event2) => {
1465
+ switch (event2.type) {
1466
+ case "submit":
1467
+ case "scroll-to-bottom":
1468
+ scrollerRef.current?.scrollToBottom();
1469
+ break;
1470
+ }
1471
+ });
1472
+ }, [
1473
+ event
1474
+ ]);
1475
+ const handleEvent = useCallback6((ev) => {
1476
+ event.emit(ev);
1477
+ }, [
1478
+ event
1479
+ ]);
1480
+ if (!identity) {
1481
+ return null;
1482
+ }
1483
+ return /* @__PURE__ */ React9.createElement(ChatThread, {
1484
+ ...props,
1485
+ ref: scrollerRef,
1486
+ identity,
1487
+ messages,
1488
+ error,
1489
+ onEvent: handleEvent
1490
+ });
1491
+ } finally {
1492
+ _effect.f();
1493
+ }
1494
+ };
1495
+ ChatThread2.displayName = "Chat.Thread";
1496
+ var Chat = {
1497
+ Root: ChatRoot,
1498
+ Prompt: ChatPrompt,
1499
+ Thread: ChatThread2
1500
+ };
1501
+
1502
+ export {
1503
+ useBlueprintRegistry,
1504
+ useBlueprints,
1505
+ useActiveBlueprints,
1506
+ useBlueprintHandlers,
1507
+ useChatProcessor,
1508
+ useChatServices,
1509
+ useContextBinder,
1510
+ useContextObjects,
1511
+ useFlush,
1512
+ useItemTypes,
1513
+ useOnline,
1514
+ usePresets,
1515
+ useReferencesProvider,
1516
+ ChatContextProvider,
1517
+ useChatContext,
1518
+ Chat
1519
+ };
1520
+ //# sourceMappingURL=chunk-HJPIYMWD.mjs.map