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

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 (348) hide show
  1. package/dist/lib/browser/AutomationPanel-UPV6GR5B.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-OJ4VECH7.mjs +37 -0
  3. package/dist/lib/browser/AutomationSettings-OJ4VECH7.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-DJB2M6DI.mjs +43 -0
  5. package/dist/lib/browser/FunctionsContainer-DJB2M6DI.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs → FunctionsPanel-FFGPFXSF.mjs} +3 -3
  7. package/dist/lib/browser/FunctionsRegistry-7FVC2YMN.mjs +10 -0
  8. package/dist/lib/browser/TriggerSettings-3UW3UTJE.mjs +11 -0
  9. package/dist/lib/browser/app-graph-builder-FHMSJUKB.mjs +82 -0
  10. package/dist/lib/browser/app-graph-builder-FHMSJUKB.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-3KUXM6DD.mjs +31 -0
  12. package/dist/lib/browser/chunk-3KUXM6DD.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-4HKBI6EW.mjs +295 -0
  14. package/dist/lib/browser/chunk-4HKBI6EW.mjs.map +7 -0
  15. package/dist/lib/browser/chunk-7SRDQVB2.mjs +275 -0
  16. package/dist/lib/browser/chunk-7SRDQVB2.mjs.map +7 -0
  17. package/dist/lib/browser/{chunk-NAPXRXTY.mjs → chunk-FNYP7F2T.mjs} +29 -36
  18. package/dist/lib/browser/chunk-FNYP7F2T.mjs.map +7 -0
  19. package/dist/lib/browser/{chunk-LZQFZO3B.mjs → chunk-H4ZAXPLY.mjs} +9 -2
  20. package/dist/lib/browser/chunk-H4ZAXPLY.mjs.map +7 -0
  21. package/dist/lib/browser/{chunk-YBPJCY3F.mjs → chunk-HAGI3PXT.mjs} +22 -5
  22. package/dist/lib/browser/chunk-HAGI3PXT.mjs.map +7 -0
  23. package/dist/lib/browser/chunk-UI4Q7M5V.mjs +8 -0
  24. package/dist/lib/browser/chunk-UI4Q7M5V.mjs.map +7 -0
  25. package/dist/lib/browser/chunk-UJZVGZBO.mjs +98 -0
  26. package/dist/lib/browser/chunk-UJZVGZBO.mjs.map +7 -0
  27. package/dist/lib/browser/chunk-VMFDCTFG.mjs +44 -0
  28. package/dist/lib/browser/chunk-VMFDCTFG.mjs.map +7 -0
  29. package/dist/lib/browser/chunk-YPUJSTT3.mjs +8 -0
  30. package/dist/lib/browser/chunk-YPUJSTT3.mjs.map +7 -0
  31. package/dist/lib/browser/chunk-ZDSWGE3W.mjs +101 -0
  32. package/dist/lib/browser/chunk-ZDSWGE3W.mjs.map +7 -0
  33. package/dist/lib/browser/cli/index.mjs +1127 -0
  34. package/dist/lib/browser/cli/index.mjs.map +7 -0
  35. package/dist/lib/browser/compute-runtime-Y3GEKNFP.mjs +128 -0
  36. package/dist/lib/browser/compute-runtime-Y3GEKNFP.mjs.map +7 -0
  37. package/dist/lib/browser/create-trigger-from-template-GVYDOR56.mjs +78 -0
  38. package/dist/lib/browser/create-trigger-from-template-GVYDOR56.mjs.map +7 -0
  39. package/dist/lib/browser/hooks/index.mjs +3 -3
  40. package/dist/lib/browser/index.mjs +57 -63
  41. package/dist/lib/browser/index.mjs.map +4 -4
  42. package/dist/lib/browser/meta.json +1 -1
  43. package/dist/lib/browser/operation-handler-OBMV73N3.mjs +17 -0
  44. package/dist/lib/browser/operation-handler-OBMV73N3.mjs.map +7 -0
  45. package/dist/lib/browser/operations/index.mjs +13 -0
  46. package/dist/lib/browser/operations/index.mjs.map +7 -0
  47. package/dist/lib/browser/react-surface-YRA4ZGCL.mjs +65 -0
  48. package/dist/lib/browser/react-surface-YRA4ZGCL.mjs.map +7 -0
  49. package/dist/lib/browser/types/index.mjs +10 -4
  50. package/dist/lib/node-esm/{AutomationPanel-HCVFNHGQ.mjs → AutomationPanel-TLKFNGI7.mjs} +4 -4
  51. package/dist/lib/node-esm/AutomationPanel-TLKFNGI7.mjs.map +7 -0
  52. package/dist/lib/node-esm/AutomationSettings-QAMDNV4N.mjs +38 -0
  53. package/dist/lib/node-esm/AutomationSettings-QAMDNV4N.mjs.map +7 -0
  54. package/dist/lib/node-esm/FunctionsContainer-2QRAWQGX.mjs +44 -0
  55. package/dist/lib/node-esm/FunctionsContainer-2QRAWQGX.mjs.map +7 -0
  56. package/dist/lib/node-esm/{FunctionsPanel-RVVCS6VH.mjs → FunctionsPanel-G3UFETZW.mjs} +3 -3
  57. package/dist/lib/node-esm/FunctionsPanel-G3UFETZW.mjs.map +7 -0
  58. package/dist/lib/node-esm/FunctionsRegistry-KB7NMKET.mjs +11 -0
  59. package/dist/lib/node-esm/FunctionsRegistry-KB7NMKET.mjs.map +7 -0
  60. package/dist/lib/node-esm/TriggerSettings-KL75WR7U.mjs +12 -0
  61. package/dist/lib/node-esm/TriggerSettings-KL75WR7U.mjs.map +7 -0
  62. package/dist/lib/node-esm/app-graph-builder-OVST2O6U.mjs +83 -0
  63. package/dist/lib/node-esm/app-graph-builder-OVST2O6U.mjs.map +7 -0
  64. package/dist/lib/node-esm/{chunk-CEVIVRTY.mjs → chunk-ANHRRBQW.mjs} +8 -2
  65. package/dist/lib/node-esm/chunk-ANHRRBQW.mjs.map +7 -0
  66. package/dist/lib/node-esm/{chunk-ECJKIUBO.mjs → chunk-DXL5YA73.mjs} +22 -5
  67. package/dist/lib/node-esm/chunk-DXL5YA73.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-GVKXGLAF.mjs +296 -0
  69. package/dist/lib/node-esm/chunk-GVKXGLAF.mjs.map +7 -0
  70. package/dist/lib/node-esm/{chunk-PICJ2REN.mjs → chunk-HT2NACMK.mjs} +29 -36
  71. package/dist/lib/node-esm/chunk-HT2NACMK.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-JYMW4Z5N.mjs +45 -0
  73. package/dist/lib/node-esm/chunk-JYMW4Z5N.mjs.map +7 -0
  74. package/dist/lib/node-esm/chunk-L6MEXN7V.mjs +32 -0
  75. package/dist/lib/node-esm/chunk-L6MEXN7V.mjs.map +7 -0
  76. package/dist/lib/node-esm/chunk-O5QHCG5A.mjs +276 -0
  77. package/dist/lib/node-esm/chunk-O5QHCG5A.mjs.map +7 -0
  78. package/dist/lib/node-esm/chunk-OKFUZA72.mjs +10 -0
  79. package/dist/lib/node-esm/chunk-OKFUZA72.mjs.map +7 -0
  80. package/dist/lib/node-esm/chunk-P3Q5IBZF.mjs +102 -0
  81. package/dist/lib/node-esm/chunk-P3Q5IBZF.mjs.map +7 -0
  82. package/dist/lib/node-esm/chunk-SUG55563.mjs +99 -0
  83. package/dist/lib/node-esm/chunk-SUG55563.mjs.map +7 -0
  84. package/dist/lib/node-esm/chunk-TGVY4GMA.mjs +10 -0
  85. package/dist/lib/node-esm/chunk-TGVY4GMA.mjs.map +7 -0
  86. package/dist/lib/node-esm/cli/index.mjs +1128 -0
  87. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  88. package/dist/lib/node-esm/compute-runtime-X2FXU47A.mjs +129 -0
  89. package/dist/lib/node-esm/compute-runtime-X2FXU47A.mjs.map +7 -0
  90. package/dist/lib/node-esm/create-trigger-from-template-HF7XIIRQ.mjs +79 -0
  91. package/dist/lib/node-esm/create-trigger-from-template-HF7XIIRQ.mjs.map +7 -0
  92. package/dist/lib/node-esm/hooks/index.mjs +3 -3
  93. package/dist/lib/node-esm/index.mjs +57 -63
  94. package/dist/lib/node-esm/index.mjs.map +4 -4
  95. package/dist/lib/node-esm/meta.json +1 -1
  96. package/dist/lib/node-esm/operation-handler-CI67LMB3.mjs +18 -0
  97. package/dist/lib/node-esm/operation-handler-CI67LMB3.mjs.map +7 -0
  98. package/dist/lib/node-esm/operations/index.mjs +14 -0
  99. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  100. package/dist/lib/node-esm/react-surface-C5MRQ2E3.mjs +66 -0
  101. package/dist/lib/node-esm/react-surface-C5MRQ2E3.mjs.map +7 -0
  102. package/dist/lib/node-esm/types/index.mjs +10 -4
  103. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  104. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  105. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  106. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  107. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  108. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  109. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  110. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  111. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  112. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  113. package/dist/types/src/capabilities/index.d.ts +4 -5
  114. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  115. package/dist/types/src/capabilities/operation-handler/index.d.ts +4 -0
  116. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  117. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +6 -0
  118. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  119. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  120. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  121. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  122. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/index.d.ts +2 -0
  124. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  126. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  128. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  130. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  132. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  134. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  135. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  136. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  137. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  138. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  139. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  140. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  141. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  142. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  143. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  144. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  145. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  146. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  147. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  148. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  149. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  150. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  151. package/dist/types/src/cli/index.d.ts +2 -0
  152. package/dist/types/src/cli/index.d.ts.map +1 -0
  153. package/dist/types/src/cli/plugin.d.ts +3 -0
  154. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  155. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +4 -5
  156. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  157. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +2 -0
  158. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  159. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  160. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  161. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  162. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  163. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  164. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  165. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  166. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  167. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
  168. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  169. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +73 -2
  170. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  171. package/dist/types/src/components/index.d.ts +3 -4
  172. package/dist/types/src/components/index.d.ts.map +1 -1
  173. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  174. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  175. package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
  176. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  177. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  178. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  179. package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
  180. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  181. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  182. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  183. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  184. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  185. package/dist/types/src/containers/index.d.ts +5 -0
  186. package/dist/types/src/containers/index.d.ts.map +1 -0
  187. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +7 -6
  188. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  189. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +4 -3
  190. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  191. package/dist/types/src/index.d.ts +1 -2
  192. package/dist/types/src/index.d.ts.map +1 -1
  193. package/dist/types/src/meta.d.ts +2 -2
  194. package/dist/types/src/meta.d.ts.map +1 -1
  195. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  196. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  197. package/dist/types/src/operations/definitions.d.ts +19 -0
  198. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  199. package/dist/types/src/operations/index.d.ts +4 -0
  200. package/dist/types/src/operations/index.d.ts.map +1 -0
  201. package/dist/types/src/testing/test-functions.d.ts +204 -3
  202. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  203. package/dist/types/src/translations.d.ts +2 -0
  204. package/dist/types/src/translations.d.ts.map +1 -1
  205. package/dist/types/src/types/capabilities.d.ts +23 -0
  206. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  207. package/dist/types/src/types/events.d.ts +5 -0
  208. package/dist/types/src/types/events.d.ts.map +1 -0
  209. package/dist/types/src/types/index.d.ts +2 -0
  210. package/dist/types/src/types/index.d.ts.map +1 -1
  211. package/dist/types/src/types/schema.d.ts +11 -3
  212. package/dist/types/src/types/schema.d.ts.map +1 -1
  213. package/dist/types/tsconfig.tsbuildinfo +1 -1
  214. package/package.json +73 -50
  215. package/src/AutomationPlugin.tsx +16 -34
  216. package/src/capabilities/app-graph-builder/app-graph-builder.ts +72 -0
  217. package/src/capabilities/app-graph-builder/index.ts +7 -0
  218. package/src/capabilities/compute-runtime/compute-runtime.ts +156 -0
  219. package/src/capabilities/compute-runtime/index.ts +7 -0
  220. package/src/capabilities/index.ts +4 -8
  221. package/src/capabilities/operation-handler/index.ts +11 -0
  222. package/src/capabilities/operation-handler/operation-handler.ts +16 -0
  223. package/src/capabilities/react-surface/index.ts +7 -0
  224. package/src/capabilities/react-surface/react-surface.tsx +57 -0
  225. package/src/cli/commands/index.ts +5 -0
  226. package/src/cli/commands/trigger/create/index.ts +14 -0
  227. package/src/cli/commands/trigger/create/queue.ts +90 -0
  228. package/src/cli/commands/trigger/create/subscription.ts +129 -0
  229. package/src/cli/commands/trigger/create/timer.ts +94 -0
  230. package/src/cli/commands/trigger/index.ts +16 -0
  231. package/src/cli/commands/trigger/list.ts +68 -0
  232. package/src/cli/commands/trigger/options.ts +59 -0
  233. package/src/cli/commands/trigger/remove.ts +45 -0
  234. package/src/cli/commands/trigger/update/index.ts +14 -0
  235. package/src/cli/commands/trigger/update/queue.ts +196 -0
  236. package/src/cli/commands/trigger/update/subscription.ts +279 -0
  237. package/src/cli/commands/trigger/update/timer.ts +194 -0
  238. package/src/cli/commands/trigger/util.ts +409 -0
  239. package/src/cli/index.ts +5 -0
  240. package/src/cli/plugin.ts +24 -0
  241. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +8 -6
  242. package/src/components/AutomationPanel/AutomationPanel.tsx +170 -72
  243. package/src/components/FunctionsPanel/FunctionsPanel.tsx +27 -30
  244. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +28 -46
  245. package/src/components/FunctionsRegistry/index.ts +4 -1
  246. package/src/components/TriggerEditor/FunctionInputEditor.tsx +34 -33
  247. package/src/components/TriggerEditor/SpecSelector.tsx +9 -7
  248. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +76 -30
  249. package/src/components/TriggerEditor/TriggerEditor.tsx +95 -48
  250. package/src/components/index.ts +1 -2
  251. package/src/{components → containers/AutomationSettings}/AutomationSettings.tsx +9 -12
  252. package/src/containers/AutomationSettings/index.ts +7 -0
  253. package/src/{components → containers/FunctionsContainer}/FunctionsContainer.tsx +10 -13
  254. package/src/containers/FunctionsContainer/index.ts +7 -0
  255. package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
  256. package/src/containers/TriggerSettings/index.ts +6 -0
  257. package/src/containers/index.ts +9 -0
  258. package/src/hooks/useComputeRuntimeCallback.ts +12 -12
  259. package/src/hooks/useTriggerRuntimeControls.ts +28 -14
  260. package/src/index.ts +1 -2
  261. package/src/meta.ts +3 -3
  262. package/src/operations/create-trigger-from-template.ts +74 -0
  263. package/src/operations/definitions.ts +27 -0
  264. package/src/operations/index.ts +9 -0
  265. package/src/testing/test-functions.ts +9 -6
  266. package/src/translations.ts +4 -0
  267. package/src/{capabilities → types}/capabilities.ts +11 -7
  268. package/src/types/events.ts +11 -0
  269. package/src/types/index.ts +2 -0
  270. package/src/types/schema.ts +4 -4
  271. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  272. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  273. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  274. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  275. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  276. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  277. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  278. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  279. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  280. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  281. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  282. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  283. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  284. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  285. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  286. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  287. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  288. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  289. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  290. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  291. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  292. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  293. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  294. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  295. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  296. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  297. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  298. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  299. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  300. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  301. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  302. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  303. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  304. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  305. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  306. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  307. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  308. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  309. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  310. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  311. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  312. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  313. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  314. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  315. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  316. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  317. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  318. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  319. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  320. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  321. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  322. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  323. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  324. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  325. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  326. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  327. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  328. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  329. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  330. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  331. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  332. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  333. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  334. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  335. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  336. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  337. package/dist/types/src/events.d.ts +0 -4
  338. package/dist/types/src/events.d.ts.map +0 -1
  339. package/src/capabilities/app-graph-builder.ts +0 -87
  340. package/src/capabilities/compute-runtime.ts +0 -127
  341. package/src/capabilities/intent-resolver.ts +0 -72
  342. package/src/capabilities/react-surface.tsx +0 -56
  343. package/src/components/TriggerSettings.tsx +0 -25
  344. package/src/events.ts +0 -11
  345. /package/dist/lib/browser/{AutomationPanel-7OECLR5N.mjs.map → AutomationPanel-UPV6GR5B.mjs.map} +0 -0
  346. /package/dist/lib/browser/{FunctionsPanel-CRW6SJUN.mjs.map → FunctionsPanel-FFGPFXSF.mjs.map} +0 -0
  347. /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → browser/FunctionsRegistry-7FVC2YMN.mjs.map} +0 -0
  348. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → browser/TriggerSettings-3UW3UTJE.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 Database, JsonSchema, Obj, Ref } from '@dxos/echo';
