@dxos/plugin-automation 0.7.5-labs.a279d8c → 0.7.5-labs.ea4b4c2

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 (305) hide show
  1. package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs +8 -0
  2. package/dist/lib/browser/AutomationPanel-VW2XIUPU.mjs.map +7 -0
  3. package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs +12 -0
  4. package/dist/lib/browser/ChatContainer-5TAVTN3T.mjs.map +7 -0
  5. package/dist/lib/browser/{ai-client-6CRYUC6D.mjs → ai-client-5CNY6JBF.mjs} +4 -4
  6. package/dist/lib/browser/{ai-client-6CRYUC6D.mjs.map → ai-client-5CNY6JBF.mjs.map} +3 -3
  7. package/dist/lib/browser/{app-graph-builder-IJTTULDP.mjs → app-graph-builder-FZGK55G7.mjs} +70 -4
  8. package/dist/lib/browser/app-graph-builder-FZGK55G7.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-HZ4TA7HY.mjs → chunk-2H2EUYXL.mjs} +2 -2
  10. package/dist/lib/browser/chunk-DVE33EZL.mjs +1602 -0
  11. package/dist/lib/browser/chunk-DVE33EZL.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-EKJVAFT2.mjs → chunk-MJK7GL5P.mjs} +108 -27
  13. package/dist/lib/browser/chunk-MJK7GL5P.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-NQFZ6XRX.mjs +243 -0
  15. package/dist/lib/browser/chunk-NQFZ6XRX.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-Q4IMHYGH.mjs +150 -0
  17. package/dist/lib/browser/chunk-Q4IMHYGH.mjs.map +7 -0
  18. package/dist/lib/browser/{chunk-HKX3D3ZP.mjs → chunk-R4JH4TLE.mjs} +4 -2
  19. package/dist/lib/browser/chunk-R4JH4TLE.mjs.map +7 -0
  20. package/dist/lib/browser/index.mjs +56 -45
  21. package/dist/lib/browser/index.mjs.map +3 -3
  22. package/dist/lib/browser/intent-resolver-BWAXKT27.mjs +29 -0
  23. package/dist/lib/browser/intent-resolver-BWAXKT27.mjs.map +7 -0
  24. package/dist/lib/browser/meta.json +1 -1
  25. package/dist/lib/browser/{react-surface-IGMBLSV7.mjs → react-surface-ILBDBZCN.mjs} +32 -23
  26. package/dist/lib/browser/react-surface-ILBDBZCN.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +10 -4
  28. package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs +26 -0
  29. package/dist/lib/node/AutomationPanel-G6EDDYWW.cjs.map +7 -0
  30. package/dist/lib/node/ChatContainer-EN24W3K4.cjs +33 -0
  31. package/dist/lib/node/ChatContainer-EN24W3K4.cjs.map +7 -0
  32. package/dist/lib/node/{ai-client-A3RRU55B.cjs → ai-client-FKLPDELV.cjs} +8 -8
  33. package/dist/lib/node/{ai-client-A3RRU55B.cjs.map → ai-client-FKLPDELV.cjs.map} +3 -3
  34. package/dist/lib/node/{app-graph-builder-MF5M4QRS.cjs → app-graph-builder-T76NYV42.cjs} +77 -12
  35. package/dist/lib/node/app-graph-builder-T76NYV42.cjs.map +7 -0
  36. package/dist/lib/node/chunk-CJGJXNY3.cjs +1586 -0
  37. package/dist/lib/node/chunk-CJGJXNY3.cjs.map +7 -0
  38. package/dist/lib/node/{chunk-5VF5JKUN.cjs → chunk-EQYHOTGG.cjs} +8 -5
  39. package/dist/lib/node/chunk-EQYHOTGG.cjs.map +7 -0
  40. package/dist/lib/node/{chunk-BUQOZA4N.cjs → chunk-GB7245FH.cjs} +87 -11
  41. package/dist/lib/node/chunk-GB7245FH.cjs.map +7 -0
  42. package/dist/lib/node/chunk-HMBKP6VG.cjs +324 -0
  43. package/dist/lib/node/chunk-HMBKP6VG.cjs.map +7 -0
  44. package/dist/lib/node/{AutomationPanel-RXJDVLCF.cjs → chunk-QXIHYOMF.cjs} +123 -9
  45. package/dist/lib/node/chunk-QXIHYOMF.cjs.map +7 -0
  46. package/dist/lib/node/{chunk-ZS5RZ7RM.cjs → chunk-U5Z7LFWB.cjs} +6 -6
  47. package/dist/lib/node/index.cjs +100 -88
  48. package/dist/lib/node/index.cjs.map +3 -3
  49. package/dist/lib/node/{intent-resolver-TBHYXBDI.cjs → intent-resolver-C6OKFVEW.cjs} +20 -15
  50. package/dist/lib/node/intent-resolver-C6OKFVEW.cjs.map +7 -0
  51. package/dist/lib/node/meta.json +1 -1
  52. package/dist/lib/node/{react-surface-BVUZMKYS.cjs → react-surface-LWDY7SQG.cjs} +31 -24
  53. package/dist/lib/node/react-surface-LWDY7SQG.cjs.map +7 -0
  54. package/dist/lib/node/types/index.cjs +15 -9
  55. package/dist/lib/node/types/index.cjs.map +2 -2
  56. package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs +9 -0
  57. package/dist/lib/node-esm/AutomationPanel-V3IWQAMO.mjs.map +7 -0
  58. package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs +13 -0
  59. package/dist/lib/node-esm/ChatContainer-CNTY3C2D.mjs.map +7 -0
  60. package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs → ai-client-XGNA6SJ5.mjs} +4 -4
  61. package/dist/lib/node-esm/{ai-client-2GBZRHBA.mjs.map → ai-client-XGNA6SJ5.mjs.map} +3 -3
  62. package/dist/lib/node-esm/{app-graph-builder-5N7OK23B.mjs → app-graph-builder-IJQEN7WT.mjs} +70 -4
  63. package/dist/lib/node-esm/app-graph-builder-IJQEN7WT.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-6HLBYDUI.mjs +244 -0
  65. package/dist/lib/node-esm/chunk-6HLBYDUI.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-DNCXRGAF.mjs +151 -0
  67. package/dist/lib/node-esm/chunk-DNCXRGAF.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-X3LPRWIL.mjs → chunk-EMVA6QUT.mjs} +4 -2
  69. package/dist/lib/node-esm/chunk-EMVA6QUT.mjs.map +7 -0
  70. package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs → chunk-IJRTDSKN.mjs} +2 -2
  71. package/dist/lib/node-esm/chunk-QP47VJT6.mjs +1603 -0
  72. package/dist/lib/node-esm/chunk-QP47VJT6.mjs.map +7 -0
  73. package/dist/lib/node-esm/{chunk-5QUXIXNB.mjs → chunk-ZLIAMW45.mjs} +108 -27
  74. package/dist/lib/node-esm/chunk-ZLIAMW45.mjs.map +7 -0
  75. package/dist/lib/node-esm/index.mjs +56 -45
  76. package/dist/lib/node-esm/index.mjs.map +3 -3
  77. package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs +30 -0
  78. package/dist/lib/node-esm/intent-resolver-DCP4ZDBA.mjs.map +7 -0
  79. package/dist/lib/node-esm/meta.json +1 -1
  80. package/dist/lib/node-esm/{react-surface-77S6XJOM.mjs → react-surface-SBDXFVIN.mjs} +32 -23
  81. package/dist/lib/node-esm/react-surface-SBDXFVIN.mjs.map +7 -0
  82. package/dist/lib/node-esm/types/index.mjs +10 -4
  83. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  84. package/dist/types/src/artifacts.stories.d.ts +10 -24
  85. package/dist/types/src/artifacts.stories.d.ts.map +1 -1
  86. package/dist/types/src/capabilities/app-graph-builder.d.ts +45 -44
  87. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  88. package/dist/types/src/capabilities/index.d.ts +27 -27
  89. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  92. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts +3 -0
  93. package/dist/types/src/components/AmbientChatDialog/AmbientChatDialog.d.ts.map +1 -0
  94. package/dist/types/src/components/AmbientChatDialog/index.d.ts +2 -0
  95. package/dist/types/src/components/AmbientChatDialog/index.d.ts.map +1 -0
  96. package/dist/types/src/components/Box/StatusLine.d.ts +11 -0
  97. package/dist/types/src/components/Box/StatusLine.d.ts.map +1 -0
  98. package/dist/types/src/components/Box/StatusLine.stories.d.ts +9 -0
  99. package/dist/types/src/components/Box/StatusLine.stories.d.ts.map +1 -0
  100. package/dist/types/src/components/Box/Tabbed.d.ts +15 -0
  101. package/dist/types/src/components/Box/Tabbed.d.ts.map +1 -0
  102. package/dist/types/src/components/Box/Tabbed.stories.d.ts +8 -0
  103. package/dist/types/src/components/Box/Tabbed.stories.d.ts.map +1 -0
  104. package/dist/types/src/components/Box/ToggleContainer.d.ts +13 -0
  105. package/dist/types/src/components/Box/ToggleContainer.d.ts.map +1 -0
  106. package/dist/types/src/components/Box/ToggleContainer.stories.d.ts +9 -0
  107. package/dist/types/src/components/Box/ToggleContainer.stories.d.ts.map +1 -0
  108. package/dist/types/src/components/Box/index.d.ts +4 -0
  109. package/dist/types/src/components/Box/index.d.ts.map +1 -0
  110. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +7 -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/MarkdownViewer/MarkdownViewer.d.ts +14 -0
  115. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +1 -0
  116. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +8 -0
  117. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +1 -0
  118. package/dist/types/src/components/MarkdownViewer/index.d.ts +2 -0
  119. package/dist/types/src/components/MarkdownViewer/index.d.ts.map +1 -0
  120. package/dist/types/src/components/Prompt/Prompt.d.ts +7 -0
  121. package/dist/types/src/components/Prompt/Prompt.d.ts.map +1 -0
  122. package/dist/types/src/components/Prompt/Prompt.stories.d.ts +8 -0
  123. package/dist/types/src/components/Prompt/Prompt.stories.d.ts.map +1 -0
  124. package/dist/types/src/components/Prompt/index.d.ts +2 -0
  125. package/dist/types/src/components/Prompt/index.d.ts.map +1 -0
  126. package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts +20 -0
  127. package/dist/types/src/components/Prompt/prompt-autocomplete.d.ts.map +1 -0
  128. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +6 -0
  129. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +1 -0
  130. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +8 -0
  131. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +1 -0
  132. package/dist/types/src/components/ServiceRegistry/index.d.ts +2 -0
  133. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +1 -0
  134. package/dist/types/src/components/Thread/Thread.d.ts +6 -9
  135. package/dist/types/src/components/Thread/Thread.d.ts.map +1 -1
  136. package/dist/types/src/components/Thread/Thread.stories.d.ts +3 -4
  137. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +1 -1
  138. package/dist/types/src/components/Thread/ThreadMessage.d.ts +12 -0
  139. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +1 -0
  140. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  141. package/dist/types/src/components/index.d.ts +6 -2
  142. package/dist/types/src/components/index.d.ts.map +1 -1
  143. package/dist/types/src/hooks/index.d.ts +3 -0
  144. package/dist/types/src/hooks/index.d.ts.map +1 -1
  145. package/dist/types/src/hooks/processor.d.ts +39 -15
  146. package/dist/types/src/hooks/processor.d.ts.map +1 -1
  147. package/dist/types/src/hooks/useChatProcessor.d.ts +7 -0
  148. package/dist/types/src/hooks/useChatProcessor.d.ts.map +1 -0
  149. package/dist/types/src/hooks/useMessageQueue.d.ts +41 -0
  150. package/dist/types/src/hooks/useMessageQueue.d.ts.map +1 -0
  151. package/dist/types/src/hooks/useServices.d.ts +7 -0
  152. package/dist/types/src/hooks/useServices.d.ts.map +1 -0
  153. package/dist/types/src/meta.d.ts +1 -0
  154. package/dist/types/src/meta.d.ts.map +1 -1
  155. package/dist/types/src/testing/index.d.ts +2 -1
  156. package/dist/types/src/testing/index.d.ts.map +1 -1
  157. package/dist/types/src/testing/{testing.d.ts → test-functions.d.ts} +1 -1
  158. package/dist/types/src/testing/test-functions.d.ts.map +1 -0
  159. package/dist/types/src/testing/test-services.d.ts +5 -0
  160. package/dist/types/src/testing/test-services.d.ts.map +1 -0
  161. package/dist/types/src/tools/function.d.ts +5 -0
  162. package/dist/types/src/tools/function.d.ts.map +1 -0
  163. package/dist/types/src/tools/index.d.ts +3 -0
  164. package/dist/types/src/tools/index.d.ts.map +1 -0
  165. package/dist/types/src/tools/openapi.d.ts +10 -0
  166. package/dist/types/src/tools/openapi.d.ts.map +1 -0
  167. package/dist/types/src/tools/openapi.test.d.ts +2 -0
  168. package/dist/types/src/tools/openapi.test.d.ts.map +1 -0
  169. package/dist/types/src/translations.d.ts +12 -6
  170. package/dist/types/src/translations.d.ts.map +1 -1
  171. package/dist/types/src/types/index.d.ts +1 -0
  172. package/dist/types/src/types/index.d.ts.map +1 -1
  173. package/dist/types/src/types/registry.d.ts +10 -0
  174. package/dist/types/src/types/registry.d.ts.map +1 -0
  175. package/dist/types/src/types/schema.d.ts +156 -7
  176. package/dist/types/src/types/schema.d.ts.map +1 -1
  177. package/dist/types/src/types/types.d.ts +2 -2
  178. package/dist/types/src/types/types.d.ts.map +1 -1
  179. package/dist/types/tsconfig.tsbuildinfo +1 -1
  180. package/package.json +56 -49
  181. package/src/AutomationPlugin.tsx +18 -26
  182. package/src/artifacts.stories.tsx +126 -65
  183. package/src/capabilities/ai-client.ts +1 -1
  184. package/src/capabilities/app-graph-builder.ts +65 -5
  185. package/src/capabilities/intent-resolver.ts +14 -9
  186. package/src/capabilities/react-surface.tsx +21 -13
  187. package/src/components/AmbientChatDialog/AmbientChatDialog.tsx +26 -0
  188. package/src/components/AmbientChatDialog/index.ts +5 -0
  189. package/src/components/Box/StatusLine.stories.tsx +52 -0
  190. package/src/components/Box/StatusLine.tsx +76 -0
  191. package/src/components/Box/Tabbed.stories.tsx +51 -0
  192. package/src/components/Box/Tabbed.tsx +89 -0
  193. package/src/components/Box/ToggleContainer.stories.tsx +110 -0
  194. package/src/components/Box/ToggleContainer.tsx +108 -0
  195. package/src/components/Box/index.ts +7 -0
  196. package/src/components/ChatContainer/ChatContainer.tsx +52 -0
  197. package/src/components/ChatContainer/index.ts +8 -0
  198. package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +56 -0
  199. package/src/components/MarkdownViewer/MarkdownViewer.tsx +79 -0
  200. package/src/components/MarkdownViewer/index.ts +5 -0
  201. package/src/components/Prompt/Prompt.stories.tsx +50 -0
  202. package/src/components/Prompt/Prompt.tsx +36 -0
  203. package/src/components/Prompt/index.ts +5 -0
  204. package/src/components/Prompt/prompt-autocomplete.ts +200 -0
  205. package/src/components/PromptEditor/PromptEditor.stories.tsx +3 -3
  206. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +49 -0
  207. package/src/components/ServiceRegistry/ServiceRegistry.tsx +75 -0
  208. package/src/components/ServiceRegistry/index.ts +5 -0
  209. package/src/components/Thread/Thread.stories.tsx +152 -97
  210. package/src/components/Thread/Thread.tsx +115 -108
  211. package/src/components/Thread/ThreadMessage.tsx +225 -0
  212. package/src/components/TriggerEditor/TriggerEditor.tsx +8 -5
  213. package/src/components/index.ts +5 -1
  214. package/src/hooks/index.ts +4 -0
  215. package/src/hooks/processor.ts +114 -65
  216. package/src/hooks/useChatProcessor.tsx +86 -0
  217. package/src/hooks/useMessageQueue.ts +23 -0
  218. package/src/hooks/useServices.ts +28 -0
  219. package/src/meta.ts +4 -1
  220. package/src/testing/index.ts +2 -1
  221. package/src/testing/test-services.ts +131 -0
  222. package/src/tools/function.ts +47 -0
  223. package/src/tools/index.ts +6 -0
  224. package/src/tools/openapi.test.ts +227 -0
  225. package/src/tools/openapi.ts +331 -0
  226. package/src/translations.ts +9 -6
  227. package/src/types/index.ts +1 -0
  228. package/src/types/registry.ts +26 -0
  229. package/src/types/schema.ts +90 -3
  230. package/src/types/types.ts +2 -2
  231. package/dist/lib/browser/AssistantPanel-KO6DZBTU.mjs +0 -340
  232. package/dist/lib/browser/AssistantPanel-KO6DZBTU.mjs.map +0 -7
  233. package/dist/lib/browser/AutomationPanel-BMLM533Z.mjs +0 -131
  234. package/dist/lib/browser/AutomationPanel-BMLM533Z.mjs.map +0 -7
  235. package/dist/lib/browser/ChatContainer-SIAJFRFF.mjs +0 -300
  236. package/dist/lib/browser/ChatContainer-SIAJFRFF.mjs.map +0 -7
  237. package/dist/lib/browser/app-graph-builder-IJTTULDP.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-C3VRGDR6.mjs +0 -75
  239. package/dist/lib/browser/chunk-C3VRGDR6.mjs.map +0 -7
  240. package/dist/lib/browser/chunk-EKJVAFT2.mjs.map +0 -7
  241. package/dist/lib/browser/chunk-HKX3D3ZP.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-JSNPW6JF.mjs +0 -14
  243. package/dist/lib/browser/chunk-JSNPW6JF.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-KPSDH6XZ.mjs +0 -118
  245. package/dist/lib/browser/chunk-KPSDH6XZ.mjs.map +0 -7
  246. package/dist/lib/browser/chunk-YZF3SDZL.mjs +0 -139
  247. package/dist/lib/browser/chunk-YZF3SDZL.mjs.map +0 -7
  248. package/dist/lib/browser/intent-resolver-AHDQ3KQP.mjs +0 -24
  249. package/dist/lib/browser/intent-resolver-AHDQ3KQP.mjs.map +0 -7
  250. package/dist/lib/browser/react-surface-IGMBLSV7.mjs.map +0 -7
  251. package/dist/lib/node/AssistantPanel-PPFS2HKK.cjs +0 -360
  252. package/dist/lib/node/AssistantPanel-PPFS2HKK.cjs.map +0 -7
  253. package/dist/lib/node/AutomationPanel-RXJDVLCF.cjs.map +0 -7
  254. package/dist/lib/node/ChatContainer-GS2SC5OG.cjs +0 -318
  255. package/dist/lib/node/ChatContainer-GS2SC5OG.cjs.map +0 -7
  256. package/dist/lib/node/app-graph-builder-MF5M4QRS.cjs.map +0 -7
  257. package/dist/lib/node/chunk-5VF5JKUN.cjs.map +0 -7
  258. package/dist/lib/node/chunk-BUQOZA4N.cjs.map +0 -7
  259. package/dist/lib/node/chunk-DNLBVFR7.cjs +0 -147
  260. package/dist/lib/node/chunk-DNLBVFR7.cjs.map +0 -7
  261. package/dist/lib/node/chunk-TWDGP26W.cjs +0 -172
  262. package/dist/lib/node/chunk-TWDGP26W.cjs.map +0 -7
  263. package/dist/lib/node/chunk-VEGLN4YN.cjs +0 -250
  264. package/dist/lib/node/chunk-VEGLN4YN.cjs.map +0 -7
  265. package/dist/lib/node/chunk-Z2YFE5SJ.cjs +0 -49
  266. package/dist/lib/node/chunk-Z2YFE5SJ.cjs.map +0 -7
  267. package/dist/lib/node/intent-resolver-TBHYXBDI.cjs.map +0 -7
  268. package/dist/lib/node/react-surface-BVUZMKYS.cjs.map +0 -7
  269. package/dist/lib/node-esm/AssistantPanel-XSSKKCJY.mjs +0 -341
  270. package/dist/lib/node-esm/AssistantPanel-XSSKKCJY.mjs.map +0 -7
  271. package/dist/lib/node-esm/AutomationPanel-GQZZ4UBI.mjs +0 -132
  272. package/dist/lib/node-esm/AutomationPanel-GQZZ4UBI.mjs.map +0 -7
  273. package/dist/lib/node-esm/ChatContainer-57ILGC3R.mjs +0 -301
  274. package/dist/lib/node-esm/ChatContainer-57ILGC3R.mjs.map +0 -7
  275. package/dist/lib/node-esm/app-graph-builder-5N7OK23B.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-5QUXIXNB.mjs.map +0 -7
  277. package/dist/lib/node-esm/chunk-ICHNUP5M.mjs +0 -119
  278. package/dist/lib/node-esm/chunk-ICHNUP5M.mjs.map +0 -7
  279. package/dist/lib/node-esm/chunk-JCYVS5GG.mjs +0 -76
  280. package/dist/lib/node-esm/chunk-JCYVS5GG.mjs.map +0 -7
  281. package/dist/lib/node-esm/chunk-L2B6VGMG.mjs +0 -16
  282. package/dist/lib/node-esm/chunk-L2B6VGMG.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-U7HXYMPZ.mjs +0 -141
  284. package/dist/lib/node-esm/chunk-U7HXYMPZ.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-X3LPRWIL.mjs.map +0 -7
  286. package/dist/lib/node-esm/intent-resolver-DPJJHFGK.mjs +0 -25
  287. package/dist/lib/node-esm/intent-resolver-DPJJHFGK.mjs.map +0 -7
  288. package/dist/lib/node-esm/react-surface-77S6XJOM.mjs.map +0 -7
  289. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts +0 -8
  290. package/dist/types/src/components/AssistantPanel/AssistantPanel.d.ts.map +0 -1
  291. package/dist/types/src/components/AssistantPanel/index.d.ts +0 -3
  292. package/dist/types/src/components/AssistantPanel/index.d.ts.map +0 -1
  293. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts +0 -6
  294. package/dist/types/src/components/AssistantPanel/system-instructions.d.ts.map +0 -1
  295. package/dist/types/src/components/ChatContainer.d.ts +0 -8
  296. package/dist/types/src/components/ChatContainer.d.ts.map +0 -1
  297. package/dist/types/src/testing/testing.d.ts.map +0 -1
  298. package/src/components/AssistantPanel/AssistantPanel.tsx +0 -232
  299. package/src/components/AssistantPanel/index.ts +0 -7
  300. package/src/components/AssistantPanel/system-instructions.ts +0 -166
  301. package/src/components/ChatContainer.tsx +0 -80
  302. /package/dist/lib/browser/{chunk-HZ4TA7HY.mjs.map → chunk-2H2EUYXL.mjs.map} +0 -0
  303. /package/dist/lib/node/{chunk-ZS5RZ7RM.cjs.map → chunk-U5Z7LFWB.cjs.map} +0 -0
  304. /package/dist/lib/node-esm/{chunk-ISYLEDVU.mjs.map → chunk-IJRTDSKN.mjs.map} +0 -0
  305. /package/src/testing/{testing.ts → test-functions.ts} +0 -0
