@dxos/plugin-automation 0.8.4-main.c1de068 → 0.8.4-main.c85a9c8dae
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/browser/AutomationPanel-EHRSV2DL.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs +37 -0
- package/dist/lib/browser/AutomationSettings-TJYG77L6.mjs.map +7 -0
- package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs +43 -0
- package/dist/lib/browser/FunctionsContainer-XHEQSNNO.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-5WPUZGRB.mjs} +3 -3
- package/dist/lib/browser/FunctionsRegistry-XRXIZRLL.mjs +10 -0
- package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs +13 -0
- package/dist/lib/browser/TriggerSettings-HUQT53SV.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs +85 -0
- package/dist/lib/browser/app-graph-builder-HLARI3VW.mjs.map +7 -0
- package/dist/lib/browser/chunk-3P4R5WNC.mjs +8 -0
- package/dist/lib/browser/chunk-3P4R5WNC.mjs.map +7 -0
- package/dist/lib/browser/chunk-4EY2KMCM.mjs +272 -0
- package/dist/lib/browser/chunk-4EY2KMCM.mjs.map +7 -0
- package/dist/lib/browser/chunk-PZNBEKO5.mjs +17 -0
- package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +7 -0
- package/dist/lib/browser/chunk-QPG3AKFX.mjs +93 -0
- package/dist/lib/browser/chunk-QPG3AKFX.mjs.map +7 -0
- package/dist/lib/browser/chunk-SEG5OCGB.mjs +31 -0
- package/dist/lib/browser/chunk-SEG5OCGB.mjs.map +7 -0
- package/dist/lib/browser/chunk-U55ZXRYM.mjs +98 -0
- package/dist/lib/browser/chunk-U55ZXRYM.mjs.map +7 -0
- package/dist/lib/browser/chunk-WOBCY2FQ.mjs +83 -0
- package/dist/lib/browser/chunk-WOBCY2FQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-XFXYU645.mjs +96 -0
- package/dist/lib/browser/chunk-XFXYU645.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZNI2CGQP.mjs +270 -0
- package/dist/lib/browser/chunk-ZNI2CGQP.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1108 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs +124 -0
- package/dist/lib/browser/compute-runtime-L2RVWXY2.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +13 -0
- package/dist/lib/browser/index.mjs +72 -50
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs +83 -0
- package/dist/lib/browser/operation-resolver-2U6ZQVXR.mjs.map +7 -0
- package/dist/lib/browser/react-surface-U6FAYV42.mjs +69 -0
- package/dist/lib/browser/react-surface-U6FAYV42.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-F7MPUR7U.mjs} +4 -4
- package/dist/lib/node-esm/AutomationPanel-F7MPUR7U.mjs.map +7 -0
- package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs +38 -0
- package/dist/lib/node-esm/AutomationSettings-5AHJMILI.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs +44 -0
- package/dist/lib/node-esm/FunctionsContainer-U5UVRKVT.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-UFL5LT2R.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-UFL5LT2R.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs +11 -0
- package/dist/lib/node-esm/FunctionsRegistry-574OBZ5T.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs +14 -0
- package/dist/lib/node-esm/TriggerSettings-RDIJHUKK.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs +86 -0
- package/dist/lib/node-esm/app-graph-builder-Z2TMQHVX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2X564LII.mjs +10 -0
- package/dist/lib/node-esm/chunk-2X564LII.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-34HGM46Z.mjs +32 -0
- package/dist/lib/node-esm/chunk-34HGM46Z.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4DK33JDH.mjs +84 -0
- package/dist/lib/node-esm/chunk-4DK33JDH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +19 -0
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-7AIKTEAX.mjs +273 -0
- package/dist/lib/node-esm/chunk-7AIKTEAX.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs +271 -0
- package/dist/lib/node-esm/chunk-CMZ4NKSK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-GXFQR3KI.mjs +99 -0
- package/dist/lib/node-esm/chunk-GXFQR3KI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs +94 -0
- package/dist/lib/node-esm/chunk-QNPYY3XZ.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-RTEXGGBX.mjs +97 -0
- package/dist/lib/node-esm/chunk-RTEXGGBX.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1109 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs +125 -0
- package/dist/lib/node-esm/compute-runtime-XD6A5Q7Q.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +14 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +72 -50
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs +84 -0
- package/dist/lib/node-esm/operation-resolver-XWJGBHJZ.mjs.map +7 -0
- package/dist/lib/node-esm/{react-surface-3PNW7NDW.mjs → react-surface-BVNHCWQ7.mjs} +31 -26
- package/dist/lib/node-esm/react-surface-BVNHCWQ7.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +10 -4
- package/dist/types/src/AutomationPlugin.d.ts +2 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +3 -0
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +6 -0
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +3 -0
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/index.d.ts +2 -0
- package/dist/types/src/cli/commands/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/cli/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/options.d.ts +11 -0
- package/dist/types/src/cli/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/cli/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/cli/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts +12 -0
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/util.d.ts +46 -0
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -0
- package/dist/types/src/cli/index.d.ts +2 -0
- package/dist/types/src/cli/index.d.ts.map +1 -0
- package/dist/types/src/cli/plugin.d.ts +3 -0
- package/dist/types/src/cli/plugin.d.ts.map +1 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -3
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +50 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +119 -4
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +4 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +3 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/{components → containers/FunctionsContainer}/FunctionsContainer.d.ts +0 -1
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +3 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +12 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +202 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +22 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/events.d.ts +5 -0
- package/dist/types/src/types/events.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +31 -2
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +82 -41
- package/src/AutomationPlugin.tsx +19 -32
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +72 -0
- package/src/capabilities/app-graph-builder/index.ts +7 -0
- package/src/capabilities/compute-runtime/compute-runtime.ts +146 -0
- package/src/capabilities/compute-runtime/index.ts +7 -0
- package/src/capabilities/index.ts +4 -5
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +80 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +61 -0
- package/src/cli/commands/index.ts +5 -0
- package/src/cli/commands/trigger/create/index.ts +14 -0
- package/src/cli/commands/trigger/create/queue.ts +89 -0
- package/src/cli/commands/trigger/create/subscription.ts +128 -0
- package/src/cli/commands/trigger/create/timer.ts +93 -0
- package/src/cli/commands/trigger/index.ts +16 -0
- package/src/cli/commands/trigger/list.ts +67 -0
- package/src/cli/commands/trigger/options.ts +59 -0
- package/src/cli/commands/trigger/remove.ts +45 -0
- package/src/cli/commands/trigger/update/index.ts +14 -0
- package/src/cli/commands/trigger/update/queue.ts +195 -0
- package/src/cli/commands/trigger/update/subscription.ts +278 -0
- package/src/cli/commands/trigger/update/timer.ts +193 -0
- package/src/cli/commands/trigger/util.ts +395 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +24 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +16 -17
- package/src/components/AutomationPanel/AutomationPanel.tsx +238 -89
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +37 -25
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +110 -0
- package/src/components/FunctionsRegistry/index.ts +8 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
- package/src/components/TriggerEditor/SpecSelector.tsx +29 -21
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +121 -33
- package/src/components/TriggerEditor/TriggerEditor.tsx +96 -48
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +27 -0
- package/src/containers/AutomationSettings/index.ts +7 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
- package/src/containers/FunctionsContainer/index.ts +7 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +26 -0
- package/src/containers/TriggerSettings/index.ts +7 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useComputeRuntimeCallback.ts +67 -0
- package/src/hooks/useTriggerRuntimeControls.ts +67 -0
- package/src/index.ts +2 -0
- package/src/meta.ts +8 -7
- package/src/testing/test-functions.ts +7 -7
- package/src/translations.ts +11 -0
- package/src/types/capabilities.ts +43 -0
- package/src/types/events.ts +11 -0
- package/src/types/index.ts +2 -0
- package/src/types/schema.ts +24 -3
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs +0 -38
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-ZWA6GOFY.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs +0 -39
- package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs +0 -80
- package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ECSTS2UI.mjs +0 -14
- package/dist/lib/browser/chunk-ECSTS2UI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERTIGJYE.mjs +0 -147
- package/dist/lib/browser/chunk-ERTIGJYE.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSJZXTS2.mjs +0 -230
- package/dist/lib/browser/chunk-FSJZXTS2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-LYJVTIVD.mjs +0 -94
- package/dist/lib/browser/chunk-LYJVTIVD.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs +0 -76
- package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4DFSM7OX.mjs +0 -64
- package/dist/lib/browser/react-surface-4DFSM7OX.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs +0 -39
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs +0 -40
- package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs +0 -81
- package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AZH66CED.mjs +0 -231
- package/dist/lib/node-esm/chunk-AZH66CED.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HIMYPGHF.mjs +0 -148
- package/dist/lib/node-esm/chunk-HIMYPGHF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs +0 -16
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs +0 -95
- package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs +0 -77
- package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3PNW7NDW.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.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/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -86
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -56
- package/src/components/AutomationContainer.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -31
- /package/dist/lib/browser/{AutomationPanel-ZWA6GOFY.mjs.map → AutomationPanel-EHRSV2DL.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-5WPUZGRB.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-YYUMSK2W.mjs.map → browser/FunctionsRegistry-XRXIZRLL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-KGIOZSPZ.mjs.map → browser/hooks/index.mjs.map} +0 -0
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Prompt from '@effect/cli/Prompt';
|
|
6
|
+
import * as Ansi from '@effect/printer-ansi/Ansi';
|
|
7
|
+
import * as Console from 'effect/Console';
|
|
8
|
+
import * as Effect from 'effect/Effect';
|
|
9
|
+
import * as Match from 'effect/Match';
|
|
10
|
+
import * as Option from 'effect/Option';
|
|
11
|
+
import type * as Schema from 'effect/Schema';
|
|
12
|
+
import * as SchemaAST from 'effect/SchemaAST';
|
|
13
|
+
|
|
14
|
+
import { FormBuilder } from '@dxos/cli-util';
|
|
15
|
+
import { Annotation, Database, Entity, Filter, Obj, Ref, Type } from '@dxos/echo';
|
|
16
|
+
import { getProperties } from '@dxos/effect';
|
|
17
|
+
import { Function, Trigger } from '@dxos/functions';
|
|
18
|
+
import { QueueAnnotation } from '@dxos/schema';
|
|
19
|
+
|
|
20
|
+
export type TriggerRemoteStatus = 'available' | 'not available' | 'n/a';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Determines the remote status of a trigger.
|
|
24
|
+
* Only timer/cron triggers can be checked for remote availability.
|
|
25
|
+
*/
|
|
26
|
+
export const getTriggerRemoteStatus = (trigger: Trigger.Trigger, remoteCronIds: string[]): TriggerRemoteStatus => {
|
|
27
|
+
if (trigger.spec?.kind !== 'timer') {
|
|
28
|
+
return 'n/a';
|
|
29
|
+
}
|
|
30
|
+
return remoteCronIds.includes(trigger.id) ? 'available' : 'not available';
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Pretty prints a trigger with ANSI colors.
|
|
35
|
+
*/
|
|
36
|
+
export const printTrigger = Effect.fn(function* (trigger: Trigger.Trigger, remoteStatus?: TriggerRemoteStatus) {
|
|
37
|
+
const fn = trigger.function && (yield* Database.load(trigger.function));
|
|
38
|
+
|
|
39
|
+
return FormBuilder.make({
|
|
40
|
+
title: trigger.id,
|
|
41
|
+
}).pipe(
|
|
42
|
+
FormBuilder.set(
|
|
43
|
+
'status',
|
|
44
|
+
trigger.enabled ? 'enabled' : 'disabled',
|
|
45
|
+
trigger.enabled ? Ansi.green : Ansi.blackBright,
|
|
46
|
+
),
|
|
47
|
+
FormBuilder.option('kind', Option.fromNullable(trigger.spec?.kind)),
|
|
48
|
+
FormBuilder.option(
|
|
49
|
+
'remote',
|
|
50
|
+
Option.fromNullable(remoteStatus),
|
|
51
|
+
Match.type<TriggerRemoteStatus>().pipe(
|
|
52
|
+
Match.withReturnType<Ansi.Ansi>(),
|
|
53
|
+
Match.when('available', () => Ansi.green),
|
|
54
|
+
Match.when('not available', () => Ansi.yellow),
|
|
55
|
+
Match.when('n/a', () => Ansi.blackBright),
|
|
56
|
+
Match.exhaustive,
|
|
57
|
+
),
|
|
58
|
+
),
|
|
59
|
+
FormBuilder.when(
|
|
60
|
+
fn,
|
|
61
|
+
FormBuilder.nest(
|
|
62
|
+
'function',
|
|
63
|
+
FormBuilder.make().pipe(FormBuilder.set('key', fn!.key), FormBuilder.set('dxn', fn!.dxn?.toString())),
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
FormBuilder.nestedOption('spec', Option.fromNullable(trigger.spec).pipe(Option.map(printSpec))),
|
|
67
|
+
FormBuilder.build,
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const printSpec = <T extends Trigger.Spec>(spec: T): FormBuilder.FormBuilder => {
|
|
72
|
+
switch (spec.kind) {
|
|
73
|
+
case 'timer':
|
|
74
|
+
return printTimer(spec);
|
|
75
|
+
case 'subscription':
|
|
76
|
+
return printSubscription(spec);
|
|
77
|
+
case 'webhook':
|
|
78
|
+
return printWebhook(spec);
|
|
79
|
+
case 'queue':
|
|
80
|
+
return printQueue(spec);
|
|
81
|
+
default:
|
|
82
|
+
return FormBuilder.make({}).pipe(FormBuilder.set('unknown', 'Unknown spec type'));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const printTimer = (spec: Trigger.TimerSpec) => FormBuilder.make({}).pipe(FormBuilder.set('cron', spec.cron));
|
|
87
|
+
|
|
88
|
+
const printSubscription = (spec: Trigger.SubscriptionSpec) =>
|
|
89
|
+
FormBuilder.make({}).pipe(FormBuilder.set('query', spec.query?.raw ?? '[Query AST]'));
|
|
90
|
+
|
|
91
|
+
const printWebhook = (spec: Trigger.WebhookSpec) =>
|
|
92
|
+
FormBuilder.make({}).pipe(FormBuilder.set('method', spec.method), FormBuilder.set('port', spec.port));
|
|
93
|
+
|
|
94
|
+
const printQueue = (spec: Trigger.QueueSpec) => FormBuilder.make({}).pipe(FormBuilder.set('queue', spec.queue));
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Prompts for input values based on an Effect schema.
|
|
98
|
+
* First shows a multi-select to choose which properties to specify,
|
|
99
|
+
* then prompts for values of the selected properties.
|
|
100
|
+
* Required properties are automatically included and cannot be unselected.
|
|
101
|
+
* @param schema - The Effect schema to prompt for
|
|
102
|
+
* @param defaults - Optional default values to use as initial values and pre-select optional properties
|
|
103
|
+
*/
|
|
104
|
+
export const promptForSchemaInput = Effect.fn(function* (
|
|
105
|
+
schema: Schema.Schema.AnyNoContext | undefined,
|
|
106
|
+
defaults?: Record<string, any> | undefined,
|
|
107
|
+
) {
|
|
108
|
+
if (!schema) {
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const ast = schema.ast;
|
|
113
|
+
|
|
114
|
+
// Check if it's a struct/object type
|
|
115
|
+
if (!SchemaAST.isTypeLiteral(ast)) {
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const properties = getProperties(ast);
|
|
120
|
+
if (properties.length === 0) {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Separate required and optional properties
|
|
125
|
+
const requiredProperties: typeof properties = [];
|
|
126
|
+
const optionalProperties: typeof properties = [];
|
|
127
|
+
|
|
128
|
+
for (const prop of properties) {
|
|
129
|
+
if (prop.isOptional) {
|
|
130
|
+
optionalProperties.push(prop);
|
|
131
|
+
} else {
|
|
132
|
+
requiredProperties.push(prop);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Build property info
|
|
137
|
+
const propertyInfo = properties.map((prop) => {
|
|
138
|
+
const key = prop.name.toString();
|
|
139
|
+
return {
|
|
140
|
+
prop,
|
|
141
|
+
key,
|
|
142
|
+
isRequired: !prop.isOptional,
|
|
143
|
+
};
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// Multi-select: show all properties and let user select which optional ones to include
|
|
147
|
+
const selectedKeys = new Set<string>();
|
|
148
|
+
|
|
149
|
+
// Required properties are automatically selected
|
|
150
|
+
for (const info of propertyInfo) {
|
|
151
|
+
if (info.isRequired) {
|
|
152
|
+
selectedKeys.add(info.key);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
// Show required properties that will be automatically included
|
|
157
|
+
if (requiredProperties.length > 0) {
|
|
158
|
+
const requiredNames = requiredProperties.map((p) => {
|
|
159
|
+
const info = propertyInfo.find((i) => i.prop === p);
|
|
160
|
+
return info?.key ?? p.name.toString();
|
|
161
|
+
});
|
|
162
|
+
yield* Console.log(`Required properties (will be included): ${requiredNames.join(', ')}`);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// For optional properties, use multi-select to choose which ones to include
|
|
166
|
+
if (optionalProperties.length > 0) {
|
|
167
|
+
const optionalInfo = propertyInfo.filter((info) => !info.isRequired);
|
|
168
|
+
const choices = optionalInfo.map((info) => {
|
|
169
|
+
const hasDefault = defaults?.[info.key] !== undefined;
|
|
170
|
+
const defaultText = hasDefault ? ` (current: ${JSON.stringify(defaults[info.key])})` : '';
|
|
171
|
+
return {
|
|
172
|
+
title: `${info.key}${defaultText}`,
|
|
173
|
+
value: info.key,
|
|
174
|
+
description: hasDefault ? 'Has default value' : undefined,
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const selected = yield* Prompt.multiSelect({
|
|
179
|
+
message: 'Select optional properties to include:',
|
|
180
|
+
choices,
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// Add selected optional properties to selectedKeys
|
|
184
|
+
for (const key of selected) {
|
|
185
|
+
selectedKeys.add(String(key));
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// If no properties selected (shouldn't happen if there are required ones), return empty
|
|
190
|
+
if (selectedKeys.size === 0) {
|
|
191
|
+
return {};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Prompt for values of selected properties
|
|
195
|
+
const inputObj: Record<string, any> = {};
|
|
196
|
+
|
|
197
|
+
for (const info of propertyInfo) {
|
|
198
|
+
if (!selectedKeys.has(info.key)) {
|
|
199
|
+
continue;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
const key = info.key;
|
|
203
|
+
const propType = info.prop.type;
|
|
204
|
+
const schemaDefault = Option.getOrUndefined(SchemaAST.getDefaultAnnotation(propType));
|
|
205
|
+
const defaultValue = defaults?.[key] ?? schemaDefault;
|
|
206
|
+
|
|
207
|
+
if (SchemaAST.isBooleanKeyword(propType)) {
|
|
208
|
+
const initialValue =
|
|
209
|
+
typeof defaultValue === 'boolean' ? defaultValue : typeof schemaDefault === 'boolean' ? schemaDefault : false;
|
|
210
|
+
const value = yield* Prompt.confirm({
|
|
211
|
+
message: `${info.key}${defaults?.[key] !== undefined ? ` (current: ${defaults[key]})` : ''}:`,
|
|
212
|
+
initial: initialValue,
|
|
213
|
+
});
|
|
214
|
+
inputObj[key] = value;
|
|
215
|
+
} else if (SchemaAST.isNumberKeyword(propType)) {
|
|
216
|
+
const currentValue = typeof defaultValue === 'number' ? String(defaultValue) : '';
|
|
217
|
+
const valueStr = yield* Prompt.text({
|
|
218
|
+
message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
|
|
219
|
+
}).pipe(Prompt.run);
|
|
220
|
+
inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : parseFloat(valueStr) || 0;
|
|
221
|
+
} else if (SchemaAST.isStringKeyword(propType)) {
|
|
222
|
+
const currentValue = typeof defaultValue === 'string' ? defaultValue : '';
|
|
223
|
+
const valueStr = yield* Prompt.text({
|
|
224
|
+
message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
|
|
225
|
+
}).pipe(Prompt.run);
|
|
226
|
+
inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : valueStr;
|
|
227
|
+
} else if (Ref.isRefType(propType)) {
|
|
228
|
+
const isDefaultTemplate =
|
|
229
|
+
typeof defaultValue === 'string' && defaultValue.startsWith('{{') && defaultValue.endsWith('}}');
|
|
230
|
+
const useTemplate = yield* Prompt.confirm({
|
|
231
|
+
message: `Use a template to specify ${info.key}?${isDefaultTemplate ? ' (current: template)' : ''}`,
|
|
232
|
+
initial: isDefaultTemplate,
|
|
233
|
+
});
|
|
234
|
+
if (useTemplate) {
|
|
235
|
+
const currentValue = typeof defaultValue === 'string' ? defaultValue : '';
|
|
236
|
+
const templateStr = yield* Prompt.text({
|
|
237
|
+
message: `${info.key} template${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
|
|
238
|
+
}).pipe(Prompt.run);
|
|
239
|
+
inputObj[key] = templateStr === '' && defaultValue !== undefined ? defaultValue : templateStr;
|
|
240
|
+
} else {
|
|
241
|
+
const annotation = Annotation.ReferenceAnnotation.getFromAst(propType).pipe(Option.getOrThrow);
|
|
242
|
+
const objects = yield* Database.runQuery(Filter.typename(annotation.typename));
|
|
243
|
+
if (objects.length === 0) {
|
|
244
|
+
inputObj[key] = undefined;
|
|
245
|
+
} else {
|
|
246
|
+
const selected = yield* Prompt.select({
|
|
247
|
+
message: `Select ${info.key}:`,
|
|
248
|
+
choices: objects.map((obj: Entity.Any) => ({
|
|
249
|
+
title: Entity.getLabel(obj) ?? obj.id,
|
|
250
|
+
value: Ref.make(obj),
|
|
251
|
+
description: Entity.getDescription(obj),
|
|
252
|
+
})),
|
|
253
|
+
});
|
|
254
|
+
inputObj[key] = selected;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
// For other types, prompt as string and let validation handle it
|
|
259
|
+
const currentValue = defaultValue !== undefined ? String(defaultValue) : '';
|
|
260
|
+
const valueStr = yield* Prompt.text({
|
|
261
|
+
message: `${info.key}${currentValue ? ` (current: ${currentValue}, press Enter to keep)` : ''}:`,
|
|
262
|
+
}).pipe(Prompt.run);
|
|
263
|
+
inputObj[key] = valueStr === '' && defaultValue !== undefined ? defaultValue : valueStr;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
return inputObj;
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Selects a function interactively from available functions in the database.
|
|
272
|
+
* Queries the database for functions and prompts the user to select one.
|
|
273
|
+
*/
|
|
274
|
+
export const selectFunction = Effect.fn(function* () {
|
|
275
|
+
const functions = yield* Database.runQuery(Filter.type(Function.Function));
|
|
276
|
+
|
|
277
|
+
if (functions.length === 0) {
|
|
278
|
+
return yield* Effect.fail(new Error('No functions available'));
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
const selected = yield* Prompt.select({
|
|
282
|
+
message: 'Select a function:',
|
|
283
|
+
choices: functions.map((fn: Function.Function) => ({
|
|
284
|
+
title: fn.name ?? fn.id,
|
|
285
|
+
value: fn.id,
|
|
286
|
+
description: fn.description,
|
|
287
|
+
})),
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
return String(selected);
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Selects a trigger interactively from available triggers.
|
|
295
|
+
* If kind is provided, filters triggers by that kind.
|
|
296
|
+
* Queries the database for triggers and prompts the user to select one.
|
|
297
|
+
*/
|
|
298
|
+
export const selectTrigger = Effect.fn(function* (kind?: Trigger.Kind) {
|
|
299
|
+
const triggers = yield* Database.runQuery(Filter.type(Trigger.Trigger));
|
|
300
|
+
const filteredTriggers = kind ? triggers.filter((trigger) => trigger.spec?.kind === kind) : triggers;
|
|
301
|
+
|
|
302
|
+
if (filteredTriggers.length === 0) {
|
|
303
|
+
return yield* Effect.fail(new Error(kind ? `No ${kind} triggers available` : 'No triggers available'));
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
const choices = yield* Effect.all(
|
|
307
|
+
filteredTriggers.map((trigger) =>
|
|
308
|
+
Effect.gen(function* () {
|
|
309
|
+
const fn = trigger.function ? yield* Database.load(trigger.function) : undefined;
|
|
310
|
+
const functionName = fn && Obj.instanceOf(Function.Function, fn) ? (fn.name ?? fn.key ?? fn.id) : undefined;
|
|
311
|
+
const title = functionName ?? trigger.id;
|
|
312
|
+
const description = `${trigger.enabled ? 'enabled' : 'disabled'} - ${trigger.spec?.kind ?? 'unknown'}`;
|
|
313
|
+
|
|
314
|
+
return {
|
|
315
|
+
title,
|
|
316
|
+
value: trigger.id,
|
|
317
|
+
description,
|
|
318
|
+
};
|
|
319
|
+
}),
|
|
320
|
+
),
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
const selected = yield* Prompt.select({
|
|
324
|
+
message: kind ? `Select a ${kind} trigger:` : 'Select a trigger:',
|
|
325
|
+
choices,
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
return String(selected);
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
/**
|
|
332
|
+
* Selects a queue interactively from available queues in the database.
|
|
333
|
+
* Queries schemas with QueueAnnotation, then queries objects of those types,
|
|
334
|
+
* and extracts queue DXNs from the objects' queue properties.
|
|
335
|
+
*/
|
|
336
|
+
export const selectQueue = Effect.fn(function* () {
|
|
337
|
+
// Query schema registry for schemas with QueueAnnotation
|
|
338
|
+
const schemas = yield* Database.runSchemaQuery({ location: ['database', 'runtime'] });
|
|
339
|
+
|
|
340
|
+
// Filter schemas that have QueueAnnotation
|
|
341
|
+
const queueSchemas = schemas.filter((schema) => {
|
|
342
|
+
const annotation = QueueAnnotation.get(schema);
|
|
343
|
+
return Option.isSome(annotation) && annotation.value === true;
|
|
344
|
+
});
|
|
345
|
+
|
|
346
|
+
if (queueSchemas.length === 0) {
|
|
347
|
+
return yield* Effect.fail(new Error('No schemas with Queue annotation found'));
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Collect all objects with queues
|
|
351
|
+
const queueChoices: Array<{ title: string; value: string; description?: string }> = [];
|
|
352
|
+
|
|
353
|
+
// Process each schema, skipping ones that fail
|
|
354
|
+
for (const schema of queueSchemas) {
|
|
355
|
+
yield* Effect.gen(function* () {
|
|
356
|
+
const typename = Type.getTypename(schema);
|
|
357
|
+
const objects = yield* Database.runQuery(Filter.type(typename));
|
|
358
|
+
|
|
359
|
+
for (const obj of objects) {
|
|
360
|
+
// Access the queue property (which is a Ref<Queue>)
|
|
361
|
+
const queueRef = (obj as any).queue as Ref.Ref<any> | undefined;
|
|
362
|
+
if (!queueRef) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
const queueDxn = queueRef.dxn.toString();
|
|
367
|
+
const label = Obj.getLabel(obj) ?? obj.id;
|
|
368
|
+
const description = Obj.getTypename(obj);
|
|
369
|
+
|
|
370
|
+
queueChoices.push({
|
|
371
|
+
title: label,
|
|
372
|
+
value: queueDxn,
|
|
373
|
+
description,
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}).pipe(Effect.catchAll(() => Effect.void));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
if (queueChoices.length === 0) {
|
|
380
|
+
return yield* Effect.fail(new Error('No objects with queue properties found'));
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
const selected = yield* Prompt.select({
|
|
384
|
+
message: 'Select a queue:',
|
|
385
|
+
choices: queueChoices,
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
return String(selected);
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
/**
|
|
392
|
+
* Pretty prints trigger removal result with ANSI colors.
|
|
393
|
+
*/
|
|
394
|
+
export const printTriggerRemoved = (id: string) =>
|
|
395
|
+
FormBuilder.make({ title: 'Trigger removed' }).pipe(FormBuilder.set('id', id), FormBuilder.build);
|
package/src/cli/index.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
8
|
+
|
|
9
|
+
// NOTE: Must not import from index to avoid pulling in react dependencies.
|
|
10
|
+
import { ComputeRuntime } from '../capabilities/compute-runtime';
|
|
11
|
+
import { meta } from '../meta';
|
|
12
|
+
import { AutomationEvents } from '../types';
|
|
13
|
+
|
|
14
|
+
import { trigger } from './commands';
|
|
15
|
+
|
|
16
|
+
export const AutomationPlugin = Plugin.define(meta).pipe(
|
|
17
|
+
AppPlugin.addCommandModule({ commands: [trigger] }),
|
|
18
|
+
Plugin.addModule({
|
|
19
|
+
activatesOn: ClientEvents.ClientReady,
|
|
20
|
+
activatesAfter: [AutomationEvents.ComputeRuntimeReady],
|
|
21
|
+
activate: ComputeRuntime,
|
|
22
|
+
}),
|
|
23
|
+
Plugin.make,
|
|
24
|
+
);
|
|
@@ -2,21 +2,19 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
|
-
import {
|
|
11
|
-
import { FunctionType, FunctionTrigger } from '@dxos/functions';
|
|
8
|
+
import { Function, Trigger } from '@dxos/functions';
|
|
12
9
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
13
10
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
|
-
import {
|
|
11
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
12
|
|
|
16
|
-
import { AutomationPanel } from './AutomationPanel';
|
|
17
13
|
import { functions } from '../../testing';
|
|
18
14
|
import { translations } from '../../translations';
|
|
19
15
|
|
|
16
|
+
import { AutomationPanel } from './AutomationPanel';
|
|
17
|
+
|
|
20
18
|
const DefaultStory = () => {
|
|
21
19
|
const spaces = useSpaces();
|
|
22
20
|
const space = spaces[1];
|
|
@@ -28,30 +26,31 @@ const DefaultStory = () => {
|
|
|
28
26
|
);
|
|
29
27
|
};
|
|
30
28
|
|
|
31
|
-
const meta
|
|
32
|
-
title: 'plugins/plugin-automation/AutomationPanel',
|
|
33
|
-
component: AutomationPanel,
|
|
29
|
+
const meta = {
|
|
30
|
+
title: 'plugins/plugin-automation/components/AutomationPanel',
|
|
31
|
+
component: AutomationPanel as any,
|
|
34
32
|
render: DefaultStory,
|
|
35
33
|
decorators: [
|
|
34
|
+
withTheme(),
|
|
36
35
|
withClientProvider({
|
|
37
36
|
createIdentity: true,
|
|
38
37
|
createSpace: true,
|
|
39
|
-
types: [
|
|
40
|
-
|
|
38
|
+
types: [Function.Function, Trigger.Trigger],
|
|
39
|
+
onCreateSpace: ({ space }) => {
|
|
41
40
|
for (const fn of functions) {
|
|
42
|
-
space.db.add(
|
|
41
|
+
space.db.add(Function.make(fn));
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
}),
|
|
46
|
-
withLayout(),
|
|
47
|
-
withTheme,
|
|
48
45
|
],
|
|
49
46
|
parameters: {
|
|
50
47
|
layout: 'centered',
|
|
51
48
|
translations,
|
|
52
49
|
},
|
|
53
|
-
}
|
|
50
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
54
51
|
|
|
55
52
|
export default meta;
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
type Story = StoryObj<typeof meta>;
|
|
55
|
+
|
|
56
|
+
export const Default: Story = {};
|