@dxos/plugin-automation 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (290) 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-I443Y6KB.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-NQGKPPXI.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-PZNBEKO5.mjs +17 -0
  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-RAF2FJST.mjs +86 -0
  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 +5 -4
  29. package/dist/lib/browser/index.mjs +61 -51
  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-IYFH2BEM.mjs → react-surface-EV3AC62F.mjs} +14 -13
  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-MKOLA2FE.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-ELINCXPW.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-5FXNN3MV.mjs +19 -0
  48. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-UAOO5IZQ.mjs → chunk-7QRUPEHH.mjs} +5 -5
  50. package/dist/lib/node-esm/chunk-HQLVREIX.mjs +87 -0
  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 +5 -4
  65. package/dist/lib/node-esm/index.mjs +61 -51
  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-FDRJ76PK.mjs → react-surface-S6VZJCEZ.mjs} +14 -13
  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 +3 -3
  126. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  127. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +4 -1
  128. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  131. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  132. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  133. package/dist/types/src/components/FunctionsRegistry/index.d.ts +2 -0
  134. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  135. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  136. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  137. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  138. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  139. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
  140. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  141. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +77 -6
  142. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  143. package/dist/types/src/components/TriggerSettings.d.ts +3 -3
  144. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -1
  145. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -4
  146. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  147. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +4 -4
  148. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  149. package/dist/types/src/index.d.ts +2 -1
  150. package/dist/types/src/index.d.ts.map +1 -1
  151. package/dist/types/src/meta.d.ts +2 -3
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/testing/test-functions.d.ts +2 -3
  154. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  155. package/dist/types/src/translations.d.ts +4 -0
  156. package/dist/types/src/translations.d.ts.map +1 -1
  157. package/dist/types/src/types/capabilities.d.ts +22 -0
  158. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  159. package/dist/types/src/types/events.d.ts +5 -0
  160. package/dist/types/src/types/events.d.ts.map +1 -0
  161. package/dist/types/src/types/index.d.ts +2 -0
  162. package/dist/types/src/types/index.d.ts.map +1 -1
  163. package/dist/types/src/types/schema.d.ts +31 -2
  164. package/dist/types/src/types/schema.d.ts.map +1 -1
  165. package/dist/types/tsconfig.tsbuildinfo +1 -1
  166. package/package.json +62 -46
  167. package/src/AutomationPlugin.tsx +18 -37
  168. package/src/capabilities/app-graph-builder/app-graph-builder.ts +71 -0
  169. package/src/capabilities/app-graph-builder/index.ts +7 -0
  170. package/src/capabilities/compute-runtime/compute-runtime.ts +133 -0
  171. package/src/capabilities/compute-runtime/index.ts +7 -0
  172. package/src/capabilities/index.ts +4 -8
  173. package/src/capabilities/operation-resolver/index.ts +7 -0
  174. package/src/capabilities/operation-resolver/operation-resolver.ts +79 -0
  175. package/src/capabilities/react-surface/index.ts +7 -0
  176. package/src/capabilities/react-surface/react-surface.tsx +60 -0
  177. package/src/cli/commands/index.ts +5 -0
  178. package/src/cli/commands/trigger/create/index.ts +14 -0
  179. package/src/cli/commands/trigger/create/queue.ts +89 -0
  180. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  181. package/src/cli/commands/trigger/create/timer.ts +93 -0
  182. package/src/cli/commands/trigger/index.ts +16 -0
  183. package/src/cli/commands/trigger/list.ts +67 -0
  184. package/src/cli/commands/trigger/options.ts +59 -0
  185. package/src/cli/commands/trigger/remove.ts +45 -0
  186. package/src/cli/commands/trigger/update/index.ts +14 -0
  187. package/src/cli/commands/trigger/update/queue.ts +195 -0
  188. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  189. package/src/cli/commands/trigger/update/timer.ts +193 -0
  190. package/src/cli/commands/trigger/util.ts +395 -0
  191. package/src/cli/index.ts +5 -0
  192. package/src/cli/plugin.ts +23 -0
  193. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +7 -11
  194. package/src/components/AutomationPanel/AutomationPanel.tsx +132 -40
  195. package/src/components/AutomationSettings.tsx +5 -5
  196. package/src/components/FunctionsContainer.tsx +11 -4
  197. package/src/components/FunctionsPanel/FunctionsPanel.tsx +33 -19
  198. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +111 -0
  199. package/src/components/FunctionsRegistry/index.ts +5 -0
  200. package/src/components/TriggerEditor/FunctionInputEditor.tsx +33 -35
  201. package/src/components/TriggerEditor/SpecSelector.tsx +21 -13
  202. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +70 -27
  203. package/src/components/TriggerEditor/TriggerEditor.tsx +81 -42
  204. package/src/components/TriggerSettings.tsx +3 -3
  205. package/src/hooks/useComputeRuntimeCallback.ts +45 -8
  206. package/src/hooks/useTriggerRuntimeControls.ts +11 -10
  207. package/src/index.ts +2 -1
  208. package/src/meta.ts +8 -7
  209. package/src/testing/test-functions.ts +3 -3
  210. package/src/translations.ts +5 -0
  211. package/src/types/capabilities.ts +42 -0
  212. package/src/types/events.ts +11 -0
  213. package/src/types/index.ts +2 -0
  214. package/src/types/schema.ts +24 -3
  215. package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
  216. package/dist/lib/browser/AutomationSettings-S3F2VT7Q.mjs +0 -70
  217. package/dist/lib/browser/AutomationSettings-S3F2VT7Q.mjs.map +0 -7
  218. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
  219. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
  220. package/dist/lib/browser/app-graph-builder-SRA3X2GQ.mjs +0 -80
  221. package/dist/lib/browser/app-graph-builder-SRA3X2GQ.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-4TWQV33E.mjs +0 -143
  223. package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-CRUNQZ2M.mjs +0 -15
  225. package/dist/lib/browser/chunk-CRUNQZ2M.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
  227. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
  229. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-P6YOYDXP.mjs +0 -53
  231. package/dist/lib/browser/chunk-P6YOYDXP.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-S4SM663I.mjs +0 -230
  233. package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
  234. package/dist/lib/browser/chunk-UHXDXRP4.mjs +0 -14
  235. package/dist/lib/browser/chunk-UHXDXRP4.mjs.map +0 -7
  236. package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
  237. package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
  238. package/dist/lib/browser/compute-runtime-G25R3RSS.mjs +0 -154
  239. package/dist/lib/browser/compute-runtime-G25R3RSS.mjs.map +0 -7
  240. package/dist/lib/browser/intent-resolver-CMLGPFD6.mjs +0 -77
  241. package/dist/lib/browser/intent-resolver-CMLGPFD6.mjs.map +0 -7
  242. package/dist/lib/browser/react-surface-IYFH2BEM.mjs.map +0 -7
  243. package/dist/lib/node-esm/AutomationSettings-C3GNAUYC.mjs +0 -71
  244. package/dist/lib/node-esm/AutomationSettings-C3GNAUYC.mjs.map +0 -7
  245. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
  246. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
  247. package/dist/lib/node-esm/app-graph-builder-R5XQJKZS.mjs +0 -81
  248. package/dist/lib/node-esm/app-graph-builder-R5XQJKZS.mjs.map +0 -7
  249. package/dist/lib/node-esm/chunk-AONUBWBE.mjs +0 -144
  250. package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
  251. package/dist/lib/node-esm/chunk-BTD2B4SZ.mjs +0 -16
  252. package/dist/lib/node-esm/chunk-BTD2B4SZ.mjs.map +0 -7
  253. package/dist/lib/node-esm/chunk-CTAX6WBZ.mjs +0 -16
  254. package/dist/lib/node-esm/chunk-CTAX6WBZ.mjs.map +0 -7
  255. package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
  256. package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
  258. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
  260. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-XL33Y62M.mjs +0 -54
  262. package/dist/lib/node-esm/chunk-XL33Y62M.mjs.map +0 -7
  263. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs +0 -231
  264. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
  265. package/dist/lib/node-esm/compute-runtime-LHO62OVM.mjs +0 -155
  266. package/dist/lib/node-esm/compute-runtime-LHO62OVM.mjs.map +0 -7
  267. package/dist/lib/node-esm/intent-resolver-NUPI6NC6.mjs +0 -78
  268. package/dist/lib/node-esm/intent-resolver-NUPI6NC6.mjs.map +0 -7
  269. package/dist/lib/node-esm/react-surface-FDRJ76PK.mjs.map +0 -7
  270. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  271. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  272. package/dist/types/src/capabilities/capabilities.d.ts +0 -18
  273. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  274. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  275. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  276. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  277. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  278. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  279. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  280. package/src/capabilities/app-graph-builder.ts +0 -86
  281. package/src/capabilities/capabilities.ts +0 -52
  282. package/src/capabilities/compute-runtime.ts +0 -124
  283. package/src/capabilities/intent-resolver.ts +0 -72
  284. package/src/capabilities/react-surface.tsx +0 -56
  285. /package/dist/lib/browser/{AutomationPanel-N5HFJJXW.mjs.map → AutomationPanel-FAS6ADCW.mjs.map} +0 -0
  286. /package/dist/lib/browser/{FunctionsPanel-I443Y6KB.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map} +0 -0
  287. /package/dist/lib/browser/{chunk-NQGKPPXI.mjs.map → chunk-54PANILA.mjs.map} +0 -0
  288. /package/dist/lib/node-esm/{AutomationPanel-MKOLA2FE.mjs.map → AutomationPanel-B7NAGDFA.mjs.map} +0 -0
  289. /package/dist/lib/node-esm/{FunctionsPanel-ELINCXPW.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map} +0 -0
  290. /package/dist/lib/node-esm/{chunk-UAOO5IZQ.mjs.map → chunk-7QRUPEHH.mjs.map} +0 -0
