@dxos/plugin-automation 0.8.4-main.c4373fc → 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 (332) 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-NRIKAPQV.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 +5 -4
  35. package/dist/lib/browser/index.mjs +66 -64
  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-JXFO46V4.mjs → react-surface-U6FAYV42.mjs} +20 -14
  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-GHK5UG4K.mjs → AutomationPanel-F7MPUR7U.mjs} +4 -4
  44. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs +38 -0
  45. package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs.map +7 -0
  46. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs +44 -0
  47. package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs.map +7 -0
  48. package/dist/lib/node-esm/{FunctionsPanel-SAMRTELO.mjs → FunctionsPanel-UFL5LT2R.mjs} +3 -3
  49. package/dist/lib/node-esm/FunctionsPanel-UFL5LT2R.mjs.map +7 -0
  50. package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs +11 -0
  51. package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs.map +7 -0
  52. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs +14 -0
  53. package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs.map +7 -0
  54. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +86 -0
  55. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-2X564LII.mjs +10 -0
  57. package/dist/lib/node-esm/chunk-2X564LII.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-34HGM46Z.mjs +32 -0
  59. package/dist/lib/node-esm/chunk-34HGM46Z.mjs.map +7 -0
  60. package/dist/lib/node-esm/chunk-4DK33JDH.mjs +84 -0
  61. package/dist/lib/node-esm/chunk-4DK33JDH.mjs.map +7 -0
  62. package/dist/lib/node-esm/{chunk-5MQJPJR2.mjs → chunk-5FXNN3MV.mjs} +6 -2
  63. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
  64. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs +273 -0
  65. package/dist/lib/node-esm/chunk-7AIKTEAX.mjs.map +7 -0
  66. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs +271 -0
  67. package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs.map +7 -0
  68. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs +99 -0
  69. package/dist/lib/node-esm/chunk-GXFQR3KI.mjs.map +7 -0
  70. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs +94 -0
  71. package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs.map +7 -0
  72. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs +97 -0
  73. package/dist/lib/node-esm/chunk-RTEXGGBX.mjs.map +7 -0
  74. package/dist/lib/node-esm/cli/index.mjs +1109 -0
  75. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  76. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs +125 -0
  77. package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs.map +7 -0
  78. package/dist/lib/node-esm/hooks/index.mjs +5 -4
  79. package/dist/lib/node-esm/index.mjs +66 -64
  80. package/dist/lib/node-esm/index.mjs.map +4 -4
  81. package/dist/lib/node-esm/meta.json +1 -1
  82. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs +84 -0
  83. package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs.map +7 -0
  84. package/dist/lib/node-esm/{react-surface-YDJ43B3N.mjs → react-surface-BVNHCWQ7.mjs} +20 -14
  85. package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs.map +7 -0
  86. package/dist/lib/node-esm/types/index.mjs +10 -4
  87. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  88. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  90. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  92. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  94. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  96. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/index.d.ts +4 -5
  98. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  100. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  102. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  104. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  106. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/index.d.ts +2 -0
  108. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  110. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  112. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  114. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  116. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  118. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  120. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  121. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  122. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  123. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  124. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  125. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  126. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  127. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  128. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  129. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  130. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  131. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  132. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  133. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  134. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  135. package/dist/types/src/cli/index.d.ts +2 -0
  136. package/dist/types/src/cli/index.d.ts.map +1 -0
  137. package/dist/types/src/cli/plugin.d.ts +3 -0
  138. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  139. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -7
  140. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  141. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +5 -0
  142. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  143. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  144. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  145. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  146. package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
  147. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  148. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  149. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  150. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  151. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  152. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +10 -8
  153. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  154. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +74 -2
  155. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  156. package/dist/types/src/components/index.d.ts +3 -4
  157. package/dist/types/src/components/index.d.ts.map +1 -1
  158. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  159. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  160. package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
  161. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  162. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  163. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  164. package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
  165. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  166. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  167. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  168. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  169. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  170. package/dist/types/src/containers/index.d.ts +5 -0
  171. package/dist/types/src/containers/index.d.ts.map +1 -0
  172. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -4
  173. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  174. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +6 -5
  175. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  176. package/dist/types/src/index.d.ts +2 -2
  177. package/dist/types/src/index.d.ts.map +1 -1
  178. package/dist/types/src/meta.d.ts +2 -2
  179. package/dist/types/src/meta.d.ts.map +1 -1
  180. package/dist/types/src/testing/test-functions.d.ts +202 -3
  181. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  182. package/dist/types/src/translations.d.ts +5 -0
  183. package/dist/types/src/translations.d.ts.map +1 -1
  184. package/dist/types/src/types/capabilities.d.ts +22 -0
  185. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  186. package/dist/types/src/types/events.d.ts +5 -0
  187. package/dist/types/src/types/events.d.ts.map +1 -0
  188. package/dist/types/src/types/index.d.ts +2 -0
  189. package/dist/types/src/types/index.d.ts.map +1 -1
  190. package/dist/types/src/types/schema.d.ts +30 -1
  191. package/dist/types/src/types/schema.d.ts.map +1 -1
  192. package/dist/types/tsconfig.tsbuildinfo +1 -1
  193. package/package.json +66 -47
  194. package/src/AutomationPlugin.tsx +15 -34
  195. package/src/capabilities/app-graph-builder/app-graph-builder.ts +72 -0
  196. package/src/capabilities/app-graph-builder/index.ts +7 -0
  197. package/src/capabilities/compute-runtime/compute-runtime.ts +146 -0
  198. package/src/capabilities/compute-runtime/index.ts +7 -0
  199. package/src/capabilities/index.ts +4 -8
  200. package/src/capabilities/operation-resolver/index.ts +7 -0
  201. package/src/capabilities/operation-resolver/operation-resolver.ts +80 -0
  202. package/src/capabilities/react-surface/index.ts +7 -0
  203. package/src/capabilities/react-surface/react-surface.tsx +61 -0
  204. package/src/cli/commands/index.ts +5 -0
  205. package/src/cli/commands/trigger/create/index.ts +14 -0
  206. package/src/cli/commands/trigger/create/queue.ts +89 -0
  207. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  208. package/src/cli/commands/trigger/create/timer.ts +93 -0
  209. package/src/cli/commands/trigger/index.ts +16 -0
  210. package/src/cli/commands/trigger/list.ts +67 -0
  211. package/src/cli/commands/trigger/options.ts +59 -0
  212. package/src/cli/commands/trigger/remove.ts +45 -0
  213. package/src/cli/commands/trigger/update/index.ts +14 -0
  214. package/src/cli/commands/trigger/update/queue.ts +195 -0
  215. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  216. package/src/cli/commands/trigger/update/timer.ts +193 -0
  217. package/src/cli/commands/trigger/util.ts +395 -0
  218. package/src/cli/index.ts +5 -0
  219. package/src/cli/plugin.ts +24 -0
  220. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +5 -6
  221. package/src/components/AutomationPanel/AutomationPanel.tsx +189 -86
  222. package/src/components/FunctionsPanel/FunctionsPanel.tsx +34 -22
  223. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +110 -0
  224. package/src/components/FunctionsRegistry/index.ts +8 -0
  225. package/src/components/TriggerEditor/FunctionInputEditor.tsx +34 -33
  226. package/src/components/TriggerEditor/SpecSelector.tsx +12 -11
  227. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +89 -23
  228. package/src/components/TriggerEditor/TriggerEditor.tsx +83 -85
  229. package/src/components/index.ts +1 -2
  230. package/src/{components → containers/AutomationSettings}/AutomationSettings.tsx +9 -12
  231. package/src/containers/AutomationSettings/index.ts +7 -0
  232. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  233. package/src/containers/FunctionsContainer/index.ts +7 -0
  234. package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
  235. package/src/containers/TriggerSettings/index.ts +7 -0
  236. package/src/containers/index.ts +9 -0
  237. package/src/hooks/useComputeRuntimeCallback.ts +45 -8
  238. package/src/hooks/useTriggerRuntimeControls.ts +30 -15
  239. package/src/index.ts +2 -2
  240. package/src/meta.ts +7 -4
  241. package/src/testing/test-functions.ts +6 -6
  242. package/src/translations.ts +7 -0
  243. package/src/{capabilities → types}/capabilities.ts +9 -14
  244. package/src/types/events.ts +11 -0
  245. package/src/types/index.ts +2 -0
  246. package/src/types/schema.ts +23 -2
  247. package/dist/lib/browser/AutomationPanel-PNBH5L5C.mjs +0 -11
  248. package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs +0 -69
  249. package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs.map +0 -7
  250. package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs +0 -36
  251. package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs.map +0 -7
  252. package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs +0 -81
  253. package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +0 -7
  254. package/dist/lib/browser/chunk-5ARH77PV.mjs +0 -15
  255. package/dist/lib/browser/chunk-5ARH77PV.mjs.map +0 -7
  256. package/dist/lib/browser/chunk-AY67OUDA.mjs +0 -14
  257. package/dist/lib/browser/chunk-AY67OUDA.mjs.map +0 -7
  258. package/dist/lib/browser/chunk-DLLE4FKP.mjs +0 -94
  259. package/dist/lib/browser/chunk-DLLE4FKP.mjs.map +0 -7
  260. package/dist/lib/browser/chunk-LC3QQU47.mjs +0 -171
  261. package/dist/lib/browser/chunk-LC3QQU47.mjs.map +0 -7
  262. package/dist/lib/browser/chunk-MVPRI3DB.mjs +0 -53
  263. package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +0 -7
  264. package/dist/lib/browser/chunk-NIJWEQRD.mjs +0 -283
  265. package/dist/lib/browser/chunk-NIJWEQRD.mjs.map +0 -7
  266. package/dist/lib/browser/chunk-QT3YWUOT.mjs +0 -14
  267. package/dist/lib/browser/chunk-QT3YWUOT.mjs.map +0 -7
  268. package/dist/lib/browser/chunk-VGBZKM3O.mjs +0 -38
  269. package/dist/lib/browser/chunk-VGBZKM3O.mjs.map +0 -7
  270. package/dist/lib/browser/chunk-WWURMV25.mjs +0 -13
  271. package/dist/lib/browser/chunk-WWURMV25.mjs.map +0 -7
  272. package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +0 -160
  273. package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +0 -7
  274. package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs +0 -77
  275. package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs.map +0 -7
  276. package/dist/lib/browser/react-surface-JXFO46V4.mjs.map +0 -7
  277. package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs +0 -70
  278. package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs.map +0 -7
  279. package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs +0 -37
  280. package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs.map +0 -7
  281. package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs +0 -82
  282. package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-3EWMZAU6.mjs +0 -172
  284. package/dist/lib/node-esm/chunk-3EWMZAU6.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +0 -7
  286. package/dist/lib/node-esm/chunk-CJUI6AKX.mjs +0 -39
  287. package/dist/lib/node-esm/chunk-CJUI6AKX.mjs.map +0 -7
  288. package/dist/lib/node-esm/chunk-EX74SIDO.mjs +0 -284
  289. package/dist/lib/node-esm/chunk-EX74SIDO.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-LWASMQIF.mjs +0 -16
  291. package/dist/lib/node-esm/chunk-LWASMQIF.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-QCA543ZR.mjs +0 -54
  293. package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +0 -7
  294. package/dist/lib/node-esm/chunk-U7LJXQS4.mjs +0 -16
  295. package/dist/lib/node-esm/chunk-U7LJXQS4.mjs.map +0 -7
  296. package/dist/lib/node-esm/chunk-WHCSOUNN.mjs +0 -16
  297. package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-YQXW3JXD.mjs +0 -95
  299. package/dist/lib/node-esm/chunk-YQXW3JXD.mjs.map +0 -7
  300. package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +0 -161
  301. package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +0 -7
  302. package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs +0 -78
  303. package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs.map +0 -7
  304. package/dist/lib/node-esm/react-surface-YDJ43B3N.mjs.map +0 -7
  305. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  306. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  307. package/dist/types/src/capabilities/capabilities.d.ts +0 -19
  308. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  309. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  310. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  311. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  312. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  313. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  314. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  315. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  316. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  317. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  318. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  319. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  320. package/dist/types/src/events.d.ts +0 -4
  321. package/dist/types/src/events.d.ts.map +0 -1
  322. package/src/capabilities/app-graph-builder.ts +0 -87
  323. package/src/capabilities/compute-runtime.ts +0 -138
  324. package/src/capabilities/intent-resolver.ts +0 -72
  325. package/src/capabilities/react-surface.tsx +0 -55
  326. package/src/components/FunctionsContainer.tsx +0 -29
  327. package/src/components/TriggerSettings.tsx +0 -25
  328. package/src/events.ts +0 -11
  329. /package/dist/lib/browser/{AutomationPanel-PNBH5L5C.mjs.map → AutomationPanel-EHRSV2DL.mjs.map} +0 -0
  330. /package/dist/lib/browser/{FunctionsPanel-NRIKAPQV.mjs.map → FunctionsPanel-5WPUZGRB.mjs.map} +0 -0
  331. /package/dist/lib/{node-esm/AutomationPanel-GHK5UG4K.mjs.map → browser/FunctionsRegistry-XRXIZRLL.mjs.map} +0 -0
  332. /package/dist/lib/node-esm/{FunctionsPanel-SAMRTELO.mjs.map → AutomationPanel-F7MPUR7U.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 FunctionType } 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 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);
