@dxos/plugin-automation 0.8.3-staging.0fa589b → 0.8.4-main.1da679c

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 (208) hide show
  1. package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +11 -0
  2. package/dist/lib/browser/AutomationSettings-S3F2VT7Q.mjs +70 -0
  3. package/dist/lib/browser/AutomationSettings-S3F2VT7Q.mjs.map +7 -0
  4. package/dist/lib/browser/{FunctionsContainer-JY7V7PLF.mjs → FunctionsContainer-U4HASI4P.mjs} +6 -9
  5. package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +7 -0
  6. package/dist/lib/browser/{FunctionsPanel-LY4IFKR7.mjs → FunctionsPanel-I443Y6KB.mjs} +3 -3
  7. package/dist/lib/browser/{app-graph-builder-T34RV5UA.mjs → app-graph-builder-SRA3X2GQ.mjs} +6 -6
  8. package/dist/lib/{node-esm/app-graph-builder-DYWAKQM3.mjs.map → browser/app-graph-builder-SRA3X2GQ.mjs.map} +3 -3
  9. package/dist/lib/browser/{chunk-C5VOC5EE.mjs → chunk-4TWQV33E.mjs} +14 -18
  10. package/dist/lib/browser/chunk-4TWQV33E.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-CRUNQZ2M.mjs +15 -0
  12. package/dist/lib/browser/chunk-CRUNQZ2M.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-IHAKPP5A.mjs → chunk-GW5U2DGT.mjs} +2 -2
  14. package/dist/lib/browser/{chunk-4E2KPMLB.mjs → chunk-HN7OHFCB.mjs} +5 -6
  15. package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +7 -0
  16. package/dist/lib/browser/chunk-NQGKPPXI.mjs +14 -0
  17. package/dist/lib/browser/chunk-NQGKPPXI.mjs.map +7 -0
  18. package/dist/lib/browser/chunk-P6YOYDXP.mjs +53 -0
  19. package/dist/lib/browser/chunk-P6YOYDXP.mjs.map +7 -0
  20. package/dist/lib/browser/{chunk-N5VLW7UZ.mjs → chunk-S4SM663I.mjs} +20 -20
  21. package/dist/lib/browser/chunk-S4SM663I.mjs.map +7 -0
  22. package/dist/lib/browser/chunk-UHXDXRP4.mjs +14 -0
  23. package/dist/lib/browser/chunk-UHXDXRP4.mjs.map +7 -0
  24. package/dist/lib/browser/{chunk-RHSCK7AU.mjs → chunk-Z5DT4MHW.mjs} +5 -5
  25. package/dist/lib/{node-esm/chunk-2IH4VB3R.mjs.map → browser/chunk-Z5DT4MHW.mjs.map} +3 -3
  26. package/dist/lib/browser/compute-runtime-G25R3RSS.mjs +154 -0
  27. package/dist/lib/browser/compute-runtime-G25R3RSS.mjs.map +7 -0
  28. package/dist/lib/browser/hooks/index.mjs +12 -0
  29. package/dist/lib/browser/index.mjs +30 -19
  30. package/dist/lib/browser/index.mjs.map +4 -4
  31. package/dist/lib/browser/{intent-resolver-AX46HSU7.mjs → intent-resolver-CMLGPFD6.mjs} +12 -11
  32. package/dist/lib/browser/intent-resolver-CMLGPFD6.mjs.map +7 -0
  33. package/dist/lib/browser/meta.json +1 -1
  34. package/dist/lib/browser/{react-surface-Z7A272CA.mjs → react-surface-IYFH2BEM.mjs} +18 -18
  35. package/dist/lib/browser/react-surface-IYFH2BEM.mjs.map +7 -0
  36. package/dist/lib/browser/types/index.mjs +8 -0
  37. package/dist/lib/node-esm/{AutomationPanel-Y3ODAHH7.mjs → AutomationPanel-MKOLA2FE.mjs} +4 -4
  38. package/dist/lib/node-esm/AutomationSettings-C3GNAUYC.mjs +71 -0
  39. package/dist/lib/node-esm/AutomationSettings-C3GNAUYC.mjs.map +7 -0
  40. package/dist/lib/node-esm/{FunctionsContainer-25M5VT3J.mjs → FunctionsContainer-VZIVURH6.mjs} +6 -9
  41. package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +7 -0
  42. package/dist/lib/node-esm/{FunctionsPanel-HVGF5AJP.mjs → FunctionsPanel-ELINCXPW.mjs} +3 -3
  43. package/dist/lib/node-esm/{app-graph-builder-DYWAKQM3.mjs → app-graph-builder-R5XQJKZS.mjs} +6 -6
  44. package/dist/lib/{browser/app-graph-builder-T34RV5UA.mjs.map → node-esm/app-graph-builder-R5XQJKZS.mjs.map} +3 -3
  45. package/dist/lib/node-esm/{chunk-2T2OZC3A.mjs → chunk-AONUBWBE.mjs} +14 -18
  46. package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +7 -0
  47. package/dist/lib/node-esm/chunk-BTD2B4SZ.mjs +16 -0
  48. package/dist/lib/node-esm/chunk-BTD2B4SZ.mjs.map +7 -0
  49. package/dist/lib/node-esm/chunk-CTAX6WBZ.mjs +16 -0
  50. package/dist/lib/node-esm/chunk-CTAX6WBZ.mjs.map +7 -0
  51. package/dist/lib/node-esm/{chunk-2IH4VB3R.mjs → chunk-CX2AILIS.mjs} +5 -5
  52. package/dist/lib/{browser/chunk-RHSCK7AU.mjs.map → node-esm/chunk-CX2AILIS.mjs.map} +3 -3
  53. package/dist/lib/node-esm/{chunk-HCCLRNMJ.mjs → chunk-NK5N3QKD.mjs} +2 -2
  54. package/dist/lib/node-esm/{chunk-6JOJ2NN4.mjs → chunk-OEZNHUL2.mjs} +5 -6
  55. package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +7 -0
  56. package/dist/lib/node-esm/chunk-UAOO5IZQ.mjs +16 -0
  57. package/dist/lib/node-esm/chunk-UAOO5IZQ.mjs.map +7 -0
  58. package/dist/lib/node-esm/chunk-XL33Y62M.mjs +54 -0
  59. package/dist/lib/node-esm/chunk-XL33Y62M.mjs.map +7 -0
  60. package/dist/lib/node-esm/{chunk-UFHDB2OA.mjs → chunk-ZOJVKPCA.mjs} +20 -20
  61. package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +7 -0
  62. package/dist/lib/node-esm/compute-runtime-LHO62OVM.mjs +155 -0
  63. package/dist/lib/node-esm/compute-runtime-LHO62OVM.mjs.map +7 -0
  64. package/dist/lib/node-esm/hooks/index.mjs +13 -0
  65. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  66. package/dist/lib/node-esm/index.mjs +30 -19
  67. package/dist/lib/node-esm/index.mjs.map +4 -4
  68. package/dist/lib/node-esm/{intent-resolver-WXHFNJJI.mjs → intent-resolver-NUPI6NC6.mjs} +12 -11
  69. package/dist/lib/node-esm/intent-resolver-NUPI6NC6.mjs.map +7 -0
  70. package/dist/lib/node-esm/meta.json +1 -1
  71. package/dist/lib/node-esm/{react-surface-TP6IYSR4.mjs → react-surface-FDRJ76PK.mjs} +18 -18
  72. package/dist/lib/node-esm/react-surface-FDRJ76PK.mjs.map +7 -0
  73. package/dist/lib/node-esm/{types.mjs → types/index.mjs} +3 -3
  74. package/dist/lib/node-esm/types/index.mjs.map +7 -0
  75. package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
  76. package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
  77. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
  78. package/dist/types/src/capabilities/capabilities.d.ts +18 -0
  79. package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
  81. package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
  82. package/dist/types/src/capabilities/index.d.ts +5 -3
  83. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  84. package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
  85. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  86. package/dist/types/src/capabilities/react-surface.d.ts +1 -1
  87. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -5
  88. package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
  89. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -3
  90. package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
  91. package/dist/types/src/components/AutomationSettings.d.ts +5 -0
  92. package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
  93. package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
  94. package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
  95. package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
  96. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +2 -2
  97. package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
  98. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +45 -3
  99. package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
  100. package/dist/types/src/components/TriggerSettings.d.ts +6 -0
  101. package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
  102. package/dist/types/src/components/index.d.ts +2 -2
  103. package/dist/types/src/components/index.d.ts.map +1 -1
  104. package/dist/types/src/hooks/index.d.ts +3 -0
  105. package/dist/types/src/hooks/index.d.ts.map +1 -0
  106. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
  107. package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
  108. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
  109. package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
  110. package/dist/types/src/index.d.ts +1 -0
  111. package/dist/types/src/index.d.ts.map +1 -1
  112. package/dist/types/src/translations.d.ts +31 -29
  113. package/dist/types/src/translations.d.ts.map +1 -1
  114. package/dist/types/src/types/index.d.ts +2 -0
  115. package/dist/types/src/types/index.d.ts.map +1 -0
  116. package/dist/types/src/{types.d.ts → types/schema.d.ts} +3 -3
  117. package/dist/types/src/types/schema.d.ts.map +1 -0
  118. package/dist/types/tsconfig.tsbuildinfo +1 -1
  119. package/package.json +55 -34
  120. package/src/AutomationPlugin.tsx +9 -4
  121. package/src/capabilities/app-graph-builder.ts +2 -2
  122. package/src/capabilities/capabilities.ts +52 -0
  123. package/src/capabilities/compute-runtime.ts +124 -0
  124. package/src/capabilities/index.ts +3 -0
  125. package/src/capabilities/intent-resolver.ts +7 -7
  126. package/src/capabilities/react-surface.tsx +11 -11
  127. package/src/components/AutomationPanel/AutomationPanel.stories.tsx +11 -8
  128. package/src/components/AutomationPanel/AutomationPanel.tsx +15 -27
  129. package/src/components/AutomationSettings.tsx +30 -0
  130. package/src/components/FunctionsContainer.tsx +10 -12
  131. package/src/components/FunctionsPanel/FunctionsPanel.tsx +2 -2
  132. package/src/components/TriggerEditor/SpecSelector.tsx +14 -14
  133. package/src/components/TriggerEditor/TriggerEditor.stories.tsx +12 -9
  134. package/src/components/TriggerEditor/TriggerEditor.tsx +6 -12
  135. package/src/components/TriggerSettings.tsx +25 -0
  136. package/src/components/index.ts +1 -1
  137. package/src/hooks/index.ts +6 -0
  138. package/src/hooks/useComputeRuntimeCallback.ts +30 -0
  139. package/src/hooks/useTriggerRuntimeControls.ts +52 -0
  140. package/src/index.ts +1 -0
  141. package/src/translations.ts +10 -4
  142. package/src/types/index.ts +5 -0
  143. package/src/{types.ts → types/schema.ts} +2 -4
  144. package/dist/lib/browser/AutomationContainer-OGNK3HD5.mjs +0 -38
  145. package/dist/lib/browser/AutomationContainer-OGNK3HD5.mjs.map +0 -7
  146. package/dist/lib/browser/AutomationPanel-PRIIAXD5.mjs +0 -11
  147. package/dist/lib/browser/FunctionsContainer-JY7V7PLF.mjs.map +0 -7
  148. package/dist/lib/browser/chunk-4E2KPMLB.mjs.map +0 -7
  149. package/dist/lib/browser/chunk-C5VOC5EE.mjs.map +0 -7
  150. package/dist/lib/browser/chunk-N5VLW7UZ.mjs.map +0 -7
  151. package/dist/lib/browser/chunk-VQWJ5UYA.mjs +0 -14
  152. package/dist/lib/browser/chunk-VQWJ5UYA.mjs.map +0 -7
  153. package/dist/lib/browser/intent-resolver-AX46HSU7.mjs.map +0 -7
  154. package/dist/lib/browser/react-surface-Z7A272CA.mjs.map +0 -7
  155. package/dist/lib/browser/types.mjs +0 -8
  156. package/dist/lib/node/AutomationContainer-B7PSJFIS.cjs +0 -66
  157. package/dist/lib/node/AutomationContainer-B7PSJFIS.cjs.map +0 -7
  158. package/dist/lib/node/AutomationPanel-XYLZU4MI.cjs +0 -32
  159. package/dist/lib/node/AutomationPanel-XYLZU4MI.cjs.map +0 -7
  160. package/dist/lib/node/FunctionsContainer-4FGOQW5X.cjs +0 -67
  161. package/dist/lib/node/FunctionsContainer-4FGOQW5X.cjs.map +0 -7
  162. package/dist/lib/node/FunctionsPanel-EWWAZK3W.cjs +0 -31
  163. package/dist/lib/node/FunctionsPanel-EWWAZK3W.cjs.map +0 -7
  164. package/dist/lib/node/app-graph-builder-5XRIIV7E.cjs +0 -96
  165. package/dist/lib/node/app-graph-builder-5XRIIV7E.cjs.map +0 -7
  166. package/dist/lib/node/chunk-3EF7MLFX.cjs +0 -38
  167. package/dist/lib/node/chunk-3EF7MLFX.cjs.map +0 -7
  168. package/dist/lib/node/chunk-6X3XJ4VI.cjs +0 -122
  169. package/dist/lib/node/chunk-6X3XJ4VI.cjs.map +0 -7
  170. package/dist/lib/node/chunk-GIIVTK4O.cjs +0 -58
  171. package/dist/lib/node/chunk-GIIVTK4O.cjs.map +0 -7
  172. package/dist/lib/node/chunk-IXUCZ3YY.cjs +0 -173
  173. package/dist/lib/node/chunk-IXUCZ3YY.cjs.map +0 -7
  174. package/dist/lib/node/chunk-LQ6XK4N5.cjs +0 -253
  175. package/dist/lib/node/chunk-LQ6XK4N5.cjs.map +0 -7
  176. package/dist/lib/node/chunk-TH4XDKAY.cjs +0 -49
  177. package/dist/lib/node/chunk-TH4XDKAY.cjs.map +0 -7
  178. package/dist/lib/node/index.cjs +0 -124
  179. package/dist/lib/node/index.cjs.map +0 -7
  180. package/dist/lib/node/intent-resolver-EAREQZFE.cjs +0 -92
  181. package/dist/lib/node/intent-resolver-EAREQZFE.cjs.map +0 -7
  182. package/dist/lib/node/meta.json +0 -1
  183. package/dist/lib/node/react-surface-OI6CDHEI.cjs +0 -87
  184. package/dist/lib/node/react-surface-OI6CDHEI.cjs.map +0 -7
  185. package/dist/lib/node/types.cjs +0 -30
  186. package/dist/lib/node/types.cjs.map +0 -7
  187. package/dist/lib/node-esm/AutomationContainer-ANCUYDDA.mjs +0 -39
  188. package/dist/lib/node-esm/AutomationContainer-ANCUYDDA.mjs.map +0 -7
  189. package/dist/lib/node-esm/FunctionsContainer-25M5VT3J.mjs.map +0 -7
  190. package/dist/lib/node-esm/chunk-2T2OZC3A.mjs.map +0 -7
  191. package/dist/lib/node-esm/chunk-6JOJ2NN4.mjs.map +0 -7
  192. package/dist/lib/node-esm/chunk-UFHDB2OA.mjs.map +0 -7
  193. package/dist/lib/node-esm/chunk-WJHKFPX2.mjs +0 -16
  194. package/dist/lib/node-esm/chunk-WJHKFPX2.mjs.map +0 -7
  195. package/dist/lib/node-esm/intent-resolver-WXHFNJJI.mjs.map +0 -7
  196. package/dist/lib/node-esm/react-surface-TP6IYSR4.mjs.map +0 -7
  197. package/dist/types/src/components/AutomationContainer.d.ts +0 -5
  198. package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
  199. package/dist/types/src/types.d.ts.map +0 -1
  200. package/src/components/AutomationContainer.tsx +0 -30
  201. /package/dist/lib/browser/{AutomationPanel-PRIIAXD5.mjs.map → AutomationPanel-N5HFJJXW.mjs.map} +0 -0
  202. /package/dist/lib/browser/{FunctionsPanel-LY4IFKR7.mjs.map → FunctionsPanel-I443Y6KB.mjs.map} +0 -0
  203. /package/dist/lib/browser/{chunk-IHAKPP5A.mjs.map → chunk-GW5U2DGT.mjs.map} +0 -0
  204. /package/dist/lib/browser/{types.mjs.map → hooks/index.mjs.map} +0 -0
  205. /package/dist/lib/{node-esm/AutomationPanel-Y3ODAHH7.mjs.map → browser/types/index.mjs.map} +0 -0
  206. /package/dist/lib/node-esm/{FunctionsPanel-HVGF5AJP.mjs.map → AutomationPanel-MKOLA2FE.mjs.map} +0 -0
  207. /package/dist/lib/node-esm/{types.mjs.map → FunctionsPanel-ELINCXPW.mjs.map} +0 -0
  208. /package/dist/lib/node-esm/{chunk-HCCLRNMJ.mjs.map → chunk-NK5N3QKD.mjs.map} +0 -0
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  meta
4
- } from "./chunk-HCCLRNMJ.mjs";
4
+ } from "./chunk-NK5N3QKD.mjs";
5
5
 
