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