@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
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AUTOMATION_PLUGIN
|
|
4
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/FunctionsPanel/FunctionsPanel.tsx
|
|
7
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import { Schema } from "effect";
|
|
9
|
-
import React, { useCallback, useMemo } from "react";
|
|
10
|
-
import { LayoutAction, createIntent, useIntentDispatcher } from "@dxos/app-framework";
|
|
11
|
-
import { FunctionType, ScriptType } from "@dxos/functions";
|
|
12
|
-
import { Filter, fullyQualifiedId, useQuery } from "@dxos/react-client/echo";
|
|
13
|
-
import { Button, useTranslation } from "@dxos/react-ui";
|
|
14
|
-
import { controlItemClasses } from "@dxos/react-ui-form";
|
|
15
|
-
import { List } from "@dxos/react-ui-list";
|
|
16
|
-
import { ghostHover, mx } from "@dxos/react-ui-theme";
|
|
17
|
-
var grid = "grid grid-cols-[1fr_auto] min-bs-[2.5rem]";
|
|
18
|
-
var FunctionsPanel = ({ space }) => {
|
|
19
|
-
var _effect = _useSignals();
|
|
20
|
-
try {
|
|
21
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
22
|
-
const functions = useQuery(space, Filter.type(FunctionType));
|
|
23
|
-
const scripts = useQuery(space, Filter.type(ScriptType));
|
|
24
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
25
|
-
const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
|
|
26
|
-
const scriptId = func.source?.target?.id;
|
|
27
|
-
if (scriptId) {
|
|
28
|
-
const script = scripts.find((s) => s.id === scriptId);
|
|
29
|
-
if (script) {
|
|
30
|
-
map[func.id] = script;
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return map;
|
|
34
|
-
}, {}), [
|
|
35
|
-
functions,
|
|
36
|
-
scripts
|
|
37
|
-
]);
|
|
38
|
-
const getScriptName = useCallback((func) => {
|
|
39
|
-
const script = functionToScriptMap[func.id];
|
|
40
|
-
return script?.name;
|
|
41
|
-
}, [
|
|
42
|
-
functionToScriptMap
|
|
43
|
-
]);
|
|
44
|
-
const handleGoToScript = useCallback((func) => {
|
|
45
|
-
const script = functionToScriptMap[func.id];
|
|
46
|
-
if (script) {
|
|
47
|
-
void dispatch(createIntent(LayoutAction.Open, {
|
|
48
|
-
part: "main",
|
|
49
|
-
subject: [
|
|
50
|
-
fullyQualifiedId(script)
|
|
51
|
-
]
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
}, [
|
|
55
|
-
functionToScriptMap,
|
|
56
|
-
dispatch
|
|
57
|
-
]);
|
|
58
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
59
|
-
role: "none",
|
|
60
|
-
className: mx(controlItemClasses)
|
|
61
|
-
}, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
|
|
62
|
-
items: functions,
|
|
63
|
-
isItem: Schema.is(FunctionType),
|
|
64
|
-
getId: (func) => func.id
|
|
65
|
-
}, ({ items }) => /* @__PURE__ */ React.createElement("div", {
|
|
66
|
-
role: "list",
|
|
67
|
-
className: "flex flex-col w-full"
|
|
68
|
-
}, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
|
|
69
|
-
key: func.id,
|
|
70
|
-
item: func,
|
|
71
|
-
classNames: mx(grid, ghostHover, "items-center", "pli-2", "min-bs-[3rem]")
|
|
72
|
-
}, /* @__PURE__ */ React.createElement("div", {
|
|
73
|
-
className: "flex flex-col truncate"
|
|
74
|
-
}, /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
75
|
-
classNames: "truncate"
|
|
76
|
-
}, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
|
|
77
|
-
className: "text-xs text-description truncate"
|
|
78
|
-
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
|
|
79
|
-
onClick: () => handleGoToScript(func)
|
|
80
|
-
}, t("go to function source button label")))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
81
|
-
className: "text-center plb-4 text-gray-500"
|
|
82
|
-
}, t("no functions found")));
|
|
83
|
-
} finally {
|
|
84
|
-
_effect.f();
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
// src/components/FunctionsPanel/index.ts
|
|
89
|
-
var FunctionsPanel_default = FunctionsPanel;
|
|
90
|
-
|
|
91
|
-
export {
|
|
92
|
-
FunctionsPanel,
|
|
93
|
-
FunctionsPanel_default
|
|
94
|
-
};
|
|
95
|
-
//# sourceMappingURL=chunk-CX2AILIS.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { 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,KAA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;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", "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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
|
|
3
|
-
// src/meta.ts
|
|
4
|
-
var AUTOMATION_PLUGIN = "dxos.org/plugin/automation";
|
|
5
|
-
var meta = {
|
|
6
|
-
id: AUTOMATION_PLUGIN,
|
|
7
|
-
name: "Automation",
|
|
8
|
-
description: "The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.",
|
|
9
|
-
icon: "ph--robot--regular",
|
|
10
|
-
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
AUTOMATION_PLUGIN,
|
|
15
|
-
meta
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-NK5N3QKD.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\n\nexport const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';\n\nexport const meta: PluginMeta = {\n id: AUTOMATION_PLUGIN,\n name: 'Automation',\n description:\n 'The Automation tab allows you to trigger pre-defined workflows related to the element you are interacting with inside of Composer.',\n icon: 'ph--robot--regular',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',\n};\n"],
|
|
5
|
-
"mappings": ";;;AAMO,IAAMA,oBAAoB;AAE1B,IAAMC,OAAmB;EAC9BC,IAAIF;EACJG,MAAM;EACNC,aACE;EACFC,MAAM;EACNC,QAAQ;AACV;",
|
|
6
|
-
"names": ["AUTOMATION_PLUGIN", "meta", "id", "name", "description", "icon", "source"]
|
|
7
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
meta
|
|
4
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
5
|
-
|
|
6
|
-
// src/types/schema.ts
|
|
7
|
-
import { Schema } from "effect";
|
|
8
|
-
import { SpaceSchema } from "@dxos/react-client/echo";
|
|
9
|
-
var TriggerTemplate = Schema.Union(Schema.Struct({
|
|
10
|
-
type: Schema.Literal("timer"),
|
|
11
|
-
cron: Schema.String
|
|
12
|
-
}), Schema.Struct({
|
|
13
|
-
type: Schema.Literal("queue"),
|
|
14
|
-
queueDXN: Schema.Any
|
|
15
|
-
}));
|
|
16
|
-
(function(AutomationAction2) {
|
|
17
|
-
class CreateTriggerFromTemplate extends Schema.TaggedClass()(`${meta.id}/action/create-trigger-from-template`, {
|
|
18
|
-
input: Schema.Struct({
|
|
19
|
-
space: SpaceSchema,
|
|
20
|
-
template: TriggerTemplate,
|
|
21
|
-
enabled: Schema.optional(Schema.Boolean),
|
|
22
|
-
// TODO(wittjosiah): Improve how this lookup is done.
|
|
23
|
-
scriptName: Schema.optional(Schema.String),
|
|
24
|
-
input: Schema.optional(Schema.Record({
|
|
25
|
-
key: Schema.String,
|
|
26
|
-
value: Schema.Any
|
|
27
|
-
}))
|
|
28
|
-
}),
|
|
29
|
-
output: Schema.Void
|
|
30
|
-
}) {
|
|
31
|
-
}
|
|
32
|
-
AutomationAction2.CreateTriggerFromTemplate = CreateTriggerFromTemplate;
|
|
33
|
-
})(AutomationAction || (AutomationAction = {}));
|
|
34
|
-
var AutomationAction;
|
|
35
|
-
|
|
36
|
-
export {
|
|
37
|
-
AutomationAction
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=chunk-OEZNHUL2.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/schema.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { 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
|
-
}
|
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AUTOMATION_PLUGIN
|
|
4
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
5
|
-
|
|
6
|
-
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
7
|
-
import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
|
|
8
|
-
import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
9
|
-
import { ComputeGraph } from "@dxos/conductor";
|
|
10
|
-
import { Type as Type2 } from "@dxos/echo";
|
|
11
|
-
import { FunctionTrigger, FunctionType, ScriptType } from "@dxos/functions";
|
|
12
|
-
import { Filter, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
|
|
13
|
-
import { Form as Form2, SelectInput as SelectInput2, useRefQueryLookupHandler } from "@dxos/react-ui-form";
|
|
14
|
-
|
|
15
|
-
// src/components/TriggerEditor/FunctionInputEditor.tsx
|
|
16
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
17
|
-
import React, { useCallback, useMemo } from "react";
|
|
18
|
-
import { Ref, Type } from "@dxos/echo";
|
|
19
|
-
import { useOnTransition } from "@dxos/react-ui";
|
|
20
|
-
import { Form, useFormValues } from "@dxos/react-ui-form";
|
|
21
|
-
var FunctionInputEditor = ({ functions, getValue, onValueChange, onQueryRefOptions }) => {
|
|
22
|
-
var _effect = _useSignals();
|
|
23
|
-
try {
|
|
24
|
-
const selectedFunctionValue = useFormValues([
|
|
25
|
-
"function"
|
|
26
|
-
]);
|
|
27
|
-
const selectedFunctionId = useMemo(() => {
|
|
28
|
-
if (Ref.isRef(selectedFunctionValue)) {
|
|
29
|
-
return selectedFunctionValue.dxn.toString().split("dxn:echo:@:").at(1);
|
|
30
|
-
}
|
|
31
|
-
}, [
|
|
32
|
-
selectedFunctionValue
|
|
33
|
-
]);
|
|
34
|
-
const selectedFunction = useMemo(() => functions.find((fn) => fn.id === selectedFunctionId), [
|
|
35
|
-
functions,
|
|
36
|
-
selectedFunctionId
|
|
37
|
-
]);
|
|
38
|
-
useOnTransition(
|
|
39
|
-
// Clear function parameter input when the function changes.
|
|
40
|
-
selectedFunctionValue,
|
|
41
|
-
(prevValue) => prevValue !== void 0 && prevValue !== selectedFunctionValue,
|
|
42
|
-
(currValue) => currValue !== void 0,
|
|
43
|
-
() => onValueChange("object", {})
|
|
44
|
-
);
|
|
45
|
-
const inputSchema = useMemo(() => selectedFunction?.inputSchema, [
|
|
46
|
-
selectedFunction
|
|
47
|
-
]);
|
|
48
|
-
const effectSchema = useMemo(() => inputSchema ? Type.toEffectSchema(inputSchema) : void 0, [
|
|
49
|
-
inputSchema
|
|
50
|
-
]);
|
|
51
|
-
const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
|
|
52
|
-
const values = useMemo(() => getValue() ?? {}, [
|
|
53
|
-
getValue
|
|
54
|
-
]);
|
|
55
|
-
const handleValuesChanged = useCallback((values2) => {
|
|
56
|
-
onValueChange("object", values2);
|
|
57
|
-
}, [
|
|
58
|
-
onValueChange
|
|
59
|
-
]);
|
|
60
|
-
if (selectedFunction === void 0 || effectSchema === void 0 || propertyCount === 0) {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("h3", {
|
|
64
|
-
className: "text-md"
|
|
65
|
-
}, "Function parameters"), /* @__PURE__ */ React.createElement(Form, {
|
|
66
|
-
schema: effectSchema,
|
|
67
|
-
values,
|
|
68
|
-
onValuesChanged: handleValuesChanged,
|
|
69
|
-
onQueryRefOptions,
|
|
70
|
-
outerSpacing: false
|
|
71
|
-
}));
|
|
72
|
-
} finally {
|
|
73
|
-
_effect.f();
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
// src/components/TriggerEditor/SpecSelector.tsx
|
|
78
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
79
|
-
import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
80
|
-
import { TriggerKinds } from "@dxos/functions";
|
|
81
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
82
|
-
import { SelectInput, useInputProps } from "@dxos/react-ui-form";
|
|
83
|
-
var SpecSelector = (props) => {
|
|
84
|
-
var _effect = _useSignals2();
|
|
85
|
-
try {
|
|
86
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
87
|
-
const specProps = useInputProps([
|
|
88
|
-
"spec"
|
|
89
|
-
]);
|
|
90
|
-
const handleTypeChange = useCallback2((_type, value) => {
|
|
91
|
-
const getDefaultTriggerSpec = (kind) => {
|
|
92
|
-
switch (kind) {
|
|
93
|
-
case "timer":
|
|
94
|
-
return {
|
|
95
|
-
kind: "timer",
|
|
96
|
-
cron: ""
|
|
97
|
-
};
|
|
98
|
-
case "subscription":
|
|
99
|
-
return {
|
|
100
|
-
kind: "subscription",
|
|
101
|
-
filter: {}
|
|
102
|
-
};
|
|
103
|
-
case "queue":
|
|
104
|
-
return {
|
|
105
|
-
kind: "queue",
|
|
106
|
-
queue: ""
|
|
107
|
-
};
|
|
108
|
-
case "email":
|
|
109
|
-
return {
|
|
110
|
-
kind: "email"
|
|
111
|
-
};
|
|
112
|
-
case "webhook":
|
|
113
|
-
return {
|
|
114
|
-
kind: "webhook"
|
|
115
|
-
};
|
|
116
|
-
default:
|
|
117
|
-
return void 0;
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
const defaultSpec = getDefaultTriggerSpec(value);
|
|
121
|
-
if (!defaultSpec) {
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
specProps.onValueChange("object", defaultSpec);
|
|
125
|
-
}, [
|
|
126
|
-
specProps
|
|
127
|
-
]);
|
|
128
|
-
const options = useMemo2(() => TriggerKinds.map((kind) => ({
|
|
129
|
-
value: kind,
|
|
130
|
-
label: t(`trigger type ${kind}`)
|
|
131
|
-
})), [
|
|
132
|
-
t
|
|
133
|
-
]);
|
|
134
|
-
return /* @__PURE__ */ React2.createElement(SelectInput, {
|
|
135
|
-
...props,
|
|
136
|
-
options,
|
|
137
|
-
onValueChange: handleTypeChange
|
|
138
|
-
});
|
|
139
|
-
} finally {
|
|
140
|
-
_effect.f();
|
|
141
|
-
}
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
145
|
-
var TriggerEditor = ({ space, trigger, onSave, onCancel }) => {
|
|
146
|
-
var _effect = _useSignals3();
|
|
147
|
-
try {
|
|
148
|
-
const handleSave = (values) => {
|
|
149
|
-
onSave?.(values);
|
|
150
|
-
};
|
|
151
|
-
const handleRefQueryLookup = useRefQueryLookupHandler({
|
|
152
|
-
space
|
|
153
|
-
});
|
|
154
|
-
const Custom = useCustomInputs(space, handleRefQueryLookup);
|
|
155
|
-
return /* @__PURE__ */ React3.createElement(Form2, {
|
|
156
|
-
outerSpacing: false,
|
|
157
|
-
Custom,
|
|
158
|
-
schema: FunctionTrigger,
|
|
159
|
-
values: trigger,
|
|
160
|
-
onSave: handleSave,
|
|
161
|
-
onCancel,
|
|
162
|
-
onQueryRefOptions: handleRefQueryLookup
|
|
163
|
-
});
|
|
164
|
-
} finally {
|
|
165
|
-
_effect.f();
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
var useCustomInputs = (space, onQueryRefOptions) => {
|
|
169
|
-
const functions = useQuery(space, Filter.type(FunctionType));
|
|
170
|
-
const workflows = useQuery(space, Filter.type(ComputeGraph));
|
|
171
|
-
const scripts = useQuery(space, Filter.type(ScriptType));
|
|
172
|
-
return useMemo3(() => ({
|
|
173
|
-
// Function selector.
|
|
174
|
-
["function"]: (props) => {
|
|
175
|
-
const getValue = useCallback3(() => {
|
|
176
|
-
const formValue = props.getValue();
|
|
177
|
-
if (Ref2.isRef(formValue)) {
|
|
178
|
-
return formValue.dxn.toString();
|
|
179
|
-
}
|
|
180
|
-
return void 0;
|
|
181
|
-
}, [
|
|
182
|
-
props
|
|
183
|
-
]);
|
|
184
|
-
const handleOnValueChange = useCallback3((_type, dxnString) => {
|
|
185
|
-
const dxn = Type2.DXN.parse(dxnString);
|
|
186
|
-
if (dxn) {
|
|
187
|
-
const ref = Ref2.fromDXN(dxn);
|
|
188
|
-
props.onValueChange("object", ref);
|
|
189
|
-
}
|
|
190
|
-
}, [
|
|
191
|
-
props.onValueChange
|
|
192
|
-
]);
|
|
193
|
-
return /* @__PURE__ */ React3.createElement(SelectInput2, {
|
|
194
|
-
...props,
|
|
195
|
-
getValue,
|
|
196
|
-
onValueChange: handleOnValueChange,
|
|
197
|
-
options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
|
|
198
|
-
});
|
|
199
|
-
},
|
|
200
|
-
// Spec selector.
|
|
201
|
-
["spec.kind"]: SpecSelector,
|
|
202
|
-
// Function input editor.
|
|
203
|
-
["input"]: (props) => /* @__PURE__ */ React3.createElement(FunctionInputEditor, {
|
|
204
|
-
...props,
|
|
205
|
-
functions,
|
|
206
|
-
onQueryRefOptions
|
|
207
|
-
})
|
|
208
|
-
}), [
|
|
209
|
-
workflows,
|
|
210
|
-
scripts,
|
|
211
|
-
functions
|
|
212
|
-
]);
|
|
213
|
-
};
|
|
214
|
-
var getWorkflowOptions = (graphs) => {
|
|
215
|
-
return graphs.map((graph) => ({
|
|
216
|
-
label: `compute-${graph.id}`,
|
|
217
|
-
value: `dxn:echo:@:${graph.id}`
|
|
218
|
-
}));
|
|
219
|
-
};
|
|
220
|
-
var getFunctionOptions = (scripts, functions) => {
|
|
221
|
-
const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
222
|
-
return functions.map((fn) => ({
|
|
223
|
-
label: getLabel(fn),
|
|
224
|
-
value: `dxn:echo:@:${fn.id}`
|
|
225
|
-
}));
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export {
|
|
229
|
-
TriggerEditor
|
|
230
|
-
};
|
|
231
|
-
//# sourceMappingURL=chunk-ZOJVKPCA.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/TriggerEditor/TriggerEditor.tsx", "../../../src/components/TriggerEditor/FunctionInputEditor.tsx", "../../../src/components/TriggerEditor/SpecSelector.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Type } from '@dxos/echo';\nimport { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';\nimport { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';\nimport { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';\n\nimport { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';\nimport { SpecSelector } from './SpecSelector';\n\nexport type TriggerEditorProps = {\n space: Space;\n trigger: FunctionTrigger;\n onSave?: (trigger: Omit<FunctionTrigger, 'id'>) => void;\n onCancel?: () => void;\n};\n\nexport const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {\n const handleSave = (values: FunctionTrigger) => {\n onSave?.(values);\n };\n\n const handleRefQueryLookup = useRefQueryLookupHandler({ space });\n const Custom = useCustomInputs(space, handleRefQueryLookup);\n\n return (\n <Form\n outerSpacing={false}\n Custom={Custom}\n schema={FunctionTrigger}\n values={trigger}\n onSave={handleSave}\n onCancel={onCancel}\n onQueryRefOptions={handleRefQueryLookup}\n />\n );\n};\n\nconst useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions']) => {\n const functions = useQuery(space, Filter.type(FunctionType));\n const workflows = useQuery(space, Filter.type(ComputeGraph));\n const scripts = useQuery(space, Filter.type(ScriptType));\n\n return useMemo(\n (): CustomInputMap => ({\n // Function selector.\n ['function' satisfies keyof FunctionTrigger]: (props) => {\n const getValue = useCallback(() => {\n const formValue = props.getValue();\n if (Ref.isRef(formValue)) {\n return formValue.dxn.toString() as string;\n }\n return undefined;\n }, [props]);\n\n const handleOnValueChange = useCallback(\n (_type: any, dxnString: string) => {\n const dxn = Type.DXN.parse(dxnString);\n if (dxn) {\n const ref = Ref.fromDXN(dxn);\n props.onValueChange('object', ref);\n }\n },\n [props.onValueChange],\n );\n\n return (\n <SelectInput\n {...props}\n getValue={getValue as any}\n onValueChange={handleOnValueChange}\n options={getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))}\n />\n );\n },\n\n // Spec selector.\n ['spec.kind' as const]: SpecSelector,\n\n // Function input editor.\n ['input' as const]: (props) => (\n <FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />\n ),\n }),\n [workflows, scripts, functions],\n );\n};\n\nconst getWorkflowOptions = (graphs: ComputeGraph[]) => {\n return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));\n};\n\nconst getFunctionOptions = (scripts: ScriptType[], functions: FunctionType[]) => {\n const getLabel = (fn: FunctionType) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;\n return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { Ref, Type } from '@dxos/echo';\nimport { type JsonPath } from '@dxos/echo-schema';\nimport { type FunctionType } from '@dxos/functions';\nimport { useOnTransition } from '@dxos/react-ui';\nimport { Form, type FormInputStateProps, type QueryRefOptions, useFormValues } from '@dxos/react-ui-form';\n\nexport type FunctionInputEditorProps = {\n functions: FunctionType[];\n onQueryRefOptions: QueryRefOptions;\n} & FormInputStateProps;\n\n/**\n * Editor component for function input parameters.\n */\nexport const FunctionInputEditor = ({\n functions,\n getValue,\n onValueChange,\n onQueryRefOptions,\n}: FunctionInputEditorProps) => {\n const selectedFunctionValue = useFormValues(['function' as JsonPath]);\n const selectedFunctionId = useMemo(() => {\n if (Ref.isRef(selectedFunctionValue)) {\n return selectedFunctionValue.dxn.toString().split('dxn:echo:@:').at(1);\n }\n }, [selectedFunctionValue]);\n\n const selectedFunction = useMemo(\n () => functions.find((fn) => fn.id === selectedFunctionId),\n [functions, selectedFunctionId],\n );\n\n useOnTransition(\n // Clear function parameter input when the function changes.\n selectedFunctionValue,\n (prevValue) => prevValue !== undefined && prevValue !== selectedFunctionValue,\n (currValue) => currValue !== undefined,\n () => onValueChange('object', {}),\n );\n\n const inputSchema = useMemo(() => selectedFunction?.inputSchema, [selectedFunction]);\n const effectSchema = useMemo(() => (inputSchema ? Type.toEffectSchema(inputSchema) : undefined), [inputSchema]);\n const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;\n\n const values = useMemo(() => getValue() ?? {}, [getValue]);\n\n const handleValuesChanged = useCallback(\n (values: any) => {\n onValueChange('object', values);\n },\n [onValueChange],\n );\n\n if (selectedFunction === undefined || effectSchema === undefined || propertyCount === 0) {\n return null;\n }\n\n return (\n <>\n <h3 className='text-md'>Function parameters</h3>\n {/* TODO(ZaymonFC): Try using <FormFields /> internal component for this nesting.\n This would allow errors to flow up to the root context. */}\n <Form\n schema={effectSchema}\n values={values}\n onValuesChanged={handleValuesChanged}\n onQueryRefOptions={onQueryRefOptions}\n outerSpacing={false}\n />\n </>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React, { useCallback, useMemo } from 'react';\n\nimport { type FunctionTrigger, TriggerKinds, type TriggerType } from '@dxos/functions';\nimport { useTranslation } from '@dxos/react-ui';\nimport { type InputProps, SelectInput, useInputProps } from '@dxos/react-ui-form';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\n\nexport type SpecSelectorProps = InputProps;\n\nexport const SpecSelector = (props: SpecSelectorProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const specProps = useInputProps(['spec' satisfies keyof FunctionTrigger]);\n\n const handleTypeChange = useCallback(\n (_type: any, value: string): TriggerType | undefined => {\n const getDefaultTriggerSpec = (kind: string) => {\n switch (kind) {\n case 'timer':\n return { kind: 'timer', cron: '' };\n case 'subscription':\n return { kind: 'subscription', filter: {} };\n case 'queue':\n return { kind: 'queue', queue: '' };\n case 'email':\n return { kind: 'email' };\n case 'webhook':\n return { kind: 'webhook' };\n default:\n return undefined;\n }\n };\n\n const defaultSpec = getDefaultTriggerSpec(value);\n if (!defaultSpec) {\n return;\n }\n\n // Update the entire spec object, not just the `spec.kind`.\n specProps.onValueChange('object', defaultSpec);\n },\n [specProps],\n );\n\n const options = useMemo(\n () =>\n TriggerKinds.map((kind) => ({\n value: kind,\n label: t(`trigger type ${kind}`),\n })),\n [t],\n );\n\n return <SelectInput {...props} options={options} onValueChange={handleTypeChange} />;\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,OAAOA,UAASC,eAAAA,cAAaC,WAAAA,gBAAe;AAE5C,SAASC,oBAAoB;AAC7B,SAASC,QAAAA,aAAY;AACrB,SAASC,iBAAiBC,cAAcC,kBAAkB;AAC1D,SAASC,QAAQC,OAAAA,MAAiBC,gBAAgB;AAClD,SAA8BC,QAAAA,OAAMC,eAAAA,cAAaC,gCAAgC;;;;ACNjF,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,KAAKC,YAAY;AAG1B,SAASC,uBAAuB;AAChC,SAASC,MAAsDC,qBAAqB;AAU7E,IAAMC,sBAAsB,CAAC,EAClCC,WACAC,UACAC,eACAC,kBAAiB,MACQ;;;AACzB,UAAMC,wBAAwBC,cAAc;MAAC;KAAuB;AACpE,UAAMC,qBAAqBC,QAAQ,MAAA;AACjC,UAAIC,IAAIC,MAAML,qBAAAA,GAAwB;AACpC,eAAOA,sBAAsBM,IAAIC,SAAQ,EAAGC,MAAM,aAAA,EAAeC,GAAG,CAAA;MACtE;IACF,GAA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,EAAE,GAAGQ,QAAQL,GAAGK;AACvG,SAAO/C,UAAUoC,IAAI,CAACM,QAAQ;IAAEJ,OAAOG,SAASC,EAAAA;IAAKF,OAAO,cAAcE,GAAGH,EAAE;EAAG,EAAA;AACpF;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "ComputeGraph", "Type", "FunctionTrigger", "FunctionType", "ScriptType", "Filter", "Ref", "useQuery", "Form", "SelectInput", "useRefQueryLookupHandler", "React", "useCallback", "useMemo", "Ref", "Type", "useOnTransition", "Form", "useFormValues", "FunctionInputEditor", "functions", "getValue", "onValueChange", "onQueryRefOptions", "selectedFunctionValue", "useFormValues", "selectedFunctionId", "useMemo", "Ref", "isRef", "dxn", "toString", "split", "at", "selectedFunction", "find", "fn", "id", "useOnTransition", "prevValue", "undefined", "currValue", "inputSchema", "effectSchema", "Type", "toEffectSchema", "propertyCount", "properties", "Object", "keys", "length", "values", "handleValuesChanged", "useCallback", "h3", "className", "Form", "schema", "onValuesChanged", "outerSpacing", "React", "useCallback", "useMemo", "TriggerKinds", "useTranslation", "SelectInput", "useInputProps", "SpecSelector", "props", "t", "useTranslation", "AUTOMATION_PLUGIN", "specProps", "useInputProps", "handleTypeChange", "useCallback", "_type", "value", "getDefaultTriggerSpec", "kind", "cron", "filter", "queue", "undefined", "defaultSpec", "onValueChange", "options", "useMemo", "TriggerKinds", "map", "label", "React", "SelectInput", "TriggerEditor", "space", "trigger", "onSave", "onCancel", "handleSave", "values", "handleRefQueryLookup", "useRefQueryLookupHandler", "Custom", "useCustomInputs", "React", "Form", "outerSpacing", "schema", "FunctionTrigger", "onQueryRefOptions", "functions", "useQuery", "Filter", "type", "FunctionType", "workflows", "ComputeGraph", "scripts", "ScriptType", "useMemo", "props", "getValue", "useCallback", "formValue", "Ref", "isRef", "dxn", "toString", "undefined", "handleOnValueChange", "_type", "dxnString", "Type", "DXN", "parse", "ref", "fromDXN", "onValueChange", "SelectInput", "options", "getWorkflowOptions", "concat", "getFunctionOptions", "SpecSelector", "FunctionInputEditor", "graphs", "map", "graph", "label", "id", "value", "getLabel", "fn", "find", "s", "source", "target", "name"]
|
|
7
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
AutomationContainer,
|
|
4
|
-
AutomationPanel,
|
|
5
|
-
FunctionsContainer,
|
|
6
|
-
FunctionsPanel
|
|
7
|
-
} from "./chunk-CICQ73ZT.mjs";
|
|
8
|
-
import {
|
|
9
|
-
TriggerEditor
|
|
10
|
-
} from "./chunk-ZOJVKPCA.mjs";
|
|
11
|
-
import {
|
|
12
|
-
AUTOMATION_PLUGIN,
|
|
13
|
-
meta
|
|
14
|
-
} from "./chunk-NK5N3QKD.mjs";
|
|
15
|
-
|
|
16
|
-
// src/AutomationPlugin.tsx
|
|
17
|
-
import { Capabilities, Events, contributes, defineModule, definePlugin } from "@dxos/app-framework";
|
|
18
|
-
import { FunctionTrigger, FunctionType } from "@dxos/functions";
|
|
19
|
-
import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
|
|
20
|
-
|
|
21
|
-
// src/capabilities/index.ts
|
|
22
|
-
import { lazy } from "@dxos/app-framework";
|
|
23
|
-
var AppGraphBuilder = lazy(() => import("./app-graph-builder-555IHYOB.mjs"));
|
|
24
|
-
var IntentResolver = lazy(() => import("./intent-resolver-6ZGBUILG.mjs"));
|
|
25
|
-
var ReactSurface = lazy(() => import("./react-surface-Y6AOXM75.mjs"));
|
|
26
|
-
|
|
27
|
-
// src/translations.ts
|
|
28
|
-
var translations = [
|
|
29
|
-
{
|
|
30
|
-
"en-US": {
|
|
31
|
-
[meta.id]: {
|
|
32
|
-
"plugin name": "Automation",
|
|
33
|
-
"automation panel label": "Automations",
|
|
34
|
-
"script automation label": "Automation",
|
|
35
|
-
"automation verbose label": "Manage automations",
|
|
36
|
-
"automation description": "You can manage all the triggers which automate your space here.",
|
|
37
|
-
"functions panel label": "Functions",
|
|
38
|
-
"functions verbose label": "Manage deployed functions",
|
|
39
|
-
"functions description": "You can manage all the functions deployed from your space on EDGE here.",
|
|
40
|
-
"function copy id": "Copy Function ID",
|
|
41
|
-
"no functions found": "No functions found",
|
|
42
|
-
"go to function source button label": "Show function source",
|
|
43
|
-
"trigger editor title": "Configure Trigger",
|
|
44
|
-
"new trigger label": "Add Trigger",
|
|
45
|
-
"trigger type timer": "Timer",
|
|
46
|
-
"trigger type webhook": "Webhook",
|
|
47
|
-
"trigger type websocket": "Websocket",
|
|
48
|
-
"trigger type subscription": "Subscription",
|
|
49
|
-
"trigger type email": "Email",
|
|
50
|
-
"trigger type queue": "Queue",
|
|
51
|
-
"trigger copy url": "Copy URL",
|
|
52
|
-
"trigger copy email": "Copy Email",
|
|
53
|
-
"trigger payload add": "Add",
|
|
54
|
-
"trigger payload remove": "Remove",
|
|
55
|
-
"trigger payload prop name placeholder": "New payload property name"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
// src/AutomationPlugin.tsx
|
|
62
|
-
var AutomationPlugin = () => definePlugin(meta, [
|
|
63
|
-
defineModule({
|
|
64
|
-
id: `${meta.id}/module/translations`,
|
|
65
|
-
activatesOn: Events.SetupTranslations,
|
|
66
|
-
activate: () => contributes(Capabilities.Translations, translations)
|
|
67
|
-
}),
|
|
68
|
-
defineModule({
|
|
69
|
-
id: `${meta.id}/module/schema`,
|
|
70
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
71
|
-
activate: () => contributes(ClientCapabilities.Schema, [
|
|
72
|
-
FunctionType,
|
|
73
|
-
FunctionTrigger
|
|
74
|
-
])
|
|
75
|
-
}),
|
|
76
|
-
defineModule({
|
|
77
|
-
id: `${meta.id}/module/app-graph-builder`,
|
|
78
|
-
activatesOn: Events.SetupAppGraph,
|
|
79
|
-
activate: AppGraphBuilder
|
|
80
|
-
}),
|
|
81
|
-
defineModule({
|
|
82
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
83
|
-
activatesOn: Events.SetupIntentResolver,
|
|
84
|
-
activate: IntentResolver
|
|
85
|
-
}),
|
|
86
|
-
defineModule({
|
|
87
|
-
id: `${meta.id}/module/react-surface`,
|
|
88
|
-
activatesOn: Events.SetupReactSurface,
|
|
89
|
-
activate: ReactSurface
|
|
90
|
-
})
|
|
91
|
-
]);
|
|
92
|
-
export {
|
|
93
|
-
AUTOMATION_PLUGIN,
|
|
94
|
-
AutomationContainer,
|
|
95
|
-
AutomationPanel,
|
|
96
|
-
AutomationPlugin,
|
|
97
|
-
FunctionsContainer,
|
|
98
|
-
FunctionsPanel,
|
|
99
|
-
TriggerEditor,
|
|
100
|
-
meta
|
|
101
|
-
};
|
|
102
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/AutomationPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';\nimport { FunctionTrigger, FunctionType } from '@dxos/functions';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';\nimport { meta } from './meta';\nimport { translations } from './translations';\n\nexport const AutomationPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [FunctionType, FunctionTrigger]),\n }),\n defineModule({\n id: `${meta.id}/module/app-graph-builder`,\n activatesOn: Events.SetupAppGraph,\n activate: AppGraphBuilder,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntentResolver,\n activate: IntentResolver,\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupReactSurface,\n activate: ReactSurface,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const AppGraphBuilder = lazy(() => import('./app-graph-builder'));\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Resource } from '@dxos/react-ui';\n\nimport { meta } from './meta';\n\nexport const translations = [\n {\n 'en-US': {\n [meta.id]: {\n 'plugin name': 'Automation',\n 'automation panel label': 'Automations',\n 'script automation label': 'Automation',\n 'automation verbose label': 'Manage automations',\n 'automation description': 'You can manage all the triggers which automate your space here.',\n\n 'functions panel label': 'Functions',\n 'functions verbose label': 'Manage deployed functions',\n 'functions description': 'You can manage all the functions deployed from your space on EDGE here.',\n 'function copy id': 'Copy Function ID',\n 'no functions found': 'No functions found',\n 'go to function source button label': 'Show function source',\n\n 'trigger editor title': 'Configure Trigger',\n 'new trigger label': 'Add Trigger',\n 'trigger type timer': 'Timer',\n 'trigger type webhook': 'Webhook',\n 'trigger type websocket': 'Websocket',\n 'trigger type subscription': 'Subscription',\n 'trigger type email': 'Email',\n 'trigger type queue': 'Queue',\n\n 'trigger copy url': 'Copy URL',\n 'trigger copy email': 'Copy Email',\n\n 'trigger payload add': 'Add',\n 'trigger payload remove': 'Remove',\n 'trigger payload prop name placeholder': 'New payload property name',\n },\n },\n },\n] as const satisfies Resource[];\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;AAIA,SAASA,cAAcC,QAAQC,aAAaC,cAAcC,oBAAoB;AAC9E,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,oBAAoBC,oBAAoB;;;ACFjD,SAASC,YAAY;AAEd,IAAMC,kBAAkBC,KAAK,MAAM,OAAO,kCAAA,CAAA;AAC1C,IAAMC,iBAAiBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAME,eAAeF,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACAvC,IAAMG,eAAe;EAC1B;IACE,SAAS;MACP,CAACC,KAAKC,EAAE,GAAG;QACT,eAAe;QACf,0BAA0B;QAC1B,2BAA2B;QAC3B,4BAA4B;QAC5B,0BAA0B;QAE1B,yBAAyB;QACzB,2BAA2B;QAC3B,yBAAyB;QACzB,oBAAoB;QACpB,sBAAsB;QACtB,sCAAsC;QAEtC,wBAAwB;QACxB,qBAAqB;QACrB,sBAAsB;QACtB,wBAAwB;QACxB,0BAA0B;QAC1B,6BAA6B;QAC7B,sBAAsB;QACtB,sBAAsB;QAEtB,oBAAoB;QACpB,sBAAsB;QAEtB,uBAAuB;QACvB,0BAA0B;QAC1B,yCAAyC;MAC3C;IACF;EACF;;;;AF9BK,IAAMC,mBAAmB,MAC9BC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,YAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaQ,aAAaC;IAC1BN,UAAU,MAAMC,YAAYM,mBAAmBC,QAAQ;MAACC;MAAcC;KAAgB;EACxF,CAAA;EACAf,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOa;IACpBX,UAAUY;EACZ,CAAA;EACAjB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOe;IACpBb,UAAUc;EACZ,CAAA;EACAnB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOiB;IACpBf,UAAUgB;EACZ,CAAA;CACD;",
|
|
6
|
-
"names": ["Capabilities", "Events", "contributes", "defineModule", "definePlugin", "FunctionTrigger", "FunctionType", "ClientCapabilities", "ClientEvents", "lazy", "AppGraphBuilder", "lazy", "IntentResolver", "ReactSurface", "translations", "meta", "id", "AutomationPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "FunctionType", "FunctionTrigger", "SetupAppGraph", "AppGraphBuilder", "SetupIntentResolver", "IntentResolver", "SetupReactSurface", "ReactSurface"]
|
|
7
|
-
}
|