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