8
9
  import { type JsonPath } from '@dxos/echo/internal';
9
- 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';
10
+ import { type Operation } from '@dxos/operation';
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: Function.Function[];
15
- onQueryRefOptions: QueryRefOptions;
16
- } & FormInputStateProps;
17
+ type: SchemaAST.AST;
18
+ functions: Operation.PersistentOperation[];
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,22 @@ 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
- const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
51
+ const effectSchema = useMemo(() => (inputSchema ? JsonSchema.toEffectSchema(inputSchema) : undefined), [inputSchema]);
55
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]);
56
57
 
57
- const values = useMemo(() => getValue() ?? {}, [getValue]);
58
-
59
- const handleValuesChanged = useCallback(
60
- (values: any) => {
61
- onValueChange('object', values);
58
+ const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(
59
+ (values) => {
60
+ onValueChange(type, values);
62
61
  },
63
- [onValueChange],
62
+ [type, onValueChange],
64
63
  );
65
64
 
66
65
  if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
@@ -69,16 +68,18 @@ export const FunctionInputEditor = ({
69
68
 
70
69
  return (
71
70
  <>
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
71
+ <Form.Label label={t('function parameters label')} asChild />
72
+ <Form.Root
73
+ key={selectedFunction.id}
76
74
  schema={effectSchema}
77
- values={values}
75
+ defaultValues={defaultValues}
76
+ db={db}
78
77
  onValuesChanged={handleValuesChanged}
79
- onQueryRefOptions={onQueryRefOptions}
80
- outerSpacing={false}
81
- />
78
+ >
79
+ <Form.FieldSet />
80
+ </Form.Root>
82
81
  </>
83
82
  );
84
83
  };
84
+
85
+ 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 => {
@@ -31,7 +31,7 @@ export const SpecSelector = (props: SpecSelectorProps) => {
31
31
  },
32
32
  };
33
33
  case 'queue':
34
- return { kind: 'queue', queue: 'dxn:' };
34
+ return { kind: 'queue', queue: 'dxn:queue:default' };
35
35
  case 'email':
36
36
  return { kind: 'email' };
37
37
  case 'webhook':
@@ -47,9 +47,9 @@ export const SpecSelector = (props: SpecSelectorProps) => {
47
47
  }
48
48
 
49
49
  // Update the entire spec object, not just the `spec.kind`.
50
- specProps.onValueChange('object', defaultSpec);
50
+ specProps.onValueChange(props.type, defaultSpec);
51
51
  },
52
- [specProps],
52
+ [props.type, specProps],
53
53
  );
54
54
 
55
55
  const options = useMemo(
@@ -61,5 +61,7 @@ export const SpecSelector = (props: SpecSelectorProps) => {
61
61
  [t],
62
62
  );
63
63
 
64
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
64
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
65
65
  };
66
+
67
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -4,17 +4,19 @@
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import React, { useState } from 'react';
7
+ import { expect, userEvent, within } from 'storybook/test';
7
8
 
8
9
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
- import { Function } from '@dxos/functions';
10
10
  import { Trigger } from '@dxos/functions';
11
+ import { Operation } from '@dxos/operation';
11
12
  import { invariant } from '@dxos/invariant';
12
13
  import { faker } from '@dxos/random';
13
14
  import { useQuery } from '@dxos/react-client/echo';
14
- import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
15
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
16
  import { useAsyncEffect } from '@dxos/react-ui';
16
17
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { Employer, Organization, Person, Project } from '@dxos/types';
18
+ import { translations as formTranslations } from '@dxos/react-ui-form';
19
+ import { Employer, Organization, Person, Pipeline } from '@dxos/types';
18
20
 
19
21
  import { functions } from '../../testing';
20
22
  import { translations } from '../../translations';
@@ -25,22 +27,22 @@ const types = [
25
27
  // TODO(burdon): Get label from annotation.
26
28
  { value: Organization.Organization.typename, label: 'Organization' },
27
29
  { value: Person.Person.typename, label: 'Person' },
28
- { value: Type.getTypename(Project.Project), label: 'Project' },
30
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
29
31
  { value: Employer.Employer.typename, label: 'Employer' },
30
32
  ];
31
33
 
32
34
  const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
- const { space } = useClientProvider();
35
+ const { space } = useClientStory();
34
36
  const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
- const tags = useQuery(space, Filter.type(Tag.Tag));
37
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
36
38
 
37
39
  useAsyncEffect(async () => {
38
40
  if (!space) {
39
41
  return;
40
42
  }
41
43
 
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');
44
+ const functions = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
45
+ const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
44
46
  invariant(fn);
45
47
  const trigger = space.db.add(
46
48
  Trigger.make({
@@ -60,41 +62,43 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
60
62
  }
61
63
 
62
64
  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>
65
+ <TriggerEditor
66
+ db={space.db}
67
+ trigger={trigger}
68
+ types={types}
69
+ tags={tags}
70
+ onSave={(values) => console.log('on save', values)}
71
+ {...props}
72
+ />
73
73
  );
74
74
  };
75
75
 
76
76
  const meta = {
77
- title: 'plugins/plugin-automation/TriggerEditor',
77
+ title: 'plugins/plugin-automation/components/TriggerEditor',
78
78
  component: TriggerEditor as any,
79
79
  render: DefaultStory,
80
80
  decorators: [
81
- withTheme,
82
- withLayout({ container: 'column' }),
81
+ withTheme(),
82
+ withLayout({ layout: 'column' }),
83
83
  withClientProvider({
84
84
  createIdentity: true,
85
85
  createSpace: true,
86
- types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
86
+ types: [Tag.Tag, Operation.PersistentOperation, Trigger.Trigger, TestSchema.ContactType],
87
87
  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' }));
88
+ // Tags.
89
+ ['Important', 'Investor', 'New'].forEach((label) => {
90
+ space.db.add(Tag.make({ label }));
91
+ });
92
+
93
+ // Functions.
94
+ functions.forEach((fn) => {
95
+ space.db.add(Obj.make(Operation.PersistentOperation, { ...fn, version: fn.version ?? '0.1.0' }));
96
+ });
91
97
 
92
- for (const fn of functions) {
93
- space.db.add(Function.make(fn));
94
- }
98
+ // Objects.
95
99
  Array.from({ length: 10 }).map(() => {
96
100
  return space.db.add(
97
- Obj.make(ContactType, {
101
+ Obj.make(TestSchema.ContactType, {
98
102
  name: faker.person.fullName(),
99
103
  identifiers: [],
100
104
  }),
@@ -104,7 +108,8 @@ const meta = {
104
108
  }),
105
109
  ],
106
110
  parameters: {
107
- translations,
111
+ layout: 'fullscreen',
112
+ translations: [...formTranslations, ...translations],
108
113
  },
109
114
  } satisfies Meta<typeof DefaultStory>;
110
115
 
@@ -119,3 +124,44 @@ export const ReadonlySpec: Story = {
119
124
  readonlySpec: true,
120
125
  },
121
126
  };
127
+
128
+ export const Spec: Story = {
129
+ play: async ({ canvasElement }) => {
130
+ const canvas = within(canvasElement);
131
+ const webhookText = await canvas.findByText('Webhook', {}, { timeout: 10_000 });
132
+ const combobox = webhookText.closest('[role="combobox"]') as HTMLElement;
133
+ await expect(combobox).not.toBeDisabled();
134
+
135
+ // Helper to switch to a kind via keyboard.
136
+ // TODO(wittjosiah): Radix Select in popper mode doesn't close on click.
137
+ // Use keyboard navigation: open, type first letter to jump, Enter to select.
138
+ const selectKind = async (combobox: HTMLElement, firstLetter: string) => {
139
+ combobox.focus();
140
+ await userEvent.keyboard('{Enter}');
141
+ await userEvent.keyboard(firstLetter);
142
+ await userEvent.keyboard('{Enter}');
143
+ };
144
+
145
+ // Timer — should show "Cron" field.
146
+ await selectKind(combobox, 't');
147
+ await expect(canvas.findByLabelText('Cron')).resolves.toBeInTheDocument();
148
+
149
+ // Email — no extra fields; Cron should be gone.
150
+ await selectKind(combobox, 'e');
151
+ await expect(combobox).not.toBeDisabled();
152
+ await expect(canvas.queryByLabelText('Cron')).not.toBeInTheDocument();
153
+
154
+ // Webhook — should show "Method" field.
155
+ await selectKind(combobox, 'w');
156
+ await expect(canvas.findByLabelText('Method')).resolves.toBeInTheDocument();
157
+
158
+ // Subscription — should show query editor.
159
+ await selectKind(combobox, 's');
160
+ await expect(combobox).not.toBeDisabled();
161
+ await expect(canvas.queryByLabelText('Method')).not.toBeInTheDocument();
162
+
163
+ // Queue — should show DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
164
+ await selectKind(combobox, 'q');
165
+ await expect(canvas.findByText('DXN')).resolves.toBeInTheDocument();
166
+ },
167
+ };
@@ -5,59 +5,92 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { ComputeGraph } from '@dxos/conductor';
8
- import { type Query, Type } from '@dxos/echo';
9
- import { Function, Script, Trigger } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
8
+ import { DXN, type Database, Entity, Feed, Obj, type Query } from '@dxos/echo';
9
+ import { Script, Trigger } from '@dxos/functions';
10
+ import { Operation } from '@dxos/operation';
11
+ import { Filter, Ref, useQuery } from '@dxos/react-client/echo';
11
12
  import { Input } from '@dxos/react-ui';
12
13
  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';
14
+ import {
15
+ type ExcludeId,
16
+ Form,
17
+ FormFieldLabel,
18
+ type FormFieldMap,
19
+ type FormRootProps,
20
+ SelectField,
21
+ omitId,
22
+ } from '@dxos/react-ui-form';
23
+
24
+ import { FunctionInputEditor } from './FunctionInputEditor';
16
25
  import { SpecSelector } from './SpecSelector';
17
26
 
27
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
28
+
18
29
  export type TriggerEditorProps = {
19
- space: Space;
30
+ db: Database.Database;
20
31
  trigger: Trigger.Trigger;
21
32
  // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
22
33
  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
- };
34
+ } &
35
+ // prettier-ignore
36
+ Pick<QueryFormProps, 'types' | 'tags'> &
37
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
38
+
39
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
40
+ const fieldMap = useCustomInputs({
41
+ db,
42
+ types,
43
+ tags,
44
+ readonlySpec,
45
+ });
46
+
47
+ const handleValuesChanged = useCallback(
48
+ (newValues: Partial<TriggerFormSchema>) => {
49
+ Obj.change(trigger, (obj) => {
50
+ Object.assign(obj, newValues);
51
+ });
52
+ },
53
+ [trigger],
54
+ );
31
55
 
32
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
33
- const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
56
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
57
+ const defaultValues = useMemo(() => {
58
+ const { id: _, ...values } = trigger;
59
+ return values;
60
+ }, [trigger]);
34
61
 
35
62
  return (
36
- <Form
37
- outerSpacing={false}
38
- Custom={Custom}
39
- schema={Trigger.Trigger}
40
- values={trigger}
41
- onSave={handleSave}
42
- onCancel={onCancel}
43
- onQueryRefOptions={handleRefQueryLookup}
44
- />
63
+ <Form.Root<TriggerFormSchema>
64
+ {...formProps}
65
+ db={db}
66
+ schema={triggerSchema}
67
+ defaultValues={defaultValues}
68
+ fieldMap={fieldMap}
69
+ onValuesChanged={handleValuesChanged}
70
+ >
71
+ <Form.Viewport>
72
+ <Form.Content>
73
+ <Form.FieldSet />
74
+ <Form.Actions />
75
+ </Form.Content>
76
+ </Form.Viewport>
77
+ </Form.Root>
45
78
  );
46
79
  };
47
80
 
48
81
  type UseCustomInputsProps = {
49
- space: Space;
82
+ db: Database.Database;
50
83
  readonlySpec?: boolean;
51
- onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
52
84
  } & Pick<QueryFormProps, 'types' | 'tags'>;
53
85
 
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));
86
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
87
+ const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
88
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
89
+ const scripts = useQuery(db, Filter.type(Script.Script));
90
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
58
91
 
59
92
  return useMemo(
60
- (): CustomInputMap => ({
93
+ (): FormFieldMap => ({
61
94
  // Function selector.
62
95
  ['function' satisfies keyof Trigger.Trigger]: (props) => {
63
96
  const getValue = useCallback(() => {
@@ -70,17 +103,17 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
70
103
 
71
104
  const handleOnValueChange = useCallback(
72
105
  (_type: any, dxnString: string) => {
73
- const dxn = Type.DXN.parse(dxnString);
106
+ const dxn = DXN.parse(dxnString);
74
107
  if (dxn) {
75
108
  const ref = Ref.fromDXN(dxn);
76
- props.onValueChange('object', ref);
109
+ props.onValueChange(props.type, ref);
77
110
  }
78
111
  },
79
- [props.onValueChange],
112
+ [props.type, props.onValueChange],
80
113
  );
81
114
 
82
115
  return (
83
- <SelectInput
116
+ <SelectField
84
117
  {...props}
85
118
  getValue={getValue as any}
86
119
  onValueChange={handleOnValueChange}
@@ -90,30 +123,31 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
90
123
  },
91
124
 
92
125
  // Spec selector.
93
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
126
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
127
+
128
+ // Queue feed selector with parent labels.
129
+ 'spec.queue': (props) => <SelectField {...props} options={getFeedQueueOptions(feeds)} />,
94
130
 
95
131
  // TODO(wittjosiah): Copied from ViewEditor.
96
132
  // Query input editor.
97
- ['spec.query' as const]: (props) => {
133
+ 'spec.query': (props) => {
98
134
  const handleChange = useCallback(
99
- (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
100
- [props.onValueChange],
135
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
136
+ [props.type, props.onValueChange],
101
137
  );
102
138
 
103
139
  return (
104
140
  <Input.Root>
105
- <InputHeader label={props.label} />
141
+ <FormFieldLabel label={props.label} asChild />
106
142
  <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
107
143
  </Input.Root>
108
144
  );
109
145
  },
110
146
 
111
147
  // Function input editor.
112
- ['input' as const]: (props) => (
113
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
114
- ),
148
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
115
149
  }),
116
- [workflows, scripts, functions, readonlySpec],
150
+ [workflows, scripts, functions, feeds, readonlySpec],
117
151
  );
118
152
  };
119
153
 
@@ -121,7 +155,20 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
121
155
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
122
156
  };
123
157
 
124
- const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
125
- const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
158
+ const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
159
+ const getLabel = (fn: Operation.PersistentOperation) =>
160
+ scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
126
161
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
127
162
  };
163
+
164
+ const getFeedQueueOptions = (feeds: Feed.Feed[]) => {
165
+ return feeds.flatMap((feed) => {
166
+ const queueDxn = Feed.getQueueDxn(feed);
167
+ if (!queueDxn) {
168
+ return [];
169
+ }
170
+ const parent = Obj.getParent(feed);
171
+ const label = parent ? Entity.getLabel(parent) : Entity.getLabel(feed);
172
+ return [{ label: label ?? feed.id, value: queueDxn.toString() }];
173
+ });
174
+ };
@@ -7,6 +7,5 @@ import { lazy } from 'react';
7
7
  export * from './TriggerEditor';
8
8
 
9
9
  export const AutomationPanel = lazy(() => import('./AutomationPanel'));
10
- export const AutomationSettings = lazy(() => import('./AutomationSettings'));
11
- export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
12
10
  export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
11
+ export const FunctionsRegistry = lazy(() => import('./FunctionsRegistry'));
@@ -5,26 +5,23 @@
5
5
  import React from 'react';
6
6
 
7
7
  import { useTranslation } from '@dxos/react-ui';
8
- import { ControlPage, ControlSection } from '@dxos/react-ui-form';
8
+ import { Settings } from '@dxos/react-ui-form';
9
9
 
10
- import { meta } from '../meta';
11
-
12
- import { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';
13
- import { TriggersSettings } from './TriggerSettings';
10
+ import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
11
+ import { meta } from '../../meta';
12
+ import { TriggersSettings } from '../TriggerSettings';
14
13
 
15
14
  export const AutomationSettings = (props: AutomationPanelProps) => {
16
15
  const { t } = useTranslation(meta.id);
17
16
  return (
18
- <ControlPage>
19
- <ControlSection
17
+ <Settings.Root>
18
+ <Settings.Section
20
19
  title={t('automation verbose label', { ns: meta.id })}
21
20
  description={t('automation description', { ns: meta.id })}
22
21
  >
23
22
  <AutomationPanel {...props} />
24
- <TriggersSettings space={props.space} />
25
- </ControlSection>
26
- </ControlPage>
23
+ <TriggersSettings db={props.space.db} />
24
+ </Settings.Section>
25
+ </Settings.Root>
27
26
  );
28
27
  };
29
-
30
- export default AutomationSettings;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { AutomationSettings } from './AutomationSettings';
6
+
7
+ export default AutomationSettings;
@@ -6,31 +6,28 @@ import React from 'react';
6
6
 
7
7
  import { type Space } from '@dxos/react-client/echo';
8
8
  import { useTranslation } from '@dxos/react-ui';
9
- import { ControlPage, ControlSection } from '@dxos/react-ui-form';
9
+ import { Settings } from '@dxos/react-ui-form';
10
10
 
11
- import { meta } from '../meta';
12
-
13
- import { FunctionsPanel } from './FunctionsPanel';
14
- import { FunctionsRegistry } from './FunctionsRegistry';
11
+ import { FunctionsPanel } from '../../components/FunctionsPanel';
12
+ import { FunctionsRegistry } from '../../components/FunctionsRegistry';
13
+ import { meta } from '../../meta';
15
14
 
16
15
  export const FunctionsContainer = ({ space }: { space: Space }) => {
17
16
  const { t } = useTranslation(meta.id);
18
17
  return (
19
- <ControlPage>
20
- <ControlSection
18
+ <Settings.Root>
19
+ <Settings.Section
21
20
  title={t('functions verbose label', { ns: meta.id })}
22
21
  description={t('functions description', { ns: meta.id })}
23
22
  >
24
23
  <FunctionsPanel space={space} />
25
- </ControlSection>
26
- <ControlSection
24
+ </Settings.Section>
25
+ <Settings.Section
27
26
  title={t('functions registry verbose label', { ns: meta.id })}
28
27
  description={t('functions registry description', { ns: meta.id })}
29
28
  >
30
29
  <FunctionsRegistry space={space} />
31
- </ControlSection>
32
- </ControlPage>
30
+ </Settings.Section>
31
+ </Settings.Root>
33
32
  );
34
33
  };
35
-
36
- export default FunctionsContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { FunctionsContainer } from './FunctionsContainer';
6
+
7
+ export default FunctionsContainer;