@dxos/plugin-automation 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878

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 (346) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/AutomationPanel-OS3ZWYJK.mjs +12 -0
  4. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  5. package/dist/lib/neutral/AutomationPlugin.node.mjs +1118 -0
  6. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  7. package/dist/lib/neutral/AutomationPlugin.workerd.mjs +23 -0
  8. package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
  9. package/dist/lib/neutral/AutomationSettings-CAFY3J7H.mjs +32 -0
  10. package/dist/lib/neutral/AutomationSettings-CAFY3J7H.mjs.map +7 -0
  11. package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.mjs +38 -0
  12. package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.mjs.map +7 -0
  13. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs +97 -0
  14. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
  15. package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs +95 -0
  16. package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs.map +7 -0
  17. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  18. package/dist/lib/neutral/app-graph-builder-4QOUKY5L.mjs +75 -0
  19. package/dist/lib/neutral/app-graph-builder-4QOUKY5L.mjs.map +7 -0
  20. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  21. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  22. package/dist/lib/neutral/capabilities/node.mjs +15 -0
  23. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-2H6X4VQY.mjs +435 -0
  25. package/dist/lib/neutral/chunk-2H6X4VQY.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  27. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-33VXVTV4.mjs +38 -0
  29. package/dist/lib/neutral/chunk-33VXVTV4.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-ARUHHM4Q.mjs +12 -0
  31. package/dist/lib/neutral/chunk-ARUHHM4Q.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-CMM3AFHR.mjs +111 -0
  33. package/dist/lib/neutral/chunk-CMM3AFHR.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-EBSOLOP6.mjs +8 -0
  35. package/dist/lib/neutral/chunk-EBSOLOP6.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  37. package/dist/lib/neutral/chunk-KV7RZLFS.mjs +344 -0
  38. package/dist/lib/neutral/chunk-KV7RZLFS.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-QLBA6Y46.mjs +39 -0
  40. package/dist/lib/neutral/chunk-QLBA6Y46.mjs.map +7 -0
  41. package/dist/lib/neutral/chunk-XC5EPVE3.mjs +76 -0
  42. package/dist/lib/neutral/chunk-XC5EPVE3.mjs.map +7 -0
  43. package/dist/lib/neutral/components/index.mjs +16 -0
  44. package/dist/lib/neutral/containers/index.mjs +13 -0
  45. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  46. package/dist/lib/neutral/create-trigger-from-template-IOQZDDSH.mjs +68 -0
  47. package/dist/lib/neutral/create-trigger-from-template-IOQZDDSH.mjs.map +7 -0
  48. package/dist/lib/neutral/hooks/index.mjs +10 -0
  49. package/dist/lib/neutral/index.mjs +16 -0
  50. package/dist/lib/neutral/layer-specs-B22CIT3U.mjs +160 -0
  51. package/dist/lib/neutral/layer-specs-B22CIT3U.mjs.map +7 -0
  52. package/dist/lib/neutral/meta.json +1 -0
  53. package/dist/lib/neutral/meta.mjs +8 -0
  54. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  55. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  56. package/dist/lib/neutral/operations/index.mjs +8 -0
  57. package/dist/lib/neutral/operations/index.mjs.map +7 -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-3OGMAMKV.mjs +57 -0
  61. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  62. package/dist/lib/neutral/testing.mjs +8 -0
  63. package/dist/lib/neutral/testing.mjs.map +7 -0
  64. package/dist/lib/neutral/translations.mjs +60 -0
  65. package/dist/lib/neutral/translations.mjs.map +7 -0
  66. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
  67. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
  68. package/dist/lib/neutral/types/index.mjs +12 -0
  69. package/dist/lib/neutral/types/index.mjs.map +7 -0
  70. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  71. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  72. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  73. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  74. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  75. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  76. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  77. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  78. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  79. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  80. package/dist/types/src/capabilities/index.d.ts +7 -5
  81. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
  83. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/node.d.ts +7 -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 +3 -2
  89. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
  91. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
  93. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
  94. package/dist/types/src/commands/index.d.ts +2 -0
  95. package/dist/types/src/commands/index.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  97. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  98. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  99. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  101. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  103. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  104. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  105. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  106. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  107. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  108. package/dist/types/src/commands/trigger/options.d.ts +10 -0
  109. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  110. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  111. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  112. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  113. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  114. package/dist/types/src/commands/trigger/update/queue.d.ts +11 -0
  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 +13 -0
  117. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  118. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  119. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  120. package/dist/types/src/commands/trigger/util.d.ts +85 -0
  121. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  122. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +5 -6
  123. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  124. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -30
  125. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  126. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts +18 -0
  127. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts.map +1 -0
  128. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  131. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  132. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  133. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  134. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  135. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  136. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  137. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  138. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +8 -7
  139. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  140. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +118 -32
  141. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  142. package/dist/types/src/components/index.d.ts +3 -4
  143. package/dist/types/src/components/index.d.ts.map +1 -1
  144. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  145. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  146. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  147. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  148. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  149. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  150. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  151. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  152. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  153. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  154. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  155. package/dist/types/src/containers/index.d.ts +5 -0
  156. package/dist/types/src/containers/index.d.ts.map +1 -0
  157. package/dist/types/src/hooks/index.d.ts +1 -1
  158. package/dist/types/src/hooks/index.d.ts.map +1 -1
  159. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts +13 -0
  160. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts.map +1 -0
  161. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +5 -4
  162. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  163. package/dist/types/src/index.d.ts +1 -5
  164. package/dist/types/src/index.d.ts.map +1 -1
  165. package/dist/types/src/meta.d.ts +2 -2
  166. package/dist/types/src/meta.d.ts.map +1 -1
  167. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  168. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  169. package/dist/types/src/operations/index.d.ts +3 -0
  170. package/dist/types/src/operations/index.d.ts.map +1 -0
  171. package/dist/types/src/plugin.d.ts +4 -0
  172. package/dist/types/src/plugin.d.ts.map +1 -0
  173. package/dist/types/src/testing/test-functions.d.ts +204 -3
  174. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  175. package/dist/types/src/testing.d.ts +2 -0
  176. package/dist/types/src/testing.d.ts.map +1 -0
  177. package/dist/types/src/translations.d.ts +45 -31
  178. package/dist/types/src/translations.d.ts.map +1 -1
  179. package/dist/types/src/types/AutomationOperation.d.ts +21 -0
  180. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  181. package/dist/types/src/types/index.d.ts +1 -0
  182. package/dist/types/src/types/index.d.ts.map +1 -1
  183. package/dist/types/src/types/schema.d.ts +13 -5
  184. package/dist/types/src/types/schema.d.ts.map +1 -1
  185. package/dist/types/tsconfig.tsbuildinfo +1 -1
  186. package/package.json +145 -70
  187. package/src/AutomationPlugin.node.ts +32 -0
  188. package/src/AutomationPlugin.test.ts +27 -0
  189. package/src/AutomationPlugin.tsx +24 -38
  190. package/src/AutomationPlugin.workerd.ts +18 -0
  191. package/src/capabilities/app-graph-builder.ts +59 -80
  192. package/src/capabilities/index.ts +13 -7
  193. package/src/capabilities/layer-specs.ts +230 -0
  194. package/src/capabilities/node.ts +17 -0
  195. package/src/capabilities/operation-handler.ts +16 -0
  196. package/src/capabilities/react-surface.tsx +49 -46
  197. package/src/capabilities/trigger-runtime-controller.test.ts +103 -0
  198. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  199. package/src/commands/index.ts +5 -0
  200. package/src/commands/trigger/create/index.ts +14 -0
  201. package/src/commands/trigger/create/queue.ts +87 -0
  202. package/src/commands/trigger/create/subscription.ts +125 -0
  203. package/src/commands/trigger/create/timer.ts +90 -0
  204. package/src/commands/trigger/index.ts +16 -0
  205. package/src/commands/trigger/list.ts +70 -0
  206. package/src/commands/trigger/options.ts +47 -0
  207. package/src/commands/trigger/remove.ts +45 -0
  208. package/src/commands/trigger/update/index.ts +14 -0
  209. package/src/commands/trigger/update/queue.ts +191 -0
  210. package/src/commands/trigger/update/subscription.ts +279 -0
  211. package/src/commands/trigger/update/timer.ts +195 -0
  212. package/src/commands/trigger/util.ts +410 -0
  213. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +15 -8
  214. package/src/components/AutomationPanel/AutomationPanel.tsx +245 -86
  215. package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
  216. package/src/components/FunctionsPanel/FunctionsPanel.tsx +43 -42
  217. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +38 -54
  218. package/src/components/FunctionsRegistry/index.ts +4 -1
  219. package/src/components/TriggerEditor/FunctionInputEditor.tsx +36 -35
  220. package/src/components/TriggerEditor/SpecSelector.tsx +26 -20
  221. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +92 -39
  222. package/src/components/TriggerEditor/TriggerEditor.tsx +171 -54
  223. package/src/components/index.ts +1 -2
  224. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  225. package/src/containers/AutomationSettings/index.ts +5 -0
  226. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  227. package/src/containers/FunctionsContainer/index.ts +5 -0
  228. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  229. package/src/containers/TriggerSettings/index.ts +6 -0
  230. package/src/containers/index.ts +9 -0
  231. package/src/hooks/index.ts +2 -1
  232. package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
  233. package/src/hooks/useTriggerRuntimeControls.ts +38 -19
  234. package/src/index.ts +1 -6
  235. package/src/meta.ts +25 -6
  236. package/src/operations/create-trigger-from-template.ts +70 -0
  237. package/src/operations/index.ts +7 -0
  238. package/src/plugin.ts +11 -0
  239. package/src/testing/test-functions.ts +12 -9
  240. package/src/testing.ts +7 -0
  241. package/src/translations.ts +53 -36
  242. package/src/types/AutomationOperation.ts +39 -0
  243. package/src/types/index.ts +2 -0
  244. package/src/types/schema.ts +6 -6
  245. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  246. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  247. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  248. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  249. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  250. package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
  251. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  252. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  254. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  255. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  256. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  257. package/dist/lib/browser/chunk-LZQFZO3B.mjs +0 -17
  258. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  259. package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
  260. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  261. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  262. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  263. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  264. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  265. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  266. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  268. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  269. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  270. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  271. package/dist/lib/browser/hooks/index.mjs +0 -13
  272. package/dist/lib/browser/index.mjs +0 -130
  273. package/dist/lib/browser/index.mjs.map +0 -7
  274. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  275. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  276. package/dist/lib/browser/meta.json +0 -1
  277. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  278. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  279. package/dist/lib/browser/types/index.mjs +0 -8
  280. package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
  281. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  282. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  283. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  284. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  285. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
  286. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  287. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  288. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  289. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
  291. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  293. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  294. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  295. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  296. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  297. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
  299. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  300. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  301. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  302. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  303. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  304. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  305. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  306. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  307. package/dist/lib/node-esm/index.mjs +0 -131
  308. package/dist/lib/node-esm/index.mjs.map +0 -7
  309. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  310. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  311. package/dist/lib/node-esm/meta.json +0 -1
  312. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  313. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  314. package/dist/lib/node-esm/types/index.mjs +0 -9
  315. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  316. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  317. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  318. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  319. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  320. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  321. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  322. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  323. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  324. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  325. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  326. package/dist/types/src/events.d.ts +0 -4
  327. package/dist/types/src/events.d.ts.map +0 -1
  328. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  329. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  330. package/src/capabilities/capabilities.ts +0 -41
  331. package/src/capabilities/compute-runtime.ts +0 -127
  332. package/src/capabilities/intent-resolver.ts +0 -72
  333. package/src/components/AutomationSettings.tsx +0 -30
  334. package/src/components/FunctionsContainer.tsx +0 -36
  335. package/src/components/TriggerSettings.tsx +0 -25
  336. package/src/events.ts +0 -11
  337. package/src/hooks/useComputeRuntimeCallback.ts +0 -68
  338. /package/dist/lib/{browser/AutomationPanel-7OECLR5N.mjs.map → neutral/AutomationPanel-OS3ZWYJK.mjs.map} +0 -0
  339. /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  340. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  341. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  342. /package/dist/lib/{node-esm/hooks → neutral/components}/index.mjs.map +0 -0
  343. /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
  344. /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → neutral/index.mjs.map} +0 -0
  345. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/meta.mjs.map} +0 -0
  346. /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