6
- // packages/plugins/plugin-automation/src/capabilities/app-graph-builder.ts
6
+ // src/capabilities/app-graph-builder.ts
7
7
  import { Rx } from "@effect-rx/rx-react";
8
8
  import { Option, pipe } from "effect";
9
9
  import { Capabilities, contributes } from "@dxos/app-framework";
10
10
  import { Obj } from "@dxos/echo";
11
11
  import { ScriptType } from "@dxos/functions";
12
- import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from "@dxos/plugin-deck/types";
12
+ import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
13
13
  import { createExtension } from "@dxos/plugin-graph";
14
14
  import { SPACE_PLUGIN } from "@dxos/plugin-space";
15
- var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBuilder, [
15
+ var app_graph_builder_default = ((context) => contributes(Capabilities.AppGraphBuilder, [
16
16
  createExtension({
17
17
  id: `${meta.id}/space-settings-automation`,
18
18
  connector: (node) => Rx.make((get) => pipe(get(node), Option.flatMap((node2) => node2.type === `${SPACE_PLUGIN}/settings` ? Option.some(node2) : Option.none()), Option.map((node2) => [
@@ -74,8 +74,8 @@ var app_graph_builder_default = (context) => contributes(Capabilities.AppGraphBu
74
74
  }
75
75
  ]), Option.getOrElse(() => [])))
76
76
  })
77
- ]);
77
+ ]));
78
78
  export {
79
79
  app_graph_builder_default as default
80
80
  };
