@dxos/plugin-automation 0.8.4-main.d05673bc65 → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
- package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
- package/dist/lib/{browser/cli/index.mjs → neutral/AutomationPlugin.node.mjs} +111 -113
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
- package/dist/lib/{browser/chunk-75XLBFAG.mjs → neutral/FunctionsPanel-GLCUBEDT.mjs} +20 -21
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
- package/dist/lib/{node-esm/chunk-6JVB3IHW.mjs → neutral/FunctionsRegistry-VRU4FBVH.mjs} +16 -19
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +13 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-EL64ZPPN.mjs → neutral/chunk-ATECY555.mjs} +6 -3
- package/dist/lib/{browser/chunk-EL64ZPPN.mjs.map → neutral/chunk-ATECY555.mjs.map} +3 -3
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
- package/dist/lib/{browser/chunk-O23LHDEX.mjs → neutral/chunk-FKFFU54G.mjs} +22 -21
- package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/{browser/chunk-BWEKRPFJ.mjs → neutral/chunk-N735CP33.mjs} +24 -33
- package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +16 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +129 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +20 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +47 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/types/src/AutomationPlugin.d.ts +1 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/{cli/plugin.d.ts → AutomationPlugin.node.d.ts} +2 -1
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/{compute-runtime/compute-runtime.d.ts → compute-runtime.d.ts} +9 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +6 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/index.d.ts +6 -6
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/queue.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/index.d.ts +7 -7
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/list.d.ts +1 -1
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/remove.d.ts +1 -1
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/update/index.d.ts +5 -5
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/{cli/commands → commands}/trigger/util.d.ts +2 -2
- package/dist/types/src/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +32 -32
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +6 -6
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +4 -4
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +95 -93
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +3 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/index.d.ts +1 -2
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +2 -4
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +1 -2
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +3 -3
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.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 +78 -76
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +32 -33
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationEvents.d.ts +3 -0
- package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +19 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +7 -28
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +115 -66
- package/src/AutomationPlugin.node.ts +29 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +11 -9
- package/src/capabilities/app-graph-builder.ts +66 -0
- package/src/capabilities/compute-runtime.ts +325 -0
- package/src/capabilities/index.ts +10 -4
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/{react-surface/react-surface.tsx → react-surface.tsx} +17 -15
- package/src/{cli/commands → commands}/trigger/create/queue.ts +4 -7
- package/src/{cli/commands → commands}/trigger/create/subscription.ts +8 -11
- package/src/{cli/commands → commands}/trigger/create/timer.ts +4 -7
- package/src/{cli/commands → commands}/trigger/list.ts +7 -4
- package/src/{cli/commands → commands}/trigger/remove.ts +1 -1
- package/src/{cli/commands → commands}/trigger/update/queue.ts +16 -17
- package/src/{cli/commands → commands}/trigger/update/subscription.ts +15 -15
- package/src/{cli/commands → commands}/trigger/update/timer.ts +16 -16
- package/src/{cli/commands → commands}/trigger/util.ts +13 -7
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +6 -5
- package/src/components/AutomationPanel/AutomationPanel.tsx +51 -43
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +31 -24
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +22 -18
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +4 -4
- package/src/components/TriggerEditor/SpecSelector.tsx +17 -13
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +13 -13
- package/src/components/TriggerEditor/TriggerEditor.tsx +8 -12
- package/src/containers/AutomationSettings/AutomationSettings.tsx +11 -7
- package/src/containers/AutomationSettings/index.ts +1 -3
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +11 -11
- package/src/containers/FunctionsContainer/index.ts +1 -3
- package/src/containers/TriggerSettings/TriggerSettings.tsx +32 -10
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useComputeRuntime.ts +30 -0
- package/src/hooks/useComputeRuntimeCallback.ts +4 -39
- package/src/hooks/useComputeRuntimeService.ts +64 -0
- package/src/hooks/useTriggerRuntimeControls.ts +6 -3
- package/src/index.ts +0 -4
- package/src/meta.ts +2 -1
- package/src/operations/create-trigger-from-template.ts +72 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/testing/test-functions.ts +6 -3
- package/src/translations.ts +38 -39
- package/src/types/AutomationCapabilities.ts +48 -0
- package/src/types/AutomationEvents.ts +11 -0
- package/src/types/AutomationOperation.ts +30 -0
- package/src/types/index.ts +4 -2
- package/src/types/schema.ts +2 -23
- package/dist/lib/browser/AutomationPanel-IGLIQY2N.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs +0 -37
- package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +0 -43
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-NMA4RYJL.mjs +0 -10
- package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +0 -10
- package/dist/lib/browser/TriggerSettings-56AIMOEC.mjs +0 -11
- package/dist/lib/browser/app-graph-builder-74ILZP25.mjs +0 -83
- package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +0 -7
- package/dist/lib/browser/chunk-75XLBFAG.mjs.map +0 -7
- package/dist/lib/browser/chunk-BWEKRPFJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-FUVAC5EC.mjs +0 -96
- package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +0 -7
- package/dist/lib/browser/chunk-GVHAETEQ.mjs +0 -83
- package/dist/lib/browser/chunk-GVHAETEQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-H2MV4XE6.mjs +0 -31
- package/dist/lib/browser/chunk-H2MV4XE6.mjs.map +0 -7
- package/dist/lib/browser/chunk-O23LHDEX.mjs.map +0 -7
- package/dist/lib/browser/chunk-OAZ2JYXV.mjs +0 -93
- package/dist/lib/browser/chunk-OAZ2JYXV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z7F7X2C5.mjs +0 -8
- package/dist/lib/browser/chunk-Z7F7X2C5.mjs.map +0 -7
- package/dist/lib/browser/cli/index.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs +0 -124
- package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs.map +0 -7
- package/dist/lib/browser/hooks/index.mjs +0 -13
- package/dist/lib/browser/index.mjs +0 -123
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs +0 -84
- package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs.map +0 -7
- package/dist/lib/browser/react-surface-5MFPVWIN.mjs +0 -65
- package/dist/lib/browser/react-surface-5MFPVWIN.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs +0 -12
- package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs +0 -38
- package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +0 -44
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs +0 -11
- package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +0 -11
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs.map +0 -7
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs +0 -12
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs +0 -84
- package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2UF55HSG.mjs +0 -94
- package/dist/lib/node-esm/chunk-2UF55HSG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6B4WZRVH.mjs +0 -84
- package/dist/lib/node-esm/chunk-6B4WZRVH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FPXVLTEY.mjs +0 -270
- package/dist/lib/node-esm/chunk-FPXVLTEY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs +0 -32
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K7T2MVB7.mjs +0 -98
- package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs +0 -295
- package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-R5YEWJCG.mjs +0 -10
- package/dist/lib/node-esm/chunk-R5YEWJCG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WC5AT7B3.mjs +0 -19
- package/dist/lib/node-esm/chunk-WC5AT7B3.mjs.map +0 -7
- package/dist/lib/node-esm/cli/index.mjs +0 -1116
- package/dist/lib/node-esm/cli/index.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs +0 -125
- package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -14
- package/dist/lib/node-esm/index.mjs +0 -124
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs +0 -85
- package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-Z74AHU4T.mjs +0 -66
- package/dist/lib/node-esm/react-surface-Z74AHU4T.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/cli/commands/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/options.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +0 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +0 -1
- package/dist/types/src/cli/index.d.ts +0 -2
- package/dist/types/src/cli/index.d.ts.map +0 -1
- package/dist/types/src/cli/plugin.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -22
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/events.d.ts +0 -5
- package/dist/types/src/types/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -73
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/compute-runtime/compute-runtime.ts +0 -146
- package/src/capabilities/compute-runtime/index.ts +0 -7
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -80
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/cli/index.ts +0 -5
- package/src/cli/plugin.ts +0 -24
- package/src/types/capabilities.ts +0 -43
- package/src/types/events.ts +0 -11
- /package/dist/lib/{browser/AutomationPanel-IGLIQY2N.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-NMA4RYJL.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsRegistry-TMKAEG5E.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/hooks → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{browser/TriggerSettings-56AIMOEC.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/hooks → neutral/operations}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm → neutral}/types/index.mjs.map +0 -0
- /package/dist/types/src/capabilities/{app-graph-builder/app-graph-builder.d.ts → app-graph-builder.d.ts} +0 -0
- /package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- /package/dist/types/src/{cli/commands → commands}/index.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/options.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/queue.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/subscription.d.ts +0 -0
- /package/dist/types/src/{cli/commands → commands}/trigger/update/timer.d.ts +0 -0
- /package/src/{cli/commands → commands}/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/create/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/index.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/options.ts +0 -0
- /package/src/{cli/commands → commands}/trigger/update/index.ts +0 -0
|
@@ -12,8 +12,8 @@ import * as Option from 'effect/Option';
|
|
|
12
12
|
import { CommandConfig } from '@dxos/cli-util';
|
|
13
13
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
14
14
|
import { Common } from '@dxos/cli-util';
|
|
15
|
+
import { Operation, Trigger } from '@dxos/compute';
|
|
15
16
|
import { DXN, Database, Filter, JsonSchema, Obj, Ref } from '@dxos/echo';
|
|
16
|
-
import { Function, Trigger } from '@dxos/functions';
|
|
17
17
|
|
|
18
18
|
import { Enabled, Input, Queue, TriggerId } from '../options';
|
|
19
19
|
import { printTrigger, promptForSchemaInput, selectFunction, selectQueue, selectTrigger } from '../util';
|
|
@@ -31,7 +31,6 @@ export const queue = Command.make(
|
|
|
31
31
|
(options) =>
|
|
32
32
|
Effect.gen(function* () {
|
|
33
33
|
const { json } = yield* CommandConfig;
|
|
34
|
-
|
|
35
34
|
const triggerId = yield* Option.match(options.id, {
|
|
36
35
|
onNone: () => selectTrigger('queue'),
|
|
37
36
|
onSome: (id) => Effect.succeed(id),
|
|
@@ -58,7 +57,7 @@ export const queue = Command.make(
|
|
|
58
57
|
).pipe(
|
|
59
58
|
Command.withDescription('Update a queue trigger.'),
|
|
60
59
|
Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
|
|
61
|
-
Command.provideEffectDiscard(() => withTypes(
|
|
60
|
+
Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
|
|
62
61
|
);
|
|
63
62
|
|
|
64
63
|
/**
|
|
@@ -67,10 +66,10 @@ export const queue = Command.make(
|
|
|
67
66
|
* @returns The current function (either original or newly assigned)
|
|
68
67
|
*/
|
|
69
68
|
const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionIdOption: Option.Option<string>) {
|
|
70
|
-
let currentFn:
|
|
69
|
+
let currentFn: Operation.PersistentOperation | undefined = trigger.function
|
|
71
70
|
? yield* Database.load(trigger.function) as any
|
|
72
71
|
: undefined;
|
|
73
|
-
if (currentFn && !Obj.instanceOf(
|
|
72
|
+
if (currentFn && !Obj.instanceOf(Operation.PersistentOperation, currentFn)) {
|
|
74
73
|
currentFn = undefined;
|
|
75
74
|
}
|
|
76
75
|
const currentFunctionName = currentFn ? (currentFn.name ?? currentFn.id) : undefined;
|
|
@@ -87,13 +86,13 @@ const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionId
|
|
|
87
86
|
onNone: () => selectFunction(),
|
|
88
87
|
onSome: (id) => Effect.succeed(id),
|
|
89
88
|
});
|
|
90
|
-
const functions = yield* Database.runQuery(Filter.type(
|
|
89
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
91
90
|
const foundFn = functions.find((fn) => fn.id === functionId);
|
|
92
|
-
if (!foundFn || !Obj.instanceOf(
|
|
91
|
+
if (!foundFn || !Obj.instanceOf(Operation.PersistentOperation, foundFn)) {
|
|
93
92
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
94
93
|
}
|
|
95
|
-
Obj.
|
|
96
|
-
|
|
94
|
+
Obj.update(trigger, (trigger) => {
|
|
95
|
+
trigger.function = Ref.make(foundFn);
|
|
97
96
|
});
|
|
98
97
|
currentFn = foundFn;
|
|
99
98
|
}
|
|
@@ -130,9 +129,9 @@ const updateQueue = Effect.fn(function* (trigger: Trigger.Trigger, queueOption:
|
|
|
130
129
|
onNone: () => selectQueue(),
|
|
131
130
|
onSome: (dxn) => Effect.succeed(dxn.toString()),
|
|
132
131
|
});
|
|
133
|
-
Obj.
|
|
134
|
-
if (
|
|
135
|
-
|
|
132
|
+
Obj.update(trigger, (trigger) => {
|
|
133
|
+
if (trigger.spec?.kind === 'queue') {
|
|
134
|
+
trigger.spec.queue = queueDxn;
|
|
136
135
|
}
|
|
137
136
|
});
|
|
138
137
|
}
|
|
@@ -144,7 +143,7 @@ const updateQueue = Effect.fn(function* (trigger: Trigger.Trigger, queueOption:
|
|
|
144
143
|
*/
|
|
145
144
|
const updateInput = Effect.fn(function* (
|
|
146
145
|
trigger: Trigger.Trigger,
|
|
147
|
-
fn:
|
|
146
|
+
fn: Operation.PersistentOperation,
|
|
148
147
|
inputOption: Option.Option<Record<string, any>>,
|
|
149
148
|
) {
|
|
150
149
|
const currentInput = trigger.input as Record<string, any> | undefined;
|
|
@@ -166,8 +165,8 @@ const updateInput = Effect.fn(function* (
|
|
|
166
165
|
promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined, currentInput),
|
|
167
166
|
onSome: (value) => Effect.succeed(value as Record<string, any>),
|
|
168
167
|
});
|
|
169
|
-
Obj.
|
|
170
|
-
|
|
168
|
+
Obj.update(trigger, (trigger) => {
|
|
169
|
+
trigger.input = inputObj;
|
|
171
170
|
});
|
|
172
171
|
}
|
|
173
172
|
});
|
|
@@ -189,7 +188,7 @@ const updateEnabled = Effect.fn(function* (
|
|
|
189
188
|
}).pipe(Prompt.run),
|
|
190
189
|
onSome: () => Effect.succeed(enabled),
|
|
191
190
|
});
|
|
192
|
-
Obj.
|
|
193
|
-
|
|
191
|
+
Obj.update(trigger, (trigger) => {
|
|
192
|
+
trigger.enabled = enabledValue;
|
|
194
193
|
});
|
|
195
194
|
});
|
|
@@ -13,8 +13,8 @@ import * as Option from 'effect/Option';
|
|
|
13
13
|
import { CommandConfig } from '@dxos/cli-util';
|
|
14
14
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
15
15
|
import { Common } from '@dxos/cli-util';
|
|
16
|
+
import { Operation, Trigger } from '@dxos/compute';
|
|
16
17
|
import { DXN, Database, Filter, JsonSchema, Obj, Query, Ref } from '@dxos/echo';
|
|
17
|
-
import { Function, Trigger } from '@dxos/functions';
|
|
18
18
|
|
|
19
19
|
import { Deep, Delay, Enabled, Input, TriggerId, Typename } from '../options';
|
|
20
20
|
import { printTrigger, promptForSchemaInput, selectFunction, selectTrigger } from '../util';
|
|
@@ -61,7 +61,7 @@ export const subscription = Command.make(
|
|
|
61
61
|
).pipe(
|
|
62
62
|
Command.withDescription('Update a subscription trigger.'),
|
|
63
63
|
Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
|
|
64
|
-
Command.provideEffectDiscard(() => withTypes(
|
|
64
|
+
Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
|
|
65
65
|
);
|
|
66
66
|
|
|
67
67
|
/**
|
|
@@ -95,10 +95,10 @@ const extractCurrentTypename = (spec: Trigger.SubscriptionSpec | undefined): Opt
|
|
|
95
95
|
* @returns The current function (either original or newly assigned)
|
|
96
96
|
*/
|
|
97
97
|
const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionIdOption: Option.Option<string>) {
|
|
98
|
-
let currentFn:
|
|
98
|
+
let currentFn: Operation.PersistentOperation | undefined = trigger.function
|
|
99
99
|
? yield* Database.load(trigger.function) as any
|
|
100
100
|
: undefined;
|
|
101
|
-
if (currentFn && !Obj.instanceOf(
|
|
101
|
+
if (currentFn && !Obj.instanceOf(Operation.PersistentOperation, currentFn)) {
|
|
102
102
|
currentFn = undefined;
|
|
103
103
|
}
|
|
104
104
|
const currentFunctionName = currentFn ? (currentFn.name ?? currentFn.id) : undefined;
|
|
@@ -115,13 +115,13 @@ const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionId
|
|
|
115
115
|
onNone: () => selectFunction(),
|
|
116
116
|
onSome: (id) => Effect.succeed(id),
|
|
117
117
|
});
|
|
118
|
-
const functions = yield* Database.runQuery(Filter.type(
|
|
118
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
119
119
|
const foundFn = functions.find((fn) => fn.id === functionId);
|
|
120
|
-
if (!foundFn || !Obj.instanceOf(
|
|
120
|
+
if (!foundFn || !Obj.instanceOf(Operation.PersistentOperation, foundFn)) {
|
|
121
121
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
122
122
|
}
|
|
123
|
-
Obj.
|
|
124
|
-
|
|
123
|
+
Obj.update(trigger, (trigger) => {
|
|
124
|
+
trigger.function = Ref.make(foundFn);
|
|
125
125
|
});
|
|
126
126
|
currentFn = foundFn;
|
|
127
127
|
}
|
|
@@ -210,8 +210,8 @@ const updateSpec = Effect.fn(function* (
|
|
|
210
210
|
subscriptionOptions.delay = delayOptionValue.value;
|
|
211
211
|
}
|
|
212
212
|
|
|
213
|
-
Obj.
|
|
214
|
-
const spec =
|
|
213
|
+
Obj.update(trigger, (trigger) => {
|
|
214
|
+
const spec = trigger.spec;
|
|
215
215
|
if (spec?.kind === 'subscription') {
|
|
216
216
|
// Cast needed because QueryAST types are deeply readonly but spec.query expects mutable.
|
|
217
217
|
spec.query = { ast: queryAst } as NonNullable<typeof spec.query>;
|
|
@@ -227,7 +227,7 @@ const updateSpec = Effect.fn(function* (
|
|
|
227
227
|
*/
|
|
228
228
|
const updateInput = Effect.fn(function* (
|
|
229
229
|
trigger: Trigger.Trigger,
|
|
230
|
-
fn:
|
|
230
|
+
fn: Operation.PersistentOperation,
|
|
231
231
|
inputOption: Option.Option<Record<string, any>>,
|
|
232
232
|
) {
|
|
233
233
|
const currentInput = trigger.input as Record<string, any> | undefined;
|
|
@@ -249,8 +249,8 @@ const updateInput = Effect.fn(function* (
|
|
|
249
249
|
promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined, currentInput),
|
|
250
250
|
onSome: (value) => Effect.succeed(value as Record<string, any>),
|
|
251
251
|
});
|
|
252
|
-
Obj.
|
|
253
|
-
|
|
252
|
+
Obj.update(trigger, (trigger) => {
|
|
253
|
+
trigger.input = inputObj;
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
256
|
});
|
|
@@ -272,7 +272,7 @@ const updateEnabled = Effect.fn(function* (
|
|
|
272
272
|
}).pipe(Prompt.run),
|
|
273
273
|
onSome: () => Effect.succeed(enabled),
|
|
274
274
|
});
|
|
275
|
-
Obj.
|
|
276
|
-
|
|
275
|
+
Obj.update(trigger, (trigger) => {
|
|
276
|
+
trigger.enabled = enabledValue;
|
|
277
277
|
});
|
|
278
278
|
});
|
|
@@ -12,8 +12,8 @@ import * as Option from 'effect/Option';
|
|
|
12
12
|
import { CommandConfig } from '@dxos/cli-util';
|
|
13
13
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
14
14
|
import { Common } from '@dxos/cli-util';
|
|
15
|
+
import { Operation, Trigger } from '@dxos/compute';
|
|
15
16
|
import { DXN, Database, Filter, JsonSchema, Obj, Ref } from '@dxos/echo';
|
|
16
|
-
import { Function, Trigger } from '@dxos/functions';
|
|
17
17
|
|
|
18
18
|
import { Cron, Enabled, Input, TriggerId } from '../options';
|
|
19
19
|
import { printTrigger, promptForSchemaInput, selectFunction, selectTrigger } from '../util';
|
|
@@ -58,7 +58,7 @@ export const timer = Command.make(
|
|
|
58
58
|
).pipe(
|
|
59
59
|
Command.withDescription('Update a timer trigger.'),
|
|
60
60
|
Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
|
|
61
|
-
Command.provideEffectDiscard(() => withTypes(
|
|
61
|
+
Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
|
|
62
62
|
);
|
|
63
63
|
|
|
64
64
|
/**
|
|
@@ -67,10 +67,10 @@ export const timer = Command.make(
|
|
|
67
67
|
* @returns The current function (either original or newly assigned)
|
|
68
68
|
*/
|
|
69
69
|
const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionIdOption: Option.Option<string>) {
|
|
70
|
-
let currentFn:
|
|
70
|
+
let currentFn: Operation.PersistentOperation | undefined = trigger.function
|
|
71
71
|
? yield* Database.load(trigger.function) as any
|
|
72
72
|
: undefined;
|
|
73
|
-
if (currentFn && !Obj.instanceOf(
|
|
73
|
+
if (currentFn && !Obj.instanceOf(Operation.PersistentOperation, currentFn)) {
|
|
74
74
|
currentFn = undefined;
|
|
75
75
|
}
|
|
76
76
|
const currentFunctionName = currentFn ? (currentFn.name ?? currentFn.id) : undefined;
|
|
@@ -87,13 +87,13 @@ const updateFunction = Effect.fn(function* (trigger: Trigger.Trigger, functionId
|
|
|
87
87
|
onNone: () => selectFunction(),
|
|
88
88
|
onSome: (id) => Effect.succeed(id),
|
|
89
89
|
});
|
|
90
|
-
const functions = yield* Database.runQuery(Filter.type(
|
|
90
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
91
91
|
const foundFn = functions.find((fn) => fn.id === functionId);
|
|
92
|
-
if (!foundFn || !Obj.instanceOf(
|
|
92
|
+
if (!foundFn || !Obj.instanceOf(Operation.PersistentOperation, foundFn)) {
|
|
93
93
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
94
94
|
}
|
|
95
|
-
Obj.
|
|
96
|
-
|
|
95
|
+
Obj.update(trigger, (trigger) => {
|
|
96
|
+
trigger.function = Ref.make(foundFn);
|
|
97
97
|
});
|
|
98
98
|
currentFn = foundFn;
|
|
99
99
|
}
|
|
@@ -128,9 +128,9 @@ const updateCron = Effect.fn(function* (trigger: Trigger.Trigger, cronOption: Op
|
|
|
128
128
|
}).pipe(Prompt.run),
|
|
129
129
|
onSome: (value) => Effect.succeed(value),
|
|
130
130
|
});
|
|
131
|
-
Obj.
|
|
132
|
-
if (
|
|
133
|
-
|
|
131
|
+
Obj.update(trigger, (trigger) => {
|
|
132
|
+
if (trigger.spec?.kind === 'timer') {
|
|
133
|
+
trigger.spec.cron = cron;
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
136
|
}
|
|
@@ -142,7 +142,7 @@ const updateCron = Effect.fn(function* (trigger: Trigger.Trigger, cronOption: Op
|
|
|
142
142
|
*/
|
|
143
143
|
const updateInput = Effect.fn(function* (
|
|
144
144
|
trigger: Trigger.Trigger,
|
|
145
|
-
fn:
|
|
145
|
+
fn: Operation.PersistentOperation,
|
|
146
146
|
inputOption: Option.Option<Record<string, any>>,
|
|
147
147
|
) {
|
|
148
148
|
const currentInput = trigger.input as Record<string, any> | undefined;
|
|
@@ -164,8 +164,8 @@ const updateInput = Effect.fn(function* (
|
|
|
164
164
|
promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined, currentInput),
|
|
165
165
|
onSome: (value) => Effect.succeed(value as Record<string, any>),
|
|
166
166
|
});
|
|
167
|
-
Obj.
|
|
168
|
-
|
|
167
|
+
Obj.update(trigger, (trigger) => {
|
|
168
|
+
trigger.input = inputObj;
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
});
|
|
@@ -187,7 +187,7 @@ const updateEnabled = Effect.fn(function* (
|
|
|
187
187
|
}).pipe(Prompt.run),
|
|
188
188
|
onSome: () => Effect.succeed(enabled),
|
|
189
189
|
});
|
|
190
|
-
Obj.
|
|
191
|
-
|
|
190
|
+
Obj.update(trigger, (trigger) => {
|
|
191
|
+
trigger.enabled = enabledValue;
|
|
192
192
|
});
|
|
193
193
|
});
|
|
@@ -12,9 +12,9 @@ import type * as Schema from 'effect/Schema';
|
|
|
12
12
|
import * as SchemaAST from 'effect/SchemaAST';
|
|
13
13
|
|
|
14
14
|
import { FormBuilder } from '@dxos/cli-util';
|
|
15
|
-
import {
|
|
15
|
+
import { Operation, Trigger } from '@dxos/compute';
|
|
16
|
+
import { Annotation, Database, Entity, Feed, Filter, Obj, Query, Ref, Type } from '@dxos/echo';
|
|
16
17
|
import { getProperties } from '@dxos/effect';
|
|
17
|
-
import { Function, Trigger } from '@dxos/functions';
|
|
18
18
|
import { FeedAnnotation } from '@dxos/schema';
|
|
19
19
|
|
|
20
20
|
export type TriggerRemoteStatus = 'available' | 'not available' | 'n/a';
|
|
@@ -60,7 +60,10 @@ export const printTrigger = Effect.fn(function* (trigger: Trigger.Trigger, remot
|
|
|
60
60
|
fn,
|
|
61
61
|
FormBuilder.nest(
|
|
62
62
|
'function',
|
|
63
|
-
FormBuilder.make().pipe(
|
|
63
|
+
FormBuilder.make().pipe(
|
|
64
|
+
FormBuilder.set('key', (fn as Operation.PersistentOperation).key),
|
|
65
|
+
FormBuilder.set('dxn', Obj.getDXN(fn as Obj.Unknown).toString()),
|
|
66
|
+
),
|
|
64
67
|
),
|
|
65
68
|
),
|
|
66
69
|
FormBuilder.nestedOption('spec', Option.fromNullable(trigger.spec).pipe(Option.map(printSpec))),
|
|
@@ -272,7 +275,7 @@ export const promptForSchemaInput = Effect.fn(function* (
|
|
|
272
275
|
* Queries the database for functions and prompts the user to select one.
|
|
273
276
|
*/
|
|
274
277
|
export const selectFunction = Effect.fn(function* () {
|
|
275
|
-
const functions = yield* Database.runQuery(Filter.type(
|
|
278
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
276
279
|
|
|
277
280
|
if (functions.length === 0) {
|
|
278
281
|
return yield* Effect.fail(new Error('No functions available'));
|
|
@@ -280,7 +283,7 @@ export const selectFunction = Effect.fn(function* () {
|
|
|
280
283
|
|
|
281
284
|
const selected = yield* Prompt.select({
|
|
282
285
|
message: 'Select a function:',
|
|
283
|
-
choices: functions.map((fn:
|
|
286
|
+
choices: functions.map((fn: Operation.PersistentOperation) => ({
|
|
284
287
|
title: fn.name ?? fn.id,
|
|
285
288
|
value: fn.id,
|
|
286
289
|
description: fn.description,
|
|
@@ -296,7 +299,9 @@ export const selectFunction = Effect.fn(function* () {
|
|
|
296
299
|
* Queries the database for triggers and prompts the user to select one.
|
|
297
300
|
*/
|
|
298
301
|
export const selectTrigger = Effect.fn(function* (kind?: Trigger.Kind) {
|
|
299
|
-
const triggers = yield* Database.runQuery(
|
|
302
|
+
const triggers = yield* Database.runQuery(
|
|
303
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('cli.trigger.selectTrigger'),
|
|
304
|
+
);
|
|
300
305
|
const filteredTriggers = kind ? triggers.filter((trigger) => trigger.spec?.kind === kind) : triggers;
|
|
301
306
|
|
|
302
307
|
if (filteredTriggers.length === 0) {
|
|
@@ -307,7 +312,8 @@ export const selectTrigger = Effect.fn(function* (kind?: Trigger.Kind) {
|
|
|
307
312
|
filteredTriggers.map((trigger) =>
|
|
308
313
|
Effect.gen(function* () {
|
|
309
314
|
const fn = trigger.function ? yield* Database.load(trigger.function) : undefined;
|
|
310
|
-
const functionName =
|
|
315
|
+
const functionName =
|
|
316
|
+
fn && Obj.instanceOf(Operation.PersistentOperation, fn) ? (fn.name ?? fn.key ?? fn.id) : undefined;
|
|
311
317
|
const title = functionName ?? trigger.id;
|
|
312
318
|
const description = `${trigger.enabled ? 'enabled' : 'disabled'} - ${trigger.spec?.kind ?? 'unknown'}`;
|
|
313
319
|
|
|
@@ -5,13 +5,14 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Operation, Trigger } from '@dxos/compute';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
10
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
11
12
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
12
13
|
|
|
13
|
-
import { functions } from '
|
|
14
|
-
import { translations } from '
|
|
14
|
+
import { functions } from '#testing';
|
|
15
|
+
import { translations } from '#translations';
|
|
15
16
|
|
|
16
17
|
import { AutomationPanel } from './AutomationPanel';
|
|
17
18
|
|
|
@@ -35,10 +36,10 @@ const meta = {
|
|
|
35
36
|
withClientProvider({
|
|
36
37
|
createIdentity: true,
|
|
37
38
|
createSpace: true,
|
|
38
|
-
types: [
|
|
39
|
+
types: [Operation.PersistentOperation, Trigger.Trigger],
|
|
39
40
|
onCreateSpace: ({ space }) => {
|
|
40
41
|
for (const fn of functions) {
|
|
41
|
-
space.db.add(
|
|
42
|
+
space.db.add(Obj.make(Operation.PersistentOperation, { ...fn, version: fn.version ?? '0.1.0' }));
|
|
42
43
|
}
|
|
43
44
|
},
|
|
44
45
|
}),
|
|
@@ -8,11 +8,13 @@ import * as Match from 'effect/Match';
|
|
|
8
8
|
import * as Schema from 'effect/Schema';
|
|
9
9
|
import React, { useCallback, useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { useTypeOptions } from '@dxos/app-toolkit/ui';
|
|
12
|
+
import { Script, Trigger } from '@dxos/compute';
|
|
13
|
+
import { Operation } from '@dxos/compute';
|
|
14
|
+
import { Context } from '@dxos/context';
|
|
15
|
+
import { Filter, Obj, Query, Tag } from '@dxos/echo';
|
|
13
16
|
import { KEY_QUEUE_CURSOR } from '@dxos/functions-runtime';
|
|
14
17
|
import { FunctionsServiceClient } from '@dxos/functions-runtime/edge';
|
|
15
|
-
import { useTypeOptions } from '@dxos/plugin-space';
|
|
16
18
|
import { type Client, useClient } from '@dxos/react-client';
|
|
17
19
|
import { type Space, useObject, useQuery } from '@dxos/react-client/echo';
|
|
18
20
|
import { Clipboard, IconButton, type IconButtonProps, Input, Separator, useTranslation } from '@dxos/react-ui';
|
|
@@ -22,7 +24,8 @@ import { Pipeline } from '@dxos/types';
|
|
|
22
24
|
import { ghostHover, mx } from '@dxos/ui-theme';
|
|
23
25
|
import { isNonNullable } from '@dxos/util';
|
|
24
26
|
|
|
25
|
-
import { meta } from '
|
|
27
|
+
import { meta } from '#meta';
|
|
28
|
+
|
|
26
29
|
import { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';
|
|
27
30
|
|
|
28
31
|
const grid = 'grid grid-cols-[40px_1fr_32px_32px] min-h-[2.5rem]';
|
|
@@ -39,8 +42,11 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
39
42
|
const { t } = useTranslation(meta.id);
|
|
40
43
|
const client = useClient();
|
|
41
44
|
const functionsServiceClient = useMemo(() => FunctionsServiceClient.fromClient(client), [client]);
|
|
42
|
-
const functions = useQuery(space.db, Filter.type(
|
|
43
|
-
const triggers = useQuery(
|
|
45
|
+
const functions = useQuery(space.db, Filter.type(Operation.PersistentOperation));
|
|
46
|
+
const triggers = useQuery(
|
|
47
|
+
space.db,
|
|
48
|
+
Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.AutomationPanel'),
|
|
49
|
+
);
|
|
44
50
|
const filteredTriggers = useMemo(() => {
|
|
45
51
|
return object ? triggers.filter(triggerMatch(object)) : triggers;
|
|
46
52
|
}, [object, triggers]);
|
|
@@ -74,8 +80,8 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
74
80
|
|
|
75
81
|
const handleSave: TriggerEditorProps['onSave'] = (trigger) => {
|
|
76
82
|
if (selected) {
|
|
77
|
-
Obj.
|
|
78
|
-
Object.assign(
|
|
83
|
+
Obj.update(selected, (selected) => {
|
|
84
|
+
Object.assign(selected, trigger);
|
|
79
85
|
});
|
|
80
86
|
} else {
|
|
81
87
|
space.db.add(Trigger.make(trigger));
|
|
@@ -92,19 +98,19 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
92
98
|
};
|
|
93
99
|
|
|
94
100
|
const handleForceRunTrigger = async (trigger: Trigger.Trigger) => {
|
|
95
|
-
await functionsServiceClient.forceRunCronTrigger(space.id, trigger.id);
|
|
101
|
+
await functionsServiceClient.forceRunCronTrigger(Context.default(), space.id, trigger.id);
|
|
96
102
|
};
|
|
97
103
|
|
|
98
104
|
const handleResetCursor = async (trigger: Trigger.Trigger) => {
|
|
99
|
-
Obj.
|
|
100
|
-
Obj.deleteKeys(
|
|
105
|
+
Obj.update(trigger, (trigger) => {
|
|
106
|
+
Obj.deleteKeys(trigger, KEY_QUEUE_CURSOR);
|
|
101
107
|
});
|
|
102
108
|
await space.db.flush({ indexes: true });
|
|
103
109
|
};
|
|
104
110
|
|
|
105
111
|
if (trigger) {
|
|
106
112
|
return (
|
|
107
|
-
<Settings.Item title={t('trigger
|
|
113
|
+
<Settings.Item title={t('trigger-editor.title')} description={t('trigger-editor.description')}>
|
|
108
114
|
<TriggerEditor
|
|
109
115
|
db={space.db}
|
|
110
116
|
trigger={trigger}
|
|
@@ -119,34 +125,36 @@ export const AutomationPanel = ({ space, object, initialTrigger, onDone }: Autom
|
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
return (
|
|
122
|
-
<Settings.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
128
|
+
<Settings.Panel>
|
|
129
|
+
<Clipboard.Provider>
|
|
130
|
+
{filteredTriggers.length > 0 && (
|
|
131
|
+
<List.Root<Trigger.Trigger>
|
|
132
|
+
items={filteredTriggers}
|
|
133
|
+
isItem={Schema.is(Trigger.Trigger)}
|
|
134
|
+
getId={(field) => field.id}
|
|
135
|
+
>
|
|
136
|
+
{({ items: filteredTriggers }) => (
|
|
137
|
+
<div role='list' className='flex flex-col w-full'>
|
|
138
|
+
{filteredTriggers?.map((trigger) => (
|
|
139
|
+
<TriggerListItem
|
|
140
|
+
key={trigger.id}
|
|
141
|
+
trigger={trigger}
|
|
142
|
+
functions={functions}
|
|
143
|
+
onSelect={handleSelect}
|
|
144
|
+
onDelete={handleDelete}
|
|
145
|
+
onResetCursor={handleResetCursor}
|
|
146
|
+
onForceRun={handleForceRunTrigger}
|
|
147
|
+
/>
|
|
148
|
+
))}
|
|
149
|
+
</div>
|
|
150
|
+
)}
|
|
151
|
+
</List.Root>
|
|
152
|
+
)}
|
|
153
|
+
|
|
154
|
+
{filteredTriggers.length > 0 && <Separator classNames='my-4' />}
|
|
155
|
+
<IconButton icon='ph--plus--regular' label={t('new-trigger.label')} onClick={handleAdd} />
|
|
156
|
+
</Clipboard.Provider>
|
|
157
|
+
</Settings.Panel>
|
|
150
158
|
);
|
|
151
159
|
};
|
|
152
160
|
|
|
@@ -159,7 +167,7 @@ const TriggerListItem = ({
|
|
|
159
167
|
onForceRun,
|
|
160
168
|
}: {
|
|
161
169
|
trigger: Trigger.Trigger;
|
|
162
|
-
functions:
|
|
170
|
+
functions: Operation.PersistentOperation[];
|
|
163
171
|
onSelect?: (trigger: Trigger.Trigger) => void;
|
|
164
172
|
onDelete?: (trigger: Trigger.Trigger) => void;
|
|
165
173
|
onResetCursor?: (trigger: Trigger.Trigger) => void;
|
|
@@ -268,7 +276,7 @@ const getWebhookUrl = (client: Client, trigger: Trigger.Trigger) => {
|
|
|
268
276
|
return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
|
|
269
277
|
};
|
|
270
278
|
|
|
271
|
-
const getFunctionName = (functions:
|
|
279
|
+
const getFunctionName = (functions: Operation.PersistentOperation[], trigger: Trigger.Trigger) => {
|
|
272
280
|
// TODO(wittjosiah): Truncation should be done in the UI.
|
|
273
281
|
// Warning that the List component is currently a can of worms.
|
|
274
282
|
const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;
|
|
@@ -278,7 +286,7 @@ const getFunctionName = (functions: Function.Function[], trigger: Trigger.Trigge
|
|
|
278
286
|
|
|
279
287
|
const scriptMatch = (script: Script.Script) => (trigger: Trigger.Trigger) => {
|
|
280
288
|
const fn = trigger.function?.target;
|
|
281
|
-
if (!Obj.instanceOf(
|
|
289
|
+
if (!Obj.instanceOf(Operation.PersistentOperation, fn)) {
|
|
282
290
|
return false;
|
|
283
291
|
}
|
|
284
292
|
|
|
@@ -7,16 +7,15 @@ import React, { useCallback, useMemo } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { useOperationInvoker } from '@dxos/app-framework/ui';
|
|
9
9
|
import { LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { SpaceOperation } from '@dxos/plugin-space/types';
|
|
10
|
+
import { Operation, Script } from '@dxos/compute';
|
|
11
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
13
12
|
import { Filter, type Space, useQuery } from '@dxos/react-client/echo';
|
|
14
|
-
import {
|
|
13
|
+
import { IconButton, useTranslation } from '@dxos/react-ui';
|
|
15
14
|
import { Settings } from '@dxos/react-ui-form';
|
|
16
15
|
import { List } from '@dxos/react-ui-list';
|
|
17
16
|
import { ghostHover, mx } from '@dxos/ui-theme';
|
|
18
17
|
|
|
19
|
-
import { meta } from '
|
|
18
|
+
import { meta } from '#meta';
|
|
20
19
|
|
|
21
20
|
export type FunctionsPanelProps = {
|
|
22
21
|
space: Space;
|
|
@@ -24,7 +23,7 @@ export type FunctionsPanelProps = {
|
|
|
24
23
|
|
|
25
24
|
export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
26
25
|
const { t } = useTranslation(meta.id);
|
|
27
|
-
const functions = useQuery(space.db, Filter.type(
|
|
26
|
+
const functions = useQuery(space.db, Filter.type(Operation.PersistentOperation));
|
|
28
27
|
const scripts = useQuery(space.db, Filter.type(Script.Script));
|
|
29
28
|
const { invokePromise } = useOperationInvoker();
|
|
30
29
|
|
|
@@ -47,7 +46,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
|
47
46
|
);
|
|
48
47
|
|
|
49
48
|
const getScriptName = useCallback(
|
|
50
|
-
(func:
|
|
49
|
+
(func: Operation.PersistentOperation) => {
|
|
51
50
|
const script = functionToScriptMap[func.id];
|
|
52
51
|
return script?.name;
|
|
53
52
|
},
|
|
@@ -55,7 +54,7 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
|
55
54
|
);
|
|
56
55
|
|
|
57
56
|
const handleGoToScript = useCallback(
|
|
58
|
-
(func:
|
|
57
|
+
(func: Operation.PersistentOperation) => {
|
|
59
58
|
const script = functionToScriptMap[func.id];
|
|
60
59
|
if (script) {
|
|
61
60
|
void invokePromise(LayoutOperation.Open, { subject: [getObjectPathFromObject(script)] });
|
|
@@ -65,35 +64,45 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
|
65
64
|
);
|
|
66
65
|
|
|
67
66
|
const handleDelete = useCallback(
|
|
68
|
-
(func:
|
|
67
|
+
(func: Operation.PersistentOperation) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),
|
|
69
68
|
[invokePromise],
|
|
70
69
|
);
|
|
71
70
|
|
|
72
71
|
return (
|
|
73
|
-
<Settings.
|
|
72
|
+
<Settings.Panel>
|
|
74
73
|
{functions.length > 0 && (
|
|
75
|
-
<List.Root<
|
|
74
|
+
<List.Root<Operation.PersistentOperation>
|
|
75
|
+
items={functions}
|
|
76
|
+
isItem={Schema.is(Operation.PersistentOperation)}
|
|
77
|
+
getId={(func) => func.id}
|
|
78
|
+
>
|
|
76
79
|
{({ items }) => (
|
|
77
80
|
<div role='list' className='flex flex-col w-full'>
|
|
78
81
|
{items?.map((func) => (
|
|
79
|
-
<List.Item<
|
|
82
|
+
<List.Item<Operation.PersistentOperation>
|
|
80
83
|
key={func.id}
|
|
81
84
|
item={func}
|
|
82
|
-
classNames={mx(
|
|
85
|
+
classNames={mx(
|
|
86
|
+
'grid grid-cols-[1fr_min-content_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center',
|
|
87
|
+
ghostHover,
|
|
88
|
+
)}
|
|
83
89
|
>
|
|
84
90
|
<div className='flex flex-col truncate'>
|
|
85
91
|
<List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
|
|
86
|
-
{getScriptName(func) && (
|
|
87
|
-
<div className='text-xs text-description truncate'>{getScriptName(func)}</div>
|
|
88
|
-
)}
|
|
92
|
+
{getScriptName(func) && <p className='text-xs text-description truncate'>{getScriptName(func)}</p>}
|
|
89
93
|
</div>
|
|
90
|
-
{functionToScriptMap[func.id] && (
|
|
91
|
-
<
|
|
92
|
-
|
|
94
|
+
{(functionToScriptMap[func.id] && (
|
|
95
|
+
<IconButton
|
|
96
|
+
icon='ph--arrow-square-out--regular'
|
|
97
|
+
iconOnly
|
|
98
|
+
label={t('show-source-button.label')}
|
|
99
|
+
onClick={() => handleGoToScript(func)}
|
|
100
|
+
/>
|
|
101
|
+
)) || <div />}
|
|
93
102
|
<IconButton
|
|
94
|
-
iconOnly
|
|
95
103
|
icon='ph--trash--regular'
|
|
96
|
-
|
|
104
|
+
iconOnly
|
|
105
|
+
label={t('delete-function-button.label')}
|
|
97
106
|
onClick={() => handleDelete(func)}
|
|
98
107
|
/>
|
|
99
108
|
</List.Item>
|
|
@@ -102,8 +111,6 @@ export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
|
102
111
|
)}
|
|
103
112
|
</List.Root>
|
|
104
113
|
)}
|
|
105
|
-
|
|
106
|
-
{functions.length === 0 && <div className='text-center py-4 text-description'>{t('no functions found')}</div>}
|
|
107
|
-
</Settings.Container>
|
|
114
|
+
</Settings.Panel>
|
|
108
115
|
);
|
|
109
116
|
};
|