@dxos/plugin-automation 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/neutral/AutomationPanel-64U7W3SJ.mjs +11 -0
- package/dist/lib/neutral/AutomationPlugin.mjs +38 -0
- package/dist/lib/neutral/AutomationPlugin.mjs.map +7 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs +1113 -0
- package/dist/lib/neutral/AutomationPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs +31 -0
- package/dist/lib/neutral/AutomationSettings-NNL2AVNT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs +38 -0
- package/dist/lib/neutral/FunctionsContainer-CU2FVKZF.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs +96 -0
- package/dist/lib/neutral/FunctionsPanel-GLCUBEDT.mjs.map +7 -0
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs +94 -0
- package/dist/lib/neutral/FunctionsRegistry-VRU4FBVH.mjs.map +7 -0
- package/dist/lib/neutral/TriggerSettings-XCHIZPOR.mjs +9 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs +75 -0
- package/dist/lib/neutral/app-graph-builder-GDCGRYEP.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +15 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/node.mjs +13 -0
- package/dist/lib/neutral/capabilities/node.mjs.map +7 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs +42 -0
- package/dist/lib/neutral/chunk-2JP77CMN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ATECY555.mjs +20 -0
- package/dist/lib/neutral/chunk-ATECY555.mjs.map +7 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs +93 -0
- package/dist/lib/neutral/chunk-DSCOLDT5.mjs.map +7 -0
- package/dist/lib/neutral/chunk-FKFFU54G.mjs +270 -0
- package/dist/lib/neutral/chunk-FKFFU54G.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs +8 -0
- package/dist/lib/neutral/chunk-GDNOJOAR.mjs.map +7 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs +12 -0
- package/dist/lib/neutral/chunk-IGGNE2XI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-N735CP33.mjs +285 -0
- package/dist/lib/neutral/chunk-N735CP33.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +16 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs +220 -0
- package/dist/lib/neutral/compute-runtime-2Q5MGOR6.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +13 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs +69 -0
- package/dist/lib/neutral/create-trigger-from-template-5FT7O7OU.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +129 -0
- package/dist/lib/neutral/hooks/index.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +20 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs +13 -0
- package/dist/lib/neutral/operation-handler-YXGYH5W5.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs +57 -0
- package/dist/lib/neutral/react-surface-3OGMAMKV.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +47 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +16 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts +3 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/AutomationPlugin.node.d.ts +4 -0
- package/dist/types/src/AutomationPlugin.node.d.ts.map +1 -0
- package/dist/types/src/AutomationPlugin.test.d.ts +2 -0
- package/dist/types/src/AutomationPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +4 -2
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts +14 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +6 -0
- package/dist/types/src/capabilities/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/commands/index.d.ts +2 -0
- package/dist/types/src/commands/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/index.d.ts +25 -0
- package/dist/types/src/commands/trigger/create/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts +15 -0
- package/dist/types/src/commands/trigger/create/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts +13 -0
- package/dist/types/src/commands/trigger/create/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/index.d.ts +57 -0
- package/dist/types/src/commands/trigger/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/list.d.ts +7 -0
- package/dist/types/src/commands/trigger/list.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/options.d.ts +11 -0
- package/dist/types/src/commands/trigger/options.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/remove.d.ts +8 -0
- package/dist/types/src/commands/trigger/remove.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/index.d.ts +28 -0
- package/dist/types/src/commands/trigger/update/index.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts +12 -0
- package/dist/types/src/commands/trigger/update/queue.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts +13 -0
- package/dist/types/src/commands/trigger/update/subscription.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts +11 -0
- package/dist/types/src/commands/trigger/update/timer.d.ts.map +1 -0
- package/dist/types/src/commands/trigger/util.d.ts +46 -0
- package/dist/types/src/commands/trigger/util.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 +32 -26
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts +8 -0
- package/dist/types/src/components/FunctionsRegistry/FunctionsRegistry.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +4 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +12 -9
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts +6 -3
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts +11 -8
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +107 -30
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +3 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts +6 -0
- package/dist/types/src/containers/AutomationSettings/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts +2 -0
- package/dist/types/src/containers/AutomationSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts +4 -0
- package/dist/types/src/containers/FunctionsContainer/FunctionsContainer.d.ts.map +1 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts +6 -0
- package/dist/types/src/containers/TriggerSettings/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts +3 -0
- package/dist/types/src/containers/TriggerSettings/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +5 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +9 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +17 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +12 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/create-trigger-from-template.d.ts +5 -0
- package/dist/types/src/operations/create-trigger-from-template.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +204 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +32 -26
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/AutomationCapabilities.d.ts +22 -0
- package/dist/types/src/types/AutomationCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/AutomationEvents.d.ts +3 -0
- package/dist/types/src/types/AutomationEvents.d.ts.map +1 -0
- package/dist/types/src/types/AutomationOperation.d.ts +19 -0
- package/dist/types/src/types/AutomationOperation.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +12 -4
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +138 -50
- package/src/AutomationPlugin.node.ts +29 -0
- package/src/AutomationPlugin.test.ts +27 -0
- package/src/AutomationPlugin.tsx +23 -34
- package/src/capabilities/app-graph-builder.ts +59 -79
- package/src/capabilities/compute-runtime.ts +325 -0
- package/src/capabilities/index.ts +9 -4
- package/src/capabilities/node.ts +13 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +49 -46
- package/src/commands/index.ts +5 -0
- package/src/commands/trigger/create/index.ts +14 -0
- package/src/commands/trigger/create/queue.ts +86 -0
- package/src/commands/trigger/create/subscription.ts +125 -0
- package/src/commands/trigger/create/timer.ts +90 -0
- package/src/commands/trigger/index.ts +16 -0
- package/src/commands/trigger/list.ts +70 -0
- package/src/commands/trigger/options.ts +59 -0
- package/src/commands/trigger/remove.ts +45 -0
- package/src/commands/trigger/update/index.ts +14 -0
- package/src/commands/trigger/update/queue.ts +194 -0
- package/src/commands/trigger/update/subscription.ts +278 -0
- package/src/commands/trigger/update/timer.ts +193 -0
- package/src/commands/trigger/util.ts +410 -0
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +9 -12
- package/src/components/AutomationPanel/AutomationPanel.tsx +250 -82
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +51 -32
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +114 -0
- package/src/components/FunctionsRegistry/index.ts +8 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +42 -35
- package/src/components/TriggerEditor/SpecSelector.tsx +29 -17
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +117 -32
- package/src/components/TriggerEditor/TriggerEditor.tsx +109 -42
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +31 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +33 -0
- package/src/containers/FunctionsContainer/index.ts +5 -0
- package/src/containers/TriggerSettings/TriggerSettings.tsx +48 -0
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useComputeRuntime.ts +30 -0
- package/src/hooks/useComputeRuntimeCallback.ts +32 -0
- package/src/hooks/useComputeRuntimeService.ts +64 -0
- package/src/hooks/useTriggerRuntimeControls.ts +70 -0
- package/src/index.ts +1 -3
- package/src/meta.ts +10 -8
- package/src/operations/create-trigger-from-template.ts +72 -0
- package/src/operations/index.ts +7 -0
- package/src/plugin.ts +11 -0
- package/src/testing/test-functions.ts +13 -10
- package/src/translations.ts +39 -29
- package/src/types/AutomationCapabilities.ts +48 -0
- package/src/types/AutomationEvents.ts +11 -0
- package/src/types/AutomationOperation.ts +30 -0
- package/src/types/index.ts +4 -0
- package/src/types/schema.ts +6 -6
- package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs +0 -35
- package/dist/lib/browser/AutomationContainer-BRV5AJZ3.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-N5HFJJXW.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-U4HASI4P.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-I443Y6KB.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs +0 -80
- package/dist/lib/browser/app-graph-builder-4OFKIRAI.mjs.map +0 -7
- package/dist/lib/browser/chunk-4TWQV33E.mjs +0 -143
- package/dist/lib/browser/chunk-4TWQV33E.mjs.map +0 -7
- package/dist/lib/browser/chunk-EIY2EUWC.mjs +0 -14
- package/dist/lib/browser/chunk-EIY2EUWC.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs +0 -15
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs +0 -38
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-S4SM663I.mjs +0 -230
- package/dist/lib/browser/chunk-S4SM663I.mjs.map +0 -7
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs +0 -94
- package/dist/lib/browser/chunk-Z5DT4MHW.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -101
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs +0 -77
- package/dist/lib/browser/intent-resolver-4PSYSQQG.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-M52XGLXY.mjs +0 -64
- package/dist/lib/browser/react-surface-M52XGLXY.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs +0 -36
- package/dist/lib/node-esm/AutomationContainer-FYRDTERM.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-MKOLA2FE.mjs +0 -12
- package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-VZIVURH6.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-ELINCXPW.mjs +0 -11
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs +0 -81
- package/dist/lib/node-esm/app-graph-builder-555IHYOB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AONUBWBE.mjs +0 -144
- package/dist/lib/node-esm/chunk-AONUBWBE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs +0 -16
- package/dist/lib/node-esm/chunk-CICQ73ZT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs +0 -95
- package/dist/lib/node-esm/chunk-CX2AILIS.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs +0 -17
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs +0 -39
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs +0 -231
- package/dist/lib/node-esm/chunk-ZOJVKPCA.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -102
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs +0 -78
- package/dist/lib/node-esm/intent-resolver-6ZGBUILG.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs +0 -65
- package/dist/lib/node-esm/react-surface-Y6AOXM75.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -72
- package/src/components/AutomationContainer.tsx +0 -28
- package/src/components/FunctionsContainer.tsx +0 -29
- /package/dist/lib/{browser/AutomationPanel-N5HFJJXW.mjs.map → neutral/AutomationPanel-64U7W3SJ.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-I443Y6KB.mjs.map → neutral/TriggerSettings-XCHIZPOR.mjs.map} +0 -0
- /package/dist/lib/{browser/types/index.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-MKOLA2FE.mjs.map → neutral/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/FunctionsPanel-ELINCXPW.mjs.map → neutral/meta.mjs.map} +0 -0
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/compute-runtime.ts
|
|
4
|
+
import { Registry } from "@effect-atom/atom";
|
|
5
|
+
import * as BrowserKeyValueStore from "@effect/platform-browser/BrowserKeyValueStore";
|
|
6
|
+
import * as KeyValueStore from "@effect/platform/KeyValueStore";
|
|
7
|
+
import * as Context from "effect/Context";
|
|
8
|
+
import * as Effect from "effect/Effect";
|
|
9
|
+
import * as Fiber from "effect/Fiber";
|
|
10
|
+
import * as Layer from "effect/Layer";
|
|
11
|
+
import * as ManagedRuntime from "effect/ManagedRuntime";
|
|
12
|
+
import { AiService, OpaqueToolkit } from "@dxos/ai";
|
|
13
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
15
|
+
import { AiContextBinder, AiContextService, AiSession, AiSessionService } from "@dxos/assistant";
|
|
16
|
+
import { McpServer } from "@dxos/assistant-toolkit";
|
|
17
|
+
import { ClientService } from "@dxos/client";
|
|
18
|
+
import { Blueprint, Credential, Operation, OperationHandlerSet, OperationRegistry, ServiceNotAvailableError } from "@dxos/compute";
|
|
19
|
+
import { Resource } from "@dxos/context";
|
|
20
|
+
import { Database, DXN, Feed, Filter, Obj } from "@dxos/echo";
|
|
21
|
+
import { AtomObj } from "@dxos/echo-atom";
|
|
22
|
+
import { createFeedServiceLayer } from "@dxos/echo-db";
|
|
23
|
+
import { acquireReleaseResource, asyncTaskTaggingLayer } from "@dxos/effect";
|
|
24
|
+
import { FunctionInvocationService, feedServiceFromQueueServiceLayer, QueueService, credentialsLayerFromDatabase } from "@dxos/functions";
|
|
25
|
+
import { AgentService } from "@dxos/functions-runtime";
|
|
26
|
+
import { FeedTraceSink, FunctionImplementationResolver, FunctionInvocationServiceLayerWithLocalLoopbackExecutor, ProcessManager, RemoteFunctionExecutionService, ServiceResolver, TriggerDispatcher, TriggerStateStore } from "@dxos/functions-runtime";
|
|
27
|
+
import { invariant } from "@dxos/invariant";
|
|
28
|
+
import { log } from "@dxos/log";
|
|
29
|
+
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
30
|
+
import { AutomationCapabilities } from "#types";
|
|
31
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/capabilities/compute-runtime.ts";
|
|
32
|
+
var compute_runtime_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
33
|
+
const capabilities = yield* Capability.Service;
|
|
34
|
+
const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());
|
|
35
|
+
return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () => Effect.tryPromise(() => provider.close()));
|
|
36
|
+
}));
|
|
37
|
+
var isDev = import.meta.env.DEV ?? false;
|
|
38
|
+
var triggerStateStoreLayer = typeof globalThis.localStorage !== "undefined" ? TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)) : TriggerStateStore.layerMemory;
|
|
39
|
+
var ComputeRuntimeProviderImpl = class extends Resource {
|
|
40
|
+
#runtimes = /* @__PURE__ */ new Map();
|
|
41
|
+
#subscriptions = /* @__PURE__ */ new Map();
|
|
42
|
+
#capabilities;
|
|
43
|
+
constructor(capabilities) {
|
|
44
|
+
super();
|
|
45
|
+
this.#capabilities = capabilities;
|
|
46
|
+
}
|
|
47
|
+
async _open() {
|
|
48
|
+
}
|
|
49
|
+
async _close() {
|
|
50
|
+
for (const unsubscribe of this.#subscriptions.values()) {
|
|
51
|
+
unsubscribe();
|
|
52
|
+
}
|
|
53
|
+
this.#subscriptions.clear();
|
|
54
|
+
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
55
|
+
this.#runtimes.clear();
|
|
56
|
+
}
|
|
57
|
+
getRuntime(spaceId) {
|
|
58
|
+
if (this.#runtimes.has(spaceId)) {
|
|
59
|
+
log("getRuntime cache hit", {
|
|
60
|
+
spaceId
|
|
61
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 59, S: this });
|
|
62
|
+
return this.#runtimes.get(spaceId);
|
|
63
|
+
}
|
|
64
|
+
log("getRuntime building", {
|
|
65
|
+
spaceId
|
|
66
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 64, S: this });
|
|
67
|
+
const layer = Layer.unwrapScoped(Effect.gen(this, function* () {
|
|
68
|
+
log("compute runtime layer build: start", {
|
|
69
|
+
spaceId
|
|
70
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 68, S: this });
|
|
71
|
+
const client = this.#capabilities.get(ClientCapabilities.Client);
|
|
72
|
+
const aiServiceLayer = this.#capabilities.get(AppCapabilities.AiServiceLayer) ?? Layer.die("AiService not found");
|
|
73
|
+
const registry = this.#capabilities.get(Capabilities.AtomRegistry);
|
|
74
|
+
const operationHandlers = OperationHandlerSet.merge(...this.#capabilities.getAll(Capabilities.OperationHandler));
|
|
75
|
+
const opaqueToolkitProvider = Layer.succeed(OpaqueToolkit.OpaqueToolkitProvider, {
|
|
76
|
+
getToolkit: () => {
|
|
77
|
+
const toolkits = this.#capabilities.getAll(AppCapabilities.Toolkit);
|
|
78
|
+
return OpaqueToolkit.merge(...toolkits);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
const blueprints = this.#capabilities.getAll(AppCapabilities.BlueprintDefinition).flatMap((blueprint) => blueprint.make());
|
|
82
|
+
const space = client.spaces.get(spaceId);
|
|
83
|
+
invariant(space, `Invalid space: ${spaceId}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 84, S: this, A: ["space", "`Invalid space: ${spaceId}`"] });
|
|
84
|
+
log("compute runtime layer build: waiting for space ready", {
|
|
85
|
+
spaceId
|
|
86
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 85, S: this });
|
|
87
|
+
const waitStarted = Date.now();
|
|
88
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
89
|
+
log("compute runtime layer build: space ready", {
|
|
90
|
+
spaceId,
|
|
91
|
+
waitMs: Date.now() - waitStarted
|
|
92
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 90, S: this });
|
|
93
|
+
const mcpQuery = space.db.query(Filter.type(McpServer.McpServer));
|
|
94
|
+
this.#subscriptions.set(spaceId, mcpQuery.subscribe());
|
|
95
|
+
log("compute runtime layer build: composing inner layer", {
|
|
96
|
+
spaceId
|
|
97
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 97, S: this });
|
|
98
|
+
return Layer.scopedDiscard(Effect.gen(function* () {
|
|
99
|
+
log("compute runtime inner layer: acquiring services", {
|
|
100
|
+
spaceId
|
|
101
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 101, S: this });
|
|
102
|
+
const registry2 = yield* Registry.AtomRegistry;
|
|
103
|
+
const triggerDispatcher = yield* TriggerDispatcher;
|
|
104
|
+
log("compute runtime inner layer: services acquired", {
|
|
105
|
+
spaceId
|
|
106
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 106, S: this });
|
|
107
|
+
let inFlight;
|
|
108
|
+
const transition = (effect2) => {
|
|
109
|
+
if (inFlight) {
|
|
110
|
+
Effect.runFork(Fiber.interrupt(inFlight));
|
|
111
|
+
}
|
|
112
|
+
inFlight = Effect.runFork(effect2.pipe(Effect.tapErrorCause((cause) => Effect.logError("trigger dispatcher transition failed", cause))));
|
|
113
|
+
};
|
|
114
|
+
const unsubscribe = registry2.subscribe(AtomObj.make(space.properties), (properties) => {
|
|
115
|
+
const computeEnvironment = properties.computeEnvironment ?? "local";
|
|
116
|
+
transition(computeEnvironment === "local" ? triggerDispatcher.start() : triggerDispatcher.stop());
|
|
117
|
+
}, {
|
|
118
|
+
immediate: true
|
|
119
|
+
});
|
|
120
|
+
yield* Effect.addFinalizer(() => Effect.sync(() => {
|
|
121
|
+
log("compute runtime inner layer: finalize", {
|
|
122
|
+
spaceId
|
|
123
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 125, S: this });
|
|
124
|
+
unsubscribe();
|
|
125
|
+
if (inFlight) {
|
|
126
|
+
Effect.runFork(Fiber.interrupt(inFlight));
|
|
127
|
+
}
|
|
128
|
+
}));
|
|
129
|
+
log("compute runtime inner layer: acquire complete", {
|
|
130
|
+
spaceId
|
|
131
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 133, S: this });
|
|
132
|
+
})).pipe(
|
|
133
|
+
Layer.provideMerge(TriggerDispatcher.layer({
|
|
134
|
+
timeControl: "natural"
|
|
135
|
+
})),
|
|
136
|
+
Layer.provideMerge(AgentService.layer({
|
|
137
|
+
getMcpServers: () => mcpQuery.results.filter(Obj.instanceOf(McpServer.McpServer)).filter((server) => server.enabled !== false).map(({ url, protocol, apiKey }) => ({
|
|
138
|
+
url,
|
|
139
|
+
protocol,
|
|
140
|
+
apiKey
|
|
141
|
+
}))
|
|
142
|
+
})),
|
|
143
|
+
Layer.provideMerge(ProcessManager.ProcessOperationInvoker.layer),
|
|
144
|
+
Layer.provideMerge(ProcessManager.layer()),
|
|
145
|
+
// TODO(dmaretskyi): Duped in assistant testing layer.
|
|
146
|
+
Layer.provideMerge(
|
|
147
|
+
// TODO(dmaretskyi): Refactor to be able to merge resovler layers, also consider service mesh achitecture.
|
|
148
|
+
Layer.effect(ServiceResolver.ServiceResolver, Effect.gen(function* () {
|
|
149
|
+
const services = yield* Effect.context().pipe(Effect.map(Context.pick(Database.Service, Feed.FeedService)), Effect.map(Layer.succeedContext));
|
|
150
|
+
return ServiceResolver.compose(
|
|
151
|
+
ServiceResolver.succeed(AiContextService, (context2) => Effect.gen(function* () {
|
|
152
|
+
if (!context2.conversation) {
|
|
153
|
+
return yield* Effect.fail(new ServiceNotAvailableError(AiContextService.key));
|
|
154
|
+
}
|
|
155
|
+
const feed = yield* Database.resolve(DXN.parse(context2.conversation), Feed.Feed).pipe(Effect.orDie);
|
|
156
|
+
const runtime3 = yield* Effect.runtime();
|
|
157
|
+
const binder = yield* acquireReleaseResource(() => new AiContextBinder({
|
|
158
|
+
feed,
|
|
159
|
+
runtime: runtime3
|
|
160
|
+
}));
|
|
161
|
+
return {
|
|
162
|
+
binder
|
|
163
|
+
};
|
|
164
|
+
}).pipe(Effect.provide(services))),
|
|
165
|
+
// AiSessionService.
|
|
166
|
+
ServiceResolver.succeed(AiSessionService, (context2) => Effect.gen(function* () {
|
|
167
|
+
if (!context2.conversation) {
|
|
168
|
+
return yield* Effect.fail(new ServiceNotAvailableError(AiSessionService.key));
|
|
169
|
+
}
|
|
170
|
+
const feed = yield* Database.resolve(DXN.parse(context2.conversation), Feed.Feed).pipe(Effect.orDie);
|
|
171
|
+
const runtime3 = yield* Effect.runtime();
|
|
172
|
+
const session = yield* acquireReleaseResource(() => new AiSession({
|
|
173
|
+
feed,
|
|
174
|
+
runtime: runtime3
|
|
175
|
+
}));
|
|
176
|
+
return session;
|
|
177
|
+
}).pipe(Effect.provide(services))),
|
|
178
|
+
yield* ServiceResolver.fromRequirements(Database.Service, OpaqueToolkit.OpaqueToolkitProvider, Feed.FeedService, QueueService, AiService.AiService, OperationRegistry.Service, Blueprint.RegistryService, Credential.CredentialsService)
|
|
179
|
+
);
|
|
180
|
+
}))
|
|
181
|
+
),
|
|
182
|
+
Layer.provideMerge(Layer.succeed(Blueprint.RegistryService, new Blueprint.Registry(blueprints))),
|
|
183
|
+
Layer.provideMerge(Layer.succeed(Capability.Service, this.#capabilities)),
|
|
184
|
+
Layer.provideMerge(Layer.succeed(Registry.AtomRegistry, registry)),
|
|
185
|
+
Layer.provideMerge(Layer.mergeAll(FeedTraceSink.layerLive, triggerStateStoreLayer, KeyValueStore.layerMemory)),
|
|
186
|
+
Layer.provideMerge(OperationRegistry.layer),
|
|
187
|
+
Layer.provideMerge(feedServiceFromQueueServiceLayer),
|
|
188
|
+
Layer.provideMerge(OperationHandlerSet.provide(operationHandlers)),
|
|
189
|
+
Layer.provideMerge(Layer.effect(Operation.Service, Effect.gen(function* () {
|
|
190
|
+
const fis = yield* FunctionInvocationService;
|
|
191
|
+
return {
|
|
192
|
+
invoke: (op, ...args) => fis.invokeFunction(op, args[0]),
|
|
193
|
+
schedule: (op, ...args) => fis.invokeFunction(op, args[0]).pipe(Effect.fork, Effect.asVoid),
|
|
194
|
+
invokePromise: async () => ({
|
|
195
|
+
error: new Error("Not implemented")
|
|
196
|
+
})
|
|
197
|
+
};
|
|
198
|
+
}))),
|
|
199
|
+
Layer.provideMerge(FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(Layer.provideMerge(FunctionImplementationResolver.layerTest({
|
|
200
|
+
functions: operationHandlers
|
|
201
|
+
})), Layer.provideMerge(client.config.values.runtime?.services?.edge?.url ? RemoteFunctionExecutionService.fromClient(client, client.config.get("runtime.client.edgeFeatures.agents") ? spaceId : void 0) : RemoteFunctionExecutionService.layerMock))),
|
|
202
|
+
Layer.provideMerge(opaqueToolkitProvider),
|
|
203
|
+
Layer.provideMerge(aiServiceLayer),
|
|
204
|
+
Layer.provideMerge(credentialsLayerFromDatabase()),
|
|
205
|
+
Layer.provideMerge(ClientService.fromClient(client)),
|
|
206
|
+
Layer.provideMerge(space ? Database.layer(space.db) : Database.notAvailable)
|
|
207
|
+
).pipe(Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable), Layer.provideMerge(space ? createFeedServiceLayer(space.queues) : Feed.notAvailable), Layer.provideMerge(isDev ? asyncTaskTaggingLayer() : Layer.empty));
|
|
208
|
+
}));
|
|
209
|
+
const runtime2 = ManagedRuntime.make(layer);
|
|
210
|
+
log("getRuntime ready (managed runtime created)", {
|
|
211
|
+
spaceId
|
|
212
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 189, S: this });
|
|
213
|
+
this.#runtimes.set(spaceId, runtime2);
|
|
214
|
+
return runtime2;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
export {
|
|
218
|
+
compute_runtime_default as default
|
|
219
|
+
};
|
|
220
|
+
//# sourceMappingURL=compute-runtime-2Q5MGOR6.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/compute-runtime.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Registry } from '@effect-atom/atom';\nimport * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';\nimport * as KeyValueStore from '@effect/platform/KeyValueStore';\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Fiber from 'effect/Fiber';\nimport * as Layer from 'effect/Layer';\nimport * as ManagedRuntime from 'effect/ManagedRuntime';\n\nimport { AiService, OpaqueToolkit } from '@dxos/ai';\nimport { Capabilities, Capability, type CapabilityManager } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { AiContextBinder, AiContextService, AiSession, AiSessionService } from '@dxos/assistant';\nimport { McpServer } from '@dxos/assistant-toolkit';\nimport { ClientService } from '@dxos/client';\nimport { SpaceProperties } from '@dxos/client-protocol';\nimport {\n Blueprint,\n Credential,\n Operation,\n OperationHandlerSet,\n OperationRegistry,\n ServiceNotAvailableError,\n} from '@dxos/compute';\nimport { Resource } from '@dxos/context';\nimport { Database, DXN, Feed, Filter, Obj } from '@dxos/echo';\nimport { AtomObj } from '@dxos/echo-atom';\nimport { createFeedServiceLayer } from '@dxos/echo-db';\nimport { acquireReleaseResource, asyncTaskTaggingLayer } from '@dxos/effect';\nimport {\n FunctionInvocationService,\n feedServiceFromQueueServiceLayer,\n QueueService,\n credentialsLayerFromDatabase,\n} from '@dxos/functions';\nimport { AgentService } from '@dxos/functions-runtime';\nimport {\n FeedTraceSink,\n FunctionImplementationResolver,\n FunctionInvocationServiceLayerWithLocalLoopbackExecutor,\n ProcessManager,\n RemoteFunctionExecutionService,\n ServiceResolver,\n TriggerDispatcher,\n TriggerStateStore,\n} from '@dxos/functions-runtime';\nimport { invariant } from '@dxos/invariant';\nimport { type SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { AutomationCapabilities } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const capabilities = yield* Capability.Service;\n const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());\n return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () =>\n Effect.tryPromise(() => provider.close()),\n );\n }),\n);\n\ndeclare global {\n interface ImportMeta {\n env: ImportMetaEnv;\n }\n\n interface ImportMetaEnv {\n DEV: boolean;\n }\n}\n\nconst isDev = import.meta.env.DEV ?? false;\n\n/** Node / test environments have no `localStorage`; browser keeps persistent trigger state. */\nconst triggerStateStoreLayer =\n typeof globalThis.localStorage !== 'undefined'\n ? TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage))\n : TriggerStateStore.layerMemory;\n\n/**\n * Adapts plugin capabilities to runtime layers.\n */\nclass ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {\n readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();\n readonly #subscriptions = new Map<SpaceId, () => void>();\n readonly #capabilities: CapabilityManager.CapabilityManager;\n\n constructor(capabilities: CapabilityManager.CapabilityManager) {\n super();\n this.#capabilities = capabilities;\n }\n\n protected override async _open() {}\n\n protected override async _close() {\n for (const unsubscribe of this.#subscriptions.values()) {\n unsubscribe();\n }\n this.#subscriptions.clear();\n await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));\n this.#runtimes.clear();\n }\n\n getRuntime(spaceId: SpaceId): AutomationCapabilities.ComputeRuntime {\n if (this.#runtimes.has(spaceId)) {\n log('getRuntime cache hit', { spaceId });\n return this.#runtimes.get(spaceId)!;\n }\n log('getRuntime building', { spaceId });\n\n const layer = Layer.unwrapScoped(\n Effect.gen(this, function* () {\n log('compute runtime layer build: start', { spaceId });\n const client = this.#capabilities.get(ClientCapabilities.Client);\n const aiServiceLayer =\n this.#capabilities.get(AppCapabilities.AiServiceLayer) ?? Layer.die('AiService not found');\n const registry = this.#capabilities.get(Capabilities.AtomRegistry);\n\n // TODO(dmaretskyi): Make these reactive.\n const operationHandlers = OperationHandlerSet.merge(\n ...this.#capabilities.getAll(Capabilities.OperationHandler),\n );\n\n const opaqueToolkitProvider = Layer.succeed(OpaqueToolkit.OpaqueToolkitProvider, {\n getToolkit: () => {\n const toolkits = this.#capabilities.getAll(AppCapabilities.Toolkit);\n return OpaqueToolkit.merge(...toolkits);\n },\n });\n\n const blueprints = this.#capabilities\n .getAll(AppCapabilities.BlueprintDefinition)\n .flatMap((blueprint) => blueprint.make());\n\n const space = client.spaces.get(spaceId);\n invariant(space, `Invalid space: ${spaceId}`);\n log('compute runtime layer build: waiting for space ready', { spaceId });\n const waitStarted = Date.now();\n yield* Effect.promise(() => space.waitUntilReady());\n log('compute runtime layer build: space ready', { spaceId, waitMs: Date.now() - waitStarted });\n\n // Maintain a live query of space-level MCP server configs.\n const mcpQuery = space.db.query(Filter.type(McpServer.McpServer));\n this.#subscriptions.set(spaceId, mcpQuery.subscribe());\n\n log('compute runtime layer build: composing inner layer', { spaceId });\n return Layer.scopedDiscard(\n Effect.gen(function* () {\n log('compute runtime inner layer: acquiring services', { spaceId });\n const registry = yield* Registry.AtomRegistry;\n const triggerDispatcher = yield* TriggerDispatcher;\n log('compute runtime inner layer: services acquired', { spaceId });\n // Track the in-flight start/stop so a new transition cancels the previous one\n // (preserving ordering on rapid toggles) and surfaces failures via the Effect logger.\n let inFlight: Fiber.RuntimeFiber<unknown, unknown> | undefined;\n const transition = (effect: Effect.Effect<unknown, unknown>) => {\n if (inFlight) {\n Effect.runFork(Fiber.interrupt(inFlight));\n }\n inFlight = Effect.runFork(\n effect.pipe(\n Effect.tapErrorCause((cause) => Effect.logError('trigger dispatcher transition failed', cause)),\n ),\n );\n };\n const unsubscribe = registry.subscribe(\n AtomObj.make(space.properties),\n (properties: Obj.Snapshot<SpaceProperties>) => {\n const computeEnvironment = properties.computeEnvironment ?? 'local';\n transition(computeEnvironment === 'local' ? triggerDispatcher.start() : triggerDispatcher.stop());\n },\n { immediate: true },\n );\n yield* Effect.addFinalizer(() =>\n Effect.sync(() => {\n log('compute runtime inner layer: finalize', { spaceId });\n unsubscribe();\n if (inFlight) {\n Effect.runFork(Fiber.interrupt(inFlight));\n }\n }),\n );\n log('compute runtime inner layer: acquire complete', { spaceId });\n }),\n )\n .pipe(\n Layer.provideMerge(TriggerDispatcher.layer({ timeControl: 'natural' })),\n Layer.provideMerge(\n AgentService.layer({\n getMcpServers: () =>\n mcpQuery.results\n .filter(Obj.instanceOf(McpServer.McpServer))\n .filter((server) => server.enabled !== false)\n .map(({ url, protocol, apiKey }) => ({ url, protocol, apiKey })),\n }),\n ),\n Layer.provideMerge(ProcessManager.ProcessOperationInvoker.layer),\n Layer.provideMerge(ProcessManager.layer()),\n // TODO(dmaretskyi): Duped in assistant testing layer.\n Layer.provideMerge(\n // TODO(dmaretskyi): Refactor to be able to merge resovler layers, also consider service mesh achitecture.\n Layer.effect(\n ServiceResolver.ServiceResolver,\n Effect.gen(function* () {\n const services = yield* Effect.context<Database.Service | Feed.FeedService>().pipe(\n Effect.map(Context.pick(Database.Service, Feed.FeedService)),\n Effect.map(Layer.succeedContext),\n );\n // AiContextBinder.\n return ServiceResolver.compose(\n ServiceResolver.succeed(AiContextService, (context) =>\n Effect.gen(function* () {\n if (!context.conversation) {\n return yield* Effect.fail(new ServiceNotAvailableError(AiContextService.key));\n }\n const feed = yield* Database.resolve(DXN.parse(context.conversation), Feed.Feed).pipe(\n Effect.orDie,\n );\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const binder = yield* acquireReleaseResource(\n () =>\n new AiContextBinder({\n feed,\n runtime,\n }),\n );\n return { binder };\n }).pipe(Effect.provide(services)),\n ),\n // AiSessionService.\n ServiceResolver.succeed(AiSessionService, (context) =>\n Effect.gen(function* () {\n if (!context.conversation) {\n return yield* Effect.fail(new ServiceNotAvailableError(AiSessionService.key));\n }\n const feed = yield* Database.resolve(DXN.parse(context.conversation), Feed.Feed).pipe(\n Effect.orDie,\n );\n const runtime = yield* Effect.runtime<Feed.FeedService>();\n const session = yield* acquireReleaseResource(\n () =>\n new AiSession({\n feed,\n runtime,\n }),\n );\n return session;\n }).pipe(Effect.provide(services)),\n ),\n yield* ServiceResolver.fromRequirements(\n Database.Service,\n OpaqueToolkit.OpaqueToolkitProvider,\n Feed.FeedService,\n QueueService,\n AiService.AiService,\n OperationRegistry.Service,\n Blueprint.RegistryService,\n Credential.CredentialsService,\n ),\n );\n }),\n ),\n ),\n Layer.provideMerge(Layer.succeed(Blueprint.RegistryService, new Blueprint.Registry(blueprints))),\n Layer.provideMerge(Layer.succeed(Capability.Service, this.#capabilities)),\n Layer.provideMerge(Layer.succeed(Registry.AtomRegistry, registry)),\n Layer.provideMerge(\n Layer.mergeAll(FeedTraceSink.layerLive, triggerStateStoreLayer, KeyValueStore.layerMemory),\n ),\n Layer.provideMerge(OperationRegistry.layer),\n Layer.provideMerge(feedServiceFromQueueServiceLayer),\n Layer.provideMerge(OperationHandlerSet.provide(operationHandlers)),\n Layer.provideMerge(\n Layer.effect(\n Operation.Service,\n Effect.gen(function* () {\n const fis = yield* FunctionInvocationService;\n return {\n invoke: (op: any, ...args: any[]) => (fis.invokeFunction as any)(op, args[0]),\n schedule: (op: any, ...args: any[]) =>\n (fis.invokeFunction as any)(op, args[0]).pipe(Effect.fork, Effect.asVoid),\n invokePromise: async () => ({ error: new Error('Not implemented') }),\n } as unknown as Operation.OperationService;\n }),\n ),\n ),\n Layer.provideMerge(\n FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(\n Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: operationHandlers })),\n Layer.provideMerge(\n client.config.values.runtime?.services?.edge?.url\n ? RemoteFunctionExecutionService.fromClient(\n client,\n client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,\n )\n : RemoteFunctionExecutionService.layerMock,\n ),\n ),\n ),\n Layer.provideMerge(opaqueToolkitProvider),\n Layer.provideMerge(aiServiceLayer),\n Layer.provideMerge(credentialsLayerFromDatabase()),\n Layer.provideMerge(ClientService.fromClient(client)),\n Layer.provideMerge(space ? Database.layer(space.db) : Database.notAvailable),\n )\n .pipe(\n Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),\n Layer.provideMerge(space ? createFeedServiceLayer(space.queues) : Feed.notAvailable),\n Layer.provideMerge(isDev ? asyncTaskTaggingLayer() : Layer.empty),\n );\n }),\n );\n\n const runtime = ManagedRuntime.make(layer);\n log('getRuntime ready (managed runtime created)', { spaceId });\n this.#runtimes.set(spaceId, runtime);\n return runtime;\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,gBAAgB;AACzB,YAAYC,0BAA0B;AACtC,YAAYC,mBAAmB;AAC/B,YAAYC,aAAa;AACzB,YAAYC,YAAY;AACxB,YAAYC,WAAW;AACvB,YAAYC,WAAW;AACvB,YAAYC,oBAAoB;AAEhC,SAASC,WAAWC,qBAAqB;AACzC,SAASC,cAAcC,kBAA0C;AACjE,SAASC,uBAAuB;AAChC,SAASC,iBAAiBC,kBAAkBC,WAAWC,wBAAwB;AAC/E,SAASC,iBAAiB;AAC1B,SAASC,qBAAqB;AAE9B,SACEC,WACAC,YACAC,WACAC,qBACAC,mBACAC,gCACK;AACP,SAASC,gBAAgB;AACzB,SAASC,UAAUC,KAAKC,MAAMC,QAAQC,WAAW;AACjD,SAASC,eAAe;AACxB,SAASC,8BAA8B;AACvC,SAASC,wBAAwBC,6BAA6B;AAC9D,SACEC,2BACAC,kCACAC,cACAC,oCACK;AACP,SAASC,oBAAoB;AAC7B,SACEC,eACAC,gCACAC,yDACAC,gBACAC,gCACAC,iBACAC,mBACAC,yBACK;AACP,SAASC,iBAAiB;AAE1B,SAASC,WAAW;AACpB,SAASC,0BAA0B;AAEnC,SAASC,8BAA8B;AAEvC,IAAA,eAAexC;IAGX,0BAAMyC,WAAW,WAAcC,kBAAqBC,aAAAA;AACpD,QAAA,eAAkBC,OAAAA,WAAYJ;AAIhC,QAAA,WAAA,OAAA,kBAAA,MAAA,IAAA,2BAAA,YAAA,EAAA,KAAA,CAAA;AAYF,SAAMK,WAAQ,YAAmB,uBAAI,gBAAA,UAAA,MAAA,kBAAA,MAAA,SAAA,MAAA,CAAA,CAAA;AAErC,CAAA,CAAA;AAMA,IAAA,QAAA,YAAA,IAAA,OAAA;;AAKW,IAAA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AAAA,KAAAA,CAAAA;AACT,SAAA,UAAA,IAAA,SAAAA,QAAA;AACF,WAAAA;;;",
|
|
6
|
+
"names": ["Registry", "BrowserKeyValueStore", "KeyValueStore", "Context", "Effect", "Fiber", "Layer", "ManagedRuntime", "AiService", "OpaqueToolkit", "Capabilities", "Capability", "AppCapabilities", "AiContextBinder", "AiContextService", "AiSession", "AiSessionService", "McpServer", "ClientService", "Blueprint", "Credential", "Operation", "OperationHandlerSet", "OperationRegistry", "ServiceNotAvailableError", "Resource", "Database", "DXN", "Feed", "Filter", "Obj", "AtomObj", "createFeedServiceLayer", "acquireReleaseResource", "asyncTaskTaggingLayer", "FunctionInvocationService", "feedServiceFromQueueServiceLayer", "QueueService", "credentialsLayerFromDatabase", "AgentService", "FeedTraceSink", "FunctionImplementationResolver", "FunctionInvocationServiceLayerWithLocalLoopbackExecutor", "ProcessManager", "RemoteFunctionExecutionService", "ServiceResolver", "TriggerDispatcher", "TriggerStateStore", "invariant", "log", "ClientCapabilities", "AutomationCapabilities", "provider", "tryPromise", "ComputeRuntimeProviderImpl", "contributes", "isDev", "capabilities", "_open", "unsubscribe", "getRuntime", "spaceId", "aiServiceLayer", "get", "registry", "AtomRegistry", "operationHandlers", "getToolkit", "getAll", "promise", "space", "waitUntilReady", "waitMs", "waitStarted", "mcpQuery", "query", "type", "triggerDispatcher", "runFork", "interrupt", "inFlight", "pipe", "subscribe", "make", "properties", "transition", "computeEnvironment", "start", "immediate", "addFinalizer", "timeControl", "provideMerge", "getMcpServers", "url", "protocol", "apiKey", "effect", "succeed", "context", "gen", "feed", "resolve", "conversation", "binder", "runtime", "session", "fis", "invoke", "schedule", "invokePromise", "error", "functions", "client", "config", "layer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/containers/index.ts
|
|
4
|
+
import { lazy } from "react";
|
|
5
|
+
var AutomationSettings = lazy(() => import("../AutomationSettings-NNL2AVNT.mjs"));
|
|
6
|
+
var FunctionsContainer = lazy(() => import("../FunctionsContainer-CU2FVKZF.mjs"));
|
|
7
|
+
var TriggerSettings = lazy(() => import("../TriggerSettings-XCHIZPOR.mjs"));
|
|
8
|
+
export {
|
|
9
|
+
AutomationSettings,
|
|
10
|
+
FunctionsContainer,
|
|
11
|
+
TriggerSettings
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\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,SAA6BA,YAAY;AAElC,IAAMC,qBAAyCD,KAAK,MAAM,OAAO,oCAAA,CAAA;AACjE,IAAME,qBAAyCF,KAAK,MAAM,OAAO,oCAAA,CAAA;AACjE,IAAMG,kBAAsCH,KAAK,MAAM,OAAO,iCAAA,CAAA;",
|
|
6
|
+
"names": ["lazy", "AutomationSettings", "FunctionsContainer", "TriggerSettings"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationOperation_exports
|
|
3
|
+
} from "./chunk-DSCOLDT5.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/operations/create-trigger-from-template.ts
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import { LayoutOperation, getSpacePath } from "@dxos/app-toolkit";
|
|
9
|
+
import { Operation, Script, Trigger } from "@dxos/compute";
|
|
10
|
+
import { Obj, Ref } from "@dxos/echo";
|
|
11
|
+
import { SpaceOperation } from "@dxos/plugin-space";
|
|
12
|
+
import { Filter } from "@dxos/react-client/echo";
|
|
13
|
+
import { meta } from "#meta";
|
|
14
|
+
var handler = AutomationOperation_exports.CreateTriggerFromTemplate.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ db, template, enabled = false, scriptName, input }) {
|
|
15
|
+
const trigger = Trigger.make({
|
|
16
|
+
enabled,
|
|
17
|
+
input
|
|
18
|
+
});
|
|
19
|
+
if (scriptName) {
|
|
20
|
+
const scripts = yield* Effect.promise(() => db.query(Filter.type(Script.Script, {
|
|
21
|
+
name: scriptName
|
|
22
|
+
})).run());
|
|
23
|
+
const [script] = scripts;
|
|
24
|
+
if (script) {
|
|
25
|
+
const functions = yield* Effect.promise(() => db.query(Filter.type(Operation.PersistentOperation, {
|
|
26
|
+
source: Ref.make(script)
|
|
27
|
+
})).run());
|
|
28
|
+
const [fn] = functions;
|
|
29
|
+
if (fn) {
|
|
30
|
+
Obj.update(trigger, (trigger2) => {
|
|
31
|
+
trigger2.function = Ref.make(fn);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
switch (template.type) {
|
|
37
|
+
case "timer": {
|
|
38
|
+
Obj.update(trigger, (trigger2) => {
|
|
39
|
+
trigger2.spec = Trigger.specTimer(template.cron);
|
|
40
|
+
});
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
case "queue": {
|
|
44
|
+
Obj.update(trigger, (trigger2) => {
|
|
45
|
+
trigger2.spec = Trigger.specQueue(template.queueDXN.toString());
|
|
46
|
+
});
|
|
47
|
+
break;
|
|
48
|
+
}
|
|
49
|
+
default: {
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
54
|
+
object: trigger,
|
|
55
|
+
target: db,
|
|
56
|
+
hidden: true
|
|
57
|
+
});
|
|
58
|
+
yield* Operation.invoke(LayoutOperation.Open, {
|
|
59
|
+
subject: [
|
|
60
|
+
`${getSpacePath(db.spaceId)}/settings/${meta.id}.automations`
|
|
61
|
+
],
|
|
62
|
+
workspace: getSpacePath(db.spaceId)
|
|
63
|
+
});
|
|
64
|
+
})));
|
|
65
|
+
var create_trigger_from_template_default = handler;
|
|
66
|
+
export {
|
|
67
|
+
create_trigger_from_template_default as default
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=create-trigger-from-template-5FT7O7OU.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/operations/create-trigger-from-template.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { LayoutOperation, getSpacePath } from '@dxos/app-toolkit';\nimport { Operation, Script, Trigger } from '@dxos/compute';\nimport { Obj, Ref } from '@dxos/echo';\nimport { type DXN } from '@dxos/keys';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { Filter } from '@dxos/react-client/echo';\n\nimport { meta } from '#meta';\n\nimport { AutomationOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof AutomationOperation.CreateTriggerFromTemplate> =\n AutomationOperation.CreateTriggerFromTemplate.pipe(\n Operation.withHandler(\n 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(() => db.query(Filter.type(Script.Script, { name: scriptName })).run());\n const [script] = scripts;\n if (script) {\n const functions = yield* Effect.promise(() =>\n db.query(Filter.type(Operation.PersistentOperation, { source: Ref.make(script) })).run(),\n );\n const [fn] = functions;\n if (fn) {\n Obj.update(trigger, (trigger) => {\n trigger.function = Ref.make(fn);\n });\n }\n }\n }\n\n switch (template.type) {\n case 'timer': {\n Obj.update(trigger, (trigger) => {\n trigger.spec = Trigger.specTimer(template.cron);\n });\n break;\n }\n case 'queue': {\n Obj.update(trigger, (trigger) => {\n trigger.spec = Trigger.specQueue((template.queueDXN as DXN).toString());\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\nexport default handler;\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiBC,oBAAoB;AAC9C,SAASC,WAAWC,QAAQC,eAAe;AAC3C,SAASC,KAAKC,WAAW;AAEzB,SAASC,sBAAsB;AAC/B,SAASC,cAAc;AAEvB,SAASC,YAAY;AAIrB,IAAMC,UACJC,4BAAoBC,0BAA0BC,KAC5CC,UAAUC,YACDC,kBAAW,WAAW,EAAEC,IAAIC,UAAUC,UAAU,OAAOC,YAAYC,MAAK,GAAE;AAC/E,QAAMC,UAAUC,QAAQC,KAAK;IAAEL;IAASE;EAAM,CAAA;AAG9C,MAAID,YAAY;AACd,UAAMK,UAAU,OAAcC,eAAQ,MAAMT,GAAGU,MAAMC,OAAOC,KAAKC,OAAOA,QAAQ;MAAEC,MAAMX;IAAW,CAAA,CAAA,EAAIY,IAAG,CAAA;AAC1G,UAAM,CAACC,MAAAA,IAAUR;AACjB,QAAIQ,QAAQ;AACV,YAAMC,YAAY,OAAcR,eAAQ,MACtCT,GAAGU,MAAMC,OAAOC,KAAKf,UAAUqB,qBAAqB;QAAEC,QAAQC,IAAIb,KAAKS,MAAAA;MAAQ,CAAA,CAAA,EAAID,IAAG,CAAA;AAExF,YAAM,CAACM,EAAAA,IAAMJ;AACb,UAAII,IAAI;AACNC,YAAIC,OAAOlB,SAAS,CAACA,aAAAA;AACnBA,UAAAA,SAAQmB,WAAWJ,IAAIb,KAAKc,EAAAA;QAC9B,CAAA;MACF;IACF;EACF;AAEA,UAAQpB,SAASW,MAAI;IACnB,KAAK,SAAS;AACZU,UAAIC,OAAOlB,SAAS,CAACA,aAAAA;AACnBA,QAAAA,SAAQoB,OAAOnB,QAAQoB,UAAUzB,SAAS0B,IAAI;MAChD,CAAA;AACA;IACF;IACA,KAAK,SAAS;AACZL,UAAIC,OAAOlB,SAAS,CAACA,aAAAA;AACnBA,QAAAA,SAAQoB,OAAOnB,QAAQsB,UAAW3B,SAAS4B,SAAiBC,SAAQ,CAAA;MACtE,CAAA;AACA;IACF;IACA,SAAS;AACP;IACF;EACF;AAEA,SAAOjC,UAAUkC,OAAOC,eAAeC,WAAW;IAChDC,QAAQ7B;IACR8B,QAAQnC;IACRoC,QAAQ;EACV,CAAA;AACA,SAAOvC,UAAUkC,OAAOM,gBAAgBC,MAAM;IAC5CC,SAAS;MAAC,GAAGC,aAAaxC,GAAGyC,OAAO,CAAA,aAAcC,KAAKC,EAAE;;IACzDC,WAAWJ,aAAaxC,GAAGyC,OAAO;EACpC,CAAA;AACF,CAAA,CAAA,CAAA;AAIN,IAAA,uCAAehD;",
|
|
6
|
+
"names": ["Effect", "LayoutOperation", "getSpacePath", "Operation", "Script", "Trigger", "Obj", "Ref", "SpaceOperation", "Filter", "meta", "handler", "AutomationOperation", "CreateTriggerFromTemplate", "pipe", "Operation", "withHandler", "fnUntraced", "db", "template", "enabled", "scriptName", "input", "trigger", "Trigger", "make", "scripts", "promise", "query", "Filter", "type", "Script", "name", "run", "script", "functions", "PersistentOperation", "source", "Ref", "fn", "Obj", "update", "function", "spec", "specTimer", "cron", "specQueue", "queueDXN", "toString", "invoke", "SpaceOperation", "AddObject", "object", "target", "hidden", "LayoutOperation", "Open", "subject", "getSpacePath", "spaceId", "meta", "id", "workspace"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AutomationCapabilities_exports
|
|
3
|
+
} from "../chunk-DSCOLDT5.mjs";
|
|
4
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
7
|
+
import { useCallback } from "react";
|
|
8
|
+
|
|
9
|
+
// src/hooks/useComputeRuntime.ts
|
|
10
|
+
import { useEffect } from "react";
|
|
11
|
+
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
12
|
+
import { log } from "@dxos/log";
|
|
13
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/hooks/useComputeRuntime.ts";
|
|
14
|
+
var useComputeRuntime = (id) => {
|
|
15
|
+
const [computeRuntime] = useCapabilities(AutomationCapabilities_exports.ComputeRuntime);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
log("useComputeRuntime", {
|
|
18
|
+
hasCapability: !!computeRuntime,
|
|
19
|
+
spaceId: id
|
|
20
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 16, S: void 0 });
|
|
21
|
+
}, [
|
|
22
|
+
!!computeRuntime,
|
|
23
|
+
id
|
|
24
|
+
]);
|
|
25
|
+
if (!computeRuntime || id === void 0) {
|
|
26
|
+
return void 0;
|
|
27
|
+
}
|
|
28
|
+
return computeRuntime.getRuntime(id);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
// src/hooks/useComputeRuntimeCallback.ts
|
|
32
|
+
var useComputeRuntimeCallback = (id, fn, deps) => {
|
|
33
|
+
const runtime = useComputeRuntime(id);
|
|
34
|
+
return useCallback(() => {
|
|
35
|
+
if (!runtime) {
|
|
36
|
+
throw new TypeError("Space not provided to useComputeRuntimeCallback");
|
|
37
|
+
}
|
|
38
|
+
return runtime.runPromise(fn());
|
|
39
|
+
}, [
|
|
40
|
+
runtime,
|
|
41
|
+
...deps ?? []
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// src/hooks/useTriggerRuntimeControls.ts
|
|
46
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
47
|
+
import * as Effect from "effect/Effect";
|
|
48
|
+
import { useEffect as useEffect2, useState } from "react";
|
|
49
|
+
import { Trigger } from "@dxos/compute";
|
|
50
|
+
import { Filter, Query } from "@dxos/echo";
|
|
51
|
+
import { TriggerDispatcher } from "@dxos/functions-runtime";
|
|
52
|
+
import { useQuery } from "@dxos/react-client/echo";
|
|
53
|
+
var useTriggerRuntimeControls = (db) => {
|
|
54
|
+
const triggers = useQuery(db, Query.select(Filter.type(Trigger.Trigger)).debugLabel("plugin-automation.useTriggerRuntimeControls"));
|
|
55
|
+
const [dispatcher, setDispatcher] = useState(void 0);
|
|
56
|
+
const init = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
|
|
57
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
58
|
+
setDispatcher(dispatcher2);
|
|
59
|
+
}));
|
|
60
|
+
useEffect2(() => {
|
|
61
|
+
void init();
|
|
62
|
+
}, []);
|
|
63
|
+
const state = useAtomValue(dispatcher?.state ?? Atom.make(void 0));
|
|
64
|
+
const start = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
|
|
65
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
66
|
+
yield* dispatcher2.start();
|
|
67
|
+
}));
|
|
68
|
+
const stop = useComputeRuntimeCallback(db?.spaceId, Effect.fnUntraced(function* () {
|
|
69
|
+
const dispatcher2 = yield* TriggerDispatcher;
|
|
70
|
+
yield* dispatcher2.stop();
|
|
71
|
+
}));
|
|
72
|
+
return {
|
|
73
|
+
triggers,
|
|
74
|
+
state,
|
|
75
|
+
start: () => void start(),
|
|
76
|
+
stop: () => void stop()
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
// src/hooks/useComputeRuntimeService.ts
|
|
81
|
+
import * as Effect2 from "effect/Effect";
|
|
82
|
+
import * as Exit from "effect/Exit";
|
|
83
|
+
import { useEffect as useEffect3, useState as useState2 } from "react";
|
|
84
|
+
import { log as log2 } from "@dxos/log";
|
|
85
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-automation/src/hooks/useComputeRuntimeService.ts";
|
|
86
|
+
var useComputeRuntimeService = (tag, spaceId) => {
|
|
87
|
+
const runtime = useComputeRuntime(spaceId);
|
|
88
|
+
const [service, setService] = useState2(void 0);
|
|
89
|
+
useEffect3(() => {
|
|
90
|
+
setService(void 0);
|
|
91
|
+
if (!runtime) {
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
let cancelled = false;
|
|
95
|
+
void (async () => {
|
|
96
|
+
try {
|
|
97
|
+
const exit = await runtime.runPromiseExit(tag.pipe(Effect2.timeout("30 seconds")));
|
|
98
|
+
if (cancelled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (Exit.isSuccess(exit)) {
|
|
102
|
+
setService(exit.value);
|
|
103
|
+
} else {
|
|
104
|
+
log2.warn("useComputeRuntimeService: failed to acquire service", {
|
|
105
|
+
cause: exit.cause
|
|
106
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 37, S: void 0 });
|
|
107
|
+
}
|
|
108
|
+
} catch (error) {
|
|
109
|
+
if (!cancelled) {
|
|
110
|
+
log2.catch(error, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 43, S: void 0 });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
})();
|
|
114
|
+
return () => {
|
|
115
|
+
cancelled = true;
|
|
116
|
+
};
|
|
117
|
+
}, [
|
|
118
|
+
runtime,
|
|
119
|
+
tag
|
|
120
|
+
]);
|
|
121
|
+
return service;
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
useComputeRuntime,
|
|
125
|
+
useComputeRuntimeCallback,
|
|
126
|
+
useComputeRuntimeService,
|
|
127
|
+
useTriggerRuntimeControls
|
|
128
|
+
};
|
|
129
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/hooks/useComputeRuntimeCallback.ts", "../../../../src/hooks/useComputeRuntime.ts", "../../../../src/hooks/useTriggerRuntimeControls.ts", "../../../../src/hooks/useComputeRuntimeService.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport { type DependencyList, useCallback } from 'react';\n\nimport { type Key } from '@dxos/echo';\n\nimport { AutomationCapabilities } from '#types';\n\nimport { useComputeRuntime } from './useComputeRuntime';\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 runtime = useComputeRuntime(id);\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// Copyright 2025 DXOS.org\n//\n\nimport { useEffect } from 'react';\n\nimport { useCapabilities } from '@dxos/app-framework/ui';\nimport { SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\n\nimport { AutomationCapabilities } from '../types';\n\n/**\n * Resolves the compute runtime for a space.\n * Returns undefined if the AutomationPlugin is not loaded or spaceId is not provided.\n */\nexport const useComputeRuntime = (id: SpaceId | undefined): AutomationCapabilities.ComputeRuntime | undefined => {\n const [computeRuntime] = useCapabilities(AutomationCapabilities.ComputeRuntime);\n // One log per change of (capability availability, spaceId) so we can see when\n // the React subscription actually observes the contributed runtime.\n useEffect(() => {\n log('useComputeRuntime', { hasCapability: !!computeRuntime, spaceId: id });\n }, [!!computeRuntime, id]);\n\n if (!computeRuntime || id === undefined) {\n return undefined;\n }\n\n return computeRuntime.getRuntime(id);\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 { Trigger } from '@dxos/compute';\nimport { type Database, Filter, Query } from '@dxos/echo';\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(\n db,\n Query.select(Filter.type(Trigger.Trigger)).debugLabel('plugin-automation.useTriggerRuntimeControls'),\n );\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", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Context from 'effect/Context';\nimport * as Effect from 'effect/Effect';\nimport * as Exit from 'effect/Exit';\nimport { useEffect, useState } from 'react';\n\nimport { SpaceId } from '@dxos/keys';\nimport { log } from '@dxos/log';\n\nimport { useComputeRuntime } from './useComputeRuntime';\n\ntype ResolvedService<T extends Context.Tag<any, any>> = Context.Tag.Service<T> | undefined;\n\n/**\n * Resolves a service from the compute runtime for a given space.\n *\n * NOTE: Previously implemented via `use(useMemo(() => runtime.runPromiseExit(...)))`.\n * React's `use()` is weird and unreliable in production builds — the Suspense\n * boundary can stay pending indefinitely without the promise ever resolving\n * from React's perspective (the runtime is built lazily on first invocation\n * and one of its `acquire` steps can block). This `useState` + `useEffect`\n * flavour avoids suspension entirely: the hook returns `undefined` while the\n * service is being acquired or if acquisition fails / times out.\n */\nexport const useComputeRuntimeService = <T extends Context.Tag<any, any>>(\n tag: T,\n spaceId?: SpaceId,\n): ResolvedService<T> => {\n const runtime = useComputeRuntime(spaceId);\n const [service, setService] = useState<ResolvedService<T>>(undefined);\n\n useEffect(() => {\n setService(undefined);\n if (!runtime) {\n return;\n }\n let cancelled = false;\n void (async () => {\n try {\n const exit = await runtime.runPromiseExit(tag.pipe(Effect.timeout('30 seconds')));\n if (cancelled) {\n return;\n }\n if (Exit.isSuccess(exit)) {\n setService(exit.value);\n } else {\n log.warn('useComputeRuntimeService: failed to acquire service', { cause: exit.cause });\n }\n } catch (error) {\n if (!cancelled) {\n log.catch(error);\n }\n }\n })();\n return () => {\n cancelled = true;\n };\n }, [runtime, tag]);\n\n return service;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAKA,SAA8BA,mBAAmB;;;ACDjD,SAASC,iBAAiB;AAE1B,SAASC,uBAAuB;AAEhC,SAASC,WAAW;AAIpB,IAAA,eAAA;AAME,IAAA,oBAAA,CAAA,OAAA;AACA,QAAA,CAAA,cAAA,IAAA,gBAAA,+BAAA,cAAoE;YAEvCC,MAAAA;QAAiCC,qBAASC;MAAG,eAAA,CAAA,CAAA;MACvE,SAAA;IAAC,GAAEC,EAAAA,YAAAA,YAAAA,GAAAA,cAAAA,GAAAA,IAAAA,GAAAA,OAAAA,CAAAA;;IAAmB,CAAA,CAAA;IAErB;;AAEJ,MAAA,CAAA,kBAA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AI,OAAO,MAAM,KAAKA,MAAAA;IAClBC,MAAM,MAAM,KAAKA,KAAAA;EACnB;AACF;;;AChEA,YAAYC,aAAY;AACxB,YAAYC,UAAU;AACtB,SAASC,aAAAA,YAAWC,YAAAA,iBAAgB;AAGpC,SAASC,OAAAA,YAAW;AAMpB,IAAAC,gBAAA;AAgBSC,IAAAA,2BAAoDC,CAAAA,KAAAA,YAAAA;AAE3DC,QAAAA,UAAU,kBAAA,OAAA;QACRC,CAAAA,SAAWF,UAAAA,IAAAA,UAAAA,MAAAA;aACNG,MAAAA;eACH,MAAA;AACF,QAAA,CAAA,SAAA;AACIC;IACJ;QACE,YAAI;sBACIC;UACN;cACE,OAAA,MAAA,QAAA,eAAA,IAAA,KAAA,gBAAA,YAAA,CAAA,CAAA;AACF,YAAA,WAAA;AACIC;;AAEJ,YAAO,eAAA,IAAA,GAAA;AACLC,qBAAS,KAAA,KAAA;;AAA2E,UAAAA,KAAA,KAAA,uDAAA;YACtF,OAAA,KAAA;UACA,GAAOC,EAAAA,YAAO,YAAA,GAAAV,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;QACd;eACES,OAAIE;AACN,YAAA,CAAA,WAAA;AACF,UAAAF,KAAA,MAAA,OAAA,QAAA,EAAA,YAAA,YAAA,GAAAT,eAAA,GAAA,IAAA,GAAA,OAAA,CAAA;QACF;MACA;;AAEA,WAAA,MAAA;AACC,kBAAA;IAACK;;IAAa;IAEjB;EACA,CAAA;;;",
|
|
6
|
+
"names": ["useCallback", "useEffect", "useCapabilities", "log", "hasCapability", "spaceId", "id", "computeRuntime", "useComputeRuntimeCallback", "id", "fn", "deps", "runtime", "useComputeRuntime", "useCallback", "TypeError", "runPromise", "Atom", "useAtomValue", "Effect", "useEffect", "useState", "Trigger", "Filter", "Query", "TriggerDispatcher", "useQuery", "useTriggerRuntimeControls", "db", "triggers", "useQuery", "Query", "select", "Filter", "type", "Trigger", "debugLabel", "dispatcher", "setDispatcher", "useState", "undefined", "init", "useComputeRuntimeCallback", "spaceId", "fnUntraced", "TriggerDispatcher", "useEffect", "state", "useAtomValue", "Atom", "make", "start", "stop", "Effect", "Exit", "useEffect", "useState", "log", "__dxlog_file", "service", "undefined", "useEffect", "setService", "runtime", "cancelled", "exit", "Exit", "log", "error", "catch"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-ATECY555.mjs";
|
|
4
|
+
import {
|
|
5
|
+
AutomationAction,
|
|
6
|
+
AutomationCapabilities_exports,
|
|
7
|
+
AutomationEvents_exports,
|
|
8
|
+
AutomationOperation_exports,
|
|
9
|
+
TriggerTemplate
|
|
10
|
+
} from "./chunk-DSCOLDT5.mjs";
|
|
11
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
12
|
+
export {
|
|
13
|
+
AutomationAction,
|
|
14
|
+
AutomationCapabilities_exports as AutomationCapabilities,
|
|
15
|
+
AutomationEvents_exports as AutomationEvents,
|
|
16
|
+
AutomationOperation_exports as AutomationOperation,
|
|
17
|
+
TriggerTemplate,
|
|
18
|
+
meta
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=index.mjs.map
|