@dxos/plugin-automation 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae

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 (313) hide show
  1. package/dist/lib/browser/AutomationPanel-EHRSV2DL.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs +37 -0
  3. package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs +43 -0
  5. package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-5WPUZGRB.mjs} +3 -3
  7. package/dist/lib/browser/FunctionsRegistry-XRXIZRLL.mjs +10 -0
  8. package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs +13 -0
  9. package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs.map +7 -0
  10. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +85 -0
  11. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-3P4R5WNC.mjs +8 -0
  13. package/dist/lib/browser/chunk-3P4R5WNC.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-4EY2KMCM.mjs +272 -0
  15. package/dist/lib/browser/chunk-4EY2KMCM.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-QPG3AKFX.mjs +93 -0
  19. package/dist/lib/browser/chunk-QPG3AKFX.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-SEG5OCGB.mjs +31 -0
  21. package/dist/lib/browser/chunk-SEG5OCGB.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-U55ZXRYM.mjs +98 -0
  23. package/dist/lib/browser/chunk-U55ZXRYM.mjs.map +7 -0
  24. package/dist/lib/browser/chunk-WOBCY2FQ.mjs +83 -0
  25. package/dist/lib/browser/chunk-WOBCY2FQ.mjs.map +7 -0
  26. package/dist/lib/browser/chunk-XFXYU645.mjs +96 -0
  27. package/dist/lib/browser/chunk-XFXYU645.mjs.map +7 -0
  28. package/dist/lib/browser/chunk-ZNI2CGQP.mjs +270 -0
  29. package/dist/lib/browser/chunk-ZNI2CGQP.mjs.map +7 -0
  30. package/dist/lib/browser/cli/index.mjs +1108 -0
  31. package/dist/lib/browser/cli/index.mjs.map +7 -0
  32. package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs +124 -0
  33. package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs.map +7 -0
  34. package/dist/lib/browser/hooks/index.mjs +13 -0
  35. package/dist/lib/browser/index.mjs +72 -50
  36. package/dist/lib/browser/index.mjs.map +4 -4
  37. package/dist/lib/browser/meta.json +1 -1
  38. package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs +83 -0
  39. package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs.map +7 -0
  40. package/dist/lib/browser/react-surface-U6FAYV42.mjs +69 -0
  41. package/dist/lib/browser/react-surface-U6FAYV42.mjs.map +7 -0
  42. package/dist/lib/browser/types/index.mjs +10 -4
  43. package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-F7MPUR7U.mjs} +4 -4
  44. package/dist/lib/node-esm/AutomationPanel-F7MPUR7U.mjs.map +7 -0
  45. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs +38 -0
  46. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs.map +7 -0
  47. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs +44 -0
  48. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs.map +7 -0
  49. package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-UFL5LT2R.mjs} +3 -3
  50. package/dist/lib/node-esm/FunctionsPanel-UFL5LT2R.mjs.map +7 -0
  51. package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs +11 -0
  52. package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs.map +7 -0
  53. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs +14 -0
  54. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs.map +7 -0
  55. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +86 -0
  56. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +7 -0
  57. package/dist/lib/node-esm/chunk-2X564LII.mjs +10 -0
  58. package/dist/lib/node-esm/chunk-2X564LII.mjs.map +7 -0
  59. package/dist/lib/node-esm/chunk-34HGM46Z.mjs +32 -0
  60. package/dist/lib/node-esm/chunk-34HGM46Z.mjs.map +7 -0
  61. package/dist/lib/node-esm/chunk-4DK33JDH.mjs +84 -0
  62. package/dist/lib/node-esm/chunk-4DK33JDH.mjs.map +7 -0
  63. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +19 -0
  64. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
  65. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs +273 -0
  66. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs.map +7 -0
  67. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs +271 -0
  68. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs.map +7 -0
  69. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs +99 -0
  70. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs.map +7 -0
  71. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs +94 -0
  72. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs.map +7 -0
  73. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs +97 -0
  74. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs.map +7 -0
  75. package/dist/lib/node-esm/cli/index.mjs +1109 -0
  76. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  77. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs +125 -0
  78. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs.map +7 -0
  79. package/dist/lib/node-esm/hooks/index.mjs +14 -0
  80. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  81. package/dist/lib/node-esm/index.mjs +72 -50
  82. package/dist/lib/node-esm/index.mjs.map +4 -4
  83. package/dist/lib/node-esm/meta.json +1 -1
  84. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs +84 -0
  85. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs.map +7 -0
  86. package/dist/lib/node-esm/{react-surface-3PNW7NDW.mjs → react-surface-BVNHCWQ7.mjs} +31 -26
  87. package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs.map +7 -0
  88. package/dist/lib/node-esm/types/index.mjs +10 -4
  89. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  90. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  91. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  92. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  94. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  96. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  98. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  99. package/dist/types/src/capabilities/index.d.ts +4 -3
  100. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  101. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  102. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  104. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  106. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  108. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/index.d.ts +2 -0
  110. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  112. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  114. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  116. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  118. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  120. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  121. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  122. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  124. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  126. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  128. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  130. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  132. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  134. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  135. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  136. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  137. package/dist/types/src/cli/index.d.ts +2 -0
  138. package/dist/types/src/cli/index.d.ts.map +1 -0
  139. package/dist/types/src/cli/plugin.d.ts +3 -0
  140. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  141. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -3
  142. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  143. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +50 -4
  144. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  145. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  146. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  147. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  148. package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
  149. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  150. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  151. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  152. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  153. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  154. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
  155. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  156. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +119 -4
  157. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  158. package/dist/types/src/components/index.d.ts +2 -3
  159. package/dist/types/src/components/index.d.ts.map +1 -1
  160. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  161. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  162. package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
  163. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  164. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  165. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  166. package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
  167. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  168. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  169. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  170. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  171. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  172. package/dist/types/src/containers/index.d.ts +5 -0
  173. package/dist/types/src/containers/index.d.ts.map +1 -0
  174. package/dist/types/src/hooks/index.d.ts +3 -0
  175. package/dist/types/src/hooks/index.d.ts.map +1 -0
  176. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +12 -0
  177. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  178. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
  179. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  180. package/dist/types/src/index.d.ts +2 -0
  181. package/dist/types/src/index.d.ts.map +1 -1
  182. package/dist/types/src/meta.d.ts +2 -3
  183. package/dist/types/src/meta.d.ts.map +1 -1
  184. package/dist/types/src/testing/test-functions.d.ts +202 -3
  185. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  186. package/dist/types/src/translations.d.ts +7 -0
  187. package/dist/types/src/translations.d.ts.map +1 -1
  188. package/dist/types/src/types/capabilities.d.ts +22 -0
  189. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  190. package/dist/types/src/types/events.d.ts +5 -0
  191. package/dist/types/src/types/events.d.ts.map +1 -0
  192. package/dist/types/src/types/index.d.ts +2 -0
  193. package/dist/types/src/types/index.d.ts.map +1 -1
  194. package/dist/types/src/types/schema.d.ts +31 -2
  195. package/dist/types/src/types/schema.d.ts.map +1 -1
  196. package/dist/types/tsconfig.tsbuildinfo +1 -1
  197. package/package.json +82 -41
  198. package/src/AutomationPlugin.tsx +19 -32
  199. package/src/capabilities/app-graph-builder/app-graph-builder.ts +72 -0
  200. package/src/capabilities/app-graph-builder/index.ts +7 -0
  201. package/src/capabilities/compute-runtime/compute-runtime.ts +146 -0
  202. package/src/capabilities/compute-runtime/index.ts +7 -0
  203. package/src/capabilities/index.ts +4 -5
  204. package/src/capabilities/operation-resolver/index.ts +7 -0
  205. package/src/capabilities/operation-resolver/operation-resolver.ts +80 -0
  206. package/src/capabilities/react-surface/index.ts +7 -0
  207. package/src/capabilities/react-surface/react-surface.tsx +61 -0
  208. package/src/cli/commands/index.ts +5 -0
  209. package/src/cli/commands/trigger/create/index.ts +14 -0
  210. package/src/cli/commands/trigger/create/queue.ts +89 -0
  211. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  212. package/src/cli/commands/trigger/create/timer.ts +93 -0
  213. package/src/cli/commands/trigger/index.ts +16 -0
  214. package/src/cli/commands/trigger/list.ts +67 -0
  215. package/src/cli/commands/trigger/options.ts +59 -0
  216. package/src/cli/commands/trigger/remove.ts +45 -0
  217. package/src/cli/commands/trigger/update/index.ts +14 -0
  218. package/src/cli/commands/trigger/update/queue.ts +195 -0
  219. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  220. package/src/cli/commands/trigger/update/timer.ts +193 -0
  221. package/src/cli/commands/trigger/util.ts +395 -0
  222. package/src/cli/index.ts +5 -0
  223. package/src/cli/plugin.ts +24 -0
  224. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +16 -17
  225. package/src/components/AutomationPanel/AutomationPanel.tsx +238 -89
  226. package/src/components/FunctionsPanel/FunctionsPanel.tsx +37 -25
  227. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +110 -0
  228. package/src/components/FunctionsRegistry/index.ts +8 -0
  229. package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
  230. package/src/components/TriggerEditor/SpecSelector.tsx +29 -21
  231. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +121 -33
  232. package/src/components/TriggerEditor/TriggerEditor.tsx +96 -48
  233. package/src/components/index.ts +1 -2
  234. package/src/containers/AutomationSettings/AutomationSettings.tsx +27 -0
  235. package/src/containers/AutomationSettings/index.ts +7 -0
  236. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  237. package/src/containers/FunctionsContainer/index.ts +7 -0
  238. package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
  239. package/src/containers/TriggerSettings/index.ts +7 -0
  240. package/src/containers/index.ts +9 -0
  241. package/src/hooks/index.ts +6 -0
  242. package/src/hooks/useComputeRuntimeCallback.ts +67 -0
  243. package/src/hooks/useTriggerRuntimeControls.ts +67 -0
  244. package/src/index.ts +2 -0
  245. package/src/meta.ts +8 -7
  246. package/src/testing/test-functions.ts +7 -7
  247. package/src/translations.ts +11 -0
  248. package/src/types/capabilities.ts +43 -0
  249. package/src/types/events.ts +11 -0
  250. package/src/types/index.ts +2 -0
  251. package/src/types/schema.ts +24 -3
  252. package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs +0 -38
  253. package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs.map +0 -7
  254. package/dist/lib/browser/AutomationPanel-ZWA6GOFY.mjs +0 -11
  255. package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs +0 -39
  256. package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs.map +0 -7
  257. package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs +0 -80
  258. package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs.map +0 -7
  259. package/dist/lib/browser/chunk-ECSTS2UI.mjs +0 -14
  260. package/dist/lib/browser/chunk-ECSTS2UI.mjs.map +0 -7
  261. package/dist/lib/browser/chunk-ERTIGJYE.mjs +0 -147
  262. package/dist/lib/browser/chunk-ERTIGJYE.mjs.map +0 -7
  263. package/dist/lib/browser/chunk-FSJZXTS2.mjs +0 -230
  264. package/dist/lib/browser/chunk-FSJZXTS2.mjs.map +0 -7
  265. package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
  266. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
  268. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
  269. package/dist/lib/browser/chunk-LYJVTIVD.mjs +0 -94
  270. package/dist/lib/browser/chunk-LYJVTIVD.mjs.map +0 -7
  271. package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs +0 -76
  272. package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs.map +0 -7
  273. package/dist/lib/browser/react-surface-4DFSM7OX.mjs +0 -64
  274. package/dist/lib/browser/react-surface-4DFSM7OX.mjs.map +0 -7
  275. package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs +0 -39
  276. package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs.map +0 -7
  277. package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs +0 -40
  278. package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs.map +0 -7
  279. package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs +0 -81
  280. package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs.map +0 -7
  281. package/dist/lib/node-esm/chunk-AZH66CED.mjs +0 -231
  282. package/dist/lib/node-esm/chunk-AZH66CED.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-HIMYPGHF.mjs +0 -148
  284. package/dist/lib/node-esm/chunk-HIMYPGHF.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
  286. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  287. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
  288. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
  289. package/dist/lib/node-esm/chunk-SGZPTJ47.mjs +0 -16
  290. package/dist/lib/node-esm/chunk-SGZPTJ47.mjs.map +0 -7
  291. package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs +0 -95
  292. package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs.map +0 -7
  293. package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs +0 -77
  294. package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs.map +0 -7
  295. package/dist/lib/node-esm/react-surface-3PNW7NDW.mjs.map +0 -7
  296. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  297. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  298. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  299. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  300. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  301. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  302. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  303. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  304. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  305. package/src/capabilities/app-graph-builder.ts +0 -86
  306. package/src/capabilities/intent-resolver.ts +0 -72
  307. package/src/capabilities/react-surface.tsx +0 -56
  308. package/src/components/AutomationContainer.tsx +0 -30
  309. package/src/components/FunctionsContainer.tsx +0 -31
  310. /package/dist/lib/browser/{AutomationPanel-ZWA6GOFY.mjs.map → AutomationPanel-EHRSV2DL.mjs.map} +0 -0
  311. /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-5WPUZGRB.mjs.map} +0 -0
  312. /package/dist/lib/{node-esm/AutomationPanel-YYUMSK2W.mjs.map → browser/FunctionsRegistry-XRXIZRLL.mjs.map} +0 -0
  313. /package/dist/lib/{node-esm/FunctionsPanel-KGIOZSPZ.mjs.map → browser/hooks/index.mjs.map} +0 -0