@@ -4,97 +4,127 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import { type Meta } from '@storybook/react';
8
- import React, { useMemo, useState } from 'react';
7
+ import { type StoryObj, type Meta } from '@storybook/react';
8
+ import React, { useCallback, useEffect, useMemo, useState } from 'react';
9
9
 
10
- import { Capabilities, Surface, useCapabilities } from '@dxos/app-framework';
10
+ import { Capabilities, IntentPlugin, Surface, useCapabilities, useIntentDispatcher } from '@dxos/app-framework';
11
11
  import { withPluginManager } from '@dxos/app-framework/testing';
12
- import { type Tool, type Message } from '@dxos/artifact';
13
- import { type ArtifactsContext, capabilities, genericTools, localServiceEndpoints } from '@dxos/artifact-testing';
12
+ import { Message, type Tool } from '@dxos/artifact';
13
+ import { capabilities, genericTools, localServiceEndpoints, type IsObject } from '@dxos/artifact-testing';
14
14
  import { AIServiceClientImpl } from '@dxos/assistant';
15
- import { create } from '@dxos/client/echo';
16
15
  import { createStatic, ObjectId } from '@dxos/echo-schema';
17
16
  import { EdgeHttpClient } from '@dxos/edge-client';
17
+ import { invariant } from '@dxos/invariant';
18
18
  import { DXN, QueueSubspaceTags, SpaceId } from '@dxos/keys';
