@dxos/react-ui-canvas-compute 0.8.2-main.2f9c567 → 0.8.2-main.36232bc

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 (99) hide show
  1. package/dist/lib/browser/index.mjs +120 -121
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node/index.cjs +160 -161
  5. package/dist/lib/node/index.cjs.map +3 -3
  6. package/dist/lib/node/meta.json +1 -1
  7. package/dist/lib/node-esm/index.mjs +120 -121
  8. package/dist/lib/node-esm/index.mjs.map +3 -3
  9. package/dist/lib/node-esm/meta.json +1 -1
  10. package/dist/types/src/graph/controller.d.ts +17 -1
  11. package/dist/types/src/graph/controller.d.ts.map +1 -1
  12. package/dist/types/src/hooks/useComputeNodeState.d.ts.map +1 -1
  13. package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -1
  14. package/dist/types/src/json.test.d.ts +18 -18
  15. package/dist/types/src/json.test.d.ts.map +1 -1
  16. package/dist/types/src/shapes/Append.d.ts +19 -19
  17. package/dist/types/src/shapes/Append.d.ts.map +1 -1
  18. package/dist/types/src/shapes/Array.d.ts +19 -19
  19. package/dist/types/src/shapes/Array.d.ts.map +1 -1
  20. package/dist/types/src/shapes/Audio.d.ts +19 -19
  21. package/dist/types/src/shapes/Audio.d.ts.map +1 -1
  22. package/dist/types/src/shapes/Beacon.d.ts +19 -19
  23. package/dist/types/src/shapes/Beacon.d.ts.map +1 -1
  24. package/dist/types/src/shapes/Boolean.d.ts +70 -70
  25. package/dist/types/src/shapes/Boolean.d.ts.map +1 -1
  26. package/dist/types/src/shapes/Chat.d.ts +19 -19
  27. package/dist/types/src/shapes/Chat.d.ts.map +1 -1
  28. package/dist/types/src/shapes/Constant.d.ts +20 -20
  29. package/dist/types/src/shapes/Constant.d.ts.map +1 -1
  30. package/dist/types/src/shapes/Database.d.ts +19 -19
  31. package/dist/types/src/shapes/Database.d.ts.map +1 -1
  32. package/dist/types/src/shapes/Function.d.ts +19 -19
  33. package/dist/types/src/shapes/Function.d.ts.map +1 -1
  34. package/dist/types/src/shapes/Gpt.d.ts +19 -19
  35. package/dist/types/src/shapes/Gpt.d.ts.map +1 -1
  36. package/dist/types/src/shapes/GptRealtime.d.ts +19 -19
  37. package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -1
  38. package/dist/types/src/shapes/Json.d.ts +37 -37
  39. package/dist/types/src/shapes/Json.d.ts.map +1 -1
  40. package/dist/types/src/shapes/Logic.d.ts +37 -37
  41. package/dist/types/src/shapes/Logic.d.ts.map +1 -1
  42. package/dist/types/src/shapes/Queue.d.ts +19 -19
  43. package/dist/types/src/shapes/Queue.d.ts.map +1 -1
  44. package/dist/types/src/shapes/RNG.d.ts +21 -21
  45. package/dist/types/src/shapes/RNG.d.ts.map +1 -1
  46. package/dist/types/src/shapes/Scope.d.ts +19 -19
  47. package/dist/types/src/shapes/Scope.d.ts.map +1 -1
  48. package/dist/types/src/shapes/Surface.d.ts +19 -19
  49. package/dist/types/src/shapes/Surface.d.ts.map +1 -1
  50. package/dist/types/src/shapes/Switch.d.ts +19 -19
  51. package/dist/types/src/shapes/Switch.d.ts.map +1 -1
  52. package/dist/types/src/shapes/Table.d.ts +19 -19
  53. package/dist/types/src/shapes/Table.d.ts.map +1 -1
  54. package/dist/types/src/shapes/Template.d.ts +20 -20
  55. package/dist/types/src/shapes/Template.d.ts.map +1 -1
  56. package/dist/types/src/shapes/Text.d.ts +19 -19
  57. package/dist/types/src/shapes/Text.d.ts.map +1 -1
  58. package/dist/types/src/shapes/TextToImage.d.ts +19 -19
  59. package/dist/types/src/shapes/TextToImage.d.ts.map +1 -1
  60. package/dist/types/src/shapes/Thread.d.ts +19 -19
  61. package/dist/types/src/shapes/Thread.d.ts.map +1 -1
  62. package/dist/types/src/shapes/Trigger.d.ts +45 -47
  63. package/dist/types/src/shapes/Trigger.d.ts.map +1 -1
  64. package/dist/types/src/shapes/common/FunctionBody.d.ts +5 -5
  65. package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -1
  66. package/dist/types/src/shapes/defs.d.ts +19 -18
  67. package/dist/types/src/shapes/defs.d.ts.map +1 -1
  68. package/package.json +39 -40
  69. package/src/compute.stories.tsx +1 -1
  70. package/src/hooks/useComputeNodeState.ts +3 -3
  71. package/src/hooks/useGraphMonitor.ts +6 -4
  72. package/src/json.test.ts +10 -10
  73. package/src/schema.test.ts +5 -5
  74. package/src/shapes/Append.tsx +5 -5
  75. package/src/shapes/Array.tsx +5 -5
  76. package/src/shapes/Audio.tsx +5 -5
  77. package/src/shapes/Beacon.tsx +5 -5
  78. package/src/shapes/Boolean.tsx +5 -5
  79. package/src/shapes/Chat.tsx +5 -5
  80. package/src/shapes/Constant.tsx +6 -6
  81. package/src/shapes/Database.tsx +5 -5
  82. package/src/shapes/Function.tsx +6 -7
  83. package/src/shapes/Gpt.tsx +5 -5
  84. package/src/shapes/GptRealtime.tsx +8 -8
  85. package/src/shapes/Json.tsx +9 -9
  86. package/src/shapes/Logic.tsx +9 -9
  87. package/src/shapes/Queue.tsx +5 -5
  88. package/src/shapes/RNG.tsx +7 -7
  89. package/src/shapes/Scope.tsx +5 -5
  90. package/src/shapes/Surface.tsx +5 -5
  91. package/src/shapes/Switch.tsx +5 -5
  92. package/src/shapes/Table.tsx +6 -6
  93. package/src/shapes/Template.tsx +7 -8
  94. package/src/shapes/Text.tsx +5 -5
  95. package/src/shapes/TextToImage.tsx +5 -5
  96. package/src/shapes/Thread.tsx +6 -6
  97. package/src/shapes/Trigger.tsx +16 -15
  98. package/src/shapes/common/FunctionBody.tsx +9 -11
  99. package/src/shapes/defs.ts +9 -9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui-canvas-compute",
