@dxos/plugin-automation 0.8.4-main.67995b8 → 0.8.4-main.ae835ea
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-LBXJDM6Z.mjs +11 -0
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs +68 -0
- package/dist/lib/browser/AutomationSettings-IIEI5D2K.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsContainer-IOB333TX.mjs → FunctionsContainer-IZTCGNJZ.mjs} +9 -12
- package/dist/lib/browser/FunctionsContainer-IZTCGNJZ.mjs.map +7 -0
- package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs → FunctionsPanel-HFCK3JRB.mjs} +3 -3
- package/dist/lib/browser/{app-graph-builder-ZTAUTFI4.mjs → app-graph-builder-7VKA2GS3.mjs} +12 -11
- package/dist/lib/browser/app-graph-builder-7VKA2GS3.mjs.map +7 -0
- package/dist/lib/browser/chunk-CVYJM6OO.mjs +66 -0
- package/dist/lib/browser/chunk-CVYJM6OO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LYJVTIVD.mjs → chunk-FHSN7G4H.mjs} +25 -12
- package/dist/lib/browser/chunk-FHSN7G4H.mjs.map +7 -0
- package/dist/lib/browser/chunk-GCGHLQM2.mjs +15 -0
- package/dist/lib/browser/chunk-GCGHLQM2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-FSJZXTS2.mjs → chunk-JW7XSPYW.mjs} +69 -32
- package/dist/lib/browser/chunk-JW7XSPYW.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ERTIGJYE.mjs → chunk-K5YNWESC.mjs} +68 -32
- package/dist/lib/browser/chunk-K5YNWESC.mjs.map +7 -0
- package/dist/lib/browser/chunk-LZQFZO3B.mjs +17 -0
- package/dist/lib/browser/chunk-LZQFZO3B.mjs.map +7 -0
- package/dist/lib/browser/chunk-XXZNGORC.mjs +14 -0
- package/dist/lib/browser/chunk-XXZNGORC.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HN7OHFCB.mjs → chunk-YBPJCY3F.mjs} +3 -3
- package/dist/lib/browser/chunk-YBPJCY3F.mjs.map +7 -0
- package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs +114 -0
- package/dist/lib/browser/compute-runtime-PFYRMGN2.mjs.map +7 -0
- package/dist/lib/browser/hooks/index.mjs +11 -0
- package/dist/lib/browser/index.mjs +44 -19
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-U3ZAQEFW.mjs → intent-resolver-5HR7M7T6.mjs} +15 -14
- 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-4DFSM7OX.mjs → react-surface-WPMY3EX2.mjs} +18 -19
- package/dist/lib/browser/react-surface-WPMY3EX2.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{AutomationPanel-YYUMSK2W.mjs → AutomationPanel-NVEIUIZP.mjs} +4 -4
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs +69 -0
- package/dist/lib/node-esm/AutomationSettings-VIIEPI2P.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsContainer-DJWB6WFH.mjs → FunctionsContainer-KKRCIXGB.mjs} +9 -12
- package/dist/lib/node-esm/FunctionsContainer-KKRCIXGB.mjs.map +7 -0
- package/dist/lib/node-esm/{FunctionsPanel-KGIOZSPZ.mjs → FunctionsPanel-74ELGR7P.mjs} +3 -3
- package/dist/lib/node-esm/FunctionsPanel-74ELGR7P.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-3FP63ZSG.mjs → app-graph-builder-RTOFJNFV.mjs} +12 -11
- package/dist/lib/node-esm/app-graph-builder-RTOFJNFV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs +67 -0
- package/dist/lib/node-esm/chunk-3BJ6BR3E.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs +19 -0
- package/dist/lib/node-esm/chunk-CEVIVRTY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OEZNHUL2.mjs → chunk-ECJKIUBO.mjs} +3 -3
- package/dist/lib/node-esm/chunk-ECJKIUBO.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-ZGPUV5VS.mjs → chunk-JOCKHLFT.mjs} +25 -12
- package/dist/lib/node-esm/chunk-JOCKHLFT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs +16 -0
- package/dist/lib/node-esm/chunk-MRYKW5TM.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-U5Q2NI7H.mjs +16 -0
- package/dist/lib/node-esm/chunk-U5Q2NI7H.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AZH66CED.mjs → chunk-W76WUTZY.mjs} +69 -32
- package/dist/lib/node-esm/chunk-W76WUTZY.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HIMYPGHF.mjs → chunk-Y7PJXFCJ.mjs} +68 -32
- package/dist/lib/node-esm/chunk-Y7PJXFCJ.mjs.map +7 -0
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs +115 -0
- package/dist/lib/node-esm/compute-runtime-IXCSD3W7.mjs.map +7 -0
- package/dist/lib/node-esm/hooks/index.mjs +12 -0
- package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +44 -19
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-3QWXEBPX.mjs → intent-resolver-KDRYB5BC.mjs} +15 -14
- 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-3PNW7NDW.mjs → react-surface-Y2BBJV2I.mjs} +18 -19
- package/dist/lib/node-esm/react-surface-Y2BBJV2I.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 +46 -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 +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 +7 -5
- 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 +3 -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 +3 -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 +62 -41
- package/src/AutomationPlugin.tsx +37 -31
- package/src/capabilities/app-graph-builder.ts +12 -11
- 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 +11 -11
- package/src/capabilities/react-surface.tsx +13 -14
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +15 -16
- package/src/components/AutomationPanel/AutomationPanel.tsx +101 -50
- package/src/components/AutomationSettings.tsx +30 -0
- package/src/components/FunctionsContainer.tsx +11 -13
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +26 -14
- package/src/components/TriggerEditor/FunctionInputEditor.tsx +10 -4
- package/src/components/TriggerEditor/SpecSelector.tsx +23 -17
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +68 -26
- package/src/components/TriggerEditor/TriggerEditor.tsx +45 -25
- 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 +32 -0
- package/src/hooks/useTriggerRuntimeControls.ts +52 -0
- package/src/index.ts +3 -0
- package/src/meta.ts +6 -5
- package/src/testing/test-functions.ts +1 -1
- package/src/translations.ts +5 -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 +0 -15
- 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 +0 -17
- 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-LBXJDM6Z.mjs.map} +0 -0
- /package/dist/lib/browser/{FunctionsPanel-56ZKRVM5.mjs.map → FunctionsPanel-HFCK3JRB.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-NVEIUIZP.mjs.map} +0 -0
|
@@ -2,32 +2,55 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import React, { useState } from 'react';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
import { Obj } from '@dxos/echo';
|
|
11
|
-
import { FunctionType, FunctionTrigger, TriggerKind } from '@dxos/functions';
|
|
8
|
+
import { Filter, Obj, Ref, Tag, Type } from '@dxos/echo';
|
|
9
|
+
import { Function, Trigger } from '@dxos/functions';
|
|
10
|
+
import { invariant } from '@dxos/invariant';
|
|
12
11
|
import { faker } from '@dxos/random';
|
|
13
|
-
import {
|
|
14
|
-
import { ContactType, withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
-
import {
|
|
12
|
+
import { useQuery } from '@dxos/react-client/echo';
|
|
13
|
+
import { ContactType, useClientProvider, withClientProvider } from '@dxos/react-client/testing';
|
|
14
|
+
import { useAsyncEffect } from '@dxos/react-ui';
|
|
15
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
16
|
+
import { DataType } from '@dxos/schema';
|
|
16
17
|
|
|
17
|
-
import { TriggerEditor } from './TriggerEditor';
|
|
18
18
|
import { functions } from '../../testing';
|
|
19
19
|
import { translations } from '../../translations';
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
import { TriggerEditor, type TriggerEditorProps } from './TriggerEditor';
|
|
22
|
+
|
|
23
|
+
const types = [
|
|
24
|
+
// TODO(burdon): Get label from annotation.
|
|
25
|
+
{ value: Type.getTypename(DataType.Organization), label: 'Organization' },
|
|
26
|
+
{ value: Type.getTypename(DataType.Person), label: 'Person' },
|
|
27
|
+
{ value: Type.getTypename(DataType.Project), label: 'Project' },
|
|
28
|
+
{ value: Type.getTypename(DataType.Employer), label: 'Employer' },
|
|
29
|
+
];
|
|
30
|
+
|
|
31
|
+
const DefaultStory = (props: Partial<TriggerEditorProps>) => {
|
|
32
|
+
const { space } = useClientProvider();
|
|
33
|
+
const [trigger, setTrigger] = useState<Trigger.Trigger>();
|
|
34
|
+
const tags = useQuery(space, Filter.type(Tag.Tag));
|
|
35
|
+
|
|
36
|
+
useAsyncEffect(async () => {
|
|
26
37
|
if (!space) {
|
|
27
38
|
return;
|
|
28
39
|
}
|
|
29
40
|
|
|
30
|
-
const
|
|
41
|
+
const result = await space.db.query(Filter.type(Function.Function)).run();
|
|
42
|
+
const fn = result.objects.find((fn) => fn.name === 'example.com/function/forex');
|
|
43
|
+
invariant(fn);
|
|
44
|
+
const trigger = space.db.add(
|
|
45
|
+
Trigger.make({
|
|
46
|
+
function: Ref.make(fn),
|
|
47
|
+
spec: { kind: 'webhook' },
|
|
48
|
+
input: {
|
|
49
|
+
from: 'USD',
|
|
50
|
+
to: 'JPY',
|
|
51
|
+
},
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
31
54
|
setTrigger(trigger);
|
|
32
55
|
}, [space]);
|
|
33
56
|
|
|
@@ -37,23 +60,36 @@ const DefaultStory = () => {
|
|
|
37
60
|
|
|
38
61
|
return (
|
|
39
62
|
<div role='none' className='w-[32rem] bs-fit border border-separator rounded-sm'>
|
|
40
|
-
<TriggerEditor
|
|
63
|
+
<TriggerEditor
|
|
64
|
+
space={space}
|
|
65
|
+
trigger={trigger}
|
|
66
|
+
types={types}
|
|
67
|
+
tags={tags}
|
|
68
|
+
onSave={(values) => console.log('on save', values)}
|
|
69
|
+
{...props}
|
|
70
|
+
/>
|
|
41
71
|
</div>
|
|
42
72
|
);
|
|
43
73
|
};
|
|
44
74
|
|
|
45
|
-
const meta
|
|
75
|
+
const meta = {
|
|
46
76
|
title: 'plugins/plugin-automation/TriggerEditor',
|
|
47
|
-
component: TriggerEditor,
|
|
77
|
+
component: TriggerEditor as any,
|
|
48
78
|
render: DefaultStory,
|
|
49
79
|
decorators: [
|
|
80
|
+
withTheme,
|
|
81
|
+
withLayout({ container: 'column' }),
|
|
50
82
|
withClientProvider({
|
|
51
83
|
createIdentity: true,
|
|
52
84
|
createSpace: true,
|
|
53
|
-
types: [
|
|
54
|
-
|
|
85
|
+
types: [Tag.Tag, Function.Function, Trigger.Trigger, ContactType],
|
|
86
|
+
onCreateSpace: ({ space }) => {
|
|
87
|
+
space.db.add(Tag.make({ label: 'Important' }));
|
|
88
|
+
space.db.add(Tag.make({ label: 'Investor' }));
|
|
89
|
+
space.db.add(Tag.make({ label: 'New' }));
|
|
90
|
+
|
|
55
91
|
for (const fn of functions) {
|
|
56
|
-
space.db.add(
|
|
92
|
+
space.db.add(Function.make(fn));
|
|
57
93
|
}
|
|
58
94
|
Array.from({ length: 10 }).map(() => {
|
|
59
95
|
return space.db.add(
|
|
@@ -65,14 +101,20 @@ const meta: Meta = {
|
|
|
65
101
|
});
|
|
66
102
|
},
|
|
67
103
|
}),
|
|
68
|
-
withLayout({ fullscreen: true, classNames: 'flex justify-center m-2' }),
|
|
69
|
-
withTheme,
|
|
70
104
|
],
|
|
71
105
|
parameters: {
|
|
72
106
|
translations,
|
|
73
107
|
},
|
|
74
|
-
}
|
|
108
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
75
109
|
|
|
76
110
|
export default meta;
|
|
77
111
|
|
|
78
|
-
|
|
112
|
+
type Story = StoryObj<typeof meta>;
|
|
113
|
+
|
|
114
|
+
export const Default: Story = {};
|
|
115
|
+
|
|
116
|
+
export const ReadonlySpec: Story = {
|
|
117
|
+
args: {
|
|
118
|
+
readonlySpec: true,
|
|
119
|
+
},
|
|
120
|
+
};
|
|
@@ -5,40 +5,38 @@
|
|
|
5
5
|
import React, { useCallback, useMemo } from 'react';
|
|
6
6
|
|
|
7
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
8
|
-
import { Type } from '@dxos/echo';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ScriptType,
|
|
15
|
-
} from '@dxos/functions';
|
|
16
|
-
import { Filter, Ref, useQuery, type Space } from '@dxos/react-client/echo';
|
|
17
|
-
import { type CustomInputMap, Form, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
8
|
+
import { type Query, Type } from '@dxos/echo';
|
|
9
|
+
import { Function, Script, Trigger } from '@dxos/functions';
|
|
10
|
+
import { Filter, Ref, type Space, useQuery } from '@dxos/react-client/echo';
|
|
11
|
+
import { Input } from '@dxos/react-ui';
|
|
12
|
+
import { QueryForm, type QueryFormProps } from '@dxos/react-ui-components';
|
|
13
|
+
import { type CustomInputMap, Form, InputHeader, SelectInput, useRefQueryLookupHandler } from '@dxos/react-ui-form';
|
|
18
14
|
|
|
19
15
|
import { FunctionInputEditor, type FunctionInputEditorProps } from './FunctionInputEditor';
|
|
20
16
|
import { SpecSelector } from './SpecSelector';
|
|
21
17
|
|
|
22
18
|
export type TriggerEditorProps = {
|
|
23
19
|
space: Space;
|
|
24
|
-
trigger:
|
|
25
|
-
|
|
20
|
+
trigger: Trigger.Trigger;
|
|
21
|
+
// TODO(wittjosiah): This needs to apply to whole spec but currently only applies to spec.kind & spec.query.
|
|
22
|
+
readonlySpec?: boolean;
|
|
23
|
+
onSave?: (trigger: Omit<Trigger.Trigger, 'id'>) => void;
|
|
26
24
|
onCancel?: () => void;
|
|
27
|
-
}
|
|
25
|
+
} & Pick<QueryFormProps, 'types' | 'tags'>;
|
|
28
26
|
|
|
29
|
-
export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEditorProps) => {
|
|
30
|
-
const handleSave = (values:
|
|
27
|
+
export const TriggerEditor = ({ space, trigger, readonlySpec, types, tags, onSave, onCancel }: TriggerEditorProps) => {
|
|
28
|
+
const handleSave = ({ id: _, ...values }: Trigger.Trigger) => {
|
|
31
29
|
onSave?.(values);
|
|
32
30
|
};
|
|
33
31
|
|
|
34
32
|
const handleRefQueryLookup = useRefQueryLookupHandler({ space });
|
|
35
|
-
const Custom = useCustomInputs(space, handleRefQueryLookup);
|
|
33
|
+
const Custom = useCustomInputs({ space, readonlySpec, types, tags, onQueryRefOptions: handleRefQueryLookup });
|
|
36
34
|
|
|
37
35
|
return (
|
|
38
36
|
<Form
|
|
39
37
|
outerSpacing={false}
|
|
40
38
|
Custom={Custom}
|
|
41
|
-
schema={
|
|
39
|
+
schema={Trigger.Trigger}
|
|
42
40
|
values={trigger}
|
|
43
41
|
onSave={handleSave}
|
|
44
42
|
onCancel={onCancel}
|
|
@@ -47,15 +45,21 @@ export const TriggerEditor = ({ space, trigger, onSave, onCancel }: TriggerEdito
|
|
|
47
45
|
);
|
|
48
46
|
};
|
|
49
47
|
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
type UseCustomInputsProps = {
|
|
49
|
+
space: Space;
|
|
50
|
+
readonlySpec?: boolean;
|
|
51
|
+
onQueryRefOptions: FunctionInputEditorProps['onQueryRefOptions'];
|
|
52
|
+
} & Pick<QueryFormProps, 'types' | 'tags'>;
|
|
53
|
+
|
|
54
|
+
const useCustomInputs = ({ space, readonlySpec, types, tags, onQueryRefOptions }: UseCustomInputsProps) => {
|
|
55
|
+
const functions = useQuery(space, Filter.type(Function.Function));
|
|
52
56
|
const workflows = useQuery(space, Filter.type(ComputeGraph));
|
|
53
|
-
const scripts = useQuery(space, Filter.type(
|
|
57
|
+
const scripts = useQuery(space, Filter.type(Script.Script));
|
|
54
58
|
|
|
55
59
|
return useMemo(
|
|
56
60
|
(): CustomInputMap => ({
|
|
57
61
|
// Function selector.
|
|
58
|
-
['function' satisfies keyof
|
|
62
|
+
['function' satisfies keyof Trigger.Trigger]: (props) => {
|
|
59
63
|
const getValue = useCallback(() => {
|
|
60
64
|
const formValue = props.getValue();
|
|
61
65
|
if (Ref.isRef(formValue)) {
|
|
@@ -86,14 +90,30 @@ const useCustomInputs = (space: Space, onQueryRefOptions: FunctionInputEditorPro
|
|
|
86
90
|
},
|
|
87
91
|
|
|
88
92
|
// Spec selector.
|
|
89
|
-
['spec.kind' as const]: SpecSelector
|
|
93
|
+
['spec.kind' as const]: (props) => <SpecSelector {...props} readonly={readonlySpec ? 'disabled-input' : false} />,
|
|
94
|
+
|
|
95
|
+
// TODO(wittjosiah): Copied from ViewEditor.
|
|
96
|
+
// Query input editor.
|
|
97
|
+
['spec.query' as const]: (props) => {
|
|
98
|
+
const handleChange = useCallback(
|
|
99
|
+
(query: Query.Any) => props.onValueChange('object', { ast: query.ast }),
|
|
100
|
+
[props.onValueChange],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<Input.Root>
|
|
105
|
+
<InputHeader label={props.label} />
|
|
106
|
+
<QueryForm initialQuery={(props.getValue() as any).ast} types={types} tags={tags} onChange={handleChange} />
|
|
107
|
+
</Input.Root>
|
|
108
|
+
);
|
|
109
|
+
},
|
|
90
110
|
|
|
91
111
|
// Function input editor.
|
|
92
112
|
['input' as const]: (props) => (
|
|
93
113
|
<FunctionInputEditor {...props} functions={functions} onQueryRefOptions={onQueryRefOptions} />
|
|
94
114
|
),
|
|
95
115
|
}),
|
|
96
|
-
[workflows, scripts, functions],
|
|
116
|
+
[workflows, scripts, functions, readonlySpec],
|
|
97
117
|
);
|
|
98
118
|
};
|
|
99
119
|
|
|
@@ -101,7 +121,7 @@ const getWorkflowOptions = (graphs: ComputeGraph[]) => {
|
|
|
101
121
|
return graphs.map((graph) => ({ label: `compute-${graph.id}`, value: `dxn:echo:@:${graph.id}` }));
|
|
102
122
|
};
|
|
103
123
|
|
|
104
|
-
const getFunctionOptions = (scripts:
|
|
105
|
-
const getLabel = (fn:
|
|
124
|
+
const getFunctionOptions = (scripts: Script.Script[], functions: Function.Function[]) => {
|
|
125
|
+
const getLabel = (fn: Function.Function) => scripts.find((s) => fn.source?.target?.id === s.id)?.name ?? fn.name;
|
|
106
126
|
return functions.map((fn) => ({ label: getLabel(fn), value: `dxn:echo:@:${fn.id}` }));
|
|
107
127
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type Space } from '@dxos/react-client/echo';
|
|
8
|
+
import { Input, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { ControlItemInput } from '@dxos/react-ui-form';
|
|
10
|
+
|
|
11
|
+
import { useTriggerRuntimeControls } from '../hooks';
|
|
12
|
+
import { meta } from '../meta';
|
|
13
|
+
|
|
14
|
+
export const TriggersSettings = ({ space }: { space: Space }) => {
|
|
15
|
+
const { triggers, isRunning, start, stop } = useTriggerRuntimeControls(space);
|
|
16
|
+
const { t } = useTranslation(meta.id);
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className='container-max-width grid grid-cols-1 md:grid-cols-[1fr_min-content]'>
|
|
20
|
+
<ControlItemInput title={t('runtime label')} description={t('runtime description')}>
|
|
21
|
+
<Input.Switch classNames='justify-self-end' checked={isRunning} onCheckedChange={isRunning ? stop : start} />
|
|
22
|
+
</ControlItemInput>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
};
|
package/src/components/index.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { lazy } from 'react';
|
|
|
6
6
|
|
|
7
7
|
export * from './TriggerEditor';
|
|
8
8
|
|
|
9
|
-
export const AutomationContainer = lazy(() => import('./AutomationContainer'));
|
|
10
9
|
export const AutomationPanel = lazy(() => import('./AutomationPanel'));
|
|
10
|
+
export const AutomationSettings = lazy(() => import('./AutomationSettings'));
|
|
11
11
|
export const FunctionsContainer = lazy(() => import('./FunctionsContainer'));
|
|
12
12
|
export const FunctionsPanel = lazy(() => import('./FunctionsPanel'));
|
package/src/events.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineEvent } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export namespace AutomationEvents {
|
|
10
|
+
export const ComputeRuntimeReady = defineEvent(`${meta.id}/event/compute-runtime-ready`);
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import type * as Effect from 'effect/Effect';
|
|
6
|
+
import { useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import { useCapability } from '@dxos/app-framework';
|
|
9
|
+
import type { Space } from '@dxos/react-client/echo';
|
|
10
|
+
|
|
11
|
+
import { AutomationCapabilities } from '../capabilities';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Create an effectful function that has access to compute services
|
|
15
|
+
*/
|
|
16
|
+
// TODO(burdon): Factor out (figure out cross-plugin capabilities dependencies).
|
|
17
|
+
export const useComputeRuntimeCallback = <T>(
|
|
18
|
+
space: Space | undefined,
|
|
19
|
+
fn: () => Effect.Effect<T, any, AutomationCapabilities.ComputeServices>,
|
|
20
|
+
deps?: React.DependencyList,
|
|
21
|
+
): (() => Promise<T>) => {
|
|
22
|
+
const computeRuntime = useCapability(AutomationCapabilities.ComputeRuntime);
|
|
23
|
+
const runtime = space !== undefined ? computeRuntime.getRuntime(space.id) : undefined;
|
|
24
|
+
|
|
25
|
+
return useCallback(() => {
|
|
26
|
+
if (!runtime) {
|
|
27
|
+
throw new TypeError('Space not provided to useComputeRuntimeCallback');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return runtime.runPromise(fn());
|
|
31
|
+
}, [runtime, ...(deps ?? [])]);
|
|
32
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Filter } from '@dxos/echo';
|
|
8
|
+
import { Trigger, TriggerDispatcher } from '@dxos/functions';
|
|
9
|
+
import { type Space, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { useAsyncState } from '@dxos/react-ui';
|
|
11
|
+
|
|
12
|
+
import { useComputeRuntimeCallback } from './useComputeRuntimeCallback';
|
|
13
|
+
|
|
14
|
+
interface TriggerRuntimeControls {
|
|
15
|
+
triggers: Trigger.Trigger[];
|
|
16
|
+
isRunning: boolean;
|
|
17
|
+
start: () => void;
|
|
18
|
+
stop: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const useTriggerRuntimeControls = (space: Space | undefined): TriggerRuntimeControls => {
|
|
22
|
+
const triggers = useQuery(space, Filter.type(Trigger.Trigger));
|
|
23
|
+
|
|
24
|
+
const [isRunningState, setIsRunningState] = useAsyncState(
|
|
25
|
+
useComputeRuntimeCallback(space, () => TriggerDispatcher.pipe(Effect.map((t) => t.running))),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const start = useComputeRuntimeCallback(
|
|
29
|
+
space,
|
|
30
|
+
Effect.fnUntraced(function* () {
|
|
31
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
32
|
+
yield* dispatcher.start();
|
|
33
|
+
setIsRunningState(true);
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
const stop = useComputeRuntimeCallback(
|
|
38
|
+
space,
|
|
39
|
+
Effect.fnUntraced(function* () {
|
|
40
|
+
const dispatcher = yield* TriggerDispatcher;
|
|
41
|
+
yield* dispatcher.stop();
|
|
42
|
+
setIsRunningState(false);
|
|
43
|
+
}),
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
return {
|
|
47
|
+
triggers,
|
|
48
|
+
isRunning: isRunningState ?? false,
|
|
49
|
+
start: () => void start(),
|
|
50
|
+
stop: () => void stop(),
|
|
51
|
+
};
|
|
52
|
+
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -3,14 +3,15 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
export const AUTOMATION_PLUGIN = 'dxos.org/plugin/automation';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
8
7
|
|
|
9
8
|
export const meta: PluginMeta = {
|
|
10
|
-
id:
|
|
9
|
+
id: 'dxos.org/plugin/automation',
|
|
11
10
|
name: 'Automation',
|
|
12
|
-
description:
|
|
13
|
-
|
|
11
|
+
description: trim`
|
|
12
|
+
Workflow automation engine that triggers custom actions based on object events and conditions.
|
|
13
|
+
Create automated pipelines that respond to changes and streamline repetitive tasks.
|
|
14
|
+
`,
|
|
14
15
|
icon: 'ph--robot--regular',
|
|
15
16
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-automation',
|
|
16
17
|
};
|
package/src/translations.ts
CHANGED
|
@@ -16,12 +16,17 @@ export const translations = [
|
|
|
16
16
|
'automation verbose label': 'Manage automations',
|
|
17
17
|
'automation description': 'You can manage all the triggers which automate your space here.',
|
|
18
18
|
|
|
19
|
+
'runtime label': 'Enable Local Runtime',
|
|
20
|
+
'runtime description':
|
|
21
|
+
'This will start a trigger dispatcher locally for this space to run triggers on your device while Composer is running.',
|
|
22
|
+
|
|
19
23
|
'functions panel label': 'Functions',
|
|
20
24
|
'functions verbose label': 'Manage deployed functions',
|
|
21
25
|
'functions description': 'You can manage all the functions deployed from your space on EDGE here.',
|
|
22
26
|
'function copy id': 'Copy Function ID',
|
|
23
27
|
'no functions found': 'No functions found',
|
|
24
28
|
'go to function source button label': 'Show function source',
|
|
29
|
+
'delete function button label': 'Delete function',
|
|
25
30
|
|
|
26
31
|
'trigger editor title': 'Configure Trigger',
|
|
27
32
|
'new trigger label': 'Add Trigger',
|
package/src/types/schema.ts
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationPanel
|
|
3
|
-
} from "./chunk-ERTIGJYE.mjs";
|
|
4
|
-
import "./chunk-FSJZXTS2.mjs";
|
|
5
|
-
import {
|
|
6
|
-
AUTOMATION_PLUGIN
|
|
7
|
-
} from "./chunk-GW5U2DGT.mjs";
|
|
8
|
-
|
|
9
|
-
// src/components/AutomationContainer.tsx
|
|
10
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
11
|
-
import React from "react";
|
|
12
|
-
import { useTranslation } from "@dxos/react-ui";
|
|
13
|
-
import { ControlSection, ControlPage } from "@dxos/react-ui-form";
|
|
14
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
15
|
-
var AutomationContainer = (props) => {
|
|
16
|
-
var _effect = _useSignals();
|
|
17
|
-
try {
|
|
18
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
19
|
-
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
20
|
-
classNames: "block overflow-y-auto"
|
|
21
|
-
}, /* @__PURE__ */ React.createElement(ControlPage, null, /* @__PURE__ */ React.createElement(ControlSection, {
|
|
22
|
-
title: t("automation verbose label", {
|
|
23
|
-
ns: AUTOMATION_PLUGIN
|
|
24
|
-
}),
|
|
25
|
-
description: t("automation description", {
|
|
26
|
-
ns: AUTOMATION_PLUGIN
|
|
27
|
-
})
|
|
28
|
-
}, /* @__PURE__ */ React.createElement(AutomationPanel, props))));
|
|
29
|
-
} finally {
|
|
30
|
-
_effect.f();
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var AutomationContainer_default = AutomationContainer;
|
|
34
|
-
export {
|
|
35
|
-
AutomationContainer,
|
|
36
|
-
AutomationContainer_default as default
|
|
37
|
-
};
|
|
38
|
-
//# sourceMappingURL=AutomationContainer-VZNV2ZQF.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlSection, ControlPage } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { AutomationPanel, type AutomationPanelProps } from './AutomationPanel';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport const AutomationContainer = (props: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <StackItem.Content classNames='block overflow-y-auto'>\n <ControlPage>\n <ControlSection\n title={t('automation verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('automation description', { ns: AUTOMATION_PLUGIN })}\n >\n <AutomationPanel {...props} />\n </ControlSection>\n </ControlPage>\n </StackItem.Content>\n );\n};\n\nexport default AutomationContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,WAAW;AAElB,SAASC,sBAAsB;AAC/B,SAASC,gBAAgBC,mBAAmB;AAC5C,SAASC,iBAAiB;AAKnB,IAAMC,sBAAsB,CAACC,UAAAA;;;AAClC,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,WACE,sBAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOR,EAAE,4BAA4B;QAAES,IAAIP;MAAkB,CAAA;MAC7DQ,aAAaV,EAAE,0BAA0B;QAAES,IAAIP;MAAkB,CAAA;OAEjE,sBAAA,cAACS,iBAAoBZ,KAAAA,CAAAA,CAAAA,CAAAA;;;;AAK/B;AAEA,IAAA,8BAAeD;",
|
|
6
|
-
"names": ["React", "useTranslation", "ControlSection", "ControlPage", "StackItem", "AutomationContainer", "props", "t", "useTranslation", "AUTOMATION_PLUGIN", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "AutomationPanel"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AutomationPanel,
|
|
3
|
-
AutomationPanel_default
|
|
4
|
-
} from "./chunk-ERTIGJYE.mjs";
|
|
5
|
-
import "./chunk-FSJZXTS2.mjs";
|
|
6
|
-
import "./chunk-GW5U2DGT.mjs";
|
|
7
|
-
export {
|
|
8
|
-
AutomationPanel,
|
|
9
|
-
AutomationPanel_default as default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=AutomationPanel-ZWA6GOFY.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/FunctionsContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type Space } from '@dxos/react-client/echo';\nimport { useTranslation } from '@dxos/react-ui';\nimport { ControlPage, ControlSection } from '@dxos/react-ui-form';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nimport { FunctionsPanel } from './FunctionsPanel';\nimport { AUTOMATION_PLUGIN } from '../meta';\n\nexport const FunctionsContainer = ({ space }: { space: Space }) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n return (\n <StackItem.Content classNames='block overflow-y-auto'>\n <ControlPage>\n <ControlSection\n title={t('functions verbose label', { ns: AUTOMATION_PLUGIN })}\n description={t('functions description', { ns: AUTOMATION_PLUGIN })}\n >\n <FunctionsPanel space={space} />\n </ControlSection>\n </ControlPage>\n </StackItem.Content>\n );\n};\n\nexport default FunctionsContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,sBAAsB;AAC/B,SAASC,aAAaC,sBAAsB;AAC5C,SAASC,iBAAiB;AAKnB,IAAMC,qBAAqB,CAAC,EAAEC,MAAK,MAAoB;;;AAC5D,UAAM,EAAEC,EAAC,IAAKC,eAAeC,iBAAAA;AAC7B,WACE,sBAAA,cAACC,UAAUC,SAAO;MAACC,YAAW;OAC5B,sBAAA,cAACC,aAAAA,MACC,sBAAA,cAACC,gBAAAA;MACCC,OAAOR,EAAE,2BAA2B;QAAES,IAAIP;MAAkB,CAAA;MAC5DQ,aAAaV,EAAE,yBAAyB;QAAES,IAAIP;MAAkB,CAAA;OAEhE,sBAAA,cAACS,gBAAAA;MAAeZ;;;;;AAK1B;AAEA,IAAA,6BAAeD;",
|
|
6
|
-
"names": ["React", "useTranslation", "ControlPage", "ControlSection", "StackItem", "FunctionsContainer", "space", "t", "useTranslation", "AUTOMATION_PLUGIN", "StackItem", "Content", "classNames", "ControlPage", "ControlSection", "title", "ns", "description", "FunctionsPanel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/app-graph-builder.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Rx } from '@effect-rx/rx-react';\nimport { Option, pipe } from 'effect';\n\nimport { Capabilities, contributes, type PluginContext } from '@dxos/app-framework';\nimport { Obj } from '@dxos/echo';\nimport { ScriptType } from '@dxos/functions';\nimport { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';\nimport { createExtension } from '@dxos/plugin-graph';\nimport { SPACE_PLUGIN } from '@dxos/plugin-space';\n\nimport { meta } from '../meta';\n\nexport default (context: PluginContext) =>\n contributes(Capabilities.AppGraphBuilder, [\n createExtension({\n id: `${meta.id}/space-settings-automation`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `automation-${node.id}`,\n type: `${meta.id}/space-settings-automation`,\n data: `${meta.id}/space-settings-automation`,\n properties: {\n label: ['automation panel label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/space-settings-functions`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (node.type === `${SPACE_PLUGIN}/settings` ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: `functions-${node.id}`,\n type: `${meta.id}/space-settings-functions`,\n data: `${meta.id}/space-settings-functions`,\n properties: {\n label: ['functions panel label', { ns: meta.id }],\n icon: 'ph--function--regular',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n createExtension({\n id: `${meta.id}/script-companion`,\n connector: (node) =>\n Rx.make((get) =>\n pipe(\n get(node),\n Option.flatMap((node) => (Obj.instanceOf(ScriptType, node.data) ? Option.some(node) : Option.none())),\n Option.map((node) => [\n {\n id: [node.id, 'automation'].join(ATTENDABLE_PATH_SEPARATOR),\n type: PLANK_COMPANION_TYPE,\n data: 'automation',\n properties: {\n label: ['script automation label', { ns: meta.id }],\n icon: 'ph--lightning--regular',\n disposition: 'hidden',\n },\n },\n ]),\n Option.getOrElse(() => []),\n ),\n ),\n }),\n ]);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,UAAU;AACnB,SAASC,QAAQC,YAAY;AAE7B,SAASC,cAAcC,mBAAuC;AAC9D,SAASC,WAAW;AACpB,SAASC,kBAAkB;AAC3B,SAASC,sBAAsBC,iCAAiC;AAChE,SAASC,uBAAuB;AAChC,SAASC,oBAAoB;AAI7B,IAAA,4BAAe,CAACC,YACdC,YAAYC,aAAaC,iBAAiB;EACxCC,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,cAAcG,MAAKH,EAAE;QACzBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAA0B;cAAEC,IAAIjB,KAAKD;YAAG;;UAChDmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUA,MAAKO,SAAS,GAAGC,YAAAA,cAA0BH,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACpGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI,aAAaG,MAAKH,EAAE;QACxBU,MAAM,GAAGT,KAAKD,EAAE;QAChBe,MAAM,GAAGd,KAAKD,EAAE;QAChBgB,YAAY;UACVC,OAAO;YAAC;YAAyB;cAAEC,IAAIjB,KAAKD;YAAG;;UAC/CmB,MAAM;QACR;MACF;KACD,GACDX,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;EACArB,gBAAgB;IACdC,IAAI,GAAGC,KAAKD,EAAE;IACdE,WAAW,CAACC,SACVC,GAAGC,KAAK,CAACC,QACPC,KACED,IAAIH,IAAAA,GACJK,OAAOC,QAAQ,CAACN,UAAUkB,IAAIC,WAAWC,YAAYpB,MAAKY,IAAI,IAAIP,OAAOI,KAAKT,KAAAA,IAAQK,OAAOK,KAAI,CAAA,GACjGL,OAAOM,IAAI,CAACX,UAAS;MACnB;QACEH,IAAI;UAACG,MAAKH;UAAI;UAAcwB,KAAKC,yBAAAA;QACjCf,MAAMgB;QACNX,MAAM;QACNC,YAAY;UACVC,OAAO;YAAC;YAA2B;cAAEC,IAAIjB,KAAKD;YAAG;;UACjDmB,MAAM;UACNQ,aAAa;QACf;MACF;KACD,GACDnB,OAAOY,UAAU,MAAM,CAAA,CAAE,CAAA,CAAA;EAGjC,CAAA;CACD;",
|
|
6
|
-
"names": ["Rx", "Option", "pipe", "Capabilities", "contributes", "Obj", "ScriptType", "PLANK_COMPANION_TYPE", "ATTENDABLE_PATH_SEPARATOR", "createExtension", "SPACE_PLUGIN", "context", "contributes", "Capabilities", "AppGraphBuilder", "createExtension", "id", "meta", "connector", "node", "Rx", "make", "get", "pipe", "Option", "flatMap", "type", "SPACE_PLUGIN", "some", "none", "map", "data", "properties", "label", "ns", "icon", "getOrElse", "Obj", "instanceOf", "ScriptType", "join", "ATTENDABLE_PATH_SEPARATOR", "PLANK_COMPANION_TYPE", "disposition"]
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
// src/components/index.ts
|
|
2
|
-
import { lazy } from "react";
|
|
3
|
-
var AutomationContainer = lazy(() => import("./AutomationContainer-VZNV2ZQF.mjs"));
|
|
4
|
-
var AutomationPanel = lazy(() => import("./AutomationPanel-ZWA6GOFY.mjs"));
|
|
5
|
-
var FunctionsContainer = lazy(() => import("./FunctionsContainer-IOB333TX.mjs"));
|
|
6
|
-
var FunctionsPanel = lazy(() => import("./FunctionsPanel-56ZKRVM5.mjs"));
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
AutomationContainer,
|
|
10
|
-
AutomationPanel,
|
|
11
|
-
FunctionsContainer,
|
|
12
|
-
FunctionsPanel
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=chunk-ECSTS2UI.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { lazy } from 'react';\n\nexport * from './TriggerEditor';\n\nexport const AutomationContainer = lazy(() => import('./AutomationContainer'));\nexport const AutomationPanel = lazy(() => import('./AutomationPanel'));\nexport const FunctionsContainer = lazy(() => import('./FunctionsContainer'));\nexport const FunctionsPanel = lazy(() => import('./FunctionsPanel'));\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,YAAY;AAId,IAAMC,sBAAsBC,KAAK,MAAM,OAAO,oCAAA,CAAA;AAC9C,IAAMC,kBAAkBD,KAAK,MAAM,OAAO,gCAAA,CAAA;AAC1C,IAAME,qBAAqBF,KAAK,MAAM,OAAO,mCAAA,CAAA;AAC7C,IAAMG,iBAAiBH,KAAK,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
-
"names": ["lazy", "AutomationContainer", "lazy", "AutomationPanel", "FunctionsContainer", "FunctionsPanel"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/AutomationPanel/AutomationPanel.tsx", "../../../src/components/AutomationPanel/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Schema } from 'effect';\nimport React, { useState } from 'react';\n\nimport { Filter, Obj } from '@dxos/echo';\nimport {\n FunctionType,\n FunctionTrigger,\n FunctionTriggerSchema,\n type FunctionTriggerType,\n ScriptType,\n TriggerKind,\n} from '@dxos/functions';\nimport { type Client, useClient } from '@dxos/react-client';\nimport { useQuery, type Space, getSpace } from '@dxos/react-client/echo';\nimport { Clipboard, IconButton, Input, Separator, useTranslation } from '@dxos/react-ui';\nimport { ControlItem, controlItemClasses } from '@dxos/react-ui-form';\nimport { List } from '@dxos/react-ui-list';\nimport { ghostHover, mx } from '@dxos/react-ui-theme';\n\nimport { AUTOMATION_PLUGIN } from '../../meta';\nimport { TriggerEditor, type TriggerEditorProps } from '../TriggerEditor';\n\nconst grid = 'grid grid-cols-[40px_1fr_32px] min-bs-[2.5rem]';\n\nexport type AutomationPanelProps = {\n space: Space;\n object?: Obj.Any;\n initialTrigger?: FunctionTriggerType;\n onDone?: () => void;\n};\n\n// TODO(burdon): Factor out common layout with ViewEditor.\nexport const AutomationPanel = ({ space, object, initialTrigger, onDone }: AutomationPanelProps) => {\n const { t } = useTranslation(AUTOMATION_PLUGIN);\n const client = useClient();\n const triggers = useQuery(space, Filter.type(FunctionTrigger));\n const functions = useQuery(space, Filter.type(FunctionType));\n const scripts = useQuery(space, Filter.type(ScriptType));\n\n const [trigger, setTrigger] = useState<FunctionTriggerType | undefined>(initialTrigger);\n const [selected, setSelected] = useState<FunctionTrigger>();\n\n const handleSelect = (trigger: FunctionTrigger) => {\n const { id: _, ...values } = trigger;\n setTrigger(values);\n setSelected(trigger);\n };\n\n const handleAdd = () => {\n setTrigger(Obj.make(FunctionTriggerSchema, {}));\n setSelected(undefined);\n };\n\n const handleDelete = (trigger: FunctionTrigger) => {\n space.db.remove(trigger);\n setTrigger(undefined);\n setSelected(undefined);\n };\n\n const handleSave: TriggerEditorProps['onSave'] = (trigger) => {\n if (selected) {\n Object.assign(selected, trigger);\n } else {\n space.db.add(Obj.make(FunctionTrigger, trigger));\n }\n\n setTrigger(undefined);\n setSelected(undefined);\n onDone?.();\n };\n\n const handleCancel: TriggerEditorProps['onCancel'] = () => {\n setTrigger(undefined);\n onDone?.();\n };\n\n if (trigger) {\n return (\n <ControlItem title={t('trigger editor title')}>\n <TriggerEditor space={space} trigger={trigger} onSave={handleSave} onCancel={handleCancel} />\n </ControlItem>\n );\n }\n\n return (\n <div className={controlItemClasses}>\n {triggers.length > 0 && (\n <List.Root<FunctionTrigger> items={triggers} isItem={Schema.is(FunctionTrigger)} getId={(field) => field.id}>\n {({ items: triggers }) => (\n <div role='list' className='flex flex-col w-full'>\n {triggers?.map((trigger) => {\n const copyAction = getCopyAction(client, trigger);\n return (\n <List.Item<FunctionTrigger>\n key={trigger.id}\n item={trigger}\n classNames={mx(grid, ghostHover, 'items-center', 'px-2')}\n >\n <Input.Root>\n <Input.Switch\n checked={trigger.enabled}\n onCheckedChange={(checked) => (trigger.enabled = checked)}\n />\n </Input.Root>\n\n <div className={'flex'}>\n <List.ItemTitle\n classNames='px-1 cursor-pointer w-0 shrink truncate'\n onClick={() => handleSelect(trigger)}\n >\n {getFunctionName(scripts, functions, trigger) ?? '∅'}\n </List.ItemTitle>\n\n {/* TODO: a better way to expose copy action */}\n {copyAction && (\n <Clipboard.IconButton\n label={t(copyAction.translationKey)}\n value={copyAction.contentProvider()}\n />\n )}\n </div>\n\n <List.ItemDeleteButton onClick={() => handleDelete(trigger)} />\n </List.Item>\n );\n })}\n </div>\n )}\n </List.Root>\n )}\n {triggers.length > 0 && <Separator classNames='mlb-4' />}\n <IconButton icon='ph--plus--regular' label={t('new trigger label')} onClick={handleAdd} />\n </div>\n );\n};\n\nconst getCopyAction = (client: Client, trigger: FunctionTrigger | undefined) => {\n if (trigger?.spec?.kind === TriggerKind.Email) {\n return { translationKey: 'trigger copy email', contentProvider: () => `${getSpace(trigger)!.id}@dxos.network` };\n }\n\n if (trigger?.spec?.kind === TriggerKind.Webhook) {\n return { translationKey: 'trigger copy url', contentProvider: () => getWebhookUrl(client, trigger) };\n }\n\n return undefined;\n};\n\nconst getWebhookUrl = (client: Client, trigger: FunctionTrigger) => {\n const spaceId = getSpace(trigger)!.id;\n const edgeUrl = new URL(client.config.values.runtime!.services!.edge!.url!);\n const isSecure = edgeUrl.protocol.startsWith('https') || edgeUrl.protocol.startsWith('wss');\n edgeUrl.protocol = isSecure ? 'https' : 'http';\n return new URL(`/webhook/${spaceId}:${trigger.id}`, edgeUrl).toString();\n};\n\nconst getFunctionName = (scripts: ScriptType[], functions: FunctionType[], trigger: FunctionTriggerType) => {\n // TODO(wittjosiah): Truncation should be done in the UI.\n // Warning that the List component is currently a can of worms.\n const shortId = trigger.function && `${trigger.function.dxn.toString().slice(0, 16)}…`;\n const functionObject = functions.find((fn) => fn === trigger.function?.target);\n if (!functionObject) {\n return shortId;\n }\n\n return scripts.find((s) => functionObject.source?.target?.id === s.id)?.name ?? shortId;\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { AutomationPanel } from './AutomationPanel';\n\nexport * from './AutomationPanel';\n\nexport default AutomationPanel;\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Schema", "React", "useState", "Filter", "Obj", "FunctionType", "FunctionTrigger", "FunctionTriggerSchema", "ScriptType", "TriggerKind", "useClient", "useQuery", "getSpace", "Clipboard", "IconButton", "Input", "Separator", "useTranslation", "ControlItem", "controlItemClasses", "List", "ghostHover", "mx", "grid", "AutomationPanel", "space", "object", "initialTrigger", "onDone", "t", "useTranslation", "AUTOMATION_PLUGIN", "client", "useClient", "triggers", "useQuery", "Filter", "type", "FunctionTrigger", "functions", "FunctionType", "scripts", "ScriptType", "trigger", "setTrigger", "useState", "selected", "setSelected", "handleSelect", "id", "_", "values", "handleAdd", "Obj", "make", "FunctionTriggerSchema", "undefined", "handleDelete", "db", "remove", "handleSave", "Object", "assign", "add", "handleCancel", "ControlItem", "title", "TriggerEditor", "onSave", "onCancel", "div", "className", "controlItemClasses", "length", "List", "Root", "items", "isItem", "Schema", "is", "getId", "field", "role", "map", "copyAction", "getCopyAction", "Item", "key", "item", "classNames", "mx", "ghostHover", "Input", "Switch", "checked", "enabled", "onCheckedChange", "ItemTitle", "onClick", "getFunctionName", "Clipboard", "IconButton", "label", "translationKey", "value", "contentProvider", "ItemDeleteButton", "Separator", "icon", "spec", "kind", "TriggerKind", "Email", "getSpace", "Webhook", "getWebhookUrl", "spaceId", "edgeUrl", "URL", "config", "runtime", "services", "edge", "url", "isSecure", "protocol", "startsWith", "toString", "shortId", "function", "dxn", "slice", "functionObject", "find", "fn", "target", "s", "source", "name", "AutomationPanel"]
|
|
7
|
-
}
|