@dxos/plugin-automation 0.8.4-main.8360d9e660 → 0.8.4-main.8baae0fced

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 (352) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/AutomationPanel-GQCS4EPU.mjs +11 -0
  4. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  5. package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +126 -130
  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-F6AZQV74.mjs +31 -0
  10. package/dist/lib/neutral/AutomationSettings-F6AZQV74.mjs.map +7 -0
  11. package/dist/lib/neutral/FunctionsContainer-2ETGQQR2.mjs +38 -0
  12. package/dist/lib/neutral/FunctionsContainer-2ETGQQR2.mjs.map +7 -0
  13. package/dist/lib/{browser/chunk-75XLBFAG.mjs → neutral/FunctionsPanel-SVRKRUXZ.mjs} +22 -22
  14. package/dist/lib/neutral/FunctionsPanel-SVRKRUXZ.mjs.map +7 -0
  15. package/dist/lib/{browser/chunk-FUVAC5EC.mjs → neutral/FunctionsRegistry-7ITCFJCW.mjs} +24 -25
  16. package/dist/lib/neutral/FunctionsRegistry-7ITCFJCW.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 +15 -0
  21. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  22. package/dist/lib/neutral/capabilities/node.mjs +13 -0
  23. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  25. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  26. package/dist/lib/{browser/chunk-EL64ZPPN.mjs → neutral/chunk-4ETZEEYR.mjs} +7 -3
  27. package/dist/lib/neutral/chunk-4ETZEEYR.mjs.map +7 -0
  28. package/dist/lib/{browser/chunk-O23LHDEX.mjs → neutral/chunk-EIIPEUUP.mjs} +60 -26
  29. package/dist/lib/neutral/chunk-EIIPEUUP.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-HRUXURVS.mjs +12 -0
  31. package/dist/lib/neutral/chunk-HRUXURVS.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  33. package/dist/lib/{browser/chunk-BWEKRPFJ.mjs → neutral/chunk-K3C5ZTZA.mjs} +29 -38
  34. package/dist/lib/neutral/chunk-K3C5ZTZA.mjs.map +7 -0
  35. package/dist/lib/neutral/chunk-VCWVO3JE.mjs +8 -0
  36. package/dist/lib/neutral/chunk-VCWVO3JE.mjs.map +7 -0
  37. package/dist/lib/neutral/chunk-VRGWNUVV.mjs +36 -0
  38. package/dist/lib/neutral/chunk-VRGWNUVV.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-YA2ZTSOH.mjs +73 -0
  40. package/dist/lib/neutral/chunk-YA2ZTSOH.mjs.map +7 -0
  41. package/dist/lib/neutral/components/index.mjs +16 -0
  42. package/dist/lib/neutral/containers/index.mjs +13 -0
  43. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  44. package/dist/lib/neutral/create-trigger-from-template-XAJWHKO2.mjs +68 -0
  45. package/dist/lib/neutral/create-trigger-from-template-XAJWHKO2.mjs.map +7 -0
  46. package/dist/lib/neutral/hooks/index.mjs +47 -0
  47. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  48. package/dist/lib/neutral/index.mjs +16 -0
  49. package/dist/lib/neutral/layer-specs-XLG75KLY.mjs +161 -0
  50. package/dist/lib/neutral/layer-specs-XLG75KLY.mjs.map +7 -0
  51. package/dist/lib/neutral/meta.json +1 -0
  52. package/dist/lib/neutral/meta.mjs +8 -0
  53. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  54. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  55. package/dist/lib/neutral/operations/index.mjs +8 -0
  56. package/dist/lib/neutral/plugin.mjs +16 -0
  57. package/dist/lib/neutral/plugin.mjs.map +7 -0
  58. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  59. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  60. package/dist/lib/neutral/testing.mjs +8 -0
  61. package/dist/lib/neutral/translations.mjs +47 -0
  62. package/dist/lib/neutral/translations.mjs.map +7 -0
  63. package/dist/lib/neutral/types/index.mjs +12 -0
  64. package/dist/types/src/AutomationPlugin.d.ts +1 -0
  65. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  66. package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
  67. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  68. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  69. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  70. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  71. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/index.d.ts +6 -4
  74. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
  76. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/node.d.ts +6 -0
  78. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  80. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  82. package/dist/types/src/commands/index.d.ts.map +1 -0
  83. package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
  84. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  85. package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +1 -1
  86. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  87. package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
  88. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  89. package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
  90. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  91. package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +7 -7
  92. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  93. package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
  94. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  95. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  96. package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
  97. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  98. package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
  99. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  101. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  103. package/dist/types/src/{cli/commands → commands}/trigger/util.d.ts +4 -4
  104. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  105. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  106. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  107. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -32
  108. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  109. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  110. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  111. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  112. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  113. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  114. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
  115. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  116. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
  117. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  118. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  119. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  120. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +95 -93
  121. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  122. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +3 -1
  123. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
  124. package/dist/types/src/containers/AutomationSettings/index.d.ts +1 -2
  125. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -1
  126. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +2 -4
  127. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
  128. package/dist/types/src/containers/FunctionsContainer/index.d.ts +1 -2
  129. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -1
  130. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +3 -3
  131. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
  132. package/dist/types/src/hooks/index.d.ts +0 -1
  133. package/dist/types/src/hooks/index.d.ts.map +1 -1
  134. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
  135. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  136. package/dist/types/src/index.d.ts +0 -3
  137. package/dist/types/src/index.d.ts.map +1 -1
  138. package/dist/types/src/meta.d.ts.map +1 -1
  139. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  140. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  141. package/dist/types/src/operations/index.d.ts +3 -0
  142. package/dist/types/src/operations/index.d.ts.map +1 -0
  143. package/dist/types/src/plugin.d.ts +4 -0
  144. package/dist/types/src/plugin.d.ts.map +1 -0
  145. package/dist/types/src/testing/test-functions.d.ts +78 -76
  146. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  147. package/dist/types/src/testing.d.ts +2 -0
  148. package/dist/types/src/testing.d.ts.map +1 -0
  149. package/dist/types/src/translations.d.ts +32 -33
  150. package/dist/types/src/translations.d.ts.map +1 -1
  151. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  152. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  153. package/dist/types/src/types/index.d.ts +1 -2
  154. package/dist/types/src/types/index.d.ts.map +1 -1
  155. package/dist/types/src/types/schema.d.ts +7 -28
  156. package/dist/types/src/types/schema.d.ts.map +1 -1
  157. package/dist/types/tsconfig.tsbuildinfo +1 -1
  158. package/package.json +125 -68
  159. package/src/AutomationPlugin.node.ts +28 -0
  160. package/src/AutomationPlugin.test.ts +27 -0
  161. package/src/AutomationPlugin.tsx +12 -11
  162. package/src/AutomationPlugin.workerd.ts +18 -0
  163. package/src/capabilities/app-graph-builder.ts +66 -0
  164. package/src/capabilities/index.ts +10 -4
  165. package/src/capabilities/layer-specs.ts +231 -0
  166. package/src/capabilities/node.ts +13 -0
  167. package/src/capabilities/operation-handler.ts +16 -0
  168. package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +17 -15
  169. package/src/{cli/commands → commands}/trigger/create/queue.ts +7 -10
  170. package/src/{cli/commands → commands}/trigger/create/subscription.ts +8 -11
  171. package/src/{cli/commands → commands}/trigger/create/timer.ts +4 -7
  172. package/src/{cli/commands → commands}/trigger/list.ts +7 -4
  173. package/src/{cli/commands → commands}/trigger/remove.ts +2 -3
  174. package/src/{cli/commands → commands}/trigger/update/queue.ts +19 -20
  175. package/src/{cli/commands → commands}/trigger/update/subscription.ts +15 -15
  176. package/src/{cli/commands → commands}/trigger/update/timer.ts +16 -16
  177. package/src/{cli/commands → commands}/trigger/util.ts +25 -17
  178. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +12 -5
  179. package/src/components/AutomationPanel/AutomationPanel.tsx +89 -47
  180. package/src/components/FunctionsPanel/FunctionsPanel.tsx +33 -25
  181. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +32 -23
  182. package/src/components/TriggerEditor/FunctionInputEditor.tsx +4 -4
  183. package/src/components/TriggerEditor/SpecSelector.tsx +17 -13
  184. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +19 -13
  185. package/src/components/TriggerEditor/TriggerEditor.tsx +13 -17
  186. package/src/containers/AutomationSettings/AutomationSettings.tsx +11 -7
  187. package/src/containers/AutomationSettings/index.ts +1 -3
  188. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +11 -11
  189. package/src/containers/FunctionsContainer/index.ts +1 -3
  190. package/src/containers/TriggerSettings/TriggerSettings.tsx +32 -10
  191. package/src/hooks/index.ts +1 -1
  192. package/src/hooks/useTriggerRuntimeControls.ts +13 -8
  193. package/src/index.ts +0 -4
  194. package/src/meta.ts +3 -1
  195. package/src/operations/create-trigger-from-template.ts +71 -0
  196. package/src/operations/index.ts +7 -0
  197. package/src/plugin.ts +11 -0
  198. package/src/testing/test-functions.ts +6 -3
  199. package/src/testing.ts +7 -0
  200. package/src/translations.ts +38 -39
  201. package/src/types/AutomationOperation.ts +30 -0
  202. package/src/types/index.ts +2 -2
  203. package/src/types/schema.ts +2 -23
  204. package/dist/lib/browser/AutomationPanel-IGLIQY2N.mjs +0 -11
  205. package/dist/lib/browser/AutomationSettings-XGJGVBDD.mjs +0 -37
  206. package/dist/lib/browser/AutomationSettings-XGJGVBDD.mjs.map +0 -7
  207. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +0 -43
  208. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +0 -7
  209. package/dist/lib/browser/FunctionsPanel-NMA4RYJL.mjs +0 -10
  210. package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +0 -10
  211. package/dist/lib/browser/TriggerSettings-GW5OEM2G.mjs +0 -11
  212. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs +0 -83
  213. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +0 -7
  214. package/dist/lib/browser/chunk-5WMYSXEH.mjs +0 -83
  215. package/dist/lib/browser/chunk-5WMYSXEH.mjs.map +0 -7
  216. package/dist/lib/browser/chunk-75XLBFAG.mjs.map +0 -7
  217. package/dist/lib/browser/chunk-BWEKRPFJ.mjs.map +0 -7
  218. package/dist/lib/browser/chunk-EL64ZPPN.mjs.map +0 -7
  219. package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-LHJEQVX5.mjs +0 -8
  221. package/dist/lib/browser/chunk-LHJEQVX5.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-O23LHDEX.mjs.map +0 -7
  223. package/dist/lib/browser/chunk-PUYY7B5F.mjs +0 -31
  224. package/dist/lib/browser/chunk-PUYY7B5F.mjs.map +0 -7
  225. package/dist/lib/browser/chunk-ZBEMNWNY.mjs +0 -93
  226. package/dist/lib/browser/chunk-ZBEMNWNY.mjs.map +0 -7
  227. package/dist/lib/browser/cli/index.mjs.map +0 -7
  228. package/dist/lib/browser/compute-runtime-I3I2BIRE.mjs +0 -130
  229. package/dist/lib/browser/compute-runtime-I3I2BIRE.mjs.map +0 -7
  230. package/dist/lib/browser/hooks/index.mjs +0 -13
  231. package/dist/lib/browser/index.mjs +0 -123
  232. package/dist/lib/browser/index.mjs.map +0 -7
  233. package/dist/lib/browser/meta.json +0 -1
  234. package/dist/lib/browser/operation-resolver-NGN4BEWN.mjs +0 -84
  235. package/dist/lib/browser/operation-resolver-NGN4BEWN.mjs.map +0 -7
  236. package/dist/lib/browser/react-surface-SXDIM3RM.mjs +0 -65
  237. package/dist/lib/browser/react-surface-SXDIM3RM.mjs.map +0 -7
  238. package/dist/lib/browser/types/index.mjs +0 -14
  239. package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs +0 -12
  240. package/dist/lib/node-esm/AutomationSettings-W52ZO2XI.mjs +0 -38
  241. package/dist/lib/node-esm/AutomationSettings-W52ZO2XI.mjs.map +0 -7
  242. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +0 -44
  243. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +0 -7
  244. package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs +0 -11
  245. package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +0 -11
  246. package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs.map +0 -7
  247. package/dist/lib/node-esm/TriggerSettings-2GKFPECW.mjs +0 -12
  248. package/dist/lib/node-esm/TriggerSettings-2GKFPECW.mjs.map +0 -7
  249. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs +0 -84
  250. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +0 -7
  251. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs +0 -97
  252. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +0 -7
  253. package/dist/lib/node-esm/chunk-BNWZ2NNI.mjs +0 -32
  254. package/dist/lib/node-esm/chunk-BNWZ2NNI.mjs.map +0 -7
  255. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs +0 -270
  256. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs +0 -98
  258. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs +0 -295
  260. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-V3VUE2NR.mjs +0 -10
  262. package/dist/lib/node-esm/chunk-V3VUE2NR.mjs.map +0 -7
  263. package/dist/lib/node-esm/chunk-WC5AT7B3.mjs +0 -19
  264. package/dist/lib/node-esm/chunk-WC5AT7B3.mjs.map +0 -7
  265. package/dist/lib/node-esm/chunk-XCFO2IXT.mjs +0 -84
  266. package/dist/lib/node-esm/chunk-XCFO2IXT.mjs.map +0 -7
  267. package/dist/lib/node-esm/chunk-XQO3HK62.mjs +0 -94
  268. package/dist/lib/node-esm/chunk-XQO3HK62.mjs.map +0 -7
  269. package/dist/lib/node-esm/cli/index.mjs +0 -1116
  270. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  271. package/dist/lib/node-esm/compute-runtime-7HCSIYFG.mjs +0 -131
  272. package/dist/lib/node-esm/compute-runtime-7HCSIYFG.mjs.map +0 -7
  273. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  274. package/dist/lib/node-esm/index.mjs +0 -124
  275. package/dist/lib/node-esm/index.mjs.map +0 -7
  276. package/dist/lib/node-esm/meta.json +0 -1
  277. package/dist/lib/node-esm/operation-resolver-ANGACQZG.mjs +0 -85
  278. package/dist/lib/node-esm/operation-resolver-ANGACQZG.mjs.map +0 -7
  279. package/dist/lib/node-esm/react-surface-QVLVDEVW.mjs +0 -66
  280. package/dist/lib/node-esm/react-surface-QVLVDEVW.mjs.map +0 -7
  281. package/dist/lib/node-esm/types/index.mjs +0 -15
  282. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  283. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  284. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  285. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  286. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  287. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  288. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  289. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  290. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  291. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  292. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  293. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  294. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  295. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  296. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  297. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
  298. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
  299. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
  300. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
  301. package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
  302. package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
  303. package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
  304. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
  305. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
  306. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
  307. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
  308. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
  309. package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
  310. package/dist/types/src/cli/index.d.ts +0 -2
  311. package/dist/types/src/cli/index.d.ts.map +0 -1
  312. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  313. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  314. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  315. package/dist/types/src/types/capabilities.d.ts +0 -23
  316. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  317. package/dist/types/src/types/events.d.ts +0 -5
  318. package/dist/types/src/types/events.d.ts.map +0 -1
  319. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -73
  320. package/src/capabilities/app-graph-builder/index.ts +0 -7
  321. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -155
  322. package/src/capabilities/compute-runtime/index.ts +0 -7
  323. package/src/capabilities/operation-resolver/index.ts +0 -7
  324. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
  325. package/src/capabilities/react-surface/index.ts +0 -7
  326. package/src/cli/index.ts +0 -5
  327. package/src/cli/plugin.ts +0 -24
  328. package/src/hooks/useComputeRuntimeCallback.ts +0 -67
  329. package/src/types/capabilities.ts +0 -45
  330. package/src/types/events.ts +0 -11
  331. /package/dist/lib/{browser/AutomationPanel-IGLIQY2N.mjs.map → neutral/AutomationPanel-GQCS4EPU.mjs.map} +0 -0
  332. /package/dist/lib/{browser/FunctionsPanel-NMA4RYJL.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  333. /package/dist/lib/{browser/FunctionsRegistry-TMKAEG5E.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  334. /package/dist/lib/{browser/TriggerSettings-GW5OEM2G.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  335. /package/dist/lib/{browser/hooks → neutral/components}/index.mjs.map +0 -0
  336. /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
  337. /package/dist/lib/{node-esm/AutomationPanel-O2BCQA7P.mjs.map → neutral/meta.mjs.map} +0 -0
  338. /package/dist/lib/{node-esm/hooks → neutral/operations}/index.mjs.map +0 -0
  339. /package/dist/lib/{node-esm/FunctionsPanel-DCXXLSVP.mjs.map → neutral/testing.mjs.map} +0 -0
  340. /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
  341. /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
  342. /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  343. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  344. /package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +0 -0
  345. /package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +0 -0
  346. /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
  347. /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
  348. /package/src/{cli/commands → commands}/index.ts +0 -0
  349. /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
  350. /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
  351. /package/src/{cli/commands → commands}/trigger/options.ts +0 -0
  352. /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
@@ -0,0 +1,231 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { Registry } from '@effect-atom/atom';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Layer from 'effect/Layer';
8
+
9
+ import { OpaqueToolkit } from '@dxos/ai';
10
+ import { Capabilities, Capability } from '@dxos/app-framework';
11
+ import { AppCapabilities } from '@dxos/app-toolkit';
12
+ import { ClientService } from '@dxos/client';
13
+ import { Blueprint, LayerSpec, OperationHandlerSet, OperationRegistry } from '@dxos/compute';
14
+ import { ProcessManager } from '@dxos/compute-runtime';
15
+ import { Database, Feed } from '@dxos/echo';
16
+ import { QueueService } from '@dxos/functions';
17
+ import {
18
+ AgentService,
19
+ FeedTraceSink,
20
+ RemoteFunctionExecutionService,
21
+ TriggerDispatcher,
22
+ TriggerStateStore,
23
+ } from '@dxos/functions-runtime';
24
+ import { invariant } from '@dxos/invariant';
25
+ import { ClientCapabilities } from '@dxos/plugin-client';
26
+
27
+ //
28
+ // Capability Module
29
+ //
30
+ // Contributes application- and space-affinity `Capabilities.LayerSpec` entries
31
+ // that together replace the former monolithic `AutomationCapabilities.ComputeRuntime`.
32
+ //
33
+ // Specs are declared at module level; runtime state (the `Client`, contributed
34
+ // capability lists, etc.) is resolved via Effect-level requirements rather
35
+ // than captured from an outer scope.
36
+ //
37
+
38
+ /**
39
+ * Default application-affinity `RemoteFunctionExecutionService`. Space specs
40
+ * (see {@link RemoteFunctionExecutionOverrideSpec}) can override this with a
41
+ * space-scoped client.
42
+ */
43
+ const RemoteFunctionExecutionSpec = LayerSpec.make(
44
+ {
45
+ affinity: 'application',
46
+ requires: [ClientService],
47
+ provides: [RemoteFunctionExecutionService],
48
+ },
49
+ () =>
50
+ Layer.unwrapEffect(
51
+ Effect.gen(function* () {
52
+ const client = yield* ClientService;
53
+ return RemoteFunctionExecutionService.fromClient(client);
54
+ }),
55
+ ),
56
+ );
57
+
58
+ /**
59
+ * Gathers contributed {@link Capabilities.OperationHandler} sets from the
60
+ * {@link Capability.Service} and exposes them through the
61
+ * {@link OperationHandlerSet.OperationHandlerProvider} tag so space-affinity
62
+ * specs (e.g. {@link OperationRegistrySpec}) can consume them through the
63
+ * normal LayerStack resolution path.
64
+ */
65
+ const OperationHandlerProviderSpec = LayerSpec.make(
66
+ {
67
+ affinity: 'application',
68
+ requires: [Capability.Service],
69
+ provides: [OperationHandlerSet.OperationHandlerProvider],
70
+ },
71
+ () =>
72
+ Layer.unwrapEffect(
73
+ Effect.gen(function* () {
74
+ const operationHandlerSets = yield* Capability.getAll(Capabilities.OperationHandler);
75
+ const mergedOperationHandlers =
76
+ operationHandlerSets.length === 0
77
+ ? OperationHandlerSet.empty
78
+ : OperationHandlerSet.merge(...operationHandlerSets);
79
+ return OperationHandlerSet.provide(mergedOperationHandlers);
80
+ }),
81
+ ),
82
+ );
83
+
84
+ const BlueprintRegistrySpec = LayerSpec.make(
85
+ {
86
+ affinity: 'application',
87
+ requires: [Capability.Service],
88
+ provides: [Blueprint.RegistryService],
89
+ },
90
+ () =>
91
+ Layer.unwrapEffect(
92
+ Effect.gen(function* () {
93
+ const capabilities = yield* Capability.Service;
94
+ const blueprints = capabilities
95
+ .getAll(AppCapabilities.BlueprintDefinition)
96
+ .flatMap((blueprint) => blueprint.make());
97
+ return Layer.succeed(Blueprint.RegistryService, new Blueprint.Registry(blueprints));
98
+ }),
99
+ ),
100
+ );
101
+
102
+ const OpaqueToolkitSpec = LayerSpec.make(
103
+ {
104
+ affinity: 'application',
105
+ requires: [Capability.Service],
106
+ provides: [OpaqueToolkit.OpaqueToolkitProvider],
107
+ },
108
+ () =>
109
+ Layer.unwrapEffect(
110
+ Effect.gen(function* () {
111
+ const capabilities = yield* Capability.Service;
112
+ return Layer.succeed(OpaqueToolkit.OpaqueToolkitProvider, {
113
+ getToolkit: () => {
114
+ const toolkits = capabilities.getAll(AppCapabilities.Toolkit);
115
+ return OpaqueToolkit.merge(...toolkits);
116
+ },
117
+ });
118
+ }),
119
+ ),
120
+ );
121
+
122
+ const AgentServiceSpec = LayerSpec.make(
123
+ {
124
+ affinity: 'application',
125
+ requires: [ProcessManager.ProcessManagerService],
126
+ provides: [AgentService.AgentService],
127
+ },
128
+ () => AgentService.layer(),
129
+ );
130
+
131
+ const OperationRegistrySpec = LayerSpec.make(
132
+ {
133
+ affinity: 'space',
134
+ requires: [Database.Service, OperationHandlerSet.OperationHandlerProvider],
135
+ provides: [OperationRegistry.Service],
136
+ },
137
+ () => OperationRegistry.layer,
138
+ );
139
+
140
+ /**
141
+ * In-memory trigger state. Loses state across restarts but works in both
142
+ * browser and CLI/Node contexts. Hosts that need durable storage should
143
+ * contribute a replacement LayerSpec that provides {@link TriggerStateStore}
144
+ * backed by a persistent `KeyValueStore` (e.g. `BrowserKeyValueStore` or
145
+ * `BunKeyValueStore`).
146
+ */
147
+ const TriggerStateStoreSpec = LayerSpec.make(
148
+ {
149
+ affinity: 'application',
150
+ requires: [],
151
+ provides: [TriggerStateStore],
152
+ },
153
+ () => TriggerStateStore.layerMemory,
154
+ );
155
+
156
+ //
157
+ // Space-affinity specs.
158
+ //
159
+
160
+ const FeedTraceSinkSpec = LayerSpec.make(
161
+ {
162
+ affinity: 'space',
163
+ requires: [Database.Service, Feed.FeedService],
164
+ provides: [FeedTraceSink.FeedTraceSink],
165
+ },
166
+ () => FeedTraceSink.layerLive,
167
+ );
168
+
169
+ /**
170
+ * Space-scoped override of {@link RemoteFunctionExecutionService}. Activated
171
+ * only when the client's `runtime.client.edgeFeatures.agents` config is set;
172
+ * falls back to the application-level spec otherwise.
173
+ */
174
+ const RemoteFunctionExecutionOverrideSpec = LayerSpec.make(
175
+ {
176
+ affinity: 'space',
177
+ requires: [ClientService],
178
+ provides: [RemoteFunctionExecutionService],
179
+ },
180
+ (context) =>
181
+ Layer.unwrapEffect(
182
+ Effect.gen(function* () {
183
+ invariant(context.space, 'space context required for RemoteFunctionExecutionService override');
184
+ const client = yield* ClientService;
185
+ return RemoteFunctionExecutionService.fromClient(client, context.space);
186
+ }),
187
+ ),
188
+ );
189
+
190
+ const TriggerDispatcherSpec = LayerSpec.make(
191
+ {
192
+ affinity: 'space',
193
+ requires: [
194
+ Database.Service,
195
+ QueueService,
196
+ TriggerStateStore,
197
+ ProcessManager.ProcessManagerService,
198
+ Registry.AtomRegistry,
199
+ ],
200
+ provides: [TriggerDispatcher],
201
+ },
202
+ () => TriggerDispatcher.layer({ timeControl: 'natural' }),
203
+ );
204
+
205
+ export default Capability.makeModule(
206
+ Effect.fnUntraced(function* () {
207
+ const client = yield* Capability.get(ClientCapabilities.Client);
208
+
209
+ const contributions: Capability.Any[] = [
210
+ Capability.contributes(Capabilities.LayerSpec, OperationHandlerProviderSpec),
211
+ Capability.contributes(Capabilities.LayerSpec, BlueprintRegistrySpec),
212
+ Capability.contributes(Capabilities.LayerSpec, OpaqueToolkitSpec),
213
+ Capability.contributes(Capabilities.LayerSpec, AgentServiceSpec),
214
+ Capability.contributes(Capabilities.LayerSpec, OperationRegistrySpec),
215
+ Capability.contributes(Capabilities.LayerSpec, TriggerStateStoreSpec),
216
+ Capability.contributes(Capabilities.LayerSpec, FeedTraceSinkSpec),
217
+ Capability.contributes(Capabilities.LayerSpec, TriggerDispatcherSpec),
218
+ Capability.contributes(Capabilities.TraceSink, ({ resolver }) => FeedTraceSink.makeRoutingSink({ resolver })),
219
+ // Edge-mode override is conditional on runtime config, so it stays in the
220
+ // activation block.
221
+ Capability.contributes(
222
+ Capabilities.LayerSpec,
223
+ client.config.get('runtime.client.edgeFeatures.agents')
224
+ ? RemoteFunctionExecutionSpec
225
+ : RemoteFunctionExecutionOverrideSpec,
226
+ ),
227
+ ];
228
+
229
+ return contributions;
230
+ }),
231
+ );
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Capability } from '@dxos/app-framework';
6
+ import { OperationHandlerSet } from '@dxos/compute';
7
+
8
+ export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
9
+ export const LayerSpecs = Capability.lazy<void, Capability.Any[]>('LayerSpecs', () => import('./layer-specs'));
10
+ export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
11
+ 'OperationHandler',
12
+ () => import('./operation-handler'),
13
+ );
@@ -0,0 +1,16 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Capabilities, Capability } from '@dxos/app-framework';
8
+ import type { OperationHandlerSet } from '@dxos/compute';
9
+
10
+ import { AutomationOperationHandlerSet } from '#operations';
11
+
12
+ export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
13
+ Effect.fnUntraced(function* () {
14
+ return Capability.contributes(Capabilities.OperationHandler, AutomationOperationHandlerSet);
15
+ }),
16
+ );
@@ -7,20 +7,18 @@ import React from 'react';
7
7
 
