@dxos/plugin-automation 0.7.5-main.b19bfc8 → 0.7.5-main.e94eead

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 (350) hide show
  1. package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs +132 -0
  2. package/dist/lib/browser/AutomationPanel-ITYXSN5Z.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-HZSTXZWK.mjs → chunk-OFDNNRLE.mjs} +3 -8
  4. package/dist/lib/browser/chunk-OFDNNRLE.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-U7QLNY2S.mjs +8 -0
  6. package/dist/lib/browser/chunk-U7QLNY2S.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-WY2C7JY4.mjs +119 -0
  8. package/dist/lib/browser/chunk-WY2C7JY4.mjs.map +7 -0
  9. package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs +56 -0
  10. package/dist/lib/browser/complementary-panel-4CPOJL4Y.mjs.map +7 -0
  11. package/dist/lib/browser/index.mjs +17 -199
  12. package/dist/lib/browser/index.mjs.map +4 -4
  13. package/dist/lib/browser/meta.json +1 -1
  14. package/dist/lib/browser/react-surface-SAPMN4PF.mjs +27 -0
  15. package/dist/lib/browser/react-surface-SAPMN4PF.mjs.map +7 -0
  16. package/dist/lib/node/{chunk-V4L7LTWM.cjs → AutomationPanel-X33HHDMQ.cjs} +19 -132
  17. package/dist/lib/node/AutomationPanel-X33HHDMQ.cjs.map +7 -0
  18. package/dist/lib/node/chunk-7Q5SNGCL.cjs +148 -0
  19. package/dist/lib/node/chunk-7Q5SNGCL.cjs.map +7 -0
  20. package/dist/lib/node/{TemplateContainer-3YCM6XPU.cjs → chunk-CB5OB6JH.cjs} +8 -21
  21. package/dist/lib/node/chunk-CB5OB6JH.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-BAQRBGOJ.cjs → chunk-ORMEYEBE.cjs} +6 -12
  23. package/dist/lib/node/chunk-ORMEYEBE.cjs.map +7 -0
  24. package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs +72 -0
  25. package/dist/lib/node/complementary-panel-ZYJJ42ZU.cjs.map +7 -0
  26. package/dist/lib/node/index.cjs +32 -198
  27. package/dist/lib/node/index.cjs.map +4 -4
  28. package/dist/lib/node/meta.json +1 -1
  29. package/dist/lib/node/{ChatContainer-4QTLL7TH.cjs → react-surface-2WRVAPGR.cjs} +20 -30
  30. package/dist/lib/node/react-surface-2WRVAPGR.cjs.map +7 -0
  31. package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs +133 -0
  32. package/dist/lib/node-esm/AutomationPanel-HY3GB4BT.mjs.map +7 -0
  33. package/dist/lib/node-esm/{chunk-IG4GSWZN.mjs → chunk-6MUUH67V.mjs} +3 -8
  34. package/dist/lib/node-esm/chunk-6MUUH67V.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs +10 -0
  36. package/dist/lib/node-esm/chunk-R3P2WPBQ.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-UDD2VA6G.mjs +120 -0
  38. package/dist/lib/node-esm/chunk-UDD2VA6G.mjs.map +7 -0
  39. package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs +57 -0
  40. package/dist/lib/node-esm/complementary-panel-S42RIIAY.mjs.map +7 -0
  41. package/dist/lib/node-esm/index.mjs +17 -199
  42. package/dist/lib/node-esm/index.mjs.map +4 -4
  43. package/dist/lib/node-esm/meta.json +1 -1
  44. package/dist/lib/node-esm/react-surface-QWLPOYXO.mjs +28 -0
  45. package/dist/lib/node-esm/react-surface-QWLPOYXO.mjs.map +7 -0
  46. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  47. package/dist/types/src/capabilities/{ai-client.d.ts → complementary-panel.d.ts} +2 -3
  48. package/dist/types/src/capabilities/complementary-panel.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/index.d.ts +1 -181
  50. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  52. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  53. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/index.d.ts +0 -17
  56. package/dist/types/src/components/index.d.ts.map +1 -1
  57. package/dist/types/src/index.d.ts +0 -1
  58. package/dist/types/src/index.d.ts.map +1 -1
  59. package/dist/types/src/meta.d.ts +0 -2
  60. package/dist/types/src/meta.d.ts.map +1 -1
  61. package/dist/types/src/testing/index.d.ts +0 -1
  62. package/dist/types/src/testing/index.d.ts.map +1 -1
  63. package/dist/types/src/testing/test-functions.d.ts +0 -2
  64. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  65. package/dist/types/src/translations.d.ts +1 -127
  66. package/dist/types/src/translations.d.ts.map +1 -1
  67. package/package.json +21 -77
  68. package/src/AutomationPlugin.tsx +7 -86
  69. package/src/capabilities/complementary-panel.ts +56 -0
  70. package/src/capabilities/index.ts +1 -6
  71. package/src/capabilities/react-surface.tsx +3 -44
  72. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
  73. package/src/components/AutomationPanel/AutomationPanel.tsx +56 -49
  74. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
  75. package/src/components/index.ts +0 -9
  76. package/src/index.ts +0 -1
  77. package/src/meta.ts +1 -4
  78. package/src/testing/index.ts +0 -1
  79. package/src/testing/test-functions.ts +0 -7
  80. package/src/translations.ts +1 -47
  81. package/dist/lib/browser/AssistantDialog-V67OWLRP.mjs +0 -116
  82. package/dist/lib/browser/AssistantDialog-V67OWLRP.mjs.map +0 -7
  83. package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs +0 -8
  84. package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs.map +0 -7
  85. package/dist/lib/browser/ChatContainer-5BS6THNV.mjs +0 -33
  86. package/dist/lib/browser/ChatContainer-5BS6THNV.mjs.map +0 -7
  87. package/dist/lib/browser/TemplateContainer-HJJV44CE.mjs +0 -23
  88. package/dist/lib/browser/TemplateContainer-HJJV44CE.mjs.map +0 -7
  89. package/dist/lib/browser/ai-client-T2PBJISL.mjs +0 -22
  90. package/dist/lib/browser/ai-client-T2PBJISL.mjs.map +0 -7
  91. package/dist/lib/browser/app-graph-builder-IR3CGVM6.mjs +0 -110
  92. package/dist/lib/browser/app-graph-builder-IR3CGVM6.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-62E2AEXF.mjs +0 -162
  94. package/dist/lib/browser/chunk-62E2AEXF.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-67KDIIM6.mjs +0 -15
  96. package/dist/lib/browser/chunk-67KDIIM6.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-BQ4WHY4D.mjs +0 -1818
  98. package/dist/lib/browser/chunk-BQ4WHY4D.mjs.map +0 -7
  99. package/dist/lib/browser/chunk-HZSTXZWK.mjs.map +0 -7
  100. package/dist/lib/browser/chunk-LJ7F4KDM.mjs +0 -243
  101. package/dist/lib/browser/chunk-LJ7F4KDM.mjs.map +0 -7
  102. package/dist/lib/browser/chunk-QH5E22EL.mjs +0 -108
  103. package/dist/lib/browser/chunk-QH5E22EL.mjs.map +0 -7
  104. package/dist/lib/browser/chunk-XAIWETH6.mjs +0 -81
  105. package/dist/lib/browser/chunk-XAIWETH6.mjs.map +0 -7
  106. package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs +0 -44
  107. package/dist/lib/browser/intent-resolver-ICLE6FSI.mjs.map +0 -7
  108. package/dist/lib/browser/react-surface-KEKVLCPQ.mjs +0 -80
  109. package/dist/lib/browser/react-surface-KEKVLCPQ.mjs.map +0 -7
  110. package/dist/lib/browser/settings-FE5DDWOE.mjs +0 -22
  111. package/dist/lib/browser/settings-FE5DDWOE.mjs.map +0 -7
  112. package/dist/lib/browser/types/index.mjs +0 -24
  113. package/dist/lib/browser/types/index.mjs.map +0 -7
  114. package/dist/lib/node/AssistantDialog-E62O72KI.cjs +0 -140
  115. package/dist/lib/node/AssistantDialog-E62O72KI.cjs.map +0 -7
  116. package/dist/lib/node/AutomationPanel-6COLKRIB.cjs +0 -26
  117. package/dist/lib/node/AutomationPanel-6COLKRIB.cjs.map +0 -7
  118. package/dist/lib/node/ChatContainer-4QTLL7TH.cjs.map +0 -7
  119. package/dist/lib/node/TemplateContainer-3YCM6XPU.cjs.map +0 -7
  120. package/dist/lib/node/ai-client-L5GUSAER.cjs +0 -38
  121. package/dist/lib/node/ai-client-L5GUSAER.cjs.map +0 -7
  122. package/dist/lib/node/app-graph-builder-ECNVGTRT.cjs +0 -122
  123. package/dist/lib/node/app-graph-builder-ECNVGTRT.cjs.map +0 -7
  124. package/dist/lib/node/chunk-3QSK6IPK.cjs +0 -133
  125. package/dist/lib/node/chunk-3QSK6IPK.cjs.map +0 -7
  126. package/dist/lib/node/chunk-76F5BCJE.cjs +0 -111
  127. package/dist/lib/node/chunk-76F5BCJE.cjs.map +0 -7
  128. package/dist/lib/node/chunk-B37JIAOP.cjs +0 -1795
  129. package/dist/lib/node/chunk-B37JIAOP.cjs.map +0 -7
  130. package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +0 -7
  131. package/dist/lib/node/chunk-UVWK2XJE.cjs +0 -183
  132. package/dist/lib/node/chunk-UVWK2XJE.cjs.map +0 -7
  133. package/dist/lib/node/chunk-V4L7LTWM.cjs.map +0 -7
  134. package/dist/lib/node/chunk-VNBYGJ4K.cjs +0 -34
  135. package/dist/lib/node/chunk-VNBYGJ4K.cjs.map +0 -7
  136. package/dist/lib/node/intent-resolver-4MQZULXW.cjs +0 -58
  137. package/dist/lib/node/intent-resolver-4MQZULXW.cjs.map +0 -7
  138. package/dist/lib/node/react-surface-4RVHY6WI.cjs +0 -95
  139. package/dist/lib/node/react-surface-4RVHY6WI.cjs.map +0 -7
  140. package/dist/lib/node/settings-GOIB2WJQ.cjs +0 -36
  141. package/dist/lib/node/settings-GOIB2WJQ.cjs.map +0 -7
  142. package/dist/lib/node/types/index.cjs +0 -46
  143. package/dist/lib/node/types/index.cjs.map +0 -7
  144. package/dist/lib/node-esm/AssistantDialog-IPRBJKWA.mjs +0 -117
  145. package/dist/lib/node-esm/AssistantDialog-IPRBJKWA.mjs.map +0 -7
  146. package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs +0 -9
  147. package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs.map +0 -7
  148. package/dist/lib/node-esm/ChatContainer-4IWUGMGM.mjs +0 -34
  149. package/dist/lib/node-esm/ChatContainer-4IWUGMGM.mjs.map +0 -7
  150. package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.mjs +0 -24
  151. package/dist/lib/node-esm/TemplateContainer-YJIXR24Z.mjs.map +0 -7
  152. package/dist/lib/node-esm/ai-client-45LZLW7V.mjs +0 -23
  153. package/dist/lib/node-esm/ai-client-45LZLW7V.mjs.map +0 -7
  154. package/dist/lib/node-esm/app-graph-builder-HMRKSZ2X.mjs +0 -111
  155. package/dist/lib/node-esm/app-graph-builder-HMRKSZ2X.mjs.map +0 -7
  156. package/dist/lib/node-esm/chunk-5BKKHYO5.mjs +0 -163
  157. package/dist/lib/node-esm/chunk-5BKKHYO5.mjs.map +0 -7
  158. package/dist/lib/node-esm/chunk-AWAU4BHR.mjs +0 -244
  159. package/dist/lib/node-esm/chunk-AWAU4BHR.mjs.map +0 -7
  160. package/dist/lib/node-esm/chunk-CAWPHOY4.mjs +0 -82
  161. package/dist/lib/node-esm/chunk-CAWPHOY4.mjs.map +0 -7
  162. package/dist/lib/node-esm/chunk-I32H7MCF.mjs +0 -109
  163. package/dist/lib/node-esm/chunk-I32H7MCF.mjs.map +0 -7
  164. package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +0 -7
  165. package/dist/lib/node-esm/chunk-QHKP5HT2.mjs +0 -1819
  166. package/dist/lib/node-esm/chunk-QHKP5HT2.mjs.map +0 -7
  167. package/dist/lib/node-esm/chunk-SS7U6GCX.mjs +0 -16
  168. package/dist/lib/node-esm/chunk-SS7U6GCX.mjs.map +0 -7
  169. package/dist/lib/node-esm/intent-resolver-ZS7XTYLG.mjs +0 -45
  170. package/dist/lib/node-esm/intent-resolver-ZS7XTYLG.mjs.map +0 -7
  171. package/dist/lib/node-esm/react-surface-5ILD642V.mjs +0 -81
  172. package/dist/lib/node-esm/react-surface-5ILD642V.mjs.map +0 -7
  173. package/dist/lib/node-esm/settings-ANNQPPRY.mjs +0 -23
  174. package/dist/lib/node-esm/settings-ANNQPPRY.mjs.map +0 -7
  175. package/dist/lib/node-esm/types/index.mjs +0 -25
  176. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  177. package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
  178. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -181
  179. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  180. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  181. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  182. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  183. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  184. package/dist/types/src/capabilities/settings.d.ts +0 -4
  185. package/dist/types/src/capabilities/settings.d.ts.map +0 -1
  186. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +0 -7
  187. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +0 -1
  188. package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +0 -8
  189. package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +0 -1
  190. package/dist/types/src/components/AmbientDialog/index.d.ts +0 -2
  191. package/dist/types/src/components/AmbientDialog/index.d.ts.map +0 -1
  192. package/dist/types/src/components/AssistantDialog.d.ts +0 -7
  193. package/dist/types/src/components/AssistantDialog.d.ts.map +0 -1
  194. package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts +0 -5
  195. package/dist/types/src/components/AutomationSettings/AutomationSettings.d.ts.map +0 -1
  196. package/dist/types/src/components/AutomationSettings/index.d.ts +0 -2
  197. package/dist/types/src/components/AutomationSettings/index.d.ts.map +0 -1
  198. package/dist/types/src/components/ChatContainer.d.ts +0 -7
  199. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  200. package/dist/types/src/components/Prompt/Prompt.d.ts +0 -17
  201. package/dist/types/src/components/Prompt/Prompt.d.ts.map +0 -1
  202. package/dist/types/src/components/Prompt/Prompt.stories.d.ts +0 -9
  203. package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +0 -1
  204. package/dist/types/src/components/Prompt/PromptBar.d.ts +0 -10
  205. package/dist/types/src/components/Prompt/PromptBar.d.ts.map +0 -1
  206. package/dist/types/src/components/Prompt/autocomplete.d.ts +0 -21
  207. package/dist/types/src/components/Prompt/autocomplete.d.ts.map +0 -1
  208. package/dist/types/src/components/Prompt/index.d.ts +0 -3
  209. package/dist/types/src/components/Prompt/index.d.ts.map +0 -1
  210. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -5
  211. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
  212. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
  213. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
  214. package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
  215. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
  216. package/dist/types/src/components/TemplateContainer.d.ts +0 -7
  217. package/dist/types/src/components/TemplateContainer.d.ts.map +0 -1
  218. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts +0 -12
  219. package/dist/types/src/components/TemplateEditor/TemplateEditor.d.ts.map +0 -1
  220. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts +0 -8
  221. package/dist/types/src/components/TemplateEditor/TemplateEditor.stories.d.ts.map +0 -1
  222. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts +0 -10
  223. package/dist/types/src/components/TemplateEditor/TemplateForm.d.ts.map +0 -1
  224. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts +0 -8
  225. package/dist/types/src/components/TemplateEditor/TemplateForm.stories.d.ts.map +0 -1
  226. package/dist/types/src/components/TemplateEditor/index.d.ts +0 -2
  227. package/dist/types/src/components/TemplateEditor/index.d.ts.map +0 -1
  228. package/dist/types/src/components/TemplateEditor/types.d.ts +0 -18
  229. package/dist/types/src/components/TemplateEditor/types.d.ts.map +0 -1
  230. package/dist/types/src/components/Thread/Thread.d.ts +0 -17
  231. package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
  232. package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -11
  233. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
  234. package/dist/types/src/components/Thread/ThreadContainer.d.ts +0 -10
  235. package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +0 -1
  236. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +0 -15
  237. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +0 -1
  238. package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -13
  239. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
  240. package/dist/types/src/components/Thread/ToolInvocations.d.ts +0 -13
  241. package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +0 -1
  242. package/dist/types/src/components/Thread/index.d.ts +0 -3
  243. package/dist/types/src/components/Thread/index.d.ts.map +0 -1
  244. package/dist/types/src/components/Thread/reducer.d.ts +0 -12
  245. package/dist/types/src/components/Thread/reducer.d.ts.map +0 -1
  246. package/dist/types/src/components/Toolbox/Toolbox.d.ts +0 -19
  247. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +0 -1
  248. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +0 -8
  249. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +0 -1
  250. package/dist/types/src/components/Toolbox/index.d.ts +0 -2
  251. package/dist/types/src/components/Toolbox/index.d.ts.map +0 -1
  252. package/dist/types/src/hooks/email.d.ts +0 -4
  253. package/dist/types/src/hooks/email.d.ts.map +0 -1
  254. package/dist/types/src/hooks/index.d.ts +0 -7
  255. package/dist/types/src/hooks/index.d.ts.map +0 -1
  256. package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
  257. package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
  258. package/dist/types/src/hooks/processor.d.ts +0 -75
  259. package/dist/types/src/hooks/processor.d.ts.map +0 -1
  260. package/dist/types/src/hooks/processor.test.d.ts +0 -2
  261. package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
  262. package/dist/types/src/hooks/useChatProcessor.d.ts +0 -8
  263. package/dist/types/src/hooks/useChatProcessor.d.ts.map +0 -1
  264. package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
  265. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
  266. package/dist/types/src/hooks/useMessageQueue.d.ts +0 -41
  267. package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
  268. package/dist/types/src/hooks/useServices.d.ts +0 -7
  269. package/dist/types/src/hooks/useServices.d.ts.map +0 -1
  270. package/dist/types/src/hooks/useTextInputEvents.d.ts +0 -13
  271. package/dist/types/src/hooks/useTextInputEvents.d.ts.map +0 -1
  272. package/dist/types/src/testing/test-services.d.ts +0 -5
  273. package/dist/types/src/testing/test-services.d.ts.map +0 -1
  274. package/dist/types/src/tools/function.d.ts +0 -5
  275. package/dist/types/src/tools/function.d.ts.map +0 -1
  276. package/dist/types/src/tools/index.d.ts +0 -3
  277. package/dist/types/src/tools/index.d.ts.map +0 -1
  278. package/dist/types/src/tools/openapi.d.ts +0 -10
  279. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  280. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  281. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  282. package/dist/types/src/types/chat.d.ts +0 -12
  283. package/dist/types/src/types/chat.d.ts.map +0 -1
  284. package/dist/types/src/types/index.d.ts +0 -5
  285. package/dist/types/src/types/index.d.ts.map +0 -1
  286. package/dist/types/src/types/service.d.ts +0 -160
  287. package/dist/types/src/types/service.d.ts.map +0 -1
  288. package/dist/types/src/types/template.d.ts +0 -40
  289. package/dist/types/src/types/template.d.ts.map +0 -1
  290. package/dist/types/src/types/types.d.ts +0 -37
  291. package/dist/types/src/types/types.d.ts.map +0 -1
  292. package/src/capabilities/ai-client.ts +0 -19
  293. package/src/capabilities/app-graph-builder.ts +0 -99
  294. package/src/capabilities/capabilities.ts +0 -12
  295. package/src/capabilities/intent-resolver.ts +0 -38
  296. package/src/capabilities/settings.ts +0 -19
  297. package/src/components/AmbientDialog/AmbientDialog.stories.tsx +0 -81
  298. package/src/components/AmbientDialog/AmbientDialog.tsx +0 -103
  299. package/src/components/AmbientDialog/index.ts +0 -5
  300. package/src/components/AssistantDialog.tsx +0 -33
  301. package/src/components/AutomationSettings/AutomationSettings.tsx +0 -49
  302. package/src/components/AutomationSettings/index.ts +0 -5
  303. package/src/components/ChatContainer.tsx +0 -29
  304. package/src/components/Prompt/Prompt.stories.tsx +0 -79
  305. package/src/components/Prompt/Prompt.tsx +0 -100
  306. package/src/components/Prompt/PromptBar.tsx +0 -100
  307. package/src/components/Prompt/autocomplete.ts +0 -212
  308. package/src/components/Prompt/index.ts +0 -6
  309. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
  310. package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -76
  311. package/src/components/ServiceRegistry/index.ts +0 -5
  312. package/src/components/TemplateContainer.tsx +0 -21
  313. package/src/components/TemplateEditor/TemplateEditor.stories.tsx +0 -72
  314. package/src/components/TemplateEditor/TemplateEditor.tsx +0 -76
  315. package/src/components/TemplateEditor/TemplateForm.stories.tsx +0 -65
  316. package/src/components/TemplateEditor/TemplateForm.tsx +0 -184
  317. package/src/components/TemplateEditor/index.ts +0 -5
  318. package/src/components/TemplateEditor/types.tsx +0 -28
  319. package/src/components/Thread/Thread.stories.tsx +0 -212
  320. package/src/components/Thread/Thread.tsx +0 -97
  321. package/src/components/Thread/ThreadContainer.stories.tsx +0 -258
  322. package/src/components/Thread/ThreadContainer.tsx +0 -78
  323. package/src/components/Thread/ThreadMessage.tsx +0 -187
  324. package/src/components/Thread/ToolInvocations.tsx +0 -93
  325. package/src/components/Thread/index.ts +0 -6
  326. package/src/components/Thread/reducer.ts +0 -52
  327. package/src/components/Toolbox/Toolbox.stories.tsx +0 -65
  328. package/src/components/Toolbox/Toolbox.tsx +0 -117
  329. package/src/components/Toolbox/index.ts +0 -5
  330. package/src/hooks/email.ts +0 -49
  331. package/src/hooks/index.ts +0 -11
  332. package/src/hooks/invocation-handler.ts +0 -109
  333. package/src/hooks/processor.test.ts +0 -15
  334. package/src/hooks/processor.ts +0 -219
  335. package/src/hooks/useChatProcessor.tsx +0 -77
  336. package/src/hooks/useLocalTriggerManager.ts +0 -82
  337. package/src/hooks/useMessageQueue.ts +0 -23
  338. package/src/hooks/useServices.ts +0 -28
  339. package/src/hooks/useTextInputEvents.ts +0 -49
  340. package/src/testing/test-services.ts +0 -131
  341. package/src/tools/function.ts +0 -47
  342. package/src/tools/index.ts +0 -6
  343. package/src/tools/openapi.test.ts +0 -224
  344. package/src/tools/openapi.ts +0 -331
  345. package/src/types/chat.ts +0 -11
  346. package/src/types/index.ts +0 -8
  347. package/src/types/service.ts +0 -102
  348. package/src/types/template.ts +0 -34
  349. package/src/types/types.ts +0 -41
  350. package/src/typings.d.ts +0 -9
