@dxos/plugin-automation 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{chunk-NGG4ICAQ.mjs → AutomationPanel-YAHFXQX6.mjs} +12 -13
- package/dist/lib/browser/AutomationPanel-YAHFXQX6.mjs.map +7 -0
- package/dist/lib/browser/{app-graph-builder-ND64CHOM.mjs → app-graph-builder-K3BIQFWW.mjs} +1 -42
- package/dist/lib/browser/app-graph-builder-K3BIQFWW.mjs.map +7 -0
- package/dist/lib/browser/chunk-MT3FZH4V.mjs +8 -0
- package/dist/lib/browser/chunk-MT3FZH4V.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +17 -23
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs +42 -0
- package/dist/lib/browser/react-surface-4QQSJR4A.mjs.map +7 -0
- package/dist/lib/node/{chunk-SRXHHBDE.cjs → AutomationPanel-ZKAMIU6O.cjs} +14 -19
- package/dist/lib/node/AutomationPanel-ZKAMIU6O.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-TVFR6RXO.cjs → app-graph-builder-HO4FPGZ5.cjs} +4 -45
- package/dist/lib/node/app-graph-builder-HO4FPGZ5.cjs.map +7 -0
- package/dist/lib/node/{chunk-L5TWLPGA.cjs → chunk-AGJ6XTDN.cjs} +7 -16
- package/dist/lib/node/chunk-AGJ6XTDN.cjs.map +7 -0
- package/dist/lib/node/index.cjs +17 -23
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-PCZCHIET.cjs → react-surface-52M54VWV.cjs} +12 -36
- package/dist/lib/node/react-surface-52M54VWV.cjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HMYAQLGF.mjs → AutomationPanel-XF7YPSKM.mjs} +12 -13
- package/dist/lib/node-esm/AutomationPanel-XF7YPSKM.mjs.map +7 -0
- package/dist/lib/node-esm/{app-graph-builder-NYLOXWVV.mjs → app-graph-builder-XCJR33VS.mjs} +1 -42
- package/dist/lib/node-esm/app-graph-builder-XCJR33VS.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs +10 -0
- package/dist/lib/node-esm/chunk-OA75PSGH.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +17 -23
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs +43 -0
- package/dist/lib/node-esm/react-surface-MGKM3OO3.mjs.map +7 -0
- package/dist/types/src/AutomationPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +0 -1
- package/dist/types/src/capabilities/index.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 +3 -6
- package/dist/types/src/components/AutomationPanel/AutomationPanel.d.ts.map +1 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts +0 -1
- package/dist/types/src/components/AutomationPanel/index.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/package.json +24 -29
- package/src/AutomationPlugin.tsx +9 -4
- package/src/capabilities/app-graph-builder.ts +0 -31
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/react-surface.tsx +7 -31
- package/src/components/AutomationPanel/AutomationPanel.stories.tsx +4 -4
- package/src/components/AutomationPanel/AutomationPanel.tsx +63 -62
- package/src/components/AutomationPanel/index.ts +0 -2
- package/src/components/TriggerEditor/TriggerEditor.stories.tsx +3 -3
- package/src/components/index.ts +0 -3
- package/src/translations.ts +1 -10
- package/dist/lib/browser/AutomationContainer-KEQ5RNIW.mjs +0 -34
- package/dist/lib/browser/AutomationContainer-KEQ5RNIW.mjs.map +0 -7
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs +0 -11
- package/dist/lib/browser/AutomationPanel-G3OB6ELR.mjs.map +0 -7
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs +0 -33
- package/dist/lib/browser/FunctionsContainer-STXBW4CX.mjs.map +0 -7
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs +0 -10
- package/dist/lib/browser/FunctionsPanel-JJPLIAJW.mjs.map +0 -7
- package/dist/lib/browser/app-graph-builder-ND64CHOM.mjs.map +0 -7
- package/dist/lib/browser/chunk-65VL4EYS.mjs +0 -88
- package/dist/lib/browser/chunk-65VL4EYS.mjs.map +0 -7
- package/dist/lib/browser/chunk-FCLWFVFX.mjs +0 -39
- package/dist/lib/browser/chunk-FCLWFVFX.mjs.map +0 -7
- package/dist/lib/browser/chunk-NGG4ICAQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-QJPKWYTL.mjs +0 -14
- package/dist/lib/browser/chunk-QJPKWYTL.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-SNIAQ7V5.mjs +0 -78
- package/dist/lib/browser/intent-resolver-SNIAQ7V5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-L22QIANU.mjs +0 -68
- package/dist/lib/browser/react-surface-L22QIANU.mjs.map +0 -7
- package/dist/lib/browser/types.mjs +0 -8
- package/dist/lib/browser/types.mjs.map +0 -7
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs +0 -62
- package/dist/lib/node/AutomationContainer-E5I76FPP.cjs.map +0 -7
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs +0 -32
- package/dist/lib/node/AutomationPanel-YLXAFJDP.cjs.map +0 -7
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs +0 -61
- package/dist/lib/node/FunctionsContainer-3HCURMEB.cjs.map +0 -7
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs +0 -31
- package/dist/lib/node/FunctionsPanel-SYIZHPGU.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-TVFR6RXO.cjs.map +0 -7
- package/dist/lib/node/chunk-BSK5SHTR.cjs +0 -116
- package/dist/lib/node/chunk-BSK5SHTR.cjs.map +0 -7
- package/dist/lib/node/chunk-L5TWLPGA.cjs.map +0 -7
- package/dist/lib/node/chunk-PSIJDHAX.cjs +0 -58
- package/dist/lib/node/chunk-PSIJDHAX.cjs.map +0 -7
- package/dist/lib/node/chunk-SRXHHBDE.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-A44BNFEG.cjs +0 -94
- package/dist/lib/node/intent-resolver-A44BNFEG.cjs.map +0 -7
- package/dist/lib/node/react-surface-PCZCHIET.cjs.map +0 -7
- package/dist/lib/node/types.cjs +0 -30
- package/dist/lib/node/types.cjs.map +0 -7
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs +0 -35
- package/dist/lib/node-esm/AutomationContainer-22PUFPSE.mjs.map +0 -7
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs +0 -12
- package/dist/lib/node-esm/AutomationPanel-6UXIAJVS.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs +0 -34
- package/dist/lib/node-esm/FunctionsContainer-XG5WVAN3.mjs.map +0 -7
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs +0 -11
- package/dist/lib/node-esm/FunctionsPanel-J3QGUESH.mjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-NYLOXWVV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs +0 -89
- package/dist/lib/node-esm/chunk-4UPGANGV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HMYAQLGF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs +0 -16
- package/dist/lib/node-esm/chunk-TMMB5ETD.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs +0 -40
- package/dist/lib/node-esm/chunk-YYBCQXB2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-JFLTVJ7D.mjs +0 -79
- package/dist/lib/node-esm/intent-resolver-JFLTVJ7D.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs +0 -69
- package/dist/lib/node-esm/react-surface-VSO4NWC6.mjs.map +0 -7
- package/dist/lib/node-esm/types.mjs +0 -9
- package/dist/lib/node-esm/types.mjs.map +0 -7
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/AutomationContainer.d.ts +0 -7
- package/dist/types/src/components/AutomationContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsContainer.d.ts +0 -7
- package/dist/types/src/components/FunctionsContainer.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts +0 -7
- package/dist/types/src/components/FunctionsPanel/FunctionsPanel.d.ts.map +0 -1
- package/dist/types/src/components/FunctionsPanel/index.d.ts +0 -4
- package/dist/types/src/components/FunctionsPanel/index.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -25
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -76
- package/src/components/AutomationContainer.tsx +0 -31
- package/src/components/FunctionsContainer.tsx +0 -31
- package/src/components/FunctionsPanel/FunctionsPanel.tsx +0 -95
- package/src/components/FunctionsPanel/index.ts +0 -8
- package/src/types.ts +0 -32
|
@@ -1,31 +0,0 @@
|
|
|
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 { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { ControlSection, ControlPage } from '@dxos/react-ui-form';
|
|
10
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
|
-
|
|
12
|
-
import { AutomationPanel } from './AutomationPanel';
|
|
13
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
14
|
-
|
|
15
|
-
export const AutomationContainer = ({ space }: { space: Space }) => {
|
|
16
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
17
|
-
return (
|
|
18
|
-
<StackItem.Content classNames='block overflow-y-auto'>
|
|
19
|
-
<ControlPage>
|
|
20
|
-
<ControlSection
|
|
21
|
-
title={t('automation verbose label', { ns: AUTOMATION_PLUGIN })}
|
|
22
|
-
description={t('automation description', { ns: AUTOMATION_PLUGIN })}
|
|
23
|
-
>
|
|
24
|
-
<AutomationPanel space={space} />
|
|
25
|
-
</ControlSection>
|
|
26
|
-
</ControlPage>
|
|
27
|
-
</StackItem.Content>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default AutomationContainer;
|
|
@@ -1,31 +0,0 @@
|
|
|
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 { useTranslation } from '@dxos/react-ui';
|
|
9
|
-
import { ControlPage, ControlSection } from '@dxos/react-ui-form';
|
|
10
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
11
|
-
|
|
12
|
-
import { FunctionsPanel } from './FunctionsPanel';
|
|
13
|
-
import { AUTOMATION_PLUGIN } from '../meta';
|
|
14
|
-
|
|
15
|
-
export const FunctionsContainer = ({ space }: { space: Space }) => {
|
|
16
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
17
|
-
return (
|
|
18
|
-
<StackItem.Content classNames='block overflow-y-auto'>
|
|
19
|
-
<ControlPage>
|
|
20
|
-
<ControlSection
|
|
21
|
-
title={t('functions verbose label', { ns: AUTOMATION_PLUGIN })}
|
|
22
|
-
description={t('functions description', { ns: AUTOMATION_PLUGIN })}
|
|
23
|
-
>
|
|
24
|
-
<FunctionsPanel space={space} />
|
|
25
|
-
</ControlSection>
|
|
26
|
-
</ControlPage>
|
|
27
|
-
</StackItem.Content>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default FunctionsContainer;
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React, { useCallback, useMemo } from 'react';
|
|
6
|
-
|
|
7
|
-
import { createIntent, LayoutAction, useIntentDispatcher } from '@dxos/app-framework';
|
|
8
|
-
import { S } from '@dxos/echo-schema';
|
|
9
|
-
import { FunctionType, ScriptType } from '@dxos/functions/types';
|
|
10
|
-
import { Filter, fullyQualifiedId, useQuery, type Space } from '@dxos/react-client/echo';
|
|
11
|
-
import { Button, useTranslation } from '@dxos/react-ui';
|
|
12
|
-
import { controlItemClasses } from '@dxos/react-ui-form';
|
|
13
|
-
import { List } from '@dxos/react-ui-list';
|
|
14
|
-
import { ghostHover, mx } from '@dxos/react-ui-theme';
|
|
15
|
-
|
|
16
|
-
import { AUTOMATION_PLUGIN } from '../../meta';
|
|
17
|
-
|
|
18
|
-
const grid = 'grid grid-cols-[1fr_auto] min-bs-[2.5rem]';
|
|
19
|
-
|
|
20
|
-
export type FunctionsPanelProps = {
|
|
21
|
-
space: Space;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const FunctionsPanel = ({ space }: FunctionsPanelProps) => {
|
|
25
|
-
const { t } = useTranslation(AUTOMATION_PLUGIN);
|
|
26
|
-
const functions = useQuery(space, Filter.schema(FunctionType));
|
|
27
|
-
const scripts = useQuery(space, Filter.schema(ScriptType));
|
|
28
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
29
|
-
|
|
30
|
-
const functionToScriptMap = useMemo(
|
|
31
|
-
() =>
|
|
32
|
-
functions.reduce(
|
|
33
|
-
(map, func) => {
|
|
34
|
-
const scriptId = func.source?.target?.id;
|
|
35
|
-
if (scriptId) {
|
|
36
|
-
const script = scripts.find((s) => s.id === scriptId);
|
|
37
|
-
if (script) {
|
|
38
|
-
map[func.id] = script;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
return map;
|
|
42
|
-
},
|
|
43
|
-
{} as Record<string, ScriptType>,
|
|
44
|
-
),
|
|
45
|
-
[functions, scripts],
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
const getScriptName = useCallback(
|
|
49
|
-
(func: FunctionType) => {
|
|
50
|
-
const script = functionToScriptMap[func.id];
|
|
51
|
-
return script?.name;
|
|
52
|
-
},
|
|
53
|
-
[functionToScriptMap],
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
const handleGoToScript = useCallback(
|
|
57
|
-
(func: FunctionType) => {
|
|
58
|
-
const script = functionToScriptMap[func.id];
|
|
59
|
-
if (script) {
|
|
60
|
-
void dispatch(createIntent(LayoutAction.Open, { part: 'main', subject: [fullyQualifiedId(script)] }));
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
[functionToScriptMap, dispatch],
|
|
64
|
-
);
|
|
65
|
-
|
|
66
|
-
return (
|
|
67
|
-
<div role='none' className={mx(controlItemClasses)}>
|
|
68
|
-
<List.Root<FunctionType> items={functions} isItem={S.is(FunctionType)} getId={(func) => func.id}>
|
|
69
|
-
{({ items }) => (
|
|
70
|
-
<div role='list' className='flex flex-col w-full'>
|
|
71
|
-
{items?.map((func) => (
|
|
72
|
-
<List.Item<FunctionType>
|
|
73
|
-
key={func.id}
|
|
74
|
-
item={func}
|
|
75
|
-
classNames={mx(grid, ghostHover, 'items-center', 'pli-2', 'min-bs-[3rem]')}
|
|
76
|
-
>
|
|
77
|
-
<div className='flex flex-col truncate'>
|
|
78
|
-
<List.ItemTitle classNames='truncate'>{func.name}</List.ItemTitle>
|
|
79
|
-
{getScriptName(func) && (
|
|
80
|
-
<div className='text-xs text-description truncate'>{getScriptName(func)}</div>
|
|
81
|
-
)}
|
|
82
|
-
</div>
|
|
83
|
-
{functionToScriptMap[func.id] && (
|
|
84
|
-
<Button onClick={() => handleGoToScript(func)}>{t('go to function source button label')}</Button>
|
|
85
|
-
)}
|
|
86
|
-
</List.Item>
|
|
87
|
-
))}
|
|
88
|
-
</div>
|
|
89
|
-
)}
|
|
90
|
-
</List.Root>
|
|
91
|
-
|
|
92
|
-
{functions.length === 0 && <div className='text-center plb-4 text-gray-500'>{t('no functions found')}</div>}
|
|
93
|
-
</div>
|
|
94
|
-
);
|
|
95
|
-
};
|
package/src/types.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { S } from '@dxos/echo-schema';
|
|
6
|
-
import { SpaceSchema } from '@dxos/react-client/echo';
|
|
7
|
-
|
|
8
|
-
import { AUTOMATION_PLUGIN } from './meta';
|
|
9
|
-
|
|
10
|
-
const TriggerTemplate = S.Union(
|
|
11
|
-
S.Struct({ type: S.Literal('timer'), cron: S.String }),
|
|
12
|
-
S.Struct({ type: S.Literal('queue'), queueDXN: S.Any }),
|
|
13
|
-
);
|
|
14
|
-
|
|
15
|
-
export namespace AutomationAction {
|
|
16
|
-
const AUTOMATION_ACTION = `${AUTOMATION_PLUGIN}/action`;
|
|
17
|
-
|
|
18
|
-
export class CreateTriggerFromTemplate extends S.TaggedClass<CreateTriggerFromTemplate>()(
|
|
19
|
-
`${AUTOMATION_ACTION}/create-trigger-from-template`,
|
|
20
|
-
{
|
|
21
|
-
input: S.Struct({
|
|
22
|
-
space: SpaceSchema,
|
|
23
|
-
template: TriggerTemplate,
|
|
24
|
-
enabled: S.optional(S.Boolean),
|
|
25
|
-
// TODO(wittjosiah): Improve how this lookup is done.
|
|
26
|
-
scriptName: S.optional(S.String),
|
|
27
|
-
payload: S.optional(S.Record({ key: S.String, value: S.Any })),
|
|
28
|
-
}),
|
|
29
|
-
output: S.Void,
|
|
30
|
-
},
|
|
31
|
-
) {}
|
|
32
|
-
}
|