@dxos/react-ui-canvas-compute 0.8.4-main.5acf9ea → 0.8.4-main.5ea62a8
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 +177 -139
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +177 -139
- 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 +9 -4
- package/dist/types/src/compute.stories.d.ts.map +1 -1
- package/dist/types/src/graph/controller.d.ts +6 -6
- 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 +1 -1
- package/dist/types/src/hooks/useComputeGraphController.d.ts.map +1 -1
- package/dist/types/src/hooks/useComputeNodeState.d.ts +1 -1
- package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -1
- package/dist/types/src/hooks/useGraphMonitor.d.ts +1 -1
- package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -1
- package/dist/types/src/shapes/Append.d.ts.map +1 -1
- package/dist/types/src/shapes/Array.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/Boolean.d.ts.map +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.map +1 -1
- 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/GptRealtime.d.ts.map +1 -1
- package/dist/types/src/shapes/Json.d.ts.map +1 -1
- package/dist/types/src/shapes/Logic.d.ts.map +1 -1
- package/dist/types/src/shapes/Queue.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/Table.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/TextToImage.d.ts.map +1 -1
- package/dist/types/src/shapes/Thread.d.ts.map +1 -1
- package/dist/types/src/shapes/Trigger.d.ts +34 -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/tsconfig.tsbuildinfo +1 -1
- package/package.json +46 -45
- package/src/compute.stories.tsx +7 -6
- package/src/graph/controller.ts +5 -4
- package/src/graph/node-defs.ts +3 -3
- package/src/hooks/useComputeGraphController.ts +1 -1
- package/src/hooks/useComputeNodeState.ts +3 -2
- package/src/hooks/useGraphMonitor.ts +1 -1
- package/src/registry.ts +2 -2
- package/src/schema.test.ts +2 -2
- package/src/shapes/Append.tsx +2 -2
- package/src/shapes/Array.tsx +2 -2
- package/src/shapes/Audio.tsx +3 -2
- package/src/shapes/Beacon.tsx +3 -2
- package/src/shapes/Boolean.tsx +2 -2
- package/src/shapes/Chat.tsx +3 -2
- package/src/shapes/Constant.tsx +3 -2
- package/src/shapes/Database.tsx +1 -1
- package/src/shapes/Function.tsx +6 -5
- package/src/shapes/Gpt.tsx +6 -4
- package/src/shapes/GptRealtime.tsx +1 -1
- package/src/shapes/Json.tsx +3 -2
- package/src/shapes/Logic.tsx +2 -2
- package/src/shapes/Queue.tsx +3 -2
- package/src/shapes/RNG.tsx +3 -2
- package/src/shapes/Scope.tsx +4 -3
- package/src/shapes/Surface.tsx +3 -2
- package/src/shapes/Switch.tsx +3 -2
- package/src/shapes/Table.tsx +2 -2
- package/src/shapes/Template.tsx +4 -3
- package/src/shapes/Text.tsx +4 -3
- package/src/shapes/TextToImage.tsx +1 -1
- package/src/shapes/Thread.tsx +2 -2
- package/src/shapes/Trigger.tsx +29 -31
- package/src/shapes/common/Box.tsx +1 -1
- package/src/shapes/common/FunctionBody.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/react-ui-canvas-compute",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.5ea62a8",
|
|
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",
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"source": "./src/index.ts",
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
13
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
|
-
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
|
-
"source": "./src/index.ts"
|
|
15
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
16
16
|
}
|
|
17
17
|
},
|
|
18
18
|
"types": "dist/types/src/index.d.ts",
|
|
@@ -26,63 +26,64 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@antv/graphlib": "^2.0.4",
|
|
28
28
|
"@antv/layout": "^1.2.13",
|
|
29
|
-
"@effect/platform": "0.
|
|
29
|
+
"@effect/platform": "0.90.2",
|
|
30
30
|
"@preact-signals/safe-react": "^0.9.0",
|
|
31
31
|
"chess.js": "^1.0.0",
|
|
32
|
-
"@dxos/
|
|
33
|
-
"@dxos/
|
|
34
|
-
"@dxos/
|
|
35
|
-
"@dxos/
|
|
36
|
-
"@dxos/
|
|
37
|
-
"@dxos/
|
|
38
|
-
"@dxos/
|
|
39
|
-
"@dxos/
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/keys": "0.8.4-main.
|
|
46
|
-
"@dxos/live-object": "0.8.4-main.
|
|
47
|
-
"@dxos/log": "0.8.4-main.
|
|
48
|
-
"@dxos/react-client": "0.8.4-main.
|
|
49
|
-
"@dxos/react-edge-client": "0.8.4-main.
|
|
50
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
51
|
-
"@dxos/react-ui-canvas": "0.8.4-main.
|
|
52
|
-
"@dxos/react-ui-canvas-editor": "0.8.4-main.
|
|
53
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
54
|
-
"@dxos/react-ui-sfx": "0.8.4-main.
|
|
55
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
56
|
-
"@dxos/react-ui-
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/util": "0.8.4-main.
|
|
32
|
+
"@dxos/app-framework": "0.8.4-main.5ea62a8",
|
|
33
|
+
"@dxos/assistant": "0.8.4-main.5ea62a8",
|
|
34
|
+
"@dxos/blueprints": "0.8.4-main.5ea62a8",
|
|
35
|
+
"@dxos/conductor": "0.8.4-main.5ea62a8",
|
|
36
|
+
"@dxos/context": "0.8.4-main.5ea62a8",
|
|
37
|
+
"@dxos/debug": "0.8.4-main.5ea62a8",
|
|
38
|
+
"@dxos/echo": "0.8.4-main.5ea62a8",
|
|
39
|
+
"@dxos/echo-schema": "0.8.4-main.5ea62a8",
|
|
40
|
+
"@dxos/async": "0.8.4-main.5ea62a8",
|
|
41
|
+
"@dxos/edge-client": "0.8.4-main.5ea62a8",
|
|
42
|
+
"@dxos/functions": "0.8.4-main.5ea62a8",
|
|
43
|
+
"@dxos/graph": "0.8.4-main.5ea62a8",
|
|
44
|
+
"@dxos/invariant": "0.8.4-main.5ea62a8",
|
|
45
|
+
"@dxos/keys": "0.8.4-main.5ea62a8",
|
|
46
|
+
"@dxos/live-object": "0.8.4-main.5ea62a8",
|
|
47
|
+
"@dxos/log": "0.8.4-main.5ea62a8",
|
|
48
|
+
"@dxos/react-client": "0.8.4-main.5ea62a8",
|
|
49
|
+
"@dxos/react-edge-client": "0.8.4-main.5ea62a8",
|
|
50
|
+
"@dxos/react-ui-attention": "0.8.4-main.5ea62a8",
|
|
51
|
+
"@dxos/react-ui-canvas": "0.8.4-main.5ea62a8",
|
|
52
|
+
"@dxos/react-ui-canvas-editor": "0.8.4-main.5ea62a8",
|
|
53
|
+
"@dxos/react-ui-form": "0.8.4-main.5ea62a8",
|
|
54
|
+
"@dxos/react-ui-sfx": "0.8.4-main.5ea62a8",
|
|
55
|
+
"@dxos/react-ui-stack": "0.8.4-main.5ea62a8",
|
|
56
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.5ea62a8",
|
|
57
|
+
"@dxos/schema": "0.8.4-main.5ea62a8",
|
|
58
|
+
"@dxos/react-ui-editor": "0.8.4-main.5ea62a8",
|
|
59
|
+
"@dxos/util": "0.8.4-main.5ea62a8",
|
|
60
|
+
"@dxos/ai": "0.8.4-main.5ea62a8"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@effect/ai": "0.
|
|
63
|
+
"@effect/ai": "0.25.2",
|
|
63
64
|
"@types/lodash.defaultsdeep": "^4.6.6",
|
|
64
65
|
"@types/react": "~18.2.0",
|
|
65
66
|
"@types/react-dom": "~18.2.0",
|
|
66
|
-
"effect": "3.17.
|
|
67
|
+
"effect": "3.17.7",
|
|
67
68
|
"lodash.defaultsdeep": "^4.6.1",
|
|
68
69
|
"react": "~18.2.0",
|
|
69
70
|
"react-dom": "~18.2.0",
|
|
70
|
-
"vite": "
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
78
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
71
|
+
"vite": "7.1.1",
|
|
72
|
+
"@dxos/compute": "0.8.4-main.5ea62a8",
|
|
73
|
+
"@dxos/echo-signals": "0.8.4-main.5ea62a8",
|
|
74
|
+
"@dxos/random": "0.8.4-main.5ea62a8",
|
|
75
|
+
"@dxos/app-framework": "0.8.4-main.5ea62a8",
|
|
76
|
+
"@dxos/react-ui": "0.8.4-main.5ea62a8",
|
|
77
|
+
"@dxos/assistant-testing": "0.8.4-main.5ea62a8",
|
|
78
|
+
"@dxos/react-ui-theme": "0.8.4-main.5ea62a8",
|
|
79
|
+
"@dxos/storybook-utils": "0.8.4-main.5ea62a8"
|
|
79
80
|
},
|
|
80
81
|
"peerDependencies": {
|
|
81
82
|
"effect": "^3.13.3",
|
|
82
83
|
"react": "~18.2.0",
|
|
83
84
|
"react-dom": "~18.2.0",
|
|
84
|
-
"@dxos/react-ui
|
|
85
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
85
|
+
"@dxos/react-ui": "0.8.4-main.5ea62a8",
|
|
86
|
+
"@dxos/react-ui-theme": "0.8.4-main.5ea62a8"
|
|
86
87
|
},
|
|
87
88
|
"publishConfig": {
|
|
88
89
|
"access": "public"
|
package/src/compute.stories.tsx
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { type PropsWithChildren, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
@@ -37,8 +37,8 @@ import {
|
|
|
37
37
|
createBasicCircuit,
|
|
38
38
|
createComputeGraphController,
|
|
39
39
|
createControlCircuit,
|
|
40
|
-
createGptCircuit,
|
|
41
40
|
createGPTRealtimeCircuit,
|
|
41
|
+
createGptCircuit,
|
|
42
42
|
createLogicCircuit,
|
|
43
43
|
createTemplateCircuit,
|
|
44
44
|
createTransformCircuit,
|
|
@@ -156,6 +156,7 @@ const DefaultStory = ({
|
|
|
156
156
|
</Select.Item>
|
|
157
157
|
))}
|
|
158
158
|
</Select.Viewport>
|
|
159
|
+
<Select.Arrow />
|
|
159
160
|
</Select.Content>
|
|
160
161
|
</Select.Portal>
|
|
161
162
|
</Select.Root>
|
|
@@ -175,9 +176,9 @@ const DefaultStory = ({
|
|
|
175
176
|
);
|
|
176
177
|
};
|
|
177
178
|
|
|
178
|
-
const meta
|
|
179
|
+
const meta = {
|
|
179
180
|
title: 'ui/react-ui-canvas-compute/compute',
|
|
180
|
-
component: Editor.Root,
|
|
181
|
+
component: Editor.Root as any,
|
|
181
182
|
render: DefaultStory,
|
|
182
183
|
decorators: [
|
|
183
184
|
withTheme,
|
|
@@ -186,11 +187,11 @@ const meta: Meta<RenderProps> = {
|
|
|
186
187
|
withLayout({ fullscreen: true }),
|
|
187
188
|
withPluginManager({ capabilities }),
|
|
188
189
|
],
|
|
189
|
-
}
|
|
190
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
190
191
|
|
|
191
192
|
export default meta;
|
|
192
193
|
|
|
193
|
-
type Story = StoryObj<
|
|
194
|
+
type Story = StoryObj<typeof meta>;
|
|
194
195
|
|
|
195
196
|
export const Default: Story = {
|
|
196
197
|
args: {
|
package/src/graph/controller.ts
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import { type Context, Effect, Either, Exit, Scope } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { type ImageContentBlock } from '@dxos/ai';
|
|
8
7
|
import { Event, synchronized } from '@dxos/async';
|
|
9
8
|
import {
|
|
10
9
|
type ComputeEdge,
|
|
@@ -19,15 +18,17 @@ import {
|
|
|
19
18
|
isNotExecuted,
|
|
20
19
|
} from '@dxos/conductor';
|
|
21
20
|
import { Resource } from '@dxos/context';
|
|
22
|
-
import { type
|
|
21
|
+
import { type ComputeEventLogger, type ComputeEventPayload } from '@dxos/functions';
|
|
23
22
|
import { type ServiceContainer } from '@dxos/functions';
|
|
24
23
|
import { log } from '@dxos/log';
|
|
25
24
|
import { type CanvasGraphModel } from '@dxos/react-ui-canvas-editor';
|
|
25
|
+
import { type ContentBlock } from '@dxos/schema';
|
|
26
26
|
|
|
27
|
-
import { resolveComputeNode } from './node-defs';
|
|
28
27
|
import { createComputeGraph } from '../hooks';
|
|
29
28
|
import { type ComputeShape } from '../shapes';
|
|
30
29
|
|
|
30
|
+
import { resolveComputeNode } from './node-defs';
|
|
31
|
+
|
|
31
32
|
// TODO(burdon): API package for conductor.
|
|
32
33
|
export const InvalidStateError = Error;
|
|
33
34
|
|
|
@@ -42,7 +43,7 @@ export interface GptExecutor {
|
|
|
42
43
|
invoke: FunctionCallback<GptInput, GptOutput>;
|
|
43
44
|
|
|
44
45
|
// TODO(dmaretskyi): A hack to get image artifacts working. Rework into querying images from the ai-service store.
|
|
45
|
-
imageCache: Map<string,
|
|
46
|
+
imageCache: Map<string, ContentBlock.Image>;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
export type RuntimeValue =
|
package/src/graph/node-defs.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
NODE_INPUT,
|
|
7
|
-
NODE_OUTPUT,
|
|
8
6
|
type ComputeNode,
|
|
9
7
|
type Executable,
|
|
8
|
+
NODE_INPUT,
|
|
9
|
+
NODE_OUTPUT,
|
|
10
10
|
type NodeType,
|
|
11
|
-
registry,
|
|
12
11
|
getTemplateInputSchema,
|
|
12
|
+
registry,
|
|
13
13
|
} from '@dxos/conductor';
|
|
14
14
|
import { raise } from '@dxos/debug';
|
|
15
15
|
import { ObjectId, toJsonSchema } from '@dxos/echo-schema';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { type RefObject, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { type CleanupFn } from '@dxos/async';
|
|
8
|
-
import { type
|
|
8
|
+
import { type EditorController, type EditorRootProps } from '@dxos/react-ui-canvas-editor';
|
|
9
9
|
|
|
10
10
|
import { type ComputeGraphController } from '../graph';
|
|
11
11
|
import { type ComputeShape } from '../shapes';
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import { useCallback, useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type { ComputeMeta, ComputeNode } from '@dxos/conductor';
|
|
9
9
|
import type { ComputeEventPayload } from '@dxos/functions';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
|
|
12
|
-
import { useComputeContext } from './compute-context';
|
|
13
12
|
import { type RuntimeValue } from '../graph';
|
|
14
13
|
import { type ComputeShape } from '../shapes';
|
|
15
14
|
|
|
15
|
+
import { useComputeContext } from './compute-context';
|
|
16
|
+
|
|
16
17
|
export type ComputeNodeState = {
|
|
17
18
|
node: ComputeNode;
|
|
18
19
|
meta: ComputeMeta;
|
|
@@ -8,7 +8,7 @@ import { type ComputeEdge, ComputeGraphModel, type ComputeNode, DEFAULT_INPUT, D
|
|
|
8
8
|
import { ObjectId, Ref } from '@dxos/echo-schema';
|
|
9
9
|
import { invariant } from '@dxos/invariant';
|
|
10
10
|
import { getSpace } from '@dxos/react-client/echo';
|
|
11
|
-
import { type
|
|
11
|
+
import { type CanvasGraphModel, type Connection, type GraphMonitor } from '@dxos/react-ui-canvas-editor';
|
|
12
12
|
import { isNonNullable } from '@dxos/util';
|
|
13
13
|
|
|
14
14
|
import { createComputeNode, isValidComputeNode } from '../graph';
|
package/src/registry.ts
CHANGED
package/src/schema.test.ts
CHANGED
|
@@ -9,15 +9,15 @@ import { live } from '@dxos/client/echo';
|
|
|
9
9
|
import { BaseGraphNode, Graph } from '@dxos/graph';
|
|
10
10
|
import {
|
|
11
11
|
Polygon,
|
|
12
|
+
Shape,
|
|
12
13
|
createEllipse,
|
|
13
14
|
createPath,
|
|
14
15
|
createRectangle,
|
|
15
16
|
isPath,
|
|
16
17
|
isPolygon,
|
|
17
|
-
Shape,
|
|
18
18
|
} from '@dxos/react-ui-canvas-editor';
|
|
19
19
|
|
|
20
|
-
import {
|
|
20
|
+
import { ComputeShape, createFunction, createSwitch } from './shapes';
|
|
21
21
|
|
|
22
22
|
describe('compute', () => {
|
|
23
23
|
test('model', ({ expect }) => {
|
package/src/shapes/Append.tsx
CHANGED
|
@@ -8,8 +8,8 @@ import React from 'react';
|
|
|
8
8
|
import { AppendInput } from '@dxos/conductor';
|
|
9
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { ComputeShape,
|
|
11
|
+
import { FunctionBody, createFunctionAnchors, getHeight } from './common';
|
|
12
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
13
13
|
|
|
14
14
|
export const AppendShape = Schema.extend(
|
|
15
15
|
ComputeShape,
|
package/src/shapes/Array.tsx
CHANGED
|
@@ -8,8 +8,8 @@ import React from 'react';
|
|
|
8
8
|
import { ReducerInput, ReducerOutput } from '@dxos/conductor';
|
|
9
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { ComputeShape,
|
|
11
|
+
import { FunctionBody, createFunctionAnchors, getHeight } from './common';
|
|
12
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
13
13
|
|
|
14
14
|
//
|
|
15
15
|
// Data
|
package/src/shapes/Audio.tsx
CHANGED
|
@@ -6,11 +6,12 @@ import { Schema } from 'effect';
|
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
8
|
import { Icon } from '@dxos/react-ui';
|
|
9
|
-
import {
|
|
9
|
+
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
12
11
|
import { useComputeNodeState } from '../hooks';
|
|
13
12
|
|
|
13
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
14
|
+
|
|
14
15
|
export const AudioShape = Schema.extend(
|
|
15
16
|
ComputeShape,
|
|
16
17
|
Schema.Struct({
|
package/src/shapes/Beacon.tsx
CHANGED
|
@@ -7,11 +7,12 @@ import React from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { DEFAULT_INPUT, isTruthy } from '@dxos/conductor';
|
|
9
9
|
import { Icon } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
13
12
|
import { useComputeNodeState } from '../hooks';
|
|
14
13
|
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
|
+
|
|
15
16
|
export const BeaconShape = Schema.extend(
|
|
16
17
|
ComputeShape,
|
|
17
18
|
Schema.Struct({
|
package/src/shapes/Boolean.tsx
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import React, { type FC } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { type ShapeDef, getAnchorPoints } from '@dxos/react-ui-canvas-editor';
|
|
9
9
|
import { createAnchors } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
|
-
import { ComputeShape, createAnchorId, createShape
|
|
11
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
12
12
|
|
|
13
13
|
//
|
|
14
14
|
// Gate utils.
|
package/src/shapes/Chat.tsx
CHANGED
|
@@ -15,10 +15,11 @@ import {
|
|
|
15
15
|
} from '@dxos/react-ui-canvas-editor';
|
|
16
16
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
17
17
|
|
|
18
|
-
import { Box } from './common';
|
|
19
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
20
18
|
import { useComputeNodeState } from '../hooks';
|
|
21
19
|
|
|
20
|
+
import { Box } from './common';
|
|
21
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
22
|
+
|
|
22
23
|
//
|
|
23
24
|
// Data
|
|
24
25
|
//
|
package/src/shapes/Constant.tsx
CHANGED
|
@@ -17,10 +17,11 @@ import {
|
|
|
17
17
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
18
18
|
import { safeParseJson } from '@dxos/util';
|
|
19
19
|
|
|
20
|
-
import { Box, TypeSelect } from './common';
|
|
21
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
22
20
|
import { useComputeNodeState } from '../hooks';
|
|
23
21
|
|
|
22
|
+
import { Box, TypeSelect } from './common';
|
|
23
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
24
|
+
|
|
24
25
|
//
|
|
25
26
|
// Data
|
|
26
27
|
//
|
package/src/shapes/Database.tsx
CHANGED
|
@@ -9,7 +9,7 @@ import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-e
|
|
|
9
9
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
11
|
import { Box } from './common';
|
|
12
|
-
import { ComputeShape, createAnchorId, createShape
|
|
12
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
13
13
|
|
|
14
14
|
export const DatabaseShape = Schema.extend(
|
|
15
15
|
ComputeShape,
|
package/src/shapes/Function.tsx
CHANGED
|
@@ -6,22 +6,23 @@ import { Schema } from 'effect';
|
|
|
6
6
|
import React, { useCallback, useRef } from 'react';
|
|
7
7
|
|
|
8
8
|
import { AnyOutput, FunctionInput } from '@dxos/conductor';
|
|
9
|
-
import { getSnapshot, isInstanceOf
|
|
9
|
+
import { Ref, getSnapshot, isInstanceOf } from '@dxos/echo-schema';
|
|
10
10
|
import { FunctionType, ScriptType } from '@dxos/functions';
|
|
11
11
|
import { useClient } from '@dxos/react-client';
|
|
12
12
|
import { Filter, parseId } from '@dxos/react-client/echo';
|
|
13
13
|
import {
|
|
14
|
+
type ShapeComponentProps,
|
|
15
|
+
type ShapeDef,
|
|
14
16
|
TextBox,
|
|
15
17
|
type TextBoxControl,
|
|
16
18
|
type TextBoxProps,
|
|
17
|
-
type ShapeComponentProps,
|
|
18
|
-
type ShapeDef,
|
|
19
19
|
} from '@dxos/react-ui-canvas-editor';
|
|
20
20
|
|
|
21
|
-
import { Box, createFunctionAnchors } from './common';
|
|
22
|
-
import { ComputeShape, createShape, type CreateShapeProps } from './defs';
|
|
23
21
|
import { useComputeNodeState } from '../hooks';
|
|
24
22
|
|
|
23
|
+
import { Box, createFunctionAnchors } from './common';
|
|
24
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
25
|
+
|
|
25
26
|
export const FunctionShape = Schema.extend(
|
|
26
27
|
ComputeShape,
|
|
27
28
|
Schema.Struct({
|
package/src/shapes/Gpt.tsx
CHANGED
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import React, { useEffect, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import { type GenerationStreamEvent } from '@dxos/ai';
|
|
9
8
|
import { GptInput, GptOutput } from '@dxos/conductor';
|
|
10
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
11
10
|
|
|
12
|
-
import { createFunctionAnchors, FunctionBody, getHeight } from './common';
|
|
13
|
-
import { ComputeShape, createShape, type CreateShapeProps } from './defs';
|
|
14
11
|
import { useComputeNodeState } from '../hooks';
|
|
15
12
|
|
|
13
|
+
import { FunctionBody, createFunctionAnchors, getHeight } from './common';
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
15
|
+
|
|
16
16
|
export const GptShape = Schema.extend(
|
|
17
17
|
ComputeShape,
|
|
18
18
|
Schema.Struct({
|
|
@@ -43,8 +43,10 @@ export const GptComponent = ({ shape }: ShapeComponentProps<GptShape>) => {
|
|
|
43
43
|
setText('');
|
|
44
44
|
break;
|
|
45
45
|
}
|
|
46
|
+
|
|
46
47
|
case 'custom': {
|
|
47
|
-
|
|
48
|
+
// TODO(burdon): Any?
|
|
49
|
+
const token = ev.event;
|
|
48
50
|
switch (token.type) {
|
|
49
51
|
case 'content_block_delta':
|
|
50
52
|
switch (token.delta.type) {
|
|
@@ -11,7 +11,7 @@ import { Icon } from '@dxos/react-ui';
|
|
|
11
11
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
12
12
|
|
|
13
13
|
import { createFunctionAnchors } from './common';
|
|
14
|
-
import { ComputeShape,
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
15
15
|
|
|
16
16
|
export const GptRealtimeShape = Schema.extend(
|
|
17
17
|
ComputeShape,
|
package/src/shapes/Json.tsx
CHANGED
|
@@ -10,10 +10,11 @@ import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-e
|
|
|
10
10
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
import { JsonFilter } from '@dxos/react-ui-syntax-highlighter';
|
|
12
12
|
|
|
13
|
-
import { createFunctionAnchors, getHeight, Box } from './common';
|
|
14
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
15
13
|
import { useComputeNodeState } from '../hooks';
|
|
16
14
|
|
|
15
|
+
import { Box, createFunctionAnchors, getHeight } from './common';
|
|
16
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
17
|
+
|
|
17
18
|
//
|
|
18
19
|
// Data
|
|
19
20
|
//
|
package/src/shapes/Logic.tsx
CHANGED
|
@@ -8,8 +8,8 @@ import React from 'react';
|
|
|
8
8
|
import { IfElseInput, IfElseOutput, IfInput, IfOutput } from '@dxos/conductor';
|
|
9
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import { ComputeShape,
|
|
11
|
+
import { FunctionBody, createFunctionAnchors, getHeight } from './common';
|
|
12
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
13
13
|
|
|
14
14
|
//
|
|
15
15
|
// Data
|
package/src/shapes/Queue.tsx
CHANGED
|
@@ -10,10 +10,11 @@ import { type ThemedClassName } from '@dxos/react-ui';
|
|
|
10
10
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
import { mx } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
13
|
+
import { useComputeNodeState } from '../hooks';
|
|
14
|
+
|
|
13
15
|
import { createFunctionAnchors } from './common';
|
|
14
16
|
import { Box, type BoxActionHandler } from './common';
|
|
15
|
-
import { ComputeShape,
|
|
16
|
-
import { useComputeNodeState } from '../hooks';
|
|
17
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
17
18
|
|
|
18
19
|
export const QueueShape = Schema.extend(
|
|
19
20
|
ComputeShape,
|
package/src/shapes/RNG.tsx
CHANGED
|
@@ -7,11 +7,12 @@ import React, { useEffect, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { DEFAULT_OUTPUT } from '@dxos/conductor';
|
|
9
9
|
import { Icon, type IconProps } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
13
12
|
import { useComputeNodeState } from '../hooks';
|
|
14
13
|
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
|
+
|
|
15
16
|
export const RandomShape = Schema.extend(
|
|
16
17
|
ComputeShape,
|
|
17
18
|
Schema.Struct({
|
package/src/shapes/Scope.tsx
CHANGED
|
@@ -6,12 +6,13 @@ import { Schema } from 'effect';
|
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
import { DEFAULT_INPUT } from '@dxos/conductor';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
10
|
+
import { Chaos, shaderPresets, useAudioStream } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
13
12
|
import { useComputeNodeState } from '../hooks';
|
|
14
13
|
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
|
+
|
|
15
16
|
export const ScopeShape = Schema.extend(
|
|
16
17
|
ComputeShape,
|
|
17
18
|
Schema.Struct({
|
package/src/shapes/Surface.tsx
CHANGED
|
@@ -10,10 +10,11 @@ import { DEFAULT_INPUT } from '@dxos/conductor';
|
|
|
10
10
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
12
12
|
|
|
13
|
-
import { Box, type BoxActionHandler } from './common';
|
|
14
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
15
13
|
import { useComputeNodeState } from '../hooks';
|
|
16
14
|
|
|
15
|
+
import { Box, type BoxActionHandler } from './common';
|
|
16
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
17
|
+
|
|
17
18
|
export const SurfaceShape = Schema.extend(
|
|
18
19
|
ComputeShape,
|
|
19
20
|
Schema.Struct({
|
package/src/shapes/Switch.tsx
CHANGED
|
@@ -7,11 +7,12 @@ import React, { useEffect, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { DEFAULT_OUTPUT } from '@dxos/conductor';
|
|
9
9
|
import { Input } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
10
|
+
import { type ShapeComponentProps, type ShapeDef, createAnchorMap } from '@dxos/react-ui-canvas-editor';
|
|
11
11
|
|
|
12
|
-
import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
|
|
13
12
|
import { useComputeNodeState } from '../hooks';
|
|
14
13
|
|
|
14
|
+
import { ComputeShape, type CreateShapeProps, createAnchorId, createShape } from './defs';
|
|
15
|
+
|
|
15
16
|
export const SwitchShape = Schema.extend(
|
|
16
17
|
ComputeShape,
|
|
17
18
|
Schema.Struct({
|
package/src/shapes/Table.tsx
CHANGED
|
@@ -9,8 +9,8 @@ import { createInputSchema, createOutputSchema } from '@dxos/conductor';
|
|
|
9
9
|
import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
|
|
10
10
|
import { DataType } from '@dxos/schema';
|
|
11
11
|
|
|
12
|
-
import {
|
|
13
|
-
import { ComputeShape,
|
|
12
|
+
import { Box, createFunctionAnchors } from './common';
|
|
13
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
14
14
|
|
|
15
15
|
const InputSchema = createInputSchema(DataType.Message);
|
|
16
16
|
const OutputSchema = createOutputSchema(Schema.mutable(Schema.Array(DataType.Message)));
|
package/src/shapes/Template.tsx
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import React, { useRef } from 'react';
|
|
7
7
|
|
|
8
|
-
import { ComputeValueType,
|
|
8
|
+
import { ComputeValueType, TemplateOutput, VoidInput, getTemplateInputSchema } from '@dxos/conductor';
|
|
9
9
|
import { toJsonSchema } from '@dxos/echo-schema';
|
|
10
10
|
import { invariant } from '@dxos/invariant';
|
|
11
11
|
import {
|
|
@@ -16,10 +16,11 @@ import {
|
|
|
16
16
|
type TextBoxProps,
|
|
17
17
|
} from '@dxos/react-ui-canvas-editor';
|
|
18
18
|
|
|
19
|
-
import { Box, createFunctionAnchors, TypeSelect } from './common';
|
|
20
|
-
import { ComputeShape, createShape, type CreateShapeProps } from './defs';
|
|
21
19
|
import { useComputeNodeState } from '../hooks';
|
|
22
20
|
|
|
21
|
+
import { Box, TypeSelect, createFunctionAnchors } from './common';
|
|
22
|
+
import { ComputeShape, type CreateShapeProps, createShape } from './defs';
|
|
23
|
+
|
|
23
24
|
//
|
|
24
25
|
// Data
|
|
25
26
|
//
|