@@ -1,76 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { HighlightStyle, LanguageSupport, syntaxHighlighting } from '@codemirror/language';
6
- import { styleTags, tags } from '@lezer/highlight';
7
- import { handlebarsLanguage } from '@xiechao/codemirror-lang-handlebars';
8
- import React from 'react';
9
-
10
- import { createDocAccessor } from '@dxos/react-client/echo';
11
- import { useThemeContext, useTranslation, type ThemedClassName } from '@dxos/react-ui';
12
- import {
13
- createBasicExtensions,
14
- createDataExtensions,
15
- createThemeExtensions,
16
- useTextEditor,
17
- } from '@dxos/react-ui-editor';
18
- import { mx } from '@dxos/react-ui-theme';
19
-
20
- import { AUTOMATION_PLUGIN } from '../../meta';
21
- import { type TemplateType } from '../../types';
22
-
23
- handlebarsLanguage.configure({
24
- props: [
25
- styleTags({
26
- '---': tags.lineComment,
27
- }),
28
- ],
29
- });
30
-
31
- export type TemplateEditorProps = ThemedClassName<{
32
- template: TemplateType;
33
- }>;
34
-
35
- export const TemplateEditor = ({ classNames, template }: TemplateEditorProps) => {
36
- const { t } = useTranslation(AUTOMATION_PLUGIN);
37
- const { themeMode } = useThemeContext();
38
- const { parentRef } = useTextEditor(
39
- () => ({
40
- initialValue: template.source,
41
- extensions: [
42
- createDataExtensions({
43
- id: template.id,
44
- text: template.source !== undefined ? createDocAccessor(template, ['template']) : undefined,
45
- }),
46
- createBasicExtensions({
47
- bracketMatching: false,
48
- lineWrapping: true,
49
- placeholder: t('template placeholder'),
50
- }),
51
- createThemeExtensions({
52
- themeMode,
53
- slots: {
54
- content: { className: '!p-3' },
55
- },
56
- }),
57
-
58
- // https://github.com/xiechao/lang-handlebars
59
- new LanguageSupport(handlebarsLanguage, syntaxHighlighting(handlebarsHighlightStyle)),
60
- ],
61
- }),
62
- [themeMode, prompt],
63
- );
64
-
65
- return <div ref={parentRef} className={mx(classNames)} />;
66
- };
67
-
68
- /**
69
- * https://github.com/xiechao/lang-handlebars/blob/direct/src/highlight.js
70
- */
71
- export const handlebarsHighlightStyle = HighlightStyle.define([
72
- { tag: tags.tagName, class: 'text-redText' }, // Braces.
73
- { tag: tags.variableName, class: 'text-blueText' },
74
- { tag: tags.keyword, class: 'text-greenText' },
75
- { tag: tags.comment, class: 'text-subdued' },
76
- ]);
@@ -1,65 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { type Meta } from '@storybook/react';
8
- import React, { useState } from 'react';
9
-
10
- import { create } from '@dxos/live-object';
11
- import { useClient } from '@dxos/react-client';
12
- import { withClientProvider } from '@dxos/react-client/testing';
13
- import { withLayout, withTheme } from '@dxos/storybook-utils';
14
-
15
- import { TemplateForm } from './TemplateForm';
16
- import translations from '../../translations';
17
- import { TemplateType } from '../../types';
18
-
19
- const TEMPLATE = [
20
- 'You are a machine that is an expert chess player.',
21
- 'The move history of the current game is: {{history}}',
22
- 'If asked to suggest a move explain why it is a good move.',
23
- '',
24
- '---',
25
- '',
26
- '{{input}}',
27
- ].join('\n');
28
-
29
- const Render = () => {
30
- const client = useClient();
31
- const [template] = useState(() => {
32
- const space = client.spaces.default;
33
- return space.db.add(create(TemplateType, { source: TEMPLATE }));
34
- });
35
-
36
- return (
37
- <div role='none' className='flex w-[40rem] border border-separator overflow-hidden'>
38
- <TemplateForm template={template} />
39
- </div>
40
- );
41
- };
42
-
43
- const meta: Meta<typeof TemplateForm> = {
44
- title: 'plugins/plugin-automation/TemplateForm',
45
- component: TemplateForm,
46
- render: Render,
47
- decorators: [
48
- withClientProvider({
49
- createIdentity: true,
50
- createSpace: true,
51
- types: [TemplateType],
52
- }),
53
- withLayout({ fullscreen: true, classNames: 'flex justify-center' }),
54
- withTheme,
55
- ],
56
- parameters: {
57
- translations,
58
- },
59
- };
60
-
61
- export default meta;
62
-
63
- type Story = Meta<typeof TemplateForm>;
64
-
65
- export const Default: Story = {};
@@ -1,184 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { type Schema as S } from '@effect/schema';
6
- import React, { Fragment, useEffect } from 'react';
7
-
8
- import { Input, Select, useTranslation } from '@dxos/react-ui';
9
- import { attentionSurface, groupBorder, mx } from '@dxos/react-ui-theme';
10
- import { isNonNullable } from '@dxos/util';
11
-
12
- import { TemplateEditor } from './TemplateEditor';
13
- import { AUTOMATION_PLUGIN } from '../../meta';
14
- import { type TemplateInput, TemplateInputType, type TemplateType } from '../../types';
15
-
16
- export type TemplateFormProps = {
17
- template: TemplateType;
18
- schema?: S.Schema<any, any, any>;
19
- commandEditable?: boolean;
20
- };
21
-
22
- export const TemplateForm = ({ template, commandEditable = true }: TemplateFormProps) => {
23
- const { t } = useTranslation(AUTOMATION_PLUGIN);
24
-
25
- usePromptInputs(template);
26
-
27
- return (
28
- <div className={mx('flex flex-col w-full overflow-hidden gap-4', groupBorder)}>
29
- {commandEditable && (
30
- <div className='flex items-center pl-4'>
31
- <span className='text-neutral-500'>/</span>
32
- <Input.Root>
33
- <Input.TextInput
34
- placeholder={t('command placeholder')}
35
- classNames={mx('is-full bg-transparent m-2')}
36
- value={template.command ?? ''}
37
- onChange={(event) => {
38
- template.command = event.target.value.replace(/\w/g, '');
39
- }}
40
- />
41
- </Input.Root>
42
- </div>
43
- )}
44
-
45
- <TemplateEditor template={template} classNames={[attentionSurface, 'min-h-[120px]']} />
46
-
47
- {(template.inputs?.length ?? 0) > 0 && (
48
- <div className='grid grid-cols-[10rem_10rem_1fr] gap-1 items-center'>
49
- {template.inputs?.filter(isNonNullable).map((input) => (
50
- <Fragment key={input.name}>
51
- <div className='pis-3 text-blueText'>{input.name}</div>
52
-
53
- <Input.Root>
54
- <Select.Root
55
- value={String(input.type)}
56
- onValueChange={(type) => {
57
- input.type = getInputType(type) ?? TemplateInputType.VALUE;
58
- }}
59
- >
60
- <Select.TriggerButton placeholder='Type' classNames='is-full' />
61
- <Select.Portal>
62
- <Select.Content>
63
- <Select.Viewport>
64
- {inputTypes.map(({ value, label }) => (
65
- <Select.Option key={value} value={String(value)}>
66
- {label}
67
- </Select.Option>
68
- ))}
69
- </Select.Viewport>
70
- </Select.Content>
71
- </Select.Portal>
72
- </Select.Root>
73
- </Input.Root>
74
-
75
- <div>
76
- {input.type !== undefined &&
77
- [
78
- TemplateInputType.VALUE,
79
- TemplateInputType.CONTEXT,
80
- TemplateInputType.RESOLVER,
81
- TemplateInputType.SCHEMA,
82
- ].includes(input.type) && (
83
- <div>
84
- <Input.Root>
85
- <Input.TextInput
86
- placeholder={t('command placeholder')}
87
- classNames={mx('is-full bg-transparent')}
88
- value={input.value ?? ''}
89
- onChange={(event) => {
90
- input.value = event.target.value;
91
- }}
92
- />
93
- </Input.Root>
94
- </div>
95
- )}
96
- </div>
97
- </Fragment>
98
- ))}
99
- </div>
100
- )}
101
- </div>
102
- );
103
- };
104
-
105
- const inputTypes = [
106
- {
107
- value: TemplateInputType.VALUE,
108
- label: 'Value',
109
- },
110
- {
111
- value: TemplateInputType.PASS_THROUGH,
112
- label: 'Pass through',
113
- },
114
- {
115
- value: TemplateInputType.RETRIEVER,
116
- label: 'Retriever',
117
- },
118
- // {
119
- // value: TemplateInputType.FUNCTION,
120
- // label: 'Function',
121
- // },
122
- // {
123
- // value: TemplateInputType.QUERY,
124
- // label: 'Query',
125
- // },
126
- {
127
- value: TemplateInputType.RESOLVER,
128
- label: 'Resolver',
129
- },
130
- {
131
- value: TemplateInputType.CONTEXT,
132
- label: 'Context',
133
- },
134
- {
135
- value: TemplateInputType.SCHEMA,
136
- label: 'Schema',
137
- },
138
- ];
139
-
140
- export const nameRegex = /\{\{([\w-]+)\}\}/;
141
-
142
- const getInputType = (type: string) => inputTypes.find(({ value }) => String(value) === type)?.value;
143
-
144
- const usePromptInputs = (template: TemplateType) => {
145
- useEffect(() => {
146
- const text = template.source ?? '';
147
- if (!template.inputs) {
148
- template.inputs = []; // TODO(burdon): Required?
149
- }
150
-
151
- const regex = new RegExp(nameRegex, 'g');
152
- const variables = new Set<string>([...text.matchAll(regex)].map((m) => m[1]));
153
-
154
- // Create map of unclaimed inputs.
155
- const unclaimed = new Map<string, TemplateInput>(
156
- template.inputs?.filter(isNonNullable).map((input) => [input.name, input]),
157
- );
158
- const missing: string[] = [];
159
- Array.from(variables.values()).forEach((name) => {
160
- if (unclaimed.has(name)) {
161
- unclaimed.delete(name);
162
- } else {
163
- missing.push(name);
164
- }
165
- });
166
-
167
- // Match or create new inputs.
168
- const values = unclaimed.values();
169
- missing.forEach((name) => {
170
- const next = values.next().value;
171
- if (next) {
172
- next.name = name;
173
- } else {
174
- template.inputs?.push({ name });
175
- }
176
- });
177
-
178
- // Remove unclaimed (deleted) inputs.
179
- // TODO(burdon): If user types incorrect name value, it will be deleted. Garbage collect?
180
- for (const input of values) {
181
- template.inputs.splice(template.inputs.indexOf(input), 1);
182
- }
183
- }, [template.source]);
184
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- export * from './TemplateEditor';
@@ -1,28 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- // TODO(burdon): Factor out (shared with backend). core/chain (@dxos/chain).
6
- // TODO(burdon): Agent/plan-and-execute (with tools). Create design doc/ontology of sequence/agent.
7
-
8
- export type Step = {
9
- id: string;
10
- };
11
-
12
- export type Variable = {
13
- name: string;
14
- type: 'value' | 'function' | 'query' | 'retriever' | 'pass-through';
15
- };
16
-
17
- export type Prompt = Step & {
18
- title?: string;
19
- description?: string;
20
- template: string;
21
- variables: Variable[];
22
- };
23
-
24
- export type Sequence = Step & {
25
- runnable: Step[];
26
- };
27
-
28
- export type Chain = {};
@@ -1,212 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { type StoryObj, type Meta } from '@storybook/react';
8
- import React, { useCallback, useEffect, useState } from 'react';
9
-
10
- import { IntentPlugin } from '@dxos/app-framework';
11
- import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { type Message } from '@dxos/artifact';
13
- import { ObjectId } from '@dxos/echo-schema';
14
- import { faker } from '@dxos/random';
15
- import { withClientProvider } from '@dxos/react-client/testing';
16
- import { withLayout, withSignals, withTheme } from '@dxos/storybook-utils';
17
-
18
- import { Thread, type ThreadProps } from './Thread';
19
- import translations from '../../translations';
20
-
21
- faker.seed(1);
22
-
23
- const Render = ({ messages: _messages, ...props }: ThreadProps) => {
24
- const [processing, setProcessing] = useState(false);
25
- const [messages, setMessages] = useState<Message[]>(_messages ?? []);
26
- useEffect(() => {
27
- setMessages(_messages ?? []);
28
- }, [_messages]);
29
-
30
- const handleSubmit = useCallback(
31
- (text: string) => {
32
- const request: Message = { id: ObjectId.random(), role: 'user', content: [{ type: 'text', text }] };
33
- const response: Message = {
34
- id: ObjectId.random(),
35
- role: 'assistant',
36
- content: [{ type: 'text', disposition: 'cot', pending: true, text: faker.lorem.paragraphs(1) }],
37
- };
38
- setMessages([...messages, request, response]);
39
- setProcessing(true);
40
- setTimeout(() => {
41
- response.content[0].pending = false;
42
- setMessages([
43
- ...messages,
44
- request,
45
- response,
46
- {
47
- id: ObjectId.random(),
48
- role: 'assistant',
49
- content: [{ type: 'text', text: faker.lorem.paragraphs(1) }],
50
- },
51
- ]);
52
- setProcessing(false);
53
- }, 3_000);
54
- },
55
- [messages],
56
- );
57
-
58
- return (
59
- <div className='flex w-[30rem] bg-white dark:bg-black'>
60
- <Thread
61
- {...props}
62
- messages={messages}
63
- processing={processing}
64
- onSubmit={handleSubmit}
65
- onCancel={() => setProcessing(false)}
66
- />
67
- </div>
68
- );
69
- };
70
-
71
- const meta: Meta<ThreadProps> = {
72
- title: 'plugins/plugin-automation/Thread',
73
- render: Render,
74
- component: Thread,
75
- decorators: [
76
- withSignals,
77
- withClientProvider({
78
- createIdentity: true,
79
- createSpace: true,
80
- }),
81
- withPluginManager({ plugins: [IntentPlugin()] }),
82
- withTheme,
83
- withLayout({ fullscreen: true, tooltips: true, classNames: 'flex justify-center' }),
84
- ],
85
- parameters: {
86
- translations,
87
- },
88
- };
89
-
90
- export default meta;
91
-
92
- type Story = StoryObj<ThreadProps>;
93
-
94
- const TEST_MESSAGES: Message[] = [
95
- {
96
- id: ObjectId.random(),
97
- role: 'user',
98
- content: [
99
- {
100
- type: 'text',
101
- text: faker.lorem.sentence(5),
102
- },
103
- ],
104
- },
105
- {
106
- id: ObjectId.random(),
107
- role: 'assistant',
108
- content: [
109
- {
110
- type: 'text',
111
- disposition: 'cot',
112
- text: Array.from({ length: faker.number.int({ min: 3, max: 5 }) })
113
- .map((_, idx) => `${idx + 1}. ${faker.lorem.paragraph()}`)
114
- .join('\n'),
115
- },
116
- {
117
- type: 'text',
118
- text: Array.from({ length: faker.number.int({ min: 2, max: 5 }) })
119
- .map(() => faker.lorem.paragraphs())
120
- .join('\n\n'),
121
- },
122
- {
123
- type: 'tool_use',
124
- id: '1234',
125
- name: 'search',
126
- input: {},
127
- },
128
- ],
129
- },
130
- {
131
- id: ObjectId.random(),
132
- role: 'user',
133
- content: [
134
- {
135
- type: 'tool_result',
136
- toolUseId: '1234',
137
- content: 'This is a tool result.',
138
- },
139
- ],
140
- },
141
- {
142
- id: ObjectId.random(),
143
- role: 'assistant',
144
- content: [
145
- {
146
- type: 'tool_use',
147
- id: '4567',
148
- name: 'create',
149
- input: {},
150
- },
151
- ],
152
- },
153
- {
154
- id: ObjectId.random(),
155
- role: 'user',
156
- content: [
157
- {
158
- type: 'tool_result',
159
- toolUseId: '4567',
160
- content: 'This is a tool result.',
161
- },
162
- ],
163
- },
164
- {
165
- id: ObjectId.random(),
166
- role: 'assistant',
167
- content: [
168
- {
169
- type: 'text',
170
- text: faker.lorem.paragraphs(1),
171
- },
172
- ],
173
- },
174
- ];
175
-
176
- export const Default: Story = {
177
- args: {
178
- messages: TEST_MESSAGES,
179
- },
180
- };
181
-
182
- export const Input: Story = {
183
- args: {
184
- processing: true,
185
- },
186
- };
187
-
188
- export const Collapse: Story = {
189
- args: {
190
- collapse: true,
191
- messages: TEST_MESSAGES,
192
- },
193
- };
194
-
195
- export const Incremental: Story = {
196
- render: () => {
197
- const [messages, setMessages] = useState<Message[]>([]);
198
- useEffect(() => {
199
- let i = 0;
200
- const interval = setInterval(() => {
201
- setMessages((messages) => [...messages, TEST_MESSAGES[i++]]);
202
- if (i >= TEST_MESSAGES.length) {
203
- clearInterval(interval);
204
- }
205
- }, 2_000);
206
-
207
- return () => clearInterval(interval);
208
- }, []);
209
-
210
- return <Render messages={messages} collapse />;
211
- },
212
- };
@@ -1,97 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type CSSProperties, useCallback, useMemo, useRef } from 'react';
6
-
7
- import { type Message } from '@dxos/artifact';
8
- import { type Space } from '@dxos/react-client/echo';
9
- import { useIdentity } from '@dxos/react-client/halo';
10
- import { type ThemedClassName } from '@dxos/react-ui';
11
- import { ScrollContainer, type ScrollController } from '@dxos/react-ui-components';
12
- import { mx } from '@dxos/react-ui-theme';
13
- import { keyToFallback } from '@dxos/util';
14
-
15
- import { ThreadMessage, type ThreadMessageProps } from './ThreadMessage';
16
- import { messageReducer } from './reducer';
17
- import { PromptBar, type PromptBarProps } from '../Prompt';
18
-
19
- export type ThreadProps = ThemedClassName<{
20
- space?: Space;
21
- messages?: Message[];
22
- collapse?: boolean;
23
- transcription?: boolean;
24
- onOpenChange?: (open: boolean) => void;
25
- }> &
26
- Pick<PromptBarProps, 'processing' | 'error' | 'onSubmit' | 'onSuggest' | 'onCancel'> &
27
- Pick<ThreadMessageProps, 'debug' | 'onPrompt' | 'onDelete'>;
28
-
29
- /**
30
- * Chat thread component.
31
- */
32
- export const Thread = ({
33
- classNames,
34
- space,
35
- messages,
36
- collapse = true,
37
- transcription,
38
- processing,
39
- error,
40
- onSubmit,
41
- onCancel,
42
- onOpenChange,
43
- ...props
44
- }: ThreadProps) => {
45
- const scroller = useRef<ScrollController>(null);
46
-
47
- const identity = useIdentity();
48
- const fallbackValue = keyToFallback(identity!.identityKey);
49
- const userHue = identity!.profile?.data?.hue || fallbackValue.hue;
50
-
51
- const handleSubmit = useCallback<NonNullable<PromptBarProps['onSubmit']>>(
52
- (value: string) => {
53
- onSubmit?.(value);
54
- scroller.current?.scrollToBottom();
55
- return true;
56
- },
57
- [onSubmit],
58
- );
59
-
60
- // TODO(dmaretskyi): This needs to be a separate type: `id` is not a valid ObjectId, this needs to accommodate messageId for deletion.
61
- const { messages: filteredMessages = [] } = useMemo(() => {
62
- if (collapse) {
63
- return (messages ?? []).reduce<{ messages: Message[]; current?: Message }>(messageReducer, {
64
- messages: [],
65
- });
66
- } else {
67
- return { messages: messages ?? [] };
68
- }
69
- }, [messages, collapse]);
70
-
71
- return (
72
- <div role='none' className={mx('flex flex-col grow overflow-hidden', classNames)}>
73
- <ScrollContainer ref={scroller} fade>
74
- <div
75
- role='none'
76
- className={mx(filteredMessages.length > 0 && 'pbs-6 pbe-6')}
77
- style={{ '--user-fill': `var(--dx-${userHue}Fill)` } as CSSProperties}
78
- >
79
- {filteredMessages.map((message) => (
80
- <ThreadMessage key={message.id} classNames='px-4 pbe-4' space={space} message={message} {...props} />
81
- ))}
82
- </div>
83
- </ScrollContainer>
84
-
85
- {onSubmit && (
86
- <PromptBar
87
- microphone={transcription}
88
- processing={processing}
89
- error={error}
90
- onSubmit={handleSubmit}
91
- onCancel={onCancel}
92
- onOpenChange={onOpenChange}
93
- />
94
- )}
95
- </div>
96
- );
97
- };