@dxos/plugin-conductor 0.7.5-main.6ab6199
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/LICENSE +8 -0
- package/README.md +90 -0
- package/dist/lib/browser/CanvasContainer-2LHBQGCB.mjs +95 -0
- package/dist/lib/browser/CanvasContainer-2LHBQGCB.mjs.map +7 -0
- package/dist/lib/browser/chunk-DUUJXCVO.mjs +21 -0
- package/dist/lib/browser/chunk-DUUJXCVO.mjs.map +7 -0
- package/dist/lib/browser/chunk-KTJBLHAY.mjs +26 -0
- package/dist/lib/browser/chunk-KTJBLHAY.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +96 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/intent-resolver-IKITW45C.mjs +34 -0
- package/dist/lib/browser/intent-resolver-IKITW45C.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react-surface-KAJ3W4G5.mjs +30 -0
- package/dist/lib/browser/react-surface-KAJ3W4G5.mjs.map +7 -0
- package/dist/lib/browser/types.mjs +8 -0
- package/dist/lib/browser/types.mjs.map +7 -0
- package/dist/lib/node/CanvasContainer-YQK4QVL6.cjs +128 -0
- package/dist/lib/node/CanvasContainer-YQK4QVL6.cjs.map +7 -0
- package/dist/lib/node/chunk-3WWLHGNO.cjs +45 -0
- package/dist/lib/node/chunk-3WWLHGNO.cjs.map +7 -0
- package/dist/lib/node/chunk-Y3VOCBBO.cjs +44 -0
- package/dist/lib/node/chunk-Y3VOCBBO.cjs.map +7 -0
- package/dist/lib/node/index.cjs +119 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-P6OSOKYW.cjs +50 -0
- package/dist/lib/node/intent-resolver-P6OSOKYW.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/react-surface-NA74HMQP.cjs +52 -0
- package/dist/lib/node/react-surface-NA74HMQP.cjs.map +7 -0
- package/dist/lib/node/types.cjs +30 -0
- package/dist/lib/node/types.cjs.map +7 -0
- package/dist/lib/node-esm/CanvasContainer-CJHLFVHB.mjs +97 -0
- package/dist/lib/node-esm/CanvasContainer-CJHLFVHB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ML7CFPFL.mjs +23 -0
- package/dist/lib/node-esm/chunk-ML7CFPFL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-ZJLM74FY.mjs +27 -0
- package/dist/lib/node-esm/chunk-ZJLM74FY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +97 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/intent-resolver-LUU6EZQI.mjs +35 -0
- package/dist/lib/node-esm/intent-resolver-LUU6EZQI.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react-surface-DX25CX6P.mjs +31 -0
- package/dist/lib/node-esm/react-surface-DX25CX6P.mjs.map +7 -0
- package/dist/lib/node-esm/types.mjs +9 -0
- package/dist/lib/node-esm/types.mjs.map +7 -0
- package/dist/types/src/ConductorPlugin.d.ts +2 -0
- package/dist/types/src/ConductorPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +3 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/CanvasContainer.d.ts +7 -0
- package/dist/types/src/components/CanvasContainer.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +11 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/sanity.test.d.ts +2 -0
- package/dist/types/src/sanity.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +25 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types.d.ts +18 -0
- package/dist/types/src/types.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +70 -0
- package/src/ConductorPlugin.tsx +64 -0
- package/src/capabilities/index.ts +8 -0
- package/src/capabilities/intent-resolver.ts +27 -0
- package/src/capabilities/react-surface.tsx +22 -0
- package/src/components/CanvasContainer.tsx +121 -0
- package/src/components/index.ts +7 -0
- package/src/index.ts +6 -0
- package/src/meta.ts +18 -0
- package/src/sanity.test.ts +11 -0
- package/src/translations.ts +23 -0
- package/src/types.ts +21 -0
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxos/plugin-conductor",
|
|
3
|
+
"version": "0.7.5-main.6ab6199",
|
|
4
|
+
"description": "Composer plugin for conductor.",
|
|
5
|
+
"homepage": "https://dxos.org",
|
|
6
|
+
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "DXOS.org",
|
|
9
|
+
"sideEffects": true,
|
|
10
|
+
"type": "module",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/types/src/index.d.ts",
|
|
14
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
|
+
},
|
|
17
|
+
"./types": {
|
|
18
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
19
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
20
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"types": "dist/types/src/index.d.ts",
|
|
24
|
+
"typesVersions": {
|
|
25
|
+
"*": {
|
|
26
|
+
"types": [
|
|
27
|
+
"dist/types/src/types/index.d.ts"
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"src"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@dxos/app-framework": "0.7.5-main.6ab6199",
|
|
37
|
+
"@dxos/assistant": "0.7.5-main.6ab6199",
|
|
38
|
+
"@dxos/conductor": "0.7.5-main.6ab6199",
|
|
39
|
+
"@dxos/functions": "0.7.5-main.6ab6199",
|
|
40
|
+
"@dxos/edge-client": "0.7.5-main.6ab6199",
|
|
41
|
+
"@dxos/echo-schema": "0.7.5-main.6ab6199",
|
|
42
|
+
"@dxos/log": "0.7.5-main.6ab6199",
|
|
43
|
+
"@dxos/live-object": "0.7.5-main.6ab6199",
|
|
44
|
+
"@dxos/plugin-client": "0.7.5-main.6ab6199",
|
|
45
|
+
"@dxos/plugin-space": "0.7.5-main.6ab6199",
|
|
46
|
+
"@dxos/react-ui-canvas-compute": "0.7.5-main.6ab6199",
|
|
47
|
+
"@dxos/react-ui-canvas-editor": "0.7.5-main.6ab6199",
|
|
48
|
+
"@dxos/react-client": "0.7.5-main.6ab6199",
|
|
49
|
+
"@dxos/react-ui-stack": "0.7.5-main.6ab6199"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/react": "~18.2.0",
|
|
53
|
+
"@types/react-dom": "~18.2.0",
|
|
54
|
+
"react": "~18.2.0",
|
|
55
|
+
"react-dom": "~18.2.0",
|
|
56
|
+
"vite": "5.4.7",
|
|
57
|
+
"@dxos/storybook-utils": "0.7.5-main.6ab6199",
|
|
58
|
+
"@dxos/react-ui-theme": "0.7.5-main.6ab6199",
|
|
59
|
+
"@dxos/react-ui": "0.7.5-main.6ab6199"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": "~18.2.0",
|
|
63
|
+
"react-dom": "~18.2.0",
|
|
64
|
+
"@dxos/react-ui-theme": "0.7.5-main.6ab6199",
|
|
65
|
+
"@dxos/react-ui": "0.7.5-main.6ab6199"
|
|
66
|
+
},
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
|
|
6
|
+
import { ComputeGraph } from '@dxos/conductor';
|
|
7
|
+
import { FunctionTrigger } from '@dxos/functions/types';
|
|
8
|
+
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
9
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
10
|
+
import { defineObjectForm } from '@dxos/plugin-space/types';
|
|
11
|
+
import { CanvasBoardType } from '@dxos/react-ui-canvas-editor';
|
|
12
|
+
|
|
13
|
+
import { IntentResolver, ReactSurface } from './capabilities';
|
|
14
|
+
import { CONDUCTOR_PLUGIN, meta } from './meta';
|
|
15
|
+
import translations from './translations';
|
|
16
|
+
import { ConductorAction } from './types';
|
|
17
|
+
|
|
18
|
+
export const ConductorPlugin = () =>
|
|
19
|
+
definePlugin(meta, [
|
|
20
|
+
defineModule({
|
|
21
|
+
id: `${meta.id}/module/translations`,
|
|
22
|
+
activatesOn: Events.SetupTranslations,
|
|
23
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
24
|
+
}),
|
|
25
|
+
defineModule({
|
|
26
|
+
id: `${meta.id}/module/metadata`,
|
|
27
|
+
activatesOn: Events.SetupMetadata,
|
|
28
|
+
activate: () =>
|
|
29
|
+
contributes(Capabilities.Metadata, {
|
|
30
|
+
id: CanvasBoardType.typename,
|
|
31
|
+
metadata: {
|
|
32
|
+
placeholder: ['canvas title placeholder', { ns: CONDUCTOR_PLUGIN }],
|
|
33
|
+
icon: 'ph--infinity--regular',
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/object-form`,
|
|
39
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
40
|
+
activate: () =>
|
|
41
|
+
contributes(
|
|
42
|
+
SpaceCapabilities.ObjectForm,
|
|
43
|
+
defineObjectForm({
|
|
44
|
+
objectSchema: CanvasBoardType,
|
|
45
|
+
getIntent: () => createIntent(ConductorAction.Create),
|
|
46
|
+
}),
|
|
47
|
+
),
|
|
48
|
+
}),
|
|
49
|
+
defineModule({
|
|
50
|
+
id: `${meta.id}/module/schema`,
|
|
51
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
52
|
+
activate: () => contributes(ClientCapabilities.Schema, [ComputeGraph, FunctionTrigger]),
|
|
53
|
+
}),
|
|
54
|
+
defineModule({
|
|
55
|
+
id: `${meta.id}/module/react-surface`,
|
|
56
|
+
activatesOn: Events.SetupReactSurface,
|
|
57
|
+
activate: ReactSurface,
|
|
58
|
+
}),
|
|
59
|
+
defineModule({
|
|
60
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
61
|
+
activatesOn: Events.SetupIntentResolver,
|
|
62
|
+
activate: IntentResolver,
|
|
63
|
+
}),
|
|
64
|
+
]);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
+
import { ComputeGraph } from '@dxos/conductor';
|
|
7
|
+
import { create, makeRef } from '@dxos/live-object';
|
|
8
|
+
import { CanvasBoardType } from '@dxos/react-ui-canvas-editor';
|
|
9
|
+
|
|
10
|
+
import { ConductorAction } from '../types';
|
|
11
|
+
|
|
12
|
+
export default () =>
|
|
13
|
+
contributes(
|
|
14
|
+
Capabilities.IntentResolver,
|
|
15
|
+
createResolver({
|
|
16
|
+
intent: ConductorAction.Create,
|
|
17
|
+
resolve: ({ name }) => ({
|
|
18
|
+
data: {
|
|
19
|
+
object: create(CanvasBoardType, {
|
|
20
|
+
name,
|
|
21
|
+
computeGraph: makeRef(create(ComputeGraph, { graph: { nodes: [], edges: [] } })),
|
|
22
|
+
layout: { nodes: [], edges: [] },
|
|
23
|
+
}),
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
}),
|
|
27
|
+
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
import { CanvasBoardType } from '@dxos/react-ui-canvas-editor';
|
|
9
|
+
|
|
10
|
+
import { CanvasContainer } from '../components';
|
|
11
|
+
import { CONDUCTOR_PLUGIN } from '../meta';
|
|
12
|
+
|
|
13
|
+
export default () =>
|
|
14
|
+
contributes(
|
|
15
|
+
Capabilities.ReactSurface,
|
|
16
|
+
createSurface({
|
|
17
|
+
id: CONDUCTOR_PLUGIN,
|
|
18
|
+
role: ['article', 'section'],
|
|
19
|
+
filter: (data): data is { subject: CanvasBoardType } => data.subject instanceof CanvasBoardType,
|
|
20
|
+
component: ({ data, role }) => <CanvasContainer canvas={data.subject} role={role} />,
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
6
|
+
|
|
7
|
+
import { AIServiceClientImpl } from '@dxos/assistant';
|
|
8
|
+
import { type Config } from '@dxos/client';
|
|
9
|
+
import { ComputeGraphModel, EdgeGpt } from '@dxos/conductor';
|
|
10
|
+
import { createStubEdgeIdentity, EdgeClient, EdgeHttpClient } from '@dxos/edge-client';
|
|
11
|
+
import { useConfig } from '@dxos/react-client';
|
|
12
|
+
import { fullyQualifiedId, getSpace, type Space } from '@dxos/react-client/echo';
|
|
13
|
+
import {
|
|
14
|
+
ComputeContext,
|
|
15
|
+
ComputeGraphController,
|
|
16
|
+
type ComputeShape,
|
|
17
|
+
ComputeShapeLayout,
|
|
18
|
+
computeShapes,
|
|
19
|
+
type Services,
|
|
20
|
+
useGraphMonitor,
|
|
21
|
+
} from '@dxos/react-ui-canvas-compute';
|
|
22
|
+
import {
|
|
23
|
+
type CanvasBoardType,
|
|
24
|
+
CanvasGraphModel,
|
|
25
|
+
Editor,
|
|
26
|
+
type EditorController,
|
|
27
|
+
KeyboardContainer,
|
|
28
|
+
ShapeRegistry,
|
|
29
|
+
} from '@dxos/react-ui-canvas-editor';
|
|
30
|
+
import { StackItem } from '@dxos/react-ui-stack';
|
|
31
|
+
|
|
32
|
+
const createServices = (config: Config, space?: Space): Partial<Services> => {
|
|
33
|
+
return {
|
|
34
|
+
spaceService:
|
|
35
|
+
space == null
|
|
36
|
+
? undefined
|
|
37
|
+
: {
|
|
38
|
+
spaceId: space.id,
|
|
39
|
+
db: space.db,
|
|
40
|
+
},
|
|
41
|
+
gpt:
|
|
42
|
+
config.values.runtime?.services?.ai?.server == null
|
|
43
|
+
? undefined
|
|
44
|
+
: new EdgeGpt(new AIServiceClientImpl({ endpoint: config.values.runtime?.services?.ai?.server })),
|
|
45
|
+
edgeClient:
|
|
46
|
+
config.values.runtime?.services?.edge?.url == null
|
|
47
|
+
? undefined
|
|
48
|
+
: new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: config.values.runtime?.services?.edge?.url }),
|
|
49
|
+
edgeHttpClient:
|
|
50
|
+
config.values.runtime?.services?.edge?.url == null
|
|
51
|
+
? undefined
|
|
52
|
+
: new EdgeHttpClient(config.values.runtime?.services?.edge?.url),
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const useGraphController = (canvas: CanvasBoardType) => {
|
|
57
|
+
const config = useConfig();
|
|
58
|
+
const space = getSpace(canvas);
|
|
59
|
+
const controller = useMemo(() => {
|
|
60
|
+
if (!canvas.computeGraph?.target) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
const model = new ComputeGraphModel(canvas.computeGraph?.target);
|
|
64
|
+
const controller = new ComputeGraphController(model);
|
|
65
|
+
controller.setServices(createServices(config, space));
|
|
66
|
+
return controller;
|
|
67
|
+
}, [canvas.computeGraph?.target, space]);
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!controller) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
void controller.open();
|
|
74
|
+
return () => {
|
|
75
|
+
void controller.close();
|
|
76
|
+
};
|
|
77
|
+
}, [controller]);
|
|
78
|
+
|
|
79
|
+
return controller;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const CanvasContainer = ({ canvas, role }: { canvas: CanvasBoardType; role: string }) => {
|
|
83
|
+
const id = fullyQualifiedId(canvas);
|
|
84
|
+
const graph = useMemo(() => CanvasGraphModel.create<ComputeShape>(canvas.layout), [canvas.layout]);
|
|
85
|
+
const controller = useGraphController(canvas);
|
|
86
|
+
const graphMonitor = useGraphMonitor(controller?.graph);
|
|
87
|
+
const registry = useMemo(() => new ShapeRegistry(computeShapes), []);
|
|
88
|
+
const editorRef = useRef<EditorController>(null);
|
|
89
|
+
|
|
90
|
+
// Layout.
|
|
91
|
+
const layout = useMemo(
|
|
92
|
+
() => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),
|
|
93
|
+
[controller, registry],
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
if (!controller) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<ComputeContext.Provider value={{ controller }}>
|
|
102
|
+
<StackItem.Content toolbar={false} size={role === 'section' ? 'square' : 'intrinsic'}>
|
|
103
|
+
<KeyboardContainer id={id}>
|
|
104
|
+
<Editor.Root
|
|
105
|
+
id={id}
|
|
106
|
+
ref={editorRef}
|
|
107
|
+
graph={graph}
|
|
108
|
+
graphMonitor={graphMonitor as any}
|
|
109
|
+
registry={registry}
|
|
110
|
+
layout={layout}
|
|
111
|
+
>
|
|
112
|
+
<Editor.Canvas />
|
|
113
|
+
<Editor.UI showTools />
|
|
114
|
+
</Editor.Root>
|
|
115
|
+
</KeyboardContainer>
|
|
116
|
+
</StackItem.Content>
|
|
117
|
+
</ComputeContext.Provider>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default CanvasContainer;
|
package/src/index.ts
ADDED
package/src/meta.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const CONDUCTOR_PLUGIN = 'dxos.org/plugin/conductor';
|
|
8
|
+
|
|
9
|
+
export const meta = {
|
|
10
|
+
id: CONDUCTOR_PLUGIN,
|
|
11
|
+
name: 'Conductor',
|
|
12
|
+
description:
|
|
13
|
+
'Conductor allows you to build a node based compute graph that can handle complex workflows inside of Composer. Leverage your collaborative data along with custom scripts to orchestrate agentic workflows that operate in the background.',
|
|
14
|
+
icon: 'ph--infinity--regular',
|
|
15
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-conductor',
|
|
16
|
+
tags: ['experimental'],
|
|
17
|
+
screenshots: ['https://dxos.network/plugin-details-canvas-dark.png'],
|
|
18
|
+
} satisfies PluginMeta;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { CanvasBoardType } from '@dxos/react-ui-canvas-editor';
|
|
6
|
+
|
|
7
|
+
import { CONDUCTOR_PLUGIN } from './meta';
|
|
8
|
+
|
|
9
|
+
export default [
|
|
10
|
+
{
|
|
11
|
+
'en-US': {
|
|
12
|
+
[CanvasBoardType.typename]: {
|
|
13
|
+
'typename label': 'Circuit',
|
|
14
|
+
},
|
|
15
|
+
[CONDUCTOR_PLUGIN]: {
|
|
16
|
+
'plugin name': 'Conductor',
|
|
17
|
+
'canvas title placeholder': 'New circuit',
|
|
18
|
+
'create canvas label': 'Create circuit',
|
|
19
|
+
'content placeholder': 'Enter text...',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
];
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { S } from '@dxos/echo-schema';
|
|
6
|
+
import { CanvasBoardType } from '@dxos/react-ui-canvas-editor';
|
|
7
|
+
|
|
8
|
+
import { CONDUCTOR_PLUGIN } from './meta';
|
|
9
|
+
|
|
10
|
+
export namespace ConductorAction {
|
|
11
|
+
const CONDUCTOR_ACTION = `${CONDUCTOR_PLUGIN}/action`;
|
|
12
|
+
|
|
13
|
+
export class Create extends S.TaggedClass<Create>()(`${CONDUCTOR_ACTION}/create`, {
|
|
14
|
+
input: S.Struct({
|
|
15
|
+
name: S.optional(S.String),
|
|
16
|
+
}),
|
|
17
|
+
output: S.Struct({
|
|
18
|
+
object: CanvasBoardType,
|
|
19
|
+
}),
|
|
20
|
+
}) {}
|
|
21
|
+
}
|