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