@dxos/plugin-automation 0.8.4-main.9735255 → 0.8.4-main.9be5663bfe
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/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-POEIL4RN.mjs +44 -0
- package/dist/lib/browser/chunk-POEIL4RN.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JOXPQ27I.mjs → chunk-WQLEMRPU.mjs} +9 -38
- package/dist/lib/browser/chunk-WQLEMRPU.mjs.map +7 -0
- package/dist/lib/browser/cli/index.mjs +122 -107
- package/dist/lib/browser/cli/index.mjs.map +3 -3
- package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs +77 -0
- package/dist/lib/browser/create-trigger-from-template-JZ62EZTB.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +79 -7
- package/dist/lib/browser/hooks/index.mjs.map +4 -4
- package/dist/lib/browser/index.mjs +60 -92
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operations/index.mjs +14 -0
- package/dist/lib/browser/operations/index.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -4
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/{chunk-RX52VKI2.mjs → chunk-JWZAVQLF.mjs} +9 -37
- package/dist/lib/node-esm/chunk-JWZAVQLF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-SP3P4OUI.mjs +45 -0
- package/dist/lib/node-esm/chunk-SP3P4OUI.mjs.map +7 -0
- package/dist/lib/node-esm/cli/index.mjs +122 -107
- package/dist/lib/node-esm/cli/index.mjs.map +3 -3
- package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs +78 -0
- package/dist/lib/node-esm/create-trigger-from-template-224Z7WJI.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +79 -7
- package/dist/lib/node-esm/hooks/index.mjs.map +4 -4
- package/dist/lib/node-esm/index.mjs +60 -92
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operations/index.mjs +15 -0
- package/dist/lib/node-esm/operations/index.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -4
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +6 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +6 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +6 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/node.d.ts +3 -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 +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/cli/commands/trigger/create/index.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/queue.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/subscription.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/create/timer.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/list.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/remove.d.ts +1 -1
- package/dist/types/src/cli/commands/trigger/update/queue.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/update/subscription.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/update/timer.d.ts.map +1 -1
- package/dist/types/src/cli/commands/trigger/util.d.ts +2 -2
- package/dist/types/src/cli/commands/trigger/util.d.ts.map +1 -1
- package/dist/types/src/cli/plugin.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +3 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +28 -30
- 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.map +1 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts +3 -1
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts +2 -2
- package/dist/types/src/components/TriggerEditor/FunctionInputEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/SpecSelector.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +91 -91
- 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 +2 -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 +2 -0
- package/dist/types/src/containers/FunctionsContainer/index.d.ts.map +1 -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 +2 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntime.d.ts +7 -0
- package/dist/types/src/hooks/useComputeRuntime.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +1 -4
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts +5 -0
- package/dist/types/src/hooks/useComputeRuntimeService.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -5
- package/dist/types/src/index.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/definitions.d.ts +19 -0
- package/dist/types/src/operations/definitions.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +4 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/testing/test-functions.d.ts +2 -0
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +29 -31
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +6 -3
- package/dist/types/src/types/capabilities.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +9 -30
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +73 -46
- package/src/AutomationPlugin.tsx +13 -10
- package/src/capabilities/app-graph-builder.ts +62 -0
- package/src/capabilities/compute-runtime.ts +248 -0
- package/src/capabilities/index.ts +10 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +59 -0
- package/src/cli/commands/trigger/create/queue.ts +7 -6
- package/src/cli/commands/trigger/create/subscription.ts +7 -6
- package/src/cli/commands/trigger/create/timer.ts +7 -6
- package/src/cli/commands/trigger/list.ts +3 -2
- package/src/cli/commands/trigger/remove.ts +2 -2
- package/src/cli/commands/trigger/update/queue.ts +21 -21
- package/src/cli/commands/trigger/update/subscription.ts +20 -19
- package/src/cli/commands/trigger/update/timer.ts +21 -20
- package/src/cli/commands/trigger/util.ts +43 -29
- package/src/cli/plugin.ts +6 -6
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +10 -8
- package/src/components/AutomationPanel/AutomationPanel.tsx +160 -87
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +37 -31
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +27 -24
- package/src/components/FunctionsRegistry/index.ts +4 -1
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +17 -8
- package/src/components/TriggerEditor/SpecSelector.tsx +12 -3
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +56 -13
- package/src/components/TriggerEditor/TriggerEditor.tsx +46 -17
- package/src/components/index.ts +1 -2
- package/src/containers/AutomationSettings/AutomationSettings.tsx +28 -0
- package/src/containers/AutomationSettings/index.ts +5 -0
- package/src/containers/FunctionsContainer/FunctionsContainer.tsx +34 -0
- package/src/containers/FunctionsContainer/index.ts +5 -0
- package/src/{components → containers/TriggerSettings}/TriggerSettings.tsx +8 -7
- package/src/containers/TriggerSettings/index.ts +6 -0
- package/src/containers/index.ts +9 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/useComputeRuntime.ts +16 -0
- package/src/hooks/useComputeRuntimeCallback.ts +4 -39
- package/src/hooks/useComputeRuntimeService.ts +24 -0
- package/src/hooks/useTriggerRuntimeControls.ts +22 -8
- package/src/index.ts +2 -6
- package/src/meta.ts +2 -2
- package/src/operations/create-trigger-from-template.ts +75 -0
- package/src/operations/definitions.ts +28 -0
- package/src/operations/index.ts +9 -0
- package/src/testing/test-functions.ts +8 -5
- package/src/translations.ts +35 -36
- package/src/types/capabilities.ts +20 -6
- package/src/types/events.ts +2 -2
- package/src/types/schema.ts +3 -24
- package/dist/lib/browser/AutomationPanel-FAS6ADCW.mjs +0 -11
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs +0 -56
- package/dist/lib/browser/AutomationSettings-XN2OIYWL.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs +0 -129
- package/dist/lib/browser/FunctionsContainer-6QLC7JP4.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-ZX4J75UM.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs +0 -84
- package/dist/lib/browser/app-graph-builder-LAQMEBMH.mjs.map +0 -7
- package/dist/lib/browser/chunk-54PANILA.mjs +0 -14
- package/dist/lib/browser/chunk-54PANILA.mjs.map +0 -7
- package/dist/lib/browser/chunk-BFUIVUQH.mjs +0 -102
- package/dist/lib/browser/chunk-BFUIVUQH.mjs.map +0 -7
- package/dist/lib/browser/chunk-BKFQBKYO.mjs +0 -8
- package/dist/lib/browser/chunk-BKFQBKYO.mjs.map +0 -7
- package/dist/lib/browser/chunk-JOXPQ27I.mjs.map +0 -7
- package/dist/lib/browser/chunk-PZNBEKO5.mjs +0 -17
- package/dist/lib/browser/chunk-PZNBEKO5.mjs.map +0 -7
- package/dist/lib/browser/chunk-QW3EM35H.mjs +0 -248
- package/dist/lib/browser/chunk-QW3EM35H.mjs.map +0 -7
- package/dist/lib/browser/chunk-RAF2FJST.mjs +0 -86
- package/dist/lib/browser/chunk-RAF2FJST.mjs.map +0 -7
- package/dist/lib/browser/chunk-YWLEY2FD.mjs +0 -200
- package/dist/lib/browser/chunk-YWLEY2FD.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs +0 -114
- package/dist/lib/browser/compute-runtime-WTWLQ67J.mjs.map +0 -7
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs +0 -82
- package/dist/lib/browser/operation-resolver-Q3MWOR7K.mjs.map +0 -7
- package/dist/lib/browser/react-surface-EV3AC62F.mjs +0 -65
- package/dist/lib/browser/react-surface-EV3AC62F.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs +0 -12
- package/dist/lib/node-esm/AutomationPanel-B7NAGDFA.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs +0 -57
- package/dist/lib/node-esm/AutomationSettings-M5PMZJ6P.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs +0 -130
- package/dist/lib/node-esm/FunctionsContainer-J4O2ULWR.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs +0 -11
- package/dist/lib/node-esm/FunctionsPanel-SS6GIVNU.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs +0 -85
- package/dist/lib/node-esm/app-graph-builder-4UCMXHYY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs +0 -201
- package/dist/lib/node-esm/chunk-2CKVH7JC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs +0 -19
- package/dist/lib/node-esm/chunk-5FXNN3MV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs +0 -16
- package/dist/lib/node-esm/chunk-7QRUPEHH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs +0 -87
- package/dist/lib/node-esm/chunk-HQLVREIX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K7GCM342.mjs +0 -10
- package/dist/lib/node-esm/chunk-K7GCM342.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs +0 -103
- package/dist/lib/node-esm/chunk-KWKWOGS5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs +0 -249
- package/dist/lib/node-esm/chunk-LJAXQ6CX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RX52VKI2.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs +0 -115
- package/dist/lib/node-esm/compute-runtime-ZHROOBLY.mjs.map +0 -7
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs +0 -83
- package/dist/lib/node-esm/operation-resolver-R5GA4YNO.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs +0 -66
- package/dist/lib/node-esm/react-surface-S6VZJCEZ.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts +0 -6
- package/dist/types/src/capabilities/app-graph-builder/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts +0 -3
- package/dist/types/src/capabilities/app-graph-builder/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts +0 -6
- package/dist/types/src/capabilities/compute-runtime/compute-runtime.d.ts.map +0 -1
- package/dist/types/src/capabilities/compute-runtime/index.d.ts +0 -3
- package/dist/types/src/capabilities/compute-runtime/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/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.map +0 -1
- package/src/capabilities/app-graph-builder/app-graph-builder.ts +0 -71
- package/src/capabilities/app-graph-builder/index.ts +0 -7
- package/src/capabilities/compute-runtime/compute-runtime.ts +0 -133
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -79
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -60
- package/src/components/AutomationSettings.tsx +0 -30
- package/src/components/FunctionsContainer.tsx +0 -36
- /package/dist/lib/browser/{AutomationPanel-FAS6ADCW.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
- /package/dist/lib/{browser/FunctionsPanel-ZX4J75UM.mjs.map → node-esm/chunk-HSLMI22Q.mjs.map} +0 -0
- /package/dist/types/src/{components → containers/TriggerSettings}/TriggerSettings.d.ts +0 -0
- /package/src/capabilities/{compute-runtime/index.ts → node.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-automation",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.9be5663bfe",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -12,6 +12,21 @@
|
|
|
12
12
|
"author": "DXOS.org",
|
|
13
13
|
"sideEffects": true,
|
|
14
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./src/capabilities/index.ts",
|
|
19
|
+
"browser": "./src/capabilities/index.ts",
|
|
20
|
+
"node": "./src/capabilities/node.ts"
|
|
21
|
+
},
|
|
22
|
+
"#components": "./src/components/index.ts",
|
|
23
|
+
"#containers": "./src/containers/index.ts",
|
|
24
|
+
"#hooks": "./src/hooks/index.ts",
|
|
25
|
+
"#meta": "./src/meta.ts",
|
|
26
|
+
"#operations": "./src/operations/index.ts",
|
|
27
|
+
"#testing": "./src/testing/index.ts",
|
|
28
|
+
"#types": "./src/types/index.ts"
|
|
29
|
+
},
|
|
15
30
|
"exports": {
|
|
16
31
|
".": {
|
|
17
32
|
"source": "./src/index.ts",
|
|
@@ -30,6 +45,12 @@
|
|
|
30
45
|
"browser": "./dist/lib/browser/hooks/index.mjs",
|
|
31
46
|
"node": "./dist/lib/node-esm/hooks/index.mjs"
|
|
32
47
|
},
|
|
48
|
+
"./operations": {
|
|
49
|
+
"source": "./src/operations/index.ts",
|
|
50
|
+
"types": "./dist/types/src/operations/index.d.ts",
|
|
51
|
+
"browser": "./dist/lib/browser/operations/index.mjs",
|
|
52
|
+
"node": "./dist/lib/node-esm/operations/index.mjs"
|
|
53
|
+
},
|
|
33
54
|
"./types": {
|
|
34
55
|
"source": "./src/types/index.ts",
|
|
35
56
|
"types": "./dist/types/src/types/index.d.ts",
|
|
@@ -54,62 +75,68 @@
|
|
|
54
75
|
"src"
|
|
55
76
|
],
|
|
56
77
|
"dependencies": {
|
|
57
|
-
"@effect/
|
|
58
|
-
"@effect/
|
|
59
|
-
"@effect/
|
|
78
|
+
"@effect-atom/atom": "^0.5.1",
|
|
79
|
+
"@effect/ai": "0.33.2",
|
|
80
|
+
"@effect/cli": "0.73.2",
|
|
81
|
+
"@effect/platform-browser": "0.74.0",
|
|
60
82
|
"@effect/printer-ansi": "0.47.0",
|
|
61
|
-
"@dxos/ai": "0.8.4-main.
|
|
62
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/client": "0.8.4-main.
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/
|
|
79
|
-
"@dxos/
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/react-
|
|
86
|
-
"@dxos/
|
|
87
|
-
"@dxos/react-ui-
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/
|
|
83
|
+
"@dxos/ai": "0.8.4-main.9be5663bfe",
|
|
84
|
+
"@dxos/app-framework": "0.8.4-main.9be5663bfe",
|
|
85
|
+
"@dxos/app-toolkit": "0.8.4-main.9be5663bfe",
|
|
86
|
+
"@dxos/async": "0.8.4-main.9be5663bfe",
|
|
87
|
+
"@dxos/cli-util": "0.8.4-main.9be5663bfe",
|
|
88
|
+
"@dxos/blueprints": "0.8.4-main.9be5663bfe",
|
|
89
|
+
"@dxos/client": "0.8.4-main.9be5663bfe",
|
|
90
|
+
"@dxos/assistant": "0.8.4-main.9be5663bfe",
|
|
91
|
+
"@dxos/conductor": "0.8.4-main.9be5663bfe",
|
|
92
|
+
"@dxos/context": "0.8.4-main.9be5663bfe",
|
|
93
|
+
"@dxos/echo": "0.8.4-main.9be5663bfe",
|
|
94
|
+
"@dxos/echo-atom": "0.8.4-main.9be5663bfe",
|
|
95
|
+
"@dxos/echo-db": "0.8.4-main.9be5663bfe",
|
|
96
|
+
"@dxos/effect": "0.8.4-main.9be5663bfe",
|
|
97
|
+
"@dxos/functions-runtime": "0.8.4-main.9be5663bfe",
|
|
98
|
+
"@dxos/functions": "0.8.4-main.9be5663bfe",
|
|
99
|
+
"@dxos/log": "0.8.4-main.9be5663bfe",
|
|
100
|
+
"@dxos/invariant": "0.8.4-main.9be5663bfe",
|
|
101
|
+
"@dxos/operation": "0.8.4-main.9be5663bfe",
|
|
102
|
+
"@dxos/plugin-deck": "0.8.4-main.9be5663bfe",
|
|
103
|
+
"@dxos/plugin-client": "0.8.4-main.9be5663bfe",
|
|
104
|
+
"@dxos/random": "0.8.4-main.9be5663bfe",
|
|
105
|
+
"@dxos/plugin-graph": "0.8.4-main.9be5663bfe",
|
|
106
|
+
"@dxos/plugin-space": "0.8.4-main.9be5663bfe",
|
|
107
|
+
"@dxos/react-client": "0.8.4-main.9be5663bfe",
|
|
108
|
+
"@dxos/keys": "0.8.4-main.9be5663bfe",
|
|
109
|
+
"@dxos/react-ui-components": "0.8.4-main.9be5663bfe",
|
|
110
|
+
"@dxos/react-ui-editor": "0.8.4-main.9be5663bfe",
|
|
111
|
+
"@dxos/react-ui-list": "0.8.4-main.9be5663bfe",
|
|
112
|
+
"@dxos/react-ui-attention": "0.8.4-main.9be5663bfe",
|
|
113
|
+
"@dxos/react-ui-form": "0.8.4-main.9be5663bfe",
|
|
114
|
+
"@dxos/react-ui-stack": "0.8.4-main.9be5663bfe",
|
|
115
|
+
"@dxos/schema": "0.8.4-main.9be5663bfe",
|
|
116
|
+
"@dxos/types": "0.8.4-main.9be5663bfe",
|
|
117
|
+
"@dxos/util": "0.8.4-main.9be5663bfe"
|
|
91
118
|
},
|
|
92
119
|
"devDependencies": {
|
|
93
|
-
"@effect-atom/atom-react": "^0.
|
|
94
|
-
"@effect/platform": "0.
|
|
120
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
121
|
+
"@effect/platform": "0.94.4",
|
|
95
122
|
"@types/react": "~19.2.7",
|
|
96
123
|
"@types/react-dom": "~19.2.3",
|
|
97
|
-
"effect": "3.
|
|
124
|
+
"effect": "3.20.0",
|
|
98
125
|
"react": "~19.2.3",
|
|
99
126
|
"react-dom": "~19.2.3",
|
|
100
|
-
"vite": "7.1.
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
127
|
+
"vite": "^7.1.11",
|
|
128
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe",
|
|
129
|
+
"@dxos/storybook-utils": "0.8.4-main.9be5663bfe",
|
|
130
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe"
|
|
104
131
|
},
|
|
105
132
|
"peerDependencies": {
|
|
106
|
-
"@effect-atom/atom-react": "^0.
|
|
107
|
-
"@effect/platform": "0.
|
|
108
|
-
"effect": "3.
|
|
133
|
+
"@effect-atom/atom-react": "^0.5.0",
|
|
134
|
+
"@effect/platform": "0.94.4",
|
|
135
|
+
"effect": "3.20.0",
|
|
109
136
|
"react": "~19.2.3",
|
|
110
137
|
"react-dom": "~19.2.3",
|
|
111
|
-
"@dxos/ui-theme": "0.8.4-main.
|
|
112
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
138
|
+
"@dxos/ui-theme": "0.8.4-main.9be5663bfe",
|
|
139
|
+
"@dxos/react-ui": "0.8.4-main.9be5663bfe"
|
|
113
140
|
},
|
|
114
141
|
"publishConfig": {
|
|
115
142
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -2,21 +2,24 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
7
|
+
import { Trigger } from '@dxos/functions';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
7
9
|
import { ClientEvents } from '@dxos/plugin-client/types';
|
|
8
10
|
|
|
9
|
-
import { AppGraphBuilder, ComputeRuntime,
|
|
10
|
-
import { meta } from '
|
|
11
|
+
import { AppGraphBuilder, ComputeRuntime, OperationHandler, ReactSurface } from '#capabilities';
|
|
12
|
+
import { meta } from '#meta';
|
|
13
|
+
import { AutomationEvents } from '#types';
|
|
14
|
+
|
|
11
15
|
import { translations } from './translations';
|
|
12
|
-
import { AutomationEvents } from './types';
|
|
13
16
|
|
|
14
17
|
export const AutomationPlugin = Plugin.define(meta).pipe(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
AppPlugin.addAppGraphModule({ activate: AppGraphBuilder }),
|
|
19
|
+
AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),
|
|
20
|
+
AppPlugin.addSchemaModule({ schema: [Operation.PersistentOperation, Trigger.Trigger] }),
|
|
21
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
22
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
20
23
|
Plugin.addModule({
|
|
21
24
|
activatesOn: ClientEvents.ClientReady,
|
|
22
25
|
activatesAfter: [AutomationEvents.ComputeRuntimeReady],
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { AppCapabilities, AppNode } from '@dxos/app-toolkit';
|
|
9
|
+
import { Script } from '@dxos/functions';
|
|
10
|
+
import { GraphBuilder, NodeMatcher } from '@dxos/plugin-graph';
|
|
11
|
+
import { meta as spaceMeta } from '@dxos/plugin-space/meta';
|
|
12
|
+
import { linkedSegment } from '@dxos/react-ui-attention';
|
|
13
|
+
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(
|
|
17
|
+
Effect.fnUntraced(function* () {
|
|
18
|
+
const extensions = yield* Effect.all([
|
|
19
|
+
GraphBuilder.createExtension({
|
|
20
|
+
id: 'space-settings-automation',
|
|
21
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
22
|
+
connector: (node) =>
|
|
23
|
+
Effect.succeed([
|
|
24
|
+
AppNode.makeSettingsPanel({
|
|
25
|
+
id: 'automations',
|
|
26
|
+
type: `${meta.id}.space-settings-automation`,
|
|
27
|
+
label: ['automation-panel.label', { ns: meta.id }],
|
|
28
|
+
icon: 'ph--lightning--regular',
|
|
29
|
+
}),
|
|
30
|
+
]),
|
|
31
|
+
}),
|
|
32
|
+
GraphBuilder.createExtension({
|
|
33
|
+
id: 'space-settings-functions',
|
|
34
|
+
match: NodeMatcher.whenNodeType(`${spaceMeta.id}.settings`),
|
|
35
|
+
connector: (node) =>
|
|
36
|
+
Effect.succeed([
|
|
37
|
+
AppNode.makeSettingsPanel({
|
|
38
|
+
id: 'functions',
|
|
39
|
+
type: `${meta.id}.space-settings-functions`,
|
|
40
|
+
label: ['functions-panel.label', { ns: meta.id }],
|
|
41
|
+
icon: 'ph--function--regular',
|
|
42
|
+
}),
|
|
43
|
+
]),
|
|
44
|
+
}),
|
|
45
|
+
GraphBuilder.createTypeExtension({
|
|
46
|
+
id: 'script-companion',
|
|
47
|
+
type: Script.Script,
|
|
48
|
+
connector: (script) =>
|
|
49
|
+
Effect.succeed([
|
|
50
|
+
AppNode.makeCompanion({
|
|
51
|
+
id: linkedSegment('automation'),
|
|
52
|
+
label: ['script-automation.label', { ns: meta.id }],
|
|
53
|
+
icon: 'ph--lightning--regular',
|
|
54
|
+
data: 'automation',
|
|
55
|
+
}),
|
|
56
|
+
]),
|
|
57
|
+
}),
|
|
58
|
+
]);
|
|
59
|
+
|
|
60
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
61
|
+
}),
|
|
62
|
+
);
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Registry } from '@effect-atom/atom';
|
|
6
|
+
import * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';
|
|
7
|
+
import * as KeyValueStore from '@effect/platform/KeyValueStore';
|
|
8
|
+
import * as Context from 'effect/Context';
|
|
9
|
+
import * as Effect from 'effect/Effect';
|
|
10
|
+
import * as Layer from 'effect/Layer';
|
|
11
|
+
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
12
|
+
|
|
13
|
+
import { AiService, GenericToolkit } from '@dxos/ai';
|
|
14
|
+
import { Capabilities, Capability, type CapabilityManager } from '@dxos/app-framework';
|
|
15
|
+
import { AppCapabilities } from '@dxos/app-toolkit';
|
|
16
|
+
import {
|
|
17
|
+
AgentService,
|
|
18
|
+
AiContextBinder,
|
|
19
|
+
AiContextService,
|
|
20
|
+
AiConversation,
|
|
21
|
+
AiConversationService,
|
|
22
|
+
ToolExecutionServices,
|
|
23
|
+
} from '@dxos/assistant';
|
|
24
|
+
import { Blueprint } from '@dxos/blueprints';
|
|
25
|
+
import { ClientService } from '@dxos/client';
|
|
26
|
+
import { SpaceProperties } from '@dxos/client/echo';
|
|
27
|
+
import { Resource } from '@dxos/context';
|
|
28
|
+
import { Database, DXN, Feed, Obj, Query, Ref } from '@dxos/echo';
|
|
29
|
+
import { createFeedServiceLayer } from '@dxos/echo-db';
|
|
30
|
+
import { acquireReleaseResource } from '@dxos/effect';
|
|
31
|
+
import {
|
|
32
|
+
CredentialsService,
|
|
33
|
+
feedServiceFromQueueServiceLayer,
|
|
34
|
+
QueueService,
|
|
35
|
+
ServiceNotAvailableError,
|
|
36
|
+
} from '@dxos/functions';
|
|
37
|
+
import {
|
|
38
|
+
FeedTraceSink,
|
|
39
|
+
FunctionImplementationResolver,
|
|
40
|
+
FunctionInvocationServiceLayerWithLocalLoopbackExecutor,
|
|
41
|
+
ProcessManager,
|
|
42
|
+
RemoteFunctionExecutionService,
|
|
43
|
+
ServiceResolver,
|
|
44
|
+
TracingServiceExt,
|
|
45
|
+
TriggerDispatcher,
|
|
46
|
+
TriggerStateStore,
|
|
47
|
+
} from '@dxos/functions-runtime';
|
|
48
|
+
import { invariant } from '@dxos/invariant';
|
|
49
|
+
import { type SpaceId } from '@dxos/keys';
|
|
50
|
+
import { OperationHandlerSet, OperationRegistry } from '@dxos/operation';
|
|
51
|
+
import { ClientCapabilities } from '@dxos/plugin-client/types';
|
|
52
|
+
|
|
53
|
+
import { AutomationCapabilities } from '#types';
|
|
54
|
+
|
|
55
|
+
export default Capability.makeModule(
|
|
56
|
+
Effect.fnUntraced(function* () {
|
|
57
|
+
const capabilities = yield* Capability.Service;
|
|
58
|
+
const provider = yield* Effect.tryPromise(() => new ComputeRuntimeProviderImpl(capabilities).open());
|
|
59
|
+
return Capability.contributes(AutomationCapabilities.ComputeRuntime, provider, () =>
|
|
60
|
+
Effect.tryPromise(() => provider.close()),
|
|
61
|
+
);
|
|
62
|
+
}),
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Adapts plugin capabilities to runtime layers.
|
|
67
|
+
*/
|
|
68
|
+
class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {
|
|
69
|
+
readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();
|
|
70
|
+
readonly #capabilities: CapabilityManager.CapabilityManager;
|
|
71
|
+
|
|
72
|
+
constructor(capabilities: CapabilityManager.CapabilityManager) {
|
|
73
|
+
super();
|
|
74
|
+
this.#capabilities = capabilities;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
protected override async _open() {}
|
|
78
|
+
|
|
79
|
+
protected override async _close() {
|
|
80
|
+
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
81
|
+
this.#runtimes.clear();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
getRuntime(spaceId: SpaceId): AutomationCapabilities.ComputeRuntime {
|
|
85
|
+
if (this.#runtimes.has(spaceId)) {
|
|
86
|
+
return this.#runtimes.get(spaceId)!;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const layer = Layer.unwrapEffect(
|
|
90
|
+
Effect.gen(this, function* () {
|
|
91
|
+
const client = this.#capabilities.get(ClientCapabilities.Client);
|
|
92
|
+
const aiServiceLayer =
|
|
93
|
+
this.#capabilities.get(AppCapabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
94
|
+
const registry = this.#capabilities.get(Capabilities.AtomRegistry);
|
|
95
|
+
|
|
96
|
+
// TODO(dmaretskyi): Make these reactive.
|
|
97
|
+
const operationHandlers = OperationHandlerSet.merge(
|
|
98
|
+
...this.#capabilities.getAll(Capabilities.OperationHandler),
|
|
99
|
+
);
|
|
100
|
+
|
|
101
|
+
const genericToolkitProvider = Layer.succeed(GenericToolkit.GenericToolkitProvider, {
|
|
102
|
+
getToolkit: () => {
|
|
103
|
+
const toolkits = this.#capabilities.getAll(AppCapabilities.Toolkit);
|
|
104
|
+
return GenericToolkit.merge(...toolkits);
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const blueprints = this.#capabilities
|
|
109
|
+
.getAll(AppCapabilities.BlueprintDefinition)
|
|
110
|
+
.flatMap((blueprint) => blueprint.make());
|
|
111
|
+
|
|
112
|
+
const space = client.spaces.get(spaceId);
|
|
113
|
+
invariant(space, `Invalid space: ${spaceId}`);
|
|
114
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
115
|
+
|
|
116
|
+
return Layer.mergeAll(
|
|
117
|
+
TriggerDispatcher.layer({ timeControl: 'natural' }),
|
|
118
|
+
Layer.succeed(Blueprint.RegistryService, new Blueprint.Registry(blueprints)),
|
|
119
|
+
).pipe(
|
|
120
|
+
Layer.provideMerge(AgentService.layer()),
|
|
121
|
+
Layer.provideMerge(ProcessManager.ProcessOperationInvoker.layer),
|
|
122
|
+
Layer.provideMerge(ProcessManager.layer()),
|
|
123
|
+
// TODO(dmaretskyi): Duped in assistant testing layer.
|
|
124
|
+
Layer.provideMerge(
|
|
125
|
+
// TODO(dmaretskyi): Refactor to be able to merge resovler layers, also consider service mesh achitecture.
|
|
126
|
+
Layer.effect(
|
|
127
|
+
ServiceResolver.ServiceResolver,
|
|
128
|
+
Effect.gen(function* () {
|
|
129
|
+
const services = yield* Effect.context<Database.Service | Feed.FeedService>().pipe(
|
|
130
|
+
Effect.map(Context.pick(Database.Service, Feed.FeedService)),
|
|
131
|
+
Effect.map(Layer.succeedContext),
|
|
132
|
+
);
|
|
133
|
+
// AiContextBinder.
|
|
134
|
+
return ServiceResolver.compose(
|
|
135
|
+
ServiceResolver.succeed(AiContextService, (context) =>
|
|
136
|
+
Effect.gen(function* () {
|
|
137
|
+
if (!context.conversation) {
|
|
138
|
+
return yield* Effect.fail(new ServiceNotAvailableError(AiContextService.key));
|
|
139
|
+
}
|
|
140
|
+
const feed = yield* Database.resolve(DXN.parse(context.conversation), Feed.Feed).pipe(
|
|
141
|
+
Effect.orDie,
|
|
142
|
+
);
|
|
143
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
144
|
+
const binder = yield* acquireReleaseResource(
|
|
145
|
+
() =>
|
|
146
|
+
new AiContextBinder({
|
|
147
|
+
feed,
|
|
148
|
+
runtime,
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
151
|
+
return { binder };
|
|
152
|
+
}).pipe(Effect.provide(services)),
|
|
153
|
+
),
|
|
154
|
+
// AiConversationService.
|
|
155
|
+
ServiceResolver.succeed(AiConversationService, (context) =>
|
|
156
|
+
Effect.gen(function* () {
|
|
157
|
+
if (!context.conversation) {
|
|
158
|
+
return yield* Effect.fail(new ServiceNotAvailableError(AiConversationService.key));
|
|
159
|
+
}
|
|
160
|
+
const feed = yield* Database.resolve(DXN.parse(context.conversation), Feed.Feed).pipe(
|
|
161
|
+
Effect.orDie,
|
|
162
|
+
);
|
|
163
|
+
const runtime = yield* Effect.runtime<Feed.FeedService>();
|
|
164
|
+
const conversation = yield* acquireReleaseResource(
|
|
165
|
+
() =>
|
|
166
|
+
new AiConversation({
|
|
167
|
+
feed,
|
|
168
|
+
runtime,
|
|
169
|
+
}),
|
|
170
|
+
);
|
|
171
|
+
return conversation;
|
|
172
|
+
}).pipe(Effect.provide(services)),
|
|
173
|
+
),
|
|
174
|
+
yield* ServiceResolver.fromRequirements(
|
|
175
|
+
Database.Service,
|
|
176
|
+
GenericToolkit.GenericToolkitProvider,
|
|
177
|
+
Feed.FeedService,
|
|
178
|
+
QueueService,
|
|
179
|
+
AiService.AiService,
|
|
180
|
+
OperationRegistry.Service,
|
|
181
|
+
Blueprint.RegistryService,
|
|
182
|
+
CredentialsService,
|
|
183
|
+
),
|
|
184
|
+
);
|
|
185
|
+
}),
|
|
186
|
+
),
|
|
187
|
+
),
|
|
188
|
+
Layer.provideMerge(Layer.succeed(Blueprint.RegistryService, new Blueprint.Registry(blueprints))),
|
|
189
|
+
Layer.provideMerge(OperationRegistry.layer),
|
|
190
|
+
Layer.provideMerge(Layer.succeed(Capability.Service, this.#capabilities)),
|
|
191
|
+
Layer.provideMerge(Layer.succeed(Registry.AtomRegistry, registry)),
|
|
192
|
+
Layer.provideMerge(
|
|
193
|
+
Layer.mergeAll(
|
|
194
|
+
TracingServiceLive,
|
|
195
|
+
FeedTraceSink.layerLive,
|
|
196
|
+
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
197
|
+
ToolExecutionServices,
|
|
198
|
+
KeyValueStore.layerMemory,
|
|
199
|
+
),
|
|
200
|
+
),
|
|
201
|
+
Layer.provideMerge(feedServiceFromQueueServiceLayer),
|
|
202
|
+
Layer.provideMerge(OperationHandlerSet.provide(operationHandlers)),
|
|
203
|
+
Layer.provideMerge(
|
|
204
|
+
FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(
|
|
205
|
+
Layer.provideMerge(genericToolkitProvider),
|
|
206
|
+
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: operationHandlers })),
|
|
207
|
+
Layer.provideMerge(
|
|
208
|
+
RemoteFunctionExecutionService.fromClient(
|
|
209
|
+
client,
|
|
210
|
+
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
211
|
+
),
|
|
212
|
+
),
|
|
213
|
+
Layer.provideMerge(aiServiceLayer),
|
|
214
|
+
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
215
|
+
Layer.provideMerge(ClientService.fromClient(client)),
|
|
216
|
+
Layer.provideMerge(space ? Database.layer(space.db) : Database.notAvailable),
|
|
217
|
+
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
218
|
+
Layer.provideMerge(space ? createFeedServiceLayer(space.queues) : Feed.notAvailable),
|
|
219
|
+
),
|
|
220
|
+
),
|
|
221
|
+
);
|
|
222
|
+
}),
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
const runtime = ManagedRuntime.make(layer);
|
|
226
|
+
this.#runtimes.set(spaceId, runtime);
|
|
227
|
+
return runtime;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
const TracingServiceLive = Layer.unwrapEffect(
|
|
232
|
+
Effect.gen(function* () {
|
|
233
|
+
const objects = yield* Database.runQuery(Query.type(SpaceProperties));
|
|
234
|
+
const [properties] = objects;
|
|
235
|
+
invariant(properties);
|
|
236
|
+
// TODO(burdon): Check ref target has loaded?
|
|
237
|
+
if (!properties.invocationTraceQueue || !properties.invocationTraceQueue.target) {
|
|
238
|
+
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
239
|
+
Obj.change(properties, (properties) => {
|
|
240
|
+
properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const queue = properties.invocationTraceQueue!.target;
|
|
245
|
+
invariant(queue);
|
|
246
|
+
return TracingServiceExt.layerInvocationsQueue({ invocationTraceQueue: queue });
|
|
247
|
+
}),
|
|
248
|
+
);
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
|
+
import { OperationHandlerSet } from '@dxos/operation';
|
|
7
|
+
|
|
8
|
+
export const AppGraphBuilder = Capability.lazy('AppGraphBuilder', () => import('./app-graph-builder'));
|
|
9
|
+
export const ComputeRuntime = Capability.lazy('ComputeRuntime', () => import('./compute-runtime'));
|
|
10
|
+
export const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(
|
|
11
|
+
'OperationHandler',
|
|
12
|
+
() => import('./operation-handler'),
|
|
13
|
+
);
|
|
14
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
8
|
+
import type { OperationHandlerSet } from '@dxos/operation';
|
|
9
|
+
|
|
10
|
+
import { AutomationOperationHandlerSet } from '#operations';
|
|
11
|
+
|
|
12
|
+
export default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(
|
|
13
|
+
Effect.fnUntraced(function* () {
|
|
14
|
+
return Capability.contributes(Capabilities.OperationHandler, AutomationOperationHandlerSet);
|
|
15
|
+
}),
|
|
16
|
+
);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface, useActiveSpace } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
12
|
+
|
|
13
|
+
import { AutomationSettings, FunctionsContainer } from '#containers';
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
export default Capability.makeModule(() =>
|
|
17
|
+
Effect.succeed(
|
|
18
|
+
Capability.contributes(Capabilities.ReactSurface, [
|
|
19
|
+
Surface.create({
|
|
20
|
+
id: 'space-settings-functions',
|
|
21
|
+
role: 'article',
|
|
22
|
+
filter: AppSurface.literalSection(`${meta.id}.space-settings-functions`),
|
|
23
|
+
component: () => {
|
|
24
|
+
const space = useActiveSpace();
|
|
25
|
+
if (!space) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return <FunctionsContainer space={space} />;
|
|
30
|
+
},
|
|
31
|
+
}),
|
|
32
|
+
Surface.create({
|
|
33
|
+
id: 'space-settings-automation',
|
|
34
|
+
role: 'article',
|
|
35
|
+
filter: AppSurface.literalSection(`${meta.id}.space-settings-automation`),
|
|
36
|
+
component: () => {
|
|
37
|
+
const space = useActiveSpace();
|
|
38
|
+
if (!space) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return <AutomationSettings space={space} />;
|
|
43
|
+
},
|
|
44
|
+
}),
|
|
45
|
+
Surface.create({
|
|
46
|
+
id: 'companion.automation',
|
|
47
|
+
role: 'article',
|
|
48
|
+
filter: AppSurface.and(AppSurface.literalArticle('automation'), AppSurface.companionArticle()),
|
|
49
|
+
component: ({ data }) => {
|
|
50
|
+
const space = getSpace(data.companionTo);
|
|
51
|
+
if (!space) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return <AutomationSettings space={space} object={data.companionTo} />;
|
|
55
|
+
},
|
|
56
|
+
}),
|
|
57
|
+
]),
|
|
58
|
+
),
|
|
59
|
+
);
|
|
@@ -13,8 +13,9 @@ import * as Option from 'effect/Option';
|
|
|
13
13
|
import { CommandConfig } from '@dxos/cli-util';
|
|
14
14
|
import { flushAndSync, print, spaceLayer, withTypes } from '@dxos/cli-util';
|
|
15
15
|
import { Common } from '@dxos/cli-util';
|
|
16
|
-
import { Database, Filter,
|
|
17
|
-
import {
|
|
16
|
+
import { Database, Filter, JsonSchema, Ref } from '@dxos/echo';
|
|
17
|
+
import { Trigger } from '@dxos/functions';
|
|
18
|
+
import { Operation } from '@dxos/operation';
|
|
18
19
|
|
|
19
20
|
import { Enabled, Input, Queue } from '../options';
|
|
20
21
|
import { printTrigger, promptForSchemaInput, selectFunction, selectQueue } from '../util';
|
|
@@ -36,7 +37,7 @@ export const queue = Command.make(
|
|
|
36
37
|
onNone: () => selectFunction(),
|
|
37
38
|
onSome: (id) => Effect.succeed(id),
|
|
38
39
|
});
|
|
39
|
-
const functions = yield* Database.
|
|
40
|
+
const functions = yield* Database.runQuery(Filter.type(Operation.PersistentOperation));
|
|
40
41
|
const fn = functions.find((fn) => fn.id === functionId);
|
|
41
42
|
if (!fn) {
|
|
42
43
|
return yield* Effect.fail(new Error(`Function not found: ${functionId}`));
|
|
@@ -48,7 +49,7 @@ export const queue = Command.make(
|
|
|
48
49
|
});
|
|
49
50
|
|
|
50
51
|
const input = yield* Option.match(options.input, {
|
|
51
|
-
onNone: () => promptForSchemaInput(fn.inputSchema ?
|
|
52
|
+
onNone: () => promptForSchemaInput(fn.inputSchema ? JsonSchema.toEffectSchema(fn.inputSchema) : undefined),
|
|
52
53
|
onSome: (value) => Effect.succeed(Object.fromEntries(HashMap.toEntries(value))),
|
|
53
54
|
});
|
|
54
55
|
|
|
@@ -72,7 +73,7 @@ export const queue = Command.make(
|
|
|
72
73
|
input,
|
|
73
74
|
});
|
|
74
75
|
|
|
75
|
-
yield* Database.
|
|
76
|
+
yield* Database.add(trigger);
|
|
76
77
|
|
|
77
78
|
if (json) {
|
|
78
79
|
yield* Console.log(JSON.stringify(trigger, null, 2));
|
|
@@ -85,5 +86,5 @@ export const queue = Command.make(
|
|
|
85
86
|
).pipe(
|
|
86
87
|
Command.withDescription('Create a queue trigger.'),
|
|
87
88
|
Command.provide(({ spaceId }) => spaceLayer(spaceId, true)),
|
|
88
|
-
Command.provideEffectDiscard(() => withTypes(
|
|
89
|
+
Command.provideEffectDiscard(() => withTypes(Operation.PersistentOperation, Trigger.Trigger)),
|
|
89
90
|
);
|