@dxos/plugin-automation 0.8.4-main.ae835ea → 0.8.4-main.bc674ce

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 (286) hide show
  1. package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +56 -0
  3. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +7 -0
  4. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +129 -0
  5. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-HFCK3JRB.mjs → FunctionsPanel-ZX4J75UM.mjs} +3 -3
  7. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +84 -0
  8. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +7 -0
  9. package/dist/lib/browser/{chunk-XXZNGORC.mjs → chunk-54PANILA.mjs} +5 -5
  10. package/dist/lib/browser/chunk-BFUIVUQH.mjs +102 -0
  11. package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-BKFQBKYO.mjs +8 -0
  13. package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +7 -0
  14. package/dist/lib/browser/chunk-JOXPQ27I.mjs +83 -0
  15. package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +7 -0
  16. package/dist/lib/browser/{chunk-LZQFZO3B.mjs → chunk-PZNBEKO5.mjs} +1 -1
  17. package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-QW3EM35H.mjs +248 -0
  19. package/dist/lib/browser/chunk-QW3EM35H.mjs.map +7 -0
  20. package/dist/lib/browser/chunk-RAF2FJST.mjs +86 -0
  21. package/dist/lib/browser/chunk-RAF2FJST.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-YWLEY2FD.mjs +200 -0
  23. package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +7 -0
  24. package/dist/lib/browser/cli/index.mjs +1107 -0
  25. package/dist/lib/browser/cli/index.mjs.map +7 -0
  26. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +114 -0
  27. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +7 -0
  28. package/dist/lib/browser/hooks/index.mjs +5 -3
  29. package/dist/lib/browser/index.mjs +53 -57
  30. package/dist/lib/browser/index.mjs.map +4 -4
  31. package/dist/lib/browser/meta.json +1 -1
  32. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +82 -0
  33. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +7 -0
  34. package/dist/lib/browser/{react-surface-WPMY3EX2.mjs → react-surface-EV3AC62F.mjs} +13 -11
  35. package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +10 -4
  37. package/dist/lib/node-esm/{AutomationPanel-NVEIUIZP.mjs → AutomationPanel-B7NAGDFA.mjs} +4 -4
  38. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +57 -0
  39. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +7 -0
  40. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +130 -0
  41. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +7 -0
  42. package/dist/lib/node-esm/{FunctionsPanel-74ELGR7P.mjs → FunctionsPanel-SS6GIVNU.mjs} +3 -3
  43. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +85 -0
  44. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +201 -0
  46. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +7 -0
  47. package/dist/lib/node-esm/{chunk-CEVIVRTY.mjs → chunk-5FXNN3MV.mjs} +1 -1
  48. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
  49. package/dist/lib/node-esm/{chunk-U5Q2NI7H.mjs → chunk-7QRUPEHH.mjs} +5 -5
  50. package/dist/lib/node-esm/chunk-HQLVREIX.mjs +87 -0
  51. package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +7 -0
  52. package/dist/lib/node-esm/chunk-K7GCM342.mjs +10 -0
  53. package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +7 -0
  54. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +103 -0
  55. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +249 -0
  57. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-RX52VKI2.mjs +84 -0
  59. package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +7 -0
  60. package/dist/lib/node-esm/cli/index.mjs +1108 -0
  61. package/dist/lib/node-esm/cli/index.mjs.map +7 -0
  62. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +115 -0
  63. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +7 -0
  64. package/dist/lib/node-esm/hooks/index.mjs +5 -3
  65. package/dist/lib/node-esm/index.mjs +53 -57
  66. package/dist/lib/node-esm/index.mjs.map +4 -4
  67. package/dist/lib/node-esm/meta.json +1 -1
  68. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +83 -0
  69. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +7 -0
  70. package/dist/lib/node-esm/{react-surface-Y2BBJV2I.mjs → react-surface-S6VZJCEZ.mjs} +13 -11
  71. package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +7 -0
  72. package/dist/lib/node-esm/types/index.mjs +10 -4
  73. package/dist/types/src/AutomationPlugin.d.ts +2 -1
  74. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
  76. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
  80. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/index.d.ts +4 -5
  84. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  85. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  86. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  87. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  88. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  89. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  90. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  91. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  92. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  93. package/dist/types/src/cli/commands/index.d.ts +2 -0
  94. package/dist/types/src/cli/commands/index.d.ts.map +1 -0
  95. package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
  96. package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
  97. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
  98. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
  99. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
  100. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
  101. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
  102. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
  103. package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
  104. package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
  105. package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
  106. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
  107. package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
  108. package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
  109. package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
  110. package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
  111. package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
  112. package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
  113. package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
  114. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
  115. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
  116. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
  117. package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
  118. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
  119. package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
  120. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
  121. package/dist/types/src/cli/index.d.ts +2 -0
  122. package/dist/types/src/cli/index.d.ts.map +1 -0
  123. package/dist/types/src/cli/plugin.d.ts +3 -0
  124. package/dist/types/src/cli/plugin.d.ts.map +1 -0
  125. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
  126. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  127. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +3 -0
  128. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  129. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
  130. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  131. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
  132. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
  133. package/dist/types/src/components/FunctionsRegistry/index.d.ts +2 -0
  134. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
  135. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +10 -7
  136. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  137. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
  138. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  139. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +7 -6
  140. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  141. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +72 -2
  142. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  143. package/dist/types/src/components/TriggerSettings.d.ts +3 -3
  144. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -1
  145. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -4
  146. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  147. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -2
  148. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  149. package/dist/types/src/index.d.ts +1 -2
  150. package/dist/types/src/index.d.ts.map +1 -1
  151. package/dist/types/src/meta.d.ts +2 -2
  152. package/dist/types/src/meta.d.ts.map +1 -1
  153. package/dist/types/src/testing/test-functions.d.ts +202 -3
  154. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  155. package/dist/types/src/translations.d.ts +3 -0
  156. package/dist/types/src/translations.d.ts.map +1 -1
  157. package/dist/types/src/types/capabilities.d.ts +22 -0
  158. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  159. package/dist/types/src/types/events.d.ts +5 -0
  160. package/dist/types/src/types/events.d.ts.map +1 -0
  161. package/dist/types/src/types/index.d.ts +2 -0
  162. package/dist/types/src/types/index.d.ts.map +1 -1
  163. package/dist/types/src/types/schema.d.ts +30 -1
  164. package/dist/types/src/types/schema.d.ts.map +1 -1
  165. package/dist/types/tsconfig.tsbuildinfo +1 -1
  166. package/package.json +61 -47
  167. package/src/AutomationPlugin.tsx +13 -33
  168. package/src/capabilities/app-graph-builder/app-graph-builder.ts +71 -0
  169. package/src/capabilities/app-graph-builder/index.ts +7 -0
  170. package/src/capabilities/compute-runtime/compute-runtime.ts +133 -0
  171. package/src/capabilities/compute-runtime/index.ts +7 -0
  172. package/src/capabilities/index.ts +4 -8
  173. package/src/capabilities/operation-resolver/index.ts +7 -0
  174. package/src/capabilities/operation-resolver/operation-resolver.ts +79 -0
  175. package/src/capabilities/react-surface/index.ts +7 -0
  176. package/src/capabilities/react-surface/react-surface.tsx +60 -0
  177. package/src/cli/commands/index.ts +5 -0
  178. package/src/cli/commands/trigger/create/index.ts +14 -0
  179. package/src/cli/commands/trigger/create/queue.ts +89 -0
  180. package/src/cli/commands/trigger/create/subscription.ts +128 -0
  181. package/src/cli/commands/trigger/create/timer.ts +93 -0
  182. package/src/cli/commands/trigger/index.ts +16 -0
  183. package/src/cli/commands/trigger/list.ts +67 -0
  184. package/src/cli/commands/trigger/options.ts +59 -0
  185. package/src/cli/commands/trigger/remove.ts +45 -0
  186. package/src/cli/commands/trigger/update/index.ts +14 -0
  187. package/src/cli/commands/trigger/update/queue.ts +195 -0
  188. package/src/cli/commands/trigger/update/subscription.ts +278 -0
  189. package/src/cli/commands/trigger/update/timer.ts +193 -0
  190. package/src/cli/commands/trigger/util.ts +395 -0
  191. package/src/cli/index.ts +5 -0
  192. package/src/cli/plugin.ts +23 -0
  193. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +1 -1
  194. package/src/components/AutomationPanel/AutomationPanel.tsx +51 -22
  195. package/src/components/AutomationSettings.tsx +1 -1
  196. package/src/components/FunctionsContainer.tsx +7 -0
  197. package/src/components/FunctionsPanel/FunctionsPanel.tsx +14 -12
  198. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +111 -0
  199. package/src/components/FunctionsRegistry/index.ts +5 -0
  200. package/src/components/TriggerEditor/FunctionInputEditor.tsx +23 -31
  201. package/src/components/TriggerEditor/SpecSelector.tsx +8 -6
  202. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +33 -29
  203. package/src/components/TriggerEditor/TriggerEditor.tsx +56 -43
  204. package/src/components/TriggerSettings.tsx +3 -3
  205. package/src/hooks/useComputeRuntimeCallback.ts +43 -8
  206. package/src/hooks/useTriggerRuntimeControls.ts +9 -8
  207. package/src/index.ts +1 -2
  208. package/src/meta.ts +2 -2
  209. package/src/testing/test-functions.ts +2 -2
  210. package/src/translations.ts +4 -0
  211. package/src/{capabilities → types}/capabilities.ts +8 -14
  212. package/src/types/events.ts +11 -0
  213. package/src/types/index.ts +2 -0
  214. package/src/types/schema.ts +23 -2
  215. package/dist/lib/browser/AutomationPanel-LBXJDM6Z.mjs +0 -11
  216. package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs +0 -68
  217. package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs.map +0 -7
  218. package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs +0 -36
  219. package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs.map +0 -7
  220. package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs +0 -81
  221. package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-CVYJM6OO.mjs +0 -66
  223. package/dist/lib/browser/chunk-CVYJM6OO.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-FHSN7G4H.mjs +0 -107
  225. package/dist/lib/browser/chunk-FHSN7G4H.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-GCGHLQM2.mjs +0 -15
  227. package/dist/lib/browser/chunk-GCGHLQM2.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
  229. package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-K5YNWESC.mjs +0 -183
  231. package/dist/lib/browser/chunk-K5YNWESC.mjs.map +0 -7
  232. package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
  233. package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
  234. package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
  235. package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs +0 -114
  236. package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs.map +0 -7
  237. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
  238. package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
  239. package/dist/lib/browser/react-surface-WPMY3EX2.mjs.map +0 -7
  240. package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs +0 -69
  241. package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs.map +0 -7
  242. package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs +0 -37
  243. package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs.map +0 -7
  244. package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs +0 -82
  245. package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs.map +0 -7
  246. package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs +0 -67
  247. package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs.map +0 -7
  248. package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
  249. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
  250. package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
  251. package/dist/lib/node-esm/chunk-JOCKHLFT.mjs +0 -108
  252. package/dist/lib/node-esm/chunk-JOCKHLFT.mjs.map +0 -7
  253. package/dist/lib/node-esm/chunk-MRYKW5TM.mjs +0 -16
  254. package/dist/lib/node-esm/chunk-MRYKW5TM.mjs.map +0 -7
  255. package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
  256. package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
  257. package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs +0 -184
  258. package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs.map +0 -7
  259. package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs +0 -115
  260. package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs.map +0 -7
  261. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
  262. package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
  263. package/dist/lib/node-esm/react-surface-Y2BBJV2I.mjs.map +0 -7
  264. package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
  265. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
  266. package/dist/types/src/capabilities/capabilities.d.ts +0 -19
  267. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  268. package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
  269. package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
  270. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  271. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  272. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  273. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  274. package/dist/types/src/events.d.ts +0 -4
  275. package/dist/types/src/events.d.ts.map +0 -1
  276. package/src/capabilities/app-graph-builder.ts +0 -87
  277. package/src/capabilities/compute-runtime.ts +0 -138
  278. package/src/capabilities/intent-resolver.ts +0 -72
  279. package/src/capabilities/react-surface.tsx +0 -55
  280. package/src/events.ts +0 -11
  281. /package/dist/lib/browser/{AutomationPanel-LBXJDM6Z.mjs.map → AutomationPanel-FAS6ADCW.mjs.map} +0 -0
  282. /package/dist/lib/browser/{FunctionsPanel-HFCK3JRB.mjs.map → FunctionsPanel-ZX4J75UM.mjs.map} +0 -0
  283. /package/dist/lib/browser/{chunk-XXZNGORC.mjs.map → chunk-54PANILA.mjs.map} +0 -0
  284. /package/dist/lib/node-esm/{AutomationPanel-NVEIUIZP.mjs.map → AutomationPanel-B7NAGDFA.mjs.map} +0 -0
  285. /package/dist/lib/node-esm/{FunctionsPanel-74ELGR7P.mjs.map → FunctionsPanel-SS6GIVNU.mjs.map} +0 -0
  286. /package/dist/lib/node-esm/{chunk-U5Q2NI7H.mjs.map → chunk-7QRUPEHH.mjs.map} +0 -0
