@dxos/react-ui-canvas-compute 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae

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.
Files changed (51) hide show
  1. package/dist/lib/browser/index.mjs +778 -962
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +778 -962
  5. package/dist/lib/node-esm/index.mjs.map +3 -3
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/compute.stories.d.ts +22 -1
  8. package/dist/types/src/compute.stories.d.ts.map +1 -1
  9. package/dist/types/src/graph/controller.d.ts +18 -31
  10. package/dist/types/src/graph/controller.d.ts.map +1 -1
  11. package/dist/types/src/hooks/useComputeNodeState.d.ts +2 -2
  12. package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -1
  13. package/dist/types/src/hooks/useGraphMonitor.d.ts +2 -2
  14. package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -1
  15. package/dist/types/src/shapes/Function.d.ts.map +1 -1
  16. package/dist/types/src/shapes/Gpt.d.ts.map +1 -1
  17. package/dist/types/src/shapes/Queue.d.ts.map +1 -1
  18. package/dist/types/src/shapes/RNG.d.ts.map +1 -1
  19. package/dist/types/src/shapes/Surface.d.ts.map +1 -1
  20. package/dist/types/src/shapes/Thread.d.ts.map +1 -1
  21. package/dist/types/src/shapes/Trigger.d.ts +6 -4
  22. package/dist/types/src/shapes/Trigger.d.ts.map +1 -1
  23. package/dist/types/src/shapes/common/Box.d.ts +4 -4
  24. package/dist/types/src/shapes/common/Box.d.ts.map +1 -1
  25. package/dist/types/src/shapes/common/FunctionBody.d.ts +2 -2
  26. package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -1
  27. package/dist/types/src/testing/circuits.d.ts +18 -24
  28. package/dist/types/src/testing/circuits.d.ts.map +1 -1
  29. package/dist/types/tsconfig.tsbuildinfo +1 -1
  30. package/package.json +59 -54
  31. package/src/README.md +0 -3
  32. package/src/compute.stories.tsx +72 -113
  33. package/src/graph/controller.ts +109 -71
  34. package/src/graph/node-defs.ts +31 -31
  35. package/src/hooks/useComputeNodeState.ts +4 -3
  36. package/src/hooks/useGraphMonitor.ts +11 -10
  37. package/src/json.test.ts +3 -3
  38. package/src/schema.test.ts +11 -11
  39. package/src/shapes/Function.tsx +10 -8
  40. package/src/shapes/Gpt.tsx +6 -1
  41. package/src/shapes/Queue.tsx +15 -9
  42. package/src/shapes/RNG.tsx +5 -1
  43. package/src/shapes/Surface.tsx +9 -3
  44. package/src/shapes/Table.tsx +3 -3
  45. package/src/shapes/Thread.tsx +17 -11
  46. package/src/shapes/Trigger.tsx +33 -44
  47. package/src/shapes/common/Box.tsx +5 -6
  48. package/src/shapes/common/FunctionBody.tsx +2 -2
  49. package/src/shapes/common/TypeSelect.tsx +1 -1
  50. package/src/shapes/defs.ts +3 -3
  51. package/src/testing/circuits.ts +5 -14
@@ -5,8 +5,9 @@
5
5
  import * as Schema from 'effect/Schema';
6
6
  import React from 'react';
7
7
 
8
- import { Surface } from '@dxos/app-framework';
8
+ import { Surface } from '@dxos/app-framework/ui';
9
9
  import { DEFAULT_INPUT } from '@dxos/conductor';
10
+ import { Card } from '@dxos/react-ui';
10
11
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
11
12
  import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
12
13
 
@@ -27,7 +28,11 @@ export type SurfaceShape = Schema.Schema.Type<typeof SurfaceShape>;
27
28
  export type CreateSurfaceProps = CreateShapeProps<SurfaceShape>;
28
29
 
29
30
  export const createSurface = (props: CreateSurfaceProps) =>
