@dxos/plugin-conductor 0.8.2-main.fbd8ed0 → 0.8.2-staging.42af850
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/{CanvasContainer-KJ3Y2QRX.mjs → CanvasContainer-7DXW45ZA.mjs} +45 -39
- package/dist/lib/browser/CanvasContainer-7DXW45ZA.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VSTYUXGI.mjs → chunk-4EJT5EIW.mjs} +3 -3
- package/dist/lib/{node-esm/chunk-44LPGIKR.mjs.map → browser/chunk-4EJT5EIW.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-O3LU2RKB.mjs → chunk-B4FDW7Y7.mjs} +3 -3
- package/dist/lib/browser/{chunk-O3LU2RKB.mjs.map → chunk-B4FDW7Y7.mjs.map} +1 -1
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/{intent-resolver-YHUDYVNX.mjs → intent-resolver-35HKT5XG.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-7OKWJOIW.mjs → react-surface-A7LHKDE5.mjs} +3 -3
- package/dist/lib/browser/types.mjs +2 -2
- package/dist/lib/node/{CanvasContainer-BNGQERH6.cjs → CanvasContainer-OINWTW67.cjs} +49 -43
- package/dist/lib/node/CanvasContainer-OINWTW67.cjs.map +7 -0
- package/dist/lib/node/{chunk-KU5RXEFZ.cjs → chunk-QBA2VGYG.cjs} +7 -7
- package/dist/lib/node/{chunk-KU5RXEFZ.cjs.map → chunk-QBA2VGYG.cjs.map} +1 -1
- package/dist/lib/node/{chunk-EDRUCA3G.cjs → chunk-V22Y2ZJE.cjs} +6 -6
- package/dist/lib/node/{chunk-EDRUCA3G.cjs.map → chunk-V22Y2ZJE.cjs.map} +1 -1
- package/dist/lib/node/index.cjs +15 -15
- package/dist/lib/node/{intent-resolver-WLVMTXPH.cjs → intent-resolver-PHADGRJ2.cjs} +7 -7
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-MSYCREGI.cjs → react-surface-6L4K6LHA.cjs} +7 -7
- package/dist/lib/node/types.cjs +3 -3
- package/dist/lib/node/types.cjs.map +1 -1
- package/dist/lib/node-esm/{CanvasContainer-E2DRQKOP.mjs → CanvasContainer-BTAYISKF.mjs} +45 -39
- package/dist/lib/node-esm/CanvasContainer-BTAYISKF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-44LPGIKR.mjs → chunk-7644E2YF.mjs} +3 -3
- package/dist/lib/{browser/chunk-VSTYUXGI.mjs.map → node-esm/chunk-7644E2YF.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-CBKKOZWC.mjs → chunk-PYF2G3G4.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-CBKKOZWC.mjs.map → chunk-PYF2G3G4.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +4 -4
- package/dist/lib/node-esm/{intent-resolver-GQYZ3WOY.mjs → intent-resolver-LKN6FO2X.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-2QW7VUYO.mjs → react-surface-ETZG4CR6.mjs} +3 -3
- package/dist/lib/node-esm/types.mjs +2 -2
- package/package.json +23 -21
- package/src/components/CanvasContainer.tsx +2 -2
- package/src/meta.ts +2 -2
- package/dist/lib/browser/CanvasContainer-KJ3Y2QRX.mjs.map +0 -7
- package/dist/lib/node/CanvasContainer-BNGQERH6.cjs.map +0 -7
- package/dist/lib/node-esm/CanvasContainer-E2DRQKOP.mjs.map +0 -7
- /package/dist/lib/browser/{intent-resolver-YHUDYVNX.mjs.map → intent-resolver-35HKT5XG.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-7OKWJOIW.mjs.map → react-surface-A7LHKDE5.mjs.map} +0 -0
- /package/dist/lib/node/{intent-resolver-WLVMTXPH.cjs.map → intent-resolver-PHADGRJ2.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-MSYCREGI.cjs.map → react-surface-6L4K6LHA.cjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-GQYZ3WOY.mjs.map → intent-resolver-LKN6FO2X.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-2QW7VUYO.mjs.map → react-surface-ETZG4CR6.mjs.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
CONDUCTOR_PLUGIN
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PYF2G3G4.mjs";
|
|
5
5
|
|
|
6
6
|
// packages/plugins/plugin-conductor/src/capabilities/react-surface.tsx
|
|
7
7
|
import React from "react";
|
|
@@ -11,7 +11,7 @@ import { CanvasBoardType } from "@dxos/react-ui-canvas-editor";
|
|
|
11
11
|
|
|
12
12
|
// packages/plugins/plugin-conductor/src/components/index.ts
|
|
13
13
|
import { lazy } from "react";
|
|
14
|
-
var CanvasContainer = lazy(() => import("./CanvasContainer-
|
|
14
|
+
var CanvasContainer = lazy(() => import("./CanvasContainer-BTAYISKF.mjs"));
|
|
15
15
|
|
|
16
16
|
// packages/plugins/plugin-conductor/src/capabilities/react-surface.tsx
|
|
17
17
|
var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
|
|
@@ -29,4 +29,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, createS
|
|
|
29
29
|
export {
|
|
30
30
|
react_surface_default as default
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=react-surface-
|
|
32
|
+
//# sourceMappingURL=react-surface-ETZG4CR6.mjs.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
ConductorAction
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-7644E2YF.mjs";
|
|
5
|
+
import "./chunk-PYF2G3G4.mjs";
|
|
6
6
|
export {
|
|
7
7
|
ConductorAction
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-conductor",
|
|
3
|
-
"version": "0.8.2-
|
|
3
|
+
"version": "0.8.2-staging.42af850",
|
|
4
4
|
"description": "Composer plugin for conductor.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -33,22 +33,24 @@
|
|
|
33
33
|
"src"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
+
"@preact-signals/safe-react": "^0.9.0",
|
|
36
37
|
"effect": "3.14.21",
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/conductor": "0.8.2-
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/echo
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/plugin-
|
|
49
|
-
"@dxos/react-client": "0.8.2-
|
|
50
|
-
"@dxos/react-ui-
|
|
51
|
-
"@dxos/react-ui-canvas-editor": "0.8.2-
|
|
38
|
+
"@dxos/ai": "0.8.2-staging.42af850",
|
|
39
|
+
"@dxos/app-framework": "0.8.2-staging.42af850",
|
|
40
|
+
"@dxos/conductor": "0.8.2-staging.42af850",
|
|
41
|
+
"@dxos/assistant": "0.8.2-staging.42af850",
|
|
42
|
+
"@dxos/echo": "0.8.2-staging.42af850",
|
|
43
|
+
"@dxos/edge-client": "0.8.2-staging.42af850",
|
|
44
|
+
"@dxos/echo-schema": "0.8.2-staging.42af850",
|
|
45
|
+
"@dxos/functions": "0.8.2-staging.42af850",
|
|
46
|
+
"@dxos/live-object": "0.8.2-staging.42af850",
|
|
47
|
+
"@dxos/log": "0.8.2-staging.42af850",
|
|
48
|
+
"@dxos/plugin-client": "0.8.2-staging.42af850",
|
|
49
|
+
"@dxos/plugin-space": "0.8.2-staging.42af850",
|
|
50
|
+
"@dxos/react-client": "0.8.2-staging.42af850",
|
|
51
|
+
"@dxos/react-ui-canvas-compute": "0.8.2-staging.42af850",
|
|
52
|
+
"@dxos/react-ui-canvas-editor": "0.8.2-staging.42af850",
|
|
53
|
+
"@dxos/react-ui-stack": "0.8.2-staging.42af850"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
56
|
"@types/react": "~18.2.0",
|
|
@@ -56,16 +58,16 @@
|
|
|
56
58
|
"react": "~18.2.0",
|
|
57
59
|
"react-dom": "~18.2.0",
|
|
58
60
|
"vite": "5.4.7",
|
|
59
|
-
"@dxos/react-ui-theme": "0.8.2-
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
61
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
62
|
+
"@dxos/react-ui": "0.8.2-staging.42af850",
|
|
63
|
+
"@dxos/storybook-utils": "0.8.2-staging.42af850"
|
|
62
64
|
},
|
|
63
65
|
"peerDependencies": {
|
|
64
66
|
"effect": "^3.13.3",
|
|
65
67
|
"react": "~18.2.0",
|
|
66
68
|
"react-dom": "~18.2.0",
|
|
67
|
-
"@dxos/react-ui": "0.8.2-
|
|
68
|
-
"@dxos/react-ui
|
|
69
|
+
"@dxos/react-ui-theme": "0.8.2-staging.42af850",
|
|
70
|
+
"@dxos/react-ui": "0.8.2-staging.42af850"
|
|
69
71
|
},
|
|
70
72
|
"publishConfig": {
|
|
71
73
|
"access": "public"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React, { useEffect, useMemo, useRef } from 'react';
|
|
6
6
|
|
|
7
|
-
import { AIServiceEdgeClient } from '@dxos/
|
|
7
|
+
import { AIServiceEdgeClient } from '@dxos/ai';
|
|
8
8
|
import { type Config } from '@dxos/client';
|
|
9
9
|
import { ComputeGraphModel, EdgeGpt } from '@dxos/conductor';
|
|
10
10
|
import { createStubEdgeIdentity, EdgeClient, EdgeHttpClient } from '@dxos/edge-client';
|
|
@@ -15,8 +15,8 @@ import {
|
|
|
15
15
|
ComputeGraphController,
|
|
16
16
|
type ComputeShape,
|
|
17
17
|
ComputeShapeLayout,
|
|
18
|
-
computeShapes,
|
|
19
18
|
type Services,
|
|
19
|
+
computeShapes,
|
|
20
20
|
useComputeGraphController,
|
|
21
21
|
useGraphMonitor,
|
|
22
22
|
} from '@dxos/react-ui-canvas-compute';
|
package/src/meta.ts
CHANGED
|
@@ -12,7 +12,7 @@ export const meta: PluginMeta = {
|
|
|
12
12
|
description:
|
|
13
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
14
|
icon: 'ph--infinity--regular',
|
|
15
|
-
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/
|
|
16
|
-
tags: ['
|
|
15
|
+
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-conductor',
|
|
16
|
+
tags: ['labs'],
|
|
17
17
|
screenshots: ['https://dxos.network/plugin-details-canvas-dark.png'],
|
|
18
18
|
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/CanvasContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useRef } from 'react';\n\nimport { AIServiceEdgeClient } from '@dxos/assistant';\nimport { type Config } from '@dxos/client';\nimport { ComputeGraphModel, EdgeGpt } from '@dxos/conductor';\nimport { createStubEdgeIdentity, EdgeClient, EdgeHttpClient } from '@dxos/edge-client';\nimport { useConfig } from '@dxos/react-client';\nimport { fullyQualifiedId, getSpace, type Space } from '@dxos/react-client/echo';\nimport {\n ComputeContext,\n ComputeGraphController,\n type ComputeShape,\n ComputeShapeLayout,\n computeShapes,\n type Services,\n useComputeGraphController,\n useGraphMonitor,\n} from '@dxos/react-ui-canvas-compute';\nimport {\n type CanvasBoardType,\n CanvasGraphModel,\n Editor,\n type EditorController,\n KeyboardContainer,\n ShapeRegistry,\n} from '@dxos/react-ui-canvas-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nconst createServices = (config: Config, space?: Space): Partial<Services> => {\n return {\n spaceService:\n space == null\n ? undefined\n : {\n spaceId: space.id,\n db: space.db,\n },\n gpt:\n config.values.runtime?.services?.ai?.server == null\n ? undefined\n : new EdgeGpt(new AIServiceEdgeClient({ endpoint: config.values.runtime?.services?.ai?.server })),\n edgeClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: config.values.runtime?.services?.edge?.url }),\n edgeHttpClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeHttpClient(config.values.runtime?.services?.edge?.url),\n };\n};\n\nconst useGraphController = (canvas: CanvasBoardType) => {\n const config = useConfig();\n const space = getSpace(canvas);\n const controller = useMemo(() => {\n if (!canvas.computeGraph?.target) {\n return null;\n }\n const model = new ComputeGraphModel(canvas.computeGraph?.target);\n const controller = new ComputeGraphController(model);\n controller.setServices(createServices(config, space));\n return controller;\n }, [canvas.computeGraph?.target, space]);\n\n useEffect(() => {\n if (!controller) {\n return;\n }\n void controller.open();\n return () => {\n void controller.close();\n };\n }, [controller]);\n\n return controller;\n};\n\nexport const CanvasContainer = ({ canvas, role }: { canvas: CanvasBoardType; role: string }) => {\n const id = fullyQualifiedId(canvas);\n const graph = useMemo(() => CanvasGraphModel.create<ComputeShape>(canvas.layout), [canvas.layout]);\n const controller = useGraphController(canvas);\n const graphMonitor = useGraphMonitor(controller?.graph);\n const registry = useMemo(() => new ShapeRegistry(computeShapes), []);\n const editorRef = useRef<EditorController>(null);\n useComputeGraphController({ controller, graph, editorRef });\n\n // Layout.\n const layout = useMemo(\n () => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),\n [controller, registry],\n );\n\n if (!controller) {\n return;\n }\n\n return (\n <ComputeContext.Provider value={{ controller }}>\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <KeyboardContainer id={id}>\n <Editor.Root\n id={id}\n ref={editorRef}\n graph={graph}\n graphMonitor={graphMonitor as any}\n registry={registry}\n layout={layout}\n >\n <Editor.Canvas />\n <Editor.UI showTools />\n </Editor.Root>\n </KeyboardContainer>\n </StackItem.Content>\n </ComputeContext.Provider>\n );\n};\n\nexport default CanvasContainer;\n"],
|
|
5
|
-
"mappings": ";AAIA,OAAOA,SAASC,WAAWC,SAASC,cAAc;AAElD,SAASC,2BAA2B;AAEpC,SAASC,mBAAmBC,eAAe;AAC3C,SAASC,wBAAwBC,YAAYC,sBAAsB;AACnE,SAASC,iBAAiB;AAC1B,SAASC,kBAAkBC,gBAA4B;AACvD,SACEC,gBACAC,wBAEAC,oBACAC,eAEAC,2BACAC,uBACK;AACP,SAEEC,kBACAC,QAEAC,mBACAC,qBACK;AACP,SAASC,iBAAiB;AAE1B,IAAMC,iBAAiB,CAACC,QAAgBC,UAAAA;AACtC,SAAO;IACLC,cACED,SAAS,OACLE,SACA;MACEC,SAASH,MAAMI;MACfC,IAAIL,MAAMK;IACZ;IACNC,KACEP,OAAOQ,OAAOC,SAASC,UAAUC,IAAIC,UAAU,OAC3CT,SACA,IAAIU,QAAQ,IAAIC,oBAAoB;MAAEC,UAAUf,OAAOQ,OAAOC,SAASC,UAAUC,IAAIC;IAAO,CAAA,CAAA;IAClGI,YACEhB,OAAOQ,OAAOC,SAASC,UAAUO,MAAMC,OAAO,OAC1Cf,SACA,IAAIgB,WAAWC,uBAAAA,GAA0B;MAAEC,gBAAgBrB,OAAOQ,OAAOC,SAASC,UAAUO,MAAMC;IAAI,CAAA;IAC5GI,gBACEtB,OAAOQ,OAAOC,SAASC,UAAUO,MAAMC,OAAO,OAC1Cf,SACA,IAAIoB,eAA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AY;AACf;EACF;AAEA,SACE,sBAAA,cAAC2B,eAAeC,UAAQ;IAACC,OAAO;MAAE7B;IAAW;KAC3C,sBAAA,cAAC8B,UAAUC,SAAO;IAACC,MAAMpB,SAAS,YAAY,WAAW;KACvD,sBAAA,cAACqB,mBAAAA;IAAkBxD;KACjB,sBAAA,cAACyD,OAAOC,MAAI;IACV1D;IACA2D,KAAKb;IACLT;IACAI;IACAE;IACAH;KAEA,sBAAA,cAACiB,OAAOG,QAAM,IAAA,GACd,sBAAA,cAACH,OAAOI,IAAE;IAACC,WAAAA;;AAMvB;AAEA,IAAA,0BAAe5B;",
|
|
6
|
-
"names": ["React", "useEffect", "useMemo", "useRef", "AIServiceEdgeClient", "ComputeGraphModel", "EdgeGpt", "createStubEdgeIdentity", "EdgeClient", "EdgeHttpClient", "useConfig", "fullyQualifiedId", "getSpace", "ComputeContext", "ComputeGraphController", "ComputeShapeLayout", "computeShapes", "useComputeGraphController", "useGraphMonitor", "CanvasGraphModel", "Editor", "KeyboardContainer", "ShapeRegistry", "StackItem", "createServices", "config", "space", "spaceService", "undefined", "spaceId", "id", "db", "gpt", "values", "runtime", "services", "ai", "server", "EdgeGpt", "AIServiceEdgeClient", "endpoint", "edgeClient", "edge", "url", "EdgeClient", "createStubEdgeIdentity", "socketEndpoint", "edgeHttpClient", "EdgeHttpClient", "useGraphController", "canvas", "useConfig", "getSpace", "controller", "useMemo", "computeGraph", "target", "model", "ComputeGraphModel", "ComputeGraphController", "setServices", "useEffect", "open", "close", "CanvasContainer", "role", "fullyQualifiedId", "graph", "CanvasGraphModel", "create", "layout", "graphMonitor", "useGraphMonitor", "registry", "ShapeRegistry", "computeShapes", "editorRef", "useRef", "useComputeGraphController", "ComputeShapeLayout", "ComputeContext", "Provider", "value", "StackItem", "Content", "size", "KeyboardContainer", "Editor", "Root", "ref", "Canvas", "UI", "showTools"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/CanvasContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useRef } from 'react';\n\nimport { AIServiceEdgeClient } from '@dxos/assistant';\nimport { type Config } from '@dxos/client';\nimport { ComputeGraphModel, EdgeGpt } from '@dxos/conductor';\nimport { createStubEdgeIdentity, EdgeClient, EdgeHttpClient } from '@dxos/edge-client';\nimport { useConfig } from '@dxos/react-client';\nimport { fullyQualifiedId, getSpace, type Space } from '@dxos/react-client/echo';\nimport {\n ComputeContext,\n ComputeGraphController,\n type ComputeShape,\n ComputeShapeLayout,\n computeShapes,\n type Services,\n useComputeGraphController,\n useGraphMonitor,\n} from '@dxos/react-ui-canvas-compute';\nimport {\n type CanvasBoardType,\n CanvasGraphModel,\n Editor,\n type EditorController,\n KeyboardContainer,\n ShapeRegistry,\n} from '@dxos/react-ui-canvas-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nconst createServices = (config: Config, space?: Space): Partial<Services> => {\n return {\n spaceService:\n space == null\n ? undefined\n : {\n spaceId: space.id,\n db: space.db,\n },\n gpt:\n config.values.runtime?.services?.ai?.server == null\n ? undefined\n : new EdgeGpt(new AIServiceEdgeClient({ endpoint: config.values.runtime?.services?.ai?.server })),\n edgeClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: config.values.runtime?.services?.edge?.url }),\n edgeHttpClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeHttpClient(config.values.runtime?.services?.edge?.url),\n };\n};\n\nconst useGraphController = (canvas: CanvasBoardType) => {\n const config = useConfig();\n const space = getSpace(canvas);\n const controller = useMemo(() => {\n if (!canvas.computeGraph?.target) {\n return null;\n }\n const model = new ComputeGraphModel(canvas.computeGraph?.target);\n const controller = new ComputeGraphController(model);\n controller.setServices(createServices(config, space));\n return controller;\n }, [canvas.computeGraph?.target, space]);\n\n useEffect(() => {\n if (!controller) {\n return;\n }\n void controller.open();\n return () => {\n void controller.close();\n };\n }, [controller]);\n\n return controller;\n};\n\nexport const CanvasContainer = ({ canvas, role }: { canvas: CanvasBoardType; role: string }) => {\n const id = fullyQualifiedId(canvas);\n const graph = useMemo(() => CanvasGraphModel.create<ComputeShape>(canvas.layout), [canvas.layout]);\n const controller = useGraphController(canvas);\n const graphMonitor = useGraphMonitor(controller?.graph);\n const registry = useMemo(() => new ShapeRegistry(computeShapes), []);\n const editorRef = useRef<EditorController>(null);\n useComputeGraphController({ controller, graph, editorRef });\n\n // Layout.\n const layout = useMemo(\n () => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),\n [controller, registry],\n );\n\n if (!controller) {\n return;\n }\n\n return (\n <ComputeContext.Provider value={{ controller }}>\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <KeyboardContainer id={id}>\n <Editor.Root\n id={id}\n ref={editorRef}\n graph={graph}\n graphMonitor={graphMonitor as any}\n registry={registry}\n layout={layout}\n >\n <Editor.Canvas />\n <Editor.UI showTools />\n </Editor.Root>\n </KeyboardContainer>\n </StackItem.Content>\n </ComputeContext.Provider>\n );\n};\n\nexport default CanvasContainer;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,mBAAkD;AAElD,uBAAoC;AAEpC,uBAA2C;AAC3C,yBAAmE;AACnE,0BAA0B;AAC1B,kBAAuD;AACvD,qCASO;AACP,oCAOO;AACP,4BAA0B;AAE1B,IAAMA,iBAAiB,CAACC,QAAgBC,UAAAA;AACtC,SAAO;IACLC,cACED,SAAS,OACLE,SACA;MACEC,SAASH,MAAMI;MACfC,IAAIL,MAAMK;IACZ;IACNC,KACEP,OAAOQ,OAAOC,SAASC,UAAUC,IAAIC,UAAU,OAC3CT,SACA,IAAIU,yBAAQ,IAAIC,qCAAoB;MAAEC,UAAUf,OAAOQ,OAAOC,SAASC,UAAUC,IAAIC;I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,MAAM,IAAIoB,4CAAcC,4CAAAA,GAAgB,CAAA,CAAE;AACnE,QAAMC,gBAAYC,qBAAyB,IAAA;AAC3CC,gEAA0B;IAAEzB;IAAYc;IAAOS;EAAU,CAAA;AAGzD,QAAMN,aAAShB,sBACb,MAAOD,cAAcoB,WAAW,IAAIM,kDAAmB1B,YAAYoB,QAAAA,IAAY7C,QAC/E;IAACyB;IAAYoB;GAAS;AAGxB,MAAI,CAACpB,YAAY;AACf;EACF;AAEA,SACE,6BAAA2B,QAAA,cAACC,8CAAeC,UAAQ;IAACC,OAAO;MAAE9B;IAAW;KAC3C,6BAAA2B,QAAA,cAACI,gCAAUC,SAAO;IAACC,MAAMrB,SAAS,YAAY,WAAW;KACvD,6BAAAe,QAAA,cAACO,iDAAAA;IAAkBzD;KACjB,6BAAAkD,QAAA,cAACQ,qCAAOC,MAAI;IACV3D;IACA4D,KAAKd;IACLT;IACAI;IACAE;IACAH;KAEA,6BAAAU,QAAA,cAACQ,qCAAOG,QAAM,IAAA,GACd,6BAAAX,QAAA,cAACQ,qCAAOI,IAAE;IAACC,WAAAA;;AAMvB;AAEA,IAAA,0BAAe7B;",
|
|
6
|
-
"names": ["createServices", "config", "space", "spaceService", "undefined", "spaceId", "id", "db", "gpt", "values", "runtime", "services", "ai", "server", "EdgeGpt", "AIServiceEdgeClient", "endpoint", "edgeClient", "edge", "url", "EdgeClient", "createStubEdgeIdentity", "socketEndpoint", "edgeHttpClient", "EdgeHttpClient", "useGraphController", "canvas", "useConfig", "getSpace", "controller", "useMemo", "computeGraph", "target", "model", "ComputeGraphModel", "ComputeGraphController", "setServices", "useEffect", "open", "close", "CanvasContainer", "role", "fullyQualifiedId", "graph", "CanvasGraphModel", "create", "layout", "graphMonitor", "useGraphMonitor", "registry", "ShapeRegistry", "computeShapes", "editorRef", "useRef", "useComputeGraphController", "ComputeShapeLayout", "React", "ComputeContext", "Provider", "value", "StackItem", "Content", "size", "KeyboardContainer", "Editor", "Root", "ref", "Canvas", "UI", "showTools"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/CanvasContainer.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useEffect, useMemo, useRef } from 'react';\n\nimport { AIServiceEdgeClient } from '@dxos/assistant';\nimport { type Config } from '@dxos/client';\nimport { ComputeGraphModel, EdgeGpt } from '@dxos/conductor';\nimport { createStubEdgeIdentity, EdgeClient, EdgeHttpClient } from '@dxos/edge-client';\nimport { useConfig } from '@dxos/react-client';\nimport { fullyQualifiedId, getSpace, type Space } from '@dxos/react-client/echo';\nimport {\n ComputeContext,\n ComputeGraphController,\n type ComputeShape,\n ComputeShapeLayout,\n computeShapes,\n type Services,\n useComputeGraphController,\n useGraphMonitor,\n} from '@dxos/react-ui-canvas-compute';\nimport {\n type CanvasBoardType,\n CanvasGraphModel,\n Editor,\n type EditorController,\n KeyboardContainer,\n ShapeRegistry,\n} from '@dxos/react-ui-canvas-editor';\nimport { StackItem } from '@dxos/react-ui-stack';\n\nconst createServices = (config: Config, space?: Space): Partial<Services> => {\n return {\n spaceService:\n space == null\n ? undefined\n : {\n spaceId: space.id,\n db: space.db,\n },\n gpt:\n config.values.runtime?.services?.ai?.server == null\n ? undefined\n : new EdgeGpt(new AIServiceEdgeClient({ endpoint: config.values.runtime?.services?.ai?.server })),\n edgeClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeClient(createStubEdgeIdentity(), { socketEndpoint: config.values.runtime?.services?.edge?.url }),\n edgeHttpClient:\n config.values.runtime?.services?.edge?.url == null\n ? undefined\n : new EdgeHttpClient(config.values.runtime?.services?.edge?.url),\n };\n};\n\nconst useGraphController = (canvas: CanvasBoardType) => {\n const config = useConfig();\n const space = getSpace(canvas);\n const controller = useMemo(() => {\n if (!canvas.computeGraph?.target) {\n return null;\n }\n const model = new ComputeGraphModel(canvas.computeGraph?.target);\n const controller = new ComputeGraphController(model);\n controller.setServices(createServices(config, space));\n return controller;\n }, [canvas.computeGraph?.target, space]);\n\n useEffect(() => {\n if (!controller) {\n return;\n }\n void controller.open();\n return () => {\n void controller.close();\n };\n }, [controller]);\n\n return controller;\n};\n\nexport const CanvasContainer = ({ canvas, role }: { canvas: CanvasBoardType; role: string }) => {\n const id = fullyQualifiedId(canvas);\n const graph = useMemo(() => CanvasGraphModel.create<ComputeShape>(canvas.layout), [canvas.layout]);\n const controller = useGraphController(canvas);\n const graphMonitor = useGraphMonitor(controller?.graph);\n const registry = useMemo(() => new ShapeRegistry(computeShapes), []);\n const editorRef = useRef<EditorController>(null);\n useComputeGraphController({ controller, graph, editorRef });\n\n // Layout.\n const layout = useMemo(\n () => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),\n [controller, registry],\n );\n\n if (!controller) {\n return;\n }\n\n return (\n <ComputeContext.Provider value={{ controller }}>\n <StackItem.Content size={role === 'section' ? 'square' : 'intrinsic'}>\n <KeyboardContainer id={id}>\n <Editor.Root\n id={id}\n ref={editorRef}\n graph={graph}\n graphMonitor={graphMonitor as any}\n registry={registry}\n layout={layout}\n >\n <Editor.Canvas />\n <Editor.UI showTools />\n </Editor.Root>\n </KeyboardContainer>\n </StackItem.Content>\n </ComputeContext.Provider>\n );\n};\n\nexport default CanvasContainer;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,SAASC,WAAWC,SAASC,cAAc;AAElD,SAASC,2BAA2B;AAEpC,SAASC,mBAAmBC,eAAe;AAC3C,SAASC,wBAAwBC,YAAYC,sBAAsB;AACnE,SAASC,iBAAiB;AAC1B,SAASC,kBAAkBC,gBAA4B;AACvD,SACEC,gBACAC,wBAEAC,oBACAC,eAEAC,2BACAC,uBACK;AACP,SAEEC,kBACAC,QAEAC,mBACAC,qBACK;AACP,SAASC,iBAAiB;AAE1B,IAAMC,iBAAiB,CAACC,QAAgBC,UAAAA;AACtC,SAAO;IACLC,cACED,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QAAMiB,QAAQb,QAAQ,MAAMc,iBAAiBC,OAAqBnB,OAAOoB,MAAM,GAAG;IAACpB,OAAOoB;GAAO;AACjG,QAAMjB,aAAaJ,mBAAmBC,MAAAA;AACtC,QAAMqB,eAAeC,gBAAgBnB,YAAYc,KAAAA;AACjD,QAAMM,WAAWnB,QAAQ,MAAM,IAAIoB,cAAcC,aAAAA,GAAgB,CAAA,CAAE;AACnE,QAAMC,YAAYC,OAAyB,IAAA;AAC3CC,4BAA0B;IAAEzB;IAAYc;IAAOS;EAAU,CAAA;AAGzD,QAAMN,SAAShB,QACb,MAAOD,cAAcoB,WAAW,IAAIM,mBAAmB1B,YAAYoB,QAAAA,IAAY7C,QAC/E;IAACyB;IAAYoB;GAAS;AAGxB,MAAI,CAACpB,YAAY;AACf;EACF;AAEA,SACE,sBAAA,cAAC2B,eAAeC,UAAQ;IAACC,OAAO;MAAE7B;IAAW;KAC3C,sBAAA,cAAC8B,UAAUC,SAAO;IAACC,MAAMpB,SAAS,YAAY,WAAW;KACvD,sBAAA,cAACqB,mBAAAA;IAAkBxD;KACjB,sBAAA,cAACyD,OAAOC,MAAI;IACV1D;IACA2D,KAAKb;IACLT;IACAI;IACAE;IACAH;KAEA,sBAAA,cAACiB,OAAOG,QAAM,IAAA,GACd,sBAAA,cAACH,OAAOI,IAAE;IAACC,WAAAA;;AAMvB;AAEA,IAAA,0BAAe5B;",
|
|
6
|
-
"names": ["React", "useEffect", "useMemo", "useRef", "AIServiceEdgeClient", "ComputeGraphModel", "EdgeGpt", "createStubEdgeIdentity", "EdgeClient", "EdgeHttpClient", "useConfig", "fullyQualifiedId", "getSpace", "ComputeContext", "ComputeGraphController", "ComputeShapeLayout", "computeShapes", "useComputeGraphController", "useGraphMonitor", "CanvasGraphModel", "Editor", "KeyboardContainer", "ShapeRegistry", "StackItem", "createServices", "config", "space", "spaceService", "undefined", "spaceId", "id", "db", "gpt", "values", "runtime", "services", "ai", "server", "EdgeGpt", "AIServiceEdgeClient", "endpoint", "edgeClient", "edge", "url", "EdgeClient", "createStubEdgeIdentity", "socketEndpoint", "edgeHttpClient", "EdgeHttpClient", "useGraphController", "canvas", "useConfig", "getSpace", "controller", "useMemo", "computeGraph", "target", "model", "ComputeGraphModel", "ComputeGraphController", "setServices", "useEffect", "open", "close", "CanvasContainer", "role", "fullyQualifiedId", "graph", "CanvasGraphModel", "create", "layout", "graphMonitor", "useGraphMonitor", "registry", "ShapeRegistry", "computeShapes", "editorRef", "useRef", "useComputeGraphController", "ComputeShapeLayout", "ComputeContext", "Provider", "value", "StackItem", "Content", "size", "KeyboardContainer", "Editor", "Root", "ref", "Canvas", "UI", "showTools"]
|
|
7
|
-
}
|
/package/dist/lib/browser/{intent-resolver-YHUDYVNX.mjs.map → intent-resolver-35HKT5XG.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node/{intent-resolver-WLVMTXPH.cjs.map → intent-resolver-PHADGRJ2.cjs.map}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{intent-resolver-GQYZ3WOY.mjs.map → intent-resolver-LKN6FO2X.mjs.map}
RENAMED
|
File without changes
|
/package/dist/lib/node-esm/{react-surface-2QW7VUYO.mjs.map → react-surface-ETZG4CR6.mjs.map}
RENAMED
|
File without changes
|