19
19
  import { ChessPlugin } from '@dxos/plugin-chess';
20
20
  import { ChessType } from '@dxos/plugin-chess/types';
21
+ import { ClientPlugin } from '@dxos/plugin-client';
21
22
  import { MapPlugin } from '@dxos/plugin-map';
23
+ import { SpacePlugin } from '@dxos/plugin-space';
24
+ import { TablePlugin } from '@dxos/plugin-table';
25
+ import { useSpace } from '@dxos/react-client/echo';
22
26
  import { useQueue } from '@dxos/react-edge-client';
23
27
  import { IconButton, Input, Toolbar } from '@dxos/react-ui';
24
28
  import { mx } from '@dxos/react-ui-theme';
25
29
  import { withLayout, withSignals, withTheme } from '@dxos/storybook-utils';
26
30
 
27
- import { Thread } from './components';
31
+ import { Thread, type ThreadProps } from './components';
28
32
  import { ChatProcessor } from './hooks';
29
33
  import { createProcessorOptions } from './testing';
34
+ import translations from './translations';
30
35
 
31
36
  const endpoints = localServiceEndpoints;
32
37
 
33
38
  type RenderProps = {
34
- items?: ArtifactsContext['items']; // TODO(burdon): Typedef.
35
- };
39
+ items?: IsObject[];
40
+ prompts?: string[];
41
+ } & Pick<ThreadProps, 'debug'>;
36
42
 