30
- createShape<SurfaceShape>({ type: 'surface', size: { width: 384, height: 384 }, ...props });
31
+ createShape<SurfaceShape>({
32
+ type: 'surface',
33
+ size: { width: 384, height: 384 },
34
+ ...props,
35
+ });
31
36
 
32
37
  export const SurfaceComponent = ({ shape }: ShapeComponentProps<SurfaceShape>) => {
33
38
  const { runtime } = useComputeNodeState(shape);
@@ -40,9 +45,10 @@ export const SurfaceComponent = ({ shape }: ShapeComponentProps<SurfaceShape>) =
40
45
  }
41
46
  };
42
47
 
48
+ // TODO(burdon): Subject property?
43
49
  return (
44
50
  <Box shape={shape} onAction={handleAction}>
45
- {value !== null && <Surface role='card--extrinsic' data={{ value }} limit={1} />}
51
+ <Card.Root>{value !== null && <Surface.Surface role='card--content' data={{ value }} limit={1} />}</Card.Root>
46
52
  </Box>
47
53
  );
48
54
  };
@@ -7,13 +7,13 @@ import React from 'react';
7
7
 
8
8
  import { createInputSchema, createOutputSchema } from '@dxos/conductor';
9
9
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
10
- import { DataType } from '@dxos/schema';
10
+ import { Message } from '@dxos/types';
11
11
 
12
12
  import { Box, createFunctionAnchors } from './common';
13
13
  import { ComputeShape, type CreateShapeProps, createShape } from './defs';
14
14
 
15
- const InputSchema = createInputSchema(DataType.Message);
16
- const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(DataType.Message)));
15
+ const InputSchema = createInputSchema(Message.Message);
16
+ const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Message.Message)));
17
17
 
18
18
  export const TableShape = Schema.extend(
19
19
  ComputeShape,
@@ -6,16 +6,16 @@ import * as Schema from 'effect/Schema';
6
6
  import React, { useEffect, useRef } from 'react';
7
7
 
8
8
  import { createInputSchema, createOutputSchema } from '@dxos/conductor';
9
- import { type ThemedClassName } from '@dxos/react-ui';
9
+ import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
10
10
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
11
- import { mx } from '@dxos/react-ui-theme';
12
- import { DataType } from '@dxos/schema';
11
+ import { Message } from '@dxos/types';
12
+ import { mx } from '@dxos/ui-theme';
13
13
 
14
14
  import { Box, createFunctionAnchors } from './common';
15
15
  import { ComputeShape, type CreateShapeProps, createShape } from './defs';
16
16
 
17
- const InputSchema = createInputSchema(DataType.Message);
18
- const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(DataType.Message)));
17
+ const InputSchema = createInputSchema(Message.Message);
18
+ const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Message.Message)));
19
19
 
20
20
  export const ThreadShape = Schema.extend(
21
21
  ComputeShape,
@@ -42,18 +42,24 @@ export const ThreadComponent = ({ shape }: ShapeComponentProps<ThreadShape>) =>
42
42
 
43
43
  return (
44
44
  <Box shape={shape}>
45
- <div ref={scrollRef} className='flex flex-col w-full overflow-y-scroll gap-2 p-2'>
46
- {[...items].map((item, i) => (
47
- <ThreadItem key={i} item={item} />
48
- ))}
49
- </div>
45
+ <ScrollArea.Root orientation='vertical'>
46
+ <ScrollArea.Viewport classNames='gap-2 p-2' ref={scrollRef}>
47
+ {[...items].map((item, i) => (
48
+ <ThreadItem key={i} item={item} />
49
+ ))}
50
+ </ScrollArea.Viewport>
51
+ </ScrollArea.Root>
50
52
  </Box>
51
53
  );
52
54
  };
53
55
 
