@dxos/plugin-automation 0.8.4-main.7ace549 → 0.8.4-main.8baae0fced

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 (329) hide show
  1. package/LICENSE +102 -5
  2. package/README.md +1 -1
  3. package/dist/lib/neutral/AutomationPanel-GQCS4EPU.mjs +11 -0
  4. package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
  5. package/dist/lib/neutral/AutomationPlugin.node.mjs +1111 -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-F6AZQV74.mjs +31 -0
  10. package/dist/lib/neutral/AutomationSettings-F6AZQV74.mjs.map +7 -0
  11. package/dist/lib/neutral/FunctionsContainer-2ETGQQR2.mjs +38 -0
  12. package/dist/lib/neutral/FunctionsContainer-2ETGQQR2.mjs.map +7 -0
  13. package/dist/lib/neutral/FunctionsPanel-SVRKRUXZ.mjs +97 -0
  14. package/dist/lib/neutral/FunctionsPanel-SVRKRUXZ.mjs.map +7 -0
  15. package/dist/lib/neutral/FunctionsRegistry-7ITCFJCW.mjs +95 -0
  16. package/dist/lib/neutral/FunctionsRegistry-7ITCFJCW.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 +15 -0
  21. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  22. package/dist/lib/neutral/capabilities/node.mjs +13 -0
  23. package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
  25. package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
  26. package/dist/lib/{browser/chunk-LZQFZO3B.mjs → neutral/chunk-4ETZEEYR.mjs} +8 -4
  27. package/dist/lib/neutral/chunk-4ETZEEYR.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-EIIPEUUP.mjs +303 -0
  29. package/dist/lib/neutral/chunk-EIIPEUUP.mjs.map +7 -0
  30. package/dist/lib/neutral/chunk-HRUXURVS.mjs +12 -0
  31. package/dist/lib/neutral/chunk-HRUXURVS.mjs.map +7 -0
  32. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  33. package/dist/lib/neutral/chunk-K3C5ZTZA.mjs +285 -0
  34. package/dist/lib/neutral/chunk-K3C5ZTZA.mjs.map +7 -0
  35. package/dist/lib/neutral/chunk-VCWVO3JE.mjs +8 -0
  36. package/dist/lib/neutral/chunk-VCWVO3JE.mjs.map +7 -0
  37. package/dist/lib/neutral/chunk-VRGWNUVV.mjs +36 -0
  38. package/dist/lib/neutral/chunk-VRGWNUVV.mjs.map +7 -0
  39. package/dist/lib/neutral/chunk-YA2ZTSOH.mjs +73 -0
  40. package/dist/lib/neutral/chunk-YA2ZTSOH.mjs.map +7 -0
  41. package/dist/lib/neutral/components/index.mjs +16 -0
  42. package/dist/lib/neutral/containers/index.mjs +13 -0
  43. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  44. package/dist/lib/neutral/create-trigger-from-template-XAJWHKO2.mjs +68 -0
  45. package/dist/lib/neutral/create-trigger-from-template-XAJWHKO2.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 +16 -0
  49. package/dist/lib/neutral/layer-specs-XLG75KLY.mjs +161 -0
  50. package/dist/lib/neutral/layer-specs-XLG75KLY.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/operation-handler-YXGYH5W5.mjs +13 -0
  54. package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
  55. package/dist/lib/neutral/operations/index.mjs +8 -0
  56. package/dist/lib/neutral/plugin.mjs +16 -0
  57. package/dist/lib/neutral/plugin.mjs.map +7 -0
  58. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
  59. package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
  60. package/dist/lib/neutral/testing.mjs +8 -0
  61. package/dist/lib/neutral/testing.mjs.map +7 -0
  62. package/dist/lib/neutral/translations.mjs +47 -0
  63. package/dist/lib/neutral/translations.mjs.map +7 -0
  64. package/dist/lib/neutral/types/index.mjs +12 -0
  65. package/dist/lib/neutral/types/index.mjs.map +7 -0
  66. package/dist/types/src/AutomationPlugin.d.ts +3 -1
  67. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  68. package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
  69. package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
  70. package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
  71. package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
  72. package/dist/types/src/AutomationPlugin.workerd.d.ts +4 -0
  73. package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
  74. package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
  75. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  76. package/dist/types/src/capabilities/index.d.ts +6 -5
  77. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  78. package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
  79. package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/node.d.ts +6 -0
  81. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  82. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  83. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  84. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  85. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  86. package/dist/types/src/commands/index.d.ts +2 -0
  87. package/dist/types/src/commands/index.d.ts.map +1 -0
  88. package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
  89. package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
  90. package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
  91. package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
  92. package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
  93. package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
  94. package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
  95. package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
  96. package/dist/types/src/commands/trigger/index.d.ts +57 -0
  97. package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
  98. package/dist/types/src/commands/trigger/list.d.ts +7 -0
  99. package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
  100. package/dist/types/src/commands/trigger/options.d.ts +11 -0
  101. package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
  102. package/dist/types/src/commands/trigger/remove.d.ts +8 -0
  103. package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
  104. package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
  105. package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
  106. package/dist/types/src/commands/trigger/update/queue.d.ts +12 -0
  107. package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
  108. package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
  109. package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
  110. package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
  111. package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
  112. package/dist/types/src/commands/trigger/util.d.ts +46 -0
  113. package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
  114. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +5 -6
  115. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  116. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -30
  117. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  118. package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
  119. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  120. package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
  121. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  122. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  123. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  124. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
  125. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  126. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  127. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  128. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +8 -7
  129. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  130. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +104 -32
  131. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  132. package/dist/types/src/components/index.d.ts +3 -4
  133. package/dist/types/src/components/index.d.ts.map +1 -1
  134. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
  135. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  136. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  137. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  138. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
  139. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  140. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  141. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  142. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  143. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  144. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  145. package/dist/types/src/containers/index.d.ts +5 -0
  146. package/dist/types/src/containers/index.d.ts.map +1 -0
  147. package/dist/types/src/hooks/index.d.ts +0 -1
  148. package/dist/types/src/hooks/index.d.ts.map +1 -1
  149. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +5 -4
  150. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  151. package/dist/types/src/index.d.ts +1 -5
  152. package/dist/types/src/index.d.ts.map +1 -1
  153. package/dist/types/src/meta.d.ts +2 -2
  154. package/dist/types/src/meta.d.ts.map +1 -1
  155. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  156. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  157. package/dist/types/src/operations/index.d.ts +3 -0
  158. package/dist/types/src/operations/index.d.ts.map +1 -0
  159. package/dist/types/src/plugin.d.ts +4 -0
  160. package/dist/types/src/plugin.d.ts.map +1 -0
  161. package/dist/types/src/testing/test-functions.d.ts +204 -2
  162. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  163. package/dist/types/src/testing.d.ts +2 -0
  164. package/dist/types/src/testing.d.ts.map +1 -0
  165. package/dist/types/src/translations.d.ts +32 -31
  166. package/dist/types/src/translations.d.ts.map +1 -1
  167. package/dist/types/src/types/AutomationOperation.d.ts +19 -0
  168. package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
  169. package/dist/types/src/types/index.d.ts +1 -0
  170. package/dist/types/src/types/index.d.ts.map +1 -1
  171. package/dist/types/src/types/schema.d.ts +11 -3
  172. package/dist/types/src/types/schema.d.ts.map +1 -1
  173. package/dist/types/tsconfig.tsbuildinfo +1 -1
  174. package/package.json +144 -70
  175. package/src/AutomationPlugin.node.ts +28 -0
  176. package/src/AutomationPlugin.test.ts +27 -0
  177. package/src/AutomationPlugin.tsx +20 -38
  178. package/src/AutomationPlugin.workerd.ts +18 -0
  179. package/src/capabilities/app-graph-builder.ts +59 -80
  180. package/src/capabilities/index.ts +9 -7
  181. package/src/capabilities/layer-specs.ts +231 -0
  182. package/src/capabilities/node.ts +13 -0
  183. package/src/capabilities/operation-handler.ts +16 -0
  184. package/src/capabilities/react-surface.tsx +49 -46
  185. package/src/commands/index.ts +5 -0
  186. package/src/commands/trigger/create/index.ts +14 -0
  187. package/src/commands/trigger/create/queue.ts +86 -0
  188. package/src/commands/trigger/create/subscription.ts +125 -0
  189. package/src/commands/trigger/create/timer.ts +90 -0
  190. package/src/commands/trigger/index.ts +16 -0
  191. package/src/commands/trigger/list.ts +70 -0
  192. package/src/commands/trigger/options.ts +59 -0
  193. package/src/commands/trigger/remove.ts +44 -0
  194. package/src/commands/trigger/update/index.ts +14 -0
  195. package/src/commands/trigger/update/queue.ts +194 -0
  196. package/src/commands/trigger/update/subscription.ts +278 -0
  197. package/src/commands/trigger/update/timer.ts +193 -0
  198. package/src/commands/trigger/util.ts +412 -0
  199. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +15 -8
  200. package/src/components/AutomationPanel/AutomationPanel.tsx +214 -83
  201. package/src/components/FunctionsPanel/FunctionsPanel.tsx +43 -42
  202. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +38 -46
  203. package/src/components/FunctionsRegistry/index.ts +4 -1
  204. package/src/components/TriggerEditor/FunctionInputEditor.tsx +34 -33
  205. package/src/components/TriggerEditor/SpecSelector.tsx +25 -19
  206. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +86 -35
  207. package/src/components/TriggerEditor/TriggerEditor.tsx +88 -47
  208. package/src/components/index.ts +1 -2
  209. package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
  210. package/src/containers/AutomationSettings/index.ts +5 -0
  211. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
  212. package/src/containers/FunctionsContainer/index.ts +5 -0
  213. package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
  214. package/src/containers/TriggerSettings/index.ts +6 -0
  215. package/src/containers/index.ts +9 -0
  216. package/src/hooks/index.ts +1 -1
  217. package/src/hooks/useTriggerRuntimeControls.ts +38 -19
  218. package/src/index.ts +1 -6
  219. package/src/meta.ts +6 -4
  220. package/src/operations/create-trigger-from-template.ts +71 -0
  221. package/src/operations/index.ts +7 -0
  222. package/src/plugin.ts +11 -0
  223. package/src/testing/test-functions.ts +11 -8
  224. package/src/testing.ts +7 -0
  225. package/src/translations.ts +39 -36
  226. package/src/types/AutomationOperation.ts +30 -0
  227. package/src/types/index.ts +2 -0
  228. package/src/types/schema.ts +5 -5
  229. package/dist/lib/browser/AutomationPanel-M4M77L4V.mjs +0 -11
  230. package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs +0 -68
  231. package/dist/lib/browser/AutomationSettings-4HCI6KJR.mjs.map +0 -7
  232. package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs +0 -144
  233. package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs.map +0 -7
  234. package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
  235. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
  236. package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
  237. package/dist/lib/browser/chunk-4MBM6C6A.mjs +0 -100
  238. package/dist/lib/browser/chunk-4MBM6C6A.mjs.map +0 -7
  239. package/dist/lib/browser/chunk-7W6QMY3L.mjs +0 -267
  240. package/dist/lib/browser/chunk-7W6QMY3L.mjs.map +0 -7
  241. package/dist/lib/browser/chunk-CZVA5NMD.mjs +0 -14
  242. package/dist/lib/browser/chunk-CZVA5NMD.mjs.map +0 -7
  243. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-T6ZESHDY.mjs +0 -191
  245. package/dist/lib/browser/chunk-T6ZESHDY.mjs.map +0 -7
  246. package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
  247. package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
  248. package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
  249. package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
  250. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  251. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  252. package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs +0 -113
  253. package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs.map +0 -7
  254. package/dist/lib/browser/hooks/index.mjs +0 -13
  255. package/dist/lib/browser/index.mjs +0 -130
  256. package/dist/lib/browser/index.mjs.map +0 -7
  257. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  258. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  259. package/dist/lib/browser/meta.json +0 -1
  260. package/dist/lib/browser/react-surface-TKU2EQ5A.mjs +0 -64
  261. package/dist/lib/browser/react-surface-TKU2EQ5A.mjs.map +0 -7
  262. package/dist/lib/browser/types/index.mjs +0 -8
  263. package/dist/lib/node-esm/AutomationPanel-F5CTC6AT.mjs +0 -12
  264. package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs +0 -69
  265. package/dist/lib/node-esm/AutomationSettings-BQLJIFRT.mjs.map +0 -7
  266. package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs +0 -145
  267. package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs.map +0 -7
  268. package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
  269. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
  270. package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
  271. package/dist/lib/node-esm/chunk-3IYSC75Z.mjs +0 -16
  272. package/dist/lib/node-esm/chunk-3IYSC75Z.mjs.map +0 -7
  273. package/dist/lib/node-esm/chunk-7B6NAAI6.mjs +0 -101
  274. package/dist/lib/node-esm/chunk-7B6NAAI6.mjs.map +0 -7
  275. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
  276. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  277. package/dist/lib/node-esm/chunk-CF2SWXPW.mjs +0 -268
  278. package/dist/lib/node-esm/chunk-CF2SWXPW.mjs.map +0 -7
  279. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  280. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  281. package/dist/lib/node-esm/chunk-F76XVENA.mjs +0 -192
  282. package/dist/lib/node-esm/chunk-F76XVENA.mjs.map +0 -7
  283. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
  284. package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
  285. package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
  286. package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
  287. package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs +0 -114
  288. package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs.map +0 -7
  289. package/dist/lib/node-esm/hooks/index.mjs +0 -14
  290. package/dist/lib/node-esm/index.mjs +0 -131
  291. package/dist/lib/node-esm/index.mjs.map +0 -7
  292. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  293. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  294. package/dist/lib/node-esm/meta.json +0 -1
  295. package/dist/lib/node-esm/react-surface-7QROSEGH.mjs +0 -65
  296. package/dist/lib/node-esm/react-surface-7QROSEGH.mjs.map +0 -7
  297. package/dist/lib/node-esm/types/index.mjs +0 -9
  298. package/dist/types/src/capabilities/capabilities.d.ts +0 -20
  299. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  300. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  301. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  302. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  303. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  304. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  305. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  306. package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
  307. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  308. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  309. package/dist/types/src/events.d.ts +0 -4
  310. package/dist/types/src/events.d.ts.map +0 -1
  311. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
  312. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
  313. package/src/capabilities/capabilities.ts +0 -41
  314. package/src/capabilities/compute-runtime.ts +0 -129
  315. package/src/capabilities/intent-resolver.ts +0 -72
  316. package/src/components/AutomationSettings.tsx +0 -30
  317. package/src/components/FunctionsContainer.tsx +0 -36
  318. package/src/components/TriggerSettings.tsx +0 -25
  319. package/src/events.ts +0 -11
  320. package/src/hooks/useComputeRuntimeCallback.ts +0 -68
  321. /package/dist/lib/{browser/AutomationPanel-M4M77L4V.mjs.map → neutral/AutomationPanel-GQCS4EPU.mjs.map} +0 -0
  322. /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
  323. /package/dist/lib/{browser/hooks/index.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
  324. /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  325. /package/dist/lib/{node-esm/hooks → neutral/components}/index.mjs.map +0 -0
  326. /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
  327. /package/dist/lib/{node-esm/AutomationPanel-F5CTC6AT.mjs.map → neutral/meta.mjs.map} +0 -0
  328. /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/operations/index.mjs.map} +0 -0
  329. /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
