@dxos/plugin-automation 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (304) 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/neutral/AutomationPlugin.node.mjs +1113 -0
  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/neutral/FunctionsPanel-GLCUBEDT.mjs +96 -0
  11. package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
  12. package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs +94 -0
  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/neutral/chunk-ATECY555.mjs +20 -0
  24. package/dist/lib/neutral/chunk-ATECY555.mjs.map +7 -0
  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/neutral/chunk-FKFFU54G.mjs +270 -0
  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/neutral/chunk-N735CP33.mjs +285 -0
  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/operations/index.mjs.map +7 -0
  52. package/dist/lib/neutral/plugin.mjs +16 -0
  53. package/dist/lib/neutral/plugin.mjs.map +7 -0
  54. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  55. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  56. package/dist/lib/neutral/translations.mjs +47 -0
  57. package/dist/lib/neutral/translations.mjs.map +7 -0
  58. package/dist/lib/neutral/types/index.mjs +16 -0
  59. package/dist/lib/neutral/types/index.mjs.map +7 -0
  60. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  61. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  62. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  63. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  64. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  65. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  67. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
  69. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/index.d.ts +6 -3
  71. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  72. package/dist/types/src/capabilities/node.d.ts +6 -0
  73. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  75. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  76. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  77. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  78. package/dist/types/src/commands/index.d.ts +2 -0
  79. package/dist/types/src/commands/index.d.ts.map +1 -0
  80. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  81. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  82. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  83. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  84. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  85. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  86. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  87. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  88. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  89. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  90. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  91. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  92. package/dist/types/src/commands/trigger/options.d.ts +11 -0
  93. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  94. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  95. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  97. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  98. package/dist/types/src/commands/trigger/update/queue.d.ts +12 -0
  99. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
  101. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  103. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  104. package/dist/types/src/commands/trigger/util.d.ts +46 -0
  105. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  106. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -7
  107. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  108. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -26
  109. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  110. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  111. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  112. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  113. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  114. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  115. package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
  116. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  117. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  118. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  119. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  120. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  121. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
  122. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  123. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +107 -30
  124. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  125. package/dist/types/src/components/index.d.ts +3 -4
  126. package/dist/types/src/components/index.d.ts.map +1 -1
  127. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  128. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  129. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  130. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  131. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  132. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  133. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  134. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  135. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  136. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  137. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  138. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  139. package/dist/types/src/containers/index.d.ts +5 -0
  140. package/dist/types/src/containers/index.d.ts.map +1 -0
  141. package/dist/types/src/hooks/index.d.ts +5 -0
  142. package/dist/types/src/hooks/index.d.ts.map +1 -0
  143. package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
  144. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  145. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +9 -0
  146. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  147. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
  148. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  149. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
  150. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  151. package/dist/types/src/index.d.ts +1 -2
  152. package/dist/types/src/index.d.ts.map +1 -1
  153. package/dist/types/src/meta.d.ts +2 -3
  154. package/dist/types/src/meta.d.ts.map +1 -1
  155. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  156. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  157. package/dist/types/src/operations/index.d.ts +3 -0
  158. package/dist/types/src/operations/index.d.ts.map +1 -0
  159. package/dist/types/src/plugin.d.ts +4 -0
  160. package/dist/types/src/plugin.d.ts.map +1 -0
  161. package/dist/types/src/testing/test-functions.d.ts +204 -3
  162. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  163. package/dist/types/src/translations.d.ts +32 -26
  164. package/dist/types/src/translations.d.ts.map +1 -1
  165. package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
  166. package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
  167. package/dist/types/src/types/AutomationEvents.d.ts +3 -0
  168. package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
  169. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  170. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  171. package/dist/types/src/types/index.d.ts +3 -0
  172. package/dist/types/src/types/index.d.ts.map +1 -1
  173. package/dist/types/src/types/schema.d.ts +12 -4
  174. package/dist/types/src/types/schema.d.ts.map +1 -1
  175. package/dist/types/tsconfig.tsbuildinfo +1 -1
  176. package/package.json +138 -50
  177. package/src/AutomationPlugin.node.ts +29 -0
  178. package/src/AutomationPlugin.test.ts +27 -0
  179. package/src/AutomationPlugin.tsx +23 -34
  180. package/src/capabilities/app-graph-builder.ts +59 -79
  181. package/src/capabilities/compute-runtime.ts +325 -0
  182. package/src/capabilities/index.ts +9 -4
  183. package/src/capabilities/node.ts +13 -0
  184. package/src/capabilities/operation-handler.ts +16 -0
  185. package/src/capabilities/react-surface.tsx +49 -46
  186. package/src/commands/index.ts +5 -0
  187. package/src/commands/trigger/create/index.ts +14 -0
  188. package/src/commands/trigger/create/queue.ts +86 -0
  189. package/src/commands/trigger/create/subscription.ts +125 -0
  190. package/src/commands/trigger/create/timer.ts +90 -0
  191. package/src/commands/trigger/index.ts +16 -0
  192. package/src/commands/trigger/list.ts +70 -0
  193. package/src/commands/trigger/options.ts +59 -0
  194. package/src/commands/trigger/remove.ts +45 -0
  195. package/src/commands/trigger/update/index.ts +14 -0
  196. package/src/commands/trigger/update/queue.ts +194 -0
  197. package/src/commands/trigger/update/subscription.ts +278 -0
  198. package/src/commands/trigger/update/timer.ts +193 -0
  199. package/src/commands/trigger/util.ts +410 -0
  200. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +9 -12
  201. package/src/components/AutomationPanel/AutomationPanel.tsx +250 -82
  202. package/src/components/FunctionsPanel/FunctionsPanel.tsx +51 -32
  203. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +114 -0
  204. package/src/components/FunctionsRegistry/index.ts +8 -0
  205. package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
  206. package/src/components/TriggerEditor/SpecSelector.tsx +29 -17
  207. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +117 -32
  208. package/src/components/TriggerEditor/TriggerEditor.tsx +109 -42
  209. package/src/components/index.ts +1 -2
  210. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  211. package/src/containers/AutomationSettings/index.ts +5 -0
  212. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  213. package/src/containers/FunctionsContainer/index.ts +5 -0
  214. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  215. package/src/containers/TriggerSettings/index.ts +6 -0
  216. package/src/containers/index.ts +9 -0
  217. package/src/hooks/index.ts +9 -0
  218. package/src/hooks/useComputeRuntime.ts +30 -0
  219. package/src/hooks/useComputeRuntimeCallback.ts +32 -0
  220. package/src/hooks/useComputeRuntimeService.ts +64 -0
  221. package/src/hooks/useTriggerRuntimeControls.ts +70 -0
  222. package/src/index.ts +1 -3
  223. package/src/meta.ts +10 -8
  224. package/src/operations/create-trigger-from-template.ts +72 -0
  225. package/src/operations/index.ts +7 -0
  226. package/src/plugin.ts +11 -0
  227. package/src/testing/test-functions.ts +13 -10
  228. package/src/translations.ts +39 -29
  229. package/src/types/AutomationCapabilities.ts +48 -0
  230. package/src/types/AutomationEvents.ts +11 -0
  231. package/src/types/AutomationOperation.ts +30 -0
  232. package/src/types/index.ts +4 -0
  233. package/src/types/schema.ts +6 -6
  234. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs +0 -35
  235. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
  236. package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
  237. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
  238. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
  239. package/dist/lib/browser/FunctionsPanel-I443Y6KB.mjs +0 -10
  240. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs +0 -80
  241. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-4TWQV33E.mjs +0 -143
  243. package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
  245. package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
  246. package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
  247. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
  249. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-S4SM663I.mjs +0 -230
  251. package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
  253. package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
  254. package/dist/lib/browser/index.mjs +0 -101
  255. package/dist/lib/browser/index.mjs.map +0 -7
  256. package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs +0 -77
  257. package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs.map +0 -7
  258. package/dist/lib/browser/meta.json +0 -1
  259. package/dist/lib/browser/react-surface-M52XGLXY.mjs +0 -64
  260. package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
  261. package/dist/lib/browser/types/index.mjs +0 -8
  262. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
  263. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
  264. package/dist/lib/node-esm/AutomationPanel-MKOLA2FE.mjs +0 -12
  265. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
  266. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
  267. package/dist/lib/node-esm/FunctionsPanel-ELINCXPW.mjs +0 -11
  268. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs +0 -81
  269. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-AONUBWBE.mjs +0 -144
  271. package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
  273. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
  274. package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
  275. package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
  277. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  278. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
  279. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
  280. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs +0 -231
  281. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
  282. package/dist/lib/node-esm/index.mjs +0 -102
  283. package/dist/lib/node-esm/index.mjs.map +0 -7
  284. package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs +0 -78
  285. package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs.map +0 -7
  286. package/dist/lib/node-esm/meta.json +0 -1
  287. package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs +0 -65
  288. package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs.map +0 -7
  289. package/dist/lib/node-esm/types/index.mjs +0 -9
  290. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  291. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  292. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  293. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  294. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  295. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  296. package/src/capabilities/intent-resolver.ts +0 -72
  297. package/src/components/AutomationContainer.tsx +0 -28
  298. package/src/components/FunctionsContainer.tsx +0 -29
  299. /package/dist/lib/{browser/AutomationPanel-N5HFJJXW.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
  300. /package/dist/lib/{browser/FunctionsPanel-I443Y6KB.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  301. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  302. /package/dist/lib/{node-esm/types → neutral/components}/index.mjs.map +0 -0
  303. /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → neutral/index.mjs.map} +0 -0
  304. /package/dist/lib/{node-esm/FunctionsPanel-ELINCXPW.mjs.map → neutral/meta.mjs.map} +0 -0
@@ -2,29 +2,26 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import type * as SchemaAST from 'effect/SchemaAST';
5
6
  import React, { useCallback, useMemo } from 'react';
6
7
 
7
- import { Ref, Type } from '@dxos/echo';
8
- import { type JsonPath } from '@dxos/echo-schema';
9
- import { type FunctionType } from '@dxos/functions';
10
- import { useOnTransition } from '@dxos/react-ui';
11
- import { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';
8
+ import { type Operation } from '@dxos/compute';
9
+ import { type Database, JsonSchema, Obj, Ref } from '@dxos/echo';
10
+ import { type JsonPath } from '@dxos/echo/internal';
11
+ import { useOnTransition, useTranslation } from '@dxos/react-ui';
12
+ import { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';
13
+
14
+ import { meta } from '#meta';
12
15
 
13
16
  export type FunctionInputEditorProps = {
14
- functions: FunctionType[];
15
- onQueryRefOptions: QueryRefOptions;
16
- } & FormInputStateProps;
17
+ type: SchemaAST.AST;
18
+ functions: Operation.PersistentOperation[];
19
+ db?: Database.Database;
20
+ } & FormFieldStateProps;
17
21
 
18
- /**
19
- * Editor component for function input parameters.
20
- */
21
- export const FunctionInputEditor = ({
22
- functions,
23
- getValue,
24
- onValueChange,
25
- onQueryRefOptions,
26
- }: FunctionInputEditorProps) => {
27
- const selectedFunctionValue = useFormValues(['function' as JsonPath]);
22
+ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }: FunctionInputEditorProps) => {
23
+ const { t } = useTranslation(meta.id);
24
+ const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, ['function' as JsonPath]);
28
25
  const selectedFunctionId = useMemo(() => {
29
26
  if (Ref.isRef(selectedFunctionValue)) {
30
27
  return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);
@@ -39,22 +36,30 @@ export const FunctionInputEditor = ({
39
36
  useOnTransition(
40
37
  // Clear function parameter input when the function changes.
41
38
  selectedFunctionValue,
42
- (prevValue) => prevValue !== undefined && prevValue !== selectedFunctionValue,
39
+ (prevValue) => {
40
+ if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
41
+ return false;
42
+ }
43
+
44
+ return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
45
+ },
43
46
  (currValue) => currValue !== undefined,
44
- () => onValueChange('object', {}),
47
+ () => onValueChange(type, {}),
45
48
  );
46
49
 
47
50
  const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
48
- const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
51
+ const effectSchema = useMemo(() => (inputSchema ? JsonSchema.toEffectSchema(inputSchema) : undefined), [inputSchema]);
49
52
  const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
53
+ const defaultValues = useMemo(() => {
54
+ const raw = getValue() ?? {};
55
+ return Obj.isObject(raw) ? { ...Obj.getSnapshot(raw) } : { ...raw };
56
+ }, [getValue]);
50
57
 
51
- const values = useMemo(() => getValue() ?? {}, [getValue]);
52
-
53
- const handleValuesChanged = useCallback(
54
- (values: any) => {
55
- onValueChange('object', values);
58
+ const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(
59
+ (values) => {
60
+ onValueChange(type, values);
56
61
  },
57
- [onValueChange],
62
+ [type, onValueChange],
58
63
  );
59
64
 
60
65
  if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
@@ -63,16 +68,18 @@ export const FunctionInputEditor = ({
63
68
 
64
69
  return (
65
70
  <>
66
- <h3 className='text-md'>Function parameters</h3>
67
- {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.
68
- This would allow errors to flow up to the root context. */}
69
- <Form
71
+ <Form.Label label={t('function-parameters.label')} asChild />
72
+ <Form.Root
73
+ key={selectedFunction.id}
70
74
  schema={effectSchema}
71
- values={values}
75
+ defaultValues={defaultValues}
76
+ db={db}
72
77
  onValuesChanged={handleValuesChanged}
73
- onQueryRefOptions={onQueryRefOptions}
74
- outerSpacing={false}
75
- />
78
+ >
79
+ <Form.FieldSet />
80
+ </Form.Root>
76
81
  </>
77
82
  );
78
83
  };
84
+
85
+ FunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';
@@ -4,32 +4,33 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
- import { type FunctionTrigger, TriggerKinds, type TriggerType } from '@dxos/functions';
7
+ import { Trigger } from '@dxos/compute';
8
+ import { Filter, Query } from '@dxos/echo';
8
9
  import { useTranslation } from '@dxos/react-ui';
9
- import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
10
+ import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
10
11
 
11
- import { AUTOMATION_PLUGIN } from '../../meta';
12
+ import { meta } from '#meta';
12
13
 
13
- export type SpecSelectorProps = InputProps;
14
+ export type SpecSelectorProps = FormFieldComponentProps;
14
15
 
15
16
  export const SpecSelector = (props: SpecSelectorProps) => {
16
- const { t } = useTranslation(AUTOMATION_PLUGIN);
17
- const specProps = useInputProps(['spec' satisfies keyof FunctionTrigger]);
17
+ const { t } = useTranslation(meta.id);
18
+ const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);
18
19
 
19
20
  const handleTypeChange = useCallback(
20
- (_type: any, value: string): TriggerType | undefined => {
21
+ (_type: any, value: string): Trigger.Spec | undefined => {
21
22
  const getDefaultTriggerSpec = (kind: string) => {
22
23
  switch (kind) {
23
24
  case 'timer':
24
- return { kind: 'timer', cron: '' };
25
+ return Trigger.specTimer('');
25
26
  case 'subscription':
26
- return { kind: 'subscription', filter: {} };
27
+ return Trigger.specSubscription(Query.select(Filter.nothing()));
27
28
  case 'queue':
28
- return { kind: 'queue', queue: '' };
29
+ return Trigger.specQueue('dxn:queue:default');
29
30
  case 'email':
30
- return { kind: 'email' };
31
+ return Trigger.specEmail();
31
32
  case 'webhook':
32
- return { kind: 'webhook' };
33
+ return Trigger.specWebhook();
33
34
  default:
34
35
  return undefined;
35
36
  }
@@ -41,19 +42,30 @@ export const SpecSelector = (props: SpecSelectorProps) => {
41
42
  }
42
43
 
43
44
  // Update the entire spec object, not just the `spec.kind`.
44
- specProps.onValueChange('object', defaultSpec);
45
+ specProps.onValueChange(props.type, defaultSpec);
45
46
  },
46
- [specProps],
47
+ [props.type, specProps],
47
48
  );
48
49
 
50
+ const kindLabels: Record<string, string> = {
51
+ timer: t('trigger-type.timer.label'),
52
+ webhook: t('trigger-type.webhook.label'),
53
+ websocket: t('trigger-type.websocket.label'),
54
+ subscription: t('trigger-type.subscription.label'),
55
+ email: t('trigger-type.email.label'),
56
+ queue: t('trigger-type.queue.label'),
57
+ };
58
+
49
59
  const options = useMemo(
50
60
  () =>
51
- TriggerKinds.map((kind) => ({
61
+ Trigger.Kinds.map((kind) => ({
52
62
  value: kind,
53
- label: t(`trigger type ${kind}`),
63
+ label: kindLabels[kind],
54
64
  })),
55
65
  [t],
56
66
  );
57
67
 
58
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
68
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
59
69
  };
70
+
71
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -2,33 +2,57 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
- import React, { useEffect, useState } from 'react';
6
+ import React, { useState } from 'react';
7
+ import { expect, userEvent, within } from 'storybook/test';
8
+
9
+ import { Operation, Trigger } from '@dxos/compute';
10
+ import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
11
+ import { invariant } from '@dxos/invariant';
12
+ import { random } from '@dxos/random';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
+ import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form/translations';
17
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
18
+ import { Employer, Organization, Person, Pipeline } from '@dxos/types';
19
+
20
+ import { functions } from '#testing';
21
+ import { translations } from '#translations';
9
22
 
10
- import { Obj } from '@dxos/echo';
11
- import { FunctionTrigger, FunctionType } from '@dxos/functions';
12
- import { faker } from '@dxos/random';
13
- import { useSpaces } from '@dxos/react-client/echo';
14
- import { ContactType, withClientProvider } from '@dxos/react-client/testing';
15
- import { withLayout, withTheme } from '@dxos/storybook-utils';
23
+ import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
16
24
 
17
- import { functions } from '../../testing';
18
- import { translations } from '../../translations';
25
+ const types = [
26
+ // TODO(burdon): Get label from annotation.
27
+ { value: Organization.Organization.typename, label: 'Organization' },
28
+ { value: Person.Person.typename, label: 'Person' },
29
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
30
+ { value: Employer.Employer.typename, label: 'Employer' },
31
+ ];
19
32
 
20
- import { TriggerEditor } from './TriggerEditor';
33
+ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
34
+ const { space } = useClientStory();
35
+ const [trigger, setTrigger] = useState<Trigger.Trigger>();
36
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
21
37
 
22
- const DefaultStory = () => {
23
- const spaces = useSpaces();
24
- const space = spaces[1];
25
- const [trigger, setTrigger] = useState<FunctionTrigger>();
26
- useEffect(() => {
38
+ useAsyncEffect(async () => {
27
39
  if (!space) {
28
40
  return;
29
41
  }
30
42
 
31
- const trigger = space.db.add(Obj.make(FunctionTrigger, { spec: { kind: 'timer', cron: '' } }));
43
+ const functions = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
44
+ const fn = functions.find((fn) => fn.name === 'com.example.function.forex');
45
+ invariant(fn);
46
+ const trigger = space.db.add(
47
+ Trigger.make({
48
+ function: Ref.make(fn),
49
+ spec: Trigger.specWebhook(),
50
+ input: {
51
+ from: 'USD',
52
+ to: 'JPY',
53
+ },
54
+ }),
55
+ );
32
56
  setTrigger(trigger);
33
57
  }, [space]);
34
58
 
@@ -37,40 +61,54 @@ const DefaultStory = () => {
37
61
  }
38
62
 
39
63
  return (
40
- <div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
41
- <TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} />
42
- </div>
64
+ <TriggerEditor
65
+ db={space.db}
66
+ trigger={trigger}
67
+ types={types}
68
+ tags={tags}
69
+ onSave={(values) => console.log('on save', values)}
70
+ {...props}
71
+ />
43
72
  );
44
73
  };
45
74
 
46
75
  const meta = {
47
- title: 'plugins/plugin-automation/TriggerEditor',
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
48
77
  component: TriggerEditor as any,
49
78
  render: DefaultStory,
50
79
  decorators: [
80
+ withTheme(),
81
+ withLayout({ layout: 'column' }),
51
82
  withClientProvider({
52
83
  createIdentity: true,
53
84
  createSpace: true,
54
- types: [FunctionType, FunctionTrigger, ContactType],
55
- onSpaceCreated: ({ space }) => {
56
- for (const fn of functions) {
57
- space.db.add(Obj.make(FunctionType, fn));
58
- }
85
+ types: [Tag.Tag, Operation.PersistentOperation, Trigger.Trigger, TestSchema.ContactType],
86
+ onCreateSpace: ({ space }) => {
87
+ // Tags.
88
+ ['Important', 'Investor', 'New'].forEach((label) => {
89
+ space.db.add(Tag.make({ label }));
90
+ });
91
+
92
+ // Functions.
93
+ functions.forEach((fn) => {
94
+ space.db.add(Obj.make(Operation.PersistentOperation, { ...fn, version: fn.version ?? '0.1.0' }));
95
+ });
96
+
97
+ // Objects.
59
98
  Array.from({ length: 10 }).map(() => {
60
99
  return space.db.add(
61
- Obj.make(ContactType, {
62
- name: faker.person.fullName(),
100
+ Obj.make(TestSchema.ContactType, {
101
+ name: random.person.fullName(),
63
102
  identifiers: [],
64
103
  }),
65
104
  );
66
105
  });
67
106
  },
68
107
  }),
69
- withLayout({ fullscreen: true, classNames: 'flex justify-center m-2' }),
70
- withTheme,
71
108
  ],
72
109
  parameters: {
73
- translations,
110
+ layout: 'fullscreen',
111
+ translations: [...formTranslations, ...translations],
74
112
  },
75
113
  } satisfies Meta<typeof DefaultStory>;
76
114
 
@@ -79,3 +117,50 @@ export default meta;
79
117
  type Story = StoryObj<typeof meta>;
80
118
 
81
119
  export const Default: Story = {};
120
+
121
+ export const ReadonlySpec: Story = {
122
+ args: {
123
+ readonlySpec: true,
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,52 +4,89 @@
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 { Type } from '@dxos/echo';
9
- import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
11
- import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
9
+ import { DXN, type Database, Entity, Feed, Obj, type Query } from '@dxos/echo';
10
+ import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
11
+ import { Input } from '@dxos/react-ui';
12
+ import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
13
+ import {
14
+ type ExcludeId,
15
+ Form,
16
+ FormFieldLabel,
17
+ type FormFieldMap,
18
+ type FormRootProps,
19
+ SelectField,
20
+ omitId,
21
+ } from '@dxos/react-ui-form';
12
22
 
13
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
23
+ import { FunctionInputEditor } from './FunctionInputEditor';
14
24
  import { SpecSelector } from './SpecSelector';
15
25
 
26
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
27
+
16
28
  export type TriggerEditorProps = {
17
- space: Space;
18
- trigger: FunctionTrigger;
19
- onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
20
- onCancel?: () => void;
21
- };
29
+ db: Database.Database;
30
+ trigger: Trigger.Trigger;
31
+ // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
32
+ readonlySpec?: boolean;
33
+ } &
34
+ // prettier-ignore
35
+ Pick<QueryFormProps, 'types' | 'tags'> &
36
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
22
37
 
23
- export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
24
- const handleSave = (values: FunctionTrigger) => {
25
- onSave?.(values);
26
- };
38
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
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
+ );
27
49
 
28
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
29
- const Custom = useCustomInputs(space, handleRefQueryLookup);
50
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
51
+ const defaultValues = useMemo(() => {
52
+ const { id: _, ...values } = trigger;
53
+ return values;
54
+ }, [trigger]);
30
55
 
31
56
  return (
32
- <Form
33
- outerSpacing={false}
34
- Custom={Custom}
35
- schema={FunctionTrigger}
36
- values={trigger}
37
- onSave={handleSave}
38
- onCancel={onCancel}
39
- onQueryRefOptions={handleRefQueryLookup}
40
- />
57
+ <Form.Root<TriggerFormSchema>
58
+ {...formProps}
59
+ db={db}
60
+ schema={triggerSchema}
61
+ defaultValues={defaultValues}
62
+ fieldMap={fieldMap}
63
+ onValuesChanged={handleValuesChanged}
64
+ >
65
+ <Form.Viewport>
66
+ <Form.Content>
67
+ <Form.FieldSet />
68
+ <Form.Actions />
69
+ </Form.Content>
70
+ </Form.Viewport>
71
+ </Form.Root>
41
72
  );
42
73
  };
43
74
 
44
- const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions']) => {
45
- const functions = useQuery(space, Filter.type(FunctionType));
46
- const workflows = useQuery(space, Filter.type(ComputeGraph));
47
- const scripts = useQuery(space, Filter.type(ScriptType));
75
+ type UseCustomInputsProps = {
76
+ db: Database.Database;
77
+ readonlySpec?: boolean;
78
+ } & Pick<QueryFormProps, 'types' | 'tags'>;
79
+
80
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
81
+ const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
82
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
83
+ const scripts = useQuery(db, Filter.type(Script.Script));
84
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
48
85
 
49
86
  return useMemo(
50
- (): CustomInputMap => ({
87
+ (): FormFieldMap => ({
51
88
  // Function selector.
52
- ['function' satisfies keyof FunctionTrigger]: (props) => {
89
+ ['function' satisfies keyof Trigger.Trigger]: (props) => {
53
90
  const getValue = useCallback(() => {
54
91
  const formValue = props.getValue();
55
92
  if (Ref.isRef(formValue)) {
@@ -60,17 +97,17 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
60
97
 
61
98
  const handleOnValueChange = useCallback(
62
99
  (_type: any, dxnString: string) => {
63
- const dxn = Type.DXN.parse(dxnString);
100
+ const dxn = DXN.parse(dxnString);
64
101
  if (dxn) {
65
102
  const ref = Ref.fromDXN(dxn);
66
- props.onValueChange('object', ref);
103
+ props.onValueChange(props.type, ref);
67
104
  }
68
105
  },
69
- [props.onValueChange],
106
+ [props.type, props.onValueChange],
70
107
  );
71
108
 
72
109
  return (
73
- <SelectInput
110
+ <SelectField
74
111
  {...props}
75
112
  getValue={getValue as any}
76
113
  onValueChange={handleOnValueChange}
@@ -80,14 +117,31 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
80
117
  },
81
118
 
82
119
  // Spec selector.
83
- ['spec.kind' as const]: SpecSelector,
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)} />,
124
+
125
+ // TODO(wittjosiah): Copied from ViewEditor.
126
+ // Query input editor.
127
+ 'spec.query': (props) => {
128
+ const handleChange = useCallback(
129
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
130
+ [props.type, props.onValueChange],
131
+ );
132
+
133
+ return (
134
+ <Input.Root>
135
+ <FormFieldLabel label={props.label} asChild />
136
+ <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
137
+ </Input.Root>
138
+ );
139
+ },
84
140
 
85
141
  // Function input editor.
86
- ['input' as const]: (props) => (
87
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
88
- ),
142
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
89
143
  }),
90
- [workflows, scripts, functions],
144
+ [workflows, scripts, functions, feeds, readonlySpec],
91
145
  );
92
146
  };
93
147
 
@@ -95,7 +149,20 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
95
149
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
96
150
  };
97
151
 
98
- const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
99
- const getLabel = (fn: FunctionType) => 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;
100
155
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
101
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
+ };
@@ -6,7 +6,6 @@ import { lazy } from 'react';
6
6
 
7
7
  export * from './TriggerEditor';
8
8
 
9
- export const AutomationContainer = lazy(() => import('./AutomationContainer'));
10
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
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';