@dxos/plugin-automation 0.7.5-main.ff8607b → 0.7.5-staging.b81e783

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 (301) hide show
  1. package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs +8 -0
  2. package/dist/lib/browser/AutomationPanel-NCKK3CFN.mjs.map +7 -0
  3. package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs +12 -0
  4. package/dist/lib/browser/ChatContainer-AZPLZJ5H.mjs.map +7 -0
  5. package/dist/lib/browser/ai-client-T2PBJISL.mjs +22 -0
  6. package/dist/lib/browser/ai-client-T2PBJISL.mjs.map +7 -0
  7. package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs +111 -0
  8. package/dist/lib/browser/app-graph-builder-F22H4YBQ.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-67KDIIM6.mjs +15 -0
  10. package/dist/lib/browser/chunk-67KDIIM6.mjs.map +7 -0
  11. package/dist/lib/browser/{chunk-DQ7ZSYJJ.mjs → chunk-HZSTXZWK.mjs} +3 -1
  12. package/dist/lib/browser/chunk-HZSTXZWK.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-L2YLAKCS.mjs +151 -0
  14. package/dist/lib/browser/chunk-L2YLAKCS.mjs.map +7 -0
  15. package/dist/lib/{node-esm/AutomationPanel-MW42U6I4.mjs → browser/chunk-LJ7F4KDM.mjs} +26 -15
  16. package/dist/lib/browser/chunk-LJ7F4KDM.mjs.map +7 -0
  17. package/dist/lib/browser/chunk-M4MWUOUC.mjs +382 -0
  18. package/dist/lib/browser/chunk-M4MWUOUC.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-U435IUIA.mjs +1775 -0
  20. package/dist/lib/browser/chunk-U435IUIA.mjs.map +7 -0
  21. package/dist/lib/browser/index.mjs +127 -42
  22. package/dist/lib/browser/index.mjs.map +4 -4
  23. package/dist/lib/browser/intent-resolver-MONKAKTY.mjs +30 -0
  24. package/dist/lib/browser/intent-resolver-MONKAKTY.mjs.map +7 -0
  25. package/dist/lib/browser/meta.json +1 -1
  26. package/dist/lib/browser/react-surface-7QWCWE4K.mjs +58 -0
  27. package/dist/lib/browser/react-surface-7QWCWE4K.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +14 -3
  29. package/dist/lib/node/AutomationPanel-6COLKRIB.cjs +26 -0
  30. package/dist/lib/node/AutomationPanel-6COLKRIB.cjs.map +7 -0
  31. package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs +33 -0
  32. package/dist/lib/node/ChatContainer-SBEUFMQ3.cjs.map +7 -0
  33. package/dist/lib/node/ai-client-L5GUSAER.cjs +38 -0
  34. package/dist/lib/node/ai-client-L5GUSAER.cjs.map +7 -0
  35. package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs +123 -0
  36. package/dist/lib/node/app-graph-builder-OCSH5R6U.cjs.map +7 -0
  37. package/dist/lib/node/{chunk-TQEDPRY5.cjs → chunk-BAQRBGOJ.cjs} +7 -4
  38. package/dist/lib/node/chunk-BAQRBGOJ.cjs.map +7 -0
  39. package/dist/lib/node/chunk-BZFAEBME.cjs +1747 -0
  40. package/dist/lib/node/chunk-BZFAEBME.cjs.map +7 -0
  41. package/dist/lib/node/chunk-K3F5JNZ6.cjs +394 -0
  42. package/dist/lib/node/chunk-K3F5JNZ6.cjs.map +7 -0
  43. package/dist/lib/node/chunk-NUOYHYAF.cjs +174 -0
  44. package/dist/lib/node/chunk-NUOYHYAF.cjs.map +7 -0
  45. package/dist/lib/node/{AutomationPanel-H5WE4FIU.cjs → chunk-V4L7LTWM.cjs} +34 -18
  46. package/dist/lib/node/chunk-V4L7LTWM.cjs.map +7 -0
  47. package/dist/lib/node/chunk-VNBYGJ4K.cjs +34 -0
  48. package/dist/lib/node/chunk-VNBYGJ4K.cjs.map +7 -0
  49. package/dist/lib/node/index.cjs +157 -86
  50. package/dist/lib/node/index.cjs.map +4 -4
  51. package/dist/lib/node/intent-resolver-KQGTYVF2.cjs +45 -0
  52. package/dist/lib/node/intent-resolver-KQGTYVF2.cjs.map +7 -0
  53. package/dist/lib/node/meta.json +1 -1
  54. package/dist/lib/node/{react-surface-S6U5ISJ6.cjs → react-surface-IXKIJFRP.cjs} +31 -12
  55. package/dist/lib/node/react-surface-IXKIJFRP.cjs.map +7 -0
  56. package/dist/lib/node/types/index.cjs +17 -6
  57. package/dist/lib/node/types/index.cjs.map +2 -2
  58. package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs +9 -0
  59. package/dist/lib/node-esm/AutomationPanel-3MPIAO7R.mjs.map +7 -0
  60. package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs +13 -0
  61. package/dist/lib/node-esm/ChatContainer-JCDLYMDZ.mjs.map +7 -0
  62. package/dist/lib/node-esm/ai-client-45LZLW7V.mjs +23 -0
  63. package/dist/lib/node-esm/ai-client-45LZLW7V.mjs.map +7 -0
  64. package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs +112 -0
  65. package/dist/lib/node-esm/app-graph-builder-XSM7DETF.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-53FFD4VO.mjs +1776 -0
  67. package/dist/lib/node-esm/chunk-53FFD4VO.mjs.map +7 -0
  68. package/dist/lib/{browser/AutomationPanel-KT3YFV56.mjs → node-esm/chunk-AWAU4BHR.mjs} +27 -14
  69. package/dist/lib/node-esm/chunk-AWAU4BHR.mjs.map +7 -0
  70. package/dist/lib/node-esm/{chunk-JFHI22MF.mjs → chunk-IG4GSWZN.mjs} +3 -1
  71. package/dist/lib/node-esm/chunk-IG4GSWZN.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-K5NNSGIV.mjs +152 -0
  73. package/dist/lib/node-esm/chunk-K5NNSGIV.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-RAT3GSJP.mjs +383 -0
  75. package/dist/lib/node-esm/chunk-RAT3GSJP.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-SS7U6GCX.mjs +16 -0
  77. package/dist/lib/node-esm/chunk-SS7U6GCX.mjs.map +7 -0
  78. package/dist/lib/node-esm/index.mjs +127 -42
  79. package/dist/lib/node-esm/index.mjs.map +4 -4
  80. package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs +31 -0
  81. package/dist/lib/node-esm/intent-resolver-XSZRLU6V.mjs.map +7 -0
  82. package/dist/lib/node-esm/meta.json +1 -1
  83. package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs +59 -0
  84. package/dist/lib/node-esm/react-surface-FZAAAXGR.mjs.map +7 -0
  85. package/dist/lib/node-esm/types/index.mjs +14 -3
  86. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  87. package/dist/types/src/capabilities/ai-client.d.ts +5 -0
  88. package/dist/types/src/capabilities/ai-client.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/app-graph-builder.d.ts +23 -22
  90. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/capabilities.d.ts +5 -0
  92. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  95. package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
  96. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  98. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts +7 -0
  99. package/dist/types/src/components/AmbientDialog/AmbientDialog.d.ts.map +1 -0
  100. package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts +8 -0
  101. package/dist/types/src/components/AmbientDialog/AmbientDialog.stories.d.ts.map +1 -0
  102. package/dist/types/src/components/AmbientDialog/index.d.ts +2 -0
  103. package/dist/types/src/components/AmbientDialog/index.d.ts.map +1 -0
  104. package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts +6 -0
  105. package/dist/types/src/components/AssistantDialog/AssistantDialog.d.ts.map +1 -0
  106. package/dist/types/src/components/AssistantDialog/index.d.ts +2 -0
  107. package/dist/types/src/components/AssistantDialog/index.d.ts.map +1 -0
  108. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -2
  109. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  110. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +6 -0
  111. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +1 -0
  112. package/dist/types/src/components/ChatContainer/index.d.ts +4 -0
  113. package/dist/types/src/components/ChatContainer/index.d.ts.map +1 -0
  114. package/dist/types/src/components/Prompt/Prompt.d.ts +13 -0
  115. package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
  116. package/dist/types/src/components/Prompt/Prompt.stories.d.ts +9 -0
  117. package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
  118. package/dist/types/src/components/Prompt/PromptBar.d.ts +10 -0
  119. package/dist/types/src/components/Prompt/PromptBar.d.ts.map +1 -0
  120. package/dist/types/src/components/Prompt/autocomplete.d.ts +21 -0
  121. package/dist/types/src/components/Prompt/autocomplete.d.ts.map +1 -0
  122. package/dist/types/src/components/Prompt/index.d.ts +3 -0
  123. package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
  124. package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +1 -2
  125. package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +1 -1
  126. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +5 -0
  127. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -0
  128. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +8 -0
  129. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +1 -0
  130. package/dist/types/src/components/ServiceRegistry/index.d.ts +2 -0
  131. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +1 -0
  132. package/dist/types/src/components/Thread/Thread.d.ts +15 -0
  133. package/dist/types/src/components/Thread/Thread.d.ts.map +1 -0
  134. package/dist/types/src/components/Thread/Thread.stories.d.ts +11 -0
  135. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -0
  136. package/dist/types/src/components/Thread/ThreadContainer.d.ts +8 -0
  137. package/dist/types/src/components/Thread/ThreadContainer.d.ts.map +1 -0
  138. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts +15 -0
  139. package/dist/types/src/components/Thread/ThreadContainer.stories.d.ts.map +1 -0
  140. package/dist/types/src/components/Thread/ThreadMessage.d.ts +13 -0
  141. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
  142. package/dist/types/src/components/Thread/ToolInvocations.d.ts +13 -0
  143. package/dist/types/src/components/Thread/ToolInvocations.d.ts.map +1 -0
  144. package/dist/types/src/components/Thread/index.d.ts +3 -0
  145. package/dist/types/src/components/Thread/index.d.ts.map +1 -0
  146. package/dist/types/src/components/Thread/reducer.d.ts +12 -0
  147. package/dist/types/src/components/Thread/reducer.d.ts.map +1 -0
  148. package/dist/types/src/components/Toolbox/Toolbox.d.ts +19 -0
  149. package/dist/types/src/components/Toolbox/Toolbox.d.ts.map +1 -0
  150. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts +8 -0
  151. package/dist/types/src/components/Toolbox/Toolbox.stories.d.ts.map +1 -0
  152. package/dist/types/src/components/Toolbox/index.d.ts +2 -0
  153. package/dist/types/src/components/Toolbox/index.d.ts.map +1 -0
  154. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
  155. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  156. package/dist/types/src/components/index.d.ts +13 -2
  157. package/dist/types/src/components/index.d.ts.map +1 -1
  158. package/dist/types/src/hooks/index.d.ts +5 -0
  159. package/dist/types/src/hooks/index.d.ts.map +1 -1
  160. package/dist/types/src/hooks/processor.d.ts +75 -0
  161. package/dist/types/src/hooks/processor.d.ts.map +1 -0
  162. package/dist/types/src/hooks/processor.test.d.ts +2 -0
  163. package/dist/types/src/hooks/processor.test.d.ts.map +1 -0
  164. package/dist/types/src/hooks/useChatProcessor.d.ts +7 -0
  165. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -0
  166. package/dist/types/src/hooks/useMessageQueue.d.ts +41 -0
  167. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -0
  168. package/dist/types/src/hooks/useServices.d.ts +7 -0
  169. package/dist/types/src/hooks/useServices.d.ts.map +1 -0
  170. package/dist/types/src/hooks/useTextInputEvents.d.ts +13 -0
  171. package/dist/types/src/hooks/useTextInputEvents.d.ts.map +1 -0
  172. package/dist/types/src/meta.d.ts +1 -0
  173. package/dist/types/src/meta.d.ts.map +1 -1
  174. package/dist/types/src/testing/index.d.ts +2 -1
  175. package/dist/types/src/testing/index.d.ts.map +1 -1
  176. package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +3 -1
  177. package/dist/types/src/testing/test-functions.d.ts.map +1 -0
  178. package/dist/types/src/testing/test-services.d.ts +5 -0
  179. package/dist/types/src/testing/test-services.d.ts.map +1 -0
  180. package/dist/types/src/tools/function.d.ts +5 -0
  181. package/dist/types/src/tools/function.d.ts.map +1 -0
  182. package/dist/types/src/tools/index.d.ts +3 -0
  183. package/dist/types/src/tools/index.d.ts.map +1 -0
  184. package/dist/types/src/tools/openapi.d.ts +10 -0
  185. package/dist/types/src/tools/openapi.d.ts.map +1 -0
  186. package/dist/types/src/tools/openapi.test.d.ts +2 -0
  187. package/dist/types/src/tools/openapi.test.d.ts.map +1 -0
  188. package/dist/types/src/translations.d.ts +95 -2
  189. package/dist/types/src/translations.d.ts.map +1 -1
  190. package/dist/types/src/types/index.d.ts +2 -0
  191. package/dist/types/src/types/index.d.ts.map +1 -1
  192. package/dist/types/src/types/registry.d.ts +10 -0
  193. package/dist/types/src/types/registry.d.ts.map +1 -0
  194. package/dist/types/src/types/schema.d.ts +161 -3
  195. package/dist/types/src/types/schema.d.ts.map +1 -1
  196. package/dist/types/src/types/types.d.ts +19 -0
  197. package/dist/types/src/types/types.d.ts.map +1 -0
  198. package/package.json +59 -40
  199. package/src/AutomationPlugin.tsx +51 -14
  200. package/src/capabilities/ai-client.ts +19 -0
  201. package/src/capabilities/app-graph-builder.ts +83 -110
  202. package/src/capabilities/capabilities.ts +12 -0
  203. package/src/capabilities/index.ts +4 -0
  204. package/src/capabilities/intent-resolver.ts +26 -0
  205. package/src/capabilities/react-surface.tsx +21 -6
  206. package/src/components/AmbientDialog/AmbientDialog.stories.tsx +81 -0
  207. package/src/components/AmbientDialog/AmbientDialog.tsx +103 -0
  208. package/src/components/AmbientDialog/index.ts +5 -0
  209. package/src/components/AssistantDialog/AssistantDialog.tsx +23 -0
  210. package/src/components/AssistantDialog/index.ts +5 -0
  211. package/src/components/ChatContainer/ChatContainer.tsx +19 -0
  212. package/src/components/ChatContainer/index.ts +9 -0
  213. package/src/components/Prompt/Prompt.stories.tsx +79 -0
  214. package/src/components/Prompt/Prompt.tsx +79 -0
  215. package/src/components/Prompt/PromptBar.tsx +100 -0
  216. package/src/components/Prompt/autocomplete.ts +212 -0
  217. package/src/components/Prompt/index.ts +6 -0
  218. package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
  219. package/src/components/PromptEditor/PromptEditor.tsx +3 -3
  220. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
  221. package/src/components/ServiceRegistry/ServiceRegistry.tsx +76 -0
  222. package/src/components/ServiceRegistry/index.ts +5 -0
  223. package/src/components/Thread/Thread.stories.tsx +210 -0
  224. package/src/components/Thread/Thread.tsx +106 -0
  225. package/src/components/Thread/ThreadContainer.stories.tsx +245 -0
  226. package/src/components/Thread/ThreadContainer.tsx +67 -0
  227. package/src/components/Thread/ThreadMessage.tsx +187 -0
  228. package/src/components/Thread/ToolInvocations.tsx +86 -0
  229. package/src/components/Thread/index.ts +6 -0
  230. package/src/components/Thread/reducer.ts +52 -0
  231. package/src/components/Toolbox/Toolbox.stories.tsx +66 -0
  232. package/src/components/Toolbox/Toolbox.tsx +89 -0
  233. package/src/components/Toolbox/index.ts +5 -0
  234. package/src/components/TriggerEditor/TriggerEditor.tsx +18 -11
  235. package/src/components/index.ts +10 -1
  236. package/src/hooks/index.ts +6 -0
  237. package/src/hooks/processor.test.ts +15 -0
  238. package/src/hooks/processor.ts +218 -0
  239. package/src/hooks/useChatProcessor.tsx +75 -0
  240. package/src/hooks/useMessageQueue.ts +23 -0
  241. package/src/hooks/useServices.ts +28 -0
  242. package/src/hooks/useTextInputEvents.ts +49 -0
  243. package/src/meta.ts +2 -0
  244. package/src/testing/index.ts +2 -1
  245. package/src/testing/{testing.ts → test-functions.ts} +9 -2
  246. package/src/testing/test-services.ts +131 -0
  247. package/src/tools/function.ts +47 -0
  248. package/src/tools/index.ts +6 -0
  249. package/src/tools/openapi.test.ts +224 -0
  250. package/src/tools/openapi.ts +331 -0
  251. package/src/translations.ts +17 -2
  252. package/src/types/index.ts +2 -0
  253. package/src/types/registry.ts +26 -0
  254. package/src/types/schema.ts +95 -1
  255. package/src/types/types.ts +22 -0
  256. package/src/typings.d.ts +9 -0
  257. package/dist/lib/browser/AssistantPanel-NTOUHOWA.mjs +0 -339
  258. package/dist/lib/browser/AssistantPanel-NTOUHOWA.mjs.map +0 -7
  259. package/dist/lib/browser/AutomationPanel-KT3YFV56.mjs.map +0 -7
  260. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs +0 -131
  261. package/dist/lib/browser/app-graph-builder-6FSMLMT4.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-4ODBJDXM.mjs +0 -10
  263. package/dist/lib/browser/chunk-4ODBJDXM.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-DL6LB2NI.mjs +0 -43
  265. package/dist/lib/browser/chunk-DL6LB2NI.mjs.map +0 -7
  266. package/dist/lib/browser/chunk-DQ7ZSYJJ.mjs.map +0 -7
  267. package/dist/lib/browser/react-surface-5YTE5MRE.mjs +0 -34
  268. package/dist/lib/browser/react-surface-5YTE5MRE.mjs.map +0 -7
  269. package/dist/lib/node/AssistantPanel-U7GDWPRC.cjs +0 -359
  270. package/dist/lib/node/AssistantPanel-U7GDWPRC.cjs.map +0 -7
  271. package/dist/lib/node/AutomationPanel-H5WE4FIU.cjs.map +0 -7
  272. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs +0 -147
  273. package/dist/lib/node/app-graph-builder-65TBXO3I.cjs.map +0 -7
  274. package/dist/lib/node/chunk-JNDMZQH7.cjs +0 -68
  275. package/dist/lib/node/chunk-JNDMZQH7.cjs.map +0 -7
  276. package/dist/lib/node/chunk-JUSXT4U5.cjs +0 -43
  277. package/dist/lib/node/chunk-JUSXT4U5.cjs.map +0 -7
  278. package/dist/lib/node/chunk-TQEDPRY5.cjs.map +0 -7
  279. package/dist/lib/node/react-surface-S6U5ISJ6.cjs.map +0 -7
  280. package/dist/lib/node-esm/AssistantPanel-M67P24GS.mjs +0 -340
  281. package/dist/lib/node-esm/AssistantPanel-M67P24GS.mjs.map +0 -7
  282. package/dist/lib/node-esm/AutomationPanel-MW42U6I4.mjs.map +0 -7
  283. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs +0 -132
  284. package/dist/lib/node-esm/app-graph-builder-4SD4F3KN.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-GIAYUM5I.mjs +0 -45
  286. package/dist/lib/node-esm/chunk-GIAYUM5I.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-JFHI22MF.mjs.map +0 -7
  288. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs +0 -12
  289. package/dist/lib/node-esm/chunk-XVIEXSEZ.mjs.map +0 -7
  290. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs +0 -35
  291. package/dist/lib/node-esm/react-surface-RWTR3TKT.mjs.map +0 -7
  292. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +0 -8
  293. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +0 -1
  294. package/dist/types/src/components/AssistantPanel/index.d.ts +0 -3
  295. package/dist/types/src/components/AssistantPanel/index.d.ts.map +0 -1
  296. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +0 -6
  297. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +0 -1
  298. package/dist/types/src/testing/testing.d.ts.map +0 -1
  299. package/src/components/AssistantPanel/AssistantPanel.tsx +0 -227
  300. package/src/components/AssistantPanel/index.ts +0 -7
  301. package/src/components/AssistantPanel/system-instructions.ts +0 -166