37
- const Render = ({ items: _items }: RenderProps) => {
43
+ // TODO(burdon): Use ChatContainer.
44
+ const Render = ({ items: _items, prompts = [], ...props }: RenderProps) => {
45
+ const space = useSpace();
38
46
  const artifactDefinitions = useCapabilities(Capabilities.ArtifactDefinition);
39
-
40
- // Configuration.
41
47
  const tools = useMemo<Tool[]>(
42
- () => [
43
- // prettier-ignore
44
- ...genericTools,
45
- ...artifactDefinitions.flatMap((definition) => definition.tools),
46
- ],
48
+ () => [...genericTools, ...artifactDefinitions.flatMap((definition) => definition.tools)],
47
49
  [genericTools, artifactDefinitions],
48
50
  );
49
51
 
50
- // TODO(burdon): Common naming/packaging.
51
- const [edgeClient] = useState(() => new EdgeHttpClient(endpoints.edge));
52
52
  const [aiClient] = useState(() => new AIServiceClientImpl({ endpoint: endpoints.ai }));
53
+ const [edgeClient] = useState(() => new EdgeHttpClient(endpoints.edge));
54
+ const { dispatchPromise: dispatch } = useIntentDispatcher();
55
+ const processor = useMemo<ChatProcessor | undefined>(() => {
56
+ if (!space) {
57
+ return;
58
+ }
53
59
 
54
- // Queue.
55
- const [queueDxn, setQueueDxn] = useState(() => randomQueueDxn());
56
- const queue = useQueue<Message>(edgeClient, DXN.parse(queueDxn, true));
57
-
58
- // Artifacts.
59
- // TODO(burdon): Factor out class.
60
- const [artifactsContext] = useState(() =>
61
- create<ArtifactsContext>({
62
- items: _items ?? [],
63
- getArtifacts() {
64
- return this.items;
65
- },
66
- addArtifact(artifact) {
67
- this.items.push(artifact);
60
+ return new ChatProcessor(
61
+ aiClient,
62
+ tools,
63
+ {
64
+ space,
65
+ dispatch,
68
66
  },
69
- }),
70
- );
67
+ createProcessorOptions(artifactDefinitions.map((definition) => definition.instructions)),
68
+ );
69
+ }, [aiClient, tools, space, dispatch, artifactDefinitions]);
71
70
 
72
- // TODO(burdon): Create hook.
73
- const processor = useMemo(
74
- () =>
75
- new ChatProcessor(
76
- aiClient,
77
- tools,
78
- { artifacts: artifactsContext },
79
- createProcessorOptions(artifactDefinitions.map((definition) => definition.instructions)),
80
- ),
81
- [aiClient, tools, artifactsContext, artifactDefinitions],
82
- );
71
+ // Queue.
72
+ const [queueDxn, setQueueDxn] = useState(() => randomQueueDxn());
73
+ const queue = useQueue<Message>(edgeClient, DXN.tryParse(queueDxn));
74
+
75
+ useEffect(() => {
76
+ if (queue?.items.length === 0 && !queue.isLoading && prompts.length > 0) {
77
+ queue.append([
78
+ createStatic(Message, {
79
+ role: 'assistant',
80
+ content: prompts.map(
81
+ (prompt) =>
82
+ ({
83
+ type: 'json',
84
+ disposition: 'suggest',
85
+ json: JSON.stringify({ text: prompt }),
86
+ }) as const,
87
+ ),
88
+ }),
89
+ ]);
90
+ }
91
+ }, [queueDxn, prompts, queue?.items.length, queue?.isLoading]);
83
92
 
84
93
  // State.
85
- const artifactItems = artifactsContext.items.toReversed();
86
- const messages = [...queue.items, ...processor.messages.value];
87
-
88
- const handleSubmit = async (message: string) => {
89
- // TODO(burdon): Button to cancel. Otherwise queue request.
90
- if (processor.isStreaming) {
91
- await processor.cancel();
92
- }
94
+ const artifactItems: any[] = []; // TODO(burdon): Query from space.
95
+ const messages = [...(queue?.items ?? []), ...(processor?.messages.value ?? [])];
96
+
97
+ const handleSubmit = processor
98
+ ? async (message: string) => {
99
+ invariant(processor);
100
+ if (processor.streaming.value) {
101
+ await processor.cancel();
102
+ }
103
+
104
+ invariant(queue);
105
+ await processor.request(message, {
106
+ history: queue.items,
107
+ onComplete: (messages) => {
108
+ queue.append(messages);
109
+ },
110
+ });
111
+ }
112
+ : undefined;
113
+
114
+ const handleSuggest = useCallback(
115
+ (text: string) => {
116
+ void handleSubmit?.(text);
117
+ },
118
+ [handleSubmit],
119
+ );
93
120
 
94
- const messages = await processor.request(message, queue.items);
95
- // TODO(burdon): Append on success only? If approved by user? Clinet/server.
96
- queue.append(messages);
97
- };
121
+ const handleDelete = useCallback(
122
+ (id: string) => {
123
+ invariant(ObjectId.isValid(id), 'Invalid message id');
124
+ void queue?.delete([id]);
125
+ },
126
+ [queue],
127
+ );
98
128
 
99
129
  return (
100
130
  <div className='grid grid-cols-2 w-full h-full divide-x divide-separator overflow-hidden'>
@@ -106,7 +136,7 @@ const Render = ({ items: _items }: RenderProps) => {
106
136
  spellCheck={false}
107
137
  placeholder='Queue DXN'
108
138
  value={queueDxn}
109
- onClick={() => setQueueDxn('')}
139
+ // onClick={() => setQueueDxn('')} Why?????
110
140
  onChange={(ev) => setQueueDxn(ev.target.value)}
111
141
  />
112
142
  <IconButton
@@ -121,11 +151,18 @@ const Render = ({ items: _items }: RenderProps) => {
121
151
  icon='ph--trash--regular'
122
152
  onClick={() => setQueueDxn(randomQueueDxn())}
123
153
  />
124
- <IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor.cancel()} />
154
+ <IconButton iconOnly label='Stop' icon='ph--stop--regular' onClick={() => processor?.cancel()} />
125
155
  </Input.Root>
126
156
  </Toolbar.Root>
127
157
 
128
- <Thread messages={messages} streaming={processor.isStreaming.value} onSubmit={handleSubmit} />
158
+ <Thread
159
+ messages={messages}
160
+ streaming={processor?.streaming.value}
161
+ onSubmit={processor ? handleSubmit : undefined}
162
+ onSuggest={processor ? handleSuggest : undefined}
163
+ onDelete={processor ? handleDelete : undefined}
164
+ {...props}
165
+ />
129
166
  </div>
130
167
 
131
168
  {/* Artifacts Deck/Mosaic */}
@@ -157,20 +194,44 @@ const meta: Meta<typeof Render> = {
157
194
  title: 'plugins/plugin-automation/artifacts',
158
195
  render: Render,
159
196
  decorators: [
160
- //
161
197
  withSignals,
198
+ withPluginManager({
199
+ plugins: [
200
+ ClientPlugin({
201
+ onClientInitialized: async (_, client) => {
202
+ await client.halo.createIdentity();
203
+ },
204
+ }),
205
+ SpacePlugin({ observability: false }),
206
+ IntentPlugin(),
207
+ ChessPlugin(),
208
+ MapPlugin(),
209
+ TablePlugin(),
210
+ ],
211
+ capabilities,
212
+ }),
162
213
  withTheme,
163
214
  withLayout({ fullscreen: true, tooltips: true }),
164
- withPluginManager({ plugins: [ChessPlugin(), MapPlugin()], capabilities }),
165
215
  ],
216
+ parameters: {
217
+ translations,
218
+ },
166
219
  };
167
220
 
168
221
  export default meta;
169
222
 
170
- export const Default = {};
223
+ type Story = StoryObj<typeof Render>;
224
+
225
+ export const Default: Story = {
226
+ args: {
227
+ debug: true,
228
+ prompts: ['Ask me a question', 'Show me a chess puzzle'],
229
+ },
230
+ };
171
231
 
172
- export const WithInitialItems = {
232
+ export const WithInitialItems: Story = {
173
233
  args: {
234
+ debug: true,
174
235
  items: [
175
236
  createStatic(ChessType, {
176
237
  fen: 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
@@ -13,7 +13,7 @@ const DEFAULT_AI_SERVICE_URL = 'http://localhost:8788';
13
13
 
14
14
  export default (context: PluginsContext) => {
15
15
  const client = context.requestCapability(ClientCapabilities.Client);
16
- const endpoint = client.config.values.runtime?.app?.env?.DX_AI_SERVICE_URL ?? DEFAULT_AI_SERVICE_URL;
16
+ const endpoint = client.config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL;
17
17
  const aiClient = new AIServiceClientImpl({ endpoint });
18
18
  return contributes(AutomationCapabilities.AiClient, aiClient);
19
19
  };
@@ -2,19 +2,81 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Capabilities, contributes, type PluginsContext } from '@dxos/app-framework';
5
+ import { Capabilities, contributes, createIntent, LayoutAction, type PluginsContext } from '@dxos/app-framework';
6
6
  import { ClientCapabilities } from '@dxos/plugin-client';
7
- import { createExtension, toSignal } from '@dxos/plugin-graph';
7
+ import { createExtension, type Node, ROOT_ID, toSignal } from '@dxos/plugin-graph';
8
8
  import { memoizeQuery } from '@dxos/plugin-space';
9
9
  import { getTypename, parseId, SpaceState } from '@dxos/react-client/echo';
10
10
 
11
- import { AUTOMATION_PLUGIN } from '../meta';
11
+ import { AMBIENT_CHAT_DIALOG, AUTOMATION_PLUGIN } from '../meta';
12
12
 
13
13
  export default (context: PluginsContext) => {
14
14
  const resolve = (typename: string) =>
15
15
  context.requestCapabilities(Capabilities.Metadata).find(({ id }) => id === typename)?.metadata ?? {};
16
16
 
17
17
  return contributes(Capabilities.AppGraphBuilder, [
18
+ createExtension({
19
+ id: `${AUTOMATION_PLUGIN}/service-registry`,
20
+ resolver: ({ id }) => {
21
+ if (!id.endsWith('~service-registry')) {
22
+ return;
23
+ }
24
+
25
+ const type = 'orphan-settings-for-subject';
26
+ const icon = 'ph--plugs--regular';
27
+
28
+ const client = context.requestCapability(ClientCapabilities.Client);
29
+ const [subjectId] = id.split('~');
30
+ const { spaceId } = parseId(subjectId);
31
+ const spaces = toSignal(
32
+ (onChange) => client.spaces.subscribe(() => onChange()).unsubscribe,
33
+ () => client.spaces.get(),
34
+ );
35
+ const space = spaces?.find((space) => space.id === spaceId && space.state.get() === SpaceState.SPACE_READY);
36
+ return {
37
+ id,
38
+ type,
39
+ data: null,
40
+ properties: {
41
+ icon,
42
+ label: ['service registry label', { ns: AUTOMATION_PLUGIN }],
43
+ object: null,
44
+ space,
45
+ },
46
+ };
47
+ },
48
+ }),
49
+ createExtension({
50
+ id: `${AUTOMATION_PLUGIN}/ambient-chat`,
51
+ filter: (node): node is Node<null> => node.id === ROOT_ID,
52
+ actions: () => [
53
+ {
54
+ id: `${LayoutAction.UpdateDialog._tag}/ambient-chat/open`,
55
+ data: async () => {
56
+ const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
57
+ await dispatch(
58
+ createIntent(LayoutAction.UpdateDialog, {
59
+ part: 'dialog',
60
+ subject: AMBIENT_CHAT_DIALOG,
61
+ options: {
62
+ state: true,
63
+ blockAlign: 'end',
64
+ },
65
+ }),
66
+ );
67
+ },
68
+ properties: {
69
+ label: ['open ambient chat label', { ns: AUTOMATION_PLUGIN }],
70
+ icon: 'ph--chat-centered-text--regular',
71
+ disposition: 'pin-end',
72
+ keyBinding: {
73
+ macos: 'shift+meta+k',
74
+ windows: 'shift+ctrl+k',
75
+ },
76
+ },
77
+ },
78
+ ],
79
+ }),
18
80
  createExtension({
19
81
  id: `${AUTOMATION_PLUGIN}/automation-for-subject`,
20
82
  resolver: ({ id }) => {
@@ -80,7 +142,6 @@ export default (context: PluginsContext) => {
80
142
  createExtension({
81
143
  id: `${AUTOMATION_PLUGIN}/assistant-for-subject`,
82
144
  resolver: ({ id }) => {
83
- // TODO(Zan): Find util (or make one). Effect schema!!
84
145
  if (!id.endsWith('~assistant')) {
85
146
  return;
86
147
  }
@@ -110,7 +171,6 @@ export default (context: PluginsContext) => {
110
171
  }
111
172
 
112
173
  const [object] = memoizeQuery(space, { id: objectId });
113
-
114
174
  return {
115
175
  id,
116
176
  type: 'orphan-automation-for-subject',
@@ -6,17 +6,22 @@ import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
6
6
  import { ObjectId } from '@dxos/echo-schema';
7
7
  import { create, makeRef } from '@dxos/live-object';
8
8
 
9
- import { AutomationAction, GptChatType } from '../types';
9
+ import { AutomationAction, AIChatType } from '../types';
10
10
 
11
11
  export default () =>
12
12
  contributes(
13
13
  Capabilities.IntentResolver,
14
- createResolver(AutomationAction.Create, ({ name }) => ({
15
- data: {
16
- object: create(GptChatType, {
17
- name,
18
- queue: makeRef({ id: ObjectId.random() }), // new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, SpaceId.random(), ObjectId.random()]).toString(),
19
- }),
20
- },
21
- })),
14
+ createResolver({
15
+ intent: AutomationAction.Create,
16
+ resolve: ({ name }) => ({
17
+ data: {
18
+ object: create(AIChatType, {
19
+ name,
20
+ // TODO(burdon): ???
21
+ // new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, SpaceId.random(), ObjectId.random()]).toString(),
22
+ queue: makeRef({ id: ObjectId.random() }),
23
+ }),
24
+ },
25
+ }),
26
+ }),
22
27
  );
@@ -5,18 +5,32 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
8
- import { getSpace, isEchoObject, type ReactiveEchoObject } from '@dxos/react-client/echo';
8
+ import { getSpace, isEchoObject, isSpace, type ReactiveEchoObject } from '@dxos/react-client/echo';
9
9
 
10
- import { AssistantPanel, AutomationPanel, ChatContainer } from '../components';
11
- import { AUTOMATION_PLUGIN } from '../meta';
12
- import { GptChatType } from '../types';
10
+ import { AmbientChatDialog, AutomationPanel, ChatContainer, ServiceRegistry } from '../components';
11
+ import { AUTOMATION_PLUGIN, AMBIENT_CHAT_DIALOG } from '../meta';
12
+ import { AIChatType } from '../types';
13
13
 
14
14
  export default () =>
15
15
  contributes(Capabilities.ReactSurface, [
16
16
  createSurface({
17
- id: `${AUTOMATION_PLUGIN}/assistant`,
18
- role: 'complementary--assistant',
19
- component: ({ data }) => <AssistantPanel subject={data.subject} />,
17
+ id: `${AUTOMATION_PLUGIN}/ai-chat`,
18
+ role: 'article',
19
+ filter: (data): data is { subject: AIChatType } => data.subject instanceof AIChatType,
20
+ component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
21
+ }),
22
+ createSurface({
23
+ id: `${AUTOMATION_PLUGIN}/service-registry`,
24
+ role: 'complementary--service-registry',
25
+ component: ({ data }) => (
26
+ <ServiceRegistry space={isSpace(data.subject) ? data.subject : getSpace(data.subject)!} />
27
+ ),
28
+ }),
29
+ createSurface({
30
+ id: AMBIENT_CHAT_DIALOG,
31
+ role: 'dialog',
32
+ filter: (data): data is any => data.component === AMBIENT_CHAT_DIALOG,
33
+ component: () => <AmbientChatDialog />,
20
34
  }),
21
35
  createSurface({
22
36
  id: `${AUTOMATION_PLUGIN}/automation`,
@@ -25,10 +39,4 @@ export default () =>
25
39
  isEchoObject(data.subject) && !!getSpace(data.subject),
26
40
  component: ({ data }) => <AutomationPanel space={getSpace(data.subject)!} object={data.subject} />,
27
41
  }),
28
- createSurface({
29
- id: `${AUTOMATION_PLUGIN}/gpt-chat`,
30
- role: 'article',
31
- filter: (data): data is { subject: GptChatType } => data.subject instanceof GptChatType,
32
- component: ({ data, role }) => <ChatContainer role={role} chat={data.subject} />,
33
- }),
34
42
  ]);
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { Dialog, Icon, useTranslation } from '@dxos/react-ui';
8
+
9
+ import { AUTOMATION_PLUGIN } from '../../meta';
10
+
11
+ const preventDefault = (event: Event) => event.preventDefault();
12
+
13
+ export const AmbientChatDialog = () => {
14
+ const { t } = useTranslation(AUTOMATION_PLUGIN);
15
+ return (
16
+ <div role='none' className='dx-dialog__overlay bg-transparent pointer-events-none' data-block-align='end'>
17
+ <Dialog.Content onInteractOutside={preventDefault} classNames='pointer-events-auto' inOverlayLayout>
18
+ <Dialog.Title classNames='sr-only'>{t('ambient chat dialog title')}</Dialog.Title>
19
+ <Dialog.Close>
20
+ <Icon icon='ph--x--regular' size={4} />
21
+ </Dialog.Close>
22
+ <h1>Hello</h1>
23
+ </Dialog.Content>
24
+ </div>
25
+ );
26
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export * from './AmbientChatDialog';
@@ -0,0 +1,52 @@
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 { faker } from '@dxos/random';
11
+ import { Button } from '@dxos/react-ui';
12
+ import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
13
+
14
+ import { StatusLine } from './StatusLine';
15
+
16
+ const meta: Meta<typeof StatusLine> = {
17
+ title: 'plugins/plugin-automation/StatusLine',
18
+ component: StatusLine,
19
+ decorators: [withSignals, withTheme, withLayout()],
20
+ parameters: {
21
+ layout: 'centered',
22
+ },
23
+ };
24
+
25
+ export default meta;
26
+
27
+ type Story = StoryObj<typeof StatusLine>;
28
+
29
+ export const Default: Story = {
30
+ args: {
31
+ classNames: 'w-96 px-2',
32
+ lines: Array.from({ length: 5 }, (_, i) => `${i}. ${faker.lorem.paragraph()}`),
33
+ autoAdvance: true,
34
+ },
35
+ };
36
+
37
+ export const Demo: Story = {
38
+ render: () => {
39
+ const [lines, setLines] = useState<string[]>([]);
40
+
41
+ return (
42
+ <div className='flex flex-col w-96 gap-4'>
43
+ <StatusLine lines={lines} autoAdvance advance={500} />
44
+ <div>
45
+ <Button onClick={() => setLines((lines) => [...lines, `${lines.length + 1}. ${faker.lorem.paragraph()}`])}>
46
+ Add
47
+ </Button>
48
+ </div>
49
+ </div>
50
+ );
51
+ },
52
+ };
@@ -0,0 +1,76 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, { useEffect, useRef, useState } from 'react';
6
+
7
+ import { type ThemedClassName } from '@dxos/react-ui';
8
+ import { mx } from '@dxos/react-ui-theme';
9
+
10
+ const emptyLines: string[] = [];
11
+
12
+ export type StatusLineProps = ThemedClassName<{
13
+ line?: number;
14
+ lines?: string[];
15
+ transition?: number;
16
+ advance?: number;
17
+ autoAdvance?: boolean;
18
+ }>;
19
+
20
+ export const StatusLine = ({
21
+ classNames,
22
+ line = -1,
23
+ lines = emptyLines,
24
+ transition = 300,
25
+ advance = 1_000,
26
+ autoAdvance,
27
+ }: StatusLineProps) => {
28
+ const containerRef = useRef<HTMLDivElement>(null);
29
+ const [currentLine, setCurrentLine] = useState(line);
30
+ useEffect(() => {
31
+ setCurrentLine(line);
32
+ }, [line]);
33
+
34
+ useEffect(() => {
35
+ if (!autoAdvance) {
36
+ return;
37
+ }
38
+
39
+ const next = () => {
40
+ setCurrentLine((prev) => {
41
+ if (prev >= lines.length - 1) {
42
+ clearInterval(interval);
43
+ return prev;
44
+ }
45
+
46
+ return prev + 1;
47
+ });
48
+ };
49
+
50
+ next();
51
+ const interval = setInterval(next, advance);
52
+
53
+ return () => clearInterval(interval);
54
+ }, [lines.length, autoAdvance, advance]);
55
+
56
+ useEffect(() => {
57
+ if (containerRef.current) {
58
+ containerRef.current.style.transition = `transform ${transition}ms ease-in-out`;
59
+ containerRef.current.style.transform = `translateY(-${currentLine * 24}px)`;
60
+ }
61
+ }, [currentLine]);
62
+
63
+ return (
64
+ <div className={mx('relative h-[24px] overflow-hidden', classNames)}>
65
+ <div ref={containerRef} className='h-[24px]'>
66
+ <div className='flex flex-col'>
67
+ {lines.map((line, i) => (
68
+ <div key={i} className={mx('flex h-[24px] items-center')}>
69
+ <span className='truncate'>{line}</span>
70
+ </div>
71
+ ))}
72
+ </div>
73
+ </div>
74
+ </div>
75
+ );
76
+ };
@@ -0,0 +1,51 @@
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 { faker } from '@dxos/random';
11
+ import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
12
+
13
+ import { Tabs } from './Tabbed';
14
+ import { ToggleContainer } from './ToggleContainer';
15
+
16
+ const content = Array.from({ length: 4 }, (_, i) => ({
17
+ title: faker.lorem.paragraph(),
18
+ content: faker.lorem.paragraphs(3),
19
+ }));
20
+
21
+ const meta: Meta<typeof Tabs> = {
22
+ title: 'plugins/plugin-automation/Tabbed',
23
+ component: Tabs,
24
+ decorators: [withSignals, withTheme, withLayout({ fullscreen: true, classNames: 'justify-center' })],
25
+ };
26
+
27
+ export default meta;
28
+
29
+ type Story = StoryObj<typeof Tabs>;
30
+
31
+ export const Default: Story = {
32
+ render: () => {
33
+ const [selected, setSelected] = useState(0);
34
+ return (
35
+ <div className='flex flex-col w-[500px] p-4 bg-attention'>
36
+ <ToggleContainer
37
+ open
38
+ title={content[selected].title}
39
+ classNames='p-1 rounded-lg bg-baseSurface border border-neutral-500'
40
+ >
41
+ <div className='flex w-full overflow-hidden'>
42
+ <Tabs length={content.length} selected={selected} onSelect={setSelected} />
43
+ <div className='flex-1 pis-2 pie-2 overflow-y-auto'>
44
+ <div>{content[selected].content}</div>
45
+ </div>
46
+ </div>
47
+ </ToggleContainer>
48
+ </div>
49
+ );
50
+ },
51
+ };