@dxos/plugin-conductor 0.8.4-main.fd6878d → 0.8.4-staging.60fe92afc8
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 +102 -5
- package/PLUGIN.mdl +461 -0
- package/README.md +7 -3
- package/dist/lib/neutral/CanvasArticle-KEPXL3ZT.mjs +98 -0
- package/dist/lib/neutral/CanvasArticle-KEPXL3ZT.mjs.map +7 -0
- package/dist/lib/neutral/ConductorPlugin.mjs +38 -0
- package/dist/lib/neutral/ConductorPlugin.mjs.map +7 -0
- package/dist/lib/neutral/capabilities/index.mjs +9 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WDHL35VB.mjs +39 -0
- package/dist/lib/neutral/chunk-WDHL35VB.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +1 -0
- package/dist/lib/neutral/containers/index.mjs +7 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-object-PTHDJAGI.mjs +26 -0
- package/dist/lib/neutral/create-object-PTHDJAGI.mjs.map +7 -0
- package/dist/lib/neutral/index.mjs +7 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +7 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +11 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-JCMKXAUY.mjs +22 -0
- package/dist/lib/neutral/react-surface-JCMKXAUY.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +29 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/types/src/ConductorPlugin.d.ts +3 -1
- package/dist/types/src/ConductorPlugin.d.ts.map +1 -1
- package/dist/types/src/ConductorPlugin.test.d.ts +2 -0
- package/dist/types/src/ConductorPlugin.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/create-object.d.ts +11 -0
- package/dist/types/src/capabilities/create-object.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +8 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/CanvasArticle/CanvasArticle.d.ts +6 -0
- package/dist/types/src/containers/CanvasArticle/CanvasArticle.d.ts.map +1 -0
- package/dist/types/src/containers/CanvasArticle/index.d.ts +2 -0
- package/dist/types/src/containers/CanvasArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +0 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +3 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +24 -14
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +0 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +83 -49
- package/src/ConductorPlugin.test.ts +27 -0
- package/src/ConductorPlugin.tsx +21 -56
- package/src/capabilities/create-object.ts +30 -0
- package/src/capabilities/index.ts +3 -3
- package/src/capabilities/react-surface.tsx +24 -15
- package/src/components/index.ts +1 -5
- package/src/containers/CanvasArticle/CanvasArticle.tsx +127 -0
- package/src/containers/CanvasArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/index.ts +0 -1
- package/src/meta.ts +24 -8
- package/src/plugin.ts +9 -0
- package/src/translations.ts +15 -12
- package/src/types/index.ts +0 -2
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/CanvasContainer-5TA2MZRA.mjs +0 -94
- package/dist/lib/browser/CanvasContainer-5TA2MZRA.mjs.map +0 -7
- package/dist/lib/browser/chunk-3AGZDOYQ.mjs +0 -21
- package/dist/lib/browser/chunk-3AGZDOYQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-IFYNDE3Z.mjs +0 -25
- package/dist/lib/browser/chunk-IFYNDE3Z.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -94
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-7OILSFLQ.mjs +0 -34
- package/dist/lib/browser/intent-resolver-7OILSFLQ.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-4DPSMURM.mjs +0 -31
- package/dist/lib/browser/react-surface-4DPSMURM.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -8
- package/dist/lib/node-esm/CanvasContainer-I35ILMX5.mjs +0 -96
- package/dist/lib/node-esm/CanvasContainer-I35ILMX5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ELHUFMCW.mjs +0 -26
- package/dist/lib/node-esm/chunk-ELHUFMCW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TL52TWDT.mjs +0 -23
- package/dist/lib/node-esm/chunk-TL52TWDT.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -95
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-U3TIHMS2.mjs +0 -35
- package/dist/lib/node-esm/intent-resolver-U3TIHMS2.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-SXQJZJRL.mjs +0 -32
- package/dist/lib/node-esm/react-surface-SXQJZJRL.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -9
- 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/CanvasContainer.d.ts +0 -8
- package/dist/types/src/components/CanvasContainer.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -18
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/intent-resolver.ts +0 -27
- package/src/components/CanvasContainer.tsx +0 -104
- package/src/types/schema.ts +0 -20
- /package/dist/lib/{browser/types → neutral/components}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/types → neutral}/index.mjs.map +0 -0
package/package.json
CHANGED
|
@@ -1,76 +1,110 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-conductor",
|
|
3
|
-
"version": "0.8.4-
|
|
3
|
+
"version": "0.8.4-staging.60fe92afc8",
|
|
4
4
|
"description": "Composer plugin for conductor.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
-
"
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/dxos/dxos"
|
|
10
|
+
},
|
|
11
|
+
"license": "FSL-1.1-Apache-2.0",
|
|
8
12
|
"author": "DXOS.org",
|
|
9
13
|
"sideEffects": true,
|
|
10
14
|
"type": "module",
|
|
15
|
+
"imports": {
|
|
16
|
+
"#capabilities": {
|
|
17
|
+
"source": "./src/capabilities/index.ts",
|
|
18
|
+
"types": "./dist/types/src/capabilities/index.d.ts",
|
|
19
|
+
"default": "./dist/lib/neutral/capabilities/index.mjs"
|
|
20
|
+
},
|
|
21
|
+
"#components": {
|
|
22
|
+
"source": "./src/components/index.ts",
|
|
23
|
+
"types": "./dist/types/src/components/index.d.ts",
|
|
24
|
+
"default": "./dist/lib/neutral/components/index.mjs"
|
|
25
|
+
},
|
|
26
|
+
"#containers": {
|
|
27
|
+
"source": "./src/containers/index.ts",
|
|
28
|
+
"types": "./dist/types/src/containers/index.d.ts",
|
|
29
|
+
"default": "./dist/lib/neutral/containers/index.mjs"
|
|
30
|
+
},
|
|
31
|
+
"#meta": {
|
|
32
|
+
"source": "./src/meta.ts",
|
|
33
|
+
"types": "./dist/types/src/meta.d.ts",
|
|
34
|
+
"default": "./dist/lib/neutral/meta.mjs"
|
|
35
|
+
},
|
|
36
|
+
"#plugin": {
|
|
37
|
+
"source": "./src/ConductorPlugin.tsx",
|
|
38
|
+
"types": "./dist/types/src/ConductorPlugin.d.ts",
|
|
39
|
+
"default": "./dist/lib/neutral/ConductorPlugin.mjs"
|
|
40
|
+
},
|
|
41
|
+
"#translations": {
|
|
42
|
+
"source": "./src/translations.ts",
|
|
43
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
44
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
11
47
|
"exports": {
|
|
12
48
|
".": {
|
|
13
49
|
"source": "./src/index.ts",
|
|
14
50
|
"types": "./dist/types/src/index.d.ts",
|
|
15
|
-
"
|
|
16
|
-
|
|
51
|
+
"default": "./dist/lib/neutral/index.mjs"
|
|
52
|
+
},
|
|
53
|
+
"./assets/PLUGIN.mdl": "./PLUGIN.mdl",
|
|
54
|
+
"./plugin": {
|
|
55
|
+
"source": "./src/plugin.ts",
|
|
56
|
+
"types": "./dist/types/src/plugin.d.ts",
|
|
57
|
+
"default": "./dist/lib/neutral/plugin.mjs"
|
|
17
58
|
},
|
|
18
|
-
"./
|
|
19
|
-
"source": "./src/
|
|
20
|
-
"types": "./dist/types/src/
|
|
21
|
-
"
|
|
22
|
-
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
59
|
+
"./translations": {
|
|
60
|
+
"source": "./src/translations.ts",
|
|
61
|
+
"types": "./dist/types/src/translations.d.ts",
|
|
62
|
+
"default": "./dist/lib/neutral/translations.mjs"
|
|
23
63
|
}
|
|
24
64
|
},
|
|
25
65
|
"types": "dist/types/src/index.d.ts",
|
|
26
|
-
"typesVersions": {
|
|
27
|
-
"*": {
|
|
28
|
-
"types": [
|
|
29
|
-
"dist/types/src/types/index.d.ts"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
66
|
"files": [
|
|
34
67
|
"dist",
|
|
35
|
-
"src"
|
|
68
|
+
"src",
|
|
69
|
+
"PLUGIN.mdl"
|
|
36
70
|
],
|
|
37
71
|
"dependencies": {
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"@dxos/ai": "0.8.4-
|
|
41
|
-
"@dxos/app-
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-client": "0.8.4-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/react-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/react-
|
|
56
|
-
"@dxos/react-ui-stack": "0.8.4-main.fd6878d"
|
|
72
|
+
"effect": "3.21.3",
|
|
73
|
+
"@dxos/app-framework": "0.8.4-staging.60fe92afc8",
|
|
74
|
+
"@dxos/ai": "0.8.4-staging.60fe92afc8",
|
|
75
|
+
"@dxos/app-toolkit": "0.8.4-staging.60fe92afc8",
|
|
76
|
+
"@dxos/compute": "0.8.4-staging.60fe92afc8",
|
|
77
|
+
"@dxos/conductor": "0.8.4-staging.60fe92afc8",
|
|
78
|
+
"@dxos/edge-client": "0.8.4-staging.60fe92afc8",
|
|
79
|
+
"@dxos/functions": "0.8.4-staging.60fe92afc8",
|
|
80
|
+
"@dxos/echo": "0.8.4-staging.60fe92afc8",
|
|
81
|
+
"@dxos/keys": "0.8.4-staging.60fe92afc8",
|
|
82
|
+
"@dxos/log": "0.8.4-staging.60fe92afc8",
|
|
83
|
+
"@dxos/plugin-automation": "0.8.4-staging.60fe92afc8",
|
|
84
|
+
"@dxos/plugin-space": "0.8.4-staging.60fe92afc8",
|
|
85
|
+
"@dxos/plugin-client": "0.8.4-staging.60fe92afc8",
|
|
86
|
+
"@dxos/react-ui-canvas-compute": "0.8.4-staging.60fe92afc8",
|
|
87
|
+
"@dxos/react-ui-canvas-editor": "0.8.4-staging.60fe92afc8",
|
|
88
|
+
"@dxos/util": "0.8.4-staging.60fe92afc8",
|
|
89
|
+
"@dxos/react-client": "0.8.4-staging.60fe92afc8"
|
|
57
90
|
},
|
|
58
91
|
"devDependencies": {
|
|
59
|
-
"@types/react": "~
|
|
60
|
-
"@types/react-dom": "~
|
|
61
|
-
"react": "~
|
|
62
|
-
"react-dom": "~
|
|
63
|
-
"vite": "
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/react-ui
|
|
66
|
-
"@dxos/
|
|
92
|
+
"@types/react": "~19.2.7",
|
|
93
|
+
"@types/react-dom": "~19.2.3",
|
|
94
|
+
"react": "~19.2.3",
|
|
95
|
+
"react-dom": "~19.2.3",
|
|
96
|
+
"vite": "^8.0.16",
|
|
97
|
+
"@dxos/plugin-testing": "0.8.4-staging.60fe92afc8",
|
|
98
|
+
"@dxos/react-ui": "0.8.4-staging.60fe92afc8",
|
|
99
|
+
"@dxos/ui-theme": "0.8.4-staging.60fe92afc8",
|
|
100
|
+
"@dxos/storybook-utils": "0.8.4-staging.60fe92afc8"
|
|
67
101
|
},
|
|
68
102
|
"peerDependencies": {
|
|
69
|
-
"effect": "
|
|
70
|
-
"react": "~
|
|
71
|
-
"react-dom": "~
|
|
72
|
-
"@dxos/react-ui": "0.8.4-
|
|
73
|
-
"@dxos/
|
|
103
|
+
"effect": "3.21.3",
|
|
104
|
+
"react": "~19.2.3",
|
|
105
|
+
"react-dom": "~19.2.3",
|
|
106
|
+
"@dxos/react-ui": "0.8.4-staging.60fe92afc8",
|
|
107
|
+
"@dxos/ui-theme": "0.8.4-staging.60fe92afc8"
|
|
74
108
|
},
|
|
75
109
|
"publishConfig": {
|
|
76
110
|
"access": "public"
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { describe, test } from 'vitest';
|
|
6
|
+
|
|
7
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
8
|
+
import { createComposerTestApp } from '@dxos/plugin-testing/harness';
|
|
9
|
+
|
|
10
|
+
import { ConductorPlugin } from '#plugin';
|
|
11
|
+
|
|
12
|
+
import { meta } from './meta';
|
|
13
|
+
|
|
14
|
+
const moduleId = (name: string) => `${meta.id}.module.${name}`;
|
|
15
|
+
|
|
16
|
+
describe('ConductorPlugin', () => {
|
|
17
|
+
test('modules activate on the expected events', async ({ expect }) => {
|
|
18
|
+
await using harness = await createComposerTestApp({
|
|
19
|
+
plugins: [ClientPlugin({}), ConductorPlugin()],
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Modules expected to be active after a normal startup.
|
|
23
|
+
expect(harness.manager.getActive()).toEqual(
|
|
24
|
+
expect.arrayContaining([moduleId('CreateObject'), moduleId('schema'), moduleId('ReactSurface')]),
|
|
25
|
+
);
|
|
26
|
+
});
|
|
27
|
+
});
|
package/src/ConductorPlugin.tsx
CHANGED
|
@@ -2,62 +2,27 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { AppPlugin } from '@dxos/app-toolkit';
|
|
6
7
|
import { ComputeGraph } from '@dxos/conductor';
|
|
7
|
-
import {
|
|
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';
|
|
8
|
+
import { CanvasBoard } from '@dxos/react-ui-canvas-editor';
|
|
12
9
|
|
|
13
|
-
import {
|
|
14
|
-
import { meta } from '
|
|
15
|
-
import { translations } from '
|
|
16
|
-
import { ConductorAction } from './types';
|
|
10
|
+
import { CreateObject, ReactSurface } from '#capabilities';
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { translations } from '#translations';
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
}),
|
|
35
|
-
}),
|
|
36
|
-
defineModule({
|
|
37
|
-
id: `${meta.id}/module/object-form`,
|
|
38
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
39
|
-
activate: () =>
|
|
40
|
-
contributes(
|
|
41
|
-
SpaceCapabilities.ObjectForm,
|
|
42
|
-
defineObjectForm({
|
|
43
|
-
objectSchema: CanvasBoardType,
|
|
44
|
-
getIntent: () => createIntent(ConductorAction.Create),
|
|
45
|
-
}),
|
|
46
|
-
),
|
|
47
|
-
}),
|
|
48
|
-
defineModule({
|
|
49
|
-
id: `${meta.id}/module/schema`,
|
|
50
|
-
activatesOn: ClientEvents.SetupSchema,
|
|
51
|
-
activate: () => contributes(ClientCapabilities.Schema, [ComputeGraph, FunctionTrigger]),
|
|
52
|
-
}),
|
|
53
|
-
defineModule({
|
|
54
|
-
id: `${meta.id}/module/react-surface`,
|
|
55
|
-
activatesOn: Events.SetupReactSurface,
|
|
56
|
-
activate: ReactSurface,
|
|
57
|
-
}),
|
|
58
|
-
defineModule({
|
|
59
|
-
id: `${meta.id}/module/intent-resolver`,
|
|
60
|
-
activatesOn: Events.SetupIntentResolver,
|
|
61
|
-
activate: IntentResolver,
|
|
62
|
-
}),
|
|
63
|
-
]);
|
|
14
|
+
// eslint-disable-next-line import/no-relative-packages
|
|
15
|
+
import pluginSpec from '../PLUGIN.mdl?raw';
|
|
16
|
+
|
|
17
|
+
export const ConductorPlugin = Plugin.define(meta).pipe(
|
|
18
|
+
AppPlugin.addCreateObjectModule({ activate: CreateObject }),
|
|
19
|
+
AppPlugin.addSchemaModule({ schema: [CanvasBoard.CanvasBoard, ComputeGraph] }),
|
|
20
|
+
AppPlugin.addSurfaceModule({ activate: ReactSurface }),
|
|
21
|
+
AppPlugin.addTranslationsModule({ translations }),
|
|
22
|
+
AppPlugin.addPluginAssetModule({
|
|
23
|
+
asset: { pluginId: meta.id, path: 'PLUGIN.mdl', content: pluginSpec, mimeType: 'application/x-mdl' },
|
|
24
|
+
}),
|
|
25
|
+
Plugin.make,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default ConductorPlugin;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
10
|
+
import { SpaceOperation } from '@dxos/plugin-space';
|
|
11
|
+
import { SpaceCapabilities } from '@dxos/plugin-space';
|
|
12
|
+
import { CanvasBoard } from '@dxos/react-ui-canvas-editor';
|
|
13
|
+
|
|
14
|
+
export default Capability.makeModule(
|
|
15
|
+
Effect.fnUntraced(function* () {
|
|
16
|
+
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
17
|
+
id: Type.getTypename(CanvasBoard.CanvasBoard),
|
|
18
|
+
createObject: (props, options) =>
|
|
19
|
+
Effect.gen(function* () {
|
|
20
|
+
const object = CanvasBoard.make(props);
|
|
21
|
+
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
22
|
+
object,
|
|
23
|
+
target: options.target,
|
|
24
|
+
hidden: true,
|
|
25
|
+
targetNodeId: options.targetNodeId,
|
|
26
|
+
});
|
|
27
|
+
}),
|
|
28
|
+
});
|
|
29
|
+
}),
|
|
30
|
+
);
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
export const
|
|
8
|
-
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
7
|
+
export const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));
|
|
8
|
+
export const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));
|
|
@@ -2,22 +2,31 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
|
|
7
|
-
import { Capabilities,
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { Capabilities, Capability } from '@dxos/app-framework';
|
|
9
|
+
import { Surface } from '@dxos/app-framework/ui';
|
|
10
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
11
|
+
import { CanvasBoard } from '@dxos/react-ui-canvas-editor';
|
|
10
12
|
|
|
11
|
-
import {
|
|
12
|
-
import { CONDUCTOR_PLUGIN } from '../meta';
|
|
13
|
+
import { CanvasArticle } from '#containers';
|
|
13
14
|
|
|
14
|
-
export default () =>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
export default Capability.makeModule(() =>
|
|
16
|
+
Effect.succeed(
|
|
17
|
+
Capability.contributes(
|
|
18
|
+
Capabilities.ReactSurface,
|
|
19
|
+
Surface.create({
|
|
20
|
+
id: 'root',
|
|
21
|
+
// TODO(wittjosiah): Split into multiple surfaces if this filter proves too strict for non-article roles.
|
|
22
|
+
filter: AppSurface.oneOf(
|
|
23
|
+
AppSurface.object(AppSurface.Article, CanvasBoard.CanvasBoard),
|
|
24
|
+
AppSurface.object(AppSurface.Section, CanvasBoard.CanvasBoard),
|
|
25
|
+
),
|
|
26
|
+
component: ({ data, role }) => (
|
|
27
|
+
<CanvasArticle role={role} subject={data.subject} attendableId={data.attendableId} />
|
|
28
|
+
),
|
|
29
|
+
}),
|
|
30
|
+
),
|
|
31
|
+
),
|
|
32
|
+
);
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Exit from 'effect/Exit';
|
|
7
|
+
import React, { Fragment, useEffect, useMemo, useRef } from 'react';
|
|
8
|
+
|
|
9
|
+
import { AiService } from '@dxos/ai';
|
|
10
|
+
import { Capabilities } from '@dxos/app-framework';
|
|
11
|
+
import { useCapability } from '@dxos/app-framework/ui';
|
|
12
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
13
|
+
import { Credential, Operation, OperationRegistry, ServiceResolver } from '@dxos/compute';
|
|
14
|
+
import { ComputeGraphModel } from '@dxos/conductor';
|
|
15
|
+
import { Database, Feed, Obj } from '@dxos/echo';
|
|
16
|
+
import { useObject } from '@dxos/react-client/echo';
|
|
17
|
+
import { Flex, type FlexProps } from '@dxos/react-ui';
|
|
18
|
+
import {
|
|
19
|
+
ComputeContext,
|
|
20
|
+
ComputeGraphController,
|
|
21
|
+
type ComputeShape,
|
|
22
|
+
ComputeShapeLayout,
|
|
23
|
+
computeShapes,
|
|
24
|
+
useComputeGraphController,
|
|
25
|
+
useGraphMonitor,
|
|
26
|
+
} from '@dxos/react-ui-canvas-compute';
|
|
27
|
+
import {
|
|
28
|
+
type CanvasBoard,
|
|
29
|
+
CanvasGraphModel,
|
|
30
|
+
Editor,
|
|
31
|
+
type EditorController,
|
|
32
|
+
KeyboardContainer,
|
|
33
|
+
ShapeRegistry,
|
|
34
|
+
} from '@dxos/react-ui-canvas-editor';
|
|
35
|
+
|
|
36
|
+
export type CanvasArticleProps = AppSurface.ObjectArticleProps<CanvasBoard.CanvasBoard>;
|
|
37
|
+
|
|
38
|
+
export const CanvasArticle = ({ role, subject, attendableId: _attendableId }: CanvasArticleProps) => {
|
|
39
|
+
const [canvas] = useObject(subject);
|
|
40
|
+
const id = Obj.getURI(canvas);
|
|
41
|
+
const graph = useMemo(
|
|
42
|
+
() => CanvasGraphModel.create<ComputeShape>(canvas.layout, (fn) => Obj.update(subject, fn)),
|
|
43
|
+
[subject, canvas.layout],
|
|
44
|
+
);
|
|
45
|
+
const controller = useGraphController(subject);
|
|
46
|
+
const graphMonitor = useGraphMonitor(controller?.graph);
|
|
47
|
+
const registry = useMemo(() => new ShapeRegistry(computeShapes), []);
|
|
48
|
+
const editorRef = useRef<EditorController>(null);
|
|
49
|
+
useComputeGraphController({ controller, graph, editorRef });
|
|
50
|
+
|
|
51
|
+
// Layout.
|
|
52
|
+
const layout = useMemo(
|
|
53
|
+
() => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),
|
|
54
|
+
[controller, registry],
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
if (!controller) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const Root = role === 'section' ? Container : Fragment;
|
|
62
|
+
|
|
63
|
+
return (
|
|
64
|
+
<ComputeContext.Provider value={{ controller }}>
|
|
65
|
+
<Root>
|
|
66
|
+
<KeyboardContainer id={id}>
|
|
67
|
+
<Editor.Root
|
|
68
|
+
id={id}
|
|
69
|
+
ref={editorRef}
|
|
70
|
+
graph={graph}
|
|
71
|
+
graphMonitor={graphMonitor as any}
|
|
72
|
+
registry={registry}
|
|
73
|
+
layout={layout}
|
|
74
|
+
>
|
|
75
|
+
<Editor.Canvas />
|
|
76
|
+
<Editor.UI showTools />
|
|
77
|
+
</Editor.Root>
|
|
78
|
+
</KeyboardContainer>
|
|
79
|
+
</Root>
|
|
80
|
+
</ComputeContext.Provider>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const Container = (props: FlexProps) => <Flex {...props} classNames='aspect-square' />;
|
|
85
|
+
|
|
86
|
+
const useGraphController = (canvas: CanvasBoard.CanvasBoard) => {
|
|
87
|
+
const db = Obj.getDatabase(canvas);
|
|
88
|
+
const processManagerRuntime = useCapability(Capabilities.ProcessManagerRuntime);
|
|
89
|
+
const [computeGraph] = useObject(canvas.computeGraph);
|
|
90
|
+
const controller = useMemo(() => {
|
|
91
|
+
if (!canvas.computeGraph?.target || !db) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
const spaceId = db.spaceId;
|
|
95
|
+
const model = new ComputeGraphModel(canvas.computeGraph?.target);
|
|
96
|
+
const spaceLayer = ServiceResolver.provide(
|
|
97
|
+
{ space: spaceId },
|
|
98
|
+
AiService.AiService,
|
|
99
|
+
Database.Service,
|
|
100
|
+
Feed.FeedService,
|
|
101
|
+
Credential.CredentialsService,
|
|
102
|
+
Operation.Service,
|
|
103
|
+
OperationRegistry.Service,
|
|
104
|
+
);
|
|
105
|
+
const computeGraphRuntime = {
|
|
106
|
+
runPromiseExit: <A, E>(effect: Effect.Effect<A, E, any>): Promise<Exit.Exit<A, E>> =>
|
|
107
|
+
processManagerRuntime.runPromiseExit(effect.pipe(Effect.provide(spaceLayer)) as any) as Promise<
|
|
108
|
+
Exit.Exit<A, E>
|
|
109
|
+
>,
|
|
110
|
+
};
|
|
111
|
+
const controller = new ComputeGraphController(computeGraphRuntime, model);
|
|
112
|
+
return controller;
|
|
113
|
+
}, [computeGraph, db, processManagerRuntime]);
|
|
114
|
+
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (!controller) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
void controller.open();
|
|
121
|
+
return () => {
|
|
122
|
+
void controller.close();
|
|
123
|
+
};
|
|
124
|
+
}, [controller]);
|
|
125
|
+
|
|
126
|
+
return controller;
|
|
127
|
+
};
|
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,17 +2,33 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
7
|
+
import { trim } from '@dxos/util';
|
|
6
8
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: CONDUCTOR_PLUGIN,
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.conductor'),
|
|
11
11
|
name: 'Conductor',
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
author: 'DXOS',
|
|
13
|
+
description: trim`
|
|
14
|
+
Conductor is a visual node-based compute graph plugin for DXOS Composer.
|
|
15
|
+
It lets you compose reactive data pipelines by connecting typed input and output ports on a
|
|
16
|
+
drag-and-drop infinite canvas — no code required for common automation patterns.
|
|
17
|
+
|
|
18
|
+
Each node in the graph is a first-class ECHO object, so the full pipeline topology is
|
|
19
|
+
replicated to every collaborator in real time via the local-first runtime.
|
|
20
|
+
Built-in node types cover constants, templates, boolean logic, control flow, JSON transforms,
|
|
21
|
+
ECHO database access, append-only queues, and conversation threads.
|
|
22
|
+
|
|
23
|
+
AI orchestration is a first-class concern: the GPT node connects to plugin-assistant's AiService
|
|
24
|
+
and supports tool calling, streaming replies, and configurable system prompts.
|
|
25
|
+
Function nodes can invoke any Blueprint operation registered in the space, making it straightforward
|
|
26
|
+
to compose multi-step agent workflows visually and share them across teams.
|
|
27
|
+
`,
|
|
14
28
|
icon: 'ph--infinity--regular',
|
|
29
|
+
iconHue: 'sky',
|
|
15
30
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-conductor',
|
|
31
|
+
spec: 'PLUGIN.mdl',
|
|
16
32
|
tags: ['labs'],
|
|
17
33
|
screenshots: ['https://dxos.network/plugin-details-canvas-dark.png'],
|
|
18
|
-
};
|
|
34
|
+
});
|
package/src/plugin.ts
ADDED
package/src/translations.ts
CHANGED
|
@@ -2,26 +2,29 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import { Type } from '@dxos/echo';
|
|
5
6
|
import { type Resource } from '@dxos/react-ui';
|
|
6
|
-
import {
|
|
7
|
+
import { CanvasBoard } from '@dxos/react-ui-canvas-editor';
|
|
7
8
|
|
|
8
|
-
import { meta } from '
|
|
9
|
+
import { meta } from '#meta';
|
|
9
10
|
|
|
10
11
|
export const translations = [
|
|
11
12
|
{
|
|
12
13
|
'en-US': {
|
|
13
|
-
[
|
|
14
|
-
'typename
|
|
15
|
-
'typename
|
|
16
|
-
'typename
|
|
17
|
-
'typename
|
|
18
|
-
'object
|
|
19
|
-
'
|
|
20
|
-
'
|
|
14
|
+
[Type.getTypename(CanvasBoard.CanvasBoard)]: {
|
|
15
|
+
'typename.label': 'Circuit',
|
|
16
|
+
'typename.label_zero': 'Circuits',
|
|
17
|
+
'typename.label_one': 'Circuit',
|
|
18
|
+
'typename.label_other': 'Circuits',
|
|
19
|
+
'object-name.placeholder': 'New circuit',
|
|
20
|
+
'add-object.label': 'Add circuit',
|
|
21
|
+
'rename-object.label': 'Rename circuit',
|
|
22
|
+
'delete-object.label': 'Delete circuit',
|
|
23
|
+
'object-deleted.label': 'Circuit deleted',
|
|
21
24
|
},
|
|
22
25
|
[meta.id]: {
|
|
23
|
-
'plugin
|
|
24
|
-
'content
|
|
26
|
+
'plugin.name': 'Conductor',
|
|
27
|
+
'content.placeholder': 'Enter text...',
|
|
25
28
|
},
|
|
26
29
|
},
|
|
27
30
|
},
|
package/src/types/index.ts
CHANGED