@dxos/plugin-automation 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878

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 (346) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/AutomationPanel-OS3ZWYJK.mjs +12 -0
  4. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  5. package/dist/lib/neutral/AutomationPlugin.node.mjs +1118 -0
  6. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  7. package/dist/lib/neutral/AutomationPlugin.workerd.mjs +23 -0
  8. package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
  9. package/dist/lib/neutral/AutomationSettings-CAFY3J7H.mjs +32 -0
  10. package/dist/lib/neutral/AutomationSettings-CAFY3J7H.mjs.map +7 -0
  11. package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.mjs +38 -0
  12. package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.mjs.map +7 -0
  13. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs +97 -0
  14. package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
  15. package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs +95 -0
  16. package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs.map +7 -0
  17. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  18. package/dist/lib/neutral/app-graph-builder-4QOUKY5L.mjs +75 -0
  19. package/dist/lib/neutral/app-graph-builder-4QOUKY5L.mjs.map +7 -0
  20. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  21. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  22. package/dist/lib/neutral/capabilities/node.mjs +15 -0
  23. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-2H6X4VQY.mjs +435 -0
  25. package/dist/lib/neutral/chunk-2H6X4VQY.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  27. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-33VXVTV4.mjs +38 -0
  29. package/dist/lib/neutral/chunk-33VXVTV4.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-ARUHHM4Q.mjs +12 -0
  31. package/dist/lib/neutral/chunk-ARUHHM4Q.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-CMM3AFHR.mjs +111 -0
  33. package/dist/lib/neutral/chunk-CMM3AFHR.mjs.map +7 -0
  34. package/dist/lib/neutral/chunk-EBSOLOP6.mjs +8 -0
  35. package/dist/lib/neutral/chunk-EBSOLOP6.mjs.map +7 -0
  36. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  37. package/dist/lib/neutral/chunk-KV7RZLFS.mjs +344 -0
  38. package/dist/lib/neutral/chunk-KV7RZLFS.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-QLBA6Y46.mjs +39 -0
  40. package/dist/lib/neutral/chunk-QLBA6Y46.mjs.map +7 -0
  41. package/dist/lib/neutral/chunk-XC5EPVE3.mjs +76 -0
  42. package/dist/lib/neutral/chunk-XC5EPVE3.mjs.map +7 -0
  43. package/dist/lib/neutral/components/index.mjs +16 -0
  44. package/dist/lib/neutral/containers/index.mjs +13 -0
  45. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  46. package/dist/lib/neutral/create-trigger-from-template-IOQZDDSH.mjs +68 -0
  47. package/dist/lib/neutral/create-trigger-from-template-IOQZDDSH.mjs.map +7 -0
  48. package/dist/lib/neutral/hooks/index.mjs +10 -0
  49. package/dist/lib/neutral/index.mjs +16 -0
  50. package/dist/lib/neutral/layer-specs-B22CIT3U.mjs +160 -0
  51. package/dist/lib/neutral/layer-specs-B22CIT3U.mjs.map +7 -0
  52. package/dist/lib/neutral/meta.json +1 -0
  53. package/dist/lib/neutral/meta.mjs +8 -0
  54. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  55. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  56. package/dist/lib/neutral/operations/index.mjs +8 -0
  57. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  58. package/dist/lib/neutral/plugin.mjs +16 -0
  59. package/dist/lib/neutral/plugin.mjs.map +7 -0
  60. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  61. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  62. package/dist/lib/neutral/testing.mjs +8 -0
  63. package/dist/lib/neutral/testing.mjs.map +7 -0
  64. package/dist/lib/neutral/translations.mjs +60 -0
  65. package/dist/lib/neutral/translations.mjs.map +7 -0
  66. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
  67. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
  68. package/dist/lib/neutral/types/index.mjs +12 -0
  69. package/dist/lib/neutral/types/index.mjs.map +7 -0
  70. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  71. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  72. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  73. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  74. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  75. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  76. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  77. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  78. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  79. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  80. package/dist/types/src/capabilities/index.d.ts +7 -5
  81. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  82. package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
  83. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/node.d.ts +7 -0
  85. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  86. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  87. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  88. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  89. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  90. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
  91. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
  92. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
  93. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
  94. package/dist/types/src/commands/index.d.ts +2 -0
  95. package/dist/types/src/commands/index.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  97. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  98. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  99. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  101. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  103. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  104. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  105. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  106. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  107. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  108. package/dist/types/src/commands/trigger/options.d.ts +10 -0
  109. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  110. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  111. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  112. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  113. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  114. package/dist/types/src/commands/trigger/update/queue.d.ts +11 -0
  115. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  116. package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
  117. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  118. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  119. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  120. package/dist/types/src/commands/trigger/util.d.ts +85 -0
  121. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  122. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +5 -6
  123. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  124. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -30
  125. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  126. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts +18 -0
  127. package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts.map +1 -0
  128. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  131. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  132. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  133. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  134. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  135. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  136. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  137. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  138. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +8 -7
  139. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  140. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +118 -32
  141. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  142. package/dist/types/src/components/index.d.ts +3 -4
  143. package/dist/types/src/components/index.d.ts.map +1 -1
  144. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  145. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  146. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  147. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  148. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  149. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  150. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  151. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  152. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  153. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  154. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  155. package/dist/types/src/containers/index.d.ts +5 -0
  156. package/dist/types/src/containers/index.d.ts.map +1 -0
  157. package/dist/types/src/hooks/index.d.ts +1 -1
  158. package/dist/types/src/hooks/index.d.ts.map +1 -1
  159. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts +13 -0
  160. package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts.map +1 -0
  161. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +5 -4
  162. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  163. package/dist/types/src/index.d.ts +1 -5
  164. package/dist/types/src/index.d.ts.map +1 -1
  165. package/dist/types/src/meta.d.ts +2 -2
  166. package/dist/types/src/meta.d.ts.map +1 -1
  167. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  168. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  169. package/dist/types/src/operations/index.d.ts +3 -0
  170. package/dist/types/src/operations/index.d.ts.map +1 -0
  171. package/dist/types/src/plugin.d.ts +4 -0
  172. package/dist/types/src/plugin.d.ts.map +1 -0
  173. package/dist/types/src/testing/test-functions.d.ts +204 -3
  174. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  175. package/dist/types/src/testing.d.ts +2 -0
  176. package/dist/types/src/testing.d.ts.map +1 -0
  177. package/dist/types/src/translations.d.ts +45 -31
  178. package/dist/types/src/translations.d.ts.map +1 -1
  179. package/dist/types/src/types/AutomationOperation.d.ts +21 -0
  180. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  181. package/dist/types/src/types/index.d.ts +1 -0
  182. package/dist/types/src/types/index.d.ts.map +1 -1
  183. package/dist/types/src/types/schema.d.ts +13 -5
  184. package/dist/types/src/types/schema.d.ts.map +1 -1
  185. package/dist/types/tsconfig.tsbuildinfo +1 -1
  186. package/package.json +145 -70
  187. package/src/AutomationPlugin.node.ts +32 -0
  188. package/src/AutomationPlugin.test.ts +27 -0
  189. package/src/AutomationPlugin.tsx +24 -38
  190. package/src/AutomationPlugin.workerd.ts +18 -0
  191. package/src/capabilities/app-graph-builder.ts +59 -80
  192. package/src/capabilities/index.ts +13 -7
  193. package/src/capabilities/layer-specs.ts +230 -0
  194. package/src/capabilities/node.ts +17 -0
  195. package/src/capabilities/operation-handler.ts +16 -0
  196. package/src/capabilities/react-surface.tsx +49 -46
  197. package/src/capabilities/trigger-runtime-controller.test.ts +103 -0
  198. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  199. package/src/commands/index.ts +5 -0
  200. package/src/commands/trigger/create/index.ts +14 -0
  201. package/src/commands/trigger/create/queue.ts +87 -0
  202. package/src/commands/trigger/create/subscription.ts +125 -0
  203. package/src/commands/trigger/create/timer.ts +90 -0
  204. package/src/commands/trigger/index.ts +16 -0
  205. package/src/commands/trigger/list.ts +70 -0
  206. package/src/commands/trigger/options.ts +47 -0
  207. package/src/commands/trigger/remove.ts +45 -0
  208. package/src/commands/trigger/update/index.ts +14 -0
  209. package/src/commands/trigger/update/queue.ts +191 -0
  210. package/src/commands/trigger/update/subscription.ts +279 -0
  211. package/src/commands/trigger/update/timer.ts +195 -0
  212. package/src/commands/trigger/util.ts +410 -0
  213. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +15 -8
  214. package/src/components/AutomationPanel/AutomationPanel.tsx +245 -86
  215. package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
  216. package/src/components/FunctionsPanel/FunctionsPanel.tsx +43 -42
  217. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +38 -54
  218. package/src/components/FunctionsRegistry/index.ts +4 -1
  219. package/src/components/TriggerEditor/FunctionInputEditor.tsx +36 -35
  220. package/src/components/TriggerEditor/SpecSelector.tsx +26 -20
  221. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +92 -39
  222. package/src/components/TriggerEditor/TriggerEditor.tsx +171 -54
  223. package/src/components/index.ts +1 -2
  224. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  225. package/src/containers/AutomationSettings/index.ts +5 -0
  226. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  227. package/src/containers/FunctionsContainer/index.ts +5 -0
  228. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  229. package/src/containers/TriggerSettings/index.ts +6 -0
  230. package/src/containers/index.ts +9 -0
  231. package/src/hooks/index.ts +2 -1
  232. package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
  233. package/src/hooks/useTriggerRuntimeControls.ts +38 -19
  234. package/src/index.ts +1 -6
  235. package/src/meta.ts +25 -6
  236. package/src/operations/create-trigger-from-template.ts +70 -0
  237. package/src/operations/index.ts +7 -0
  238. package/src/plugin.ts +11 -0
  239. package/src/testing/test-functions.ts +12 -9
  240. package/src/testing.ts +7 -0
  241. package/src/translations.ts +53 -36
  242. package/src/types/AutomationOperation.ts +39 -0
  243. package/src/types/index.ts +2 -0
  244. package/src/types/schema.ts +6 -6
  245. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  246. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  247. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  248. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  249. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  250. package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
  251. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  252. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  253. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  254. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  255. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  256. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  257. package/dist/lib/browser/chunk-LZQFZO3B.mjs +0 -17
  258. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  259. package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
  260. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  261. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  262. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  263. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  264. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  265. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  266. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  267. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  268. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  269. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  270. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  271. package/dist/lib/browser/hooks/index.mjs +0 -13
  272. package/dist/lib/browser/index.mjs +0 -130
  273. package/dist/lib/browser/index.mjs.map +0 -7
  274. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  275. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  276. package/dist/lib/browser/meta.json +0 -1
  277. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  278. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  279. package/dist/lib/browser/types/index.mjs +0 -8
  280. package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
  281. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  282. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  283. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  284. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  285. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
  286. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  287. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  288. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  289. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  290. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
  291. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  292. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  293. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  294. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  295. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  296. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  297. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  298. package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
  299. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  300. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  301. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  302. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  303. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  304. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  305. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  306. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  307. package/dist/lib/node-esm/index.mjs +0 -131
  308. package/dist/lib/node-esm/index.mjs.map +0 -7
  309. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  310. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  311. package/dist/lib/node-esm/meta.json +0 -1
  312. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  313. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  314. package/dist/lib/node-esm/types/index.mjs +0 -9
  315. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  316. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  317. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  318. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  319. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  320. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  321. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  322. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  323. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  324. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  325. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  326. package/dist/types/src/events.d.ts +0 -4
  327. package/dist/types/src/events.d.ts.map +0 -1
  328. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  329. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  330. package/src/capabilities/capabilities.ts +0 -41
  331. package/src/capabilities/compute-runtime.ts +0 -127
  332. package/src/capabilities/intent-resolver.ts +0 -72
  333. package/src/components/AutomationSettings.tsx +0 -30
  334. package/src/components/FunctionsContainer.tsx +0 -36
  335. package/src/components/TriggerSettings.tsx +0 -25
  336. package/src/events.ts +0 -11
  337. package/src/hooks/useComputeRuntimeCallback.ts +0 -68
  338. /package/dist/lib/{browser/AutomationPanel-7OECLR5N.mjs.map → neutral/AutomationPanel-OS3ZWYJK.mjs.map} +0 -0
  339. /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  340. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  341. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  342. /package/dist/lib/{node-esm/hooks → neutral/components}/index.mjs.map +0 -0
  343. /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
  344. /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → neutral/index.mjs.map} +0 -0
  345. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/meta.mjs.map} +0 -0
  346. /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