8
8
  import { Capabilities, Capability } from '@dxos/app-framework';
9
9
  import { Surface } from '@dxos/app-framework/ui';
10
- import { Obj } from '@dxos/echo';
11
- import { useActiveSpace } from '@dxos/plugin-space';
10
+ import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
12
11
  import { getSpace } from '@dxos/react-client/echo';
13
12
 
14
- import { AutomationSettings, FunctionsContainer } from '../../containers';
15
- import { meta } from '../../meta';
13
+ import { AutomationSettings, FunctionsContainer } from '#containers';
14
+ import { meta } from '#meta';
16
15
 
17
16
  export default Capability.makeModule(() =>
18
17
  Effect.succeed(
19
18
  Capability.contributes(Capabilities.ReactSurface, [
20
19
  Surface.create({
21
- id: `${meta.id}.space-settings-functions`,
22
- role: 'article',
23
- filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-functions`,
20
+ id: 'space-settings-functions',
21
+ filter: AppSurface.literal(AppSurface.Article, `${meta.id}.space-settings-functions`),
24
22
  component: () => {
25
23
  const space = useActiveSpace();
26
24
  if (!space) {
@@ -31,9 +29,8 @@ export default Capability.makeModule(() =>
31
29
  },
32
30
  }),
33
31
  Surface.create({
34
- id: `${meta.id}.space-settings-automation`,
35
- role: 'article',
36
- filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-automation`,
32
+ id: 'space-settings-automation',
33
+ filter: AppSurface.literal(AppSurface.Article, `${meta.id}.space-settings-automation`),
37
34
  component: () => {
38
35
  const space = useActiveSpace();
39
36
  if (!space) {
@@ -44,12 +41,17 @@ export default Capability.makeModule(() =>
44
41
  },
45
42
  }),
46
43
  Surface.create({
47
- id: `${meta.id}.companion.automation`,
48
- role: 'article',
49
- filter: (data): data is { companionTo: Obj.Unknown; subject: 'automation' } =>
50
- Obj.isObject(data.companionTo) && data.subject === 'automation',
44
+ id: 'companion.automation',
45
+ filter: AppSurface.allOf(
46
+ AppSurface.literal(AppSurface.Article, 'automation'),
47
+ AppSurface.companion(AppSurface.Article),
48
+ ),
51
49
  component: ({ data }) => {
52
- return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;
50
+ const space = getSpace(data.companionTo);
51
+ if (!space) {
52
+ return null;
53
+ }
54
+ return <AutomationSettings space={space} object={data.companionTo} />;
53
55
  },
54
56
  }),
55
57
  ]),
@@ -13,11 +13,11 @@ import * as Option from 'effect/Option';
13
13
  import { CommandConfig } from '@dxos/cli-util';
14
14
  import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
15
15
  import { Common } from '@dxos/cli-util';
16
+ import { Operation, Trigger } from '@dxos/compute';
16
17
  import { Database, Filter, JsonSchema, Ref } from '@dxos/echo';
17
- import { Function, Trigger } from '@dxos/functions';
18
18
 
19
19
  import { Enabled, Input, Queue } from '../options';
20
- import { printTrigger, promptForSchemaInput, selectFunction, selectQueue } from '../util';
20
+ import { printTrigger, promptForSchemaInput, selectFunction, selectFeed } from '../util';
21
21
 
22
22
  export const queue = Command.make(
23
23
  'queue',
@@ -36,14 +36,14 @@ export const queue = Command.make(
36
36
  onNone: () => selectFunction(),
37
37
  onSome: (id) => Effect.succeed(id),
38
38
  });
39
- const functions = yield* Database.runQuery(Filter.type(Function.Function));
39
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
40
40
  const fn = functions.find((fn) => fn.id === functionId);
41
41
  if (!fn) {
42
42
  return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
43
43
  }
44
44
 
45
- const queueDxn = yield* Option.match(options.queue, {
46
- onNone: () => selectQueue(),
45
+ const queueDXN = yield* Option.match(options.queue, {
46
+ onNone: () => selectFeed(),
47
47
  onSome: (dxn) => Effect.succeed(dxn.toString()),
48
48
  });
49
49
 
@@ -65,10 +65,7 @@ export const queue = Command.make(
65
65
  const trigger = Trigger.make({
66
66
  function: Ref.make(fn),
67
67
  enabled,
68
- spec: {
69
- kind: 'queue',
70
- queue: queueDxn,
71
- },
68
+ spec: Trigger.specQueue(queueDXN),
72
69
  input,
73
70
  });
74
71
 
@@ -85,5 +82,5 @@ export const queue = Command.make(
85
82
  ).pipe(
86
83
  Command.withDescription('Create a queue trigger.'),
87
84
  Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
88
- Command.provideEffectDiscard(() => withTypes(Function.Function, Trigger.Trigger)),
85
+ Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
89
86
  );
@@ -13,8 +13,8 @@ import * as Option from 'effect/Option';
13
13
  import { CommandConfig } from '@dxos/cli-util';
14
14
  import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
15
15
  import { Common } from '@dxos/cli-util';
16
+ import { Operation, Trigger } from '@dxos/compute';
16
17
  import { Database, Filter, JsonSchema, Query, Ref } from '@dxos/echo';
17
- import { Function, Trigger } from '@dxos/functions';
18
18
 
19
19
  import { Deep, Delay, Enabled, Input, Typename } from '../options';
20
20
  import { printTrigger, promptForSchemaInput, selectFunction } from '../util';
@@ -38,7 +38,7 @@ export const subscription = Command.make(
38
38
  onNone: () => selectFunction(),
39
39
  onSome: (id) => Effect.succeed(id),
40
40
  });
41
- const functions = yield* Database.runQuery(Filter.type(Function.Function));
41
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
42
42
  const fn = functions.find((fn) => fn.id === functionId);
43
43
  if (!fn) {
44
44
  return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
@@ -51,7 +51,7 @@ export const subscription = Command.make(
51
51
  }).pipe(Prompt.run),
52
52
  onSome: (value) => Effect.succeed(value),
53
53
  });
54
- const queryAst = Query.select(Filter.type(typename)).ast;
54
+ const subscriptionQuery = Query.select(Filter.type(typename));
55
55
 
56
56
  const deepOption = yield* Option.match(options.deep, {
57
57
  onNone: () =>
@@ -102,13 +102,10 @@ export const subscription = Command.make(
102
102
  const trigger = Trigger.make({
103
103
  function: Ref.make(fn),
104
104
  enabled,
105
- spec: {
106
- kind: 'subscription',
107
- query: {
108
- ast: queryAst,
109
- },
110
- options: Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : undefined,
111
- },
105
+ spec: Trigger.specSubscription(
106
+ subscriptionQuery,
107
+ Object.keys(subscriptionOptions).length > 0 ? subscriptionOptions : undefined,
108
+ ),
112
109
  input,
113
110
  });
114
111
  yield* Database.add(trigger);
@@ -124,5 +121,5 @@ export const subscription = Command.make(
124
121
  ).pipe(
125
122
  Command.withDescription('Create a subscription trigger.'),
126
123
  Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
127
- Command.provideEffectDiscard(() => withTypes(Function.Function, Trigger.Trigger)),
124
+ Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
128
125
  );
@@ -13,8 +13,8 @@ import * as Option from 'effect/Option';
13
13
  import { CommandConfig } from '@dxos/cli-util';
14
14
  import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
15
15
  import { Common } from '@dxos/cli-util';
16
+ import { Operation, Trigger } from '@dxos/compute';
16
17
  import { Database, Filter, JsonSchema, Ref } from '@dxos/echo';
17
- import { Function, Trigger } from '@dxos/functions';
18
18
 
19
19
  import { Cron, Enabled, Input } from '../options';
20
20
  import { printTrigger, promptForSchemaInput, selectFunction } from '../util';
@@ -37,7 +37,7 @@ export const timer = Command.make(
37
37
  onNone: () => selectFunction(),
38
38
  onSome: (id) => Effect.succeed(id),
39
39
  });
40
- const functions = yield* Database.runQuery(Filter.type(Function.Function));
40
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
41
41
  const fn = functions.find((fn) => fn.id === functionId);
42
42
  if (!fn) {
43
43
  return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
@@ -69,10 +69,7 @@ export const timer = Command.make(
69
69
  const trigger = Trigger.make({
70
70
  function: Ref.make(fn),
71
71
  enabled,
72
- spec: {
73
- kind: 'timer',
74
- cron,
75
- },
72
+ spec: Trigger.specTimer(cron),
76
73
  input,
77
74
  });
78
75
 
@@ -89,5 +86,5 @@ export const timer = Command.make(
89
86
  ).pipe(
90
87
  Command.withDescription('Create a timer trigger.'),
91
88
  Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
92
- Command.provideEffectDiscard(() => withTypes(Function.Function, Trigger.Trigger)),
89
+ Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
93
90
  );
@@ -9,8 +9,9 @@ import * as Effect from 'effect/Effect';
9
9
 
10
10
  import { CommandConfig, Common, printList, spaceIdWithDefault, spaceLayer } from '@dxos/cli-util';
11
11
  import { ClientService } from '@dxos/client';
12
- import { Database, Filter } from '@dxos/echo';
13
- import { Trigger } from '@dxos/functions';
12
+ import { Trigger } from '@dxos/compute';
13
+ import { Context } from '@dxos/context';
14
+ import { Database, Filter, Query } from '@dxos/echo';
14
15
 
15
16
  import { getTriggerRemoteStatus, printTrigger } from './util';
16
17
 
@@ -23,13 +24,15 @@ export const list = Command.make(
23
24
  const { json } = yield* CommandConfig;
24
25
 
25
26
  // Fetch local triggers
26
- const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
27
+ const triggers = yield* Database.runQuery(
28
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('cli.trigger.list'),
29
+ );
27
30
 
28
31
  // Fetch remote cron triggers to check availability
29
32
  const remoteCronIds = yield* Effect.gen(function* () {
30
33
  const client = yield* ClientService;
31
34
  const spaceId = yield* spaceIdWithDefault(spaceIdOption);
32
- const result = yield* Effect.promise(() => client.edge.http.getCronTriggers(spaceId)).pipe(
35
+ const result = yield* Effect.promise(() => client.edge.http.getCronTriggers(Context.default(), spaceId)).pipe(
33
36
  Effect.catchAll(() => Effect.succeed({ cronIds: [] })),
34
37
  );
35
38
  return result.cronIds;
@@ -9,9 +9,8 @@ import * as Effect from 'effect/Effect';
9
9
  import * as Option from 'effect/Option';
10
10
 
11
11
  import { CommandConfig, Common, print, spaceLayer, withTypes } from '@dxos/cli-util';
12
- import { DXN } from '@dxos/echo';
13
- import { Database } from '@dxos/echo';
14
- import { Trigger } from '@dxos/functions';
12
+ import { Trigger } from '@dxos/compute';
13
+ import { Database, DXN } from '@dxos/echo';
15
14
 
16
15
  import { TriggerId } from './options';
17
16
  import { printTriggerRemoved, selectTrigger } from './util';
@@ -12,11 +12,11 @@ import * as Option from 'effect/Option';
12
12
  import { CommandConfig } from '@dxos/cli-util';
13
13
  import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
14
14
  import { Common } from '@dxos/cli-util';
15
+ import { Operation, Trigger } from '@dxos/compute';
15
16
  import { DXN, Database, Filter, JsonSchema, Obj, Ref } from '@dxos/echo';
16
- import { Function, Trigger } from '@dxos/functions';
17
17
 
18
18
  import { Enabled, Input, Queue, TriggerId } from '../options';
19
- import { printTrigger, promptForSchemaInput, selectFunction, selectQueue, selectTrigger } from '../util';
19
+ import { printTrigger, promptForSchemaInput, selectFunction, selectFeed, selectTrigger } from '../util';
20
20
 
21
21
  export const queue = Command.make(
22
22
  'queue',
@@ -31,7 +31,6 @@ export const queue = Command.make(
31
31
  (options) =>
32
32
  Effect.gen(function* () {
33
33
  const { json } = yield* CommandConfig;
34
-
35
34
  const triggerId = yield* Option.match(options.id, {
36
35
  onNone: () => selectTrigger('queue'),
37
36
  onSome: (id) => Effect.succeed(id),
@@ -58,7 +57,7 @@ export const queue = Command.make(
58
57
  ).pipe(
59
58
  Command.withDescription('Update a queue trigger.'),
60
59
  Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
61
- Command.provideEffectDiscard(() => withTypes(Function.Function, Trigger.Trigger)),
60
+ Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
62
61
  );
63
62
 
64
63
  /**
@@ -67,10 +66,10 @@ export const queue = Command.make(
67
66
  * @returns The current function (either original or newly assigned)
68
67
  */
69
68
  const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionIdOption: Option.Option<string>) {
70
- let currentFn: Function.Function | undefined = trigger.function
69
+ let currentFn: Operation.PersistentOperation | undefined = trigger.function
71
70
  ? yield* Database.load(trigger.function) as any
72
71
  : undefined;
73
- if (currentFn && !Obj.instanceOf(Function.Function, currentFn)) {
72
+ if (currentFn && !Obj.instanceOf(Operation.PersistentOperation, currentFn)) {
74
73
  currentFn = undefined;
75
74
  }
76
75
  const currentFunctionName = currentFn ? (currentFn.name ?? currentFn.id) : undefined;
@@ -87,13 +86,13 @@ const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionId
87
86
  onNone: () => selectFunction(),
88
87
  onSome: (id) => Effect.succeed(id),
89
88
  });
90
- const functions = yield* Database.runQuery(Filter.type(Function.Function));
89
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
91
90
  const foundFn = functions.find((fn) => fn.id === functionId);
92
- if (!foundFn || !Obj.instanceOf(Function.Function, foundFn)) {
91
+ if (!foundFn || !Obj.instanceOf(Operation.PersistentOperation, foundFn)) {
93
92
  return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
94
93
  }
95
- Obj.change(trigger, (mutableTrigger) => {
96
- mutableTrigger.function = Ref.make(foundFn);
94
+ Obj.update(trigger, (trigger) => {
95
+ trigger.function = Ref.make(foundFn);
97
96
  });
98
97
  currentFn = foundFn;
99
98
  }
@@ -126,13 +125,13 @@ const updateQueue = Effect.fn(function* (trigger: Trigger.Trigger, queueOption:
126
125
  onSome: () => Effect.succeed(true),
127
126
  });
128
127
  if (shouldChangeQueue) {
129
- const queueDxn = yield* Option.match(queueOption, {
130
- onNone: () => selectQueue(),
128
+ const queueDXN = yield* Option.match(queueOption, {
129
+ onNone: () => selectFeed(),
131
130
  onSome: (dxn) => Effect.succeed(dxn.toString()),
132
131
  });
133
- Obj.change(trigger, (mutableTrigger) => {
134
- if (mutableTrigger.spec?.kind === 'queue') {
135
- mutableTrigger.spec.queue = queueDxn;
132
+ Obj.update(trigger, (trigger) => {
133
+ if (trigger.spec?.kind === 'queue') {
134
+ trigger.spec.queue = queueDXN;
136
135
  }
137
136
  });
138
137
  }
@@ -144,7 +143,7 @@ const updateQueue = Effect.fn(function* (trigger: Trigger.Trigger, queueOption:
144
143
  */
145
144
  const updateInput = Effect.fn(function* (
146
145
  trigger: Trigger.Trigger,
147
- fn: Function.Function,
146
+ fn: Operation.PersistentOperation,
148
147
  inputOption: Option.Option<Record<string, any>>,
149
148
  ) {
150
149
  const currentInput = trigger.input as Record<string, any> | undefined;
@@ -166,8 +165,8 @@ const updateInput = Effect.fn(function* (
166
165
  promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined, currentInput),
167
166
  onSome: (value) => Effect.succeed(value as Record<string, any>),
168
167
  });
169
- Obj.change(trigger, (mutableTrigger) => {
170
- mutableTrigger.input = inputObj;
168
+ Obj.update(trigger, (trigger) => {
169
+ trigger.input = inputObj;
171
170
  });
172
171
  }
173
172
  });
@@ -189,7 +188,7 @@ const updateEnabled = Effect.fn(function* (
189
188
  }).pipe(Prompt.run),
190
189
  onSome: () => Effect.succeed(enabled),
191
190
  });
192
- Obj.change(trigger, (mutableTrigger) => {
193
- mutableTrigger.enabled = enabledValue;
191
+ Obj.update(trigger, (trigger) => {
192
+ trigger.enabled = enabledValue;
194
193
  });
195
194
  });