@dxos/plugin-automation 0.8.4-main.b97322e → 0.8.4-main.c4373fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/AutomationPanel-PNBH5L5C.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs +69 -0
- package/dist/lib/browser/AutomationSettings-3LABN6ER.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsContainer-IOB333TX.mjs → FunctionsContainer-HHBMPUOD.mjs} +9 -12
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-NRIKAPQV.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-ZTAUTFI4.mjs → app-graph-builder-DV5HMFX4.mjs} +11 -10
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +7 -0
- package/dist/lib/browser/chunk-5ARH77PV.mjs +15 -0
- package/dist/lib/browser/chunk-5ARH77PV.mjs.map +7 -0
- package/dist/lib/browser/chunk-AY67OUDA.mjs +14 -0
- package/dist/lib/browser/chunk-AY67OUDA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LYJVTIVD.mjs → chunk-DLLE4FKP.mjs} +6 -6
- package/dist/lib/browser/chunk-DLLE4FKP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERTIGJYE.mjs → chunk-LC3QQU47.mjs} +52 -28
- package/dist/lib/browser/chunk-LC3QQU47.mjs.map +7 -0
- package/dist/lib/browser/chunk-MVPRI3DB.mjs +53 -0
- package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSJZXTS2.mjs → chunk-NIJWEQRD.mjs} +84 -31
- package/dist/lib/browser/chunk-NIJWEQRD.mjs.map +7 -0
- package/dist/lib/browser/chunk-QT3YWUOT.mjs +14 -0
- package/dist/lib/browser/chunk-QT3YWUOT.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-VGBZKM3O.mjs} +3 -3
- package/dist/lib/browser/chunk-VGBZKM3O.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GW5U2DGT.mjs → chunk-WWURMV25.mjs} +2 -4
- package/dist/lib/browser/chunk-WWURMV25.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +160 -0
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +12 -0
- package/dist/lib/browser/index.mjs +36 -16
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-U3ZAQEFW.mjs → intent-resolver-D2OHKQRR.mjs} +11 -10
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-4DFSM7OX.mjs → react-surface-JXFO46V4.mjs} +18 -19
- package/dist/lib/browser/react-surface-JXFO46V4.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-GHK5UG4K.mjs} +4 -4
- package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs +70 -0
- package/dist/lib/node-esm/AutomationSettings-XENNIIZM.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsContainer-DJWB6WFH.mjs → FunctionsContainer-ZKVOBUHV.mjs} +9 -12
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-SAMRTELO.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-SAMRTELO.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3FP63ZSG.mjs → app-graph-builder-TR2WXPX2.mjs} +11 -10
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HIMYPGHF.mjs → chunk-3EWMZAU6.mjs} +52 -28
- package/dist/lib/node-esm/chunk-3EWMZAU6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NK5N3QKD.mjs → chunk-5MQJPJR2.mjs} +2 -4
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-CJUI6AKX.mjs} +3 -3
- package/dist/lib/node-esm/chunk-CJUI6AKX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AZH66CED.mjs → chunk-EX74SIDO.mjs} +84 -31
- package/dist/lib/node-esm/chunk-EX74SIDO.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-LWASMQIF.mjs +16 -0
- package/dist/lib/node-esm/chunk-LWASMQIF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs +54 -0
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs +16 -0
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs +16 -0
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGPUV5VS.mjs → chunk-YQXW3JXD.mjs} +6 -6
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +161 -0
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +13 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +36 -16
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-3QWXEBPX.mjs → intent-resolver-2LGBVXT5.mjs} +11 -10
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-3PNW7NDW.mjs → react-surface-YDJ43B3N.mjs} +18 -19
- package/dist/lib/node-esm/react-surface-YDJ43B3N.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/AutomationPlugin.d.ts +1 -1
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +19 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts +5 -0
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +6 -5
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +45 -4
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- package/dist/types/src/components/AutomationSettings.d.ts +5 -0
- package/dist/types/src/components/AutomationSettings.d.ts.map +1 -0
- package/dist/types/src/components/FunctionsContainer.d.ts.map +1 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +1 -1
- 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 +4 -3
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +47 -4
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/components/TriggerSettings.d.ts +6 -0
- package/dist/types/src/components/TriggerSettings.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -2
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/events.d.ts +4 -0
- package/dist/types/src/events.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +3 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +8 -0
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +11 -0
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +2 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +1 -1
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +59 -37
- package/src/AutomationPlugin.tsx +37 -31
- package/src/capabilities/app-graph-builder.ts +10 -9
- package/src/capabilities/capabilities.ts +48 -0
- package/src/capabilities/compute-runtime.ts +138 -0
- package/src/capabilities/index.ts +3 -0
- package/src/capabilities/intent-resolver.ts +7 -7
- package/src/capabilities/react-surface.tsx +13 -14
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +13 -13
- package/src/components/AutomationPanel/AutomationPanel.tsx +84 -38
- package/src/components/AutomationSettings.tsx +30 -0
- package/src/components/FunctionsContainer.tsx +11 -13
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +5 -5
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +8 -2
- package/src/components/TriggerEditor/SpecSelector.tsx +23 -16
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +41 -19
- package/src/components/TriggerEditor/TriggerEditor.tsx +68 -18
- package/src/components/TriggerSettings.tsx +25 -0
- package/src/components/index.ts +1 -1
- package/src/events.ts +11 -0
- package/src/hooks/index.ts +6 -0
- package/src/hooks/useComputeRuntimeCallback.ts +30 -0
- package/src/hooks/useTriggerRuntimeControls.ts +52 -0
- package/src/index.ts +2 -0
- package/src/meta.ts +1 -3
- package/src/testing/test-functions.ts +1 -1
- package/src/translations.ts +4 -0
- package/src/types/schema.ts +1 -1
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs +0 -38
- package/dist/lib/browser/AutomationContainer-VZNV2ZQF.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-ZWA6GOFY.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-IOB333TX.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ZTAUTFI4.mjs.map +0 -7
- package/dist/lib/browser/chunk-ECSTS2UI.mjs +0 -14
- package/dist/lib/browser/chunk-ECSTS2UI.mjs.map +0 -7
- package/dist/lib/browser/chunk-ERTIGJYE.mjs.map +0 -7
- package/dist/lib/browser/chunk-FSJZXTS2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GW5U2DGT.mjs.map +0 -7
- package/dist/lib/browser/chunk-HN7OHFCB.mjs.map +0 -7
- package/dist/lib/browser/chunk-LYJVTIVD.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-U3ZAQEFW.mjs.map +0 -7
- package/dist/lib/browser/react-surface-4DFSM7OX.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs +0 -39
- package/dist/lib/node-esm/AutomationContainer-WMIH3F4V.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-DJWB6WFH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-3FP63ZSG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AZH66CED.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HIMYPGHF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NK5N3QKD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OEZNHUL2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs +0 -16
- package/dist/lib/node-esm/chunk-SGZPTJ47.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZGPUV5VS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-3QWXEBPX.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-3PNW7NDW.mjs.map +0 -7
- package/dist/types/src/components/AutomationContainer.d.ts +0 -5
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/src/components/AutomationContainer.tsx +0 -30
- /package/dist/lib/browser/{AutomationPanel-ZWA6GOFY.mjs.map → AutomationPanel-PNBH5L5C.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-NRIKAPQV.mjs.map} +0 -0
- /package/dist/lib/{node-esm/AutomationPanel-YYUMSK2W.mjs.map → browser/hooks/index.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs.map → AutomationPanel-GHK5UG4K.mjs.map} +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.c4373fc",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -10,11 +10,19 @@
|
|
|
10
10
|
"type": "module",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
|
+
"source": "./src/index.ts",
|
|
13
14
|
"types": "./dist/types/src/index.d.ts",
|
|
14
15
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
16
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
17
|
},
|
|
18
|
+
"./hooks": {
|
|
19
|
+
"source": "./src/hooks/index.ts",
|
|
20
|
+
"types": "./dist/types/src/hooks/index.d.ts",
|
|
21
|
+
"browser": "./dist/lib/browser/hooks/index.mjs",
|
|
22
|
+
"node": "./dist/lib/node-esm/hooks/index.mjs"
|
|
23
|
+
},
|
|
17
24
|
"./types": {
|
|
25
|
+
"source": "./src/types/index.ts",
|
|
18
26
|
"types": "./dist/types/src/types/index.d.ts",
|
|
19
27
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
28
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -22,7 +30,14 @@
|
|
|
22
30
|
},
|
|
23
31
|
"types": "dist/types/src/index.d.ts",
|
|
24
32
|
"typesVersions": {
|
|
25
|
-
"*": {
|
|
33
|
+
"*": {
|
|
34
|
+
"hooks": [
|
|
35
|
+
"dist/types/src/hooks/index.d.ts"
|
|
36
|
+
],
|
|
37
|
+
"types": [
|
|
38
|
+
"dist/types/src/types/index.d.ts"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
26
41
|
},
|
|
27
42
|
"files": [
|
|
28
43
|
"assets",
|
|
@@ -30,49 +45,56 @@
|
|
|
30
45
|
"src"
|
|
31
46
|
],
|
|
32
47
|
"dependencies": {
|
|
48
|
+
"@effect/ai": "0.29.1",
|
|
49
|
+
"@effect/platform-browser": "0.72.0",
|
|
33
50
|
"@preact-signals/safe-react": "^0.9.0",
|
|
34
|
-
"@preact/signals-core": "^1.
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/functions": "0.8.4-main.
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/log": "0.8.4-main.
|
|
46
|
-
"@dxos/plugin-
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/react-
|
|
53
|
-
"@dxos/
|
|
51
|
+
"@preact/signals-core": "^1.12.1",
|
|
52
|
+
"@dxos/ai": "0.8.4-main.c4373fc",
|
|
53
|
+
"@dxos/app-framework": "0.8.4-main.c4373fc",
|
|
54
|
+
"@dxos/assistant": "0.8.4-main.c4373fc",
|
|
55
|
+
"@dxos/async": "0.8.4-main.c4373fc",
|
|
56
|
+
"@dxos/echo": "0.8.4-main.c4373fc",
|
|
57
|
+
"@dxos/functions": "0.8.4-main.c4373fc",
|
|
58
|
+
"@dxos/conductor": "0.8.4-main.c4373fc",
|
|
59
|
+
"@dxos/keys": "0.8.4-main.c4373fc",
|
|
60
|
+
"@dxos/invariant": "0.8.4-main.c4373fc",
|
|
61
|
+
"@dxos/live-object": "0.8.4-main.c4373fc",
|
|
62
|
+
"@dxos/log": "0.8.4-main.c4373fc",
|
|
63
|
+
"@dxos/plugin-client": "0.8.4-main.c4373fc",
|
|
64
|
+
"@dxos/context": "0.8.4-main.c4373fc",
|
|
65
|
+
"@dxos/plugin-deck": "0.8.4-main.c4373fc",
|
|
66
|
+
"@dxos/plugin-space": "0.8.4-main.c4373fc",
|
|
67
|
+
"@dxos/plugin-graph": "0.8.4-main.c4373fc",
|
|
68
|
+
"@dxos/random": "0.8.4-main.c4373fc",
|
|
69
|
+
"@dxos/react-client": "0.8.4-main.c4373fc",
|
|
70
|
+
"@dxos/react-ui-editor": "0.8.4-main.c4373fc",
|
|
71
|
+
"@dxos/react-ui-form": "0.8.4-main.c4373fc",
|
|
72
|
+
"@dxos/react-ui-list": "0.8.4-main.c4373fc",
|
|
73
|
+
"@dxos/react-ui-stack": "0.8.4-main.c4373fc",
|
|
74
|
+
"@dxos/schema": "0.8.4-main.c4373fc",
|
|
75
|
+
"@dxos/util": "0.8.4-main.c4373fc"
|
|
54
76
|
},
|
|
55
77
|
"devDependencies": {
|
|
56
|
-
"@effect-rx/rx-react": "0.
|
|
57
|
-
"@effect/platform": "0.
|
|
58
|
-
"@types/react": "~
|
|
59
|
-
"@types/react-dom": "~
|
|
60
|
-
"effect": "3.
|
|
61
|
-
"react": "~
|
|
62
|
-
"react-dom": "~
|
|
63
|
-
"vite": "
|
|
64
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
65
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
66
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
78
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
79
|
+
"@effect/platform": "0.92.1",
|
|
80
|
+
"@types/react": "~19.2.2",
|
|
81
|
+
"@types/react-dom": "~19.2.1",
|
|
82
|
+
"effect": "3.18.3",
|
|
83
|
+
"react": "~19.2.0",
|
|
84
|
+
"react-dom": "~19.2.0",
|
|
85
|
+
"vite": "7.1.9",
|
|
86
|
+
"@dxos/react-ui": "0.8.4-main.c4373fc",
|
|
87
|
+
"@dxos/react-ui-theme": "0.8.4-main.c4373fc",
|
|
88
|
+
"@dxos/storybook-utils": "0.8.4-main.c4373fc"
|
|
67
89
|
},
|
|
68
90
|
"peerDependencies": {
|
|
69
91
|
"@effect-rx/rx-react": "^0.34.1",
|
|
70
92
|
"@effect/platform": "^0.80.12",
|
|
71
93
|
"effect": "^3.13.3",
|
|
72
|
-
"react": "
|
|
73
|
-
"react-dom": "
|
|
74
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
75
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
94
|
+
"react": "^19.0.0",
|
|
95
|
+
"react-dom": "^19.0.0",
|
|
96
|
+
"@dxos/react-ui": "0.8.4-main.c4373fc",
|
|
97
|
+
"@dxos/react-ui-theme": "0.8.4-main.c4373fc"
|
|
76
98
|
},
|
|
77
99
|
"publishConfig": {
|
|
78
100
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -2,39 +2,45 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, defineModule, definePlugin
|
|
6
|
-
import {
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
|
+
import { FunctionTrigger, FunctionType } from '@dxos/functions';
|
|
7
7
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
8
|
|
|
9
|
-
import { AppGraphBuilder, IntentResolver, ReactSurface } from './capabilities';
|
|
9
|
+
import { AppGraphBuilder, ComputeRuntime, IntentResolver, ReactSurface } from './capabilities';
|
|
10
|
+
import { AutomationEvents } from './events';
|
|
10
11
|
import { meta } from './meta';
|
|
11
12
|
import { translations } from './translations';
|
|
12
13
|
|
|
13
|
-
export const AutomationPlugin = () =>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
14
|
+
export const AutomationPlugin = definePlugin(meta, () => [
|
|
15
|
+
defineModule({
|
|
16
|
+
id: `${meta.id}/module/translations`,
|
|
17
|
+
activatesOn: Events.SetupTranslations,
|
|
18
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
19
|
+
}),
|
|
20
|
+
defineModule({
|
|
21
|
+
id: `${meta.id}/module/schema`,
|
|
22
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
23
|
+
activate: () => contributes(ClientCapabilities.Schema, [FunctionType, FunctionTrigger]),
|
|
24
|
+
}),
|
|
25
|
+
defineModule({
|
|
26
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
27
|
+
activatesOn: Events.SetupAppGraph,
|
|
28
|
+
activate: AppGraphBuilder,
|
|
29
|
+
}),
|
|
30
|
+
defineModule({
|
|
31
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
32
|
+
activatesOn: Events.SetupIntentResolver,
|
|
33
|
+
activate: IntentResolver,
|
|
34
|
+
}),
|
|
35
|
+
defineModule({
|
|
36
|
+
id: `${meta.id}/module/react-surface`,
|
|
37
|
+
activatesOn: Events.SetupReactSurface,
|
|
38
|
+
activate: ReactSurface,
|
|
39
|
+
}),
|
|
40
|
+
defineModule({
|
|
41
|
+
id: `${meta.id}/module/compute-runtime`,
|
|
42
|
+
activatesOn: ClientEvents.ClientReady,
|
|
43
|
+
activatesAfter: [AutomationEvents.ComputeRuntimeReady],
|
|
44
|
+
activate: ComputeRuntime,
|
|
45
|
+
}),
|
|
46
|
+
]);
|
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import
|
|
6
|
+
import * as Function from 'effect/Function';
|
|
7
|
+
import * as Option from 'effect/Option';
|
|
7
8
|
|
|
8
|
-
import { Capabilities,
|
|
9
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
9
10
|
import { Obj } from '@dxos/echo';
|
|
10
11
|
import { ScriptType } from '@dxos/functions';
|
|
11
|
-
import {
|
|
12
|
+
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
12
13
|
import { createExtension } from '@dxos/plugin-graph';
|
|
13
|
-
import {
|
|
14
|
+
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
14
15
|
|
|
15
16
|
import { meta } from '../meta';
|
|
16
17
|
|
|
@@ -20,9 +21,9 @@ export default (context: PluginContext) =>
|
|
|
20
21
|
id: `${meta.id}/space-settings-automation`,
|
|
21
22
|
connector: (node) =>
|
|
22
23
|
Rx.make((get) =>
|
|
23
|
-
pipe(
|
|
24
|
+
Function.pipe(
|
|
24
25
|
get(node),
|
|
25
|
-
Option.flatMap((node) => (node.type === `${
|
|
26
|
+
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
26
27
|
Option.map((node) => [
|
|
27
28
|
{
|
|
28
29
|
id: `automation-${node.id}`,
|
|
@@ -42,9 +43,9 @@ export default (context: PluginContext) =>
|
|
|
42
43
|
id: `${meta.id}/space-settings-functions`,
|
|
43
44
|
connector: (node) =>
|
|
44
45
|
Rx.make((get) =>
|
|
45
|
-
pipe(
|
|
46
|
+
Function.pipe(
|
|
46
47
|
get(node),
|
|
47
|
-
Option.flatMap((node) => (node.type === `${
|
|
48
|
+
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
48
49
|
Option.map((node) => [
|
|
49
50
|
{
|
|
50
51
|
id: `functions-${node.id}`,
|
|
@@ -64,7 +65,7 @@ export default (context: PluginContext) =>
|
|
|
64
65
|
id: `${meta.id}/script-companion`,
|
|
65
66
|
connector: (node) =>
|
|
66
67
|
Rx.make((get) =>
|
|
67
|
-
pipe(
|
|
68
|
+
Function.pipe(
|
|
68
69
|
get(node),
|
|
69
70
|
Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),
|
|
70
71
|
Option.map((node) => [
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
6
|
+
|
|
7
|
+
import { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
8
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
9
|
+
import type {
|
|
10
|
+
CredentialsService,
|
|
11
|
+
DatabaseService,
|
|
12
|
+
FunctionInvocationService,
|
|
13
|
+
InvocationTracer,
|
|
14
|
+
QueueService,
|
|
15
|
+
TriggerDispatcher,
|
|
16
|
+
TriggerStateStore,
|
|
17
|
+
} from '@dxos/functions';
|
|
18
|
+
import type { SpaceId } from '@dxos/keys';
|
|
19
|
+
|
|
20
|
+
import { meta } from '../meta';
|
|
21
|
+
|
|
22
|
+
export namespace AutomationCapabilities {
|
|
23
|
+
/**
|
|
24
|
+
* Service stack for executing agents, functions, and triggers.
|
|
25
|
+
*/
|
|
26
|
+
export type ComputeServices =
|
|
27
|
+
| TriggerDispatcher
|
|
28
|
+
| AiService.AiService
|
|
29
|
+
| DatabaseService
|
|
30
|
+
| QueueService
|
|
31
|
+
| CredentialsService
|
|
32
|
+
| FunctionInvocationService
|
|
33
|
+
| InvocationTracer
|
|
34
|
+
| TriggerStateStore
|
|
35
|
+
// TODO(dmaretskyi): Those should be provided at AI-chat call site.
|
|
36
|
+
| ToolResolverService
|
|
37
|
+
| ToolExecutionService;
|
|
38
|
+
|
|
39
|
+
export type ComputeRuntime = ManagedRuntime.ManagedRuntime<AutomationCapabilities.ComputeServices, never>;
|
|
40
|
+
export interface ComputeRuntimeProvider {
|
|
41
|
+
getRuntime(spaceId: SpaceId): ComputeRuntime;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Runtime for executing agents, functions, and triggers.
|
|
46
|
+
*/
|
|
47
|
+
export const ComputeRuntime = defineCapability<ComputeRuntimeProvider>(`${meta.id}/capability/compute-runtime`);
|
|
48
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
|
+
import * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';
|
|
7
|
+
import * as Effect from 'effect/Effect';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
10
|
+
|
|
11
|
+
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
12
|
+
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
13
|
+
import { Resource } from '@dxos/context';
|
|
14
|
+
import { Query, Ref } from '@dxos/echo';
|
|
15
|
+
import {
|
|
16
|
+
CredentialsService,
|
|
17
|
+
DatabaseService,
|
|
18
|
+
FunctionImplementationResolver,
|
|
19
|
+
FunctionInvocationService,
|
|
20
|
+
InvocationTracer,
|
|
21
|
+
LocalFunctionExecutionService,
|
|
22
|
+
QueueService,
|
|
23
|
+
RemoteFunctionExecutionService,
|
|
24
|
+
TriggerDispatcher,
|
|
25
|
+
} from '@dxos/functions';
|
|
26
|
+
import { TriggerStateStore } from '@dxos/functions';
|
|
27
|
+
import { invariant } from '@dxos/invariant';
|
|
28
|
+
import { type SpaceId } from '@dxos/keys';
|
|
29
|
+
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
30
|
+
import { PropertiesType } from '@dxos/react-client/echo';
|
|
31
|
+
|
|
32
|
+
import { AutomationCapabilities } from './capabilities';
|
|
33
|
+
|
|
34
|
+
export default async (context: PluginContext) => {
|
|
35
|
+
const provider = await new ComputeRuntimeProviderImpl(context).open();
|
|
36
|
+
return contributes(AutomationCapabilities.ComputeRuntime, provider, async () => {
|
|
37
|
+
await provider.close();
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilities.ComputeRuntimeProvider {
|
|
42
|
+
readonly #runtimes = new Map<SpaceId, AutomationCapabilities.ComputeRuntime>();
|
|
43
|
+
readonly #context: PluginContext;
|
|
44
|
+
|
|
45
|
+
constructor(context: PluginContext) {
|
|
46
|
+
super();
|
|
47
|
+
this.#context = context;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected override async _open() {}
|
|
51
|
+
|
|
52
|
+
protected override async _close() {
|
|
53
|
+
await Promise.all(Array.from(this.#runtimes.values()).map((rt) => rt.dispose()));
|
|
54
|
+
this.#runtimes.clear();
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
getRuntime(spaceId: SpaceId): AutomationCapabilities.ComputeRuntime {
|
|
58
|
+
if (this.#runtimes.has(spaceId)) {
|
|
59
|
+
return this.#runtimes.get(spaceId)!;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const layer = Layer.unwrapEffect(
|
|
63
|
+
Effect.gen(this, function* () {
|
|
64
|
+
const client = this.#context.getCapability(ClientCapabilities.Client);
|
|
65
|
+
const serviceLayer =
|
|
66
|
+
this.#context.getCapability(Capabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
67
|
+
|
|
68
|
+
// TODO(dmaretskyi): Make those reactive.
|
|
69
|
+
const functions = this.#context.getCapabilities(Capabilities.Functions);
|
|
70
|
+
const toolkits = this.#context.getCapabilities(Capabilities.Toolkit);
|
|
71
|
+
const handlers = this.#context.getCapabilities(Capabilities.ToolkitHandler);
|
|
72
|
+
|
|
73
|
+
const allFunctions = functions.flat();
|
|
74
|
+
// TODO(wittjosiah): Don't cast.
|
|
75
|
+
const toolkit = Toolkit.merge(...toolkits) as Toolkit.Toolkit<any>;
|
|
76
|
+
const handlersLayer = Layer.mergeAll(Layer.empty, ...handlers);
|
|
77
|
+
|
|
78
|
+
const space = client.spaces.get(spaceId);
|
|
79
|
+
invariant(space);
|
|
80
|
+
yield* Effect.promise(() => space.waitUntilReady());
|
|
81
|
+
|
|
82
|
+
return Layer.mergeAll(TriggerDispatcher.layer({ timeControl: 'natural' })).pipe(
|
|
83
|
+
Layer.provideMerge(
|
|
84
|
+
Layer.mergeAll(
|
|
85
|
+
InvocationTracerLive,
|
|
86
|
+
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
87
|
+
makeToolResolverFromFunctions(allFunctions, toolkit),
|
|
88
|
+
makeToolExecutionServiceFromFunctions(toolkit, handlersLayer),
|
|
89
|
+
),
|
|
90
|
+
),
|
|
91
|
+
Layer.provideMerge(
|
|
92
|
+
Layer.mergeAll(
|
|
93
|
+
FunctionInvocationService.layer.pipe(
|
|
94
|
+
Layer.provideMerge(
|
|
95
|
+
LocalFunctionExecutionService.layerLive.pipe(
|
|
96
|
+
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions: allFunctions })),
|
|
97
|
+
Layer.provideMerge(
|
|
98
|
+
RemoteFunctionExecutionService.fromClient(
|
|
99
|
+
client.edge.baseUrl,
|
|
100
|
+
// If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
|
|
101
|
+
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
102
|
+
),
|
|
103
|
+
),
|
|
104
|
+
Layer.provideMerge(serviceLayer),
|
|
105
|
+
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
106
|
+
Layer.provideMerge(space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable),
|
|
107
|
+
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
108
|
+
),
|
|
109
|
+
),
|
|
110
|
+
),
|
|
111
|
+
),
|
|
112
|
+
),
|
|
113
|
+
);
|
|
114
|
+
}),
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const runtime = ManagedRuntime.make(layer);
|
|
118
|
+
this.#runtimes.set(spaceId, runtime);
|
|
119
|
+
|
|
120
|
+
return runtime;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const InvocationTracerLive = Layer.unwrapEffect(
|
|
125
|
+
Effect.gen(function* () {
|
|
126
|
+
const {
|
|
127
|
+
objects: [properties],
|
|
128
|
+
} = yield* DatabaseService.runQuery(Query.type(PropertiesType));
|
|
129
|
+
invariant(properties);
|
|
130
|
+
if (!properties.invocationTraceQueue) {
|
|
131
|
+
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
132
|
+
properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
133
|
+
}
|
|
134
|
+
const queue = properties.invocationTraceQueue.target;
|
|
135
|
+
invariant(queue);
|
|
136
|
+
return InvocationTracer.layerLive({ invocationTraceQueue: queue });
|
|
137
|
+
}),
|
|
138
|
+
);
|
|
@@ -5,5 +5,8 @@
|
|
|
5
5
|
import { lazy } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const ComputeRuntime = lazy(() => import('./compute-runtime'));
|
|
8
9
|
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
10
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
11
|
+
|
|
12
|
+
export * from './capabilities';
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
contributes,
|
|
7
6
|
Capabilities,
|
|
8
|
-
|
|
7
|
+
LayoutAction,
|
|
9
8
|
type PluginContext,
|
|
9
|
+
contributes,
|
|
10
10
|
createIntent,
|
|
11
|
-
|
|
11
|
+
createResolver,
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
13
|
import { Obj, Ref } from '@dxos/echo';
|
|
14
|
-
import { FunctionTrigger, FunctionType, ScriptType
|
|
14
|
+
import { FunctionTrigger, FunctionType, ScriptType } from '@dxos/functions';
|
|
15
15
|
import { type DXN } from '@dxos/keys';
|
|
16
16
|
import { ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
17
17
|
import { SpaceAction } from '@dxos/plugin-space/types';
|
|
@@ -43,11 +43,11 @@ export default (context: PluginContext) =>
|
|
|
43
43
|
|
|
44
44
|
switch (template.type) {
|
|
45
45
|
case 'timer': {
|
|
46
|
-
trigger.spec = { kind:
|
|
46
|
+
trigger.spec = { kind: 'timer', cron: template.cron };
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
49
|
case 'queue': {
|
|
50
|
-
trigger.spec = { kind:
|
|
50
|
+
trigger.spec = { kind: 'queue', queue: (template.queueDXN as DXN).toString() };
|
|
51
51
|
break;
|
|
52
52
|
}
|
|
53
53
|
default: {
|
|
@@ -57,7 +57,7 @@ export default (context: PluginContext) =>
|
|
|
57
57
|
|
|
58
58
|
return {
|
|
59
59
|
intents: [
|
|
60
|
-
createIntent(SpaceAction.AddObject, { object: trigger, target: space }),
|
|
60
|
+
createIntent(SpaceAction.AddObject, { object: trigger, target: space, hidden: true }),
|
|
61
61
|
createIntent(LayoutAction.Open, {
|
|
62
62
|
part: 'main',
|
|
63
63
|
subject: [`automation-settings${ATTENDABLE_PATH_SEPARATOR}${space.id}`],
|
|
@@ -6,51 +6,50 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface, useLayout } from '@dxos/app-framework';
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import { ScriptType } from '@dxos/functions';
|
|
10
9
|
import { getSpace, parseId, useSpace } from '@dxos/react-client/echo';
|
|
11
10
|
|
|
12
|
-
import {
|
|
11
|
+
import { AutomationSettings, FunctionsContainer } from '../components';
|
|
13
12
|
import { meta } from '../meta';
|
|
14
13
|
|
|
15
14
|
export default () =>
|
|
16
15
|
contributes(Capabilities.ReactSurface, [
|
|
17
16
|
createSurface({
|
|
18
|
-
id: `${meta.id}/space-settings-
|
|
17
|
+
id: `${meta.id}/space-settings-functions`,
|
|
19
18
|
role: 'article',
|
|
20
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-
|
|
19
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-functions`,
|
|
21
20
|
component: () => {
|
|
22
21
|
const layout = useLayout();
|
|
23
22
|
const { spaceId } = parseId(layout.workspace);
|
|
24
23
|
const space = useSpace(spaceId);
|
|
25
|
-
if (!space
|
|
24
|
+
if (!space) {
|
|
26
25
|
return null;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
return <
|
|
28
|
+
return <FunctionsContainer space={space} />;
|
|
30
29
|
},
|
|
31
30
|
}),
|
|
32
31
|
createSurface({
|
|
33
|
-
id: `${meta.id}/space-settings-
|
|
32
|
+
id: `${meta.id}/space-settings-automation`,
|
|
34
33
|
role: 'article',
|
|
35
|
-
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-
|
|
34
|
+
filter: (data): data is { subject: string } => data.subject === `${meta.id}/space-settings-automation`,
|
|
36
35
|
component: () => {
|
|
37
36
|
const layout = useLayout();
|
|
38
37
|
const { spaceId } = parseId(layout.workspace);
|
|
39
38
|
const space = useSpace(spaceId);
|
|
40
|
-
if (!space
|
|
39
|
+
if (!space) {
|
|
41
40
|
return null;
|
|
42
41
|
}
|
|
43
42
|
|
|
44
|
-
return <
|
|
43
|
+
return <AutomationSettings space={space} />;
|
|
45
44
|
},
|
|
46
45
|
}),
|
|
47
46
|
createSurface({
|
|
48
47
|
id: `${meta.id}/companion/automation`,
|
|
49
48
|
role: 'article',
|
|
50
|
-
filter: (data): data is { companionTo:
|
|
51
|
-
Obj.
|
|
52
|
-
component: ({ data
|
|
53
|
-
return <
|
|
49
|
+
filter: (data): data is { companionTo: Obj.Any; subject: 'automation' } =>
|
|
50
|
+
Obj.isObject(data.companionTo) && data.subject === 'automation',
|
|
51
|
+
component: ({ data }) => {
|
|
52
|
+
return <AutomationSettings space={getSpace(data.companionTo)!} object={data.companionTo} />;
|
|
54
53
|
},
|
|
55
54
|
}),
|
|
56
55
|
]);
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta } from '@storybook/react-vite';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React from 'react';
|
|
9
7
|
|
|
10
8
|
import { Obj } from '@dxos/echo';
|
|
11
|
-
import {
|
|
9
|
+
import { FunctionTrigger, FunctionType } from '@dxos/functions';
|
|
12
10
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
13
11
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
14
|
-
import {
|
|
12
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
13
|
|
|
16
|
-
import { AutomationPanel } from './AutomationPanel';
|
|
17
14
|
import { functions } from '../../testing';
|
|
18
15
|
import { translations } from '../../translations';
|
|
19
16
|
|
|
17
|
+
import { AutomationPanel } from './AutomationPanel';
|
|
18
|
+
|
|
20
19
|
const DefaultStory = () => {
|
|
21
20
|
const spaces = useSpaces();
|
|
22
21
|
const space = spaces[1];
|
|
@@ -28,30 +27,31 @@ const DefaultStory = () => {
|
|
|
28
27
|
);
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
const meta
|
|
30
|
+
const meta = {
|
|
32
31
|
title: 'plugins/plugin-automation/AutomationPanel',
|
|
33
|
-
component: AutomationPanel,
|
|
32
|
+
component: AutomationPanel as any,
|
|
34
33
|
render: DefaultStory,
|
|
35
34
|
decorators: [
|
|
35
|
+
withTheme,
|
|
36
36
|
withClientProvider({
|
|
37
37
|
createIdentity: true,
|
|
38
38
|
createSpace: true,
|
|
39
39
|
types: [FunctionType, FunctionTrigger],
|
|
40
|
-
|
|
40
|
+
onCreateSpace: ({ space }) => {
|
|
41
41
|
for (const fn of functions) {
|
|
42
42
|
space.db.add(Obj.make(FunctionType, fn));
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
}),
|
|
46
|
-
withLayout(),
|
|
47
|
-
withTheme,
|
|
48
46
|
],
|
|
49
47
|
parameters: {
|
|
50
48
|
layout: 'centered',
|
|
51
49
|
translations,
|
|
52
50
|
},
|
|
53
|
-
}
|
|
51
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
54
52
|
|
|
55
53
|
export default meta;
|
|
56
54
|
|
|
57
|
-
|
|
55
|
+
type Story = StoryObj<typeof meta>;
|
|
56
|
+
|
|
57
|
+
export const Default: Story = {};
|