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