@@ -4,28 +4,34 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
- import { type FunctionTrigger, TriggerKinds, type TriggerType } from '@dxos/functions';
7
+ import { Filter, Query } from '@dxos/echo';
8
+ import { Trigger } from '@dxos/functions';
8
9
  import { useTranslation } from '@dxos/react-ui';
9
- import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
10
+ import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
10
11
 
11
- import { AUTOMATION_PLUGIN } from '../../meta';
12
+ import { meta } from '../../meta';
12
13
 
13
- export type SpecSelectorProps = InputProps;
14
+ export type SpecSelectorProps = FormFieldComponentProps;
14
15
 
15
16
  export const SpecSelector = (props: SpecSelectorProps) => {
16
- const { t } = useTranslation(AUTOMATION_PLUGIN);
17
- const specProps = useInputProps(['spec' satisfies keyof FunctionTrigger]);
17
+ const { t } = useTranslation(meta.id);
18
+ const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);
18
19
 
19
20
  const handleTypeChange = useCallback(
20
- (_type: any, value: string): TriggerType | undefined => {
21
+ (_type: any, value: string): Trigger.Spec | undefined => {
21
22
  const getDefaultTriggerSpec = (kind: string) => {
22
23
  switch (kind) {
23
24
  case 'timer':
24
25
  return { kind: 'timer', cron: '' };
25
26
  case 'subscription':
26
- return { kind: 'subscription', filter: {} };
27
+ return {
28
+ kind: 'subscription',
29
+ query: {
30
+ ast: Query.select(Filter.nothing()).ast,
31
+ },
32
+ };
27
33
  case 'queue':
28
- return { kind: 'queue', queue: '' };
34
+ return { kind: 'queue', queue: 'dxn:' };
29
35
  case 'email':
30
36
  return { kind: 'email' };
31
37
  case 'webhook':
@@ -41,19 +47,21 @@ export const SpecSelector = (props: SpecSelectorProps) => {
41
47
  }
42
48
 
43
49
  // Update the entire spec object, not just the `spec.kind`.
44
- specProps.onValueChange('object', defaultSpec);
50
+ specProps.onValueChange(props.type, defaultSpec);
45
51
  },
46
- [specProps],
52
+ [props.type, specProps],
47
53
  );
48
54
 
49
55
  const options = useMemo(
50
56
  () =>
51
- TriggerKinds.map((kind) => ({
57
+ Trigger.Kinds.map((kind) => ({
52
58
  value: kind,
53
59
  label: t(`trigger type ${kind}`),
54
60
  })),
55
61
  [t],
56
62
  );
57
63
 
58
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
64
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
59
65
  };
66
+
67
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -2,33 +2,56 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
- import React, { useEffect, useState } from 'react';
6
+ import React, { useState } from 'react';
9
7
 
10
- import { Obj } from '@dxos/echo';
11
- import { FunctionTrigger, FunctionType } from '@dxos/functions';
8
+ import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
+ import { Function, Trigger } from '@dxos/functions';
10
+ import { invariant } from '@dxos/invariant';
12
11
  import { faker } from '@dxos/random';
13
- import { useSpaces } from '@dxos/react-client/echo';
14
- import { ContactType, withClientProvider } from '@dxos/react-client/testing';
15
- import { withLayout, withTheme } from '@dxos/storybook-utils';
12
+ import { useQuery } from '@dxos/react-client/echo';
13
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
14
+ import { useAsyncEffect } from '@dxos/react-ui';
15
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form';
17
+ import { Employer, Organization, Person, Project } from '@dxos/types';
16
18
 
17
19
  import { functions } from '../../testing';
18
20
  import { translations } from '../../translations';
19
21
 
20
- import { TriggerEditor } from './TriggerEditor';
22
+ import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
23
+
24
+ const types = [
25
+ // TODO(burdon): Get label from annotation.
26
+ { value: Organization.Organization.typename, label: 'Organization' },
27
+ { value: Person.Person.typename, label: 'Person' },
28
+ { value: Type.getTypename(Project.Project), label: 'Project' },
29
+ { value: Employer.Employer.typename, label: 'Employer' },
30
+ ];
31
+
32
+ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
+ const { space } = useClientStory();
34
+ const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
21
36
 
22
- const DefaultStory = () => {
23
- const spaces = useSpaces();
24
- const space = spaces[1];
25
- const [trigger, setTrigger] = useState<FunctionTrigger>();
26
- useEffect(() => {
37
+ useAsyncEffect(async () => {
27
38
  if (!space) {
28
39
  return;
29
40
  }
30
41
 
31
- const trigger = space.db.add(Obj.make(FunctionTrigger, { spec: { kind: 'timer', cron: '' } }));
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
+ invariant(fn);
45
+ const trigger = space.db.add(
46
+ Trigger.make({
47
+ function: Ref.make(fn),
48
+ spec: { kind: 'webhook' },
49
+ input: {
50
+ from: 'USD',
51
+ to: 'JPY',
52
+ },
53
+ }),
54
+ );
32
55
  setTrigger(trigger);
33
56
  }, [space]);
34
57
 
@@ -37,9 +60,14 @@ const DefaultStory = () => {
37
60
  }
38
61
 
39
62
  return (
40
- <div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
41
- <TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} />
42
- </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
+ />
43
71
  );
44
72
  };
45
73
 
@@ -48,17 +76,27 @@ const meta = {
48
76
  component: TriggerEditor as any,
49
77
  render: DefaultStory,
50
78
  decorators: [
79
+ withTheme,
80
+ withLayout({ layout: 'column' }),
51
81
  withClientProvider({
52
82
  createIdentity: true,
53
83
  createSpace: true,
54
- types: [FunctionType, FunctionTrigger, ContactType],
55
- onSpaceCreated: ({ space }) => {
56
- for (const fn of functions) {
57
- space.db.add(Obj.make(FunctionType, fn));
58
- }
84
+ types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
85
+ onCreateSpace: ({ space }) => {
86
+ // Tags.
87
+ ['Important', 'Investor', 'New'].forEach((label) => {
88
+ space.db.add(Tag.make({ label }));
89
+ });
90
+
91
+ // Functions.
92
+ functions.forEach((fn) => {
93
+ space.db.add(Function.make(fn));
94
+ });
95
+
96
+ // Objects.
59
97
  Array.from({ length: 10 }).map(() => {
60
98
  return space.db.add(
61
- Obj.make(ContactType, {
99
+ Obj.make(TestSchema.ContactType, {
62
100
  name: faker.person.fullName(),
63
101
  identifiers: [],
64
102
  }),
@@ -66,11 +104,10 @@ const meta = {
66
104
  });
67
105
  },
68
106
  }),
69
- withLayout({ fullscreen: true, classNames: 'flex justify-center m-2' }),
70
- withTheme,
71
107
  ],
72
108
  parameters: {
73
- translations,
109
+ layout: 'fullscreen',
110
+ translations: [...formTranslations, ...translations],
74
111
  },
75
112
  } satisfies Meta<typeof DefaultStory>;
76
113
 
@@ -79,3 +116,9 @@ export default meta;
79
116
  type Story = StoryObj<typeof meta>;
80
117
 
81
118
  export const Default: Story = {};
119
+
120
+ export const ReadonlySpec: Story = {
121
+ args: {
122
+ readonlySpec: true,
123
+ },
124
+ };
@@ -5,51 +5,76 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { Type } from '@dxos/echo';
9
- import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
11
- import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
8
+ import { DXN, type Database, type Query } from '@dxos/echo';
9
+ import { Function, Script, Trigger } from '@dxos/functions';
10
+ import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
11
+ import { Input } from '@dxos/react-ui';
12
+ import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
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';
12
22
 
13
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
23
+ import { FunctionInputEditor } from './FunctionInputEditor';
14
24
  import { SpecSelector } from './SpecSelector';
15
25
 
16
- export type TriggerEditorProps = {
17
- space: Space;
18
- trigger: FunctionTrigger;
19
- onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
20
- onCancel?: () => void;
21
- };
26
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
22
27
 
23
- export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
24
- const handleSave = (values: FunctionTrigger) => {
25
- onSave?.(values);
26
- };
28
+ export type TriggerEditorProps = {
29
+ db: Database.Database;
30
+ trigger: Trigger.Trigger;
31
+ // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
32
+ readonlySpec?: boolean;
33
+ } &
34
+ // prettier-ignore
35
+ Pick<QueryFormProps, 'types' | 'tags'> &
36
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
27
37
 
28
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
29
- const Custom = useCustomInputs(space, handleRefQueryLookup);
38
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
+ const fieldMap = useCustomInputs({
40
+ db,
41
+ types,
42
+ tags,
43
+ readonlySpec,
44
+ });
30
45
 
31
46
  return (
32
- <Form
33
- outerSpacing={false}
34
- Custom={Custom}
35
- schema={FunctionTrigger}
47
+ <Form.Root<TriggerFormSchema>
48
+ {...formProps}
49
+ schema={omitId(Trigger.Trigger)}
36
50
  values={trigger}
37
- onSave={handleSave}
38
- onCancel={onCancel}
39
- onQueryRefOptions={handleRefQueryLookup}
40
- />
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>
41
61
  );
42
62
  };
43
63
 
44
- const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions']) => {
45
- const functions = useQuery(space, Filter.type(FunctionType));
46
- const workflows = useQuery(space, Filter.type(ComputeGraph));
47
- const scripts = useQuery(space, Filter.type(ScriptType));
64
+ type UseCustomInputsProps = {
65
+ db: Database.Database;
66
+ readonlySpec?: boolean;
67
+ } & Pick<QueryFormProps, 'types' | 'tags'>;
68
+
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));
48
73
 
49
74
  return useMemo(
50
- (): CustomInputMap => ({
75
+ (): FormFieldMap => ({
51
76
  // Function selector.
52
- ['function' satisfies keyof FunctionTrigger]: (props) => {
77
+ ['function' satisfies keyof Trigger.Trigger]: (props) => {
53
78
  const getValue = useCallback(() => {
54
79
  const formValue = props.getValue();
55
80
  if (Ref.isRef(formValue)) {
@@ -60,17 +85,17 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
60
85
 
61
86
  const handleOnValueChange = useCallback(
62
87
  (_type: any, dxnString: string) => {
63
- const dxn = Type.DXN.parse(dxnString);
88
+ const dxn = DXN.parse(dxnString);
64
89
  if (dxn) {
65
90
  const ref = Ref.fromDXN(dxn);
66
- props.onValueChange('object', ref);
91
+ props.onValueChange(props.type, ref);
67
92
  }
68
93
  },
69
- [props.onValueChange],
94
+ [props.type, props.onValueChange],
70
95
  );
71
96
 
72
97
  return (
73
- <SelectInput
98
+ <SelectField
74
99
  {...props}
75
100
  getValue={getValue as any}
76
101
  onValueChange={handleOnValueChange}
@@ -80,14 +105,28 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
80
105
  },
81
106
 
82
107
  // Spec selector.
83
- ['spec.kind' as const]: SpecSelector,
108
+ ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec} />,
109
+
110
+ // TODO(wittjosiah): Copied from ViewEditor.
111
+ // Query input editor.
112
+ ['spec.query' as const]: (props) => {
113
+ const handleChange = useCallback(
114
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
115
+ [props.type, props.onValueChange],
116
+ );
117
+
118
+ return (
119
+ <Input.Root>
120
+ <FormFieldLabel label={props.label} asChild />
121
+ <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
122
+ </Input.Root>
123
+ );
124
+ },
84
125
 
85
126
  // Function input editor.
86
- ['input' as const]: (props) => (
87
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
88
- ),
127
+ ['input' as const]: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
89
128
  }),
90
- [workflows, scripts, functions],
129
+ [workflows, scripts, functions, readonlySpec],
91
130
  );
92
131
  };
93
132
 
@@ -95,7 +134,7 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
95
134
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
96
135
  };
97
136
 
98
- const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
99
- const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
137
+ const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
138
+ const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
100
139
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
101
140
  };
@@ -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 (
@@ -2,29 +2,66 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import type { Effect } from 'effect';
6
- import { useCallback } from 'react';
5
+ import * as Cause from 'effect/Cause';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Exit from 'effect/Exit';
8
+ import { type DependencyList, useCallback } from 'react';
7
9
 
8
- import { useCapability } from '@dxos/app-framework';
9
- import type { Space } from '@dxos/react-client/echo';
10
+ import { useCapability } from '@dxos/app-framework/react';
11
+ import { type Key } from '@dxos/echo';
12
+ import { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';
13
+ import { log } from '@dxos/log';
10
14
 
11
- import { AutomationCapabilities } from '../capabilities';
15
+ import { AutomationCapabilities } from '../types';
12
16
 
13
17
  /**
14
18
  * Create an effectful function that has access to compute services
15
19
  */
20
+ // TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
16
21
  export const useComputeRuntimeCallback = <T>(
17
- space: Space | undefined,
22
+ id: Key.SpaceId | undefined,
18
23
  fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
19
- deps?: React.DependencyList,
24
+ deps?: DependencyList,
20
25
  ): (() => Promise<T>) => {
21
26
  const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
22
- const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
27
+ const runtime = id !== undefined ? computeRuntime.getRuntime(id) : undefined;
23
28
 
24
29
  return useCallback(() => {
25
30
  if (!runtime) {
26
31
  throw new TypeError('Space not provided to useComputeRuntimeCallback');
27
32
  }
33
+
28
34
  return runtime.runPromise(fn());
29
35
  }, [runtime, ...(deps ?? [])]);
30
36
  };
37
+
38
+ // TODO(wittjosiah): Function invoking should automatically be traced (DX-647).
39
+ export const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>
40
+ Effect.gen(function* () {
41
+ const tracer = yield* TracingService;
42
+ const trace = yield* tracer.traceInvocationStart({
43
+ target: undefined,
44
+ payload: {
45
+ data: {},
46
+ },
47
+ });
48
+
49
+ // Invoke the function.
50
+ const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(
51
+ Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),
52
+ Effect.exit,
53
+ );
54
+
55
+ if (Exit.isFailure(result)) {
56
+ const error = Cause.prettyErrors(result.cause)[0];
57
+ log.error(error.message, error.cause ?? error.stack);
58
+ }
59
+
60
+ yield* tracer.traceInvocationEnd({
61
+ trace,
62
+ // TODO(dmaretskyi): Might miss errors.
63
+ exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,
64
+ });
65
+
66
+ return result;
67
+ });
@@ -2,31 +2,32 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Effect } from 'effect';
5
+ import * as Effect from 'effect/Effect';
6
6
 
7
- import { Filter } from '@dxos/echo';
8
- import { FunctionTrigger, TriggerDispatcher } from '@dxos/functions';
9
- import { type Space, useQuery } from '@dxos/react-client/echo';
7
+ import { type Database, Filter } from '@dxos/echo';
8
+ import { Trigger } from '@dxos/functions';
9
+ import { TriggerDispatcher } from '@dxos/functions-runtime';
10
+ import { useQuery } from '@dxos/react-client/echo';
10
11
  import { useAsyncState } from '@dxos/react-ui';
11
12
 
12
13
  import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
13
14
 
14
15
  interface TriggerRuntimeControls {
15
- triggers: FunctionTrigger[];
16
+ triggers: Trigger.Trigger[];
16
17
  isRunning: boolean;
17
18
  start: () => void;
18
19
  stop: () => void;
19
20
  }
20
21
 
21
- export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
22
- const triggers = useQuery(space, Filter.type(FunctionTrigger));
22
+ export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
23
+ const triggers = useQuery(db, Filter.type(Trigger.Trigger));
23
24
 
24
25
  const [isRunningState, setIsRunningState] = useAsyncState(
25
- useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
26
+ useComputeRuntimeCallback(db?.spaceId, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
26
27
  );
27
28
 
28
29
  const start = useComputeRuntimeCallback(
29
- space,
30
+ db?.spaceId,
30
31
  Effect.fnUntraced(function* () {
31
32
  const dispatcher = yield* TriggerDispatcher;
32
33
  yield* dispatcher.start();
@@ -35,7 +36,7 @@ export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRunt
35
36
  );
36
37
 
37
38
  const stop = useComputeRuntimeCallback(
38
- space,
39
+ db?.spaceId,
39
40
  Effect.fnUntraced(function* () {
40
41
  const dispatcher = yield* TriggerDispatcher;
41
42
  yield* dispatcher.stop();
package/src/index.ts CHANGED
@@ -2,8 +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';
7
+ export * from './hooks';
8
+ export * from './types';
8
9
 
9
10
  export * from './AutomationPlugin';
package/src/meta.ts CHANGED
@@ -2,15 +2,16 @@
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
+ import { trim } from '@dxos/util';
6
7
 
7
- export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
8
-
9
- export const meta: PluginMeta = {
10
- id: AUTOMATION_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'dxos.org/plugin/automation',
11
10
  name: 'Automation',
12
- description:
13
- 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',
11
+ description: trim`
12
+ Workflow automation engine that triggers custom actions based on object events and conditions.
13
+ Create automated pipelines that respond to changes and streamline repetitive tasks.
14
+ `,
14
15
  icon: 'ph--robot--regular',
15
16
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
16
17
  };
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
5
+ import * as Schema from 'effect/Schema';
6
6
 
7
- import { ContactType } from '@dxos/client/testing';
7
+ import { TestSchema } from '@dxos/client/testing';
8
8
  import { Type } from '@dxos/echo';
9
9
 
10
10
  export const functions = [
@@ -35,7 +35,7 @@ export const functions = [
35
35
  version: '0.0.1',
36
36
  inputSchema: Type.toJsonSchema(
37
37
  Schema.Struct({
38
- contact: Type.Ref(ContactType).annotations({ title: 'Contact' }),
38
+ contact: Type.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
39
39
  }),
40
40
  ),
41
41
  },
@@ -22,10 +22,15 @@ export const translations = [
22
22
 
23
23
  'functions panel label': 'Functions',
24
24
  'functions verbose label': 'Manage deployed functions',
25
+ 'functions registry verbose label': 'Functions registry',
26
+ 'functions registry description': 'Import functions from the registry',
25
27
  'functions description': 'You can manage all the functions deployed from your space on EDGE here.',
26
28
  'function copy id': 'Copy Function ID',
27
29
  'no functions found': 'No functions found',
28
30
  'go to function source button label': 'Show function source',
31
+ 'delete function button label': 'Delete function',
32
+
33
+ 'function parameters label': 'Function parameters',
29
34
 
30
35
  'trigger editor title': 'Configure Trigger',
31
36
  'new trigger label': 'Add Trigger',
@@ -0,0 +1,42 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import type * as ManagedRuntime from 'effect/ManagedRuntime';
6
+
7
+ import { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
8
+ import { Capability } from '@dxos/app-framework';
9
+ import { type Database } from '@dxos/echo';
10
+ import type { CredentialsService, FunctionInvocationService, QueueService, TracingService } from '@dxos/functions';
11
+ import type { TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';
12
+ import type { SpaceId } from '@dxos/keys';
13
+
14
+ import { meta } from '../meta';
15
+
16
+ export namespace AutomationCapabilities {
17
+ /**
18
+ * Service stack for executing agents, functions, and triggers.
19
+ */
20
+ export type ComputeServices =
21
+ | TriggerDispatcher
22
+ | TriggerStateStore
23
+ | AiService.AiService
24
+ | Database.Service
25
+ | QueueService
26
+ | CredentialsService
27
+ | FunctionInvocationService
28
+ | TracingService
29
+ // TODO(dmaretskyi): Those should be provided at AI-chat call site.
30
+ | ToolResolverService
31
+ | ToolExecutionService;
32
+
33
+ export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;
34
+ export interface ComputeRuntimeProvider {
35
+ getRuntime(spaceId: SpaceId): ComputeRuntime;
36
+ }
37
+
38
+ /**
39
+ * Runtime for executing agents, functions, and triggers.
40
+ */
41
+ export const ComputeRuntime = Capability.make<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);
42
+ }
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { ActivationEvent } from '@dxos/app-framework';
6
+
7
+ import { meta } from '../meta';
8
+
9
+ export namespace AutomationEvents {
10
+ export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}/event/compute-runtime-ready`);
11
+ }