@dxos/plugin-automation 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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.
- package/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
- package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs +1113 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs +96 -0
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs +94 -0
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +13 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ATECY555.mjs +20 -0
- package/dist/lib/neutral/chunk-ATECY555.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FKFFU54G.mjs +270 -0
- package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-N735CP33.mjs +285 -0
- package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +16 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +129 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +20 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +47 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +3 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +6 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts +11 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts +12 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +46 -0
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -7
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -26
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +107 -30
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +9 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +204 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +32 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationEvents.d.ts +3 -0
- package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +19 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +12 -4
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +138 -50
- package/src/AutomationPlugin.node.ts +29 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +23 -34
- package/src/capabilities/app-graph-builder.ts +59 -79
- package/src/capabilities/compute-runtime.ts +325 -0
- package/src/capabilities/index.ts +9 -4
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +49 -46
- package/src/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +86 -0
- package/src/commands/trigger/create/subscription.ts +125 -0
- package/src/commands/trigger/create/timer.ts +90 -0
- package/src/commands/trigger/index.ts +16 -0
- package/src/commands/trigger/list.ts +70 -0
- package/src/commands/trigger/options.ts +59 -0
- package/src/commands/trigger/remove.ts +45 -0
- package/src/commands/trigger/update/index.ts +14 -0
- package/src/commands/trigger/update/queue.ts +194 -0
- package/src/commands/trigger/update/subscription.ts +278 -0
- package/src/commands/trigger/update/timer.ts +193 -0
- package/src/commands/trigger/util.ts +410 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +9 -12
- package/src/components/AutomationPanel/AutomationPanel.tsx +250 -82
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +51 -32
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +114 -0
- package/src/components/FunctionsRegistry/index.ts +8 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
- package/src/components/TriggerEditor/SpecSelector.tsx +29 -17
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +117 -32
- package/src/components/TriggerEditor/TriggerEditor.tsx +109 -42
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
- package/src/containers/FunctionsContainer/index.ts +5 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useComputeRuntime.ts +30 -0
- package/src/hooks/useComputeRuntimeCallback.ts +32 -0
- package/src/hooks/useComputeRuntimeService.ts +64 -0
- package/src/hooks/useTriggerRuntimeControls.ts +70 -0
- package/src/index.ts +1 -3
- package/src/meta.ts +10 -8
- package/src/operations/create-trigger-from-template.ts +72 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/testing/test-functions.ts +13 -10
- package/src/translations.ts +39 -29
- package/src/types/AutomationCapabilities.ts +48 -0
- package/src/types/AutomationEvents.ts +11 -0
- package/src/types/AutomationOperation.ts +30 -0
- package/src/types/index.ts +4 -0
- package/src/types/schema.ts +6 -6
- package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs +0 -35
- package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-I443Y6KB.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs +0 -80
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-4TWQV33E.mjs +0 -143
- package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
- package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
- package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-S4SM663I.mjs +0 -230
- package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs +0 -77
- package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-M52XGLXY.mjs +0 -64
- package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-MKOLA2FE.mjs +0 -12
- package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-ELINCXPW.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs +0 -81
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AONUBWBE.mjs +0 -144
- package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs +0 -231
- package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs +0 -65
- package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationContainer.tsx +0 -28
- package/src/components/FunctionsContainer.tsx +0 -29
- /package/dist/lib/{browser/AutomationPanel-N5HFJJXW.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-I443Y6KB.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-ELINCXPW.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
13
|
+
import { FunctionsPanel, FunctionsRegistry } from '../../components';
|
|
14
|
+
|
|
15
|
+
export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
return (
|
|
18
|
+
<Settings.Viewport>
|
|
19
|
+
<Settings.Section
|
|
20
|
+
title={t('functions-verbose.label', { ns: meta.id })}
|
|
21
|
+
description={t('functions.description', { ns: meta.id })}
|
|
22
|
+
>
|
|
23
|
+
<FunctionsPanel space={space} />
|
|
24
|
+
</Settings.Section>
|
|
25
|
+
<Settings.Section
|
|
26
|
+
title={t('functions-registry-verbose.label', { ns: meta.id })}
|
|
27
|
+
description={t('functions-registry.description', { ns: meta.id })}
|
|
28
|
+
>
|
|
29
|
+
<FunctionsRegistry space={space} />
|
|
30
|
+
</Settings.Section>
|
|
31
|
+
</Settings.Viewport>
|
|
32
|
+
);
|
|
33
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ComputeEnvironment } from '@dxos/client-protocol';
|
|
8
|
+
import { useObject } from '@dxos/echo-react';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
12
|
+
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
|
|
15
|
+
export const TriggersSettings = ({ space }: { space: Space }) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
const [properties, changeProperties] = useObject(space.properties);
|
|
18
|
+
const selected = properties.computeEnvironment ?? 'local';
|
|
19
|
+
|
|
20
|
+
const handleUpdate = (option: ComputeEnvironment) => {
|
|
21
|
+
changeProperties((draft) => {
|
|
22
|
+
draft.computeEnvironment = option;
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
28
|
+
<Settings.Item title={t('runtime.label')} description={t('runtime.description')}>
|
|
29
|
+
<DropdownMenu.Root>
|
|
30
|
+
<DropdownMenu.Trigger asChild>
|
|
31
|
+
<IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />
|
|
32
|
+
</DropdownMenu.Trigger>
|
|
33
|
+
<DropdownMenu.Portal>
|
|
34
|
+
<DropdownMenu.Content side='bottom'>
|
|
35
|
+
<DropdownMenu.Viewport>
|
|
36
|
+
<DropdownMenu.Item onClick={() => handleUpdate('disabled')}>
|
|
37
|
+
{t(`runtime.disabled.label`)}
|
|
38
|
+
</DropdownMenu.Item>
|
|
39
|
+
<DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>
|
|
40
|
+
<DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>
|
|
41
|
+
</DropdownMenu.Viewport>
|
|
42
|
+
</DropdownMenu.Content>
|
|
43
|
+
</DropdownMenu.Portal>
|
|
44
|
+
</DropdownMenu.Root>
|
|
45
|
+
</Settings.Item>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
|
|
8
|
+
export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
|
|
9
|
+
export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useEffect } from 'react';
|
|
6
|
+
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
import { SpaceId } from '@dxos/keys';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
|
|
11
|
+
import { AutomationCapabilities } from '../types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the compute runtime for a space.
|
|
15
|
+
* Returns undefined if the AutomationPlugin is not loaded or spaceId is not provided.
|
|
16
|
+
*/
|
|
17
|
+
export const useComputeRuntime = (id: SpaceId | undefined): AutomationCapabilities.ComputeRuntime | undefined => {
|
|
18
|
+
const [computeRuntime] = useCapabilities(AutomationCapabilities.ComputeRuntime);
|
|
19
|
+
// One log per change of (capability availability, spaceId) so we can see when
|
|
20
|
+
// the React subscription actually observes the contributed runtime.
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
log('useComputeRuntime', { hasCapability: !!computeRuntime, spaceId: id });
|
|
23
|
+
}, [!!computeRuntime, id]);
|
|
24
|
+
|
|
25
|
+
if (!computeRuntime || id === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return computeRuntime.getRuntime(id);
|
|
30
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import { type DependencyList, useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Key } from '@dxos/echo';
|
|
9
|
+
|
|
10
|
+
import { AutomationCapabilities } from '#types';
|
|
11
|
+
|
|
12
|
+
import { useComputeRuntime } from './useComputeRuntime';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Create an effectful function that has access to compute services
|
|
16
|
+
*/
|
|
17
|
+
// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
|
|
18
|
+
export const useComputeRuntimeCallback = <T>(
|
|
19
|
+
id: Key.SpaceId | undefined,
|
|
20
|
+
fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
|
|
21
|
+
deps?: DependencyList,
|
|
22
|
+
): (() => Promise<T>) => {
|
|
23
|
+
const runtime = useComputeRuntime(id);
|
|
24
|
+
|
|
25
|
+
return useCallback(() => {
|
|
26
|
+
if (!runtime) {
|
|
27
|
+
throw new TypeError('Space not provided to useComputeRuntimeCallback');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return runtime.runPromise(fn());
|
|
31
|
+
}, [runtime, ...(deps ?? [])]);
|
|
32
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Context from 'effect/Context';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Exit from 'effect/Exit';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { SpaceId } from '@dxos/keys';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
|
|
13
|
+
import { useComputeRuntime } from './useComputeRuntime';
|
|
14
|
+
|
|
15
|
+
type ResolvedService<T extends Context.Tag<any, any>> = Context.Tag.Service<T> | undefined;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Resolves a service from the compute runtime for a given space.
|
|
19
|
+
*
|
|
20
|
+
* NOTE: Previously implemented via `use(useMemo(() => runtime.runPromiseExit(...)))`.
|
|
21
|
+
* React's `use()` is weird and unreliable in production builds — the Suspense
|
|
22
|
+
* boundary can stay pending indefinitely without the promise ever resolving
|
|
23
|
+
* from React's perspective (the runtime is built lazily on first invocation
|
|
24
|
+
* and one of its `acquire` steps can block). This `useState` + `useEffect`
|
|
25
|
+
* flavour avoids suspension entirely: the hook returns `undefined` while the
|
|
26
|
+
* service is being acquired or if acquisition fails / times out.
|
|
27
|
+
*/
|
|
28
|
+
export const useComputeRuntimeService = <T extends Context.Tag<any, any>>(
|
|
29
|
+
tag: T,
|
|
30
|
+
spaceId?: SpaceId,
|
|
31
|
+
): ResolvedService<T> => {
|
|
32
|
+
const runtime = useComputeRuntime(spaceId);
|
|
33
|
+
const [service, setService] = useState<ResolvedService<T>>(undefined);
|
|
34
|
+
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setService(undefined);
|
|
37
|
+
if (!runtime) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let cancelled = false;
|
|
41
|
+
void (async () => {
|
|
42
|
+
try {
|
|
43
|
+
const exit = await runtime.runPromiseExit(tag.pipe(Effect.timeout('30 seconds')));
|
|
44
|
+
if (cancelled) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (Exit.isSuccess(exit)) {
|
|
48
|
+
setService(exit.value);
|
|
49
|
+
} else {
|
|
50
|
+
log.warn('useComputeRuntimeService: failed to acquire service', { cause: exit.cause });
|
|
51
|
+
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
if (!cancelled) {
|
|
54
|
+
log.catch(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})();
|
|
58
|
+
return () => {
|
|
59
|
+
cancelled = true;
|
|
60
|
+
};
|
|
61
|
+
}, [runtime, tag]);
|
|
62
|
+
|
|
63
|
+
return service;
|
|
64
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Context from 'effect/Context';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { Trigger } from '@dxos/compute';
|
|
11
|
+
import { type Database, Filter, Query } from '@dxos/echo';
|
|
12
|
+
import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
14
|
+
|
|
15
|
+
import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
|
|
16
|
+
|
|
17
|
+
interface TriggerRuntimeControls {
|
|
18
|
+
triggers: Trigger.Trigger[];
|
|
19
|
+
|
|
20
|
+
state: TriggerDispatcherState | undefined;
|
|
21
|
+
|
|
22
|
+
start: () => void;
|
|
23
|
+
stop: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
|
|
27
|
+
const triggers = useQuery(
|
|
28
|
+
db,
|
|
29
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
|
|
33
|
+
|
|
34
|
+
const init = useComputeRuntimeCallback(
|
|
35
|
+
db?.spaceId,
|
|
36
|
+
Effect.fnUntraced(function* () {
|
|
37
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
38
|
+
setDispatcher(dispatcher);
|
|
39
|
+
}),
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
void init();
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
|
|
47
|
+
|
|
48
|
+
const start = useComputeRuntimeCallback(
|
|
49
|
+
db?.spaceId,
|
|
50
|
+
Effect.fnUntraced(function* () {
|
|
51
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
52
|
+
yield* dispatcher.start();
|
|
53
|
+
}),
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const stop = useComputeRuntimeCallback(
|
|
57
|
+
db?.spaceId,
|
|
58
|
+
Effect.fnUntraced(function* () {
|
|
59
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
60
|
+
yield* dispatcher.stop();
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
triggers,
|
|
66
|
+
state,
|
|
67
|
+
start: () => void start(),
|
|
68
|
+
stop: () => void stop(),
|
|
69
|
+
};
|
|
70
|
+
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,15 +2,17 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: AUTOMATION_PLUGIN,
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.automation',
|
|
11
10
|
name: 'Automation',
|
|
12
|
-
description:
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
description: trim`
|
|
12
|
+
Workflow automation engine that triggers custom actions based on object events and conditions.
|
|
13
|
+
Create automated pipelines that respond to changes and streamline repetitive tasks.
|
|
14
|
+
`,
|
|
15
|
+
icon: 'ph--atom--regular',
|
|
15
16
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
|
|
17
|
+
tags: ['system'],
|
|
16
18
|
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
8
|
+
import { Operation, Script, Trigger } from '@dxos/compute';
|
|
9
|
+
import { Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { type DXN } from '@dxos/keys';
|
|
11
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
12
|
+
import { Filter } from '@dxos/react-client/echo';
|
|
13
|
+
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
import { AutomationOperation } from '../types';
|
|
17
|
+
|
|
18
|
+
const handler: Operation.WithHandler<typeof AutomationOperation.CreateTriggerFromTemplate> =
|
|
19
|
+
AutomationOperation.CreateTriggerFromTemplate.pipe(
|
|
20
|
+
Operation.withHandler(
|
|
21
|
+
Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
22
|
+
const trigger = Trigger.make({ enabled, input });
|
|
23
|
+
|
|
24
|
+
// TODO(wittjosiah): Factor out function lookup by script name?
|
|
25
|
+
if (scriptName) {
|
|
26
|
+
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());
|
|
27
|
+
const [script] = scripts;
|
|
28
|
+
if (script) {
|
|
29
|
+
const functions = yield* Effect.promise(() =>
|
|
30
|
+
db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),
|
|
31
|
+
);
|
|
32
|
+
const [fn] = functions;
|
|
33
|
+
if (fn) {
|
|
34
|
+
Obj.update(trigger, (trigger) => {
|
|
35
|
+
trigger.function = Ref.make(fn);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
switch (template.type) {
|
|
42
|
+
case 'timer': {
|
|
43
|
+
Obj.update(trigger, (trigger) => {
|
|
44
|
+
trigger.spec = Trigger.specTimer(template.cron);
|
|
45
|
+
});
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'queue': {
|
|
49
|
+
Obj.update(trigger, (trigger) => {
|
|
50
|
+
trigger.spec = Trigger.specQueue((template.queueDXN as DXN).toString());
|
|
51
|
+
});
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
default: {
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
60
|
+
object: trigger,
|
|
61
|
+
target: db,
|
|
62
|
+
hidden: true,
|
|
63
|
+
});
|
|
64
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
65
|
+
subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],
|
|
66
|
+
workspace: getSpacePath(db.spaceId),
|
|
67
|
+
});
|
|
68
|
+
}),
|
|
69
|
+
),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const AutomationPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { AutomationOperationHandlerSet } from './operations';
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { TestSchema } from '@dxos/client/testing';
|
|
8
|
+
import { JsonSchema, Ref } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
export const functions = [
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
key: 'com.example.function.chess',
|
|
13
|
+
name: 'com.example.function.chess',
|
|
13
14
|
version: '0.1.0',
|
|
14
|
-
inputSchema:
|
|
15
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
15
16
|
Schema.Struct({
|
|
16
17
|
level: Schema.Number.annotations({
|
|
17
18
|
title: 'Level',
|
|
@@ -20,10 +21,11 @@ export const functions = [
|
|
|
20
21
|
),
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
|
-
|
|
24
|
+
key: 'com.example.function.forex',
|
|
25
|
+
name: 'com.example.function.forex',
|
|
24
26
|
version: '0.1.0',
|
|
25
27
|
binding: 'FOREX',
|
|
26
|
-
inputSchema:
|
|
28
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
27
29
|
Schema.Struct({
|
|
28
30
|
from: Schema.String.annotations({ title: 'Currency from' }),
|
|
29
31
|
to: Schema.String.annotations({ title: 'Currency to' }),
|
|
@@ -31,11 +33,12 @@ export const functions = [
|
|
|
31
33
|
),
|
|
32
34
|
},
|
|
33
35
|
{
|
|
34
|
-
|
|
36
|
+
key: 'com.example.function.ping-contact',
|
|
37
|
+
name: 'com.example.function.ping-contact',
|
|
35
38
|
version: '0.0.1',
|
|
36
|
-
inputSchema:
|
|
39
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
37
40
|
Schema.Struct({
|
|
38
|
-
contact:
|
|
41
|
+
contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
|
|
39
42
|
}),
|
|
40
43
|
),
|
|
41
44
|
},
|
package/src/translations.ts
CHANGED
|
@@ -4,40 +4,50 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'automation
|
|
15
|
-
'script
|
|
16
|
-
'automation
|
|
17
|
-
'automation
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
'trigger
|
|
36
|
-
'trigger
|
|
37
|
-
|
|
38
|
-
'trigger
|
|
39
|
-
|
|
40
|
-
'trigger
|
|
13
|
+
'plugin.name': 'Automation',
|
|
14
|
+
'automation-panel.label': 'Automations',
|
|
15
|
+
'script-automation.label': 'Automation',
|
|
16
|
+
'automation-verbose.label': 'Manage automations',
|
|
17
|
+
'automation.description': 'Triggers that automate this space.',
|
|
18
|
+
|
|
19
|
+
'runtime.label': 'Trigger runtime location',
|
|
20
|
+
'runtime.description': 'Determines where the triggers in this space will execute.',
|
|
21
|
+
'runtime.disabled.label': 'Triggers disabled',
|
|
22
|
+
'runtime.local.label': 'Local',
|
|
23
|
+
'runtime.edge.label': 'EDGE (experimental)',
|
|
24
|
+
|
|
25
|
+
'functions-panel.label': 'Functions',
|
|
26
|
+
'functions-verbose.label': 'Manage deployed functions',
|
|
27
|
+
'functions-registry-verbose.label': 'Functions registry',
|
|
28
|
+
'functions-registry.description': 'Import functions from the registry',
|
|
29
|
+
'functions.description': 'Functions deployed from this space on EDGE.',
|
|
30
|
+
'show-source-button.label': 'Show source',
|
|
31
|
+
'delete-function-button.label': 'Delete function',
|
|
32
|
+
|
|
33
|
+
'function-parameters.label': 'Function parameters',
|
|
34
|
+
|
|
35
|
+
'trigger-editor.title': 'Configure Trigger',
|
|
36
|
+
'trigger-editor.description':
|
|
37
|
+
'Triggers are used to run functions at specific times or when specific events occur.',
|
|
38
|
+
'new-trigger.label': 'Add Trigger',
|
|
39
|
+
|
|
40
|
+
'trigger-type.timer.label': 'Timer',
|
|
41
|
+
'trigger-type.webhook.label': 'Webhook',
|
|
42
|
+
'trigger-type.websocket.label': 'Websocket',
|
|
43
|
+
'trigger-type.subscription.label': 'Subscription',
|
|
44
|
+
'trigger-type.email.label': 'Email',
|
|
45
|
+
'trigger-type.queue.label': 'Feed',
|
|
46
|
+
|
|
47
|
+
'trigger-payload-prop-name.placeholder': 'New payload property name',
|
|
48
|
+
'import-function-button.label': 'Loading...',
|
|
49
|
+
'update-function-button.label': 'Update',
|
|
50
|
+
'loading-functions.message': 'Loading functions...',
|
|
41
51
|
},
|
|
42
52
|
},
|
|
43
53
|
},
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import type * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
8
|
+
|
|
9
|
+
import { type AiService, type OpaqueToolkit } from '@dxos/ai';
|
|
10
|
+
import { Capability } from '@dxos/app-framework';
|
|
11
|
+
import type { Blueprint, Credential, Operation, OperationRegistry, Process } from '@dxos/compute';
|
|
12
|
+
import { type Database, type Feed } from '@dxos/echo';
|
|
13
|
+
import type { QueueService } from '@dxos/functions';
|
|
14
|
+
import { AgentService } from '@dxos/functions-runtime';
|
|
15
|
+
import type { ProcessManager, TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';
|
|
16
|
+
import type { SpaceId } from '@dxos/keys';
|
|
17
|
+
|
|
18
|
+
import { meta } from '#meta';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Service stack for executing agents, functions, and triggers.
|
|
22
|
+
*/
|
|
23
|
+
export type ComputeServices =
|
|
24
|
+
| TriggerDispatcher
|
|
25
|
+
| TriggerStateStore
|
|
26
|
+
| AiService.AiService
|
|
27
|
+
| Database.Service
|
|
28
|
+
| Feed.FeedService
|
|
29
|
+
| QueueService
|
|
30
|
+
| Credential.CredentialsService
|
|
31
|
+
| Blueprint.RegistryService
|
|
32
|
+
| AgentService.AgentService
|
|
33
|
+
| Process.ProcessMonitorService
|
|
34
|
+
| ProcessManager.Service
|
|
35
|
+
| Operation.Service
|
|
36
|
+
| OperationRegistry.Service
|
|
37
|
+
| OpaqueToolkit.OpaqueToolkitProvider;
|
|
38
|
+
|
|
39
|
+
export type ComputeRuntime = ManagedRuntime.ManagedRuntime<ComputeServices, never>;
|
|
40
|
+
|
|
41
|
+
export interface ComputeRuntimeProvider {
|
|
42
|
+
getRuntime(spaceId: SpaceId): ComputeRuntime;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Runtime for executing agents, functions, and triggers.
|
|
47
|
+
*/
|
|
48
|
+
export const ComputeRuntime = Capability.make<ComputeRuntimeProvider>(`${meta.id}.capability.compute-runtime`);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { ActivationEvent } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
export const ComputeRuntimeReady = ActivationEvent.make(`${meta.id}.event.compute-runtime-ready`);
|