@dxos/plugin-automation 0.8.4-main.72ec0f3 → 0.8.4-main.8360d9e660

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 (326) hide show
  1. package/dist/lib/browser/AutomationPanel-IGLIQY2N.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-XGJGVBDD.mjs +37 -0
  3. package/dist/lib/browser/AutomationSettings-XGJGVBDD.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +43 -0
  5. package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs → FunctionsPanel-NMA4RYJL.mjs} +3 -3
  7. package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +10 -0
  8. package/dist/lib/browser/TriggerSettings-GW5OEM2G.mjs +11 -0
  9. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs +83 -0
  10. package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-5WMYSXEH.mjs +83 -0
  12. package/dist/lib/browser/chunk-5WMYSXEH.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-75XLBFAG.mjs +97 -0
  14. package/dist/lib/browser/chunk-75XLBFAG.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-BWEKRPFJ.mjs +294 -0
  16. package/dist/lib/browser/chunk-BWEKRPFJ.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-LZQFZO3B.mjs → chunk-EL64ZPPN.mjs} +2 -2
  18. package/dist/lib/browser/chunk-EL64ZPPN.mjs.map +7 -0
  19. package/dist/lib/browser/chunk-FUVAC5EC.mjs +96 -0
  20. package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +7 -0
  21. package/dist/lib/browser/chunk-LHJEQVX5.mjs +8 -0
  22. package/dist/lib/browser/chunk-LHJEQVX5.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-O23LHDEX.mjs +269 -0
  24. package/dist/lib/browser/chunk-O23LHDEX.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-PUYY7B5F.mjs +31 -0
  26. package/dist/lib/browser/chunk-PUYY7B5F.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-ZBEMNWNY.mjs +93 -0
  28. package/dist/lib/browser/chunk-ZBEMNWNY.mjs.map +7 -0
  29. package/dist/lib/browser/cli/index.mjs +1115 -0
  30. package/dist/lib/browser/cli/index.mjs.map +7 -0
  31. package/dist/lib/browser/compute-runtime-I3I2BIRE.mjs +130 -0
  32. package/dist/lib/browser/compute-runtime-I3I2BIRE.mjs.map +7 -0
  33. package/dist/lib/browser/hooks/index.mjs +3 -3
  34. package/dist/lib/browser/index.mjs +55 -62
  35. package/dist/lib/browser/index.mjs.map +4 -4
  36. package/dist/lib/browser/meta.json +1 -1
  37. package/dist/lib/browser/operation-resolver-NGN4BEWN.mjs +84 -0
  38. package/dist/lib/browser/operation-resolver-NGN4BEWN.mjs.map +7 -0
  39. package/dist/lib/browser/react-surface-SXDIM3RM.mjs +65 -0
  40. package/dist/lib/browser/react-surface-SXDIM3RM.mjs.map +7 -0
  41. package/dist/lib/browser/types/index.mjs +10 -4
  42. package/dist/lib/node-esm/{AutomationPanel-HCVFNHGQ.mjs → AutomationPanel-O2BCQA7P.mjs} +4 -4
  43. package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs.map +7 -0
  44. package/dist/lib/node-esm/AutomationSettings-W52ZO2XI.mjs +38 -0
  45. package/dist/lib/node-esm/AutomationSettings-W52ZO2XI.mjs.map +7 -0
  46. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +44 -0
  47. package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +7 -0
  48. package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs → FunctionsPanel-DCXXLSVP.mjs} +3 -3
  49. package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs.map +7 -0
  50. package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +11 -0
  51. package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs.map +7 -0
  52. package/dist/lib/node-esm/TriggerSettings-2GKFPECW.mjs +12 -0
  53. package/dist/lib/node-esm/TriggerSettings-2GKFPECW.mjs.map +7 -0
  54. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs +84 -0
  55. package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs +97 -0
  57. package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-BNWZ2NNI.mjs +32 -0
  59. package/dist/lib/node-esm/chunk-BNWZ2NNI.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs +270 -0
  61. package/dist/lib/node-esm/chunk-FPXVLTEY.mjs.map +7 -0
  62. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs +98 -0
  63. package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs +295 -0
  65. package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-V3VUE2NR.mjs +10 -0
  67. package/dist/lib/node-esm/chunk-V3VUE2NR.mjs.map +7 -0
  68. package/dist/lib/node-esm/{chunk-CEVIVRTY.mjs → chunk-WC5AT7B3.mjs} +2 -2
  69. package/dist/lib/node-esm/chunk-WC5AT7B3.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-XCFO2IXT.mjs +84 -0
  71. package/dist/lib/node-esm/chunk-XCFO2IXT.mjs.map +7 -0
  72. package/dist/lib/node-esm/{chunk-PICJ2REN.mjs → chunk-XQO3HK62.mjs} +30 -37
  73. package/dist/lib/node-esm/chunk-XQO3HK62.mjs.map +7 -0
  74. package/dist/lib/node-esm/cli/index.mjs +1116 -0
  75. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  76. package/dist/lib/node-esm/compute-runtime-7HCSIYFG.mjs +131 -0
  77. package/dist/lib/node-esm/compute-runtime-7HCSIYFG.mjs.map +7 -0
  78. package/dist/lib/node-esm/hooks/index.mjs +3 -3
  79. package/dist/lib/node-esm/index.mjs +55 -62
  80. package/dist/lib/node-esm/index.mjs.map +4 -4
  81. package/dist/lib/node-esm/meta.json +1 -1
  82. package/dist/lib/node-esm/operation-resolver-ANGACQZG.mjs +85 -0
  83. package/dist/lib/node-esm/operation-resolver-ANGACQZG.mjs.map +7 -0
  84. package/dist/lib/node-esm/react-surface-QVLVDEVW.mjs +66 -0
  85. package/dist/lib/node-esm/react-surface-QVLVDEVW.mjs.map +7 -0
  86. package/dist/lib/node-esm/types/index.mjs +10 -4
  87. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  88. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  90. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  92. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  94. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  96. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/index.d.ts +4 -5
  98. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  100. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  102. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  104. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  106. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/index.d.ts +2 -0
  108. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  110. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  112. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  114. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  116. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  118. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  120. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  121. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  122. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  124. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  126. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  128. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  130. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  132. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  134. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  135. package/dist/types/src/cli/index.d.ts +2 -0
  136. package/dist/types/src/cli/index.d.ts.map +1 -0
  137. package/dist/types/src/cli/plugin.d.ts +3 -0
  138. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  139. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +4 -5
  140. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  141. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +2 -0
  142. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  143. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  144. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  145. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  146. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  147. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +10 -7
  148. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  149. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  150. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  151. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
  152. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  153. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +72 -2
  154. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  155. package/dist/types/src/components/index.d.ts +3 -4
  156. package/dist/types/src/components/index.d.ts.map +1 -1
  157. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  158. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  159. package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
  160. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  161. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  162. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  163. package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
  164. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  165. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  166. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  167. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  168. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  169. package/dist/types/src/containers/index.d.ts +5 -0
  170. package/dist/types/src/containers/index.d.ts.map +1 -0
  171. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +6 -6
  172. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  173. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +4 -3
  174. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  175. package/dist/types/src/index.d.ts +1 -2
  176. package/dist/types/src/index.d.ts.map +1 -1
  177. package/dist/types/src/meta.d.ts +2 -2
  178. package/dist/types/src/meta.d.ts.map +1 -1
  179. package/dist/types/src/testing/test-functions.d.ts +202 -3
  180. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  181. package/dist/types/src/translations.d.ts +2 -0
  182. package/dist/types/src/translations.d.ts.map +1 -1
  183. package/dist/types/src/types/capabilities.d.ts +23 -0
  184. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  185. package/dist/types/src/types/events.d.ts +5 -0
  186. package/dist/types/src/types/events.d.ts.map +1 -0
  187. package/dist/types/src/types/index.d.ts +2 -0
  188. package/dist/types/src/types/index.d.ts.map +1 -1
  189. package/dist/types/src/types/schema.d.ts +32 -3
  190. package/dist/types/src/types/schema.d.ts.map +1 -1
  191. package/dist/types/tsconfig.tsbuildinfo +1 -1
  192. package/package.json +67 -50
  193. package/src/AutomationPlugin.tsx +14 -33
  194. package/src/capabilities/app-graph-builder/app-graph-builder.ts +73 -0
  195. package/src/capabilities/app-graph-builder/index.ts +7 -0
  196. package/src/capabilities/compute-runtime/compute-runtime.ts +155 -0
  197. package/src/capabilities/compute-runtime/index.ts +7 -0
  198. package/src/capabilities/index.ts +4 -8
  199. package/src/capabilities/operation-resolver/index.ts +7 -0
  200. package/src/capabilities/operation-resolver/operation-resolver.ts +80 -0
  201. package/src/capabilities/react-surface/index.ts +7 -0
  202. package/src/capabilities/react-surface/react-surface.tsx +57 -0
  203. package/src/cli/commands/index.ts +5 -0
  204. package/src/cli/commands/trigger/create/index.ts +14 -0
  205. package/src/cli/commands/trigger/create/queue.ts +89 -0
  206. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  207. package/src/cli/commands/trigger/create/timer.ts +93 -0
  208. package/src/cli/commands/trigger/index.ts +16 -0
  209. package/src/cli/commands/trigger/list.ts +67 -0
  210. package/src/cli/commands/trigger/options.ts +59 -0
  211. package/src/cli/commands/trigger/remove.ts +45 -0
  212. package/src/cli/commands/trigger/update/index.ts +14 -0
  213. package/src/cli/commands/trigger/update/queue.ts +195 -0
  214. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  215. package/src/cli/commands/trigger/update/timer.ts +193 -0
  216. package/src/cli/commands/trigger/util.ts +404 -0
  217. package/src/cli/index.ts +5 -0
  218. package/src/cli/plugin.ts +24 -0
  219. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +3 -3
  220. package/src/components/AutomationPanel/AutomationPanel.tsx +165 -69
  221. package/src/components/FunctionsPanel/FunctionsPanel.tsx +17 -24
  222. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +18 -43
  223. package/src/components/FunctionsRegistry/index.ts +4 -1
  224. package/src/components/TriggerEditor/FunctionInputEditor.tsx +32 -31
  225. package/src/components/TriggerEditor/SpecSelector.tsx +9 -7
  226. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +75 -30
  227. package/src/components/TriggerEditor/TriggerEditor.tsx +90 -45
  228. package/src/components/index.ts +1 -2
  229. package/src/{components → containers/AutomationSettings}/AutomationSettings.tsx +9 -12
  230. package/src/containers/AutomationSettings/index.ts +7 -0
  231. package/src/{components → containers/FunctionsContainer}/FunctionsContainer.tsx +10 -13
  232. package/src/containers/FunctionsContainer/index.ts +7 -0
  233. package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
  234. package/src/containers/TriggerSettings/index.ts +6 -0
  235. package/src/containers/index.ts +9 -0
  236. package/src/hooks/useComputeRuntimeCallback.ts +10 -11
  237. package/src/hooks/useTriggerRuntimeControls.ts +28 -14
  238. package/src/index.ts +1 -2
  239. package/src/meta.ts +3 -3
  240. package/src/testing/test-functions.ts +6 -6
  241. package/src/translations.ts +4 -0
  242. package/src/{capabilities → types}/capabilities.ts +11 -7
  243. package/src/types/events.ts +11 -0
  244. package/src/types/index.ts +2 -0
  245. package/src/types/schema.ts +24 -3
  246. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  247. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  248. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  249. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  250. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  251. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  252. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  254. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  255. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  256. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  257. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  258. package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
  259. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  260. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  261. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  263. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  265. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  266. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  267. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  268. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  269. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  270. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  271. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  272. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  273. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  274. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  275. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  276. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  277. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  278. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  279. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  280. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  281. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  282. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  284. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  286. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  288. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  289. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  291. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  293. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  294. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  295. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  296. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  297. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  298. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  299. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  300. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  301. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  302. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  303. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  304. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  305. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  306. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  307. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  308. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  309. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  310. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  311. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  312. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  313. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  314. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  315. package/dist/types/src/events.d.ts +0 -4
  316. package/dist/types/src/events.d.ts.map +0 -1
  317. package/src/capabilities/app-graph-builder.ts +0 -87
  318. package/src/capabilities/compute-runtime.ts +0 -127
  319. package/src/capabilities/intent-resolver.ts +0 -72
  320. package/src/capabilities/react-surface.tsx +0 -56
  321. package/src/components/TriggerSettings.tsx +0 -25
  322. package/src/events.ts +0 -11
  323. /package/dist/lib/browser/{AutomationPanel-7OECLR5N.mjs.map → AutomationPanel-IGLIQY2N.mjs.map} +0 -0
  324. /package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs.map → FunctionsPanel-NMA4RYJL.mjs.map} +0 -0
  325. /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → browser/FunctionsRegistry-TMKAEG5E.mjs.map} +0 -0
  326. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → browser/TriggerSettings-GW5OEM2G.mjs.map} +0 -0
