@dxos/plugin-automation 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/LICENSE +102 -5
- package/PLUGIN.mdl +428 -0
- package/README.md +1 -1
- package/dist/lib/neutral/AutomationPanel-OKF2MDLO.mjs +12 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
- package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +191 -186
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs +23 -0
- package/dist/lib/neutral/AutomationPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-GQF5UFM6.mjs +32 -0
- package/dist/lib/neutral/AutomationSettings-GQF5UFM6.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-YBTQGCL3.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-YBTQGCL3.mjs.map +7 -0
- package/dist/lib/{browser/chunk-U55ZXRYM.mjs → neutral/FunctionsPanel-L32Z67B7.mjs} +24 -25
- package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
- package/dist/lib/{browser/chunk-XFXYU645.mjs → neutral/FunctionsRegistry-RTCY3LXE.mjs} +24 -25
- package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-Q3LJLICE.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-Q3LJLICE.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +19 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +17 -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-7YWISQOZ.mjs +54 -0
- package/dist/lib/neutral/chunk-7YWISQOZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-C7H62AU3.mjs +435 -0
- package/dist/lib/neutral/chunk-C7H62AU3.mjs.map +7 -0
- package/dist/lib/neutral/chunk-CMM3AFHR.mjs +111 -0
- package/dist/lib/neutral/chunk-CMM3AFHR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-LRVJEKMN.mjs +40 -0
- package/dist/lib/neutral/chunk-LRVJEKMN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MBIODLCB.mjs +12 -0
- package/dist/lib/neutral/chunk-MBIODLCB.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NCCFEPBZ.mjs +76 -0
- package/dist/lib/neutral/chunk-NCCFEPBZ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZNI2CGQP.mjs → neutral/chunk-RCBE37YU.mjs} +158 -60
- package/dist/lib/neutral/chunk-RCBE37YU.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TJOQNSS5.mjs +8 -0
- package/dist/lib/neutral/chunk-TJOQNSS5.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +16 -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-5YUHZOFA.mjs +68 -0
- package/dist/lib/neutral/create-trigger-from-template-5YUHZOFA.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +10 -0
- package/dist/lib/neutral/index.mjs +16 -0
- package/dist/lib/neutral/layer-specs-OXK75RDW.mjs +141 -0
- package/dist/lib/neutral/layer-specs-OXK75RDW.mjs.map +7 -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/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-FOOBGYNG.mjs +57 -0
- package/dist/lib/neutral/react-surface-FOOBGYNG.mjs.map +7 -0
- package/dist/lib/neutral/registry-sync-JYDDTBAE.mjs +82 -0
- package/dist/lib/neutral/registry-sync-JYDDTBAE.mjs.map +7 -0
- package/dist/lib/neutral/testing.mjs +8 -0
- package/dist/lib/neutral/translations.mjs +60 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs +77 -0
- package/dist/lib/neutral/trigger-runtime-controller-BOEJYGWC.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +1 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
- 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/AutomationPlugin.workerd.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +6 -0
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +8 -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.map +1 -0
- package/dist/types/src/capabilities/registry-sync.d.ts +21 -0
- package/dist/types/src/capabilities/registry-sync.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts +5 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.d.ts.map +1 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts +2 -0
- package/dist/types/src/capabilities/trigger-runtime-controller.test.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +2 -2
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +8 -8
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +1 -2
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +2 -3
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +85 -0
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -32
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts +18 -0
- package/dist/types/src/components/AutomationPanel/TriggerEdgeMetadata.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +109 -93
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/util.d.ts +14 -0
- package/dist/types/src/components/TriggerEditor/util.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +3 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/index.d.ts +1 -2
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +2 -4
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +1 -2
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +3 -3
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
- package/dist/types/src/containers/TriggerSettings/index.d.ts +2 -2
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +1 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts +13 -0
- package/dist/types/src/hooks/useEdgeTriggersDispatcherStatus.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +1 -1
- 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 +162 -46
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/testing.d.ts +2 -0
- package/dist/types/src/testing.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +45 -33
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/AutomationOperation.d.ts +21 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +1 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +11 -32
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +124 -75
- package/src/AutomationPlugin.node.ts +35 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +33 -11
- package/src/AutomationPlugin.workerd.ts +18 -0
- package/src/capabilities/app-graph-builder.ts +66 -0
- package/src/capabilities/index.ts +15 -4
- package/src/capabilities/layer-specs.ts +197 -0
- package/src/capabilities/node.ts +18 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/capabilities/registry-sync.ts +110 -0
- package/src/capabilities/trigger-runtime-controller.test.ts +103 -0
- package/src/capabilities/trigger-runtime-controller.ts +126 -0
- package/src/{cli/commands → commands}/trigger/create/queue.ts +14 -16
- package/src/{cli/commands → commands}/trigger/create/subscription.ts +8 -11
- package/src/{cli/commands → commands}/trigger/create/timer.ts +4 -7
- package/src/{cli/commands → commands}/trigger/list.ts +7 -4
- package/src/{cli/commands → commands}/trigger/options.ts +3 -15
- package/src/{cli/commands → commands}/trigger/remove.ts +5 -5
- package/src/{cli/commands → commands}/trigger/update/queue.ts +39 -43
- package/src/{cli/commands → commands}/trigger/update/subscription.ts +22 -21
- package/src/{cli/commands → commands}/trigger/update/timer.ts +22 -20
- package/src/{cli/commands → commands}/trigger/util.ts +53 -38
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +12 -5
- package/src/components/AutomationPanel/AutomationPanel.tsx +120 -58
- package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +35 -27
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +32 -23
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +9 -13
- package/src/components/TriggerEditor/SpecSelector.tsx +18 -14
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +36 -18
- package/src/components/TriggerEditor/TriggerEditor.tsx +120 -25
- package/src/components/TriggerEditor/util.ts +51 -0
- package/src/containers/AutomationSettings/AutomationSettings.tsx +12 -8
- package/src/containers/AutomationSettings/index.ts +1 -3
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +11 -11
- package/src/containers/FunctionsContainer/index.ts +1 -3
- package/src/containers/TriggerSettings/TriggerSettings.tsx +32 -10
- package/src/containers/TriggerSettings/index.ts +2 -3
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
- package/src/hooks/useTriggerRuntimeControls.ts +13 -8
- package/src/index.ts +0 -4
- package/src/meta.ts +27 -7
- package/src/operations/create-trigger-from-template.ts +70 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/testing/test-functions.ts +38 -4
- package/src/testing.ts +7 -0
- package/src/translations.ts +52 -39
- package/src/types/AutomationOperation.ts +39 -0
- package/src/types/index.ts +2 -2
- package/src/types/schema.ts +4 -25
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/AutomationPanel-EHRSV2DL.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs +0 -37
- package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs +0 -43
- package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-5WPUZGRB.mjs +0 -10
- package/dist/lib/browser/FunctionsRegistry-XRXIZRLL.mjs +0 -10
- package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs +0 -13
- package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +0 -85
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +0 -7
- package/dist/lib/browser/chunk-3P4R5WNC.mjs +0 -8
- package/dist/lib/browser/chunk-3P4R5WNC.mjs.map +0 -7
- package/dist/lib/browser/chunk-4EY2KMCM.mjs +0 -272
- package/dist/lib/browser/chunk-4EY2KMCM.mjs.map +0 -7
- package/dist/lib/browser/chunk-PZNBEKO5.mjs +0 -17
- package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +0 -7
- package/dist/lib/browser/chunk-QPG3AKFX.mjs +0 -93
- package/dist/lib/browser/chunk-QPG3AKFX.mjs.map +0 -7
- package/dist/lib/browser/chunk-SEG5OCGB.mjs +0 -31
- package/dist/lib/browser/chunk-SEG5OCGB.mjs.map +0 -7
- package/dist/lib/browser/chunk-U55ZXRYM.mjs.map +0 -7
- package/dist/lib/browser/chunk-WOBCY2FQ.mjs +0 -83
- package/dist/lib/browser/chunk-WOBCY2FQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-XFXYU645.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZNI2CGQP.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs +0 -124
- package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -13
- package/dist/lib/browser/index.mjs +0 -123
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs +0 -83
- package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-U6FAYV42.mjs +0 -69
- package/dist/lib/browser/react-surface-U6FAYV42.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/AutomationPanel-F7MPUR7U.mjs +0 -12
- package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs +0 -38
- package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs +0 -44
- package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-UFL5LT2R.mjs +0 -11
- package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs +0 -11
- package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs +0 -14
- package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +0 -86
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2X564LII.mjs +0 -10
- package/dist/lib/node-esm/chunk-2X564LII.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-34HGM46Z.mjs +0 -32
- package/dist/lib/node-esm/chunk-34HGM46Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4DK33JDH.mjs +0 -84
- package/dist/lib/node-esm/chunk-4DK33JDH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7AIKTEAX.mjs +0 -273
- package/dist/lib/node-esm/chunk-7AIKTEAX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs +0 -271
- package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GXFQR3KI.mjs +0 -99
- package/dist/lib/node-esm/chunk-GXFQR3KI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs +0 -94
- package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RTEXGGBX.mjs +0 -97
- package/dist/lib/node-esm/chunk-RTEXGGBX.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -1109
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs +0 -125
- package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs +0 -124
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs +0 -84
- package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs +0 -70
- package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/commands/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts +0 -46
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -12
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -22
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -72
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/compute-runtime/compute-runtime.ts +0 -146
- package/src/capabilities/compute-runtime/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -61
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -24
- package/src/hooks/useComputeRuntimeCallback.ts +0 -67
- package/src/types/capabilities.ts +0 -43
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/AutomationPanel-EHRSV2DL.mjs.map → neutral/AutomationPanel-OKF2MDLO.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-5WPUZGRB.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsRegistry-XRXIZRLL.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/hooks/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-F7MPUR7U.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-UFL5LT2R.mjs.map → neutral/operations/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsRegistry-574OBZ5T.mjs.map → neutral/testing.mjs.map} +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
- /package/src/{cli/commands → commands}/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Option from 'effect/Option';
|
|
6
|
+
import * as Record from 'effect/Record';
|
|
5
7
|
import React, { useCallback, useMemo } from 'react';
|
|
6
8
|
|
|
9
|
+
import { Operation, Script, Trigger } from '@dxos/compute';
|
|
7
10
|
import { ComputeGraph } from '@dxos/conductor';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import { Annotation, type Database, Entity, Feed, Filter, Obj, Query, Ref, Scope, Type } from '@dxos/echo';
|
|
12
|
+
import { DXN, EID } from '@dxos/keys';
|
|
13
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
11
14
|
import { Input } from '@dxos/react-ui';
|
|
12
15
|
import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
|
|
13
16
|
import {
|
|
@@ -22,6 +25,7 @@ import {
|
|
|
22
25
|
|
|
23
26
|
import { FunctionInputEditor } from './FunctionInputEditor';
|
|
24
27
|
import { SpecSelector } from './SpecSelector';
|
|
28
|
+
import { getOperationUri } from './util';
|
|
25
29
|
|
|
26
30
|
type TriggerFormSchema = ExcludeId<typeof Trigger.Trigger>;
|
|
27
31
|
|
|
@@ -36,22 +40,18 @@ export type TriggerEditorProps = {
|
|
|
36
40
|
Pick<FormRootProps<TriggerFormSchema>, 'onSave' | 'onCancel'>;
|
|
37
41
|
|
|
38
42
|
export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }: TriggerEditorProps) => {
|
|
39
|
-
const fieldMap = useCustomInputs({
|
|
40
|
-
db,
|
|
41
|
-
types,
|
|
42
|
-
tags,
|
|
43
|
-
readonlySpec,
|
|
44
|
-
});
|
|
43
|
+
const fieldMap = useCustomInputs({ db, types, tags, readonlySpec });
|
|
45
44
|
|
|
46
45
|
const handleValuesChanged = useCallback(
|
|
47
46
|
(newValues: Partial<TriggerFormSchema>) => {
|
|
48
|
-
Obj.
|
|
49
|
-
Object.assign(
|
|
47
|
+
Obj.update(trigger, (trigger) => {
|
|
48
|
+
Object.assign(trigger, newValues);
|
|
50
49
|
});
|
|
51
50
|
},
|
|
52
51
|
[trigger],
|
|
53
52
|
);
|
|
54
53
|
|
|
54
|
+
const triggerSchema = useMemo(() => omitId(Trigger.Trigger), []);
|
|
55
55
|
const defaultValues = useMemo(() => {
|
|
56
56
|
const { id: _, ...values } = trigger;
|
|
57
57
|
return values;
|
|
@@ -60,9 +60,9 @@ export const TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formP
|
|
|
60
60
|
return (
|
|
61
61
|
<Form.Root<TriggerFormSchema>
|
|
62
62
|
{...formProps}
|
|
63
|
-
schema={omitId(Trigger.Trigger)}
|
|
64
|
-
defaultValues={defaultValues}
|
|
65
63
|
db={db}
|
|
64
|
+
schema={triggerSchema}
|
|
65
|
+
defaultValues={defaultValues}
|
|
66
66
|
fieldMap={fieldMap}
|
|
67
67
|
onValuesChanged={handleValuesChanged}
|
|
68
68
|
>
|
|
@@ -82,9 +82,14 @@ type UseCustomInputsProps = {
|
|
|
82
82
|
} & Pick<QueryFormProps, 'types' | 'tags'>;
|
|
83
83
|
|
|
84
84
|
const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps): FormFieldMap => {
|
|
85
|
-
const functions = useQuery(
|
|
85
|
+
const functions = useQuery(
|
|
86
|
+
db,
|
|
87
|
+
Query.select(Filter.type(Operation.PersistentOperation)).from(Scope.space(), Scope.registry()),
|
|
88
|
+
);
|
|
89
|
+
|
|
86
90
|
const workflows = useQuery(db, Filter.type(ComputeGraph));
|
|
87
91
|
const scripts = useQuery(db, Filter.type(Script.Script));
|
|
92
|
+
const feeds = useQuery(db, Filter.type(Feed.Feed));
|
|
88
93
|
|
|
89
94
|
return useMemo(
|
|
90
95
|
(): FormFieldMap => ({
|
|
@@ -93,17 +98,17 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
|
|
|
93
98
|
const getValue = useCallback(() => {
|
|
94
99
|
const formValue = props.getValue();
|
|
95
100
|
if (Ref.isRef(formValue)) {
|
|
96
|
-
return formValue.
|
|
101
|
+
return formValue.uri;
|
|
97
102
|
}
|
|
98
103
|
return undefined;
|
|
99
104
|
}, [props]);
|
|
100
105
|
|
|
101
106
|
const handleOnValueChange = useCallback(
|
|
102
|
-
(_type: any,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
props.onValueChange(props.type,
|
|
107
|
+
(_type: any, uriString: string) => {
|
|
108
|
+
// Function references are either an EID (space-resident) or a key DXN (registry).
|
|
109
|
+
const uri = EID.tryParse(uriString) ?? (DXN.isDXN(uriString) ? uriString : undefined);
|
|
110
|
+
if (uri) {
|
|
111
|
+
props.onValueChange(props.type, Ref.fromURI(uri));
|
|
107
112
|
}
|
|
108
113
|
},
|
|
109
114
|
[props.type, props.onValueChange],
|
|
@@ -122,6 +127,36 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
|
|
|
122
127
|
// Spec selector.
|
|
123
128
|
'spec.kind': (props) => <SpecSelector {...props} readonly={readonlySpec} />,
|
|
124
129
|
|
|
130
|
+
// Feed selector with parent labels.
|
|
131
|
+
'spec.feed': (props) => {
|
|
132
|
+
const getValue = useCallback(() => {
|
|
133
|
+
const formValue = props.getValue();
|
|
134
|
+
if (Ref.isRef(formValue)) {
|
|
135
|
+
return formValue.uri.toString() as string;
|
|
136
|
+
}
|
|
137
|
+
return undefined;
|
|
138
|
+
}, [props]);
|
|
139
|
+
|
|
140
|
+
const handleOnValueChange = useCallback(
|
|
141
|
+
(_type: any, dxnString: string) => {
|
|
142
|
+
const uri = EID.tryParse(dxnString);
|
|
143
|
+
if (uri) {
|
|
144
|
+
props.onValueChange(props.type, Ref.fromURI(uri));
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
[props.type, props.onValueChange],
|
|
148
|
+
);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<SelectField
|
|
152
|
+
{...props}
|
|
153
|
+
getValue={getValue as any}
|
|
154
|
+
onValueChange={handleOnValueChange}
|
|
155
|
+
options={getFeedOptions(feeds)}
|
|
156
|
+
/>
|
|
157
|
+
);
|
|
158
|
+
},
|
|
159
|
+
|
|
125
160
|
// TODO(wittjosiah): Copied from ViewEditor.
|
|
126
161
|
// Query input editor.
|
|
127
162
|
'spec.query': (props) => {
|
|
@@ -141,15 +176,75 @@ const useCustomInputs = ({ db, readonlySpec, types, tags }: UseCustomInputsProps
|
|
|
141
176
|
// Function input editor.
|
|
142
177
|
input: (props) => <FunctionInputEditor {...props} functions={functions} db={db} />,
|
|
143
178
|
}),
|
|
144
|
-
[workflows, scripts, functions, readonlySpec],
|
|
179
|
+
[workflows, scripts, functions, feeds, readonlySpec],
|
|
145
180
|
);
|
|
146
181
|
};
|
|
147
182
|
|
|
183
|
+
const getObjectIconProps = (object: Entity.Unknown): { icon?: string; iconHue?: string } => {
|
|
184
|
+
const type = Entity.getType(object);
|
|
185
|
+
const schema = type ? Type.getSchema(type) : undefined;
|
|
186
|
+
const annotation = schema ? Option.getOrUndefined(Annotation.IconAnnotation.get(schema)) : undefined;
|
|
187
|
+
return annotation ? { icon: annotation.icon, iconHue: annotation.hue } : {};
|
|
188
|
+
};
|
|
189
|
+
|
|
148
190
|
const getWorkflowOptions = (graphs: ComputeGraph[]) => {
|
|
149
|
-
return graphs.map((graph) => ({
|
|
191
|
+
return graphs.map((graph) => ({
|
|
192
|
+
label: `compute-${graph.id}`,
|
|
193
|
+
value: Obj.getURI(graph),
|
|
194
|
+
...getObjectIconProps(graph),
|
|
195
|
+
}));
|
|
150
196
|
};
|
|
151
197
|
|
|
152
|
-
const getFunctionOptions = (scripts: Script.Script[], functions:
|
|
153
|
-
const getLabel = (fn:
|
|
154
|
-
|
|
198
|
+
const getFunctionOptions = (scripts: Script.Script[], functions: Operation.PersistentOperation[]) => {
|
|
199
|
+
const getLabel = (fn: Operation.PersistentOperation) =>
|
|
200
|
+
scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
201
|
+
return functions.map((fn) => {
|
|
202
|
+
const { icon: schemaIcon, iconHue } = getObjectIconProps(fn);
|
|
203
|
+
return {
|
|
204
|
+
label: getLabel(fn),
|
|
205
|
+
value: getOperationUri(fn),
|
|
206
|
+
icon: fn.icon ?? schemaIcon,
|
|
207
|
+
iconHue,
|
|
208
|
+
};
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
const getFeedDisplayName = (feed: Feed.Feed): string =>
|
|
213
|
+
Entity.getLabel(feed) ?? feed.name ?? Entity.getTypename(feed) ?? 'Feed';
|
|
214
|
+
|
|
215
|
+
const computeRefRole = (entity: Feed.Feed): string | undefined => {
|
|
216
|
+
const parent = Obj.getParent(entity);
|
|
217
|
+
if (!parent) {
|
|
218
|
+
return undefined;
|
|
219
|
+
}
|
|
220
|
+
for (const key of Record.keys(parent)) {
|
|
221
|
+
if (Ref.isRef(parent[key]) && parent[key].target?.id === entity.id) {
|
|
222
|
+
return `$.${key}`;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return undefined;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
const getFeedOptions = (feeds: Feed.Feed[]) => {
|
|
229
|
+
return feeds.map((feed) => {
|
|
230
|
+
const parent = Obj.getParent(feed);
|
|
231
|
+
const displayObject = parent ?? feed;
|
|
232
|
+
const role = computeRefRole(feed);
|
|
233
|
+
|
|
234
|
+
if (parent) {
|
|
235
|
+
return {
|
|
236
|
+
label: Entity.getLabel(parent) ?? Entity.getTypename(parent) ?? 'Parent',
|
|
237
|
+
secondaryLabel: role ?? getFeedDisplayName(feed),
|
|
238
|
+
value: Obj.getURI(feed),
|
|
239
|
+
...getObjectIconProps(displayObject),
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return {
|
|
244
|
+
label: getFeedDisplayName(feed),
|
|
245
|
+
secondaryLabel: role,
|
|
246
|
+
value: Obj.getURI(feed),
|
|
247
|
+
...getObjectIconProps(displayObject),
|
|
248
|
+
};
|
|
249
|
+
});
|
|
155
250
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Operation } from '@dxos/compute';
|
|
6
|
+
import { Obj } from '@dxos/echo';
|
|
7
|
+
import { DXN, EID, type URI } from '@dxos/keys';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Reference URI for an operation. Registry operations (no owning database) are referenced by
|
|
11
|
+
* their versioned key DXN so they resolve via the operation registry; space-resident operations
|
|
12
|
+
* are referenced by their EID.
|
|
13
|
+
*/
|
|
14
|
+
// TODO(wittjosiah): There should be a generic & consistent way to get the dxn uri for entities if its available.
|
|
15
|
+
export const getOperationUri = (fn: Operation.PersistentOperation): URI.URI => {
|
|
16
|
+
if (Obj.getDatabase(fn) === undefined) {
|
|
17
|
+
const key = Operation.getKey(fn);
|
|
18
|
+
const version = Operation.getVersion(fn);
|
|
19
|
+
const dxn = key ? DXN.tryMake(version ? `dxn:${key}:${version}` : `dxn:${key}`) : undefined;
|
|
20
|
+
if (dxn) {
|
|
21
|
+
return dxn;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return Obj.getURI(fn);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Resolve an operation from a list by its reference URI (an EID for space-resident operations,
|
|
30
|
+
* or a versioned key DXN for registry operations).
|
|
31
|
+
*/
|
|
32
|
+
export const findOperationByUri = (
|
|
33
|
+
functions: readonly Operation.PersistentOperation[],
|
|
34
|
+
uri: URI.URI,
|
|
35
|
+
): Operation.PersistentOperation | undefined => {
|
|
36
|
+
const eid = EID.tryParse(uri);
|
|
37
|
+
if (eid) {
|
|
38
|
+
const entityId = EID.getEntityId(eid);
|
|
39
|
+
return entityId ? functions.find((fn) => fn.id === entityId) : undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
if (DXN.isDXN(uri)) {
|
|
43
|
+
const key = DXN.getName(uri);
|
|
44
|
+
const version = DXN.getVersion(uri);
|
|
45
|
+
return functions.find(
|
|
46
|
+
(fn) => Operation.getKey(fn) === key && (version === undefined || Operation.getVersion(fn) === version),
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return undefined;
|
|
51
|
+
};
|
|
@@ -4,24 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
7
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
8
9
|
import { Settings } from '@dxos/react-ui-form';
|
|
9
10
|
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
|
|
10
13
|
import { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';
|
|
11
|
-
import {
|
|
12
|
-
|
|
14
|
+
import { TriggersSettings } from '../TriggerSettings';
|
|
15
|
+
|
|
16
|
+
export type AutomationSettingsProps = AppSurface.SpaceArticleProps<Omit<AutomationPanelProps, 'space'>>;
|
|
13
17
|
|
|
14
|
-
export const AutomationSettings = (props:
|
|
18
|
+
export const AutomationSettings = (props: AutomationSettingsProps) => {
|
|
15
19
|
const { t } = useTranslation(meta.id);
|
|
16
20
|
return (
|
|
17
|
-
<Settings.
|
|
21
|
+
<Settings.Viewport>
|
|
18
22
|
<Settings.Section
|
|
19
|
-
title={t('automation
|
|
20
|
-
description={t('automation
|
|
23
|
+
title={t('automation-verbose.label', { ns: meta.id })}
|
|
24
|
+
description={t('automation.description', { ns: meta.id })}
|
|
21
25
|
>
|
|
22
26
|
<AutomationPanel {...props} />
|
|
23
|
-
<TriggersSettings
|
|
27
|
+
<TriggersSettings space={props.space} />
|
|
24
28
|
</Settings.Section>
|
|
25
|
-
</Settings.
|
|
29
|
+
</Settings.Viewport>
|
|
26
30
|
);
|
|
27
31
|
};
|
|
@@ -4,30 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
8
|
import { useTranslation } from '@dxos/react-ui';
|
|
9
9
|
import { Settings } from '@dxos/react-ui-form';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { FunctionsRegistry } from '../../components/FunctionsRegistry';
|
|
13
|
-
import { meta } from '../../meta';
|
|
11
|
+
import { meta } from '#meta';
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
import { FunctionsPanel, FunctionsRegistry } from '../../components';
|
|
14
|
+
|
|
15
|
+
export const FunctionsContainer = ({ space }: AppSurface.SpaceArticleProps) => {
|
|
16
16
|
const { t } = useTranslation(meta.id);
|
|
17
17
|
return (
|
|
18
|
-
<Settings.
|
|
18
|
+
<Settings.Viewport>
|
|
19
19
|
<Settings.Section
|
|
20
|
-
title={t('functions
|
|
21
|
-
description={t('functions
|
|
20
|
+
title={t('functions-verbose.label', { ns: meta.id })}
|
|
21
|
+
description={t('functions.description', { ns: meta.id })}
|
|
22
22
|
>
|
|
23
23
|
<FunctionsPanel space={space} />
|
|
24
24
|
</Settings.Section>
|
|
25
25
|
<Settings.Section
|
|
26
|
-
title={t('functions
|
|
27
|
-
description={t('functions
|
|
26
|
+
title={t('functions-registry-verbose.label', { ns: meta.id })}
|
|
27
|
+
description={t('functions-registry.description', { ns: meta.id })}
|
|
28
28
|
>
|
|
29
29
|
<FunctionsRegistry space={space} />
|
|
30
30
|
</Settings.Section>
|
|
31
|
-
</Settings.
|
|
31
|
+
</Settings.Viewport>
|
|
32
32
|
);
|
|
33
33
|
};
|
|
@@ -4,23 +4,45 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import {
|
|
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';
|
|
9
11
|
import { Settings } from '@dxos/react-ui-form';
|
|
10
12
|
|
|
11
|
-
import {
|
|
12
|
-
import { meta } from '../../meta';
|
|
13
|
+
import { meta } from '#meta';
|
|
13
14
|
|
|
14
|
-
export const TriggersSettings = ({
|
|
15
|
-
const { state, start, stop } = useTriggerRuntimeControls(db);
|
|
16
|
-
const isRunning = state?.enabled ?? false;
|
|
15
|
+
export const TriggersSettings = ({ space }: { space: Space }) => {
|
|
17
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
|
+
};
|
|
18
25
|
|
|
19
26
|
return (
|
|
20
27
|
<div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
21
|
-
<Settings.
|
|
22
|
-
<
|
|
23
|
-
|
|
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>
|
|
24
46
|
</div>
|
|
25
47
|
);
|
|
26
48
|
};
|
package/src/hooks/index.ts
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Context } from '@dxos/context';
|
|
8
|
+
import { type TriggersDispatcherStatus } from '@dxos/edge-client';
|
|
9
|
+
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
10
|
+
import { type SpaceId } from '@dxos/keys';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
import { useClient } from '@dxos/react-client';
|
|
13
|
+
import { useIdentity } from '@dxos/react-client/halo';
|
|
14
|
+
|
|
15
|
+
const POLL_INTERVAL_MS = 5_000;
|
|
16
|
+
|
|
17
|
+
export type EdgeTriggersDispatcherStatusState = {
|
|
18
|
+
status: TriggersDispatcherStatus | undefined;
|
|
19
|
+
error: boolean;
|
|
20
|
+
loading: boolean;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Polls Edge TriggersDispatcher status for a space while enabled.
|
|
25
|
+
* Uses {@link FunctionsServiceClient} so requests are authenticated like other edge trigger calls.
|
|
26
|
+
*/
|
|
27
|
+
export const useEdgeTriggersDispatcherStatus = (
|
|
28
|
+
spaceId: SpaceId | undefined,
|
|
29
|
+
enabled: boolean,
|
|
30
|
+
): EdgeTriggersDispatcherStatusState => {
|
|
31
|
+
const client = useClient();
|
|
32
|
+
const identity = useIdentity();
|
|
33
|
+
const functionsServiceClient = useMemo(() => FunctionsServiceClient.fromClient(client), [client]);
|
|
34
|
+
const [status, setStatus] = useState<TriggersDispatcherStatus | undefined>();
|
|
35
|
+
const [error, setError] = useState(false);
|
|
36
|
+
const [loading, setLoading] = useState(false);
|
|
37
|
+
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
if (!enabled || !spaceId || !identity) {
|
|
40
|
+
setStatus(undefined);
|
|
41
|
+
setError(false);
|
|
42
|
+
setLoading(false);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let cancelled = false;
|
|
47
|
+
|
|
48
|
+
const fetchStatus = async () => {
|
|
49
|
+
try {
|
|
50
|
+
setLoading(true);
|
|
51
|
+
const result = await functionsServiceClient.getTriggersDispatcherStatus(Context.default(), spaceId);
|
|
52
|
+
if (!cancelled) {
|
|
53
|
+
setStatus(result);
|
|
54
|
+
setError(false);
|
|
55
|
+
}
|
|
56
|
+
} catch (err) {
|
|
57
|
+
log.catch(err);
|
|
58
|
+
if (!cancelled) {
|
|
59
|
+
setError(true);
|
|
60
|
+
}
|
|
61
|
+
} finally {
|
|
62
|
+
if (!cancelled) {
|
|
63
|
+
setLoading(false);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
void fetchStatus();
|
|
69
|
+
const interval = setInterval(() => void fetchStatus(), POLL_INTERVAL_MS);
|
|
70
|
+
|
|
71
|
+
return () => {
|
|
72
|
+
cancelled = true;
|
|
73
|
+
clearInterval(interval);
|
|
74
|
+
};
|
|
75
|
+
}, [enabled, functionsServiceClient, identity, spaceId]);
|
|
76
|
+
|
|
77
|
+
return { status, error, loading };
|
|
78
|
+
};
|
|
@@ -7,13 +7,12 @@ import type * as Context from 'effect/Context';
|
|
|
7
7
|
import * as Effect from 'effect/Effect';
|
|
8
8
|
import { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
import { Trigger } from '@dxos/
|
|
10
|
+
import { useSpaceCallback } from '@dxos/app-framework/ui';
|
|
11
|
+
import { Trigger } from '@dxos/compute';
|
|
12
|
+
import { type Database, Filter, Query } from '@dxos/echo';
|
|
12
13
|
import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
|
|
13
14
|
import { useQuery } from '@dxos/react-client/echo';
|
|
14
15
|
|
|
15
|
-
import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
|
|
16
|
-
|
|
17
16
|
interface TriggerRuntimeControls {
|
|
18
17
|
triggers: Trigger.Trigger[];
|
|
19
18
|
|
|
@@ -24,12 +23,16 @@ interface TriggerRuntimeControls {
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
|
|
27
|
-
const triggers = useQuery(
|
|
26
|
+
const triggers = useQuery(
|
|
27
|
+
db,
|
|
28
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
|
|
29
|
+
);
|
|
28
30
|
|
|
29
31
|
const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
|
|
30
32
|
|
|
31
|
-
const init =
|
|
33
|
+
const init = useSpaceCallback(
|
|
32
34
|
db?.spaceId,
|
|
35
|
+
[TriggerDispatcher],
|
|
33
36
|
Effect.fnUntraced(function* () {
|
|
34
37
|
const dispatcher = yield* TriggerDispatcher;
|
|
35
38
|
setDispatcher(dispatcher);
|
|
@@ -42,16 +45,18 @@ export const useTriggerRuntimeControls = (db: Database.Database | undefined): Tr
|
|
|
42
45
|
|
|
43
46
|
const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
|
|
44
47
|
|
|
45
|
-
const start =
|
|
48
|
+
const start = useSpaceCallback(
|
|
46
49
|
db?.spaceId,
|
|
50
|
+
[TriggerDispatcher],
|
|
47
51
|
Effect.fnUntraced(function* () {
|
|
48
52
|
const dispatcher = yield* TriggerDispatcher;
|
|
49
53
|
yield* dispatcher.start();
|
|
50
54
|
}),
|
|
51
55
|
);
|
|
52
56
|
|
|
53
|
-
const stop =
|
|
57
|
+
const stop = useSpaceCallback(
|
|
54
58
|
db?.spaceId,
|
|
59
|
+
[TriggerDispatcher],
|
|
55
60
|
Effect.fnUntraced(function* () {
|
|
56
61
|
const dispatcher = yield* TriggerDispatcher;
|
|
57
62
|
yield* dispatcher.stop();
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,16 +2,36 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.automation'),
|
|
10
11
|
name: 'Automation',
|
|
12
|
+
author: 'DXOS',
|
|
11
13
|
description: trim`
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
Event-driven workflow automation engine for DXOS Composer.
|
|
15
|
+
Triggers connect ECHO objects, timer schedules, incoming feeds (email, webhook), and data
|
|
16
|
+
subscriptions to persistent compute functions — enabling automated pipelines that react to
|
|
17
|
+
changes in real time without manual intervention.
|
|
18
|
+
|
|
19
|
+
Each trigger references a PersistentOperation (a compiled function derived from a Script or
|
|
20
|
+
a visual ComputeGraph workflow) and carries optional structured input forwarded at invocation.
|
|
21
|
+
A per-space TriggerDispatcher manages execution: running locally in the browser when
|
|
22
|
+
computeEnvironment is "local", or delegating to the DXOS edge for server-side reliability.
|
|
23
|
+
|
|
24
|
+
The AutomationPanel settings surface lets users create, configure, enable, disable, and
|
|
25
|
+
force-run triggers from within any space. The TriggerEditor form supports all spec kinds —
|
|
26
|
+
timer (cron), feed, subscription, email, and webhook — with a query builder for
|
|
27
|
+
subscription-type triggers and a structured input editor for passing data to functions.
|
|
28
|
+
|
|
29
|
+
Operation handlers and blueprints contributed by any plugin in the application are
|
|
30
|
+
automatically merged and made available to every space's OperationRegistry, so new
|
|
31
|
+
capabilities registered by other plugins become instantly invocable from automation triggers.
|
|
14
32
|
`,
|
|
15
|
-
icon: 'ph--
|
|
33
|
+
icon: 'ph--atom--regular',
|
|
16
34
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
|
|
17
|
-
|
|
35
|
+
spec: 'PLUGIN.mdl',
|
|
36
|
+
tags: ['system'],
|
|
37
|
+
});
|