@dxos/plugin-automation 0.8.4-main.c4373fc → 0.8.4-main.d05673bc65
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-IGLIQY2N.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs +37 -0
- package/dist/lib/browser/AutomationSettings-EDO3N5WI.mjs.map +7 -0
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs +43 -0
- package/dist/lib/browser/FunctionsContainer-R4ZMYSFJ.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-NRIKAPQV.mjs → FunctionsPanel-NMA4RYJL.mjs} +3 -3
- package/dist/lib/browser/FunctionsRegistry-TMKAEG5E.mjs +10 -0
- package/dist/lib/browser/TriggerSettings-56AIMOEC.mjs +11 -0
- package/dist/lib/browser/app-graph-builder-74ILZP25.mjs +83 -0
- package/dist/lib/browser/app-graph-builder-74ILZP25.mjs.map +7 -0
- package/dist/lib/browser/chunk-75XLBFAG.mjs +97 -0
- package/dist/lib/browser/chunk-75XLBFAG.mjs.map +7 -0
- package/dist/lib/browser/chunk-BWEKRPFJ.mjs +294 -0
- package/dist/lib/browser/chunk-BWEKRPFJ.mjs.map +7 -0
- package/dist/lib/browser/chunk-EL64ZPPN.mjs +17 -0
- package/dist/lib/browser/chunk-EL64ZPPN.mjs.map +7 -0
- package/dist/lib/browser/chunk-FUVAC5EC.mjs +96 -0
- package/dist/lib/browser/chunk-FUVAC5EC.mjs.map +7 -0
- package/dist/lib/browser/chunk-GVHAETEQ.mjs +83 -0
- package/dist/lib/browser/chunk-GVHAETEQ.mjs.map +7 -0
- package/dist/lib/browser/chunk-H2MV4XE6.mjs +31 -0
- package/dist/lib/browser/chunk-H2MV4XE6.mjs.map +7 -0
- package/dist/lib/browser/chunk-O23LHDEX.mjs +269 -0
- package/dist/lib/browser/chunk-O23LHDEX.mjs.map +7 -0
- package/dist/lib/browser/chunk-OAZ2JYXV.mjs +93 -0
- package/dist/lib/browser/chunk-OAZ2JYXV.mjs.map +7 -0
- package/dist/lib/browser/chunk-Z7F7X2C5.mjs +8 -0
- package/dist/lib/browser/chunk-Z7F7X2C5.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +1115 -0
- package/dist/lib/browser/cli/index.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs +124 -0
- package/dist/lib/browser/compute-runtime-F3UMRKCL.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +5 -4
- package/dist/lib/browser/index.mjs +66 -64
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs +84 -0
- package/dist/lib/browser/operation-resolver-IRC2DZU7.mjs.map +7 -0
- package/dist/lib/browser/react-surface-5MFPVWIN.mjs +65 -0
- package/dist/lib/browser/react-surface-5MFPVWIN.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +10 -4
- package/dist/lib/node-esm/{AutomationPanel-GHK5UG4K.mjs → AutomationPanel-O2BCQA7P.mjs} +4 -4
- package/dist/lib/node-esm/AutomationPanel-O2BCQA7P.mjs.map +7 -0
- package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs +38 -0
- package/dist/lib/node-esm/AutomationSettings-LJNRQUX7.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs +44 -0
- package/dist/lib/node-esm/FunctionsContainer-GYRPQZM7.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-SAMRTELO.mjs → FunctionsPanel-DCXXLSVP.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-DCXXLSVP.mjs.map +7 -0
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs +11 -0
- package/dist/lib/node-esm/FunctionsRegistry-7WCHC64E.mjs.map +7 -0
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs +12 -0
- package/dist/lib/node-esm/TriggerSettings-ONY5ZUKW.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs +84 -0
- package/dist/lib/node-esm/app-graph-builder-VDXPOWCH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-2UF55HSG.mjs +94 -0
- package/dist/lib/node-esm/chunk-2UF55HSG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6B4WZRVH.mjs +84 -0
- package/dist/lib/node-esm/chunk-6B4WZRVH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6JVB3IHW.mjs +97 -0
- package/dist/lib/node-esm/chunk-6JVB3IHW.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-FPXVLTEY.mjs +270 -0
- package/dist/lib/node-esm/chunk-FPXVLTEY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs +32 -0
- package/dist/lib/node-esm/chunk-JVUE5PMI.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-K7T2MVB7.mjs +98 -0
- package/dist/lib/node-esm/chunk-K7T2MVB7.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs +295 -0
- package/dist/lib/node-esm/chunk-Q5JSKD6Z.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-R5YEWJCG.mjs +10 -0
- package/dist/lib/node-esm/chunk-R5YEWJCG.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WC5AT7B3.mjs +19 -0
- package/dist/lib/node-esm/chunk-WC5AT7B3.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +1116 -0
- package/dist/lib/node-esm/cli/index.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs +125 -0
- package/dist/lib/node-esm/compute-runtime-AMFVJMF2.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +5 -4
- package/dist/lib/node-esm/index.mjs +66 -64
- 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-CBLQHL4N.mjs +85 -0
- package/dist/lib/node-esm/operation-resolver-CBLQHL4N.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-Z74AHU4T.mjs +66 -0
- package/dist/lib/node-esm/react-surface-Z74AHU4T.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 -5
- 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 +6 -7
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +5 -0
- 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 +10 -8
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +74 -2
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +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/useComputeRuntimeCallback.d.ts +8 -4
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +6 -5
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/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 +5 -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 +32 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +66 -47
- package/src/AutomationPlugin.tsx +15 -34
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +73 -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 -8
- 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 +57 -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 +404 -0
- package/src/cli/index.ts +5 -0
- package/src/cli/plugin.ts +24 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +5 -6
- package/src/components/AutomationPanel/AutomationPanel.tsx +188 -86
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +34 -22
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +110 -0
- package/src/components/FunctionsRegistry/index.ts +8 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +34 -33
- package/src/components/TriggerEditor/SpecSelector.tsx +12 -11
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +89 -23
- package/src/components/TriggerEditor/TriggerEditor.tsx +101 -86
- package/src/components/index.ts +1 -2
- package/src/{components → containers/AutomationSettings}/AutomationSettings.tsx +9 -12
- 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 +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/useComputeRuntimeCallback.ts +45 -8
- package/src/hooks/useTriggerRuntimeControls.ts +30 -15
- package/src/index.ts +2 -2
- package/src/meta.ts +8 -5
- package/src/testing/test-functions.ts +6 -6
- package/src/translations.ts +7 -0
- package/src/{capabilities → types}/capabilities.ts +9 -14
- 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/AutomationPanel-PNBH5L5C.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs +0 -69
- package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs +0 -81
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +0 -7
- package/dist/lib/browser/chunk-5ARH77PV.mjs +0 -15
- package/dist/lib/browser/chunk-5ARH77PV.mjs.map +0 -7
- package/dist/lib/browser/chunk-AY67OUDA.mjs +0 -14
- package/dist/lib/browser/chunk-AY67OUDA.mjs.map +0 -7
- package/dist/lib/browser/chunk-DLLE4FKP.mjs +0 -94
- package/dist/lib/browser/chunk-DLLE4FKP.mjs.map +0 -7
- package/dist/lib/browser/chunk-LC3QQU47.mjs +0 -171
- package/dist/lib/browser/chunk-LC3QQU47.mjs.map +0 -7
- package/dist/lib/browser/chunk-MVPRI3DB.mjs +0 -53
- package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +0 -7
- package/dist/lib/browser/chunk-NIJWEQRD.mjs +0 -283
- package/dist/lib/browser/chunk-NIJWEQRD.mjs.map +0 -7
- package/dist/lib/browser/chunk-QT3YWUOT.mjs +0 -14
- package/dist/lib/browser/chunk-QT3YWUOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-VGBZKM3O.mjs +0 -38
- package/dist/lib/browser/chunk-VGBZKM3O.mjs.map +0 -7
- package/dist/lib/browser/chunk-WWURMV25.mjs +0 -13
- package/dist/lib/browser/chunk-WWURMV25.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +0 -160
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs +0 -77
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JXFO46V4.mjs +0 -63
- package/dist/lib/browser/react-surface-JXFO46V4.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs +0 -70
- package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs +0 -82
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3EWMZAU6.mjs +0 -172
- package/dist/lib/node-esm/chunk-3EWMZAU6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs +0 -15
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs +0 -39
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EX74SIDO.mjs +0 -284
- package/dist/lib/node-esm/chunk-EX74SIDO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LWASMQIF.mjs +0 -16
- package/dist/lib/node-esm/chunk-LWASMQIF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs +0 -54
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs +0 -16
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs +0 -16
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs +0 -95
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +0 -161
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-YDJ43B3N.mjs +0 -64
- package/dist/lib/node-esm/react-surface-YDJ43B3N.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/capabilities.d.ts +0 -19
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +0 -5
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/components/AutomationSettings.d.ts +0 -5
- package/dist/types/src/components/AutomationSettings.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/TriggerSettings.d.ts +0 -6
- package/dist/types/src/components/TriggerSettings.d.ts.map +0 -1
- package/dist/types/src/events.d.ts +0 -4
- package/dist/types/src/events.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -87
- package/src/capabilities/compute-runtime.ts +0 -138
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/capabilities/react-surface.tsx +0 -55
- package/src/components/FunctionsContainer.tsx +0 -29
- package/src/components/TriggerSettings.tsx +0 -25
- package/src/events.ts +0 -11
- /package/dist/lib/browser/{AutomationPanel-PNBH5L5C.mjs.map → AutomationPanel-IGLIQY2N.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-NRIKAPQV.mjs.map → FunctionsPanel-NMA4RYJL.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-GHK5UG4K.mjs.map → browser/FunctionsRegistry-TMKAEG5E.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-SAMRTELO.mjs.map → browser/TriggerSettings-56AIMOEC.mjs.map} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationPanel,
|
|
3
|
+
AutomationPanel_default
|
|
4
|
+
} from "./chunk-O23LHDEX.mjs";
|
|
5
|
+
import "./chunk-BWEKRPFJ.mjs";
|
|
6
|
+
import "./chunk-EL64ZPPN.mjs";
|
|
7
|
+
export {
|
|
8
|
+
AutomationPanel,
|
|
9
|
+
AutomationPanel_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=AutomationPanel-IGLIQY2N.mjs.map
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TriggersSettings
|
|
3
|
+
} from "./chunk-H2MV4XE6.mjs";
|
|
4
|
+
import "./chunk-OAZ2JYXV.mjs";
|
|
5
|
+
import "./chunk-GVHAETEQ.mjs";
|
|
6
|
+
import {
|
|
7
|
+
AutomationPanel
|
|
8
|
+
} from "./chunk-O23LHDEX.mjs";
|
|
9
|
+
import "./chunk-BWEKRPFJ.mjs";
|
|
10
|
+
import {
|
|
11
|
+
meta
|
|
12
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
13
|
+
|
|
14
|
+
// src/containers/AutomationSettings/AutomationSettings.tsx
|
|
15
|
+
import React from "react";
|
|
16
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
17
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
18
|
+
var AutomationSettings = (props) => {
|
|
19
|
+
const { t } = useTranslation(meta.id);
|
|
20
|
+
return /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
21
|
+
title: t("automation verbose label", {
|
|
22
|
+
ns: meta.id
|
|
23
|
+
}),
|
|
24
|
+
description: t("automation description", {
|
|
25
|
+
ns: meta.id
|
|
26
|
+
})
|
|
27
|
+
}, /* @__PURE__ */ React.createElement(AutomationPanel, props), /* @__PURE__ */ React.createElement(TriggersSettings, {
|
|
28
|
+
db: props.space.db
|
|
29
|
+
})));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
// src/containers/AutomationSettings/index.ts
|
|
33
|
+
var AutomationSettings_default = AutomationSettings;
|
|
34
|
+
export {
|
|
35
|
+
AutomationSettings_default as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=AutomationSettings-EDO3N5WI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/AutomationSettings/AutomationSettings.tsx", "../../../src/containers/AutomationSettings/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\n\nimport { AutomationPanel, type AutomationPanelProps } from '../../components/AutomationPanel';\nimport { meta } from '../../meta';\nimport { TriggersSettings } from '../TriggerSettings';\n\nexport const AutomationSettings = (props: AutomationPanelProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <Settings.Root>\n <Settings.Section\n title={t('automation verbose label', { ns: meta.id })}\n description={t('automation description', { ns: meta.id })}\n >\n <AutomationPanel {...props} />\n <TriggersSettings db={props.space.db} />\n </Settings.Section>\n </Settings.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { AutomationSettings } from './AutomationSettings';\n\nexport default AutomationSettings;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,sBAAsB;AAC/B,SAASC,gBAAgB;AAMlB,IAAMC,qBAAqB,CAACC,UAAAA;AACjC,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,SACE,sBAAA,cAACC,SAASC,MAAI,MACZ,sBAAA,cAACD,SAASE,SAAO;IACfC,OAAOP,EAAE,4BAA4B;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;IACnDM,aAAaT,EAAE,0BAA0B;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAEvD,sBAAA,cAACO,iBAAoBX,KAAAA,GACrB,sBAAA,cAACY,kBAAAA;IAAiBC,IAAIb,MAAMc,MAAMD;;AAI1C;;;ACpBA,IAAA,6BAAeE;",
|
|
6
|
+
"names": ["React", "useTranslation", "Settings", "AutomationSettings", "props", "t", "useTranslation", "meta", "id", "Settings", "Root", "Section", "title", "ns", "description", "AutomationPanel", "TriggersSettings", "db", "space", "AutomationSettings"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FunctionsPanel
|
|
3
|
+
} from "./chunk-75XLBFAG.mjs";
|
|
4
|
+
import {
|
|
5
|
+
FunctionsRegistry
|
|
6
|
+
} from "./chunk-FUVAC5EC.mjs";
|
|
7
|
+
import {
|
|
8
|
+
meta
|
|
9
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
10
|
+
|
|
11
|
+
// src/containers/FunctionsContainer/FunctionsContainer.tsx
|
|
12
|
+
import React from "react";
|
|
13
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
14
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
15
|
+
var FunctionsContainer = ({ space }) => {
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
return /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
18
|
+
title: t("functions verbose label", {
|
|
19
|
+
ns: meta.id
|
|
20
|
+
}),
|
|
21
|
+
description: t("functions description", {
|
|
22
|
+
ns: meta.id
|
|
23
|
+
})
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
25
|
+
space
|
|
26
|
+
})), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
27
|
+
title: t("functions registry verbose label", {
|
|
28
|
+
ns: meta.id
|
|
29
|
+
}),
|
|
30
|
+
description: t("functions registry description", {
|
|
31
|
+
ns: meta.id
|
|
32
|
+
})
|
|
33
|
+
}, /* @__PURE__ */ React.createElement(FunctionsRegistry, {
|
|
34
|
+
space
|
|
35
|
+
})));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// src/containers/FunctionsContainer/index.ts
|
|
39
|
+
var FunctionsContainer_default = FunctionsContainer;
|
|
40
|
+
export {
|
|
41
|
+
FunctionsContainer_default as default
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=FunctionsContainer-R4ZMYSFJ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/FunctionsContainer/FunctionsContainer.tsx", "../../../src/containers/FunctionsContainer/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\n\nimport { FunctionsPanel } from '../../components/FunctionsPanel';\nimport { FunctionsRegistry } from '../../components/FunctionsRegistry';\nimport { meta } from '../../meta';\n\nexport const FunctionsContainer = ({ space }: { space: Space }) => {\n const { t } = useTranslation(meta.id);\n return (\n <Settings.Root>\n <Settings.Section\n title={t('functions verbose label', { ns: meta.id })}\n description={t('functions description', { ns: meta.id })}\n >\n <FunctionsPanel space={space} />\n </Settings.Section>\n <Settings.Section\n title={t('functions registry verbose label', { ns: meta.id })}\n description={t('functions registry description', { ns: meta.id })}\n >\n <FunctionsRegistry space={space} />\n </Settings.Section>\n </Settings.Root>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FunctionsContainer } from './FunctionsContainer';\n\nexport default FunctionsContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,gBAAgB;AAMlB,IAAMC,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;AAC5D,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,SACE,sBAAA,cAACC,SAASC,MAAI,MACZ,sBAAA,cAACD,SAASE,SAAO;IACfC,OAAOP,EAAE,2BAA2B;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;IAClDM,aAAaT,EAAE,yBAAyB;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAEtD,sBAAA,cAACO,gBAAAA;IAAeX;OAElB,sBAAA,cAACK,SAASE,SAAO;IACfC,OAAOP,EAAE,oCAAoC;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;IAC3DM,aAAaT,EAAE,kCAAkC;MAAEQ,IAAIN,KAAKC;IAAG,CAAA;KAE/D,sBAAA,cAACQ,mBAAAA;IAAkBZ;;AAI3B;;;AC1BA,IAAA,6BAAea;",
|
|
6
|
+
"names": ["React", "useTranslation", "Settings", "FunctionsContainer", "space", "t", "useTranslation", "meta", "id", "Settings", "Root", "Section", "title", "ns", "description", "FunctionsPanel", "FunctionsRegistry", "FunctionsContainer"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
FunctionsPanel,
|
|
3
3
|
FunctionsPanel_default
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-75XLBFAG.mjs";
|
|
5
|
+
import "./chunk-EL64ZPPN.mjs";
|
|
6
6
|
export {
|
|
7
7
|
FunctionsPanel,
|
|
8
8
|
FunctionsPanel_default as default
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=FunctionsPanel-
|
|
10
|
+
//# sourceMappingURL=FunctionsPanel-NMA4RYJL.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TriggersSettings
|
|
3
|
+
} from "./chunk-H2MV4XE6.mjs";
|
|
4
|
+
import "./chunk-OAZ2JYXV.mjs";
|
|
5
|
+
import "./chunk-GVHAETEQ.mjs";
|
|
6
|
+
import "./chunk-EL64ZPPN.mjs";
|
|
7
|
+
export {
|
|
8
|
+
TriggersSettings,
|
|
9
|
+
TriggersSettings as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=TriggerSettings-56AIMOEC.mjs.map
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import { Capability } from "@dxos/app-framework";
|
|
8
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
9
|
+
import { Script } from "@dxos/functions";
|
|
10
|
+
import { COMPANION_PREFIX } from "@dxos/app-toolkit";
|
|
11
|
+
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
12
|
+
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
13
|
+
import { meta as spaceMeta } from "@dxos/plugin-space";
|
|
14
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
15
|
+
const extensions = yield* Effect.all([
|
|
16
|
+
GraphBuilder.createExtension({
|
|
17
|
+
id: `${meta.id}.space-settings-automation`,
|
|
18
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
19
|
+
connector: (node) => Effect.succeed([
|
|
20
|
+
{
|
|
21
|
+
id: `${meta.id}.automations`,
|
|
22
|
+
type: `${meta.id}.space-settings-automation`,
|
|
23
|
+
data: `${meta.id}.space-settings-automation`,
|
|
24
|
+
properties: {
|
|
25
|
+
label: [
|
|
26
|
+
"automation panel label",
|
|
27
|
+
{
|
|
28
|
+
ns: meta.id
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
icon: "ph--lightning--regular"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
])
|
|
35
|
+
}),
|
|
36
|
+
GraphBuilder.createExtension({
|
|
37
|
+
id: `${meta.id}.space-settings-functions`,
|
|
38
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
39
|
+
connector: (node) => Effect.succeed([
|
|
40
|
+
{
|
|
41
|
+
id: `${meta.id}.functions`,
|
|
42
|
+
type: `${meta.id}.space-settings-functions`,
|
|
43
|
+
data: `${meta.id}.space-settings-functions`,
|
|
44
|
+
properties: {
|
|
45
|
+
label: [
|
|
46
|
+
"functions panel label",
|
|
47
|
+
{
|
|
48
|
+
ns: meta.id
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
icon: "ph--function--regular"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
])
|
|
55
|
+
}),
|
|
56
|
+
GraphBuilder.createTypeExtension({
|
|
57
|
+
id: `${meta.id}.script-companion`,
|
|
58
|
+
type: Script.Script,
|
|
59
|
+
connector: (script) => Effect.succeed([
|
|
60
|
+
{
|
|
61
|
+
id: `${COMPANION_PREFIX}automation`,
|
|
62
|
+
type: PLANK_COMPANION_TYPE,
|
|
63
|
+
data: "automation",
|
|
64
|
+
properties: {
|
|
65
|
+
label: [
|
|
66
|
+
"script automation label",
|
|
67
|
+
{
|
|
68
|
+
ns: meta.id
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
icon: "ph--lightning--regular",
|
|
72
|
+
disposition: "hidden"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
])
|
|
76
|
+
})
|
|
77
|
+
]);
|
|
78
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
79
|
+
}));
|
|
80
|
+
export {
|
|
81
|
+
app_graph_builder_default as default
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=app-graph-builder-74ILZP25.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/app-graph-builder/app-graph-builder.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { Script } from '@dxos/functions';\nimport { COMPANION_PREFIX } from '@dxos/app-toolkit';\nimport { PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';\nimport { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';\nimport { meta as spaceMeta } from '@dxos/plugin-space';\n\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n GraphBuilder.createExtension({\n id: `${meta.id}.space-settings-automation`,\n match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),\n connector: (node) =>\n Effect.succeed([\n {\n id: `${meta.id}.automations`,\n type: `${meta.id}.space-settings-automation`,\n data: `${meta.id}.space-settings-automation`,\n properties: {\n label: ['automation panel label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n },\n },\n ]),\n }),\n GraphBuilder.createExtension({\n id: `${meta.id}.space-settings-functions`,\n match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),\n connector: (node) =>\n Effect.succeed([\n {\n id: `${meta.id}.functions`,\n type: `${meta.id}.space-settings-functions`,\n data: `${meta.id}.space-settings-functions`,\n properties: {\n label: ['functions panel label', { ns: meta.id }],\n icon: 'ph--function--regular',\n },\n },\n ]),\n }),\n GraphBuilder.createTypeExtension({\n id: `${meta.id}.script-companion`,\n type: Script.Script,\n connector: (script) =>\n Effect.succeed([\n {\n id: `${COMPANION_PREFIX}automation`,\n type: PLANK_COMPANION_TYPE,\n data: 'automation',\n properties: {\n label: ['script automation label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n disposition: 'hidden',\n },\n },\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAChC,SAASC,cAAc;AACvB,SAASC,wBAAwB;AACjC,SAASC,4BAA4B;AACrC,SAASC,cAAcC,mBAAmB;AAC1C,SAASC,QAAQC,iBAAiB;AAIlC,IAAA,4BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,QAAMC,aAAa,OAAcC,WAAI;IACnCC,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC,aAAa,GAAGC,UAAUL,EAAE,WAAW;MAC1DM,WAAW,CAACC,SACHC,eAAQ;QACb;UACER,IAAI,GAAGC,KAAKD,EAAE;UACdS,MAAM,GAAGR,KAAKD,EAAE;UAChBU,MAAM,GAAGT,KAAKD,EAAE;UAChBW,YAAY;YACVC,OAAO;cAAC;cAA0B;gBAAEC,IAAIZ,KAAKD;cAAG;;YAChDc,MAAM;UACR;QACF;OACD;IACL,CAAA;IACAhB,aAAaC,gBAAgB;MAC3BC,IAAI,GAAGC,KAAKD,EAAE;MACdE,OAAOC,YAAYC,aAAa,GAAGC,UAAUL,EAAE,WAAW;MAC1DM,WAAW,CAACC,SACHC,eAAQ;QACb;UACER,IAAI,GAAGC,KAAKD,EAAE;UACdS,MAAM,GAAGR,KAAKD,EAAE;UAChBU,MAAM,GAAGT,KAAKD,EAAE;UAChBW,YAAY;YACVC,OAAO;cAAC;cAAyB;gBAAEC,IAAIZ,KAAKD;cAAG;;YAC/Cc,MAAM;UACR;QACF;OACD;IACL,CAAA;IACAhB,aAAaiB,oBAAoB;MAC/Bf,IAAI,GAAGC,KAAKD,EAAE;MACdS,MAAMO,OAAOA;MACbV,WAAW,CAACW,WACHT,eAAQ;QACb;UACER,IAAI,GAAGkB,gBAAAA;UACPT,MAAMU;UACNT,MAAM;UACNC,YAAY;YACVC,OAAO;cAAC;cAA2B;gBAAEC,IAAIZ,KAAKD;cAAG;;YACjDc,MAAM;YACNM,aAAa;UACf;QACF;OACD;IACL,CAAA;GACD;AAED,SAAO3B,WAAW4B,YAAYC,gBAAgBC,iBAAiB3B,UAAAA;AACjE,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "Script", "COMPANION_PREFIX", "PLANK_COMPANION_TYPE", "GraphBuilder", "NodeMatcher", "meta", "spaceMeta", "Capability", "makeModule", "fnUntraced", "extensions", "all", "GraphBuilder", "createExtension", "id", "meta", "match", "NodeMatcher", "whenNodeType", "spaceMeta", "connector", "node", "succeed", "type", "data", "properties", "label", "ns", "icon", "createTypeExtension", "Script", "script", "COMPANION_PREFIX", "PLANK_COMPANION_TYPE", "disposition", "contributes", "AppCapabilities", "AppGraphBuilder"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/FunctionsPanel/FunctionsPanel.tsx
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import React, { useCallback, useMemo } from "react";
|
|
8
|
+
import { useOperationInvoker } from "@dxos/app-framework/ui";
|
|
9
|
+
import { LayoutOperation, getObjectPathFromObject } from "@dxos/app-toolkit";
|
|
10
|
+
import { Function, Script } from "@dxos/functions";
|
|
11
|
+
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
12
|
+
import { Filter, useQuery } from "@dxos/react-client/echo";
|
|
13
|
+
import { Button, IconButton, useTranslation } from "@dxos/react-ui";
|
|
14
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
15
|
+
import { List } from "@dxos/react-ui-list";
|
|
16
|
+
import { ghostHover, mx } from "@dxos/ui-theme";
|
|
17
|
+
var FunctionsPanel = ({ space }) => {
|
|
18
|
+
const { t } = useTranslation(meta.id);
|
|
19
|
+
const functions = useQuery(space.db, Filter.type(Function.Function));
|
|
20
|
+
const scripts = useQuery(space.db, Filter.type(Script.Script));
|
|
21
|
+
const { invokePromise } = useOperationInvoker();
|
|
22
|
+
const functionToScriptMap = useMemo(() => functions.reduce((map, func) => {
|
|
23
|
+
const scriptId = func.source?.target?.id;
|
|
24
|
+
if (scriptId) {
|
|
25
|
+
const script = scripts.find((s) => s.id === scriptId);
|
|
26
|
+
if (script) {
|
|
27
|
+
map[func.id] = script;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return map;
|
|
31
|
+
}, {}), [
|
|
32
|
+
functions,
|
|
33
|
+
scripts
|
|
34
|
+
]);
|
|
35
|
+
const getScriptName = useCallback((func) => {
|
|
36
|
+
const script = functionToScriptMap[func.id];
|
|
37
|
+
return script?.name;
|
|
38
|
+
}, [
|
|
39
|
+
functionToScriptMap
|
|
40
|
+
]);
|
|
41
|
+
const handleGoToScript = useCallback((func) => {
|
|
42
|
+
const script = functionToScriptMap[func.id];
|
|
43
|
+
if (script) {
|
|
44
|
+
void invokePromise(LayoutOperation.Open, {
|
|
45
|
+
subject: [
|
|
46
|
+
getObjectPathFromObject(script)
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}, [
|
|
51
|
+
functionToScriptMap,
|
|
52
|
+
invokePromise
|
|
53
|
+
]);
|
|
54
|
+
const handleDelete = useCallback((func) => invokePromise(SpaceOperation.RemoveObjects, {
|
|
55
|
+
objects: [
|
|
56
|
+
func
|
|
57
|
+
]
|
|
58
|
+
}), [
|
|
59
|
+
invokePromise
|
|
60
|
+
]);
|
|
61
|
+
return /* @__PURE__ */ React.createElement(Settings.Container, null, functions.length > 0 && /* @__PURE__ */ React.createElement(List.Root, {
|
|
62
|
+
items: functions,
|
|
63
|
+
isItem: Schema.is(Function.Function),
|
|
64
|
+
getId: (func) => func.id
|
|
65
|
+
}, ({ items }) => /* @__PURE__ */ React.createElement("div", {
|
|
66
|
+
role: "list",
|
|
67
|
+
className: "flex flex-col w-full"
|
|
68
|
+
}, items?.map((func) => /* @__PURE__ */ React.createElement(List.Item, {
|
|
69
|
+
key: func.id,
|
|
70
|
+
item: func,
|
|
71
|
+
classNames: mx("grid grid-cols-[1fr_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center", ghostHover)
|
|
72
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
73
|
+
className: "flex flex-col truncate"
|
|
74
|
+
}, /* @__PURE__ */ React.createElement(List.ItemTitle, {
|
|
75
|
+
classNames: "truncate"
|
|
76
|
+
}, func.name), getScriptName(func) && /* @__PURE__ */ React.createElement("div", {
|
|
77
|
+
className: "text-xs text-description truncate"
|
|
78
|
+
}, getScriptName(func))), functionToScriptMap[func.id] && /* @__PURE__ */ React.createElement(Button, {
|
|
79
|
+
onClick: () => handleGoToScript(func)
|
|
80
|
+
}, t("go to function source button label")), /* @__PURE__ */ React.createElement(IconButton, {
|
|
81
|
+
iconOnly: true,
|
|
82
|
+
icon: "ph--trash--regular",
|
|
83
|
+
label: t("delete function button label"),
|
|
84
|
+
onClick: () => handleDelete(func)
|
|
85
|
+
}))))), functions.length === 0 && /* @__PURE__ */ React.createElement("div", {
|
|
86
|
+
className: "text-center py-4 text-description"
|
|
87
|
+
}, t("no functions found")));
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// src/components/FunctionsPanel/index.ts
|
|
91
|
+
var FunctionsPanel_default = FunctionsPanel;
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
FunctionsPanel,
|
|
95
|
+
FunctionsPanel_default
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=chunk-75XLBFAG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/FunctionsPanel/FunctionsPanel.tsx", "../../../src/components/FunctionsPanel/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\nimport React, { useCallback, useMemo } from 'react';\n\nimport { useOperationInvoker } from '@dxos/app-framework/ui';\nimport { LayoutOperation, getObjectPathFromObject } from '@dxos/app-toolkit';\nimport { Obj } from '@dxos/echo';\nimport { Function, Script } from '@dxos/functions';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Filter, type Space, useQuery } from '@dxos/react-client/echo';\nimport { Button, IconButton, useTranslation } from '@dxos/react-ui';\nimport { Settings } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/ui-theme';\n\nimport { meta } from '../../meta';\n\nexport type FunctionsPanelProps = {\n space: Space;\n};\n\nexport const FunctionsPanel = ({ space }: FunctionsPanelProps) => {\n const { t } = useTranslation(meta.id);\n const functions = useQuery(space.db, Filter.type(Function.Function));\n const scripts = useQuery(space.db, Filter.type(Script.Script));\n const { invokePromise } = useOperationInvoker();\n\n const functionToScriptMap = useMemo(\n () =>\n functions.reduce(\n (map, func) => {\n const scriptId = func.source?.target?.id;\n if (scriptId) {\n const script = scripts.find((s) => s.id === scriptId);\n if (script) {\n map[func.id] = script;\n }\n }\n return map;\n },\n {} as Record<string, Script.Script>,\n ),\n [functions, scripts],\n );\n\n const getScriptName = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n return script?.name;\n },\n [functionToScriptMap],\n );\n\n const handleGoToScript = useCallback(\n (func: Function.Function) => {\n const script = functionToScriptMap[func.id];\n if (script) {\n void invokePromise(LayoutOperation.Open, { subject: [getObjectPathFromObject(script)] });\n }\n },\n [functionToScriptMap, invokePromise],\n );\n\n const handleDelete = useCallback(\n (func: Function.Function) => invokePromise(SpaceOperation.RemoveObjects, { objects: [func] }),\n [invokePromise],\n );\n\n return (\n <Settings.Container>\n {functions.length > 0 && (\n <List.Root<Function.Function> items={functions} isItem={Schema.is(Function.Function)} getId={(func) => func.id}>\n {({ items }) => (\n <div role='list' className='flex flex-col w-full'>\n {items?.map((func) => (\n <List.Item<Function.Function>\n key={func.id}\n item={func}\n classNames={mx('grid grid-cols-[1fr_auto] min-h-[2.5rem] min-h-[3rem] px-2 items-center', ghostHover)}\n >\n <div className='flex flex-col truncate'>\n <List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>\n {getScriptName(func) && (\n <div className='text-xs text-description truncate'>{getScriptName(func)}</div>\n )}\n </div>\n {functionToScriptMap[func.id] && (\n <Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>\n )}\n <IconButton\n iconOnly\n icon='ph--trash--regular'\n label={t('delete function button label')}\n onClick={() => handleDelete(func)}\n />\n </List.Item>\n ))}\n </div>\n )}\n </List.Root>\n )}\n\n {functions.length === 0 && <div className='text-center py-4 text-description'>{t('no functions found')}</div>}\n </Settings.Container>\n );\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { FunctionsPanel } from './FunctionsPanel';\n\nexport * from './FunctionsPanel';\nexport default FunctionsPanel;\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,SAASC,aAAaC,eAAe;AAE5C,SAASC,2BAA2B;AACpC,SAASC,iBAAiBC,+BAA+B;AAEzD,SAASC,UAAUC,cAAc;AACjC,SAASC,sBAAsB;AAC/B,SAASC,QAAoBC,gBAAgB;AAC7C,SAASC,QAAQC,YAAYC,sBAAsB;AACnD,SAASC,gBAAgB;AACzB,SAASC,YAAY;AACrB,SAASC,YAAYC,UAAU;AAQxB,IAAMC,iBAAiB,CAAC,EAAEC,MAAK,MAAuB;AAC3D,QAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,QAAMC,YAAYC,SAASN,MAAMO,IAAIC,OAAOC,KAAKC,SAASA,QAAQ,CAAA;AAClE,QAAMC,UAAUL,SAASN,MAAMO,IAAIC,OAAOC,KAAKG,OAAOA,MAAM,CAAA;AAC5D,QAAM,EAAEC,cAAa,IAAKC,oBAAAA;AAE1B,QAAMC,sBAAsBC,QAC1B,MACEX,UAAUY,OACR,CAACC,KAAKC,SAAAA;AACJ,UAAMC,WAAWD,KAAKE,QAAQC,QAAQlB;AACtC,QAAIgB,UAAU;AACZ,YAAMG,SAASZ,QAAQa,KAAK,CAACC,MAAMA,EAAErB,OAAOgB,QAAAA;AAC5C,UAAIG,QAAQ;AACVL,YAAIC,KAAKf,EAAE,IAAImB;MACjB;IACF;AACA,WAAOL;EACT,GACA,CAAC,CAAA,GAEL;IAACb;IAAWM;GAAQ;AAGtB,QAAMe,gBAAgBC,YACpB,CAACR,SAAAA;AACC,UAAMI,SAASR,oBAAoBI,KAAKf,EAAE;AAC1C,WAAOmB,QAAQK;EACjB,GACA;IAACb;GAAoB;AAGvB,QAAMc,mBAAmBF,YACvB,CAACR,SAAAA;AACC,UAAMI,SAASR,oBAAoBI,KAAKf,EAAE;AAC1C,QAAImB,QAAQ;AACV,WAAKV,cAAciB,gBAAgBC,MAAM;QAAEC,SAAS;UAACC,wBAAwBV,MAAAA;;MAAS,CAAA;IACxF;EACF,GACA;IAACR;IAAqBF;GAAc;AAGtC,QAAMqB,eAAeP,YACnB,CAACR,SAA4BN,cAAcsB,eAAeC,eAAe;IAAEC,SAAS;MAAClB;;EAAM,CAAA,GAC3F;IAACN;GAAc;AAGjB,SACE,sBAAA,cAACyB,SAASC,WAAS,MAChBlC,UAAUmC,SAAS,KAClB,sBAAA,cAACC,KAAKC,MAAI;IAAoBC,OAAOtC;IAAWuC,QAAeC,UAAGnC,SAASA,QAAQ;IAAGoC,OAAO,CAAC3B,SAASA,KAAKf;KACzG,CAAC,EAAEuC,MAAK,MACP,sBAAA,cAACI,OAAAA;IAAIC,MAAK;IAAOC,WAAU;KACxBN,OAAOzB,IAAI,CAACC,SACX,sBAAA,cAACsB,KAAKS,MAAI;IACRC,KAAKhC,KAAKf;IACVgD,MAAMjC;IACNkC,YAAYC,GAAG,2EAA2EC,UAAAA;KAE1F,sBAAA,cAACR,OAAAA;IAAIE,WAAU;KACb,sBAAA,cAACR,KAAKe,WAAS;IAACH,YAAW;KAAYlC,KAAKS,IAAI,GAC/CF,cAAcP,IAAAA,KACb,sBAAA,cAAC4B,OAAAA;IAAIE,WAAU;KAAqCvB,cAAcP,IAAAA,CAAAA,CAAAA,GAGrEJ,oBAAoBI,KAAKf,EAAE,KAC1B,sBAAA,cAACqD,QAAAA;IAAOC,SAAS,MAAM7B,iBAAiBV,IAAAA;KAAQlB,EAAE,oCAAA,CAAA,GAEpD,sBAAA,cAAC0D,YAAAA;IACCC,UAAAA;IACAC,MAAK;IACLC,OAAO7D,EAAE,8BAAA;IACTyD,SAAS,MAAMxB,aAAaf,IAAAA;UASzCd,UAAUmC,WAAW,KAAK,sBAAA,cAACO,OAAAA;IAAIE,WAAU;KAAqChD,EAAE,oBAAA,CAAA,CAAA;AAGvF;;;ACrGA,IAAA,yBAAe8D;",
|
|
6
|
+
"names": ["Schema", "React", "useCallback", "useMemo", "useOperationInvoker", "LayoutOperation", "getObjectPathFromObject", "Function", "Script", "SpaceOperation", "Filter", "useQuery", "Button", "IconButton", "useTranslation", "Settings", "List", "ghostHover", "mx", "FunctionsPanel", "space", "t", "useTranslation", "meta", "id", "functions", "useQuery", "db", "Filter", "type", "Function", "scripts", "Script", "invokePromise", "useOperationInvoker", "functionToScriptMap", "useMemo", "reduce", "map", "func", "scriptId", "source", "target", "script", "find", "s", "getScriptName", "useCallback", "name", "handleGoToScript", "LayoutOperation", "Open", "subject", "getObjectPathFromObject", "handleDelete", "SpaceOperation", "RemoveObjects", "objects", "Settings", "Container", "length", "List", "Root", "items", "isItem", "is", "getId", "div", "role", "className", "Item", "key", "item", "classNames", "mx", "ghostHover", "ItemTitle", "Button", "onClick", "IconButton", "iconOnly", "icon", "label", "FunctionsPanel"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
6
|
+
import React3, { useCallback as useCallback3, useMemo as useMemo3 } from "react";
|
|
7
|
+
import { ComputeGraph } from "@dxos/conductor";
|
|
8
|
+
import { DXN, Entity, Feed, Obj as Obj2 } from "@dxos/echo";
|
|
9
|
+
import { Function, Script, Trigger as Trigger2 } from "@dxos/functions";
|
|
10
|
+
import { Filter as Filter2, Ref as Ref2, useQuery } from "@dxos/react-client/echo";
|
|
11
|
+
import { Input } from "@dxos/react-ui";
|
|
12
|
+
import { QueryForm } from "@dxos/react-ui-components";
|
|
13
|
+
import { Form as Form2, FormFieldLabel, SelectField as SelectField2, omitId } from "@dxos/react-ui-form";
|
|
14
|
+
|
|
15
|
+
// src/components/TriggerEditor/FunctionInputEditor.tsx
|
|
16
|
+
import React, { useCallback, useMemo } from "react";
|
|
17
|
+
import { JsonSchema, Obj, Ref } from "@dxos/echo";
|
|
18
|
+
import { useOnTransition, useTranslation } from "@dxos/react-ui";
|
|
19
|
+
import { Form, useFormValues } from "@dxos/react-ui-form";
|
|
20
|
+
var FunctionInputEditor = ({ type, functions, db, getValue, onValueChange }) => {
|
|
21
|
+
const { t } = useTranslation(meta.id);
|
|
22
|
+
const selectedFunctionValue = useFormValues(FunctionInputEditor.displayName, [
|
|
23
|
+
"function"
|
|
24
|
+
]);
|
|
25
|
+
const selectedFunctionId = useMemo(() => {
|
|
26
|
+
if (Ref.isRef(selectedFunctionValue)) {
|
|
27
|
+
return selectedFunctionValue.dxn.toString().split("dxn:echo:@:").at(1);
|
|
28
|
+
}
|
|
29
|
+
}, [
|
|
30
|
+
selectedFunctionValue
|
|
31
|
+
]);
|
|
32
|
+
const selectedFunction = useMemo(() => functions.find((fn) => fn.id === selectedFunctionId), [
|
|
33
|
+
functions,
|
|
34
|
+
selectedFunctionId
|
|
35
|
+
]);
|
|
36
|
+
useOnTransition(
|
|
37
|
+
// Clear function parameter input when the function changes.
|
|
38
|
+
selectedFunctionValue,
|
|
39
|
+
(prevValue) => {
|
|
40
|
+
if (!Ref.isRef(prevValue) || !Ref.isRef(selectedFunctionValue)) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return prevValue.dxn.toString() !== selectedFunctionValue.dxn.toString();
|
|
44
|
+
},
|
|
45
|
+
(currValue) => currValue !== void 0,
|
|
46
|
+
() => onValueChange(type, {})
|
|
47
|
+
);
|
|
48
|
+
const inputSchema = useMemo(() => selectedFunction?.inputSchema, [
|
|
49
|
+
selectedFunction
|
|
50
|
+
]);
|
|
51
|
+
const effectSchema = useMemo(() => inputSchema ? JsonSchema.toEffectSchema(inputSchema) : void 0, [
|
|
52
|
+
inputSchema
|
|
53
|
+
]);
|
|
54
|
+
const propertyCount = inputSchema?.properties ? Object.keys(inputSchema.properties).length : 0;
|
|
55
|
+
const defaultValues = useMemo(() => {
|
|
56
|
+
const raw = getValue() ?? {};
|
|
57
|
+
return Obj.isObject(raw) ? {
|
|
58
|
+
...Obj.getSnapshot(raw)
|
|
59
|
+
} : {
|
|
60
|
+
...raw
|
|
61
|
+
};
|
|
62
|
+
}, [
|
|
63
|
+
getValue
|
|
64
|
+
]);
|
|
65
|
+
const handleValuesChanged = useCallback((values) => {
|
|
66
|
+
onValueChange(type, values);
|
|
67
|
+
}, [
|
|
68
|
+
type,
|
|
69
|
+
onValueChange
|
|
70
|
+
]);
|
|
71
|
+
if (selectedFunction === void 0 || effectSchema === void 0 || propertyCount === 0) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Form.Label, {
|
|
75
|
+
label: t("function parameters label"),
|
|
76
|
+
asChild: true
|
|
77
|
+
}), /* @__PURE__ */ React.createElement(Form.Root, {
|
|
78
|
+
key: selectedFunction.id,
|
|
79
|
+
schema: effectSchema,
|
|
80
|
+
defaultValues,
|
|
81
|
+
db,
|
|
82
|
+
onValuesChanged: handleValuesChanged
|
|
83
|
+
}, /* @__PURE__ */ React.createElement(Form.FieldSet, null)));
|
|
84
|
+
};
|
|
85
|
+
FunctionInputEditor.displayName = "AutomationTrigger.FunctionInputEditor";
|
|
86
|
+
|
|
87
|
+
// src/components/TriggerEditor/SpecSelector.tsx
|
|
88
|
+
import React2, { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
89
|
+
import { Filter, Query } from "@dxos/echo";
|
|
90
|
+
import { Trigger } from "@dxos/functions";
|
|
91
|
+
import { useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
92
|
+
import { SelectField, useFormFieldState } from "@dxos/react-ui-form";
|
|
93
|
+
var SpecSelector = (props) => {
|
|
94
|
+
const { t } = useTranslation2(meta.id);
|
|
95
|
+
const specProps = useFormFieldState(SpecSelector.displayName, [
|
|
96
|
+
"spec"
|
|
97
|
+
]);
|
|
98
|
+
const handleTypeChange = useCallback2((_type, value) => {
|
|
99
|
+
const getDefaultTriggerSpec = (kind) => {
|
|
100
|
+
switch (kind) {
|
|
101
|
+
case "timer":
|
|
102
|
+
return {
|
|
103
|
+
kind: "timer",
|
|
104
|
+
cron: ""
|
|
105
|
+
};
|
|
106
|
+
case "subscription":
|
|
107
|
+
return {
|
|
108
|
+
kind: "subscription",
|
|
109
|
+
query: {
|
|
110
|
+
ast: Query.select(Filter.nothing()).ast
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
case "queue":
|
|
114
|
+
return {
|
|
115
|
+
kind: "queue",
|
|
116
|
+
queue: "dxn:queue:default"
|
|
117
|
+
};
|
|
118
|
+
case "email":
|
|
119
|
+
return {
|
|
120
|
+
kind: "email"
|
|
121
|
+
};
|
|
122
|
+
case "webhook":
|
|
123
|
+
return {
|
|
124
|
+
kind: "webhook"
|
|
125
|
+
};
|
|
126
|
+
default:
|
|
127
|
+
return void 0;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
const defaultSpec = getDefaultTriggerSpec(value);
|
|
131
|
+
if (!defaultSpec) {
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
specProps.onValueChange(props.type, defaultSpec);
|
|
135
|
+
}, [
|
|
136
|
+
props.type,
|
|
137
|
+
specProps
|
|
138
|
+
]);
|
|
139
|
+
const options = useMemo2(() => Trigger.Kinds.map((kind) => ({
|
|
140
|
+
value: kind,
|
|
141
|
+
label: t(`trigger type ${kind}`)
|
|
142
|
+
})), [
|
|
143
|
+
t
|
|
144
|
+
]);
|
|
145
|
+
return /* @__PURE__ */ React2.createElement(SelectField, {
|
|
146
|
+
...props,
|
|
147
|
+
options,
|
|
148
|
+
onValueChange: handleTypeChange
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
SpecSelector.displayName = "Form.SpecSelector";
|
|
152
|
+
|
|
153
|
+
// src/components/TriggerEditor/TriggerEditor.tsx
|
|
154
|
+
var TriggerEditor = ({ db, types, tags, readonlySpec, trigger, ...formProps }) => {
|
|
155
|
+
const fieldMap = useCustomInputs({
|
|
156
|
+
db,
|
|
157
|
+
types,
|
|
158
|
+
tags,
|
|
159
|
+
readonlySpec
|
|
160
|
+
});
|
|
161
|
+
const handleValuesChanged = useCallback3((newValues) => {
|
|
162
|
+
Obj2.change(trigger, (t) => {
|
|
163
|
+
Object.assign(t, newValues);
|
|
164
|
+
});
|
|
165
|
+
}, [
|
|
166
|
+
trigger
|
|
167
|
+
]);
|
|
168
|
+
const triggerSchema = useMemo3(() => omitId(Trigger2.Trigger), []);
|
|
169
|
+
const defaultValues = useMemo3(() => {
|
|
170
|
+
const { id: _, ...values } = trigger;
|
|
171
|
+
return values;
|
|
172
|
+
}, [
|
|
173
|
+
trigger
|
|
174
|
+
]);
|
|
175
|
+
return /* @__PURE__ */ React3.createElement(Form2.Root, {
|
|
176
|
+
...formProps,
|
|
177
|
+
db,
|
|
178
|
+
schema: triggerSchema,
|
|
179
|
+
defaultValues,
|
|
180
|
+
fieldMap,
|
|
181
|
+
onValuesChanged: handleValuesChanged
|
|
182
|
+
}, /* @__PURE__ */ React3.createElement(Form2.Viewport, null, /* @__PURE__ */ React3.createElement(Form2.Content, null, /* @__PURE__ */ React3.createElement(Form2.FieldSet, null), /* @__PURE__ */ React3.createElement(Form2.Actions, null))));
|
|
183
|
+
};
|
|
184
|
+
var useCustomInputs = ({ db, readonlySpec, types, tags }) => {
|
|
185
|
+
const functions = useQuery(db, Filter2.type(Function.Function));
|
|
186
|
+
const workflows = useQuery(db, Filter2.type(ComputeGraph));
|
|
187
|
+
const scripts = useQuery(db, Filter2.type(Script.Script));
|
|
188
|
+
const feeds = useQuery(db, Filter2.type(Feed.Feed));
|
|
189
|
+
return useMemo3(() => ({
|
|
190
|
+
// Function selector.
|
|
191
|
+
["function"]: (props) => {
|
|
192
|
+
const getValue = useCallback3(() => {
|
|
193
|
+
const formValue = props.getValue();
|
|
194
|
+
if (Ref2.isRef(formValue)) {
|
|
195
|
+
return formValue.dxn.toString();
|
|
196
|
+
}
|
|
197
|
+
return void 0;
|
|
198
|
+
}, [
|
|
199
|
+
props
|
|
200
|
+
]);
|
|
201
|
+
const handleOnValueChange = useCallback3((_type, dxnString) => {
|
|
202
|
+
const dxn = DXN.parse(dxnString);
|
|
203
|
+
if (dxn) {
|
|
204
|
+
const ref = Ref2.fromDXN(dxn);
|
|
205
|
+
props.onValueChange(props.type, ref);
|
|
206
|
+
}
|
|
207
|
+
}, [
|
|
208
|
+
props.type,
|
|
209
|
+
props.onValueChange
|
|
210
|
+
]);
|
|
211
|
+
return /* @__PURE__ */ React3.createElement(SelectField2, {
|
|
212
|
+
...props,
|
|
213
|
+
getValue,
|
|
214
|
+
onValueChange: handleOnValueChange,
|
|
215
|
+
options: getWorkflowOptions(workflows).concat(getFunctionOptions(scripts, functions))
|
|
216
|
+
});
|
|
217
|
+
},
|
|
218
|
+
// Spec selector.
|
|
219
|
+
"spec.kind": (props) => /* @__PURE__ */ React3.createElement(SpecSelector, {
|
|
220
|
+
...props,
|
|
221
|
+
readonly: readonlySpec
|
|
222
|
+
}),
|
|
223
|
+
// Queue feed selector with parent labels.
|
|
224
|
+
"spec.queue": (props) => /* @__PURE__ */ React3.createElement(SelectField2, {
|
|
225
|
+
...props,
|
|
226
|
+
options: getFeedQueueOptions(feeds)
|
|
227
|
+
}),
|
|
228
|
+
// TODO(wittjosiah): Copied from ViewEditor.
|
|
229
|
+
// Query input editor.
|
|
230
|
+
"spec.query": (props) => {
|
|
231
|
+
const handleChange = useCallback3((query) => props.onValueChange(props.type, {
|
|
232
|
+
ast: query.ast
|
|
233
|
+
}), [
|
|
234
|
+
props.type,
|
|
235
|
+
props.onValueChange
|
|
236
|
+
]);
|
|
237
|
+
return /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(FormFieldLabel, {
|
|
238
|
+
label: props.label,
|
|
239
|
+
asChild: true
|
|
240
|
+
}), /* @__PURE__ */ React3.createElement(QueryForm, {
|
|
241
|
+
initialQuery: props.getValue().ast,
|
|
242
|
+
types,
|
|
243
|
+
tags,
|
|
244
|
+
onChange: handleChange
|
|
245
|
+
}));
|
|
246
|
+
},
|
|
247
|
+
// Function input editor.
|
|
248
|
+
input: (props) => /* @__PURE__ */ React3.createElement(FunctionInputEditor, {
|
|
249
|
+
...props,
|
|
250
|
+
functions,
|
|
251
|
+
db
|
|
252
|
+
})
|
|
253
|
+
}), [
|
|
254
|
+
workflows,
|
|
255
|
+
scripts,
|
|
256
|
+
functions,
|
|
257
|
+
feeds,
|
|
258
|
+
readonlySpec
|
|
259
|
+
]);
|
|
260
|
+
};
|
|
261
|
+
var getWorkflowOptions = (graphs) => {
|
|
262
|
+
return graphs.map((graph) => ({
|
|
263
|
+
label: `compute-${graph.id}`,
|
|
264
|
+
value: `dxn:echo:@:${graph.id}`
|
|
265
|
+
}));
|
|
266
|
+
};
|
|
267
|
+
var getFunctionOptions = (scripts, functions) => {
|
|
268
|
+
const getLabel = (fn) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
269
|
+
return functions.map((fn) => ({
|
|
270
|
+
label: getLabel(fn),
|
|
271
|
+
value: `dxn:echo:@:${fn.id}`
|
|
272
|
+
}));
|
|
273
|
+
};
|
|
274
|
+
var getFeedQueueOptions = (feeds) => {
|
|
275
|
+
return feeds.flatMap((feed) => {
|
|
276
|
+
const queueDxn = Feed.getQueueDxn(feed);
|
|
277
|
+
if (!queueDxn) {
|
|
278
|
+
return [];
|
|
279
|
+
}
|
|
280
|
+
const parent = Obj2.getParent(feed);
|
|
281
|
+
const label = parent ? Entity.getLabel(parent) : Entity.getLabel(feed);
|
|
282
|
+
return [
|
|
283
|
+
{
|
|
284
|
+
label: label ?? feed.id,
|
|
285
|
+
value: queueDxn.toString()
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
});
|
|
289
|
+
};
|
|
290
|
+
|
|
291
|
+
export {
|
|
292
|
+
TriggerEditor
|
|
293
|
+
};
|
|
294
|
+
//# sourceMappingURL=chunk-BWEKRPFJ.mjs.map
|