@@ -7,15 +7,15 @@ import React, { useCallback, useMemo } from 'react';
7
7
  import { Filter, Query } from '@dxos/echo';
8
8
  import { Trigger } from '@dxos/functions';
9
9
  import { useTranslation } from '@dxos/react-ui';
10
- import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
10
+ import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
11
11
 
12
12
  import { meta } from '../../meta';
13
13
 
14
- export type SpecSelectorProps = InputProps;
14
+ export type SpecSelectorProps = FormFieldComponentProps;
15
15
 
16
16
  export const SpecSelector = (props: SpecSelectorProps) => {
17
17
  const { t } = useTranslation(meta.id);
18
- const specProps = useInputProps(['spec' satisfies keyof Trigger.Trigger]);
18
+ const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);
19
19
 
20
20
  const handleTypeChange = useCallback(
21
21
  (_type: any, value: string): Trigger.Spec | undefined => {
@@ -31,7 +31,7 @@ export const SpecSelector = (props: SpecSelectorProps) => {
31
31
  },
32
32
  };
33
33
  case 'queue':
34
- return { kind: 'queue', queue: 'dxn:' };
34
+ return { kind: 'queue', queue: 'dxn:queue:default' };
35
35
  case 'email':
36
36
  return { kind: 'email' };
37
37
  case 'webhook':
@@ -47,9 +47,9 @@ export const SpecSelector = (props: SpecSelectorProps) => {
47
47
  }
48
48
 
49
49
  // Update the entire spec object, not just the `spec.kind`.
50
- specProps.onValueChange('object', defaultSpec);
50
+ specProps.onValueChange(props.type, defaultSpec);
51
51
  },
