@dxos/plugin-automation 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b

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 (362) hide show
  1. package/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
  2. package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
  3. package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
  4. package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +138 -133
  5. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  6. package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
  7. package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
  8. package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
  9. package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
  10. package/dist/lib/{browser/chunk-QNEQ23BF.mjs → neutral/FunctionsPanel-GLCUBEDT.mjs} +23 -25
  11. package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
  12. package/dist/lib/{browser/FunctionsContainer-5NHAAP5H.mjs → neutral/FunctionsRegistry-VRU4FBVH.mjs} +23 -54
  13. package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
  14. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  15. package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
  16. package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
  17. package/dist/lib/neutral/capabilities/index.mjs +15 -0
  18. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  19. package/dist/lib/neutral/capabilities/node.mjs +13 -0
  20. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  22. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  23. package/dist/lib/{browser/chunk-PZNBEKO5.mjs → neutral/chunk-ATECY555.mjs} +7 -4
  24. package/dist/lib/{browser/chunk-PZNBEKO5.mjs.map → neutral/chunk-ATECY555.mjs.map} +3 -3
  25. package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
  26. package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
  27. package/dist/lib/{browser/chunk-C273ZYLE.mjs → neutral/chunk-FKFFU54G.mjs} +53 -41
  28. package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
  29. package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
  30. package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
  32. package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  34. package/dist/lib/{node-esm/chunk-EJPZWAGR.mjs → neutral/chunk-N735CP33.mjs} +69 -41
  35. package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
  36. package/dist/lib/neutral/components/index.mjs +16 -0
  37. package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
  38. package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
  39. package/dist/lib/neutral/containers/index.mjs +13 -0
  40. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  41. package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
  42. package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
  43. package/dist/lib/neutral/hooks/index.mjs +129 -0
  44. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  45. package/dist/lib/neutral/index.mjs +20 -0
  46. package/dist/lib/neutral/meta.json +1 -0
  47. package/dist/lib/neutral/meta.mjs +8 -0
  48. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  49. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  50. package/dist/lib/neutral/operations/index.mjs +8 -0
  51. package/dist/lib/neutral/plugin.mjs +16 -0
  52. package/dist/lib/neutral/plugin.mjs.map +7 -0
  53. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  54. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  55. package/dist/lib/neutral/translations.mjs +47 -0
  56. package/dist/lib/neutral/translations.mjs.map +7 -0
  57. package/dist/lib/neutral/types/index.mjs +16 -0
  58. package/dist/types/src/AutomationPlugin.d.ts +1 -0
  59. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  60. package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
  61. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  62. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  63. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  64. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  65. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
  67. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  68. package/dist/types/src/capabilities/index.d.ts +6 -4
  69. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  70. package/dist/types/src/capabilities/node.d.ts +6 -0
  71. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  73. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  75. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  76. package/dist/types/src/commands/index.d.ts.map +1 -0
  77. package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
  78. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  79. package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +1 -1
  80. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  81. package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
  82. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  83. package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
  84. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  85. package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +7 -7
  86. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  87. package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
  88. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  89. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  90. package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
  91. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  92. package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
  93. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  94. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  95. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  97. package/dist/types/src/{cli/commands → commands}/trigger/util.d.ts +4 -4
  98. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  99. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  100. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  101. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -31
  102. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  103. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  104. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  105. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  106. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  107. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  108. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  109. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
  110. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  111. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
  112. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  113. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
  114. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  115. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +96 -92
  116. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  117. package/dist/types/src/components/index.d.ts +2 -3
  118. package/dist/types/src/components/index.d.ts.map +1 -1
  119. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  120. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  121. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  122. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  123. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  124. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  125. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  126. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  127. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  128. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  129. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  130. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  131. package/dist/types/src/containers/index.d.ts +5 -0
  132. package/dist/types/src/containers/index.d.ts.map +1 -0
  133. package/dist/types/src/hooks/index.d.ts +2 -0
  134. package/dist/types/src/hooks/index.d.ts.map +1 -1
  135. package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
  136. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  137. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
  138. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  139. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
  140. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  141. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
  142. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  143. package/dist/types/src/index.d.ts +0 -3
  144. package/dist/types/src/index.d.ts.map +1 -1
  145. package/dist/types/src/meta.d.ts.map +1 -1
  146. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  147. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  148. package/dist/types/src/operations/index.d.ts +3 -0
  149. package/dist/types/src/operations/index.d.ts.map +1 -0
  150. package/dist/types/src/plugin.d.ts +4 -0
  151. package/dist/types/src/plugin.d.ts.map +1 -0
  152. package/dist/types/src/testing/test-functions.d.ts +78 -76
  153. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  154. package/dist/types/src/translations.d.ts +32 -32
  155. package/dist/types/src/translations.d.ts.map +1 -1
  156. package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
  157. package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
  158. package/dist/types/src/types/AutomationEvents.d.ts +3 -0
  159. package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
  160. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  161. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  162. package/dist/types/src/types/index.d.ts +3 -2
  163. package/dist/types/src/types/index.d.ts.map +1 -1
  164. package/dist/types/src/types/schema.d.ts +9 -30
  165. package/dist/types/src/types/schema.d.ts.map +1 -1
  166. package/dist/types/tsconfig.tsbuildinfo +1 -1
  167. package/package.json +115 -65
  168. package/src/AutomationPlugin.node.ts +29 -0
  169. package/src/AutomationPlugin.test.ts +27 -0
  170. package/src/AutomationPlugin.tsx +11 -9
  171. package/src/capabilities/app-graph-builder.ts +66 -0
  172. package/src/capabilities/compute-runtime.ts +325 -0
  173. package/src/capabilities/index.ts +10 -4
  174. package/src/capabilities/node.ts +13 -0
  175. package/src/capabilities/operation-handler.ts +16 -0
  176. package/src/capabilities/react-surface.tsx +59 -0
  177. package/src/{cli/commands → commands}/trigger/create/queue.ts +6 -9
  178. package/src/{cli/commands → commands}/trigger/create/subscription.ts +10 -13
  179. package/src/{cli/commands → commands}/trigger/create/timer.ts +6 -9
  180. package/src/{cli/commands → commands}/trigger/list.ts +7 -4
  181. package/src/{cli/commands → commands}/trigger/remove.ts +1 -1
  182. package/src/{cli/commands → commands}/trigger/update/queue.ts +18 -19
  183. package/src/{cli/commands → commands}/trigger/update/subscription.ts +17 -17
  184. package/src/{cli/commands → commands}/trigger/update/timer.ts +18 -18
  185. package/src/{cli/commands → commands}/trigger/util.ts +39 -24
  186. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +8 -7
  187. package/src/components/AutomationPanel/AutomationPanel.tsx +76 -66
  188. package/src/components/FunctionsPanel/FunctionsPanel.tsx +31 -27
  189. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +25 -21
  190. package/src/components/FunctionsRegistry/index.ts +4 -1
  191. package/src/components/TriggerEditor/FunctionInputEditor.tsx +6 -6
  192. package/src/components/TriggerEditor/SpecSelector.tsx +17 -13
  193. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +54 -12
  194. package/src/components/TriggerEditor/TriggerEditor.tsx +45 -17
  195. package/src/components/index.ts +1 -2
  196. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  197. package/src/containers/AutomationSettings/index.ts +5 -0
  198. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  199. package/src/containers/FunctionsContainer/index.ts +5 -0
  200. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  201. package/src/containers/TriggerSettings/index.ts +6 -0
  202. package/src/containers/index.ts +9 -0
  203. package/src/hooks/index.ts +3 -0
  204. package/src/hooks/useComputeRuntime.ts +30 -0
  205. package/src/hooks/useComputeRuntimeCallback.ts +4 -39
  206. package/src/hooks/useComputeRuntimeService.ts +64 -0
  207. package/src/hooks/useTriggerRuntimeControls.ts +6 -3
  208. package/src/index.ts +0 -4
  209. package/src/meta.ts +3 -2
  210. package/src/operations/create-trigger-from-template.ts +72 -0
  211. package/src/operations/index.ts +7 -0
  212. package/src/plugin.ts +11 -0
  213. package/src/testing/test-functions.ts +11 -8
  214. package/src/translations.ts +39 -38
  215. package/src/types/AutomationCapabilities.ts +48 -0
  216. package/src/types/AutomationEvents.ts +11 -0
  217. package/src/types/AutomationOperation.ts +30 -0
  218. package/src/types/index.ts +4 -2
  219. package/src/types/schema.ts +3 -24
  220. package/dist/lib/browser/AutomationPanel-C6MZ22CB.mjs +0 -11
  221. package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs +0 -57
  222. package/dist/lib/browser/AutomationSettings-D7UO5V3Q.mjs.map +0 -7
  223. package/dist/lib/browser/FunctionsContainer-5NHAAP5H.mjs.map +0 -7
  224. package/dist/lib/browser/FunctionsPanel-RD22LYMR.mjs +0 -10
  225. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +0 -85
  226. package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +0 -7
  227. package/dist/lib/browser/chunk-C273ZYLE.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-JFBUK3WR.mjs +0 -14
  229. package/dist/lib/browser/chunk-JFBUK3WR.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-JN7QRQQX.mjs +0 -256
  231. package/dist/lib/browser/chunk-JN7QRQQX.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-JOXPQ27I.mjs +0 -83
  233. package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
  234. package/dist/lib/browser/chunk-O5Y2F33G.mjs +0 -8
  235. package/dist/lib/browser/chunk-O5Y2F33G.mjs.map +0 -7
  236. package/dist/lib/browser/chunk-P5AEO35Y.mjs +0 -93
  237. package/dist/lib/browser/chunk-P5AEO35Y.mjs.map +0 -7
  238. package/dist/lib/browser/chunk-QNEQ23BF.mjs.map +0 -7
  239. package/dist/lib/browser/cli/index.mjs.map +0 -7
  240. package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs +0 -119
  241. package/dist/lib/browser/compute-runtime-BUBHYS4Y.mjs.map +0 -7
  242. package/dist/lib/browser/hooks/index.mjs +0 -13
  243. package/dist/lib/browser/index.mjs +0 -123
  244. package/dist/lib/browser/index.mjs.map +0 -7
  245. package/dist/lib/browser/meta.json +0 -1
  246. package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs +0 -83
  247. package/dist/lib/browser/operation-resolver-IN2FRGOT.mjs.map +0 -7
  248. package/dist/lib/browser/react-surface-246NXXJR.mjs +0 -66
  249. package/dist/lib/browser/react-surface-246NXXJR.mjs.map +0 -7
  250. package/dist/lib/browser/types/index.mjs +0 -14
  251. package/dist/lib/node-esm/AutomationPanel-RTBY7YFM.mjs +0 -12
  252. package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs +0 -58
  253. package/dist/lib/node-esm/AutomationSettings-GK4RLSDN.mjs.map +0 -7
  254. package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs +0 -126
  255. package/dist/lib/node-esm/FunctionsContainer-AHHZODM5.mjs.map +0 -7
  256. package/dist/lib/node-esm/FunctionsPanel-V2DKWYMU.mjs +0 -11
  257. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +0 -86
  258. package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
  260. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-AENSLAVD.mjs +0 -99
  262. package/dist/lib/node-esm/chunk-AENSLAVD.mjs.map +0 -7
  263. package/dist/lib/node-esm/chunk-EJPZWAGR.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs +0 -16
  265. package/dist/lib/node-esm/chunk-K5Z4UGIO.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-M3UPTGXF.mjs +0 -10
  267. package/dist/lib/node-esm/chunk-M3UPTGXF.mjs.map +0 -7
  268. package/dist/lib/node-esm/chunk-OJEFRZEV.mjs +0 -259
  269. package/dist/lib/node-esm/chunk-OJEFRZEV.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs +0 -94
  271. package/dist/lib/node-esm/chunk-Q7EMIPMW.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-RX52VKI2.mjs +0 -84
  273. package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
  274. package/dist/lib/node-esm/cli/index.mjs +0 -1109
  275. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  276. package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs +0 -120
  277. package/dist/lib/node-esm/compute-runtime-6UEDBN76.mjs.map +0 -7
  278. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  279. package/dist/lib/node-esm/index.mjs +0 -124
  280. package/dist/lib/node-esm/index.mjs.map +0 -7
  281. package/dist/lib/node-esm/meta.json +0 -1
  282. package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs +0 -84
  283. package/dist/lib/node-esm/operation-resolver-67CEAKXP.mjs.map +0 -7
  284. package/dist/lib/node-esm/react-surface-U6762KPI.mjs +0 -67
  285. package/dist/lib/node-esm/react-surface-U6762KPI.mjs.map +0 -7
  286. package/dist/lib/node-esm/types/index.mjs +0 -15
  287. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  288. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  289. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  290. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  291. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  292. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  293. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  294. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  295. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  296. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  297. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  298. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  299. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  300. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  301. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  302. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  303. package/dist/types/src/cli/commands/index.d.ts.map +0 -1
  304. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
  305. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
  306. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
  307. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
  308. package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
  309. package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
  310. package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
  311. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
  312. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
  313. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
  314. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
  315. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
  316. package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
  317. package/dist/types/src/cli/index.d.ts +0 -2
  318. package/dist/types/src/cli/index.d.ts.map +0 -1
  319. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  320. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  321. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  322. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  323. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  324. package/dist/types/src/components/TriggerSettings.d.ts +0 -6
  325. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  326. package/dist/types/src/types/capabilities.d.ts +0 -22
  327. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  328. package/dist/types/src/types/events.d.ts +0 -5
  329. package/dist/types/src/types/events.d.ts.map +0 -1
  330. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -72
  331. package/src/capabilities/app-graph-builder/index.ts +0 -7
  332. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -140
  333. package/src/capabilities/compute-runtime/index.ts +0 -7
  334. package/src/capabilities/operation-resolver/index.ts +0 -7
  335. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
  336. package/src/capabilities/react-surface/index.ts +0 -7
  337. package/src/capabilities/react-surface/react-surface.tsx +0 -61
  338. package/src/cli/index.ts +0 -5
  339. package/src/cli/plugin.ts +0 -24
  340. package/src/components/AutomationSettings.tsx +0 -30
  341. package/src/components/FunctionsContainer.tsx +0 -36
  342. package/src/components/TriggerSettings.tsx +0 -26
  343. package/src/types/capabilities.ts +0 -42
  344. package/src/types/events.ts +0 -11
  345. /package/dist/lib/{browser/AutomationPanel-C6MZ22CB.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
  346. /package/dist/lib/{browser/FunctionsPanel-RD22LYMR.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  347. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  348. /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
  349. /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
  350. /package/dist/lib/{node-esm/AutomationPanel-RTBY7YFM.mjs.map → neutral/meta.mjs.map} +0 -0
  351. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  352. /package/dist/lib/{node-esm/FunctionsPanel-V2DKWYMU.mjs.map → neutral/types/index.mjs.map} +0 -0
  353. /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
  354. /package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +0 -0
  355. /package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +0 -0
  356. /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
  357. /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
  358. /package/src/{cli/commands → commands}/index.ts +0 -0
  359. /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
  360. /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
  361. /package/src/{cli/commands → commands}/trigger/options.ts +0 -0
  362. /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
@@ -8,24 +8,27 @@ import * as Match from 'effect/Match';
8
8
  import * as Schema from 'effect/Schema';
9
9
  import React, { useCallback, useMemo, useState } from 'react';
10
10
 
11
- import { Filter, Obj, Tag } from '@dxos/echo';
12
- import { Function, Script, Trigger } from '@dxos/functions';
11
+ import { useTypeOptions } from '@dxos/app-toolkit/ui';
12
+ import { Script, Trigger } from '@dxos/compute';
13
+ import { Operation } from '@dxos/compute';
14
+ import { Context } from '@dxos/context';
15
+ import { Filter, Obj, Query, Tag } from '@dxos/echo';
13
16
  import { KEY_QUEUE_CURSOR } from '@dxos/functions-runtime';
14
17
  import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
15
- import { useTypeOptions } from '@dxos/plugin-space';
16
18
  import { type Client, useClient } from '@dxos/react-client';
17
19
  import { type Space, useObject, useQuery } from '@dxos/react-client/echo';
18
- import { Clipboard, IconButton, Input, Separator, useTranslation } from '@dxos/react-ui';
20
+ import { Clipboard, IconButton, type IconButtonProps, Input, Separator, useTranslation } from '@dxos/react-ui';
19
21
  import { Settings } from '@dxos/react-ui-form';
20
22
  import { List } from '@dxos/react-ui-list';
21
23
  import { Pipeline } from '@dxos/types';
22
24
  import { ghostHover, mx } from '@dxos/ui-theme';
23
25
  import { isNonNullable } from '@dxos/util';
24
26
 
25
- import { meta } from '../../meta';
27
+ import { meta } from '#meta';
28
+
26
29
  import { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';
27
30
 
28
- const grid = 'grid grid-cols-[40px_1fr_32px_32px] min-bs-[2.5rem]';
31
+ const grid = 'grid grid-cols-[40px_1fr_32px_32px] min-h-[2.5rem]';
29
32
 
30
33
  export type AutomationPanelProps = {
31
34
  space: Space;
@@ -39,8 +42,11 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
39
42
  const { t } = useTranslation(meta.id);
40
43
  const client = useClient();
41
44
  const functionsServiceClient = useMemo(() => FunctionsServiceClient.fromClient(client), [client]);
42
- const functions = useQuery(space.db, Filter.type(Function.Function));
43
- const triggers = useQuery(space.db, Filter.type(Trigger.Trigger));
45
+ const functions = useQuery(space.db, Filter.type(Operation.PersistentOperation));
46
+ const triggers = useQuery(
47
+ space.db,
48
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.AutomationPanel'),
49
+ );
44
50
  const filteredTriggers = useMemo(() => {
45
51
  return object ? triggers.filter(triggerMatch(object)) : triggers;
46
52
  }, [object, triggers]);
@@ -50,7 +56,6 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
50
56
  annotation: {
51
57
  location: ['database', 'runtime'],
52
58
  kind: ['user'],
53
- registered: ['registered'],
54
59
  },
55
60
  });
56
61
 
@@ -75,8 +80,8 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
75
80
 
76
81
  const handleSave: TriggerEditorProps['onSave'] = (trigger) => {
77
82
  if (selected) {
78
- Obj.change(selected, (mutable) => {
79
- Object.assign(mutable, trigger);
83
+ Obj.update(selected, (selected) => {
84
+ Object.assign(selected, trigger);
80
85
  });
81
86
  } else {
82
87
  space.db.add(Trigger.make(trigger));
@@ -93,19 +98,19 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
93
98
  };
94
99
 
95
100
  const handleForceRunTrigger = async (trigger: Trigger.Trigger) => {
96
- await functionsServiceClient.forceRunCronTrigger(space.id, trigger.id);
101
+ await functionsServiceClient.forceRunCronTrigger(Context.default(), space.id, trigger.id);
97
102
  };
98
103
 
99
104
  const handleResetCursor = async (trigger: Trigger.Trigger) => {
100
- Obj.change(trigger, (t) => {
101
- Obj.deleteKeys(t, KEY_QUEUE_CURSOR);
105
+ Obj.update(trigger, (trigger) => {
106
+ Obj.deleteKeys(trigger, KEY_QUEUE_CURSOR);
102
107
  });
103
108
  await space.db.flush({ indexes: true });
104
109
  };
105
110
 
106
111
  if (trigger) {
107
112
  return (
108
- <Settings.Item title={t('trigger editor title')}>
113
+ <Settings.Item title={t('trigger-editor.title')} description={t('trigger-editor.description')}>
109
114
  <TriggerEditor
110
115
  db={space.db}
111
116
  trigger={trigger}
@@ -120,34 +125,36 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
120
125
  }
121
126
 
122
127
  return (
123
- <Settings.Container>
124
- {filteredTriggers.length > 0 && (
125
- <List.Root<Trigger.Trigger>
126
- items={filteredTriggers}
127
- isItem={Schema.is(Trigger.Trigger)}
128
- getId={(field) => field.id}
129
- >
130
- {({ items: filteredTriggers }) => (
131
- <div role='list' className='flex flex-col is-full'>
132
- {filteredTriggers?.map((trigger) => (
133
- <TriggerListItem
134
- key={trigger.id}
135
- trigger={trigger}
136
- functions={functions}
137
- onSelect={handleSelect}
138
- onDelete={handleDelete}
139
- onResetCursor={handleResetCursor}
140
- onForceRun={handleForceRunTrigger}
141
- />
142
- ))}
143
- </div>
144
- )}
145
- </List.Root>
146
- )}
147
-
148
- {filteredTriggers.length > 0 && <Separator classNames='mlb-4' />}
149
- <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />
150
- </Settings.Container>
128
+ <Settings.Panel>
129
+ <Clipboard.Provider>
130
+ {filteredTriggers.length > 0 && (
131
+ <List.Root<Trigger.Trigger>
132
+ items={filteredTriggers}
133
+ isItem={Schema.is(Trigger.Trigger)}
134
+ getId={(field) => field.id}
135
+ >
136
+ {({ items: filteredTriggers }) => (
137
+ <div role='list' className='flex flex-col w-full'>
138
+ {filteredTriggers?.map((trigger) => (
139
+ <TriggerListItem
140
+ key={trigger.id}
141
+ trigger={trigger}
142
+ functions={functions}
143
+ onSelect={handleSelect}
144
+ onDelete={handleDelete}
145
+ onResetCursor={handleResetCursor}
146
+ onForceRun={handleForceRunTrigger}
147
+ />
148
+ ))}
149
+ </div>
150
+ )}
151
+ </List.Root>
152
+ )}
153
+
154
+ {filteredTriggers.length > 0 && <Separator classNames='my-4' />}
155
+ <IconButton icon='ph--plus--regular' label={t('new-trigger.label')} onClick={handleAdd} />
156
+ </Clipboard.Provider>
157
+ </Settings.Panel>
151
158
  );
152
159
  };
153
160
 
@@ -160,7 +167,7 @@ const TriggerListItem = ({
160
167
  onForceRun,
161
168
  }: {
162
169
  trigger: Trigger.Trigger;
163
- functions: Function.Function[];
170
+ functions: Operation.PersistentOperation[];
164
171
  onSelect?: (trigger: Trigger.Trigger) => void;
165
172
  onDelete?: (trigger: Trigger.Trigger) => void;
166
173
  onResetCursor?: (trigger: Trigger.Trigger) => void;
@@ -195,18 +202,38 @@ const TriggerListItem = ({
195
202
  onForceRun?.(trigger);
196
203
  }, [onForceRun, trigger]);
197
204
 
205
+ const actionProps = useMemo<IconButtonProps | undefined>(() => {
206
+ if (trigger.spec?.kind === 'timer' && onForceRun) {
207
+ return {
208
+ disabled: !enabled || trigger.spec?.kind !== 'timer',
209
+ icon: 'ph--play--regular',
210
+ label: 'Force run',
211
+ onClick: handleForceRun,
212
+ };
213
+ }
214
+
215
+ if (trigger.spec?.kind === 'queue' && onResetCursor) {
216
+ return {
217
+ disabled: !cursor,
218
+ icon: 'ph--arrow-clockwise--regular',
219
+ label: 'Reset cursor',
220
+ onClick: handleResetCursor,
221
+ };
222
+ }
223
+ }, [enabled, trigger.spec?.kind, handleForceRun]);
224
+
198
225
  return (
199
226
  <List.Item<Obj.Snapshot<Trigger.Trigger>>
200
227
  key={trigger.id}
201
228
  item={snapshot}
202
- classNames={mx(grid, ghostHover, 'items-center', 'pli-2')}
229
+ classNames={mx(grid, ghostHover, 'items-center', 'px-2')}
203
230
  >
204
231
  <Input.Root>
205
232
  <Input.Switch checked={enabled} onCheckedChange={onEnabledChange} />
206
233
  </Input.Root>
207
234
 
208
235
  <div className={'flex'}>
209
- <List.ItemTitle classNames='pli-1 cursor-pointer is-0 shrink truncate' onClick={handleSelect}>
236
+ <List.ItemTitle classNames='px-1 cursor-pointer w-0 shrink truncate' onClick={handleSelect}>
210
237
  {getFunctionName(functions, trigger) ?? '∅'}
211
238
  {cursor && <div className='text-xs text-description truncate ml-4'>Position: {cursor}</div>}
212
239
  </List.ItemTitle>
@@ -216,24 +243,7 @@ const TriggerListItem = ({
216
243
  )}
217
244
  </div>
218
245
 
219
- {trigger.spec?.kind === 'timer' && onForceRun && (
220
- <List.ItemButton
221
- autoHide={false}
222
- disabled={!enabled || trigger.spec?.kind !== 'timer'}
223
- icon='ph--play--regular'
224
- label='Force run'
225
- onClick={handleForceRun}
226
- />
227
- )}
228
- {trigger.spec?.kind === 'queue' && onResetCursor && (
229
- <List.ItemButton
230
- autoHide={false}
231
- disabled={!cursor}
232
- icon='ph--arrow-clockwise--regular'
233
- label='Reset cursor'
234
- onClick={handleResetCursor}
235
- />
236
- )}
246
+ {actionProps ? <List.ItemIconButton {...actionProps} autoHide={false} /> : <div />}
237
247
 
238
248
  {onDelete && <List.ItemDeleteButton onClick={handleDelete} />}
239
249
  </List.Item>
@@ -266,7 +276,7 @@ const getWebhookUrl = (client: Client, trigger: Trigger.Trigger) => {
266
276
  return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
267
277
  };
268
278
 
269
- const getFunctionName = (functions: Function.Function[], trigger: Trigger.Trigger) => {
279
+ const getFunctionName = (functions: Operation.PersistentOperation[], trigger: Trigger.Trigger) => {
270
280
  // TODO(wittjosiah): Truncation should be done in the UI.
271
281
  // Warning that the List component is currently a can of worms.
272
282
  const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;
@@ -276,7 +286,7 @@ const getFunctionName = (functions: Function.Function[], trigger: Trigger.Trigge
276
286
 
277
287
  const scriptMatch = (script: Script.Script) => (trigger: Trigger.Trigger) => {
278
288
  const fn = trigger.function?.target;
279
- if (!Obj.instanceOf(Function.Function, fn)) {
289
+ if (!Obj.instanceOf(Operation.PersistentOperation, fn)) {
280
290
  return false;
281
291
  }
282
292
 
@@ -6,17 +6,16 @@ import * as Schema from 'effect/Schema';
6
6
  import React, { useCallback, useMemo } from 'react';
7
7
 
8
8
  import { useOperationInvoker } from '@dxos/app-framework/ui';
9
- import { LayoutOperation } from '@dxos/app-toolkit';
10
- import { Obj } from '@dxos/echo';
11
- import { Function, Script } from '@dxos/functions';
12
- import { SpaceOperation } from '@dxos/plugin-space/types';
9
+ import { LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
10
+ import { Operation, Script } from '@dxos/compute';
11
+ import { SpaceOperation } from '@dxos/plugin-space';
13
12
  import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
14
- import { Button, IconButton, useTranslation } from '@dxos/react-ui';
13
+ import { IconButton, useTranslation } from '@dxos/react-ui';
15
14
  import { Settings } from '@dxos/react-ui-form';
16
15
  import { List } from '@dxos/react-ui-list';
17
16
  import { ghostHover, mx } from '@dxos/ui-theme';
18
17
 
19
- import { meta } from '../../meta';
18
+ import { meta } from '#meta';
20
19
 
21
20
  export type FunctionsPanelProps = {
22
21
  space: Space;
@@ -24,7 +23,7 @@ export type FunctionsPanelProps = {
24
23
 
25
24
  export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
26
25
  const { t } = useTranslation(meta.id);
27
- const functions = useQuery(space.db, Filter.type(Function.Function));
26
+ const functions = useQuery(space.db, Filter.type(Operation.PersistentOperation));
28
27
  const scripts = useQuery(space.db, Filter.type(Script.Script));
29
28
  const { invokePromise } = useOperationInvoker();
30
29
 
@@ -47,7 +46,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
47
46
  );
48
47
 
49
48
  const getScriptName = useCallback(
50
- (func: Function.Function) => {
49
+ (func: Operation.PersistentOperation) => {
51
50
  const script = functionToScriptMap[func.id];
52
51
  return script?.name;
53
52
  },
@@ -55,48 +54,55 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
55
54
  );
56
55
 
57
56
  const handleGoToScript = useCallback(
58
- (func: Function.Function) => {
57
+ (func: Operation.PersistentOperation) => {
59
58
  const script = functionToScriptMap[func.id];
60
59
  if (script) {
61
- void invokePromise(LayoutOperation.Open, { subject: [Obj.getDXN(script).toString()] });
60
+ void invokePromise(LayoutOperation.Open, { subject: [getObjectPathFromObject(script)] });
62
61
  }
63
62
  },
64
63
  [functionToScriptMap, invokePromise],
65
64
  );
66
65
 
67
66
  const handleDelete = useCallback(
68
- (func: Function.Function) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),
67
+ (func: Operation.PersistentOperation) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),
69
68
  [invokePromise],
70
69
  );
71
70
 
72
71
  return (
73
- <Settings.Container>
72
+ <Settings.Panel>
74
73
  {functions.length > 0 && (
75
- <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>
74
+ <List.Root<Operation.PersistentOperation>
75
+ items={functions}
76
+ isItem={Schema.is(Operation.PersistentOperation)}
77
+ getId={(func) => func.id}
78
+ >
76
79
  {({ items }) => (
77
- <div role='list' className='flex flex-col is-full'>
80
+ <div role='list' className='flex flex-col w-full'>
78
81
  {items?.map((func) => (
79
- <List.Item<Function.Function>
82
+ <List.Item<Operation.PersistentOperation>
80
83
  key={func.id}
81
84
  item={func}
82
85
  classNames={mx(
83
- 'grid grid-cols-[1fr_auto] min-bs-[2.5rem] min-bs-[3rem] pli-2 items-center',
86
+ 'grid grid-cols-[1fr_min-content_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center',
84
87
  ghostHover,
85
88
  )}
86
89
  >
87
90
  <div className='flex flex-col truncate'>
88
91
  <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
89
- {getScriptName(func) && (
90
- <div className='text-xs text-description truncate'>{getScriptName(func)}</div>
91
- )}
92
+ {getScriptName(func) && <p className='text-xs text-description truncate'>{getScriptName(func)}</p>}
92
93
  </div>
93
- {functionToScriptMap[func.id] && (
94
- <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>
95
- )}
94
+ {(functionToScriptMap[func.id] && (
95
+ <IconButton
96
+ icon='ph--arrow-square-out--regular'
97
+ iconOnly
98
+ label={t('show-source-button.label')}
99
+ onClick={() => handleGoToScript(func)}
100
+ />
101
+ )) || <div />}
96
102
  <IconButton
97
- iconOnly
98
103
  icon='ph--trash--regular'
99
- label={t('delete function button label')}
104
+ iconOnly
105
+ label={t('delete-function-button.label')}
100
106
  onClick={() => handleDelete(func)}
101
107
  />
102
108
  </List.Item>
@@ -105,8 +111,6 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
105
111
  )}
106
112
  </List.Root>
107
113
  )}
108
-
109
- {functions.length === 0 && <div className='text-center plb-4 text-description'>{t('no functions found')}</div>}
110
- </Settings.Container>
114
+ </Settings.Panel>
111
115
  );
112
116
  };
@@ -6,7 +6,8 @@ import * as Schema from 'effect/Schema';
6
6
  import { useState } from 'react';
7
7
  import React, { useCallback } from 'react';
8
8
 
9
- import { Function } from '@dxos/functions';
9
+ import * as OperationModule from '@dxos/compute';
10
+ import { Context } from '@dxos/context';
10
11
  import { getDeployedFunctions } from '@dxos/functions-runtime/edge';
11
12
  import { useClient } from '@dxos/react-client';
12
13
  import { Filter, Query, type Space, useQuery } from '@dxos/react-client/echo';
@@ -15,9 +16,9 @@ import { Settings } from '@dxos/react-ui-form';
15
16
  import { List } from '@dxos/react-ui-list';
16
17
  import { ghostHover, mx } from '@dxos/ui-theme';
17
18
 
18
- import { meta } from '../../meta';
19
+ import { meta } from '#meta';
19
20
 
20
- const grid = 'grid grid-cols-[1fr_1fr_auto] min-bs-[2.5rem]';
21
+ const grid = 'grid grid-cols-[1fr_1fr_auto] min-h-[2.5rem]';
21
22
 
22
23
  type FunctionsRegistryProps = {
23
24
  space: Space;
@@ -26,12 +27,12 @@ type FunctionsRegistryProps = {
26
27
  export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
27
28
  const client = useClient();
28
29
  const [loading, setLoading] = useState(true);
29
- const [functions, setFunctions] = useState<Function.Function[]>([]);
30
+ const [functions, setFunctions] = useState<OperationModule.Operation.PersistentOperation[]>([]);
30
31
  const { t } = useTranslation(meta.id);
31
32
 
32
- const dbFunctions = useQuery(space.db, Filter.type(Function.Function));
33
+ const dbFunctions = useQuery(space.db, Filter.type(OperationModule.Operation.PersistentOperation));
33
34
 
34
- const state = (func: Function.Function) => {
35
+ const state = (func: OperationModule.Operation.PersistentOperation) => {
35
36
  const dbFunction = dbFunctions.find((f) => f.key === func.key);
36
37
  if (!dbFunction) {
37
38
  return 'import';
@@ -44,35 +45,41 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
44
45
 
45
46
  useAsyncEffect(async () => {
46
47
  setLoading(true);
47
- const functions = await getDeployedFunctions(client, true);
48
+ const functions = await getDeployedFunctions(Context.default(), client, true);
48
49
  setFunctions(functions);
49
50
  setLoading(false);
50
51
  }, []);
51
52
 
52
53
  const hanleImportOrUpdate = useCallback(
53
- async (func: Function.Function) => {
54
- const functions = await space.db.query(Query.type(Function.Function, { key: func.key })).run();
54
+ async (func: OperationModule.Operation.PersistentOperation) => {
55
+ const functions = await space.db
56
+ .query(Query.type(OperationModule.Operation.PersistentOperation, { key: func.key }))
57
+ .run();
55
58
  const [existingFunc] = functions;
56
59
  if (!existingFunc) {
57
60
  space.db.add(func);
58
61
  return;
59
62
  }
60
- Function.setFrom(existingFunc, func);
63
+ OperationModule.Operation.setFrom(existingFunc, func);
61
64
  },
62
65
  [space],
63
66
  );
64
67
 
65
68
  return (
66
- <Settings.Container>
69
+ <Settings.Panel>
67
70
  {functions.length > 0 && (
68
- <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>
71
+ <List.Root<OperationModule.Operation.PersistentOperation>
72
+ items={functions}
73
+ isItem={Schema.is(OperationModule.Operation.PersistentOperation)}
74
+ getId={(func) => func.id}
75
+ >
69
76
  {({ items }) => (
70
- <div role='list' className='flex flex-col is-full'>
77
+ <div role='list' className='flex flex-col w-full'>
71
78
  {items?.map((func) => (
72
- <List.Item<Function.Function>
79
+ <List.Item<OperationModule.Operation.PersistentOperation>
73
80
  key={func.id}
74
81
  item={func}
75
- classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}
82
+ classNames={mx(grid, ghostHover, 'items-center', 'px-2', 'min-h-[3rem]')}
76
83
  >
77
84
  <div className='flex flex-col truncate'>
78
85
  <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
@@ -89,7 +96,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
89
96
  iconOnly
90
97
  icon={state(func) === 'update' ? 'ph--arrows-clockwise--regular' : 'ph--download--regular'}
91
98
  label={
92
- state(func) === 'update' ? t('update function button label') : t('import function button label')
99
+ state(func) === 'update' ? t('update-function-button.label') : t('import-function-button.label')
93
100
  }
94
101
  disabled={state(func) === 'none'}
95
102
  onClick={() => hanleImportOrUpdate(func)}
@@ -101,10 +108,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
101
108
  </List.Root>
102
109
  )}
103
110
 
104
- {functions.length === 0 && !loading && (
105
- <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>
106
- )}
107
- {loading && <div className='text-center plb-4 text-gray-500'>{t('loading functions')}</div>}
108
- </Settings.Container>
111
+ {loading && <div className='text-center py-4 text-gray-500'>{t('loading-functions.message')}</div>}
112
+ </Settings.Panel>
109
113
  );
110
114
  };
@@ -2,4 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export { FunctionsRegistry } from './FunctionsRegistry';
5
+ import { FunctionsRegistry } from './FunctionsRegistry';
6
+
7
+ export { FunctionsRegistry };
8
+ export default FunctionsRegistry;
@@ -5,17 +5,17 @@
5
5
  import type * as SchemaAST from 'effect/SchemaAST';
6
6
  import React, { useCallback, useMemo } from 'react';
7
7
 
8
- import { type Database, Obj, Ref, Type } from '@dxos/echo';
8
+ import { type Operation } from '@dxos/compute';
9
+ import { type Database, JsonSchema, Obj, Ref } from '@dxos/echo';
9
10
  import { type JsonPath } from '@dxos/echo/internal';
10
- import { type Function } from '@dxos/functions';
11
11
  import { useOnTransition, useTranslation } from '@dxos/react-ui';
12
12
  import { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';
13
13
 
14
- import { meta } from '../../meta';
14
+ import { meta } from '#meta';
15
15
 
16
16
  export type FunctionInputEditorProps = {
17
17
  type: SchemaAST.AST;
18
- functions: Function.Function[];
18
+ functions: Operation.PersistentOperation[];
19
19
  db?: Database.Database;
20
20
  } & FormFieldStateProps;
21
21
 
@@ -48,7 +48,7 @@ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChan
48
48
  );
49
49
 
50
50
  const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
51
- const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
51
+ const effectSchema = useMemo(() => (inputSchema ? JsonSchema.toEffectSchema(inputSchema) : undefined), [inputSchema]);
52
52
  const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
53
53
  const defaultValues = useMemo(() => {
54
54
  const raw = getValue() ?? {};
@@ -68,7 +68,7 @@ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChan
68
68
 
69
69
  return (
70
70
  <>
71
- <Form.Label label={t('function parameters label')} asChild />
71
+ <Form.Label label={t('function-parameters.label')} asChild />
72
72
  <Form.Root
73
73
  key={selectedFunction.id}
74
74
  schema={effectSchema}
@@ -4,12 +4,12 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
+ import { Trigger } from '@dxos/compute';
7
8
  import { Filter, Query } from '@dxos/echo';
8
- import { Trigger } from '@dxos/functions';
9
9
  import { useTranslation } from '@dxos/react-ui';
10
10
  import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
11
11
 
12
- import { meta } from '../../meta';
12
+ import { meta } from '#meta';
13
13
 
14
14
  export type SpecSelectorProps = FormFieldComponentProps;
15
15
 
@@ -22,20 +22,15 @@ export const SpecSelector = (props: SpecSelectorProps) => {
22
22
  const getDefaultTriggerSpec = (kind: string) => {
23
23
  switch (kind) {
24
24
  case 'timer':
25
- return { kind: 'timer', cron: '' };
25
+ return Trigger.specTimer('');
26
26
  case 'subscription':
27
- return {
28
- kind: 'subscription',
29
- query: {
30
- ast: Query.select(Filter.nothing()).ast,
31
- },
32
- };
27
+ return Trigger.specSubscription(Query.select(Filter.nothing()));
33
28
  case 'queue':
34
- return { kind: 'queue', queue: 'dxn:' };
29
+ return Trigger.specQueue('dxn:queue:default');
35
30
  case 'email':
36
- return { kind: 'email' };
31
+ return Trigger.specEmail();
37
32
  case 'webhook':
38
- return { kind: 'webhook' };
33
+ return Trigger.specWebhook();
39
34
  default:
40
35
  return undefined;
41
36
  }
@@ -52,11 +47,20 @@ export const SpecSelector = (props: SpecSelectorProps) => {
52
47
  [props.type, specProps],
53
48
  );
54
49
 
50
+ const kindLabels: Record<string, string> = {
51
+ timer: t('trigger-type.timer.label'),
52
+ webhook: t('trigger-type.webhook.label'),
53
+ websocket: t('trigger-type.websocket.label'),
54
+ subscription: t('trigger-type.subscription.label'),
55
+ email: t('trigger-type.email.label'),
56
+ queue: t('trigger-type.queue.label'),
57
+ };
58
+
55
59
  const options = useMemo(
56
60
  () =>
57
61
  Trigger.Kinds.map((kind) => ({
58
62
  value: kind,
59
- label: t(`trigger type ${kind}`),
63
+ label: kindLabels[kind],
60
64
  })),
61
65
  [t],
62
66
  );