3
- "version": "0.8.2-main.2f9c567",
3
+ "version": "0.8.2-main.36232bc",
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",
@@ -24,34 +24,33 @@
24
24
  "@antv/layout": "^1.2.13",
25
25
  "@effect/platform": "0.75.1",
26
26
  "chess.js": "^1.0.0",
27
- "@dxos/app-framework": "0.8.2-main.2f9c567",
28
- "@dxos/artifact": "0.8.2-main.2f9c567",
29
- "@dxos/assistant": "0.8.2-main.2f9c567",
30
- "@dxos/async": "0.8.2-main.2f9c567",
31
- "@dxos/context": "0.8.2-main.2f9c567",
32
- "@dxos/debug": "0.8.2-main.2f9c567",
33
- "@dxos/echo": "0.8.2-main.2f9c567",
34
- "@dxos/echo-schema": "0.8.2-main.2f9c567",
35
- "@dxos/edge-client": "0.8.2-main.2f9c567",
36
- "@dxos/conductor": "0.8.2-main.2f9c567",
37
- "@dxos/functions": "0.8.2-main.2f9c567",
38
- "@dxos/graph": "0.8.2-main.2f9c567",
39
- "@dxos/invariant": "0.8.2-main.2f9c567",
40
- "@dxos/keys": "0.8.2-main.2f9c567",
41
- "@dxos/live-object": "0.8.2-main.2f9c567",
42
- "@dxos/log": "0.8.2-main.2f9c567",
43
- "@dxos/react-client": "0.8.2-main.2f9c567",
44
- "@dxos/react-edge-client": "0.8.2-main.2f9c567",
45
- "@dxos/react-ui-attention": "0.8.2-main.2f9c567",
46
- "@dxos/react-ui-canvas": "0.8.2-main.2f9c567",
47
- "@dxos/react-ui-editor": "0.8.2-main.2f9c567",
48
- "@dxos/react-ui-canvas-editor": "0.8.2-main.2f9c567",
49
- "@dxos/react-ui-form": "0.8.2-main.2f9c567",
50
- "@dxos/react-ui-sfx": "0.8.2-main.2f9c567",
51
- "@dxos/react-ui-stack": "0.8.2-main.2f9c567",
52
- "@dxos/react-ui-syntax-highlighter": "0.8.2-main.2f9c567",
53
- "@dxos/util": "0.8.2-main.2f9c567",
54
- "@dxos/schema": "0.8.2-main.2f9c567"
27
+ "@dxos/app-framework": "0.8.2-main.36232bc",
28
+ "@dxos/assistant": "0.8.2-main.36232bc",
29
+ "@dxos/artifact": "0.8.2-main.36232bc",
30
+ "@dxos/conductor": "0.8.2-main.36232bc",
31
+ "@dxos/context": "0.8.2-main.36232bc",
32
+ "@dxos/debug": "0.8.2-main.36232bc",
33
+ "@dxos/async": "0.8.2-main.36232bc",
34
+ "@dxos/echo-schema": "0.8.2-main.36232bc",
35
+ "@dxos/edge-client": "0.8.2-main.36232bc",
36
+ "@dxos/invariant": "0.8.2-main.36232bc",
37
+ "@dxos/keys": "0.8.2-main.36232bc",
38
+ "@dxos/graph": "0.8.2-main.36232bc",
39
+ "@dxos/live-object": "0.8.2-main.36232bc",
40
+ "@dxos/log": "0.8.2-main.36232bc",
41
+ "@dxos/functions": "0.8.2-main.36232bc",
42
+ "@dxos/react-client": "0.8.2-main.36232bc",
43
+ "@dxos/react-edge-client": "0.8.2-main.36232bc",
44
+ "@dxos/react-ui-attention": "0.8.2-main.36232bc",
45
+ "@dxos/react-ui-canvas-editor": "0.8.2-main.36232bc",
46
+ "@dxos/react-ui-editor": "0.8.2-main.36232bc",
47
+ "@dxos/react-ui-canvas": "0.8.2-main.36232bc",
48
+ "@dxos/react-ui-form": "0.8.2-main.36232bc",
49
+ "@dxos/react-ui-sfx": "0.8.2-main.36232bc",
50
+ "@dxos/react-ui-stack": "0.8.2-main.36232bc",
51
+ "@dxos/react-ui-syntax-highlighter": "0.8.2-main.36232bc",
52
+ "@dxos/util": "0.8.2-main.36232bc",
53
+ "@dxos/schema": "0.8.2-main.36232bc"
55
54
  },