@@ -0,0 +1,81 @@
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, { useState } from 'react';
9
+
10
+ import { IntentPlugin } from '@dxos/app-framework';
11
+ import { withPluginManager } from '@dxos/app-framework/testing';
12
+ import { Config } from '@dxos/client';
13
+ import { faker } from '@dxos/random';
14
+ import { withClientProvider } from '@dxos/react-client/testing';
15
+ import { Dialog, Toolbar, Button } from '@dxos/react-ui';
16
+ import { withTheme, withLayout } from '@dxos/storybook-utils';
17
+
18
+ import { AmbientDialog } from './AmbientDialog';
19
+ import translations from '../../translations';
20
+
21
+ const meta: Meta<typeof AmbientDialog> = {
22
+ title: 'plugins/plugin-automation/AmbientDialog',
23
+ component: AmbientDialog,
24
+ render: () => {
25
+ const [open, setOpen] = useState(true);
26
+ const [items, setItems] = useState<string[]>([]);
27
+ return (
28
+ <>
29
+ <div>
30
+ <Toolbar.Root>
31
+ <Toolbar.Button onClick={() => setOpen(true)}>Open</Toolbar.Button>
32
+ </Toolbar.Root>
33
+ </div>
34
+ <Dialog.Root open={open} onOpenChange={setOpen}>
35
+ <AmbientDialog>
36
+ <div className='flex flex-col h-full overflow-hidden'>
37
+ <div className='flex flex-col h-full gap-2 overflow-auto'>
38
+ {items.map((item) => (
39
+ <div key={item} className='px-2'>
40
+ {item}
41
+ </div>
42
+ ))}
43
+ {items.length > 0 && <div className='pbe-2' />}
44
+ </div>
45
+ <div className='shrink-0 h-[40px]'>
46
+ <Button onClick={() => setItems([...items, faker.lorem.word()])}>Add</Button>
47
+ </div>
48
+ </div>
49
+ </AmbientDialog>
50
+ </Dialog.Root>
51
+ </>
52
+ );
53
+ },
54
+ decorators: [
55
+ withClientProvider({
56
+ config: new Config({
57
+ runtime: {
58
+ client: { edgeFeatures: { signaling: true } },
59
+ services: {
60
+ edge: { url: 'https://edge.dxos.workers.dev/' },
61
+ iceProviders: [{ urls: 'https://edge.dxos.workers.dev/ice' }],
62
+ },
63
+ },
64
+ }),
65
+ createIdentity: true,
66
+ createSpace: true,
67
+ }),
68
+ withPluginManager({ plugins: [IntentPlugin()] }),
69
+ withTheme,
70
+ withLayout({ fullscreen: true, tooltips: true }),
71
+ ],
72
+ parameters: {
73
+ translations,
74
+ },
75
+ };
76
+
77
+ export default meta;
78
+
79
+ type Story = StoryObj<typeof AmbientDialog>;
80
+
81
+ export const Default: Story = {};
@@ -0,0 +1,103 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { type PropsWithChildren, useCallback, useEffect, useState } from 'react';
6
+
7
+ import { Dialog, Icon, IconButton } from '@dxos/react-ui';
8
+ import { resizeAttributes, ResizeHandle, type Size, sizeStyle } from '@dxos/react-ui-dnd';
9
+ import { mx } from '@dxos/react-ui-theme';
10
+
11
+ const preventDefault = (event: Event) => event.preventDefault();
12
+
13
+ const minSize = 5;
14
+
15
+ // TODO(burdon): Factor out.
16
+ export const AmbientDialog = ({
17
+ children,
18
+ open: _open,
19
+ title,
20
+ onOpenChange,
21
+ }: PropsWithChildren<{ open?: boolean; onOpenChange?: (open: boolean) => void; title?: string }>) => {
22
+ const [resizeKey, setReizeKey] = useState(0);
23
+ const [size, setSize] = useState<Size>('min-content');
24
+ const [open, setOpen] = useState(_open);
25
+
26
+ // Update controlled value.
27
+ useEffect(() => {
28
+ setOpen(_open);
29
+ }, [_open]);
30
+
31
+ // Update size and key.
32
+ useEffect(() => {
33
+ setSize(open ? 'min-content' : minSize);
34
+ setReizeKey((key) => key + 1);
35
+ }, [open]);
36
+
37
+ // TODO(burdon): Animate open/close.
38
+ // NOTE: We set the min size to 5rem (80px), and the header and prompt bar to 40px (i.e., the rail-size) each.
39
+ // The dialog has no vertical padding and has box-content so that when closed it collapses to the size of the header and prompt bar.
40
+ const handleToggle = useCallback(() => {
41
+ setOpen((open) => {
42
+ onOpenChange?.(!open);
43
+ return !open;
44
+ });
45
+ }, []);
46
+
47
+ return (
48
+ <div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>
49
+ <Dialog.Content
50
+ classNames='relative box-content py-0 px-2 md:is-[35rem] md:max-is-none overflow-hidden pointer-events-auto transition-[block-size] ease-in-out duration-0 [&:not([data-dx-resizing="true"])]:duration-200'
51
+ inOverlayLayout
52
+ {...resizeAttributes}
53
+ style={{
54
+ ...sizeStyle(size, 'vertical', true),
55
+ maxBlockSize: 'calc(100dvh - env(safe-area-inset-bottom) - env(safe-area-inset-top) - 8rem)',
56
+ }}
57
+ onInteractOutside={preventDefault}
58
+ >
59
+ <ResizeHandle
60
+ key={resizeKey}
61
+ side='block-start'
62
+ defaultSize='min-content'
63
+ minSize={minSize}
64
+ fallbackSize={minSize}
65
+ iconPosition='center'
66
+ onSizeChange={setSize}
67
+ />
68
+
69
+ <DialogHeader open={open} title={title} onToggle={handleToggle} />
70
+
71
+ {children}
72
+ </Dialog.Content>
73
+ </div>
74
+ );
75
+ };
76
+
77
+ /**
78
+ * Matches same layout grid as PromptBar.
79
+ */
80
+ const DialogHeader = ({ open, title, onToggle }: { open?: boolean; title?: string; onToggle: () => void }) => {
81
+ return (
82
+ <div className='flex shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] items-center overflow-hidden'>
83
+ <div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
84
+ <Dialog.Close>
85
+ <Icon icon='ph--x--regular' />
86
+ </Dialog.Close>
87
+ </div>
88
+ <div className='grow'>
89
+ <Dialog.Title classNames='flex justify-center text-xs text-subdued'>{title}</Dialog.Title>
90
+ </div>
91
+ <div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
92
+ <IconButton
93
+ variant='ghost'
94
+ icon={'ph--caret-up--regular'}
95
+ classNames={mx('[&>svg]:transition [&>svg]:duration-200', open && '[&>svg]:rotate-180')}
96
+ iconOnly
97
+ label='Shrink'
98
+ onClick={onToggle}
99
+ />
100
+ </div>
101
+ </div>
102
+ );
103
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './AmbientDialog';
@@ -0,0 +1,23 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { type FC, useState } from 'react';
6
+
7
+ import { useTranslation } from '@dxos/react-ui';
8
+
9
+ import { AUTOMATION_PLUGIN } from '../../meta';
10
+ import { type AIChatType } from '../../types';
11
+ import { AmbientDialog } from '../AmbientDialog';
12
+ import { ThreadContainer } from '../Thread';
13
+
14
+ export const AssistantDialog: FC<{ chat?: AIChatType }> = ({ chat }) => {
15
+ const { t } = useTranslation(AUTOMATION_PLUGIN);
16
+ const [open, setOpen] = useState(false);
17
+
18
+ return (
19
+ <AmbientDialog open={open} onOpenChange={setOpen} title={t('assistant dialog title')}>
20
+ <ThreadContainer chat={chat} onOpenChange={setOpen} />
21
+ </AmbientDialog>
22
+ );
23
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './AssistantDialog';
@@ -0,0 +1,19 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { StackItem } from '@dxos/react-ui-stack';
8
+
9
+ import { type AIChatType } from '../../types';
10
+ import { ThreadContainer } from '../Thread';
11
+
12
+ // TODO(burdon): Attention.
13
+ export const ChatContainer = ({ chat, role }: { chat: AIChatType; role: string }) => {
14
+ return (
15
+ <StackItem.Content toolbar={false} role={role} classNames='mli-auto w-full max-w-[50rem]'>
16
+ <ThreadContainer chat={chat} />
17
+ </StackItem.Content>
18
+ );
19
+ };
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { ChatContainer } from './ChatContainer';
6
+
7
+ export * from './ChatContainer';
8
+
9
+ export default ChatContainer;
@@ -0,0 +1,79 @@
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, { useEffect, useState } from 'react';
9
+
10
+ import { withTheme, withLayout } from '@dxos/storybook-utils';
11
+
12
+ import { Prompt } from './Prompt';
13
+ import { PromptBar } from './PromptBar';
14
+ import translations from '../../translations';
15
+
16
+ const meta: Meta<typeof Prompt> = {
17
+ title: 'plugins/plugin-automation/Prompt',
18
+ component: Prompt,
19
+ decorators: [withTheme, withLayout({ tooltips: true })],
20
+ parameters: {
21
+ layout: 'centered',
22
+ translations,
23
+ },
24
+ };
25
+
26
+ export default meta;
27
+
28
+ type Story = StoryObj<typeof Prompt>;
29
+
30
+ export const Default: Story = {
31
+ args: {
32
+ classNames: 'w-96 p-4 rounded outline outline-gray-200',
33
+ autoFocus: true,
34
+ onSubmit: (text) => {
35
+ console.log('onEnter', text);
36
+ },
37
+ onSuggest: (text) => {
38
+ const trimmed = text.trim().toLowerCase();
39
+ if (trimmed.length < 2) {
40
+ return [];
41
+ }
42
+
43
+ const suggestions = [
44
+ 'Create a kanban board',
45
+ 'Create a new project',
46
+ 'Find flights to Tokyo',
47
+ "Let's play chess",
48
+ 'Show me Paris on a map',
49
+ ];
50
+
51
+ return suggestions.filter((s) => s.toLowerCase().startsWith(text));
52
+ },
53
+ },
54
+ };
55
+
56
+ export const Toolbar: Story = {
57
+ render: (args) => {
58
+ const [processing, setProcessing] = useState(false);
59
+ useEffect(() => {
60
+ let t: NodeJS.Timeout;
61
+ if (processing) {
62
+ t = setTimeout(() => setProcessing(false), 10_000);
63
+ }
64
+ return () => clearTimeout(t);
65
+ }, [processing]);
66
+ console.log('processing', processing);
67
+
68
+ return (
69
+ <PromptBar
70
+ classNames='w-[25rem] p-1 overflow-hidden border border-gray-200 rounded'
71
+ microphone
72
+ processing={processing}
73
+ onSubmit={() => setProcessing(true)}
74
+ onCancel={() => setProcessing(false)}
75
+ {...args}
76
+ />
77
+ );
78
+ },
79
+ };
@@ -0,0 +1,79 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { forwardRef, useImperativeHandle } from 'react';
6
+
7
+ import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
8
+ import {
9
+ type BasicExtensionsOptions,
10
+ createBasicExtensions,
11
+ createThemeExtensions,
12
+ useTextEditor,
13
+ type UseTextEditorProps,
14
+ } from '@dxos/react-ui-editor';
15
+ import { mx } from '@dxos/react-ui-theme';
16
+
17
+ import { createAutocompleteExtension, type AutocompleteOptions } from './autocomplete';
18
+
19
+ // TODO(burdon): Handle object references.
20
+
21
+ export interface PromptController {
22
+ focus(): void;
23
+ setText(text: string): void;
24
+ }
25
+
26
+ export type PromptProps = ThemedClassName<
27
+ AutocompleteOptions &
28
+ Pick<UseTextEditorProps, 'autoFocus'> &
29
+ Pick<BasicExtensionsOptions, 'lineWrapping' | 'placeholder'>
30
+ >;
31
+
32
+ export const Prompt = forwardRef<PromptController, PromptProps>(
33
+ ({ classNames, autoFocus, lineWrapping = false, placeholder, onSubmit, onSuggest }, forwardRef) => {
34
+ const { themeMode } = useThemeContext();
35
+ const { parentRef, view } = useTextEditor(
36
+ {
37
+ autoFocus,
38
+ extensions: [
39
+ createBasicExtensions({
40
+ bracketMatching: false,
41
+ lineWrapping,
42
+ placeholder,
43
+ }),
44
+ createThemeExtensions({ themeMode }),
45
+ createAutocompleteExtension({ onSubmit, onSuggest }),
46
+ ],
47
+ },
48
+ [themeMode, onSubmit, onSuggest],
49
+ );
50
+
51
+ // Expose editor view.
52
+ useImperativeHandle(
53
+ forwardRef,
54
+ () => {
55
+ return {
56
+ focus: () => {
57
+ view?.focus();
58
+ },
59
+ setText: (text: string) => {
60
+ view?.dispatch({
61
+ changes: {
62
+ from: 0,
63
+ to: view.state.doc.length,
64
+ insert: text,
65
+ },
66
+ selection: {
67
+ anchor: text.length,
68
+ head: text.length,
69
+ },
70
+ });
71
+ },
72
+ };
73
+ },
74
+ [view, onSubmit],
75
+ );
76
+
77
+ return <div ref={parentRef} className={mx('w-full overflow-hidden', classNames)} />;
78
+ },
79
+ );
@@ -0,0 +1,100 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { useRef, useState } from 'react';
6
+
7
+ import { useVoiceInput } from '@dxos/plugin-transcription';
8
+ import { Icon, IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
9
+ import { Spinner } from '@dxos/react-ui-sfx';
10
+ import { errorText, mx } from '@dxos/react-ui-theme';
11
+
12
+ import { Prompt, type PromptController, type PromptProps } from './Prompt';
13
+ import { AUTOMATION_PLUGIN } from '../../meta';
14
+
15
+ export type PromptBarProps = ThemedClassName<
16
+ Pick<PromptProps, 'placeholder' | 'lineWrapping' | 'onSubmit' | 'onSuggest'> & {
17
+ processing?: boolean;
18
+ error?: Error;
19
+ microphone?: boolean;
20
+ onCancel?: () => void;
21
+ }
22
+ >;
23
+
24
+ export const PromptBar = ({
25
+ classNames,
26
+ placeholder,
27
+ processing,
28
+ error,
29
+ microphone,
30
+ onCancel,
31
+ ...props
32
+ }: PromptBarProps) => {
33
+ const { t } = useTranslation(AUTOMATION_PLUGIN);
34
+
35
+ const promptRef = useRef<PromptController>(null);
36
+
37
+ // TODO(burdon): Configure capability in TranscriptionPlugin.
38
+ const [active, setActive] = useState(false);
39
+ const { recording } = useVoiceInput({
40
+ active,
41
+ onUpdate: (text) => {
42
+ promptRef.current?.setText(text);
43
+ promptRef.current?.focus();
44
+ },
45
+ });
46
+
47
+ // TODO(burdon): Tooltip for error.
48
+ return (
49
+ <div
50
+ className={mx(
51
+ 'flex shrink-0 w-full grid grid-cols-[var(--rail-action)_1fr_var(--rail-action)] overflow-hidden',
52
+ classNames,
53
+ )}
54
+ >
55
+ <div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
56
+ {(error && <Icon icon='ph--warning-circle--regular' classNames={errorText} size={5} />) || (
57
+ <Spinner active={processing} />
58
+ )}
59
+ </div>
60
+ <Prompt
61
+ ref={promptRef}
62
+ autoFocus
63
+ classNames='pbs-2'
64
+ lineWrapping={true}
65
+ placeholder={placeholder ?? t('prompt placeholder')}
66
+ {...props}
67
+ />
68
+ {(onCancel || microphone) && (
69
+ <div className='flex w-[--rail-action] h-[--rail-action] items-center justify-center'>
70
+ {processing && onCancel && (
71
+ <IconButton
72
+ classNames='px-1.5'
73
+ variant='ghost'
74
+ size={5}
75
+ icon='ph--x--regular'
76
+ iconOnly
77
+ label={t('cancel processing button')}
78
+ onClick={onCancel}
79
+ />
80
+ )}
81
+ {!processing && microphone && (
82
+ <IconButton
83
+ classNames={mx('px-1.5', recording && 'bg-primary-500')}
84
+ variant='ghost'
85
+ size={5}
86
+ icon='ph--microphone--regular'
87
+ iconOnly
88
+ noTooltip
89
+ label={t('microphone button')}
90
+ onMouseDown={() => setActive(true)}
91
+ onMouseUp={() => setActive(false)}
92
+ onTouchStart={() => setActive(true)}
93
+ onTouchEnd={() => setActive(false)}
94
+ />
95
+ )}
96
+ </div>
97
+ )}
98
+ </div>
99
+ );
100
+ };