54
56
  export const ThreadItem = ({ classNames, item }: ThemedClassName<{ item: any }>) => {
55
57
  if (typeof item !== 'object') {
56
- return <div className={mx(classNames)}>{item}</div>;
58
+ return (
59
+ <div role='none' className={mx(classNames)}>
60
+ {item}
61
+ </div>
62
+ );
57
63
  }
58
64
 
59
65
  // TODO(burdon): Hack; introspect type.
@@ -6,24 +6,9 @@ import * as Schema from 'effect/Schema';
6
6
  import React, { useEffect } from 'react';
7
7
 
8
8
  import { VoidInput } from '@dxos/conductor';
9
- import { Filter, Obj, Query } from '@dxos/echo';
10
- import { ObjectId, Ref } from '@dxos/echo/internal';
11
- import {
12
- type EmailTrigger,
13
- EmailTriggerOutput,
14
- FunctionTrigger,
15
- type QueueTrigger,
16
- QueueTriggerOutput,
17
- type SubscriptionTrigger,
18
- SubscriptionTriggerOutput,
19
- type TimerTrigger,
20
- TimerTriggerOutput,
21
- type TriggerKind,
22
- TriggerKinds,
23
- type TriggerType,
24
- type WebhookTrigger,
25
- WebhookTriggerOutput,
26
- } from '@dxos/functions';
9
+ import { Filter, Obj, Query, Ref } from '@dxos/echo';
10
+ import { type Mutable } from '@dxos/echo/internal';
11
+ import { Trigger, TriggerEvent } from '@dxos/functions';
27
12
  import { DXN, SpaceId } from '@dxos/keys';
28
13
  import { useSpace } from '@dxos/react-client/echo';
29
14
  import { Select, type SelectRootProps } from '@dxos/react-ui';
@@ -36,25 +21,26 @@ export const TriggerShape = Schema.extend(
36
21
  ComputeShape,
37
22
  Schema.Struct({
38
23
  type: Schema.Literal('trigger'),
39
- functionTrigger: Schema.optional(Ref(FunctionTrigger)),
24
+ functionTrigger: Schema.optional(Ref.Ref(Trigger.Trigger)),
40
25
  }),
41
26
  );
42
- export type TriggerShape = Schema.Schema.Type<typeof TriggerShape>;
27
+
28
+ export interface TriggerShape extends Schema.Schema.Type<typeof TriggerShape> {}
43
29
 
44
30
  export type CreateTriggerProps = CreateShapeProps<Omit<TriggerShape, 'functionTrigger'>> & {
45
31
  spaceId?: SpaceId;
46
- triggerKind?: TriggerKind;
32
+ triggerKind?: Trigger.Kind;
47
33
  };
48
34
 
49
35
  export const createTrigger = (props: CreateTriggerProps): TriggerShape => {
50
- const functionTrigger = Obj.make(FunctionTrigger, {
36
+ const functionTrigger = Trigger.make({
51
37
  enabled: true,
52
38
  spec: createTriggerSpec(props),
53
39
  });
54
40
  return createShape<TriggerShape>({
55
41
  type: 'trigger',
56
42
  functionTrigger: Ref.make(functionTrigger),
57
- size: { width: 192, height: getHeight(EmailTriggerOutput) },
43
+ size: { width: 192, height: getHeight(TriggerEvent.EmailEvent) },
58
44
  ...props,
59
45
  });
60
46
  };
@@ -67,7 +53,9 @@ export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
67
53
 
68
54
  useEffect(() => {
69
55
  if (functionTrigger && !functionTrigger.spec) {
70
- functionTrigger.spec = createTriggerSpec({ triggerKind: 'email', spaceId: space?.id });
56
+ Obj.change(functionTrigger, (t) => {
57
+ t.spec = createTriggerSpec({ triggerKind: 'email', spaceId: space?.id }) as Mutable<Trigger.Spec>;
58
+ });
71
59
  }
72
60
  }, [functionTrigger, functionTrigger?.spec]);
73
61
 
@@ -75,9 +63,11 @@ export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
75
63
  shape.size.height = getHeight(getOutputSchema(functionTrigger?.spec?.kind ?? 'email'));
76
64
  }, [functionTrigger?.spec?.kind]);
77
65
 
78
- const setKind = (kind: TriggerKind) => {
66
+ const setKind = (kind: Trigger.Kind) => {
79
67
  if (functionTrigger?.spec?.kind !== kind) {
80
- functionTrigger!.spec = createTriggerSpec({ triggerKind: kind, spaceId: space?.id });
68
+ Obj.change(functionTrigger!, (t) => {
69
+ t.spec = createTriggerSpec({ triggerKind: kind, spaceId: space?.id }) as Mutable<Trigger.Spec>;
70
+ });
81
71
  }
82
72
  };
83
73
 
@@ -89,7 +79,7 @@ export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
89
79
  <FunctionBody
90
80
  shape={shape}
91
81
  status={
92
- <TriggerKindSelect value={functionTrigger.spec?.kind} onValueChange={(kind) => setKind(kind as TriggerKind)} />
82
+ <TriggerKindSelect value={functionTrigger.spec?.kind} onValueChange={(kind) => setKind(kind as Trigger.Kind)} />
93
83
  }
94
84
  inputSchema={VoidInput}
95
85
  outputSchema={getOutputSchema(functionTrigger.spec!.kind!)}
@@ -101,12 +91,12 @@ export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
101
91
  const TriggerKindSelect = ({ value, onValueChange }: Pick<SelectRootProps, 'value' | 'onValueChange'>) => {
102
92
  return (
103
93
  <Select.Root value={value} onValueChange={onValueChange}>
104
- <Select.TriggerButton variant='ghost' classNames='w-full !px-0' />
94
+ <Select.TriggerButton variant='ghost' classNames='w-full px-0!' />
105
95
  <Select.Portal>
106
96
  <Select.Content>
107
97
  <Select.ScrollUpButton />
108
98
  <Select.Viewport>
109
- {TriggerKinds.map((kind) => (
99
+ {Trigger.Kinds.map((kind) => (
110
100
  <Select.Option key={kind} value={kind}>
111
101
  {kind}
112
102
  </Select.Option>
@@ -120,37 +110,36 @@ const TriggerKindSelect = ({ value, onValueChange }: Pick<SelectRootProps, 'valu
120
110
  );
121
111
  };
122
112
 
123
- const createTriggerSpec = (props: { triggerKind?: TriggerKind; spaceId?: SpaceId }): TriggerType => {
113
+ const createTriggerSpec = (props: { triggerKind?: Trigger.Kind; spaceId?: SpaceId }): Trigger.Spec => {
124
114
  const kind = props.triggerKind ?? 'email';
125
115
  switch (kind) {
126
116
  case 'timer':
127
- return { kind: 'timer', cron: '*/10 * * * * *' } satisfies TimerTrigger;
117
+ return { kind: 'timer', cron: '*/10 * * * * *' } satisfies Trigger.TimerSpec;
128
118
  case 'webhook':
129
- return { kind: 'webhook', method: 'POST' } satisfies WebhookTrigger;
119
+ return { kind: 'webhook', method: 'POST' } satisfies Trigger.WebhookSpec;
130
120
  case 'subscription':
131
121
  return {
132
122
  kind: 'subscription',
133
123
  query: {
134
- string: 'Query.select(Filter.nothing())',
135
124
  ast: Query.select(Filter.nothing()).ast,
136
125
  },
137
- } satisfies SubscriptionTrigger;
126
+ } satisfies Trigger.SubscriptionSpec;
138
127
  case 'email':
139
- return { kind: 'email' } satisfies EmailTrigger;
128
+ return { kind: 'email' } satisfies Trigger.EmailSpec;
140
129
  case 'queue': {
141
- const dxn = new DXN(DXN.kind.QUEUE, ['data', props.spaceId ?? SpaceId.random(), ObjectId.random()]).toString();
142
- return { kind: 'queue', queue: dxn } satisfies QueueTrigger;
130
+ const dxn = new DXN(DXN.kind.QUEUE, ['data', props.spaceId ?? SpaceId.random(), Obj.ID.random()]).toString();
131
+ return { kind: 'queue', queue: dxn } satisfies Trigger.QueueSpec;
143
132
  }
144
133
  }
145
134
  };
146
135
 
147
- const getOutputSchema = (kind: TriggerKind) => {
148
- const kindToSchema: Record<TriggerKind, Schema.Schema<any>> = {
149
- ['email']: EmailTriggerOutput,
150
- ['subscription']: SubscriptionTriggerOutput,
151
- ['timer']: TimerTriggerOutput,
152
- ['webhook']: WebhookTriggerOutput,
153
- ['queue']: QueueTriggerOutput,
136
+ const getOutputSchema = (kind: Trigger.Kind) => {
137
+ const kindToSchema: Record<Trigger.Kind, Schema.Schema<any>> = {
138
+ ['email']: TriggerEvent.EmailEvent,
139
+ ['subscription']: TriggerEvent.SubscriptionEvent,
140
+ ['timer']: TriggerEvent.TimerEvent,
141
+ ['webhook']: TriggerEvent.WebhookEvent,
142
+ ['queue']: TriggerEvent.QueueEvent,
154
143
  };
155
144
  return kindToSchema[kind];
156
145
  };
@@ -6,9 +6,8 @@ import React, { type PropsWithChildren, type ReactNode, forwardRef } from 'react
6
6
 
7
7
  import { invariant } from '@dxos/invariant';
8
8
  import { Icon, IconButton, type ThemedClassName } from '@dxos/react-ui';
9
- import { useEditorContext, useShapeDef } from '@dxos/react-ui-canvas-editor';
10
- import { type Shape } from '@dxos/react-ui-canvas-editor';
11
- import { mx } from '@dxos/react-ui-theme';
9
+ import { type CanvasBoard, useEditorContext, useShapeDef } from '@dxos/react-ui-canvas-editor';
10
+ import { mx } from '@dxos/ui-theme';
12
11
 
13
12
  export const headerHeight = 32;
14
13
  export const footerHeight = 32;
@@ -17,7 +16,7 @@ export type BoxActionHandler = (action: 'run' | 'open' | 'close') => void;
17
16
 
18
17
  export type BoxProps = PropsWithChildren<
19
18
  ThemedClassName<{
20
- shape: Shape;
19
+ shape: CanvasBoard.Shape;
21
20
  title?: string;
22
21
  status?: string | ReactNode;
23
22
  open?: boolean;
@@ -33,7 +32,7 @@ export const Box = forwardRef<HTMLDivElement, BoxProps>(
33
32
 
34
33
  return (
35
34
  <div ref={forwardedRef} className='flex flex-col h-full w-full justify-between'>
36
- <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-hoverSurface'>
35
+ <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-input-surface'>
37
36
  <Icon icon={icon} classNames='mx-2' />
38
37
  <div className='grow text-sm truncate'>{debug ? shape.type : (name ?? shape.text ?? title)}</div>
39
38
  <IconButton
@@ -51,7 +50,7 @@ export const Box = forwardRef<HTMLDivElement, BoxProps>(
51
50
  />
52
51
  </div>
53
52
  <div className={mx('flex flex-col h-full grow overflow-hidden', classNames)}>{children}</div>
54
- <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-hoverSurface'>
53
+ <div className='flex shrink-0 w-full justify-between items-center h-[32px] bg-input-surface'>
55
54
  <div className='grow px-2 text-sm truncate'>{debug ? shape.id : status}</div>
56
55
  {openable && (
57
56
  <IconButton
@@ -8,7 +8,7 @@ import React, { type JSX, useRef, useState } from 'react';
8
8
 
9
9
  import { VoidInput, VoidOutput } from '@dxos/conductor';
10
10
  import { useCanvasContext } from '@dxos/react-ui-canvas';
11
- import { type Polygon, type Shape } from '@dxos/react-ui-canvas-editor';
11
+ import { type CanvasBoard, type Polygon } from '@dxos/react-ui-canvas-editor';
12
12
  import { createAnchors, getParentShapeElement, rowHeight } from '@dxos/react-ui-canvas-editor';
13
13
 
14
14
  import { Box, type BoxProps, footerHeight, headerHeight } from '../common';
@@ -18,7 +18,7 @@ const bodyPadding = 8;
18
18
  const expandedHeight = 200;
19
19
 
20
20
  export type FunctionBodyProps = {
21
- shape: Shape;
21
+ shape: CanvasBoard.Shape;
22
22
  name?: string;
23
23
  content?: JSX.Element;
24
24
  inputSchema?: Schema.Schema.Any;
@@ -11,7 +11,7 @@ import { Select, type SelectRootProps } from '@dxos/react-ui';
11
11
  export const TypeSelect = ({ value, onValueChange }: Pick<SelectRootProps, 'value' | 'onValueChange'>) => {
12
12
  return (
13
13
  <Select.Root value={value} onValueChange={onValueChange}>
14
- <Select.TriggerButton variant='ghost' classNames='w-full !px-0' />
14
+ <Select.TriggerButton variant='ghost' classNames='w-full px-0!' />
15
15
  <Select.Portal>
16
16
  <Select.Content>
17
17
  <Select.ScrollUpButton />
@@ -6,7 +6,7 @@ import * as Schema from 'effect/Schema';
6
6
  import * as SchemaAST from 'effect/SchemaAST';
7
7
 
8
8
  import { DEFAULT_INPUT, DEFAULT_OUTPUT } from '@dxos/conductor';
9
- import { ObjectId } from '@dxos/echo/internal';
9
+ import { Obj } from '@dxos/echo';
10
10
  import { Polygon } from '@dxos/react-ui-canvas-editor';
11
11
  import { type MakeOptional } from '@dxos/util';
12
12
 
@@ -37,7 +37,7 @@ export const ComputeShape = Schema.extend(
37
37
  Polygon,
38
38
  Schema.Struct({
39
39
  // TODO(burdon): Rename computeNode?
40
- node: Schema.optional(ObjectId.annotations({ description: 'Compute node id' })),
40
+ node: Schema.optional(Obj.ID.annotations({ description: 'Compute node id' })),
41
41
  }).pipe(Schema.mutable),
42
42
  );
43
43
 
@@ -45,7 +45,7 @@ export type ComputeShape = Schema.Schema.Type<typeof ComputeShape>;
45
45
 
46
46
  export const createShape = <S extends ComputeShape>({ id, ...rest }: CreateShapeProps<S> & { type: string }): S => {
47
47
  return {
48
- id: id ?? ObjectId.random(),
48
+ id: id ?? Obj.ID.random(),
49
49
  ...rest,
50
50
  } as S;
51
51
  };
@@ -3,14 +3,10 @@
3
3
  //
4
4
 
5
5
  import { createSystemPrompt } from '@dxos/assistant';
6
- import { ObjectId } from '@dxos/echo/internal';
7
- import { type ServiceContainer } from '@dxos/functions';
8
- import { DXN, SpaceId } from '@dxos/keys';
6
+ import { DXN, ObjectId, SpaceId } from '@dxos/keys';
9
7
  import { type Dimension, type Point } from '@dxos/react-ui-canvas';
10
8
  import { CanvasGraphModel, createNote, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
11
9
 
12
- import { ComputeGraphController } from '../graph';
13
- import { createComputeGraph } from '../hooks';
14
10
  import {
15
11
  type ComputeShape,
16
12
  createAnd,
@@ -38,19 +34,14 @@ import {
38
34
  createTextToImage,
39
35
  } from '../shapes';
40
36
 
41
- export const createComputeGraphController = (
42
- graph: CanvasGraphModel<ComputeShape>,
43
- serviceContainer: ServiceContainer,
44
- ) => {
45
- const computeGraph = createComputeGraph(graph);
46
- const controller = new ComputeGraphController(serviceContainer, computeGraph);
47
- return { controller, graph };
48
- };
49
-
50
37
  //
51
38
  // Circuits
52
39
  //
53
40
 
41
+ export const createEmptyCircuit = () => {
42
+ return CanvasGraphModel.create<ComputeShape>();
43
+ };
44
+
54
45
  export const createBasicCircuit = () => {
55
46
  const model = CanvasGraphModel.create<ComputeShape>();
56
47
  model.builder.call(({ model }) => {