@dxos/plugin-automation 0.7.5-labs.f5080a1 → 0.7.5-main.5ae2ba8

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 (297) 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-DQ7ZSYJJ.mjs → chunk-OFDNNRLE.mjs} +3 -6
  4. package/dist/lib/browser/{chunk-DQ7ZSYJJ.mjs.map → chunk-OFDNNRLE.mjs.map} +3 -3
  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 +22 -373
  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-OCW5GAVZ.cjs → AutomationPanel-X33HHDMQ.cjs} +19 -131
  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/chunk-CB5OB6JH.cjs +40 -0
  21. package/dist/lib/node/chunk-CB5OB6JH.cjs.map +7 -0
  22. package/dist/lib/node/{chunk-TQEDPRY5.cjs → chunk-ORMEYEBE.cjs} +6 -9
  23. package/dist/lib/node/{chunk-TQEDPRY5.cjs.map → chunk-ORMEYEBE.cjs.map} +3 -3
  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 +37 -374
  27. package/dist/lib/node/index.cjs.map +4 -4
  28. package/dist/lib/node/meta.json +1 -1
  29. package/dist/lib/node/{react-surface-HDAVE6NU.cjs → react-surface-2WRVAPGR.cjs} +9 -28
  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-JFHI22MF.mjs → chunk-6MUUH67V.mjs} +3 -6
  34. package/dist/lib/node-esm/{chunk-JFHI22MF.mjs.map → chunk-6MUUH67V.mjs.map} +3 -3
  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 +22 -373
  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 -180
  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 +1 -2
  53. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  54. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  55. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -2
  56. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  57. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  58. package/dist/types/src/components/index.d.ts +1 -11
  59. package/dist/types/src/components/index.d.ts.map +1 -1
  60. package/dist/types/src/index.d.ts +1 -3
  61. package/dist/types/src/index.d.ts.map +1 -1
  62. package/dist/types/src/meta.d.ts +0 -1
  63. package/dist/types/src/meta.d.ts.map +1 -1
  64. package/dist/types/src/testing/index.d.ts +0 -1
  65. package/dist/types/src/testing/index.d.ts.map +1 -1
  66. package/dist/types/src/testing/test-functions.d.ts +0 -2
  67. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  68. package/dist/types/src/translations.d.ts +2 -92
  69. package/dist/types/src/translations.d.ts.map +1 -1
  70. package/package.json +23 -71
  71. package/src/AutomationPlugin.tsx +9 -64
  72. package/src/capabilities/complementary-panel.ts +56 -0
  73. package/src/capabilities/index.ts +1 -5
  74. package/src/capabilities/react-surface.tsx +2 -16
  75. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -2
  76. package/src/components/AutomationPanel/AutomationPanel.tsx +56 -49
  77. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +1 -2
  78. package/src/components/TriggerEditor/TriggerEditor.tsx +6 -1
  79. package/src/components/index.ts +0 -7
  80. package/src/index.ts +2 -3
  81. package/src/meta.ts +1 -2
  82. package/src/testing/index.ts +0 -1
  83. package/src/testing/test-functions.ts +0 -7
  84. package/src/translations.ts +2 -29
  85. package/dist/lib/browser/AutomationPanel-YPD3AGQN.mjs +0 -8
  86. package/dist/lib/browser/AutomationPanel-YPD3AGQN.mjs.map +0 -7
  87. package/dist/lib/browser/ChatContainer-ODZECATM.mjs +0 -12
  88. package/dist/lib/browser/ChatContainer-ODZECATM.mjs.map +0 -7
  89. package/dist/lib/browser/ai-client-UJLNYP7B.mjs +0 -22
  90. package/dist/lib/browser/ai-client-UJLNYP7B.mjs.map +0 -7
  91. package/dist/lib/browser/app-graph-builder-3H5TCRG4.mjs +0 -162
  92. package/dist/lib/browser/app-graph-builder-3H5TCRG4.mjs.map +0 -7
  93. package/dist/lib/browser/chunk-43WRHV2L.mjs +0 -150
  94. package/dist/lib/browser/chunk-43WRHV2L.mjs.map +0 -7
  95. package/dist/lib/browser/chunk-BQHXJZ4K.mjs +0 -15
  96. package/dist/lib/browser/chunk-BQHXJZ4K.mjs.map +0 -7
  97. package/dist/lib/browser/chunk-DL7XA62G.mjs +0 -1531
  98. package/dist/lib/browser/chunk-DL7XA62G.mjs.map +0 -7
  99. package/dist/lib/browser/chunk-PQGFC2ZO.mjs +0 -284
  100. package/dist/lib/browser/chunk-PQGFC2ZO.mjs.map +0 -7
  101. package/dist/lib/browser/chunk-Z54KIF6H.mjs +0 -242
  102. package/dist/lib/browser/chunk-Z54KIF6H.mjs.map +0 -7
  103. package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs +0 -29
  104. package/dist/lib/browser/intent-resolver-5YVZJFS3.mjs.map +0 -7
  105. package/dist/lib/browser/react-surface-WRHRCEV5.mjs +0 -50
  106. package/dist/lib/browser/react-surface-WRHRCEV5.mjs.map +0 -7
  107. package/dist/lib/browser/types/index.mjs +0 -24
  108. package/dist/lib/browser/types/index.mjs.map +0 -7
  109. package/dist/lib/node/AutomationPanel-CO26O75P.cjs +0 -26
  110. package/dist/lib/node/AutomationPanel-CO26O75P.cjs.map +0 -7
  111. package/dist/lib/node/ChatContainer-5URBEXQD.cjs +0 -33
  112. package/dist/lib/node/ChatContainer-5URBEXQD.cjs.map +0 -7
  113. package/dist/lib/node/ai-client-AOB6TLNW.cjs +0 -38
  114. package/dist/lib/node/ai-client-AOB6TLNW.cjs.map +0 -7
  115. package/dist/lib/node/app-graph-builder-CDEQJEHY.cjs +0 -178
  116. package/dist/lib/node/app-graph-builder-CDEQJEHY.cjs.map +0 -7
  117. package/dist/lib/node/chunk-AWZVJZ2I.cjs +0 -34
  118. package/dist/lib/node/chunk-AWZVJZ2I.cjs.map +0 -7
  119. package/dist/lib/node/chunk-D2QQXWOY.cjs +0 -302
  120. package/dist/lib/node/chunk-D2QQXWOY.cjs.map +0 -7
  121. package/dist/lib/node/chunk-H3RSMGJG.cjs +0 -173
  122. package/dist/lib/node/chunk-H3RSMGJG.cjs.map +0 -7
  123. package/dist/lib/node/chunk-NH7STAX6.cjs +0 -1515
  124. package/dist/lib/node/chunk-NH7STAX6.cjs.map +0 -7
  125. package/dist/lib/node/chunk-OCW5GAVZ.cjs.map +0 -7
  126. package/dist/lib/node/intent-resolver-MJFZT5IU.cjs +0 -44
  127. package/dist/lib/node/intent-resolver-MJFZT5IU.cjs.map +0 -7
  128. package/dist/lib/node/react-surface-HDAVE6NU.cjs.map +0 -7
  129. package/dist/lib/node/types/index.cjs +0 -46
  130. package/dist/lib/node/types/index.cjs.map +0 -7
  131. package/dist/lib/node-esm/AutomationPanel-VQZUKPK2.mjs +0 -9
  132. package/dist/lib/node-esm/AutomationPanel-VQZUKPK2.mjs.map +0 -7
  133. package/dist/lib/node-esm/ChatContainer-23QIVDG5.mjs +0 -13
  134. package/dist/lib/node-esm/ChatContainer-23QIVDG5.mjs.map +0 -7
  135. package/dist/lib/node-esm/ai-client-RUCCJ7JZ.mjs +0 -23
  136. package/dist/lib/node-esm/ai-client-RUCCJ7JZ.mjs.map +0 -7
  137. package/dist/lib/node-esm/app-graph-builder-GR3URVNX.mjs +0 -163
  138. package/dist/lib/node-esm/app-graph-builder-GR3URVNX.mjs.map +0 -7
  139. package/dist/lib/node-esm/chunk-7JO77AAS.mjs +0 -151
  140. package/dist/lib/node-esm/chunk-7JO77AAS.mjs.map +0 -7
  141. package/dist/lib/node-esm/chunk-JJFWFS6P.mjs +0 -1532
  142. package/dist/lib/node-esm/chunk-JJFWFS6P.mjs.map +0 -7
  143. package/dist/lib/node-esm/chunk-LSSWQIQD.mjs +0 -16
  144. package/dist/lib/node-esm/chunk-LSSWQIQD.mjs.map +0 -7
  145. package/dist/lib/node-esm/chunk-NSVQZ3EH.mjs +0 -243
  146. package/dist/lib/node-esm/chunk-NSVQZ3EH.mjs.map +0 -7
  147. package/dist/lib/node-esm/chunk-VN2AFV25.mjs +0 -285
  148. package/dist/lib/node-esm/chunk-VN2AFV25.mjs.map +0 -7
  149. package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs +0 -30
  150. package/dist/lib/node-esm/intent-resolver-FCKNRTKQ.mjs.map +0 -7
  151. package/dist/lib/node-esm/react-surface-FZ5OFRDE.mjs +0 -51
  152. package/dist/lib/node-esm/react-surface-FZ5OFRDE.mjs.map +0 -7
  153. package/dist/lib/node-esm/types/index.mjs +0 -25
  154. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  155. package/dist/types/src/artifacts.stories.d.ts +0 -16
  156. package/dist/types/src/artifacts.stories.d.ts.map +0 -1
  157. package/dist/types/src/capabilities/ai-client.d.ts.map +0 -1
  158. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -180
  159. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  160. package/dist/types/src/capabilities/capabilities.d.ts +0 -5
  161. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  162. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  163. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  164. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts +0 -7
  165. package/dist/types/src/components/ChatContainer/ChatContainer.d.ts.map +0 -1
  166. package/dist/types/src/components/ChatContainer/index.d.ts +0 -4
  167. package/dist/types/src/components/ChatContainer/index.d.ts.map +0 -1
  168. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts +0 -14
  169. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.d.ts.map +0 -1
  170. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts +0 -8
  171. package/dist/types/src/components/MarkdownViewer/MarkdownViewer.stories.d.ts.map +0 -1
  172. package/dist/types/src/components/MarkdownViewer/index.d.ts +0 -2
  173. package/dist/types/src/components/MarkdownViewer/index.d.ts.map +0 -1
  174. package/dist/types/src/components/PromptEditor/PromptEditor.d.ts +0 -10
  175. package/dist/types/src/components/PromptEditor/PromptEditor.d.ts.map +0 -1
  176. package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts +0 -6
  177. package/dist/types/src/components/PromptEditor/PromptEditor.stories.d.ts.map +0 -1
  178. package/dist/types/src/components/PromptEditor/index.d.ts +0 -2
  179. package/dist/types/src/components/PromptEditor/index.d.ts.map +0 -1
  180. package/dist/types/src/components/PromptEditor/prompt-extension.d.ts +0 -4
  181. package/dist/types/src/components/PromptEditor/prompt-extension.d.ts.map +0 -1
  182. package/dist/types/src/components/PromptEditor/types.d.ts +0 -18
  183. package/dist/types/src/components/PromptEditor/types.d.ts.map +0 -1
  184. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts +0 -6
  185. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.d.ts.map +0 -1
  186. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts +0 -8
  187. package/dist/types/src/components/ServiceRegistry/ServiceRegistry.stories.d.ts.map +0 -1
  188. package/dist/types/src/components/ServiceRegistry/index.d.ts +0 -2
  189. package/dist/types/src/components/ServiceRegistry/index.d.ts.map +0 -1
  190. package/dist/types/src/components/Thread/ScrollContainer.d.ts +0 -15
  191. package/dist/types/src/components/Thread/ScrollContainer.d.ts.map +0 -1
  192. package/dist/types/src/components/Thread/StatusLine.d.ts +0 -11
  193. package/dist/types/src/components/Thread/StatusLine.d.ts.map +0 -1
  194. package/dist/types/src/components/Thread/StatusLine.stories.d.ts +0 -9
  195. package/dist/types/src/components/Thread/StatusLine.stories.d.ts.map +0 -1
  196. package/dist/types/src/components/Thread/Tabbed.d.ts +0 -9
  197. package/dist/types/src/components/Thread/Tabbed.d.ts.map +0 -1
  198. package/dist/types/src/components/Thread/Tabbed.stories.d.ts +0 -8
  199. package/dist/types/src/components/Thread/Tabbed.stories.d.ts.map +0 -1
  200. package/dist/types/src/components/Thread/Thread.d.ts +0 -11
  201. package/dist/types/src/components/Thread/Thread.d.ts.map +0 -1
  202. package/dist/types/src/components/Thread/Thread.stories.d.ts +0 -10
  203. package/dist/types/src/components/Thread/Thread.stories.d.ts.map +0 -1
  204. package/dist/types/src/components/Thread/ThreadMessage.d.ts +0 -12
  205. package/dist/types/src/components/Thread/ThreadMessage.d.ts.map +0 -1
  206. package/dist/types/src/components/Thread/ToggleContainer.d.ts +0 -13
  207. package/dist/types/src/components/Thread/ToggleContainer.d.ts.map +0 -1
  208. package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts +0 -9
  209. package/dist/types/src/components/Thread/ToggleContainer.stories.d.ts.map +0 -1
  210. package/dist/types/src/components/Thread/index.d.ts +0 -2
  211. package/dist/types/src/components/Thread/index.d.ts.map +0 -1
  212. package/dist/types/src/hooks/email.d.ts +0 -4
  213. package/dist/types/src/hooks/email.d.ts.map +0 -1
  214. package/dist/types/src/hooks/index.d.ts +0 -6
  215. package/dist/types/src/hooks/index.d.ts.map +0 -1
  216. package/dist/types/src/hooks/invocation-handler.d.ts +0 -5
  217. package/dist/types/src/hooks/invocation-handler.d.ts.map +0 -1
  218. package/dist/types/src/hooks/processor.d.ts +0 -70
  219. package/dist/types/src/hooks/processor.d.ts.map +0 -1
  220. package/dist/types/src/hooks/processor.test.d.ts +0 -2
  221. package/dist/types/src/hooks/processor.test.d.ts.map +0 -1
  222. package/dist/types/src/hooks/useChatProcessor.d.ts +0 -7
  223. package/dist/types/src/hooks/useChatProcessor.d.ts.map +0 -1
  224. package/dist/types/src/hooks/useLocalTriggerManager.d.ts +0 -3
  225. package/dist/types/src/hooks/useLocalTriggerManager.d.ts.map +0 -1
  226. package/dist/types/src/hooks/useMessageQueue.d.ts +0 -41
  227. package/dist/types/src/hooks/useMessageQueue.d.ts.map +0 -1
  228. package/dist/types/src/hooks/useServices.d.ts +0 -7
  229. package/dist/types/src/hooks/useServices.d.ts.map +0 -1
  230. package/dist/types/src/presets.d.ts +0 -9
  231. package/dist/types/src/presets.d.ts.map +0 -1
  232. package/dist/types/src/testing/test-services.d.ts +0 -5
  233. package/dist/types/src/testing/test-services.d.ts.map +0 -1
  234. package/dist/types/src/tools/function.d.ts +0 -5
  235. package/dist/types/src/tools/function.d.ts.map +0 -1
  236. package/dist/types/src/tools/index.d.ts +0 -3
  237. package/dist/types/src/tools/index.d.ts.map +0 -1
  238. package/dist/types/src/tools/openapi.d.ts +0 -10
  239. package/dist/types/src/tools/openapi.d.ts.map +0 -1
  240. package/dist/types/src/tools/openapi.test.d.ts +0 -2
  241. package/dist/types/src/tools/openapi.test.d.ts.map +0 -1
  242. package/dist/types/src/types/index.d.ts +0 -4
  243. package/dist/types/src/types/index.d.ts.map +0 -1
  244. package/dist/types/src/types/registry.d.ts +0 -10
  245. package/dist/types/src/types/registry.d.ts.map +0 -1
  246. package/dist/types/src/types/schema.d.ts +0 -221
  247. package/dist/types/src/types/schema.d.ts.map +0 -1
  248. package/dist/types/src/types/types.d.ts +0 -18
  249. package/dist/types/src/types/types.d.ts.map +0 -1
  250. package/src/artifacts.stories.tsx +0 -241
  251. package/src/capabilities/ai-client.ts +0 -19
  252. package/src/capabilities/app-graph-builder.ts +0 -156
  253. package/src/capabilities/capabilities.ts +0 -12
  254. package/src/capabilities/intent-resolver.ts +0 -27
  255. package/src/components/ChatContainer/ChatContainer.tsx +0 -52
  256. package/src/components/ChatContainer/index.ts +0 -8
  257. package/src/components/MarkdownViewer/MarkdownViewer.stories.tsx +0 -56
  258. package/src/components/MarkdownViewer/MarkdownViewer.tsx +0 -79
  259. package/src/components/MarkdownViewer/index.ts +0 -5
  260. package/src/components/PromptEditor/PromptEditor.stories.tsx +0 -64
  261. package/src/components/PromptEditor/PromptEditor.tsx +0 -222
  262. package/src/components/PromptEditor/index.ts +0 -5
  263. package/src/components/PromptEditor/prompt-extension.ts +0 -43
  264. package/src/components/PromptEditor/types.tsx +0 -28
  265. package/src/components/ServiceRegistry/ServiceRegistry.stories.tsx +0 -49
  266. package/src/components/ServiceRegistry/ServiceRegistry.tsx +0 -75
  267. package/src/components/ServiceRegistry/index.ts +0 -5
  268. package/src/components/Thread/ScrollContainer.tsx +0 -92
  269. package/src/components/Thread/StatusLine.stories.tsx +0 -52
  270. package/src/components/Thread/StatusLine.tsx +0 -76
  271. package/src/components/Thread/Tabbed.stories.tsx +0 -52
  272. package/src/components/Thread/Tabbed.tsx +0 -72
  273. package/src/components/Thread/Thread.stories.tsx +0 -190
  274. package/src/components/Thread/Thread.tsx +0 -156
  275. package/src/components/Thread/ThreadMessage.tsx +0 -203
  276. package/src/components/Thread/ToggleContainer.stories.tsx +0 -111
  277. package/src/components/Thread/ToggleContainer.tsx +0 -103
  278. package/src/components/Thread/index.ts +0 -5
  279. package/src/hooks/email.ts +0 -49
  280. package/src/hooks/index.ts +0 -10
  281. package/src/hooks/invocation-handler.ts +0 -109
  282. package/src/hooks/processor.test.ts +0 -15
  283. package/src/hooks/processor.ts +0 -210
  284. package/src/hooks/useChatProcessor.tsx +0 -86
  285. package/src/hooks/useLocalTriggerManager.ts +0 -82
  286. package/src/hooks/useMessageQueue.ts +0 -23
  287. package/src/hooks/useServices.ts +0 -28
  288. package/src/presets.ts +0 -248
  289. package/src/testing/test-services.ts +0 -131
  290. package/src/tools/function.ts +0 -47
  291. package/src/tools/index.ts +0 -6
  292. package/src/tools/openapi.test.ts +0 -227
  293. package/src/tools/openapi.ts +0 -331
  294. package/src/types/index.ts +0 -7
  295. package/src/types/registry.ts +0 -26
  296. package/src/types/schema.ts +0 -132
  297. package/src/types/types.ts +0 -21
