@dxos/react-ui-canvas-compute 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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 +102 -5
- package/dist/lib/browser/index.mjs +391 -469
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +391 -469
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/DiagnosticOverlay.d.ts.map +1 -1
- package/dist/types/src/compute-layout.d.ts.map +1 -1
- package/dist/types/src/compute.stories.d.ts +1 -1
- package/dist/types/src/compute.stories.d.ts.map +1 -1
- package/dist/types/src/graph/controller.d.ts +44 -30
- 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.map +1 -1
- package/dist/types/src/hooks/useComputeNodeState.d.ts +2 -3
- package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphMonitor.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 +7 -7
- package/dist/types/src/shapes/Boolean.d.ts.map +1 -1
- package/dist/types/src/shapes/Chat.d.ts +1 -1
- package/dist/types/src/shapes/Chat.d.ts.map +1 -1
- package/dist/types/src/shapes/Constant.d.ts +1 -1
- package/dist/types/src/shapes/Constant.d.ts.map +1 -1
- package/dist/types/src/shapes/Database.d.ts +1 -1
- package/dist/types/src/shapes/Database.d.ts.map +1 -1
- package/dist/types/src/shapes/{Queue.d.ts → Feed.d.ts} +9 -9
- package/dist/types/src/shapes/Feed.d.ts.map +1 -0
- package/dist/types/src/shapes/Function.d.ts +1 -1
- package/dist/types/src/shapes/Function.d.ts.map +1 -1
- package/dist/types/src/shapes/Gpt.d.ts +1 -1
- package/dist/types/src/shapes/Gpt.d.ts.map +1 -1
- package/dist/types/src/shapes/GptRealtime.d.ts +1 -1
- package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -1
- package/dist/types/src/shapes/Json.d.ts +2 -2
- package/dist/types/src/shapes/Json.d.ts.map +1 -1
- package/dist/types/src/shapes/Logic.d.ts +2 -2
- package/dist/types/src/shapes/Logic.d.ts.map +1 -1
- package/dist/types/src/shapes/RNG.d.ts +2 -2
- 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 +2 -2
- package/dist/types/src/shapes/Template.d.ts.map +1 -1
- package/dist/types/src/shapes/Text.d.ts +1 -1
- package/dist/types/src/shapes/Text.d.ts.map +1 -1
- package/dist/types/src/shapes/TextToImage.d.ts +1 -1
- package/dist/types/src/shapes/TextToImage.d.ts.map +1 -1
- package/dist/types/src/shapes/Thread.d.ts +1 -1
- package/dist/types/src/shapes/Thread.d.ts.map +1 -1
- package/dist/types/src/shapes/Trigger.d.ts +7 -30
- package/dist/types/src/shapes/Trigger.d.ts.map +1 -1
- package/dist/types/src/shapes/common/Box.d.ts.map +1 -1
- package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -1
- package/dist/types/src/shapes/common/TypeSelect.d.ts +1 -1
- package/dist/types/src/shapes/common/TypeSelect.d.ts.map +1 -1
- package/dist/types/src/shapes/defs.d.ts +1 -1
- package/dist/types/src/shapes/defs.d.ts.map +1 -1
- package/dist/types/src/shapes/index.d.ts +2 -2
- package/dist/types/src/shapes/index.d.ts.map +1 -1
- package/dist/types/src/testing/circuits.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +50 -51
- package/src/compute.stories.tsx +26 -10
- package/src/graph/controller.ts +64 -27
- package/src/hooks/useComputeNodeState.ts +3 -5
- package/src/hooks/useGraphMonitor.ts +3 -3
- package/src/registry.ts +2 -2
- package/src/shapes/Audio.tsx +1 -2
- package/src/shapes/Beacon.tsx +0 -1
- package/src/shapes/Boolean.tsx +1 -1
- package/src/shapes/Chat.tsx +0 -1
- package/src/shapes/Constant.tsx +0 -1
- package/src/shapes/{Queue.tsx → Feed.tsx} +13 -14
- package/src/shapes/Function.tsx +5 -4
- package/src/shapes/Gpt.tsx +0 -1
- package/src/shapes/Json.tsx +9 -3
- package/src/shapes/RNG.tsx +0 -1
- package/src/shapes/Scope.tsx +0 -1
- package/src/shapes/Surface.tsx +4 -2
- package/src/shapes/Switch.tsx +0 -1
- package/src/shapes/Table.tsx +3 -2
- package/src/shapes/Template.tsx +0 -1
- package/src/shapes/Text.tsx +0 -1
- package/src/shapes/Thread.tsx +4 -7
- package/src/shapes/Trigger.tsx +23 -23
- package/src/shapes/common/Box.tsx +1 -3
- package/src/shapes/index.ts +2 -2
- package/src/testing/circuits.ts +5 -5
- package/dist/types/src/shapes/Queue.d.ts.map +0 -1
package/src/shapes/Json.tsx
CHANGED
|
@@ -8,10 +8,9 @@ import React from 'react';
|
|
|
8
8
|
import { DEFAULT_INPUT, DefaultOutput, JsonTransformInput } from '@dxos/conductor';
|
|
9
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
|
-
import {
|
|
11
|
+
import { Syntax } from '@dxos/react-ui-syntax-highlighter';
|
|
12
12
|
|
|
13
13
|
import { useComputeNodeState } from '../hooks';
|
|
14
|
-
|
|
15
14
|
import { Box, createFunctionAnchors, getHeight } from './common';
|
|
16
15
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
17
16
|
|
|
@@ -50,7 +49,14 @@ export const JsonComponent = ({ shape, ...props }: JsonComponentProps) => {
|
|
|
50
49
|
|
|
51
50
|
return (
|
|
52
51
|
<Box shape={shape}>
|
|
53
|
-
<
|
|
52
|
+
<Syntax.Root data={value}>
|
|
53
|
+
<Syntax.Content>
|
|
54
|
+
<Syntax.Filter />
|
|
55
|
+
<Syntax.Viewport>
|
|
56
|
+
<Syntax.Code classNames='text-xs' />
|
|
57
|
+
</Syntax.Viewport>
|
|
58
|
+
</Syntax.Content>
|
|
59
|
+
</Syntax.Root>
|
|
54
60
|
</Box>
|
|
55
61
|
);
|
|
56
62
|
};
|
package/src/shapes/RNG.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { Icon, type IconProps } from '@dxos/react-ui';
|
|
|
10
10
|
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
12
|
import { useComputeNodeState } from '../hooks';
|
|
13
|
-
|
|
14
13
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
14
|
|
|
16
15
|
export const RandomShape = Schema.extend(
|
package/src/shapes/Scope.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/
|
|
|
10
10
|
import { Chaos, shaderPresets, useAudioStream } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
12
|
import { useComputeNodeState } from '../hooks';
|
|
13
|
-
|
|
14
13
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
14
|
|
|
16
15
|
export const ScopeShape = Schema.extend(
|
package/src/shapes/Surface.tsx
CHANGED
|
@@ -6,13 +6,13 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { Surface } from '@dxos/app-framework/ui';
|
|
9
|
+
import { AppSurface } from '@dxos/app-toolkit/ui';
|
|
9
10
|
import { DEFAULT_INPUT } from '@dxos/conductor';
|
|
10
11
|
import { Card } from '@dxos/react-ui';
|
|
11
12
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
12
13
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
13
14
|
|
|
14
15
|
import { useComputeNodeState } from '../hooks';
|
|
15
|
-
|
|
16
16
|
import { Box, type BoxActionHandler } from './common';
|
|
17
17
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
18
18
|
|
|
@@ -48,7 +48,9 @@ export const SurfaceComponent = ({ shape }: ShapeComponentProps<SurfaceShape>) =
|
|
|
48
48
|
// TODO(burdon): Subject property?
|
|
49
49
|
return (
|
|
50
50
|
<Box shape={shape} onAction={handleAction}>
|
|
51
|
-
<Card.Root>
|
|
51
|
+
<Card.Root>
|
|
52
|
+
{value !== null && <Surface.Surface type={AppSurface.Card} data={{ subject: value }} limit={1} />}
|
|
53
|
+
</Card.Root>
|
|
52
54
|
</Box>
|
|
53
55
|
);
|
|
54
56
|
};
|
package/src/shapes/Switch.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { Input } from '@dxos/react-ui';
|
|
|
10
10
|
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
12
|
import { useComputeNodeState } from '../hooks';
|
|
13
|
-
|
|
14
13
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
14
|
|
|
16
15
|
export const SwitchShape = Schema.extend(
|
package/src/shapes/Table.tsx
CHANGED
|
@@ -6,14 +6,15 @@ import * as Schema from 'effect/Schema';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { createInputSchema, createOutputSchema } from '@dxos/conductor';
|
|
9
|
+
import { Type } from '@dxos/echo';
|
|
9
10
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
11
|
import { Message } from '@dxos/types';
|
|
11
12
|
|
|
12
13
|
import { Box, createFunctionAnchors } from './common';
|
|
13
14
|
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
14
15
|
|
|
15
|
-
const InputSchema = createInputSchema(Message.Message);
|
|
16
|
-
const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Message.Message)));
|
|
16
|
+
const InputSchema = createInputSchema(Type.getSchema(Message.Message));
|
|
17
|
+
const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Type.getSchema(Message.Message))));
|
|
17
18
|
|
|
18
19
|
export const TableShape = Schema.extend(
|
|
19
20
|
ComputeShape,
|
package/src/shapes/Template.tsx
CHANGED
package/src/shapes/Text.tsx
CHANGED
|
@@ -10,7 +10,6 @@ import { type ShapeComponentProps, type ShapeDef, TextBox } from '@dxos/react-ui
|
|
|
10
10
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
12
|
import { useComputeNodeState } from '../hooks';
|
|
13
|
-
|
|
14
13
|
import { Box, type BoxActionHandler } from './common';
|
|
15
14
|
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
16
15
|
|
package/src/shapes/Thread.tsx
CHANGED
|
@@ -6,6 +6,7 @@ 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 } from '@dxos/echo';
|
|
9
10
|
import { ScrollArea, type ThemedClassName } from '@dxos/react-ui';
|
|
10
11
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
11
12
|
import { Message } from '@dxos/types';
|
|
@@ -14,8 +15,8 @@ import { mx } from '@dxos/ui-theme';
|
|
|
14
15
|
import { Box, createFunctionAnchors } from './common';
|
|
15
16
|
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
16
17
|
|
|
17
|
-
const InputSchema = createInputSchema(Message.Message);
|
|
18
|
-
const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Message.Message)));
|
|
18
|
+
const InputSchema = createInputSchema(Type.getSchema(Message.Message));
|
|
19
|
+
const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(Type.getSchema(Message.Message))));
|
|
19
20
|
|
|
20
21
|
export const ThreadShape = Schema.extend(
|
|
21
22
|
ComputeShape,
|
|
@@ -55,11 +56,7 @@ export const ThreadComponent = ({ shape }: ShapeComponentProps<ThreadShape>) =>
|
|
|
55
56
|
|
|
56
57
|
export const ThreadItem = ({ classNames, item }: ThemedClassName<{ item: any }>) => {
|
|
57
58
|
if (typeof item !== 'object') {
|
|
58
|
-
return (
|
|
59
|
-
<div role='none' className={mx(classNames)}>
|
|
60
|
-
{item}
|
|
61
|
-
</div>
|
|
62
|
-
);
|
|
59
|
+
return <div className={mx(classNames)}>{item}</div>;
|
|
63
60
|
}
|
|
64
61
|
|
|
65
62
|
// TODO(burdon): Hack; introspect type.
|
package/src/shapes/Trigger.tsx
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
import React, { useEffect } from 'react';
|
|
7
7
|
|
|
8
|
+
import { Trigger, TriggerEvent } from '@dxos/compute';
|
|
8
9
|
import { VoidInput } from '@dxos/conductor';
|
|
9
10
|
import { Filter, Obj, Query, Ref } from '@dxos/echo';
|
|
10
11
|
import { type Mutable } from '@dxos/echo/internal';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { useSpace } from '@dxos/react-client/echo';
|
|
12
|
+
import { type SpaceId } from '@dxos/keys';
|
|
13
|
+
import { useSpaces } from '@dxos/react-client/echo';
|
|
14
14
|
import { Select, type SelectRootProps } from '@dxos/react-ui';
|
|
15
15
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
16
16
|
|
|
17
17
|
import { FunctionBody, createFunctionAnchors, getHeight } from './common';
|
|
18
18
|
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
const TriggerShapeSchema = Schema.extend(
|
|
21
21
|
ComputeShape,
|
|
22
22
|
Schema.Struct({
|
|
23
23
|
type: Schema.Literal('trigger'),
|
|
@@ -25,7 +25,13 @@ export const TriggerShape = Schema.extend(
|
|
|
25
25
|
}),
|
|
26
26
|
);
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
// TODO(wittjosiah): Try to clean up this type inference.
|
|
29
|
+
export interface TriggerShape extends ComputeShape {
|
|
30
|
+
type: 'trigger';
|
|
31
|
+
functionTrigger?: Ref.Ref<Trigger.Trigger>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const TriggerShape: Schema.Schema<TriggerShape> = TriggerShapeSchema as any;
|
|
29
35
|
|
|
30
36
|
export type CreateTriggerProps = CreateShapeProps<Omit<TriggerShape, 'functionTrigger'>> & {
|
|
31
37
|
spaceId?: SpaceId;
|
|
@@ -48,13 +54,13 @@ export const createTrigger = (props: CreateTriggerProps): TriggerShape => {
|
|
|
48
54
|
export type TriggerComponentProps = ShapeComponentProps<TriggerShape>;
|
|
49
55
|
|
|
50
56
|
export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
|
|
51
|
-
const space =
|
|
57
|
+
const [space] = useSpaces();
|
|
52
58
|
const functionTrigger = shape.functionTrigger?.target;
|
|
53
59
|
|
|
54
60
|
useEffect(() => {
|
|
55
61
|
if (functionTrigger && !functionTrigger.spec) {
|
|
56
|
-
Obj.
|
|
57
|
-
|
|
62
|
+
Obj.update(functionTrigger, (functionTrigger) => {
|
|
63
|
+
functionTrigger.spec = createTriggerSpec({ triggerKind: 'email', spaceId: space?.id }) as Mutable<Trigger.Spec>;
|
|
58
64
|
});
|
|
59
65
|
}
|
|
60
66
|
}, [functionTrigger, functionTrigger?.spec]);
|
|
@@ -65,8 +71,8 @@ export const TriggerComponent = ({ shape }: TriggerComponentProps) => {
|
|
|
65
71
|
|
|
66
72
|
const setKind = (kind: Trigger.Kind) => {
|
|
67
73
|
if (functionTrigger?.spec?.kind !== kind) {
|
|
68
|
-
Obj.
|
|
69
|
-
|
|
74
|
+
Obj.update(functionTrigger!, (obj) => {
|
|
75
|
+
obj.spec = createTriggerSpec({ triggerKind: kind, spaceId: space?.id }) as Mutable<Trigger.Spec>;
|
|
70
76
|
});
|
|
71
77
|
}
|
|
72
78
|
};
|
|
@@ -114,21 +120,15 @@ const createTriggerSpec = (props: { triggerKind?: Trigger.Kind; spaceId?: SpaceI
|
|
|
114
120
|
const kind = props.triggerKind ?? 'email';
|
|
115
121
|
switch (kind) {
|
|
116
122
|
case 'timer':
|
|
117
|
-
return
|
|
123
|
+
return Trigger.specTimer('*/10 * * * * *');
|
|
118
124
|
case 'webhook':
|
|
119
|
-
return {
|
|
125
|
+
return Trigger.specWebhook({ method: 'POST' });
|
|
120
126
|
case 'subscription':
|
|
121
|
-
return
|
|
122
|
-
kind: 'subscription',
|
|
123
|
-
query: {
|
|
124
|
-
ast: Query.select(Filter.nothing()).ast,
|
|
125
|
-
},
|
|
126
|
-
} satisfies Trigger.SubscriptionSpec;
|
|
127
|
+
return Trigger.specSubscription(Query.select(Filter.nothing()));
|
|
127
128
|
case 'email':
|
|
128
|
-
return
|
|
129
|
-
case '
|
|
130
|
-
|
|
131
|
-
return { kind: 'queue', queue: dxn } satisfies Trigger.QueueSpec;
|
|
129
|
+
return Trigger.specEmail();
|
|
130
|
+
case 'feed': {
|
|
131
|
+
return { kind: 'feed' } satisfies Trigger.FeedSpec;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
};
|
|
@@ -139,7 +139,7 @@ const getOutputSchema = (kind: Trigger.Kind) => {
|
|
|
139
139
|
['subscription']: TriggerEvent.SubscriptionEvent,
|
|
140
140
|
['timer']: TriggerEvent.TimerEvent,
|
|
141
141
|
['webhook']: TriggerEvent.WebhookEvent,
|
|
142
|
-
['
|
|
142
|
+
['feed']: TriggerEvent.FeedEvent,
|
|
143
143
|
};
|
|
144
144
|
return kindToSchema[kind];
|
|
145
145
|
};
|
|
@@ -27,7 +27,7 @@ export type BoxProps = PropsWithChildren<
|
|
|
27
27
|
export const Box = forwardRef<HTMLDivElement, BoxProps>(
|
|
28
28
|
({ children, classNames, shape, title, status, open, onAction }, forwardedRef) => {
|
|
29
29
|
invariant(shape.type);
|
|
30
|
-
const { icon, name, openable } = useShapeDef(shape.type) ?? { icon: 'ph--
|
|
30
|
+
const { icon, name, openable } = useShapeDef(shape.type) ?? { icon: 'ph--circle-dashed--regular' };
|
|
31
31
|
const { debug } = useEditorContext();
|
|
32
32
|
|
|
33
33
|
return (
|
|
@@ -39,7 +39,6 @@ export const Box = forwardRef<HTMLDivElement, BoxProps>(
|
|
|
39
39
|
classNames='p-1 text-green-500'
|
|
40
40
|
variant='ghost'
|
|
41
41
|
icon='ph--play--regular'
|
|
42
|
-
size={4}
|
|
43
42
|
label='run'
|
|
44
43
|
iconOnly
|
|
45
44
|
onDoubleClick={(ev) => ev.stopPropagation()}
|
|
@@ -57,7 +56,6 @@ export const Box = forwardRef<HTMLDivElement, BoxProps>(
|
|
|
57
56
|
classNames='p-1'
|
|
58
57
|
variant='ghost'
|
|
59
58
|
icon={open ? 'ph--caret-up--regular' : 'ph--caret-down--regular'}
|
|
60
|
-
size={4}
|
|
61
59
|
label={open ? 'close' : 'open'}
|
|
62
60
|
iconOnly
|
|
63
61
|
onClick={(ev) => {
|
package/src/shapes/index.ts
CHANGED
|
@@ -13,11 +13,12 @@ export * from './Boolean';
|
|
|
13
13
|
export * from './Chat';
|
|
14
14
|
export * from './Constant';
|
|
15
15
|
export * from './Database';
|
|
16
|
+
export * from './Feed';
|
|
16
17
|
export * from './Function';
|
|
17
18
|
export * from './Gpt';
|
|
19
|
+
export * from './GptRealtime';
|
|
18
20
|
export * from './Json';
|
|
19
21
|
export * from './Logic';
|
|
20
|
-
export * from './Queue';
|
|
21
22
|
export * from './RNG';
|
|
22
23
|
export * from './Scope';
|
|
23
24
|
export * from './Surface';
|
|
@@ -28,4 +29,3 @@ export * from './Text';
|
|
|
28
29
|
export * from './Thread';
|
|
29
30
|
export * from './TextToImage';
|
|
30
31
|
export * from './Trigger';
|
|
31
|
-
export * from './GptRealtime';
|
package/src/testing/circuits.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { createSystemPrompt } from '@dxos/assistant';
|
|
6
|
-
import {
|
|
6
|
+
import { EID, EntityId, SpaceId } from '@dxos/keys';
|
|
7
7
|
import { type Dimension, type Point } from '@dxos/react-ui-canvas';
|
|
8
8
|
import { CanvasGraphModel, createNote, pointMultiply, pointsToRect, rectToPoints } from '@dxos/react-ui-canvas-editor';
|
|
9
9
|
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
createJsonTransform,
|
|
25
25
|
createNot,
|
|
26
26
|
createOr,
|
|
27
|
-
|
|
27
|
+
createFeed,
|
|
28
28
|
createRandom,
|
|
29
29
|
createScope,
|
|
30
30
|
createSurface,
|
|
@@ -67,7 +67,7 @@ export const createTransformCircuit = () => {
|
|
|
67
67
|
|
|
68
68
|
model.builder
|
|
69
69
|
// TODO(burdon): Make id optional.
|
|
70
|
-
.createNode(createNote({ id:
|
|
70
|
+
.createNode(createNote({ id: EntityId.random(), text: 'Random number generator', ...position({ x: 0, y: -6 }) }))
|
|
71
71
|
.createEdge({ source: a.id, target: c.id })
|
|
72
72
|
.createEdge({ source: b.id, target: c.id, input: 'expression' })
|
|
73
73
|
.createEdge({ source: c.id, target: d.id });
|
|
@@ -236,12 +236,12 @@ export const createGptCircuit = (options: {
|
|
|
236
236
|
if (options.history) {
|
|
237
237
|
const queue = model.createNode(
|
|
238
238
|
createConstant({
|
|
239
|
-
value:
|
|
239
|
+
value: EID.make({ spaceId: SpaceId.random(), entityId: EntityId.random() }),
|
|
240
240
|
...position({ x: -18, y: 5, width: 8, height: 6 }),
|
|
241
241
|
}),
|
|
242
242
|
);
|
|
243
243
|
|
|
244
|
-
const thread = model.createNode(
|
|
244
|
+
const thread = model.createNode(createFeed(position({ x: -3, y: 3, width: 14, height: 10 })));
|
|
245
245
|
const append = model.createNode(createAppend(position({ x: 10, y: 6 })));
|
|
246
246
|
|
|
247
247
|
builder
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Queue.d.ts","sourceRoot":"","sources":["../../../../src/shapes/Queue.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAOvF,OAAO,EAAgB,KAAK,gBAAgB,EAAe,MAAM,QAAQ,CAAC;AAE1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;GAKtB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAE/D,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,UAAU,CAAC,CAAC;AAE5D,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB;;;;;;;;;;;;;;;;;;;CAK/C,CAAC;AAEL,eAAO,MAAM,cAAc,GAAI,WAAW,mBAAmB,CAAC,UAAU,CAAC,sBAqBxE,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,sBAAsB,eAAe,CAAC;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,CAAC,sBAe7E,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,UAAU,CAQ3C,CAAC"}
|