@dxos/plugin-automation 0.8.4-main.406dc2a → 0.8.4-main.43cb759274
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/neutral/AutomationPlugin.node.mjs +1113 -0
- 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/neutral/FunctionsPanel-L32Z67B7.mjs +97 -0
- package/dist/lib/neutral/FunctionsPanel-L32Z67B7.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsRegistry-RTCY3LXE.mjs +95 -0
- 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/neutral/chunk-RCBE37YU.mjs +368 -0
- 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/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-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/testing.mjs.map +7 -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 +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/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 +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -5
- 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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- 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 +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 +10 -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 +11 -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 +85 -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 +45 -27
- 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 +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 +9 -8
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +117 -29
- 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/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.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 +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 +6 -5
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- 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 +318 -3
- 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 -28
- 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 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +13 -5
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +136 -69
- package/src/AutomationPlugin.node.ts +35 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +39 -36
- package/src/AutomationPlugin.workerd.ts +18 -0
- package/src/capabilities/app-graph-builder.ts +59 -80
- package/src/capabilities/index.ts +14 -7
- 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 +49 -45
- 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/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +87 -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 +47 -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 +191 -0
- package/src/commands/trigger/update/subscription.ts +279 -0
- package/src/commands/trigger/update/timer.ts +195 -0
- package/src/commands/trigger/util.ts +410 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +13 -7
- package/src/components/AutomationPanel/AutomationPanel.tsx +260 -100
- package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +50 -30
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +119 -0
- package/src/components/FunctionsRegistry/index.ts +8 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +39 -42
- package/src/components/TriggerEditor/SpecSelector.tsx +28 -22
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +105 -41
- package/src/components/TriggerEditor/TriggerEditor.tsx +179 -56
- package/src/components/TriggerEditor/util.ts +51 -0
- 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 +2 -1
- package/src/hooks/useEdgeTriggersDispatcherStatus.ts +78 -0
- package/src/hooks/useTriggerRuntimeControls.ts +39 -19
- package/src/index.ts +1 -5
- package/src/meta.ts +30 -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 +43 -9
- package/src/testing.ts +7 -0
- package/src/translations.ts +53 -33
- package/src/types/AutomationOperation.ts +39 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +6 -6
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/AutomationPanel-3PHA5FTJ.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-3EYSPFKB.mjs +0 -69
- package/dist/lib/browser/AutomationSettings-3EYSPFKB.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-NRIKAPQV.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs +0 -81
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +0 -7
- package/dist/lib/browser/chunk-5ARH77PV.mjs +0 -15
- package/dist/lib/browser/chunk-5ARH77PV.mjs.map +0 -7
- package/dist/lib/browser/chunk-6TUZQIEN.mjs +0 -14
- package/dist/lib/browser/chunk-6TUZQIEN.mjs.map +0 -7
- package/dist/lib/browser/chunk-DK7BLEKU.mjs +0 -14
- package/dist/lib/browser/chunk-DK7BLEKU.mjs.map +0 -7
- package/dist/lib/browser/chunk-DLLE4FKP.mjs +0 -94
- package/dist/lib/browser/chunk-DLLE4FKP.mjs.map +0 -7
- package/dist/lib/browser/chunk-MVPRI3DB.mjs +0 -53
- package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +0 -7
- package/dist/lib/browser/chunk-SUKAEYF3.mjs +0 -267
- package/dist/lib/browser/chunk-SUKAEYF3.mjs.map +0 -7
- package/dist/lib/browser/chunk-VGBZKM3O.mjs +0 -38
- package/dist/lib/browser/chunk-VGBZKM3O.mjs.map +0 -7
- package/dist/lib/browser/chunk-VL3KSDVL.mjs +0 -183
- package/dist/lib/browser/chunk-VL3KSDVL.mjs.map +0 -7
- package/dist/lib/browser/chunk-WWURMV25.mjs +0 -13
- package/dist/lib/browser/chunk-WWURMV25.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +0 -160
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -12
- package/dist/lib/browser/index.mjs +0 -121
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs +0 -77
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-G7CG7BML.mjs +0 -63
- package/dist/lib/browser/react-surface-G7CG7BML.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationPanel-EETYIR35.mjs +0 -12
- package/dist/lib/node-esm/AutomationSettings-WKSMWITV.mjs +0 -70
- package/dist/lib/node-esm/AutomationSettings-WKSMWITV.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-SAMRTELO.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs +0 -82
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2EWXIFEK.mjs +0 -16
- package/dist/lib/node-esm/chunk-2EWXIFEK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs +0 -15
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AKHETVIQ.mjs +0 -184
- package/dist/lib/node-esm/chunk-AKHETVIQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-B7N3H45O.mjs +0 -16
- package/dist/lib/node-esm/chunk-B7N3H45O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs +0 -39
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J3XEBEIE.mjs +0 -268
- package/dist/lib/node-esm/chunk-J3XEBEIE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs +0 -54
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs +0 -16
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs +0 -95
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +0 -161
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -13
- package/dist/lib/node-esm/index.mjs +0 -122
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-OMZSBDHS.mjs +0 -64
- package/dist/lib/node-esm/react-surface-OMZSBDHS.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/capabilities.d.ts +0 -19
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
- 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/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings.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/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +0 -8
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -48
- package/src/capabilities/compute-runtime.ts +0 -138
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -29
- package/src/components/TriggerSettings.tsx +0 -25
- package/src/events.ts +0 -11
- package/src/hooks/useComputeRuntimeCallback.ts +0 -30
- /package/dist/lib/{browser/AutomationPanel-3PHA5FTJ.mjs.map → neutral/AutomationPanel-OKF2MDLO.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-NRIKAPQV.mjs.map → neutral/AutomationPlugin.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks/index.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/hooks → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-EETYIR35.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-SAMRTELO.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type ComputeEnvironment } from '@dxos/client-protocol';
|
|
8
|
+
import { useObject } from '@dxos/echo-react';
|
|
9
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
10
|
+
import { DropdownMenu, IconButton, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { Settings } from '@dxos/react-ui-form';
|
|
12
|
+
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
|
|
15
|
+
export const TriggersSettings = ({ space }: { space: Space }) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
const [properties, changeProperties] = useObject(space.properties);
|
|
18
|
+
const selected = properties.computeEnvironment ?? 'local';
|
|
19
|
+
|
|
20
|
+
const handleUpdate = (option: ComputeEnvironment) => {
|
|
21
|
+
changeProperties((draft) => {
|
|
22
|
+
draft.computeEnvironment = option;
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className='grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
28
|
+
<Settings.Item title={t('runtime.label')} description={t('runtime.description')}>
|
|
29
|
+
<DropdownMenu.Root>
|
|
30
|
+
<DropdownMenu.Trigger asChild>
|
|
31
|
+
<IconButton iconEnd icon='ph--caret-down--regular' size={4} label={t(`runtime.${selected}.label`)} />
|
|
32
|
+
</DropdownMenu.Trigger>
|
|
33
|
+
<DropdownMenu.Portal>
|
|
34
|
+
<DropdownMenu.Content side='bottom'>
|
|
35
|
+
<DropdownMenu.Viewport>
|
|
36
|
+
<DropdownMenu.Item onClick={() => handleUpdate('disabled')}>
|
|
37
|
+
{t(`runtime.disabled.label`)}
|
|
38
|
+
</DropdownMenu.Item>
|
|
39
|
+
<DropdownMenu.Item onClick={() => handleUpdate('local')}>{t(`runtime.local.label`)}</DropdownMenu.Item>
|
|
40
|
+
<DropdownMenu.Item onClick={() => handleUpdate('edge')}>{t(`runtime.edge.label`)}</DropdownMenu.Item>
|
|
41
|
+
</DropdownMenu.Viewport>
|
|
42
|
+
</DropdownMenu.Content>
|
|
43
|
+
</DropdownMenu.Portal>
|
|
44
|
+
</DropdownMenu.Root>
|
|
45
|
+
</Settings.Item>
|
|
46
|
+
</div>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type ComponentType, lazy } from 'react';
|
|
6
|
+
|
|
7
|
+
export const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));
|
|
8
|
+
export const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));
|
|
9
|
+
export const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));
|
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
|
+
};
|
|
@@ -2,50 +2,70 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Atom, useAtomValue } from '@effect-atom/atom-react';
|
|
6
|
+
import type * as Context from 'effect/Context';
|
|
5
7
|
import * as Effect from 'effect/Effect';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
6
9
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { type
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
|
|
10
|
+
import { useSpaceCallback } from '@dxos/app-framework/ui';
|
|
11
|
+
import { Trigger } from '@dxos/compute';
|
|
12
|
+
import { type Database, Filter, Query } from '@dxos/echo';
|
|
13
|
+
import { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';
|
|
14
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
13
15
|
|
|
14
16
|
interface TriggerRuntimeControls {
|
|
15
|
-
triggers:
|
|
16
|
-
|
|
17
|
+
triggers: Trigger.Trigger[];
|
|
18
|
+
|
|
19
|
+
state: TriggerDispatcherState | undefined;
|
|
20
|
+
|
|
17
21
|
start: () => void;
|
|
18
22
|
stop: () => void;
|
|
19
23
|
}
|
|
20
24
|
|
|
21
|
-
export const useTriggerRuntimeControls = (
|
|
22
|
-
const triggers = useQuery(
|
|
25
|
+
export const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {
|
|
26
|
+
const triggers = useQuery(
|
|
27
|
+
db,
|
|
28
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);
|
|
23
32
|
|
|
24
|
-
const
|
|
25
|
-
|
|
33
|
+
const init = useSpaceCallback(
|
|
34
|
+
db?.spaceId,
|
|
35
|
+
[TriggerDispatcher],
|
|
36
|
+
Effect.fnUntraced(function* () {
|
|
37
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
38
|
+
setDispatcher(dispatcher);
|
|
39
|
+
}),
|
|
26
40
|
);
|
|
27
41
|
|
|
28
|
-
|
|
29
|
-
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
void init();
|
|
44
|
+
}, []);
|
|
45
|
+
|
|
46
|
+
const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));
|
|
47
|
+
|
|
48
|
+
const start = useSpaceCallback(
|
|
49
|
+
db?.spaceId,
|
|
50
|
+
[TriggerDispatcher],
|
|
30
51
|
Effect.fnUntraced(function* () {
|
|
31
52
|
const dispatcher = yield* TriggerDispatcher;
|
|
32
53
|
yield* dispatcher.start();
|
|
33
|
-
setIsRunningState(true);
|
|
34
54
|
}),
|
|
35
55
|
);
|
|
36
56
|
|
|
37
|
-
const stop =
|
|
38
|
-
|
|
57
|
+
const stop = useSpaceCallback(
|
|
58
|
+
db?.spaceId,
|
|
59
|
+
[TriggerDispatcher],
|
|
39
60
|
Effect.fnUntraced(function* () {
|
|
40
61
|
const dispatcher = yield* TriggerDispatcher;
|
|
41
62
|
yield* dispatcher.stop();
|
|
42
|
-
setIsRunningState(false);
|
|
43
63
|
}),
|
|
44
64
|
);
|
|
45
65
|
|
|
46
66
|
return {
|
|
47
67
|
triggers,
|
|
48
|
-
|
|
68
|
+
state,
|
|
49
69
|
start: () => void start(),
|
|
50
70
|
stop: () => void stop(),
|
|
51
71
|
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,13 +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';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
6
8
|
|
|
7
|
-
export const meta
|
|
8
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.automation'),
|
|
9
11
|
name: 'Automation',
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
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.
|
|
32
|
+
`,
|
|
33
|
+
icon: 'ph--atom--regular',
|
|
13
34
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
|
|
14
|
-
|
|
35
|
+
spec: 'PLUGIN.mdl',
|
|
36
|
+
tags: ['system'],
|
|
37
|
+
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';
|
|
8
|
+
import { Operation, Script, Trigger } from '@dxos/compute';
|
|
9
|
+
import { type Feed, Filter, Obj, Ref } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
|
|
14
|
+
import { AutomationOperation } from '../types';
|
|
15
|
+
|
|
16
|
+
const handler: Operation.WithHandler<typeof AutomationOperation.CreateTriggerFromTemplate> =
|
|
17
|
+
AutomationOperation.CreateTriggerFromTemplate.pipe(
|
|
18
|
+
Operation.withHandler(
|
|
19
|
+
Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
20
|
+
const trigger = Trigger.make({ enabled, input });
|
|
21
|
+
|
|
22
|
+
// TODO(wittjosiah): Factor out function lookup by script name?
|
|
23
|
+
if (scriptName) {
|
|
24
|
+
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());
|
|
25
|
+
const [script] = scripts;
|
|
26
|
+
if (script) {
|
|
27
|
+
const functions = yield* Effect.promise(() =>
|
|
28
|
+
db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),
|
|
29
|
+
);
|
|
30
|
+
const [fn] = functions;
|
|
31
|
+
if (fn) {
|
|
32
|
+
Obj.update(trigger, (trigger) => {
|
|
33
|
+
trigger.function = Ref.make(fn);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
switch (template.type) {
|
|
40
|
+
case 'timer': {
|
|
41
|
+
Obj.update(trigger, (trigger) => {
|
|
42
|
+
trigger.spec = Trigger.specTimer(template.cron);
|
|
43
|
+
});
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case 'feed': {
|
|
47
|
+
Obj.update(trigger, (trigger) => {
|
|
48
|
+
trigger.spec = Trigger.specFeed(template.feed as Feed.Feed);
|
|
49
|
+
});
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
default: {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
58
|
+
object: trigger,
|
|
59
|
+
target: db,
|
|
60
|
+
hidden: true,
|
|
61
|
+
});
|
|
62
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
63
|
+
subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],
|
|
64
|
+
workspace: getSpacePath(db.spaceId),
|
|
65
|
+
});
|
|
66
|
+
}),
|
|
67
|
+
),
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
export default handler;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const AutomationPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { AutomationOperationHandlerSet } from './operations';
|
|
@@ -4,14 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { TestSchema } from '@dxos/client/testing';
|
|
8
|
+
import { JsonSchema, Ref, DXN } from '@dxos/echo';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Operations seeded into the local space in stories.
|
|
12
|
+
*/
|
|
10
13
|
export const functions = [
|
|
11
14
|
{
|
|
12
|
-
|
|
15
|
+
key: DXN.make('com.example.function.chess'),
|
|
16
|
+
name: 'com.example.function.chess',
|
|
13
17
|
version: '0.1.0',
|
|
14
|
-
inputSchema:
|
|
18
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
15
19
|
Schema.Struct({
|
|
16
20
|
level: Schema.Number.annotations({
|
|
17
21
|
title: 'Level',
|
|
@@ -20,10 +24,11 @@ export const functions = [
|
|
|
20
24
|
),
|
|
21
25
|
},
|
|
22
26
|
{
|
|
23
|
-
|
|
27
|
+
key: DXN.make('com.example.function.forex'),
|
|
28
|
+
name: 'com.example.function.forex',
|
|
24
29
|
version: '0.1.0',
|
|
25
30
|
binding: 'FOREX',
|
|
26
|
-
inputSchema:
|
|
31
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
27
32
|
Schema.Struct({
|
|
28
33
|
from: Schema.String.annotations({ title: 'Currency from' }),
|
|
29
34
|
to: Schema.String.annotations({ title: 'Currency to' }),
|
|
@@ -31,11 +36,40 @@ export const functions = [
|
|
|
31
36
|
),
|
|
32
37
|
},
|
|
33
38
|
{
|
|
34
|
-
|
|
39
|
+
key: DXN.make('com.example.function.pingContact'),
|
|
40
|
+
name: 'com.example.function.ping-contact',
|
|
35
41
|
version: '0.0.1',
|
|
36
|
-
inputSchema:
|
|
42
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
37
43
|
Schema.Struct({
|
|
38
|
-
contact:
|
|
44
|
+
contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
|
|
45
|
+
}),
|
|
46
|
+
),
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Operations seeded into the registry (not the local space) in stories.
|
|
52
|
+
* Simulates built-in or plugin-provided operations available globally.
|
|
53
|
+
*/
|
|
54
|
+
export const registryFunctions = [
|
|
55
|
+
{
|
|
56
|
+
key: 'com.example.function.translate',
|
|
57
|
+
name: 'com.example.function.translate',
|
|
58
|
+
version: '0.1.0',
|
|
59
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
60
|
+
Schema.Struct({
|
|
61
|
+
text: Schema.String.annotations({ title: 'Text' }),
|
|
62
|
+
targetLanguage: Schema.String.annotations({ title: 'Target language' }),
|
|
63
|
+
}),
|
|
64
|
+
),
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'com.example.function.summarize',
|
|
68
|
+
name: 'com.example.function.summarize',
|
|
69
|
+
version: '0.1.0',
|
|
70
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
71
|
+
Schema.Struct({
|
|
72
|
+
content: Schema.String.annotations({ title: 'Content' }),
|
|
39
73
|
}),
|
|
40
74
|
),
|
|
41
75
|
},
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -4,44 +4,64 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Resource } from '@dxos/react-ui';
|
|
6
6
|
|
|
7
|
-
import { meta } from '
|
|
7
|
+
import { meta } from '#meta';
|
|
8
8
|
|
|
9
9
|
export const translations = [
|
|
10
10
|
{
|
|
11
11
|
'en-US': {
|
|
12
12
|
[meta.id]: {
|
|
13
|
-
'plugin
|
|
14
|
-
'automation
|
|
15
|
-
'script
|
|
16
|
-
'automation
|
|
17
|
-
'automation
|
|
18
|
-
|
|
19
|
-
'runtime
|
|
20
|
-
'runtime
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
'
|
|
24
|
-
|
|
25
|
-
'functions
|
|
26
|
-
'
|
|
27
|
-
'
|
|
28
|
-
'
|
|
29
|
-
|
|
30
|
-
'
|
|
31
|
-
'
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
'trigger
|
|
36
|
-
'trigger
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
'trigger
|
|
41
|
-
|
|
42
|
-
'trigger
|
|
43
|
-
'trigger
|
|
44
|
-
'trigger
|
|
13
|
+
'plugin.name': 'Automation',
|
|
14
|
+
'automation-panel.label': 'Automations',
|
|
15
|
+
'script-automation.label': 'Automation',
|
|
16
|
+
'automation-verbose.label': 'Manage automations',
|
|
17
|
+
'automation.description': 'Triggers that automate this space.',
|
|
18
|
+
|
|
19
|
+
'runtime.label': 'Trigger runtime location',
|
|
20
|
+
'runtime.description': 'Determines where the triggers in this space will execute.',
|
|
21
|
+
'runtime.disabled.label': 'Triggers disabled',
|
|
22
|
+
'runtime.local.label': 'Local',
|
|
23
|
+
'runtime.edge.label': 'EDGE (experimental)',
|
|
24
|
+
|
|
25
|
+
'functions-panel.label': 'Functions',
|
|
26
|
+
'functions-verbose.label': 'Manage deployed functions',
|
|
27
|
+
'functions-registry-verbose.label': 'Functions registry',
|
|
28
|
+
'functions-registry.description': 'Import functions from the registry',
|
|
29
|
+
'functions.description': 'Functions deployed from this space on EDGE.',
|
|
30
|
+
'show-source-button.label': 'Show source',
|
|
31
|
+
'delete-function-button.label': 'Delete function',
|
|
32
|
+
|
|
33
|
+
'function-parameters.label': 'Function parameters',
|
|
34
|
+
|
|
35
|
+
'trigger-editor.title': 'Configure Trigger',
|
|
36
|
+
'trigger-editor.description':
|
|
37
|
+
'Triggers are used to run functions at specific times or when specific events occur.',
|
|
38
|
+
'new-trigger.label': 'Add Trigger',
|
|
39
|
+
|
|
40
|
+
'trigger-type.timer.label': 'Timer',
|
|
41
|
+
'trigger-type.webhook.label': 'Webhook',
|
|
42
|
+
'trigger-type.websocket.label': 'Websocket',
|
|
43
|
+
'trigger-type.subscription.label': 'Subscription',
|
|
44
|
+
'trigger-type.email.label': 'Email',
|
|
45
|
+
'trigger-type.feed.label': 'Feed',
|
|
46
|
+
|
|
47
|
+
'trigger-payload-prop-name.placeholder': 'New payload property name',
|
|
48
|
+
'import-function-button.label': 'Loading...',
|
|
49
|
+
'update-function-button.label': 'Update',
|
|
50
|
+
'loading-functions.message': 'Loading functions...',
|
|
51
|
+
|
|
52
|
+
'edge.trigger.status.loading.message': 'Loading edge trigger status…',
|
|
53
|
+
'edge.trigger.status.unavailable.message': 'Edge trigger status unavailable',
|
|
54
|
+
'edge.trigger.status.dispatcher.label': 'Edge dispatcher: {{state}}',
|
|
55
|
+
'edge.trigger.status.active.label': 'active',
|
|
56
|
+
'edge.trigger.status.inactive.label': 'inactive',
|
|
57
|
+
'edge.trigger.status.next.cron.label': 'Next cron run: {{time}}',
|
|
58
|
+
'edge.trigger.status.next.alarm.label': 'Next alarm: {{time}}',
|
|
59
|
+
'edge.trigger.status.inactivity.label': 'Inactivity timeout: {{remaining}} remaining',
|
|
60
|
+
'edge.trigger.status.registered.label': 'Edge: registered',
|
|
61
|
+
'edge.trigger.status.not.registered.label': 'Edge: not registered',
|
|
62
|
+
'edge.trigger.status.registered.count.label': 'Enabled cron triggers on edge: {{registered}} / {{total}}',
|
|
63
|
+
'edge.trigger.status.cron.na.label': 'Edge: cron registration n/a',
|
|
64
|
+
'edge.trigger.status.disabled.detail.label': 'disabled',
|
|
45
65
|
},
|
|
46
66
|
},
|
|
47
67
|
},
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import * as Schema from 'effect/Schema';
|
|
8
|
+
|
|
9
|
+
import { Capability } from '@dxos/app-framework';
|
|
10
|
+
import { Operation } from '@dxos/compute';
|
|
11
|
+
import { Database, DXN } from '@dxos/echo';
|
|
12
|
+
// Value-side `EID` import keeps TS declaration emit portable — `TriggerTemplate`
|
|
13
|
+
// references `EID.Schema` and the inferred `CreateTriggerFromTemplate` type
|
|
14
|
+
// otherwise needs a transitive `@dxos/keys` import that's hard for d.ts emit to surface.
|
|
15
|
+
import { EID as _EchoURIReference } from '@dxos/keys';
|
|
16
|
+
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
|
|
19
|
+
import { TriggerTemplate } from './schema';
|
|
20
|
+
export { _EchoURIReference };
|
|
21
|
+
|
|
22
|
+
const makeKey = (name: string) => DXN.make(`${meta.id}.operation.${name}`);
|
|
23
|
+
|
|
24
|
+
export const CreateTriggerFromTemplate = Operation.make({
|
|
25
|
+
meta: {
|
|
26
|
+
key: makeKey('createTriggerFromTemplate'),
|
|
27
|
+
name: 'Create Trigger From Template',
|
|
28
|
+
icon: 'ph--lightning--regular',
|
|
29
|
+
},
|
|
30
|
+
services: [Capability.Service],
|
|
31
|
+
input: Schema.Struct({
|
|
32
|
+
db: Database.Database,
|
|
33
|
+
template: TriggerTemplate,
|
|
34
|
+
enabled: Schema.optional(Schema.Boolean),
|
|
35
|
+
scriptName: Schema.optional(Schema.String),
|
|
36
|
+
input: Schema.optional(Schema.Record({ key: Schema.String, value: Schema.Any })),
|
|
37
|
+
}),
|
|
38
|
+
output: Schema.Void,
|
|
39
|
+
});
|
package/src/types/index.ts
CHANGED
package/src/types/schema.ts
CHANGED
|
@@ -4,21 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { Database } from '@dxos/echo';
|
|
8
8
|
|
|
9
|
-
import { meta } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
10
10
|
|
|
11
|
-
const TriggerTemplate = Schema.Union(
|
|
11
|
+
export const TriggerTemplate = Schema.Union(
|
|
12
12
|
Schema.Struct({ type: Schema.Literal('timer'), cron: Schema.String }),
|
|
13
|
-
Schema.Struct({ type: Schema.Literal('
|
|
13
|
+
Schema.Struct({ type: Schema.Literal('feed'), feed: Schema.Any }),
|
|
14
14
|
);
|
|
15
15
|
|
|
16
16
|
export namespace AutomationAction {
|
|
17
17
|
export class CreateTriggerFromTemplate extends Schema.TaggedClass<CreateTriggerFromTemplate>()(
|
|
18
|
-
`${meta.id}
|
|
18
|
+
`${meta.id}.action.create-trigger-from-template`,
|
|
19
19
|
{
|
|
20
20
|
input: Schema.Struct({
|
|
21
|
-
|
|
21
|
+
db: Database.Database,
|
|
22
22
|
template: TriggerTemplate,
|
|
23
23
|
enabled: Schema.optional(Schema.Boolean),
|
|
24
24
|
// TODO(wittjosiah): Improve how this lookup is done.
|