@dxos/plugin-automation 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b

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 (362) hide show
  1. package/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
  2. package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
  3. package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
  4. package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +138 -133
  5. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  6. package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
  7. package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
  8. package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
  9. package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
  10. package/dist/lib/{browser/chunk-QNEQ23BF.mjs → neutral/FunctionsPanel-GLCUBEDT.mjs} +23 -25
  11. package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
  12. package/dist/lib/{browser/FunctionsContainer-5NHAAP5H.mjs → neutral/FunctionsRegistry-VRU4FBVH.mjs} +23 -54
  13. package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
  14. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  15. package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
  16. package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
  17. package/dist/lib/neutral/capabilities/index.mjs +15 -0
  18. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  19. package/dist/lib/neutral/capabilities/node.mjs +13 -0
  20. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  22. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  23. package/dist/lib/{browser/chunk-PZNBEKO5.mjs → neutral/chunk-ATECY555.mjs} +7 -4
  24. package/dist/lib/{browser/chunk-PZNBEKO5.mjs.map → neutral/chunk-ATECY555.mjs.map} +3 -3
  25. package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
  26. package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
  27. package/dist/lib/{browser/chunk-C273ZYLE.mjs → neutral/chunk-FKFFU54G.mjs} +53 -41
  28. package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
  29. package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
  30. package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
  32. package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  34. package/dist/lib/{node-esm/chunk-EJPZWAGR.mjs → neutral/chunk-N735CP33.mjs} +69 -41
  35. package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
  36. package/dist/lib/neutral/components/index.mjs +16 -0
  37. package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
  38. package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
  39. package/dist/lib/neutral/containers/index.mjs +13 -0
  40. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  41. package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
  42. package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
  43. package/dist/lib/neutral/hooks/index.mjs +129 -0
  44. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  45. package/dist/lib/neutral/index.mjs +20 -0
  46. package/dist/lib/neutral/meta.json +1 -0
  47. package/dist/lib/neutral/meta.mjs +8 -0
  48. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  49. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  50. package/dist/lib/neutral/operations/index.mjs +8 -0
  51. package/dist/lib/neutral/plugin.mjs +16 -0
  52. package/dist/lib/neutral/plugin.mjs.map +7 -0
  53. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  54. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  55. package/dist/lib/neutral/translations.mjs +47 -0
  56. package/dist/lib/neutral/translations.mjs.map +7 -0
  57. package/dist/lib/neutral/types/index.mjs +16 -0
  58. package/dist/types/src/AutomationPlugin.d.ts +1 -0
  59. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  60. package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
  61. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  62. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  63. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  64. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  65. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
  67. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  68. package/dist/types/src/capabilities/index.d.ts +6 -4
  69. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  70. package/dist/types/src/capabilities/node.d.ts +6 -0
  71. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  73. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  75. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  76. package/dist/types/src/commands/index.d.ts.map +1 -0
  77. package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
  78. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  79. package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +1 -1
  80. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  81. package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
  82. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  83. package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
  84. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  85. package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +7 -7
  86. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  87. package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
  88. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  89. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  90. package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
  91. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  92. package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
  93. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  94. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  95. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  97. package/dist/types/src/{cli/commands → commands}/trigger/util.d.ts +4 -4
  98. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  99. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  100. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  101. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -31
  102. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  103. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  104. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  105. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  106. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  107. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  108. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  109. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
  110. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  111. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
  112. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  113. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  114. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  115. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +96 -92
  116. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  117. package/dist/types/src/components/index.d.ts +2 -3
  118. package/dist/types/src/components/index.d.ts.map +1 -1
  119. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  120. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  121. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  122. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  123. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  124. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  125. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  126. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  127. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  128. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  129. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  130. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  131. package/dist/types/src/containers/index.d.ts +5 -0
  132. package/dist/types/src/containers/index.d.ts.map +1 -0
  133. package/dist/types/src/hooks/index.d.ts +2 -0
  134. package/dist/types/src/hooks/index.d.ts.map +1 -1
  135. package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
  136. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  137. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
  138. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  139. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
  140. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  141. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
  142. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  143. package/dist/types/src/index.d.ts +0 -3
  144. package/dist/types/src/index.d.ts.map +1 -1
  145. package/dist/types/src/meta.d.ts.map +1 -1
  146. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  147. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  148. package/dist/types/src/operations/index.d.ts +3 -0
  149. package/dist/types/src/operations/index.d.ts.map +1 -0
  150. package/dist/types/src/plugin.d.ts +4 -0
  151. package/dist/types/src/plugin.d.ts.map +1 -0
  152. package/dist/types/src/testing/test-functions.d.ts +78 -76
  153. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  154. package/dist/types/src/translations.d.ts +32 -32
  155. package/dist/types/src/translations.d.ts.map +1 -1
  156. package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
  157. package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
  158. package/dist/types/src/types/AutomationEvents.d.ts +3 -0
  159. package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
  160. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  161. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  162. package/dist/types/src/types/index.d.ts +3 -2
  163. package/dist/types/src/types/index.d.ts.map +1 -1
  164. package/dist/types/src/types/schema.d.ts +9 -30
  165. package/dist/types/src/types/schema.d.ts.map +1 -1
  166. package/dist/types/tsconfig.tsbuildinfo +1 -1
  167. package/package.json +115 -65
  168. package/src/AutomationPlugin.node.ts +29 -0
  169. package/src/AutomationPlugin.test.ts +27 -0
  170. package/src/AutomationPlugin.tsx +11 -9
  171. package/src/capabilities/app-graph-builder.ts +66 -0
  172. package/src/capabilities/compute-runtime.ts +325 -0
  173. package/src/capabilities/index.ts +10 -4
  174. package/src/capabilities/node.ts +13 -0
  175. package/src/capabilities/operation-handler.ts +16 -0
  176. package/src/capabilities/react-surface.tsx +59 -0
  177. package/src/{cli/commands → commands}/trigger/create/queue.ts +6 -9
  178. package/src/{cli/commands → commands}/trigger/create/subscription.ts +10 -13
  179. package/src/{cli/commands → commands}/trigger/create/timer.ts +6 -9
  180. package/src/{cli/commands → commands}/trigger/list.ts +7 -4
  181. package/src/{cli/commands → commands}/trigger/remove.ts +1 -1
  182. package/src/{cli/commands → commands}/trigger/update/queue.ts +18 -19
  183. package/src/{cli/commands → commands}/trigger/update/subscription.ts +17 -17
  184. package/src/{cli/commands → commands}/trigger/update/timer.ts +18 -18
  185. package/src/{cli/commands → commands}/trigger/util.ts +39 -24
  186. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +8 -7
  187. package/src/components/AutomationPanel/AutomationPanel.tsx +76 -66
  188. package/src/components/FunctionsPanel/FunctionsPanel.tsx +31 -27
  189. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +25 -21
  190. package/src/components/FunctionsRegistry/index.ts +4 -1
  191. package/src/components/TriggerEditor/FunctionInputEditor.tsx +6 -6
  192. package/src/components/TriggerEditor/SpecSelector.tsx +17 -13
  193. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +54 -12
  194. package/src/components/TriggerEditor/TriggerEditor.tsx +45 -17
  195. package/src/components/index.ts +1 -2
  196. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  197. package/src/containers/AutomationSettings/index.ts +5 -0
  198. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  199. package/src/containers/FunctionsContainer/index.ts +5 -0
  200. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  201. package/src/containers/TriggerSettings/index.ts +6 -0
  202. package/src/containers/index.ts +9 -0
  203. package/src/hooks/index.ts +3 -0
  204. package/src/hooks/useComputeRuntime.ts +30 -0
  205. package/src/hooks/useComputeRuntimeCallback.ts +4 -39
  206. package/src/hooks/useComputeRuntimeService.ts +64 -0
  207. package/src/hooks/useTriggerRuntimeControls.ts +6 -3
  208. package/src/index.ts +0 -4
  209. package/src/meta.ts +3 -2
  210. package/src/operations/create-trigger-from-template.ts +72 -0
  211. package/src/operations/index.ts +7 -0
  212. package/src/plugin.ts +11 -0
  213. package/src/testing/test-functions.ts +11 -8
  214. package/src/translations.ts +39 -38
  215. package/src/types/AutomationCapabilities.ts +48 -0
  216. package/src/types/AutomationEvents.ts +11 -0
  217. package/src/types/AutomationOperation.ts +30 -0
  218. package/src/types/index.ts +4 -2
  219. package/src/types/schema.ts +3 -24
  220. package/dist/lib/browser/AutomationPanel-C6MZ22CB.mjs +0 -11
  221. package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs +0 -57
  222. package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs.map +0 -7
  223. package/dist/lib/browser/FunctionsContainer-5NHAAP5H.mjs.map +0 -7
  224. package/dist/lib/browser/FunctionsPanel-RD22LYMR.mjs +0 -10
  225. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +0 -85
  226. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +0 -7
  227. package/dist/lib/browser/chunk-C273ZYLE.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-JFBUK3WR.mjs +0 -14
  229. package/dist/lib/browser/chunk-JFBUK3WR.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-JN7QRQQX.mjs +0 -256
  231. package/dist/lib/browser/chunk-JN7QRQQX.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-JOXPQ27I.mjs +0 -83
  233. package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
  234. package/dist/lib/browser/chunk-O5Y2F33G.mjs +0 -8
  235. package/dist/lib/browser/chunk-O5Y2F33G.mjs.map +0 -7
  236. package/dist/lib/browser/chunk-P5AEO35Y.mjs +0 -93
  237. package/dist/lib/browser/chunk-P5AEO35Y.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-QNEQ23BF.mjs.map +0 -7
  239. package/dist/lib/browser/cli/index.mjs.map +0 -7
  240. package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs +0 -119
  241. package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs.map +0 -7
  242. package/dist/lib/browser/hooks/index.mjs +0 -13
  243. package/dist/lib/browser/index.mjs +0 -123
  244. package/dist/lib/browser/index.mjs.map +0 -7
  245. package/dist/lib/browser/meta.json +0 -1
  246. package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs +0 -83
  247. package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs.map +0 -7
  248. package/dist/lib/browser/react-surface-246NXXJR.mjs +0 -66
  249. package/dist/lib/browser/react-surface-246NXXJR.mjs.map +0 -7
  250. package/dist/lib/browser/types/index.mjs +0 -14
  251. package/dist/lib/node-esm/AutomationPanel-RTBY7YFM.mjs +0 -12
  252. package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs +0 -58
  253. package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs.map +0 -7
  254. package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs +0 -126
  255. package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs.map +0 -7
  256. package/dist/lib/node-esm/FunctionsPanel-V2DKWYMU.mjs +0 -11
  257. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +0 -86
  258. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
  260. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-AENSLAVD.mjs +0 -99
  262. package/dist/lib/node-esm/chunk-AENSLAVD.mjs.map +0 -7
  263. package/dist/lib/node-esm/chunk-EJPZWAGR.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs +0 -16
  265. package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-M3UPTGXF.mjs +0 -10
  267. package/dist/lib/node-esm/chunk-M3UPTGXF.mjs.map +0 -7
  268. package/dist/lib/node-esm/chunk-OJEFRZEV.mjs +0 -259
  269. package/dist/lib/node-esm/chunk-OJEFRZEV.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs +0 -94
  271. package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-RX52VKI2.mjs +0 -84
  273. package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
  274. package/dist/lib/node-esm/cli/index.mjs +0 -1109
  275. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  276. package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs +0 -120
  277. package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs.map +0 -7
  278. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  279. package/dist/lib/node-esm/index.mjs +0 -124
  280. package/dist/lib/node-esm/index.mjs.map +0 -7
  281. package/dist/lib/node-esm/meta.json +0 -1
  282. package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs +0 -84
  283. package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs.map +0 -7
  284. package/dist/lib/node-esm/react-surface-U6762KPI.mjs +0 -67
  285. package/dist/lib/node-esm/react-surface-U6762KPI.mjs.map +0 -7
  286. package/dist/lib/node-esm/types/index.mjs +0 -15
  287. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  288. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  289. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  290. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  291. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  292. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  293. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  294. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  295. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  296. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  297. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  298. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  299. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  300. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  301. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  302. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  303. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  304. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
  305. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
  306. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
  307. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
  308. package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
  309. package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
  310. package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
  311. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
  312. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
  313. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
  314. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
  315. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
  316. package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
  317. package/dist/types/src/cli/index.d.ts +0 -2
  318. package/dist/types/src/cli/index.d.ts.map +0 -1
  319. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  320. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  321. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  322. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  323. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  324. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  325. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  326. package/dist/types/src/types/capabilities.d.ts +0 -22
  327. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  328. package/dist/types/src/types/events.d.ts +0 -5
  329. package/dist/types/src/types/events.d.ts.map +0 -1
  330. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -72
  331. package/src/capabilities/app-graph-builder/index.ts +0 -7
  332. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -140
  333. package/src/capabilities/compute-runtime/index.ts +0 -7
  334. package/src/capabilities/operation-resolver/index.ts +0 -7
  335. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
  336. package/src/capabilities/react-surface/index.ts +0 -7
  337. package/src/capabilities/react-surface/react-surface.tsx +0 -61
  338. package/src/cli/index.ts +0 -5
  339. package/src/cli/plugin.ts +0 -24
  340. package/src/components/AutomationSettings.tsx +0 -30
  341. package/src/components/FunctionsContainer.tsx +0 -36
  342. package/src/components/TriggerSettings.tsx +0 -26
  343. package/src/types/capabilities.ts +0 -42
  344. package/src/types/events.ts +0 -11
  345. /package/dist/lib/{browser/AutomationPanel-C6MZ22CB.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
  346. /package/dist/lib/{browser/FunctionsPanel-RD22LYMR.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  347. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  348. /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
  349. /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
  350. /package/dist/lib/{node-esm/AutomationPanel-RTBY7YFM.mjs.map → neutral/meta.mjs.map} +0 -0
  351. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  352. /package/dist/lib/{node-esm/FunctionsPanel-V2DKWYMU.mjs.map → neutral/types/index.mjs.map} +0 -0
  353. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  354. /package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +0 -0
  355. /package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +0 -0
  356. /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
  357. /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
  358. /package/src/{cli/commands → commands}/index.ts +0 -0
  359. /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
  360. /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
  361. /package/src/{cli/commands → commands}/trigger/options.ts +0 -0
  362. /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
@@ -4,20 +4,21 @@
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
+ import { expect, userEvent, within } from 'storybook/test';
7
8
 
9
+ import { Operation, Trigger } from '@dxos/compute';
8
10
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
- import { Function, Trigger } from '@dxos/functions';
10
11
  import { invariant } from '@dxos/invariant';
11
- import { faker } from '@dxos/random';
12
+ import { random } from '@dxos/random';
12
13
  import { useQuery } from '@dxos/react-client/echo';
13
14
  import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
14
15
  import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form/translations';
15
17
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
16
- import { translations as formTranslations } from '@dxos/react-ui-form';
17
18
  import { Employer, Organization, Person, Pipeline } from '@dxos/types';
18
19
 
19
- import { functions } from '../../testing';
20
- import { translations } from '../../translations';
20
+ import { functions } from '#testing';
21
+ import { translations } from '#translations';
21
22
 
22
23
  import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
23
24
 
@@ -39,13 +40,13 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
39
40
  return;
40
41
  }
41
42
 
42
- const functions = await space.db.query(Filter.type(Function.Function)).run();
43
- const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
43
+ const functions = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
44
+ const fn = functions.find((fn) => fn.name === 'com.example.function.forex');
44
45
  invariant(fn);
45
46
  const trigger = space.db.add(
46
47
  Trigger.make({
47
48
  function: Ref.make(fn),
48
- spec: { kind: 'webhook' },
49
+ spec: Trigger.specWebhook(),
49
50
  input: {
50
51
  from: 'USD',
51
52
  to: 'JPY',
@@ -72,7 +73,7 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
72
73
  };
73
74
 
74
75
  const meta = {
75
- title: 'plugins/plugin-automation/TriggerEditor',
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
76
77
  component: TriggerEditor as any,
77
78
  render: DefaultStory,
78
79
  decorators: [
@@ -81,7 +82,7 @@ const meta = {
81
82
  withClientProvider({
82
83
  createIdentity: true,
83
84
  createSpace: true,
84
- types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
85
+ types: [Tag.Tag, Operation.PersistentOperation, Trigger.Trigger, TestSchema.ContactType],
85
86
  onCreateSpace: ({ space }) => {
86
87
  // Tags.
87
88
  ['Important', 'Investor', 'New'].forEach((label) => {
@@ -90,14 +91,14 @@ const meta = {
90
91
 
91
92
  // Functions.
92
93
  functions.forEach((fn) => {
93
- space.db.add(Function.make(fn));
94
+ space.db.add(Obj.make(Operation.PersistentOperation, { ...fn, version: fn.version ?? '0.1.0' }));
94
95
  });
95
96
 
96
97
  // Objects.
97
98
  Array.from({ length: 10 }).map(() => {
98
99
  return space.db.add(
99
100
  Obj.make(TestSchema.ContactType, {
100
- name: faker.person.fullName(),
101
+ name: random.person.fullName(),
101
102
  identifiers: [],
102
103
  }),
103
104
  );
@@ -122,3 +123,44 @@ export const ReadonlySpec: Story = {
122
123
  readonlySpec: true,
123
124
  },
124
125
  };
126
+
127
+ export const Spec: Story = {
128
+ play: async ({ canvasElement }) => {
129
+ const canvas = within(canvasElement);
130
+ const webhookText = await canvas.findByText('Webhook', {}, { timeout: 10_000 });
131
+ const combobox = webhookText.closest('[role="combobox"]') as HTMLElement;
132
+ await expect(combobox).not.toBeDisabled();
133
+
134
+ // Helper to switch to a kind via keyboard.
135
+ // TODO(wittjosiah): Radix Select in popper mode doesn't close on click.
136
+ // Use keyboard navigation: open, type first letter to jump, Enter to select.
137
+ const selectKind = async (combobox: HTMLElement, firstLetter: string) => {
138
+ combobox.focus();
139
+ await userEvent.keyboard('{Enter}');
140
+ await userEvent.keyboard(firstLetter);
141
+ await userEvent.keyboard('{Enter}');
142
+ };
143
+
144
+ // Timer — should show "Cron" field.
145
+ await selectKind(combobox, 't');
146
+ await expect(canvas.findByLabelText('Cron')).resolves.toBeInTheDocument();
147
+
148
+ // Email — no extra fields; Cron should be gone.
149
+ await selectKind(combobox, 'e');
150
+ await expect(combobox).not.toBeDisabled();
151
+ await expect(canvas.queryByLabelText('Cron')).not.toBeInTheDocument();
152
+
153
+ // Webhook — should show "Method" field.
154
+ await selectKind(combobox, 'w');
155
+ await expect(canvas.findByLabelText('Method')).resolves.toBeInTheDocument();
156
+
157
+ // Subscription — should show query editor.
158
+ await selectKind(combobox, 's');
159
+ await expect(combobox).not.toBeDisabled();
160
+ await expect(canvas.queryByLabelText('Method')).not.toBeInTheDocument();
161
+
162
+ // Feed — should show DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
163
+ await selectKind(combobox, 'f');
164
+ await expect(canvas.findByText('DXN')).resolves.toBeInTheDocument();
165
+ },
166
+ };
@@ -4,9 +4,9 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
+ import { Operation, Script, Trigger } from '@dxos/compute';
7
8
  import { ComputeGraph } from '@dxos/conductor';
8
- import { DXN, type Database, type Query } from '@dxos/echo';
9
- import { Function, Script, Trigger } from '@dxos/functions';
9
+ import { DXN, type Database, Entity, Feed, Obj, type Query } from '@dxos/echo';
10
10
  import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
11
11
  import { Input } from '@dxos/react-ui';
12
12
  import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
@@ -36,20 +36,31 @@ export type TriggerEditorProps = {
36
36
  Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
37
37
 
38
38
  export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
- const fieldMap = useCustomInputs({
40
- db,
41
- types,
42
- tags,
43
- readonlySpec,
44
- });
39
+ const fieldMap = useCustomInputs({ db, types, tags, readonlySpec });
40
+
41
+ const handleValuesChanged = useCallback(
42
+ (newValues: Partial<TriggerFormSchema>) => {
43
+ Obj.update(trigger, (trigger) => {
44
+ Object.assign(trigger, newValues);
45
+ });
46
+ },
47
+ [trigger],
48
+ );
49
+
50
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
51
+ const defaultValues = useMemo(() => {
52
+ const { id: _, ...values } = trigger;
53
+ return values;
54
+ }, [trigger]);
45
55
 
46
56
  return (
47
57
  <Form.Root<TriggerFormSchema>
48
58
  {...formProps}
49
- schema={omitId(Trigger.Trigger)}
50
- values={trigger}
51
59
  db={db}
60
+ schema={triggerSchema}
61
+ defaultValues={defaultValues}
52
62
  fieldMap={fieldMap}
63
+ onValuesChanged={handleValuesChanged}
53
64
  >
54
65
  <Form.Viewport>
55
66
  <Form.Content>
@@ -67,9 +78,10 @@ type UseCustomInputsProps = {
67
78
  } & Pick<QueryFormProps, 'types' | 'tags'>;
68
79
 
69
80
  const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
70
- const functions = useQuery(db, Filter.type(Function.Function));
81
+ const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
71
82
  const workflows = useQuery(db, Filter.type(ComputeGraph));
72
83
  const scripts = useQuery(db, Filter.type(Script.Script));
84
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
73
85
 
74
86
  return useMemo(
75
87
  (): FormFieldMap => ({
@@ -105,11 +117,14 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
105
117
  },
106
118
 
107
119
  // Spec selector.
108
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec} />,
120
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
121
+
122
+ // Queue feed selector with parent labels.
123
+ 'spec.queue': (props) => <SelectField {...props} options={getFeedQueueOptions(feeds)} />,
109
124
 
110
125
  // TODO(wittjosiah): Copied from ViewEditor.
111
126
  // Query input editor.
112
- ['spec.query' as const]: (props) => {
127
+ 'spec.query': (props) => {
113
128
  const handleChange = useCallback(
114
129
  (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
115
130
  [props.type, props.onValueChange],
@@ -124,9 +139,9 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
124
139
  },
125
140
 
126
141
  // Function input editor.
127
- ['input' as const]: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
142
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
128
143
  }),
129
- [workflows, scripts, functions, readonlySpec],
144
+ [workflows, scripts, functions, feeds, readonlySpec],
130
145
  );
131
146
  };
132
147
 
@@ -134,7 +149,20 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
134
149
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
135
150
  };
136
151
 
137
- const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
138
- const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
152
+ const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
153
+ const getLabel = (fn: Operation.PersistentOperation) =>
154
+ scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
139
155
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
140
156
  };
157
+
158
+ const getFeedQueueOptions = (feeds: Feed.Feed[]) => {
159
+ return feeds.flatMap((feed) => {
160
+ const queueDxn = Feed.getQueueDxn(feed);
161
+ if (!queueDxn) {
162
+ return [];
163
+ }
164
+ const parent = Obj.getParent(feed);
165
+ const label = parent ? Entity.getLabel(parent) : Entity.getLabel(feed);
166
+ return [{ label: label ?? feed.id, value: queueDxn.toString() }];
167
+ });
168
+ };
@@ -7,6 +7,5 @@ import { lazy } from 'react';
7
7
  export * from './TriggerEditor';
8
8
 
9
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
10
- export const AutomationSettings = lazy(() => import('./AutomationSettings'));
11
- export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
12
10
  export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
11
+ export const FunctionsRegistry = lazy(() => import('./FunctionsRegistry'));
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
14
+ import { TriggersSettings } from '../TriggerSettings';
15
+
16
+ export type AutomationSettingsProps = AppSurface.SpaceArticleProps<Omit<AutomationPanelProps, 'space'>>;
17
+
18
+ export const AutomationSettings = (props: AutomationSettingsProps) => {
19
+ const { t } = useTranslation(meta.id);
20
+ return (
21
+ <Settings.Viewport>
22
+ <Settings.Section
23
+ title={t('automation-verbose.label', { ns: meta.id })}
24
+ description={t('automation.description', { ns: meta.id })}
25
+ >
26
+ <AutomationPanel {...props} />
27
+ <TriggersSettings space={props.space} />
28
+ </Settings.Section>
29
+ </Settings.Viewport>
30
+ );
31
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { AutomationSettings as default } from './AutomationSettings';
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ import { FunctionsPanel, FunctionsRegistry } from '../../components';
14
+
15
+ export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
16
+ const { t } = useTranslation(meta.id);
17
+ return (
18
+ <Settings.Viewport>
19
+ <Settings.Section
20
+ title={t('functions-verbose.label', { ns: meta.id })}
21
+ description={t('functions.description', { ns: meta.id })}
22
+ >
23
+ <FunctionsPanel space={space} />
24
+ </Settings.Section>
25
+ <Settings.Section
26
+ title={t('functions-registry-verbose.label', { ns: meta.id })}
27
+ description={t('functions-registry.description', { ns: meta.id })}
28
+ >
29
+ <FunctionsRegistry space={space} />
30
+ </Settings.Section>
31
+ </Settings.Viewport>
32
+ );
33
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { FunctionsContainer as default } from './FunctionsContainer';
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type ComputeEnvironment } from '@dxos/client-protocol';
8
+ import { useObject } from '@dxos/echo-react';
9
+ import { type Space } from '@dxos/react-client/echo';
10
+ import { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';
11
+ import { Settings } from '@dxos/react-ui-form';
12
+
13
+ import { meta } from '#meta';
14
+
15
+ export const TriggersSettings = ({ space }: { space: Space }) => {
16
+ const { t } = useTranslation(meta.id);
17
+ const [properties, changeProperties] = useObject(space.properties);
18
+ const selected = properties.computeEnvironment ?? 'local';
19
+
20
+ const handleUpdate = (option: ComputeEnvironment) => {
21
+ changeProperties((draft) => {
22
+ draft.computeEnvironment = option;
23
+ });
24
+ };
25
+
26
+ return (
27
+ <div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
28
+ <Settings.Item title={t('runtime.label')} description={t('runtime.description')}>
29
+ <DropdownMenu.Root>
30
+ <DropdownMenu.Trigger asChild>
31
+ <IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />
32
+ </DropdownMenu.Trigger>
33
+ <DropdownMenu.Portal>
34
+ <DropdownMenu.Content side='bottom'>
35
+ <DropdownMenu.Viewport>
36
+ <DropdownMenu.Item onClick={() => handleUpdate('disabled')}>
37
+ {t(`runtime.disabled.label`)}
38
+ </DropdownMenu.Item>
39
+ <DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>
40
+ <DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>
41
+ </DropdownMenu.Viewport>
42
+ </DropdownMenu.Content>
43
+ </DropdownMenu.Portal>
44
+ </DropdownMenu.Root>
45
+ </Settings.Item>
46
+ </div>
47
+ );
48
+ };
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { TriggersSettings } from './TriggerSettings';
6
+ export { TriggersSettings as default } from './TriggerSettings';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
8
+ export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
9
+ export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
@@ -2,5 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // TODO(wittjosiah): Factor out.
5
6
  export * from './useComputeRuntimeCallback';
6
7
  export * from './useTriggerRuntimeControls';
8
+ export * from './useComputeRuntime';
9
+ export * from './useComputeRuntimeService';
@@ -0,0 +1,30 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useEffect } from 'react';
6
+
7
+ import { useCapabilities } from '@dxos/app-framework/ui';
8
+ import { SpaceId } from '@dxos/keys';
9
+ import { log } from '@dxos/log';
10
+
11
+ import { AutomationCapabilities } from '../types';
12
+
13
+ /**
14
+ * Resolves the compute runtime for a space.
15
+ * Returns undefined if the AutomationPlugin is not loaded or spaceId is not provided.
16
+ */
17
+ export const useComputeRuntime = (id: SpaceId | undefined): AutomationCapabilities.ComputeRuntime | undefined => {
18
+ const [computeRuntime] = useCapabilities(AutomationCapabilities.ComputeRuntime);
19
+ // One log per change of (capability availability, spaceId) so we can see when
20
+ // the React subscription actually observes the contributed runtime.
21
+ useEffect(() => {
22
+ log('useComputeRuntime', { hasCapability: !!computeRuntime, spaceId: id });
23
+ }, [!!computeRuntime, id]);
24
+
25
+ if (!computeRuntime || id === undefined) {
26
+ return undefined;
27
+ }
28
+
29
+ return computeRuntime.getRuntime(id);
30
+ };
@@ -2,17 +2,14 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Cause from 'effect/Cause';
6
5
  import * as Effect from 'effect/Effect';
7
- import * as Exit from 'effect/Exit';
8
6
  import { type DependencyList, useCallback } from 'react';
9
7
 
10
- import { useCapability } from '@dxos/app-framework/ui';
11
8
  import { type Key } from '@dxos/echo';
12
- import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
13
- import { log } from '@dxos/log';
14
9
 
15
- import { AutomationCapabilities } from '../types';
10
+ import { AutomationCapabilities } from '#types';
11
+
12
+ import { useComputeRuntime } from './useComputeRuntime';
16
13
 
17
14
  /**
18
15
  * Create an effectful function that has access to compute services
@@ -23,8 +20,7 @@ export const useComputeRuntimeCallback = <T>(
23
20
  fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
24
21
  deps?: DependencyList,
25
22
  ): (() => Promise<T>) => {
26
- const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
27
- const runtime = id !== undefined ? computeRuntime.getRuntime(id) : undefined;
23
+ const runtime = useComputeRuntime(id);
28
24
 
29
25
  return useCallback(() => {
30
26
  if (!runtime) {
@@ -34,34 +30,3 @@ export const useComputeRuntimeCallback = <T>(
34
30
  return runtime.runPromise(fn());
35
31
  }, [runtime, ...(deps ?? [])]);
36
32
  };
37
-
38
- // TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
39
- export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
40
- Effect.gen(function* () {
41
- const tracer = yield* TracingService;
42
- const trace = yield* tracer.traceInvocationStart({
43
- target: undefined,
44
- payload: {
45
- data: {},
46
- },
47
- });
48
-
49
- // Invoke the function.
50
- const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
51
- Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
52
- Effect.exit,
53
- );
54
-
55
- if (Exit.isFailure(result)) {
56
- const error = Cause.prettyErrors(result.cause)[0];
57
- log.error(error.message, error.cause ?? error.stack);
58
- }
59
-
60
- yield* tracer.traceInvocationEnd({
61
- trace,
62
- // TODO(dmaretskyi): Might miss errors.
63
- exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
64
- });
65
-
66
- return result;
67
- });
@@ -0,0 +1,64 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Context from 'effect/Context';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Exit from 'effect/Exit';
8
+ import { useEffect, useState } from 'react';
9
+
10
+ import { SpaceId } from '@dxos/keys';
11
+ import { log } from '@dxos/log';
12
+
13
+ import { useComputeRuntime } from './useComputeRuntime';
14
+
15
+ type ResolvedService<T extends Context.Tag<any, any>> = Context.Tag.Service<T> | undefined;
16
+
17
+ /**
18
+ * Resolves a service from the compute runtime for a given space.
19
+ *
20
+ * NOTE: Previously implemented via `use(useMemo(() => runtime.runPromiseExit(...)))`.
21
+ * React's `use()` is weird and unreliable in production builds — the Suspense
22
+ * boundary can stay pending indefinitely without the promise ever resolving
23
+ * from React's perspective (the runtime is built lazily on first invocation
24
+ * and one of its `acquire` steps can block). This `useState` + `useEffect`
25
+ * flavour avoids suspension entirely: the hook returns `undefined` while the
26
+ * service is being acquired or if acquisition fails / times out.
27
+ */
28
+ export const useComputeRuntimeService = <T extends Context.Tag<any, any>>(
29
+ tag: T,
30
+ spaceId?: SpaceId,
31
+ ): ResolvedService<T> => {
32
+ const runtime = useComputeRuntime(spaceId);
33
+ const [service, setService] = useState<ResolvedService<T>>(undefined);
34
+
35
+ useEffect(() => {
36
+ setService(undefined);
37
+ if (!runtime) {
38
+ return;
39
+ }
40
+ let cancelled = false;
41
+ void (async () => {
42
+ try {
43
+ const exit = await runtime.runPromiseExit(tag.pipe(Effect.timeout('30 seconds')));
44
+ if (cancelled) {
45
+ return;
46
+ }
47
+ if (Exit.isSuccess(exit)) {
48
+ setService(exit.value);
49
+ } else {
50
+ log.warn('useComputeRuntimeService: failed to acquire service', { cause: exit.cause });
51
+ }
52
+ } catch (error) {
53
+ if (!cancelled) {
54
+ log.catch(error);
55
+ }
56
+ }
57
+ })();
58
+ return () => {
59
+ cancelled = true;
60
+ };
61
+ }, [runtime, tag]);
62
+
63
+ return service;
64
+ };
@@ -7,8 +7,8 @@ import type * as Context from 'effect/Context';
7
7
  import * as Effect from 'effect/Effect';
8
8
  import { useEffect, useState } from 'react';
9
9
 
10
- import { type Database, Filter } from '@dxos/echo';
11
- import { Trigger } from '@dxos/functions';
10
+ import { Trigger } from '@dxos/compute';
11
+ import { type Database, Filter, Query } from '@dxos/echo';
12
12
  import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
13
13
  import { useQuery } from '@dxos/react-client/echo';
14
14
 
@@ -24,7 +24,10 @@ interface TriggerRuntimeControls {
24
24
  }
25
25
 
26
26
  export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
27
- const triggers = useQuery(db, Filter.type(Trigger.Trigger));
27
+ const triggers = useQuery(
28
+ db,
29
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
30
+ );
28
31
 
29
32
  const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
30
33
 
package/src/index.ts CHANGED
@@ -2,9 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export * from './components';
6
5
  export * from './meta';
7
- export * from './hooks';
8
6
  export * from './types';
9
-
10
- export * from './AutomationPlugin';
package/src/meta.ts CHANGED
@@ -6,12 +6,13 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/automation',
9
+ id: 'org.dxos.plugin.automation',
10
10
  name: 'Automation',
11
11
  description: trim`
12
12
  Workflow automation engine that triggers custom actions based on object events and conditions.
13
13
  Create automated pipelines that respond to changes and streamline repetitive tasks.
14
14
  `,
15
- icon: 'ph--robot--regular',
15
+ icon: 'ph--atom--regular',
16
16
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
17
+ tags: ['system'],
17
18
  };