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