@@ -2,26 +2,24 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import * as Array from 'effect/Array';
6
- import * as EffectFunction from 'effect/Function';
7
- import * as Order from 'effect/Order';
8
5
  import * as Schema from 'effect/Schema';
9
6
  import { useState } from 'react';
10
7
  import React, { useCallback } from 'react';
11
8
 
12
- import { Function } from '@dxos/functions';
9
+ import * as OperationModule from '@dxos/compute';
10
+ import { Context } from '@dxos/context';
11
+ import { Filter, Obj } from '@dxos/echo';
13
12
  import { getDeployedFunctions } from '@dxos/functions-runtime/edge';
14
13
  import { useClient } from '@dxos/react-client';
15
- import { Filter, Query, type Space, useQuery } from '@dxos/react-client/echo';
16
- import { useAsyncEffect } from '@dxos/react-ui';
17
- import { IconButton, useTranslation } from '@dxos/react-ui';
18
- import { controlItemClasses } from '@dxos/react-ui-form';
14
+ import { type Space, useQuery } from '@dxos/react-client/echo';
15
+ import { IconButton, useAsyncEffect, useTranslation } from '@dxos/react-ui';
16
+ import { Settings } from '@dxos/react-ui-form';
19
17
  import { List } from '@dxos/react-ui-list';
