@dxos/plugin-automation 0.8.4-main.7ace549 → 0.8.4-main.937b3ca

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 (273) hide show
  1. package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +56 -0
  3. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +129 -0
  5. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs → FunctionsPanel-ZX4J75UM.mjs} +3 -3
  7. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +84 -0
  8. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-CZVA5NMD.mjs → chunk-54PANILA.mjs} +5 -5
  10. package/dist/lib/browser/chunk-BFUIVUQH.mjs +102 -0
  11. package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-BKFQBKYO.mjs +8 -0
  13. package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-JOXPQ27I.mjs +83 -0
  15. package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-LZQFZO3B.mjs → chunk-PZNBEKO5.mjs} +1 -1
  17. package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-QW3EM35H.mjs +248 -0
  19. package/dist/lib/browser/chunk-QW3EM35H.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-4MBM6C6A.mjs → chunk-RAF2FJST.mjs} +14 -28
  21. package/dist/lib/browser/chunk-RAF2FJST.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-YWLEY2FD.mjs +200 -0
  23. package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +7 -0
  24. package/dist/lib/browser/cli/index.mjs +1107 -0
  25. package/dist/lib/browser/cli/index.mjs.map +7 -0
  26. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +114 -0
  27. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +7 -0
  28. package/dist/lib/browser/hooks/index.mjs +3 -3
  29. package/dist/lib/browser/index.mjs +49 -57
  30. package/dist/lib/browser/index.mjs.map +4 -4
  31. package/dist/lib/browser/meta.json +1 -1
  32. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +82 -0
  33. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +7 -0
  34. package/dist/lib/browser/{react-surface-TKU2EQ5A.mjs → react-surface-EV3AC62F.mjs} +12 -11
  35. package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +10 -4
  37. package/dist/lib/node-esm/{AutomationPanel-F5CTC6AT.mjs → AutomationPanel-B7NAGDFA.mjs} +4 -4
  38. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +57 -0
  39. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +7 -0
  40. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +130 -0
  41. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +7 -0
  42. package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs → FunctionsPanel-SS6GIVNU.mjs} +3 -3
  43. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +85 -0
  44. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +201 -0
  46. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +7 -0
  47. package/dist/lib/node-esm/{chunk-CEVIVRTY.mjs → chunk-5FXNN3MV.mjs} +1 -1
  48. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-3IYSC75Z.mjs → chunk-7QRUPEHH.mjs} +5 -5
  50. package/dist/lib/node-esm/{chunk-7B6NAAI6.mjs → chunk-HQLVREIX.mjs} +14 -28
  51. package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-K7GCM342.mjs +10 -0
  53. package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +103 -0
  55. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +249 -0
  57. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-RX52VKI2.mjs +84 -0
  59. package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +7 -0
  60. package/dist/lib/node-esm/cli/index.mjs +1108 -0
  61. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  62. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +115 -0
  63. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +7 -0
  64. package/dist/lib/node-esm/hooks/index.mjs +3 -3
  65. package/dist/lib/node-esm/index.mjs +49 -57
  66. package/dist/lib/node-esm/index.mjs.map +4 -4
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +83 -0
  69. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +7 -0
  70. package/dist/lib/node-esm/{react-surface-7QROSEGH.mjs → react-surface-S6VZJCEZ.mjs} +12 -11
  71. package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +7 -0
  72. package/dist/lib/node-esm/types/index.mjs +10 -4
  73. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  74. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  76. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  80. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/index.d.ts +4 -5
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  86. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  88. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  90. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  92. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  93. package/dist/types/src/cli/commands/index.d.ts +2 -0
  94. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  95. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  96. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  97. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  98. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  99. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  100. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  101. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  102. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  103. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  104. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  105. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  106. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  108. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  110. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  112. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  114. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  116. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  118. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  120. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  121. package/dist/types/src/cli/index.d.ts +2 -0
  122. package/dist/types/src/cli/index.d.ts.map +1 -0
  123. package/dist/types/src/cli/plugin.d.ts +3 -0
  124. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  125. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  126. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  127. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +1 -0
  128. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  131. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +10 -7
  132. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  133. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  134. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  135. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
  136. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  137. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +70 -2
  138. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  139. package/dist/types/src/components/TriggerSettings.d.ts +3 -3
  140. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -1
  141. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +6 -6
  142. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  143. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -2
  144. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  145. package/dist/types/src/index.d.ts +1 -2
  146. package/dist/types/src/index.d.ts.map +1 -1
  147. package/dist/types/src/meta.d.ts +2 -2
  148. package/dist/types/src/meta.d.ts.map +1 -1
  149. package/dist/types/src/translations.d.ts +1 -0
  150. package/dist/types/src/translations.d.ts.map +1 -1
  151. package/dist/types/src/types/capabilities.d.ts +22 -0
  152. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  153. package/dist/types/src/types/events.d.ts +5 -0
  154. package/dist/types/src/types/events.d.ts.map +1 -0
  155. package/dist/types/src/types/index.d.ts +2 -0
  156. package/dist/types/src/types/index.d.ts.map +1 -1
  157. package/dist/types/src/types/schema.d.ts +30 -1
  158. package/dist/types/src/types/schema.d.ts.map +1 -1
  159. package/dist/types/tsconfig.tsbuildinfo +1 -1
  160. package/package.json +61 -49
  161. package/src/AutomationPlugin.tsx +13 -33
  162. package/src/capabilities/app-graph-builder/app-graph-builder.ts +71 -0
  163. package/src/capabilities/app-graph-builder/index.ts +7 -0
  164. package/src/capabilities/{compute-runtime.ts → compute-runtime/compute-runtime.ts} +48 -44
  165. package/src/capabilities/compute-runtime/index.ts +7 -0
  166. package/src/capabilities/index.ts +4 -8
  167. package/src/capabilities/operation-resolver/index.ts +7 -0
  168. package/src/capabilities/operation-resolver/operation-resolver.ts +79 -0
  169. package/src/capabilities/react-surface/index.ts +7 -0
  170. package/src/capabilities/react-surface/react-surface.tsx +60 -0
  171. package/src/cli/commands/index.ts +5 -0
  172. package/src/cli/commands/trigger/create/index.ts +14 -0
  173. package/src/cli/commands/trigger/create/queue.ts +89 -0
  174. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  175. package/src/cli/commands/trigger/create/timer.ts +93 -0
  176. package/src/cli/commands/trigger/index.ts +16 -0
  177. package/src/cli/commands/trigger/list.ts +67 -0
  178. package/src/cli/commands/trigger/options.ts +59 -0
  179. package/src/cli/commands/trigger/remove.ts +45 -0
  180. package/src/cli/commands/trigger/update/index.ts +14 -0
  181. package/src/cli/commands/trigger/update/queue.ts +195 -0
  182. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  183. package/src/cli/commands/trigger/update/timer.ts +193 -0
  184. package/src/cli/commands/trigger/util.ts +395 -0
  185. package/src/cli/index.ts +5 -0
  186. package/src/cli/plugin.ts +23 -0
  187. package/src/components/AutomationPanel/AutomationPanel.tsx +33 -12
  188. package/src/components/AutomationSettings.tsx +1 -1
  189. package/src/components/FunctionsPanel/FunctionsPanel.tsx +11 -16
  190. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +8 -24
  191. package/src/components/TriggerEditor/FunctionInputEditor.tsx +23 -31
  192. package/src/components/TriggerEditor/SpecSelector.tsx +8 -6
  193. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +27 -24
  194. package/src/components/TriggerEditor/TriggerEditor.tsx +55 -42
  195. package/src/components/TriggerSettings.tsx +3 -3
  196. package/src/hooks/useComputeRuntimeCallback.ts +9 -10
  197. package/src/hooks/useTriggerRuntimeControls.ts +7 -7
  198. package/src/index.ts +1 -2
  199. package/src/meta.ts +2 -2
  200. package/src/translations.ts +2 -0
  201. package/src/{capabilities → types}/capabilities.ts +8 -7
  202. package/src/types/events.ts +11 -0
  203. package/src/types/index.ts +2 -0
  204. package/src/types/schema.ts +23 -2
  205. package/dist/lib/browser/AutomationPanel-M4M77L4V.mjs +0 -11
  206. package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs +0 -68
  207. package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs.map +0 -7
  208. package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs +0 -144
  209. package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs.map +0 -7
  210. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  211. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  212. package/dist/lib/browser/chunk-4MBM6C6A.mjs.map +0 -7
  213. package/dist/lib/browser/chunk-7W6QMY3L.mjs +0 -267
  214. package/dist/lib/browser/chunk-7W6QMY3L.mjs.map +0 -7
  215. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  216. package/dist/lib/browser/chunk-T6ZESHDY.mjs +0 -191
  217. package/dist/lib/browser/chunk-T6ZESHDY.mjs.map +0 -7
  218. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  219. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  221. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  223. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  224. package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs +0 -113
  225. package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs.map +0 -7
  226. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  227. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  228. package/dist/lib/browser/react-surface-TKU2EQ5A.mjs.map +0 -7
  229. package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs +0 -69
  230. package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs.map +0 -7
  231. package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs +0 -145
  232. package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs.map +0 -7
  233. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  234. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  235. package/dist/lib/node-esm/chunk-7B6NAAI6.mjs.map +0 -7
  236. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  237. package/dist/lib/node-esm/chunk-CF2SWXPW.mjs +0 -268
  238. package/dist/lib/node-esm/chunk-CF2SWXPW.mjs.map +0 -7
  239. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  240. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  241. package/dist/lib/node-esm/chunk-F76XVENA.mjs +0 -192
  242. package/dist/lib/node-esm/chunk-F76XVENA.mjs.map +0 -7
  243. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  244. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  245. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  246. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  247. package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs +0 -114
  248. package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs.map +0 -7
  249. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  250. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  251. package/dist/lib/node-esm/react-surface-7QROSEGH.mjs.map +0 -7
  252. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  253. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  254. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  255. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  256. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  257. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  258. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  259. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  260. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  261. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  262. package/dist/types/src/events.d.ts +0 -4
  263. package/dist/types/src/events.d.ts.map +0 -1
  264. package/src/capabilities/app-graph-builder.ts +0 -87
  265. package/src/capabilities/intent-resolver.ts +0 -72
  266. package/src/capabilities/react-surface.tsx +0 -56
  267. package/src/events.ts +0 -11
  268. /package/dist/lib/browser/{AutomationPanel-M4M77L4V.mjs.map → AutomationPanel-FAS6ADCW.mjs.map} +0 -0
  269. /package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map} +0 -0
  270. /package/dist/lib/browser/{chunk-CZVA5NMD.mjs.map → chunk-54PANILA.mjs.map} +0 -0
  271. /package/dist/lib/node-esm/{AutomationPanel-F5CTC6AT.mjs.map → AutomationPanel-B7NAGDFA.mjs.map} +0 -0
  272. /package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map} +0 -0
  273. /package/dist/lib/node-esm/{chunk-3IYSC75Z.mjs.map → chunk-7QRUPEHH.mjs.map} +0 -0