81
- //# sourceMappingURL=app-graph-builder-DYWAKQM3.mjs.map
81
+ //# sourceMappingURL=app-graph-builder-R5XQJKZS.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/app-graph-builder.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension } from '@dxos/plugin-graph';\nimport { SPACE_PLUGIN } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/script-companion`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: [node.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 Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
5
- "mappings": ";;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,mBAAuC;AAC9D,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,sBAAsBC,iCAAiC;AAChE,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAI7B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,cAAcG,MAAKH,EAAE;QACzBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIjB,KAAKD;YAAG;;UAChDmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,aAAaG,MAAKH,EAAE;QACxBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIjB,KAAKD;YAAG;;UAC/CmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUkB,IAAIC,WAAWC,YAAYpB,MAAKY,IAAI,IAAIP,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACjGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcwB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIjB,KAAKD;YAAG;;UACjDmB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACDnB,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
6
- "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "Obj", "ScriptType", "PLANK_COMPANION_TYPE", "ATTENDABLE_PATH_SEPARATOR", "createExtension", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "type", "SPACE_PLUGIN", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { createExtension } from '@dxos/plugin-graph';\nimport { SPACE_PLUGIN } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\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 Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/script-companion`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: [node.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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UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIjB,KAAKD;YAAG;;UAC/CmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUkB,IAAIC,WAAWC,YAAYpB,MAAKY,IAAI,IAAIP,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACjGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcwB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIjB,KAAKD;YAAG;;UACjDmB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACDnB,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
6
+ "names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "Obj", "ScriptType", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "createExtension", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "type", "SPACE_PLUGIN", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
7
7
  }