56
55
  "devDependencies": {
57
56
  "@effect/ai": "0.8.0",
@@ -59,26 +58,26 @@
59
58
  "@types/lodash.defaultsdeep": "^4.6.6",
60
59
  "@types/react": "~18.2.0",
61
60
  "@types/react-dom": "~18.2.0",
62
- "effect": "3.14.21",
61
+ "effect": "3.13.3",
63
62
  "lodash.defaultsdeep": "^4.6.1",
64
63
  "react": "~18.2.0",
65
64
  "react-dom": "~18.2.0",
66
65
  "vite": "5.4.7",
67
- "@dxos/artifact-testing": "0.8.2-main.2f9c567",
68
- "@dxos/app-framework": "0.8.2-main.2f9c567",
69
- "@dxos/compute": "0.8.2-main.2f9c567",
70
- "@dxos/random": "0.8.2-main.2f9c567",
71
- "@dxos/echo-signals": "0.8.2-main.2f9c567",
72
- "@dxos/storybook-utils": "0.8.2-main.2f9c567",
73
- "@dxos/react-ui-theme": "0.8.2-main.2f9c567",
74
- "@dxos/react-ui": "0.8.2-main.2f9c567"
66
+ "@dxos/app-framework": "0.8.2-main.36232bc",
67
+ "@dxos/artifact-testing": "0.8.2-main.36232bc",
68
+ "@dxos/random": "0.8.2-main.36232bc",
69
+ "@dxos/echo-signals": "0.8.2-main.36232bc",
70
+ "@dxos/compute": "0.8.2-main.36232bc",
71
+ "@dxos/react-ui": "0.8.2-main.36232bc",
72
+ "@dxos/storybook-utils": "0.8.2-main.36232bc",
73
+ "@dxos/react-ui-theme": "0.8.2-main.36232bc"
75
74
  },