@@ -2,9 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Array from 'effect/Array';
6
- import * as EffectFunction from 'effect/Function';
7
- import * as Order from 'effect/Order';
8
5
  import * as Schema from 'effect/Schema';
9
6
  import { useState } from 'react';
10
7
  import React, { useCallback } from 'react';
@@ -17,7 +14,7 @@ import { useAsyncEffect } from '@dxos/react-ui';
17
14
  import { IconButton, useTranslation } from '@dxos/react-ui';
18
15
  import { controlItemClasses } from '@dxos/react-ui-form';
19
16
  import { List } from '@dxos/react-ui-list';
20
- import { ghostHover, mx } from '@dxos/react-ui-theme';
17
+ import { ghostHover, mx } from '@dxos/ui-theme';
21
18
 
22
19
  import { meta } from '../../meta';
23
20
 
@@ -33,7 +30,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
33
30
  const [functions, setFunctions] = useState<Function.Function[]>([]);
34
31
  const { t } = useTranslation(meta.id);
35
32
 
36
- const dbFunctions = useQuery(space, Filter.type(Function.Function));
33
+ const dbFunctions = useQuery(space.db, Filter.type(Function.Function));
37
34
 
38
35
  const state = (func: Function.Function) => {
39
36
  const dbFunction = dbFunctions.find((f) => f.key === func.key);
@@ -48,24 +45,15 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
48
45
 
49
46
  useAsyncEffect(async () => {
50
47
  setLoading(true);
51
- const functions = await getDeployedFunctions(client);
48
+ const functions = await getDeployedFunctions(client, true);
52
49
  setFunctions(functions);
53
50
  setLoading(false);
54
51
  }, []);
55
52
 
56
- const dedupedFunctions = EffectFunction.pipe(
57
- functions,
58
- Array.filter((_) => _.key !== undefined),
59
- Array.sort(Order.reverse(Order.mapInput(Order.string, (_: Function.Function) => _.updated ?? ''))),
60
- Array.dedupeWith((self, that) => self.key === that.key),
61
- Array.sort(Order.mapInput(Order.string, (_: Function.Function) => _.key ?? '')),
62
- );
63
-
64
53
  const hanleImportOrUpdate = useCallback(
65
54
  async (func: Function.Function) => {
66
- const {
67
- objects: [existingFunc],
68
- } = await space.db.query(Query.type(Function.Function, { key: func.key })).run();
55
+ const functions = await space.db.query(Query.type(Function.Function, { key: func.key })).run();
56
+ const [existingFunc] = functions;
69
57
  if (!existingFunc) {
70
58
  space.db.add(func);
71
59
  return;
@@ -77,12 +65,8 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
77
65
 
78
66
  return (
79
67
  <div role='none' className={mx(controlItemClasses)}>
80
- {dedupedFunctions.length > 0 && (
81
- <List.Root<Function.Function>
82
- items={dedupedFunctions}
83
- isItem={Schema.is(Function.Function)}
84
- getId={(func) => func.id}
85
- >
68
+ {functions.length > 0 && (
69
+ <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>
86
70
  {({ items }) => (
87
71
  <div role='list' className='flex flex-col is-full'>
88
72
  {items?.map((func) => (
@@ -118,7 +102,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
118
102
  </List.Root>
119
103
  )}
120
104
 
121
- {dedupedFunctions.length === 0 && !loading && (
105
+ {functions.length === 0 && !loading && (
122
106
  <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>
123
107
  )}
124
108
  {loading && <div className='text-center plb-4 text-gray-500'>{t('loading functions')}</div>}
@@ -2,29 +2,26 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import type * as SchemaAST from 'effect/SchemaAST';
5
6
  import React, { useCallback, useMemo } from 'react';
6
7
 
7
- import { Ref, Type } from '@dxos/echo';
8
+ import { type Database, Ref, Type } from '@dxos/echo';
8
9
  import { type JsonPath } from '@dxos/echo/internal';
9
10
  import { type Function } from '@dxos/functions';
10
- import { useOnTransition } from '@dxos/react-ui';
11
- import { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';
11
+ import { useOnTransition, useTranslation } from '@dxos/react-ui';
12
+ import { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';
13
+
14
+ import { meta } from '../../meta';
12
15
 
13
16
  export type FunctionInputEditorProps = {
17
+ type: SchemaAST.AST;
14
18
  functions: Function.Function[];
15
- onQueryRefOptions: QueryRefOptions;
16
- } & FormInputStateProps;
19
+ db?: Database.Database;
20
+ } & FormFieldStateProps;
17
21
 
18
- /**
19
- * Editor component for function input parameters.
20
- */
21
- export const FunctionInputEditor = ({
22
- functions,
23
- getValue,
24
- onValueChange,
25
- onQueryRefOptions,
26
- }: FunctionInputEditorProps) => {
27
- const selectedFunctionValue = useFormValues(['function' as JsonPath]);
22
+ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }: FunctionInputEditorProps) => {
23
+ const { t } = useTranslation(meta.id);
24
+ const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, ['function' as JsonPath]);
28
25
  const selectedFunctionId = useMemo(() => {
29
26
  if (Ref.isRef(selectedFunctionValue)) {
30
27
  return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);
@@ -47,20 +44,19 @@ export const FunctionInputEditor = ({
47
44
  return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
48
45
  },
49
46
  (currValue) => currValue !== undefined,
50
- () => onValueChange('object', {}),
47
+ () => onValueChange(type, {}),
51
48
  );
52
49
 
53
50
  const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
54
51
  const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
55
52
  const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
56
-
57
53
  const values = useMemo(() => getValue() ?? {}, [getValue]);
58
54
 
59
- const handleValuesChanged = useCallback(
60
- (values: any) => {
61
- onValueChange('object', values);
55
+ const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(
56
+ (values) => {
57
+ onValueChange(type, values);
62
58
  },
63
- [onValueChange],
59
+ [type, onValueChange],
64
60
  );
65
61
 
66
62
  if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
@@ -69,16 +65,12 @@ export const FunctionInputEditor = ({
69
65
 
70
66
  return (
71
67
  <>
72
- <h3 className='text-md'>Function parameters</h3>
73
- {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.
74
- This would allow errors to flow up to the root context. */}
75
- <Form
76
- schema={effectSchema}
77
- values={values}
78
- onValuesChanged={handleValuesChanged}
79
- onQueryRefOptions={onQueryRefOptions}
80
- outerSpacing={false}
81
- />
68
+ <Form.Label label={t('function parameters label')} asChild />
69
+ <Form.Root schema={effectSchema} values={values} db={db} onValuesChanged={handleValuesChanged}>
70
+ <Form.FieldSet />
71
+ </Form.Root>
82
72
  </>
83
73
  );
84
74
  };
75
+
76
+ FunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';
@@ -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 => {
@@ -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';
@@ -6,14 +6,14 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
7
 
8
8
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
- import { Function } from '@dxos/functions';
10
- import { Trigger } from '@dxos/functions';
9
+ import { Function, Trigger } from '@dxos/functions';
11
10
  import { invariant } from '@dxos/invariant';
12
11
  import { faker } from '@dxos/random';
13
12
  import { useQuery } from '@dxos/react-client/echo';
14
- import { TestSchema, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
13
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
14
  import { useAsyncEffect } from '@dxos/react-ui';
16
15
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form';
17
17
  import { Employer, Organization, Person, Project } from '@dxos/types';
18
18
 
19
19
  import { functions } from '../../testing';
@@ -30,17 +30,17 @@ const types = [
30
30
  ];
31
31
 
32
32
  const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
- const { space } = useClientProvider();
33
+ const { space } = useClientStory();
34
34
  const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
- const tags = useQuery(space, Filter.type(Tag.Tag));
35
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
36
36
 
37
37
  useAsyncEffect(async () => {
38
38
  if (!space) {
39
39
  return;
40
40
  }
41
41
 
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');
42
+ const functions = await space.db.query(Filter.type(Function.Function)).run();
43
+ const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
44
44
  invariant(fn);
45
45
  const trigger = space.db.add(
46
46
  Trigger.make({
@@ -60,16 +60,14 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
60
60
  }
61
61
 
62
62
  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>
63
+ <TriggerEditor
64
+ db={space.db}
65
+ trigger={trigger}
66
+ types={types}
67
+ tags={tags}
68
+ onSave={(values) => console.log('on save', values)}
69
+ {...props}
70
+ />
73
71
  );
74
72
  };
75
73
 
@@ -79,19 +77,23 @@ const meta = {
79
77
  render: DefaultStory,
80
78
  decorators: [
81
79
  withTheme,
82
- withLayout({ container: 'column' }),
80
+ withLayout({ layout: 'column' }),
83
81
  withClientProvider({
84
82
  createIdentity: true,
85
83
  createSpace: true,
86
84
  types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
87
85
  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' }));
86
+ // Tags.
87
+ ['Important', 'Investor', 'New'].forEach((label) => {
88
+ space.db.add(Tag.make({ label }));
89
+ });
91
90
 
92
- for (const fn of functions) {
91
+ // Functions.
92
+ functions.forEach((fn) => {
93
93
  space.db.add(Function.make(fn));
94
- }
94
+ });
95
+
96
+ // Objects.
95
97
  Array.from({ length: 10 }).map(() => {
96
98
  return space.db.add(
97
99
  Obj.make(TestSchema.ContactType, {
@@ -104,7 +106,8 @@ const meta = {
104
106
  }),
105
107
  ],
106
108
  parameters: {
107
- translations,
109
+ layout: 'fullscreen',
110
+ translations: [...formTranslations, ...translations],
108
111
  },
109
112
  } satisfies Meta<typeof DefaultStory>;
110
113
 
@@ -5,59 +5,74 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { DXN, type Query } from '@dxos/echo';
8
+ import { DXN, type Database, 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
- };
31
-
32
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
33
- const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
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
+ });
34
45
 
35
46
  return (
36
- <Form
37
- outerSpacing={false}
38
- Custom={Custom}
39
- schema={Trigger.Trigger}
47
+ <Form.Root<TriggerFormSchema>
48
+ {...formProps}
49
+ schema={omitId(Trigger.Trigger)}
40
50
  values={trigger}
41
- onSave={handleSave}
42
- onCancel={onCancel}
43
- onQueryRefOptions={handleRefQueryLookup}
44
- />
51
+ db={db}
52
+ fieldMap={fieldMap}
53
+ >
54
+ <Form.Viewport>
55
+ <Form.Content>
56
+ <Form.FieldSet />
57
+ <Form.Actions />
58
+ </Form.Content>
59
+ </Form.Viewport>
60
+ </Form.Root>
45
61
  );
46
62
  };
47
63
 
48
64
  type UseCustomInputsProps = {
49
- space: Space;
65
+ db: Database.Database;
50
66
  readonlySpec?: boolean;
51
- onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
52
67
  } & Pick<QueryFormProps, 'types' | 'tags'>;
53
68
 
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));
69
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
70
+ const functions = useQuery(db, Filter.type(Function.Function));
71
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
72
+ const scripts = useQuery(db, Filter.type(Script.Script));
58
73
 
59
74
  return useMemo(
60
- (): CustomInputMap => ({
75
+ (): FormFieldMap => ({
61
76
  // Function selector.
62
77
  ['function' satisfies keyof Trigger.Trigger]: (props) => {
63
78
  const getValue = useCallback(() => {
@@ -73,14 +88,14 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
73
88
  const dxn = DXN.parse(dxnString);
74
89
  if (dxn) {
75
90
  const ref = Ref.fromDXN(dxn);
76
- props.onValueChange('object', ref);
91
+ props.onValueChange(props.type, ref);
77
92
  }
78
93
  },
79
- [props.onValueChange],
94
+ [props.type, props.onValueChange],
80
95
  );
81
96
 
82
97
  return (
83
- <SelectInput
98
+ <SelectField
84
99
  {...props}
85
100
  getValue={getValue as any}
86
101
  onValueChange={handleOnValueChange}
@@ -90,28 +105,26 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
90
105
  },
91
106
 
92
107
  // Spec selector.
93
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
108
+ ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec} />,
94
109
 
95
110
  // TODO(wittjosiah): Copied from ViewEditor.
96
111
  // Query input editor.
97
112
  ['spec.query' as const]: (props) => {
98
113
  const handleChange = useCallback(
99
- (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
100
- [props.onValueChange],
114
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
115
+ [props.type, props.onValueChange],
101
116
  );
102
117
 
103
118
  return (
104
119
  <Input.Root>
105
- <InputHeader label={props.label} />
120
+ <FormFieldLabel label={props.label} asChild />
106
121
  <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
107
122
  </Input.Root>
108
123
  );
109
124
  },
110
125
 
111
126
  // Function input editor.
112
- ['input' as const]: (props) => (
113
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
114
- ),
127
+ ['input' as const]: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
115
128
  }),
116
129
  [workflows, scripts, functions, readonlySpec],
117
130
  );
@@ -4,15 +4,15 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type Space } from '@dxos/react-client/echo';
7
+ import { type Database } from '@dxos/echo';
8
8
  import { Input, useTranslation } from '@dxos/react-ui';
9
9
  import { ControlItemInput } from '@dxos/react-ui-form';
10
10
 
11
11
  import { useTriggerRuntimeControls } from '../hooks';
12
12
  import { meta } from '../meta';
13
13
 
14
- export const TriggersSettings = ({ space }: { space: Space }) => {
15
- const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
14
+ export const TriggersSettings = ({ db }: { db: Database.Database }) => {
15
+ const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(db);
16
16
  const { t } = useTranslation(meta.id);
17
17
 
18
18
  return (
@@ -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
10
  import { useCapability } from '@dxos/app-framework/react';
11
- import { type FunctionDefinition, FunctionInvocationService } from '@dxos/functions';
12
- import { InvocationTracer, TracingServiceExt } from '@dxos/functions-runtime';
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
 
@@ -4,10 +4,10 @@
4
4
 
5
5
  import * as Effect from 'effect/Effect';
6
6
 
7
- import { Filter } from '@dxos/echo';
7
+ import { type Database, Filter } from '@dxos/echo';
8
8
  import { Trigger } from '@dxos/functions';
9
9
  import { TriggerDispatcher } from '@dxos/functions-runtime';
10
- import { type Space, useQuery } from '@dxos/react-client/echo';
10
+ import { useQuery } from '@dxos/react-client/echo';
11
11
  import { useAsyncState } from '@dxos/react-ui';
12
12
 
13
13
  import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
@@ -19,15 +19,15 @@ interface TriggerRuntimeControls {
19
19
  stop: () => void;
20
20
  }
21
21
 
22
- export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
23
- const triggers = useQuery(space, Filter.type(Trigger.Trigger));
22
+ export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
23
+ const triggers = useQuery(db, Filter.type(Trigger.Trigger));
24
24
 
25
25
  const [isRunningState, setIsRunningState] = useAsyncState(
26
- useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
26
+ useComputeRuntimeCallback(db?.spaceId, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
27
27
  );
28
28
 
29
29
  const start = useComputeRuntimeCallback(
30
- space,
30
+ db?.spaceId,
31
31
  Effect.fnUntraced(function* () {
32
32
  const dispatcher = yield* TriggerDispatcher;
33
33
  yield* dispatcher.start();
@@ -36,7 +36,7 @@ export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRunt
36
36
  );
37
37
 
38
38
  const stop = useComputeRuntimeCallback(
39
- space,
39
+ db?.spaceId,
40
40
  Effect.fnUntraced(function* () {
41
41
  const dispatcher = yield* TriggerDispatcher;
42
42
  yield* dispatcher.stop();
package/src/index.ts CHANGED
@@ -2,10 +2,9 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- export { AutomationCapabilities } from './capabilities';
6
5
  export * from './components';
7
6
  export * from './meta';
8
- export * from './events';
9
7
  export * from './hooks';
8
+ export * from './types';
10
9
 
11
10
  export * from './AutomationPlugin';
package/src/meta.ts CHANGED
@@ -2,10 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
- export const meta: PluginMeta = {
8
+ export const meta: Plugin.Meta = {
9
9
  id: 'dxos.org/plugin/automation',
10
10
  name: 'Automation',
11
11
  description: trim`
@@ -30,6 +30,8 @@ export const translations = [
30
30
  'go to function source button label': 'Show function source',
31
31
  'delete function button label': 'Delete function',
32
32
 
33
+ 'function parameters label': 'Function parameters',
34
+
33
35
  'trigger editor title': 'Configure Trigger',
34
36
  'new trigger label': 'Add Trigger',
35
37
  'trigger type timer': 'Timer',