@dxos/plugin-automation 0.8.4-main.d05673bc65 → 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 (381) 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} +181 -183
  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-75XLBFAG.mjs → neutral/FunctionsPanel-L32Z67B7.mjs} +22 -22
  15. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
  16. package/dist/lib/{browser/chunk-FUVAC5EC.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-BWEKRPFJ.mjs → neutral/chunk-RCBE37YU.mjs} +150 -76
  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/types/src/AutomationPlugin.d.ts +1 -0
  71. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  72. package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
  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.map +1 -0
  79. package/dist/types/src/capabilities/index.d.ts +8 -4
  80. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  81. package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
  82. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/node.d.ts +8 -0
  84. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  86. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
  89. package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
  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.map +1 -0
  95. package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
  96. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  97. package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +2 -2
  98. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  99. package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
  100. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  101. package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
  102. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  103. package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +8 -8
  104. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  105. package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
  106. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  107. package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +1 -2
  108. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  109. package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
  110. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  111. package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
  112. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  113. package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +2 -3
  114. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  115. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  116. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  117. package/dist/types/src/commands/trigger/util.d.ts +85 -0
  118. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  119. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  120. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  121. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -32
  122. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  123. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts +18 -0
  124. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts.map +1 -0
  125. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  126. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  127. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  128. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  130. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
  131. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  132. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
  133. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  134. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  135. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  136. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +109 -93
  137. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  138. package/dist/types/src/components/TriggerEditor/util.d.ts +14 -0
  139. package/dist/types/src/components/TriggerEditor/util.d.ts.map +1 -0
  140. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +3 -1
  141. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
  142. package/dist/types/src/containers/AutomationSettings/index.d.ts +1 -2
  143. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -1
  144. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +2 -4
  145. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
  146. package/dist/types/src/containers/FunctionsContainer/index.d.ts +1 -2
  147. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -1
  148. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +3 -3
  149. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
  150. package/dist/types/src/hooks/index.d.ts +1 -1
  151. package/dist/types/src/hooks/index.d.ts.map +1 -1
  152. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts +13 -0
  153. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts.map +1 -0
  154. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
  155. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  156. package/dist/types/src/index.d.ts +0 -3
  157. package/dist/types/src/index.d.ts.map +1 -1
  158. package/dist/types/src/meta.d.ts +1 -1
  159. package/dist/types/src/meta.d.ts.map +1 -1
  160. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  161. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  162. package/dist/types/src/operations/index.d.ts +3 -0
  163. package/dist/types/src/operations/index.d.ts.map +1 -0
  164. package/dist/types/src/plugin.d.ts +4 -0
  165. package/dist/types/src/plugin.d.ts.map +1 -0
  166. package/dist/types/src/testing/test-functions.d.ts +162 -46
  167. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  168. package/dist/types/src/testing.d.ts +2 -0
  169. package/dist/types/src/testing.d.ts.map +1 -0
  170. package/dist/types/src/translations.d.ts +45 -33
  171. package/dist/types/src/translations.d.ts.map +1 -1
  172. package/dist/types/src/types/AutomationOperation.d.ts +21 -0
  173. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  174. package/dist/types/src/types/index.d.ts +1 -2
  175. package/dist/types/src/types/index.d.ts.map +1 -1
  176. package/dist/types/src/types/schema.d.ts +9 -30
  177. package/dist/types/src/types/schema.d.ts.map +1 -1
  178. package/dist/types/tsconfig.tsbuildinfo +1 -1
  179. package/package.json +124 -75
  180. package/src/AutomationPlugin.node.ts +35 -0
  181. package/src/AutomationPlugin.test.ts +27 -0
  182. package/src/AutomationPlugin.tsx +33 -11
  183. package/src/AutomationPlugin.workerd.ts +18 -0
  184. package/src/capabilities/app-graph-builder.ts +66 -0
  185. package/src/capabilities/index.ts +15 -4
  186. package/src/capabilities/layer-specs.ts +197 -0
  187. package/src/capabilities/node.ts +18 -0
  188. package/src/capabilities/operation-handler.ts +16 -0
  189. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +17 -15
  190. package/src/capabilities/registry-sync.ts +110 -0
  191. package/src/capabilities/trigger-runtime-controller.test.ts +103 -0
  192. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  193. package/src/{cli/commands → commands}/trigger/create/queue.ts +14 -16
  194. package/src/{cli/commands → commands}/trigger/create/subscription.ts +8 -11
  195. package/src/{cli/commands → commands}/trigger/create/timer.ts +4 -7
  196. package/src/{cli/commands → commands}/trigger/list.ts +7 -4
  197. package/src/{cli/commands → commands}/trigger/options.ts +3 -15
  198. package/src/{cli/commands → commands}/trigger/remove.ts +5 -5
  199. package/src/{cli/commands → commands}/trigger/update/queue.ts +39 -43
  200. package/src/{cli/commands → commands}/trigger/update/subscription.ts +22 -21
  201. package/src/{cli/commands → commands}/trigger/update/timer.ts +22 -20
  202. package/src/{cli/commands → commands}/trigger/util.ts +36 -30
  203. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +12 -5
  204. package/src/components/AutomationPanel/AutomationPanel.tsx +119 -56
  205. package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
  206. package/src/components/FunctionsPanel/FunctionsPanel.tsx +33 -25
  207. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +32 -23
  208. package/src/components/TriggerEditor/FunctionInputEditor.tsx +9 -13
  209. package/src/components/TriggerEditor/SpecSelector.tsx +18 -14
  210. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +36 -18
  211. package/src/components/TriggerEditor/TriggerEditor.tsx +109 -31
  212. package/src/components/TriggerEditor/util.ts +51 -0
  213. package/src/containers/AutomationSettings/AutomationSettings.tsx +11 -7
  214. package/src/containers/AutomationSettings/index.ts +1 -3
  215. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +11 -11
  216. package/src/containers/FunctionsContainer/index.ts +1 -3
  217. package/src/containers/TriggerSettings/TriggerSettings.tsx +32 -10
  218. package/src/hooks/index.ts +2 -1
  219. package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
  220. package/src/hooks/useTriggerRuntimeControls.ts +13 -8
  221. package/src/index.ts +0 -4
  222. package/src/meta.ts +27 -7
  223. package/src/operations/create-trigger-from-template.ts +70 -0
  224. package/src/operations/index.ts +7 -0
  225. package/src/plugin.ts +11 -0
  226. package/src/testing/test-functions.ts +38 -4
  227. package/src/testing.ts +7 -0
  228. package/src/translations.ts +52 -39
  229. package/src/types/AutomationOperation.ts +39 -0
  230. package/src/types/index.ts +2 -2
  231. package/src/types/schema.ts +3 -24
  232. package/src/vite-env.d.ts +10 -0
  233. package/dist/lib/browser/AutomationPanel-IGLIQY2N.mjs +0 -11
  234. package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs +0 -37
  235. package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs.map +0 -7
  236. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +0 -43
  237. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +0 -7
  238. package/dist/lib/browser/FunctionsPanel-NMA4RYJL.mjs +0 -10
  239. package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +0 -10
  240. package/dist/lib/browser/TriggerSettings-56AIMOEC.mjs +0 -11
  241. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs +0 -83
  242. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +0 -7
  243. package/dist/lib/browser/chunk-75XLBFAG.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-BWEKRPFJ.mjs.map +0 -7
  245. package/dist/lib/browser/chunk-EL64ZPPN.mjs +0 -17
  246. package/dist/lib/browser/chunk-EL64ZPPN.mjs.map +0 -7
  247. package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-GVHAETEQ.mjs +0 -83
  249. package/dist/lib/browser/chunk-GVHAETEQ.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-H2MV4XE6.mjs +0 -31
  251. package/dist/lib/browser/chunk-H2MV4XE6.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-O23LHDEX.mjs +0 -269
  253. package/dist/lib/browser/chunk-O23LHDEX.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-OAZ2JYXV.mjs +0 -93
  255. package/dist/lib/browser/chunk-OAZ2JYXV.mjs.map +0 -7
  256. package/dist/lib/browser/chunk-Z7F7X2C5.mjs +0 -8
  257. package/dist/lib/browser/chunk-Z7F7X2C5.mjs.map +0 -7
  258. package/dist/lib/browser/cli/index.mjs.map +0 -7
  259. package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs +0 -124
  260. package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs.map +0 -7
  261. package/dist/lib/browser/hooks/index.mjs +0 -13
  262. package/dist/lib/browser/index.mjs +0 -123
  263. package/dist/lib/browser/index.mjs.map +0 -7
  264. package/dist/lib/browser/meta.json +0 -1
  265. package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs +0 -84
  266. package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs.map +0 -7
  267. package/dist/lib/browser/react-surface-5MFPVWIN.mjs +0 -65
  268. package/dist/lib/browser/react-surface-5MFPVWIN.mjs.map +0 -7
  269. package/dist/lib/browser/types/index.mjs +0 -14
  270. package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs +0 -12
  271. package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs +0 -38
  272. package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs.map +0 -7
  273. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +0 -44
  274. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +0 -7
  275. package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs +0 -11
  276. package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +0 -11
  277. package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs +0 -12
  278. package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs.map +0 -7
  279. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs +0 -84
  280. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +0 -7
  281. package/dist/lib/node-esm/chunk-2UF55HSG.mjs +0 -94
  282. package/dist/lib/node-esm/chunk-2UF55HSG.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-6B4WZRVH.mjs +0 -84
  284. package/dist/lib/node-esm/chunk-6B4WZRVH.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs +0 -97
  286. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs +0 -270
  288. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs.map +0 -7
  289. package/dist/lib/node-esm/chunk-JVUE5PMI.mjs +0 -32
  290. package/dist/lib/node-esm/chunk-JVUE5PMI.mjs.map +0 -7
  291. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs +0 -98
  292. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +0 -7
  293. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs +0 -295
  294. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs.map +0 -7
  295. package/dist/lib/node-esm/chunk-R5YEWJCG.mjs +0 -10
  296. package/dist/lib/node-esm/chunk-R5YEWJCG.mjs.map +0 -7
  297. package/dist/lib/node-esm/chunk-WC5AT7B3.mjs +0 -19
  298. package/dist/lib/node-esm/chunk-WC5AT7B3.mjs.map +0 -7
  299. package/dist/lib/node-esm/cli/index.mjs +0 -1116
  300. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  301. package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs +0 -125
  302. package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs.map +0 -7
  303. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  304. package/dist/lib/node-esm/index.mjs +0 -124
  305. package/dist/lib/node-esm/index.mjs.map +0 -7
  306. package/dist/lib/node-esm/meta.json +0 -1
  307. package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs +0 -85
  308. package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs.map +0 -7
  309. package/dist/lib/node-esm/react-surface-Z74AHU4T.mjs +0 -66
  310. package/dist/lib/node-esm/react-surface-Z74AHU4T.mjs.map +0 -7
  311. package/dist/lib/node-esm/types/index.mjs +0 -15
  312. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  313. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  314. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  315. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  316. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  317. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  318. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  319. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  320. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  321. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  322. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  323. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  324. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  325. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  326. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  327. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
  328. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
  329. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
  330. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
  331. package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
  332. package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
  333. package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
  334. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
  335. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
  336. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
  337. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
  338. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
  339. package/dist/types/src/cli/commands/trigger/util.d.ts +0 -46
  340. package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
  341. package/dist/types/src/cli/index.d.ts +0 -2
  342. package/dist/types/src/cli/index.d.ts.map +0 -1
  343. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  344. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  345. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  346. package/dist/types/src/types/capabilities.d.ts +0 -22
  347. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  348. package/dist/types/src/types/events.d.ts +0 -5
  349. package/dist/types/src/types/events.d.ts.map +0 -1
  350. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -73
  351. package/src/capabilities/app-graph-builder/index.ts +0 -7
  352. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -146
  353. package/src/capabilities/compute-runtime/index.ts +0 -7
  354. package/src/capabilities/operation-resolver/index.ts +0 -7
  355. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
  356. package/src/capabilities/react-surface/index.ts +0 -7
  357. package/src/cli/index.ts +0 -5
  358. package/src/cli/plugin.ts +0 -24
  359. package/src/hooks/useComputeRuntimeCallback.ts +0 -67
  360. package/src/types/capabilities.ts +0 -43
  361. package/src/types/events.ts +0 -11
  362. /package/dist/lib/{browser/AutomationPanel-IGLIQY2N.mjs.map → neutral/AutomationPanel-OKF2MDLO.mjs.map} +0 -0
  363. /package/dist/lib/{browser/FunctionsPanel-NMA4RYJL.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  364. /package/dist/lib/{browser/FunctionsRegistry-TMKAEG5E.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  365. /package/dist/lib/{browser/TriggerSettings-56AIMOEC.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  366. /package/dist/lib/{browser/hooks → neutral/components}/index.mjs.map +0 -0
  367. /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
  368. /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
  369. /package/dist/lib/{node-esm/AutomationPanel-O2BCQA7P.mjs.map → neutral/meta.mjs.map} +0 -0
  370. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  371. /package/dist/lib/{node-esm/FunctionsPanel-DCXXLSVP.mjs.map → neutral/testing.mjs.map} +0 -0
  372. /package/dist/lib/{node-esm/FunctionsRegistry-7WCHC64E.mjs.map → neutral/types/index.mjs.map} +0 -0
  373. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  374. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  375. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  376. /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
  377. /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
  378. /package/src/{cli/commands → commands}/index.ts +0 -0
  379. /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
  380. /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
  381. /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
@@ -1,25 +1,20 @@
1
- import {
2
- ComputeRuntime
3
- } from "../chunk-Z7F7X2C5.mjs";
4
- import {
5
- AutomationEvents
6
- } from "../chunk-GVHAETEQ.mjs";
7
- import {
8
- meta
9
- } from "../chunk-EL64ZPPN.mjs";
1
+ import "./chunk-J5LGTIGS.mjs";
10
2
 
11
- // src/cli/plugin.ts
12
- import { Plugin } from "@dxos/app-framework";
3
+ // src/AutomationPlugin.node.ts
4
+ import { ActivationEvent, ActivationEvents, Plugin } from "@dxos/app-framework";
13
5
  import { AppPlugin } from "@dxos/app-toolkit";
14
- import { ClientEvents } from "@dxos/plugin-client/types";
6
+ import { Operation as Operation8, Trace, Trigger as Trigger10 } from "@dxos/compute";
7
+ import { ClientEvents } from "@dxos/plugin-client";
8
+ import { AppGraphBuilder, LayerSpecs, OperationHandler, RegistrySync, TriggerRuntimeController } from "#capabilities";
9
+ import { meta } from "#meta";
15
10
 
16
- // src/cli/commands/trigger/index.ts
11
+ // src/commands/trigger/index.ts
17
12
  import * as Command11 from "@effect/cli/Command";
18
13
 
19
- // src/cli/commands/trigger/create/index.ts
14
+ // src/commands/trigger/create/index.ts
20
15
  import * as Command4 from "@effect/cli/Command";
21
16
 
22
- // src/cli/commands/trigger/create/queue.ts
17
+ // src/commands/trigger/create/queue.ts
23
18
  import * as Command from "@effect/cli/Command";
24
19
  import * as Options2 from "@effect/cli/Options";
25
20
  import * as Prompt2 from "@effect/cli/Prompt";
@@ -30,13 +25,12 @@ import * as Option2 from "effect/Option";
30
25
  import { CommandConfig } from "@dxos/cli-util";
31
26
  import { flushAndSync, print, spaceLayer, withTypes } from "@dxos/cli-util";
32
27
  import { Common } from "@dxos/cli-util";
33
- import { Database as Database2, Filter as Filter2, JsonSchema, Ref as Ref2 } from "@dxos/echo";
34
- import { Function as Function2, Trigger as Trigger2 } from "@dxos/functions";
28
+ import { Operation as Operation2, Trigger as Trigger2 } from "@dxos/compute";
29
+ import { Database as Database2, Feed as FeedNs, Filter as Filter2, JsonSchema, Ref as Ref2 } from "@dxos/echo";
30
+ import { EID } from "@dxos/keys";
35
31
 
36
- // src/cli/commands/trigger/options.ts
32
+ // src/commands/trigger/options.ts
37
33
  import * as Options from "@effect/cli/Options";
38
- import * as Schema from "effect/Schema";
39
- import { DXN } from "@dxos/keys";
40
34
  var TriggerId = Options.text("id").pipe(Options.withDescription("The id of the trigger."));
41
35
  var Enabled = Options.boolean("enabled", {
42
36
  ifPresent: true
@@ -48,13 +42,9 @@ var Deep = Options.boolean("deep", {
48
42
  }).pipe(Options.withDescription("Watch changes to nested properties (not just creation)."));
49
43
  var Delay = Options.integer("delay").pipe(Options.withDescription("Debounce changes with a delay in milliseconds."));
50
44
  var Cron = Options.text("cron").pipe(Options.withDescription("The cron expression to use for the timer trigger."));
51
- var DXNSchema = Schema.String.pipe(Schema.transform(Schema.instanceOf(DXN), {
52
- decode: (value2) => DXN.parse(value2),
53
- encode: (value2) => value2.toString()
54
- }));
55
- var Queue = Options.text("queue").pipe(Options.withDescription("The DXN of the queue for the queue trigger."), Options.withSchema(DXNSchema));
45
+ var Feed = Options.text("feed").pipe(Options.withDescription("The EID of the feed for the feed trigger (echo://<spaceId>/<objectId>)."));
56
46
 
57
- // src/cli/commands/trigger/util.ts
47
+ // src/commands/trigger/util.ts
58
48
  import * as Prompt from "@effect/cli/Prompt";
59
49
  import * as Ansi from "@effect/printer-ansi/Ansi";
60
50
  import * as Console from "effect/Console";
@@ -63,9 +53,9 @@ import * as Match from "effect/Match";
63
53
  import * as Option from "effect/Option";
64
54
  import * as SchemaAST from "effect/SchemaAST";
65
55
  import { FormBuilder } from "@dxos/cli-util";
66
- import { Annotation, Database, Entity, Feed, Filter, Obj, Ref, Type } from "@dxos/echo";
56
+ import { Operation, Trigger } from "@dxos/compute";
57
+ import { Annotation, Database, Entity, Feed as Feed2, Filter, Obj, Query, Ref, Scope, Type } from "@dxos/echo";
67
58
  import { getProperties } from "@dxos/effect";
68
- import { Function, Trigger } from "@dxos/functions";
69
59
  import { FeedAnnotation } from "@dxos/schema";
70
60
  var getTriggerRemoteStatus = (trigger2, remoteCronIds) => {
71
61
  if (trigger2.spec?.kind !== "timer") {
@@ -77,7 +67,7 @@ var printTrigger = Effect.fn(function* (trigger2, remoteStatus) {
77
67
  const fn6 = trigger2.function && (yield* Database.load(trigger2.function));
78
68
  return FormBuilder.make({
79
69
  title: trigger2.id
80
- }).pipe(FormBuilder.set("status", trigger2.enabled ? "enabled" : "disabled", trigger2.enabled ? Ansi.green : Ansi.blackBright), FormBuilder.option("kind", Option.fromNullable(trigger2.spec?.kind)), FormBuilder.option("remote", Option.fromNullable(remoteStatus), Match.type().pipe(Match.withReturnType(), Match.when("available", () => Ansi.green), Match.when("not available", () => Ansi.yellow), Match.when("n/a", () => Ansi.blackBright), Match.exhaustive)), FormBuilder.when(fn6, FormBuilder.nest("function", FormBuilder.make().pipe(FormBuilder.set("key", fn6.key), FormBuilder.set("dxn", fn6.dxn?.toString())))), FormBuilder.nestedOption("spec", Option.fromNullable(trigger2.spec).pipe(Option.map(printSpec))), FormBuilder.build);
70
+ }).pipe(FormBuilder.set("status", trigger2.enabled ? "enabled" : "disabled", trigger2.enabled ? Ansi.green : Ansi.blackBright), FormBuilder.option("kind", Option.fromNullable(trigger2.spec?.kind)), FormBuilder.option("remote", Option.fromNullable(remoteStatus), Match.type().pipe(Match.withReturnType(), Match.when("available", () => Ansi.green), Match.when("not available", () => Ansi.yellow), Match.when("n/a", () => Ansi.blackBright), Match.exhaustive)), FormBuilder.when(fn6, FormBuilder.nest("function", FormBuilder.make().pipe(FormBuilder.set("key", Obj.getMeta(fn6).key), FormBuilder.set("dxn", Obj.getURI(fn6))))), FormBuilder.nestedOption("spec", Option.fromNullable(trigger2.spec).pipe(Option.map(printSpec))), FormBuilder.build);
81
71
  });
82
72
  var printSpec = (spec) => {
83
73
  switch (spec.kind) {
@@ -87,8 +77,8 @@ var printSpec = (spec) => {
87
77
  return printSubscription(spec);
88
78
  case "webhook":
89
79
  return printWebhook(spec);
90
- case "queue":
91
- return printQueue(spec);
80
+ case "feed":
81
+ return printFeed(spec);
92
82
  default:
93
83
  return FormBuilder.make({}).pipe(FormBuilder.set("unknown", "Unknown spec type"));
94
84
  }
@@ -96,7 +86,7 @@ var printSpec = (spec) => {
96
86
  var printTimer = (spec) => FormBuilder.make({}).pipe(FormBuilder.set("cron", spec.cron));
97
87
  var printSubscription = (spec) => FormBuilder.make({}).pipe(FormBuilder.set("query", spec.query?.raw ?? "[Query AST]"));
98
88
  var printWebhook = (spec) => FormBuilder.make({}).pipe(FormBuilder.set("method", spec.method), FormBuilder.set("port", spec.port));
99
- var printQueue = (spec) => FormBuilder.make({}).pipe(FormBuilder.set("queue", spec.queue));
89
+ var printFeed = (spec) => FormBuilder.make({}).pipe(FormBuilder.set("feed", spec.feed ? spec.feed.uri.toString() : "(none)"));
100
90
  var promptForSchemaInput = Effect.fn(function* (schema, defaults) {
101
91
  if (!schema) {
102
92
  return {};
@@ -229,7 +219,7 @@ var promptForSchemaInput = Effect.fn(function* (schema, defaults) {
229
219
  return inputObj;
230
220
  });
231
221
  var selectFunction = Effect.fn(function* () {
232
- const functions = yield* Database.runQuery(Filter.type(Function.Function));
222
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
233
223
  if (functions.length === 0) {
234
224
  return yield* Effect.fail(new Error("No functions available"));
235
225
  }
@@ -244,14 +234,14 @@ var selectFunction = Effect.fn(function* () {
244
234
  return String(selected);
245
235
  });
246
236
  var selectTrigger = Effect.fn(function* (kind) {
247
- const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
237
+ const triggers = yield* Database.runQuery(Query.select(Filter.type(Trigger.Trigger)).debugLabel("cli.trigger.selectTrigger"));
248
238
  const filteredTriggers = kind ? triggers.filter((trigger2) => trigger2.spec?.kind === kind) : triggers;
249
239
  if (filteredTriggers.length === 0) {
250
240
  return yield* Effect.fail(new Error(kind ? `No ${kind} triggers available` : "No triggers available"));
251
241
  }
252
242
  const choices = yield* Effect.all(filteredTriggers.map((trigger2) => Effect.gen(function* () {
253
243
  const fn6 = trigger2.function ? yield* Database.load(trigger2.function) : void 0;
254
- const functionName = fn6 && Obj.instanceOf(Function.Function, fn6) ? fn6.name ?? fn6.key ?? fn6.id : void 0;
244
+ const functionName = fn6 && Obj.instanceOf(Operation.PersistentOperation, fn6) ? fn6.name ?? Obj.getMeta(fn6).key ?? fn6.id : void 0;
255
245
  const title = functionName ?? trigger2.id;
256
246
  const description = `${trigger2.enabled ? "enabled" : "disabled"} - ${trigger2.spec?.kind ?? "unknown"}`;
257
247
  return {
@@ -266,21 +256,17 @@ var selectTrigger = Effect.fn(function* (kind) {
266
256
  });
267
257
  return String(selected);
268
258
  });
269
- var selectQueue = Effect.fn(function* () {
270
- const schemas = yield* Database.runSchemaQuery({
271
- location: [
272
- "database",
273
- "runtime"
274
- ]
275
- });
276
- const feedSchemas = schemas.filter((schema) => {
259
+ var selectFeed = Effect.fn(function* () {
260
+ const schemas = yield* Database.runQuery(Query.select(Filter.type(Type.Type)).from(Scope.space(), Scope.registry()));
261
+ const feedSchemas = schemas.filter((type2) => {
262
+ const schema = Type.getSchema(type2);
277
263
  const annotation = FeedAnnotation.get(schema);
278
264
  return Option.isSome(annotation) && annotation.value === true;
279
265
  });
280
266
  if (feedSchemas.length === 0) {
281
267
  return yield* Effect.fail(new Error("No schemas with Feed annotation found"));
282
268
  }
283
- const queueChoices = [];
269
+ const feedChoices = [];
284
270
  for (const schema of feedSchemas) {
285
271
  yield* Effect.gen(function* () {
286
272
  const typename = Type.getTypename(schema);
@@ -291,42 +277,38 @@ var selectQueue = Effect.fn(function* () {
291
277
  continue;
292
278
  }
293
279
  const feedObj = yield* Effect.promise(() => feedRef.tryLoad());
294
- if (!feedObj || !Obj.instanceOf(Feed.Feed, feedObj)) {
295
- continue;
296
- }
297
- const queueDxn = Feed.getQueueDxn(feedObj);
298
- if (!queueDxn) {
280
+ if (!feedObj || !Obj.instanceOf(Feed2.Feed, feedObj)) {
299
281
  continue;
300
282
  }
301
283
  const label = Obj.getLabel(obj) ?? obj.id;
302
284
  const description = Obj.getTypename(obj);
303
- queueChoices.push({
285
+ feedChoices.push({
304
286
  title: label,
305
- value: queueDxn.toString(),
287
+ value: feedObj,
306
288
  description
307
289
  });
308
290
  }
309
291
  }).pipe(Effect.catchAll(() => Effect.void));
310
292
  }
311
- if (queueChoices.length === 0) {
312
- return yield* Effect.fail(new Error("No objects with queue properties found"));
293
+ if (feedChoices.length === 0) {
294
+ return yield* Effect.fail(new Error("No objects with feed properties found"));
313
295
  }
314
296
  const selected = yield* Prompt.select({
315
- message: "Select a queue:",
316
- choices: queueChoices
297
+ message: "Select a feed:",
298
+ choices: feedChoices
317
299
  });
318
- return String(selected);
300
+ return selected;
319
301
  });
320
302
  var printTriggerRemoved = (id) => FormBuilder.make({
321
303
  title: "Trigger removed"
322
304
  }).pipe(FormBuilder.set("id", id), FormBuilder.build);
323
305
 
324
- // src/cli/commands/trigger/create/queue.ts
325
- var queue = Command.make("queue", {
306
+ // src/commands/trigger/create/queue.ts
307
+ var queue = Command.make("feed", {
326
308
  spaceId: Common.spaceId.pipe(Options2.optional),
327
309
  enabled: Enabled,
328
310
  functionId: Common.functionId.pipe(Options2.optional),
329
- queue: Queue.pipe(Options2.optional),
311
+ feed: Feed.pipe(Options2.optional),
330
312
  input: Input.pipe(Options2.optional)
331
313
  }, (options) => Effect2.gen(function* () {
332
314
  const { json } = yield* CommandConfig;
@@ -334,14 +316,14 @@ var queue = Command.make("queue", {
334
316
  onNone: () => selectFunction(),
335
317
  onSome: (id) => Effect2.succeed(id)
336
318
  });
337
- const functions = yield* Database2.runQuery(Filter2.type(Function2.Function));
319
+ const functions = yield* Database2.runQuery(Filter2.type(Operation2.PersistentOperation));
338
320
  const fn6 = functions.find((fn7) => fn7.id === functionId);
339
321
  if (!fn6) {
340
322
  return yield* Effect2.fail(new Error(`Function not found: ${functionId}`));
341
323
  }
342
- const queueDxn = yield* Option2.match(options.queue, {
343
- onNone: () => selectQueue(),
344
- onSome: (dxn) => Effect2.succeed(dxn.toString())
324
+ const feed = yield* Option2.match(options.feed, {
325
+ onNone: () => selectFeed(),
326
+ onSome: (uri) => Database2.resolve(EID.parse(uri), FeedNs.Feed)
345
327
  });
346
328
  const input = yield* Option2.match(options.input, {
347
329
  onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema.toEffectSchema(fn6.inputSchema) : void 0),
@@ -357,10 +339,7 @@ var queue = Command.make("queue", {
357
339
  const trigger2 = Trigger2.make({
358
340
  function: Ref2.make(fn6),
359
341
  enabled,
360
- spec: {
361
- kind: "queue",
362
- queue: queueDxn
363
- },
342
+ spec: Trigger2.specFeed(feed),
364
343
  input
365
344
  });
366
345
  yield* Database2.add(trigger2);
@@ -372,9 +351,9 @@ var queue = Command.make("queue", {
372
351
  yield* flushAndSync({
373
352
  indexes: true
374
353
  });
375
- })).pipe(Command.withDescription("Create a queue trigger."), Command.provide(({ spaceId }) => spaceLayer(spaceId, true)), Command.provideEffectDiscard(() => withTypes(Function2.Function, Trigger2.Trigger)));
354
+ })).pipe(Command.withDescription("Create a feed trigger."), Command.provide(({ spaceId }) => spaceLayer(spaceId, true)), Command.provideEffectDiscard(() => withTypes(Operation2.PersistentOperation, Trigger2.Trigger)));
376
355
 
377
- // src/cli/commands/trigger/create/subscription.ts
356
+ // src/commands/trigger/create/subscription.ts
378
357
  import * as Command2 from "@effect/cli/Command";
379
358
  import * as Options3 from "@effect/cli/Options";
380
359
  import * as Prompt3 from "@effect/cli/Prompt";
@@ -385,8 +364,8 @@ import * as Option3 from "effect/Option";
385
364
  import { CommandConfig as CommandConfig2 } from "@dxos/cli-util";
386
365
  import { flushAndSync as flushAndSync2, print as print2, spaceLayer as spaceLayer2, withTypes as withTypes2 } from "@dxos/cli-util";
387
366
  import { Common as Common2 } from "@dxos/cli-util";
388
- import { Database as Database3, Filter as Filter3, JsonSchema as JsonSchema2, Query, Ref as Ref3 } from "@dxos/echo";
389
- import { Function as Function3, Trigger as Trigger3 } from "@dxos/functions";
367
+ import { Operation as Operation3, Trigger as Trigger3 } from "@dxos/compute";
368
+ import { Database as Database3, Filter as Filter3, JsonSchema as JsonSchema2, Query as Query2, Ref as Ref3 } from "@dxos/echo";
390
369
  var subscription = Command2.make("subscription", {
391
370
  spaceId: Common2.spaceId.pipe(Options3.optional),
392
371
  enabled: Enabled,
@@ -401,7 +380,7 @@ var subscription = Command2.make("subscription", {
401
380
  onNone: () => selectFunction(),
402
381
  onSome: (id) => Effect3.succeed(id)
403
382
  });
404
- const functions = yield* Database3.runQuery(Filter3.type(Function3.Function));
383
+ const functions = yield* Database3.runQuery(Filter3.type(Operation3.PersistentOperation));
405
384
  const fn6 = functions.find((fn7) => fn7.id === functionId);
406
385
  if (!fn6) {
407
386
  return yield* Effect3.fail(new Error(`Function not found: ${functionId}`));
@@ -412,7 +391,7 @@ var subscription = Command2.make("subscription", {
412
391
  }).pipe(Prompt3.run),
413
392
  onSome: (value2) => Effect3.succeed(value2)
414
393
  });
415
- const queryAst = Query.select(Filter3.type(typename)).ast;
394
+ const subscriptionQuery = Query2.select(Filter3.type(typename));
416
395
  const deepOption = yield* Option3.match(options.deep, {
417
396
  onNone: () => Prompt3.confirm({
418
397
  message: "Watch changes to nested properties (deep)?",
@@ -450,13 +429,7 @@ var subscription = Command2.make("subscription", {
450
429
  const trigger2 = Trigger3.make({
451
430
  function: Ref3.make(fn6),
452
431
  enabled,
453
- spec: {
454
- kind: "subscription",
455
- query: {
456
- ast: queryAst
457
- },
458
- options: Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : void 0
459
- },
432
+ spec: Trigger3.specSubscription(subscriptionQuery, Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : void 0),
460
433
  input
461
434
  });
462
435
  yield* Database3.add(trigger2);
@@ -468,9 +441,9 @@ var subscription = Command2.make("subscription", {
468
441
  yield* flushAndSync2({
469
442
  indexes: true
470
443
  });
471
- })).pipe(Command2.withDescription("Create a subscription trigger."), Command2.provide(({ spaceId }) => spaceLayer2(spaceId, true)), Command2.provideEffectDiscard(() => withTypes2(Function3.Function, Trigger3.Trigger)));
444
+ })).pipe(Command2.withDescription("Create a subscription trigger."), Command2.provide(({ spaceId }) => spaceLayer2(spaceId, true)), Command2.provideEffectDiscard(() => withTypes2(Operation3.PersistentOperation, Trigger3.Trigger)));
472
445
 
473
- // src/cli/commands/trigger/create/timer.ts
446
+ // src/commands/trigger/create/timer.ts
474
447
  import * as Command3 from "@effect/cli/Command";
475
448
  import * as Options4 from "@effect/cli/Options";
476
449
  import * as Prompt4 from "@effect/cli/Prompt";
@@ -481,8 +454,8 @@ import * as Option4 from "effect/Option";
481
454
  import { CommandConfig as CommandConfig3 } from "@dxos/cli-util";
482
455
  import { flushAndSync as flushAndSync3, print as print3, spaceLayer as spaceLayer3, withTypes as withTypes3 } from "@dxos/cli-util";
483
456
  import { Common as Common3 } from "@dxos/cli-util";
457
+ import { Operation as Operation4, Trigger as Trigger4 } from "@dxos/compute";
484
458
  import { Database as Database4, Filter as Filter4, JsonSchema as JsonSchema3, Ref as Ref4 } from "@dxos/echo";
485
- import { Function as Function4, Trigger as Trigger4 } from "@dxos/functions";
486
459
  var timer = Command3.make("timer", {
487
460
  spaceId: Common3.spaceId.pipe(Options4.optional),
488
461
  enabled: Enabled,
@@ -495,7 +468,7 @@ var timer = Command3.make("timer", {
495
468
  onNone: () => selectFunction(),
496
469
  onSome: (id) => Effect4.succeed(id)
497
470
  });
498
- const functions = yield* Database4.runQuery(Filter4.type(Function4.Function));
471
+ const functions = yield* Database4.runQuery(Filter4.type(Operation4.PersistentOperation));
499
472
  const fn6 = functions.find((fn7) => fn7.id === functionId);
500
473
  if (!fn6) {
501
474
  return yield* Effect4.fail(new Error(`Function not found: ${functionId}`));
@@ -520,10 +493,7 @@ var timer = Command3.make("timer", {
520
493
  const trigger2 = Trigger4.make({
521
494
  function: Ref4.make(fn6),
522
495
  enabled,
523
- spec: {
524
- kind: "timer",
525
- cron
526
- },
496
+ spec: Trigger4.specTimer(cron),
527
497
  input
528
498
  });
529
499
  yield* Database4.add(trigger2);
@@ -535,33 +505,35 @@ var timer = Command3.make("timer", {
535
505
  yield* flushAndSync3({
536
506
  indexes: true
537
507
  });
538
- })).pipe(Command3.withDescription("Create a timer trigger."), Command3.provide(({ spaceId }) => spaceLayer3(spaceId, true)), Command3.provideEffectDiscard(() => withTypes3(Function4.Function, Trigger4.Trigger)));
508
+ })).pipe(Command3.withDescription("Create a timer trigger."), Command3.provide(({ spaceId }) => spaceLayer3(spaceId, true)), Command3.provideEffectDiscard(() => withTypes3(Operation4.PersistentOperation, Trigger4.Trigger)));
539
509
 
540
- // src/cli/commands/trigger/create/index.ts
510
+ // src/commands/trigger/create/index.ts
541
511
  var create = Command4.make("create").pipe(Command4.withDescription("Create a trigger."), Command4.withSubcommands([
542
512
  subscription,
543
513
  timer,
544
514
  queue
545
515
  ]));
546
516
 
547
- // src/cli/commands/trigger/list.ts
517
+ // src/commands/trigger/list.ts
548
518
  import * as Command5 from "@effect/cli/Command";
549
519
  import * as Options5 from "@effect/cli/Options";
550
520
  import * as Console5 from "effect/Console";
551
521
  import * as Effect5 from "effect/Effect";
552
522
  import { CommandConfig as CommandConfig4, Common as Common4, printList, spaceIdWithDefault, spaceLayer as spaceLayer4 } from "@dxos/cli-util";
553
523
  import { ClientService } from "@dxos/client";
554
- import { Database as Database5, Filter as Filter5 } from "@dxos/echo";
555
- import { Trigger as Trigger5 } from "@dxos/functions";
524
+ import { Trigger as Trigger5 } from "@dxos/compute";
525
+ import { Context } from "@dxos/context";
526
+ import { Database as Database5, Filter as Filter5, Query as Query3 } from "@dxos/echo";
527
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/commands/trigger/list.ts";
556
528
  var list = Command5.make("list", {
557
529
  spaceId: Common4.spaceId.pipe(Options5.optional)
558
530
  }, Effect5.fn(function* ({ spaceId: spaceIdOption }) {
559
531
  const { json } = yield* CommandConfig4;
560
- const triggers = yield* Database5.runQuery(Filter5.type(Trigger5.Trigger));
532
+ const triggers = yield* Database5.runQuery(Query3.select(Filter5.type(Trigger5.Trigger)).debugLabel("cli.trigger.list"));
561
533
  const remoteCronIds = yield* Effect5.gen(function* () {
562
534
  const client = yield* ClientService;
563
535
  const spaceId = yield* spaceIdWithDefault(spaceIdOption);
564
- const result = yield* Effect5.promise(() => client.edge.http.getCronTriggers(spaceId)).pipe(Effect5.catchAll(() => Effect5.succeed({
536
+ const result = yield* Effect5.promise(() => client.edge.http.getCronTriggers(Context.default(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 24 }), spaceId)).pipe(Effect5.catchAll(() => Effect5.succeed({
565
537
  cronIds: []
566
538
  })));
567
539
  return result.cronIds;
@@ -585,16 +557,16 @@ var list = Command5.make("list", {
585
557
  }
586
558
  })).pipe(Command5.withDescription("List triggers configured on EDGE."), Command5.provide(({ spaceId }) => spaceLayer4(spaceId, true)));
587
559
 
588
- // src/cli/commands/trigger/remove.ts
560
+ // src/commands/trigger/remove.ts
589
561
  import * as Command6 from "@effect/cli/Command";
590
562
  import * as Options6 from "@effect/cli/Options";
591
563
  import * as Console6 from "effect/Console";
592
564
  import * as Effect6 from "effect/Effect";
593
565
  import * as Option5 from "effect/Option";
594
566
  import { CommandConfig as CommandConfig5, Common as Common5, print as print4, spaceLayer as spaceLayer5, withTypes as withTypes4 } from "@dxos/cli-util";
595
- import { DXN as DXN2 } from "@dxos/echo";
596
- import { Database as Database6 } from "@dxos/echo";
597
- import { Trigger as Trigger6 } from "@dxos/functions";
567
+ import { Trigger as Trigger6 } from "@dxos/compute";
568
+ import { Database as Database6, Ref as Ref5 } from "@dxos/echo";
569
+ import { EID as EID2 } from "@dxos/keys";
598
570
  var remove = Command6.make("remove", {
599
571
  spaceId: Common5.spaceId.pipe(Options6.optional),
600
572
  id: TriggerId.pipe(Options6.optional)
@@ -604,8 +576,10 @@ var remove = Command6.make("remove", {
604
576
  onNone: () => selectTrigger(),
605
577
  onSome: (id) => Effect6.succeed(id)
606
578
  });
607
- const dxn = DXN2.fromLocalObjectId(triggerId);
608
- const trigger2 = yield* Database6.resolve(dxn, Trigger6.Trigger);
579
+ const dxn = EID2.make({
580
+ entityId: triggerId
581
+ });
582
+ const trigger2 = yield* Database6.resolve(Ref5.fromURI(dxn), Trigger6.Trigger);
609
583
  yield* Database6.remove(trigger2);
610
584
  if (json) {
611
585
  yield* Console6.log(JSON.stringify({
@@ -617,10 +591,10 @@ var remove = Command6.make("remove", {
617
591
  }
618
592
  })).pipe(Command6.withDescription("Remove a trigger."), Command6.provide(({ spaceId }) => spaceLayer5(spaceId, true)), Command6.provideEffectDiscard(() => withTypes4(Trigger6.Trigger)));
619
593
 
620
- // src/cli/commands/trigger/update/index.ts
594
+ // src/commands/trigger/update/index.ts
621
595
  import * as Command10 from "@effect/cli/Command";
622
596
 
623
- // src/cli/commands/trigger/update/queue.ts
597
+ // src/commands/trigger/update/queue.ts
624
598
  import * as Command7 from "@effect/cli/Command";
625
599
  import * as Options7 from "@effect/cli/Options";
626
600
  import * as Prompt5 from "@effect/cli/Prompt";
@@ -630,28 +604,31 @@ import * as Option6 from "effect/Option";
630
604
  import { CommandConfig as CommandConfig6 } from "@dxos/cli-util";
631
605
  import { flushAndSync as flushAndSync4, print as print5, spaceLayer as spaceLayer6, withTypes as withTypes5 } from "@dxos/cli-util";
632
606
  import { Common as Common6 } from "@dxos/cli-util";
633
- import { DXN as DXN3, Database as Database7, Filter as Filter6, JsonSchema as JsonSchema4, Obj as Obj2, Ref as Ref5 } from "@dxos/echo";
634
- import { Function as Function5, Trigger as Trigger7 } from "@dxos/functions";
635
- var queue2 = Command7.make("queue", {
607
+ import { Operation as Operation5, Trigger as Trigger7 } from "@dxos/compute";
608
+ import { Database as Database7, Feed as FeedNs2, Filter as Filter6, JsonSchema as JsonSchema4, Obj as Obj2, Ref as Ref6 } from "@dxos/echo";
609
+ import { EID as EID3 } from "@dxos/keys";
610
+ var queue2 = Command7.make("feed", {
636
611
  spaceId: Common6.spaceId.pipe(Options7.optional),
637
612
  id: TriggerId.pipe(Options7.optional),
638
613
  enabled: Enabled,
639
614
  functionId: Common6.functionId.pipe(Options7.optional),
640
- queue: Queue.pipe(Options7.optional),
615
+ feed: Feed.pipe(Options7.optional),
641
616
  input: Input.pipe(Options7.optional)
642
617
  }, (options) => Effect7.gen(function* () {
643
618
  const { json } = yield* CommandConfig6;
644
619
  const triggerId = yield* Option6.match(options.id, {
645
- onNone: () => selectTrigger("queue"),
620
+ onNone: () => selectTrigger("feed"),
646
621
  onSome: (id) => Effect7.succeed(id)
647
622
  });
648
- const dxn = DXN3.fromLocalObjectId(triggerId);
623
+ const dxn = EID3.make({
624
+ entityId: triggerId
625
+ });
649
626
  const trigger2 = yield* Database7.resolve(dxn, Trigger7.Trigger);
650
- if (trigger2.spec?.kind !== "queue") {
627
+ if (trigger2.spec?.kind !== "feed") {
651
628
  return yield* Effect7.fail(new Error(`Invalid trigger type: ${trigger2.spec?.kind}`));
652
629
  }
653
630
  const currentFn = yield* updateFunction(trigger2, options.functionId);
654
- yield* updateQueue(trigger2, options.queue);
631
+ yield* updateFeed(trigger2, options.feed);
655
632
  yield* updateInput(trigger2, currentFn, options.input);
656
633
  yield* updateEnabled(trigger2, options.id, options.enabled);
657
634
  if (json) {
@@ -662,10 +639,10 @@ var queue2 = Command7.make("queue", {
662
639
  yield* flushAndSync4({
663
640
  indexes: true
664
641
  });
665
- })).pipe(Command7.withDescription("Update a queue trigger."), Command7.provide(({ spaceId }) => spaceLayer6(spaceId, true)), Command7.provideEffectDiscard(() => withTypes5(Function5.Function, Trigger7.Trigger)));
642
+ })).pipe(Command7.withDescription("Update a feed trigger."), Command7.provide(({ spaceId }) => spaceLayer6(spaceId, true)), Command7.provideEffectDiscard(() => withTypes5(Operation5.PersistentOperation, Trigger7.Trigger)));
666
643
  var updateFunction = Effect7.fn(function* (trigger2, functionIdOption) {
667
644
  let currentFn = trigger2.function ? yield* Database7.load(trigger2.function) : void 0;
668
- if (currentFn && !Obj2.instanceOf(Function5.Function, currentFn)) {
645
+ if (currentFn && !Obj2.instanceOf(Operation5.PersistentOperation, currentFn)) {
669
646
  currentFn = void 0;
670
647
  }
671
648
  const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
@@ -681,40 +658,40 @@ var updateFunction = Effect7.fn(function* (trigger2, functionIdOption) {
681
658
  onNone: () => selectFunction(),
682
659
  onSome: (id) => Effect7.succeed(id)
683
660
  });
684
- const functions = yield* Database7.runQuery(Filter6.type(Function5.Function));
661
+ const functions = yield* Database7.runQuery(Filter6.type(Operation5.PersistentOperation));
685
662
  const foundFn = functions.find((fn6) => fn6.id === functionId);
686
- if (!foundFn || !Obj2.instanceOf(Function5.Function, foundFn)) {
663
+ if (!foundFn || !Obj2.instanceOf(Operation5.PersistentOperation, foundFn)) {
687
664
  return yield* Effect7.fail(new Error(`Function not found: ${functionId}`));
688
665
  }
689
- Obj2.change(trigger2, (mutableTrigger) => {
690
- mutableTrigger.function = Ref5.make(foundFn);
666
+ Obj2.update(trigger2, (trigger3) => {
667
+ trigger3.function = Ref6.make(foundFn);
691
668
  });
692
669
  currentFn = foundFn;
693
670
  }
694
671
  if (!currentFn) {
695
- const functionId = trigger2.function?.dxn.asEchoDXN()?.echoId ?? "unknown";
672
+ const functionId = (trigger2.function ? trigger2.function.uri.toString() : void 0) ?? "unknown";
696
673
  return yield* Effect7.fail(new Error(`Invalid reference for ${functionId}`));
697
674
  }
698
675
  return currentFn;
699
676
  });
700
- var updateQueue = Effect7.fn(function* (trigger2, queueOption) {
701
- const currentQueue = trigger2.spec?.kind === "queue" ? trigger2.spec.queue : void 0;
702
- const currentQueueStr = currentQueue ? typeof currentQueue === "string" ? currentQueue : String(currentQueue) : void 0;
703
- const shouldChangeQueue = yield* Option6.match(queueOption, {
677
+ var updateFeed = Effect7.fn(function* (trigger2, feedOption) {
678
+ const currentFeed = trigger2.spec?.kind === "feed" ? trigger2.spec.feed : void 0;
679
+ const currentFeedStr = currentFeed ? currentFeed.uri.toString() : void 0;
680
+ const shouldChangeFeed = yield* Option6.match(feedOption, {
704
681
  onNone: () => Prompt5.confirm({
705
- message: `Change the queue${currentQueueStr ? ` (current: ${currentQueueStr})` : ""}?`,
682
+ message: `Change the feed${currentFeedStr ? ` (current: ${currentFeedStr})` : ""}?`,
706
683
  initial: false
707
684
  }).pipe(Prompt5.run),
708
685
  onSome: () => Effect7.succeed(true)
709
686
  });
710
- if (shouldChangeQueue) {
711
- const queueDxn = yield* Option6.match(queueOption, {
712
- onNone: () => selectQueue(),
713
- onSome: (dxn) => Effect7.succeed(dxn.toString())
687
+ if (shouldChangeFeed) {
688
+ const feed = yield* Option6.match(feedOption, {
689
+ onNone: () => selectFeed(),
690
+ onSome: (uri) => Database7.resolve(EID3.parse(uri), FeedNs2.Feed)
714
691
  });
715
- Obj2.change(trigger2, (mutableTrigger) => {
716
- if (mutableTrigger.spec?.kind === "queue") {
717
- mutableTrigger.spec.queue = queueDxn;
692
+ Obj2.update(trigger2, (trigger3) => {
693
+ if (trigger3.spec?.kind === "feed") {
694
+ trigger3.spec.feed = Ref6.make(feed);
718
695
  }
719
696
  });
720
697
  }
@@ -737,8 +714,8 @@ var updateInput = Effect7.fn(function* (trigger2, fn6, inputOption) {
737
714
  onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema4.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
738
715
  onSome: (value2) => Effect7.succeed(value2)
739
716
  });
740
- Obj2.change(trigger2, (mutableTrigger) => {
741
- mutableTrigger.input = inputObj;
717
+ Obj2.update(trigger2, (trigger3) => {
718
+ trigger3.input = inputObj;
742
719
  });
743
720
  }
744
721
  });
@@ -750,12 +727,12 @@ var updateEnabled = Effect7.fn(function* (trigger2, idOption, enabled) {
750
727
  }).pipe(Prompt5.run),
751
728
  onSome: () => Effect7.succeed(enabled)
752
729
  });
753
- Obj2.change(trigger2, (mutableTrigger) => {
754
- mutableTrigger.enabled = enabledValue;
730
+ Obj2.update(trigger2, (trigger3) => {
731
+ trigger3.enabled = enabledValue;
755
732
  });
756
733
  });
757
734
 
758
- // src/cli/commands/trigger/update/subscription.ts
735
+ // src/commands/trigger/update/subscription.ts
759
736
  import * as Command8 from "@effect/cli/Command";
760
737
  import * as Options8 from "@effect/cli/Options";
761
738
  import * as Prompt6 from "@effect/cli/Prompt";
@@ -766,8 +743,9 @@ import * as Option7 from "effect/Option";
766
743
  import { CommandConfig as CommandConfig7 } from "@dxos/cli-util";
767
744
  import { flushAndSync as flushAndSync5, print as print6, spaceLayer as spaceLayer7, withTypes as withTypes6 } from "@dxos/cli-util";
768
745
  import { Common as Common7 } from "@dxos/cli-util";
769
- import { DXN as DXN4, Database as Database8, Filter as Filter7, JsonSchema as JsonSchema5, Obj as Obj3, Query as Query2, Ref as Ref6 } from "@dxos/echo";
770
- import { Function as Function6, Trigger as Trigger8 } from "@dxos/functions";
746
+ import { Operation as Operation6, Trigger as Trigger8 } from "@dxos/compute";
747
+ import { Database as Database8, Filter as Filter7, JsonSchema as JsonSchema5, Obj as Obj3, Query as Query4, Ref as Ref7 } from "@dxos/echo";
748
+ import { DXN, EID as EID4 } from "@dxos/keys";
771
749
  var subscription2 = Command8.make("subscription", {
772
750
  spaceId: Common7.spaceId.pipe(Options8.optional),
773
751
  id: TriggerId.pipe(Options8.optional),
@@ -783,8 +761,10 @@ var subscription2 = Command8.make("subscription", {
783
761
  onNone: () => selectTrigger("subscription"),
784
762
  onSome: (id) => Effect8.succeed(id)
785
763
  });
786
- const dxn = DXN4.fromLocalObjectId(triggerId);
787
- const trigger2 = yield* Database8.resolve(dxn, Trigger8.Trigger);
764
+ const dxn = EID4.make({
765
+ entityId: triggerId
766
+ });
767
+ const trigger2 = yield* Database8.resolve(Ref7.fromURI(dxn), Trigger8.Trigger);
788
768
  if (trigger2.spec?.kind !== "subscription") {
789
769
  return yield* Effect8.fail(new Error(`Invalid trigger type: ${trigger2.spec?.kind}`));
790
770
  }
@@ -800,7 +780,7 @@ var subscription2 = Command8.make("subscription", {
800
780
  yield* flushAndSync5({
801
781
  indexes: true
802
782
  });
803
- })).pipe(Command8.withDescription("Update a subscription trigger."), Command8.provide(({ spaceId }) => spaceLayer7(spaceId, true)), Command8.provideEffectDiscard(() => withTypes6(Function6.Function, Trigger8.Trigger)));
783
+ })).pipe(Command8.withDescription("Update a subscription trigger."), Command8.provide(({ spaceId }) => spaceLayer7(spaceId, true)), Command8.provideEffectDiscard(() => withTypes6(Operation6.PersistentOperation, Trigger8.Trigger)));
804
784
  var extractCurrentTypename = (spec) => {
805
785
  if (!spec?.query?.ast) {
806
786
  return Option7.none();
@@ -809,11 +789,11 @@ var extractCurrentTypename = (spec) => {
809
789
  type: "select"
810
790
  }, (q) => Match2.value(q.filter).pipe(Match2.withReturnType(), Match2.when({
811
791
  type: "object"
812
- }, (f) => Option7.fromNullable(f.typename).pipe(Option7.flatMap((dxn) => Option7.fromNullable(DXN4.tryParse(dxn))), Option7.flatMap((dxn) => Option7.fromNullable(dxn.asTypeDXN()?.type)))), Match2.orElse(() => Option7.none()))), Match2.orElse(() => Option7.none()));
792
+ }, (f) => Option7.fromNullable(f.typename).pipe(Option7.flatMap((dxn) => Option7.fromNullable(DXN.isDXN(dxn) ? DXN.getName(dxn) : void 0)))), Match2.orElse(() => Option7.none()))), Match2.orElse(() => Option7.none()));
813
793
  };
814
794
  var updateFunction2 = Effect8.fn(function* (trigger2, functionIdOption) {
815
795
  let currentFn = trigger2.function ? yield* Database8.load(trigger2.function) : void 0;
816
- if (currentFn && !Obj3.instanceOf(Function6.Function, currentFn)) {
796
+ if (currentFn && !Obj3.instanceOf(Operation6.PersistentOperation, currentFn)) {
817
797
  currentFn = void 0;
818
798
  }
819
799
  const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
@@ -829,18 +809,18 @@ var updateFunction2 = Effect8.fn(function* (trigger2, functionIdOption) {
829
809
  onNone: () => selectFunction(),
830
810
  onSome: (id) => Effect8.succeed(id)
831
811
  });
832
- const functions = yield* Database8.runQuery(Filter7.type(Function6.Function));
812
+ const functions = yield* Database8.runQuery(Filter7.type(Operation6.PersistentOperation));
833
813
  const foundFn = functions.find((fn6) => fn6.id === functionId);
834
- if (!foundFn || !Obj3.instanceOf(Function6.Function, foundFn)) {
814
+ if (!foundFn || !Obj3.instanceOf(Operation6.PersistentOperation, foundFn)) {
835
815
  return yield* Effect8.fail(new Error(`Function not found: ${functionId}`));
836
816
  }
837
- Obj3.change(trigger2, (mutableTrigger) => {
838
- mutableTrigger.function = Ref6.make(foundFn);
817
+ Obj3.update(trigger2, (trigger3) => {
818
+ trigger3.function = Ref7.make(foundFn);
839
819
  });
840
820
  currentFn = foundFn;
841
821
  }
842
822
  if (!currentFn) {
843
- const functionId = trigger2.function?.dxn.asEchoDXN()?.echoId ?? "unknown";
823
+ const functionId = (trigger2.function ? EID4.getEntityId(EID4.tryParse(trigger2.function.uri)) : void 0) ?? "unknown";
844
824
  return yield* Effect8.fail(new Error(`Invalid reference for ${functionId}`));
845
825
  }
846
826
  return currentFn;
@@ -874,7 +854,7 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
874
854
  }).pipe(Prompt6.run),
875
855
  onSome: (value2) => Effect8.succeed(value2)
876
856
  });
877
- const queryAst = Query2.select(Filter7.type(typename)).ast;
857
+ const queryAst = Query4.select(Filter7.type(typename)).ast;
878
858
  const deepOptionValue = yield* Option7.match(deepOption, {
879
859
  onNone: () => Prompt6.confirm({
880
860
  message: "Watch changes to nested properties (deep)?",
@@ -899,8 +879,8 @@ var updateSpec = Effect8.fn(function* (trigger2, typenameOption, deepOption, del
899
879
  if (Option7.isSome(delayOptionValue)) {
900
880
  subscriptionOptions.delay = delayOptionValue.value;
901
881
  }
902
- Obj3.change(trigger2, (mutableTrigger) => {
903
- const spec = mutableTrigger.spec;
882
+ Obj3.update(trigger2, (trigger3) => {
883
+ const spec = trigger3.spec;
904
884
  if (spec?.kind === "subscription") {
905
885
  spec.query = {
906
886
  ast: queryAst
@@ -928,8 +908,8 @@ var updateInput2 = Effect8.fn(function* (trigger2, fn6, inputOption) {
928
908
  onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema5.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
929
909
  onSome: (value2) => Effect8.succeed(value2)
930
910
  });
931
- Obj3.change(trigger2, (mutableTrigger) => {
932
- mutableTrigger.input = inputObj;
911
+ Obj3.update(trigger2, (trigger3) => {
912
+ trigger3.input = inputObj;
933
913
  });
934
914
  }
935
915
  });
@@ -941,12 +921,12 @@ var updateEnabled2 = Effect8.fn(function* (trigger2, idOption, enabled) {
941
921
  }).pipe(Prompt6.run),
942
922
  onSome: () => Effect8.succeed(enabled)
943
923
  });
944
- Obj3.change(trigger2, (mutableTrigger) => {
945
- mutableTrigger.enabled = enabledValue;
924
+ Obj3.update(trigger2, (trigger3) => {
925
+ trigger3.enabled = enabledValue;
946
926
  });
947
927
  });
948
928
 
949
- // src/cli/commands/trigger/update/timer.ts
929
+ // src/commands/trigger/update/timer.ts
950
930
  import * as Command9 from "@effect/cli/Command";
951
931
  import * as Options9 from "@effect/cli/Options";
952
932
  import * as Prompt7 from "@effect/cli/Prompt";
@@ -956,8 +936,9 @@ import * as Option8 from "effect/Option";
956
936
  import { CommandConfig as CommandConfig8 } from "@dxos/cli-util";
957
937
  import { flushAndSync as flushAndSync6, print as print7, spaceLayer as spaceLayer8, withTypes as withTypes7 } from "@dxos/cli-util";
958
938
  import { Common as Common8 } from "@dxos/cli-util";
959
- import { DXN as DXN5, Database as Database9, Filter as Filter8, JsonSchema as JsonSchema6, Obj as Obj4, Ref as Ref7 } from "@dxos/echo";
960
- import { Function as Function7, Trigger as Trigger9 } from "@dxos/functions";
939
+ import { Operation as Operation7, Trigger as Trigger9 } from "@dxos/compute";
940
+ import { Database as Database9, Filter as Filter8, JsonSchema as JsonSchema6, Obj as Obj4, Ref as Ref8 } from "@dxos/echo";
941
+ import { EID as EID5 } from "@dxos/keys";
961
942
  var timer2 = Command9.make("timer", {
962
943
  spaceId: Common8.spaceId.pipe(Options9.optional),
963
944
  id: TriggerId.pipe(Options9.optional),
@@ -971,8 +952,10 @@ var timer2 = Command9.make("timer", {
971
952
  onNone: () => selectTrigger("timer"),
972
953
  onSome: (id) => Effect9.succeed(id)
973
954
  });
974
- const dxn = DXN5.fromLocalObjectId(triggerId);
975
- const trigger2 = yield* Database9.resolve(dxn, Trigger9.Trigger);
955
+ const dxn = EID5.make({
956
+ entityId: triggerId
957
+ });
958
+ const trigger2 = yield* Database9.resolve(Ref8.fromURI(dxn), Trigger9.Trigger);
976
959
  if (!trigger2.spec || trigger2.spec?.kind !== "timer") {
977
960
  return yield* Effect9.fail(new Error(`Invalid trigger type: ${trigger2.spec?.kind}`));
978
961
  }
@@ -988,10 +971,10 @@ var timer2 = Command9.make("timer", {
988
971
  yield* flushAndSync6({
989
972
  indexes: true
990
973
  });
991
- })).pipe(Command9.withDescription("Update a timer trigger."), Command9.provide(({ spaceId }) => spaceLayer8(spaceId, true)), Command9.provideEffectDiscard(() => withTypes7(Function7.Function, Trigger9.Trigger)));
974
+ })).pipe(Command9.withDescription("Update a timer trigger."), Command9.provide(({ spaceId }) => spaceLayer8(spaceId, true)), Command9.provideEffectDiscard(() => withTypes7(Operation7.PersistentOperation, Trigger9.Trigger)));
992
975
  var updateFunction3 = Effect9.fn(function* (trigger2, functionIdOption) {
993
976
  let currentFn = trigger2.function ? yield* Database9.load(trigger2.function) : void 0;
994
- if (currentFn && !Obj4.instanceOf(Function7.Function, currentFn)) {
977
+ if (currentFn && !Obj4.instanceOf(Operation7.PersistentOperation, currentFn)) {
995
978
  currentFn = void 0;
996
979
  }
997
980
  const currentFunctionName = currentFn ? currentFn.name ?? currentFn.id : void 0;
@@ -1007,18 +990,18 @@ var updateFunction3 = Effect9.fn(function* (trigger2, functionIdOption) {
1007
990
  onNone: () => selectFunction(),
1008
991
  onSome: (id) => Effect9.succeed(id)
1009
992
  });
1010
- const functions = yield* Database9.runQuery(Filter8.type(Function7.Function));
993
+ const functions = yield* Database9.runQuery(Filter8.type(Operation7.PersistentOperation));
1011
994
  const foundFn = functions.find((fn6) => fn6.id === functionId);
1012
- if (!foundFn || !Obj4.instanceOf(Function7.Function, foundFn)) {
995
+ if (!foundFn || !Obj4.instanceOf(Operation7.PersistentOperation, foundFn)) {
1013
996
  return yield* Effect9.fail(new Error(`Function not found: ${functionId}`));
1014
997
  }
1015
- Obj4.change(trigger2, (mutableTrigger) => {
1016
- mutableTrigger.function = Ref7.make(foundFn);
998
+ Obj4.update(trigger2, (trigger3) => {
999
+ trigger3.function = Ref8.make(foundFn);
1017
1000
  });
1018
1001
  currentFn = foundFn;
1019
1002
  }
1020
1003
  if (!currentFn) {
1021
- const functionId = trigger2.function?.dxn.asEchoDXN()?.echoId ?? "unknown";
1004
+ const functionId = (trigger2.function ? EID5.getEntityId(EID5.tryParse(trigger2.function.uri)) : void 0) ?? "unknown";
1022
1005
  return yield* Effect9.fail(new Error(`Invalid reference for ${functionId}`));
1023
1006
  }
1024
1007
  return currentFn;
@@ -1039,9 +1022,9 @@ var updateCron = Effect9.fn(function* (trigger2, cronOption) {
1039
1022
  }).pipe(Prompt7.run),
1040
1023
  onSome: (value2) => Effect9.succeed(value2)
1041
1024
  });
1042
- Obj4.change(trigger2, (mutableTrigger) => {
1043
- if (mutableTrigger.spec?.kind === "timer") {
1044
- mutableTrigger.spec.cron = cron;
1025
+ Obj4.update(trigger2, (trigger3) => {
1026
+ if (trigger3.spec?.kind === "timer") {
1027
+ trigger3.spec.cron = cron;
1045
1028
  }
1046
1029
  });
1047
1030
  }
@@ -1064,8 +1047,8 @@ var updateInput3 = Effect9.fn(function* (trigger2, fn6, inputOption) {
1064
1047
  onNone: () => promptForSchemaInput(fn6.inputSchema ? JsonSchema6.toEffectSchema(fn6.inputSchema) : void 0, currentInput),
1065
1048
  onSome: (value2) => Effect9.succeed(value2)
1066
1049
  });
1067
- Obj4.change(trigger2, (mutableTrigger) => {
1068
- mutableTrigger.input = inputObj;
1050
+ Obj4.update(trigger2, (trigger3) => {
1051
+ trigger3.input = inputObj;
1069
1052
  });
1070
1053
  }
1071
1054
  });
@@ -1077,19 +1060,19 @@ var updateEnabled3 = Effect9.fn(function* (trigger2, idOption, enabled) {
1077
1060
  }).pipe(Prompt7.run),
1078
1061
  onSome: () => Effect9.succeed(enabled)
1079
1062
  });
1080
- Obj4.change(trigger2, (mutableTrigger) => {
1081
- mutableTrigger.enabled = enabledValue;
1063
+ Obj4.update(trigger2, (trigger3) => {
1064
+ trigger3.enabled = enabledValue;
1082
1065
  });
1083
1066
  });
1084
1067
 
1085
- // src/cli/commands/trigger/update/index.ts
1068
+ // src/commands/trigger/update/index.ts
1086
1069
  var update = Command10.make("update").pipe(Command10.withDescription("Update a trigger."), Command10.withSubcommands([
1087
1070
  subscription2,
1088
1071
  timer2,
1089
1072
  queue2
1090
1073
  ]));
1091
1074
 
1092
- // src/cli/commands/trigger/index.ts
1075
+ // src/commands/trigger/index.ts
1093
1076
  var trigger = Command11.make("trigger").pipe(Command11.withDescription("Manage EDGE triggers."), Command11.withSubcommands([
1094
1077
  create,
1095
1078
  list,
@@ -1097,19 +1080,34 @@ var trigger = Command11.make("trigger").pipe(Command11.withDescription("Manage E
1097
1080
  update
1098
1081
  ]));
1099
1082
 
1100
- // src/cli/plugin.ts
1101
- var AutomationPlugin = Plugin.define(meta).pipe(AppPlugin.addCommandModule({
1083
+ // src/AutomationPlugin.node.ts
1084
+ var AutomationPlugin = Plugin.define(meta).pipe(AppPlugin.addAppGraphModule({
1085
+ activate: AppGraphBuilder
1086
+ }), AppPlugin.addCommandModule({
1102
1087
  commands: [
1103
1088
  trigger
1104
1089
  ]
1090
+ }), AppPlugin.addOperationHandlerModule({
1091
+ activate: OperationHandler
1092
+ }), AppPlugin.addSchemaModule({
1093
+ schema: [
1094
+ Operation8.PersistentOperation,
1095
+ Trigger10.Trigger,
1096
+ Trace.Message
1097
+ ]
1098
+ }), Plugin.addModule({
1099
+ activatesOn: ActivationEvents.SetupProcessManager,
1100
+ activate: LayerSpecs
1105
1101
  }), Plugin.addModule({
1106
1102
  activatesOn: ClientEvents.ClientReady,
1107
- activatesAfter: [
1108
- AutomationEvents.ComputeRuntimeReady
1109
- ],
1110
- activate: ComputeRuntime
1103
+ activate: RegistrySync
1104
+ }), Plugin.addModule({
1105
+ activatesOn: ActivationEvent.allOf(ActivationEvents.ProcessManagerReady, ClientEvents.SpacesReady),
1106
+ activate: TriggerRuntimeController
1111
1107
  }), Plugin.make);
1108
+ var AutomationPlugin_node_default = AutomationPlugin;
1112
1109
  export {
1113
- AutomationPlugin
1110
+ AutomationPlugin,
1111
+ AutomationPlugin_node_default as default
1114
1112
  };
1115
- //# sourceMappingURL=index.mjs.map
1113
+ //# sourceMappingURL=AutomationPlugin.node.mjs.map