76
75
  "peerDependencies": {
77
76
  "effect": "3.13.3",
78
77
  "react": "~18.2.0",
79
78
  "react-dom": "~18.2.0",
80
- "@dxos/react-ui": "0.8.2-main.2f9c567",
81
- "@dxos/react-ui-theme": "0.8.2-main.2f9c567"
79
+ "@dxos/react-ui": "0.8.2-main.36232bc",
80
+ "@dxos/react-ui-theme": "0.8.2-main.36232bc"
82
81
  },
83
82
  "publishConfig": {
84
83
  "access": "public"
@@ -38,7 +38,7 @@ import {
38
38
  createArtifactCircuit,
39
39
  } from './testing';
40
40
 
41
- // const FormSchema = Schema.omit<any, any, ['subgraph']>('subgraph')(ComputeNode);
41
+ // const FormSchema = S.omit<any, any, ['subgraph']>('subgraph')(ComputeNode);
42
42
 
43
43
  const sidebarTypes: NonNullable<RenderProps['sidebar']>[] = ['canvas', 'compute', 'controller', 'selected'] as const;
44
44
 
@@ -2,10 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import { useCallback, useEffect, useState } from 'react';
7
6
 
8
7
  import type { ComputeNode, ComputeMeta, ComputeEvent } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { invariant } from '@dxos/invariant';
10
10
 
11
11
  import { useComputeContext } from './compute-context';
@@ -67,8 +67,8 @@ export const useComputeNodeState = (shape: ComputeShape): ComputeNodeState => {
67
67
  return {
68
68
  node: controller.getComputeNode(shape.node!),
69
69
  meta: meta ?? {
70
- input: Schema.Struct({}),
71
- output: Schema.Struct({}),
70
+ input: S.Struct({}),
71
+ output: S.Struct({}),
72
72
  },
73
73
  runtime: {
74
74
  inputs: controller.getInputs(shape.node!),
@@ -5,8 +5,9 @@
5
5
  import { useMemo } from 'react';
6
6
 
7
7
  import { type ComputeEdge, ComputeGraphModel, type ComputeNode, DEFAULT_INPUT, DEFAULT_OUTPUT } from '@dxos/conductor';
8
- import { Type } from '@dxos/echo';
8
+ import { ObjectId } from '@dxos/echo-schema';
9
9
  import { invariant } from '@dxos/invariant';
10
+ import { DXN } from '@dxos/keys';
10
11
  import { getSpace } from '@dxos/react-client/echo';
11
12
  import { type GraphMonitor, type CanvasGraphModel, type Connection } from '@dxos/react-ui-canvas-editor';
12
13
  import { isNonNullable } from '@dxos/util';
@@ -27,7 +28,7 @@ export const mapEdge = (
27
28
  invariant(targetNode?.node);
28
29
 
29
30
  return {
30
- id: Type.ObjectId.random(),
31
+ id: ObjectId.random(),
31
32
  source: sourceNode.node,
32
33
  target: targetNode.node,
33
34
  output,
@@ -113,8 +114,9 @@ export const createComputeGraph = (graph?: CanvasGraphModel<ComputeShape>) => {
113
114
  const linkTriggerToCompute = (graph: ComputeGraphModel, computeNode: ComputeNode, triggerData: TriggerShape) => {
114
115
  const functionTrigger = triggerData.functionTrigger?.target;
115
116
  invariant(functionTrigger);
116
- functionTrigger.function = Type.ref(graph.root);
117
- functionTrigger.inputNodeId = computeNode.id;
117
+ functionTrigger.function = DXN.fromLocalObjectId(graph.root.id).toString();
118
+ functionTrigger.meta ??= {};
119
+ functionTrigger.meta.computeNodeId = computeNode.id;
118
120
  };
119
121
 
120
122
  const deleteTriggerObjects = (computeGraph: ComputeGraphModel, deleted: CanvasGraphModel) => {
package/src/json.test.ts CHANGED
@@ -2,27 +2,27 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import { describe, test } from 'vitest';
7
6
 
7
+ import { S } from '@dxos/echo-schema';
8
8
  import { BaseGraphEdge, BaseGraphNode } from '@dxos/graph';
9
9
 
10
10
  import { createGptCircuit } from './testing';
11
11
 
12
- export const Shape = Schema.extend(
12
+ export const Shape = S.extend(
13
13
  BaseGraphNode,
14
- Schema.Struct({
15
- text: Schema.optional(Schema.String),
16
- guide: Schema.optional(Schema.Boolean),
17
- classNames: Schema.optional(Schema.String),
14
+ S.Struct({
15
+ text: S.optional(S.String),
16
+ guide: S.optional(S.Boolean),
17
+ classNames: S.optional(S.String),
18
18
  }),
19
19
  );
20
20
 
21
- export const Connection = Schema.extend(
21
+ export const Connection = S.extend(
22
22
  BaseGraphEdge,
23
- Schema.Struct({
24
- input: Schema.optional(Schema.String),
25
- output: Schema.optional(Schema.String),
23
+ S.Struct({
24
+ input: S.optional(S.String),
25
+ output: S.optional(S.String),
26
26
  }),
27
27
  );
28
28
 
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import { describe, test } from 'vitest';
7
6
 
8
7
  import { live } from '@dxos/client/echo';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { BaseGraphNode, Graph } from '@dxos/graph';
10
10
  import {
11
11
  Polygon,
@@ -24,10 +24,10 @@ describe('compute', () => {
24
24
  // const model = CanvasGraphModel.create<ComputeShape>();
25
25
  const node = createSwitch({ id: 'x', center: { x: 0, y: 0 }, size: { width: 80, height: 80 } });
26
26
  console.log(JSON.stringify(node, null, 2));
27
- expect(Schema.is(ComputeShape)(node)).toBe(true);
28
- expect(Schema.is(Polygon)(node)).toBe(true);
29
- expect(Schema.is(Shape)(node)).toBe(true);
30
- expect(Schema.is(BaseGraphNode)(node)).toBe(true);
27
+ expect(S.is(ComputeShape)(node)).toBe(true);
28
+ expect(S.is(Polygon)(node)).toBe(true);
29
+ expect(S.is(Shape)(node)).toBe(true);
30
+ expect(S.is(BaseGraphNode)(node)).toBe(true);
31
31
 
32
32
  const graph = live(Graph, { nodes: [], edges: [] });
33
33
  graph.nodes.push(node); // Throws.
@@ -2,23 +2,23 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React from 'react';
7
6
 
8
7
  import { AppendInput } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
10
10
 
11
11
  import { createFunctionAnchors, FunctionBody, getHeight } from './common';
12
12
  import { ComputeShape, createShape, type CreateShapeProps } from './defs';
13
13
 
14
- export const AppendShape = Schema.extend(
14
+ export const AppendShape = S.extend(
15
15
  ComputeShape,
16
- Schema.Struct({
17
- type: Schema.Literal('append'),
16
+ S.Struct({
17
+ type: S.Literal('append'),
18
18
  }),
19
19
  );
20
20
 
21
- export type AppendShape = Schema.Schema.Type<typeof AppendShape>;
21
+ export type AppendShape = S.Schema.Type<typeof AppendShape>;
22
22
 
23
23
  export type CreateAppendProps = CreateShapeProps<AppendShape>;
24
24
 
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React from 'react';
7
6
 
8
7
  import { ReducerInput, ReducerOutput } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
10
10
 
11
11
  import { createFunctionAnchors, FunctionBody, getHeight } from './common';
@@ -15,14 +15,14 @@ import { ComputeShape, createShape, type CreateShapeProps } from './defs';
15
15
  // Data
16
16
  //
17
17
 
18
- export const ReducerShape = Schema.extend(
18
+ export const ReducerShape = S.extend(
19
19
  ComputeShape,
20
- Schema.Struct({
21
- type: Schema.Literal('reducer'),
20
+ S.Struct({
21
+ type: S.Literal('reducer'),
22
22
  }),
23
23
  );
24
24
 
25
- export type ReducerShape = Schema.Schema.Type<typeof ReducerShape>;
25
+ export type ReducerShape = S.Schema.Type<typeof ReducerShape>;
26
26
 
27
27
  //
28
28
  // Components
@@ -2,23 +2,23 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useEffect, useState } from 'react';
7
6
 
7
+ import { S } from '@dxos/echo-schema';
8
8
  import { Icon } from '@dxos/react-ui';
9
9
  import { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
10
10
 
11
11
  import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
12
12
  import { useComputeNodeState } from '../hooks';
13
13
 
14
- export const AudioShape = Schema.extend(
14
+ export const AudioShape = S.extend(
15
15
  ComputeShape,
16
- Schema.Struct({
17
- type: Schema.Literal('audio'),
16
+ S.Struct({
17
+ type: S.Literal('audio'),
18
18
  }),
19
19
  );
20
20
 
21
- export type AudioShape = Schema.Schema.Type<typeof AudioShape>;
21
+ export type AudioShape = S.Schema.Type<typeof AudioShape>;
22
22
 
23
23
  export type CreateAudioProps = CreateShapeProps<AudioShape>;
24
24
 
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React from 'react';
7
6
 
8
7
  import { DEFAULT_INPUT, isTruthy } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { Icon } from '@dxos/react-ui';
10
10
  import { createAnchorMap, type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
11
11
  import { mx } from '@dxos/react-ui-theme';
@@ -13,14 +13,14 @@ import { mx } from '@dxos/react-ui-theme';
13
13
  import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
14
14
  import { useComputeNodeState } from '../hooks';
15
15
 
16
- export const BeaconShape = Schema.extend(
16
+ export const BeaconShape = S.extend(
17
17
  ComputeShape,
18
- Schema.Struct({
19
- type: Schema.Literal('beacon'),
18
+ S.Struct({
19
+ type: S.Literal('beacon'),
20
20
  }),
21
21
  );
22
22
 
23
- export type BeaconShape = Schema.Schema.Type<typeof BeaconShape>;
23
+ export type BeaconShape = S.Schema.Type<typeof BeaconShape>;
24
24
 
25
25
  export type CreateBeaconProps = CreateShapeProps<BeaconShape>;
26
26
 
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { type FC } from 'react';
7
6
 
7
+ import { S } from '@dxos/echo-schema';
8
8
  import { type ShapeDef } from '@dxos/react-ui-canvas-editor';
9
9
  import { createAnchors, getAnchorPoints } from '@dxos/react-ui-canvas-editor';
10
10
 
@@ -17,14 +17,14 @@ import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from
17
17
 
18
18
  type GateType = 'and' | 'or' | 'not';
19
19
 
20
- const GateShape = Schema.extend(
20
+ const GateShape = S.extend(
21
21
  ComputeShape,
22
- Schema.Struct({
23
- type: Schema.String,
22
+ S.Struct({
23
+ type: S.String,
24
24
  }),
25
25
  );
26
26
 
27
- type GateShape = Schema.Schema.Type<typeof GateShape>;
27
+ type GateShape = S.Schema.Type<typeof GateShape>;
28
28
 
29
29
  type CreateGateProps = CreateShapeProps<GateShape> & { type: GateType };
30
30
 
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useRef } from 'react';
7
6
 
8
7
  import { DEFAULT_OUTPUT } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import {
10
10
  type ShapeComponentProps,
11
11
  type ShapeDef,
@@ -23,14 +23,14 @@ import { useComputeNodeState } from '../hooks';
23
23
  // Data
24
24
  //
25
25
 
26
- export const ChatShape = Schema.extend(
26
+ export const ChatShape = S.extend(
27
27
  ComputeShape,
28
- Schema.Struct({
29
- type: Schema.Literal('chat'),
28
+ S.Struct({
29
+ type: S.Literal('chat'),
30
30
  }),
31
31
  );
32
32
 
33
- export type ChatShape = Schema.Schema.Type<typeof ChatShape>;
33
+ export type ChatShape = S.Schema.Type<typeof ChatShape>;
34
34
 
35
35
  //
36
36
  // Component
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useCallback, useRef, useState } from 'react';
7
6
 
8
7
  import { ComputeValueType } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { Input } from '@dxos/react-ui';
10
10
  import {
11
11
  type ShapeComponentProps,
@@ -25,15 +25,15 @@ import { useComputeNodeState } from '../hooks';
25
25
  // Data
26
26
  //
27
27
 
28
- export const ConstantShape = Schema.extend(
28
+ export const ConstantShape = S.extend(
29
29
  ComputeShape,
30
- Schema.Struct({
31
- type: Schema.Literal('constant'),
32
- value: Schema.optional(Schema.Any),
30
+ S.Struct({
31
+ type: S.Literal('constant'),
32
+ value: S.optional(S.Any),
33
33
  }),
34
34
  );
35
35
 
36
- export type ConstantShape = Schema.Schema.Type<typeof ConstantShape>;
36
+ export type ConstantShape = S.Schema.Type<typeof ConstantShape>;
37
37
 
38
38
  //
39
39
  // Component
@@ -2,23 +2,23 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React from 'react';
7
6
 
7
+ import { S } from '@dxos/echo-schema';
8
8
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
9
9
  import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
10
10
 
11
11
  import { Box } from './common';
12
12
  import { ComputeShape, createAnchorId, createShape, type CreateShapeProps } from './defs';
13
13
 
14
- export const DatabaseShape = Schema.extend(
14
+ export const DatabaseShape = S.extend(
15
15
  ComputeShape,
16
- Schema.Struct({
17
- type: Schema.Literal('database'),
16
+ S.Struct({
17
+ type: S.Literal('database'),
18
18
  }),
19
19
  );
20
20
 
21
- export type DatabaseShape = Schema.Schema.Type<typeof DatabaseShape>;
21
+ export type DatabaseShape = S.Schema.Type<typeof DatabaseShape>;
22
22
 
23
23
  export type CreateDatabaseProps = CreateShapeProps<DatabaseShape>;
24
24
 
@@ -2,12 +2,11 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useCallback, useRef } from 'react';
7
6
 
8
7
  import { AnyOutput, FunctionInput } from '@dxos/conductor';
9
- import { getSnapshot, isInstanceOf } from '@dxos/echo-schema';
10
- import { FunctionType, ScriptType } from '@dxos/functions';
8
+ import { getSnapshot, isInstanceOf, S } from '@dxos/echo-schema';
9
+ import { FunctionType, ScriptType } from '@dxos/functions/types';
11
10
  import { useClient } from '@dxos/react-client';
12
11
  import { Filter, makeRef, parseId } from '@dxos/react-client/echo';
13
12
  import {
@@ -22,14 +21,14 @@ import { Box, createFunctionAnchors } from './common';
22
21
  import { ComputeShape, createShape, type CreateShapeProps } from './defs';
23
22
  import { useComputeNodeState } from '../hooks';
24
23
 
25
- export const FunctionShape = Schema.extend(
24
+ export const FunctionShape = S.extend(
26
25
  ComputeShape,
27
- Schema.Struct({
28
- type: Schema.Literal('function'),
26
+ S.Struct({
27
+ type: S.Literal('function'),
29
28
  }),
30
29
  );
31
30
 
32
- export type FunctionShape = Schema.Schema.Type<typeof FunctionShape>;
31
+ export type FunctionShape = S.Schema.Type<typeof FunctionShape>;
33
32
 
34
33
  export type CreateFunctionProps = CreateShapeProps<FunctionShape>;
35
34
 
@@ -2,25 +2,25 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useEffect, useState } from 'react';
7
6
 
8
7
  import type { GenerationStreamEvent } from '@dxos/assistant';
9
8
  import { GptInput, GptOutput } from '@dxos/conductor';
9
+ import { S } from '@dxos/echo-schema';
10
10
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
11
11
 
12
12
  import { createFunctionAnchors, FunctionBody, getHeight } from './common';
13
13
  import { ComputeShape, createShape, type CreateShapeProps } from './defs';
14
14
  import { useComputeNodeState } from '../hooks';
15
15
 
16
- export const GptShape = Schema.extend(
16
+ export const GptShape = S.extend(
17
17
  ComputeShape,
18
- Schema.Struct({
19
- type: Schema.Literal('gpt'),
18
+ S.Struct({
19
+ type: S.Literal('gpt'),
20
20
  }),
21
21
  );
22
22
 
23
- export type GptShape = Schema.Schema.Type<typeof GptShape>;
23
+ export type GptShape = S.Schema.Type<typeof GptShape>;
24
24
 
25
25
  export type CreateGptProps = CreateShapeProps<GptShape>;
26
26
 
@@ -2,9 +2,9 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React, { useState } from 'react';
7
6
 
7
+ import { S } from '@dxos/echo-schema';
8
8
  import { log } from '@dxos/log';
9
9
  import { useConfig } from '@dxos/react-client';
10
10
  import { Icon } from '@dxos/react-ui';
@@ -13,14 +13,14 @@ import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-e
13
13
  import { createFunctionAnchors } from './common';
14
14
  import { ComputeShape, createShape, type CreateShapeProps } from './defs';
15
15
 
16
- export const GptRealtimeShape = Schema.extend(
16
+ export const GptRealtimeShape = S.extend(
17
17
  ComputeShape,
18
- Schema.Struct({
19
- type: Schema.Literal('gpt-realtime'),
18
+ S.Struct({
19
+ type: S.Literal('gpt-realtime'),
20
20
  }),
21
21
  );
22
22
 
23
- export type GptRealtimeShape = Schema.Schema.Type<typeof GptRealtimeShape>;
23
+ export type GptRealtimeShape = S.Schema.Type<typeof GptRealtimeShape>;
24
24
 
25
25
  export type CreateGptRealtimeProps = CreateShapeProps<GptRealtimeShape>;
26
26
 
@@ -164,10 +164,10 @@ export const gptRealtimeShape: ShapeDef<GptRealtimeShape> = {
164
164
  getAnchors: (shape) =>
165
165
  createFunctionAnchors(
166
166
  shape,
167
- Schema.Struct({
168
- audio: Schema.Any,
167
+ S.Struct({
168
+ audio: S.Any,
169
169
  }),
170
- Schema.Struct({}),
170
+ S.Struct({}),
171
171
  ),
172
172
  resizable: true,
173
173
  };
@@ -2,10 +2,10 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { Schema } from 'effect';
6
5
  import React from 'react';
7
6
 
8
7
  import { DEFAULT_INPUT, DefaultOutput, JsonTransformInput } from '@dxos/conductor';
8
+ import { S } from '@dxos/echo-schema';
9
9
  import { type ShapeComponentProps, type ShapeDef } from '@dxos/react-ui-canvas-editor';
10
10
  import { createAnchorMap } from '@dxos/react-ui-canvas-editor';
11
11
  import { JsonFilter } from '@dxos/react-ui-syntax-highlighter';
@@ -18,23 +18,23 @@ import { useComputeNodeState } from '../hooks';
18
18
  // Data
19
19
  //
20
20
 
21
- export const JsonShape = Schema.extend(
21
+ export const JsonShape = S.extend(
22
22
  ComputeShape,
23
- Schema.Struct({
24
- type: Schema.Literal('json'),
23
+ S.Struct({
24
+ type: S.Literal('json'),
25
25
  }),
26
26
  );
27
27
 
28
- export type JsonShape = Schema.Schema.Type<typeof JsonShape>;
28
+ export type JsonShape = S.Schema.Type<typeof JsonShape>;
29
29
 
30
- export const JsonTransformShape = Schema.extend(
30
+ export const JsonTransformShape = S.extend(
31
31
  ComputeShape,
32
- Schema.Struct({
33
- type: Schema.Literal('json-transform'),
32
+ S.Struct({
33
+ type: S.Literal('json-transform'),
34
34
  }),
35
35
  );
36
36
 
37
- export type JsonTransformShape = Schema.Schema.Type<typeof JsonTransformShape>;
37
+ export type JsonTransformShape = S.Schema.Type<typeof JsonTransformShape>;
38
38
 
39
39
  //
40
40
  // Component