@@ -1,25 +1,25 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  TriggerEditor
4
- } from "./chunk-UFHDB2OA.mjs";
4
+ } from "./chunk-ZOJVKPCA.mjs";
5
5
  import {
6
6
  AUTOMATION_PLUGIN
7
- } from "./chunk-HCCLRNMJ.mjs";
7
+ } from "./chunk-NK5N3QKD.mjs";
8
8
 
9
- // packages/plugins/plugin-automation/src/components/AutomationPanel/AutomationPanel.tsx
9
+ // src/components/AutomationPanel/AutomationPanel.tsx
10
10
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
11
11
  import { Schema } from "effect";
12
12
  import React, { useState } from "react";
13
13
  import { Filter, Obj } from "@dxos/echo";
14
- import { FunctionType, FunctionTrigger, FunctionTriggerSchema, ScriptType, TriggerKind } from "@dxos/functions";
14
+ import { FunctionTrigger, FunctionType, ScriptType } from "@dxos/functions";
15
15
  import { useClient } from "@dxos/react-client";
16
- import { useQuery, getSpace } from "@dxos/react-client/echo";
16
+ import { getSpace, useQuery } from "@dxos/react-client/echo";
17
17
  import { Clipboard, IconButton, Input, Separator, useTranslation } from "@dxos/react-ui";
18
18
  import { ControlItem, controlItemClasses } from "@dxos/react-ui-form";
19
19
  import { List } from "@dxos/react-ui-list";
20
20
  import { ghostHover, mx } from "@dxos/react-ui-theme";
21
21
  var grid = "grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]";
22
- var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
22
+ var AutomationPanel = ({ classNames, space, object, initialTrigger, onDone }) => {
23
23
  var _effect = _useSignals();
24
24
  try {
25
25
  const { t } = useTranslation(AUTOMATION_PLUGIN);
@@ -30,12 +30,11 @@ var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
30
30
  const [trigger, setTrigger] = useState(initialTrigger);
31
31
  const [selected, setSelected] = useState();
32
32
  const handleSelect = (trigger2) => {
33
- const { id: _, ...values } = trigger2;
34
- setTrigger(values);
33
+ setTrigger(trigger2);
35
34
  setSelected(trigger2);
36
35
  };
37
36
  const handleAdd = () => {
38
- setTrigger(Obj.make(FunctionTriggerSchema, {}));
37
+ setTrigger(Obj.make(FunctionTrigger, {}));
39
38
  setSelected(void 0);
40
39
  };
41
40
  const handleDelete = (trigger2) => {
@@ -68,7 +67,7 @@ var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
68
67
  }));
69
68
  }
70
69
  return /* @__PURE__ */ React.createElement("div", {
71
- className: controlItemClasses
70
+ className: mx(controlItemClasses, classNames)
72
71
  }, triggers.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
73
72
  items: triggers,
74
73
  isItem: Schema.is(FunctionTrigger),
@@ -108,13 +107,13 @@ var AutomationPanel = ({ space, object, initialTrigger, onDone }) => {
108
107
  }
109
108
  };