52
- [specProps],
52
+ [props.type, specProps],
53
53
  );
54
54
 
55
55
  const options = useMemo(
@@ -61,5 +61,7 @@ export const SpecSelector = (props: SpecSelectorProps) => {
61
61
  [t],
62
62
  );
63
63
 
64
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
64
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
65
65
  };
66
+
67
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -4,17 +4,18 @@
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
+ import { expect, userEvent, within } from 'storybook/test';
7
8
 
8
9
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
- import { Function } from '@dxos/functions';
10
- import { Trigger } from '@dxos/functions';
10
+ import { Function, Trigger } from '@dxos/functions';
11
11
  import { invariant } from '@dxos/invariant';
12
12
  import { faker } from '@dxos/random';
13
13
  import { useQuery } from '@dxos/react-client/echo';
14
- import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
14
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
15
  import { useAsyncEffect } from '@dxos/react-ui';
16
16
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { Employer, Organization, Person, Project } from '@dxos/types';
17
+ import { translations as formTranslations } from '@dxos/react-ui-form';
18
+ import { Employer, Organization, Person, Pipeline } from '@dxos/types';
18
19
 
19
20
  import { functions } from '../../testing';
20
21
  import { translations } from '../../translations';
@@ -25,22 +26,22 @@ const types = [
25
26
  // TODO(burdon): Get label from annotation.
26
27
  { value: Organization.Organization.typename, label: 'Organization' },
27
28
  { value: Person.Person.typename, label: 'Person' },
28
- { value: Type.getTypename(Project.Project), label: 'Project' },
29
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
29
30
  { value: Employer.Employer.typename, label: 'Employer' },
30
31
  ];
