@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,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationOperation
|
|
3
|
+
} from "./chunk-GVHAETEQ.mjs";
|
|
4
|
+
import {
|
|
5
|
+
meta
|
|
6
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
7
|
+
|
|
8
|
+
// src/capabilities/operation-resolver/operation-resolver.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
11
|
+
import { LayoutOperation, getSpacePath } from "@dxos/app-toolkit";
|
|
12
|
+
import { Obj, Ref } from "@dxos/echo";
|
|
13
|
+
import { Function, Script, Trigger } from "@dxos/functions";
|
|
14
|
+
import { Operation, OperationResolver } from "@dxos/operation";
|
|
15
|
+
import { SpaceOperation } from "@dxos/plugin-space/types";
|
|
16
|
+
import { Filter } from "@dxos/react-client/echo";
|
|
17
|
+
var operation_resolver_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
18
|
+
return Capability.contributes(Capabilities.OperationResolver, [
|
|
19
|
+
OperationResolver.make({
|
|
20
|
+
operation: AutomationOperation.CreateTriggerFromTemplate,
|
|
21
|
+
handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
22
|
+
const trigger = Trigger.make({
|
|
23
|
+
enabled,
|
|
24
|
+
input
|
|
25
|
+
});
|
|
26
|
+
if (scriptName) {
|
|
27
|
+
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, {
|
|
28
|
+
name: scriptName
|
|
29
|
+
})).run());
|
|
30
|
+
const [script] = scripts;
|
|
31
|
+
if (script) {
|
|
32
|
+
const functions = yield* Effect.promise(() => db.query(Filter.type(Function.Function, {
|
|
33
|
+
source: Ref.make(script)
|
|
34
|
+
})).run());
|
|
35
|
+
const [fn] = functions;
|
|
36
|
+
if (fn) {
|
|
37
|
+
Obj.change(trigger, (t) => {
|
|
38
|
+
t.function = Ref.make(fn);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
switch (template.type) {
|
|
44
|
+
case "timer": {
|
|
45
|
+
Obj.change(trigger, (t) => {
|
|
46
|
+
t.spec = {
|
|
47
|
+
kind: "timer",
|
|
48
|
+
cron: template.cron
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case "queue": {
|
|
54
|
+
Obj.change(trigger, (t) => {
|
|
55
|
+
t.spec = {
|
|
56
|
+
kind: "queue",
|
|
57
|
+
queue: template.queueDXN.toString()
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
default: {
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
67
|
+
object: trigger,
|
|
68
|
+
target: db,
|
|
69
|
+
hidden: true
|
|
70
|
+
});
|
|
71
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
72
|
+
subject: [
|
|
73
|
+
`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`
|
|
74
|
+
],
|
|
75
|
+
workspace: getSpacePath(db.spaceId)
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
]);
|
|
80
|
+
}));
|
|
81
|
+
export {
|
|
82
|
+
operation_resolver_default as default
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=operation-resolver-IRC2DZU7.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';\nimport { Obj, Ref } from '@dxos/echo';\nimport { Function, Script, Trigger } from '@dxos/functions';\nimport { type DXN } from '@dxos/keys';\nimport { Operation, OperationResolver } from '@dxos/operation';\nimport { SpaceOperation } from '@dxos/plugin-space/types';\nimport { Filter } from '@dxos/react-client/echo';\n\nimport { meta } from '../../meta';\nimport { AutomationOperation } from '../../types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: AutomationOperation.CreateTriggerFromTemplate,\n handler: Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {\n const trigger = Trigger.make({ enabled, input });\n\n // TODO(wittjosiah): Factor out function lookup by script name?\n if (scriptName) {\n const scripts = yield* Effect.promise(() =>\n db.query(Filter.type(Script.Script, { name: scriptName })).run(),\n );\n const [script] = scripts;\n if (script) {\n const functions = yield* Effect.promise(() =>\n db.query(Filter.type(Function.Function, { source: Ref.make(script) })).run(),\n );\n const [fn] = functions;\n if (fn) {\n Obj.change(trigger, (t) => {\n t.function = Ref.make(fn);\n });\n }\n }\n }\n\n switch (template.type) {\n case 'timer': {\n Obj.change(trigger, (t) => {\n t.spec = { kind: 'timer', cron: template.cron };\n });\n break;\n }\n case 'queue': {\n Obj.change(trigger, (t) => {\n t.spec = {\n kind: 'queue',\n queue: (template.queueDXN as DXN).toString(),\n };\n });\n break;\n }\n default: {\n break;\n }\n }\n\n yield* Operation.invoke(SpaceOperation.AddObject, {\n object: trigger,\n target: db,\n hidden: true,\n });\n yield* Operation.invoke(LayoutOperation.Open, {\n subject: [`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`],\n workspace: getSpacePath(db.spaceId),\n });\n }),\n }),\n ]);\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,KAAKC,WAAW;AACzB,SAASC,UAAUC,QAAQC,eAAe;AAE1C,SAASC,WAAWC,yBAAyB;AAC7C,SAASC,sBAAsB;AAC/B,SAASC,cAAc;AAKvB,IAAA,6BAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAChB,SAAOF,WAAWG,YAAYC,aAAaC,mBAAmB;IAC5DA,kBAAkBC,KAAK;MACrBC,WAAWC,oBAAoBC;MAC/BC,SAAgBR,kBAAW,WAAW,EAAES,IAAIC,UAAUC,UAAU,OAAOC,YAAYC,MAAK,GAAE;AACxF,cAAMC,UAAUC,QAAQX,KAAK;UAAEO;UAASE;QAAM,CAAA;AAG9C,YAAID,YAAY;AACd,gBAAMI,UAAU,OAAcC,eAAQ,MACpCR,GAAGS,MAAMC,OAAOC,KAAKC,OAAOA,QAAQ;YAAEC,MAAMV;UAAW,CAAA,CAAA,EAAIW,IAAG,CAAA;AAEhE,gBAAM,CAACC,MAAAA,IAAUR;AACjB,cAAIQ,QAAQ;AACV,kBAAMC,YAAY,OAAcR,eAAQ,MACtCR,GAAGS,MAAMC,OAAOC,KAAKM,SAASA,UAAU;cAAEC,QAAQC,IAAIxB,KAAKoB,MAAAA;YAAQ,CAAA,CAAA,EAAID,IAAG,CAAA;AAE5E,kBAAM,CAACM,EAAAA,IAAMJ;AACb,gBAAII,IAAI;AACNC,kBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,kBAAEC,WAAWL,IAAIxB,KAAKyB,EAAAA;cACxB,CAAA;YACF;UACF;QACF;AAEA,gBAAQnB,SAASU,MAAI;UACnB,KAAK,SAAS;AACZU,gBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,gBAAEE,OAAO;gBAAEC,MAAM;gBAASC,MAAM1B,SAAS0B;cAAK;YAChD,CAAA;AACA;UACF;UACA,KAAK,SAAS;AACZN,gBAAIC,OAAOjB,SAAS,CAACkB,MAAAA;AACnBA,gBAAEE,OAAO;gBACPC,MAAM;gBACNE,OAAQ3B,SAAS4B,SAAiBC,SAAQ;cAC5C;YACF,CAAA;AACA;UACF;UACA,SAAS;AACP;UACF;QACF;AAEA,eAAOC,UAAUC,OAAOC,eAAeC,WAAW;UAChDC,QAAQ9B;UACR+B,QAAQpC;UACRqC,QAAQ;QACV,CAAA;AACA,eAAON,UAAUC,OAAOM,gBAAgBC,MAAM;UAC5CC,SAAS;YAAC,GAAGC,aAAazC,GAAG0C,OAAO,CAAA,aAAcC,KAAKC,EAAE;;UACzDC,WAAWJ,aAAazC,GAAG0C,OAAO;QACpC,CAAA;MACF,CAAA;IACF,CAAA;GACD;AACH,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "LayoutOperation", "getSpacePath", "Obj", "Ref", "Function", "Script", "Trigger", "Operation", "OperationResolver", "SpaceOperation", "Filter", "Capability", "makeModule", "fnUntraced", "contributes", "Capabilities", "OperationResolver", "make", "operation", "AutomationOperation", "CreateTriggerFromTemplate", "handler", "db", "template", "enabled", "scriptName", "input", "trigger", "Trigger", "scripts", "promise", "query", "Filter", "type", "Script", "name", "run", "script", "functions", "Function", "source", "Ref", "fn", "Obj", "change", "t", "function", "spec", "kind", "cron", "queue", "queueDXN", "toString", "Operation", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "LayoutOperation", "Open", "subject", "getSpacePath", "spaceId", "meta", "id", "workspace"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-EL64ZPPN.mjs";
|
|
4
|
+
|
|
5
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
9
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
10
|
+
import { Obj } from "@dxos/echo";
|
|
11
|
+
import { useActiveSpace } from "@dxos/plugin-space";
|
|
12
|
+
import { getSpace } from "@dxos/react-client/echo";
|
|
13
|
+
|
|
14
|
+
// src/containers/index.ts
|
|
15
|
+
import { lazy } from "react";
|
|
16
|
+
var AutomationSettings = lazy(() => import("./AutomationSettings-EDO3N5WI.mjs"));
|
|
17
|
+
var FunctionsContainer = lazy(() => import("./FunctionsContainer-R4ZMYSFJ.mjs"));
|
|
18
|
+
var TriggerSettings = lazy(() => import("./TriggerSettings-56AIMOEC.mjs"));
|
|
19
|
+
|
|
20
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
21
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
22
|
+
Surface.create({
|
|
23
|
+
id: `${meta.id}.space-settings-functions`,
|
|
24
|
+
role: "article",
|
|
25
|
+
filter: (data) => data.subject === `${meta.id}.space-settings-functions`,
|
|
26
|
+
component: () => {
|
|
27
|
+
const space = useActiveSpace();
|
|
28
|
+
if (!space) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
return /* @__PURE__ */ React.createElement(FunctionsContainer, {
|
|
32
|
+
space
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}),
|
|
36
|
+
Surface.create({
|
|
37
|
+
id: `${meta.id}.space-settings-automation`,
|
|
38
|
+
role: "article",
|
|
39
|
+
filter: (data) => data.subject === `${meta.id}.space-settings-automation`,
|
|
40
|
+
component: () => {
|
|
41
|
+
const space = useActiveSpace();
|
|
42
|
+
if (!space) {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
return /* @__PURE__ */ React.createElement(AutomationSettings, {
|
|
46
|
+
space
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
Surface.create({
|
|
51
|
+
id: `${meta.id}.companion.automation`,
|
|
52
|
+
role: "article",
|
|
53
|
+
filter: (data) => Obj.isObject(data.companionTo) && data.subject === "automation",
|
|
54
|
+
component: ({ data }) => {
|
|
55
|
+
return /* @__PURE__ */ React.createElement(AutomationSettings, {
|
|
56
|
+
space: getSpace(data.companionTo),
|
|
57
|
+
object: data.companionTo
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
])));
|
|
62
|
+
export {
|
|
63
|
+
react_surface_default as default
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=react-surface-5MFPVWIN.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { useActiveSpace } from '@dxos/plugin-space';\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { AutomationSettings, FunctionsContainer } from '../../containers';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}.space-settings-functions`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-functions`,\n component: () => {\n const space = useActiveSpace();\n if (!space) {\n return null;\n }\n\n return <FunctionsContainer space={space} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.space-settings-automation`,\n role: 'article',\n filter: (data): data is { subject: string } => data.subject === `${meta.id}.space-settings-automation`,\n component: () => {\n const space = useActiveSpace();\n if (!space) {\n return null;\n }\n\n return <AutomationSettings space={space} />;\n },\n }),\n Surface.create({\n id: `${meta.id}.companion.automation`,\n role: 'article',\n filter: (data): data is { companionTo: Obj.Unknown; subject: 'automation' } =>\n Obj.isObject(data.companionTo) && data.subject === 'automation',\n component: ({ data }) => {\n return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;\n },\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const AutomationSettings: ComponentType<any> = lazy(() => import('./AutomationSettings'));\nexport const FunctionsContainer: ComponentType<any> = lazy(() => import('./FunctionsContainer'));\nexport const TriggerSettings: ComponentType<any> = lazy(() => import('./TriggerSettings'));\n"],
|
|
5
|
+
"mappings": ";;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,sBAAsB;AAC/B,SAASC,gBAAgB;;;ACPzB,SAA6BC,YAAY;AAElC,IAAMC,qBAAyCC,KAAK,MAAM,OAAO,mCAAA,CAAA;AACjE,IAAMC,qBAAyCD,KAAK,MAAM,OAAO,mCAAA,CAAA;AACjE,IAAME,kBAAsCF,KAAK,MAAM,OAAO,gCAAA,CAAA;;;ADQrE,IAAA,wBAAeG,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,QAAQC,eAAAA;AACd,UAAI,CAACD,OAAO;AACV,eAAO;MACT;AAEA,aAAO,sBAAA,cAACE,oBAAAA;QAAmBF;;IAC7B;EACF,CAAA;EACAT,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SAAsCA,KAAKC,YAAY,GAAGJ,KAAKD,EAAE;IAC1EM,WAAW,MAAA;AACT,YAAMC,QAAQC,eAAAA;AACd,UAAI,CAACD,OAAO;AACV,eAAO;MACT;AAEA,aAAO,sBAAA,cAACG,oBAAAA;QAAmBH;;IAC7B;EACF,CAAA;EACAT,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;IACNC,QAAQ,CAACC,SACPO,IAAIC,SAASR,KAAKS,WAAW,KAAKT,KAAKC,YAAY;IACrDC,WAAW,CAAC,EAAEF,KAAI,MAAE;AAClB,aAAO,sBAAA,cAACM,oBAAAA;QAAmBH,OAAOO,SAASV,KAAKS,WAAW;QAAIE,QAAQX,KAAKS;;IAC9E;EACF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "useActiveSpace", "getSpace", "lazy", "AutomationSettings", "lazy", "FunctionsContainer", "TriggerSettings", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "subject", "component", "space", "useActiveSpace", "FunctionsContainer", "AutomationSettings", "Obj", "isObject", "companionTo", "getSpace", "object"]
|
|
7
|
+
}
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
|
-
AutomationAction
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
AutomationAction,
|
|
3
|
+
AutomationCapabilities,
|
|
4
|
+
AutomationEvents,
|
|
5
|
+
AutomationOperation
|
|
6
|
+
} from "../chunk-GVHAETEQ.mjs";
|
|
7
|
+
import "../chunk-EL64ZPPN.mjs";
|
|
5
8
|
export {
|
|
6
|
-
AutomationAction
|
|
9
|
+
AutomationAction,
|
|
10
|
+
AutomationCapabilities,
|
|
11
|
+
AutomationEvents,
|
|
12
|
+
AutomationOperation
|
|
7
13
|
};
|
|
8
14
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -2,11 +2,11 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
AutomationPanel,
|
|
4
4
|
AutomationPanel_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-FPXVLTEY.mjs";
|
|
6
|
+
import "./chunk-Q5JSKD6Z.mjs";
|
|
7
|
+
import "./chunk-WC5AT7B3.mjs";
|
|
8
8
|
export {
|
|
9
9
|
AutomationPanel,
|
|
10
10
|
AutomationPanel_default as default
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=AutomationPanel-
|
|
12
|
+
//# sourceMappingURL=AutomationPanel-O2BCQA7P.mjs.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
TriggersSettings
|
|
4
|
+
} from "./chunk-JVUE5PMI.mjs";
|
|
5
|
+
import "./chunk-2UF55HSG.mjs";
|
|
6
|
+
import "./chunk-6B4WZRVH.mjs";
|
|
7
|
+
import {
|
|
8
|
+
AutomationPanel
|
|
9
|
+
} from "./chunk-FPXVLTEY.mjs";
|
|
10
|
+
import "./chunk-Q5JSKD6Z.mjs";
|
|
11
|
+
import {
|
|
12
|
+
meta
|
|
13
|
+
} from "./chunk-WC5AT7B3.mjs";
|
|
14
|
+
|
|
15
|
+
// src/containers/AutomationSettings/AutomationSettings.tsx
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
18
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
19
|
+
var AutomationSettings = (props) => {
|
|
20
|
+
const { t } = useTranslation(meta.id);
|
|
21
|
+
return /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
22
|
+
title: t("automation verbose label", {
|
|
23
|
+
ns: meta.id
|
|
24
|
+
}),
|
|
25
|
+
description: t("automation description", {
|
|
26
|
+
ns: meta.id
|
|
27
|
+
})
|
|
28
|
+
}, /* @__PURE__ */ React.createElement(AutomationPanel, props), /* @__PURE__ */ React.createElement(TriggersSettings, {
|
|
29
|
+
db: props.space.db
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
// src/containers/AutomationSettings/index.ts
|
|
34
|
+
var AutomationSettings_default = AutomationSettings;
|
|
35
|
+
export {
|
|
36
|
+
AutomationSettings_default as default
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=AutomationSettings-LJNRQUX7.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,44 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
FunctionsPanel
|
|
4
|
+
} from "./chunk-K7T2MVB7.mjs";
|
|
5
|
+
import {
|
|
6
|
+
FunctionsRegistry
|
|
7
|
+
} from "./chunk-6JVB3IHW.mjs";
|
|
8
|
+
import {
|
|
9
|
+
meta
|
|
10
|
+
} from "./chunk-WC5AT7B3.mjs";
|
|
11
|
+
|
|
12
|
+
// src/containers/FunctionsContainer/FunctionsContainer.tsx
|
|
13
|
+
import React from "react";
|
|
14
|
+
import { useTranslation } from "@dxos/react-ui";
|
|
15
|
+
import { Settings } from "@dxos/react-ui-form";
|
|
16
|
+
var FunctionsContainer = ({ space }) => {
|
|
17
|
+
const { t } = useTranslation(meta.id);
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Settings.Root, null, /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
19
|
+
title: t("functions verbose label", {
|
|
20
|
+
ns: meta.id
|
|
21
|
+
}),
|
|
22
|
+
description: t("functions description", {
|
|
23
|
+
ns: meta.id
|
|
24
|
+
})
|
|
25
|
+
}, /* @__PURE__ */ React.createElement(FunctionsPanel, {
|
|
26
|
+
space
|
|
27
|
+
})), /* @__PURE__ */ React.createElement(Settings.Section, {
|
|
28
|
+
title: t("functions registry verbose label", {
|
|
29
|
+
ns: meta.id
|
|
30
|
+
}),
|
|
31
|
+
description: t("functions registry description", {
|
|
32
|
+
ns: meta.id
|
|
33
|
+
})
|
|
34
|
+
}, /* @__PURE__ */ React.createElement(FunctionsRegistry, {
|
|
35
|
+
space
|
|
36
|
+
})));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/containers/FunctionsContainer/index.ts
|
|
40
|
+
var FunctionsContainer_default = FunctionsContainer;
|
|
41
|
+
export {
|
|
42
|
+
FunctionsContainer_default as default
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=FunctionsContainer-GYRPQZM7.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
|
+
}
|
|
@@ -2,10 +2,10 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
import {
|
|
3
3
|
FunctionsPanel,
|
|
4
4
|
FunctionsPanel_default
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
} from "./chunk-K7T2MVB7.mjs";
|
|
6
|
+
import "./chunk-WC5AT7B3.mjs";
|
|
7
7
|
export {
|
|
8
8
|
FunctionsPanel,
|
|
9
9
|
FunctionsPanel_default as default
|
|
10
10
|
};
|
|
11
|
-
//# sourceMappingURL=FunctionsPanel-
|
|
11
|
+
//# sourceMappingURL=FunctionsPanel-DCXXLSVP.mjs.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
FunctionsRegistry,
|
|
4
|
+
FunctionsRegistry_default
|
|
5
|
+
} from "./chunk-6JVB3IHW.mjs";
|
|
6
|
+
import "./chunk-WC5AT7B3.mjs";
|
|
7
|
+
export {
|
|
8
|
+
FunctionsRegistry,
|
|
9
|
+
FunctionsRegistry_default as default
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=FunctionsRegistry-7WCHC64E.mjs.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
TriggersSettings
|
|
4
|
+
} from "./chunk-JVUE5PMI.mjs";
|
|
5
|
+
import "./chunk-2UF55HSG.mjs";
|
|
6
|
+
import "./chunk-6B4WZRVH.mjs";
|
|
7
|
+
import "./chunk-WC5AT7B3.mjs";
|
|
8
|
+
export {
|
|
9
|
+
TriggersSettings,
|
|
10
|
+
TriggersSettings as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=TriggerSettings-ONY5ZUKW.mjs.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-WC5AT7B3.mjs";
|
|
5
|
+
|
|
6
|
+
// src/capabilities/app-graph-builder/app-graph-builder.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { Capability } from "@dxos/app-framework";
|
|
9
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
10
|
+
import { Script } from "@dxos/functions";
|
|
11
|
+
import { COMPANION_PREFIX } from "@dxos/app-toolkit";
|
|
12
|
+
import { PLANK_COMPANION_TYPE } from "@dxos/plugin-deck/types";
|
|
13
|
+
import { GraphBuilder, NodeMatcher } from "@dxos/plugin-graph";
|
|
14
|
+
import { meta as spaceMeta } from "@dxos/plugin-space";
|
|
15
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
16
|
+
const extensions = yield* Effect.all([
|
|
17
|
+
GraphBuilder.createExtension({
|
|
18
|
+
id: `${meta.id}.space-settings-automation`,
|
|
19
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
20
|
+
connector: (node) => Effect.succeed([
|
|
21
|
+
{
|
|
22
|
+
id: `${meta.id}.automations`,
|
|
23
|
+
type: `${meta.id}.space-settings-automation`,
|
|
24
|
+
data: `${meta.id}.space-settings-automation`,
|
|
25
|
+
properties: {
|
|
26
|
+
label: [
|
|
27
|
+
"automation panel label",
|
|
28
|
+
{
|
|
29
|
+
ns: meta.id
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
icon: "ph--lightning--regular"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
])
|
|
36
|
+
}),
|
|
37
|
+
GraphBuilder.createExtension({
|
|
38
|
+
id: `${meta.id}.space-settings-functions`,
|
|
39
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
40
|
+
connector: (node) => Effect.succeed([
|
|
41
|
+
{
|
|
42
|
+
id: `${meta.id}.functions`,
|
|
43
|
+
type: `${meta.id}.space-settings-functions`,
|
|
44
|
+
data: `${meta.id}.space-settings-functions`,
|
|
45
|
+
properties: {
|
|
46
|
+
label: [
|
|
47
|
+
"functions panel label",
|
|
48
|
+
{
|
|
49
|
+
ns: meta.id
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
icon: "ph--function--regular"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
])
|
|
56
|
+
}),
|
|
57
|
+
GraphBuilder.createTypeExtension({
|
|
58
|
+
id: `${meta.id}.script-companion`,
|
|
59
|
+
type: Script.Script,
|
|
60
|
+
connector: (script) => Effect.succeed([
|
|
61
|
+
{
|
|
62
|
+
id: `${COMPANION_PREFIX}automation`,
|
|
63
|
+
type: PLANK_COMPANION_TYPE,
|
|
64
|
+
data: "automation",
|
|
65
|
+
properties: {
|
|
66
|
+
label: [
|
|
67
|
+
"script automation label",
|
|
68
|
+
{
|
|
69
|
+
ns: meta.id
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
icon: "ph--lightning--regular",
|
|
73
|
+
disposition: "hidden"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
])
|
|
77
|
+
})
|
|
78
|
+
]);
|
|
79
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
80
|
+
}));
|
|
81
|
+
export {
|
|
82
|
+
app_graph_builder_default as default
|
|
83
|
+
};
|
|
84
|
+
//# sourceMappingURL=app-graph-builder-VDXPOWCH.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,94 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
AutomationCapabilities
|
|
4
|
+
} from "./chunk-6B4WZRVH.mjs";
|
|
5
|
+
|
|
6
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
7
|
+
import * as Cause from "effect/Cause";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Exit from "effect/Exit";
|
|
10
|
+
import { useCallback } from "react";
|
|
11
|
+
import { useCapability } from "@dxos/app-framework/ui";
|
|
12
|
+
import { FunctionInvocationService, TracingService } from "@dxos/functions";
|
|
13
|
+
import { log } from "@dxos/log";
|
|
14
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/hooks/useComputeRuntimeCallback.ts";
|
|
15
|
+
var useComputeRuntimeCallback = (id, fn, deps) => {
|
|
16
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
17
|
+
const runtime = id !== void 0 ? computeRuntime.getRuntime(id) : void 0;
|
|
18
|
+
return useCallback(() => {
|
|
19
|
+
if (!runtime) {
|
|
20
|
+
throw new TypeError("Space not provided to useComputeRuntimeCallback");
|
|
21
|
+
}
|
|
22
|
+
return runtime.runPromise(fn());
|
|
23
|
+
}, [
|
|
24
|
+
runtime,
|
|
25
|
+
...deps ?? []
|
|
26
|
+
]);
|
|
27
|
+
};
|
|
28
|
+
var invokeFunctionWithTracing = (functionDef, inputData) => Effect.gen(function* () {
|
|
29
|
+
const tracer = yield* TracingService;
|
|
30
|
+
const trace = yield* tracer.traceInvocationStart({
|
|
31
|
+
target: void 0,
|
|
32
|
+
payload: {
|
|
33
|
+
data: {}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop), Effect.exit);
|
|
37
|
+
if (Exit.isFailure(result)) {
|
|
38
|
+
const error = Cause.prettyErrors(result.cause)[0];
|
|
39
|
+
log.error(error.message, error.cause ?? error.stack, {
|
|
40
|
+
F: __dxlog_file,
|
|
41
|
+
L: 57,
|
|
42
|
+
S: this,
|
|
43
|
+
C: (f, a) => f(...a)
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
yield* tracer.traceInvocationEnd({
|
|
47
|
+
trace,
|
|
48
|
+
// TODO(dmaretskyi): Might miss errors.
|
|
49
|
+
exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : void 0
|
|
50
|
+
});
|
|
51
|
+
return result;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// src/hooks/useTriggerRuntimeControls.ts
|
|
55
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
56
|
+
import * as Effect2 from "effect/Effect";
|
|
57
|
+
import { useEffect, useState } from "react";
|
|
58
|
+
import { Filter } from "@dxos/echo";
|
|
59
|
+
import { Trigger } from "@dxos/functions";
|
|
60
|
+
import { TriggerDispatcher } from "@dxos/functions-runtime";
|
|
61
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
62
|
+
var useTriggerRuntimeControls = (db) => {
|
|
63
|
+
const triggers = useQuery(db, Filter.type(Trigger.Trigger));
|
|
64
|
+
const [dispatcher, setDispatcher] = useState(void 0);
|
|
65
|
+
const init = useComputeRuntimeCallback(db?.spaceId, Effect2.fnUntraced(function* () {
|
|
66
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
67
|
+
setDispatcher(dispatcher2);
|
|
68
|
+
}));
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
void init();
|
|
71
|
+
}, []);
|
|
72
|
+
const state = useAtomValue(dispatcher?.state ?? Atom.make(void 0));
|
|
73
|
+
const start = useComputeRuntimeCallback(db?.spaceId, Effect2.fnUntraced(function* () {
|
|
74
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
75
|
+
yield* dispatcher2.start();
|
|
76
|
+
}));
|
|
77
|
+
const stop = useComputeRuntimeCallback(db?.spaceId, Effect2.fnUntraced(function* () {
|
|
78
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
79
|
+
yield* dispatcher2.stop();
|
|
80
|
+
}));
|
|
81
|
+
return {
|
|
82
|
+
triggers,
|
|
83
|
+
state,
|
|
84
|
+
start: () => void start(),
|
|
85
|
+
stop: () => void stop()
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export {
|
|
90
|
+
useComputeRuntimeCallback,
|
|
91
|
+
invokeFunctionWithTracing,
|
|
92
|
+
useTriggerRuntimeControls
|
|
93
|
+
};
|
|
94
|
+
//# sourceMappingURL=chunk-2UF55HSG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/hooks/useComputeRuntimeCallback.ts", "../../../src/hooks/useTriggerRuntimeControls.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Cause from 'effect/Cause';\nimport * as Effect from 'effect/Effect';\nimport * as Exit from 'effect/Exit';\nimport { type DependencyList, useCallback } from 'react';\n\nimport { useCapability } from '@dxos/app-framework/ui';\nimport { type Key } from '@dxos/echo';\nimport { type FunctionDefinition, FunctionInvocationService, TracingService } from '@dxos/functions';\nimport { log } from '@dxos/log';\n\nimport { AutomationCapabilities } from '../types';\n\n/**\n * Create an effectful function that has access to compute services\n */\n// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).\nexport const useComputeRuntimeCallback = <T>(\n id: Key.SpaceId | undefined,\n fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,\n deps?: DependencyList,\n): (() => Promise<T>) => {\n const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);\n const runtime = id !== undefined ? computeRuntime.getRuntime(id) : undefined;\n\n return useCallback(() => {\n if (!runtime) {\n throw new TypeError('Space not provided to useComputeRuntimeCallback');\n }\n\n return runtime.runPromise(fn());\n }, [runtime, ...(deps ?? [])]);\n};\n\n// TODO(wittjosiah): Function invoking should automatically be traced (DX-647).\nexport const invokeFunctionWithTracing = <I, O>(functionDef: FunctionDefinition<I, O>, inputData: I) =>\n Effect.gen(function* () {\n const tracer = yield* TracingService;\n const trace = yield* tracer.traceInvocationStart({\n target: undefined,\n payload: {\n data: {},\n },\n });\n\n // Invoke the function.\n const result = yield* FunctionInvocationService.invokeFunction(functionDef, inputData).pipe(\n Effect.provide(trace.invocationTraceQueue ? TracingService.layerInvocation(trace) : TracingService.layerNoop),\n Effect.exit,\n );\n\n if (Exit.isFailure(result)) {\n const error = Cause.prettyErrors(result.cause)[0];\n log.error(error.message, error.cause ?? error.stack);\n }\n\n yield* tracer.traceInvocationEnd({\n trace,\n // TODO(dmaretskyi): Might miss errors.\n exception: Exit.isFailure(result) ? Cause.prettyErrors(result.cause)[0] : undefined,\n });\n\n return result;\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport type * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport { useEffect, useState } from 'react';\n\nimport { type Database, Filter } from '@dxos/echo';\nimport { Trigger } from '@dxos/functions';\nimport { TriggerDispatcher, type TriggerDispatcherState } from '@dxos/functions-runtime';\nimport { useQuery } from '@dxos/react-client/echo';\n\nimport { useComputeRuntimeCallback } from './useComputeRuntimeCallback';\n\ninterface TriggerRuntimeControls {\n triggers: Trigger.Trigger[];\n\n state: TriggerDispatcherState | undefined;\n\n start: () => void;\n stop: () => void;\n}\n\nexport const useTriggerRuntimeControls = (db: Database.Database | undefined): TriggerRuntimeControls => {\n const triggers = useQuery(db, Filter.type(Trigger.Trigger));\n\n const [dispatcher, setDispatcher] = useState<Context.Tag.Service<TriggerDispatcher> | undefined>(undefined);\n\n const init = useComputeRuntimeCallback(\n db?.spaceId,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n setDispatcher(dispatcher);\n }),\n );\n\n useEffect(() => {\n void init();\n }, []);\n\n const state = useAtomValue(dispatcher?.state ?? Atom.make(undefined));\n\n const start = useComputeRuntimeCallback(\n db?.spaceId,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.start();\n }),\n );\n\n const stop = useComputeRuntimeCallback(\n db?.spaceId,\n Effect.fnUntraced(function* () {\n const dispatcher = yield* TriggerDispatcher;\n yield* dispatcher.stop();\n }),\n );\n\n return {\n triggers,\n state,\n start: () => void start(),\n stop: () => void stop(),\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,UAAU;AACtB,SAA8BC,mBAAmB;AAEjD,SAASC,qBAAqB;AAE9B,SAAkCC,2BAA2BC,sBAAsB;AACnF,SAASC,WAAW;;AAQb,IAAMC,4BAA4B,CACvCC,IACAC,IACAC,SAAAA;AAEA,QAAMC,iBAAiBC,cAAcC,uBAAuBC,cAAc;AAC1E,QAAMC,UAAUP,OAAOQ,SAAYL,eAAeM,WAAWT,EAAAA,IAAMQ;AAEnE,SAAOE,YAAY,MAAA;AACjB,QAAI,CAACH,SAAS;AACZ,YAAM,IAAII,UAAU,iDAAA;IACtB;AAEA,WAAOJ,QAAQK,WAAWX,GAAAA,CAAAA;EAC5B,GAAG;IAACM;OAAaL,QAAQ,CAAA;GAAI;AAC/B;AAGO,IAAMW,4BAA4B,CAAOC,aAAuCC,cAC9EC,WAAI,aAAA;AACT,QAAMC,SAAS,OAAOC;AACtB,QAAMC,QAAQ,OAAOF,OAAOG,qBAAqB;IAC/CC,QAAQb;IACRc,SAAS;MACPC,MAAM,CAAC;IACT;EACF,CAAA;AAGA,QAAMC,SAAS,OAAOC,0BAA0BC,eAAeZ,aAAaC,SAAAA,EAAWY,KAC9EC,eAAQT,MAAMU,uBAAuBX,eAAeY,gBAAgBX,KAAAA,IAASD,eAAea,SAAS,GACrGC,WAAI;AAGb,MAASC,eAAUT,MAAAA,GAAS;AAC1B,UAAMU,QAAcC,mBAAaX,OAAOY,KAAK,EAAE,CAAA;AAC/CC,QAAIH,MAAMA,MAAMI,SAASJ,MAAME,SAASF,MAAMK,OAAK;;;;;;EACrD;AAEA,SAAOtB,OAAOuB,mBAAmB;IAC/BrB;;IAEAsB,WAAgBR,eAAUT,MAAAA,IAAgBW,mBAAaX,OAAOY,KAAK,EAAE,CAAA,IAAK5B;EAC5E,CAAA;AAEA,SAAOgB;AACT,CAAA;;;AC9DF,SAASkB,MAAMC,oBAAoB;AAEnC,YAAYC,aAAY;AACxB,SAASC,WAAWC,gBAAgB;AAEpC,SAAwBC,cAAc;AACtC,SAASC,eAAe;AACxB,SAASC,yBAAsD;AAC/D,SAASC,gBAAgB;AAalB,IAAMC,4BAA4B,CAACC,OAAAA;AACxC,QAAMC,WAAWC,SAASF,IAAIG,OAAOC,KAAKC,QAAQA,OAAO,CAAA;AAEzD,QAAM,CAACC,YAAYC,aAAAA,IAAiBC,SAA6DC,MAAAA;AAEjG,QAAMC,OAAOC,0BACXX,IAAIY,SACGC,mBAAW,aAAA;AAChB,UAAMP,cAAa,OAAOQ;AAC1BP,kBAAcD,WAAAA;EAChB,CAAA,CAAA;AAGFS,YAAU,MAAA;AACR,SAAKL,KAAAA;EACP,GAAG,CAAA,CAAE;AAEL,QAAMM,QAAQC,aAAaX,YAAYU,SAASE,KAAKC,KAAKV,MAAAA,CAAAA;AAE1D,QAAMW,QAAQT,0BACZX,IAAIY,SACGC,mBAAW,aAAA;AAChB,UAAMP,cAAa,OAAOQ;AAC1B,WAAOR,YAAWc,MAAK;EACzB,CAAA,CAAA;AAGF,QAAMC,OAAOV,0BACXX,IAAIY,SACGC,mBAAW,aAAA;AAChB,UAAMP,cAAa,OAAOQ;AAC1B,WAAOR,YAAWe,KAAI;EACxB,CAAA,CAAA;AAGF,SAAO;IACLpB;IACAe;IACAI,OAAO,MAAM,KAAKA,MAAAA;IAClBC,MAAM,MAAM,KAAKA,KAAAA;EACnB;AACF;",
|
|
6
|
+
"names": ["Cause", "Effect", "Exit", "useCallback", "useCapability", "FunctionInvocationService", "TracingService", "log", "useComputeRuntimeCallback", "id", "fn", "deps", "computeRuntime", "useCapability", "AutomationCapabilities", "ComputeRuntime", "runtime", "undefined", "getRuntime", "useCallback", "TypeError", "runPromise", "invokeFunctionWithTracing", "functionDef", "inputData", "gen", "tracer", "TracingService", "trace", "traceInvocationStart", "target", "payload", "data", "result", "FunctionInvocationService", "invokeFunction", "pipe", "provide", "invocationTraceQueue", "layerInvocation", "layerNoop", "exit", "isFailure", "error", "prettyErrors", "cause", "log", "message", "stack", "traceInvocationEnd", "exception", "Atom", "useAtomValue", "Effect", "useEffect", "useState", "Filter", "Trigger", "TriggerDispatcher", "useQuery", "useTriggerRuntimeControls", "db", "triggers", "useQuery", "Filter", "type", "Trigger", "dispatcher", "setDispatcher", "useState", "undefined", "init", "useComputeRuntimeCallback", "spaceId", "fnUntraced", "TriggerDispatcher", "useEffect", "state", "useAtomValue", "Atom", "make", "start", "stop"]
|
|
7
|
+
}
|