@@ -1,203 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type FC } from 'react';
6
-
7
- import { type MessageContentBlock, type Message } from '@dxos/artifact';
8
- import { invariant } from '@dxos/invariant';
9
- import { log } from '@dxos/log';
10
- import { Button, ButtonGroup, Icon, type ThemedClassName } from '@dxos/react-ui';
11
- import { Json } from '@dxos/react-ui-syntax-highlighter';
12
- import { mx } from '@dxos/react-ui-theme';
13
- import { safeParseJson } from '@dxos/util';
14
-
15
- import { StatusLine } from './StatusLine';
16
- import { ToggleContainer } from './ToggleContainer';
17
- import { MarkdownViewer } from '../MarkdownViewer';
18
-
19
- export type ThreadMessageProps = ThemedClassName<{
20
- message: Message;
21
- collapse?: boolean;
22
- debug?: boolean;
23
- onSuggest?: (text: string) => void;
24
- onDelete?: (id: string) => void;
25
- }>;
26
-
27
- export const ThreadMessage: FC<ThreadMessageProps> = ({
28
- classNames,
29
- message,
30
- collapse,
31
- debug,
32
- onSuggest,
33
- onDelete,
34
- }) => {
35
- if (typeof message !== 'object') {
36
- return <div className={mx(classNames)}>{message}</div>;
37
- }
38
-
39
- const { role, content = [] } = message;
40
-
41
- // TODO(burdon): Factor out tool blocks.
42
- const toolBlocks = content.filter((block) => block.type === 'tool_use' || block.type === 'tool_result');
43
- if (collapse && toolBlocks.length > 0) {
44
- let request: (MessageContentBlock & { type: 'tool_use' }) | undefined;
45
- const json: any[] = [];
46
- const lines = toolBlocks.map((block) => {
47
- switch (block.type) {
48
- case 'tool_use': {
49
- request = block;
50
- json.push(block);
51
- // TODO(burdon): Get plugin name.
52
- return `Calling ${block.name}...`;
53
- }
54
-
55
- case 'tool_result': {
56
- if (!request) {
57
- log.warn('unexpected message', { tool: block });
58
- return 'Error';
59
- }
60
-
61
- json.push(block);
62
- return `Processed ${request.name}`;
63
- }
64
-
65
- default: {
66
- request = undefined;
67
- return 'Error';
68
- }
69
- }
70
- });
71
-
72
- return (
73
- <div className={mx('flex', classNames)}>
74
- <div className='w-full p-1 px-2 overflow-hidden rounded-md bg-baseSurface'>
75
- <ToggleContainer title={<StatusLine lines={lines} autoAdvance />} toggle>
76
- <Json data={json} classNames='!p-1 text-xs' />
77
- </ToggleContainer>
78
- </div>
79
- </div>
80
- );
81
- }
82
-
83
- return (
84
- <div className={mx('flex flex-col shrink-0 gap-2')}>
85
- {debug && (
86
- <div className='text-xs text-subdued'>
87
- {message.id}{' '}
88
- {onDelete && (
89
- <span className='cursor-pointer underline' onClick={() => onDelete(message.id)}>
90
- delete
91
- </span>
92
- )}
93
- </div>
94
- )}
95
- {content.map((block, idx) => (
96
- <div key={idx} className={mx('flex', classNames, block.type === 'text' && role === 'user' && 'justify-end')}>
97
- <Block role={role} block={block} onSuggest={onSuggest ?? (() => {})} />
98
- </div>
99
- ))}
100
- </div>
101
- );
102
- };
103
-
104
- const Block = ({
105
- block,
106
- role,
107
- onSuggest,
108
- }: Pick<Message, 'role'> & { block: MessageContentBlock; onSuggest: (text: string) => void }) => {
109
- const Component = componentMap[block.type] ?? componentMap.default;
110
- return (
111
- <div
112
- className={mx(
113
- 'p-1 px-2 overflow-hidden rounded-md',
114
- (block.type !== 'text' || block.disposition) && 'w-full bg-baseSurface',
115
- block.type === 'text' && role === 'user' && 'bg-primary-200 dark:bg-primary-500',
116
- )}
117
- >
118
- <Component block={block} onSuggest={onSuggest} />
119
- </div>
120
- );
121
- };
122
-
123
- const titles: Record<string, string> = {
124
- ['cot' as const]: 'Chain of thought',
125
- ['artifact' as const]: 'Artifact',
126
- ['tool_use' as const]: 'Tool request',
127
- ['tool_result' as const]: 'Tool result',
128
- };
129
-
130
- type BlockComponent = FC<{ block: MessageContentBlock; onSuggest: (text: string) => void }>;
131
-
132
- const componentMap: Record<string, BlockComponent> = {
133
- text: ({ block }) => {
134
- invariant(block.type === 'text');
135
- const title = block.disposition ? titles[block.disposition] : undefined;
136
- if (!title) {
137
- return (
138
- <MarkdownViewer content={block.text} classNames={[block.disposition === 'cot' && 'text-sm text-subdued']} />
139
- );
140
- }
141
-
142
- return (
143
- <ToggleContainer
144
- title={title}
145
- icon={
146
- block.pending ? (
147
- <Icon icon={'ph--circle-notch--regular'} classNames='text-subdued ml-2 animate-spin' size={4} />
148
- ) : undefined
149
- }
150
- defaultOpen={block.disposition === 'cot'}
151
- toggle
152
- >
153
- <MarkdownViewer content={block.text} classNames={[block.disposition === 'cot' && 'text-sm text-subdued']} />
154
- </ToggleContainer>
155
- );
156
- },
157
-
158
- json: ({ block, onSuggest }) => {
159
- invariant(block.type === 'json');
160
-
161
- switch (block.disposition) {
162
- case 'suggest': {
163
- const { text = '' }: { text: string } = safeParseJson(block.json ?? '{}') ?? ({} as any);
164
- return <Button onClick={() => onSuggest(text)}>{text}</Button>;
165
- }
166
-
167
- case 'select': {
168
- const { options = [] }: { options: string[] } = safeParseJson(block.json ?? '{}') ?? ({} as any);
169
- return (
170
- <ButtonGroup>
171
- {options.map((option) => (
172
- <Button key={option} onClick={() => onSuggest(option)}>
173
- {option}
174
- </Button>
175
- ))}
176
- </ButtonGroup>
177
- );
178
- }
179
-
180
- default: {
181
- const title = block.disposition ? titles[block.disposition] : undefined;
182
- return (
183
- <ToggleContainer title={title ?? 'JSON'} toggle>
184
- <Json data={safeParseJson(block.json ?? block)} classNames='!p-1 text-xs' />
185
- </ToggleContainer>
186
- );
187
- }
188
- }
189
- },
190
-
191
- default: ({ block }) => {
192
- let title = titles[block.type];
193
- if (block.type === 'tool_use') {
194
- title = `Tool [${block.name}]`; // TODO(burdon): Get label from tool.
195
- }
196
-
197
- return (
198
- <ToggleContainer title={title ?? 'JSON'} toggle>
199
- <Json data={block} classNames='!p-1 text-xs' />
200
- </ToggleContainer>
201
- );
202
- },
203
- };
@@ -1,111 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import { computed, type ReadonlySignal, signal } from '@preact/signals-core';
8
- import { type StoryObj, type Meta } from '@storybook/react';
9
- import React, { useEffect, useMemo, useState } from 'react';
10
-
11
- import { faker } from '@dxos/random';
12
- import { Icon, Input, Toolbar } from '@dxos/react-ui';
13
- import { mx } from '@dxos/react-ui-theme';
14
- import { withLayout, withTheme, withSignals } from '@dxos/storybook-utils';
15
-
16
- import { ToggleContainer, type ToggleContainerProps } from './ToggleContainer';
17
- import { MarkdownViewer } from '../MarkdownViewer';
18
-
19
- class Generator {
20
- private readonly _current = signal<string>(faker.lorem.sentence(5));
21
- private readonly _lines = signal<string[]>([]);
22
- private _running: NodeJS.Timeout | undefined;
23
-
24
- readonly count = computed(() => this._lines.value.length);
25
- readonly text: ReadonlySignal<string[]> = computed(() => [...this._lines.value, this._current.value]);
26
-
27
- start() {
28
- this.stop();
29
- this._running = setInterval(() => {
30
- if (this._current.value.length > 0) {
31
- this._current.value += ' ';
32
- }
33
- this._current.value += faker.lorem.words(Math.ceil(Math.random() * 2));
34
- if (Math.random() > 0.95) {
35
- this._lines.value = [...this._lines.value, this._current.value + '.'];
36
- this._current.value = '';
37
- }
38
- }, 100);
39
- }
40
-
41
- stop() {
42
- if (this._running) {
43
- clearInterval(this._running);
44
- this._running = undefined;
45
- }
46
- }
47
- }
48
-
49
- const Render = ({ shrinkX, ...props }: ToggleContainerProps) => {
50
- const generator = useMemo(() => new Generator(), []);
51
- const [running, setRunning] = useState(false);
52
- useEffect(() => {
53
- if (running) {
54
- generator.start();
55
- } else {
56
- generator.stop();
57
- }
58
- }, [running]);
59
-
60
- return (
61
- <div className='flex flex-col w-[500px]'>
62
- <Toolbar.Root classNames='p-4'>
63
- <Input.Root>
64
- <Input.Switch checked={running} onCheckedChange={(checked) => setRunning(checked)} />
65
- </Input.Root>
66
- <div className='grow' />
67
- <div>{generator.count.value}</div>
68
- </Toolbar.Root>
69
- <div className='flex p-4'>
70
- <div className={mx('border border-border rounded-md p-2', !shrinkX && 'w-full')}>
71
- <ToggleContainer
72
- {...props}
73
- shrinkX={shrinkX}
74
- toggle
75
- icon={
76
- running ? (
77
- <Icon icon={'ph--circle-notch--regular'} classNames='text-subdued ml-2 animate-spin' size={4} />
78
- ) : undefined
79
- }
80
- >
81
- <MarkdownViewer classNames='text-sm' content={generator.text.value.join('\n\n')} />
82
- </ToggleContainer>
83
- </div>
84
- </div>
85
- </div>
86
- );
87
- };
88
-
89
- const meta: Meta<typeof ToggleContainer> = {
90
- title: 'plugins/plugin-automation/ToggleContainer',
91
- component: ToggleContainer,
92
- render: Render,
93
- decorators: [withSignals, withTheme, withLayout({ fullscreen: true, classNames: 'justify-center bg-baseSurface' })],
94
- };
95
-
96
- export default meta;
97
-
98
- type Story = StoryObj<typeof ToggleContainer>;
99
-
100
- export const Default: Story = {
101
- args: {
102
- title: 'Markdown',
103
- },
104
- };
105
-
106
- export const Shrink: Story = {
107
- args: {
108
- title: 'Markdown',
109
- shrinkX: true,
110
- },
111
- };
@@ -1,103 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React, { type JSX, type PropsWithChildren, useEffect, useState } from 'react';
6
-
7
- import { Icon, type ThemedClassName } from '@dxos/react-ui';
8
- import { mx } from '@dxos/react-ui-theme';
9
-
10
- export type ToggleContainerProps = ThemedClassName<
11
- PropsWithChildren<{
12
- title?: string | JSX.Element;
13
- icon?: JSX.Element;
14
- toggle?: boolean;
15
- defaultOpen?: boolean;
16
- duration?: number;
17
- /** Should shrink the width when closed. */
18
- shrinkX?: boolean;
19
- }>
20
- >;
21
-
22
- // TODO(burdon): Externalize toggle state.
23
- export const ToggleContainer = ({
24
- title,
25
- icon,
26
- toggle,
27
- defaultOpen,
28
- duration = 400,
29
- shrinkX = false,
30
- children,
31
- classNames,
32
- }: ToggleContainerProps) => {
33
- const [expand, setExpand] = useState(defaultOpen || !toggle);
34
- const [expandX, setExpandX] = useState(shrinkX ? expand : true);
35
- const [expandY, setExpandY] = useState(expand);
36
-
37
- useEffect(() => {
38
- let t: NodeJS.Timeout;
39
- if (expand) {
40
- if (shrinkX) {
41
- setExpandX(true);
42
- }
43
- t = setTimeout(
44
- () => {
45
- setExpandY(true);
46
- },
47
- shrinkX ? duration : 0,
48
- );
49
- } else {
50
- setExpandY(false);
51
- if (shrinkX) {
52
- t = setTimeout(() => {
53
- setExpandX(false);
54
- }, duration);
55
- }
56
- }
57
-
58
- return () => clearTimeout(t);
59
- }, [expand]);
60
-
61
- return (
62
- <div className={mx('overflow-hidden', classNames)}>
63
- {title && (
64
- <div
65
- className='flex gap-1 py-1 items-center text-sm text-subdued cursor-pointer select-none'
66
- onClick={toggle ? () => setExpand((open) => !open) : undefined}
67
- >
68
- {toggle && (
69
- <div className='flex w-[24px] h-[24px] items-center justify-center'>
70
- <Icon
71
- size={4}
72
- icon={'ph--caret-right--regular'}
73
- style={{ transitionDuration: `${shrinkX ? duration * 2 : duration}ms` }}
74
- classNames={['transition transition-transform ease-in-out', expand ? 'rotate-90' : 'transform-none']}
75
- />
76
- </div>
77
- )}
78
- <div className='flex-1 pis-1 pie-1 truncate'>{title}</div>
79
- {icon}
80
- </div>
81
- )}
82
- <div
83
- style={{ transitionDuration: `${duration}ms` }}
84
- className={mx(
85
- 'grid transition-[grid-template-columns] ease-in-out',
86
- expandX ? 'grid-cols-[1fr]' : 'grid-cols-[0fr]',
87
- )}
88
- >
89
- <div className='overflow-hidden'>
90
- <div
91
- style={{ transitionDuration: `${duration}ms` }}
92
- className={mx(
93
- 'grid transition-[grid-template-rows] ease-in-out',
94
- expandY ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]',
95
- )}
96
- >
97
- <div className={mx('flex overflow-hidden transition-opacity')}>{children}</div>
98
- </div>
99
- </div>
100
- </div>
101
- </div>
102
- );
103
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './Thread';
@@ -1,49 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { findObjectWithForeignKey } from '@dxos/echo-db';
6
- import { foreignKey } from '@dxos/echo-schema';
7
- import { log } from '@dxos/log';
8
- import { MailboxType } from '@dxos/plugin-inbox/types';
9
- import { MessageType } from '@dxos/plugin-space/types';
10
- import { type Space, Filter, create, makeRef } from '@dxos/react-client/echo';
11
-
12
- export const SOURCE_ID = 'hub.dxos.network/api/mailbox';
13
-
14
- export const handleEmail = async (space: Space, data: any) => {
15
- const { messages } = data;
16
-
17
- // Create mailbox if doesn't exist.
18
- const { objects: mailboxes } = await space.db.query(Filter.schema(MailboxType)).run();
19
- const mailbox = mailboxes[0] ?? space.db.add(create(MailboxType, { messages: [] }));
20
-
21
- log.info('messages', { count: messages.length, existingMailbox: mailboxes.length > 0 });
22
-
23
- const { objects } = await space.db.query(Filter.schema(MessageType)).run();
24
- for (const message of messages) {
25
- let object = findObjectWithForeignKey(objects, { source: SOURCE_ID, id: String(message.id) });
26
- if (!object) {
27
- object = space.db.add(
28
- create(
29
- MessageType,
30
- {
31
- sender: { email: message.from },
32
- timestamp: new Date(message.created).toISOString(),
33
- text: message.body,
34
- properties: {
35
- subject: message.subject,
36
- to: [{ email: message.to }],
37
- },
38
- },
39
- {
40
- keys: [foreignKey(SOURCE_ID, String(message.id))],
41
- },
42
- ),
43
- );
44
- mailbox.messages?.push(makeRef(object));
45
- }
46
- }
47
-
48
- return 200;
49
- };
@@ -1,10 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export * from './processor';
6
-
7
- export * from './useChatProcessor';
8
- export * from './useLocalTriggerManager';
9
- export * from './useMessageQueue';
10
- export * from './useServices';
@@ -1,109 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { sleep } from '@dxos/async';
6
- import { getObjectCore, ResultFormat } from '@dxos/echo-db';
7
- import { type AnyObjectData } from '@dxos/echo-schema';
8
- import { FunctionType } from '@dxos/functions';
9
- import { type FunctionTrigger } from '@dxos/functions';
10
- import { invariant } from '@dxos/invariant';
11
- import { DXN, LOCAL_SPACE_TAG } from '@dxos/keys';
12
- import { log } from '@dxos/log';
13
- import { type Client, type Config } from '@dxos/react-client';
14
- import { type Space } from '@dxos/react-client/echo';
15
-
16
- const MAX_RETRIES = 3;
17
- const RETRY_DELAY = 1_000;
18
-
19
- const callFunction = async (funcUrl: string, trigger: any, data: any) => {
20
- const body = { event: 'trigger', trigger, data };
21
-
22
- let retryCount = 0;
23
- while (retryCount < MAX_RETRIES) {
24
- log.info('exec', { funcUrl, body, retryCount });
25
- const response = await fetch(funcUrl, {
26
- method: 'POST',
27
- headers: {
28
- 'Content-Type': 'application/json',
29
- },
30
- body: JSON.stringify(body),
31
- });
32
-
33
- const data = await response.text();
34
- log.info('response', { status: response.status, body: data });
35
- if (response.status === 409) {
36
- retryCount++;
37
- await sleep(RETRY_DELAY * Math.min(retryCount, 2));
38
- continue;
39
- }
40
-
41
- return { status: response.status, data };
42
- }
43
- return { status: 500 };
44
- };
45
-
46
- export const invokeFunction = async (client: Client, space: Space, trigger: FunctionTrigger, data: any) => {
47
- try {
48
- invariant(trigger.spec);
49
- invariant(trigger.function);
50
-
51
- const script = await space.db.query({ id: trigger.function }, { format: ResultFormat.Plain }).first();
52
- const { objects: functions } = await space.db
53
- .query({ __typename: FunctionType.typename }, { format: ResultFormat.Plain })
54
- .run();
55
- const func = functions.find((fn) => referenceEquals(fn.source, trigger.function!)) as AnyObjectData | undefined;
56
- const funcSlug = func?.__meta.keys.find((key) => key.source === USERFUNCTIONS_META_KEY)?.id;
57
- if (!funcSlug) {
58
- log.warn('function not deployed', { scriptId: script.id, name: script.name });
59
- return 404;
60
- }
61
-
62
- const funcUrl = getFunctionUrl(client.config, funcSlug, space.id);
63
- const triggerData: AnyObjectData = {
64
- ...getObjectCore(trigger).toPlainObject(),
65
- // TODO: Remove when functions can query by DXN.
66
- promptId: trigger.meta?.prompt?.id,
67
- };
68
- // TODO: Remove when functions can add objects and easily modify collections (push, splice).
69
- return (await callFunction(funcUrl, triggerData, data)).status;
70
- } catch (err) {
71
- return 400;
72
- }
73
- };
74
-
75
- const USERFUNCTIONS_META_KEY = 'dxos.org/service/function';
76
-
77
- const getFunctionUrl = (config: Config, slug: string, spaceId?: string) => {
78
- const baseUrl = new URL('functions/', config.values.runtime?.services?.edge?.url);
79
-
80
- // Leading slashes cause the URL to be treated as an absolute path.
81
- const relativeUrl = slug.replace(/^\//, '');
82
- const url = new URL(`./${relativeUrl}`, baseUrl.toString());
83
- spaceId && url.searchParams.set('spaceId', spaceId);
84
- url.protocol = 'https';
85
- return url.toString();
86
- };
87
-
88
- // TODO(dmaretskyi): Factor out.
89
-
90
- type ReferenceLike = { '/': string } | string;
91
-
92
- const referenceEquals = (a: ReferenceLike, b: ReferenceLike): boolean => {
93
- const aDXN = toDXN(a);
94
- const bDXN = toDXN(b);
95
- return aDXN.toString() === bDXN.toString();
96
- };
97
-
98
- const toDXN = (ref: ReferenceLike): DXN => {
99
- if (typeof ref === 'string') {
100
- if (ref.startsWith('dxn:')) {
101
- return DXN.parse(ref);
102
- } else {
103
- return new DXN(DXN.kind.ECHO, [LOCAL_SPACE_TAG, ref]);
104
- }
105
- }
106
-
107
- invariant(typeof ref['/'] === 'string');
108
- return DXN.parse(ref['/']);
109
- };
@@ -1,15 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { describe, it } from 'vitest';
6
-
7
- import { ChatProcessor } from './processor';
8
-
9
- describe('ChatProcessor', () => {
10
- it('should be instantiable', ({ expect }) => {
11
- const client = {} as any; // TODO(burdon): Create mock.
12
- const processor = new ChatProcessor(client);
13
- expect(processor).toBeDefined();
14
- });
15
- });