@@ -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
+ };
@@ -2,51 +2,70 @@
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';
8
- 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
-
13
- import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
10
+ import { useSpaceCallback } from '@dxos/app-framework/ui';
11
+ import { Trigger } from '@dxos/compute';
12
+ import { type Database, Filter, Query } from '@dxos/echo';
13
+ import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
14
+ import { useQuery } from '@dxos/react-client/echo';
14
15
 
15
16
  interface TriggerRuntimeControls {
16
17
  triggers: Trigger.Trigger[];
17
- isRunning: boolean;
18
+
19
+ state: TriggerDispatcherState | undefined;
20
+
18
21
  start: () => void;
19
22
  stop: () => void;
20
23
  }
21
24
 
22
- export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
23
- const triggers = useQuery(space, Filter.type(Trigger.Trigger));
25
+ export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
26
+ const triggers = useQuery(
27
+ db,
28
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
29
+ );
30
+
31
+ const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
24
32
 
25
- const [isRunningState, setIsRunningState] = useAsyncState(
26
- useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
33
+ const init = useSpaceCallback(
34
+ db?.spaceId,
35
+ [TriggerDispatcher],
36
+ Effect.fnUntraced(function* () {
37
+ const dispatcher = yield* TriggerDispatcher;
38
+ setDispatcher(dispatcher);
39
+ }),
27
40
  );
28
41
 
29
- const start = useComputeRuntimeCallback(
30
- space,
42
+ useEffect(() => {
43
+ void init();
44
+ }, []);
45
+
46
+ const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
47
+
48
+ const start = useSpaceCallback(
49
+ db?.spaceId,
50
+ [TriggerDispatcher],
31
51
  Effect.fnUntraced(function* () {
32
52
  const dispatcher = yield* TriggerDispatcher;
33
53
  yield* dispatcher.start();
34
- setIsRunningState(true);
35
54
  }),
36
55
  );
37
56
 
38
- const stop = useComputeRuntimeCallback(
39
- space,
57
+ const stop = useSpaceCallback(
58
+ db?.spaceId,
59
+ [TriggerDispatcher],
40
60
  Effect.fnUntraced(function* () {
41
61
  const dispatcher = yield* TriggerDispatcher;
42
62
  yield* dispatcher.stop();
43
- setIsRunningState(false);
44
63
  }),
45
64
  );
46
65
 
47
66
  return {
48
67
  triggers,
49
- isRunning: isRunningState ?? false,
68
+ state,
50
69
  start: () => void start(),
51
70
  stop: () => void stop(),
52
71
  };
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
5
  export * from './meta';
8
- export * from './events';
9
- export * from './hooks';
10
-
11
- export * from './AutomationPlugin';
6
+ export * from './types';
package/src/meta.ts CHANGED
@@ -2,16 +2,35 @@
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
+ author: 'DXOS',
11
12
  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.
13
+ Event-driven workflow automation engine for DXOS Composer.
14
+ Triggers connect ECHO objects, timer schedules, incoming feeds (email, webhook), and data
15
+ subscriptions to persistent compute functions — enabling automated pipelines that react to
16
+ changes in real time without manual intervention.
17
+
18
+ Each trigger references a PersistentOperation (a compiled function derived from a Script or
19
+ a visual ComputeGraph workflow) and carries optional structured input forwarded at invocation.
20
+ A per-space TriggerDispatcher manages execution: running locally in the browser when
21
+ computeEnvironment is "local", or delegating to the DXOS edge for server-side reliability.
22
+
23
+ The AutomationPanel settings surface lets users create, configure, enable, disable, and
24
+ force-run triggers from within any space. The TriggerEditor form supports all spec kinds —
25
+ timer (cron), feed, subscription, email, and webhook — with a query builder for
26
+ subscription-type triggers and a structured input editor for passing data to functions.
27
+
28
+ Operation handlers and blueprints contributed by any plugin in the application are
29
+ automatically merged and made available to every space's OperationRegistry, so new
30
+ capabilities registered by other plugins become instantly invocable from automation triggers.
14
31
  `,
15
- icon: 'ph--robot--regular',
32
+ icon: 'ph--atom--regular',
16
33
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
34
+ spec: 'PLUGIN.mdl',
35
+ tags: ['system'],
17
36
  };
@@ -0,0 +1,70 @@
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 { Operation, Script, Trigger } from '@dxos/compute';
9
+ import { type Feed, Filter, Obj, Ref } from '@dxos/echo';
10
+ import { SpaceOperation } from '@dxos/plugin-space';
11
+
12
+ import { meta } from '#meta';
13
+
14
+ import { AutomationOperation } from '../types';
15
+
16
+ const handler: Operation.WithHandler<typeof AutomationOperation.CreateTriggerFromTemplate> =
17
+ AutomationOperation.CreateTriggerFromTemplate.pipe(
18
+ Operation.withHandler(
19
+ Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
20
+ const trigger = Trigger.make({ enabled, input });
21
+
22
+ // TODO(wittjosiah): Factor out function lookup by script name?
23
+ if (scriptName) {
24
+ const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());
25
+ const [script] = scripts;
26
+ if (script) {
27
+ const functions = yield* Effect.promise(() =>
28
+ db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),
29
+ );
30
+ const [fn] = functions;
31
+ if (fn) {
32
+ Obj.update(trigger, (trigger) => {
33
+ trigger.function = Ref.make(fn);
34
+ });
35
+ }
36
+ }
37
+ }
38
+
39
+ switch (template.type) {
40
+ case 'timer': {
41
+ Obj.update(trigger, (trigger) => {
42
+ trigger.spec = Trigger.specTimer(template.cron);
43
+ });
44
+ break;
45
+ }
46
+ case 'feed': {
47
+ Obj.update(trigger, (trigger) => {
48
+ trigger.spec = Trigger.specFeed(template.feed as Feed.Feed);
49
+ });
50
+ break;
51
+ }
52
+ default: {
53
+ break;
54
+ }
55
+ }
56
+
57
+ yield* Operation.invoke(SpaceOperation.AddObject, {
58
+ object: trigger,
59
+ target: db,
60
+ hidden: true,
61
+ });
62
+ yield* Operation.invoke(LayoutOperation.Open, {
63
+ subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],
64
+ workspace: getSpacePath(db.spaceId),
65
+ });
66
+ }),
67
+ ),
68
+ );
69
+
70
+ export default handler;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const AutomationOperationHandlerSet = OperationHandlerSet.lazy(() => import('./create-trigger-from-template'));
package/src/plugin.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const AutomationPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { AutomationOperationHandlerSet } from './operations';
@@ -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
- name: 'example.com/function/chess',
12
+ key: 'com.example.function.chess',
13
+ name: 'com.example.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
  {
23
- name: 'example.com/function/forex',
24
+ key: 'com.example.function.forex',
25
+ name: 'com.example.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
  {
34
- name: 'example.com/function/ping-contact',
36
+ key: 'com.example.function.ping-contact',
37
+ name: 'com.example.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
  },
package/src/testing.ts ADDED
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // Eager re-export of `AutomationPlugin`. See `@dxos/plugin-testing/src/core.ts`
6
+ // for the rationale.
7
+ export * from './AutomationPlugin';
@@ -4,47 +4,64 @@
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':
21
- 'This will start a trigger dispatcher locally for this space to run triggers on your device while Composer is running.',
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',
13
+ 'plugin.name': 'Automation',
14
+ 'automation-panel.label': 'Automations',
15
+ 'script-automation.label': 'Automation',
16
+ 'automation-verbose.label': 'Manage automations',
17
+ 'automation.description': 'Triggers that automate this space.',
18
+
19
+ 'runtime.label': 'Trigger runtime location',
20
+ 'runtime.description': 'Determines where the triggers in this space will execute.',
21
+ 'runtime.disabled.label': 'Triggers disabled',
22
+ 'runtime.local.label': 'Local',
23
+ 'runtime.edge.label': 'EDGE (experimental)',
24
+
25
+ 'functions-panel.label': 'Functions',
26
+ 'functions-verbose.label': 'Manage deployed functions',
27
+ 'functions-registry-verbose.label': 'Functions registry',
28
+ 'functions-registry.description': 'Import functions from the registry',
29
+ 'functions.description': 'Functions deployed from this space on EDGE.',
30
+ 'show-source-button.label': 'Show source',
31
+ 'delete-function-button.label': 'Delete function',
32
+
33
+ 'function-parameters.label': 'Function parameters',
34
+
35
+ 'trigger-editor.title': 'Configure Trigger',
36
+ 'trigger-editor.description':
37
+ 'Triggers are used to run functions at specific times or when specific events occur.',
38
+ 'new-trigger.label': 'Add Trigger',
39
+
40
+ 'trigger-type.timer.label': 'Timer',
41
+ 'trigger-type.webhook.label': 'Webhook',
42
+ 'trigger-type.websocket.label': 'Websocket',
43
+ 'trigger-type.subscription.label': 'Subscription',
44
+ 'trigger-type.email.label': 'Email',
45
+ 'trigger-type.feed.label': 'Feed',
46
+
47
+ 'trigger-payload-prop-name.placeholder': 'New payload property name',
48
+ 'import-function-button.label': 'Loading...',
49
+ 'update-function-button.label': 'Update',
50
+ 'loading-functions.message': 'Loading functions...',
51
+
52
+ 'edge.trigger.status.loading.message': 'Loading edge trigger status…',
53
+ 'edge.trigger.status.unavailable.message': 'Edge trigger status unavailable',
54
+ 'edge.trigger.status.dispatcher.label': 'Edge dispatcher: {{state}}',
55
+ 'edge.trigger.status.active.label': 'active',
56
+ 'edge.trigger.status.inactive.label': 'inactive',
57
+ 'edge.trigger.status.next.cron.label': 'Next cron run: {{time}}',
58
+ 'edge.trigger.status.next.alarm.label': 'Next alarm: {{time}}',
59
+ 'edge.trigger.status.inactivity.label': 'Inactivity timeout: {{remaining}} remaining',
60
+ 'edge.trigger.status.registered.label': 'Edge: registered',
61
+ 'edge.trigger.status.not.registered.label': 'Edge: not registered',
62
+ 'edge.trigger.status.registered.count.label': 'Enabled cron triggers on edge: {{registered}} / {{total}}',
63
+ 'edge.trigger.status.cron.na.label': 'Edge: cron registration n/a',
64
+ 'edge.trigger.status.disabled.detail.label': 'disabled',
48
65
  },
49
66
  },
50
67
  },
@@ -0,0 +1,39 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+ import { Operation } from '@dxos/compute';
11
+ import { Database } from '@dxos/echo';
12
+ // Value-side `EchoURI` import keeps TS declaration emit portable — `TriggerTemplate`
13
+ // references `EchoURI.Schema` and the inferred `CreateTriggerFromTemplate` type
14
+ // otherwise needs a transitive `@dxos/keys` import that's hard for d.ts emit to surface.
15
+ import { EchoURI as _EchoURIReference } from '@dxos/keys';
16
+
17
+ import { meta } from '#meta';
18
+
19
+ import { TriggerTemplate } from './schema';
20
+ export { _EchoURIReference };
21
+
22
+ const AUTOMATION_OPERATION = `${meta.id}.operation`;
23
+
24
+ export const CreateTriggerFromTemplate = Operation.make({
25
+ meta: {
26
+ key: `${AUTOMATION_OPERATION}.create-trigger-from-template`,
27
+ name: 'Create Trigger From Template',
28
+ icon: 'ph--lightning--regular',
29
+ },
30
+ services: [Capability.Service],
31
+ input: Schema.Struct({
32
+ db: Database.Database,
33
+ template: TriggerTemplate,
34
+ enabled: Schema.optional(Schema.Boolean),
35
+ scriptName: Schema.optional(Schema.String),
36
+ input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
37
+ }),
38
+ output: Schema.Void,
39
+ });
@@ -3,3 +3,5 @@
3
3
  //
4
4
 
5
5
  export * from './schema';
6
+
7
+ export * as AutomationOperation from './AutomationOperation';
@@ -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
- Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),
13
+ Schema.Struct({ type: Schema.Literal('feed'), feed: 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
@@ -1,68 +0,0 @@
1
- import {
2
- useTriggerRuntimeControls
3
- } from "./chunk-NAPXRXTY.mjs";
4
- import "./chunk-XAKZ4ANY.mjs";
5
- import {
6
- AutomationPanel
7
- } from "./chunk-QKFBHAGN.mjs";
8
- import "./chunk-JW7XSPYW.mjs";
9
- import {
10
- meta
11
- } from "./chunk-LZQFZO3B.mjs";
12
-
13
- // src/components/AutomationSettings.tsx
14
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
15
- import React2 from "react";
16
- import { useTranslation as useTranslation2 } from "@dxos/react-ui";
17
- import { ControlPage, ControlSection } from "@dxos/react-ui-form";
18
-
19
- // src/components/TriggerSettings.tsx
20
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
21
- import React from "react";
22
- import { Input, useTranslation } from "@dxos/react-ui";
23
- import { ControlItemInput } from "@dxos/react-ui-form";
24
- var TriggersSettings = ({ space }) => {
25
- var _effect = _useSignals();
26
- try {
27
- const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
28
- const { t } = useTranslation(meta.id);
29
- return /* @__PURE__ */ React.createElement("div", {
30
- className: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
31
- }, /* @__PURE__ */ React.createElement(ControlItemInput, {
32
- title: t("runtime label"),
33
- description: t("runtime description")
34
- }, /* @__PURE__ */ React.createElement(Input.Switch, {
35
- classNames: "justify-self-end",
36
- checked: isRunning,
37
- onCheckedChange: isRunning ? stop : start
38
- })));
39
- } finally {
40
- _effect.f();
41
- }
42
- };
43
-
44
- // src/components/AutomationSettings.tsx
45
- var AutomationSettings = (props) => {
46
- var _effect = _useSignals2();
47
- try {
48
- const { t } = useTranslation2(meta.id);
49
- return /* @__PURE__ */ React2.createElement(ControlPage, null, /* @__PURE__ */ React2.createElement(ControlSection, {
50
- title: t("automation verbose label", {
51
- ns: meta.id
52
- }),
53
- description: t("automation description", {
54
- ns: meta.id
55
- })
56
- }, /* @__PURE__ */ React2.createElement(AutomationPanel, props), /* @__PURE__ */ React2.createElement(TriggersSettings, {
57
- space: props.space
58
- })));
59
- } finally {
60
- _effect.f();
61
- }
62
- };
63
- var AutomationSettings_default = AutomationSettings;
64
- export {
65
- AutomationSettings,
66
- AutomationSettings_default as default
67
- };
68
- //# sourceMappingURL=AutomationSettings-KCZISXI6.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/AutomationSettings.tsx", "../../../src/components/TriggerSettings.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\nimport { TriggersSettings } from './TriggerSettings';\n\nexport const AutomationSettings = (props: AutomationPanelProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: meta.id })}\n description={t('automation description', { ns: meta.id })}\n >\n <AutomationPanel {...props} />\n <TriggersSettings space={props.space} />\n </ControlSection>\n </ControlPage>\n );\n};\n\nexport default AutomationSettings;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlItemInput } from '@dxos/react-ui-form';\n\nimport { useTriggerRuntimeControls } from '../hooks';\nimport { meta } from '../meta';\n\nexport const TriggersSettings = ({ space }: { space: Space }) => {\n const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);\n const { t } = useTranslation(meta.id);\n\n return (\n <div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>\n <ControlItemInput title={t('runtime label')} description={t('runtime description')}>\n <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />\n </ControlItemInput>\n </div>\n );\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,kBAAAA,uBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;;;;ACH5C,OAAOC,WAAW;AAGlB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,wBAAwB;AAK1B,IAAMC,mBAAmB,CAAC,EAAEC,MAAK,MAAoB;;;AAC1D,UAAM,EAAEC,UAAUC,WAAWC,OAAOC,KAAI,IAAKC,0BAA0BL,KAAAA;AACvE,UAAM,EAAEM,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACC,kBAAAA;MAAiBC,OAAOP,EAAE,eAAA;MAAkBQ,aAAaR,EAAE,qBAAA;OAC1D,sBAAA,cAACS,MAAMC,QAAM;MAACC,YAAW;MAAmBC,SAAShB;MAAWiB,iBAAiBjB,YAAYE,OAAOD;;;;;AAI5G;;;ADVO,IAAMiB,qBAAqB,CAACC,UAAAA;;;AACjC,UAAM,EAAEC,EAAC,IAAKC,gBAAeC,KAAKC,EAAE;AACpC,WACE,gBAAAC,OAAA,cAACC,aAAAA,MACC,gBAAAD,OAAA,cAACE,gBAAAA;MACCC,OAAOP,EAAE,4BAA4B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;MACnDM,aAAaT,EAAE,0BAA0B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;OAEvD,gBAAAC,OAAA,cAACM,iBAAoBX,KAAAA,GACrB,gBAAAK,OAAA,cAACO,kBAAAA;MAAiBC,OAAOb,MAAMa;;;;;AAIvC;AAEA,IAAA,6BAAed;",
6
- "names": ["React", "useTranslation", "ControlPage", "ControlSection", "React", "Input", "useTranslation", "ControlItemInput", "TriggersSettings", "space", "triggers", "isRunning", "start", "stop", "useTriggerRuntimeControls", "t", "useTranslation", "meta", "id", "div", "className", "ControlItemInput", "title", "description", "Input", "Switch", "classNames", "checked", "onCheckedChange", "AutomationSettings", "props", "t", "useTranslation", "meta", "id", "React", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel", "TriggersSettings", "space"]
7
- }