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