@dxos/plugin-automation 0.8.4-main.72ec0f3 → 0.8.4-main.74a063c4e0

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 (282) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/chunk-POEIL4RN.mjs +44 -0
  3. package/dist/lib/browser/chunk-POEIL4RN.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-WQLEMRPU.mjs +54 -0
  5. package/dist/lib/browser/chunk-WQLEMRPU.mjs.map +7 -0
  6. package/dist/lib/browser/cli/index.mjs +1122 -0
  7. package/dist/lib/browser/cli/index.mjs.map +7 -0
  8. package/dist/lib/browser/create-trigger-from-template-JPF5BFMX.mjs +77 -0
  9. package/dist/lib/browser/create-trigger-from-template-JPF5BFMX.mjs.map +7 -0
  10. package/dist/lib/browser/hooks/index.mjs +79 -7
  11. package/dist/lib/browser/hooks/index.mjs.map +4 -4
  12. package/dist/lib/browser/index.mjs +72 -112
  13. package/dist/lib/browser/index.mjs.map +4 -4
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/operations/index.mjs +14 -0
  16. package/dist/lib/browser/operations/index.mjs.map +7 -0
  17. package/dist/lib/browser/types/index.mjs +10 -4
  18. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  19. package/dist/lib/node-esm/{chunk-ECJKIUBO.mjs → chunk-JWZAVQLF.mjs} +24 -7
  20. package/dist/lib/node-esm/chunk-JWZAVQLF.mjs.map +7 -0
  21. package/dist/lib/node-esm/chunk-SP3P4OUI.mjs +45 -0
  22. package/dist/lib/node-esm/chunk-SP3P4OUI.mjs.map +7 -0
  23. package/dist/lib/node-esm/cli/index.mjs +1123 -0
  24. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  25. package/dist/lib/node-esm/create-trigger-from-template-FT75A4SF.mjs +78 -0
  26. package/dist/lib/node-esm/create-trigger-from-template-FT75A4SF.mjs.map +7 -0
  27. package/dist/lib/node-esm/hooks/index.mjs +79 -7
  28. package/dist/lib/node-esm/hooks/index.mjs.map +4 -4
  29. package/dist/lib/node-esm/index.mjs +72 -112
  30. package/dist/lib/node-esm/index.mjs.map +4 -4
  31. package/dist/lib/node-esm/meta.json +1 -1
  32. package/dist/lib/node-esm/operations/index.mjs +15 -0
  33. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/types/index.mjs +10 -4
  35. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  36. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  38. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  39. package/dist/types/src/capabilities/compute-runtime.d.ts +4 -3
  40. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -1
  41. package/dist/types/src/capabilities/index.d.ts +6 -5
  42. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  43. package/dist/types/src/capabilities/node.d.ts +3 -0
  44. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  45. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  46. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  47. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  48. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  49. package/dist/types/src/cli/commands/index.d.ts +2 -0
  50. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  51. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  52. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  53. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  54. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  55. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  56. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  57. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  58. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  59. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  60. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  61. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  62. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  63. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  64. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  65. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  66. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  67. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  68. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  69. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  70. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  71. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  72. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  73. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  74. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  75. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  76. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  77. package/dist/types/src/cli/index.d.ts +2 -0
  78. package/dist/types/src/cli/index.d.ts.map +1 -0
  79. package/dist/types/src/cli/plugin.d.ts +3 -0
  80. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  81. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +4 -5
  82. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  83. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +28 -29
  84. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  85. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  86. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  87. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  88. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  89. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  90. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  91. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  92. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  93. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
  94. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  95. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +98 -31
  96. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  97. package/dist/types/src/components/index.d.ts +3 -4
  98. package/dist/types/src/components/index.d.ts.map +1 -1
  99. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  100. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  101. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  102. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  103. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  104. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  105. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  106. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  107. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  108. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  109. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  110. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  111. package/dist/types/src/containers/index.d.ts +5 -0
  112. package/dist/types/src/containers/index.d.ts.map +1 -0
  113. package/dist/types/src/hooks/index.d.ts +2 -0
  114. package/dist/types/src/hooks/index.d.ts.map +1 -1
  115. package/dist/types/src/hooks/useComputeRuntime.d.ts +7 -0
  116. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  117. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +4 -7
  118. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  119. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +5 -0
  120. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  121. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +4 -3
  122. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  123. package/dist/types/src/index.d.ts +2 -6
  124. package/dist/types/src/index.d.ts.map +1 -1
  125. package/dist/types/src/meta.d.ts +2 -2
  126. package/dist/types/src/meta.d.ts.map +1 -1
  127. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  128. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  129. package/dist/types/src/operations/definitions.d.ts +19 -0
  130. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  131. package/dist/types/src/operations/index.d.ts +4 -0
  132. package/dist/types/src/operations/index.d.ts.map +1 -0
  133. package/dist/types/src/testing/test-functions.d.ts +204 -3
  134. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  135. package/dist/types/src/translations.d.ts +29 -30
  136. package/dist/types/src/translations.d.ts.map +1 -1
  137. package/dist/types/src/types/capabilities.d.ts +25 -0
  138. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  139. package/dist/types/src/types/events.d.ts +5 -0
  140. package/dist/types/src/types/events.d.ts.map +1 -0
  141. package/dist/types/src/types/index.d.ts +2 -0
  142. package/dist/types/src/types/index.d.ts.map +1 -1
  143. package/dist/types/src/types/schema.d.ts +11 -3
  144. package/dist/types/src/types/schema.d.ts.map +1 -1
  145. package/dist/types/tsconfig.tsbuildinfo +1 -1
  146. package/package.json +89 -50
  147. package/src/AutomationPlugin.tsx +18 -35
  148. package/src/capabilities/app-graph-builder.ts +54 -79
  149. package/src/capabilities/compute-runtime.ts +172 -53
  150. package/src/capabilities/index.ts +9 -7
  151. package/src/capabilities/node.ts +7 -0
  152. package/src/capabilities/operation-handler.ts +16 -0
  153. package/src/capabilities/react-surface.tsx +49 -46
  154. package/src/cli/commands/index.ts +5 -0
  155. package/src/cli/commands/trigger/create/index.ts +14 -0
  156. package/src/cli/commands/trigger/create/queue.ts +90 -0
  157. package/src/cli/commands/trigger/create/subscription.ts +129 -0
  158. package/src/cli/commands/trigger/create/timer.ts +94 -0
  159. package/src/cli/commands/trigger/index.ts +16 -0
  160. package/src/cli/commands/trigger/list.ts +68 -0
  161. package/src/cli/commands/trigger/options.ts +59 -0
  162. package/src/cli/commands/trigger/remove.ts +45 -0
  163. package/src/cli/commands/trigger/update/index.ts +14 -0
  164. package/src/cli/commands/trigger/update/queue.ts +195 -0
  165. package/src/cli/commands/trigger/update/subscription.ts +279 -0
  166. package/src/cli/commands/trigger/update/timer.ts +194 -0
  167. package/src/cli/commands/trigger/util.ts +409 -0
  168. package/src/cli/index.ts +5 -0
  169. package/src/cli/plugin.ts +23 -0
  170. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +10 -8
  171. package/src/components/AutomationPanel/AutomationPanel.tsx +174 -75
  172. package/src/components/FunctionsPanel/FunctionsPanel.tsx +42 -41
  173. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +28 -49
  174. package/src/components/FunctionsRegistry/index.ts +4 -1
  175. package/src/components/TriggerEditor/FunctionInputEditor.tsx +34 -33
  176. package/src/components/TriggerEditor/SpecSelector.tsx +20 -9
  177. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +80 -34
  178. package/src/components/TriggerEditor/TriggerEditor.tsx +90 -48
  179. package/src/components/index.ts +1 -2
  180. package/src/containers/AutomationSettings/AutomationSettings.tsx +28 -0
  181. package/src/containers/AutomationSettings/index.ts +5 -0
  182. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +34 -0
  183. package/src/containers/FunctionsContainer/index.ts +5 -0
  184. package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
  185. package/src/containers/TriggerSettings/index.ts +6 -0
  186. package/src/containers/index.ts +9 -0
  187. package/src/hooks/index.ts +3 -0
  188. package/src/hooks/useComputeRuntime.ts +16 -0
  189. package/src/hooks/useComputeRuntimeCallback.ts +8 -44
  190. package/src/hooks/useComputeRuntimeService.ts +24 -0
  191. package/src/hooks/useTriggerRuntimeControls.ts +28 -14
  192. package/src/index.ts +2 -7
  193. package/src/meta.ts +3 -3
  194. package/src/operations/create-trigger-from-template.ts +75 -0
  195. package/src/operations/definitions.ts +28 -0
  196. package/src/operations/index.ts +9 -0
  197. package/src/testing/test-functions.ts +9 -6
  198. package/src/translations.ts +35 -34
  199. package/src/types/capabilities.ts +56 -0
  200. package/src/types/events.ts +11 -0
  201. package/src/types/index.ts +2 -0
  202. package/src/types/schema.ts +5 -5
  203. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  204. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  205. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  206. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  207. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  208. package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
  209. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  210. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  211. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  212. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  213. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  214. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  215. package/dist/lib/browser/chunk-LZQFZO3B.mjs +0 -17
  216. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  217. package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
  218. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  219. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  220. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  221. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  222. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  223. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  224. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  225. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  226. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  227. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  228. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  229. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  230. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  231. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  232. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  233. package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
  234. package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs.map +0 -7
  235. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  236. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  237. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  238. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  239. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
  240. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs.map +0 -7
  241. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  242. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  243. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  244. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  245. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
  246. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  247. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  248. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  249. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  250. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  251. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  252. package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
  253. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  254. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  255. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  256. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  257. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  258. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  259. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  260. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  261. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  262. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  263. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  264. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  265. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  266. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  267. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  268. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  269. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  270. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  271. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  272. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  273. package/dist/types/src/events.d.ts +0 -4
  274. package/dist/types/src/events.d.ts.map +0 -1
  275. package/src/capabilities/capabilities.ts +0 -41
  276. package/src/capabilities/intent-resolver.ts +0 -72
  277. package/src/components/AutomationSettings.tsx +0 -30
  278. package/src/components/FunctionsContainer.tsx +0 -36
  279. package/src/components/TriggerSettings.tsx +0 -25
  280. package/src/events.ts +0 -11
  281. /package/dist/lib/browser/{AutomationPanel-7OECLR5N.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  282. /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { TriggersSettings } from './TriggerSettings';
6
+ export { TriggersSettings as default } from './TriggerSettings';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
8
+ export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
9
+ export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
@@ -2,5 +2,8 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ // TODO(wittjosiah): Factor out.
5
6
  export * from './useComputeRuntimeCallback';
6
7
  export * from './useTriggerRuntimeControls';
8
+ export * from './useComputeRuntime';
9
+ export * from './useComputeRuntimeService';
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { useCapability } from '@dxos/app-framework/ui';
6
+ import { SpaceId } from '@dxos/keys';
7
+
8
+ import { AutomationCapabilities } from '../types';
9
+
10
+ /**
11
+ * Resolves the compute runtime for a space.
12
+ */
13
+ export const useComputeRuntime = (id: SpaceId | undefined): AutomationCapabilities.ComputeRuntime | undefined => {
14
+ const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
15
+ return id !== undefined ? computeRuntime.getRuntime(id) : undefined;
16
+ };
@@ -2,30 +2,25 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Cause from 'effect/Cause';
6
5
  import * as Effect from 'effect/Effect';
7
- import * as Exit from 'effect/Exit';
8
- import { useCallback } from 'react';
6
+ import { type DependencyList, useCallback } from 'react';
9
7
 
10
- import { useCapability } from '@dxos/app-framework/react';
11
- import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
12
- import { InvocationTracer, TracingServiceExt } from '@dxos/functions-runtime';
13
- import { log } from '@dxos/log';
14
- import type { Space } from '@dxos/react-client/echo';
8
+ import { type Key } from '@dxos/echo';
15
9
 
16
- import { AutomationCapabilities } from '../capabilities';
10
+ import { AutomationCapabilities } from '#types';
11
+
12
+ import { useComputeRuntime } from './useComputeRuntime';
17
13
 
18
14
  /**
19
15
  * Create an effectful function that has access to compute services
20
16
  */
21
17
  // TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
22
18
  export const useComputeRuntimeCallback = <T>(
23
- space: Space | undefined,
19
+ id: Key.SpaceId | undefined,
24
20
  fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
25
- deps?: React.DependencyList,
21
+ deps?: DependencyList,
26
22
  ): (() => Promise<T>) => {
27
- const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
28
- const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
23
+ const runtime = useComputeRuntime(id);
29
24
 
30
25
  return useCallback(() => {
31
26
  if (!runtime) {
@@ -35,34 +30,3 @@ export const useComputeRuntimeCallback = <T>(
35
30
  return runtime.runPromise(fn());
36
31
  }, [runtime, ...(deps ?? [])]);
37
32
  };
38
-
39
- // TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
40
- export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
41
- Effect.gen(function* () {
42
- const tracer = yield* InvocationTracer;
43
- const trace = yield* tracer.traceInvocationStart({
44
- target: undefined,
45
- payload: {
46
- data: {},
47
- },
48
- });
49
-
50
- // Invoke the function.
51
- const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
52
- Effect.provide(TracingServiceExt.layerQueue(trace.invocationTraceQueue)),
53
- Effect.exit,
54
- );
55
-
56
- if (Exit.isFailure(result)) {
57
- const error = Cause.prettyErrors(result.cause)[0];
58
- log.error(error.message, error.cause ?? error.stack);
59
- }
60
-
61
- yield* tracer.traceInvocationEnd({
62
- trace,
63
- // TODO(dmaretskyi): Might miss errors.
64
- exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
65
- });
66
-
67
- return result;
68
- });
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Context from 'effect/Context';
6
+ import { use } from 'react';
7
+ import { useMemo } from 'react';
8
+
9
+ import { unwrapExit } from '@dxos/effect';
10
+ import { SpaceId } from '@dxos/keys';
11
+
12
+ import { AutomationCapabilities } from '../types';
13
+ import { useComputeRuntime } from './useComputeRuntime';
14
+
15
+ export const useComputeRuntimeService = <T extends Context.Tag<any, any>>(
16
+ tag: T,
17
+ spaceId?: SpaceId,
18
+ ): (Context.Tag.Service<T> & AutomationCapabilities.ComputeRuntime) | undefined => {
19
+ const runtime = useComputeRuntime(spaceId);
20
+ if (!runtime) {
21
+ return undefined;
22
+ }
23
+ return unwrapExit(use(useMemo(() => runtime.runPromiseExit(tag), [runtime, tag])));
24
+ };
@@ -2,51 +2,65 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import { Atom, useAtomValue } from '@effect-atom/atom-react';
6
+ import type * as Context from 'effect/Context';
5
7
  import * as Effect from 'effect/Effect';
8
+ import { useEffect, useState } from 'react';
6
9
 
7
- import { Filter } from '@dxos/echo';
10
+ import { type Database, Filter } from '@dxos/echo';
8
11
  import { Trigger } from '@dxos/functions';
9
- import { TriggerDispatcher } from '@dxos/functions-runtime';
10
- import { type Space, useQuery } from '@dxos/react-client/echo';
11
- import { useAsyncState } from '@dxos/react-ui';
12
+ import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
13
+ import { useQuery } from '@dxos/react-client/echo';
12
14
 
13
15
  import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
14
16
 
15
17
  interface TriggerRuntimeControls {
16
18
  triggers: Trigger.Trigger[];
17
- isRunning: boolean;
19
+
20
+ state: TriggerDispatcherState | undefined;
21
+
18
22
  start: () => void;
19
23
  stop: () => void;
20
24
  }
21
25
 
22
- export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
23
- const triggers = useQuery(space, Filter.type(Trigger.Trigger));
26
+ export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
27
+ const triggers = useQuery(db, Filter.type(Trigger.Trigger));
24
28
 
25
- const [isRunningState, setIsRunningState] = useAsyncState(
26
- useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
29
+ const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
30
+
31
+ const init = useComputeRuntimeCallback(
32
+ db?.spaceId,
33
+ Effect.fnUntraced(function* () {
34
+ const dispatcher = yield* TriggerDispatcher;
35
+ setDispatcher(dispatcher);
36
+ }),
27
37
  );
28
38
 
39
+ useEffect(() => {
40
+ void init();
41
+ }, []);
42
+
43
+ const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
44
+
29
45
  const start = useComputeRuntimeCallback(
30
- space,
46
+ db?.spaceId,
31
47
  Effect.fnUntraced(function* () {
32
48
  const dispatcher = yield* TriggerDispatcher;
33
49
  yield* dispatcher.start();
34
- setIsRunningState(true);
35
50
  }),
36
51
  );
37
52
 
38
53
  const stop = useComputeRuntimeCallback(
39
- space,
54
+ db?.spaceId,
40
55
  Effect.fnUntraced(function* () {
41
56
  const dispatcher = yield* TriggerDispatcher;
42
57
  yield* dispatcher.stop();
43
- setIsRunningState(false);
44
58
  }),
45
59
  );
46
60
 
47
61
  return {
48
62
  triggers,
49
- isRunning: isRunningState ?? false,
63
+ state,
50
64
  start: () => void start(),
51
65
  stop: () => void stop(),
52
66
  };
package/src/index.ts CHANGED
@@ -2,10 +2,5 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { AutomationCapabilities } from './capabilities';
6
- export * from './components';
7
- export * from './meta';
8
- export * from './events';
9
- export * from './hooks';
10
-
11
- export * from './AutomationPlugin';
5
+ export { AutomationPlugin } from './AutomationPlugin';
6
+ export { meta } from './meta';
package/src/meta.ts CHANGED
@@ -2,11 +2,11 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const meta: PluginMeta = {
9
- id: 'dxos.org/plugin/automation',
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.automation',
10
10
  name: 'Automation',
11
11
  description: trim`
12
12
  Workflow automation engine that triggers custom actions based on object events and conditions.
@@ -0,0 +1,75 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';
8
+ import { Obj, Ref } from '@dxos/echo';
9
+ import { Script, Trigger } from '@dxos/functions';
10
+ import { type DXN } from '@dxos/keys';
11
+ import { Operation } from '@dxos/operation';
12
+ import { SpaceOperation } from '@dxos/plugin-space/operations';
13
+ import { Filter } from '@dxos/react-client/echo';
14
+
15
+ import { meta } from '#meta';
16
+
17
+ import { CreateTriggerFromTemplate } from './definitions';
18
+
19
+ const handler: Operation.WithHandler<typeof CreateTriggerFromTemplate> = CreateTriggerFromTemplate.pipe(
20
+ Operation.withHandler(
21
+ Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
22
+ const trigger = Trigger.make({ enabled, input });
23
+
24
+ // TODO(wittjosiah): Factor out function lookup by script name?
25
+ if (scriptName) {
26
+ const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());
27
+ const [script] = scripts;
28
+ if (script) {
29
+ const functions = yield* Effect.promise(() =>
30
+ db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),
31
+ );
32
+ const [fn] = functions;
33
+ if (fn) {
34
+ Obj.change(trigger, (obj) => {
35
+ obj.function = Ref.make(fn);
36
+ });
37
+ }
38
+ }
39
+ }
40
+
41
+ switch (template.type) {
42
+ case 'timer': {
43
+ Obj.change(trigger, (obj) => {
44
+ obj.spec = { kind: 'timer', cron: template.cron };
45
+ });
46
+ break;
47
+ }
48
+ case 'queue': {
49
+ Obj.change(trigger, (obj) => {
50
+ obj.spec = {
51
+ kind: 'queue',
52
+ queue: (template.queueDXN as DXN).toString(),
53
+ };
54
+ });
55
+ break;
56
+ }
57
+ default: {
58
+ break;
59
+ }
60
+ }
61
+
62
+ yield* Operation.invoke(SpaceOperation.AddObject, {
63
+ object: trigger,
64
+ target: db,
65
+ hidden: true,
66
+ });
67
+ yield* Operation.invoke(LayoutOperation.Open, {
68
+ subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],
69
+ workspace: getSpacePath(db.spaceId),
70
+ });
71
+ }),
72
+ ),
73
+ );
74
+
75
+ export default handler;
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import { Database } from '@dxos/echo';
9
+ import { Operation } from '@dxos/operation';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ import { TriggerTemplate } from '../types';
14
+
15
+ const AUTOMATION_OPERATION = `${meta.id}.operation`;
16
+
17
+ export const CreateTriggerFromTemplate = Operation.make({
18
+ meta: { key: `${AUTOMATION_OPERATION}.create-trigger-from-template`, name: 'Create Trigger From Template' },
19
+ services: [Capability.Service],
20
+ input: Schema.Struct({
21
+ db: Database.Database,
22
+ template: TriggerTemplate,
23
+ enabled: Schema.optional(Schema.Boolean),
24
+ scriptName: Schema.optional(Schema.String),
25
+ input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
26
+ }),
27
+ output: Schema.Void,
28
+ });
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/operation';
6
+
7
+ export * as AutomationOperation from './definitions';
8
+
9
+ export const AutomationOperationHandlerSet = OperationHandlerSet.lazy(() => import('./create-trigger-from-template'));
@@ -4,14 +4,15 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { ContactType } from '@dxos/client/testing';
8
- import { Type } from '@dxos/echo';
7
+ import { TestSchema } from '@dxos/client/testing';
8
+ import { JsonSchema, Ref } from '@dxos/echo';
9
9
 
10
10
  export const functions = [
11
11
  {
12
+ key: 'example.com/function/chess',
12
13
  name: 'example.com/function/chess',
13
14
  version: '0.1.0',
14
- inputSchema: Type.toJsonSchema(
15
+ inputSchema: JsonSchema.toJsonSchema(
15
16
  Schema.Struct({
16
17
  level: Schema.Number.annotations({
17
18
  title: 'Level',
@@ -20,10 +21,11 @@ export const functions = [
20
21
  ),
21
22
  },
22
23
  {
24
+ key: 'example.com/function/forex',
23
25
  name: 'example.com/function/forex',
24
26
  version: '0.1.0',
25
27
  binding: 'FOREX',
26
- inputSchema: Type.toJsonSchema(
28
+ inputSchema: JsonSchema.toJsonSchema(
27
29
  Schema.Struct({
28
30
  from: Schema.String.annotations({ title: 'Currency from' }),
29
31
  to: Schema.String.annotations({ title: 'Currency to' }),
@@ -31,11 +33,12 @@ export const functions = [
31
33
  ),
32
34
  },
33
35
  {
36
+ key: 'example.com/function/ping-contact',
34
37
  name: 'example.com/function/ping-contact',
35
38
  version: '0.0.1',
36
- inputSchema: Type.toJsonSchema(
39
+ inputSchema: JsonSchema.toJsonSchema(
37
40
  Schema.Struct({
38
- contact: Type.Ref(ContactType).annotations({ title: 'Contact' }),
41
+ contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
39
42
  }),
40
43
  ),
41
44
  },
@@ -4,47 +4,48 @@
4
4
 
5
5
  import { type Resource } from '@dxos/react-ui';
6
6
 
7
- import { meta } from './meta';
7
+ import { meta } from '#meta';
8
8
 
9
9
  export const translations = [
10
10
  {
11
11
  'en-US': {
12
12
  [meta.id]: {
13
- 'plugin name': 'Automation',
14
- 'automation panel label': 'Automations',
15
- 'script automation label': 'Automation',
16
- 'automation verbose label': 'Manage automations',
17
- 'automation description': 'You can manage all the triggers which automate your space here.',
18
-
19
- 'runtime label': 'Enable Local Runtime',
20
- 'runtime description':
13
+ 'plugin.name': 'Automation',
14
+ 'automation-panel.label': 'Automations',
15
+ 'script-automation.label': 'Automation',
16
+ 'automation-verbose.label': 'Manage automations',
17
+ 'automation.description': 'You can manage all the triggers which automate your space here.',
18
+
19
+ 'runtime.label': 'Enable Local Runtime',
20
+ 'runtime.description':
21
21
  'This will start a trigger dispatcher locally for this space to run triggers on your device while Composer is running.',
22
22
 
23
- 'functions panel label': 'Functions',
24
- 'functions verbose label': 'Manage deployed functions',
25
- 'functions registry verbose label': 'Functions registry',
26
- 'functions registry description': 'Import functions from the registry',
27
- 'functions description': 'You can manage all the functions deployed from your space on EDGE here.',
28
- 'function copy id': 'Copy Function ID',
29
- 'no functions found': 'No functions found',
30
- 'go to function source button label': 'Show function source',
31
- 'delete function button label': 'Delete function',
32
-
33
- 'trigger editor title': 'Configure Trigger',
34
- 'new trigger label': 'Add Trigger',
35
- 'trigger type timer': 'Timer',
36
- 'trigger type webhook': 'Webhook',
37
- 'trigger type websocket': 'Websocket',
38
- 'trigger type subscription': 'Subscription',
39
- 'trigger type email': 'Email',
40
- 'trigger type queue': 'Queue',
41
-
42
- 'trigger copy url': 'Copy URL',
43
- 'trigger copy email': 'Copy Email',
44
-
45
- 'trigger payload add': 'Add',
46
- 'trigger payload remove': 'Remove',
47
- 'trigger payload prop name placeholder': 'New payload property name',
23
+ 'functions-panel.label': 'Functions',
24
+ 'functions-verbose.label': 'Manage deployed functions',
25
+ 'functions-registry-verbose.label': 'Functions registry',
26
+ 'functions-registry.description': 'Import functions from the registry',
27
+ 'functions.description': 'You can manage all the functions deployed from your space on EDGE here.',
28
+ 'show-source-button.label': 'Show source',
29
+ 'delete-function-button.label': 'Delete function',
30
+
31
+ 'function-parameters.label': 'Function parameters',
32
+
33
+ 'trigger-editor.title': 'Configure Trigger',
34
+ 'trigger-editor.description':
35
+ 'Triggers are used to run functions at specific times or when specific events occur.',
36
+ 'new-trigger.label': 'Add Trigger',
37
+
38
+ 'trigger-type.timer.label': 'Timer',
39
+ 'trigger-type.webhook.label': 'Webhook',
40
+ 'trigger-type.websocket.label': 'Websocket',
41
+ 'trigger-type.subscription.label': 'Subscription',
42
+ 'trigger-type.email.label': 'Email',
43
+ 'trigger-type.queue.label': 'Feed',
44
+
45
+ 'trigger-payload-prop-name.placeholder': 'New payload property name',
46
+ 'import-function-button.label': 'Loading...',
47
+ 'loading-functions.message': 'Loading functions...',
48
+ 'update-function-button.label': 'Update',
48
49
  },
49
50
  },
50
51
  },
@@ -0,0 +1,56 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import type * as ManagedRuntime from 'effect/ManagedRuntime';
6
+
7
+ import { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
8
+ import { Capability } from '@dxos/app-framework';
9
+ import { AgentService } from '@dxos/assistant';
10
+ import type { Blueprint } from '@dxos/blueprints';
11
+ import { type Database, type Feed } from '@dxos/echo';
12
+ import type {
13
+ CredentialsService,
14
+ FunctionInvocationService,
15
+ Process,
16
+ QueueService,
17
+ TracingService,
18
+ } from '@dxos/functions';
19
+ import type { TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';
20
+ import type { SpaceId } from '@dxos/keys';
21
+ import type { Operation } from '@dxos/operation';
22
+
23
+ import { meta } from '#meta';
24
+
25
+ export namespace AutomationCapabilities {
26
+ /**
27
+ * Service stack for executing agents, functions, and triggers.
28
+ */
29
+ export type ComputeServices =
30
+ | TriggerDispatcher
31
+ | TriggerStateStore
32
+ | AiService.AiService
33
+ | Database.Service
34
+ | Feed.FeedService
35
+ | QueueService
36
+ | CredentialsService
37
+ | Blueprint.RegistryService
38
+ | AgentService.AgentService
39
+ | Process.ProcessMonitorService
40
+ | TracingService // TODO(dmaretskyi): Probably should not be provided here.
41
+ | FunctionInvocationService // TODO(dmaretskyi): Deprecated
42
+ | Operation.Service
43
+ // TODO(dmaretskyi): Those should be provided at AI-chat call site.
44
+ | ToolResolverService
45
+ | ToolExecutionService;
46
+
47
+ export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;
48
+ export interface ComputeRuntimeProvider {
49
+ getRuntime(spaceId: SpaceId): ComputeRuntime;
50
+ }
51
+
52
+ /**
53
+ * Runtime for executing agents, functions, and triggers.
54
+ */
55
+ export const ComputeRuntime = Capability.make<ComputeRuntimeProvider>(`${meta.id}.capability.compute-runtime`);
56
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { ActivationEvent } from '@dxos/app-framework';
6
+
7
+ import { meta } from '#meta';
8
+
9
+ export namespace AutomationEvents {
10
+ export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}.event.compute-runtime-ready`);
11
+ }
@@ -2,4 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ export * from './capabilities';
6
+ export * from './events';
5
7
  export * from './schema';
@@ -4,21 +4,21 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { SpaceSchema } from '@dxos/react-client/echo';
7
+ import { Database } from '@dxos/echo';
8
8
 
9
- import { meta } from '../meta';
9
+ import { meta } from '#meta';
10
10
 
11
- const TriggerTemplate = Schema.Union(
11
+ export const TriggerTemplate = Schema.Union(
12
12
  Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),
13
13
  Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),
14
14
  );
15
15
 
16
16
  export namespace AutomationAction {
17
17
  export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(
18
- `${meta.id}/action/create-trigger-from-template`,
18
+ `${meta.id}.action.create-trigger-from-template`,
19
19
  {
20
20
  input: Schema.Struct({
21
- space: SpaceSchema,
21
+ db: Database.Database,
22
22
  template: TriggerTemplate,
23
23
  enabled: Schema.optional(Schema.Boolean),
24
24
  // TODO(wittjosiah): Improve how this lookup is done.
@@ -1,11 +0,0 @@
1
- import {
2
- AutomationPanel,
3
- AutomationPanel_default
4
- } from "./chunk-QKFBHAGN.mjs";
5
- import "./chunk-JW7XSPYW.mjs";
6
- import "./chunk-LZQFZO3B.mjs";
7
- export {
8
- AutomationPanel,
9
- AutomationPanel_default as default
10
- };
11
- //# sourceMappingURL=AutomationPanel-7OECLR5N.mjs.map