@@ -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 JsonPath } from '@dxos/echo-schema';
9
- import { type FunctionType } from '@dxos/functions';
10
- import { useOnTransition } from '@dxos/react-ui';
11
- import { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';
8
+ import { type Database, JsonSchema, Obj, Ref } from '@dxos/echo';
9
+ import { type JsonPath } from '@dxos/echo/internal';
10
+ import { type Function } from '@dxos/functions';
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 = {
14
- functions: FunctionType[];
15
- onQueryRefOptions: QueryRefOptions;
16
- } & FormInputStateProps;
17
+ type: SchemaAST.AST;
18
+ functions: Function.Function[];
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);
@@ -39,22 +36,30 @@ export const FunctionInputEditor = ({
39
36
  useOnTransition(
40
37
  // Clear function parameter input when the function changes.
41
38
  selectedFunctionValue,
42
- (prevValue) => prevValue !== undefined && prevValue !== selectedFunctionValue,
39
+ (prevValue) => {
40
+ if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
41
+ return false;
42
+ }
43
+
44
+ return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
45
+ },
43
46
  (currValue) => currValue !== undefined,
44
- () => onValueChange('object', {}),
47
+ () => onValueChange(type, {}),
45
48
  );
46
49
 
47
50
  const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
48
- const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
51
+ const effectSchema = useMemo(() => (inputSchema ? JsonSchema.toEffectSchema(inputSchema) : undefined), [inputSchema]);
49
52
  const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
53
+ const defaultValues = useMemo(() => {
54
+ const raw = getValue() ?? {};
55
+ return Obj.isObject(raw) ? { ...Obj.getSnapshot(raw) } : { ...raw };
56
+ }, [getValue]);
50
57
 
51
- const values = useMemo(() => getValue() ?? {}, [getValue]);
52
-
53
- const handleValuesChanged = useCallback(
54
- (values: any) => {
55
- onValueChange('object', values);
58
+ const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(
59
+ (values) => {
60
+ onValueChange(type, values);
56
61
  },
57
- [onValueChange],
62
+ [type, onValueChange],
58
63
  );
59
64
 
60
65
  if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
@@ -63,16 +68,18 @@ export const FunctionInputEditor = ({
63
68
 
64
69
  return (
65
70
  <>
66
- <h3 className='text-md'>Function parameters</h3>
67
- {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.
68
- This would allow errors to flow up to the root context. */}
69
- <Form
71
+ <Form.Label label={t('function parameters label')} asChild />
72
+ <Form.Root
73
+ key={selectedFunction.id}
70
74
  schema={effectSchema}
71
- values={values}
75
+ defaultValues={defaultValues}
76
+ db={db}
72
77
  onValuesChanged={handleValuesChanged}
73
- onQueryRefOptions={onQueryRefOptions}
74
- outerSpacing={false}
75
- />
78
+ >
79
+ <Form.FieldSet />
80
+ </Form.Root>
76
81
  </>
77
82
  );
78
83
  };
84
+
85
+ FunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';
@@ -4,32 +4,38 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
- import { type FunctionTriggerType, TriggerKind, 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 { SelectInput, type InputProps, 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 FunctionTriggerType]);
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
- case TriggerKind.Timer:
24
- return { kind: TriggerKind.Timer, cron: '' };
25
- case TriggerKind.Subscription:
26
- return { kind: TriggerKind.Subscription, filter: {} };
27
- case TriggerKind.Queue:
28
- return { kind: TriggerKind.Queue, queue: '' };
29
- case TriggerKind.Email:
30
- return { kind: TriggerKind.Email };
31
- case TriggerKind.Webhook:
32
- return { kind: TriggerKind.Webhook };
24
+ case 'timer':
25
+ return { kind: 'timer', cron: '' };
26
+ case 'subscription':
27
+ return {
28
+ kind: 'subscription',
29
+ query: {
30
+ ast: Query.select(Filter.nothing()).ast,
31
+ },
32
+ };
33
+ case 'queue':
34
+ return { kind: 'queue', queue: 'dxn:queue:default' };
35
+ case 'email':
36
+ return { kind: 'email' };
37
+ case 'webhook':
38
+ return { kind: 'webhook' };
33
39
  default:
34
40
  return undefined;
35
41
  }
@@ -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
- Object.values(TriggerKind).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,32 +2,57 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
5
+ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import React, { useState } from 'react';
7
+ import { expect, userEvent, within } from 'storybook/test';
6
8
 
7
- import { type Meta } from '@storybook/react-vite';
8
- import React, { useEffect, useState } from 'react';
9
-
10
- import { Obj } from '@dxos/echo';
11
- import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions';
9
+ import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
10
+ import { Function, Trigger } from '@dxos/functions';
11
+ import { invariant } from '@dxos/invariant';
12
12
  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';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
+ import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
+ import { translations as formTranslations } from '@dxos/react-ui-form';
18
+ import { Employer, Organization, Person, Pipeline } from '@dxos/types';
16
19
 
17
- import { TriggerEditor } from './TriggerEditor';
18
20
  import { functions } from '../../testing';
19
21
  import { translations } from '../../translations';
20
22
 
21
- const DefaultStory = () => {
22
- const spaces = useSpaces();
23
- const space = spaces[1];
24
- const [trigger, setTrigger] = useState<FunctionTrigger>();
25
- useEffect(() => {
23
+ import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
24
+
25
+ const types = [
26
+ // TODO(burdon): Get label from annotation.
27
+ { value: Organization.Organization.typename, label: 'Organization' },
28
+ { value: Person.Person.typename, label: 'Person' },
29
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
30
+ { value: Employer.Employer.typename, label: 'Employer' },
31
+ ];
32
+
33
+ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
34
+ const { space } = useClientStory();
35
+ const [trigger, setTrigger] = useState<Trigger.Trigger>();
36
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
37
+
38
+ useAsyncEffect(async () => {
26
39
  if (!space) {
27
40
  return;
28
41
  }
29
42
 
30
- const trigger = space.db.add(Obj.make(FunctionTrigger, { spec: { kind: TriggerKind.Timer, cron: '' } }));
43
+ const functions = await space.db.query(Filter.type(Function.Function)).run();
44
+ const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
45
+ invariant(fn);
46
+ const trigger = space.db.add(
47
+ Trigger.make({
48
+ function: Ref.make(fn),
49
+ spec: { kind: 'webhook' },
50
+ input: {
51
+ from: 'USD',
52
+ to: 'JPY',
53
+ },
54
+ }),
55
+ );
31
56
  setTrigger(trigger);
32
57
  }, [space]);
33
58
 
@@ -36,28 +61,43 @@ const DefaultStory = () => {
36
61
  }
37
62
 
38
63
  return (
39
- <div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
40
- <TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} />
41
- </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
+ />
42
72
  );
43
73
  };
44
74
 
45
- const meta: Meta = {
46
- title: 'plugins/plugin-automation/TriggerEditor',
47
- component: TriggerEditor,
75
+ const meta = {
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
77
+ component: TriggerEditor as any,
48
78
  render: DefaultStory,
49
79
  decorators: [
80
+ withTheme(),
81
+ withLayout({ layout: 'column' }),
50
82
  withClientProvider({
51
83
  createIdentity: true,
52
84
  createSpace: true,
53
- types: [FunctionType, FunctionTrigger, ContactType],
54
- onSpaceCreated: ({ space }) => {
55
- for (const fn of functions) {
56
- space.db.add(Obj.make(FunctionType, fn));
57
- }
85
+ types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
86
+ onCreateSpace: ({ space }) => {
87
+ // Tags.
88
+ ['Important', 'Investor', 'New'].forEach((label) => {
89
+ space.db.add(Tag.make({ label }));
90
+ });
91
+
92
+ // Functions.
93
+ functions.forEach((fn) => {
94
+ space.db.add(Function.make(fn));
95
+ });
96
+
97
+ // Objects.
58
98
  Array.from({ length: 10 }).map(() => {
59
99
  return space.db.add(
60
- Obj.make(ContactType, {
100
+ Obj.make(TestSchema.ContactType, {
61
101
  name: faker.person.fullName(),
62
102
  identifiers: [],
63
103
  }),
@@ -65,14 +105,62 @@ const meta: Meta = {
65
105
  });
66
106
  },
67
107
  }),
68
- withLayout({ fullscreen: true, classNames: 'flex justify-center m-2' }),
69
- withTheme,
70
108
  ],
71
109
  parameters: {
72
- translations,
110
+ layout: 'fullscreen',
111
+ translations: [...formTranslations, ...translations],
73
112
  },
74
- };
113
+ } satisfies Meta<typeof DefaultStory>;
75
114
 
76
115
  export default meta;
77
116
 
78
- export const Default = {};
117
+ type Story = StoryObj<typeof meta>;
118
+
119
+ export const Default: Story = {};
120
+
121
+ export const ReadonlySpec: Story = {
122
+ args: {
123
+ readonlySpec: true,
124
+ },
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).
163
+ await selectKind(combobox, 'q');
164
+ await expect(canvas.findByLabelText('DXN')).resolves.toBeInTheDocument();
165
+ },
166
+ };
@@ -5,57 +5,91 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { Type } from '@dxos/echo';
8
+ import { DXN, type Database, Obj, 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';
9
13
  import {
10
- FunctionType,
11
- FunctionTriggerSchema,
12
- type FunctionTriggerType,
13
- type FunctionTrigger,
14
- ScriptType,
15
- } from '@dxos/functions';
16
- import { Filter, Ref, useQuery, type Space } from '@dxos/react-client/echo';
17
- import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
18
-
19
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
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';
20
24
  import { SpecSelector } from './SpecSelector';
21
25
 
26
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
27
+
22
28
  export type TriggerEditorProps = {
23
- space: Space;
24
- trigger: FunctionTriggerType;
25
- onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
26
- onCancel?: () => void;
27
- };
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'>;
28
37
 
29
- export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
30
- const handleSave = (values: FunctionTriggerType) => {
31
- onSave?.(values);
32
- };
38
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
+ const fieldMap = useCustomInputs({
40
+ db,
41
+ types,
42
+ tags,
43
+ readonlySpec,
44
+ });
33
45
 
34
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
35
- const Custom = useCustomInputs(space, handleRefQueryLookup);
46
+ const handleValuesChanged = useCallback(
47
+ (newValues: Partial<TriggerFormSchema>) => {
48
+ Obj.change(trigger, (t) => {
49
+ Object.assign(t, newValues);
50
+ });
51
+ },
52
+ [trigger],
53
+ );
54
+
55
+ const defaultValues = useMemo(() => {
56
+ const { id: _, ...values } = trigger;
57
+ return values;
58
+ }, [trigger]);
36
59
 
37
60
  return (
38
- <Form
39
- outerSpacing={false}
40
- Custom={Custom}
41
- schema={FunctionTriggerSchema}
42
- values={trigger}
43
- onSave={handleSave}
44
- onCancel={onCancel}
45
- onQueryRefOptions={handleRefQueryLookup}
46
- />
61
+ <Form.Root<TriggerFormSchema>
62
+ {...formProps}
63
+ schema={omitId(Trigger.Trigger)}
64
+ defaultValues={defaultValues}
65
+ db={db}
66
+ fieldMap={fieldMap}
67
+ onValuesChanged={handleValuesChanged}
68
+ >
69
+ <Form.Viewport>
70
+ <Form.Content>
71
+ <Form.FieldSet />
72
+ <Form.Actions />
73
+ </Form.Content>
74
+ </Form.Viewport>
75
+ </Form.Root>
47
76
  );
48
77
  };
49
78
 
50
- const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions']) => {
51
- const functions = useQuery(space, Filter.type(FunctionType));
52
- const workflows = useQuery(space, Filter.type(ComputeGraph));
53
- const scripts = useQuery(space, Filter.type(ScriptType));
79
+ type UseCustomInputsProps = {
80
+ db: Database.Database;
81
+ readonlySpec?: boolean;
82
+ } & Pick<QueryFormProps, 'types' | 'tags'>;
83
+
84
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
85
+ const functions = useQuery(db, Filter.type(Function.Function));
86
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
87
+ const scripts = useQuery(db, Filter.type(Script.Script));
54
88
 
55
89
  return useMemo(
56
- (): CustomInputMap => ({
90
+ (): FormFieldMap => ({
57
91
  // Function selector.
58
- ['function' satisfies keyof FunctionTriggerType]: (props) => {
92
+ ['function' satisfies keyof Trigger.Trigger]: (props) => {
59
93
  const getValue = useCallback(() => {
60
94
  const formValue = props.getValue();
61
95
  if (Ref.isRef(formValue)) {
@@ -66,17 +100,17 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
66
100
 
67
101
  const handleOnValueChange = useCallback(
68
102
  (_type: any, dxnString: string) => {
69
- const dxn = Type.DXN.parse(dxnString);
103
+ const dxn = DXN.parse(dxnString);
70
104
  if (dxn) {
71
105
  const ref = Ref.fromDXN(dxn);
72
- props.onValueChange('object', ref);
106
+ props.onValueChange(props.type, ref);
73
107
  }
74
108
  },
75
- [props.onValueChange],
109
+ [props.type, props.onValueChange],
76
110
  );
77
111
 
78
112
  return (
79
- <SelectInput
113
+ <SelectField
80
114
  {...props}
81
115
  getValue={getValue as any}
82
116
  onValueChange={handleOnValueChange}
@@ -86,14 +120,28 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
86
120
  },
87
121
 
88
122
  // Spec selector.
89
- ['spec.kind' as const]: SpecSelector,
123
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
124
+
125
+ // TODO(wittjosiah): Copied from ViewEditor.
126
+ // Query input editor.
127
+ 'spec.query': (props) => {
128
+ const handleChange = useCallback(
129
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
130
+ [props.type, props.onValueChange],
131
+ );
132
+
133
+ return (
134
+ <Input.Root>
135
+ <FormFieldLabel label={props.label} asChild />
136
+ <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
137
+ </Input.Root>
138
+ );
139
+ },
90
140
 
91
141
  // Function input editor.
92
- ['input' as const]: (props) => (
93
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
94
- ),
142
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
95
143
  }),
96
- [workflows, scripts, functions],
144
+ [workflows, scripts, functions, readonlySpec],
97
145
  );
98
146
  };
99
147
 
@@ -101,7 +149,7 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
101
149
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
102
150
  };
103
151
 
104
- const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
105
- const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
152
+ const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
153
+ const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
106
154
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
107
155
  };
@@ -6,7 +6,6 @@ import { lazy } from 'react';
6
6
 
7
7
  export * from './TriggerEditor';
8
8
 
9
- export const AutomationContainer = lazy(() => import('./AutomationContainer'));
10
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
11
- export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
12
10
  export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
11
+ export const FunctionsRegistry = lazy(() => import('./FunctionsRegistry'));
@@ -0,0 +1,27 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { useTranslation } from '@dxos/react-ui';
8
+ import { Settings } from '@dxos/react-ui-form';
9
+
10
+ import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
11
+ import { meta } from '../../meta';
12
+ import { TriggersSettings } from '../TriggerSettings/TriggerSettings';
13
+
14
+ export const AutomationSettings = (props: AutomationPanelProps) => {
15
+ const { t } = useTranslation(meta.id);
16
+ return (
17
+ <Settings.Root>
18
+ <Settings.Section
19
+ title={t('automation verbose label', { ns: meta.id })}
20
+ description={t('automation description', { ns: meta.id })}
21
+ >
22
+ <AutomationPanel {...props} />
23
+ <TriggersSettings db={props.space.db} />
24
+ </Settings.Section>
25
+ </Settings.Root>
26
+ );
27
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { AutomationSettings } from './AutomationSettings';
6
+
7
+ export default AutomationSettings;
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type Space } from '@dxos/react-client/echo';
8
+ import { useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { FunctionsPanel } from '../../components/FunctionsPanel';
12
+ import { FunctionsRegistry } from '../../components/FunctionsRegistry';
13
+ import { meta } from '../../meta';
14
+
15
+ export const FunctionsContainer = ({ space }: { space: Space }) => {
16
+ const { t } = useTranslation(meta.id);
17
+ return (
18
+ <Settings.Root>
19
+ <Settings.Section
20
+ title={t('functions verbose label', { ns: meta.id })}
21
+ description={t('functions description', { ns: meta.id })}
22
+ >
23
+ <FunctionsPanel space={space} />
24
+ </Settings.Section>
25
+ <Settings.Section
26
+ title={t('functions registry verbose label', { ns: meta.id })}
27
+ description={t('functions registry description', { ns: meta.id })}
28
+ >
29
+ <FunctionsRegistry space={space} />
30
+ </Settings.Section>
31
+ </Settings.Root>
32
+ );
33
+ };