@dxos/plugin-automation 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29

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 (304) 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/neutral/AutomationPlugin.node.mjs +1113 -0
  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/neutral/FunctionsPanel-GLCUBEDT.mjs +96 -0
  11. package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
  12. package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs +94 -0
  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/neutral/chunk-ATECY555.mjs +20 -0
  24. package/dist/lib/neutral/chunk-ATECY555.mjs.map +7 -0
  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/neutral/chunk-FKFFU54G.mjs +270 -0
  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/neutral/chunk-N735CP33.mjs +285 -0
  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/operations/index.mjs.map +7 -0
  52. package/dist/lib/neutral/plugin.mjs +16 -0
  53. package/dist/lib/neutral/plugin.mjs.map +7 -0
  54. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  55. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  56. package/dist/lib/neutral/translations.mjs +47 -0
  57. package/dist/lib/neutral/translations.mjs.map +7 -0
  58. package/dist/lib/neutral/types/index.mjs +16 -0
  59. package/dist/lib/neutral/types/index.mjs.map +7 -0
  60. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  61. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  62. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  63. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  64. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  65. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  67. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
  69. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/index.d.ts +6 -3
  71. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  72. package/dist/types/src/capabilities/node.d.ts +6 -0
  73. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  75. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  76. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  77. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  78. package/dist/types/src/commands/index.d.ts +2 -0
  79. package/dist/types/src/commands/index.d.ts.map +1 -0
  80. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  81. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  82. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  83. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  84. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  85. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  86. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  87. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  88. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  89. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  90. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  91. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  92. package/dist/types/src/commands/trigger/options.d.ts +11 -0
  93. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  94. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  95. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  97. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  98. package/dist/types/src/commands/trigger/update/queue.d.ts +12 -0
  99. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
  101. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  103. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  104. package/dist/types/src/commands/trigger/util.d.ts +46 -0
  105. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  106. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -7
  107. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  108. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -26
  109. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  110. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  111. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  112. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  113. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  114. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  115. package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
  116. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  117. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  118. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  119. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  120. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  121. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
  122. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  123. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +107 -30
  124. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  125. package/dist/types/src/components/index.d.ts +3 -4
  126. package/dist/types/src/components/index.d.ts.map +1 -1
  127. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  128. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  129. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  130. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  131. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  132. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  133. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  134. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  135. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
  136. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  137. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  138. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  139. package/dist/types/src/containers/index.d.ts +5 -0
  140. package/dist/types/src/containers/index.d.ts.map +1 -0
  141. package/dist/types/src/hooks/index.d.ts +5 -0
  142. package/dist/types/src/hooks/index.d.ts.map +1 -0
  143. package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
  144. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  145. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +9 -0
  146. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  147. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
  148. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  149. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
  150. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  151. package/dist/types/src/index.d.ts +1 -2
  152. package/dist/types/src/index.d.ts.map +1 -1
  153. package/dist/types/src/meta.d.ts +2 -3
  154. package/dist/types/src/meta.d.ts.map +1 -1
  155. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  156. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  157. package/dist/types/src/operations/index.d.ts +3 -0
  158. package/dist/types/src/operations/index.d.ts.map +1 -0
  159. package/dist/types/src/plugin.d.ts +4 -0
  160. package/dist/types/src/plugin.d.ts.map +1 -0
  161. package/dist/types/src/testing/test-functions.d.ts +204 -3
  162. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  163. package/dist/types/src/translations.d.ts +32 -26
  164. package/dist/types/src/translations.d.ts.map +1 -1
  165. package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
  166. package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
  167. package/dist/types/src/types/AutomationEvents.d.ts +3 -0
  168. package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
  169. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  170. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  171. package/dist/types/src/types/index.d.ts +3 -0
  172. package/dist/types/src/types/index.d.ts.map +1 -1
  173. package/dist/types/src/types/schema.d.ts +12 -4
  174. package/dist/types/src/types/schema.d.ts.map +1 -1
  175. package/dist/types/tsconfig.tsbuildinfo +1 -1
  176. package/package.json +138 -50
  177. package/src/AutomationPlugin.node.ts +29 -0
  178. package/src/AutomationPlugin.test.ts +27 -0
  179. package/src/AutomationPlugin.tsx +23 -34
  180. package/src/capabilities/app-graph-builder.ts +59 -79
  181. package/src/capabilities/compute-runtime.ts +325 -0
  182. package/src/capabilities/index.ts +9 -4
  183. package/src/capabilities/node.ts +13 -0
  184. package/src/capabilities/operation-handler.ts +16 -0
  185. package/src/capabilities/react-surface.tsx +49 -46
  186. package/src/commands/index.ts +5 -0
  187. package/src/commands/trigger/create/index.ts +14 -0
  188. package/src/commands/trigger/create/queue.ts +86 -0
  189. package/src/commands/trigger/create/subscription.ts +125 -0
  190. package/src/commands/trigger/create/timer.ts +90 -0
  191. package/src/commands/trigger/index.ts +16 -0
  192. package/src/commands/trigger/list.ts +70 -0
  193. package/src/commands/trigger/options.ts +59 -0
  194. package/src/commands/trigger/remove.ts +45 -0
  195. package/src/commands/trigger/update/index.ts +14 -0
  196. package/src/commands/trigger/update/queue.ts +194 -0
  197. package/src/commands/trigger/update/subscription.ts +278 -0
  198. package/src/commands/trigger/update/timer.ts +193 -0
  199. package/src/commands/trigger/util.ts +410 -0
  200. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +9 -12
  201. package/src/components/AutomationPanel/AutomationPanel.tsx +250 -82
  202. package/src/components/FunctionsPanel/FunctionsPanel.tsx +51 -32
  203. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +114 -0
  204. package/src/components/FunctionsRegistry/index.ts +8 -0
  205. package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
  206. package/src/components/TriggerEditor/SpecSelector.tsx +29 -17
  207. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +117 -32
  208. package/src/components/TriggerEditor/TriggerEditor.tsx +109 -42
  209. package/src/components/index.ts +1 -2
  210. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  211. package/src/containers/AutomationSettings/index.ts +5 -0
  212. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  213. package/src/containers/FunctionsContainer/index.ts +5 -0
  214. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  215. package/src/containers/TriggerSettings/index.ts +6 -0
  216. package/src/containers/index.ts +9 -0
  217. package/src/hooks/index.ts +9 -0
  218. package/src/hooks/useComputeRuntime.ts +30 -0
  219. package/src/hooks/useComputeRuntimeCallback.ts +32 -0
  220. package/src/hooks/useComputeRuntimeService.ts +64 -0
  221. package/src/hooks/useTriggerRuntimeControls.ts +70 -0
  222. package/src/index.ts +1 -3
  223. package/src/meta.ts +10 -8
  224. package/src/operations/create-trigger-from-template.ts +72 -0
  225. package/src/operations/index.ts +7 -0
  226. package/src/plugin.ts +11 -0
  227. package/src/testing/test-functions.ts +13 -10
  228. package/src/translations.ts +39 -29
  229. package/src/types/AutomationCapabilities.ts +48 -0
  230. package/src/types/AutomationEvents.ts +11 -0
  231. package/src/types/AutomationOperation.ts +30 -0
  232. package/src/types/index.ts +4 -0
  233. package/src/types/schema.ts +6 -6
  234. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs +0 -35
  235. package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
  236. package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
  237. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
  238. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
  239. package/dist/lib/browser/FunctionsPanel-I443Y6KB.mjs +0 -10
  240. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs +0 -80
  241. package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-4TWQV33E.mjs +0 -143
  243. package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
  245. package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
  246. package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
  247. package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
  249. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-S4SM663I.mjs +0 -230
  251. package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
  252. package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
  253. package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
  254. package/dist/lib/browser/index.mjs +0 -101
  255. package/dist/lib/browser/index.mjs.map +0 -7
  256. package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs +0 -77
  257. package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs.map +0 -7
  258. package/dist/lib/browser/meta.json +0 -1
  259. package/dist/lib/browser/react-surface-M52XGLXY.mjs +0 -64
  260. package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
  261. package/dist/lib/browser/types/index.mjs +0 -8
  262. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
  263. package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
  264. package/dist/lib/node-esm/AutomationPanel-MKOLA2FE.mjs +0 -12
  265. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
  266. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
  267. package/dist/lib/node-esm/FunctionsPanel-ELINCXPW.mjs +0 -11
  268. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs +0 -81
  269. package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-AONUBWBE.mjs +0 -144
  271. package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
  273. package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
  274. package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
  275. package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
  276. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
  277. package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
  278. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
  279. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
  280. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs +0 -231
  281. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
  282. package/dist/lib/node-esm/index.mjs +0 -102
  283. package/dist/lib/node-esm/index.mjs.map +0 -7
  284. package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs +0 -78
  285. package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs.map +0 -7
  286. package/dist/lib/node-esm/meta.json +0 -1
  287. package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs +0 -65
  288. package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs.map +0 -7
  289. package/dist/lib/node-esm/types/index.mjs +0 -9
  290. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  291. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  292. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  293. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  294. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  295. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  296. package/src/capabilities/intent-resolver.ts +0 -72
  297. package/src/components/AutomationContainer.tsx +0 -28
  298. package/src/components/FunctionsContainer.tsx +0 -29
  299. /package/dist/lib/{browser/AutomationPanel-N5HFJJXW.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
  300. /package/dist/lib/{browser/FunctionsPanel-I443Y6KB.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  301. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  302. /package/dist/lib/{node-esm/types → neutral/components}/index.mjs.map +0 -0
  303. /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → neutral/index.mjs.map} +0 -0
  304. /package/dist/lib/{node-esm/FunctionsPanel-ELINCXPW.mjs.map → neutral/meta.mjs.map} +0 -0
@@ -0,0 +1,410 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Prompt from '@effect/cli/Prompt';
6
+ import * as Ansi from '@effect/printer-ansi/Ansi';
7
+ import * as Console from 'effect/Console';
8
+ import * as Effect from 'effect/Effect';
9
+ import * as Match from 'effect/Match';
10
+ import * as Option from 'effect/Option';
11
+ import type * as Schema from 'effect/Schema';
12
+ import * as SchemaAST from 'effect/SchemaAST';
13
+
14
+ import { FormBuilder } from '@dxos/cli-util';
15
+ import { Operation, Trigger } from '@dxos/compute';
16
+ import { Annotation, Database, Entity, Feed, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
17
+ import { getProperties } from '@dxos/effect';
18
+ import { FeedAnnotation } from '@dxos/schema';
19
+
20
+ export type TriggerRemoteStatus = 'available' | 'not available' | 'n/a';
21
+
22
+ /**
23
+ * Determines the remote status of a trigger.
24
+ * Only timer/cron triggers can be checked for remote availability.
25
+ */
26
+ export const getTriggerRemoteStatus = (trigger: Trigger.Trigger, remoteCronIds: string[]): TriggerRemoteStatus => {
27
+ if (trigger.spec?.kind !== 'timer') {
28
+ return 'n/a';
29
+ }
30
+ return remoteCronIds.includes(trigger.id) ? 'available' : 'not available';
31
+ };
32
+
33
+ /**
34
+ * Pretty prints a trigger with ANSI colors.
35
+ */
36
+ export const printTrigger = Effect.fn(function* (trigger: Trigger.Trigger, remoteStatus?: TriggerRemoteStatus) {
37
+ const fn = trigger.function && (yield* Database.load(trigger.function));
38
+
39
+ return FormBuilder.make({
40
+ title: trigger.id,
41
+ }).pipe(
42
+ FormBuilder.set(
43
+ 'status',
44
+ trigger.enabled ? 'enabled' : 'disabled',
45
+ trigger.enabled ? Ansi.green : Ansi.blackBright,
46
+ ),
47
+ FormBuilder.option('kind', Option.fromNullable(trigger.spec?.kind)),
48
+ FormBuilder.option(
49
+ 'remote',
50
+ Option.fromNullable(remoteStatus),
51
+ Match.type<TriggerRemoteStatus>().pipe(
52
+ Match.withReturnType<Ansi.Ansi>(),
53
+ Match.when('available', () => Ansi.green),
54
+ Match.when('not available', () => Ansi.yellow),
55
+ Match.when('n/a', () => Ansi.blackBright),
56
+ Match.exhaustive,
57
+ ),
58
+ ),
59
+ FormBuilder.when(
60
+ fn,
61
+ FormBuilder.nest(
62
+ 'function',
63
+ FormBuilder.make().pipe(
64
+ FormBuilder.set('key', (fn as Operation.PersistentOperation).key),
65
+ FormBuilder.set('dxn', Obj.getDXN(fn as Obj.Unknown).toString()),
66
+ ),
67
+ ),
68
+ ),
69
+ FormBuilder.nestedOption('spec', Option.fromNullable(trigger.spec).pipe(Option.map(printSpec))),
70
+ FormBuilder.build,
71
+ );
72
+ });
73
+
74
+ const printSpec = <T extends Trigger.Spec>(spec: T): FormBuilder.FormBuilder => {
75
+ switch (spec.kind) {
76
+ case 'timer':
77
+ return printTimer(spec);
78
+ case 'subscription':
79
+ return printSubscription(spec);
80
+ case 'webhook':
81
+ return printWebhook(spec);
82
+ case 'queue':
83
+ return printQueue(spec);
84
+ default:
85
+ return FormBuilder.make({}).pipe(FormBuilder.set('unknown', 'Unknown spec type'));
86
+ }
87
+ };
88
+
89
+ const printTimer = (spec: Trigger.TimerSpec) => FormBuilder.make({}).pipe(FormBuilder.set('cron', spec.cron));
90
+
91
+ const printSubscription = (spec: Trigger.SubscriptionSpec) =>
92
+ FormBuilder.make({}).pipe(FormBuilder.set('query', spec.query?.raw ?? '[Query AST]'));
93
+
94
+ const printWebhook = (spec: Trigger.WebhookSpec) =>
95
+ FormBuilder.make({}).pipe(FormBuilder.set('method', spec.method), FormBuilder.set('port', spec.port));
96
+
97
+ const printQueue = (spec: Trigger.QueueSpec) => FormBuilder.make({}).pipe(FormBuilder.set('queue', spec.queue));
98
+
99
+ /**
100
+ * Prompts for input values based on an Effect schema.
101
+ * First shows a multi-select to choose which properties to specify,
102
+ * then prompts for values of the selected properties.
103
+ * Required properties are automatically included and cannot be unselected.
104
+ * @param schema - The Effect schema to prompt for
105
+ * @param defaults - Optional default values to use as initial values and pre-select optional properties
106
+ */
107
+ export const promptForSchemaInput = Effect.fn(function* (
108
+ schema: Schema.Schema.AnyNoContext | undefined,
109
+ defaults?: Record<string, any> | undefined,
110
+ ) {
111
+ if (!schema) {
112
+ return {};
113
+ }
114
+
115
+ const ast = schema.ast;
116
+
117
+ // Check if it's a struct/object type
118
+ if (!SchemaAST.isTypeLiteral(ast)) {
119
+ return {};
120
+ }
121
+
122
+ const properties = getProperties(ast);
123
+ if (properties.length === 0) {
124
+ return {};
125
+ }
126
+
127
+ // Separate required and optional properties
128
+ const requiredProperties: typeof properties = [];
129
+ const optionalProperties: typeof properties = [];
130
+
131
+ for (const prop of properties) {
132
+ if (prop.isOptional) {
133
+ optionalProperties.push(prop);
134
+ } else {
135
+ requiredProperties.push(prop);
136
+ }
137
+ }
138
+
139
+ // Build property info
140
+ const propertyInfo = properties.map((prop) => {
141
+ const key = prop.name.toString();
142
+ return {
143
+ prop,
144
+ key,
145
+ isRequired: !prop.isOptional,
146
+ };
147
+ });
148
+
149
+ // Multi-select: show all properties and let user select which optional ones to include
150
+ const selectedKeys = new Set<string>();
151
+
152
+ // Required properties are automatically selected
153
+ for (const info of propertyInfo) {
154
+ if (info.isRequired) {
155
+ selectedKeys.add(info.key);
156
+ }
157
+ }
158
+
159
+ // Show required properties that will be automatically included
160
+ if (requiredProperties.length > 0) {
161
+ const requiredNames = requiredProperties.map((p) => {
162
+ const info = propertyInfo.find((i) => i.prop === p);
163
+ return info?.key ?? p.name.toString();
164
+ });
165
+ yield* Console.log(`Required properties (will be included): ${requiredNames.join(', ')}`);
166
+ }
167
+
168
+ // For optional properties, use multi-select to choose which ones to include
169
+ if (optionalProperties.length > 0) {
170
+ const optionalInfo = propertyInfo.filter((info) => !info.isRequired);
171
+ const choices = optionalInfo.map((info) => {
172
+ const hasDefault = defaults?.[info.key] !== undefined;
173
+ const defaultText = hasDefault ? ` (current: ${JSON.stringify(defaults[info.key])})` : '';
174
+ return {
175
+ title: `${info.key}${defaultText}`,
176
+ value: info.key,
177
+ description: hasDefault ? 'Has default value' : undefined,
178
+ };
179
+ });
180
+
181
+ const selected = yield* Prompt.multiSelect({
182
+ message: 'Select optional properties to include:',
183
+ choices,
184
+ });
185
+
186
+ // Add selected optional properties to selectedKeys
187
+ for (const key of selected) {
188
+ selectedKeys.add(String(key));
189
+ }
190
+ }
191
+
192
+ // If no properties selected (shouldn't happen if there are required ones), return empty
193
+ if (selectedKeys.size === 0) {
194
+ return {};
195
+ }
196
+
197
+ // Prompt for values of selected properties
198
+ const inputObj: Record<string, any> = {};
199
+
200
+ for (const info of propertyInfo) {
201
+ if (!selectedKeys.has(info.key)) {
202
+ continue;
203
+ }
204
+
205
+ const key = info.key;
206
+ const propType = info.prop.type;
207
+ const schemaDefault = Option.getOrUndefined(SchemaAST.getDefaultAnnotation(propType));
208
+ const defaultValue = defaults?.[key] ?? schemaDefault;
209
+
210
+ if (SchemaAST.isBooleanKeyword(propType)) {
211
+ const initialValue =
212
+ typeof defaultValue === 'boolean' ? defaultValue : typeof schemaDefault === 'boolean' ? schemaDefault : false;
213
+ const value = yield* Prompt.confirm({
214
+ message: `${info.key}${defaults?.[key] !== undefined ? ` (current: ${defaults[key]})` : ''}:`,
215
+ initial: initialValue,
216
+ });
217
+ inputObj[key] = value;
218
+ } else if (SchemaAST.isNumberKeyword(propType)) {
219
+ const currentValue = typeof defaultValue === 'number' ? String(defaultValue) : '';
220
+ const valueStr = yield* Prompt.text({
221
+ message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
222
+ }).pipe(Prompt.run);
223
+ inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : parseFloat(valueStr) || 0;
224
+ } else if (SchemaAST.isStringKeyword(propType)) {
225
+ const currentValue = typeof defaultValue === 'string' ? defaultValue : '';
226
+ const valueStr = yield* Prompt.text({
227
+ message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
228
+ }).pipe(Prompt.run);
229
+ inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : valueStr;
230
+ } else if (Ref.isRefType(propType)) {
231
+ const isDefaultTemplate =
232
+ typeof defaultValue === 'string' && defaultValue.startsWith('{{') && defaultValue.endsWith('}}');
233
+ const useTemplate = yield* Prompt.confirm({
234
+ message: `Use a template to specify ${info.key}?${isDefaultTemplate ? ' (current: template)' : ''}`,
235
+ initial: isDefaultTemplate,
236
+ });
237
+ if (useTemplate) {
238
+ const currentValue = typeof defaultValue === 'string' ? defaultValue : '';
239
+ const templateStr = yield* Prompt.text({
240
+ message: `${info.key} template${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
241
+ }).pipe(Prompt.run);
242
+ inputObj[key] = templateStr === '' && defaultValue !== undefined ? defaultValue : templateStr;
243
+ } else {
244
+ const annotation = Annotation.ReferenceAnnotation.getFromAst(propType).pipe(Option.getOrThrow);
245
+ const objects = yield* Database.runQuery(Filter.typename(annotation.typename));
246
+ if (objects.length === 0) {
247
+ inputObj[key] = undefined;
248
+ } else {
249
+ const selected = yield* Prompt.select({
250
+ message: `Select ${info.key}:`,
251
+ choices: objects.map((obj: Entity.Any) => ({
252
+ title: Entity.getLabel(obj) ?? obj.id,
253
+ value: Ref.make(obj),
254
+ description: Entity.getDescription(obj),
255
+ })),
256
+ });
257
+ inputObj[key] = selected;
258
+ }
259
+ }
260
+ } else {
261
+ // For other types, prompt as string and let validation handle it
262
+ const currentValue = defaultValue !== undefined ? String(defaultValue) : '';
263
+ const valueStr = yield* Prompt.text({
264
+ message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
265
+ }).pipe(Prompt.run);
266
+ inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : valueStr;
267
+ }
268
+ }
269
+
270
+ return inputObj;
271
+ });
272
+
273
+ /**
274
+ * Selects a function interactively from available functions in the database.
275
+ * Queries the database for functions and prompts the user to select one.
276
+ */
277
+ export const selectFunction = Effect.fn(function* () {
278
+ const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
279
+
280
+ if (functions.length === 0) {
281
+ return yield* Effect.fail(new Error('No functions available'));
282
+ }
283
+
284
+ const selected = yield* Prompt.select({
285
+ message: 'Select a function:',
286
+ choices: functions.map((fn: Operation.PersistentOperation) => ({
287
+ title: fn.name ?? fn.id,
288
+ value: fn.id,
289
+ description: fn.description,
290
+ })),
291
+ });
292
+
293
+ return String(selected);
294
+ });
295
+
296
+ /**
297
+ * Selects a trigger interactively from available triggers.
298
+ * If kind is provided, filters triggers by that kind.
299
+ * Queries the database for triggers and prompts the user to select one.
300
+ */
301
+ export const selectTrigger = Effect.fn(function* (kind?: Trigger.Kind) {
302
+ const triggers = yield* Database.runQuery(
303
+ Query.select(Filter.type(Trigger.Trigger)).debugLabel('cli.trigger.selectTrigger'),
304
+ );
305
+ const filteredTriggers = kind ? triggers.filter((trigger) => trigger.spec?.kind === kind) : triggers;
306
+
307
+ if (filteredTriggers.length === 0) {
308
+ return yield* Effect.fail(new Error(kind ? `No ${kind} triggers available` : 'No triggers available'));
309
+ }
310
+
311
+ const choices = yield* Effect.all(
312
+ filteredTriggers.map((trigger) =>
313
+ Effect.gen(function* () {
314
+ const fn = trigger.function ? yield* Database.load(trigger.function) : undefined;
315
+ const functionName =
316
+ fn && Obj.instanceOf(Operation.PersistentOperation, fn) ? (fn.name ?? fn.key ?? fn.id) : undefined;
317
+ const title = functionName ?? trigger.id;
318
+ const description = `${trigger.enabled ? 'enabled' : 'disabled'} - ${trigger.spec?.kind ?? 'unknown'}`;
319
+
320
+ return {
321
+ title,
322
+ value: trigger.id,
323
+ description,
324
+ };
325
+ }),
326
+ ),
327
+ );
328
+
329
+ const selected = yield* Prompt.select({
330
+ message: kind ? `Select a ${kind} trigger:` : 'Select a trigger:',
331
+ choices,
332
+ });
333
+
334
+ return String(selected);
335
+ });
336
+
337
+ /**
338
+ * Selects a queue interactively from available queues in the database.
339
+ * Queries schemas with FeedAnnotation, then queries objects of those types,
340
+ * and extracts queue DXNs from the objects' feed properties.
341
+ */
342
+ export const selectQueue = Effect.fn(function* () {
343
+ // Query schema registry for schemas with FeedAnnotation.
344
+ const schemas = yield* Database.runSchemaQuery({ location: ['database', 'runtime'] });
345
+
346
+ // Filter schemas that have FeedAnnotation.
347
+ const feedSchemas = schemas.filter((schema) => {
348
+ const annotation = FeedAnnotation.get(schema);
349
+ return Option.isSome(annotation) && annotation.value === true;
350
+ });
351
+
352
+ if (feedSchemas.length === 0) {
353
+ return yield* Effect.fail(new Error('No schemas with Feed annotation found'));
354
+ }
355
+
356
+ // Collect all objects with queues.
357
+ const queueChoices: Array<{ title: string; value: string; description?: string }> = [];
358
+
359
+ // Process each feed schema, loading the Feed object to extract queue DXN.
360
+ for (const schema of feedSchemas) {
361
+ yield* Effect.gen(function* () {
362
+ const typename = Type.getTypename(schema);
363
+ const objects = yield* Database.runQuery(Filter.type(typename));
364
+
365
+ for (const obj of objects) {
366
+ // Access the feed property (which is a Ref<Feed>).
367
+ const feedRef = (obj as any).feed as Ref.Ref<any> | undefined;
368
+ if (!feedRef) {
369
+ continue;
370
+ }
371
+
372
+ const feedObj = yield* Effect.promise(() => feedRef.tryLoad());
373
+ if (!feedObj || !Obj.instanceOf(Feed.Feed, feedObj)) {
374
+ continue;
375
+ }
376
+
377
+ const queueDxn = Feed.getQueueDxn(feedObj);
378
+ if (!queueDxn) {
379
+ continue;
380
+ }
381
+
382
+ const label = Obj.getLabel(obj) ?? obj.id;
383
+ const description = Obj.getTypename(obj);
384
+
385
+ queueChoices.push({
386
+ title: label,
387
+ value: queueDxn.toString(),
388
+ description,
389
+ });
390
+ }
391
+ }).pipe(Effect.catchAll(() => Effect.void));
392
+ }
393
+
394
+ if (queueChoices.length === 0) {
395
+ return yield* Effect.fail(new Error('No objects with queue properties found'));
396
+ }
397
+
398
+ const selected = yield* Prompt.select({
399
+ message: 'Select a queue:',
400
+ choices: queueChoices,
401
+ });
402
+
403
+ return String(selected);
404
+ });
405
+
406
+ /**
407
+ * Pretty prints trigger removal result with ANSI colors.
408
+ */
409
+ export const printTriggerRemoved = (id: string) =>
410
+ FormBuilder.make({ title: 'Trigger removed' }).pipe(FormBuilder.set('id', id), FormBuilder.build);
@@ -2,19 +2,17 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import '@dxos-theme';
6
-
7
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
8
6
  import React from 'react';
9
7
 
8
+ import { Operation, Trigger } from '@dxos/compute';
10
9
  import { Obj } from '@dxos/echo';
11
- import { FunctionTrigger, FunctionType } from '@dxos/functions';
12
10
  import { useSpaces } from '@dxos/react-client/echo';
13
11
  import { withClientProvider } from '@dxos/react-client/testing';
14
- import { withLayout, withTheme } from '@dxos/storybook-utils';
12
+ import { withTheme } from '@dxos/react-ui/testing';
15
13
 
16
- import { functions } from '../../testing';
17
- import { translations } from '../../translations';
14
+ import { functions } from '#testing';
15
+ import { translations } from '#translations';
18
16
 
19
17
  import { AutomationPanel } from './AutomationPanel';
20
18
 
@@ -30,22 +28,21 @@ const DefaultStory = () => {
30
28
  };
31
29
 
32
30
  const meta = {
33
- title: 'plugins/plugin-automation/AutomationPanel',
31
+ title: 'plugins/plugin-automation/components/AutomationPanel',
34
32
  component: AutomationPanel as any,
35
33
  render: DefaultStory,
36
34
  decorators: [
35
+ withTheme(),
37
36
  withClientProvider({
38
37
  createIdentity: true,
39
38
  createSpace: true,
40
- types: [FunctionType, FunctionTrigger],
41
- onSpaceCreated: ({ space }) => {
39
+ types: [Operation.PersistentOperation, Trigger.Trigger],
40
+ onCreateSpace: ({ space }) => {
42
41
  for (const fn of functions) {
43
- space.db.add(Obj.make(FunctionType, fn));
42
+ space.db.add(Obj.make(Operation.PersistentOperation, { ...fn, version: fn.version ?? '0.1.0' }));
44
43
  }
45
44
  },
46
45
  }),
47
- withLayout(),
48
- withTheme,
49
46
  ],
50
47
  parameters: {
51
48
  layout: 'centered',