@@ -4,48 +4,49 @@
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
 
9
+ import { Operation, Trigger } from '@dxos/compute';
8
10
  import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
9
- import { Function } from '@dxos/functions';
10
- import { Trigger } from '@dxos/functions';
11
11
  import { invariant } from '@dxos/invariant';
12
- import { faker } from '@dxos/random';
12
+ import { random } from '@dxos/random';
13
13
  import { useQuery } from '@dxos/react-client/echo';
14
- import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
14
+ import { TestSchema, useClientStory, withClientProvider } from '@dxos/react-client/testing';
15
15
  import { useAsyncEffect } from '@dxos/react-ui';
16
+ import { translations as formTranslations } from '@dxos/react-ui-form/translations';
16
17
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
17
- import { Employer, Organization, Person, Project } from '@dxos/types';
18
+ import { Employer, Organization, Person, Pipeline } from '@dxos/types';
18
19
 
19
- import { functions } from '../../testing';
20
- import { translations } from '../../translations';
20
+ import { functions } from '#testing';
21
+ import { translations } from '#translations';
21
22
 
22
23
  import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
23
24
 
24
25
  const types = [
25
26
  // TODO(burdon): Get label from annotation.
26
- { value: Organization.Organization.typename, label: 'Organization' },
27
- { value: Person.Person.typename, label: 'Person' },
28
- { value: Type.getTypename(Project.Project), label: 'Project' },
29
- { value: Employer.Employer.typename, label: 'Employer' },
27
+ { value: Type.getTypename(Organization.Organization), label: 'Organization' },
28
+ { value: Type.getTypename(Person.Person), label: 'Person' },
29
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
30
+ { value: Type.getTypename(Employer.Employer), label: 'Employer' },
30
31
  ];
