@dxos/plugin-automation 0.8.4-main.5ad4a44 → 0.8.4-main.66e292d
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-M4M77L4V.mjs +11 -0
- package/dist/lib/browser/{AutomationSettings-3LABN6ER.mjs → AutomationSettings-4HCI6KJR.mjs} +6 -7
- package/dist/lib/{node-esm/AutomationSettings-XENNIIZM.mjs.map → browser/AutomationSettings-4HCI6KJR.mjs.map} +1 -1
- package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs +144 -0
- package/dist/lib/browser/FunctionsContainer-CDVBRQCT.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-NRIKAPQV.mjs → FunctionsPanel-CRW6SJUN.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-DV5HMFX4.mjs → app-graph-builder-W7LLC6XW.mjs} +7 -7
- package/dist/lib/browser/app-graph-builder-W7LLC6XW.mjs.map +7 -0
- package/dist/lib/browser/chunk-4MBM6C6A.mjs +100 -0
- package/dist/lib/browser/chunk-4MBM6C6A.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NIJWEQRD.mjs → chunk-7W6QMY3L.mjs} +26 -42
- package/dist/lib/browser/chunk-7W6QMY3L.mjs.map +7 -0
- package/dist/lib/browser/{chunk-AY67OUDA.mjs → chunk-CZVA5NMD.mjs} +5 -5
- package/dist/lib/browser/chunk-LZQFZO3B.mjs +17 -0
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LC3QQU47.mjs → chunk-T6ZESHDY.mjs} +38 -18
- package/dist/lib/browser/chunk-T6ZESHDY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-DLLE4FKP.mjs → chunk-TWWFNOIR.mjs} +27 -12
- package/dist/lib/browser/chunk-TWWFNOIR.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5ARH77PV.mjs → chunk-XAKZ4ANY.mjs} +2 -2
- package/dist/lib/browser/chunk-XAKZ4ANY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VGBZKM3O.mjs → chunk-YBPJCY3F.mjs} +2 -2
- package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs +113 -0
- package/dist/lib/browser/compute-runtime-B4XJVY4Y.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +5 -4
- package/dist/lib/browser/index.mjs +19 -10
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-D2OHKQRR.mjs → intent-resolver-5HR7M7T6.mjs} +8 -8
- package/dist/lib/browser/intent-resolver-5HR7M7T6.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-JXFO46V4.mjs → react-surface-TKU2EQ5A.mjs} +6 -5
- package/dist/lib/browser/react-surface-TKU2EQ5A.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-GHK5UG4K.mjs → AutomationPanel-F5CTC6AT.mjs} +4 -4
- package/dist/lib/node-esm/{AutomationSettings-XENNIIZM.mjs → AutomationSettings-BQLJIFRT.mjs} +6 -7
- package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs +145 -0
- package/dist/lib/node-esm/FunctionsContainer-ZHHJPQAZ.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-SAMRTELO.mjs → FunctionsPanel-RVVCS6VH.mjs} +3 -3
- package/dist/lib/node-esm/{app-graph-builder-TR2WXPX2.mjs → app-graph-builder-SLQOO7GH.mjs} +7 -7
- package/dist/lib/node-esm/app-graph-builder-SLQOO7GH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LWASMQIF.mjs → chunk-3IYSC75Z.mjs} +5 -5
- package/dist/lib/node-esm/chunk-7B6NAAI6.mjs +101 -0
- package/dist/lib/node-esm/chunk-7B6NAAI6.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5MQJPJR2.mjs → chunk-CEVIVRTY.mjs} +6 -2
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-EX74SIDO.mjs → chunk-CF2SWXPW.mjs} +26 -42
- package/dist/lib/node-esm/chunk-CF2SWXPW.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-CJUI6AKX.mjs → chunk-ECJKIUBO.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-3EWMZAU6.mjs → chunk-F76XVENA.mjs} +38 -18
- package/dist/lib/node-esm/chunk-F76XVENA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-WHCSOUNN.mjs → chunk-KB7NFEYY.mjs} +2 -2
- package/dist/lib/node-esm/chunk-KB7NFEYY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YQXW3JXD.mjs → chunk-RVK52XGK.mjs} +27 -12
- package/dist/lib/node-esm/chunk-RVK52XGK.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs +114 -0
- package/dist/lib/node-esm/compute-runtime-JUWTQXOV.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +5 -4
- package/dist/lib/node-esm/index.mjs +19 -10
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-2LGBVXT5.mjs → intent-resolver-KDRYB5BC.mjs} +8 -8
- package/dist/lib/node-esm/intent-resolver-KDRYB5BC.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-YDJ43B3N.mjs → react-surface-7QROSEGH.mjs} +6 -5
- package/dist/lib/node-esm/react-surface-7QROSEGH.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/capabilities/capabilities.d.ts +2 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/compute-runtime.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts +2 -2
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts +3 -0
- package/dist/types/src/components/AutomationPanel/AutomationPanel.stories.d.ts.map +1 -1
- 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/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 +2 -0
- package/dist/types/src/components/FunctionsRegistry/index.d.ts.map +1 -0
- 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 +6 -5
- package/dist/types/src/components/TriggerEditor/TriggerEditor.d.ts.map +1 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts +3 -1
- package/dist/types/src/components/TriggerEditor/TriggerEditor.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts +5 -1
- package/dist/types/src/hooks/useComputeRuntimeCallback.d.ts.map +1 -1
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts +2 -2
- package/dist/types/src/hooks/useTriggerRuntimeControls.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -0
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/testing/test-functions.d.ts +2 -3
- package/dist/types/src/testing/test-functions.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -33
- package/src/AutomationPlugin.tsx +2 -2
- package/src/capabilities/app-graph-builder.ts +6 -6
- package/src/capabilities/capabilities.ts +2 -9
- package/src/capabilities/compute-runtime.ts +27 -36
- package/src/capabilities/intent-resolver.ts +5 -5
- package/src/capabilities/react-surface.tsx +2 -1
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +4 -5
- package/src/components/AutomationPanel/AutomationPanel.tsx +48 -35
- package/src/components/FunctionsContainer.tsx +7 -0
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +32 -13
- package/src/components/FunctionsRegistry/FunctionsRegistry.tsx +127 -0
- package/src/components/FunctionsRegistry/index.ts +5 -0
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +2 -2
- package/src/components/TriggerEditor/SpecSelector.tsx +4 -5
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +37 -16
- package/src/components/TriggerEditor/TriggerEditor.tsx +24 -54
- package/src/hooks/useComputeRuntimeCallback.ts +40 -2
- package/src/hooks/useTriggerRuntimeControls.ts +4 -3
- package/src/index.ts +1 -0
- package/src/meta.ts +5 -2
- package/src/testing/test-functions.ts +2 -2
- package/src/translations.ts +3 -0
- package/dist/lib/browser/AutomationPanel-PNBH5L5C.mjs +0 -11
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs +0 -36
- package/dist/lib/browser/FunctionsContainer-HHBMPUOD.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-DV5HMFX4.mjs.map +0 -7
- package/dist/lib/browser/chunk-5ARH77PV.mjs.map +0 -7
- package/dist/lib/browser/chunk-DLLE4FKP.mjs.map +0 -7
- package/dist/lib/browser/chunk-LC3QQU47.mjs.map +0 -7
- package/dist/lib/browser/chunk-MVPRI3DB.mjs +0 -53
- package/dist/lib/browser/chunk-MVPRI3DB.mjs.map +0 -7
- package/dist/lib/browser/chunk-NIJWEQRD.mjs.map +0 -7
- package/dist/lib/browser/chunk-QT3YWUOT.mjs +0 -14
- package/dist/lib/browser/chunk-QT3YWUOT.mjs.map +0 -7
- package/dist/lib/browser/chunk-WWURMV25.mjs +0 -13
- package/dist/lib/browser/chunk-WWURMV25.mjs.map +0 -7
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs +0 -160
- package/dist/lib/browser/compute-runtime-YJREH6WP.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-D2OHKQRR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-JXFO46V4.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs +0 -37
- package/dist/lib/node-esm/FunctionsContainer-ZKVOBUHV.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-TR2WXPX2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3EWMZAU6.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5MQJPJR2.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EX74SIDO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs +0 -54
- package/dist/lib/node-esm/chunk-QCA543ZR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs +0 -16
- package/dist/lib/node-esm/chunk-U7LJXQS4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-WHCSOUNN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQXW3JXD.mjs.map +0 -7
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs +0 -161
- package/dist/lib/node-esm/compute-runtime-CMEPAYND.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-2LGBVXT5.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-YDJ43B3N.mjs.map +0 -7
- /package/dist/lib/browser/{AutomationPanel-PNBH5L5C.mjs.map → AutomationPanel-M4M77L4V.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-NRIKAPQV.mjs.map → FunctionsPanel-CRW6SJUN.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-AY67OUDA.mjs.map → chunk-CZVA5NMD.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-VGBZKM3O.mjs.map → chunk-YBPJCY3F.mjs.map} +0 -0
- /package/dist/lib/node-esm/{AutomationPanel-GHK5UG4K.mjs.map → AutomationPanel-F5CTC6AT.mjs.map} +0 -0
- /package/dist/lib/{browser/AutomationSettings-3LABN6ER.mjs.map → node-esm/AutomationSettings-BQLJIFRT.mjs.map} +0 -0
- /package/dist/lib/node-esm/{FunctionsPanel-SAMRTELO.mjs.map → FunctionsPanel-RVVCS6VH.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-LWASMQIF.mjs.map → chunk-3IYSC75Z.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-CJUI6AKX.mjs.map → chunk-ECJKIUBO.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.66e292d",
|
|
4
4
|
"description": "Prompt chain plugin",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -49,52 +49,55 @@
|
|
|
49
49
|
"@effect/platform-browser": "0.72.0",
|
|
50
50
|
"@preact-signals/safe-react": "^0.9.0",
|
|
51
51
|
"@preact/signals-core": "^1.12.1",
|
|
52
|
-
"@dxos/ai": "0.8.4-main.
|
|
53
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
54
|
-
"@dxos/assistant": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/functions": "0.8.4-main.
|
|
60
|
-
"@dxos/invariant": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/plugin-
|
|
66
|
-
"@dxos/plugin-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/react-ui-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
52
|
+
"@dxos/ai": "0.8.4-main.66e292d",
|
|
53
|
+
"@dxos/app-framework": "0.8.4-main.66e292d",
|
|
54
|
+
"@dxos/assistant": "0.8.4-main.66e292d",
|
|
55
|
+
"@dxos/async": "0.8.4-main.66e292d",
|
|
56
|
+
"@dxos/conductor": "0.8.4-main.66e292d",
|
|
57
|
+
"@dxos/echo": "0.8.4-main.66e292d",
|
|
58
|
+
"@dxos/context": "0.8.4-main.66e292d",
|
|
59
|
+
"@dxos/functions": "0.8.4-main.66e292d",
|
|
60
|
+
"@dxos/invariant": "0.8.4-main.66e292d",
|
|
61
|
+
"@dxos/functions-runtime": "0.8.4-main.66e292d",
|
|
62
|
+
"@dxos/keys": "0.8.4-main.66e292d",
|
|
63
|
+
"@dxos/live-object": "0.8.4-main.66e292d",
|
|
64
|
+
"@dxos/log": "0.8.4-main.66e292d",
|
|
65
|
+
"@dxos/plugin-client": "0.8.4-main.66e292d",
|
|
66
|
+
"@dxos/plugin-deck": "0.8.4-main.66e292d",
|
|
67
|
+
"@dxos/plugin-space": "0.8.4-main.66e292d",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.4-main.66e292d",
|
|
69
|
+
"@dxos/react-client": "0.8.4-main.66e292d",
|
|
70
|
+
"@dxos/random": "0.8.4-main.66e292d",
|
|
71
|
+
"@dxos/react-ui-components": "0.8.4-main.66e292d",
|
|
72
|
+
"@dxos/react-ui-form": "0.8.4-main.66e292d",
|
|
73
|
+
"@dxos/react-ui-list": "0.8.4-main.66e292d",
|
|
74
|
+
"@dxos/react-ui-stack": "0.8.4-main.66e292d",
|
|
75
|
+
"@dxos/react-ui-editor": "0.8.4-main.66e292d",
|
|
76
|
+
"@dxos/types": "0.8.4-main.66e292d",
|
|
77
|
+
"@dxos/util": "0.8.4-main.66e292d",
|
|
78
|
+
"@dxos/schema": "0.8.4-main.66e292d"
|
|
76
79
|
},
|
|
77
80
|
"devDependencies": {
|
|
78
|
-
"@effect-
|
|
81
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
79
82
|
"@effect/platform": "0.92.1",
|
|
80
83
|
"@types/react": "~19.2.2",
|
|
81
|
-
"@types/react-dom": "~19.2.
|
|
84
|
+
"@types/react-dom": "~19.2.2",
|
|
82
85
|
"effect": "3.18.3",
|
|
83
86
|
"react": "~19.2.0",
|
|
84
87
|
"react-dom": "~19.2.0",
|
|
85
88
|
"vite": "7.1.9",
|
|
86
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
87
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
88
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
89
|
+
"@dxos/react-ui": "0.8.4-main.66e292d",
|
|
90
|
+
"@dxos/react-ui-theme": "0.8.4-main.66e292d",
|
|
91
|
+
"@dxos/storybook-utils": "0.8.4-main.66e292d"
|
|
89
92
|
},
|
|
90
93
|
"peerDependencies": {
|
|
91
|
-
"@effect-
|
|
94
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
92
95
|
"@effect/platform": "^0.80.12",
|
|
93
96
|
"effect": "^3.13.3",
|
|
94
97
|
"react": "^19.0.0",
|
|
95
98
|
"react-dom": "^19.0.0",
|
|
96
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
97
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
99
|
+
"@dxos/react-ui": "0.8.4-main.66e292d",
|
|
100
|
+
"@dxos/react-ui-theme": "0.8.4-main.66e292d"
|
|
98
101
|
},
|
|
99
102
|
"publishConfig": {
|
|
100
103
|
"access": "public"
|
package/src/AutomationPlugin.tsx
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { Function, Trigger } from '@dxos/functions';
|
|
7
7
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
8
|
|
|
9
9
|
import { AppGraphBuilder, ComputeRuntime, IntentResolver, ReactSurface } from './capabilities';
|
|
@@ -20,7 +20,7 @@ export const AutomationPlugin = definePlugin(meta, () => [
|
|
|
20
20
|
defineModule({
|
|
21
21
|
id: `${meta.id}/module/schema`,
|
|
22
22
|
activatesOn: ClientEvents.SetupSchema,
|
|
23
|
-
activate: () => contributes(ClientCapabilities.Schema, [
|
|
23
|
+
activate: () => contributes(ClientCapabilities.Schema, [Function.Function, Trigger.Trigger]),
|
|
24
24
|
}),
|
|
25
25
|
defineModule({
|
|
26
26
|
id: `${meta.id}/module/app-graph-builder`,
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Atom } from '@effect-atom/atom-react';
|
|
6
6
|
import * as Function from 'effect/Function';
|
|
7
7
|
import * as Option from 'effect/Option';
|
|
8
8
|
|
|
9
9
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
10
10
|
import { Obj } from '@dxos/echo';
|
|
11
|
-
import {
|
|
11
|
+
import { Script } from '@dxos/functions';
|
|
12
12
|
import { ATTENDABLE_PATH_SEPARATOR, PLANK_COMPANION_TYPE } from '@dxos/plugin-deck/types';
|
|
13
13
|
import { createExtension } from '@dxos/plugin-graph';
|
|
14
14
|
import { meta as spaceMeta } from '@dxos/plugin-space';
|
|
@@ -20,7 +20,7 @@ export default (context: PluginContext) =>
|
|
|
20
20
|
createExtension({
|
|
21
21
|
id: `${meta.id}/space-settings-automation`,
|
|
22
22
|
connector: (node) =>
|
|
23
|
-
|
|
23
|
+
Atom.make((get) =>
|
|
24
24
|
Function.pipe(
|
|
25
25
|
get(node),
|
|
26
26
|
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
@@ -42,7 +42,7 @@ export default (context: PluginContext) =>
|
|
|
42
42
|
createExtension({
|
|
43
43
|
id: `${meta.id}/space-settings-functions`,
|
|
44
44
|
connector: (node) =>
|
|
45
|
-
|
|
45
|
+
Atom.make((get) =>
|
|
46
46
|
Function.pipe(
|
|
47
47
|
get(node),
|
|
48
48
|
Option.flatMap((node) => (node.type === `${spaceMeta.id}/settings` ? Option.some(node) : Option.none())),
|
|
@@ -64,10 +64,10 @@ export default (context: PluginContext) =>
|
|
|
64
64
|
createExtension({
|
|
65
65
|
id: `${meta.id}/script-companion`,
|
|
66
66
|
connector: (node) =>
|
|
67
|
-
|
|
67
|
+
Atom.make((get) =>
|
|
68
68
|
Function.pipe(
|
|
69
69
|
get(node),
|
|
70
|
-
Option.flatMap((node) => (Obj.instanceOf(
|
|
70
|
+
Option.flatMap((node) => (Obj.instanceOf(Script.Script, node.data) ? Option.some(node) : Option.none())),
|
|
71
71
|
Option.map((node) => [
|
|
72
72
|
{
|
|
73
73
|
id: [node.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),
|
|
@@ -6,15 +6,8 @@ import type * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
|
6
6
|
|
|
7
7
|
import { type AiService, type ToolExecutionService, type ToolResolverService } from '@dxos/ai';
|
|
8
8
|
import { defineCapability } from '@dxos/app-framework';
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
DatabaseService,
|
|
12
|
-
FunctionInvocationService,
|
|
13
|
-
InvocationTracer,
|
|
14
|
-
QueueService,
|
|
15
|
-
TriggerDispatcher,
|
|
16
|
-
TriggerStateStore,
|
|
17
|
-
} from '@dxos/functions';
|
|
9
|
+
import type { CredentialsService, DatabaseService, FunctionInvocationService, QueueService } from '@dxos/functions';
|
|
10
|
+
import type { InvocationTracer, TriggerDispatcher, TriggerStateStore } from '@dxos/functions-runtime';
|
|
18
11
|
import type { SpaceId } from '@dxos/keys';
|
|
19
12
|
|
|
20
13
|
import { meta } from '../meta';
|
|
@@ -2,32 +2,28 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import * as Toolkit from '@effect/ai/Toolkit';
|
|
6
5
|
import * as BrowserKeyValueStore from '@effect/platform-browser/BrowserKeyValueStore';
|
|
7
6
|
import * as Effect from 'effect/Effect';
|
|
8
7
|
import * as Layer from 'effect/Layer';
|
|
9
8
|
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
10
9
|
|
|
11
10
|
import { Capabilities, type PluginContext, contributes } from '@dxos/app-framework';
|
|
12
|
-
import { makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
11
|
+
import { GenericToolkit, makeToolExecutionServiceFromFunctions, makeToolResolverFromFunctions } from '@dxos/assistant';
|
|
13
12
|
import { Resource } from '@dxos/context';
|
|
14
13
|
import { Query, Ref } from '@dxos/echo';
|
|
14
|
+
import { CredentialsService, DatabaseService, QueueService } from '@dxos/functions';
|
|
15
15
|
import {
|
|
16
|
-
CredentialsService,
|
|
17
|
-
DatabaseService,
|
|
18
16
|
FunctionImplementationResolver,
|
|
19
|
-
|
|
17
|
+
FunctionInvocationServiceLayerWithLocalLoopbackExecutor,
|
|
20
18
|
InvocationTracer,
|
|
21
|
-
LocalFunctionExecutionService,
|
|
22
|
-
QueueService,
|
|
23
19
|
RemoteFunctionExecutionService,
|
|
24
20
|
TriggerDispatcher,
|
|
25
|
-
} from '@dxos/functions';
|
|
26
|
-
import { TriggerStateStore } from '@dxos/functions';
|
|
21
|
+
} from '@dxos/functions-runtime';
|
|
22
|
+
import { TriggerStateStore } from '@dxos/functions-runtime';
|
|
27
23
|
import { invariant } from '@dxos/invariant';
|
|
28
24
|
import { type SpaceId } from '@dxos/keys';
|
|
29
25
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
30
|
-
import {
|
|
26
|
+
import { SpaceProperties } from '@dxos/react-client/echo';
|
|
31
27
|
|
|
32
28
|
import { AutomationCapabilities } from './capabilities';
|
|
33
29
|
|
|
@@ -65,15 +61,12 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
65
61
|
const serviceLayer =
|
|
66
62
|
this.#context.getCapability(Capabilities.AiServiceLayer) ?? Layer.die('AiService not found');
|
|
67
63
|
|
|
68
|
-
// TODO(dmaretskyi): Make
|
|
69
|
-
const functions = this.#context.getCapabilities(Capabilities.Functions);
|
|
64
|
+
// TODO(dmaretskyi): Make these reactive.
|
|
65
|
+
const functions = this.#context.getCapabilities(Capabilities.Functions).flat();
|
|
70
66
|
const toolkits = this.#context.getCapabilities(Capabilities.Toolkit);
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
// TODO(wittjosiah): Don't cast.
|
|
75
|
-
const toolkit = Toolkit.merge(...toolkits) as Toolkit.Toolkit<any>;
|
|
76
|
-
const handlersLayer = Layer.mergeAll(Layer.empty, ...handlers);
|
|
67
|
+
const mergedToolkit = GenericToolkit.merge(...toolkits);
|
|
68
|
+
const toolkit = mergedToolkit.toolkit;
|
|
69
|
+
const toolkitLayer = mergedToolkit.layer;
|
|
77
70
|
|
|
78
71
|
const space = client.spaces.get(spaceId);
|
|
79
72
|
invariant(space);
|
|
@@ -84,29 +77,25 @@ class ComputeRuntimeProviderImpl extends Resource implements AutomationCapabilit
|
|
|
84
77
|
Layer.mergeAll(
|
|
85
78
|
InvocationTracerLive,
|
|
86
79
|
TriggerStateStore.layerKv.pipe(Layer.provide(BrowserKeyValueStore.layerLocalStorage)),
|
|
87
|
-
makeToolResolverFromFunctions(
|
|
88
|
-
makeToolExecutionServiceFromFunctions(toolkit,
|
|
80
|
+
makeToolResolverFromFunctions(functions, toolkit),
|
|
81
|
+
makeToolExecutionServiceFromFunctions(toolkit, toolkitLayer),
|
|
89
82
|
),
|
|
90
83
|
),
|
|
91
84
|
Layer.provideMerge(
|
|
92
85
|
Layer.mergeAll(
|
|
93
|
-
|
|
86
|
+
FunctionInvocationServiceLayerWithLocalLoopbackExecutor.pipe(
|
|
87
|
+
Layer.provideMerge(FunctionImplementationResolver.layerTest({ functions })),
|
|
94
88
|
Layer.provideMerge(
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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),
|
|
89
|
+
RemoteFunctionExecutionService.fromClient(
|
|
90
|
+
client,
|
|
91
|
+
// If agent is not enabled do not provide spaceId because space context will be unavailable on EDGE.
|
|
92
|
+
client.config.get('runtime.client.edgeFeatures.agents') ? spaceId : undefined,
|
|
108
93
|
),
|
|
109
94
|
),
|
|
95
|
+
Layer.provideMerge(serviceLayer),
|
|
96
|
+
Layer.provideMerge(CredentialsService.layerFromDatabase()),
|
|
97
|
+
Layer.provideMerge(space ? DatabaseService.layer(space.db) : DatabaseService.notAvailable),
|
|
98
|
+
Layer.provideMerge(space ? QueueService.layer(space.queues) : QueueService.notAvailable),
|
|
110
99
|
),
|
|
111
100
|
),
|
|
112
101
|
),
|
|
@@ -125,12 +114,14 @@ const InvocationTracerLive = Layer.unwrapEffect(
|
|
|
125
114
|
Effect.gen(function* () {
|
|
126
115
|
const {
|
|
127
116
|
objects: [properties],
|
|
128
|
-
} = yield* DatabaseService.runQuery(Query.type(
|
|
117
|
+
} = yield* DatabaseService.runQuery(Query.type(SpaceProperties));
|
|
129
118
|
invariant(properties);
|
|
130
|
-
|
|
119
|
+
// TODO(burdon): Check ref target has loaded?
|
|
120
|
+
if (!properties.invocationTraceQueue || !properties.invocationTraceQueue.target) {
|
|
131
121
|
const queue = yield* QueueService.createQueue({ subspaceTag: 'trace' });
|
|
132
122
|
properties.invocationTraceQueue = Ref.fromDXN(queue.dxn);
|
|
133
123
|
}
|
|
124
|
+
|
|
134
125
|
const queue = properties.invocationTraceQueue.target;
|
|
135
126
|
invariant(queue);
|
|
136
127
|
return InvocationTracer.layerLive({ invocationTraceQueue: queue });
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
createIntent,
|
|
11
11
|
createResolver,
|
|
12
12
|
} from '@dxos/app-framework';
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
13
|
+
import { Ref } from '@dxos/echo';
|
|
14
|
+
import { Function, Script, Trigger } 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';
|
|
@@ -24,17 +24,17 @@ export default (context: PluginContext) =>
|
|
|
24
24
|
createResolver({
|
|
25
25
|
intent: AutomationAction.CreateTriggerFromTemplate,
|
|
26
26
|
resolve: async ({ space, template, enabled = false, scriptName, input }) => {
|
|
27
|
-
const trigger =
|
|
27
|
+
const trigger = Trigger.make({ enabled, input });
|
|
28
28
|
|
|
29
29
|
// TODO(wittjosiah): Factor out function lookup by script name?
|
|
30
30
|
if (scriptName) {
|
|
31
31
|
const {
|
|
32
32
|
objects: [script],
|
|
33
|
-
} = await space.db.query(Filter.type(
|
|
33
|
+
} = await space.db.query(Filter.type(Script.Script, { name: scriptName })).run();
|
|
34
34
|
if (script) {
|
|
35
35
|
const {
|
|
36
36
|
objects: [fn],
|
|
37
|
-
} = await space.db.query(Filter.type(
|
|
37
|
+
} = await space.db.query(Filter.type(Function.Function, { source: Ref.make(script) })).run();
|
|
38
38
|
if (fn) {
|
|
39
39
|
trigger.function = Ref.make(fn);
|
|
40
40
|
}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { Capabilities, contributes, createSurface
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { useLayout } from '@dxos/app-framework/react';
|
|
8
9
|
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { getSpace, parseId, useSpace } from '@dxos/react-client/echo';
|
|
10
11
|
|
|
@@ -5,8 +5,7 @@
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
9
|
-
import { FunctionTrigger, FunctionType } from '@dxos/functions';
|
|
8
|
+
import { Function, Trigger } from '@dxos/functions';
|
|
10
9
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
11
10
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
12
11
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
@@ -21,7 +20,7 @@ const DefaultStory = () => {
|
|
|
21
20
|
const space = spaces[1];
|
|
22
21
|
|
|
23
22
|
return (
|
|
24
|
-
<div className='
|
|
23
|
+
<div className='is-96'>
|
|
25
24
|
<AutomationPanel space={space} />
|
|
26
25
|
</div>
|
|
27
26
|
);
|
|
@@ -36,10 +35,10 @@ const meta = {
|
|
|
36
35
|
withClientProvider({
|
|
37
36
|
createIdentity: true,
|
|
38
37
|
createSpace: true,
|
|
39
|
-
types: [
|
|
38
|
+
types: [Function.Function, Trigger.Trigger],
|
|
40
39
|
onCreateSpace: ({ space }) => {
|
|
41
40
|
for (const fn of functions) {
|
|
42
|
-
space.db.add(
|
|
41
|
+
space.db.add(Function.make(fn));
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
}),
|
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import * as Array from 'effect/Array';
|
|
6
|
-
import * as
|
|
6
|
+
import * as EFn from 'effect/Function';
|
|
7
7
|
import * as Match from 'effect/Match';
|
|
8
8
|
import * as Schema from 'effect/Schema';
|
|
9
9
|
import React, { useMemo, useState } from 'react';
|
|
10
10
|
|
|
11
|
-
import { Filter, Obj } from '@dxos/echo';
|
|
12
|
-
import {
|
|
11
|
+
import { Filter, Obj, Tag } from '@dxos/echo';
|
|
12
|
+
import { Function, Script, Trigger } from '@dxos/functions';
|
|
13
|
+
import { useTypeOptions } from '@dxos/plugin-space';
|
|
13
14
|
import { type Client, useClient } from '@dxos/react-client';
|
|
14
15
|
import { type Space, getSpace, useQuery } from '@dxos/react-client/echo';
|
|
15
16
|
import { Clipboard, IconButton, Input, Separator, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
16
17
|
import { ControlItem, controlItemClasses } from '@dxos/react-ui-form';
|
|
17
18
|
import { List } from '@dxos/react-ui-list';
|
|
18
19
|
import { ghostHover, mx } from '@dxos/react-ui-theme';
|
|
19
|
-
import {
|
|
20
|
+
import { Project } from '@dxos/types';
|
|
21
|
+
import { isNonNullable } from '@dxos/util';
|
|
20
22
|
|
|
21
23
|
import { meta } from '../../meta';
|
|
22
24
|
import { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';
|
|
@@ -26,7 +28,7 @@ const grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';
|
|
|
26
28
|
export type AutomationPanelProps = ThemedClassName<{
|
|
27
29
|
space: Space;
|
|
28
30
|
object?: Obj.Any;
|
|
29
|
-
initialTrigger?:
|
|
31
|
+
initialTrigger?: Trigger.Trigger;
|
|
30
32
|
onDone?: () => void;
|
|
31
33
|
}>;
|
|
32
34
|
|
|
@@ -34,26 +36,35 @@ export type AutomationPanelProps = ThemedClassName<{
|
|
|
34
36
|
export const AutomationPanel = ({ classNames, space, object, initialTrigger, onDone }: AutomationPanelProps) => {
|
|
35
37
|
const { t } = useTranslation(meta.id);
|
|
36
38
|
const client = useClient();
|
|
37
|
-
const functions = useQuery(space, Filter.type(
|
|
38
|
-
const triggers = useQuery(space, Filter.type(
|
|
39
|
+
const functions = useQuery(space, Filter.type(Function.Function));
|
|
40
|
+
const triggers = useQuery(space, Filter.type(Trigger.Trigger));
|
|
39
41
|
const filteredTriggers = useMemo(() => {
|
|
40
42
|
return object ? triggers.filter(triggerMatch(object)) : triggers;
|
|
41
43
|
}, [object, triggers]);
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const tags = useQuery(space, Filter.type(Tag.Tag));
|
|
45
|
+
const types = useTypeOptions({
|
|
46
|
+
space,
|
|
47
|
+
annotation: {
|
|
48
|
+
location: ['database', 'runtime'],
|
|
49
|
+
kind: ['user'],
|
|
50
|
+
registered: ['registered'],
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
const [trigger, setTrigger] = useState<Trigger.Trigger | undefined>(initialTrigger);
|
|
55
|
+
const [selected, setSelected] = useState<Trigger.Trigger>();
|
|
56
|
+
|
|
57
|
+
const handleSelect = (trigger: Trigger.Trigger) => {
|
|
47
58
|
setTrigger(trigger);
|
|
48
59
|
setSelected(trigger);
|
|
49
60
|
};
|
|
50
61
|
|
|
51
62
|
const handleAdd = () => {
|
|
52
|
-
setTrigger(
|
|
63
|
+
setTrigger(Trigger.make({}));
|
|
53
64
|
setSelected(undefined);
|
|
54
65
|
};
|
|
55
66
|
|
|
56
|
-
const handleDelete = (trigger:
|
|
67
|
+
const handleDelete = (trigger: Trigger.Trigger) => {
|
|
57
68
|
space.db.remove(trigger);
|
|
58
69
|
setTrigger(undefined);
|
|
59
70
|
setSelected(undefined);
|
|
@@ -63,7 +74,7 @@ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onD
|
|
|
63
74
|
if (selected) {
|
|
64
75
|
Object.assign(selected, trigger);
|
|
65
76
|
} else {
|
|
66
|
-
space.db.add(
|
|
77
|
+
space.db.add(Trigger.make(trigger));
|
|
67
78
|
}
|
|
68
79
|
|
|
69
80
|
setTrigger(undefined);
|
|
@@ -83,6 +94,8 @@ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onD
|
|
|
83
94
|
space={space}
|
|
84
95
|
trigger={trigger}
|
|
85
96
|
readonlySpec={Boolean(object)}
|
|
97
|
+
tags={tags}
|
|
98
|
+
types={types}
|
|
86
99
|
onSave={handleSave}
|
|
87
100
|
onCancel={handleCancel}
|
|
88
101
|
/>
|
|
@@ -93,20 +106,20 @@ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onD
|
|
|
93
106
|
return (
|
|
94
107
|
<div className={mx(controlItemClasses, classNames)}>
|
|
95
108
|
{filteredTriggers.length > 0 && (
|
|
96
|
-
<List.Root<
|
|
109
|
+
<List.Root<Trigger.Trigger>
|
|
97
110
|
items={filteredTriggers}
|
|
98
|
-
isItem={Schema.is(
|
|
111
|
+
isItem={Schema.is(Trigger.Trigger)}
|
|
99
112
|
getId={(field) => field.id}
|
|
100
113
|
>
|
|
101
114
|
{({ items: filteredTriggers }) => (
|
|
102
|
-
<div role='list' className='flex flex-col
|
|
115
|
+
<div role='list' className='flex flex-col is-full'>
|
|
103
116
|
{filteredTriggers?.map((trigger) => {
|
|
104
117
|
const copyAction = getCopyAction(client, trigger);
|
|
105
118
|
return (
|
|
106
|
-
<List.Item<
|
|
119
|
+
<List.Item<Trigger.Trigger>
|
|
107
120
|
key={trigger.id}
|
|
108
121
|
item={trigger}
|
|
109
|
-
classNames={mx(grid, ghostHover, 'items-center', '
|
|
122
|
+
classNames={mx(grid, ghostHover, 'items-center', 'pli-2')}
|
|
110
123
|
>
|
|
111
124
|
<Input.Root>
|
|
112
125
|
<Input.Switch
|
|
@@ -117,7 +130,7 @@ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onD
|
|
|
117
130
|
|
|
118
131
|
<div className={'flex'}>
|
|
119
132
|
<List.ItemTitle
|
|
120
|
-
classNames='
|
|
133
|
+
classNames='pli-1 cursor-pointer is-0 shrink truncate'
|
|
121
134
|
onClick={() => handleSelect(trigger)}
|
|
122
135
|
>
|
|
123
136
|
{getFunctionName(functions, trigger) ?? '∅'}
|
|
@@ -146,7 +159,7 @@ export const AutomationPanel = ({ classNames, space, object, initialTrigger, onD
|
|
|
146
159
|
);
|
|
147
160
|
};
|
|
148
161
|
|
|
149
|
-
const getCopyAction = (client: Client, trigger:
|
|
162
|
+
const getCopyAction = (client: Client, trigger: Trigger.Trigger | undefined) => {
|
|
150
163
|
if (trigger?.spec?.kind === 'email') {
|
|
151
164
|
return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };
|
|
152
165
|
}
|
|
@@ -158,7 +171,7 @@ const getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) =>
|
|
|
158
171
|
return undefined;
|
|
159
172
|
};
|
|
160
173
|
|
|
161
|
-
const getWebhookUrl = (client: Client, trigger:
|
|
174
|
+
const getWebhookUrl = (client: Client, trigger: Trigger.Trigger) => {
|
|
162
175
|
const spaceId = getSpace(trigger)!.id;
|
|
163
176
|
const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);
|
|
164
177
|
const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');
|
|
@@ -166,7 +179,7 @@ const getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {
|
|
|
166
179
|
return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();
|
|
167
180
|
};
|
|
168
181
|
|
|
169
|
-
const getFunctionName = (functions:
|
|
182
|
+
const getFunctionName = (functions: Function.Function[], trigger: Trigger.Trigger) => {
|
|
170
183
|
// TODO(wittjosiah): Truncation should be done in the UI.
|
|
171
184
|
// Warning that the List component is currently a can of worms.
|
|
172
185
|
const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;
|
|
@@ -174,25 +187,25 @@ const getFunctionName = (functions: FunctionType[], trigger: FunctionTrigger) =>
|
|
|
174
187
|
return functionObject?.name ?? shortId;
|
|
175
188
|
};
|
|
176
189
|
|
|
177
|
-
const scriptMatch = (script:
|
|
190
|
+
const scriptMatch = (script: Script.Script) => (trigger: Trigger.Trigger) => {
|
|
178
191
|
const fn = trigger.function?.target;
|
|
179
|
-
if (!Obj.instanceOf(
|
|
192
|
+
if (!Obj.instanceOf(Function.Function, fn)) {
|
|
180
193
|
return false;
|
|
181
194
|
}
|
|
182
195
|
|
|
183
196
|
return fn.source?.target === script;
|
|
184
197
|
};
|
|
185
198
|
|
|
186
|
-
const projectMatch = (project:
|
|
187
|
-
const viewQueries =
|
|
188
|
-
project.
|
|
189
|
-
Array.map((
|
|
190
|
-
Array.filter(
|
|
199
|
+
const projectMatch = (project: Project.Project) => {
|
|
200
|
+
const viewQueries = EFn.pipe(
|
|
201
|
+
project.columns,
|
|
202
|
+
Array.map((column) => column.view.target),
|
|
203
|
+
Array.filter(isNonNullable),
|
|
191
204
|
Array.map((view) => Obj.getSnapshot(view).query.ast),
|
|
192
205
|
Array.map((ast) => JSON.stringify(ast)),
|
|
193
206
|
);
|
|
194
207
|
|
|
195
|
-
return (trigger:
|
|
208
|
+
return (trigger: Trigger.Trigger) => {
|
|
196
209
|
const spec = Obj.getSnapshot(trigger).spec;
|
|
197
210
|
if (spec?.kind !== 'subscription') {
|
|
198
211
|
return false;
|
|
@@ -204,13 +217,13 @@ const projectMatch = (project: DataType.Project) => {
|
|
|
204
217
|
};
|
|
205
218
|
|
|
206
219
|
const triggerMatch = Match.type<Obj.Any>().pipe(
|
|
207
|
-
Match.withReturnType<(trigger:
|
|
220
|
+
Match.withReturnType<(trigger: Trigger.Trigger) => boolean>(),
|
|
208
221
|
Match.when(
|
|
209
|
-
(obj) => Obj.instanceOf(
|
|
222
|
+
(obj) => Obj.instanceOf(Script.Script, obj),
|
|
210
223
|
(obj) => scriptMatch(obj),
|
|
211
224
|
),
|
|
212
225
|
Match.when(
|
|
213
|
-
(obj) => Obj.instanceOf(
|
|
226
|
+
(obj) => Obj.instanceOf(Project.Project, obj),
|
|
214
227
|
(obj) => projectMatch(obj),
|
|
215
228
|
),
|
|
216
229
|
Match.orElse((_obj) => () => true),
|
|
@@ -11,6 +11,7 @@ import { ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
|
11
11
|
import { meta } from '../meta';
|
|
12
12
|
|
|
13
13
|
import { FunctionsPanel } from './FunctionsPanel';
|
|
14
|
+
import { FunctionsRegistry } from './FunctionsRegistry';
|
|
14
15
|
|
|
15
16
|
export const FunctionsContainer = ({ space }: { space: Space }) => {
|
|
16
17
|
const { t } = useTranslation(meta.id);
|
|
@@ -22,6 +23,12 @@ export const FunctionsContainer = ({ space }: { space: Space }) => {
|
|
|
22
23
|
>
|
|
23
24
|
<FunctionsPanel space={space} />
|
|
24
25
|
</ControlSection>
|
|
26
|
+
<ControlSection
|
|
27
|
+
title={t('functions registry verbose label', { ns: meta.id })}
|
|
28
|
+
description={t('functions registry description', { ns: meta.id })}
|
|
29
|
+
>
|
|
30
|
+
<FunctionsRegistry space={space} />
|
|
31
|
+
</ControlSection>
|
|
25
32
|
</ControlPage>
|
|
26
33
|
);
|
|
27
34
|
};
|