@@ -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';
@@ -5,20 +5,20 @@
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
7
  import { Filter, Query } from '@dxos/echo';
8
- import { type FunctionTrigger, TriggerKinds, type TriggerType } from '@dxos/functions';
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 FunctionTrigger]);
18
+ const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);
19
19
 
20
20
  const handleTypeChange = useCallback(
21
- (_type: any, value: string): TriggerType | undefined => {
21
+ (_type: any, value: string): Trigger.Spec | undefined => {
22
22
  const getDefaultTriggerSpec = (kind: string) => {
23
23
  switch (kind) {
24
24
  case 'timer':
@@ -27,12 +27,11 @@ export const SpecSelector = (props: SpecSelectorProps) => {
27
27
  return {
28
28
  kind: 'subscription',
29
29
  query: {
30
- string: 'Query.select(Filter.nothing())',
31
30
  ast: Query.select(Filter.nothing()).ast,
32
31
  },
33
32
  };
34
33
  case 'queue':
35
- return { kind: 'queue', queue: 'dxn:' };
34
+ return { kind: 'queue', queue: 'dxn:queue:default' };
36
35
  case 'email':
37
36
  return { kind: 'email' };
38
37
  case 'webhook':
@@ -48,19 +47,21 @@ export const SpecSelector = (props: SpecSelectorProps) => {
48
47
  }
49
48
 
50
49
  // Update the entire spec object, not just the `spec.kind`.
51
- specProps.onValueChange('object', defaultSpec);
50
+ specProps.onValueChange(props.type, defaultSpec);
52
51
  },
53
- [specProps],
52
+ [props.type, specProps],
54
53
  );
55
54
 
56
55
  const options = useMemo(
57
56
  () =>
58
- TriggerKinds.map((kind) => ({
57
+ Trigger.Kinds.map((kind) => ({
59
58
  value: kind,
60
59
  label: t(`trigger type ${kind}`),
61
60
  })),
62
61
  [t],
63
62
  );
64
63
 
65
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
64
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
66
65
  };
66
+
67
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -4,36 +4,47 @@
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
- import { Filter, Obj, Ref } from '@dxos/echo';
9
- import { FunctionTrigger, FunctionType } from '@dxos/functions';
9
+ import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
10
+ import { Function, Trigger } from '@dxos/functions';
10
11
  import { invariant } from '@dxos/invariant';
11
12
  import { faker } from '@dxos/random';
12
- import { useSpaces } from '@dxos/react-client/echo';
13
- import { ContactType, withClientProvider } from '@dxos/react-client/testing';
13
+ import { useQuery } from '@dxos/react-client/echo';
14
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
14
15
  import { useAsyncEffect } from '@dxos/react-ui';
15
- import { withTheme } from '@dxos/react-ui/testing';
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
20
  import { functions } from '../../testing';
18
21
  import { translations } from '../../translations';
19
22
 
20
23
  import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
21
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
+
22
33
  const DefaultStory = (props: Partial<TriggerEditorProps>) => {
23
- const spaces = useSpaces();
24
- const space = spaces[1];
25
- const [trigger, setTrigger] = useState<FunctionTrigger>();
34
+ const { space } = useClientStory();
35
+ const [trigger, setTrigger] = useState<Trigger.Trigger>();
36
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
26
37
 
27
38
  useAsyncEffect(async () => {
28
39
  if (!space) {
29
40
  return;
30
41
  }
31
42
 
32
- const result = await space.db.query(Filter.type(FunctionType)).run();
33
- const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
43
+ const functions = await space.db.query(Filter.type(Function.Function)).run();
44
+ const fn = functions.find((fn) => fn.name === 'example.com/function/forex');
34
45
  invariant(fn);
35
46
  const trigger = space.db.add(
36
- Obj.make(FunctionTrigger, {
47
+ Trigger.make({
37
48
  function: Ref.make(fn),
38
49
  spec: { kind: 'webhook' },
39
50
  input: {
@@ -50,29 +61,43 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
50
61
  }
51
62
 
52
63
  return (
53
- <div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
54
- <TriggerEditor space={space} trigger={trigger} onSave={(values) => console.log('on save', values)} {...props} />
55
- </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
+ />
56
72
  );
57
73
  };
58
74
 
59
75
  const meta = {
60
- title: 'plugins/plugin-automation/TriggerEditor',
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
61
77
  component: TriggerEditor as any,
62
78
  render: DefaultStory,
63
79
  decorators: [
64
- withTheme,
80
+ withTheme(),
81
+ withLayout({ layout: 'column' }),
65
82
  withClientProvider({
66
83
  createIdentity: true,
67
84
  createSpace: true,
68
- types: [FunctionType, FunctionTrigger, ContactType],
85
+ types: [Tag.Tag, Function.Function, Trigger.Trigger, TestSchema.ContactType],
69
86
  onCreateSpace: ({ space }) => {
70
- for (const fn of functions) {
71
- space.db.add(Obj.make(FunctionType, fn));
72
- }
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.
73
98
  Array.from({ length: 10 }).map(() => {
74
99
  return space.db.add(
75
- Obj.make(ContactType, {
100
+ Obj.make(TestSchema.ContactType, {
76
101
  name: faker.person.fullName(),
77
102
  identifiers: [],
78
103
  }),
@@ -82,8 +107,8 @@ const meta = {
82
107
  }),
83
108
  ],
84
109
  parameters: {
85
- layout: 'column',
86
- translations,
110
+ layout: 'fullscreen',
111
+ translations: [...formTranslations, ...translations],
87
112
  },
88
113
  } satisfies Meta<typeof DefaultStory>;
89
114
 
@@ -98,3 +123,44 @@ export const ReadonlySpec: Story = {
98
123
  readonlySpec: true,
99
124
  },
100
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,67 +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';
9
- import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
11
- import { Input, useDensityContext, useElevationContext, useThemeContext, useTranslation } from '@dxos/react-ui';
12
- import { Editor, createBasicExtensions, createThemeExtensions } from '@dxos/react-ui-editor';
13
- import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
14
- import { inputTheme, mx } from '@dxos/react-ui-theme';
15
-
16
- import { meta } from '../../meta';
17
-
18
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
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';
13
+ import {
14
+ type ExcludeId,
15
+ Form,
16
+ FormFieldLabel,
17
+ type FormFieldMap,
18
+ type FormRootProps,
19
+ SelectField,
20
+ omitId,
21
+ } from '@dxos/react-ui-form';
22
+
23
+ import { FunctionInputEditor } from './FunctionInputEditor';
19
24
  import { SpecSelector } from './SpecSelector';
20
25
 
26
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
27
+
21
28
  export type TriggerEditorProps = {
22
- space: Space;
23
- trigger: FunctionTrigger;
29
+ db: Database.Database;
30
+ trigger: Trigger.Trigger;
24
31
  // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
25
32
  readonlySpec?: boolean;
26
- onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;
27
- onCancel?: () => void;
28
- };
29
-
30
- export const TriggerEditor = ({ space, trigger, readonlySpec, onSave, onCancel }: TriggerEditorProps) => {
31
- const handleSave = (values: FunctionTrigger) => {
32
- onSave?.(values);
33
- };
33
+ } &
34
+ // prettier-ignore
35
+ Pick<QueryFormProps, 'types' | 'tags'> &
36
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
37
+
38
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
39
+ const fieldMap = useCustomInputs({
40
+ db,
41
+ types,
42
+ tags,
43
+ readonlySpec,
44
+ });
45
+
46
+ const handleValuesChanged = useCallback(
47
+ (newValues: Partial<TriggerFormSchema>) => {
48
+ Obj.change(trigger, (t) => {
49
+ Object.assign(t, newValues);
50
+ });
51
+ },
52
+ [trigger],
53
+ );
34
54
 
35
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
36
- const Custom = useCustomInputs({ space, readonlySpec, onQueryRefOptions: handleRefQueryLookup });
55
+ const defaultValues = useMemo(() => {
56
+ const { id: _, ...values } = trigger;
57
+ return values;
58
+ }, [trigger]);
37
59
 
38
60
  return (
39
- <Form
40
- outerSpacing={false}
41
- Custom={Custom}
42
- schema={FunctionTrigger}
43
- values={trigger}
44
- onSave={handleSave}
45
- onCancel={onCancel}
46
- onQueryRefOptions={handleRefQueryLookup}
47
- />
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>
48
76
  );
49
77
  };
50
78
 
51
- const useCustomInputs = ({
52
- space,
53
- readonlySpec,
54
- onQueryRefOptions,
55
- }: {
56
- space: Space;
79
+ type UseCustomInputsProps = {
80
+ db: Database.Database;
57
81
  readonlySpec?: boolean;
58
- onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
59
- }) => {
60
- const { t } = useTranslation(meta.id);
61
- const functions = useQuery(space, Filter.type(FunctionType));
62
- const workflows = useQuery(space, Filter.type(ComputeGraph));
63
- const scripts = useQuery(space, Filter.type(ScriptType));
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));
64
88
 
65
89
  return useMemo(
66
- (): CustomInputMap => ({
90
+ (): FormFieldMap => ({
67
91
  // Function selector.
68
- ['function' satisfies keyof FunctionTrigger]: (props) => {
92
+ ['function' satisfies keyof Trigger.Trigger]: (props) => {
69
93
  const getValue = useCallback(() => {
70
94
  const formValue = props.getValue();
71
95
  if (Ref.isRef(formValue)) {
@@ -76,17 +100,17 @@ const useCustomInputs = ({
76
100
 
77
101
  const handleOnValueChange = useCallback(
78
102
  (_type: any, dxnString: string) => {
79
- const dxn = Type.DXN.parse(dxnString);
103
+ const dxn = DXN.parse(dxnString);
80
104
  if (dxn) {
81
105
  const ref = Ref.fromDXN(dxn);
82
- props.onValueChange('object', ref);
106
+ props.onValueChange(props.type, ref);
83
107
  }
84
108
  },
85
- [props.onValueChange],
109
+ [props.type, props.onValueChange],
86
110
  );
87
111
 
88
112
  return (
89
- <SelectInput
113
+ <SelectField
90
114
  {...props}
91
115
  getValue={getValue as any}
92
116
  onValueChange={handleOnValueChange}
@@ -96,52 +120,26 @@ const useCustomInputs = ({
96
120
  },
97
121
 
98
122
  // Spec selector.
99
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
123
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
100
124
 
101
125
  // TODO(wittjosiah): Copied from ViewEditor.
102
126
  // Query input editor.
103
- ['spec.query' as const]: (props) => {
104
- const { themeMode } = useThemeContext();
105
- const density = useDensityContext();
106
- const elevation = useElevationContext();
107
- const value = props.getValue() as any;
108
-
109
- // TODO(wittjosiah): Including props.onValueChange in deps causes infinite loop.
127
+ 'spec.query': (props) => {
110
128
  const handleChange = useCallback(
111
- (text: string) => props.onValueChange('object', { ...value, string: text }),
112
- [],
113
- );
114
-
115
- const extensions = useMemo(
116
- () => [
117
- createBasicExtensions({ readOnly: readonlySpec, placeholder: t('query placeholder') }),
118
- createThemeExtensions({ themeMode }),
119
- ],
120
- [],
129
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
130
+ [props.type, props.onValueChange],
121
131
  );
122
132
 
123
- // TODO(wittjosiah): This is probably not the right way to do these styles.
124
133
  return (
125
134
  <Input.Root>
126
- <InputHeader label={props.label} />
127
- <Editor
128
- classNames={mx(
129
- inputTheme.input({ density, elevation }),
130
- 'flex items-center',
131
- 'focus-within:bg-focusSurface focus-within:border-separator focus-within:hover:bg-focusSurface',
132
- )}
133
- extensions={extensions}
134
- value={value.string}
135
- onChange={handleChange}
136
- />
135
+ <FormFieldLabel label={props.label} asChild />
136
+ <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
137
137
  </Input.Root>
138
138
  );
139
139
  },
140
140
 
141
141
  // Function input editor.
142
- ['input' as const]: (props) => (
143
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
144
- ),
142
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
145
143
  }),
146
144
  [workflows, scripts, functions, readonlySpec],
147
145
  );
@@ -151,7 +149,7 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
151
149
  return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
152
150
  };
153
151
 
154
- const getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {
155
- 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;
156
154
  return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
157
155
  };
@@ -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/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;
@@ -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
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { FunctionsContainer } from './FunctionsContainer';
6
+
7
+ export default FunctionsContainer;