31
32
 
32
33
  const DefaultStory = (props: Partial<TriggerEditorProps>) => {
33
- const { space } = useClientProvider();
34
+ const { space } = useClientStory();
34
35
  const [trigger, setTrigger] = useState<Trigger.Trigger>();
35
- const tags = useQuery(space, Filter.type(Tag.Tag));
36
+ const tags = useQuery(space?.db, Filter.type(Tag.Tag));
36
37
 
37
38
  useAsyncEffect(async () => {
38
39
  if (!space) {
39
40
  return;
40
41
  }
41
42
 
42
- const result = await space.db.query(Filter.type(Function.Function)).run();
43
- const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
43
+ const functions = await space.db.query(Filter.type(Operation.PersistentOperation)).run();
44
+ const fn = functions.find((fn) => fn.name === 'com.example.function.forex');
44
45
  invariant(fn);
45
46
  const trigger = space.db.add(
46
47
  Trigger.make({
47
48
  function: Ref.make(fn),
48
- spec: { kind: 'webhook' },
49
+ spec: Trigger.specWebhook(),
49
50
  input: {
50
51
  from: 'USD',
51
52
  to: 'JPY',
@@ -60,42 +61,50 @@ const DefaultStory = (props: Partial<TriggerEditorProps>) => {
60
61
  }
61
62
 
62
63
  return (
63
- <div role='none' className='is-[32rem] bs-fit border border-separator rounded-sm'>
64
- <TriggerEditor
65
- space={space}
66
- trigger={trigger}
67
- types={types}
68
- tags={tags}
69
- onSave={(values) => console.log('on save', values)}
70
- {...props}
71
- />
72
- </div>
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
+ />
73
72
  );
74
73
  };
75
74
 
76
75
  const meta = {
77
- title: 'plugins/plugin-automation/TriggerEditor',
76
+ title: 'plugins/plugin-automation/components/TriggerEditor',
78
77
  component: TriggerEditor as any,
79
78
  render: DefaultStory,
80
79
  decorators: [
81
- withTheme,
82
- withLayout({ container: 'column' }),
80
+ withTheme(),
81
+ withLayout({ layout: 'column' }),
83
82
  withClientProvider({
84
83
  createIdentity: true,
85
84
  createSpace: true,
86
- types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
85
+ types: [Tag.Tag, Operation.PersistentOperation, Trigger.Trigger, TestSchema.ContactType],
87
86
  onCreateSpace: ({ space }) => {
88
- space.db.add(Tag.make({ label: 'Important' }));
89
- space.db.add(Tag.make({ label: 'Investor' }));
90
- space.db.add(Tag.make({ label: 'New' }));
87
+ // Tags.
88
+ ['Important', 'Investor', 'New'].forEach((label) => {
89
+ space.db.add(Tag.make({ label }));
90
+ });
91
+
92
+ // Functions.
93
+ functions.forEach((fn) => {
94
+ const { key, version, ...data } = fn;
95
+ space.db.add(
96
+ Obj.make(Operation.PersistentOperation, {
97
+ [Obj.Meta]: { key, version: version ?? '0.1.0' },
98
+ ...data,
99
+ }),
100
+ );
101
+ });
91
102
 
92
- for (const fn of functions) {
93
- space.db.add(Function.make(fn));
94
- }
103
+ // Objects.
95
104
  Array.from({ length: 10 }).map(() => {
96
105
  return space.db.add(
97
- Obj.make(ContactType, {
98
- name: faker.person.fullName(),
106
+ Obj.make(TestSchema.ContactType, {
107
+ name: random.person.fullName(),
99
108
  identifiers: [],
100
109
  }),
101
110
  );
@@ -104,7 +113,8 @@ const meta = {
104
113
  }),
105
114
  ],
106
115
  parameters: {
107
- translations,
116
+ layout: 'fullscreen',
117
+ translations: [...formTranslations, ...translations],
108
118
  },
109
119
  } satisfies Meta<typeof DefaultStory>;
110
120
 
@@ -119,3 +129,46 @@ export const ReadonlySpec: Story = {
119
129
  readonlySpec: true,
120
130
  },
121
131
  };
132
+
133
+ export const Spec: Story = {
134
+ play: async ({ canvasElement }) => {
135
+ const canvas = within(canvasElement);
136
+ const webhookText = await canvas.findByText('Webhook', {}, { timeout: 10_000 });
137
+ const combobox = webhookText.closest('[role="combobox"]') as HTMLElement;
138
+ await expect(combobox).not.toBeDisabled();
139
+
140
+ // Helper to switch to a kind via keyboard.
141
+ // TODO(wittjosiah): Radix Select in popper mode doesn't close on click.
142
+ // Use keyboard navigation: open, type first letter to jump, Enter to select.
143
+ const selectKind = async (combobox: HTMLElement, firstLetter: string) => {
144
+ combobox.focus();
145
+ await userEvent.keyboard('{Enter}');
146
+ await userEvent.keyboard(firstLetter);
147
+ await userEvent.keyboard('{Enter}');
148
+ };
149
+
150
+ // Timer — should show "Cron" field.
151
+ await selectKind(combobox, 't');
152
+ await expect(canvas.findByLabelText('Cron')).resolves.toBeInTheDocument();
153
+
154
+ // Email — no extra fields; Cron should be gone.
155
+ await selectKind(combobox, 'e');
156
+ await expect(combobox).not.toBeDisabled();
157
+ await expect(canvas.queryByLabelText('Cron')).not.toBeInTheDocument();
158
+
159
+ // Webhook — should show "Method" field.
160
+ await selectKind(combobox, 'w');
161
+ await expect(canvas.findByLabelText('Method')).resolves.toBeInTheDocument();
162
+
163
+ // Subscription — should show query editor.
164
+ await selectKind(combobox, 's');
165
+ await expect(combobox).not.toBeDisabled();
166
+ await expect(canvas.queryByLabelText('Method')).not.toBeInTheDocument();
167
+
168
+ // Feed — should show the Feed selector field (a Ref(Feed) combobox). The combobox
169
+ // isn't associated with its label, so match the field's <label> element directly.
170
+ await selectKind(combobox, 'f');
171
+ await expect(combobox).not.toBeDisabled();
172
+ await expect(await canvas.findByText('Feed', { selector: 'label' })).toBeInTheDocument();
173
+ },
174
+ };
@@ -2,85 +2,114 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Option from 'effect/Option';
6
+ import * as Record from 'effect/Record';
5
7
  import React, { useCallback, useMemo } from 'react';
6
8
 
9
+ import { Operation, Script, Trigger } from '@dxos/compute';
7
10
  import { ComputeGraph } from '@dxos/conductor';
8
- import { type Query, Type } from '@dxos/echo';
9
- import { Function, Script, Trigger } from '@dxos/functions';
10
- import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
11
+ import { Annotation, type Database, Entity, Feed, Filter, Obj, type Query, Ref, Type } from '@dxos/echo';
12
+ import { EchoURI } from '@dxos/keys';
13
+ import { useQuery } from '@dxos/react-client/echo';
11
14
  import { Input } from '@dxos/react-ui';
12
15
  import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
13
- import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
14
-
15
- import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
16
+ import {
17
+ type ExcludeId,
18
+ Form,
19
+ FormFieldLabel,
20
+ type FormFieldMap,
21
+ type FormRootProps,
22
+ SelectField,
23
+ omitId,
24
+ } from '@dxos/react-ui-form';
25
+
26
+ import { FunctionInputEditor } from './FunctionInputEditor';
16
27
  import { SpecSelector } from './SpecSelector';
17
28
 
29
+ type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
30
+
18
31
  export type TriggerEditorProps = {
19
- space: Space;
32
+ db: Database.Database;
20
33
  trigger: Trigger.Trigger;
21
34
  // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
22
35
  readonlySpec?: boolean;
23
- onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;
24
- onCancel?: () => void;
25
- } & Pick<QueryFormProps, 'types' | 'tags'>;
26
-
27
- export const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {
28
- const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {
29
- onSave?.(values);
30
- };
36
+ } &
37
+ // prettier-ignore
38
+ Pick<QueryFormProps, 'types' | 'tags'> &
39
+ Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
40
+
41
+ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
42
+ const fieldMap = useCustomInputs({ db, types, tags, readonlySpec });
43
+
44
+ const handleValuesChanged = useCallback(
45
+ (newValues: Partial<TriggerFormSchema>) => {
46
+ Obj.update(trigger, (trigger) => {
47
+ Object.assign(trigger, newValues);
48
+ });
49
+ },
50
+ [trigger],
51
+ );
31
52
 
32
- const handleRefQueryLookup = useRefQueryLookupHandler({ space });
33
- const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
53
+ const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
54
+ const defaultValues = useMemo(() => {
55
+ const { id: _, ...values } = trigger;
56
+ return values;
57
+ }, [trigger]);
34
58
 
35
59
  return (
36
- <Form
37
- outerSpacing={false}
38
- Custom={Custom}
39
- schema={Trigger.Trigger}
40
- values={trigger}
41
- onSave={handleSave}
42
- onCancel={onCancel}
43
- onQueryRefOptions={handleRefQueryLookup}
44
- />
60
+ <Form.Root<TriggerFormSchema>
61
+ {...formProps}
62
+ db={db}
63
+ schema={triggerSchema}
64
+ defaultValues={defaultValues}
65
+ fieldMap={fieldMap}
66
+ onValuesChanged={handleValuesChanged}
67
+ >
68
+ <Form.Viewport>
69
+ <Form.Content>
70
+ <Form.FieldSet />
71
+ <Form.Actions />
72
+ </Form.Content>
73
+ </Form.Viewport>
74
+ </Form.Root>
45
75
  );
46
76
  };
47
77
 
48
78
  type UseCustomInputsProps = {
49
- space: Space;
79
+ db: Database.Database;
50
80
  readonlySpec?: boolean;
51
- onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
52
81
  } & Pick<QueryFormProps, 'types' | 'tags'>;
53
82
 
54
- const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {
55
- const functions = useQuery(space, Filter.type(Function.Function));
56
- const workflows = useQuery(space, Filter.type(ComputeGraph));
57
- const scripts = useQuery(space, Filter.type(Script.Script));
83
+ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
84
+ const functions = useQuery(db, Filter.type(Operation.PersistentOperation));
85
+ const workflows = useQuery(db, Filter.type(ComputeGraph));
86
+ const scripts = useQuery(db, Filter.type(Script.Script));
87
+ const feeds = useQuery(db, Filter.type(Feed.Feed));
58
88
 
59
89
  return useMemo(
60
- (): CustomInputMap => ({
90
+ (): FormFieldMap => ({
61
91
  // Function selector.
62
92
  ['function' satisfies keyof Trigger.Trigger]: (props) => {
63
93
  const getValue = useCallback(() => {
64
94
  const formValue = props.getValue();
65
95
  if (Ref.isRef(formValue)) {
66
- return formValue.dxn.toString() as string;
96
+ return formValue.uri;
67
97
  }
68
98
  return undefined;
69
99
  }, [props]);
70
100
 
71
101
  const handleOnValueChange = useCallback(
72
- (_type: any, dxnString: string) => {
73
- const dxn = Type.DXN.parse(dxnString);
74
- if (dxn) {
75
- const ref = Ref.fromDXN(dxn);
76
- props.onValueChange('object', ref);
102
+ (_type: any, uriString: string) => {
103
+ const uri = EchoURI.tryParse(uriString);
104
+ if (uri) {
105
+ props.onValueChange(props.type, Ref.fromURI(uri));
77
106
  }
78
107
  },
79
- [props.onValueChange],
108
+ [props.type, props.onValueChange],
80
109
  );
81
110
 
82
111
  return (
83
- <SelectInput
112
+ <SelectField
84
113
  {...props}
85
114
  getValue={getValue as any}
86
115
  onValueChange={handleOnValueChange}
@@ -90,38 +119,126 @@ const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }
90
119
  },
91
120
 
92
121
  // Spec selector.
93
- ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
122
+ 'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
123
+
124
+ // Feed selector with parent labels.
125
+ 'spec.feed': (props) => {
126
+ const getValue = useCallback(() => {
127
+ const formValue = props.getValue();
128
+ if (Ref.isRef(formValue)) {
129
+ return formValue.uri.toString() as string;
130
+ }
131
+ return undefined;
132
+ }, [props]);
133
+
134
+ const handleOnValueChange = useCallback(
135
+ (_type: any, dxnString: string) => {
136
+ const uri = EchoURI.tryParse(dxnString);
137
+ if (uri) {
138
+ props.onValueChange(props.type, Ref.fromURI(uri));
139
+ }
140
+ },
141
+ [props.type, props.onValueChange],
142
+ );
143
+
144
+ return (
145
+ <SelectField
146
+ {...props}
147
+ getValue={getValue as any}
148
+ onValueChange={handleOnValueChange}
149
+ options={getFeedOptions(feeds)}
150
+ />
151
+ );
152
+ },
94
153
 
95
154
  // TODO(wittjosiah): Copied from ViewEditor.
96
155
  // Query input editor.
97
- ['spec.query' as const]: (props) => {
156
+ 'spec.query': (props) => {
98
157
  const handleChange = useCallback(
99
- (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
100
- [props.onValueChange],
158
+ (query: Query.Any) => props.onValueChange(props.type, { ast: query.ast }),
159
+ [props.type, props.onValueChange],
101
160
  );
102
161
 
103
162
  return (
104
163
  <Input.Root>
105
- <InputHeader label={props.label} />
164
+ <FormFieldLabel label={props.label} asChild />
106
165
  <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
107
166
  </Input.Root>
108
167
  );
109
168
  },
110
169
 
111
170
  // Function input editor.
112
- ['input' as const]: (props) => (
113
- <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
114
- ),
171
+ input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
115
172
  }),
116
- [workflows, scripts, functions, readonlySpec],
173
+ [workflows, scripts, functions, feeds, readonlySpec],
117
174
  );
118
175
  };
119
176
 
177
+ const getObjectIconProps = (object: Entity.Unknown): { icon?: string; iconHue?: string } => {
178
+ const type = Entity.getType(object);
179
+ const schema = type ? Type.getSchema(type) : undefined;
180
+ const annotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : undefined;
181
+ return annotation ? { icon: annotation.icon, iconHue: annotation.hue } : {};
182
+ };
183
+
120
184
  const getWorkflowOptions = (graphs: ComputeGraph[]) => {
121
- return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
185
+ return graphs.map((graph) => ({
186
+ label: `compute-${graph.id}`,
187
+ value: Obj.getURI(graph),
188
+ ...getObjectIconProps(graph),
189
+ }));
190
+ };
191
+
192
+ const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
193
+ const getLabel = (fn: Operation.PersistentOperation) =>
194
+ scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
195
+ return functions.map((fn) => {
196
+ const { icon: schemaIcon, iconHue } = getObjectIconProps(fn);
197
+ return {
198
+ label: getLabel(fn),
199
+ value: Obj.getURI(fn),
200
+ icon: fn.icon ?? schemaIcon,
201
+ iconHue,
202
+ };
203
+ });
204
+ };
205
+
206
+ const getFeedDisplayName = (feed: Feed.Feed): string =>
207
+ Entity.getLabel(feed) ?? feed.name ?? Entity.getTypename(feed) ?? 'Feed';
208
+
209
+ const computeRefRole = (entity: Feed.Feed): string | undefined => {
210
+ const parent = Obj.getParent(entity);
211
+ if (!parent) {
212
+ return undefined;
213
+ }
214
+ for (const key of Record.keys(parent)) {
215
+ if (Ref.isRef(parent[key]) && parent[key].target?.id === entity.id) {
216
+ return `$.${key}`;
217
+ }
218
+ }
219
+ return undefined;
122
220
  };
123
221
 
124
- const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
125
- const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
126
- return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
222
+ const getFeedOptions = (feeds: Feed.Feed[]) => {
223
+ return feeds.map((feed) => {
224
+ const parent = Obj.getParent(feed);
225
+ const displayObject = parent ?? feed;
226
+ const role = computeRefRole(feed);
227
+
228
+ if (parent) {
229
+ return {
230
+ label: Entity.getLabel(parent) ?? Entity.getTypename(parent) ?? 'Parent',
231
+ secondaryLabel: role ?? getFeedDisplayName(feed),
232
+ value: Obj.getURI(feed),
233
+ ...getObjectIconProps(displayObject),
234
+ };
235
+ }
236
+
237
+ return {
238
+ label: getFeedDisplayName(feed),
239
+ secondaryLabel: role,
240
+ value: Obj.getURI(feed),
241
+ ...getObjectIconProps(displayObject),
242
+ };
243
+ });
127
244
  };
@@ -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'));
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
14
+ import { TriggersSettings } from '../TriggerSettings';
15
+
16
+ export type AutomationSettingsProps = AppSurface.SpaceArticleProps<Omit<AutomationPanelProps, 'space'>>;
17
+
18
+ export const AutomationSettings = (props: AutomationSettingsProps) => {
19
+ const { t } = useTranslation(meta.id);
20
+ return (
21
+ <Settings.Viewport>
22
+ <Settings.Section
23
+ title={t('automation-verbose.label', { ns: meta.id })}
24
+ description={t('automation.description', { ns: meta.id })}
25
+ >
26
+ <AutomationPanel {...props} />
27
+ <TriggersSettings space={props.space} />
28
+ </Settings.Section>
29
+ </Settings.Viewport>
30
+ );
31
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { AutomationSettings as default } from './AutomationSettings';
@@ -0,0 +1,33 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { useTranslation } from '@dxos/react-ui';
9
+ import { Settings } from '@dxos/react-ui-form';
10
+
11
+ import { meta } from '#meta';
12
+
13
+ import { FunctionsPanel, FunctionsRegistry } from '../../components';
14
+
15
+ export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
16
+ const { t } = useTranslation(meta.id);
17
+ return (
18
+ <Settings.Viewport>
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.Viewport>
32
+ );
33
+ };
@@ -0,0 +1,5 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { FunctionsContainer as default } from './FunctionsContainer';
@@ -0,0 +1,48 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type ComputeEnvironment } from '@dxos/client-protocol';
8
+ import { useObject } from '@dxos/echo-react';
9
+ import { type Space } from '@dxos/react-client/echo';
10
+ import { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';
11
+ import { Settings } from '@dxos/react-ui-form';
12
+
13
+ import { meta } from '#meta';
14
+
15
+ export const TriggersSettings = ({ space }: { space: Space }) => {
16
+ const { t } = useTranslation(meta.id);
17
+ const [properties, changeProperties] = useObject(space.properties);
18
+ const selected = properties.computeEnvironment ?? 'local';
19
+
20
+ const handleUpdate = (option: ComputeEnvironment) => {
21
+ changeProperties((draft) => {
22
+ draft.computeEnvironment = option;
23
+ });
24
+ };
25
+
26
+ return (
27
+ <div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
28
+ <Settings.Item title={t('runtime.label')} description={t('runtime.description')}>
29
+ <DropdownMenu.Root>
30
+ <DropdownMenu.Trigger asChild>
31
+ <IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />
32
+ </DropdownMenu.Trigger>
33
+ <DropdownMenu.Portal>
34
+ <DropdownMenu.Content side='bottom'>
35
+ <DropdownMenu.Viewport>
36
+ <DropdownMenu.Item onClick={() => handleUpdate('disabled')}>
37
+ {t(`runtime.disabled.label`)}
38
+ </DropdownMenu.Item>
39
+ <DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>
40
+ <DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>
41
+ </DropdownMenu.Viewport>
42
+ </DropdownMenu.Content>
43
+ </DropdownMenu.Portal>
44
+ </DropdownMenu.Root>
45
+ </Settings.Item>
46
+ </div>
47
+ );
48
+ };
@@ -0,0 +1,6 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ export { TriggersSettings } from './TriggerSettings';
6
+ export { TriggersSettings as default } from './TriggerSettings';
@@ -0,0 +1,9 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
8
+ export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
9
+ export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
@@ -2,5 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './useComputeRuntimeCallback';
5
+ // TODO(wittjosiah): Factor out.
6
+ export * from './useEdgeTriggersDispatcherStatus';
6
7
  export * from './useTriggerRuntimeControls';