@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
@@ -7,16 +7,16 @@ import React, { useCallback, useMemo } from 'react';
7
7
 
8
8
  import { useOperationInvoker } from '@dxos/app-framework/ui';
9
9
  import { LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
10
- import { Obj } from '@dxos/echo';
11
- import { Function, Script } from '@dxos/functions';
12
- import { SpaceOperation } from '@dxos/plugin-space/types';
13
- import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
14
- import { Button, IconButton, useTranslation } from '@dxos/react-ui';
10
+ import { Operation, Script } from '@dxos/compute';
11
+ import { Filter } from '@dxos/echo';
12
+ import { SpaceOperation } from '@dxos/plugin-space';
13
+ import { type Space, useQuery } from '@dxos/react-client/echo';
14
+ import { IconButton, useTranslation } from '@dxos/react-ui';
15
15
  import { Settings } from '@dxos/react-ui-form';
16
16
  import { List } from '@dxos/react-ui-list';
17
17
  import { ghostHover, mx } from '@dxos/ui-theme';
18
18
 
19
- import { meta } from '../../meta';
19
+ import { meta } from '#meta';
20
20
 
21
21
  export type FunctionsPanelProps = {
22
22
  space: Space;
@@ -24,7 +24,7 @@ export type FunctionsPanelProps = {
24
24
 
25
25
  export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
26
26
  const { t } = useTranslation(meta.id);
27
- const functions = useQuery(space.db, Filter.type(Function.Function));
27
+ const functions = useQuery(space.db, Filter.type(Operation.PersistentOperation));
28
28
  const scripts = useQuery(space.db, Filter.type(Script.Script));
29
29
  const { invokePromise } = useOperationInvoker();
30
30
 
@@ -47,7 +47,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
47
47
  );
48
48
 
49
49
  const getScriptName = useCallback(
50
- (func: Function.Function) => {
50
+ (func: Operation.PersistentOperation) => {
51
51
  const script = functionToScriptMap[func.id];
52
52
  return script?.name;
53
53
  },
@@ -55,7 +55,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
55
55
  );
56
56
 
57
57
  const handleGoToScript = useCallback(
58
- (func: Function.Function) => {
58
+ (func: Operation.PersistentOperation) => {
59
59
  const script = functionToScriptMap[func.id];
60
60
  if (script) {
61
61
  void invokePromise(LayoutOperation.Open, { subject: [getObjectPathFromObject(script)] });
@@ -65,35 +65,45 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
65
65
  );
66
66
 
67
67
  const handleDelete = useCallback(
68
- (func: Function.Function) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),
68
+ (func: Operation.PersistentOperation) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),
69
69
  [invokePromise],
70
70
  );
71
71
 
72
72
  return (
73
- <Settings.Container>
73
+ <Settings.Panel>
74
74
  {functions.length > 0 && (
75
- <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>
75
+ <List.Root<Operation.PersistentOperation>
76
+ items={functions}
77
+ isItem={Schema.is(Operation.PersistentOperation)}
78
+ getId={(func) => func.id}
79
+ >
76
80
  {({ items }) => (
77
81
  <div role='list' className='flex flex-col w-full'>
78
82
  {items?.map((func) => (
79
- <List.Item<Function.Function>
83
+ <List.Item<Operation.PersistentOperation>
80
84
  key={func.id}
81
85
  item={func}
82
- classNames={mx('grid grid-cols-[1fr_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center', ghostHover)}
86
+ classNames={mx(
87
+ 'grid grid-cols-[1fr_min-content_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center',
88
+ ghostHover,
89
+ )}
83
90
  >
84
91
  <div className='flex flex-col truncate'>
85
92
  <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
86
- {getScriptName(func) && (
87
- <div className='text-xs text-description truncate'>{getScriptName(func)}</div>
88
- )}
93
+ {getScriptName(func) && <p className='text-xs text-description truncate'>{getScriptName(func)}</p>}
89
94
  </div>
90
- {functionToScriptMap[func.id] && (
91
- <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>
92
- )}
95
+ {(functionToScriptMap[func.id] && (
96
+ <IconButton
97
+ icon='ph--arrow-square-out--regular'
98
+ iconOnly
99
+ label={t('show-source-button.label')}
100
+ onClick={() => handleGoToScript(func)}
101
+ />
102
+ )) || <div />}
93
103
  <IconButton
94
- iconOnly
95
104
  icon='ph--trash--regular'
96
- label={t('delete function button label')}
105
+ iconOnly
106
+ label={t('delete-function-button.label')}
97
107
  onClick={() => handleDelete(func)}
98
108
  />
99
109
  </List.Item>
@@ -102,8 +112,6 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
102
112
  )}
103
113
  </List.Root>
104
114
  )}
105
-
106
- {functions.length === 0 && <div className='text-center py-4 text-description'>{t('no functions found')}</div>}
107
- </Settings.Container>
115
+ </Settings.Panel>
108
116
  );
109
117
  };
@@ -6,16 +6,18 @@ import * as Schema from 'effect/Schema';
6
6
  import { useState } from 'react';
7
7
  import React, { useCallback } from 'react';
8
8
 
9
- import { Function } from '@dxos/functions';
9
+ import * as OperationModule from '@dxos/compute';
10
+ import { Context } from '@dxos/context';
11
+ import { Filter, Obj } from '@dxos/echo';
10
12
  import { getDeployedFunctions } from '@dxos/functions-runtime/edge';
11
13
  import { useClient } from '@dxos/react-client';
12
- import { Filter, Query, type Space, useQuery } from '@dxos/react-client/echo';
14
+ import { type Space, useQuery } from '@dxos/react-client/echo';
13
15
  import { IconButton, useAsyncEffect, useTranslation } from '@dxos/react-ui';
14
16
  import { Settings } from '@dxos/react-ui-form';
15
17
  import { List } from '@dxos/react-ui-list';
16
18
  import { ghostHover, mx } from '@dxos/ui-theme';
17
19
 
18
- import { meta } from '../../meta';
20
+ import { meta } from '#meta';
19
21
 
20
22
  const grid = 'grid grid-cols-[1fr_1fr_auto] min-h-[2.5rem]';
21
23
 
@@ -26,17 +28,18 @@ type FunctionsRegistryProps = {
26
28
  export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
27
29
  const client = useClient();
28
30
  const [loading, setLoading] = useState(true);
29
- const [functions, setFunctions] = useState<Function.Function[]>([]);
31
+ const [functions, setFunctions] = useState<OperationModule.Operation.PersistentOperation[]>([]);
30
32
  const { t } = useTranslation(meta.id);
31
33
 
32
- const dbFunctions = useQuery(space.db, Filter.type(Function.Function));
34
+ const dbFunctions = useQuery(space.db, Filter.type(OperationModule.Operation.PersistentOperation));
33
35
 
34
- const state = (func: Function.Function) => {
35
- const dbFunction = dbFunctions.find((f) => f.key === func.key);
36
+ const state = (func: OperationModule.Operation.PersistentOperation) => {
37
+ const funcKey = Obj.getMeta(func).key;
38
+ const dbFunction = dbFunctions.find((f) => Obj.getMeta(f).key === funcKey);
36
39
  if (!dbFunction) {
37
40
  return 'import';
38
41
  }
39
- if (dbFunction.version === func.version && dbFunction.updated === func.updated) {
42
+ if (Obj.getMeta(dbFunction).version === Obj.getMeta(func).version && dbFunction.updated === func.updated) {
40
43
  return 'none';
41
44
  }
42
45
  return 'update';
@@ -44,42 +47,51 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
44
47
 
45
48
  useAsyncEffect(async () => {
46
49
  setLoading(true);
47
- const functions = await getDeployedFunctions(client, true);
50
+ const functions = await getDeployedFunctions(Context.default(), client, true);
48
51
  setFunctions(functions);
49
52
  setLoading(false);
50
53
  }, []);
51
54
 
52
55
  const hanleImportOrUpdate = useCallback(
53
- async (func: Function.Function) => {
54
- const functions = await space.db.query(Query.type(Function.Function, { key: func.key })).run();
56
+ async (func: OperationModule.Operation.PersistentOperation) => {
57
+ const funcKey = Obj.getMeta(func).key;
58
+ const functions = funcKey
59
+ ? await space.db
60
+ .query(Filter.and(Filter.type(OperationModule.Operation.PersistentOperation), Filter.key(funcKey)))
61
+ .run()
62
+ : [];
55
63
  const [existingFunc] = functions;
56
64
  if (!existingFunc) {
57
65
  space.db.add(func);
58
66
  return;
59
67
  }
60
- Function.setFrom(existingFunc, func);
68
+ OperationModule.Operation.setFrom(existingFunc, func);
61
69
  },
62
70
  [space],
63
71
  );
64
72
 
65
73
  return (
66
- <Settings.Container>
74
+ <Settings.Panel>
67
75
  {functions.length > 0 && (
68
- <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>
76
+ <List.Root<OperationModule.Operation.PersistentOperation>
77
+ items={functions}
78
+ isItem={Schema.is(OperationModule.Operation.PersistentOperation)}
79
+ getId={(func) => func.id}
80
+ >
69
81
  {({ items }) => (
70
82
  <div role='list' className='flex flex-col w-full'>
71
83
  {items?.map((func) => (
72
- <List.Item<Function.Function>
84
+ <List.Item<OperationModule.Operation.PersistentOperation>
73
85
  key={func.id}
74
86
  item={func}
75
87
  classNames={mx(grid, ghostHover, 'items-center', 'px-2', 'min-h-[3rem]')}
76
88
  >
77
89
  <div className='flex flex-col truncate'>
78
90
  <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
79
- <div className='text-xs text-description truncate'>{func.key}</div>
91
+ <div className='text-xs text-description truncate'>{Obj.getMeta(func).key}</div>
80
92
  </div>
81
93
  <div className='flex flex-col truncate'>
82
- <div className='text-xs text-description truncate'>{func.version}</div>
94
+ <div className='text-xs text-description truncate'>{Obj.getMeta(func).version}</div>
83
95
  <div className='text-xs text-description truncate'>
84
96
  {func.updated ? `Uploaded ${new Date(func.updated).toLocaleString()}` : ''}
85
97
  </div>
@@ -89,7 +101,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
89
101
  iconOnly
90
102
  icon={state(func) === 'update' ? 'ph--arrows-clockwise--regular' : 'ph--download--regular'}
91
103
  label={
92
- state(func) === 'update' ? t('update function button label') : t('import function button label')
104
+ state(func) === 'update' ? t('update-function-button.label') : t('import-function-button.label')
93
105
  }
94
106
  disabled={state(func) === 'none'}
95
107
  onClick={() => hanleImportOrUpdate(func)}
@@ -101,10 +113,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
101
113
  </List.Root>
102
114
  )}
103
115
 
104
- {functions.length === 0 && !loading && (
105
- <div className='text-center py-4 text-gray-500'>{t('no functions found')}</div>
106
- )}
107
- {loading && <div className='text-center py-4 text-gray-500'>{t('loading functions')}</div>}
108
- </Settings.Container>
116
+ {loading && <div className='text-center py-4 text-gray-500'>{t('loading-functions.message')}</div>}
117
+ </Settings.Panel>
109
118
  );
110
119
  };
@@ -5,17 +5,17 @@
5
5
  import type * as SchemaAST from 'effect/SchemaAST';
6
6
  import React, { useCallback, useMemo } from 'react';
7
7
 
8
+ import { type Operation } from '@dxos/compute';
8
9
  import { type Database, JsonSchema, Obj, Ref } from '@dxos/echo';
9
10
  import { type JsonPath } from '@dxos/echo/internal';
10
- import { type Function } from '@dxos/functions';
11
11
  import { useOnTransition, useTranslation } from '@dxos/react-ui';
12
12
  import { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';
13
13
 
14
- import { meta } from '../../meta';
14
+ import { meta } from '#meta';
15
15
 
16
16
  export type FunctionInputEditorProps = {
17
17
  type: SchemaAST.AST;
18
- functions: Function.Function[];
18
+ functions: Operation.PersistentOperation[];
19
19
  db?: Database.Database;
20
20
  } & FormFieldStateProps;
21
21
 
@@ -68,7 +68,7 @@ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChan
68
68
 
69
69
  return (
70
70
  <>
71
- <Form.Label label={t('function parameters label')} asChild />
71
+ <Form.Label label={t('function-parameters.label')} asChild />
72
72
  <Form.Root
73
73
  key={selectedFunction.id}
74
74
  schema={effectSchema}
@@ -4,12 +4,12 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
+ import { Trigger } from '@dxos/compute';
7
8
  import { Filter, Query } from '@dxos/echo';
8
- import { Trigger } from '@dxos/functions';
9
9
  import { useTranslation } from '@dxos/react-ui';
10
10
  import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
11
11
 
12
- import { meta } from '../../meta';
12
+ import { meta } from '#meta';
13
13
 
14
14
  export type SpecSelectorProps = FormFieldComponentProps;
15
15
 
@@ -22,20 +22,15 @@ export const SpecSelector = (props: SpecSelectorProps) => {
22
22
  const getDefaultTriggerSpec = (kind: string) => {
23
23
  switch (kind) {
24
24
  case 'timer':
25
- return { kind: 'timer', cron: '' };
25
+ return Trigger.specTimer('');
26
26
  case 'subscription':
27
- return {
28
- kind: 'subscription',
29
- query: {
30
- ast: Query.select(Filter.nothing()).ast,
31
- },
32
- };
27
+ return Trigger.specSubscription(Query.select(Filter.nothing()));
33
28
  case 'queue':
34
- return { kind: 'queue', queue: 'dxn:queue:default' };
29
+ return Trigger.specQueue('dxn:queue:default');
35
30
  case 'email':
36
- return { kind: 'email' };
31
+ return Trigger.specEmail();
37
32
  case 'webhook':
38
- return { kind: 'webhook' };
33
+ return Trigger.specWebhook();
39
34
  default:
40
35
  return undefined;
41
36
  }
@@ -52,11 +47,20 @@ export const SpecSelector = (props: SpecSelectorProps) => {
52
47
  [props.type, specProps],
53
48
  );
54
49
 
50
+ const kindLabels: Record<string, string> = {
51
+ timer: t('trigger-type.timer.label'),
52
+ webhook: t('trigger-type.webhook.label'),
53
+ websocket: t('trigger-type.websocket.label'),
54
+ subscription: t('trigger-type.subscription.label'),
55
+ email: t('trigger-type.email.label'),
56
+ queue: t('trigger-type.queue.label'),
57
+ };
58
+
55
59
  const options = useMemo(
56
60
  () =>
57
61
  Trigger.Kinds.map((kind) => ({
58
62
  value: kind,
59
- label: t(`trigger type ${kind}`),
63
+ label: kindLabels[kind],
60
64
  })),
61
65
  [t],
62
66
  );
@@ -6,19 +6,19 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
  import { expect, userEvent, within } from 'storybook/test';
8
8
 
9
+ import { Operation, Trigger } from '@dxos/compute';
9
10
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
10
- import { Function, Trigger } from '@dxos/functions';
11
11
  import { invariant } from '@dxos/invariant';
12
- import { faker } from '@dxos/random';
12
+ import { random } from '@dxos/random';
13
13
  import { useQuery } from '@dxos/react-client/echo';
14
14
  import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
15
  import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form/translations';
16
17
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { translations as formTranslations } from '@dxos/react-ui-form';
18
18
  import { Employer, Organization, Person, Pipeline } from '@dxos/types';
19
19
 
20
- import { functions } from '../../testing';
21
- import { translations } from '../../translations';
20
+ import { functions } from '#testing';
21
+ import { translations } from '#translations';
22
22
 
23
23
  import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
24
24
 
@@ -40,13 +40,13 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
40
40
  return;
41
41
  }
42
42
 
43
- const functions = await space.db.query(Filter.type(Function.Function)).run();
44
- const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
43
+ const functions = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
44
+ const fn = functions.find((fn) => fn.name === 'com.example.function.forex');
45
45
  invariant(fn);
46
46
  const trigger = space.db.add(
47
47
  Trigger.make({
48
48
  function: Ref.make(fn),
49
- spec: { kind: 'webhook' },
49
+ spec: Trigger.specWebhook(),
50
50
  input: {
51
51
  from: 'USD',
52
52
  to: 'JPY',
@@ -82,7 +82,7 @@ const meta = {
82
82
  withClientProvider({
83
83
  createIdentity: true,
84
84
  createSpace: true,
85
- types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
85
+ types: [Tag.Tag, Operation.PersistentOperation, Trigger.Trigger, TestSchema.ContactType],
86
86
  onCreateSpace: ({ space }) => {
87
87
  // Tags.
88
88
  ['Important', 'Investor', 'New'].forEach((label) => {
@@ -91,14 +91,20 @@ const meta = {
91
91
 
92
92
  // Functions.
93
93
  functions.forEach((fn) => {
94
- space.db.add(Function.make(fn));
94
+ const { key, version, ...data } = fn;
95
+ space.db.add(
96
+ Obj.make(Operation.PersistentOperation, {
97
+ [Obj.Meta]: { key, version: version ?? '0.1.0' },
98
+ ...data,
99
+ }),
100
+ );
95
101
  });
96
102
 
97
103
  // Objects.
98
104
  Array.from({ length: 10 }).map(() => {
99
105
  return space.db.add(
100
106
  Obj.make(TestSchema.ContactType, {
101
- name: faker.person.fullName(),
107
+ name: random.person.fullName(),
102
108
  identifiers: [],
103
109
  }),
104
110
  );
@@ -159,8 +165,8 @@ export const Spec: Story = {
159
165
  await expect(combobox).not.toBeDisabled();
160
166
  await expect(canvas.queryByLabelText('Method')).not.toBeInTheDocument();
161
167
 
162
- // Queue — should show DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
163
- await selectKind(combobox, 'q');
168
+ // Feed — should show DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
169
+ await selectKind(combobox, 'f');
164
170
  await expect(canvas.findByText('DXN')).resolves.toBeInTheDocument();
165
171
  },
166
172
  };
@@ -4,10 +4,10 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
+ import { Operation, Script, Trigger } from '@dxos/compute';
7
8
  import { ComputeGraph } from '@dxos/conductor';
8
- import { DXN, type Database, Entity, Feed, Obj, type Query } from '@dxos/echo';
9
- import { Function, Script, Trigger } from '@dxos/functions';
10
- import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
9
+ import { type Database, DXN, Entity, Feed, Filter, Obj, type Query, Ref } from '@dxos/echo';
10
+ import { useQuery } from '@dxos/react-client/echo';
11
11
  import { Input } from '@dxos/react-ui';
12
12
  import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
13
13
  import {
@@ -36,17 +36,12 @@ export type TriggerEditorProps = {
36
36
  Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
37
37
 
38
38
  export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
- const fieldMap = useCustomInputs({
40
- db,
41
- types,
42
- tags,
43
- readonlySpec,
44
- });
39
+ const fieldMap = useCustomInputs({ db, types, tags, readonlySpec });
45
40
 
46
41
  const handleValuesChanged = useCallback(
47
42
  (newValues: Partial<TriggerFormSchema>) => {
48
- Obj.change(trigger, (t) => {
49
- Object.assign(t, newValues);
43
+ Obj.update(trigger, (trigger) => {
44
+ Object.assign(trigger, newValues);
50
45
  });
51
46
  },
52
47
  [trigger],
@@ -83,7 +78,7 @@ type UseCustomInputsProps = {
83
78
  } & Pick<QueryFormProps, 'types' | 'tags'>;
84
79
 
85
80
  const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
86
- const functions = useQuery(db, Filter.type(Function.Function));
81
+ const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
87
82
  const workflows = useQuery(db, Filter.type(ComputeGraph));
88
83
  const scripts = useQuery(db, Filter.type(Script.Script));
89
84
  const feeds = useQuery(db, Filter.type(Feed.Feed));
@@ -154,19 +149,20 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
154
149
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
155
150
  };
156
151
 
157
- const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
158
- const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
152
+ const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
153
+ const getLabel = (fn: Operation.PersistentOperation) =>
154
+ scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
159
155
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
160
156
  };
161
157
 
162
158
  const getFeedQueueOptions = (feeds: Feed.Feed[]) => {
163
159
  return feeds.flatMap((feed) => {
164
- const queueDxn = Feed.getQueueDxn(feed);
165
- if (!queueDxn) {
160
+ const queueDXN = Feed.getQueueDxn(feed);
161
+ if (!queueDXN) {
166
162
  return [];
167
163
  }
168
164
  const parent = Obj.getParent(feed);
169
165
  const label = parent ? Entity.getLabel(parent) : Entity.getLabel(feed);
170
- return [{ label: label ?? feed.id, value: queueDxn.toString() }];
166
+ return [{ label: label ?? feed.id, value: queueDXN.toString() }];
171
167
  });
172
168
  };
@@ -4,24 +4,28 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
7
8
  import { useTranslation } from '@dxos/react-ui';
8
9
  import { Settings } from '@dxos/react-ui-form';
9
10
 
11
+ import { meta } from '#meta';
12
+
10
13
  import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
11
- import { meta } from '../../meta';
12
14
  import { TriggersSettings } from '../TriggerSettings';
13
15
 
14
- export const AutomationSettings = (props: AutomationPanelProps) => {
16
+ export type AutomationSettingsProps = AppSurface.SpaceArticleProps<Omit<AutomationPanelProps, 'space'>>;
17
+
18
+ export const AutomationSettings = (props: AutomationSettingsProps) => {
15
19
  const { t } = useTranslation(meta.id);
16
20
  return (
17
- <Settings.Root>
21
+ <Settings.Viewport>
18
22
  <Settings.Section
19
- title={t('automation verbose label', { ns: meta.id })}
20
- description={t('automation description', { ns: meta.id })}
23
+ title={t('automation-verbose.label', { ns: meta.id })}
24
+ description={t('automation.description', { ns: meta.id })}
21
25
  >
22
26
  <AutomationPanel {...props} />
23
- <TriggersSettings db={props.space.db} />
27
+ <TriggersSettings space={props.space} />
24
28
  </Settings.Section>
25
- </Settings.Root>
29
+ </Settings.Viewport>
26
30
  );
27
31
  };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { AutomationSettings } from './AutomationSettings';
6
-
7
- export default AutomationSettings;
5
+ export { AutomationSettings as default } from './AutomationSettings';
@@ -4,30 +4,30 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type Space } from '@dxos/react-client/echo';
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
9
  import { Settings } from '@dxos/react-ui-form';
10
10
 
11
- import { FunctionsPanel } from '../../components/FunctionsPanel';
12
- import { FunctionsRegistry } from '../../components/FunctionsRegistry';
13
- import { meta } from '../../meta';
11
+ import { meta } from '#meta';
14
12
 
15
- export const FunctionsContainer = ({ space }: { space: Space }) => {
13
+ import { FunctionsPanel, FunctionsRegistry } from '../../components';
14
+
15
+ export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
16
16
  const { t } = useTranslation(meta.id);
17
17
  return (
18
- <Settings.Root>
18
+ <Settings.Viewport>
19
19
  <Settings.Section
20
- title={t('functions verbose label', { ns: meta.id })}
21
- description={t('functions description', { ns: meta.id })}
20
+ title={t('functions-verbose.label', { ns: meta.id })}
21
+ description={t('functions.description', { ns: meta.id })}
22
22
  >
23
23
  <FunctionsPanel space={space} />
24
24
  </Settings.Section>
25
25
  <Settings.Section
26
- title={t('functions registry verbose label', { ns: meta.id })}
27
- description={t('functions registry description', { ns: meta.id })}
26
+ title={t('functions-registry-verbose.label', { ns: meta.id })}
27
+ description={t('functions-registry.description', { ns: meta.id })}
28
28
  >
29
29
  <FunctionsRegistry space={space} />
30
30
  </Settings.Section>
31
- </Settings.Root>
31
+ </Settings.Viewport>
32
32
  );
33
33
  };
@@ -2,6 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { FunctionsContainer } from './FunctionsContainer';
6
-
7
- export default FunctionsContainer;
5
+ export { FunctionsContainer as default } from './FunctionsContainer';
@@ -4,23 +4,45 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type Database } from '@dxos/echo';
8
- import { Input, useTranslation } from '@dxos/react-ui';
7
+ import { type ComputeEnvironment } from '@dxos/client-protocol';
8
+ import { useObject } from '@dxos/echo-react';
9
+ import { type Space } from '@dxos/react-client/echo';
10
+ import { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';
9
11
  import { Settings } from '@dxos/react-ui-form';
10
12
 
11
- import { useTriggerRuntimeControls } from '../../hooks';
12
- import { meta } from '../../meta';
13
+ import { meta } from '#meta';
13
14
 
14
- export const TriggersSettings = ({ db }: { db: Database.Database }) => {
15
- const { state, start, stop } = useTriggerRuntimeControls(db);
16
- const isRunning = state?.enabled ?? false;
15
+ export const TriggersSettings = ({ space }: { space: Space }) => {
17
16
  const { t } = useTranslation(meta.id);
17
+ const [properties, changeProperties] = useObject(space.properties);
18
+ const selected = properties.computeEnvironment ?? 'local';
19
+
20
+ const handleUpdate = (option: ComputeEnvironment) => {
21
+ changeProperties((draft) => {
22
+ draft.computeEnvironment = option;
23
+ });
24
+ };
18
25
 
19
26
  return (
20
27
  <div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
21
- <Settings.ItemInput title={t('runtime label')} description={t('runtime description')}>
22
- <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
23
- </Settings.ItemInput>
28
+ <Settings.Item title={t('runtime.label')} description={t('runtime.description')}>
29
+ <DropdownMenu.Root>
30
+ <DropdownMenu.Trigger asChild>
31
+ <IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />
32
+ </DropdownMenu.Trigger>
33
+ <DropdownMenu.Portal>
34
+ <DropdownMenu.Content side='bottom'>
35
+ <DropdownMenu.Viewport>
36
+ <DropdownMenu.Item onClick={() => handleUpdate('disabled')}>
37
+ {t(`runtime.disabled.label`)}
38
+ </DropdownMenu.Item>
39
+ <DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>
40
+ <DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>
41
+ </DropdownMenu.Viewport>
42
+ </DropdownMenu.Content>
43
+ </DropdownMenu.Portal>
44
+ </DropdownMenu.Root>
45
+ </Settings.Item>
24
46
  </div>
25
47
  );
26
48
  };