@@ -1,67 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- AutomationCapabilities
4
- } from "./chunk-MRYKW5TM.mjs";
5
-
6
- // src/hooks/useComputeRuntimeCallback.ts
7
- import { useCallback } from "react";
8
- import { useCapability } from "@dxos/app-framework";
9
-
10
- // src/capabilities/index.ts
11
- import { lazy } from "@dxos/app-framework";
12
- var AppGraphBuilder = lazy(() => import("./app-graph-builder-RTOFJNFV.mjs"));
13
- var ComputeRuntime = lazy(() => import("./compute-runtime-IXCSD3W7.mjs"));
14
- var IntentResolver = lazy(() => import("./intent-resolver-KDRYB5BC.mjs"));
15
- var ReactSurface = lazy(() => import("./react-surface-Y2BBJV2I.mjs"));
16
-
17
- // src/hooks/useComputeRuntimeCallback.ts
18
- var useComputeRuntimeCallback = (space, fn, deps) => {
19
- const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
20
- const runtime = space !== void 0 ? computeRuntime.getRuntime(space.id) : void 0;
21
- return useCallback(() => {
22
- if (!runtime) {
23
- throw new TypeError("Space not provided to useComputeRuntimeCallback");
24
- }
25
- return runtime.runPromise(fn());
26
- }, [
27
- runtime,
28
- ...deps ?? []
29
- ]);
30
- };
31
-
32
- // src/hooks/useTriggerRuntimeControls.ts
33
- import * as Effect from "effect/Effect";
34
- import { Filter } from "@dxos/echo";
35
- import { Trigger, TriggerDispatcher } from "@dxos/functions";
36
- import { useQuery } from "@dxos/react-client/echo";
37
- import { useAsyncState } from "@dxos/react-ui";
38
- var useTriggerRuntimeControls = (space) => {
39
- const triggers = useQuery(space, Filter.type(Trigger.Trigger));
40
- const [isRunningState, setIsRunningState] = useAsyncState(useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))));
41
- const start = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
42
- const dispatcher = yield* TriggerDispatcher;
43
- yield* dispatcher.start();
44
- setIsRunningState(true);
45
- }));
46
- const stop = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
47
- const dispatcher = yield* TriggerDispatcher;
48
- yield* dispatcher.stop();
49
- setIsRunningState(false);
50
- }));
51
- return {
52
- triggers,
53
- isRunning: isRunningState ?? false,
54
- start: () => void start(),
55
- stop: () => void stop()
56
- };
57
- };
58
-
59
- export {
60
- useComputeRuntimeCallback,
61
- useTriggerRuntimeControls,
62
- AppGraphBuilder,
63
- ComputeRuntime,
64
- IntentResolver,
65
- ReactSurface
66
- };
67
- //# sourceMappingURL=chunk-3BJ6BR3E.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/hooks/useComputeRuntimeCallback.ts", "../../../src/capabilities/index.ts", "../../../src/hooks/useTriggerRuntimeControls.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as Effect from 'effect/Effect';\nimport { useCallback } from 'react';\n\nimport { useCapability } from '@dxos/app-framework';\nimport type { Space } from '@dxos/react-client/echo';\n\nimport { AutomationCapabilities } from '../capabilities';\n\n/**\n * Create an effectful function that has access to compute services\n */\n// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).\nexport const useComputeRuntimeCallback = <T>(\n space: Space | undefined,\n fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,\n deps?: React.DependencyList,\n): (() => Promise<T>) => {\n const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);\n const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;\n\n return useCallback(() => {\n if (!runtime) {\n throw new TypeError('Space not provided to useComputeRuntimeCallback');\n }\n\n return runtime.runPromise(fn());\n }, [runtime, ...(deps ?? [])]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const ComputeRuntime = lazy(() => import('./compute-runtime'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n\nexport * from './capabilities';\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Filter } from '@dxos/echo';\nimport { Trigger, TriggerDispatcher } from '@dxos/functions';\nimport { type Space, useQuery } from '@dxos/react-client/echo';\nimport { useAsyncState } from '@dxos/react-ui';\n\nimport { useComputeRuntimeCallback } from './useComputeRuntimeCallback';\n\ninterface TriggerRuntimeControls {\n triggers: Trigger.Trigger[];\n isRunning: boolean;\n start: () => void;\n stop: () => void;\n}\n\nexport const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {\n const triggers = useQuery(space, Filter.type(Trigger.Trigger));\n\n const [isRunningState, setIsRunningState] = useAsyncState(\n useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),\n );\n\n const start = useComputeRuntimeCallback(\n space,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.start();\n setIsRunningState(true);\n }),\n );\n\n const stop = useComputeRuntimeCallback(\n space,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.stop();\n setIsRunningState(false);\n }),\n );\n\n return {\n triggers,\n isRunning: isRunningState ?? false,\n start: () => void start(),\n stop: () => void stop(),\n };\n};\n"],
5
- "mappings": ";;;;;;AAKA,SAASA,mBAA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AAkB,KAAA;EACpB,CAAA,CAAA;AAGF,SAAO;IACLN;IACAkB,WAAWb,kBAAkB;IAC7BS,OAAO,MAAM,KAAKA,MAAAA;IAClBG,MAAM,MAAM,KAAKA,KAAAA;EACnB;AACF;",
6
- "names": ["useCallback", "useCapability", "lazy", "AppGraphBuilder", "lazy", "ComputeRuntime", "IntentResolver", "ReactSurface", "useComputeRuntimeCallback", "space", "fn", "deps", "computeRuntime", "useCapability", "AutomationCapabilities", "ComputeRuntime", "runtime", "undefined", "getRuntime", "id", "useCallback", "TypeError", "runPromise", "Effect", "Filter", "Trigger", "TriggerDispatcher", "useQuery", "useAsyncState", "useTriggerRuntimeControls", "space", "triggers", "useQuery", "Filter", "type", "Trigger", "isRunningState", "setIsRunningState", "useAsyncState", "useComputeRuntimeCallback", "TriggerDispatcher", "pipe", "map", "t", "running", "start", "fnUntraced", "dispatcher", "stop", "isRunning"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/automation',\n name: 'Automation',\n description: trim`\n Workflow automation engine that triggers custom actions based on object events and conditions.\n Create automated pipelines that respond to changes and streamline repetitive tasks.\n `,\n icon: 'ph--robot--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',\n};\n"],
5
- "mappings": ";;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source"]
7
- }
@@ -1,39 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-CEVIVRTY.mjs";
5
-
6
- // src/types/schema.ts
7
- import * as Schema from "effect/Schema";
8
- import { SpaceSchema } from "@dxos/react-client/echo";
9
- var TriggerTemplate = Schema.Union(Schema.Struct({
10
- type: Schema.Literal("timer"),
11
- cron: Schema.String
12
- }), Schema.Struct({
13
- type: Schema.Literal("queue"),
14
- queueDXN: Schema.Any
15
- }));
16
- (function(AutomationAction2) {
17
- class CreateTriggerFromTemplate extends Schema.TaggedClass()(`${meta.id}/action/create-trigger-from-template`, {
18
- input: Schema.Struct({
19
- space: SpaceSchema,
20
- template: TriggerTemplate,
21
- enabled: Schema.optional(Schema.Boolean),
22
- // TODO(wittjosiah): Improve how this lookup is done.
23
- scriptName: Schema.optional(Schema.String),
24
- input: Schema.optional(Schema.Record({
25
- key: Schema.String,
26
- value: Schema.Any
27
- }))
28
- }),
29
- output: Schema.Void
30
- }) {
31
- }
32
- AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
33
- })(AutomationAction || (AutomationAction = {}));
34
- var AutomationAction;
35
-
36
- export {
37
- AutomationAction
38
- };
39
- //# sourceMappingURL=chunk-ECJKIUBO.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/schema.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { SpaceSchema } from '@dxos/react-client/echo';\n\nimport { meta } from '../meta';\n\nconst TriggerTemplate = Schema.Union(\n Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),\n Schema.Struct({ type: Schema.Literal('queue'), queueDXN: Schema.Any }),\n);\n\nexport namespace AutomationAction {\n export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(\n `${meta.id}/action/create-trigger-from-template`,\n {\n input: Schema.Struct({\n space: SpaceSchema,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\n // TODO(wittjosiah): Improve how this lookup is done.\n scriptName: Schema.optional(Schema.String),\n input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),\n }),\n output: Schema.Void,\n },\n ) {}\n}\n"],
5
- "mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,mBAAmB;AAI5B,IAAMC,kBAAyBC,aACtBC,cAAO;EAAEC,MAAaC,eAAQ,OAAA;EAAUC,MAAaC;AAAO,CAAA,GAC5DJ,cAAO;EAAEC,MAAaC,eAAQ,OAAA;EAAUG,UAAiBC;AAAI,CAAA,CAAA;UAGrDC,mBAAAA;EACR,MAAMC,kCAAyCC,mBAAW,EAC/D,GAAGC,KAAKC,EAAE,wCACV;IACEC,OAAcZ,cAAO;MACnBa,OAAOC;MACPC,UAAUjB;MACVkB,SAAgBC,gBAAgBC,cAAO;;MAEvCC,YAAmBF,gBAAgBb,aAAM;MACzCQ,OAAcK,gBAAgBG,cAAO;QAAEC,KAAYjB;QAAQkB,OAAchB;MAAI,CAAA,CAAA;IAC/E,CAAA;IACAiB,QAAeC;EACjB,CAAA,EAAA;EACC;oBAbUhB,4BAAAA;AAcf,GAfiBD,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
6
- "names": ["Schema", "SpaceSchema", "TriggerTemplate", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "CreateTriggerFromTemplate", "TaggedClass", "meta", "id", "input", "space", "SpaceSchema", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "key", "value", "output", "Void"]
7
- }
@@ -1,108 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-CEVIVRTY.mjs";
5
-
6
- // src/components/FunctionsPanel/FunctionsPanel.tsx
7
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
8
- import * as Schema from "effect/Schema";
9
- import React, { useCallback, useMemo } from "react";
10
- import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
11
- import { Function, Script } from "@dxos/functions";
12
- import { SpaceAction } from "@dxos/plugin-space/types";
13
- import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
14
- import { Button, IconButton, useTranslation } from "@dxos/react-ui";
15
- import { controlItemClasses } from "@dxos/react-ui-form";
16
- import { List } from "@dxos/react-ui-list";
17
- import { ghostHover, mx } from "@dxos/react-ui-theme";
18
- var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
19
- var FunctionsPanel = ({ space }) => {
20
- var _effect = _useSignals();
21
- try {
22
- const { t } = useTranslation(meta.id);
23
- const functions = useQuery(space, Filter.type(Function.Function));
24
- const scripts = useQuery(space, Filter.type(Script.Script));
25
- const { dispatchPromise: dispatch } = useIntentDispatcher();
26
- const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
27
- const scriptId = func.source?.target?.id;
28
- if (scriptId) {
29
- const script = scripts.find((s) => s.id === scriptId);
30
- if (script) {
31
- map[func.id] = script;
32
- }
33
- }
34
- return map;
35
- }, {}), [
36
- functions,
37
- scripts
38
- ]);
39
- const getScriptName = useCallback((func) => {
40
- const script = functionToScriptMap[func.id];
41
- return script?.name;
42
- }, [
43
- functionToScriptMap
44
- ]);
45
- const handleGoToScript = useCallback((func) => {
46
- const script = functionToScriptMap[func.id];
47
- if (script) {
48
- void dispatch(createIntent(LayoutAction.Open, {
49
- part: "main",
50
- subject: [
51
- fullyQualifiedId(script)
52
- ]
53
- }));
54
- }
55
- }, [
56
- functionToScriptMap,
57
- dispatch
58
- ]);
59
- const handleDelete = useCallback((func) => dispatch(createIntent(SpaceAction.RemoveObjects, {
60
- objects: [
61
- func
62
- ]
63
- })), [
64
- dispatch
65
- ]);
66
- return /* @__PURE__ */ React.createElement("div", {
67
- role: "none",
68
- className: mx(controlItemClasses)
69
- }, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
70
- items: functions,
71
- isItem: Schema.is(Function.Function),
72
- getId: (func) => func.id
73
- }, ({ items }) => /* @__PURE__ */ React.createElement("div", {
74
- role: "list",
75
- className: "flex flex-col w-full"
76
- }, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
77
- key: func.id,
78
- item: func,
79
- classNames: mx(grid, ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
80
- }, /* @__PURE__ */ React.createElement("div", {
81
- className: "flex flex-col truncate"
82
- }, /* @__PURE__ */ React.createElement(List.ItemTitle, {
83
- classNames: "truncate"
84
- }, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
85
- className: "text-xs text-description truncate"
86
- }, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
87
- onClick: () => handleGoToScript(func)
88
- }, t("go to function source button label")), /* @__PURE__ */ React.createElement(IconButton, {
89
- iconOnly: true,
90
- icon: "ph--trash--regular",
91
- label: t("delete function button label"),
92
- onClick: () => handleDelete(func)
93
- }))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
94
- className: "text-center plb-4 text-gray-500"
95
- }, t("no functions found")));
96
- } finally {
97
- _effect.f();
98
- }
99
- };
100
-
101
- // src/components/FunctionsPanel/index.ts
102
- var FunctionsPanel_default = FunctionsPanel;
103
-
104
- export {
105
- FunctionsPanel,
106
- FunctionsPanel_default
107
- };
108
- //# sourceMappingURL=chunk-JOCKHLFT.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { Function, Script } from '@dxos/functions';\nimport { SpaceAction } from '@dxos/plugin-space/types';\nimport { Filter, type Space, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';\nimport { Button, IconButton, useTranslation } from '@dxos/react-ui';\nimport { controlItemClasses } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../../meta';\n\nconst grid = 'grid grid-cols-[1fr_auto] min-bs-[2.5rem]';\n\nexport type FunctionsPanelProps = {\n space: Space;\n};\n\nexport const FunctionsPanel = ({ space }: FunctionsPanelProps) => {\n const { t } = useTranslation(meta.id);\n const functions = useQuery(space, Filter.type(Function.Function));\n const scripts = useQuery(space, Filter.type(Script.Script));\n const { dispatchPromise: dispatch } = useIntentDispatcher();\n\n const functionToScriptMap = useMemo(\n () =>\n functions.reduce(\n (map, func) => {\n const scriptId = func.source?.target?.id;\n if (scriptId) {\n const script = scripts.find((s) => s.id === scriptId);\n if (script) {\n map[func.id] = script;\n }\n }\n return map;\n },\n {} as Record<string, Script.Script>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n if (script) {\n void dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [fullyQualifiedId(script)] }));\n }\n },\n [functionToScriptMap, dispatch],\n );\n\n const handleDelete = useCallback(\n (func: Function.Function) => dispatch(createIntent(SpaceAction.RemoveObjects, { objects: [func] })),\n [dispatch],\n );\n\n return (\n <div role='none' className={mx(controlItemClasses)}>\n {functions.length > 0 && (\n <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<Function.Function>\n key={func.id}\n item={func}\n classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}\n >\n <div className='flex flex-col truncate'>\n <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>\n {getScriptName(func) && (\n <div className='text-xs text-description truncate'>{getScriptName(func)}</div>\n )}\n </div>\n {functionToScriptMap[func.id] && (\n <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>\n )}\n <IconButton\n iconOnly\n icon='ph--trash--regular'\n label={t('delete function button label')}\n onClick={() => handleDelete(func)}\n />\n </List.Item>\n ))}\n </div>\n )}\n </List.Root>\n )}\n\n {functions.length === 0 && <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>}\n </div>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport * from './FunctionsPanel';\nexport default FunctionsPanel;\n"],
5
- "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,UAAUC,cAAc;AACjC,SAASC,mBAAmB;AAC5B,SAASC,QAAoBC,kBAAkBC,gBAAgB;AAC/D,SAASC,QAAQC,YAAYC,sBAAsB;AACnD,SAASC,0BAA0B;AACnC,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAI/B,IAAMC,OAAO;AAMN,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;;;AAC3D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAMC,YAAYC,SAASN,OAAOO,OAAOC,KAAKC,SAASA,QAAQ,CAAA;AAC/D,UAAMC,UAAUJ,SAASN,OAAOO,OAAOC,KAAKG,OAAOA,MAAM,CAAA;AACzD,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,UAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,YAAMC,WAAWD,KAAKE,QAAQC,QAAQlB;AACtC,UAAIgB,UAAU;AACZ,cAAMG,SAASb,QAAQc,KAAK,CAACC,MAAMA,EAAErB,OAAOgB,QAAAA;AAC5C,YAAIG,QAAQ;AACVL,cAAIC,KAAKf,EAAE,IAAImB;QACjB;MACF;AACA,aAAOL;IACT,GACA,CAAC,CAAA,GAEL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,KAC1B,sBAAA,cAACsD,QAAAA;MAAOC,SAAS,MAAM9B,iBAAiBV,IAAAA;OAAQlB,EAAE,oCAAA,CAAA,GAEpD,sBAAA,cAAC2D,YAAAA;MACCC,UAAAA;MACAC,MAAK;MACLC,OAAO9D,EAAE,8BAAA;MACT0D,SAAS,MAAMvB,aAAajB,IAAAA;YASzCd,UAAUwC,WAAW,KAAK,sBAAA,cAACL,OAAAA;MAAIE,WAAU;OAAmCzC,EAAE,oBAAA,CAAA,CAAA;;;;AAGrF;;;ACrGA,IAAA,yBAAe+D;",
6
- "names": ["Schema", "React", "useCallback", "useMemo", "LayoutAction", "createIntent", "useIntentDispatcher", "Function", "Script", "SpaceAction", "Filter", "fullyQualifiedId", "useQuery", "Button", "IconButton", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "meta", "id", "functions", "useQuery", "Filter", "type", "Function", "scripts", "Script", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "handleDelete", "SpaceAction", "RemoveObjects", "objects", "div", "role", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "IconButton", "iconOnly", "icon", "label", "FunctionsPanel"]
7
- }
@@ -1,16 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-CEVIVRTY.mjs";
5
-
6
- // src/capabilities/capabilities.ts
7
- import { defineCapability } from "@dxos/app-framework";
8
- (function(AutomationCapabilities2) {
9
- AutomationCapabilities2.ComputeRuntime = defineCapability(`${meta.id}/capability/compute-runtime`);
10
- })(AutomationCapabilities || (AutomationCapabilities = {}));
11
- var AutomationCapabilities;
12
-
13
- export {
14
- AutomationCapabilities
15
- };
16
- //# sourceMappingURL=chunk-MRYKW5TM.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/capabilities.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';\nimport { defineCapability } from '@dxos/app-framework';\nimport type {\n CredentialsService,\n DatabaseService,\n FunctionInvocationService,\n InvocationTracer,\n QueueService,\n TriggerDispatcher,\n TriggerStateStore,\n} from '@dxos/functions';\nimport type { SpaceId } from '@dxos/keys';\n\nimport { meta } from '../meta';\n\nexport namespace AutomationCapabilities {\n /**\n * Service stack for executing agents, functions, and triggers.\n */\n export type ComputeServices =\n | TriggerDispatcher\n | AiService.AiService\n | DatabaseService\n | QueueService\n | CredentialsService\n | FunctionInvocationService\n | InvocationTracer\n | TriggerStateStore\n // TODO(dmaretskyi): Those should be provided at AI-chat call site.\n | ToolResolverService\n | ToolExecutionService;\n\n export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;\n export interface ComputeRuntimeProvider {\n getRuntime(spaceId: SpaceId): ComputeRuntime;\n }\n\n /**\n * Runtime for executing agents, functions, and triggers.\n */\n export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);\n}\n"],
5
- "mappings": ";;;;;;AAOA,SAASA,wBAAwB;UAchBC,yBAAAA;0BAyBFC,iBAAiBC,iBAAyC,GAAGC,KAAKC,EAAE,6BAA6B;AAChH,GA1BiBJ,2BAAAA,yBAAAA,CAAAA,EAAAA;;",
6
- "names": ["defineCapability", "AutomationCapabilities", "ComputeRuntime", "defineCapability", "meta", "id"]
7
- }
@@ -1,268 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- meta
4
- } from "./chunk-CEVIVRTY.mjs";
5
-
6
- // src/components/TriggerEditor/TriggerEditor.tsx
7
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
8
- import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
9
- import { ComputeGraph } from "@dxos/conductor";
10
- import { Type as Type2 } from "@dxos/echo";
11
- import { Function, Script, Trigger as Trigger2 } from "@dxos/functions";
12
- import { Filter as Filter2, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
13
- import { Input } from "@dxos/react-ui";
14
- import { QueryForm } from "@dxos/react-ui-components";
15
- import { Form as Form2, InputHeader, SelectInput as SelectInput2, useRefQueryLookupHandler } from "@dxos/react-ui-form";
16
-
17
- // src/components/TriggerEditor/FunctionInputEditor.tsx
18
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
19
- import React, { useCallback, useMemo } from "react";
20
- import { Ref, Type } from "@dxos/echo";
21
- import { useOnTransition } from "@dxos/react-ui";
22
- import { Form, useFormValues } from "@dxos/react-ui-form";
23
- var FunctionInputEditor = ({ functions, getValue, onValueChange, onQueryRefOptions }) => {
24
- var _effect = _useSignals();
25
- try {
26
- const selectedFunctionValue = useFormValues([
27
- "function"
28
- ]);
29
- const selectedFunctionId = useMemo(() => {
30
- if (Ref.isRef(selectedFunctionValue)) {
31
- return selectedFunctionValue.dxn.toString().split("dxn:echo:@:").at(1);
32
- }
33
- }, [
34
- selectedFunctionValue
35
- ]);
36
- const selectedFunction = useMemo(() => functions.find((fn) => fn.id === selectedFunctionId), [
37
- functions,
38
- selectedFunctionId
39
- ]);
40
- useOnTransition(
41
- // Clear function parameter input when the function changes.
42
- selectedFunctionValue,
43
- (prevValue) => {
44
- if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
45
- return false;
46
- }
47
- return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
48
- },
49
- (currValue) => currValue !== void 0,
50
- () => onValueChange("object", {})
51
- );
52
- const inputSchema = useMemo(() => selectedFunction?.inputSchema, [
53
- selectedFunction
54
- ]);
55
- const effectSchema = useMemo(() => inputSchema ? Type.toEffectSchema(inputSchema) : void 0, [
56
- inputSchema
57
- ]);
58
- const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
59
- const values = useMemo(() => getValue() ?? {}, [
60
- getValue
61
- ]);
62
- const handleValuesChanged = useCallback((values2) => {
63
- onValueChange("object", values2);
64
- }, [
65
- onValueChange
66
- ]);
67
- if (selectedFunction === void 0 || effectSchema === void 0 || propertyCount === 0) {
68
- return null;
69
- }
70
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h3", {
71
- className: "text-md"
72
- }, "Function parameters"), /* @__PURE__ */ React.createElement(Form, {
73
- schema: effectSchema,
74
- values,
75
- onValuesChanged: handleValuesChanged,
76
- onQueryRefOptions,
77
- outerSpacing: false
78
- }));
79
- } finally {
80
- _effect.f();
81
- }
82
- };
83
-
84
- // src/components/TriggerEditor/SpecSelector.tsx
85
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
86
- import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
87
- import { Filter, Query } from "@dxos/echo";
88
- import { Trigger } from "@dxos/functions";
89
- import { useTranslation } from "@dxos/react-ui";
90
- import { SelectInput, useInputProps } from "@dxos/react-ui-form";
91
- var SpecSelector = (props) => {
92
- var _effect = _useSignals2();
93
- try {
94
- const { t } = useTranslation(meta.id);
95
- const specProps = useInputProps([
96
- "spec"
97
- ]);
98
- const handleTypeChange = useCallback2((_type, value) => {
99
- const getDefaultTriggerSpec = (kind) => {
100
- switch (kind) {
101
- case "timer":
102
- return {
103
- kind: "timer",
104
- cron: ""
105
- };
106
- case "subscription":
107
- return {
108
- kind: "subscription",
109
- query: {
110
- ast: Query.select(Filter.nothing()).ast
111
- }
112
- };
113
- case "queue":
114
- return {
115
- kind: "queue",
116
- queue: "dxn:"
117
- };
118
- case "email":
119
- return {
120
- kind: "email"
121
- };
122
- case "webhook":
123
- return {
124
- kind: "webhook"
125
- };
126
- default:
127
- return void 0;
128
- }
129
- };
130
- const defaultSpec = getDefaultTriggerSpec(value);
131
- if (!defaultSpec) {
132
- return;
133
- }
134
- specProps.onValueChange("object", defaultSpec);
135
- }, [
136
- specProps
137
- ]);
138
- const options = useMemo2(() => Trigger.Kinds.map((kind) => ({
139
- value: kind,
140
- label: t(`trigger type ${kind}`)
141
- })), [
142
- t
143
- ]);
144
- return /* @__PURE__ */ React2.createElement(SelectInput, {
145
- ...props,
146
- options,
147
- onValueChange: handleTypeChange
148
- });
149
- } finally {
150
- _effect.f();
151
- }
152
- };
153
-
154
- // src/components/TriggerEditor/TriggerEditor.tsx
155
- var TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }) => {
156
- var _effect = _useSignals3();
157
- try {
158
- const handleSave = ({ id: _, ...values }) => {
159
- onSave?.(values);
160
- };
161
- const handleRefQueryLookup = useRefQueryLookupHandler({
162
- space
163
- });
164
- const Custom = useCustomInputs({
165
- space,
166
- readonlySpec,
167
- types,
168
- tags,
169
- onQueryRefOptions: handleRefQueryLookup
170
- });
171
- return /* @__PURE__ */ React3.createElement(Form2, {
172
- outerSpacing: false,
173
- Custom,
174
- schema: Trigger2.Trigger,
175
- values: trigger,
176
- onSave: handleSave,
177
- onCancel,
178
- onQueryRefOptions: handleRefQueryLookup
179
- });
180
- } finally {
181
- _effect.f();
182
- }
183
- };
184
- var useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }) => {
185
- const functions = useQuery(space, Filter2.type(Function.Function));
186
- const workflows = useQuery(space, Filter2.type(ComputeGraph));
187
- const scripts = useQuery(space, Filter2.type(Script.Script));
188
- return useMemo3(() => ({
189
- // Function selector.
190
- ["function"]: (props) => {
191
- const getValue = useCallback3(() => {
192
- const formValue = props.getValue();
193
- if (Ref2.isRef(formValue)) {
194
- return formValue.dxn.toString();
195
- }
196
- return void 0;
197
- }, [
198
- props
199
- ]);
200
- const handleOnValueChange = useCallback3((_type, dxnString) => {
201
- const dxn = Type2.DXN.parse(dxnString);
202
- if (dxn) {
203
- const ref = Ref2.fromDXN(dxn);
204
- props.onValueChange("object", ref);
205
- }
206
- }, [
207
- props.onValueChange
208
- ]);
209
- return /* @__PURE__ */ React3.createElement(SelectInput2, {
210
- ...props,
211
- getValue,
212
- onValueChange: handleOnValueChange,
213
- options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
214
- });
215
- },
216
- // Spec selector.
217
- ["spec.kind"]: (props) => /* @__PURE__ */ React3.createElement(SpecSelector, {
218
- ...props,
219
- readonly: readonlySpec ? "disabled-input" : false
220
- }),
221
- // TODO(wittjosiah): Copied from ViewEditor.
222
- // Query input editor.
223
- ["spec.query"]: (props) => {
224
- const handleChange = useCallback3((query) => props.onValueChange("object", {
225
- ast: query.ast
226
- }), [
227
- props.onValueChange
228
- ]);
229
- return /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(InputHeader, {
230
- label: props.label
231
- }), /* @__PURE__ */ React3.createElement(QueryForm, {
232
- initialQuery: props.getValue().ast,
233
- types,
234
- tags,
235
- onChange: handleChange
236
- }));
237
- },
238
- // Function input editor.
239
- ["input"]: (props) => /* @__PURE__ */ React3.createElement(FunctionInputEditor, {
240
- ...props,
241
- functions,
242
- onQueryRefOptions
243
- })
244
- }), [
245
- workflows,
246
- scripts,
247
- functions,
248
- readonlySpec
249
- ]);
250
- };
251
- var getWorkflowOptions = (graphs) => {
252
- return graphs.map((graph) => ({
253
- label: `compute-${graph.id}`,
254
- value: `dxn:echo:@:${graph.id}`
255
- }));
256
- };
257
- var getFunctionOptions = (scripts, functions) => {
258
- const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
259
- return functions.map((fn) => ({
260
- label: getLabel(fn),
261
- value: `dxn:echo:@:${fn.id}`
262
- }));
263
- };
264
-
265
- export {
266
- TriggerEditor
267
- };
268
- //# sourceMappingURL=chunk-W76WUTZY.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/FunctionInputEditor.tsx", "../../../src/components/TriggerEditor/SpecSelector.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { type Query, Type } from '@dxos/echo';\nimport { Function, Script, Trigger } from '@dxos/functions';\nimport { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';\nimport { Input } from '@dxos/react-ui';\nimport { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';\nimport { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';\n\nimport { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';\nimport { SpecSelector } from './SpecSelector';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: Trigger.Trigger;\n // TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.\n readonlySpec?: boolean;\n onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;\n onCancel?: () => void;\n} & Pick<QueryFormProps, 'types' | 'tags'>;\n\nexport const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {\n const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {\n onSave?.(values);\n };\n\n const handleRefQueryLookup = useRefQueryLookupHandler({ space });\n const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });\n\n return (\n <Form\n outerSpacing={false}\n Custom={Custom}\n schema={Trigger.Trigger}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n onQueryRefOptions={handleRefQueryLookup}\n />\n );\n};\n\ntype UseCustomInputsProps = {\n space: Space;\n readonlySpec?: boolean;\n onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];\n} & Pick<QueryFormProps, 'types' | 'tags'>;\n\nconst useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {\n const functions = useQuery(space, Filter.type(Function.Function));\n const workflows = useQuery(space, Filter.type(ComputeGraph));\n const scripts = useQuery(space, Filter.type(Script.Script));\n\n return useMemo(\n (): CustomInputMap => ({\n // Function selector.\n ['function' satisfies keyof Trigger.Trigger]: (props) => {\n const getValue = useCallback(() => {\n const formValue = props.getValue();\n if (Ref.isRef(formValue)) {\n return formValue.dxn.toString() as string;\n }\n return undefined;\n }, [props]);\n\n const handleOnValueChange = useCallback(\n (_type: any, dxnString: string) => {\n const dxn = Type.DXN.parse(dxnString);\n if (dxn) {\n const ref = Ref.fromDXN(dxn);\n props.onValueChange('object', ref);\n }\n },\n [props.onValueChange],\n );\n\n return (\n <SelectInput\n {...props}\n getValue={getValue as any}\n onValueChange={handleOnValueChange}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n );\n },\n\n // Spec selector.\n ['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,\n\n // TODO(wittjosiah): Copied from ViewEditor.\n // Query input editor.\n ['spec.query' as const]: (props) => {\n const handleChange = useCallback(\n (query: Query.Any) => props.onValueChange('object', { ast: query.ast }),\n [props.onValueChange],\n );\n\n return (\n <Input.Root>\n <InputHeader label={props.label} />\n <QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />\n </Input.Root>\n );\n },\n\n // Function input editor.\n ['input' as const]: (props) => (\n <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />\n ),\n }),\n [workflows, scripts, functions, readonlySpec],\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {\n const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Ref, Type } from '@dxos/echo';\nimport { type JsonPath } from '@dxos/echo/internal';\nimport { type Function } from '@dxos/functions';\nimport { useOnTransition } from '@dxos/react-ui';\nimport { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';\n\nexport type FunctionInputEditorProps = {\n functions: Function.Function[];\n onQueryRefOptions: QueryRefOptions;\n} & FormInputStateProps;\n\n/**\n * Editor component for function input parameters.\n */\nexport const FunctionInputEditor = ({\n functions,\n getValue,\n onValueChange,\n onQueryRefOptions,\n}: FunctionInputEditorProps) => {\n const selectedFunctionValue = useFormValues(['function' as JsonPath]);\n const selectedFunctionId = useMemo(() => {\n if (Ref.isRef(selectedFunctionValue)) {\n return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);\n }\n }, [selectedFunctionValue]);\n\n const selectedFunction = useMemo(\n () => functions.find((fn) => fn.id === selectedFunctionId),\n [functions, selectedFunctionId],\n );\n\n useOnTransition(\n // Clear function parameter input when the function changes.\n selectedFunctionValue,\n (prevValue) => {\n if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {\n return false;\n }\n\n return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();\n },\n (currValue) => currValue !== undefined,\n () => onValueChange('object', {}),\n );\n\n const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);\n const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);\n const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;\n\n const values = useMemo(() => getValue() ?? {}, [getValue]);\n\n const handleValuesChanged = useCallback(\n (values: any) => {\n onValueChange('object', values);\n },\n [onValueChange],\n );\n\n if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {\n return null;\n }\n\n return (\n <>\n <h3 className='text-md'>Function parameters</h3>\n {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.\n This would allow errors to flow up to the root context. */}\n <Form\n schema={effectSchema}\n values={values}\n onValuesChanged={handleValuesChanged}\n onQueryRefOptions={onQueryRefOptions}\n outerSpacing={false}\n />\n </>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Filter, Query } from '@dxos/echo';\nimport { Trigger } from '@dxos/functions';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\n\nexport type SpecSelectorProps = InputProps;\n\nexport const SpecSelector = (props: SpecSelectorProps) => {\n const { t } = useTranslation(meta.id);\n const specProps = useInputProps(['spec' satisfies keyof Trigger.Trigger]);\n\n const handleTypeChange = useCallback(\n (_type: any, value: string): Trigger.Spec | undefined => {\n const getDefaultTriggerSpec = (kind: string) => {\n switch (kind) {\n case 'timer':\n return { kind: 'timer', cron: '' };\n case 'subscription':\n return {\n kind: 'subscription',\n query: {\n ast: Query.select(Filter.nothing()).ast,\n },\n };\n case 'queue':\n return { kind: 'queue', queue: 'dxn:' };\n case 'email':\n return { kind: 'email' };\n case 'webhook':\n return { kind: 'webhook' };\n default:\n return undefined;\n }\n };\n\n const defaultSpec = getDefaultTriggerSpec(value);\n if (!defaultSpec) {\n return;\n }\n\n // Update the entire spec object, not just the `spec.kind`.\n specProps.onValueChange('object', defaultSpec);\n },\n [specProps],\n );\n\n const options = useMemo(\n () =>\n Trigger.Kinds.map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n })),\n [t],\n );\n\n return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;\n};\n"],
5
- "mappings": ";;;;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,oBAAo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AC1B,SAAOA,OAAOC,IAAI,CAACC,WAAW;IAAEP,OAAO,WAAWO,MAAM7D,EAAE;IAAI8D,OAAO,cAAcD,MAAM7D,EAAE;EAAG,EAAA;AAChG;AAEA,IAAM6C,qBAAqB,CAACzB,SAA0BP,cAAAA;AACpD,QAAMkD,WAAW,CAACC,OAA0B5C,QAAQ6C,KAAK,CAACC,MAAMF,GAAGG,QAAQC,QAAQpE,OAAOkE,EAAElE,EAAE,GAAGqE,QAAQL,GAAGK;AAC5G,SAAOxD,UAAU+C,IAAI,CAACI,QAAQ;IAAEV,OAAOS,SAASC,EAAAA;IAAKF,OAAO,cAAcE,GAAGhE,EAAE;EAAG,EAAA;AACpF;",
6
- "names": ["React", "useCallback", "useMemo", "ComputeGraph", "Type", "Function", "Script", "Trigger", "Filter", "Ref", "useQuery", "Input", "QueryForm", "Form", "InputHeader", "SelectInput", "useRefQueryLookupHandler", "React", "useCallback", "useMemo", "Ref", "Type", "useOnTransition", "Form", "useFormValues", "FunctionInputEditor", "functions", "getValue", "onValueChange", "onQueryRefOptions", "selectedFunctionValue", "useFormValues", "selectedFunctionId", "useMemo", "Ref", "isRef", "dxn", "toString", "split", "at", "selectedFunction", "find", "fn", "id", "useOnTransition", "prevValue", "currValue", "undefined", "inputSchema", "effectSchema", "Type", "toEffectSchema", "propertyCount", "properties", "Object", "keys", "length", "values", "handleValuesChanged", "useCallback", "h3", "className", "Form", "schema", "onValuesChanged", "outerSpacing", "React", "useCallback", "useMemo", "Filter", "Query", "Trigger", "useTranslation", "SelectInput", "useInputProps", "SpecSelector", "props", "t", "useTranslation", "meta", "id", "specProps", "useInputProps", "handleTypeChange", "useCallback", "_type", "value", "getDefaultTriggerSpec", "kind", "cron", "query", "ast", "Query", "select", "Filter", "nothing", "queue", "undefined", "defaultSpec", "onValueChange", "options", "useMemo", "Trigger", "Kinds", "map", "label", "React", "SelectInput", "TriggerEditor", "space", "trigger", "readonlySpec", "types", "tags", "onSave", "onCancel", "handleSave", "id", "_", "values", "handleRefQueryLookup", "useRefQueryLookupHandler", "Custom", "useCustomInputs", "onQueryRefOptions", "React", "Form", "outerSpacing", "schema", "Trigger", "functions", "useQuery", "Filter", "type", "Function", "workflows", "ComputeGraph", "scripts", "Script", "useMemo", "props", "getValue", "useCallback", "formValue", "Ref", "isRef", "dxn", "toString", "undefined", "handleOnValueChange", "_type", "dxnString", "Type", "DXN", "parse", "ref", "fromDXN", "onValueChange", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "SpecSelector", "readonly", "handleChange", "query", "ast", "Input", "Root", "InputHeader", "label", "QueryForm", "initialQuery", "onChange", "FunctionInputEditor", "graphs", "map", "graph", "value", "getLabel", "fn", "find", "s", "source", "target", "name"]
7
- }