@dxos/plugin-automation 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731

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 (386) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +428 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/AutomationPanel-OKF2MDLO.mjs +12 -0
  5. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  6. package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +191 -186
  7. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  8. package/dist/lib/neutral/AutomationPlugin.workerd.mjs +23 -0
  9. package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
  10. package/dist/lib/neutral/AutomationSettings-GQF5UFM6.mjs +32 -0
  11. package/dist/lib/neutral/AutomationSettings-GQF5UFM6.mjs.map +7 -0
  12. package/dist/lib/neutral/FunctionsContainer-YBTQGCL3.mjs +38 -0
  13. package/dist/lib/neutral/FunctionsContainer-YBTQGCL3.mjs.map +7 -0
  14. package/dist/lib/{browser/chunk-U55ZXRYM.mjs → neutral/FunctionsPanel-L32Z67B7.mjs} +24 -25
  15. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
  16. package/dist/lib/{browser/chunk-XFXYU645.mjs → neutral/FunctionsRegistry-RTCY3LXE.mjs} +24 -25
  17. package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs.map +7 -0
  18. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  19. package/dist/lib/neutral/app-graph-builder-Q3LJLICE.mjs +75 -0
  20. package/dist/lib/neutral/app-graph-builder-Q3LJLICE.mjs.map +7 -0
  21. package/dist/lib/neutral/capabilities/index.mjs +19 -0
  22. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  23. package/dist/lib/neutral/capabilities/node.mjs +17 -0
  24. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  26. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  27. package/dist/lib/neutral/chunk-7YWISQOZ.mjs +54 -0
  28. package/dist/lib/neutral/chunk-7YWISQOZ.mjs.map +7 -0
  29. package/dist/lib/neutral/chunk-C7H62AU3.mjs +435 -0
  30. package/dist/lib/neutral/chunk-C7H62AU3.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-CMM3AFHR.mjs +111 -0
  32. package/dist/lib/neutral/chunk-CMM3AFHR.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  34. package/dist/lib/neutral/chunk-LRVJEKMN.mjs +40 -0
  35. package/dist/lib/neutral/chunk-LRVJEKMN.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-MBIODLCB.mjs +12 -0
  37. package/dist/lib/neutral/chunk-MBIODLCB.mjs.map +7 -0
  38. package/dist/lib/neutral/chunk-NCCFEPBZ.mjs +76 -0
  39. package/dist/lib/neutral/chunk-NCCFEPBZ.mjs.map +7 -0
  40. package/dist/lib/{browser/chunk-ZNI2CGQP.mjs → neutral/chunk-RCBE37YU.mjs} +158 -60
  41. package/dist/lib/neutral/chunk-RCBE37YU.mjs.map +7 -0
  42. package/dist/lib/neutral/chunk-TJOQNSS5.mjs +8 -0
  43. package/dist/lib/neutral/chunk-TJOQNSS5.mjs.map +7 -0
  44. package/dist/lib/neutral/components/index.mjs +16 -0
  45. package/dist/lib/neutral/containers/index.mjs +13 -0
  46. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  47. package/dist/lib/neutral/create-trigger-from-template-5YUHZOFA.mjs +68 -0
  48. package/dist/lib/neutral/create-trigger-from-template-5YUHZOFA.mjs.map +7 -0
  49. package/dist/lib/neutral/hooks/index.mjs +10 -0
  50. package/dist/lib/neutral/index.mjs +16 -0
  51. package/dist/lib/neutral/layer-specs-OXK75RDW.mjs +141 -0
  52. package/dist/lib/neutral/layer-specs-OXK75RDW.mjs.map +7 -0
  53. package/dist/lib/neutral/meta.json +1 -0
  54. package/dist/lib/neutral/meta.mjs +8 -0
  55. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  56. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  57. package/dist/lib/neutral/operations/index.mjs +8 -0
  58. package/dist/lib/neutral/plugin.mjs +16 -0
  59. package/dist/lib/neutral/plugin.mjs.map +7 -0
  60. package/dist/lib/neutral/react-surface-FOOBGYNG.mjs +57 -0
  61. package/dist/lib/neutral/react-surface-FOOBGYNG.mjs.map +7 -0
  62. package/dist/lib/neutral/registry-sync-JYDDTBAE.mjs +82 -0
  63. package/dist/lib/neutral/registry-sync-JYDDTBAE.mjs.map +7 -0
  64. package/dist/lib/neutral/testing.mjs +8 -0
  65. package/dist/lib/neutral/translations.mjs +60 -0
  66. package/dist/lib/neutral/translations.mjs.map +7 -0
  67. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
  68. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
  69. package/dist/lib/neutral/types/index.mjs +12 -0
  70. package/dist/lib/neutral/types/index.mjs.map +7 -0
  71. package/dist/types/src/AutomationPlugin.d.ts +1 -0
  72. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  73. package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
  74. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  75. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  76. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  77. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  78. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/index.d.ts +8 -4
  81. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
  83. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/node.d.ts +8 -0
  85. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  86. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  87. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
  90. package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
  92. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
  94. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
  95. package/dist/types/src/commands/index.d.ts.map +1 -0
  96. package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
  97. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  98. package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +2 -2
  99. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  100. package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
  101. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  102. package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
  103. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  104. package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +8 -8
  105. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  106. package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
  107. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  108. package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +1 -2
  109. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  110. package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
  111. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  112. package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
  113. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  114. package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +2 -3
  115. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  116. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  117. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  118. package/dist/types/src/commands/trigger/util.d.ts +85 -0
  119. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  120. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  121. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  122. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -32
  123. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  124. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts +18 -0
  125. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts.map +1 -0
  126. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  127. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  128. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  131. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
  132. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  133. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
  134. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  135. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  136. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  137. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +109 -93
  138. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  139. package/dist/types/src/components/TriggerEditor/util.d.ts +14 -0
  140. package/dist/types/src/components/TriggerEditor/util.d.ts.map +1 -0
  141. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +3 -1
  142. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
  143. package/dist/types/src/containers/AutomationSettings/index.d.ts +1 -2
  144. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -1
  145. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +2 -4
  146. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
  147. package/dist/types/src/containers/FunctionsContainer/index.d.ts +1 -2
  148. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -1
  149. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +3 -3
  150. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
  151. package/dist/types/src/containers/TriggerSettings/index.d.ts +2 -2
  152. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -1
  153. package/dist/types/src/hooks/index.d.ts +1 -1
  154. package/dist/types/src/hooks/index.d.ts.map +1 -1
  155. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts +13 -0
  156. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts.map +1 -0
  157. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
  158. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  159. package/dist/types/src/index.d.ts +0 -3
  160. package/dist/types/src/index.d.ts.map +1 -1
  161. package/dist/types/src/meta.d.ts +1 -1
  162. package/dist/types/src/meta.d.ts.map +1 -1
  163. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  164. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  165. package/dist/types/src/operations/index.d.ts +3 -0
  166. package/dist/types/src/operations/index.d.ts.map +1 -0
  167. package/dist/types/src/plugin.d.ts +4 -0
  168. package/dist/types/src/plugin.d.ts.map +1 -0
  169. package/dist/types/src/testing/test-functions.d.ts +162 -46
  170. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  171. package/dist/types/src/testing.d.ts +2 -0
  172. package/dist/types/src/testing.d.ts.map +1 -0
  173. package/dist/types/src/translations.d.ts +45 -33
  174. package/dist/types/src/translations.d.ts.map +1 -1
  175. package/dist/types/src/types/AutomationOperation.d.ts +21 -0
  176. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  177. package/dist/types/src/types/index.d.ts +1 -2
  178. package/dist/types/src/types/index.d.ts.map +1 -1
  179. package/dist/types/src/types/schema.d.ts +11 -32
  180. package/dist/types/src/types/schema.d.ts.map +1 -1
  181. package/dist/types/tsconfig.tsbuildinfo +1 -1
  182. package/package.json +124 -75
  183. package/src/AutomationPlugin.node.ts +35 -0
  184. package/src/AutomationPlugin.test.ts +27 -0
  185. package/src/AutomationPlugin.tsx +33 -11
  186. package/src/AutomationPlugin.workerd.ts +18 -0
  187. package/src/capabilities/app-graph-builder.ts +66 -0
  188. package/src/capabilities/index.ts +15 -4
  189. package/src/capabilities/layer-specs.ts +197 -0
  190. package/src/capabilities/node.ts +18 -0
  191. package/src/capabilities/operation-handler.ts +16 -0
  192. package/src/capabilities/react-surface.tsx +59 -0
  193. package/src/capabilities/registry-sync.ts +110 -0
  194. package/src/capabilities/trigger-runtime-controller.test.ts +103 -0
  195. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  196. package/src/{cli/commands → commands}/trigger/create/queue.ts +14 -16
  197. package/src/{cli/commands → commands}/trigger/create/subscription.ts +8 -11
  198. package/src/{cli/commands → commands}/trigger/create/timer.ts +4 -7
  199. package/src/{cli/commands → commands}/trigger/list.ts +7 -4
  200. package/src/{cli/commands → commands}/trigger/options.ts +3 -15
  201. package/src/{cli/commands → commands}/trigger/remove.ts +5 -5
  202. package/src/{cli/commands → commands}/trigger/update/queue.ts +39 -43
  203. package/src/{cli/commands → commands}/trigger/update/subscription.ts +22 -21
  204. package/src/{cli/commands → commands}/trigger/update/timer.ts +22 -20
  205. package/src/{cli/commands → commands}/trigger/util.ts +53 -38
  206. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +12 -5
  207. package/src/components/AutomationPanel/AutomationPanel.tsx +120 -58
  208. package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
  209. package/src/components/FunctionsPanel/FunctionsPanel.tsx +35 -27
  210. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +32 -23
  211. package/src/components/TriggerEditor/FunctionInputEditor.tsx +9 -13
  212. package/src/components/TriggerEditor/SpecSelector.tsx +18 -14
  213. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +36 -18
  214. package/src/components/TriggerEditor/TriggerEditor.tsx +120 -25
  215. package/src/components/TriggerEditor/util.ts +51 -0
  216. package/src/containers/AutomationSettings/AutomationSettings.tsx +12 -8
  217. package/src/containers/AutomationSettings/index.ts +1 -3
  218. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +11 -11
  219. package/src/containers/FunctionsContainer/index.ts +1 -3
  220. package/src/containers/TriggerSettings/TriggerSettings.tsx +32 -10
  221. package/src/containers/TriggerSettings/index.ts +2 -3
  222. package/src/hooks/index.ts +2 -1
  223. package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
  224. package/src/hooks/useTriggerRuntimeControls.ts +13 -8
  225. package/src/index.ts +0 -4
  226. package/src/meta.ts +27 -7
  227. package/src/operations/create-trigger-from-template.ts +70 -0
  228. package/src/operations/index.ts +7 -0
  229. package/src/plugin.ts +11 -0
  230. package/src/testing/test-functions.ts +38 -4
  231. package/src/testing.ts +7 -0
  232. package/src/translations.ts +52 -39
  233. package/src/types/AutomationOperation.ts +39 -0
  234. package/src/types/index.ts +2 -2
  235. package/src/types/schema.ts +4 -25
  236. package/src/vite-env.d.ts +10 -0
  237. package/dist/lib/browser/AutomationPanel-EHRSV2DL.mjs +0 -11
  238. package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs +0 -37
  239. package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs.map +0 -7
  240. package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs +0 -43
  241. package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs.map +0 -7
  242. package/dist/lib/browser/FunctionsPanel-5WPUZGRB.mjs +0 -10
  243. package/dist/lib/browser/FunctionsRegistry-XRXIZRLL.mjs +0 -10
  244. package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs +0 -13
  245. package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs.map +0 -7
  246. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +0 -85
  247. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-3P4R5WNC.mjs +0 -8
  249. package/dist/lib/browser/chunk-3P4R5WNC.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-4EY2KMCM.mjs +0 -272
  251. package/dist/lib/browser/chunk-4EY2KMCM.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-PZNBEKO5.mjs +0 -17
  253. package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-QPG3AKFX.mjs +0 -93
  255. package/dist/lib/browser/chunk-QPG3AKFX.mjs.map +0 -7
  256. package/dist/lib/browser/chunk-SEG5OCGB.mjs +0 -31
  257. package/dist/lib/browser/chunk-SEG5OCGB.mjs.map +0 -7
  258. package/dist/lib/browser/chunk-U55ZXRYM.mjs.map +0 -7
  259. package/dist/lib/browser/chunk-WOBCY2FQ.mjs +0 -83
  260. package/dist/lib/browser/chunk-WOBCY2FQ.mjs.map +0 -7
  261. package/dist/lib/browser/chunk-XFXYU645.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-ZNI2CGQP.mjs.map +0 -7
  263. package/dist/lib/browser/cli/index.mjs.map +0 -7
  264. package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs +0 -124
  265. package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs.map +0 -7
  266. package/dist/lib/browser/hooks/index.mjs +0 -13
  267. package/dist/lib/browser/index.mjs +0 -123
  268. package/dist/lib/browser/index.mjs.map +0 -7
  269. package/dist/lib/browser/meta.json +0 -1
  270. package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs +0 -83
  271. package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs.map +0 -7
  272. package/dist/lib/browser/react-surface-U6FAYV42.mjs +0 -69
  273. package/dist/lib/browser/react-surface-U6FAYV42.mjs.map +0 -7
  274. package/dist/lib/browser/types/index.mjs +0 -14
  275. package/dist/lib/node-esm/AutomationPanel-F7MPUR7U.mjs +0 -12
  276. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs +0 -38
  277. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs.map +0 -7
  278. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs +0 -44
  279. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs.map +0 -7
  280. package/dist/lib/node-esm/FunctionsPanel-UFL5LT2R.mjs +0 -11
  281. package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs +0 -11
  282. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs +0 -14
  283. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs.map +0 -7
  284. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +0 -86
  285. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +0 -7
  286. package/dist/lib/node-esm/chunk-2X564LII.mjs +0 -10
  287. package/dist/lib/node-esm/chunk-2X564LII.mjs.map +0 -7
  288. package/dist/lib/node-esm/chunk-34HGM46Z.mjs +0 -32
  289. package/dist/lib/node-esm/chunk-34HGM46Z.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-4DK33JDH.mjs +0 -84
  291. package/dist/lib/node-esm/chunk-4DK33JDH.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
  293. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
  294. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs +0 -273
  295. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs.map +0 -7
  296. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs +0 -271
  297. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs +0 -99
  299. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs.map +0 -7
  300. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs +0 -94
  301. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs.map +0 -7
  302. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs +0 -97
  303. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs.map +0 -7
  304. package/dist/lib/node-esm/cli/index.mjs +0 -1109
  305. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  306. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs +0 -125
  307. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs.map +0 -7
  308. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  309. package/dist/lib/node-esm/index.mjs +0 -124
  310. package/dist/lib/node-esm/index.mjs.map +0 -7
  311. package/dist/lib/node-esm/meta.json +0 -1
  312. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs +0 -84
  313. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs.map +0 -7
  314. package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs +0 -70
  315. package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs.map +0 -7
  316. package/dist/lib/node-esm/types/index.mjs +0 -15
  317. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  318. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  319. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  320. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  321. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  322. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  323. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  324. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  325. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  326. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  327. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  328. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  329. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  330. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  331. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  332. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
  333. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
  334. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
  335. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
  336. package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
  337. package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
  338. package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
  339. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
  340. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
  341. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
  342. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
  343. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
  344. package/dist/types/src/cli/commands/trigger/util.d.ts +0 -46
  345. package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
  346. package/dist/types/src/cli/index.d.ts +0 -2
  347. package/dist/types/src/cli/index.d.ts.map +0 -1
  348. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  349. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  350. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  351. package/dist/types/src/types/capabilities.d.ts +0 -22
  352. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  353. package/dist/types/src/types/events.d.ts +0 -5
  354. package/dist/types/src/types/events.d.ts.map +0 -1
  355. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -72
  356. package/src/capabilities/app-graph-builder/index.ts +0 -7
  357. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -146
  358. package/src/capabilities/compute-runtime/index.ts +0 -7
  359. package/src/capabilities/operation-resolver/index.ts +0 -7
  360. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
  361. package/src/capabilities/react-surface/index.ts +0 -7
  362. package/src/capabilities/react-surface/react-surface.tsx +0 -61
  363. package/src/cli/index.ts +0 -5
  364. package/src/cli/plugin.ts +0 -24
  365. package/src/hooks/useComputeRuntimeCallback.ts +0 -67
  366. package/src/types/capabilities.ts +0 -43
  367. package/src/types/events.ts +0 -11
  368. /package/dist/lib/{browser/AutomationPanel-EHRSV2DL.mjs.map → neutral/AutomationPanel-OKF2MDLO.mjs.map} +0 -0
  369. /package/dist/lib/{browser/FunctionsPanel-5WPUZGRB.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  370. /package/dist/lib/{browser/FunctionsRegistry-XRXIZRLL.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  371. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  372. /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
  373. /package/dist/lib/{node-esm → neutral}/hooks/index.mjs.map +0 -0
  374. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
  375. /package/dist/lib/{node-esm/AutomationPanel-F7MPUR7U.mjs.map → neutral/meta.mjs.map} +0 -0
  376. /package/dist/lib/{node-esm/FunctionsPanel-UFL5LT2R.mjs.map → neutral/operations/index.mjs.map} +0 -0
  377. /package/dist/lib/{node-esm/FunctionsRegistry-574OBZ5T.mjs.map → neutral/testing.mjs.map} +0 -0
  378. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  379. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  380. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  381. /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
  382. /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
  383. /package/src/{cli/commands → commands}/index.ts +0 -0
  384. /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
  385. /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
  386. /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
@@ -2,12 +2,15 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Option from 'effect/Option';
6
+ import * as Record from 'effect/Record';
5
7
  import React, { useCallback, useMemo } from 'react';
6
8
 
9
+ import { Operation, Script, Trigger } from '@dxos/compute';
7
10
  import { ComputeGraph } from '@dxos/conductor';
8
- import { DXN, type Database, Obj, type Query } from '@dxos/echo';
9
- import { Function, Script, Trigger } from '@dxos/functions';
10
- import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
11
+ import { Annotation, type Database, Entity, Feed, Filter, Obj, Query, Ref, Scope, Type } from '@dxos/echo';
12
+ import { DXN, EID } from '@dxos/keys';
13
+ import { useQuery } from '@dxos/react-client/echo';
11
14
  import { Input } from '@dxos/react-ui';
12
15
  import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
13
16
  import {
@@ -22,6 +25,7 @@ import {
22
25
 
23
26
  import { FunctionInputEditor } from './FunctionInputEditor';
24
27
  import { SpecSelector } from './SpecSelector';
28
+ import { getOperationUri } from './util';
25
29
 
26
30
  type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
27
31
 
@@ -36,22 +40,18 @@ export type TriggerEditorProps = {
36
40
  Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
37
41
 
38
42
  export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
- const fieldMap = useCustomInputs({
40
- db,
41
- types,
42
- tags,
43
- readonlySpec,
44
- });
43
+ const fieldMap = useCustomInputs({ db, types, tags, readonlySpec });
45
44
 
46
45
  const handleValuesChanged = useCallback(
47
46
  (newValues: Partial<TriggerFormSchema>) => {
48
- Obj.change(trigger, (t) => {
49
- Object.assign(t, newValues);
47
+ Obj.update(trigger, (trigger) => {
48
+ Object.assign(trigger, newValues);
50
49
  });
51
50
  },
52
51
  [trigger],
53
52
  );
54
53
 
54
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
55
55
  const defaultValues = useMemo(() => {
56
56
  const { id: _, ...values } = trigger;
57
57
  return values;
@@ -60,9 +60,9 @@ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formP
60
60
  return (
61
61
  <Form.Root<TriggerFormSchema>
62
62
  {...formProps}
63
- schema={omitId(Trigger.Trigger)}
64
- defaultValues={defaultValues}
65
63
  db={db}
64
+ schema={triggerSchema}
65
+ defaultValues={defaultValues}
66
66
  fieldMap={fieldMap}
67
67
  onValuesChanged={handleValuesChanged}
68
68
  >
@@ -82,9 +82,14 @@ type UseCustomInputsProps = {
82
82
  } & Pick<QueryFormProps, 'types' | 'tags'>;
83
83
 
84
84
  const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
85
- const functions = useQuery(db, Filter.type(Function.Function));
85
+ const functions = useQuery(
86
+ db,
87
+ Query.select(Filter.type(Operation.PersistentOperation)).from(Scope.space(), Scope.registry()),
88
+ );
89
+
86
90
  const workflows = useQuery(db, Filter.type(ComputeGraph));
87
91
  const scripts = useQuery(db, Filter.type(Script.Script));
92
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
88
93
 
89
94
  return useMemo(
90
95
  (): FormFieldMap => ({
@@ -93,17 +98,17 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
93
98
  const getValue = useCallback(() => {
94
99
  const formValue = props.getValue();
95
100
  if (Ref.isRef(formValue)) {
96
- return formValue.dxn.toString() as string;
101
+ return formValue.uri;
97
102
  }
98
103
  return undefined;
99
104
  }, [props]);
100
105
 
101
106
  const handleOnValueChange = useCallback(
102
- (_type: any, dxnString: string) => {
103
- const dxn = DXN.parse(dxnString);
104
- if (dxn) {
105
- const ref = Ref.fromDXN(dxn);
106
- props.onValueChange(props.type, ref);
107
+ (_type: any, uriString: string) => {
108
+ // Function references are either an EID (space-resident) or a key DXN (registry).
109
+ const uri = EID.tryParse(uriString) ?? (DXN.isDXN(uriString) ? uriString : undefined);
110
+ if (uri) {
111
+ props.onValueChange(props.type, Ref.fromURI(uri));
107
112
  }
108
113
  },
109
114
  [props.type, props.onValueChange],
@@ -122,6 +127,36 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
122
127
  // Spec selector.
123
128
  'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
124
129
 
130
+ // Feed selector with parent labels.
131
+ 'spec.feed': (props) => {
132
+ const getValue = useCallback(() => {
133
+ const formValue = props.getValue();
134
+ if (Ref.isRef(formValue)) {
135
+ return formValue.uri.toString() as string;
136
+ }
137
+ return undefined;
138
+ }, [props]);
139
+
140
+ const handleOnValueChange = useCallback(
141
+ (_type: any, dxnString: string) => {
142
+ const uri = EID.tryParse(dxnString);
143
+ if (uri) {
144
+ props.onValueChange(props.type, Ref.fromURI(uri));
145
+ }
146
+ },
147
+ [props.type, props.onValueChange],
148
+ );
149
+
150
+ return (
151
+ <SelectField
152
+ {...props}
153
+ getValue={getValue as any}
154
+ onValueChange={handleOnValueChange}
155
+ options={getFeedOptions(feeds)}
156
+ />
157
+ );
158
+ },
159
+
125
160
  // TODO(wittjosiah): Copied from ViewEditor.
126
161
  // Query input editor.
127
162
  'spec.query': (props) => {
@@ -141,15 +176,75 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
141
176
  // Function input editor.
142
177
  input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
143
178
  }),
144
- [workflows, scripts, functions, readonlySpec],
179
+ [workflows, scripts, functions, feeds, readonlySpec],
145
180
  );
146
181
  };
147
182
 
183
+ const getObjectIconProps = (object: Entity.Unknown): { icon?: string; iconHue?: string } => {
184
+ const type = Entity.getType(object);
185
+ const schema = type ? Type.getSchema(type) : undefined;
186
+ const annotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : undefined;
187
+ return annotation ? { icon: annotation.icon, iconHue: annotation.hue } : {};
188
+ };
189
+
148
190
  const getWorkflowOptions = (graphs: ComputeGraph[]) => {
149
- return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
191
+ return graphs.map((graph) => ({
192
+ label: `compute-${graph.id}`,
193
+ value: Obj.getURI(graph),
194
+ ...getObjectIconProps(graph),
195
+ }));
150
196
  };
151
197
 
152
- const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
153
- const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
154
- return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
198
+ const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
199
+ const getLabel = (fn: Operation.PersistentOperation) =>
200
+ scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
201
+ return functions.map((fn) => {
202
+ const { icon: schemaIcon, iconHue } = getObjectIconProps(fn);
203
+ return {
204
+ label: getLabel(fn),
205
+ value: getOperationUri(fn),
206
+ icon: fn.icon ?? schemaIcon,
207
+ iconHue,
208
+ };
209
+ });
210
+ };
211
+
212
+ const getFeedDisplayName = (feed: Feed.Feed): string =>
213
+ Entity.getLabel(feed) ?? feed.name ?? Entity.getTypename(feed) ?? 'Feed';
214
+
215
+ const computeRefRole = (entity: Feed.Feed): string | undefined => {
216
+ const parent = Obj.getParent(entity);
217
+ if (!parent) {
218
+ return undefined;
219
+ }
220
+ for (const key of Record.keys(parent)) {
221
+ if (Ref.isRef(parent[key]) && parent[key].target?.id === entity.id) {
222
+ return `$.${key}`;
223
+ }
224
+ }
225
+ return undefined;
226
+ };
227
+
228
+ const getFeedOptions = (feeds: Feed.Feed[]) => {
229
+ return feeds.map((feed) => {
230
+ const parent = Obj.getParent(feed);
231
+ const displayObject = parent ?? feed;
232
+ const role = computeRefRole(feed);
233
+
234
+ if (parent) {
235
+ return {
236
+ label: Entity.getLabel(parent) ?? Entity.getTypename(parent) ?? 'Parent',
237
+ secondaryLabel: role ?? getFeedDisplayName(feed),
238
+ value: Obj.getURI(feed),
239
+ ...getObjectIconProps(displayObject),
240
+ };
241
+ }
242
+
243
+ return {
244
+ label: getFeedDisplayName(feed),
245
+ secondaryLabel: role,
246
+ value: Obj.getURI(feed),
247
+ ...getObjectIconProps(displayObject),
248
+ };
249
+ });
155
250
  };
@@ -0,0 +1,51 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Operation } from '@dxos/compute';
6
+ import { Obj } from '@dxos/echo';
7
+ import { DXN, EID, type URI } from '@dxos/keys';
8
+
9
+ /**
10
+ * Reference URI for an operation. Registry operations (no owning database) are referenced by
11
+ * their versioned key DXN so they resolve via the operation registry; space-resident operations
12
+ * are referenced by their EID.
13
+ */
14
+ // TODO(wittjosiah): There should be a generic & consistent way to get the dxn uri for entities if its available.
15
+ export const getOperationUri = (fn: Operation.PersistentOperation): URI.URI => {
16
+ if (Obj.getDatabase(fn) === undefined) {
17
+ const key = Operation.getKey(fn);
18
+ const version = Operation.getVersion(fn);
19
+ const dxn = key ? DXN.tryMake(version ? `dxn:${key}:${version}` : `dxn:${key}`) : undefined;
20
+ if (dxn) {
21
+ return dxn;
22
+ }
23
+ }
24
+
25
+ return Obj.getURI(fn);
26
+ };
27
+
28
+ /**
29
+ * Resolve an operation from a list by its reference URI (an EID for space-resident operations,
30
+ * or a versioned key DXN for registry operations).
31
+ */
32
+ export const findOperationByUri = (
33
+ functions: readonly Operation.PersistentOperation[],
34
+ uri: URI.URI,
35
+ ): Operation.PersistentOperation | undefined => {
36
+ const eid = EID.tryParse(uri);
37
+ if (eid) {
38
+ const entityId = EID.getEntityId(eid);
39
+ return entityId ? functions.find((fn) => fn.id === entityId) : undefined;
40
+ }
41
+
42
+ if (DXN.isDXN(uri)) {
43
+ const key = DXN.getName(uri);
44
+ const version = DXN.getVersion(uri);
45
+ return functions.find(
46
+ (fn) => Operation.getKey(fn) === key && (version === undefined || Operation.getVersion(fn) === version),
47
+ );
48
+ }
49
+
50
+ return undefined;
51
+ };
@@ -4,24 +4,28 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
7
8
  import { useTranslation } from '@dxos/react-ui';
8
9
  import { Settings } from '@dxos/react-ui-form';
9
10
 
11
+ import { meta } from '#meta';
12
+
10
13
  import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
11
- import { meta } from '../../meta';
12
- import { TriggersSettings } from '../TriggerSettings/TriggerSettings';
14
+ import { TriggersSettings } from '../TriggerSettings';
15
+
16
+ export type AutomationSettingsProps = AppSurface.SpaceArticleProps<Omit<AutomationPanelProps, 'space'>>;
13
17
 
14
- export const AutomationSettings = (props: AutomationPanelProps) => {
18
+ export const AutomationSettings = (props: AutomationSettingsProps) => {
15
19
  const { t } = useTranslation(meta.id);
16
20
  return (
17
- <Settings.Root>
21
+ <Settings.Viewport>
18
22
  <Settings.Section
19
- title={t('automation verbose label', { ns: meta.id })}
20
- description={t('automation description', { ns: meta.id })}
23
+ title={t('automation-verbose.label', { ns: meta.id })}
24
+ description={t('automation.description', { ns: meta.id })}
21
25
  >
22
26
  <AutomationPanel {...props} />
23
- <TriggersSettings db={props.space.db} />
27
+ <TriggersSettings space={props.space} />
24
28
  </Settings.Section>
25
- </Settings.Root>
29
+ </Settings.Viewport>
26
30
  );
27
31
  };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { AutomationSettings } from './AutomationSettings';
6
-
7
- export default AutomationSettings;
5
+ export { AutomationSettings as default } from './AutomationSettings';
@@ -4,30 +4,30 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type Space } from '@dxos/react-client/echo';
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { Settings } from '@dxos/react-ui-form';
10
10
 
11
- import { FunctionsPanel } from '../../components/FunctionsPanel';
12
- import { FunctionsRegistry } from '../../components/FunctionsRegistry';
13
- import { meta } from '../../meta';
11
+ import { meta } from '#meta';
14
12
 
15
- export const FunctionsContainer = ({ space }: { space: Space }) => {
13
+ import { FunctionsPanel, FunctionsRegistry } from '../../components';
14
+
15
+ export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
16
16
  const { t } = useTranslation(meta.id);
17
17
  return (
18
- <Settings.Root>
18
+ <Settings.Viewport>
19
19
  <Settings.Section
20
- title={t('functions verbose label', { ns: meta.id })}
21
- description={t('functions description', { ns: meta.id })}
20
+ title={t('functions-verbose.label', { ns: meta.id })}
21
+ description={t('functions.description', { ns: meta.id })}
22
22
  >
23
23
  <FunctionsPanel space={space} />
24
24
  </Settings.Section>
25
25
  <Settings.Section
26
- title={t('functions registry verbose label', { ns: meta.id })}
27
- description={t('functions registry description', { ns: meta.id })}
26
+ title={t('functions-registry-verbose.label', { ns: meta.id })}
27
+ description={t('functions-registry.description', { ns: meta.id })}
28
28
  >
29
29
  <FunctionsRegistry space={space} />
30
30
  </Settings.Section>
31
- </Settings.Root>
31
+ </Settings.Viewport>
32
32
  );
33
33
  };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { FunctionsContainer } from './FunctionsContainer';
6
-
7
- export default FunctionsContainer;
5
+ export { FunctionsContainer as default } from './FunctionsContainer';
@@ -4,23 +4,45 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type Database } from '@dxos/echo';
8
- import { Input, useTranslation } from '@dxos/react-ui';
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';
9
11
  import { Settings } from '@dxos/react-ui-form';
10
12
 
11
- import { useTriggerRuntimeControls } from '../../hooks';
12
- import { meta } from '../../meta';
13
+ import { meta } from '#meta';
13
14
 
14
- export const TriggersSettings = ({ db }: { db: Database.Database }) => {
15
- const { state, start, stop } = useTriggerRuntimeControls(db);
16
- const isRunning = state?.enabled ?? false;
15
+ export const TriggersSettings = ({ space }: { space: Space }) => {
17
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
+ };
18
25
 
19
26
  return (
20
27
  <div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
21
- <Settings.ItemInput title={t('runtime label')} description={t('runtime description')}>
22
- <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
23
- </Settings.ItemInput>
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>
24
46
  </div>
25
47
  );
26
48
  };
@@ -2,6 +2,5 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { TriggersSettings } from './TriggerSettings';
6
-
7
- export default TriggersSettings;
5
+ export { TriggersSettings } from './TriggerSettings';
6
+ export { TriggersSettings as default } from './TriggerSettings';
@@ -2,5 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './useComputeRuntimeCallback';
5
+ // TODO(wittjosiah): Factor out.
6
+ export * from './useEdgeTriggersDispatcherStatus';
6
7
  export * from './useTriggerRuntimeControls';
@@ -0,0 +1,78 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { useEffect, useMemo, useState } from 'react';
6
+
7
+ import { Context } from '@dxos/context';
8
+ import { type TriggersDispatcherStatus } from '@dxos/edge-client';
9
+ import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
10
+ import { type SpaceId } from '@dxos/keys';
11
+ import { log } from '@dxos/log';
12
+ import { useClient } from '@dxos/react-client';
13
+ import { useIdentity } from '@dxos/react-client/halo';
14
+
15
+ const POLL_INTERVAL_MS = 5_000;
16
+
17
+ export type EdgeTriggersDispatcherStatusState = {
18
+ status: TriggersDispatcherStatus | undefined;
19
+ error: boolean;
20
+ loading: boolean;
21
+ };
22
+
23
+ /**
24
+ * Polls Edge TriggersDispatcher status for a space while enabled.
25
+ * Uses {@link FunctionsServiceClient} so requests are authenticated like other edge trigger calls.
26
+ */
27
+ export const useEdgeTriggersDispatcherStatus = (
28
+ spaceId: SpaceId | undefined,
29
+ enabled: boolean,
30
+ ): EdgeTriggersDispatcherStatusState => {
31
+ const client = useClient();
32
+ const identity = useIdentity();
33
+ const functionsServiceClient = useMemo(() => FunctionsServiceClient.fromClient(client), [client]);
34
+ const [status, setStatus] = useState<TriggersDispatcherStatus | undefined>();
35
+ const [error, setError] = useState(false);
36
+ const [loading, setLoading] = useState(false);
37
+
38
+ useEffect(() => {
39
+ if (!enabled || !spaceId || !identity) {
40
+ setStatus(undefined);
41
+ setError(false);
42
+ setLoading(false);
43
+ return;
44
+ }
45
+
46
+ let cancelled = false;
47
+
48
+ const fetchStatus = async () => {
49
+ try {
50
+ setLoading(true);
51
+ const result = await functionsServiceClient.getTriggersDispatcherStatus(Context.default(), spaceId);
52
+ if (!cancelled) {
53
+ setStatus(result);
54
+ setError(false);
55
+ }
56
+ } catch (err) {
57
+ log.catch(err);
58
+ if (!cancelled) {
59
+ setError(true);
60
+ }
61
+ } finally {
62
+ if (!cancelled) {
63
+ setLoading(false);
64
+ }
65
+ }
66
+ };
67
+
68
+ void fetchStatus();
69
+ const interval = setInterval(() => void fetchStatus(), POLL_INTERVAL_MS);
70
+
71
+ return () => {
72
+ cancelled = true;
73
+ clearInterval(interval);
74
+ };
75
+ }, [enabled, functionsServiceClient, identity, spaceId]);
76
+
77
+ return { status, error, loading };
78
+ };
@@ -7,13 +7,12 @@ 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 { useSpaceCallback } from '@dxos/app-framework/ui';
11
+ import { Trigger } from '@dxos/compute';
12
+ import { type Database, Filter, Query } from '@dxos/echo';
12
13
  import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
13
14
  import { useQuery } from '@dxos/react-client/echo';
14
15
 
15
- import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
16
-
17
16
  interface TriggerRuntimeControls {
18
17
  triggers: Trigger.Trigger[];
19
18
 
@@ -24,12 +23,16 @@ interface TriggerRuntimeControls {
24
23
  }
25
24
 
26
25
  export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
27
- const triggers = useQuery(db, Filter.type(Trigger.Trigger));
26
+ const triggers = useQuery(
27
+ db,
28
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
29
+ );
28
30
 
29
31
  const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
30
32
 
31
- const init = useComputeRuntimeCallback(
33
+ const init = useSpaceCallback(
32
34
  db?.spaceId,
35
+ [TriggerDispatcher],
33
36
  Effect.fnUntraced(function* () {
34
37
  const dispatcher = yield* TriggerDispatcher;
35
38
  setDispatcher(dispatcher);
@@ -42,16 +45,18 @@ export const useTriggerRuntimeControls = (db: Database.Database | undefined): Tr
42
45
 
43
46
  const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
44
47
 
45
- const start = useComputeRuntimeCallback(
48
+ const start = useSpaceCallback(
46
49
  db?.spaceId,
50
+ [TriggerDispatcher],
47
51
  Effect.fnUntraced(function* () {
48
52
  const dispatcher = yield* TriggerDispatcher;
49
53
  yield* dispatcher.start();
50
54
  }),
51
55
  );
52
56
 
53
- const stop = useComputeRuntimeCallback(
57
+ const stop = useSpaceCallback(
54
58
  db?.spaceId,
59
+ [TriggerDispatcher],
55
60
  Effect.fnUntraced(function* () {
56
61
  const dispatcher = yield* TriggerDispatcher;
57
62
  yield* dispatcher.stop();
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
@@ -2,16 +2,36 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Plugin } from '@dxos/app-framework';
5
+ import { Plugin } from '@dxos/app-framework';
6
+ import { DXN } from '@dxos/keys';
6
7
  import { trim } from '@dxos/util';
7
8
 
8
- export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/automation',
9
+ export const meta = Plugin.makeMeta({
10
+ key: DXN.make('org.dxos.plugin.automation'),
10
11
  name: 'Automation',
12
+ author: 'DXOS',
11
13
  description: trim`
12
- Workflow automation engine that triggers custom actions based on object events and conditions.
13
- Create automated pipelines that respond to changes and streamline repetitive tasks.
14
+ Event-driven workflow automation engine for DXOS Composer.
15
+ Triggers connect ECHO objects, timer schedules, incoming feeds (email, webhook), and data
16
+ subscriptions to persistent compute functions — enabling automated pipelines that react to
17
+ changes in real time without manual intervention.
18
+
19
+ Each trigger references a PersistentOperation (a compiled function derived from a Script or
20
+ a visual ComputeGraph workflow) and carries optional structured input forwarded at invocation.
21
+ A per-space TriggerDispatcher manages execution: running locally in the browser when
22
+ computeEnvironment is "local", or delegating to the DXOS edge for server-side reliability.
23
+
24
+ The AutomationPanel settings surface lets users create, configure, enable, disable, and
25
+ force-run triggers from within any space. The TriggerEditor form supports all spec kinds —
26
+ timer (cron), feed, subscription, email, and webhook — with a query builder for
27
+ subscription-type triggers and a structured input editor for passing data to functions.
28
+
29
+ Operation handlers and blueprints contributed by any plugin in the application are
30
+ automatically merged and made available to every space's OperationRegistry, so new
31
+ capabilities registered by other plugins become instantly invocable from automation triggers.
14
32
  `,
15
- icon: 'ph--robot--regular',
33
+ icon: 'ph--atom--regular',
16
34
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
17
- };
35
+ spec: 'PLUGIN.mdl',
36
+ tags: ['system'],
37
+ });