110
109
  var getCopyAction = (client, trigger) => {
111
- if (trigger?.spec?.kind === TriggerKind.Email) {
110
+ if (trigger?.spec?.kind === "email") {
112
111
  return {
113
112
  translationKey: "trigger copy email",
114
113
  contentProvider: () => `${getSpace(trigger).id}@dxos.network`
115
114
  };
116
115
  }
117
- if (trigger?.spec?.kind === TriggerKind.Webhook) {
116
+ if (trigger?.spec?.kind === "webhook") {
118
117
  return {
119
118
  translationKey: "trigger copy url",
120
119
  contentProvider: () => getWebhookUrl(client, trigger)
@@ -132,17 +131,14 @@ var getWebhookUrl = (client, trigger) => {
132
131
  var getFunctionName = (scripts, functions, trigger) => {
133
132
  const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}\u2026`;
134
133
  const functionObject = functions.find((fn) => fn === trigger.function?.target);
135
- if (!functionObject) {
136
- return shortId;
137
- }
138
- return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;
134
+ return functionObject?.name ?? shortId;
139
135
  };
140
136
 
141
- // packages/plugins/plugin-automation/src/components/AutomationPanel/index.ts
137
+ // src/components/AutomationPanel/index.ts
142
138
  var AutomationPanel_default = AutomationPanel;
143
139
 
144
140
  export {
145
141
  AutomationPanel,
146
142
  AutomationPanel_default
147
143
  };
148
- //# sourceMappingURL=chunk-2T2OZC3A.mjs.map
144
+ //# sourceMappingURL=chunk-AONUBWBE.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { useState } from 'react';\n\nimport { Filter, Obj } from '@dxos/echo';\nimport { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { type Space, getSpace, useQuery } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, Separator, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { ControlItem, controlItemClasses } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = ThemedClassName<{\n space: Space;\n object?: Obj.Any;\n initialTrigger?: FunctionTrigger;\n onDone?: () => void;\n}>;\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ classNames, space, object, initialTrigger, onDone }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.type(FunctionTrigger));\n const functions = useQuery(space, Filter.type(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTrigger | undefined>(initialTrigger);\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n setTrigger(trigger);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(Obj.make(FunctionTrigger, {}));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(Obj.make(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n onDone?.();\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n onDone?.();\n };\n\n if (trigger) {\n return (\n <ControlItem title={t('trigger editor title')}>\n <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />\n </ControlItem>\n );\n }\n\n return (\n <div className={mx(controlItemClasses, classNames)}>\n {triggers.length > 0 && (\n <List.Root<FunctionTrigger> items={triggers} isItem={Schema.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Clipboard.IconButton\n label={t(copyAction.translationKey)}\n value={copyAction.contentProvider()}\n />\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n )}\n {triggers.length > 0 && <Separator classNames='mlb-4' />}\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.kind === 'email') {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.kind === 'webhook') {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTrigger) => {\n // TODO(wittjosiah): Truncation should be done in the UI.\n // Warning that the List component is currently a can of worms.\n const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;\n const functionObject = functions.find((fn) => fn === trigger.function?.target);\n return functionObject?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport * from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,SAASA,cAAc;AACvB,OAAOC,SAASC,gBAAgB;AAEhC,SAASC,QAAQC,WAAW;AAC5B,SAASC,iBAAiBC,cAAcC,kBAAkB;AAC1D,SAAsBC,iBAAiB;AACvC,SAAqBC,UAAUC,gBAAgB;AAC/C,SAASC,WAAWC,YAAYC,OAAOC,WAAiCC,sBAAsB;AAC9F,SAASC,aAAaC,0BAA0B;AAChD,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAK/B,IAAMC,OAAO;AAUN,IAAMC,kBAAkB,CAAC,EAAEC,YAAYC,OAAOC,QAAQC,gBAAgBC,OAAM,MAAwB;;;AACzG,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,UAAMC,SAASC,UAAAA;AACf,UAAMC,WAAWC,SAASV,OAAOW,OAAOC,KAAKC,eAAAA,CAAAA;AAC7C,UAAMC,YAAYJ,SA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E,iBAAiB,MAAMO,cAAc5E,QAAQW,OAAAA;IAAS;EACrG;AAEA,SAAOS;AACT;AAEA,IAAMwD,gBAAgB,CAAC5E,QAAgBW,YAAAA;AACrC,QAAMkE,UAAUF,SAAShE,OAAAA,EAAUoC;AACnC,QAAM+B,UAAU,IAAIC,IAAI/E,OAAOgF,OAAOC,OAAOC,QAASC,SAAUC,KAAMC,GAAG;AACzE,QAAMC,WAAWR,QAAQS,SAASC,WAAW,OAAA,KAAYV,QAAQS,SAASC,WAAW,KAAA;AACrFV,UAAQS,WAAWD,WAAW,UAAU;AACxC,SAAO,IAAIP,IAAI,YAAYF,OAAAA,IAAWlE,QAAQoC,EAAE,IAAI+B,OAAAA,EAASW,SAAQ;AACvE;AAEA,IAAM1B,kBAAkB,CAACtD,SAAuBF,WAA2BI,YAAAA;AAGzE,QAAM+E,UAAU/E,QAAQgF,YAAY,GAAGhF,QAAQgF,SAASC,IAAIH,SAAQ,EAAGI,MAAM,GAAG,EAAA,CAAA;AAChF,QAAMC,iBAAiBvF,UAAUwF,KAAK,CAACC,OAAOA,OAAOrF,QAAQgF,UAAUM,MAAAA;AACvE,SAAOH,gBAAgBI,QAAQR;AACjC;;;ACtJA,IAAA,0BAAeS;",
6
+ "names": ["Schema", "React", "useState", "Filter", "Obj", "FunctionTrigger", "FunctionType", "ScriptType", "useClient", "getSpace", "useQuery", "Clipboard", "IconButton", "Input", "Separator", "useTranslation", "ControlItem", "controlItemClasses", "List", "ghostHover", "mx", "grid", "AutomationPanel", "classNames", "space", "object", "initialTrigger", "onDone", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "type", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "handleAdd", "Obj", "make", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "ControlItem", "title", "TriggerEditor", "onSave", "onCancel", "div", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "Schema", "is", "getId", "field", "id", "role", "map", "copyAction", "getCopyAction", "Item", "key", "item", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "Clipboard", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "Separator", "icon", "spec", "kind", "getSpace", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "values", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "dxn", "slice", "functionObject", "find", "fn", "target", "name", "AutomationPanel"]
7
+ }
@@ -0,0 +1,16 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/capabilities/index.ts
4
+ import { lazy } from "@dxos/app-framework";
5
+ var AppGraphBuilder = lazy(() => import("./app-graph-builder-R5XQJKZS.mjs"));
6
+ var ComputeRuntime = lazy(() => import("./compute-runtime-LHO62OVM.mjs"));
7
+ var IntentResolver = lazy(() => import("./intent-resolver-NUPI6NC6.mjs"));
8
+ var ReactSurface = lazy(() => import("./react-surface-FDRJ76PK.mjs"));
9
+
10
+ export {
11
+ AppGraphBuilder,
12
+ ComputeRuntime,
13
+ IntentResolver,
14
+ ReactSurface
15
+ };
16
+ //# sourceMappingURL=chunk-BTD2B4SZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/index.ts"],
4
+ "sourcesContent": ["//\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"],
5
+ "mappings": ";;;AAIA,SAASA,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,iBAAiBF,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMG,eAAeH,KAAK,MAAM,OAAO,8BAAA,CAAA;",
6
+ "names": ["lazy", "AppGraphBuilder", "lazy", "ComputeRuntime", "IntentResolver", "ReactSurface"]
7
+ }
@@ -0,0 +1,16 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ meta
4
+ } from "./chunk-NK5N3QKD.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-CTAX6WBZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/capabilities.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ManagedRuntime } from 'effect';\n\nimport { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';\nimport { defineCapability } from '@dxos/app-framework';\nimport type {\n CredentialsService,\n DatabaseService,\n FunctionImplementationResolver,\n InvocationTracer,\n LocalFunctionExecutionService,\n QueueService,\n RemoteFunctionExecutionService,\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 | LocalFunctionExecutionService\n | RemoteFunctionExecutionService\n // TODO(dmaretskyi): This service is private and shouldn't be exposed as a part of public API.\n | FunctionImplementationResolver\n | InvocationTracer\n | TriggerStateStore\n // TODO(dmaretskyi): Those should be provided at AI-chat call site.\n | ToolResolverService\n | ToolExecutionService;\n\n export interface ComputeRuntimeProvider {\n getRuntime(spaceId: SpaceId): ManagedRuntime.ManagedRuntime<ComputeServices, never>;\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;UAgBhBC,yBAAAA;0BA2BFC,iBAAiBC,iBAAyC,GAAGC,KAAKC,EAAE,6BAA6B;AAChH,GA5BiBJ,2BAAAA,yBAAAA,CAAAA,EAAAA;;",
6
+ "names": ["defineCapability", "AutomationCapabilities", "ComputeRuntime", "defineCapability", "meta", "id"]
7
+ }
@@ -1,13 +1,13 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  AUTOMATION_PLUGIN
4
- } from "./chunk-HCCLRNMJ.mjs";
4
+ } from "./chunk-NK5N3QKD.mjs";
5
5
 
6
- // packages/plugins/plugin-automation/src/components/FunctionsPanel/FunctionsPanel.tsx
6
+ // src/components/FunctionsPanel/FunctionsPanel.tsx
7
7
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
8
8
  import { Schema } from "effect";
9
9
  import React, { useCallback, useMemo } from "react";
10
- import { createIntent, LayoutAction, useIntentDispatcher } from "@dxos/app-framework";
10
+ import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
11
11
  import { FunctionType, ScriptType } from "@dxos/functions";
12
12
  import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
13
13
  import { Button, useTranslation } from "@dxos/react-ui";
@@ -85,11 +85,11 @@ var FunctionsPanel = ({ space }) => {
85
85
  }
86
86
  };
87
87
 
88
- // packages/plugins/plugin-automation/src/components/FunctionsPanel/index.ts
88
+ // src/components/FunctionsPanel/index.ts
89
89
  var FunctionsPanel_default = FunctionsPanel;
90
90
 
91
91
  export {
92
92
  FunctionsPanel,
93
93
  FunctionsPanel_default
94
94
  };
95
- //# sourceMappingURL=chunk-2IH4VB3R.mjs.map
95
+ //# sourceMappingURL=chunk-CX2AILIS.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';\nimport { FunctionType, ScriptType } from '@dxos/functions';\nimport { Filter, fullyQualifiedId, useQuery, type Space } from '@dxos/react-client/echo';\nimport { Button, 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 { AUTOMATION_PLUGIN } 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(AUTOMATION_PLUGIN);\n const functions = useQuery(space, Filter.type(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\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, ScriptType>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: FunctionType) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: FunctionType) => {\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 return (\n <div role='none' className={mx(controlItemClasses)}>\n {functions.length > 0 && (\n <List.Root<FunctionType> items={functions} isItem={Schema.is(FunctionType)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<FunctionType>\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 </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,SAASA,cAAc;AACvB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,cAAcC,kBAAkB;AACzC,SAASC,QAAQC,kBAAkBC,gBAA4B;AAC/D,SAASC,QAAQC,sBAAsB;AACvC,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,iBAAAA;AAC7B,UAAMC,YAAYC,SAASL,OAAOM,O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I;MACV6B,MAAMjC;MACNkC,YAAYb,GAAGzC,MAAMuD,YAAY,gBAAgB,SAAS,eAAA;OAE1D,sBAAA,cAACjB,OAAAA;MAAIE,WAAU;OACb,sBAAA,cAACI,KAAKY,WAAS;MAACF,YAAW;OAAYlC,KAAKU,IAAI,GAC/CF,cAAcR,IAAAA,KACb,sBAAA,cAACkB,OAAAA;MAAIE,WAAU;OAAqCZ,cAAcR,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKI,EAAE,KAC1B,sBAAA,cAACiC,QAAAA;MAAOC,SAAS,MAAM3B,iBAAiBX,IAAAA;OAAQjB,EAAE,oCAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAS/DG,UAAUqC,WAAW,KAAK,sBAAA,cAACL,OAAAA;MAAIE,WAAU;OAAmCrC,EAAE,oBAAA,CAAA,CAAA;;;;AAGrF;;;ACzFA,IAAA,yBAAewD;",
6
- "names": ["Schema", "React", "useCallback", "useMemo", "createIntent", "LayoutAction", "useIntentDispatcher", "FunctionType", "ScriptType", "Filter", "fullyQualifiedId", "useQuery", "Button", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "type", "FunctionType", "scripts", "ScriptType", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "id", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "div", "role", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "Schema", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "FunctionsPanel"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { LayoutAction, createIntent, useIntentDispatcher } from '@dxos/app-framework';\nimport { FunctionType, ScriptType } from '@dxos/functions';\nimport { Filter, type Space, fullyQualifiedId, useQuery } from '@dxos/react-client/echo';\nimport { Button, 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 { AUTOMATION_PLUGIN } 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(AUTOMATION_PLUGIN);\n const functions = useQuery(space, Filter.type(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\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, ScriptType>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: FunctionType) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: FunctionType) => {\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 return (\n <div role='none' className={mx(controlItemClasses)}>\n {functions.length > 0 && (\n <List.Root<FunctionType> items={functions} isItem={Schema.is(FunctionType)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<FunctionType>\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 </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,SAASA,cAAc;AACvB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,cAAcC,cAAcC,2BAA2B;AAChE,SAASC,cAAcC,kBAAkB;AACzC,SAASC,QAAoBC,kBAAkBC,gBAAgB;AAC/D,SAASC,QAAQC,sBAAsB;AACvC,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,iBAAAA;AAC7B,UAAMC,YAAYC,SAASL,OAAOM,OAAOC,KAAKC,YAAAA,CAAAA;AAC9C,UAAMC,UAAUJ,SAASL,OAAOM,OAAOC,KAAKG,UAAAA,CAAAA;AAC5C,UAAM,EAAEC,iBAAiBC,SAAQ,IAAKC,oBAAAA;AAEtC,UAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,YAAMC,WAAWD,KAAKE,QAAQC,QAAQC;AACtC,UAAIH,UAAU;AACZ,cAAMI,SAASd,QAAQe,KAAK,CAACC,MAAMA,EAAEH,OAAOH,QAAAA;AAC5C,YAAII,QAAQ;AACVN,cAAIC,KAAKI,EAAE,IAAIC;QACjB;MACF;AACA,aAAON;IACT,GACA,CA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AA,GAS/DG,UAAUqC,WAAW,KAAK,sBAAA,cAACL,OAAAA;MAAIE,WAAU;OAAmCrC,EAAE,oBAAA,CAAA,CAAA;;;;AAGrF;;;ACzFA,IAAA,yBAAewD;",
6
+ "names": ["Schema", "React", "useCallback", "useMemo", "LayoutAction", "createIntent", "useIntentDispatcher", "FunctionType", "ScriptType", "Filter", "fullyQualifiedId", "useQuery", "Button", "useTranslation", "controlItemClasses", "List", "ghostHover", "mx", "grid", "FunctionsPanel", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "functions", "useQuery", "Filter", "type", "FunctionType", "scripts", "ScriptType", "dispatchPromise", "dispatch", "useIntentDispatcher", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "id", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "createIntent", "LayoutAction", "Open", "part", "subject", "fullyQualifiedId", "div", "role", "className", "mx", "controlItemClasses", "length", "List", "Root", "items", "isItem", "Schema", "is", "getId", "Item", "key", "item", "classNames", "ghostHover", "ItemTitle", "Button", "onClick", "FunctionsPanel"]
7
7
  }
@@ -1,6 +1,6 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
 
3
- // packages/plugins/plugin-automation/src/meta.ts
3
+ // src/meta.ts
4
4
  var AUTOMATION_PLUGIN = "dxos.org/plugin/automation";
5
5
  var meta = {
6
6
  id: AUTOMATION_PLUGIN,
@@ -14,4 +14,4 @@ export {
14
14
  AUTOMATION_PLUGIN,
15
15
  meta
16
16
  };
17
- //# sourceMappingURL=chunk-HCCLRNMJ.mjs.map
17
+ //# sourceMappingURL=chunk-NK5N3QKD.mjs.map
@@ -1,9 +1,9 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
- AUTOMATION_PLUGIN
4
- } from "./chunk-HCCLRNMJ.mjs";
3
+ meta
4
+ } from "./chunk-NK5N3QKD.mjs";
5
5
 
6
- // packages/plugins/plugin-automation/src/types.ts
6
+ // src/types/schema.ts
7
7
  import { Schema } from "effect";
8
8
  import { SpaceSchema } from "@dxos/react-client/echo";
9
9
  var TriggerTemplate = Schema.Union(Schema.Struct({
@@ -14,8 +14,7 @@ var TriggerTemplate = Schema.Union(Schema.Struct({
14
14
  queueDXN: Schema.Any
15
15
  }));
16
16
  (function(AutomationAction2) {
17
- const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
18
- class CreateTriggerFromTemplate extends Schema.TaggedClass()(`${AUTOMATION_ACTION}/create-trigger-from-template`, {
17
+ class CreateTriggerFromTemplate extends Schema.TaggedClass()(`${meta.id}/action/create-trigger-from-template`, {
19
18
  input: Schema.Struct({
20
19
  space: SpaceSchema,
21
20
  template: TriggerTemplate,
@@ -37,4 +36,4 @@ var AutomationAction;
37
36
  export {
38
37
  AutomationAction
39
38
  };
40
- //# sourceMappingURL=chunk-6JOJ2NN4.mjs.map
39
+ //# sourceMappingURL=chunk-OEZNHUL2.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/schema.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Schema } from 'effect';\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,SAASA,cAAc;AAEvB,SAASC,mBAAmB;AAI5B,IAAMC,kBAAkBC,OAAOC,MAC7BD,OAAOE,OAAO;EAAEC,MAAMH,OAAOI,QAAQ,OAAA;EAAUC,MAAML,OAAOM;AAAO,CAAA,GACnEN,OAAOE,OAAO;EAAEC,MAAMH,OAAOI,QAAQ,OAAA;EAAUG,UAAUP,OAAOQ;AAAI,CAAA,CAAA;UAGrDC,mBAAAA;EACR,MAAMC,kCAAkCV,OAAOW,YAAW,EAC/D,GAAGC,KAAKC,EAAE,wCACV;IACEC,OAAOd,OAAOE,OAAO;MACnBa,OAAOC;MACPC,UAAUlB;MACVmB,SAASlB,OAAOmB,SAASnB,OAAOoB,OAAO;;MAEvCC,YAAYrB,OAAOmB,SAASnB,OAAOM,MAAM;MACzCQ,OAAOd,OAAOmB,SAASnB,OAAOsB,OAAO;QAAEC,KAAKvB,OAAOM;QAAQkB,OAAOxB,OAAOQ;MAAI,CAAA,CAAA;IAC/E,CAAA;IACAiB,QAAQzB,OAAO0B;EACjB,CAAA,EAAA;EACC;oBAbUhB,4BAAAA;AAcf,GAfiBD,qBAAAA,mBAAAA,CAAAA,EAAAA;;",
6
+ "names": ["Schema", "SpaceSchema", "TriggerTemplate", "Schema", "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
+ }
@@ -0,0 +1,16 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/components/index.ts
4
+ import { lazy } from "react";
5
+ var AutomationPanel = lazy(() => import("./AutomationPanel-MKOLA2FE.mjs"));
6
+ var AutomationSettings = lazy(() => import("./AutomationSettings-C3GNAUYC.mjs"));
7
+ var FunctionsContainer = lazy(() => import("./FunctionsContainer-VZIVURH6.mjs"));
8
+ var FunctionsPanel = lazy(() => import("./FunctionsPanel-ELINCXPW.mjs"));
9
+
10
+ export {
11
+ AutomationPanel,
12
+ AutomationSettings,
13
+ FunctionsContainer,
14
+ FunctionsPanel
15
+ };
16
+ //# sourceMappingURL=chunk-UAOO5IZQ.mjs.map
@@ -0,0 +1,7 @@
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
+ }
@@ -0,0 +1,54 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ AutomationCapabilities
4
+ } from "./chunk-CTAX6WBZ.mjs";
5
+
6
+ // src/hooks/useComputeRuntimeCallback.ts
7
+ import { useCallback } from "react";
8
+ import { useCapability } from "@dxos/app-framework";
9
+ var useComputeRuntimeCallback = (space, fn, deps) => {
10
+ const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
11
+ const runtime = space !== void 0 ? computeRuntime.getRuntime(space.id) : void 0;
12
+ return useCallback(() => {
13
+ if (!runtime) {
14
+ throw new TypeError("Space not provided to useComputeRuntimeCallback");
15
+ }
16
+ return runtime.runPromise(fn());
17
+ }, [
18
+ runtime,
19
+ ...deps ?? []
20
+ ]);
21
+ };
22
+
23
+ // src/hooks/useTriggerRuntimeControls.ts
24
+ import { Effect } from "effect";
25
+ import { Filter } from "@dxos/echo";
26
+ import { FunctionTrigger, TriggerDispatcher } from "@dxos/functions";
27
+ import { useQuery } from "@dxos/react-client/echo";
28
+ import { useAsyncState } from "@dxos/react-ui";
29
+ var useTriggerRuntimeControls = (space) => {
30
+ const triggers = useQuery(space, Filter.type(FunctionTrigger));
31
+ const [isRunningState, setIsRunningState] = useAsyncState(useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))));
32
+ const start = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
33
+ const dispatcher = yield* TriggerDispatcher;
34
+ yield* dispatcher.start();
35
+ setIsRunningState(true);
36
+ }));
37
+ const stop = useComputeRuntimeCallback(space, Effect.fnUntraced(function* () {
38
+ const dispatcher = yield* TriggerDispatcher;
39
+ yield* dispatcher.stop();
40
+ setIsRunningState(false);
41
+ }));
42
+ return {
43
+ triggers,
44
+ isRunning: isRunningState ?? false,
45
+ start: () => void start(),
46
+ stop: () => void stop()
47
+ };
48
+ };
49
+
50
+ export {
51
+ useComputeRuntimeCallback,
52
+ useTriggerRuntimeControls
53
+ };
54
+ //# sourceMappingURL=chunk-XL33Y62M.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/hooks/useComputeRuntimeCallback.ts", "../../../src/hooks/useTriggerRuntimeControls.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport type { Effect } from '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 */\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 return runtime.runPromise(fn());\n }, [runtime, ...(deps ?? [])]);\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Effect } from 'effect';\n\nimport { Filter } from '@dxos/echo';\nimport { FunctionTrigger, 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: FunctionTrigger[];\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(FunctionTrigger));\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,mBAAmB;AAE5B,SAASC,qBAAqB;AAQvB,IAAMC,4BAA4B,CACvCC,OACAC,IACAC,SAAAA;AAEA,QAAMC,iBAAiBC,cAAcC,uBAAuBC,cAAc;AAC1E,QAAMC,UAAUP,UAAUQ,SAAYL,eAAeM,WAAWT,MAAMU,EAAE,IAAIF;AAE5E,SAAOG,YAAY,MAAA;AACjB,QAAI,CAACJ,SAAS;AACZ,YAAM,IAAIK,UAAU,iDAAA;IACtB;AACA,WAAOL,QAAQM,WAAWZ,GAAAA,CAAAA;EAC5B,GAAG;IAACM;OAAaL,QAAQ,CAAA;GAAI;AAC/B;;;ACzBA,SAASY,cAAc;AAEvB,SAASC,cAAc;AACvB,SAASC,iBAAiBC,yBAAyB;AACnD,SAAqBC,gBAAgB;AACrC,SAASC,qBAAqB;AAWvB,IAAMC,4BAA4B,CAACC,UAAAA;AACxC,QAAMC,WAAWC,SAASF,OAAOG,OAAOC,KAAKC,eAAAA,CAAAA;AAE7C,QAAM,CAACC,gBAAgBC,iBAAAA,IAAqBC,cAC1CC,0BAA0BT,OAAO,MAAMU,kBAAkBC,KAAKC,OAAOC,IAAI,CAACC,MAAMA,EAAEC,OAAO,CAAA,CAAA,CAAA;AAG3F,QAAMC,QAAQP,0BACZT,OACAY,OAAOK,WAAW,aAAA;AAChB,UAAMC,aAAa,OAAOR;AAC1B,WAAOQ,WAAWF,MAAK;AACvBT,sBAAkB,IAAA;EACpB,CAAA,CAAA;AAGF,QAAMY,OAAOV,0BACXT,OACAY,OAAOK,WAAW,aAAA;AAChB,UAAMC,aAAa,OAAOR;AAC1B,WAAOQ,WAAWC,KAAI;AACtBZ,sBAAkB,KAAA;EACpB,CAAA,CAAA;AAGF,SAAO;IACLN;IACAmB,WAAWd,kBAAkB;IAC7BU,OAAO,MAAM,KAAKA,MAAAA;IAClBG,MAAM,MAAM,KAAKA,KAAAA;EACnB;AACF;",
6
+ "names": ["useCallback", "useCapability", "useComputeRuntimeCallback", "space", "fn", "deps", "computeRuntime", "useCapability", "AutomationCapabilities", "ComputeRuntime", "runtime", "undefined", "getRuntime", "id", "useCallback", "TypeError", "runPromise", "Effect", "Filter", "FunctionTrigger", "TriggerDispatcher", "useQuery", "useAsyncState", "useTriggerRuntimeControls", "space", "triggers", "useQuery", "Filter", "type", "FunctionTrigger", "isRunningState", "setIsRunningState", "useAsyncState", "useComputeRuntimeCallback", "TriggerDispatcher", "pipe", "Effect", "map", "t", "running", "start", "fnUntraced", "dispatcher", "stop", "isRunning"]
7
+ }
@@ -1,18 +1,18 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  AUTOMATION_PLUGIN
4
- } from "./chunk-HCCLRNMJ.mjs";
4
+ } from "./chunk-NK5N3QKD.mjs";
5
5
 
6
- // packages/plugins/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx
6
+ // src/components/TriggerEditor/TriggerEditor.tsx
7
7
  import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
8
8
  import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
9
9
  import { ComputeGraph } from "@dxos/conductor";
10
10
  import { Type as Type2 } from "@dxos/echo";
11
- import { FunctionType, FunctionTriggerSchema, ScriptType } from "@dxos/functions";
11
+ import { FunctionTrigger, FunctionType, ScriptType } from "@dxos/functions";
12
12
  import { Filter, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
13
13
  import { Form as Form2, SelectInput as SelectInput2, useRefQueryLookupHandler } from "@dxos/react-ui-form";
14
14
 
15
- // packages/plugins/plugin-automation/src/components/TriggerEditor/FunctionInputEditor.tsx
15
+ // src/components/TriggerEditor/FunctionInputEditor.tsx
16
16
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
17
17
  import React, { useCallback, useMemo } from "react";
18
18
  import { Ref, Type } from "@dxos/echo";
@@ -74,10 +74,10 @@ var FunctionInputEditor = ({ functions, getValue, onValueChange, onQueryRefOptio
74
74
  }
75
75
  };
76
76
 
77
- // packages/plugins/plugin-automation/src/components/TriggerEditor/SpecSelector.tsx
77
+ // src/components/TriggerEditor/SpecSelector.tsx
78
78
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
79
79
  import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
80
- import { TriggerKind } from "@dxos/functions";
80
+ import { TriggerKinds } from "@dxos/functions";
81
81
  import { useTranslation } from "@dxos/react-ui";
82
82
  import { SelectInput, useInputProps } from "@dxos/react-ui-form";
83
83
  var SpecSelector = (props) => {
@@ -90,28 +90,28 @@ var SpecSelector = (props) => {
90
90
  const handleTypeChange = useCallback2((_type, value) => {
91
91
  const getDefaultTriggerSpec = (kind) => {
92
92
  switch (kind) {
93
- case TriggerKind.Timer:
93
+ case "timer":
94
94
  return {
95
- kind: TriggerKind.Timer,
95
+ kind: "timer",
96
96
  cron: ""
97
97
  };
98
- case TriggerKind.Subscription:
98
+ case "subscription":
99
99
  return {
100
- kind: TriggerKind.Subscription,
100
+ kind: "subscription",
101
101
  filter: {}
102
102
  };
103
- case TriggerKind.Queue:
103
+ case "queue":
104
104
  return {
105
- kind: TriggerKind.Queue,
105
+ kind: "queue",
106
106
  queue: ""
107
107
  };
108
- case TriggerKind.Email:
108
+ case "email":
109
109
  return {
110
- kind: TriggerKind.Email
110
+ kind: "email"
111
111
  };
112
- case TriggerKind.Webhook:
112
+ case "webhook":
113
113
  return {
114
- kind: TriggerKind.Webhook
114
+ kind: "webhook"
115
115
  };
116
116
  default:
117
117
  return void 0;
@@ -125,7 +125,7 @@ var SpecSelector = (props) => {
125
125
  }, [
126
126
  specProps
127
127
  ]);
128
- const options = useMemo2(() => Object.values(TriggerKind).map((kind) => ({
128
+ const options = useMemo2(() => TriggerKinds.map((kind) => ({
129
129
  value: kind,
130
130
  label: t(`trigger type ${kind}`)
131
131
  })), [
@@ -141,7 +141,7 @@ var SpecSelector = (props) => {
141
141
  }
142
142
  };
143
143
 
144
- // packages/plugins/plugin-automation/src/components/TriggerEditor/TriggerEditor.tsx
144
+ // src/components/TriggerEditor/TriggerEditor.tsx
145
145
  var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
146
146
  var _effect = _useSignals3();
147
147
  try {
@@ -155,7 +155,7 @@ var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
155
155
  return /* @__PURE__ */ React3.createElement(Form2, {
156
156
  outerSpacing: false,
157
157
  Custom,
158
- schema: FunctionTriggerSchema,
158
+ schema: FunctionTrigger,
159
159
  values: trigger,
160
160
  onSave: handleSave,
161
161
  onCancel,
@@ -228,4 +228,4 @@ var getFunctionOptions = (scripts, functions) => {
228
228
  export {
229
229
  TriggerEditor
230
230
  };
231
- //# sourceMappingURL=chunk-UFHDB2OA.mjs.map
231
+ //# sourceMappingURL=chunk-ZOJVKPCA.mjs.map