@dxos/plugin-automation 0.8.4-main.fffef41 → 0.8.4-staging.60fe92afc8

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 (407) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +428 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/AutomationArticle-GN36NUX2.mjs +17 -0
  5. package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs +165 -0
  6. package/dist/lib/neutral/AutomationCompanion-M26WR6VP.mjs.map +7 -0
  7. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  8. package/dist/lib/neutral/AutomationPlugin.node.mjs +1132 -0
  9. package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
  10. package/dist/lib/neutral/AutomationPlugin.workerd.mjs +36 -0
  11. package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
  12. package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs +27 -0
  13. package/dist/lib/neutral/AutomationSettings-YXUJDRQA.mjs.map +7 -0
  14. package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
  15. package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs +102 -0
  16. package/dist/lib/neutral/app-graph-builder-BTTHS4VK.mjs.map +7 -0
  17. package/dist/lib/neutral/capabilities/index.mjs +25 -0
  18. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  19. package/dist/lib/neutral/capabilities/node.mjs +19 -0
  20. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-24JKY6NU.mjs +21 -0
  22. package/dist/lib/neutral/chunk-24JKY6NU.mjs.map +7 -0
  23. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  24. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-DUGOIM7G.mjs +36 -0
  26. package/dist/lib/neutral/chunk-DUGOIM7G.mjs.map +7 -0
  27. package/dist/lib/neutral/chunk-FE7YFBX7.mjs +486 -0
  28. package/dist/lib/neutral/chunk-FE7YFBX7.mjs.map +7 -0
  29. package/dist/lib/neutral/chunk-GARB7S5R.mjs +157 -0
  30. package/dist/lib/neutral/chunk-GARB7S5R.mjs.map +7 -0
  31. package/dist/lib/neutral/chunk-HPUHQ3L6.mjs +64 -0
  32. package/dist/lib/neutral/chunk-HPUHQ3L6.mjs.map +7 -0
  33. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  34. package/dist/lib/neutral/chunk-SONGOJRB.mjs +8 -0
  35. package/dist/lib/neutral/chunk-SONGOJRB.mjs.map +7 -0
  36. package/dist/lib/neutral/components/index.mjs +48 -0
  37. package/dist/lib/neutral/components/index.mjs.map +7 -0
  38. package/dist/lib/neutral/containers/index.mjs +15 -0
  39. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  40. package/dist/lib/neutral/create-automation-OE3TNXYE.mjs +41 -0
  41. package/dist/lib/neutral/create-automation-OE3TNXYE.mjs.map +7 -0
  42. package/dist/lib/neutral/create-object-MEJOWGMH.mjs +25 -0
  43. package/dist/lib/neutral/create-object-MEJOWGMH.mjs.map +7 -0
  44. package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs +68 -0
  45. package/dist/lib/neutral/create-trigger-from-template-TERHKWJM.mjs.map +7 -0
  46. package/dist/lib/neutral/hooks/index.mjs +47 -0
  47. package/dist/lib/neutral/hooks/index.mjs.map +7 -0
  48. package/dist/lib/neutral/index.mjs +22 -0
  49. package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs +137 -0
  50. package/dist/lib/neutral/layer-specs-G6GCH7BE.mjs.map +7 -0
  51. package/dist/lib/neutral/meta.json +1 -0
  52. package/dist/lib/neutral/meta.mjs +8 -0
  53. package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs +14 -0
  54. package/dist/lib/neutral/navigation-resolver-I3L5FHJO.mjs.map +7 -0
  55. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
  56. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  57. package/dist/lib/neutral/operations/index.mjs +8 -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-IBRWUKPC.mjs +54 -0
  61. package/dist/lib/neutral/react-surface-IBRWUKPC.mjs.map +7 -0
  62. package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs +86 -0
  63. package/dist/lib/neutral/registry-sync-G6TKKZGK.mjs.map +7 -0
  64. package/dist/lib/neutral/templates-ETXVD3VE.mjs +16 -0
  65. package/dist/lib/neutral/templates-ETXVD3VE.mjs.map +7 -0
  66. package/dist/lib/neutral/testing.mjs +8 -0
  67. package/dist/lib/neutral/translations.mjs +64 -0
  68. package/dist/lib/neutral/translations.mjs.map +7 -0
  69. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
  70. package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
  71. package/dist/lib/neutral/types/index.mjs +18 -0
  72. package/dist/lib/neutral/types/index.mjs.map +7 -0
  73. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  74. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  75. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  76. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  77. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  78. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  79. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  80. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  82. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/create-object.d.ts +11 -0
  84. package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
  85. package/dist/types/src/capabilities/create-object.test.d.ts +2 -0
  86. package/dist/types/src/capabilities/create-object.test.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/index.d.ts +16 -5
  88. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  89. package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
  90. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/navigation-resolver.d.ts +6 -0
  92. package/dist/types/src/capabilities/navigation-resolver.d.ts.map +1 -0
  93. package/dist/types/src/capabilities/node.d.ts +9 -0
  94. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  95. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  96. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  97. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  98. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  99. package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
  100. package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
  101. package/dist/types/src/capabilities/templates.d.ts +6 -0
  102. package/dist/types/src/capabilities/templates.d.ts.map +1 -0
  103. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
  104. package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
  105. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
  106. package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
  107. package/dist/types/src/commands/index.d.ts +2 -0
  108. package/dist/types/src/commands/index.d.ts.map +1 -0
  109. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  110. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  111. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  112. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  113. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  114. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  115. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  116. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  117. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  118. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  119. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  120. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  121. package/dist/types/src/commands/trigger/options.d.ts +10 -0
  122. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  123. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  124. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  125. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  126. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  127. package/dist/types/src/commands/trigger/update/queue.d.ts +11 -0
  128. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  129. package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
  130. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  131. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  132. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  133. package/dist/types/src/commands/trigger/util.d.ts +85 -0
  134. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  135. package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts +14 -0
  136. package/dist/types/src/components/CreateAutomationPanel/CreateAutomationPanel.d.ts.map +1 -0
  137. package/dist/types/src/components/CreateAutomationPanel/index.d.ts +2 -0
  138. package/dist/types/src/components/CreateAutomationPanel/index.d.ts.map +1 -0
  139. package/dist/types/src/components/index.d.ts +1 -7
  140. package/dist/types/src/components/index.d.ts.map +1 -1
  141. package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts +35 -0
  142. package/dist/types/src/containers/AutomationArticle/AutomationArticle.d.ts.map +1 -0
  143. package/dist/types/src/containers/AutomationArticle/index.d.ts +3 -0
  144. package/dist/types/src/containers/AutomationArticle/index.d.ts.map +1 -0
  145. package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts +13 -0
  146. package/dist/types/src/containers/AutomationCompanion/AutomationCompanion.d.ts.map +1 -0
  147. package/dist/types/src/containers/AutomationCompanion/index.d.ts +3 -0
  148. package/dist/types/src/containers/AutomationCompanion/index.d.ts.map +1 -0
  149. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +10 -0
  150. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  151. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  152. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  153. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  154. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  155. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  156. package/dist/types/src/containers/index.d.ts +6 -0
  157. package/dist/types/src/containers/index.d.ts.map +1 -0
  158. package/dist/types/src/hooks/index.d.ts +0 -1
  159. package/dist/types/src/hooks/index.d.ts.map +1 -1
  160. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +5 -4
  161. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  162. package/dist/types/src/index.d.ts +1 -5
  163. package/dist/types/src/index.d.ts.map +1 -1
  164. package/dist/types/src/meta.d.ts +2 -2
  165. package/dist/types/src/meta.d.ts.map +1 -1
  166. package/dist/types/src/operations/create-automation.d.ts +5 -0
  167. package/dist/types/src/operations/create-automation.d.ts.map +1 -0
  168. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  169. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  170. package/dist/types/src/operations/index.d.ts +3 -0
  171. package/dist/types/src/operations/index.d.ts.map +1 -0
  172. package/dist/types/src/paths.d.ts +3 -0
  173. package/dist/types/src/paths.d.ts.map +1 -0
  174. package/dist/types/src/plugin.d.ts +4 -0
  175. package/dist/types/src/plugin.d.ts.map +1 -0
  176. package/dist/types/src/templates/index.d.ts +10 -0
  177. package/dist/types/src/templates/index.d.ts.map +1 -0
  178. package/dist/types/src/testing/test-functions.d.ts +318 -3
  179. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  180. package/dist/types/src/testing.d.ts +2 -0
  181. package/dist/types/src/testing.d.ts.map +1 -0
  182. package/dist/types/src/translations.d.ts +90 -31
  183. package/dist/types/src/translations.d.ts.map +1 -1
  184. package/dist/types/src/types/Automation.d.ts +41 -0
  185. package/dist/types/src/types/Automation.d.ts.map +1 -0
  186. package/dist/types/src/types/Automation.test.d.ts +2 -0
  187. package/dist/types/src/types/Automation.test.d.ts.map +1 -0
  188. package/dist/types/src/types/AutomationCapabilities.d.ts +42 -0
  189. package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
  190. package/dist/types/src/types/AutomationOperation.d.ts +31 -0
  191. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  192. package/dist/types/src/types/Runnable.d.ts +14 -0
  193. package/dist/types/src/types/Runnable.d.ts.map +1 -0
  194. package/dist/types/src/types/index.d.ts +4 -0
  195. package/dist/types/src/types/index.d.ts.map +1 -1
  196. package/dist/types/src/types/schema.d.ts +13 -5
  197. package/dist/types/src/types/schema.d.ts.map +1 -1
  198. package/dist/types/src/util/automations-for-object.d.ts +20 -0
  199. package/dist/types/src/util/automations-for-object.d.ts.map +1 -0
  200. package/dist/types/src/util/automations-for-object.test.d.ts +2 -0
  201. package/dist/types/src/util/automations-for-object.test.d.ts.map +1 -0
  202. package/dist/types/tsconfig.tsbuildinfo +1 -1
  203. package/package.json +136 -71
  204. package/src/AutomationPlugin.node.ts +48 -0
  205. package/src/AutomationPlugin.test.ts +27 -0
  206. package/src/AutomationPlugin.tsx +47 -35
  207. package/src/AutomationPlugin.workerd.ts +24 -0
  208. package/src/capabilities/app-graph-builder.ts +81 -78
  209. package/src/capabilities/create-object.test.ts +18 -0
  210. package/src/capabilities/create-object.ts +26 -0
  211. package/src/capabilities/index.ts +17 -7
  212. package/src/capabilities/layer-specs.ts +196 -0
  213. package/src/capabilities/navigation-resolver.ts +19 -0
  214. package/src/capabilities/node.ts +19 -0
  215. package/src/capabilities/operation-handler.ts +16 -0
  216. package/src/capabilities/react-surface.tsx +45 -46
  217. package/src/capabilities/registry-sync.ts +114 -0
  218. package/src/capabilities/templates.ts +17 -0
  219. package/src/capabilities/trigger-runtime-controller.test.ts +107 -0
  220. package/src/capabilities/trigger-runtime-controller.ts +126 -0
  221. package/src/commands/index.ts +5 -0
  222. package/src/commands/trigger/create/index.ts +14 -0
  223. package/src/commands/trigger/create/queue.ts +87 -0
  224. package/src/commands/trigger/create/subscription.ts +126 -0
  225. package/src/commands/trigger/create/timer.ts +90 -0
  226. package/src/commands/trigger/index.ts +16 -0
  227. package/src/commands/trigger/list.ts +69 -0
  228. package/src/commands/trigger/options.ts +47 -0
  229. package/src/commands/trigger/remove.ts +45 -0
  230. package/src/commands/trigger/update/index.ts +14 -0
  231. package/src/commands/trigger/update/queue.ts +191 -0
  232. package/src/commands/trigger/update/subscription.ts +279 -0
  233. package/src/commands/trigger/update/timer.ts +195 -0
  234. package/src/commands/trigger/util.ts +410 -0
  235. package/src/components/CreateAutomationPanel/CreateAutomationPanel.tsx +68 -0
  236. package/src/components/CreateAutomationPanel/index.ts +5 -0
  237. package/src/components/index.ts +1 -8
  238. package/src/containers/AutomationArticle/AutomationArticle.tsx +586 -0
  239. package/src/containers/AutomationArticle/index.ts +6 -0
  240. package/src/containers/AutomationCompanion/AutomationCompanion.tsx +183 -0
  241. package/src/containers/AutomationCompanion/index.ts +6 -0
  242. package/src/containers/AutomationSettings/AutomationSettings.tsx +34 -0
  243. package/src/containers/AutomationSettings/index.ts +5 -0
  244. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  245. package/src/containers/TriggerSettings/index.ts +6 -0
  246. package/src/containers/index.ts +10 -0
  247. package/src/hooks/index.ts +1 -1
  248. package/src/hooks/useTriggerRuntimeControls.ts +38 -19
  249. package/src/index.ts +1 -6
  250. package/src/meta.ts +23 -7
  251. package/src/operations/create-automation.ts +38 -0
  252. package/src/operations/create-trigger-from-template.ts +70 -0
  253. package/src/operations/index.ts +10 -0
  254. package/src/paths.ts +13 -0
  255. package/src/plugin.ts +11 -0
  256. package/src/templates/index.ts +22 -0
  257. package/src/testing/test-functions.ts +43 -9
  258. package/src/testing.ts +7 -0
  259. package/src/translations.ts +49 -33
  260. package/src/types/Automation.test.ts +37 -0
  261. package/src/types/Automation.ts +45 -0
  262. package/src/types/AutomationCapabilities.ts +52 -0
  263. package/src/types/AutomationOperation.ts +61 -0
  264. package/src/types/Runnable.ts +14 -0
  265. package/src/types/index.ts +5 -0
  266. package/src/types/schema.ts +6 -6
  267. package/src/util/automations-for-object.test.ts +86 -0
  268. package/src/util/automations-for-object.ts +72 -0
  269. package/src/vite-env.d.ts +10 -0
  270. package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
  271. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
  272. package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
  273. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
  274. package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
  275. package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
  276. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  277. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  278. package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
  279. package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
  280. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  281. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  282. package/dist/lib/browser/chunk-LZQFZO3B.mjs +0 -17
  283. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  284. package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
  285. package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
  286. package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
  287. package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
  288. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  289. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  290. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  291. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  292. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  293. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  294. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
  295. package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
  296. package/dist/lib/browser/hooks/index.mjs +0 -13
  297. package/dist/lib/browser/index.mjs +0 -130
  298. package/dist/lib/browser/index.mjs.map +0 -7
  299. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  300. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  301. package/dist/lib/browser/meta.json +0 -1
  302. package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
  303. package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
  304. package/dist/lib/browser/types/index.mjs +0 -8
  305. package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
  306. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
  307. package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
  308. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
  309. package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
  310. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
  311. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  312. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  313. package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
  314. package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
  315. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
  316. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  317. package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
  318. package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
  319. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  320. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  321. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  322. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  323. package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
  324. package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
  325. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  326. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  327. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  328. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  329. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
  330. package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
  331. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  332. package/dist/lib/node-esm/index.mjs +0 -131
  333. package/dist/lib/node-esm/index.mjs.map +0 -7
  334. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  335. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  336. package/dist/lib/node-esm/meta.json +0 -1
  337. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
  338. package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
  339. package/dist/lib/node-esm/types/index.mjs +0 -9
  340. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  341. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  342. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  343. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  344. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  345. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  346. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +0 -13
  347. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +0 -1
  348. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +0 -50
  349. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +0 -1
  350. package/dist/types/src/components/AutomationPanel/index.d.ts +0 -4
  351. package/dist/types/src/components/AutomationPanel/index.d.ts.map +0 -1
  352. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  353. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  354. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  355. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  356. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +0 -7
  357. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +0 -1
  358. package/dist/types/src/components/FunctionsPanel/index.d.ts +0 -4
  359. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +0 -1
  360. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +0 -8
  361. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +0 -1
  362. package/dist/types/src/components/FunctionsRegistry/index.d.ts +0 -2
  363. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +0 -1
  364. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +0 -12
  365. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +0 -1
  366. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +0 -5
  367. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +0 -1
  368. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +0 -13
  369. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +0 -1
  370. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +0 -51
  371. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +0 -1
  372. package/dist/types/src/components/TriggerEditor/index.d.ts +0 -2
  373. package/dist/types/src/components/TriggerEditor/index.d.ts.map +0 -1
  374. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  375. package/dist/types/src/events.d.ts +0 -4
  376. package/dist/types/src/events.d.ts.map +0 -1
  377. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  378. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  379. package/src/capabilities/capabilities.ts +0 -41
  380. package/src/capabilities/compute-runtime.ts +0 -127
  381. package/src/capabilities/intent-resolver.ts +0 -72
  382. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +0 -56
  383. package/src/components/AutomationPanel/AutomationPanel.tsx +0 -223
  384. package/src/components/AutomationPanel/index.ts +0 -9
  385. package/src/components/AutomationSettings.tsx +0 -30
  386. package/src/components/FunctionsContainer.tsx +0 -36
  387. package/src/components/FunctionsPanel/FunctionsPanel.tsx +0 -116
  388. package/src/components/FunctionsPanel/index.ts +0 -8
  389. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +0 -135
  390. package/src/components/FunctionsRegistry/index.ts +0 -5
  391. package/src/components/TriggerEditor/FunctionInputEditor.tsx +0 -84
  392. package/src/components/TriggerEditor/SpecSelector.tsx +0 -65
  393. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +0 -121
  394. package/src/components/TriggerEditor/TriggerEditor.tsx +0 -127
  395. package/src/components/TriggerEditor/index.ts +0 -5
  396. package/src/components/TriggerSettings.tsx +0 -25
  397. package/src/events.ts +0 -11
  398. package/src/hooks/useComputeRuntimeCallback.ts +0 -68
  399. /package/dist/lib/{browser/AutomationPanel-7OECLR5N.mjs.map → neutral/AutomationArticle-GN36NUX2.mjs.map} +0 -0
  400. /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  401. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  402. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  403. /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
  404. /package/dist/lib/{node-esm/AutomationPanel-HCVFNHGQ.mjs.map → neutral/meta.mjs.map} +0 -0
  405. /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  406. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/testing.mjs.map} +0 -0
  407. /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
