@dxos/react-ui-canvas-compute 0.7.5-labs.071a3e2
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/LICENSE +8 -0
- package/README.md +1 -0
- package/dist/lib/browser/index.mjs +2535 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/node/index.cjs +2627 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node-esm/index.mjs +2535 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/types/src/components/DiagnosticOverlay.d.ts +7 -0
- package/dist/types/src/components/DiagnosticOverlay.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/compute-layout.d.ts +9 -0
- package/dist/types/src/compute-layout.d.ts.map +1 -0
- package/dist/types/src/compute.stories.d.ts +28 -0
- package/dist/types/src/compute.stories.d.ts.map +1 -0
- package/dist/types/src/graph/controller.d.ts +142 -0
- package/dist/types/src/graph/controller.d.ts.map +1 -0
- package/dist/types/src/graph/index.d.ts +3 -0
- package/dist/types/src/graph/index.d.ts.map +1 -0
- package/dist/types/src/graph/node-defs.d.ts +6 -0
- package/dist/types/src/graph/node-defs.d.ts.map +1 -0
- package/dist/types/src/hooks/compute-context.d.ts +7 -0
- package/dist/types/src/hooks/compute-context.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +4 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useComputeNodeState.d.ts +19 -0
- package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -0
- package/dist/types/src/hooks/useGraphMonitor.d.ts +14 -0
- package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +6 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/json.test.d.ts +21 -0
- package/dist/types/src/json.test.d.ts.map +1 -0
- package/dist/types/src/registry.d.ts +9 -0
- package/dist/types/src/registry.d.ts.map +1 -0
- package/dist/types/src/schema.test.d.ts +2 -0
- package/dist/types/src/schema.test.d.ts.map +1 -0
- package/dist/types/src/shapes/Append.d.ts +54 -0
- package/dist/types/src/shapes/Append.d.ts.map +1 -0
- package/dist/types/src/shapes/Array.d.ts +38 -0
- package/dist/types/src/shapes/Array.d.ts.map +1 -0
- package/dist/types/src/shapes/Audio.d.ts +54 -0
- package/dist/types/src/shapes/Audio.d.ts.map +1 -0
- package/dist/types/src/shapes/Beacon.d.ts +54 -0
- package/dist/types/src/shapes/Beacon.d.ts.map +1 -0
- package/dist/types/src/shapes/Boolean.d.ts +233 -0
- package/dist/types/src/shapes/Boolean.d.ts.map +1 -0
- package/dist/types/src/shapes/Chat.d.ts +57 -0
- package/dist/types/src/shapes/Chat.d.ts.map +1 -0
- package/dist/types/src/shapes/Constant.d.ts +60 -0
- package/dist/types/src/shapes/Constant.d.ts.map +1 -0
- package/dist/types/src/shapes/Database.d.ts +54 -0
- package/dist/types/src/shapes/Database.d.ts.map +1 -0
- package/dist/types/src/shapes/Function.d.ts +54 -0
- package/dist/types/src/shapes/Function.d.ts.map +1 -0
- package/dist/types/src/shapes/Gpt.d.ts +54 -0
- package/dist/types/src/shapes/Gpt.d.ts.map +1 -0
- package/dist/types/src/shapes/GptRealtime.d.ts +54 -0
- package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -0
- package/dist/types/src/shapes/Json.d.ts +107 -0
- package/dist/types/src/shapes/Json.d.ts.map +1 -0
- package/dist/types/src/shapes/Logic.d.ts +109 -0
- package/dist/types/src/shapes/Logic.d.ts.map +1 -0
- package/dist/types/src/shapes/Queue.d.ts +58 -0
- package/dist/types/src/shapes/Queue.d.ts.map +1 -0
- package/dist/types/src/shapes/RNG.d.ts +58 -0
- package/dist/types/src/shapes/RNG.d.ts.map +1 -0
- package/dist/types/src/shapes/Scope.d.ts +54 -0
- package/dist/types/src/shapes/Scope.d.ts.map +1 -0
- package/dist/types/src/shapes/Surface.d.ts +54 -0
- package/dist/types/src/shapes/Surface.d.ts.map +1 -0
- package/dist/types/src/shapes/Switch.d.ts +54 -0
- package/dist/types/src/shapes/Switch.d.ts.map +1 -0
- package/dist/types/src/shapes/Table.d.ts +54 -0
- package/dist/types/src/shapes/Table.d.ts.map +1 -0
- package/dist/types/src/shapes/Template.d.ts +56 -0
- package/dist/types/src/shapes/Template.d.ts.map +1 -0
- package/dist/types/src/shapes/Text.d.ts +54 -0
- package/dist/types/src/shapes/Text.d.ts.map +1 -0
- package/dist/types/src/shapes/TextToImage.d.ts +54 -0
- package/dist/types/src/shapes/TextToImage.d.ts.map +1 -0
- package/dist/types/src/shapes/Thread.d.ts +58 -0
- package/dist/types/src/shapes/Thread.d.ts.map +1 -0
- package/dist/types/src/shapes/Trigger.d.ts +64 -0
- package/dist/types/src/shapes/Trigger.d.ts.map +1 -0
- package/dist/types/src/shapes/common/Box.d.ts +25 -0
- package/dist/types/src/shapes/common/Box.d.ts.map +1 -0
- package/dist/types/src/shapes/common/FunctionBody.d.ts +15 -0
- package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -0
- package/dist/types/src/shapes/common/TypeSelect.d.ts +4 -0
- package/dist/types/src/shapes/common/TypeSelect.d.ts.map +1 -0
- package/dist/types/src/shapes/common/index.d.ts +4 -0
- package/dist/types/src/shapes/common/index.d.ts.map +1 -0
- package/dist/types/src/shapes/defs.d.ts +39 -0
- package/dist/types/src/shapes/defs.d.ts.map +1 -0
- package/dist/types/src/shapes/index.d.ts +27 -0
- package/dist/types/src/shapes/index.d.ts.map +1 -0
- package/dist/types/src/testing/circuits.d.ts +193 -0
- package/dist/types/src/testing/circuits.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +85 -0
- package/src/README.md +47 -0
- package/src/components/DiagnosticOverlay.tsx +23 -0
- package/src/components/index.ts +5 -0
- package/src/compute-layout.ts +37 -0
- package/src/compute.stories.tsx +365 -0
- package/src/graph/controller.ts +419 -0
- package/src/graph/index.ts +6 -0
- package/src/graph/node-defs.ts +82 -0
- package/src/hooks/compute-context.ts +19 -0
- package/src/hooks/index.ts +7 -0
- package/src/hooks/useComputeNodeState.ts +83 -0
- package/src/hooks/useGraphMonitor.ts +133 -0
- package/src/index.ts +9 -0
- package/src/json.test.ts +35 -0
- package/src/registry.ts +100 -0
- package/src/schema.test.ts +62 -0
- package/src/shapes/Append.tsx +43 -0
- package/src/shapes/Array.tsx +61 -0
- package/src/shapes/Audio.tsx +55 -0
- package/src/shapes/Beacon.tsx +56 -0
- package/src/shapes/Boolean.tsx +215 -0
- package/src/shapes/Chat.tsx +77 -0
- package/src/shapes/Constant.tsx +125 -0
- package/src/shapes/Database.tsx +39 -0
- package/src/shapes/Function.tsx +40 -0
- package/src/shapes/Gpt.tsx +91 -0
- package/src/shapes/GptRealtime.tsx +175 -0
- package/src/shapes/Json.tsx +103 -0
- package/src/shapes/Logic.tsx +82 -0
- package/src/shapes/Queue.tsx +78 -0
- package/src/shapes/RNG.tsx +84 -0
- package/src/shapes/Scope.tsx +54 -0
- package/src/shapes/Surface.tsx +57 -0
- package/src/shapes/Switch.tsx +53 -0
- package/src/shapes/Table.tsx +45 -0
- package/src/shapes/Template.tsx +98 -0
- package/src/shapes/Text.tsx +56 -0
- package/src/shapes/TextToImage.tsx +39 -0
- package/src/shapes/Thread.tsx +87 -0
- package/src/shapes/Trigger.tsx +152 -0
- package/src/shapes/common/Box.tsx +74 -0
- package/src/shapes/common/FunctionBody.tsx +122 -0
- package/src/shapes/common/TypeSelect.tsx +31 -0
- package/src/shapes/common/index.ts +7 -0
- package/src/shapes/defs.ts +50 -0
- package/src/shapes/index.ts +31 -0
- package/src/testing/circuits.ts +320 -0
- package/src/testing/index.ts +5 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
8
|
+
import React, { type PropsWithChildren, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
+
|
|
10
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
|
+
import { capabilities, createEdgeServices } from '@dxos/artifact-testing';
|
|
12
|
+
import { type UnsubscribeCallback } from '@dxos/async';
|
|
13
|
+
import { type ComputeGraphModel, type ComputeNode, type GraphDiagnostic } from '@dxos/conductor';
|
|
14
|
+
import { withClientProvider } from '@dxos/react-client/testing';
|
|
15
|
+
import { Select, Toolbar } from '@dxos/react-ui';
|
|
16
|
+
import { withAttention } from '@dxos/react-ui-attention/testing';
|
|
17
|
+
import { Editor, type EditorController, type EditorRootProps, ShapeRegistry } from '@dxos/react-ui-canvas-editor';
|
|
18
|
+
import { Container, useSelection } from '@dxos/react-ui-canvas-editor/testing';
|
|
19
|
+
import { JsonFilter } from '@dxos/react-ui-syntax-highlighter';
|
|
20
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
21
|
+
|
|
22
|
+
import { DiagnosticOverlay } from './components';
|
|
23
|
+
import { ComputeShapeLayout } from './compute-layout';
|
|
24
|
+
import { type ComputeGraphController } from './graph';
|
|
25
|
+
import { ComputeContext, useGraphMonitor } from './hooks';
|
|
26
|
+
import { computeShapes } from './registry';
|
|
27
|
+
import { type ComputeShape } from './shapes';
|
|
28
|
+
import {
|
|
29
|
+
createControlCircuit,
|
|
30
|
+
createGPTRealtimeCircuit,
|
|
31
|
+
createLogicCircuit,
|
|
32
|
+
createComputeGraphController,
|
|
33
|
+
createBasicCircuit,
|
|
34
|
+
createGptCircuit,
|
|
35
|
+
createAudioCircuit,
|
|
36
|
+
createTransformCircuit,
|
|
37
|
+
createTemplateCircuit,
|
|
38
|
+
createArtifactCircuit,
|
|
39
|
+
} from './testing';
|
|
40
|
+
|
|
41
|
+
// const FormSchema = S.omit<any, any, ['subgraph']>('subgraph')(ComputeNode);
|
|
42
|
+
|
|
43
|
+
const sidebarTypes: NonNullable<RenderProps['sidebar']>[] = ['canvas', 'compute', 'controller', 'selected'] as const;
|
|
44
|
+
|
|
45
|
+
// TODO(burdon): Move to async/context?
|
|
46
|
+
const combine = (...cbs: UnsubscribeCallback[]) => {
|
|
47
|
+
return () => {
|
|
48
|
+
for (const cb of cbs) {
|
|
49
|
+
cb();
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
type RenderProps = EditorRootProps<ComputeShape> &
|
|
55
|
+
PropsWithChildren<{
|
|
56
|
+
init?: boolean;
|
|
57
|
+
sidebar?: 'canvas' | 'compute' | 'controller' | 'selected';
|
|
58
|
+
computeGraph?: ComputeGraphModel;
|
|
59
|
+
controller?: ComputeGraphController;
|
|
60
|
+
}>;
|
|
61
|
+
|
|
62
|
+
const Render = ({
|
|
63
|
+
id = 'test',
|
|
64
|
+
children,
|
|
65
|
+
graph,
|
|
66
|
+
controller,
|
|
67
|
+
init,
|
|
68
|
+
sidebar: _sidebar,
|
|
69
|
+
registry,
|
|
70
|
+
...props
|
|
71
|
+
}: RenderProps) => {
|
|
72
|
+
const [, forceUpdate] = useState({});
|
|
73
|
+
|
|
74
|
+
const editorRef = useRef<EditorController>(null);
|
|
75
|
+
|
|
76
|
+
// Selection.
|
|
77
|
+
const [selection, selected] = useSelection(graph);
|
|
78
|
+
|
|
79
|
+
const getComputeNode = (id?: string): ComputeNode | undefined => {
|
|
80
|
+
if (id) {
|
|
81
|
+
const node = graph?.getNode(id) as ComputeShape;
|
|
82
|
+
if (node?.node) {
|
|
83
|
+
return controller?.graph.getNode(node.node);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// Sidebar.
|
|
89
|
+
const [sidebar, setSidebar] = useState(_sidebar);
|
|
90
|
+
const json = useMemo(() => {
|
|
91
|
+
switch (sidebar) {
|
|
92
|
+
case 'canvas':
|
|
93
|
+
return { graph };
|
|
94
|
+
case 'compute':
|
|
95
|
+
return { graph: controller?.graph };
|
|
96
|
+
case 'controller':
|
|
97
|
+
return { state: controller?.state };
|
|
98
|
+
case 'selected':
|
|
99
|
+
return { shape: selected, compute: getComputeNode(selected?.id) };
|
|
100
|
+
}
|
|
101
|
+
}, [graph, controller, sidebar, selected]);
|
|
102
|
+
|
|
103
|
+
// Controller.
|
|
104
|
+
useEffect(() => {
|
|
105
|
+
if (!controller || !graph) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
void controller.open();
|
|
110
|
+
const off = combine(
|
|
111
|
+
controller.update.on(() => {
|
|
112
|
+
void editorRef.current?.update();
|
|
113
|
+
forceUpdate({});
|
|
114
|
+
}),
|
|
115
|
+
|
|
116
|
+
// TODO(burdon): Every node is called on every update.
|
|
117
|
+
controller.output.on(({ nodeId, property, value }) => {
|
|
118
|
+
if (value.type === 'not-executed') {
|
|
119
|
+
// If the node didn't execute, don't trigger.
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const edge = graph.edges.find((edge) => {
|
|
124
|
+
const source = graph.getNode(edge.source);
|
|
125
|
+
return (source as ComputeShape).node === nodeId && edge.output === property;
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
if (edge) {
|
|
129
|
+
void editorRef.current?.action?.({ type: 'trigger', edges: [edge] });
|
|
130
|
+
}
|
|
131
|
+
}),
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
return () => {
|
|
135
|
+
void controller.close();
|
|
136
|
+
off();
|
|
137
|
+
};
|
|
138
|
+
}, [graph, controller]);
|
|
139
|
+
|
|
140
|
+
// Sync monitor.
|
|
141
|
+
const graphMonitor = useGraphMonitor(controller?.graph);
|
|
142
|
+
|
|
143
|
+
// Layout.
|
|
144
|
+
const layout = useMemo(
|
|
145
|
+
() => (controller && registry ? new ComputeShapeLayout(controller, registry) : undefined),
|
|
146
|
+
[controller, registry],
|
|
147
|
+
);
|
|
148
|
+
|
|
149
|
+
const [diagnostics, setDiagnostics] = useState<GraphDiagnostic[]>([]);
|
|
150
|
+
useEffect(() => {
|
|
151
|
+
if (controller) {
|
|
152
|
+
void controller.checkGraph().then(() => {
|
|
153
|
+
setDiagnostics(controller.diagnostics);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}, []);
|
|
157
|
+
|
|
158
|
+
if (!controller) {
|
|
159
|
+
return <div />;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return (
|
|
163
|
+
<div className='grid grid-cols-[1fr,360px] w-full h-full'>
|
|
164
|
+
<ComputeContext.Provider value={{ controller }}>
|
|
165
|
+
<Container id={id} classNames={['flex grow overflow-hidden', !sidebar && 'col-span-2']}>
|
|
166
|
+
<Editor.Root<ComputeShape>
|
|
167
|
+
ref={editorRef}
|
|
168
|
+
id={id}
|
|
169
|
+
graph={graph}
|
|
170
|
+
graphMonitor={graphMonitor}
|
|
171
|
+
layout={layout}
|
|
172
|
+
registry={registry}
|
|
173
|
+
selection={selection}
|
|
174
|
+
autoZoom
|
|
175
|
+
{...props}
|
|
176
|
+
>
|
|
177
|
+
<Editor.Canvas>{children}</Editor.Canvas>
|
|
178
|
+
<Editor.UI showTools />
|
|
179
|
+
</Editor.Root>
|
|
180
|
+
<DiagnosticOverlay diagnostics={diagnostics} />
|
|
181
|
+
</Container>
|
|
182
|
+
</ComputeContext.Provider>
|
|
183
|
+
|
|
184
|
+
{sidebar && (
|
|
185
|
+
<Container id='sidebar' classNames='flex flex-col h-full overflow-hidden'>
|
|
186
|
+
<Toolbar.Root classNames='p-1'>
|
|
187
|
+
<Select.Root value={sidebar} onValueChange={(value) => setSidebar(value as RenderProps['sidebar'])}>
|
|
188
|
+
<Select.TriggerButton classNames='is-full'>{sidebar}</Select.TriggerButton>
|
|
189
|
+
<Select.Portal>
|
|
190
|
+
<Select.Content>
|
|
191
|
+
<Select.Viewport>
|
|
192
|
+
{sidebarTypes.map((type) => (
|
|
193
|
+
<Select.Item key={type} value={type}>
|
|
194
|
+
{type}
|
|
195
|
+
</Select.Item>
|
|
196
|
+
))}
|
|
197
|
+
</Select.Viewport>
|
|
198
|
+
</Select.Content>
|
|
199
|
+
</Select.Portal>
|
|
200
|
+
</Select.Root>
|
|
201
|
+
</Toolbar.Root>
|
|
202
|
+
|
|
203
|
+
<div className='flex flex-col h-full overflow-hidden divide-y divider-separator'>
|
|
204
|
+
{sidebar === 'selected' && selected && (
|
|
205
|
+
<div>Form</div>
|
|
206
|
+
// <Form<ComputeNode> schema={FormSchema} values={getComputeNode(selected.id) ?? {}} Custom={{}} />
|
|
207
|
+
)}
|
|
208
|
+
|
|
209
|
+
<JsonFilter data={json} />
|
|
210
|
+
</div>
|
|
211
|
+
</Container>
|
|
212
|
+
)}
|
|
213
|
+
</div>
|
|
214
|
+
);
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
const meta: Meta<RenderProps> = {
|
|
218
|
+
title: 'ui/react-ui-canvas-compute/compute',
|
|
219
|
+
component: Editor.Root,
|
|
220
|
+
render: Render,
|
|
221
|
+
decorators: [
|
|
222
|
+
withClientProvider({ createIdentity: true, createSpace: true }),
|
|
223
|
+
withTheme,
|
|
224
|
+
withAttention,
|
|
225
|
+
withLayout({ fullscreen: true, tooltips: true }),
|
|
226
|
+
withPluginManager({ capabilities }),
|
|
227
|
+
],
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
export default meta;
|
|
231
|
+
|
|
232
|
+
type Story = StoryObj<RenderProps>;
|
|
233
|
+
|
|
234
|
+
export const Default: Story = {
|
|
235
|
+
args: {
|
|
236
|
+
// debug: true,
|
|
237
|
+
showGrid: false,
|
|
238
|
+
snapToGrid: false,
|
|
239
|
+
sidebar: 'selected',
|
|
240
|
+
registry: new ShapeRegistry(computeShapes),
|
|
241
|
+
...createComputeGraphController(),
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
export const Beacon: Story = {
|
|
246
|
+
args: {
|
|
247
|
+
// debug: true,
|
|
248
|
+
showGrid: false,
|
|
249
|
+
snapToGrid: false,
|
|
250
|
+
sidebar: 'selected',
|
|
251
|
+
registry: new ShapeRegistry(computeShapes),
|
|
252
|
+
...createComputeGraphController(createBasicCircuit()),
|
|
253
|
+
},
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export const Transform: Story = {
|
|
257
|
+
args: {
|
|
258
|
+
// debug: true,
|
|
259
|
+
showGrid: false,
|
|
260
|
+
snapToGrid: false,
|
|
261
|
+
sidebar: 'selected',
|
|
262
|
+
registry: new ShapeRegistry(computeShapes),
|
|
263
|
+
...createComputeGraphController(createTransformCircuit()),
|
|
264
|
+
},
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export const Logic: Story = {
|
|
268
|
+
args: {
|
|
269
|
+
// debug: true,
|
|
270
|
+
showGrid: false,
|
|
271
|
+
snapToGrid: false,
|
|
272
|
+
sidebar: 'compute',
|
|
273
|
+
registry: new ShapeRegistry(computeShapes),
|
|
274
|
+
...createComputeGraphController(createLogicCircuit()),
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
export const Control: Story = {
|
|
279
|
+
args: {
|
|
280
|
+
// debug: true,
|
|
281
|
+
showGrid: false,
|
|
282
|
+
snapToGrid: false,
|
|
283
|
+
sidebar: 'compute',
|
|
284
|
+
registry: new ShapeRegistry(computeShapes),
|
|
285
|
+
...createComputeGraphController(createControlCircuit()),
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
// export const Ollama: Story = {
|
|
290
|
+
// args: {
|
|
291
|
+
// // debug: true,
|
|
292
|
+
// showGrid: false,
|
|
293
|
+
// snapToGrid: false,
|
|
294
|
+
// registry: new ShapeRegistry(computeShapes),
|
|
295
|
+
// ...createComputeGraphController(createTest3(), createEdgeServices()),
|
|
296
|
+
// },
|
|
297
|
+
// };
|
|
298
|
+
|
|
299
|
+
export const Template: Story = {
|
|
300
|
+
args: {
|
|
301
|
+
showGrid: false,
|
|
302
|
+
snapToGrid: false,
|
|
303
|
+
// sidebar: 'controller',
|
|
304
|
+
registry: new ShapeRegistry(computeShapes),
|
|
305
|
+
...createComputeGraphController(createTemplateCircuit(), createEdgeServices()),
|
|
306
|
+
},
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export const GPT: Story = {
|
|
310
|
+
args: {
|
|
311
|
+
// debug: true,
|
|
312
|
+
showGrid: false,
|
|
313
|
+
snapToGrid: false,
|
|
314
|
+
// sidebar: 'json',
|
|
315
|
+
sidebar: 'controller',
|
|
316
|
+
registry: new ShapeRegistry(computeShapes),
|
|
317
|
+
...createComputeGraphController(createGptCircuit({ history: true }), createEdgeServices()),
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
export const Plugins: Story = {
|
|
322
|
+
args: {
|
|
323
|
+
// debug: true,
|
|
324
|
+
showGrid: false,
|
|
325
|
+
snapToGrid: false,
|
|
326
|
+
// sidebar: 'json',
|
|
327
|
+
registry: new ShapeRegistry(computeShapes),
|
|
328
|
+
...createComputeGraphController(
|
|
329
|
+
createGptCircuit({ history: true, image: true, artifact: true }),
|
|
330
|
+
createEdgeServices(),
|
|
331
|
+
),
|
|
332
|
+
},
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
export const Artifact: Story = {
|
|
336
|
+
args: {
|
|
337
|
+
// debug: true,
|
|
338
|
+
showGrid: false,
|
|
339
|
+
snapToGrid: false,
|
|
340
|
+
// sidebar: 'json',
|
|
341
|
+
registry: new ShapeRegistry(computeShapes),
|
|
342
|
+
...createComputeGraphController(createArtifactCircuit(), createEdgeServices()),
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
export const Audio: Story = {
|
|
347
|
+
args: {
|
|
348
|
+
// debug: true,
|
|
349
|
+
showGrid: false,
|
|
350
|
+
snapToGrid: false,
|
|
351
|
+
sidebar: 'controller',
|
|
352
|
+
registry: new ShapeRegistry(computeShapes),
|
|
353
|
+
...createComputeGraphController(createAudioCircuit(), createEdgeServices()),
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
|
|
357
|
+
export const Voice: Story = {
|
|
358
|
+
args: {
|
|
359
|
+
showGrid: false,
|
|
360
|
+
snapToGrid: false,
|
|
361
|
+
sidebar: 'controller',
|
|
362
|
+
registry: new ShapeRegistry(computeShapes),
|
|
363
|
+
...createComputeGraphController(createGPTRealtimeCircuit(), createEdgeServices()),
|
|
364
|
+
},
|
|
365
|
+
};
|