20
- import { ghostHover, mx } from '@dxos/react-ui-theme';
18
+ import { ghostHover, mx } from '@dxos/ui-theme';
21
19
 
22
- import { meta } from '../../meta';
20
+ import { meta } from '#meta';
23
21
 
24
- const grid = 'grid grid-cols-[1fr_1fr_auto] min-bs-[2.5rem]';
22
+ const grid = 'grid grid-cols-[1fr_1fr_auto] min-h-[2.5rem]';
25
23
 
26
24
  type FunctionsRegistryProps = {
27
25
  space: Space;
@@ -30,17 +28,18 @@ type FunctionsRegistryProps = {
30
28
  export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
31
29
  const client = useClient();
32
30
  const [loading, setLoading] = useState(true);
33
- const [functions, setFunctions] = useState<Function.Function[]>([]);
31
+ const [functions, setFunctions] = useState<OperationModule.Operation.PersistentOperation[]>([]);
34
32
  const { t } = useTranslation(meta.id);
35
33
 
36
- const dbFunctions = useQuery(space, Filter.type(Function.Function));
34
+ const dbFunctions = useQuery(space.db, Filter.type(OperationModule.Operation.PersistentOperation));
37
35
 
38
- const state = (func: Function.Function) => {
39
- const dbFunction = dbFunctions.find((f) => f.key === func.key);
36
+ const state = (func: OperationModule.Operation.PersistentOperation) => {
37
+ const funcKey = Obj.getMeta(func).key;
38
+ const dbFunction = dbFunctions.find((f) => Obj.getMeta(f).key === funcKey);
40
39
  if (!dbFunction) {
41
40
  return 'import';
42
41
  }
43
- if (dbFunction.version === func.version && dbFunction.updated === func.updated) {
42
+ if (Obj.getMeta(dbFunction).version === Obj.getMeta(func).version && dbFunction.updated === func.updated) {
44
43
  return 'none';
45
44
  }
46
45
  return 'update';
@@ -48,55 +47,51 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
48
47
 
49
48
  useAsyncEffect(async () => {
50
49
  setLoading(true);
51
- const functions = await getDeployedFunctions(client);
50
+ const functions = await getDeployedFunctions(Context.default(), client, true);
52
51
  setFunctions(functions);
53
52
  setLoading(false);
54
53
  }, []);
55
54
 
56
- const dedupedFunctions = EffectFunction.pipe(
57
- functions,
58
- Array.filter((_) => _.key !== undefined),
59
- Array.sort(Order.reverse(Order.mapInput(Order.string, (_: Function.Function) => _.updated ?? ''))),
60
- Array.dedupeWith((self, that) => self.key === that.key),
61
- Array.sort(Order.mapInput(Order.string, (_: Function.Function) => _.key ?? '')),
62
- );
63
-
64
55
  const hanleImportOrUpdate = useCallback(
65
- async (func: Function.Function) => {
66
- const {
67
- objects: [existingFunc],
68
- } = await space.db.query(Query.type(Function.Function, { key: func.key })).run();
56
+ async (func: OperationModule.Operation.PersistentOperation) => {
57
+ const funcKey = Obj.getMeta(func).key;
58
+ const functions = funcKey
59
+ ? await space.db
60
+ .query(Filter.and(Filter.type(OperationModule.Operation.PersistentOperation), Filter.key(funcKey)))
61
+ .run()
62
+ : [];
63
+ const [existingFunc] = functions;
69
64
  if (!existingFunc) {
70
65
  space.db.add(func);
71
66
  return;
72
67
  }
73
- Function.setFrom(existingFunc, func);
68
+ OperationModule.Operation.setFrom(existingFunc, func);
74
69
  },
75
70
  [space],
76
71
  );
77
72
 
78
73
  return (
79
- <div role='none' className={mx(controlItemClasses)}>
80
- {dedupedFunctions.length > 0 && (
81
- <List.Root<Function.Function>
82
- items={dedupedFunctions}
83
- isItem={Schema.is(Function.Function)}
74
+ <Settings.Panel>
75
+ {functions.length > 0 && (
76
+ <List.Root<OperationModule.Operation.PersistentOperation>
77
+ items={functions}
78
+ isItem={Schema.is(OperationModule.Operation.PersistentOperation)}
84
79
  getId={(func) => func.id}
85
80
  >
86
81
  {({ items }) => (
87
- <div role='list' className='flex flex-col is-full'>
82
+ <div role='list' className='flex flex-col w-full'>
88
83
  {items?.map((func) => (
89
- <List.Item<Function.Function>
84
+ <List.Item<OperationModule.Operation.PersistentOperation>
90
85
  key={func.id}
91
86
  item={func}
92
- classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}
87
+ classNames={mx(grid, ghostHover, 'items-center', 'px-2', 'min-h-[3rem]')}
93
88
  >
94
89
  <div className='flex flex-col truncate'>
95
90
  <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
96
- <div className='text-xs text-description truncate'>{func.key}</div>
91
+ <div className='text-xs text-description truncate'>{Obj.getMeta(func).key}</div>
97
92
  </div>
98
93
  <div className='flex flex-col truncate'>
99
- <div className='text-xs text-description truncate'>{func.version}</div>
94
+ <div className='text-xs text-description truncate'>{Obj.getMeta(func).version}</div>
100
95
  <div className='text-xs text-description truncate'>
101
96
  {func.updated ? `Uploaded ${new Date(func.updated).toLocaleString()}` : ''}
102
97
  </div>
@@ -106,7 +101,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
106
101
  iconOnly
107
102
  icon={state(func) === 'update' ? 'ph--arrows-clockwise--regular' : 'ph--download--regular'}
108
103
  label={
109
- state(func) === 'update' ? t('update function button label') : t('import function button label')
104
+ state(func) === 'update' ? t('update-function-button.label') : t('import-function-button.label')
110
105
  }
111
106
  disabled={state(func) === 'none'}
112
107
  onClick={() => hanleImportOrUpdate(func)}
@@ -118,10 +113,7 @@ export const FunctionsRegistry = ({ space }: FunctionsRegistryProps) => {
118
113
  </List.Root>
119
114
  )}
120
115
 
121
- {dedupedFunctions.length === 0 && !loading && (
122
- <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>
123
- )}
124
- {loading && <div className='text-center plb-4 text-gray-500'>{t('loading functions')}</div>}
125
- </div>
116
+ {loading && <div className='text-center py-4 text-gray-500'>{t('loading-functions.message')}</div>}
117
+ </Settings.Panel>
126
118
  );
127
119
  };
@@ -2,4 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export { FunctionsRegistry } from './FunctionsRegistry';
5
+ import { FunctionsRegistry } from './FunctionsRegistry';
6
+
7
+ export { FunctionsRegistry };
8
+ export default FunctionsRegistry;
@@ -2,29 +2,26 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import type * as SchemaAST from 'effect/SchemaAST';
5
6
  import React, { useCallback, useMemo } from 'react';
6
7
 
7
- import { Ref, Type } from '@dxos/echo';
8
+ import { type Operation } from '@dxos/compute';
9
+ import { type Database, JsonSchema, Obj, Ref } from '@dxos/echo';
8
10
  import { type JsonPath } from '@dxos/echo/internal';
9
- import { type Function } from '@dxos/functions';
10
- import { useOnTransition } from '@dxos/react-ui';
11
- import { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';
11
+ import { useOnTransition, useTranslation } from '@dxos/react-ui';
12
+ import { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';
13
+
14
+ import { meta } from '#meta';
12
15
 
13
16
  export type FunctionInputEditorProps = {
14
- functions: Function.Function[];
15
- onQueryRefOptions: QueryRefOptions;
16
- } & FormInputStateProps;
17
+ type: SchemaAST.AST;
18
+ functions: Operation.PersistentOperation[];
19
+ db?: Database.Database;
20
+ } & FormFieldStateProps;
17
21
 
18
- /**
19
- * Editor component for function input parameters.
20
- */
21
- export const FunctionInputEditor = ({
22
- functions,
23
- getValue,
24
- onValueChange,
25
- onQueryRefOptions,
26
- }: FunctionInputEditorProps) => {
27
- const selectedFunctionValue = useFormValues(['function' as JsonPath]);
22
+ export const FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }: FunctionInputEditorProps) => {
23
+ const { t } = useTranslation(meta.id);
24
+ const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, ['function' as JsonPath]);
28
25
  const selectedFunctionId = useMemo(() => {
29
26
  if (Ref.isRef(selectedFunctionValue)) {
30
27
  return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);
@@ -47,20 +44,22 @@ export const FunctionInputEditor = ({
47
44
  return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
48
45
  },
49
46
  (currValue) => currValue !== undefined,
50
- () => onValueChange('object', {}),
47
+ () => onValueChange(type, {}),
51
48
  );
52
49
 
53
50
  const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);
54
- const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);
51
+ const effectSchema = useMemo(() => (inputSchema ? JsonSchema.toEffectSchema(inputSchema) : undefined), [inputSchema]);
55
52
  const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
53
+ const defaultValues = useMemo(() => {
54
+ const raw = getValue() ?? {};
55
+ return Obj.isObject(raw) ? { ...Obj.getSnapshot(raw) } : { ...raw };
56
+ }, [getValue]);
56
57
 
57
- const values = useMemo(() => getValue() ?? {}, [getValue]);
58
-
59
- const handleValuesChanged = useCallback(
60
- (values: any) => {
61
- onValueChange('object', values);
58
+ const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(
59
+ (values) => {
60
+ onValueChange(type, values);
62
61
  },
63
- [onValueChange],
62
+ [type, onValueChange],
64
63
  );
65
64
 
66
65
  if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {
@@ -69,16 +68,18 @@ export const FunctionInputEditor = ({
69
68
 
70
69
  return (
71
70
  <>
72
- <h3 className='text-md'>Function parameters</h3>
73
- {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.
74
- This would allow errors to flow up to the root context. */}
75
- <Form
71
+ <Form.Label label={t('function-parameters.label')} asChild />
72
+ <Form.Root
73
+ key={selectedFunction.id}
76
74
  schema={effectSchema}
77
- values={values}
75
+ defaultValues={defaultValues}
76
+ db={db}
78
77
  onValuesChanged={handleValuesChanged}
79
- onQueryRefOptions={onQueryRefOptions}
80
- outerSpacing={false}
81
- />
78
+ >
79
+ <Form.FieldSet />
80
+ </Form.Root>
82
81
  </>
83
82
  );
84
83
  };
84
+
85
+ FunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';
@@ -4,38 +4,33 @@
4
4
 
5
5
  import React, { useCallback, useMemo } from 'react';
6
6
 
7
+ import { Trigger } from '@dxos/compute';
7
8
  import { Filter, Query } from '@dxos/echo';
8
- import { Trigger } from '@dxos/functions';
9
9
  import { useTranslation } from '@dxos/react-ui';
10
- import { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';
10
+ import { type FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';
11
11
 
12
- import { meta } from '../../meta';
12
+ import { meta } from '#meta';
13
13
 
14
- export type SpecSelectorProps = InputProps;
14
+ export type SpecSelectorProps = FormFieldComponentProps;
15
15
 
16
16
  export const SpecSelector = (props: SpecSelectorProps) => {
17
17
  const { t } = useTranslation(meta.id);
18
- const specProps = useInputProps(['spec' satisfies keyof Trigger.Trigger]);
18
+ const specProps = useFormFieldState(SpecSelector.displayName, ['spec' satisfies keyof Trigger.Trigger]);
19
19
 
20
20
  const handleTypeChange = useCallback(
21
21
  (_type: any, value: string): Trigger.Spec | undefined => {
22
22
  const getDefaultTriggerSpec = (kind: string) => {
23
23
  switch (kind) {
24
24
  case 'timer':
25
- return { kind: 'timer', cron: '' };
25
+ return Trigger.specTimer('');
26
26
  case 'subscription':
27
- return {
28
- kind: 'subscription',
29
- query: {
30
- ast: Query.select(Filter.nothing()).ast,
31
- },
32
- };
27
+ return Trigger.specSubscription(Query.select(Filter.nothing()));
33
28
  case 'queue':
34
- return { kind: 'queue', queue: 'dxn:' };
29
+ return Trigger.specQueue('dxn:queue:default');
35
30
  case 'email':
36
- return { kind: 'email' };
31
+ return Trigger.specEmail();
37
32
  case 'webhook':
38
- return { kind: 'webhook' };
33
+ return Trigger.specWebhook();
39
34
  default:
40
35
  return undefined;
41
36
  }
@@ -47,19 +42,30 @@ export const SpecSelector = (props: SpecSelectorProps) => {
47
42
  }
48
43
 
49
44
  // Update the entire spec object, not just the `spec.kind`.
50
- specProps.onValueChange('object', defaultSpec);
45
+ specProps.onValueChange(props.type, defaultSpec);
51
46
  },
52
- [specProps],
47
+ [props.type, specProps],
53
48
  );
54
49
 
50
+ const kindLabels: Record<string, string> = {
51
+ timer: t('trigger-type.timer.label'),
52
+ webhook: t('trigger-type.webhook.label'),
53
+ websocket: t('trigger-type.websocket.label'),
54
+ subscription: t('trigger-type.subscription.label'),
55
+ email: t('trigger-type.email.label'),
56
+ queue: t('trigger-type.queue.label'),
57
+ };
58
+
55
59
  const options = useMemo(
56
60
  () =>
57
61
  Trigger.Kinds.map((kind) => ({
58
62
  value: kind,
59
- label: t(`trigger type ${kind}`),
63
+ label: kindLabels[kind],
60
64
  })),
61
65
  [t],
62
66
  );
63
67
 
64
- return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;
68
+ return <SelectField {...props} options={options} onValueChange={handleTypeChange} />;
65
69
  };
70
+
71
+ SpecSelector.displayName = 'Form.SpecSelector';
@@ -4,20 +4,21 @@
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 { TestSchema, 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
 
@@ -25,27 +26,27 @@ const types = [
25
26
  // TODO(burdon): Get label from annotation.
26
27
  { value: Organization.Organization.typename, label: 'Organization' },
27
28
  { value: Person.Person.typename, label: 'Person' },
28
- { value: Type.getTypename(Project.Project), label: 'Project' },
29
+ { value: Type.getTypename(Pipeline.Pipeline), label: 'Project' },
29
30
  { value: Employer.Employer.typename, 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, TestSchema.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
106
  Obj.make(TestSchema.ContactType, {
98
- name: faker.person.fullName(),
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,44 @@ 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 DXN field (the queue address). DXN is a combobox, not an input, so use getByText.
169
+ await selectKind(combobox, 'f');
170
+ await expect(canvas.findByText('DXN')).resolves.toBeInTheDocument();
171
+ },
172
+ };