@dxos/plugin-automation 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe

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 (261) hide show
  1. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  2. package/dist/lib/browser/chunk-POEIL4RN.mjs +44 -0
  3. package/dist/lib/browser/chunk-POEIL4RN.mjs.map +7 -0
  4. package/dist/lib/browser/{chunk-JOXPQ27I.mjs → chunk-WQLEMRPU.mjs} +9 -38
  5. package/dist/lib/browser/chunk-WQLEMRPU.mjs.map +7 -0
  6. package/dist/lib/browser/cli/index.mjs +122 -107
  7. package/dist/lib/browser/cli/index.mjs.map +3 -3
  8. package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs +77 -0
  9. package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs.map +7 -0
  10. package/dist/lib/browser/hooks/index.mjs +79 -7
  11. package/dist/lib/browser/hooks/index.mjs.map +4 -4
  12. package/dist/lib/browser/index.mjs +60 -92
  13. package/dist/lib/browser/index.mjs.map +4 -4
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/operations/index.mjs +14 -0
  16. package/dist/lib/browser/operations/index.mjs.map +7 -0
  17. package/dist/lib/browser/types/index.mjs +4 -4
  18. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  19. package/dist/lib/node-esm/{chunk-RX52VKI2.mjs → chunk-JWZAVQLF.mjs} +9 -37
  20. package/dist/lib/node-esm/chunk-JWZAVQLF.mjs.map +7 -0
  21. package/dist/lib/node-esm/chunk-SP3P4OUI.mjs +45 -0
  22. package/dist/lib/node-esm/chunk-SP3P4OUI.mjs.map +7 -0
  23. package/dist/lib/node-esm/cli/index.mjs +122 -107
  24. package/dist/lib/node-esm/cli/index.mjs.map +3 -3
  25. package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs +78 -0
  26. package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs.map +7 -0
  27. package/dist/lib/node-esm/hooks/index.mjs +79 -7
  28. package/dist/lib/node-esm/hooks/index.mjs.map +4 -4
  29. package/dist/lib/node-esm/index.mjs +60 -92
  30. package/dist/lib/node-esm/index.mjs.map +4 -4
  31. package/dist/lib/node-esm/meta.json +1 -1
  32. package/dist/lib/node-esm/operations/index.mjs +15 -0
  33. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/types/index.mjs +4 -4
  35. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
  37. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  38. package/dist/types/src/capabilities/compute-runtime.d.ts +6 -0
  39. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  40. package/dist/types/src/capabilities/index.d.ts +6 -4
  41. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/node.d.ts +3 -0
  43. package/dist/types/src/capabilities/node.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  45. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  46. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  47. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  48. package/dist/types/src/cli/commands/trigger/create/index.d.ts +1 -1
  49. package/dist/types/src/cli/commands/trigger/create/queue.d.ts +1 -1
  50. package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -1
  51. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +1 -1
  52. package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -1
  53. package/dist/types/src/cli/commands/trigger/create/timer.d.ts +1 -1
  54. package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -1
  55. package/dist/types/src/cli/commands/trigger/list.d.ts +1 -1
  56. package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -1
  57. package/dist/types/src/cli/commands/trigger/remove.d.ts +1 -1
  58. package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -1
  59. package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -1
  60. package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -1
  61. package/dist/types/src/cli/commands/trigger/util.d.ts +2 -2
  62. package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -1
  63. package/dist/types/src/cli/plugin.d.ts.map +1 -1
  64. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -4
  65. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  66. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +28 -30
  67. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  68. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  69. package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
  70. package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
  71. package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
  72. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +2 -2
  73. package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
  74. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  75. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  76. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +91 -91
  77. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  78. package/dist/types/src/components/index.d.ts +3 -4
  79. package/dist/types/src/components/index.d.ts.map +1 -1
  80. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
  81. package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
  82. package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
  83. package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
  84. package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
  85. package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
  86. package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
  87. package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
  88. package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
  89. package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
  90. package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
  91. package/dist/types/src/containers/index.d.ts +5 -0
  92. package/dist/types/src/containers/index.d.ts.map +1 -0
  93. package/dist/types/src/hooks/index.d.ts +2 -0
  94. package/dist/types/src/hooks/index.d.ts.map +1 -1
  95. package/dist/types/src/hooks/useComputeRuntime.d.ts +7 -0
  96. package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
  97. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
  98. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
  99. package/dist/types/src/hooks/useComputeRuntimeService.d.ts +5 -0
  100. package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
  101. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -1
  102. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
  103. package/dist/types/src/index.d.ts +2 -5
  104. package/dist/types/src/index.d.ts.map +1 -1
  105. package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
  106. package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
  107. package/dist/types/src/operations/definitions.d.ts +19 -0
  108. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  109. package/dist/types/src/operations/index.d.ts +4 -0
  110. package/dist/types/src/operations/index.d.ts.map +1 -0
  111. package/dist/types/src/testing/test-functions.d.ts +2 -0
  112. package/dist/types/src/testing/test-functions.d.ts.map +1 -1
  113. package/dist/types/src/translations.d.ts +29 -31
  114. package/dist/types/src/translations.d.ts.map +1 -1
  115. package/dist/types/src/types/capabilities.d.ts +6 -3
  116. package/dist/types/src/types/capabilities.d.ts.map +1 -1
  117. package/dist/types/src/types/schema.d.ts +9 -30
  118. package/dist/types/src/types/schema.d.ts.map +1 -1
  119. package/dist/types/tsconfig.tsbuildinfo +1 -1
  120. package/package.json +73 -46
  121. package/src/AutomationPlugin.tsx +13 -10
  122. package/src/capabilities/app-graph-builder.ts +62 -0
  123. package/src/capabilities/compute-runtime.ts +248 -0
  124. package/src/capabilities/index.ts +10 -4
  125. package/src/capabilities/operation-handler.ts +16 -0
  126. package/src/capabilities/react-surface.tsx +59 -0
  127. package/src/cli/commands/trigger/create/queue.ts +7 -6
  128. package/src/cli/commands/trigger/create/subscription.ts +7 -6
  129. package/src/cli/commands/trigger/create/timer.ts +7 -6
  130. package/src/cli/commands/trigger/list.ts +3 -2
  131. package/src/cli/commands/trigger/remove.ts +2 -2
  132. package/src/cli/commands/trigger/update/queue.ts +21 -21
  133. package/src/cli/commands/trigger/update/subscription.ts +20 -19
  134. package/src/cli/commands/trigger/update/timer.ts +21 -20
  135. package/src/cli/commands/trigger/util.ts +43 -29
  136. package/src/cli/plugin.ts +6 -6
  137. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +10 -8
  138. package/src/components/AutomationPanel/AutomationPanel.tsx +160 -87
  139. package/src/components/FunctionsPanel/FunctionsPanel.tsx +37 -31
  140. package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +27 -24
  141. package/src/components/FunctionsRegistry/index.ts +4 -1
  142. package/src/components/TriggerEditor/FunctionInputEditor.tsx +17 -8
  143. package/src/components/TriggerEditor/SpecSelector.tsx +12 -3
  144. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +56 -13
  145. package/src/components/TriggerEditor/TriggerEditor.tsx +46 -17
  146. package/src/components/index.ts +1 -2
  147. package/src/containers/AutomationSettings/AutomationSettings.tsx +28 -0
  148. package/src/containers/AutomationSettings/index.ts +5 -0
  149. package/src/containers/FunctionsContainer/FunctionsContainer.tsx +34 -0
  150. package/src/containers/FunctionsContainer/index.ts +5 -0
  151. package/src/{components → containers/TriggerSettings}/TriggerSettings.tsx +8 -7
  152. package/src/containers/TriggerSettings/index.ts +6 -0
  153. package/src/containers/index.ts +9 -0
  154. package/src/hooks/index.ts +3 -0
  155. package/src/hooks/useComputeRuntime.ts +16 -0
  156. package/src/hooks/useComputeRuntimeCallback.ts +4 -39
  157. package/src/hooks/useComputeRuntimeService.ts +24 -0
  158. package/src/hooks/useTriggerRuntimeControls.ts +22 -8
  159. package/src/index.ts +2 -6
  160. package/src/meta.ts +2 -2
  161. package/src/operations/create-trigger-from-template.ts +75 -0
  162. package/src/operations/definitions.ts +28 -0
  163. package/src/operations/index.ts +9 -0
  164. package/src/testing/test-functions.ts +8 -5
  165. package/src/translations.ts +35 -36
  166. package/src/types/capabilities.ts +20 -6
  167. package/src/types/events.ts +2 -2
  168. package/src/types/schema.ts +3 -24
  169. package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +0 -11
  170. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +0 -56
  171. package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +0 -7
  172. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +0 -129
  173. package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +0 -7
  174. package/dist/lib/browser/FunctionsPanel-ZX4J75UM.mjs +0 -10
  175. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +0 -84
  176. package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +0 -7
  177. package/dist/lib/browser/chunk-54PANILA.mjs +0 -14
  178. package/dist/lib/browser/chunk-54PANILA.mjs.map +0 -7
  179. package/dist/lib/browser/chunk-BFUIVUQH.mjs +0 -102
  180. package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +0 -7
  181. package/dist/lib/browser/chunk-BKFQBKYO.mjs +0 -8
  182. package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +0 -7
  183. package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
  184. package/dist/lib/browser/chunk-PZNBEKO5.mjs +0 -17
  185. package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +0 -7
  186. package/dist/lib/browser/chunk-QW3EM35H.mjs +0 -248
  187. package/dist/lib/browser/chunk-QW3EM35H.mjs.map +0 -7
  188. package/dist/lib/browser/chunk-RAF2FJST.mjs +0 -86
  189. package/dist/lib/browser/chunk-RAF2FJST.mjs.map +0 -7
  190. package/dist/lib/browser/chunk-YWLEY2FD.mjs +0 -200
  191. package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +0 -7
  192. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +0 -114
  193. package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +0 -7
  194. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +0 -82
  195. package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +0 -7
  196. package/dist/lib/browser/react-surface-EV3AC62F.mjs +0 -65
  197. package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +0 -7
  198. package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs +0 -12
  199. package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs.map +0 -7
  200. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +0 -57
  201. package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +0 -7
  202. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +0 -130
  203. package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +0 -7
  204. package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs +0 -11
  205. package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs.map +0 -7
  206. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +0 -85
  207. package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +0 -7
  208. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +0 -201
  209. package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +0 -7
  210. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
  211. package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-7QRUPEHH.mjs +0 -16
  213. package/dist/lib/node-esm/chunk-7QRUPEHH.mjs.map +0 -7
  214. package/dist/lib/node-esm/chunk-HQLVREIX.mjs +0 -87
  215. package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +0 -7
  216. package/dist/lib/node-esm/chunk-K7GCM342.mjs +0 -10
  217. package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +0 -7
  218. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +0 -103
  219. package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +0 -7
  220. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +0 -249
  221. package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +0 -7
  222. package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
  223. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +0 -115
  224. package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +0 -7
  225. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +0 -83
  226. package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +0 -7
  227. package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs +0 -66
  228. package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +0 -7
  229. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
  230. package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
  231. package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
  232. package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
  233. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
  234. package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
  235. package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
  236. package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
  237. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  238. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  239. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  240. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  241. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  242. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  243. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  244. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  245. package/dist/types/src/components/AutomationSettings.d.ts +0 -5
  246. package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
  247. package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
  248. package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
  249. package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -71
  250. package/src/capabilities/app-graph-builder/index.ts +0 -7
  251. package/src/capabilities/compute-runtime/compute-runtime.ts +0 -133
  252. package/src/capabilities/operation-resolver/index.ts +0 -7
  253. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -79
  254. package/src/capabilities/react-surface/index.ts +0 -7
  255. package/src/capabilities/react-surface/react-surface.tsx +0 -60
  256. package/src/components/AutomationSettings.tsx +0 -30
  257. package/src/components/FunctionsContainer.tsx +0 -36
  258. /package/dist/lib/browser/{AutomationPanel-FAS6ADCW.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  259. /package/dist/lib/{browser/FunctionsPanel-ZX4J75UM.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
  260. /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
  261. /package/src/capabilities/{compute-runtime/index.ts → node.ts} +0 -0
@@ -1,84 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-PZNBEKO5.mjs";
4
-
5
- // src/capabilities/app-graph-builder/app-graph-builder.ts
6
- import * as Effect from "effect/Effect";
7
- import { Capability, Common } from "@dxos/app-framework";
8
- import { Script } from "@dxos/functions";
9
- import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
10
- import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
11
- import { meta as spaceMeta } from "@dxos/plugin-space";
12
- var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
13
- const extensions = yield* Effect.all([
14
- GraphBuilder.createExtension({
15
- id: `${meta.id}/space-settings-automation`,
16
- match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
17
- connector: (node) => Effect.succeed([
18
- {
19
- id: `automation-${node.id}`,
20
- type: `${meta.id}/space-settings-automation`,
21
- data: `${meta.id}/space-settings-automation`,
22
- properties: {
23
- label: [
24
- "automation panel label",
25
- {
26
- ns: meta.id
27
- }
28
- ],
29
- icon: "ph--lightning--regular"
30
- }
31
- }
32
- ])
33
- }),
34
- GraphBuilder.createExtension({
35
- id: `${meta.id}/space-settings-functions`,
36
- match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),
37
- connector: (node) => Effect.succeed([
38
- {
39
- id: `functions-${node.id}`,
40
- type: `${meta.id}/space-settings-functions`,
41
- data: `${meta.id}/space-settings-functions`,
42
- properties: {
43
- label: [
44
- "functions panel label",
45
- {
46
- ns: meta.id
47
- }
48
- ],
49
- icon: "ph--function--regular"
50
- }
51
- }
52
- ])
53
- }),
54
- GraphBuilder.createTypeExtension({
55
- id: `${meta.id}/script-companion`,
56
- type: Script.Script,
57
- connector: (script) => Effect.succeed([
58
- {
59
- id: [
60
- script.id,
61
- "automation"
62
- ].join(ATTENDABLE_PATH_SEPARATOR),
63
- type: PLANK_COMPANION_TYPE,
64
- data: "automation",
65
- properties: {
66
- label: [
67
- "script automation label",
68
- {
69
- ns: meta.id
70
- }
71
- ],
72
- icon: "ph--lightning--regular",
73
- disposition: "hidden"
74
- }
75
- }
76
- ])
77
- })
78
- ]);
79
- return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);
80
- }));
81
- export {
82
- app_graph_builder_default as default
83
- };
84
- //# sourceMappingURL=app-graph-builder-LAQMEBMH.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\nimport { Script } from '@dxos/functions';\nimport { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { meta as spaceMeta } from '@dxos/plugin-space';\n\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}/space-settings-automation`,\n match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),\n connector: (node) =>\n Effect.succeed([\n {\n id: `automation-${node.id}`,\n type: `${meta.id}/space-settings-automation`,\n data: `${meta.id}/space-settings-automation`,\n properties: {\n label: ['automation panel label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}/space-settings-functions`,\n match: NodeMatcher.whenNodeType(`${spaceMeta.id}/settings`),\n connector: (node) =>\n Effect.succeed([\n {\n id: `functions-${node.id}`,\n type: `${meta.id}/space-settings-functions`,\n data: `${meta.id}/space-settings-functions`,\n properties: {\n label: ['functions panel label', { ns: meta.id }],\n icon: 'ph--function--regular',\n },\n },\n ]),\n }),\n GraphBuilder.createTypeExtension({\n id: `${meta.id}/script-companion`,\n type: Script.Script,\n connector: (script) =>\n Effect.succeed([\n {\n id: [script.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'automation',\n properties: {\n label: ['script automation label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n disposition: 'hidden',\n },\n },\n ]),\n }),\n ]);\n\n return Capability.contributes(Common.Capability.AppGraphBuilder, extensions);\n }),\n);\n"],
5
- "mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AACnC,SAASC,cAAc;AACvB,SAASC,2BAA2BC,4BAA4B;AAChE,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,QAAQC,iBAAiB;AAIlC,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC,aAAa,GAAGC,UAAUL,EAAE,WAAW;MAC1DM,WAAW,CAACC,SACHC,eAAQ;QACb;UACER,IAAI,cAAcO,KAAKP,EAAE;UACzBS,MAAM,GAAGR,KAAKD,EAAE;UAChBU,MAAM,GAAGT,KAAKD,EAAE;UAChBW,YAAY;YACVC,OAAO;cAAC;cAA0B;gBAAEC,IAAIZ,KAAKD;cAAG;;YAChDc,MAAM;UACR;QACF;OACD;IACL,CAAA;IACAhB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC,aAAa,GAAGC,UAAUL,EAAE,WAAW;MAC1DM,WAAW,CAACC,SACHC,eAAQ;QACb;UACER,IAAI,aAAaO,KAAKP,EAAE;UACxBS,MAAM,GAAGR,KAAKD,EAAE;UAChBU,MAAM,GAAGT,KAAKD,EAAE;UAChBW,YAAY;YACVC,OAAO;cAAC;cAAyB;gBAAEC,IAAIZ,KAAKD;cAAG;;YAC/Cc,MAAM;UACR;QACF;OACD;IACL,CAAA;IACAhB,aAAaiB,oBAAoB;MAC/Bf,IAAI,GAAGC,KAAKD,EAAE;MACdS,MAAMO,OAAOA;MACbV,WAAW,CAACW,WACHT,eAAQ;QACb;UACER,IAAI;YAACiB,OAAOjB;YAAI;YAAckB,KAAKC,yBAAAA;UACnCV,MAAMW;UACNV,MAAM;UACNC,YAAY;YACVC,OAAO;cAAC;cAA2B;gBAAEC,IAAIZ,KAAKD;cAAG;;YACjDc,MAAM;YACNO,aAAa;UACf;QACF;OACD;IACL,CAAA;GACD;AAED,SAAO5B,WAAW6B,YAAYC,OAAO9B,WAAW+B,iBAAiB5B,UAAAA;AACnE,CAAA,CAAA;",
6
- "names": ["Effect", "Capability", "Common", "Script", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "GraphBuilder", "NodeMatcher", "meta", "spaceMeta", "Capability", "makeModule", "fnUntraced", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenNodeType", "spaceMeta", "connector", "node", "succeed", "type", "data", "properties", "label", "ns", "icon", "createTypeExtension", "Script", "script", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition", "contributes", "Common", "AppGraphBuilder"]
7
- }
@@ -1,14 +0,0 @@
1
- // src/components/index.ts
2
- import { lazy } from "react";
3
- var AutomationPanel = lazy(() => import("./AutomationPanel-FAS6ADCW.mjs"));
4
- var AutomationSettings = lazy(() => import("./AutomationSettings-XN2OIYWL.mjs"));
5
- var FunctionsContainer = lazy(() => import("./FunctionsContainer-6QLC7JP4.mjs"));
6
- var FunctionsPanel = lazy(() => import("./FunctionsPanel-ZX4J75UM.mjs"));
7
-
8
- export {
9
- AutomationPanel,
10
- AutomationSettings,
11
- FunctionsContainer,
12
- FunctionsPanel
13
- };
14
- //# sourceMappingURL=chunk-54PANILA.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/components/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './TriggerEditor';\n\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\nexport const AutomationSettings = lazy(() => import('./AutomationSettings'));\nexport const FunctionsContainer = lazy(() => import('./FunctionsContainer'));\nexport const FunctionsPanel = lazy(() => import('./FunctionsPanel'));\n"],
5
- "mappings": ";AAIA,SAASA,YAAY;AAId,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAMC,qBAAqBD,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAME,qBAAqBF,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,iBAAiBH,KAAK,MAAM,OAAO,+BAAA,CAAA;",
6
- "names": ["lazy", "AutomationPanel", "lazy", "AutomationSettings", "FunctionsContainer", "FunctionsPanel"]
7
- }
@@ -1,102 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-PZNBEKO5.mjs";
4
-
5
- // src/components/FunctionsPanel/FunctionsPanel.tsx
6
- import * as Schema from "effect/Schema";
7
- import React, { useCallback, useMemo } from "react";
8
- import { Common } from "@dxos/app-framework";
9
- import { useOperationInvoker } from "@dxos/app-framework/react";
10
- import { Obj } from "@dxos/echo";
11
- import { Function, Script } from "@dxos/functions";
12
- import { SpaceOperation } from "@dxos/plugin-space/types";
13
- import { Filter, 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/ui-theme";
18
- var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
19
- var FunctionsPanel = ({ space }) => {
20
- const { t } = useTranslation(meta.id);
21
- const functions = useQuery(space.db, Filter.type(Function.Function));
22
- const scripts = useQuery(space.db, Filter.type(Script.Script));
23
- const { invokePromise } = useOperationInvoker();
24
- const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
25
- const scriptId = func.source?.target?.id;
26
- if (scriptId) {
27
- const script = scripts.find((s) => s.id === scriptId);
28
- if (script) {
29
- map[func.id] = script;
30
- }
31
- }
32
- return map;
33
- }, {}), [
34
- functions,
35
- scripts
36
- ]);
37
- const getScriptName = useCallback((func) => {
38
- const script = functionToScriptMap[func.id];
39
- return script?.name;
40
- }, [
41
- functionToScriptMap
42
- ]);
43
- const handleGoToScript = useCallback((func) => {
44
- const script = functionToScriptMap[func.id];
45
- if (script) {
46
- void invokePromise(Common.LayoutOperation.Open, {
47
- subject: [
48
- Obj.getDXN(script).toString()
49
- ]
50
- });
51
- }
52
- }, [
53
- functionToScriptMap,
54
- invokePromise
55
- ]);
56
- const handleDelete = useCallback((func) => invokePromise(SpaceOperation.RemoveObjects, {
57
- objects: [
58
- func
59
- ]
60
- }), [
61
- invokePromise
62
- ]);
63
- return /* @__PURE__ */ React.createElement("div", {
64
- role: "none",
65
- className: mx(controlItemClasses)
66
- }, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
67
- items: functions,
68
- isItem: Schema.is(Function.Function),
69
- getId: (func) => func.id
70
- }, ({ items }) => /* @__PURE__ */ React.createElement("div", {
71
- role: "list",
72
- className: "flex flex-col is-full"
73
- }, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
74
- key: func.id,
75
- item: func,
76
- classNames: mx(grid, ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
77
- }, /* @__PURE__ */ React.createElement("div", {
78
- className: "flex flex-col truncate"
79
- }, /* @__PURE__ */ React.createElement(List.ItemTitle, {
80
- classNames: "truncate"
81
- }, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
82
- className: "text-xs text-description truncate"
83
- }, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
84
- onClick: () => handleGoToScript(func)
85
- }, t("go to function source button label")), /* @__PURE__ */ React.createElement(IconButton, {
86
- iconOnly: true,
87
- icon: "ph--trash--regular",
88
- label: t("delete function button label"),
89
- onClick: () => handleDelete(func)
90
- }))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
91
- className: "text-center plb-4 text-gray-500"
92
- }, t("no functions found")));
93
- };
94
-
95
- // src/components/FunctionsPanel/index.ts
96
- var FunctionsPanel_default = FunctionsPanel;
97
-
98
- export {
99
- FunctionsPanel,
100
- FunctionsPanel_default
101
- };
102
- //# sourceMappingURL=chunk-BFUIVUQH.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 { Common } from '@dxos/app-framework';\nimport { useOperationInvoker } from '@dxos/app-framework/react';\nimport { Obj } from '@dxos/echo';\nimport { Function, Script } from '@dxos/functions';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Filter, type Space, 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/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.db, Filter.type(Function.Function));\n const scripts = useQuery(space.db, Filter.type(Script.Script));\n const { invokePromise } = useOperationInvoker();\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 invokePromise(Common.LayoutOperation.Open, { subject: [Obj.getDXN(script).toString()] });\n }\n },\n [functionToScriptMap, invokePromise],\n );\n\n const handleDelete = useCallback(\n (func: Function.Function) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),\n [invokePromise],\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 is-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,c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obj", "Function", "Script", "SpaceOperation", "Filter", "useQuery", "Button", "IconButton", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "meta", "id", "functions", "useQuery", "db", "Filter", "type", "Function", "scripts", "Script", "invokePromise", "useOperationInvoker", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "Common", "LayoutOperation", "Open", "subject", "Obj", "getDXN", "toString", "handleDelete", "SpaceOperation", "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,8 +0,0 @@
1
- // src/capabilities/compute-runtime/index.ts
2
- import { Capability } from "@dxos/app-framework";
3
- var ComputeRuntime = Capability.lazy("ComputeRuntime", () => import("./compute-runtime-WTWLQ67J.mjs"));
4
-
5
- export {
6
- ComputeRuntime
7
- };
8
- //# sourceMappingURL=chunk-BKFQBKYO.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/capabilities/compute-runtime/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const ComputeRuntime = Capability.lazy('ComputeRuntime', () => import('./compute-runtime'));\n"],
5
- "mappings": ";AAIA,SAASA,kBAAkB;AAEpB,IAAMC,iBAAiBC,WAAWC,KAAK,kBAAkB,MAAM,OAAO,gCAAA,CAAA;",
6
- "names": ["Capability", "ComputeRuntime", "Capability", "lazy"]
7
- }
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/types/capabilities.ts", "../../../src/types/events.ts", "../../../src/types/schema.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 { Capability } from '@dxos/app-framework';\nimport { type Database } from '@dxos/echo';\nimport type { CredentialsService, FunctionInvocationService, QueueService, TracingService } from '@dxos/functions';\nimport type { TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';\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 | TriggerStateStore\n | AiService.AiService\n | Database.Service\n | QueueService\n | CredentialsService\n | FunctionInvocationService\n | TracingService\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 = Capability.make<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { ActivationEvent } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\n\nexport namespace AutomationEvents {\n export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}/event/compute-runtime-ready`);\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Database } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\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 db: Database.Database,\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\nconst AUTOMATION_OPERATION = `${meta.id}/operation`;\n\nexport namespace AutomationOperation {\n export const CreateTriggerFromTemplate = Operation.make({\n meta: { key: `${AUTOMATION_OPERATION}/create-trigger-from-template`, name: 'Create Trigger From Template' },\n services: [Capability.Service],\n schema: {\n input: Schema.Struct({\n db: Database.Database,\n template: TriggerTemplate,\n enabled: Schema.optional(Schema.Boolean),\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": ";;;;;AAOA,SAASA,kBAAkB;UAQVC,yBAAAA;0BAyBFC,iBAAiBC,WAAWC,KAA6B,GAAGC,KAAKC,EAAE,6BAA6B;AAC/G,GA1BiBL,2BAAAA,yBAAAA,CAAAA,EAAAA;;;;ACXjB,SAASM,uBAAuB;UAIfC,mBAAAA;oBACFC,sBAAsBC,gBAAgBC,KAAK,GAAGC,KAAKC,EAAE,8BAA8B;AAClG,GAFiBL,qBAAAA,mBAAAA,CAAAA,EAAAA;;;;ACJjB,YAAYM,YAAY;AAExB,SAASC,cAAAA,mBAAkB;AAC3B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAI1B,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,IAAIC,SAASA;MACbC,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;AAiBjB,IAAMkB,uBAAuB,GAAGf,KAAKC,EAAE;UAEtBe,sBAAAA;uBACFlB,4BAA4BmB,UAAUC,KAAK;IACtDlB,MAAM;MAAEW,KAAK,GAAGI,oBAAAA;MAAqDI,MAAM;IAA+B;IAC1GC,UAAU;MAACC,YAAWC;;IACtBC,QAAQ;MACNrB,OAAcZ,cAAO;QACnBa,IAAIC,SAASA;QACbC,UAAUjB;QACVkB,SAAgBC,gBAAgBC,cAAO;QACvCC,YAAmBF,gBAAgBb,aAAM;QACzCQ,OAAcK,gBAAgBG,cAAO;UAAEC,KAAYjB;UAAQkB,OAAchB;QAAI,CAAA,CAAA;MAC/E,CAAA;MACAiB,QAAeC;IACjB;EACF,CAAA;AACF,GAfiBE,wBAAAA,sBAAAA,CAAAA,EAAAA;;;",
6
- "names": ["Capability", "AutomationCapabilities", "ComputeRuntime", "Capability", "make", "meta", "id", "ActivationEvent", "AutomationEvents", "ComputeRuntimeReady", "ActivationEvent", "make", "meta", "id", "Schema", "Capability", "Database", "Operation", "TriggerTemplate", "Union", "Struct", "type", "Literal", "cron", "String", "queueDXN", "Any", "AutomationAction", "CreateTriggerFromTemplate", "TaggedClass", "meta", "id", "input", "db", "Database", "template", "enabled", "optional", "Boolean", "scriptName", "Record", "key", "value", "output", "Void", "AUTOMATION_OPERATION", "AutomationOperation", "Operation", "make", "name", "services", "Capability", "Service", "schema"]
7
- }
@@ -1,17 +0,0 @@
1
- // src/meta.ts
2
- import { trim } from "@dxos/util";
3
- var meta = {
4
- id: "dxos.org/plugin/automation",
5
- name: "Automation",
6
- description: trim`
7
- Workflow automation engine that triggers custom actions based on object events and conditions.
8
- Create automated pipelines that respond to changes and streamline repetitive tasks.
9
- `,
10
- icon: "ph--robot--regular",
11
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation"
12
- };
13
-
14
- export {
15
- meta
16
- };
17
- //# sourceMappingURL=chunk-PZNBEKO5.mjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/meta.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\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,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,QAAQ;AACV;",
6
- "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "source"]
7
- }
@@ -1,248 +0,0 @@
1
- import {
2
- meta
3
- } from "./chunk-PZNBEKO5.mjs";
4
-
5
- // src/components/TriggerEditor/TriggerEditor.tsx
6
- import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
7
- import { ComputeGraph } from "@dxos/conductor";
8
- import { DXN } from "@dxos/echo";
9
- import { Function, Script, Trigger as Trigger2 } from "@dxos/functions";
10
- import { Filter as Filter2, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
11
- import { Input } from "@dxos/react-ui";
12
- import { QueryForm } from "@dxos/react-ui-components";
13
- import { Form as Form2, FormFieldLabel, SelectField as SelectField2, omitId } from "@dxos/react-ui-form";
14
-
15
- // src/components/TriggerEditor/FunctionInputEditor.tsx
16
- import React, { useCallback, useMemo } from "react";
17
- import { Ref, Type } from "@dxos/echo";
18
- import { useOnTransition, useTranslation } from "@dxos/react-ui";
19
- import { Form, useFormValues } from "@dxos/react-ui-form";
20
- var FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }) => {
21
- const { t } = useTranslation(meta.id);
22
- const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, [
23
- "function"
24
- ]);
25
- const selectedFunctionId = useMemo(() => {
26
- if (Ref.isRef(selectedFunctionValue)) {
27
- return selectedFunctionValue.dxn.toString().split("dxn:echo:@:").at(1);
28
- }
29
- }, [
30
- selectedFunctionValue
31
- ]);
32
- const selectedFunction = useMemo(() => functions.find((fn) => fn.id === selectedFunctionId), [
33
- functions,
34
- selectedFunctionId
35
- ]);
36
- useOnTransition(
37
- // Clear function parameter input when the function changes.
38
- selectedFunctionValue,
39
- (prevValue) => {
40
- if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
41
- return false;
42
- }
43
- return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
44
- },
45
- (currValue) => currValue !== void 0,
46
- () => onValueChange(type, {})
47
- );
48
- const inputSchema = useMemo(() => selectedFunction?.inputSchema, [
49
- selectedFunction
50
- ]);
51
- const effectSchema = useMemo(() => inputSchema ? Type.toEffectSchema(inputSchema) : void 0, [
52
- inputSchema
53
- ]);
54
- const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
55
- const values = useMemo(() => getValue() ?? {}, [
56
- getValue
57
- ]);
58
- const handleValuesChanged = useCallback((values2) => {
59
- onValueChange(type, values2);
60
- }, [
61
- type,
62
- onValueChange
63
- ]);
64
- if (selectedFunction === void 0 || effectSchema === void 0 || propertyCount === 0) {
65
- return null;
66
- }
67
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Form.Label, {
68
- label: t("function parameters label"),
69
- asChild: true
70
- }), /* @__PURE__ */ React.createElement(Form.Root, {
71
- schema: effectSchema,
72
- values,
73
- db,
74
- onValuesChanged: handleValuesChanged
75
- }, /* @__PURE__ */ React.createElement(Form.FieldSet, null)));
76
- };
77
- FunctionInputEditor.displayName = "AutomationTrigger.FunctionInputEditor";
78
-
79
- // src/components/TriggerEditor/SpecSelector.tsx
80
- import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
81
- import { Filter, Query } from "@dxos/echo";
82
- import { Trigger } from "@dxos/functions";
83
- import { useTranslation as useTranslation2 } from "@dxos/react-ui";
84
- import { SelectField, useFormFieldState } from "@dxos/react-ui-form";
85
- var SpecSelector = (props) => {
86
- const { t } = useTranslation2(meta.id);
87
- const specProps = useFormFieldState(SpecSelector.displayName, [
88
- "spec"
89
- ]);
90
- const handleTypeChange = useCallback2((_type, value) => {
91
- const getDefaultTriggerSpec = (kind) => {
92
- switch (kind) {
93
- case "timer":
94
- return {
95
- kind: "timer",
96
- cron: ""
97
- };
98
- case "subscription":
99
- return {
100
- kind: "subscription",
101
- query: {
102
- ast: Query.select(Filter.nothing()).ast
103
- }
104
- };
105
- case "queue":
106
- return {
107
- kind: "queue",
108
- queue: "dxn:"
109
- };
110
- case "email":
111
- return {
112
- kind: "email"
113
- };
114
- case "webhook":
115
- return {
116
- kind: "webhook"
117
- };
118
- default:
119
- return void 0;
120
- }
121
- };
122
- const defaultSpec = getDefaultTriggerSpec(value);
123
- if (!defaultSpec) {
124
- return;
125
- }
126
- specProps.onValueChange(props.type, defaultSpec);
127
- }, [
128
- props.type,
129
- specProps
130
- ]);
131
- const options = useMemo2(() => Trigger.Kinds.map((kind) => ({
132
- value: kind,
133
- label: t(`trigger type ${kind}`)
134
- })), [
135
- t
136
- ]);
137
- return /* @__PURE__ */ React2.createElement(SelectField, {
138
- ...props,
139
- options,
140
- onValueChange: handleTypeChange
141
- });
142
- };
143
- SpecSelector.displayName = "Form.SpecSelector";
144
-
145
- // src/components/TriggerEditor/TriggerEditor.tsx
146
- var TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }) => {
147
- const fieldMap = useCustomInputs({
148
- db,
149
- types,
150
- tags,
151
- readonlySpec
152
- });
153
- return /* @__PURE__ */ React3.createElement(Form2.Root, {
154
- ...formProps,
155
- schema: omitId(Trigger2.Trigger),
156
- values: trigger,
157
- db,
158
- fieldMap
159
- }, /* @__PURE__ */ React3.createElement(Form2.Viewport, null, /* @__PURE__ */ React3.createElement(Form2.Content, null, /* @__PURE__ */ React3.createElement(Form2.FieldSet, null), /* @__PURE__ */ React3.createElement(Form2.Actions, null))));
160
- };
161
- var useCustomInputs = ({ db, readonlySpec, types, tags }) => {
162
- const functions = useQuery(db, Filter2.type(Function.Function));
163
- const workflows = useQuery(db, Filter2.type(ComputeGraph));
164
- const scripts = useQuery(db, Filter2.type(Script.Script));
165
- return useMemo3(() => ({
166
- // Function selector.
167
- ["function"]: (props) => {
168
- const getValue = useCallback3(() => {
169
- const formValue = props.getValue();
170
- if (Ref2.isRef(formValue)) {
171
- return formValue.dxn.toString();
172
- }
173
- return void 0;
174
- }, [
175
- props
176
- ]);
177
- const handleOnValueChange = useCallback3((_type, dxnString) => {
178
- const dxn = DXN.parse(dxnString);
179
- if (dxn) {
180
- const ref = Ref2.fromDXN(dxn);
181
- props.onValueChange(props.type, ref);
182
- }
183
- }, [
184
- props.type,
185
- props.onValueChange
186
- ]);
187
- return /* @__PURE__ */ React3.createElement(SelectField2, {
188
- ...props,
189
- getValue,
190
- onValueChange: handleOnValueChange,
191
- options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
192
- });
193
- },
194
- // Spec selector.
195
- ["spec.kind"]: (props) => /* @__PURE__ */ React3.createElement(SpecSelector, {
196
- ...props,
197
- readonly: readonlySpec
198
- }),
199
- // TODO(wittjosiah): Copied from ViewEditor.
200
- // Query input editor.
201
- ["spec.query"]: (props) => {
202
- const handleChange = useCallback3((query) => props.onValueChange(props.type, {
203
- ast: query.ast
204
- }), [
205
- props.type,
206
- props.onValueChange
207
- ]);
208
- return /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(FormFieldLabel, {
209
- label: props.label,
210
- asChild: true
211
- }), /* @__PURE__ */ React3.createElement(QueryForm, {
212
- initialQuery: props.getValue().ast,
213
- types,
214
- tags,
215
- onChange: handleChange
216
- }));
217
- },
218
- // Function input editor.
219
- ["input"]: (props) => /* @__PURE__ */ React3.createElement(FunctionInputEditor, {
220
- ...props,
221
- functions,
222
- db
223
- })
224
- }), [
225
- workflows,
226
- scripts,
227
- functions,
228
- readonlySpec
229
- ]);
230
- };
231
- var getWorkflowOptions = (graphs) => {
232
- return graphs.map((graph) => ({
233
- label: `compute-${graph.id}`,
234
- value: `dxn:echo:@:${graph.id}`
235
- }));
236
- };
237
- var getFunctionOptions = (scripts, functions) => {
238
- const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
239
- return functions.map((fn) => ({
240
- label: getLabel(fn),
241
- value: `dxn:echo:@:${fn.id}`
242
- }));
243
- };
244
-
245
- export {
246
- TriggerEditor
247
- };
248
- //# sourceMappingURL=chunk-QW3EM35H.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 { DXN, type Database, type Query } from '@dxos/echo';\nimport { Function, Script, Trigger } from '@dxos/functions';\nimport { Filter, Ref, useQuery } from '@dxos/react-client/echo';\nimport { Input } from '@dxos/react-ui';\nimport { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';\nimport {\n type ExcludeId,\n Form,\n FormFieldLabel,\n type FormFieldMap,\n type FormRootProps,\n SelectField,\n omitId,\n} from '@dxos/react-ui-form';\n\nimport { FunctionInputEditor } from './FunctionInputEditor';\nimport { SpecSelector } from './SpecSelector';\n\ntype TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;\n\nexport type TriggerEditorProps = {\n db: Database.Database;\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} &\n // prettier-ignore\n Pick<QueryFormProps, 'types' | 'tags'> &\n Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;\n\nexport const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {\n const fieldMap = useCustomInputs({\n db,\n types,\n tags,\n readonlySpec,\n });\n\n return (\n <Form.Root<TriggerFormSchema>\n {...formProps}\n schema={omitId(Trigger.Trigger)}\n values={trigger}\n db={db}\n fieldMap={fieldMap}\n >\n <Form.Viewport>\n <Form.Content>\n <Form.FieldSet />\n <Form.Actions />\n </Form.Content>\n </Form.Viewport>\n </Form.Root>\n );\n};\n\ntype UseCustomInputsProps = {\n db: Database.Database;\n readonlySpec?: boolean;\n} & Pick<QueryFormProps, 'types' | 'tags'>;\n\nconst useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {\n const functions = useQuery(db, Filter.type(Function.Function));\n const workflows = useQuery(db, Filter.type(ComputeGraph));\n const scripts = useQuery(db, Filter.type(Script.Script));\n\n return useMemo(\n (): FormFieldMap => ({\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 = DXN.parse(dxnString);\n if (dxn) {\n const ref = Ref.fromDXN(dxn);\n props.onValueChange(props.type, ref);\n }\n },\n [props.type, props.onValueChange],\n );\n\n return (\n <SelectField\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} />,\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(props.type, { ast: query.ast }),\n [props.type, props.onValueChange],\n );\n\n return (\n <Input.Root>\n <FormFieldLabel label={props.label} asChild />\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) => <FunctionInputEditor {...props} functions={functions} db={db} />,\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 type * as SchemaAST from 'effect/SchemaAST';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type Database, Ref, Type } from '@dxos/echo';\nimport { type JsonPath } from '@dxos/echo/internal';\nimport { type Function } from '@dxos/functions';\nimport { useOnTransition, useTranslation } from '@dxos/react-ui';\nimport { Form, type FormFieldStateProps, type FormRootProps, useFormValues } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\n\nexport type FunctionInputEditorProps = {\n type: SchemaAST.AST;\n functions: Function.Function[];\n db?: Database.Database;\n} & FormFieldStateProps;\n\nexport const FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }: FunctionInputEditorProps) => {\n const { t } = useTranslation(meta.id);\n const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, ['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(type, {}),\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 const values = useMemo(() => getValue() ?? {}, [getValue]);\n\n const handleValuesChanged = useCallback<NonNullable<FormRootProps['onValuesChanged']>>(\n (values) => {\n onValueChange(type, values);\n },\n [type, onValueChange],\n );\n\n if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {\n return null;\n }\n\n return (\n <>\n <Form.Label label={t('function parameters label')} asChild />\n <Form.Root schema={effectSchema} values={values} db={db} onValuesChanged={handleValuesChanged}>\n <Form.FieldSet />\n </Form.Root>\n </>\n );\n};\n\nFunctionInputEditor.displayName = 'AutomationTrigger.FunctionInputEditor';\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 FormFieldComponentProps, SelectField, useFormFieldState } from '@dxos/react-ui-form';\n\nimport { meta } from '../../meta';\n\nexport type SpecSelectorProps = FormFieldComponentProps;\n\nexport const SpecSelector = (props: SpecSelectorProps) => {\n const { t } = useTranslation(meta.id);\n const specProps = useFormFieldState(SpecSelector.displayName, ['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(props.type, defaultSpec);\n },\n [props.type, 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 <SelectField {...props} options={options} onValueChange={handleTypeChange} />;\n};\n\nSpecSelector.displayName = 'Form.SpecSelector';\n"],
5
- "mappings": ";;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,WAAsC;AAC/C,SAASC,UAAUC,QAAQC,WAAAA,gBAAe;AAC1C,SAASC,UAAAA,SAAQC,OAAAA,MAAKC,gBAAgB;AACtC,SAASC,aAAa;AACtB,SAASC,iBAAsC;AAC/C,SAEEC,QAAAA,OACAC,gBAGAC,eAAAA,cACAC,cACK;;;ACfP,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAAwBC,KAAKC,YAAY;AAGzC,SAASC,iBAAiBC,sBAAsB;AAChD,SAASC,MAAoDC,qBAAqB;AAU3E,IAAMC,sBAAsB,CAAC,EAAEC,MAAMC,WAAWC,IAAIC,UAAUC,cAAa,MAA4B;AAC5G,QAAM,EAAEC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qB,CAACxB,SAA0BP,cAAAA;AACpD,QAAMkD,WAAW,CAACC,OAA0B5C,QAAQ6C,KAAK,CAACC,MAAMF,GAAGG,QAAQC,QAAQP,OAAOK,EAAEL,EAAE,GAAGQ,QAAQL,GAAGK;AAC5G,SAAOxD,UAAU8C,IAAI,CAACK,QAAQ;IAAEZ,OAAOW,SAASC,EAAAA;IAAKF,OAAO,cAAcE,GAAGH,EAAE;EAAG,EAAA;AACpF;",
6
- "names": ["React", "useCallback", "useMemo", "ComputeGraph", "DXN", "Function", "Script", "Trigger", "Filter", "Ref", "useQuery", "Input", "QueryForm", "Form", "FormFieldLabel", "SelectField", "omitId", "React", "useCallback", "useMemo", "Ref", "Type", "useOnTransition", "useTranslation", "Form", "useFormValues", "FunctionInputEditor", "type", "functions", "db", "getValue", "onValueChange", "t", "useTranslation", "meta", "id", "selectedFunctionValue", "useFormValues", "displayName", "selectedFunctionId", "useMemo", "Ref", "isRef", "dxn", "toString", "split", "at", "selectedFunction", "find", "fn", "useOnTransition", "prevValue", "currValue", "undefined", "inputSchema", "effectSchema", "Type", "toEffectSchema", "propertyCount", "properties", "Object", "keys", "length", "values", "handleValuesChanged", "useCallback", "Form", "Label", "label", "asChild", "Root", "schema", "onValuesChanged", "FieldSet", "React", "useCallback", "useMemo", "Filter", "Query", "Trigger", "useTranslation", "SelectField", "useFormFieldState", "SpecSelector", "props", "t", "useTranslation", "meta", "id", "specProps", "useFormFieldState", "displayName", "handleTypeChange", "useCallback", "_type", "value", "getDefaultTriggerSpec", "kind", "cron", "query", "ast", "Query", "select", "Filter", "nothing", "queue", "undefined", "defaultSpec", "onValueChange", "type", "options", "useMemo", "Trigger", "Kinds", "map", "label", "React", "SelectField", "TriggerEditor", "db", "types", "tags", "readonlySpec", "trigger", "formProps", "fieldMap", "useCustomInputs", "React", "Form", "Root", "schema", "omitId", "Trigger", "values", "Viewport", "Content", "FieldSet", "Actions", "functions", "useQuery", "Filter", "type", "Function", "workflows", "ComputeGraph", "scripts", "Script", "useMemo", "props", "getValue", "useCallback", "formValue", "Ref", "isRef", "dxn", "toString", "undefined", "handleOnValueChange", "_type", "dxnString", "DXN", "parse", "ref", "fromDXN", "onValueChange", "SelectField", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "SpecSelector", "readonly", "handleChange", "query", "ast", "Input", "FormFieldLabel", "label", "asChild", "QueryForm", "initialQuery", "onChange", "FunctionInputEditor", "graphs", "map", "graph", "id", "value", "getLabel", "fn", "find", "s", "source", "target", "name"]
7
- }