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