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