@dxos/plugin-automation 0.8.4-main.e8ec1fe → 0.8.4-main.effb148878
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/README.md +1 -1
- package/dist/lib/neutral/AutomationPanel-OS3ZWYJK.mjs +12 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +10 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs +1118 -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-CAFY3J7H.mjs +32 -0
- package/dist/lib/neutral/AutomationSettings-CAFY3J7H.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-V5AM45ZI.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-4QOUKY5L.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-4QOUKY5L.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +15 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2H6X4VQY.mjs +435 -0
- package/dist/lib/neutral/chunk-2H6X4VQY.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-33VXVTV4.mjs +38 -0
- package/dist/lib/neutral/chunk-33VXVTV4.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ARUHHM4Q.mjs +12 -0
- package/dist/lib/neutral/chunk-ARUHHM4Q.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-EBSOLOP6.mjs +8 -0
- package/dist/lib/neutral/chunk-EBSOLOP6.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KV7RZLFS.mjs +344 -0
- package/dist/lib/neutral/chunk-KV7RZLFS.mjs.map +7 -0
- package/dist/lib/neutral/chunk-QLBA6Y46.mjs +39 -0
- package/dist/lib/neutral/chunk-QLBA6Y46.mjs.map +7 -0
- package/dist/lib/neutral/chunk-XC5EPVE3.mjs +76 -0
- package/dist/lib/neutral/chunk-XC5EPVE3.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-IOQZDDSH.mjs +68 -0
- package/dist/lib/neutral/create-trigger-from-template-IOQZDDSH.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-B22CIT3U.mjs +160 -0
- package/dist/lib/neutral/layer-specs-B22CIT3U.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-3OGMAMKV.mjs +57 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.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 +7 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/layer-specs.d.ts +5 -0
- package/dist/types/src/capabilities/layer-specs.d.ts.map +1 -0
- package/dist/types/src/capabilities/node.d.ts +7 -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/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 +5 -6
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -30
- 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 +3 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- 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 +8 -7
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +118 -32
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.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 +5 -4
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -5
- 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 +204 -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 -31
- 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 +145 -70
- package/src/AutomationPlugin.node.ts +32 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +24 -38
- package/src/AutomationPlugin.workerd.ts +18 -0
- package/src/capabilities/app-graph-builder.ts +59 -80
- package/src/capabilities/index.ts +13 -7
- package/src/capabilities/layer-specs.ts +230 -0
- package/src/capabilities/node.ts +17 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +49 -46
- 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 +15 -8
- package/src/components/AutomationPanel/AutomationPanel.tsx +245 -86
- package/src/components/AutomationPanel/TriggerEdgeMetadata.tsx +148 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +43 -42
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +38 -54
- package/src/components/FunctionsRegistry/index.ts +4 -1
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +36 -35
- package/src/components/TriggerEditor/SpecSelector.tsx +26 -20
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +92 -39
- package/src/components/TriggerEditor/TriggerEditor.tsx +171 -54
- 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 +38 -19
- package/src/index.ts +1 -6
- package/src/meta.ts +25 -6
- 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 +12 -9
- package/src/testing.ts +7 -0
- package/src/translations.ts +53 -36
- package/src/types/AutomationOperation.ts +39 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +6 -6
- package/dist/lib/browser/AutomationPanel-7OECLR5N.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs +0 -68
- package/dist/lib/browser/AutomationSettings-KCZISXI6.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs +0 -151
- package/dist/lib/browser/FunctionsContainer-MIWEISRR.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-CRW6SJUN.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs +0 -81
- package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +0 -7
- package/dist/lib/browser/chunk-EPEXQP45.mjs +0 -14
- package/dist/lib/browser/chunk-EPEXQP45.mjs.map +0 -7
- package/dist/lib/browser/chunk-JW7XSPYW.mjs +0 -267
- package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +0 -7
- package/dist/lib/browser/chunk-LZQFZO3B.mjs +0 -17
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +0 -7
- package/dist/lib/browser/chunk-NAPXRXTY.mjs +0 -100
- package/dist/lib/browser/chunk-NAPXRXTY.mjs.map +0 -7
- package/dist/lib/browser/chunk-QKFBHAGN.mjs +0 -184
- package/dist/lib/browser/chunk-QKFBHAGN.mjs.map +0 -7
- package/dist/lib/browser/chunk-TWWFNOIR.mjs +0 -109
- package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +0 -7
- package/dist/lib/browser/chunk-XAKZ4ANY.mjs +0 -15
- package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +0 -7
- package/dist/lib/browser/chunk-YBPJCY3F.mjs +0 -38
- package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs +0 -113
- package/dist/lib/browser/compute-runtime-EIQTHJFZ.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -13
- package/dist/lib/browser/index.mjs +0 -130
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs +0 -77
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-YQW7WCFW.mjs +0 -64
- package/dist/lib/browser/react-surface-YQW7WCFW.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationPanel-HCVFNHGQ.mjs +0 -12
- package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs +0 -69
- package/dist/lib/node-esm/AutomationSettings-UUUPVNUJ.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs +0 -152
- package/dist/lib/node-esm/FunctionsContainer-6OB3JN5O.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-RVVCS6VH.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs +0 -82
- package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6YRKST6M.mjs +0 -185
- package/dist/lib/node-esm/chunk-6YRKST6M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +0 -19
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CPP35BE6.mjs +0 -16
- package/dist/lib/node-esm/chunk-CPP35BE6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs +0 -39
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs +0 -16
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PICJ2REN.mjs +0 -101
- package/dist/lib/node-esm/chunk-PICJ2REN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RVK52XGK.mjs +0 -110
- package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs +0 -268
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-URROOC34.mjs +0 -114
- package/dist/lib/node-esm/compute-runtime-URROOC34.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs +0 -131
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs +0 -65
- package/dist/lib/node-esm/react-surface-NNHYNBO6.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/capabilities.d.ts +0 -20
- 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 -12
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -41
- package/src/capabilities/compute-runtime.ts +0 -127
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -36
- package/src/components/TriggerSettings.tsx +0 -25
- package/src/events.ts +0 -11
- package/src/hooks/useComputeRuntimeCallback.ts +0 -68
- /package/dist/lib/{browser/AutomationPanel-7OECLR5N.mjs.map → neutral/AutomationPanel-OS3ZWYJK.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-CRW6SJUN.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-HCVFNHGQ.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-RVVCS6VH.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
|
@@ -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,51 +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 { Trigger } from '@dxos/
|
|
9
|
-
import {
|
|
10
|
-
import { type
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
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';
|
|
14
15
|
|
|
15
16
|
interface TriggerRuntimeControls {
|
|
16
17
|
triggers: Trigger.Trigger[];
|
|
17
|
-
|
|
18
|
+
|
|
19
|
+
state: TriggerDispatcherState | undefined;
|
|
20
|
+
|
|
18
21
|
start: () => void;
|
|
19
22
|
stop: () => void;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
|
-
export const useTriggerRuntimeControls = (
|
|
23
|
-
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);
|
|
24
32
|
|
|
25
|
-
const
|
|
26
|
-
|
|
33
|
+
const init = useSpaceCallback(
|
|
34
|
+
db?.spaceId,
|
|
35
|
+
[TriggerDispatcher],
|
|
36
|
+
Effect.fnUntraced(function* () {
|
|
37
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
38
|
+
setDispatcher(dispatcher);
|
|
39
|
+
}),
|
|
27
40
|
);
|
|
28
41
|
|
|
29
|
-
|
|
30
|
-
|
|
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],
|
|
31
51
|
Effect.fnUntraced(function* () {
|
|
32
52
|
const dispatcher = yield* TriggerDispatcher;
|
|
33
53
|
yield* dispatcher.start();
|
|
34
|
-
setIsRunningState(true);
|
|
35
54
|
}),
|
|
36
55
|
);
|
|
37
56
|
|
|
38
|
-
const stop =
|
|
39
|
-
|
|
57
|
+
const stop = useSpaceCallback(
|
|
58
|
+
db?.spaceId,
|
|
59
|
+
[TriggerDispatcher],
|
|
40
60
|
Effect.fnUntraced(function* () {
|
|
41
61
|
const dispatcher = yield* TriggerDispatcher;
|
|
42
62
|
yield* dispatcher.stop();
|
|
43
|
-
setIsRunningState(false);
|
|
44
63
|
}),
|
|
45
64
|
);
|
|
46
65
|
|
|
47
66
|
return {
|
|
48
67
|
triggers,
|
|
49
|
-
|
|
68
|
+
state,
|
|
50
69
|
start: () => void start(),
|
|
51
70
|
stop: () => void stop(),
|
|
52
71
|
};
|
package/src/index.ts
CHANGED
|
@@ -2,10 +2,5 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export { AutomationCapabilities } from './capabilities';
|
|
6
|
-
export * from './components';
|
|
7
5
|
export * from './meta';
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './hooks';
|
|
10
|
-
|
|
11
|
-
export * from './AutomationPlugin';
|
|
6
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -2,16 +2,35 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const meta:
|
|
9
|
-
id: 'dxos.
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.automation',
|
|
10
10
|
name: 'Automation',
|
|
11
|
+
author: 'DXOS',
|
|
11
12
|
description: trim`
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
Event-driven workflow automation engine for DXOS Composer.
|
|
14
|
+
Triggers connect ECHO objects, timer schedules, incoming feeds (email, webhook), and data
|
|
15
|
+
subscriptions to persistent compute functions — enabling automated pipelines that react to
|
|
16
|
+
changes in real time without manual intervention.
|
|
17
|
+
|
|
18
|
+
Each trigger references a PersistentOperation (a compiled function derived from a Script or
|
|
19
|
+
a visual ComputeGraph workflow) and carries optional structured input forwarded at invocation.
|
|
20
|
+
A per-space TriggerDispatcher manages execution: running locally in the browser when
|
|
21
|
+
computeEnvironment is "local", or delegating to the DXOS edge for server-side reliability.
|
|
22
|
+
|
|
23
|
+
The AutomationPanel settings surface lets users create, configure, enable, disable, and
|
|
24
|
+
force-run triggers from within any space. The TriggerEditor form supports all spec kinds —
|
|
25
|
+
timer (cron), feed, subscription, email, and webhook — with a query builder for
|
|
26
|
+
subscription-type triggers and a structured input editor for passing data to functions.
|
|
27
|
+
|
|
28
|
+
Operation handlers and blueprints contributed by any plugin in the application are
|
|
29
|
+
automatically merged and made available to every space's OperationRegistry, so new
|
|
30
|
+
capabilities registered by other plugins become instantly invocable from automation triggers.
|
|
14
31
|
`,
|
|
15
|
-
icon: 'ph--
|
|
32
|
+
icon: 'ph--atom--regular',
|
|
16
33
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
|
|
34
|
+
spec: 'PLUGIN.mdl',
|
|
35
|
+
tags: ['system'],
|
|
17
36
|
};
|
|
@@ -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,15 @@
|
|
|
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 } from '@dxos/echo';
|
|
9
9
|
|
|
10
10
|
export const functions = [
|
|
11
11
|
{
|
|
12
|
-
|
|
12
|
+
key: 'com.example.function.chess',
|
|
13
|
+
name: 'com.example.function.chess',
|
|
13
14
|
version: '0.1.0',
|
|
14
|
-
inputSchema:
|
|
15
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
15
16
|
Schema.Struct({
|
|
16
17
|
level: Schema.Number.annotations({
|
|
17
18
|
title: 'Level',
|
|
@@ -20,10 +21,11 @@ export const functions = [
|
|
|
20
21
|
),
|
|
21
22
|
},
|
|
22
23
|
{
|
|
23
|
-
|
|
24
|
+
key: 'com.example.function.forex',
|
|
25
|
+
name: 'com.example.function.forex',
|
|
24
26
|
version: '0.1.0',
|
|
25
27
|
binding: 'FOREX',
|
|
26
|
-
inputSchema:
|
|
28
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
27
29
|
Schema.Struct({
|
|
28
30
|
from: Schema.String.annotations({ title: 'Currency from' }),
|
|
29
31
|
to: Schema.String.annotations({ title: 'Currency to' }),
|
|
@@ -31,11 +33,12 @@ export const functions = [
|
|
|
31
33
|
),
|
|
32
34
|
},
|
|
33
35
|
{
|
|
34
|
-
|
|
36
|
+
key: 'com.example.function.ping-contact',
|
|
37
|
+
name: 'com.example.function.ping-contact',
|
|
35
38
|
version: '0.0.1',
|
|
36
|
-
inputSchema:
|
|
39
|
+
inputSchema: JsonSchema.toJsonSchema(
|
|
37
40
|
Schema.Struct({
|
|
38
|
-
contact:
|
|
41
|
+
contact: Ref.Ref(TestSchema.ContactType).annotations({ title: 'Contact' }),
|
|
39
42
|
}),
|
|
40
43
|
),
|
|
41
44
|
},
|
package/src/testing.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -4,47 +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
|
-
'functions
|
|
27
|
-
'functions
|
|
28
|
-
'
|
|
29
|
-
'
|
|
30
|
-
'
|
|
31
|
-
'delete
|
|
32
|
-
|
|
33
|
-
'
|
|
34
|
-
|
|
35
|
-
'trigger
|
|
36
|
-
'trigger
|
|
37
|
-
|
|
38
|
-
'trigger
|
|
39
|
-
|
|
40
|
-
'trigger
|
|
41
|
-
|
|
42
|
-
'trigger
|
|
43
|
-
'trigger
|
|
44
|
-
|
|
45
|
-
'trigger
|
|
46
|
-
|
|
47
|
-
'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',
|
|
48
65
|
},
|
|
49
66
|
},
|
|
50
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 } from '@dxos/echo';
|
|
12
|
+
// Value-side `EchoURI` import keeps TS declaration emit portable — `TriggerTemplate`
|
|
13
|
+
// references `EchoURI.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 { EchoURI as _EchoURIReference } from '@dxos/keys';
|
|
16
|
+
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
|
|
19
|
+
import { TriggerTemplate } from './schema';
|
|
20
|
+
export { _EchoURIReference };
|
|
21
|
+
|
|
22
|
+
const AUTOMATION_OPERATION = `${meta.id}.operation`;
|
|
23
|
+
|
|
24
|
+
export const CreateTriggerFromTemplate = Operation.make({
|
|
25
|
+
meta: {
|
|
26
|
+
key: `${AUTOMATION_OPERATION}.create-trigger-from-template`,
|
|
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.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationPanel,
|
|
3
|
-
AutomationPanel_default
|
|
4
|
-
} from "./chunk-QKFBHAGN.mjs";
|
|
5
|
-
import "./chunk-JW7XSPYW.mjs";
|
|
6
|
-
import "./chunk-LZQFZO3B.mjs";
|
|
7
|
-
export {
|
|
8
|
-
AutomationPanel,
|
|
9
|
-
AutomationPanel_default as default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=AutomationPanel-7OECLR5N.mjs.map
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useTriggerRuntimeControls
|
|
3
|
-
} from "./chunk-NAPXRXTY.mjs";
|
|
4
|
-
import "./chunk-XAKZ4ANY.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AutomationPanel
|
|
7
|
-
} from "./chunk-QKFBHAGN.mjs";
|
|
8
|
-
import "./chunk-JW7XSPYW.mjs";
|
|
9
|
-
import {
|
|
10
|
-
meta
|
|
11
|
-
} from "./chunk-LZQFZO3B.mjs";
|
|
12
|
-
|
|
13
|
-
// src/components/AutomationSettings.tsx
|
|
14
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
15
|
-
import React2 from "react";
|
|
16
|
-
import { useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
17
|
-
import { ControlPage, ControlSection } from "@dxos/react-ui-form";
|
|
18
|
-
|
|
19
|
-
// src/components/TriggerSettings.tsx
|
|
20
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
21
|
-
import React from "react";
|
|
22
|
-
import { Input, useTranslation } from "@dxos/react-ui";
|
|
23
|
-
import { ControlItemInput } from "@dxos/react-ui-form";
|
|
24
|
-
var TriggersSettings = ({ space }) => {
|
|
25
|
-
var _effect = _useSignals();
|
|
26
|
-
try {
|
|
27
|
-
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
28
|
-
const { t } = useTranslation(meta.id);
|
|
29
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
30
|
-
className: "container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]"
|
|
31
|
-
}, /* @__PURE__ */ React.createElement(ControlItemInput, {
|
|
32
|
-
title: t("runtime label"),
|
|
33
|
-
description: t("runtime description")
|
|
34
|
-
}, /* @__PURE__ */ React.createElement(Input.Switch, {
|
|
35
|
-
classNames: "justify-self-end",
|
|
36
|
-
checked: isRunning,
|
|
37
|
-
onCheckedChange: isRunning ? stop : start
|
|
38
|
-
})));
|
|
39
|
-
} finally {
|
|
40
|
-
_effect.f();
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
// src/components/AutomationSettings.tsx
|
|
45
|
-
var AutomationSettings = (props) => {
|
|
46
|
-
var _effect = _useSignals2();
|
|
47
|
-
try {
|
|
48
|
-
const { t } = useTranslation2(meta.id);
|
|
49
|
-
return /* @__PURE__ */ React2.createElement(ControlPage, null, /* @__PURE__ */ React2.createElement(ControlSection, {
|
|
50
|
-
title: t("automation verbose label", {
|
|
51
|
-
ns: meta.id
|
|
52
|
-
}),
|
|
53
|
-
description: t("automation description", {
|
|
54
|
-
ns: meta.id
|
|
55
|
-
})
|
|
56
|
-
}, /* @__PURE__ */ React2.createElement(AutomationPanel, props), /* @__PURE__ */ React2.createElement(TriggersSettings, {
|
|
57
|
-
space: props.space
|
|
58
|
-
})));
|
|
59
|
-
} finally {
|
|
60
|
-
_effect.f();
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var AutomationSettings_default = AutomationSettings;
|
|
64
|
-
export {
|
|
65
|
-
AutomationSettings,
|
|
66
|
-
AutomationSettings_default as default
|
|
67
|
-
};
|
|
68
|
-
//# sourceMappingURL=AutomationSettings-KCZISXI6.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationSettings.tsx", "../../../src/components/TriggerSettings.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\n\nimport { meta } from '../meta';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\nimport { TriggersSettings } from './TriggerSettings';\n\nexport const AutomationSettings = (props: AutomationPanelProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: meta.id })}\n description={t('automation description', { ns: meta.id })}\n >\n <AutomationPanel {...props} />\n <TriggersSettings space={props.space} />\n </ControlSection>\n </ControlPage>\n );\n};\n\nexport default AutomationSettings;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { Input, useTranslation } from '@dxos/react-ui';\nimport { ControlItemInput } from '@dxos/react-ui-form';\n\nimport { useTriggerRuntimeControls } from '../hooks';\nimport { meta } from '../meta';\n\nexport const TriggersSettings = ({ space }: { space: Space }) => {\n const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);\n const { t } = useTranslation(meta.id);\n\n return (\n <div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>\n <ControlItemInput title={t('runtime label')} description={t('runtime description')}>\n <Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />\n </ControlItemInput>\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,kBAAAA,uBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;;;;ACH5C,OAAOC,WAAW;AAGlB,SAASC,OAAOC,sBAAsB;AACtC,SAASC,wBAAwB;AAK1B,IAAMC,mBAAmB,CAAC,EAAEC,MAAK,MAAoB;;;AAC1D,UAAM,EAAEC,UAAUC,WAAWC,OAAOC,KAAI,IAAKC,0BAA0BL,KAAAA;AACvE,UAAM,EAAEM,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AAEpC,WACE,sBAAA,cAACC,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACC,kBAAAA;MAAiBC,OAAOP,EAAE,eAAA;MAAkBQ,aAAaR,EAAE,qBAAA;OAC1D,sBAAA,cAACS,MAAMC,QAAM;MAACC,YAAW;MAAmBC,SAAShB;MAAWiB,iBAAiBjB,YAAYE,OAAOD;;;;;AAI5G;;;ADVO,IAAMiB,qBAAqB,CAACC,UAAAA;;;AACjC,UAAM,EAAEC,EAAC,IAAKC,gBAAeC,KAAKC,EAAE;AACpC,WACE,gBAAAC,OAAA,cAACC,aAAAA,MACC,gBAAAD,OAAA,cAACE,gBAAAA;MACCC,OAAOP,EAAE,4BAA4B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;MACnDM,aAAaT,EAAE,0BAA0B;QAAEQ,IAAIN,KAAKC;MAAG,CAAA;OAEvD,gBAAAC,OAAA,cAACM,iBAAoBX,KAAAA,GACrB,gBAAAK,OAAA,cAACO,kBAAAA;MAAiBC,OAAOb,MAAMa;;;;;AAIvC;AAEA,IAAA,6BAAed;",
|
|
6
|
-
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "React", "Input", "useTranslation", "ControlItemInput", "TriggersSettings", "space", "triggers", "isRunning", "start", "stop", "useTriggerRuntimeControls", "t", "useTranslation", "meta", "id", "div", "className", "ControlItemInput", "title", "description", "Input", "Switch", "classNames", "checked", "onCheckedChange", "AutomationSettings", "props", "t", "useTranslation", "meta", "id", "React", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel", "TriggersSettings", "space"]
|
|
7
|
-
}
|