@dxos/react-ui-canvas-compute 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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/dist/lib/browser/index.mjs +916 -1158
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +916 -1158
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/DiagnosticOverlay.d.ts.map +1 -1
- package/dist/types/src/compute-layout.d.ts.map +1 -1
- package/dist/types/src/compute.stories.d.ts +22 -1
- package/dist/types/src/compute.stories.d.ts.map +1 -1
- package/dist/types/src/graph/controller.d.ts +40 -35
- package/dist/types/src/graph/controller.d.ts.map +1 -1
- package/dist/types/src/graph/node-defs.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeGraphController.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeNodeState.d.ts +4 -5
- package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphMonitor.d.ts +2 -2
- package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -1
- package/dist/types/src/shapes/Append.d.ts +1 -1
- package/dist/types/src/shapes/Append.d.ts.map +1 -1
- package/dist/types/src/shapes/Array.d.ts +1 -1
- package/dist/types/src/shapes/Array.d.ts.map +1 -1
- package/dist/types/src/shapes/Audio.d.ts +1 -1
- package/dist/types/src/shapes/Audio.d.ts.map +1 -1
- package/dist/types/src/shapes/Beacon.d.ts +1 -1
- package/dist/types/src/shapes/Beacon.d.ts.map +1 -1
- package/dist/types/src/shapes/Boolean.d.ts +7 -7
- package/dist/types/src/shapes/Boolean.d.ts.map +1 -1
- package/dist/types/src/shapes/Chat.d.ts +1 -1
- package/dist/types/src/shapes/Chat.d.ts.map +1 -1
- package/dist/types/src/shapes/Constant.d.ts +1 -1
- package/dist/types/src/shapes/Constant.d.ts.map +1 -1
- package/dist/types/src/shapes/Database.d.ts +1 -1
- package/dist/types/src/shapes/Database.d.ts.map +1 -1
- package/dist/types/src/shapes/{Queue.d.ts → Feed.d.ts} +9 -9
- package/dist/types/src/shapes/Feed.d.ts.map +1 -0
- package/dist/types/src/shapes/Function.d.ts +1 -1
- package/dist/types/src/shapes/Function.d.ts.map +1 -1
- package/dist/types/src/shapes/Gpt.d.ts +1 -1
- package/dist/types/src/shapes/Gpt.d.ts.map +1 -1
- package/dist/types/src/shapes/GptRealtime.d.ts +1 -1
- package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -1
- package/dist/types/src/shapes/Json.d.ts +2 -2
- package/dist/types/src/shapes/Json.d.ts.map +1 -1
- package/dist/types/src/shapes/Logic.d.ts +2 -2
- package/dist/types/src/shapes/Logic.d.ts.map +1 -1
- package/dist/types/src/shapes/RNG.d.ts +2 -2
- package/dist/types/src/shapes/RNG.d.ts.map +1 -1
- package/dist/types/src/shapes/Scope.d.ts +1 -1
- package/dist/types/src/shapes/Scope.d.ts.map +1 -1
- package/dist/types/src/shapes/Surface.d.ts +1 -1
- package/dist/types/src/shapes/Surface.d.ts.map +1 -1
- package/dist/types/src/shapes/Switch.d.ts +1 -1
- package/dist/types/src/shapes/Switch.d.ts.map +1 -1
- package/dist/types/src/shapes/Table.d.ts +1 -1
- package/dist/types/src/shapes/Table.d.ts.map +1 -1
- package/dist/types/src/shapes/Template.d.ts +2 -2
- package/dist/types/src/shapes/Template.d.ts.map +1 -1
- package/dist/types/src/shapes/Text.d.ts +1 -1
- package/dist/types/src/shapes/Text.d.ts.map +1 -1
- package/dist/types/src/shapes/TextToImage.d.ts +1 -1
- package/dist/types/src/shapes/TextToImage.d.ts.map +1 -1
- package/dist/types/src/shapes/Thread.d.ts +1 -1
- package/dist/types/src/shapes/Thread.d.ts.map +1 -1
- package/dist/types/src/shapes/Trigger.d.ts +6 -4
- package/dist/types/src/shapes/Trigger.d.ts.map +1 -1
- package/dist/types/src/shapes/common/Box.d.ts +4 -4
- package/dist/types/src/shapes/common/Box.d.ts.map +1 -1
- package/dist/types/src/shapes/common/FunctionBody.d.ts +2 -2
- package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -1
- package/dist/types/src/shapes/common/TypeSelect.d.ts +1 -1
- package/dist/types/src/shapes/common/TypeSelect.d.ts.map +1 -1
- package/dist/types/src/shapes/defs.d.ts +1 -1
- package/dist/types/src/shapes/defs.d.ts.map +1 -1
- package/dist/types/src/shapes/index.d.ts +2 -2
- package/dist/types/src/shapes/index.d.ts.map +1 -1
- package/dist/types/src/testing/circuits.d.ts +18 -24
- package/dist/types/src/testing/circuits.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -58
- package/src/README.md +0 -3
- package/src/compute.stories.tsx +89 -114
- package/src/graph/controller.ts +139 -78
- package/src/graph/node-defs.ts +31 -31
- package/src/hooks/useComputeNodeState.ts +7 -8
- package/src/hooks/useGraphMonitor.ts +11 -10
- package/src/json.test.ts +3 -3
- package/src/registry.ts +2 -2
- package/src/schema.test.ts +11 -11
- package/src/shapes/Audio.tsx +1 -2
- package/src/shapes/Beacon.tsx +0 -1
- package/src/shapes/Boolean.tsx +1 -1
- package/src/shapes/Chat.tsx +0 -1
- package/src/shapes/Constant.tsx +0 -1
- package/src/shapes/{Queue.tsx → Feed.tsx} +26 -21
- package/src/shapes/Function.tsx +12 -9
- package/src/shapes/Gpt.tsx +6 -2
- package/src/shapes/Json.tsx +9 -3
- package/src/shapes/RNG.tsx +5 -2
- package/src/shapes/Scope.tsx +0 -1
- package/src/shapes/Surface.tsx +12 -4
- package/src/shapes/Switch.tsx +0 -1
- package/src/shapes/Table.tsx +3 -3
- package/src/shapes/Template.tsx +0 -1
- package/src/shapes/Text.tsx +0 -1
- package/src/shapes/Thread.tsx +12 -10
- package/src/shapes/Trigger.tsx +21 -21
- package/src/shapes/common/Box.tsx +5 -8
- package/src/shapes/common/FunctionBody.tsx +2 -2
- package/src/shapes/common/TypeSelect.tsx +1 -1
- package/src/shapes/defs.ts +3 -3
- package/src/shapes/index.ts +2 -2
- package/src/testing/circuits.ts +7 -16
- package/dist/types/src/shapes/Queue.d.ts.map +0 -1
package/package.json
CHANGED
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-canvas-compute",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.bc2380dfbc",
|
|
4
4
|
"description": "A compute graph extension for the canvas editor component.",
|
|
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
|
"type": "module",
|
|
10
14
|
"exports": {
|
|
11
15
|
".": {
|
|
12
16
|
"source": "./src/index.ts",
|
|
13
|
-
"types": "./dist/types/src/index.d.ts",
|
|
14
17
|
"browser": "./dist/lib/browser/index.mjs",
|
|
15
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
18
|
+
"node": "./dist/lib/node-esm/index.mjs",
|
|
19
|
+
"types": "./dist/types/src/index.d.ts"
|
|
16
20
|
}
|
|
17
21
|
},
|
|
18
22
|
"types": "dist/types/src/index.d.ts",
|
|
19
|
-
"typesVersions": {
|
|
20
|
-
"*": {}
|
|
21
|
-
},
|
|
22
23
|
"files": [
|
|
23
24
|
"dist",
|
|
24
25
|
"src"
|
|
@@ -26,64 +27,66 @@
|
|
|
26
27
|
"dependencies": {
|
|
27
28
|
"@antv/graphlib": "^2.0.4",
|
|
28
29
|
"@antv/layout": "^1.2.13",
|
|
29
|
-
"@effect/platform": "0.
|
|
30
|
-
"@preact-signals/safe-react": "^0.9.0",
|
|
30
|
+
"@effect/platform": "0.94.4",
|
|
31
31
|
"chess.js": "^1.0.0",
|
|
32
|
-
"@dxos/ai": "0.8.4-main.
|
|
33
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/assistant": "0.8.4-main.
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/context": "0.8.4-main.
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-
|
|
52
|
-
"@dxos/react-ui-
|
|
53
|
-
"@dxos/react-
|
|
54
|
-
"@dxos/react-ui-
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/react-ui-
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
32
|
+
"@dxos/ai": "0.8.4-main.bc2380dfbc",
|
|
33
|
+
"@dxos/app-framework": "0.8.4-main.bc2380dfbc",
|
|
34
|
+
"@dxos/app-toolkit": "0.8.4-main.bc2380dfbc",
|
|
35
|
+
"@dxos/assistant": "0.8.4-main.bc2380dfbc",
|
|
36
|
+
"@dxos/async": "0.8.4-main.bc2380dfbc",
|
|
37
|
+
"@dxos/conductor": "0.8.4-main.bc2380dfbc",
|
|
38
|
+
"@dxos/context": "0.8.4-main.bc2380dfbc",
|
|
39
|
+
"@dxos/debug": "0.8.4-main.bc2380dfbc",
|
|
40
|
+
"@dxos/echo-db": "0.8.4-main.bc2380dfbc",
|
|
41
|
+
"@dxos/compute": "0.8.4-main.bc2380dfbc",
|
|
42
|
+
"@dxos/echo": "0.8.4-main.bc2380dfbc",
|
|
43
|
+
"@dxos/edge-client": "0.8.4-main.bc2380dfbc",
|
|
44
|
+
"@dxos/effect": "0.8.4-main.bc2380dfbc",
|
|
45
|
+
"@dxos/functions": "0.8.4-main.bc2380dfbc",
|
|
46
|
+
"@dxos/functions-runtime": "0.8.4-main.bc2380dfbc",
|
|
47
|
+
"@dxos/graph": "0.8.4-main.bc2380dfbc",
|
|
48
|
+
"@dxos/log": "0.8.4-main.bc2380dfbc",
|
|
49
|
+
"@dxos/invariant": "0.8.4-main.bc2380dfbc",
|
|
50
|
+
"@dxos/keys": "0.8.4-main.bc2380dfbc",
|
|
51
|
+
"@dxos/react-client": "0.8.4-main.bc2380dfbc",
|
|
52
|
+
"@dxos/react-ui-attention": "0.8.4-main.bc2380dfbc",
|
|
53
|
+
"@dxos/react-edge-client": "0.8.4-main.bc2380dfbc",
|
|
54
|
+
"@dxos/react-ui-editor": "0.8.4-main.bc2380dfbc",
|
|
55
|
+
"@dxos/react-ui-canvas": "0.8.4-main.bc2380dfbc",
|
|
56
|
+
"@dxos/react-ui-canvas-editor": "0.8.4-main.bc2380dfbc",
|
|
57
|
+
"@dxos/react-ui-mosaic": "0.8.4-main.bc2380dfbc",
|
|
58
|
+
"@dxos/react-ui-sfx": "0.8.4-main.bc2380dfbc",
|
|
59
|
+
"@dxos/types": "0.8.4-main.bc2380dfbc",
|
|
60
|
+
"@dxos/schema": "0.8.4-main.bc2380dfbc",
|
|
61
|
+
"@dxos/util": "0.8.4-main.bc2380dfbc",
|
|
62
|
+
"@dxos/react-ui-form": "0.8.4-main.bc2380dfbc",
|
|
63
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.bc2380dfbc",
|
|
64
|
+
"@dxos/react-ui-stack": "0.8.4-main.bc2380dfbc"
|
|
60
65
|
},
|
|
61
66
|
"devDependencies": {
|
|
62
|
-
"@effect/ai": "0.
|
|
63
|
-
"@effect/experimental": "0.
|
|
67
|
+
"@effect/ai": "0.33.2",
|
|
68
|
+
"@effect/experimental": "0.58.0",
|
|
64
69
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
65
|
-
"@types/react": "~19.2.
|
|
66
|
-
"@types/react-dom": "~19.2.
|
|
67
|
-
"effect": "3.
|
|
70
|
+
"@types/react": "~19.2.7",
|
|
71
|
+
"@types/react-dom": "~19.2.3",
|
|
72
|
+
"effect": "3.20.0",
|
|
68
73
|
"lodash.defaultsdeep": "^4.6.1",
|
|
69
|
-
"react": "~19.2.
|
|
70
|
-
"react-dom": "~19.2.
|
|
71
|
-
"vite": "
|
|
72
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@dxos/echo-signals": "0.8.4-main.ae835ea",
|
|
79
|
-
"@dxos/react-ui-theme": "0.8.4-main.ae835ea"
|
|
74
|
+
"react": "~19.2.3",
|
|
75
|
+
"react-dom": "~19.2.3",
|
|
76
|
+
"vite": "^8.0.13",
|
|
77
|
+
"@dxos/app-framework": "0.8.4-main.bc2380dfbc",
|
|
78
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc",
|
|
79
|
+
"@dxos/storybook-utils": "0.8.4-main.bc2380dfbc",
|
|
80
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc",
|
|
81
|
+
"@dxos/assistant-toolkit": "0.8.4-main.bc2380dfbc",
|
|
82
|
+
"@dxos/random": "0.8.4-main.bc2380dfbc"
|
|
80
83
|
},
|
|
81
84
|
"peerDependencies": {
|
|
82
|
-
"effect": "
|
|
83
|
-
"react": "
|
|
84
|
-
"react-dom": "
|
|
85
|
-
"@dxos/react-ui
|
|
86
|
-
"@dxos/
|
|
85
|
+
"effect": "3.20.0",
|
|
86
|
+
"react": "~19.2.3",
|
|
87
|
+
"react-dom": "~19.2.3",
|
|
88
|
+
"@dxos/react-ui": "0.8.4-main.bc2380dfbc",
|
|
89
|
+
"@dxos/ui-theme": "0.8.4-main.bc2380dfbc"
|
|
87
90
|
},
|
|
88
91
|
"publishConfig": {
|
|
89
92
|
"access": "public"
|
package/src/README.md
CHANGED
package/src/compute.stories.tsx
CHANGED
|
@@ -3,29 +3,31 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
8
|
+
import * as ManagedRuntime from 'effect/ManagedRuntime';
|
|
6
9
|
import React, { type PropsWithChildren, useEffect, useMemo, useRef, useState } from 'react';
|
|
7
10
|
|
|
11
|
+
import { AiServiceTestingPreset } from '@dxos/ai/testing';
|
|
8
12
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
9
|
-
import { capabilities } from '@dxos/assistant-toolkit';
|
|
13
|
+
import { capabilities } from '@dxos/assistant-toolkit/testing';
|
|
14
|
+
import { Operation, OperationRegistry } from '@dxos/compute';
|
|
10
15
|
import { type ComputeGraphModel, type ComputeNode, type GraphDiagnostic } from '@dxos/conductor';
|
|
11
|
-
import {
|
|
16
|
+
import { Feed } from '@dxos/echo';
|
|
17
|
+
import { TestDatabaseLayer } from '@dxos/echo-db/testing';
|
|
18
|
+
import { configuredCredentialsLayer } from '@dxos/functions';
|
|
12
19
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
13
20
|
import { Select, Toolbar } from '@dxos/react-ui';
|
|
14
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
15
21
|
import { withAttention } from '@dxos/react-ui-attention/testing';
|
|
16
|
-
import {
|
|
17
|
-
CanvasGraphModel,
|
|
18
|
-
Editor,
|
|
19
|
-
type EditorController,
|
|
20
|
-
type EditorRootProps,
|
|
21
|
-
ShapeRegistry,
|
|
22
|
-
} from '@dxos/react-ui-canvas-editor';
|
|
22
|
+
import { Editor, type EditorController, type EditorRootProps, ShapeRegistry } from '@dxos/react-ui-canvas-editor';
|
|
23
23
|
import { Container, useSelection } from '@dxos/react-ui-canvas-editor/testing';
|
|
24
|
-
import {
|
|
24
|
+
import { Form } from '@dxos/react-ui-form';
|
|
25
|
+
import { Syntax } from '@dxos/react-ui-syntax-highlighter';
|
|
26
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
25
27
|
|
|
26
28
|
import { DiagnosticOverlay } from './components';
|
|
27
29
|
import { ComputeShapeLayout } from './compute-layout';
|
|
28
|
-
import { type ComputeGraphController } from './graph';
|
|
30
|
+
import { type ComputeGraphController, createComputeGraphController } from './graph';
|
|
29
31
|
import { ComputeContext, useComputeGraphController, useGraphMonitor } from './hooks';
|
|
30
32
|
import { computeShapes } from './registry';
|
|
31
33
|
import { type ComputeShape } from './shapes';
|
|
@@ -33,8 +35,8 @@ import {
|
|
|
33
35
|
createArtifactCircuit,
|
|
34
36
|
createAudioCircuit,
|
|
35
37
|
createBasicCircuit,
|
|
36
|
-
createComputeGraphController,
|
|
37
38
|
createControlCircuit,
|
|
39
|
+
createEmptyCircuit,
|
|
38
40
|
createGPTRealtimeCircuit,
|
|
39
41
|
createGptCircuit,
|
|
40
42
|
createLogicCircuit,
|
|
@@ -42,10 +44,12 @@ import {
|
|
|
42
44
|
createTransformCircuit,
|
|
43
45
|
} from './testing';
|
|
44
46
|
|
|
45
|
-
//
|
|
47
|
+
// TODO(burdon): Replace ServiceContainer.
|
|
46
48
|
|
|
47
49
|
const sidebarTypes: NonNullable<RenderProps['sidebar']>[] = ['canvas', 'compute', 'controller', 'selected'] as const;
|
|
48
50
|
|
|
51
|
+
const hiddenArg = { table: { disable: true } };
|
|
52
|
+
|
|
49
53
|
type RenderProps = EditorRootProps<ComputeShape> &
|
|
50
54
|
PropsWithChildren<{
|
|
51
55
|
init?: boolean;
|
|
@@ -59,9 +63,10 @@ const DefaultStory = ({
|
|
|
59
63
|
children,
|
|
60
64
|
graph,
|
|
61
65
|
controller = null,
|
|
62
|
-
|
|
63
|
-
sidebar: _sidebar,
|
|
66
|
+
sidebar: sidebarProp,
|
|
64
67
|
registry,
|
|
68
|
+
showGrid = true,
|
|
69
|
+
snapToGrid = true,
|
|
65
70
|
...props
|
|
66
71
|
}: RenderProps) => {
|
|
67
72
|
const editorRef = useRef<EditorController>(null);
|
|
@@ -79,7 +84,7 @@ const DefaultStory = ({
|
|
|
79
84
|
};
|
|
80
85
|
|
|
81
86
|
// Sidebar.
|
|
82
|
-
const [sidebar, setSidebar] = useState(
|
|
87
|
+
const [sidebar, setSidebar] = useState<RenderProps['sidebar']>(sidebarProp);
|
|
83
88
|
const json = useMemo(() => {
|
|
84
89
|
switch (sidebar) {
|
|
85
90
|
case 'canvas':
|
|
@@ -119,7 +124,7 @@ const DefaultStory = ({
|
|
|
119
124
|
}
|
|
120
125
|
|
|
121
126
|
return (
|
|
122
|
-
<div className='grid grid-cols-[
|
|
127
|
+
<div className='grid grid-cols-[1fr_360px] h-full w-full'>
|
|
123
128
|
<ComputeContext.Provider value={{ controller }}>
|
|
124
129
|
<Container id={id} classNames={['flex grow overflow-hidden', !sidebar && 'col-span-2']}>
|
|
125
130
|
<Editor.Root<ComputeShape>
|
|
@@ -131,6 +136,8 @@ const DefaultStory = ({
|
|
|
131
136
|
registry={registry}
|
|
132
137
|
selection={selection}
|
|
133
138
|
autoZoom
|
|
139
|
+
showGrid={showGrid}
|
|
140
|
+
snapToGrid={snapToGrid}
|
|
134
141
|
{...props}
|
|
135
142
|
>
|
|
136
143
|
<Editor.Canvas>{children}</Editor.Canvas>
|
|
@@ -144,7 +151,7 @@ const DefaultStory = ({
|
|
|
144
151
|
<Container id='sidebar' classNames='flex flex-col h-full overflow-hidden'>
|
|
145
152
|
<Toolbar.Root>
|
|
146
153
|
<Select.Root value={sidebar} onValueChange={(value) => setSidebar(value as RenderProps['sidebar'])}>
|
|
147
|
-
<Select.TriggerButton classNames='
|
|
154
|
+
<Select.TriggerButton classNames='w-full'>{sidebar}</Select.TriggerButton>
|
|
148
155
|
<Select.Portal>
|
|
149
156
|
<Select.Content>
|
|
150
157
|
<Select.Viewport>
|
|
@@ -161,12 +168,25 @@ const DefaultStory = ({
|
|
|
161
168
|
</Toolbar.Root>
|
|
162
169
|
|
|
163
170
|
<div className='flex flex-col h-full overflow-hidden divide-y divider-separator'>
|
|
171
|
+
{/* TODO(burdon): Provide schema. */}
|
|
164
172
|
{sidebar === 'selected' && selected && (
|
|
165
|
-
<
|
|
166
|
-
|
|
173
|
+
<Form.Root<ComputeNode> values={getComputeNode(selected.id) ?? {}}>
|
|
174
|
+
<Form.Viewport>
|
|
175
|
+
<Form.Content>
|
|
176
|
+
<Form.FieldSet />
|
|
177
|
+
<Form.Actions />
|
|
178
|
+
</Form.Content>
|
|
179
|
+
</Form.Viewport>
|
|
180
|
+
</Form.Root>
|
|
167
181
|
)}
|
|
168
|
-
|
|
169
|
-
|
|
182
|
+
<Syntax.Root data={json}>
|
|
183
|
+
<Syntax.Content>
|
|
184
|
+
<Syntax.Filter />
|
|
185
|
+
<Syntax.Viewport>
|
|
186
|
+
<Syntax.Code />
|
|
187
|
+
</Syntax.Viewport>
|
|
188
|
+
</Syntax.Content>
|
|
189
|
+
</Syntax.Root>
|
|
170
190
|
</div>
|
|
171
191
|
</Container>
|
|
172
192
|
)}
|
|
@@ -179,183 +199,138 @@ const meta = {
|
|
|
179
199
|
component: Editor.Root as any,
|
|
180
200
|
render: DefaultStory,
|
|
181
201
|
decorators: [
|
|
182
|
-
withTheme,
|
|
183
|
-
|
|
202
|
+
withTheme(),
|
|
203
|
+
withLayout({ layout: 'fullscreen' }),
|
|
204
|
+
withAttention(),
|
|
184
205
|
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
185
206
|
withPluginManager({ capabilities }),
|
|
186
207
|
],
|
|
187
208
|
parameters: {
|
|
188
209
|
layout: 'fullscreen',
|
|
189
210
|
},
|
|
211
|
+
argTypes: {
|
|
212
|
+
controller: hiddenArg,
|
|
213
|
+
graph: hiddenArg,
|
|
214
|
+
registry: hiddenArg,
|
|
215
|
+
sidebar: {
|
|
216
|
+
control: 'select',
|
|
217
|
+
options: [...sidebarTypes, null],
|
|
218
|
+
},
|
|
219
|
+
},
|
|
190
220
|
} satisfies Meta<typeof DefaultStory>;
|
|
191
221
|
|
|
192
222
|
export default meta;
|
|
193
223
|
|
|
194
224
|
type Story = StoryObj<typeof meta>;
|
|
195
225
|
|
|
226
|
+
const ServiceLayer = Layer.empty.pipe(
|
|
227
|
+
Layer.provideMerge(
|
|
228
|
+
Layer.mergeAll(
|
|
229
|
+
Layer.succeed(Operation.Service, {
|
|
230
|
+
invoke: () => Effect.die('Operation.Service not available in test.'),
|
|
231
|
+
schedule: () => Effect.die('Operation.Service not available in test.'),
|
|
232
|
+
invokePromise: async () => ({ error: new Error('Not available') }),
|
|
233
|
+
} as any),
|
|
234
|
+
Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),
|
|
235
|
+
),
|
|
236
|
+
),
|
|
237
|
+
Layer.provideMerge(
|
|
238
|
+
Layer.mergeAll(
|
|
239
|
+
AiServiceTestingPreset('direct'),
|
|
240
|
+
TestDatabaseLayer(),
|
|
241
|
+
configuredCredentialsLayer([]),
|
|
242
|
+
Feed.notAvailable,
|
|
243
|
+
),
|
|
244
|
+
),
|
|
245
|
+
Layer.orDie,
|
|
246
|
+
);
|
|
247
|
+
|
|
196
248
|
export const Default: Story = {
|
|
197
249
|
args: {
|
|
198
|
-
// debug: true,
|
|
199
|
-
showGrid: false,
|
|
200
|
-
snapToGrid: false,
|
|
201
|
-
sidebar: 'selected',
|
|
202
250
|
registry: new ShapeRegistry(computeShapes),
|
|
203
|
-
...createComputeGraphController(
|
|
251
|
+
...createComputeGraphController(createEmptyCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
204
252
|
},
|
|
205
253
|
};
|
|
206
254
|
|
|
207
255
|
export const Beacon: Story = {
|
|
208
256
|
args: {
|
|
209
|
-
// debug: true,
|
|
210
|
-
showGrid: false,
|
|
211
|
-
snapToGrid: false,
|
|
212
|
-
sidebar: 'selected',
|
|
213
257
|
registry: new ShapeRegistry(computeShapes),
|
|
214
|
-
...createComputeGraphController(createBasicCircuit(),
|
|
258
|
+
...createComputeGraphController(createBasicCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
215
259
|
},
|
|
216
260
|
};
|
|
217
261
|
|
|
218
262
|
export const Transform: Story = {
|
|
219
263
|
args: {
|
|
220
|
-
// debug: true,
|
|
221
|
-
showGrid: false,
|
|
222
|
-
snapToGrid: false,
|
|
223
|
-
sidebar: 'selected',
|
|
224
264
|
registry: new ShapeRegistry(computeShapes),
|
|
225
|
-
...createComputeGraphController(createTransformCircuit(),
|
|
265
|
+
...createComputeGraphController(createTransformCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
226
266
|
},
|
|
227
267
|
};
|
|
228
268
|
|
|
229
269
|
export const Logic: Story = {
|
|
230
270
|
args: {
|
|
231
|
-
// debug: true,
|
|
232
|
-
showGrid: false,
|
|
233
|
-
snapToGrid: false,
|
|
234
|
-
sidebar: 'compute',
|
|
235
271
|
registry: new ShapeRegistry(computeShapes),
|
|
236
|
-
...createComputeGraphController(createLogicCircuit(),
|
|
272
|
+
...createComputeGraphController(createLogicCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
237
273
|
},
|
|
238
274
|
};
|
|
239
275
|
|
|
240
276
|
export const Control: Story = {
|
|
241
277
|
args: {
|
|
242
|
-
// debug: true,
|
|
243
|
-
showGrid: false,
|
|
244
|
-
snapToGrid: false,
|
|
245
|
-
sidebar: 'compute',
|
|
246
278
|
registry: new ShapeRegistry(computeShapes),
|
|
247
|
-
...createComputeGraphController(createControlCircuit(),
|
|
279
|
+
...createComputeGraphController(createControlCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
248
280
|
},
|
|
249
281
|
};
|
|
250
282
|
|
|
251
283
|
export const Template: Story = {
|
|
252
284
|
args: {
|
|
253
|
-
showGrid: false,
|
|
254
|
-
snapToGrid: false,
|
|
255
|
-
// sidebar: 'controller',
|
|
256
285
|
registry: new ShapeRegistry(computeShapes),
|
|
257
|
-
...createComputeGraphController(
|
|
258
|
-
createTemplateCircuit(),
|
|
259
|
-
new ServiceContainer().setServices({
|
|
260
|
-
// ai: AiService.make(new Edge AiServiceClient({ endpoint: localServiceEndpoints.ai })),
|
|
261
|
-
}),
|
|
262
|
-
),
|
|
286
|
+
...createComputeGraphController(createTemplateCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
263
287
|
},
|
|
264
288
|
};
|
|
265
289
|
|
|
266
290
|
export const GPT: Story = {
|
|
267
291
|
args: {
|
|
268
|
-
// debug: true,
|
|
269
|
-
showGrid: false,
|
|
270
|
-
snapToGrid: false,
|
|
271
|
-
// sidebar: 'json',
|
|
272
|
-
sidebar: 'controller',
|
|
273
292
|
registry: new ShapeRegistry(computeShapes),
|
|
274
|
-
...createComputeGraphController(
|
|
275
|
-
createGptCircuit({ history: true }),
|
|
276
|
-
new ServiceContainer().setServices({
|
|
277
|
-
// ai: AiService.make(new Edge AiServiceClient({ endpoint: localServiceEndpoints.ai })),
|
|
278
|
-
}),
|
|
279
|
-
),
|
|
293
|
+
...createComputeGraphController(createGptCircuit({ history: true }), ManagedRuntime.make(ServiceLayer)),
|
|
280
294
|
},
|
|
281
295
|
};
|
|
282
296
|
|
|
283
297
|
export const Plugins: Story = {
|
|
284
298
|
args: {
|
|
285
|
-
// debug: true,
|
|
286
|
-
showGrid: false,
|
|
287
|
-
snapToGrid: false,
|
|
288
|
-
// sidebar: 'json',
|
|
289
299
|
registry: new ShapeRegistry(computeShapes),
|
|
290
300
|
...createComputeGraphController(
|
|
291
301
|
createGptCircuit({ history: true, image: true, artifact: true }),
|
|
292
|
-
|
|
293
|
-
// ai: AiService.make(new Edge AiServiceClient({ endpoint: SERVICES_CONFIG.local.ai.server })),
|
|
294
|
-
}),
|
|
302
|
+
ManagedRuntime.make(ServiceLayer),
|
|
295
303
|
),
|
|
296
304
|
},
|
|
297
305
|
};
|
|
298
306
|
|
|
299
307
|
export const Artifact: Story = {
|
|
300
308
|
args: {
|
|
301
|
-
// debug: true,
|
|
302
|
-
showGrid: false,
|
|
303
|
-
snapToGrid: false,
|
|
304
|
-
// sidebar: 'json',
|
|
305
309
|
registry: new ShapeRegistry(computeShapes),
|
|
306
|
-
...createComputeGraphController(
|
|
307
|
-
createArtifactCircuit(),
|
|
308
|
-
new ServiceContainer().setServices({
|
|
309
|
-
// ai: AiService.make(new Edge AiServiceClient({ endpoint: SERVICES_CONFIG.local.ai.server })),
|
|
310
|
-
}),
|
|
311
|
-
),
|
|
310
|
+
...createComputeGraphController(createArtifactCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
312
311
|
},
|
|
313
312
|
};
|
|
314
313
|
|
|
315
314
|
export const ImageGen: Story = {
|
|
316
315
|
args: {
|
|
317
|
-
// debug: true,
|
|
318
|
-
showGrid: false,
|
|
319
|
-
snapToGrid: false,
|
|
320
|
-
// sidebar: 'json',
|
|
321
|
-
sidebar: 'controller',
|
|
322
316
|
registry: new ShapeRegistry(computeShapes),
|
|
323
317
|
...createComputeGraphController(
|
|
324
318
|
createGptCircuit({ image: true, artifact: true }),
|
|
325
|
-
|
|
326
|
-
// ai: AiService.make(createTestAiServiceClient()),
|
|
327
|
-
}),
|
|
319
|
+
ManagedRuntime.make(ServiceLayer),
|
|
328
320
|
),
|
|
329
321
|
},
|
|
330
322
|
};
|
|
331
323
|
|
|
332
324
|
export const Audio: Story = {
|
|
333
325
|
args: {
|
|
334
|
-
// debug: true,
|
|
335
|
-
showGrid: false,
|
|
336
|
-
snapToGrid: false,
|
|
337
|
-
sidebar: 'controller',
|
|
338
326
|
registry: new ShapeRegistry(computeShapes),
|
|
339
|
-
...createComputeGraphController(
|
|
340
|
-
createAudioCircuit(),
|
|
341
|
-
new ServiceContainer().setServices({
|
|
342
|
-
// ai: AiService.make(createTestAiServiceClient()),
|
|
343
|
-
}),
|
|
344
|
-
),
|
|
327
|
+
...createComputeGraphController(createAudioCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
345
328
|
},
|
|
346
329
|
};
|
|
347
330
|
|
|
348
331
|
export const Voice: Story = {
|
|
349
332
|
args: {
|
|
350
|
-
showGrid: false,
|
|
351
|
-
snapToGrid: false,
|
|
352
|
-
sidebar: 'controller',
|
|
353
333
|
registry: new ShapeRegistry(computeShapes),
|
|
354
|
-
...createComputeGraphController(
|
|
355
|
-
createGPTRealtimeCircuit(),
|
|
356
|
-
new ServiceContainer().setServices({
|
|
357
|
-
// ai: AiService.make(createTestAiServiceClient()),
|
|
358
|
-
}),
|
|
359
|
-
),
|
|
334
|
+
...createComputeGraphController(createGPTRealtimeCircuit(), ManagedRuntime.make(ServiceLayer)),
|
|
360
335
|
},
|
|
361
336
|
};
|