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