@@ -4,14 +4,18 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { ContactType } from '@dxos/client/testing';
8
- import { Type } from '@dxos/echo';
7
+ import { TestSchema } from '@dxos/client/testing';
8
+ import { JsonSchema, Ref, DXN } from '@dxos/echo';
9
9
 
10
+ /**
11
+ * Operations seeded into the local space in stories.
12
+ */
10
13
  export const functions = [
11
14
  {
12
- name: 'example.com/function/chess',
15
+ key: DXN.make('com.example.function.chess'),
16
+ name: 'com.example.function.chess',
13
17
  version: '0.1.0',
14
- inputSchema: Type.toJsonSchema(
18
+ inputSchema: JsonSchema.toJsonSchema(
15
19
  Schema.Struct({
16
20
  level: Schema.Number.annotations({
17
21
  title: 'Level',
@@ -20,10 +24,11 @@ export const functions = [
20
24
  ),
21
25
  },
22
26
  {
23
- name: 'example.com/function/forex',
27
+ key: DXN.make('com.example.function.forex'),
28
+ name: 'com.example.function.forex',
24
29
  version: '0.1.0',
25
30
  binding: 'FOREX',
26
- inputSchema: Type.toJsonSchema(
31
+ inputSchema: JsonSchema.toJsonSchema(
27
32
  Schema.Struct({
28
33
  from: Schema.String.annotations({ title: 'Currency from' }),
29
34
  to: Schema.String.annotations({ title: 'Currency to' }),
@@ -31,11 +36,40 @@ export const functions = [
31
36
  ),
32
37
  },
33
38
  {
34
- name: 'example.com/function/ping-contact',
39
+ key: DXN.make('com.example.function.pingContact'),
40
+ name: 'com.example.function.ping-contact',
35
41
  version: '0.0.1',
36
- inputSchema: Type.toJsonSchema(
42
+ inputSchema: JsonSchema.toJsonSchema(
37
43
  Schema.Struct({
38
- contact: Type.Ref(ContactType).annotations({ title: 'Contact' }),
44
+ contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
45
+ }),
46
+ ),
47
+ },
48
+ ];
49
+
50
+ /**
51
+ * Operations seeded into the registry (not the local space) in stories.
52
+ * Simulates built-in or plugin-provided operations available globally.
53
+ */
54
+ export const registryFunctions = [
55
+ {
56
+ key: 'com.example.function.translate',
57
+ name: 'com.example.function.translate',
58
+ version: '0.1.0',
59
+ inputSchema: JsonSchema.toJsonSchema(
60
+ Schema.Struct({
61
+ text: Schema.String.annotations({ title: 'Text' }),
62
+ targetLanguage: Schema.String.annotations({ title: 'Target language' }),
63
+ }),
64
+ ),
65
+ },
66
+ {
67
+ key: 'com.example.function.summarize',
68
+ name: 'com.example.function.summarize',
69
+ version: '0.1.0',
70
+ inputSchema: JsonSchema.toJsonSchema(
71
+ Schema.Struct({
72
+ content: Schema.String.annotations({ title: 'Content' }),
39
73
  }),
40
74
  ),
41
75
  },
package/src/testing.ts ADDED
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // Eager re-export of `AutomationPlugin`. See `@dxos/plugin-testing/src/core.ts`
6
+ // for the rationale.
7
+ export * from './AutomationPlugin';
@@ -2,49 +2,65 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
+ import { Type } from '@dxos/echo';
5
6
  import { type Resource } from '@dxos/react-ui';
6
7
 
7
- import { meta } from './meta';
8
+ import { meta } from '#meta';
9
+ import { Automation } from '#types';
8
10
 
9
11
  export const translations = [
10
12
  {
11
13
  'en-US': {
14
+ [Type.getTypename(Automation.Automation)]: {
15
+ 'typename.label': 'Automation',
16
+ 'typename.label_zero': 'Automations',
17
+ 'typename.label_one': 'Automation',
18
+ 'typename.label_other': 'Automations',
19
+ 'object-name.placeholder': 'New automation',
20
+ 'add-object.label': 'Add automation',
21
+ 'rename-object.label': 'Rename automation',
22
+ 'delete-object.label': 'Delete automation',
23
+ },
12
24
  [meta.id]: {
13
- 'plugin name': 'Automation',
14
- 'automation panel label': 'Automations',
15
- 'script automation label': 'Automation',
16
- 'automation verbose label': 'Manage automations',
17
- 'automation description': 'You can manage all the triggers which automate your space here.',
18
-
19
- 'runtime label': 'Enable Local Runtime',
20
- 'runtime description':
21
- 'This will start a trigger dispatcher locally for this space to run triggers on your device while Composer is running.',
22
-
23
- 'functions panel label': 'Functions',
24
- 'functions verbose label': 'Manage deployed functions',
25
- 'functions registry verbose label': 'Functions registry',
26
- 'functions registry description': 'Import functions from the registry',
27
- 'functions description': 'You can manage all the functions deployed from your space on EDGE here.',
28
- 'function copy id': 'Copy Function ID',
29
- 'no functions found': 'No functions found',
30
- 'go to function source button label': 'Show function source',
31
- 'delete function button label': 'Delete function',
25
+ 'plugin.name': 'Automation',
26
+ 'automation-panel.label': 'Automations',
27
+ 'create-panel.template.placeholder': 'Search templates...',
32
28
 
33
- 'trigger editor title': 'Configure Trigger',
34
- 'new trigger label': 'Add Trigger',
35
- 'trigger type timer': 'Timer',
36
- 'trigger type webhook': 'Webhook',
37
- 'trigger type websocket': 'Websocket',
38
- 'trigger type subscription': 'Subscription',
39
- 'trigger type email': 'Email',
40
- 'trigger type queue': 'Queue',
29
+ 'automation-name.label': 'Name',
30
+ 'general.title': 'General',
31
+ 'general.description': 'Name and status.',
32
+ 'action.title': 'Action',
33
+ 'action.description': 'What this automation runs.',
34
+ 'action.placeholder': 'Select an operation or routine',
35
+ 'action-input.label': 'Input',
36
+ 'action-kind.operation.label': 'Operation',
37
+ 'action-kind.routine.label': 'Routine',
38
+ 'trigger-picker.title': 'Trigger',
39
+ 'trigger-picker.description': 'When this automation runs.',
40
+ 'trigger-kind.placeholder': 'Select trigger type',
41
+ 'trigger-kind.timer.label': 'Schedule (cron)',
42
+ 'trigger-kind.feed.label': 'Feed',
43
+ 'cron.placeholder': '0 0 * * *',
44
+ 'feed.placeholder': 'Select a feed',
45
+ 'enabled.label': 'Enabled',
46
+ 'enabled.description': 'Turn this automation on or off.',
47
+ 'add-trigger.label': 'Add trigger',
48
+ 'add-trigger-first.message': 'Add a trigger to enable.',
49
+ 'remove-trigger.label': 'Remove',
50
+ 'select-action-first.message': 'Select an action first.',
51
+ 'automation-companion.label': 'Automation',
52
+ 'no-automations.message': 'No automations for this object.',
53
+ 'automation-not-associated.message': 'Not yet associated with this object.',
54
+ 'automation-detached.message': 'No longer associated with this object.',
41
55
 
42
- 'trigger copy url': 'Copy URL',
43
- 'trigger copy email': 'Copy Email',
56
+ 'automation-verbose.label': 'Manage automations',
57
+ 'automation.description': 'Manage where automations in this space run.',
44
58
 
45
- 'trigger payload add': 'Add',
46
- 'trigger payload remove': 'Remove',
47
- 'trigger payload prop name placeholder': 'New payload property name',
59
+ 'runtime.label': 'Runtime location',
60
+ 'runtime.description': 'Determines where automations in this space run.',
61
+ 'runtime.disabled.label': 'Disabled',
62
+ 'runtime.local.label': 'Local',
63
+ 'runtime.edge.label': 'EDGE (experimental)',
48
64
  },
49
65
  },
50
66
  },
@@ -0,0 +1,37 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { Obj, Type } from '@dxos/echo';
9
+
10
+ import { blank } from '../templates';
11
+ import * as Automation from './Automation';
12
+ import * as Runnable from './Runnable';
13
+
14
+ describe('Automation', () => {
15
+ test('make produces a typed Automation', ({ expect }) => {
16
+ const automation = Automation.make({ name: 'Test', triggers: [] });
17
+ expect(Automation.instanceOf(automation)).toBe(true);
18
+ expect(Obj.instanceOf(Automation.Automation, automation)).toBe(true);
19
+ expect(Type.getTypename(Automation.Automation)).toBe('org.dxos.type.automation');
20
+ expect(Obj.getLabel(automation)).toBe('Test');
21
+ expect(automation.triggers).toEqual([]);
22
+ expect(automation.runnable).toBeUndefined();
23
+ });
24
+
25
+ test('Runnable seam is currently the Operation type', ({ expect }) => {
26
+ // MVP: Runnable === Operation. Widening this to a union is the documented next step.
27
+ expect(Runnable.Runnable).toBe(Operation.PersistentOperation);
28
+ });
29
+
30
+ describe('blank template', () => {
31
+ test('is the default no-op template', ({ expect }) => {
32
+ expect(blank.id).toBe('org.dxos.automation.blank');
33
+ expect(blank.label).toBe('Blank');
34
+ expect(typeof blank.scaffold).toBe('function');
35
+ });
36
+ });
37
+ });
@@ -0,0 +1,45 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { DXN, Annotation, Obj, Ref, Type } from '@dxos/echo';
10
+ import { LabelAnnotation } from '@dxos/echo/internal';
11
+
12
+ import * as Runnable from './Runnable';
13
+
14
+ /**
15
+ * User-facing automation: a thin aggregate of an action (`runnable`) and the triggers that fire it.
16
+ * App-level only — EDGE stays unaware of it (triggers point directly at the runnable).
17
+ */
18
+ export const Automation = Schema.Struct({
19
+ name: Schema.String.pipe(Schema.optional),
20
+ description: Schema.String.pipe(Schema.optional),
21
+ /**
22
+ * The action to run. A trigger's `function` Ref points directly at this (so EDGE/the dispatcher can run
23
+ * it). `Runnable` is the type seam — currently just Operation; see Runnable.ts.
24
+ */
25
+ runnable: Ref.Ref(Runnable.Runnable).pipe(Schema.optional),
26
+ /**
27
+ * Explicit membership, bi-directional with `trigger.function → runnable`. Required (not derived by query)
28
+ * because the runnable may be a shared registry operation referenced by multiple automations, which would
29
+ * conflate triggers. MVP enforces length <= 1.
30
+ *
31
+ * Typed as `Obj.Unknown` (not `Trigger`) to avoid pulling query-AST types into the emitted declaration —
32
+ * the same reason `Trigger.function` uses `Obj.Unknown`. Resolve and narrow with `Obj.instanceOf(Trigger)`.
33
+ */
34
+ triggers: Schema.Array(Ref.Ref(Obj.Unknown)),
35
+ }).pipe(
36
+ LabelAnnotation.set(['name']),
37
+ Annotation.IconAnnotation.set({ icon: 'ph--lightning--regular', hue: 'amber' }),
38
+ Type.makeObject(DXN.make('org.dxos.type.automation', '0.1.0')),
39
+ );
40
+
41
+ export type Automation = Type.InstanceType<typeof Automation>;
42
+
43
+ export const instanceOf = (value: unknown): value is Automation => Obj.instanceOf(Automation, value);
44
+
45
+ export const make = (props: Obj.MakeProps<typeof Automation>) => Obj.make(Automation, props);
@@ -0,0 +1,52 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import type * as Effect from 'effect/Effect';
6
+
7
+ import { Capability } from '@dxos/app-framework';
8
+ import type { Database, Obj } from '@dxos/echo';
9
+ import { type DelegationStrategy } from '@dxos/functions-runtime';
10
+
11
+ import * as Automation from './Automation';
12
+
13
+ /**
14
+ * Optional supervisor strategy for the agent chat service. When contributed (by a plugin that knows
15
+ * the agent/plan model, e.g. plugin-assistant), the conversational agent delegates outstanding work
16
+ * to sub-agents and folds their results back into the conversation. Consumed by the AgentService
17
+ * LayerSpec; absent by default (a plain conversational agent).
18
+ */
19
+ export const AgentDelegationStrategy = Capability.make<DelegationStrategy>(
20
+ 'org.dxos.plugin.automation.capability.agentDelegationStrategy',
21
+ );
22
+
23
+ /**
24
+ * An automation template contributed by a plugin. The create dialog and the per-object "Automations"
25
+ * companion list contributed templates (`Capability.getAll(AutomationCapabilities.Template)`) and run the
26
+ * chosen template's `scaffold` to build the automation.
27
+ */
28
+ export type Template = {
29
+ /** Stable id (e.g. 'org.dxos.automation.blank'). */
30
+ id: string;
31
+ /** Human-readable label shown in the picker. */
32
+ label: string;
33
+ /** Optional Phosphor icon name. */
34
+ icon?: string;
35
+ /**
36
+ * Whether this template applies to the given companion subject. The subject is the object whose
37
+ * "Automations" companion is open, or undefined in the global create dialog. Templates that need a
38
+ * specific subject (e.g. a feed-bearing Mailbox) gate themselves here. Defaults to always-applies.
39
+ */
40
+ appliesTo?: (subject?: Obj.Unknown) => boolean;
41
+ /**
42
+ * Build the Automation from the user's input. The returned Automation is added to the database by the
43
+ * create flow; any auxiliary objects (runnable, triggers) must be added by the scaffold itself via
44
+ * Database.Service. `subject` is set when scaffolding from an object's companion.
45
+ */
46
+ scaffold: (ctx: {
47
+ name?: string;
48
+ subject?: Obj.Unknown;
49
+ }) => Effect.Effect<Automation.Automation, Error, Database.Service>;
50
+ };
51
+
52
+ export const Template = Capability.make<Template>('org.dxos.plugin.automation.capability.template');
@@ -0,0 +1,61 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import * as Schema from 'effect/Schema';
8
+
9
+ import { Capability } from '@dxos/app-framework';
10
+ import { Operation } from '@dxos/compute';
11
+ import { Database, DXN, Obj } from '@dxos/echo';
12
+ // Value-side `EID` import keeps TS declaration emit portable — `TriggerTemplate`
13
+ // references `EID.Schema` and the inferred `CreateTriggerFromTemplate` type
14
+ // otherwise needs a transitive `@dxos/keys` import that's hard for d.ts emit to surface.
15
+ import { EID as _EchoURIReference } from '@dxos/keys';
16
+
17
+ import { meta } from '#meta';
18
+
19
+ import { TriggerTemplate } from './schema';
20
+ export { _EchoURIReference };
21
+
22
+ const makeKey = (name: string) => DXN.make(`${meta.id}.operation.${name}`);
23
+
24
+ export const CreateTriggerFromTemplate = Operation.make({
25
+ meta: {
26
+ key: makeKey('createTriggerFromTemplate'),
27
+ name: 'Create Trigger From Template',
28
+ icon: 'ph--lightning--regular',
29
+ },
30
+ services: [Capability.Service],
31
+ input: Schema.Struct({
32
+ db: Database.Database,
33
+ template: TriggerTemplate,
34
+ enabled: Schema.optional(Schema.Boolean),
35
+ scriptName: Schema.optional(Schema.String),
36
+ input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
37
+ }),
38
+ output: Schema.Void,
39
+ });
40
+
41
+ // The single creation entrypoint for every path (create dialog, companion, sidebar) so placement and
42
+ // ownership are established in one place. Output mirrors `SpaceCapabilities.CreateObjectResult`.
43
+ export const CreateAutomation = Operation.make({
44
+ meta: {
45
+ key: makeKey('createAutomation'),
46
+ name: 'Create Automation',
47
+ icon: 'ph--lightning--regular',
48
+ },
49
+ services: [Capability.Service],
50
+ input: Schema.Struct({
51
+ db: Database.Database,
52
+ templateId: Schema.String,
53
+ name: Schema.optional(Schema.String),
54
+ subject: Schema.optional(Obj.Unknown),
55
+ }),
56
+ output: Schema.Struct({
57
+ id: Schema.String,
58
+ subject: Schema.Array(Schema.String),
59
+ object: Obj.Unknown,
60
+ }),
61
+ });
@@ -0,0 +1,14 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ // @import-as-namespace
6
+
7
+ import { Operation } from '@dxos/compute';
8
+
9
+ // TODO(wittjosiah): Currently just Operation. Widen to a union (Operation | ComputeGraph | …) once the
10
+ // dispatcher/EDGE can run non-Operation runnables as a Process; factor down to @dxos/compute once
11
+ // ComputeGraph's type moves there. Routines are NOT a direct member — they run via the AgentPrompt
12
+ // operation (bound as input).
13
+ export type Runnable = Operation.PersistentOperation;
14
+ export const Runnable = Operation.PersistentOperation;
@@ -3,3 +3,8 @@
3
3
  //
4
4
 
5
5
  export * from './schema';
6
+
7
+ export * as Automation from './Automation';
8
+ export * as AutomationCapabilities from './AutomationCapabilities';
9
+ export * as AutomationOperation from './AutomationOperation';
10
+ export * as Runnable from './Runnable';
@@ -4,21 +4,21 @@
4
4
 
5
5
  import * as Schema from 'effect/Schema';
6
6
 
7
- import { SpaceSchema } from '@dxos/react-client/echo';
7
+ import { Database } from '@dxos/echo';
8
8
 
9
- import { meta } from '../meta';
9
+ import { meta } from '#meta';
10
10
 
11
- const TriggerTemplate = Schema.Union(
11
+ export const TriggerTemplate = Schema.Union(
12
12
  Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),
13
- Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),
13
+ Schema.Struct({ type: Schema.Literal('feed'), feed: Schema.Any }),
14
14
  );
15
15
 
16
16
  export namespace AutomationAction {
17
17
  export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(
18
- `${meta.id}/action/create-trigger-from-template`,
18
+ `${meta.id}.action.create-trigger-from-template`,
19
19
  {
20
20
  input: Schema.Struct({
21
- space: SpaceSchema,
21
+ db: Database.Database,
22
22
  template: TriggerTemplate,
23
23
  enabled: Schema.optional(Schema.Boolean),
24
24
  // TODO(wittjosiah): Improve how this lookup is done.
@@ -0,0 +1,86 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+ import { describe, test } from 'vitest';
7
+
8
+ import { Trigger } from '@dxos/compute';
9
+ import { type Database, DXN, Feed, Obj, Ref, Type } from '@dxos/echo';
10
+ import { EffectEx } from '@dxos/effect';
11
+ import { EID, URI } from '@dxos/keys';
12
+ import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
13
+ import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
14
+ import { createComposerTestApp } from '@dxos/plugin-testing/harness';
15
+
16
+ import { Automation } from '#types';
17
+
18
+ import { automationsForObject, connectedAutomationsQuery } from './automations-for-object';
19
+
20
+ // A minimal feed-annotated host (like a mailbox): an object holding a `feed` ref.
21
+ const FeedHost = Schema.Struct({
22
+ name: Schema.optional(Schema.String),
23
+ feed: Ref.Ref(Feed.Feed),
24
+ }).pipe(Type.makeObject(DXN.make('org.dxos.test.feedHost', '0.1.0')));
25
+
26
+ const types = [Automation.Automation, Trigger.Trigger, Feed.Feed, FeedHost];
27
+
28
+ const initSpace = async (harness: Awaited<ReturnType<typeof createComposerTestApp>>) => {
29
+ const { personalSpace } = await EffectEx.runAndForwardErrors(
30
+ initializeIdentity(harness.get(ClientCapabilities.Client)),
31
+ );
32
+ await harness.waitForEvent(ClientEvents.SpacesReady);
33
+ return personalSpace.db;
34
+ };
35
+
36
+ const connectedIds = (db: Database.Database, object: Obj.Unknown) =>
37
+ db
38
+ .query(connectedAutomationsQuery(object))
39
+ .run()
40
+ .then((automations) => automations.map((automation) => automation.id).sort());
41
+
42
+ // Build a space-qualified ref like the RefField object picker does (from the entity's fully-qualified URI),
43
+ // rather than the bare ref `Ref.make` produces — this is the encoding real triggers carry, and it exercises
44
+ // the reverse-ref EID normalization that lets qualified refs match a space-less anchor.
45
+ const qualifiedRef = (db: Database.Database, object: Obj.Unknown) =>
46
+ Ref.fromURI(URI.make(EID.make({ spaceId: db.spaceId, entityId: object.id })));
47
+
48
+ describe('automations connected to an object', () => {
49
+ test('input-ref: trigger whose nested input references the object', async ({ expect }) => {
50
+ await using harness = await createComposerTestApp({ plugins: [ClientPlugin({ types })] });
51
+ const db = await initSpace(harness);
52
+
53
+ const target = db.add(Automation.make({ name: 'target', triggers: [] }));
54
+ const other = db.add(Automation.make({ name: 'other', triggers: [] }));
55
+ // The target ref is nested in the trigger's untyped `input` record, and is space-qualified like a
56
+ // picker-created ref.
57
+ const trigger = db.add(Trigger.make({ input: { subject: qualifiedRef(db, target) } }));
58
+ const owner = db.add(Automation.make({ name: 'owner', triggers: [Ref.make(trigger)] }));
59
+ await db.flush();
60
+
61
+ expect(automationsForObject(target, [owner, other]).map((automation) => automation.id)).toEqual([owner.id]);
62
+ expect(automationsForObject(other, [owner])).toEqual([]);
63
+
64
+ // Poll to absorb index latency; the query resolves via the reverse-ref index.
65
+ await expect.poll(() => connectedIds(db, target), { timeout: 5_000 }).toEqual([owner.id]);
66
+ await expect.poll(() => connectedIds(db, other), { timeout: 5_000 }).toEqual([]);
67
+ });
68
+
69
+ test('feed-ref: feed trigger bound to the object’s feed', async ({ expect }) => {
70
+ await using harness = await createComposerTestApp({ plugins: [ClientPlugin({ types })] });
71
+ const db = await initSpace(harness);
72
+
73
+ const feed = db.add(Feed.make());
74
+ const host = db.add(Obj.make(FeedHost, { name: 'mailbox', feed: Ref.make(feed) }));
75
+ const other = db.add(Automation.make({ name: 'other', triggers: [] }));
76
+ // Picker-created feed refs are space-qualified (unlike `Trigger.specFeed`'s bare `Ref.make`); the host's
77
+ // own feed ref is bare (code-created). They must still match through the reverse-ref index.
78
+ const feedTrigger = db.add(Trigger.make({ spec: { kind: 'feed', feed: qualifiedRef(db, feed) } }));
79
+ const owner = db.add(Automation.make({ name: 'feed-owner', triggers: [Ref.make(feedTrigger)] }));
80
+ await db.flush();
81
+
82
+ expect(automationsForObject(host, [owner, other]).map((automation) => automation.id)).toEqual([owner.id]);
83
+
84
+ await expect.poll(() => connectedIds(db, host), { timeout: 5_000 }).toEqual([owner.id]);
85
+ });
86
+ });
@@ -0,0 +1,72 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { Trigger } from '@dxos/compute';
6
+ import { Filter, Obj, Query, Ref } from '@dxos/echo';
7
+
8
+ import { Automation } from '#types';
9
+
10
+ /**
11
+ * Reactive query for the automations connected to an object O — without a stored association field.
12
+ *
13
+ * Association is derived: an automation is connected when one of its triggers references O, either via a
14
+ * `Ref` anywhere in the trigger's `input` (e.g. a magazine passed into AgentPrompt's input) or via a feed
15
+ * trigger whose `spec.feed` resolves to `O.feed` (feed-annotated hosts like mailboxes). Both are reachable
16
+ * by reverse-reference traversal because ECHO's reverse-ref index is structural — it records every ref in a
17
+ * document regardless of schema path (incl. untyped records and union-nested fields). The traversal is two
18
+ * hops: O ← Trigger ← Automation.
19
+ */
20
+ export const connectedAutomationsQuery = (object: Obj.Unknown): Query.Query<Automation.Automation> => {
21
+ // Triggers referencing O directly (any path, incl. nested in the untyped `input` record).
22
+ const byInput = Query.select(Filter.id(object.id)).referencedBy(Trigger.Trigger);
23
+ // Triggers referencing O's feed; `.reference('feed')` reads the path structurally and is empty for objects
24
+ // without a feed prop, so this branch contributes nothing for non-feed objects.
25
+ const byFeed = Query.select(Filter.id(object.id)).reference('feed').referencedBy(Trigger.Trigger);
26
+ return Query.all(byInput, byFeed).referencedBy(Automation.Automation, 'triggers');
27
+ };
28
+
29
+ /**
30
+ * Pure predicate equivalent of {@link connectedAutomationsQuery}, over a pre-queried list of automations.
31
+ * Kept for unit tests (asserting the query and predicate agree) and the deferred quick-association check.
32
+ */
33
+ export const automationsForObject = (
34
+ object: Obj.Unknown,
35
+ automations: Automation.Automation[],
36
+ ): Automation.Automation[] => automations.filter((automation) => automationReferencesObject(automation, object));
37
+
38
+ export const automationReferencesObject = (automation: Automation.Automation, object: Obj.Unknown): boolean => {
39
+ const objectFeedId = getFeedId(object);
40
+ return automation.triggers.some((ref) => {
41
+ const trigger = ref.target;
42
+ if (!Obj.instanceOf(Trigger.Trigger, trigger)) {
43
+ return false;
44
+ }
45
+
46
+ if (trigger.spec?.kind === 'feed' && objectFeedId && trigger.spec.feed?.target?.id === objectFeedId) {
47
+ return true;
48
+ }
49
+
50
+ return trigger.input != null && referencesId(trigger.input, object.id);
51
+ });
52
+ };
53
+
54
+ /** The feed id a feed-annotated object points at (e.g. `mailbox.feed`), if any. */
55
+ const getFeedId = (object: Obj.Unknown): string | undefined => {
56
+ const feedRef = (object as { feed?: Ref.Ref<unknown> }).feed;
57
+ return Ref.isRef(feedRef) ? feedRef.target?.id : undefined;
58
+ };
59
+
60
+ /** Recursively scan a value for a Ref whose target is the given object id. */
61
+ const referencesId = (value: unknown, id: string): boolean => {
62
+ if (Ref.isRef(value)) {
63
+ return value.target?.id === id;
64
+ }
65
+ if (Array.isArray(value)) {
66
+ return value.some((entry) => referencesId(entry, id));
67
+ }
68
+ if (value && typeof value === 'object') {
69
+ return Object.values(value).some((entry) => referencesId(entry, id));
70
+ }
71
+ return false;
72
+ };
@@ -0,0 +1,10 @@
1
+ /// <reference types="vite/client" />
2
+
3
+ //
4
+ // Copyright 2026 DXOS.org
5
+ //
6
+
7
+ declare module '*.mdl?raw' {
8
+ const content: string;
9
+ export default content;
10
+ }
@@ -1,11 +0,0 @@
1
- import {
2
- AutomationPanel,
3
- AutomationPanel_default
4
- } from "./chunk-QKFBHAGN.mjs";
5
- import "./chunk-JW7XSPYW.mjs";
6
- import "./chunk-LZQFZO3B.mjs";
7
- export {
8
- AutomationPanel,
9
- AutomationPanel_default as default
10
- };
11
- //# sourceMappingURL=AutomationPanel-7OECLR5N.mjs.map