31
32
 
32
33
  const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
- const { space } = useClientProvider();
34
+ const { space } = useClientStory();
34
35
  const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
- const tags = useQuery(space, Filter.type(Tag.Tag));
36
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
36
37
 
37
38
  useAsyncEffect(async () => {
38
39
  if (!space) {
39
40
  return;
40
41
  }
41
42
 
42
- const result = await space.db.query(Filter.type(Function.Function)).run();
43
- const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
43
+ const functions = await space.db.query(Filter.type(Function.Function)).run();
44
+ const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
44
45
  invariant(fn);
45
46
  const trigger = space.db.add(
46
47
  Trigger.make({
@@ -60,41 +61,43 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
60
61
  }
61
62
 
62
63
  return (
63
- <div role='none' className='is-[32rem] bs-fit border border-separator rounded-sm'>
64
- <TriggerEditor
65
- space={space}
66
- trigger={trigger}
67
- types={types}
68
- tags={tags}
69
- onSave={(values) => console.log('on save', values)}
70
- {...props}
71
- />
72
- </div>
64
+ <TriggerEditor
65
+ db={space.db}
66
+ trigger={trigger}
67
+ types={types}
68
+ tags={tags}
69
+ onSave={(values) => console.log('on save', values)}
70
+ {...props}
71
+ />
73
72
  );
74
73
  };
75
74
 
76
75
  const meta = {
77
- title: 'plugins/plugin-automation/TriggerEditor',
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
78
77
  component: TriggerEditor as any,
79
78
  render: DefaultStory,
80
79
  decorators: [
81
- withTheme,
82
- withLayout({ container: 'column' }),
80
+ withTheme(),
81
+ withLayout({ layout: 'column' }),
83
82
  withClientProvider({
84
83
  createIdentity: true,
85
84
  createSpace: true,
86
- types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
85
+ types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
87
86
  onCreateSpace: ({ space }) => {
88
- space.db.add(Tag.make({ label: 'Important' }));
89
- space.db.add(Tag.make({ label: 'Investor' }));
90
- space.db.add(Tag.make({ label: 'New' }));
87
+ // Tags.
88
+ ['Important', 'Investor', 'New'].forEach((label) => {
89
+ space.db.add(Tag.make({ label }));
90
+ });
91
91
 
92
- for (const fn of functions) {
92
+ // Functions.
93
+ functions.forEach((fn) => {
93
94
  space.db.add(Function.make(fn));
94
- }
95
+ });
96
+
97
+ // Objects.
95
98
  Array.from({ length: 10 }).map(() => {
96
99
  return space.db.add(
97
- Obj.make(ContactType, {
100
+ Obj.make(TestSchema.ContactType, {
98
101
  name: faker.person.fullName(),
99
102
  identifiers: [],
100
103
  }),
@@ -104,7 +107,8 @@ const meta = {
104
107
  }),
105
108
  ],
106
109
  parameters: {
107
- translations,
110
+ layout: 'fullscreen',
111
+ translations: [...formTranslations, ...translations],
108
112
  },
109
113
  } satisfies Meta<typeof DefaultStory>;
110
114
 
@@ -119,3 +123,44 @@ export const ReadonlySpec: Story = {
119
123
  readonlySpec: true,
120
124
  },
121
125
  };
126
+
127
+ export const Spec: Story = {
128
+ play: async ({ canvasElement }) => {
129
+ const canvas = within(canvasElement);
130
+ const webhookText = await canvas.findByText('Webhook', {}, { timeout: 10_000 });
131
+ const combobox = webhookText.closest('[role="combobox"]') as HTMLElement;
132
+ await expect(combobox).not.toBeDisabled();
133
+
134
+ // Helper to switch to a kind via keyboard.
135
+ // TODO(wittjosiah): Radix Select in popper mode doesn't close on click.
136
+ // Use keyboard navigation: open, type first letter to jump, Enter to select.
137
+ const selectKind = async (combobox: HTMLElement, firstLetter: string) => {
138
+ combobox.focus();
139
+ await userEvent.keyboard('{Enter}');
140
+ await userEvent.keyboard(firstLetter);
141
+ await userEvent.keyboard('{Enter}');
142
+ };
143
+
144
+ // Timer — should show "Cron" field.
145
+ await selectKind(combobox, 't');
146
+ await expect(canvas.findByLabelText('Cron')).resolves.toBeInTheDocument();
147
+
148
+ // Email — no extra fields; Cron should be gone.
149
+ await selectKind(combobox, 'e');
150
+ await expect(combobox).not.toBeDisabled();
151
+ await expect(canvas.queryByLabelText('Cron')).not.toBeInTheDocument();
152
+
153
+ // Webhook — should show "Method" field.
154
+ await selectKind(combobox, 'w');
155
+ await expect(canvas.findByLabelText('Method')).resolves.toBeInTheDocument();
156
+
157
+ // Subscription — should show query editor.
158
+ await selectKind(combobox, 's');
159
+ await expect(combobox).not.toBeDisabled();
160
+ await expect(canvas.queryByLabelText('Method')).not.toBeInTheDocument();
161
+
162
+ // Queue — should show DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
163
+ await selectKind(combobox, 'q');
164
+ await expect(canvas.findByText('DXN')).resolves.toBeInTheDocument();
165
+ },
166
+ };
@@ -5,59 +5,91 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { type Query, Type } from '@dxos/echo';
8
+ import { DXN, type Database, Entity, Feed, Obj, type Query } from '@dxos/echo';
9
9
  import { Function, Script, Trigger } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
10
+ import { Filter, Ref, 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
- import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
14
-
15
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
13
+ import {
14
+ type ExcludeId,
15
+ Form,
16
+ FormFieldLabel,
17
+ type FormFieldMap,
18
+ type FormRootProps,
19
+ SelectField,
20
+ omitId,
21
+ } from '@dxos/react-ui-form';
22
+
23
+ import { FunctionInputEditor } from './FunctionInputEditor';
16
24
  import { SpecSelector } from './SpecSelector';
17
25
 
26
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
27
+
18
28
  export type TriggerEditorProps = {
19
- space: Space;
29
+ db: Database.Database;
20
30
  trigger: Trigger.Trigger;
21
31
  // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
22
32
  readonlySpec?: boolean;
23
- onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;
24
- onCancel?: () => void;
25
- } & Pick<QueryFormProps, 'types' | 'tags'>;
26
-
27
- export const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {
28
- const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {
29
- onSave?.(values);
30
- };
33
+ } &
34
+ // prettier-ignore
35
+ Pick<QueryFormProps, 'types' | 'tags'> &
36
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
37
+
38
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
+ const fieldMap = useCustomInputs({
40
+ db,
41
+ types,
42
+ tags,
43
+ readonlySpec,
44
+ });
45
+
46
+ const handleValuesChanged = useCallback(
47
+ (newValues: Partial<TriggerFormSchema>) => {
48
+ Obj.change(trigger, (t) => {
49
+ Object.assign(t, newValues);
50
+ });
51
+ },
52
+ [trigger],
53
+ );
31
54
 
32
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
33
- const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
55
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
56
+ const defaultValues = useMemo(() => {
57
+ const { id: _, ...values } = trigger;
58
+ return values;
59
+ }, [trigger]);
34
60
 
35
61
  return (
36
- <Form
37
- outerSpacing={false}
38
- Custom={Custom}
39
- schema={Trigger.Trigger}
40
- values={trigger}
41
- onSave={handleSave}
42
- onCancel={onCancel}
43
- onQueryRefOptions={handleRefQueryLookup}
44
- />
62
+ <Form.Root<TriggerFormSchema>
63
+ {...formProps}
64
+ db={db}
65
+ schema={triggerSchema}
66
+ defaultValues={defaultValues}
67
+ fieldMap={fieldMap}
68
+ onValuesChanged={handleValuesChanged}
69
+ >
70
+ <Form.Viewport>
71
+ <Form.Content>
72
+ <Form.FieldSet />
73
+ <Form.Actions />
74
+ </Form.Content>
75
+ </Form.Viewport>
76
+ </Form.Root>
45
77
  );
46
78
  };
47
79
 
48
80
  type UseCustomInputsProps = {
49
- space: Space;
81
+ db: Database.Database;
50
82
  readonlySpec?: boolean;
51
- onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
52
83
  } & Pick<QueryFormProps, 'types' | 'tags'>;
53
84
 
54
- const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {
55
- const functions = useQuery(space, Filter.type(Function.Function));
56
- const workflows = useQuery(space, Filter.type(ComputeGraph));
57
- const scripts = useQuery(space, Filter.type(Script.Script));
85
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
86
+ const functions = useQuery(db, Filter.type(Function.Function));
87
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
88
+ const scripts = useQuery(db, Filter.type(Script.Script));
89
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
58
90
 
59
91
  return useMemo(
60
- (): CustomInputMap => ({
92
+ (): FormFieldMap => ({
61
93
  // Function selector.
62
94
  ['function' satisfies keyof Trigger.Trigger]: (props) => {
63
95
  const getValue = useCallback(() => {
@@ -70,17 +102,17 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
70
102
 
71
103
  const handleOnValueChange = useCallback(
72
104
  (_type: any, dxnString: string) => {
73
- const dxn = Type.DXN.parse(dxnString);
105
+ const dxn = DXN.parse(dxnString);
74
106
  if (dxn) {
75
107
  const ref = Ref.fromDXN(dxn);
76
- props.onValueChange('object', ref);
108
+ props.onValueChange(props.type, ref);
77
109
  }
78
110
  },
79
- [props.onValueChange],
111
+ [props.type, props.onValueChange],
80
112
  );
81
113
 
82
114
  return (
83
- <SelectInput
115
+ <SelectField
84
116
  {...props}
85
117
  getValue={getValue as any}
86
118
  onValueChange={handleOnValueChange}
@@ -90,30 +122,31 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
90
122
  },
91
123
 
92
124
  // Spec selector.
93
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
125
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
126
+
127
+ // Queue feed selector with parent labels.
128
+ 'spec.queue': (props) => <SelectField {...props} options={getFeedQueueOptions(feeds)} />,
94
129
 
95
130
  // TODO(wittjosiah): Copied from ViewEditor.
96
131
  // Query input editor.
97
- ['spec.query' as const]: (props) => {
132
+ 'spec.query': (props) => {
98
133
  const handleChange = useCallback(
99
- (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
100
- [props.onValueChange],
134
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
135
+ [props.type, props.onValueChange],
101
136
  );
102
137
 
103
138
  return (
104
139
  <Input.Root>
105
- <InputHeader label={props.label} />
140
+ <FormFieldLabel label={props.label} asChild />
106
141
  <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
107
142
  </Input.Root>
108
143
  );
109
144
  },
110
145
 
111
146
  // Function input editor.
112
- ['input' as const]: (props) => (
113
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
114
- ),
147
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
115
148
  }),
116
- [workflows, scripts, functions, readonlySpec],
149
+ [workflows, scripts, functions, feeds, readonlySpec],
117
150
  );
118
151
  };
119
152
 
@@ -125,3 +158,15 @@ const getFunctionOptions = (scripts: Script.Script[], functions: Function.Functi
125
158
  const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
126
159
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
127
160
  };
161
+
162
+ const getFeedQueueOptions = (feeds: Feed.Feed[]) => {
163
+ return feeds.flatMap((feed) => {
164
+ const queueDxn = Feed.getQueueDxn(feed);
165
+ if (!queueDxn) {
166
+ return [];
167
+ }
168
+ const parent = Obj.getParent(feed);
169
+ const label = parent ? Entity.getLabel(parent) : Entity.getLabel(feed);
170
+ return [{ label: label ?? feed.id, value: queueDxn.toString() }];
171
+ });
172
+ };
@@ -7,6 +7,5 @@ import { lazy } from 'react';
7
7
  export * from './TriggerEditor';
8
8
 
9
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
10
- export const AutomationSettings = lazy(() => import('./AutomationSettings'));
11
- export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
12
10
  export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
11
+ export const FunctionsRegistry = lazy(() => import('./FunctionsRegistry'));
@@ -5,26 +5,23 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { useTranslation } from '@dxos/react-ui';
8
- import { ControlPage, ControlSection } from '@dxos/react-ui-form';
8
+ import { Settings } from '@dxos/react-ui-form';
9
9
 
10
- import { meta } from '../meta';
11
-
12
- import { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';
13
- import { TriggersSettings } from './TriggerSettings';
10
+ import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
11
+ import { meta } from '../../meta';
12
+ import { TriggersSettings } from '../TriggerSettings';
14
13
 
15
14
  export const AutomationSettings = (props: AutomationPanelProps) => {
16
15
  const { t } = useTranslation(meta.id);
17
16
  return (
18
- <ControlPage>
19
- <ControlSection
17
+ <Settings.Root>
18
+ <Settings.Section
20
19
  title={t('automation verbose label', { ns: meta.id })}
21
20
  description={t('automation description', { ns: meta.id })}
22
21
  >
23
22
  <AutomationPanel {...props} />
24
- <TriggersSettings space={props.space} />
25
- </ControlSection>
26
- </ControlPage>
23
+ <TriggersSettings db={props.space.db} />
24
+ </Settings.Section>
25
+ </Settings.Root>
27
26
  );
28
27
  };
29
-
30
- export default AutomationSettings;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { AutomationSettings } from './AutomationSettings';
6
+
7
+ export default AutomationSettings;
@@ -6,31 +6,28 @@ import React from 'react';
6
6
 
7
7
  import { type Space } from '@dxos/react-client/echo';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
- import { ControlPage, ControlSection } from '@dxos/react-ui-form';
9
+ import { Settings } from '@dxos/react-ui-form';
10
10
 
11
- import { meta } from '../meta';
12
-
13
- import { FunctionsPanel } from './FunctionsPanel';
14
- import { FunctionsRegistry } from './FunctionsRegistry';
11
+ import { FunctionsPanel } from '../../components/FunctionsPanel';
12
+ import { FunctionsRegistry } from '../../components/FunctionsRegistry';
13
+ import { meta } from '../../meta';
15
14
 
16
15
  export const FunctionsContainer = ({ space }: { space: Space }) => {
17
16
  const { t } = useTranslation(meta.id);
18
17
  return (
19
- <ControlPage>
20
- <ControlSection
18
+ <Settings.Root>
19
+ <Settings.Section
21
20
  title={t('functions verbose label', { ns: meta.id })}
22
21
  description={t('functions description', { ns: meta.id })}
23
22
  >
24
23
  <FunctionsPanel space={space} />
25
- </ControlSection>
26
- <ControlSection
24
+ </Settings.Section>
25
+ <Settings.Section
27
26
  title={t('functions registry verbose label', { ns: meta.id })}
28
27
  description={t('functions registry description', { ns: meta.id })}
29
28
  >
30
29
  <FunctionsRegistry space={space} />
31
- </ControlSection>
32
- </ControlPage>
30
+ </Settings.Section>
31
+ </Settings.Root>
33
32
  );
34
33
  };
35
-
36
- export default FunctionsContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { FunctionsContainer } from './FunctionsContainer';
6
+
7
+ export default FunctionsContainer;
@@ -0,0 +1,26 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type Database } from '@dxos/echo';
8
+ import { Input, useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { useTriggerRuntimeControls } from '../../hooks';
12
+ import { meta } from '../../meta';
13
+
14
+ export const TriggersSettings = ({ db }: { db: Database.Database }) => {
15
+ const { state, start, stop } = useTriggerRuntimeControls(db);
16
+ const isRunning = state?.enabled ?? false;
17
+ const { t } = useTranslation(meta.id);
18
+
19
+ return (
20
+ <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>
24
+ </div>
25
+ );
26
+ };
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { TriggersSettings } from './TriggerSettings';
6
+ export { TriggersSettings as default } from './TriggerSettings';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
8
+ export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
9
+ export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
@@ -5,27 +5,26 @@
5
5
  import * as Cause from 'effect/Cause';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import * as Exit from 'effect/Exit';
8
- import { useCallback } from 'react';
8
+ import { type DependencyList, useCallback } from 'react';
9
9
 
10
- import { useCapability } from '@dxos/app-framework/react';
11
- import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
12
- import { InvocationTracer, TracingServiceExt } from '@dxos/functions-runtime';
10
+ import { useCapability } from '@dxos/app-framework/ui';
11
+ import { type Key } from '@dxos/echo';
12
+ import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
13
13
  import { log } from '@dxos/log';
14
- import type { Space } from '@dxos/react-client/echo';
15
14
 
16
- import { AutomationCapabilities } from '../capabilities';
15
+ import { AutomationCapabilities } from '../types';
17
16
 
18
17
  /**
19
18
  * Create an effectful function that has access to compute services
20
19
  */
21
20
  // TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
22
21
  export const useComputeRuntimeCallback = <T>(
23
- space: Space | undefined,
22
+ id: Key.SpaceId | undefined,
24
23
  fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
25
- deps?: React.DependencyList,
24
+ deps?: DependencyList,
26
25
  ): (() => Promise<T>) => {
27
26
  const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
28
- const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
27
+ const runtime = id !== undefined ? computeRuntime.getRuntime(id) : undefined;
29
28
 
30
29
  return useCallback(() => {
31
30
  if (!runtime) {
@@ -39,7 +38,7 @@ export const useComputeRuntimeCallback = <T>(
39
38
  // TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
40
39
  export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
41
40
  Effect.gen(function* () {
42
- const tracer = yield* InvocationTracer;
41
+ const tracer = yield* TracingService;
43
42
  const trace = yield* tracer.traceInvocationStart({
44
43
  target: undefined,
45
44
  payload: {
@@ -49,7 +48,7 @@ export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<
49
48
 
50
49
  // Invoke the function.
51
50
  const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
52
- Effect.provide(TracingServiceExt.layerQueue(trace.invocationTraceQueue)),
51
+ Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
53
52
  Effect.exit,
54
53
  );
55
54