@dxos/react-ui-canvas-compute 0.8.2-main.f11618f → 0.8.2-main.fbd8ed0
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 +136 -135
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/index.cjs +161 -160
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/index.mjs +136 -135
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/components/DiagnosticOverlay.d.ts.map +1 -1
- package/dist/types/src/graph/controller.d.ts +1 -17
- 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.map +1 -1
- package/dist/types/src/hooks/useGraphMonitor.d.ts.map +1 -1
- package/dist/types/src/json.test.d.ts +18 -18
- package/dist/types/src/json.test.d.ts.map +1 -1
- package/dist/types/src/shapes/Append.d.ts +19 -19
- package/dist/types/src/shapes/Append.d.ts.map +1 -1
- package/dist/types/src/shapes/Array.d.ts +19 -19
- package/dist/types/src/shapes/Array.d.ts.map +1 -1
- package/dist/types/src/shapes/Audio.d.ts +19 -19
- package/dist/types/src/shapes/Audio.d.ts.map +1 -1
- package/dist/types/src/shapes/Beacon.d.ts +19 -19
- package/dist/types/src/shapes/Beacon.d.ts.map +1 -1
- package/dist/types/src/shapes/Boolean.d.ts +70 -70
- package/dist/types/src/shapes/Boolean.d.ts.map +1 -1
- package/dist/types/src/shapes/Chat.d.ts +19 -19
- package/dist/types/src/shapes/Chat.d.ts.map +1 -1
- package/dist/types/src/shapes/Constant.d.ts +20 -20
- package/dist/types/src/shapes/Constant.d.ts.map +1 -1
- package/dist/types/src/shapes/Database.d.ts +19 -19
- package/dist/types/src/shapes/Database.d.ts.map +1 -1
- package/dist/types/src/shapes/Function.d.ts +19 -19
- package/dist/types/src/shapes/Function.d.ts.map +1 -1
- package/dist/types/src/shapes/Gpt.d.ts +19 -19
- package/dist/types/src/shapes/Gpt.d.ts.map +1 -1
- package/dist/types/src/shapes/GptRealtime.d.ts +19 -19
- package/dist/types/src/shapes/GptRealtime.d.ts.map +1 -1
- package/dist/types/src/shapes/Json.d.ts +37 -37
- package/dist/types/src/shapes/Json.d.ts.map +1 -1
- package/dist/types/src/shapes/Logic.d.ts +37 -37
- package/dist/types/src/shapes/Logic.d.ts.map +1 -1
- package/dist/types/src/shapes/Queue.d.ts +19 -19
- package/dist/types/src/shapes/Queue.d.ts.map +1 -1
- package/dist/types/src/shapes/RNG.d.ts +21 -21
- package/dist/types/src/shapes/RNG.d.ts.map +1 -1
- package/dist/types/src/shapes/Scope.d.ts +19 -19
- package/dist/types/src/shapes/Scope.d.ts.map +1 -1
- package/dist/types/src/shapes/Surface.d.ts +19 -19
- package/dist/types/src/shapes/Surface.d.ts.map +1 -1
- package/dist/types/src/shapes/Switch.d.ts +19 -19
- package/dist/types/src/shapes/Switch.d.ts.map +1 -1
- package/dist/types/src/shapes/Table.d.ts +19 -19
- package/dist/types/src/shapes/Table.d.ts.map +1 -1
- package/dist/types/src/shapes/Template.d.ts +20 -20
- package/dist/types/src/shapes/Template.d.ts.map +1 -1
- package/dist/types/src/shapes/Text.d.ts +19 -19
- package/dist/types/src/shapes/Text.d.ts.map +1 -1
- package/dist/types/src/shapes/TextToImage.d.ts +19 -19
- package/dist/types/src/shapes/TextToImage.d.ts.map +1 -1
- package/dist/types/src/shapes/Thread.d.ts +19 -19
- package/dist/types/src/shapes/Thread.d.ts.map +1 -1
- package/dist/types/src/shapes/Trigger.d.ts +47 -45
- package/dist/types/src/shapes/Trigger.d.ts.map +1 -1
- package/dist/types/src/shapes/common/FunctionBody.d.ts +5 -5
- package/dist/types/src/shapes/common/FunctionBody.d.ts.map +1 -1
- package/dist/types/src/shapes/common/TypeSelect.d.ts.map +1 -1
- package/dist/types/src/shapes/defs.d.ts +18 -19
- package/dist/types/src/shapes/defs.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 +40 -40
- package/src/compute.stories.tsx +2 -2
- package/src/hooks/useComputeNodeState.ts +3 -3
- package/src/hooks/useGraphMonitor.ts +3 -5
- package/src/json.test.ts +10 -10
- package/src/schema.test.ts +5 -5
- package/src/shapes/Append.tsx +5 -5
- package/src/shapes/Array.tsx +5 -5
- package/src/shapes/Audio.tsx +5 -5
- package/src/shapes/Beacon.tsx +5 -5
- package/src/shapes/Boolean.tsx +5 -5
- package/src/shapes/Chat.tsx +5 -5
- package/src/shapes/Constant.tsx +6 -6
- package/src/shapes/Database.tsx +5 -5
- package/src/shapes/Function.tsx +8 -7
- package/src/shapes/Gpt.tsx +5 -5
- package/src/shapes/GptRealtime.tsx +8 -8
- package/src/shapes/Json.tsx +9 -9
- package/src/shapes/Logic.tsx +9 -9
- package/src/shapes/Queue.tsx +5 -5
- package/src/shapes/RNG.tsx +7 -7
- package/src/shapes/Scope.tsx +5 -5
- package/src/shapes/Surface.tsx +5 -5
- package/src/shapes/Switch.tsx +5 -5
- package/src/shapes/Table.tsx +6 -6
- package/src/shapes/Template.tsx +8 -7
- package/src/shapes/Text.tsx +5 -5
- package/src/shapes/TextToImage.tsx +5 -5
- package/src/shapes/Thread.tsx +6 -6
- package/src/shapes/Trigger.tsx +30 -31
- package/src/shapes/common/FunctionBody.tsx +11 -9
- package/src/shapes/defs.ts +9 -9
|
@@ -142,8 +142,8 @@ var useComputeGraphController = ({ controller, graph, editorRef }) => {
|
|
|
142
142
|
};
|
|
143
143
|
|
|
144
144
|
// packages/ui/react-ui-canvas-compute/src/hooks/useComputeNodeState.ts
|
|
145
|
+
import { Schema } from "effect";
|
|
145
146
|
import { useCallback, useEffect as useEffect2, useState as useState2 } from "react";
|
|
146
|
-
import { S } from "@dxos/echo-schema";
|
|
147
147
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
148
148
|
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-canvas-compute/src/hooks/useComputeNodeState.ts";
|
|
149
149
|
var useComputeNodeState = (shape) => {
|
|
@@ -200,8 +200,8 @@ var useComputeNodeState = (shape) => {
|
|
|
200
200
|
return {
|
|
201
201
|
node: controller.getComputeNode(shape.node),
|
|
202
202
|
meta: meta ?? {
|
|
203
|
-
input:
|
|
204
|
-
output:
|
|
203
|
+
input: Schema.Struct({}),
|
|
204
|
+
output: Schema.Struct({})
|
|
205
205
|
},
|
|
206
206
|
runtime: {
|
|
207
207
|
inputs: controller.getInputs(shape.node),
|
|
@@ -218,9 +218,8 @@ var useComputeNodeState = (shape) => {
|
|
|
218
218
|
// packages/ui/react-ui-canvas-compute/src/hooks/useGraphMonitor.ts
|
|
219
219
|
import { useMemo } from "react";
|
|
220
220
|
import { ComputeGraphModel, DEFAULT_INPUT, DEFAULT_OUTPUT } from "@dxos/conductor";
|
|
221
|
-
import { ObjectId as ObjectId2 } from "@dxos/echo-schema";
|
|
221
|
+
import { ObjectId as ObjectId2, Ref } from "@dxos/echo-schema";
|
|
222
222
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
223
|
-
import { DXN } from "@dxos/keys";
|
|
224
223
|
import { getSpace } from "@dxos/react-client/echo";
|
|
225
224
|
import { isNonNullable } from "@dxos/util";
|
|
226
225
|
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-canvas-compute/src/hooks/useGraphMonitor.ts";
|
|
@@ -229,7 +228,7 @@ var mapEdge = (graph, { source, target, output = DEFAULT_OUTPUT, input = DEFAULT
|
|
|
229
228
|
const targetNode = graph.findNode(target);
|
|
230
229
|
invariant3(sourceNode?.node, void 0, {
|
|
231
230
|
F: __dxlog_file3,
|
|
232
|
-
L:
|
|
231
|
+
L: 26,
|
|
233
232
|
S: void 0,
|
|
234
233
|
A: [
|
|
235
234
|
"sourceNode?.node",
|
|
@@ -238,7 +237,7 @@ var mapEdge = (graph, { source, target, output = DEFAULT_OUTPUT, input = DEFAULT
|
|
|
238
237
|
});
|
|
239
238
|
invariant3(targetNode?.node, void 0, {
|
|
240
239
|
F: __dxlog_file3,
|
|
241
|
-
L:
|
|
240
|
+
L: 27,
|
|
242
241
|
S: void 0,
|
|
243
242
|
A: [
|
|
244
243
|
"targetNode?.node",
|
|
@@ -262,7 +261,7 @@ var useGraphMonitor = (model) => {
|
|
|
262
261
|
}
|
|
263
262
|
invariant3(node.type, void 0, {
|
|
264
263
|
F: __dxlog_file3,
|
|
265
|
-
L:
|
|
264
|
+
L: 52,
|
|
266
265
|
S: void 0,
|
|
267
266
|
A: [
|
|
268
267
|
"node.type",
|
|
@@ -320,16 +319,15 @@ var linkTriggerToCompute = (graph, computeNode, triggerData) => {
|
|
|
320
319
|
const functionTrigger = triggerData.functionTrigger?.target;
|
|
321
320
|
invariant3(functionTrigger, void 0, {
|
|
322
321
|
F: __dxlog_file3,
|
|
323
|
-
L:
|
|
322
|
+
L: 115,
|
|
324
323
|
S: void 0,
|
|
325
324
|
A: [
|
|
326
325
|
"functionTrigger",
|
|
327
326
|
""
|
|
328
327
|
]
|
|
329
328
|
});
|
|
330
|
-
functionTrigger.function =
|
|
331
|
-
functionTrigger.
|
|
332
|
-
functionTrigger.meta.computeNodeId = computeNode.id;
|
|
329
|
+
functionTrigger.function = Ref.make(graph.root);
|
|
330
|
+
functionTrigger.inputNodeId = computeNode.id;
|
|
333
331
|
};
|
|
334
332
|
var deleteTriggerObjects = (computeGraph, deleted) => {
|
|
335
333
|
const space = getSpace(computeGraph.root);
|
|
@@ -714,18 +712,18 @@ var Box = /* @__PURE__ */ forwardRef(({ children, classNames, shape, title, stat
|
|
|
714
712
|
});
|
|
715
713
|
|
|
716
714
|
// packages/ui/react-ui-canvas-compute/src/shapes/common/FunctionBody.tsx
|
|
715
|
+
import { SchemaAST as SchemaAST2 } from "effect";
|
|
717
716
|
import React2, { useRef, useState as useState3 } from "react";
|
|
718
717
|
import { VoidInput, VoidOutput } from "@dxos/conductor";
|
|
719
|
-
import { AST as AST2 } from "@dxos/echo-schema";
|
|
720
718
|
import { useCanvasContext } from "@dxos/react-ui-canvas";
|
|
721
719
|
import { getParentShapeElement, createAnchors, rowHeight } from "@dxos/react-ui-canvas-editor";
|
|
722
720
|
|
|
723
721
|
// packages/ui/react-ui-canvas-compute/src/shapes/defs.ts
|
|
724
|
-
import {
|
|
722
|
+
import { Schema as Schema2, SchemaAST } from "effect";
|
|
725
723
|
import { DEFAULT_INPUT as DEFAULT_INPUT2, DEFAULT_OUTPUT as DEFAULT_OUTPUT2 } from "@dxos/conductor";
|
|
726
|
-
import { ObjectId as ObjectId3
|
|
724
|
+
import { ObjectId as ObjectId3 } from "@dxos/echo-schema";
|
|
727
725
|
import { Polygon } from "@dxos/react-ui-canvas-editor";
|
|
728
|
-
var getProperties = (ast) =>
|
|
726
|
+
var getProperties = (ast) => SchemaAST.getPropertySignatures(ast).map(({ name }) => ({
|
|
729
727
|
name: name.toString()
|
|
730
728
|
}));
|
|
731
729
|
var createAnchorId = (kind, property = kind === "input" ? DEFAULT_INPUT2 : DEFAULT_OUTPUT2) => [
|
|
@@ -739,12 +737,12 @@ var parseAnchorId = (id) => {
|
|
|
739
737
|
id
|
|
740
738
|
];
|
|
741
739
|
};
|
|
742
|
-
var ComputeShape =
|
|
740
|
+
var ComputeShape = Schema2.extend(Polygon, Schema2.Struct({
|
|
743
741
|
// TODO(burdon): Rename computeNode?
|
|
744
|
-
node:
|
|
745
|
-
[
|
|
742
|
+
node: Schema2.optional(ObjectId3.annotations({
|
|
743
|
+
[SchemaAST.DescriptionAnnotationId]: "Compute node id"
|
|
746
744
|
}))
|
|
747
|
-
}).pipe(
|
|
745
|
+
}).pipe(Schema2.mutable));
|
|
748
746
|
var createShape = ({ id, ...rest }) => {
|
|
749
747
|
return {
|
|
750
748
|
id: id ?? ObjectId3.random(),
|
|
@@ -817,12 +815,12 @@ var FunctionBody = ({ shape, name, content, inputSchema = VoidInput, outputSchem
|
|
|
817
815
|
}, content));
|
|
818
816
|
};
|
|
819
817
|
var getHeight = (input) => {
|
|
820
|
-
const properties =
|
|
818
|
+
const properties = SchemaAST2.getPropertySignatures(input.ast);
|
|
821
819
|
return headerHeight + footerHeight + bodyPadding * 2 + properties.length * rowHeight + 2;
|
|
822
820
|
};
|
|
823
821
|
var createFunctionAnchors = (shape, input = VoidInput, output = VoidOutput) => {
|
|
824
|
-
const inputs =
|
|
825
|
-
const outputs =
|
|
822
|
+
const inputs = SchemaAST2.getPropertySignatures(input.ast).map(({ name }) => createAnchorId("input", name.toString()));
|
|
823
|
+
const outputs = SchemaAST2.getPropertySignatures(output.ast).map(({ name }) => createAnchorId("output", name.toString()));
|
|
826
824
|
return createAnchors({
|
|
827
825
|
shape,
|
|
828
826
|
inputs,
|
|
@@ -852,11 +850,11 @@ var TypeSelect = ({ value, onValueChange }) => {
|
|
|
852
850
|
};
|
|
853
851
|
|
|
854
852
|
// packages/ui/react-ui-canvas-compute/src/shapes/Array.tsx
|
|
853
|
+
import { Schema as Schema3 } from "effect";
|
|
855
854
|
import React4 from "react";
|
|
856
855
|
import { ReducerInput, ReducerOutput } from "@dxos/conductor";
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
type: S3.Literal("reducer")
|
|
856
|
+
var ReducerShape = Schema3.extend(ComputeShape, Schema3.Struct({
|
|
857
|
+
type: Schema3.Literal("reducer")
|
|
860
858
|
}));
|
|
861
859
|
var ReducerComponent = ({ shape }) => {
|
|
862
860
|
return /* @__PURE__ */ React4.createElement(FunctionBody, {
|
|
@@ -883,11 +881,11 @@ var reducerShape = {
|
|
|
883
881
|
};
|
|
884
882
|
|
|
885
883
|
// packages/ui/react-ui-canvas-compute/src/shapes/Append.tsx
|
|
884
|
+
import { Schema as Schema4 } from "effect";
|
|
886
885
|
import React5 from "react";
|
|
887
886
|
import { AppendInput } from "@dxos/conductor";
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
type: S4.Literal("append")
|
|
887
|
+
var AppendShape = Schema4.extend(ComputeShape, Schema4.Struct({
|
|
888
|
+
type: Schema4.Literal("append")
|
|
891
889
|
}));
|
|
892
890
|
var createAppend = (props) => createShape({
|
|
893
891
|
type: "append",
|
|
@@ -913,12 +911,12 @@ var appendShape = {
|
|
|
913
911
|
};
|
|
914
912
|
|
|
915
913
|
// packages/ui/react-ui-canvas-compute/src/shapes/Audio.tsx
|
|
914
|
+
import { Schema as Schema5 } from "effect";
|
|
916
915
|
import React6, { useEffect as useEffect3, useState as useState4 } from "react";
|
|
917
|
-
import { S as S5 } from "@dxos/echo-schema";
|
|
918
916
|
import { Icon as Icon2 } from "@dxos/react-ui";
|
|
919
917
|
import { createAnchorMap } from "@dxos/react-ui-canvas-editor";
|
|
920
|
-
var AudioShape =
|
|
921
|
-
type:
|
|
918
|
+
var AudioShape = Schema5.extend(ComputeShape, Schema5.Struct({
|
|
919
|
+
type: Schema5.Literal("audio")
|
|
922
920
|
}));
|
|
923
921
|
var createAudio = (props) => createShape({
|
|
924
922
|
type: "audio",
|
|
@@ -963,14 +961,14 @@ var audioShape = {
|
|
|
963
961
|
};
|
|
964
962
|
|
|
965
963
|
// packages/ui/react-ui-canvas-compute/src/shapes/Beacon.tsx
|
|
964
|
+
import { Schema as Schema6 } from "effect";
|
|
966
965
|
import React7 from "react";
|
|
967
966
|
import { DEFAULT_INPUT as DEFAULT_INPUT3, isTruthy } from "@dxos/conductor";
|
|
968
|
-
import { S as S6 } from "@dxos/echo-schema";
|
|
969
967
|
import { Icon as Icon3 } from "@dxos/react-ui";
|
|
970
968
|
import { createAnchorMap as createAnchorMap2 } from "@dxos/react-ui-canvas-editor";
|
|
971
969
|
import { mx as mx2 } from "@dxos/react-ui-theme";
|
|
972
|
-
var BeaconShape =
|
|
973
|
-
type:
|
|
970
|
+
var BeaconShape = Schema6.extend(ComputeShape, Schema6.Struct({
|
|
971
|
+
type: Schema6.Literal("beacon")
|
|
974
972
|
}));
|
|
975
973
|
var createBeacon = (props) => createShape({
|
|
976
974
|
type: "beacon",
|
|
@@ -1007,11 +1005,11 @@ var beaconShape = {
|
|
|
1007
1005
|
};
|
|
1008
1006
|
|
|
1009
1007
|
// packages/ui/react-ui-canvas-compute/src/shapes/Boolean.tsx
|
|
1008
|
+
import { Schema as Schema7 } from "effect";
|
|
1010
1009
|
import React8 from "react";
|
|
1011
|
-
import { S as S7 } from "@dxos/echo-schema";
|
|
1012
1010
|
import { createAnchors as createAnchors2, getAnchorPoints } from "@dxos/react-ui-canvas-editor";
|
|
1013
|
-
var GateShape =
|
|
1014
|
-
type:
|
|
1011
|
+
var GateShape = Schema7.extend(ComputeShape, Schema7.Struct({
|
|
1012
|
+
type: Schema7.String
|
|
1015
1013
|
}));
|
|
1016
1014
|
var createGate = (props) => createShape({
|
|
1017
1015
|
size: {
|
|
@@ -1178,13 +1176,13 @@ var notShape = defineShape({
|
|
|
1178
1176
|
});
|
|
1179
1177
|
|
|
1180
1178
|
// packages/ui/react-ui-canvas-compute/src/shapes/Chat.tsx
|
|
1179
|
+
import { Schema as Schema8 } from "effect";
|
|
1181
1180
|
import React9, { useRef as useRef2 } from "react";
|
|
1182
1181
|
import { DEFAULT_OUTPUT as DEFAULT_OUTPUT3 } from "@dxos/conductor";
|
|
1183
|
-
import { S as S8 } from "@dxos/echo-schema";
|
|
1184
1182
|
import { TextBox } from "@dxos/react-ui-canvas-editor";
|
|
1185
1183
|
import { createAnchorMap as createAnchorMap3 } from "@dxos/react-ui-canvas-editor";
|
|
1186
|
-
var ChatShape =
|
|
1187
|
-
type:
|
|
1184
|
+
var ChatShape = Schema8.extend(ComputeShape, Schema8.Struct({
|
|
1185
|
+
type: Schema8.Literal("chat")
|
|
1188
1186
|
}));
|
|
1189
1187
|
var TextInputComponent = ({ shape, title, ...props }) => {
|
|
1190
1188
|
const { runtime } = useComputeNodeState(shape);
|
|
@@ -1233,16 +1231,16 @@ var chatShape = {
|
|
|
1233
1231
|
};
|
|
1234
1232
|
|
|
1235
1233
|
// packages/ui/react-ui-canvas-compute/src/shapes/Constant.tsx
|
|
1234
|
+
import { Schema as Schema9 } from "effect";
|
|
1236
1235
|
import React10, { useCallback as useCallback2, useRef as useRef3, useState as useState5 } from "react";
|
|
1237
1236
|
import { ComputeValueType as ComputeValueType2 } from "@dxos/conductor";
|
|
1238
|
-
import { S as S9 } from "@dxos/echo-schema";
|
|
1239
1237
|
import { Input } from "@dxos/react-ui";
|
|
1240
1238
|
import { TextBox as TextBox2 } from "@dxos/react-ui-canvas-editor";
|
|
1241
1239
|
import { createAnchorMap as createAnchorMap4 } from "@dxos/react-ui-canvas-editor";
|
|
1242
1240
|
import { safeParseJson } from "@dxos/util";
|
|
1243
|
-
var ConstantShape =
|
|
1244
|
-
type:
|
|
1245
|
-
value:
|
|
1241
|
+
var ConstantShape = Schema9.extend(ComputeShape, Schema9.Struct({
|
|
1242
|
+
type: Schema9.Literal("constant"),
|
|
1243
|
+
value: Schema9.optional(Schema9.Any)
|
|
1246
1244
|
}));
|
|
1247
1245
|
var inferType = (value) => {
|
|
1248
1246
|
if (typeof value === "string") {
|
|
@@ -1330,11 +1328,11 @@ var constantShape = {
|
|
|
1330
1328
|
};
|
|
1331
1329
|
|
|
1332
1330
|
// packages/ui/react-ui-canvas-compute/src/shapes/Database.tsx
|
|
1331
|
+
import { Schema as Schema10 } from "effect";
|
|
1333
1332
|
import React11 from "react";
|
|
1334
|
-
import { S as S10 } from "@dxos/echo-schema";
|
|
1335
1333
|
import { createAnchorMap as createAnchorMap5 } from "@dxos/react-ui-canvas-editor";
|
|
1336
|
-
var DatabaseShape =
|
|
1337
|
-
type:
|
|
1334
|
+
var DatabaseShape = Schema10.extend(ComputeShape, Schema10.Struct({
|
|
1335
|
+
type: Schema10.Literal("database")
|
|
1338
1336
|
}));
|
|
1339
1337
|
var createDatabase = (props) => createShape({
|
|
1340
1338
|
type: "database",
|
|
@@ -1364,15 +1362,16 @@ var databaseShape = {
|
|
|
1364
1362
|
};
|
|
1365
1363
|
|
|
1366
1364
|
// packages/ui/react-ui-canvas-compute/src/shapes/Function.tsx
|
|
1365
|
+
import { Schema as Schema11 } from "effect";
|
|
1367
1366
|
import React12, { useCallback as useCallback3, useRef as useRef4 } from "react";
|
|
1368
1367
|
import { AnyOutput, FunctionInput } from "@dxos/conductor";
|
|
1369
|
-
import { getSnapshot, isInstanceOf,
|
|
1370
|
-
import { FunctionType, ScriptType } from "@dxos/functions
|
|
1368
|
+
import { getSnapshot, isInstanceOf, Ref as Ref2 } from "@dxos/echo-schema";
|
|
1369
|
+
import { FunctionType, ScriptType } from "@dxos/functions";
|
|
1371
1370
|
import { useClient } from "@dxos/react-client";
|
|
1372
1371
|
import { Filter, makeRef, parseId } from "@dxos/react-client/echo";
|
|
1373
1372
|
import { TextBox as TextBox3 } from "@dxos/react-ui-canvas-editor";
|
|
1374
|
-
var FunctionShape =
|
|
1375
|
-
type:
|
|
1373
|
+
var FunctionShape = Schema11.extend(ComputeShape, Schema11.Struct({
|
|
1374
|
+
type: Schema11.Literal("function")
|
|
1376
1375
|
}));
|
|
1377
1376
|
var createFunction = (props) => createShape({
|
|
1378
1377
|
type: "function",
|
|
@@ -1397,8 +1396,8 @@ var TextInputComponent2 = ({ shape, title, ...props }) => {
|
|
|
1397
1396
|
if (!space || !isInstanceOf(ScriptType, object)) {
|
|
1398
1397
|
return;
|
|
1399
1398
|
}
|
|
1400
|
-
const { objects: [fn] } = await space.db.query(Filter.
|
|
1401
|
-
source: object
|
|
1399
|
+
const { objects: [fn] } = await space.db.query(Filter.type(FunctionType, {
|
|
1400
|
+
source: Ref2.make(object)
|
|
1402
1401
|
})).run();
|
|
1403
1402
|
if (!fn) {
|
|
1404
1403
|
return;
|
|
@@ -1442,11 +1441,11 @@ var functionShape = {
|
|
|
1442
1441
|
};
|
|
1443
1442
|
|
|
1444
1443
|
// packages/ui/react-ui-canvas-compute/src/shapes/Gpt.tsx
|
|
1444
|
+
import { Schema as Schema12 } from "effect";
|
|
1445
1445
|
import React13, { useEffect as useEffect4, useState as useState6 } from "react";
|
|
1446
1446
|
import { GptInput, GptOutput } from "@dxos/conductor";
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
type: S12.Literal("gpt")
|
|
1447
|
+
var GptShape = Schema12.extend(ComputeShape, Schema12.Struct({
|
|
1448
|
+
type: Schema12.Literal("gpt")
|
|
1450
1449
|
}));
|
|
1451
1450
|
var createGpt = (props) => createShape({
|
|
1452
1451
|
type: "gpt",
|
|
@@ -1512,16 +1511,16 @@ var gptShape = {
|
|
|
1512
1511
|
};
|
|
1513
1512
|
|
|
1514
1513
|
// packages/ui/react-ui-canvas-compute/src/shapes/Json.tsx
|
|
1514
|
+
import { Schema as Schema13 } from "effect";
|
|
1515
1515
|
import React14 from "react";
|
|
1516
1516
|
import { DEFAULT_INPUT as DEFAULT_INPUT4, DefaultOutput, JsonTransformInput } from "@dxos/conductor";
|
|
1517
|
-
import { S as S13 } from "@dxos/echo-schema";
|
|
1518
1517
|
import { createAnchorMap as createAnchorMap6 } from "@dxos/react-ui-canvas-editor";
|
|
1519
1518
|
import { JsonFilter } from "@dxos/react-ui-syntax-highlighter";
|
|
1520
|
-
var JsonShape =
|
|
1521
|
-
type:
|
|
1519
|
+
var JsonShape = Schema13.extend(ComputeShape, Schema13.Struct({
|
|
1520
|
+
type: Schema13.Literal("json")
|
|
1522
1521
|
}));
|
|
1523
|
-
var JsonTransformShape =
|
|
1524
|
-
type:
|
|
1522
|
+
var JsonTransformShape = Schema13.extend(ComputeShape, Schema13.Struct({
|
|
1523
|
+
type: Schema13.Literal("json-transform")
|
|
1525
1524
|
}));
|
|
1526
1525
|
var JsonComponent = ({ shape, ...props }) => {
|
|
1527
1526
|
const { runtime } = useComputeNodeState(shape);
|
|
@@ -1584,14 +1583,14 @@ var jsonTransformShape = {
|
|
|
1584
1583
|
};
|
|
1585
1584
|
|
|
1586
1585
|
// packages/ui/react-ui-canvas-compute/src/shapes/Logic.tsx
|
|
1586
|
+
import { Schema as Schema14 } from "effect";
|
|
1587
1587
|
import React15 from "react";
|
|
1588
1588
|
import { IfElseInput, IfElseOutput, IfInput, IfOutput } from "@dxos/conductor";
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
type: S14.Literal("if")
|
|
1589
|
+
var IfShape = Schema14.extend(ComputeShape, Schema14.Struct({
|
|
1590
|
+
type: Schema14.Literal("if")
|
|
1592
1591
|
}));
|
|
1593
|
-
var IfElseShape =
|
|
1594
|
-
type:
|
|
1592
|
+
var IfElseShape = Schema14.extend(ComputeShape, Schema14.Struct({
|
|
1593
|
+
type: Schema14.Literal("if-else")
|
|
1595
1594
|
}));
|
|
1596
1595
|
var IfComponent = ({ shape, ...props }) => {
|
|
1597
1596
|
return /* @__PURE__ */ React15.createElement(FunctionBody, {
|
|
@@ -1641,12 +1640,12 @@ var ifElseShape = {
|
|
|
1641
1640
|
};
|
|
1642
1641
|
|
|
1643
1642
|
// packages/ui/react-ui-canvas-compute/src/shapes/Queue.tsx
|
|
1643
|
+
import { Schema as Schema15 } from "effect";
|
|
1644
1644
|
import React16, { Fragment } from "react";
|
|
1645
1645
|
import { DEFAULT_OUTPUT as DEFAULT_OUTPUT4, QueueInput, QueueOutput } from "@dxos/conductor";
|
|
1646
|
-
import { S as S15 } from "@dxos/echo-schema";
|
|
1647
1646
|
import { mx as mx3 } from "@dxos/react-ui-theme";
|
|
1648
|
-
var QueueShape =
|
|
1649
|
-
type:
|
|
1647
|
+
var QueueShape = Schema15.extend(ComputeShape, Schema15.Struct({
|
|
1648
|
+
type: Schema15.Literal("queue")
|
|
1650
1649
|
}));
|
|
1651
1650
|
var createQueue = (props) => createShape({
|
|
1652
1651
|
type: "queue",
|
|
@@ -1703,16 +1702,16 @@ var queueShape = {
|
|
|
1703
1702
|
};
|
|
1704
1703
|
|
|
1705
1704
|
// packages/ui/react-ui-canvas-compute/src/shapes/RNG.tsx
|
|
1705
|
+
import { Schema as Schema16 } from "effect";
|
|
1706
1706
|
import React17, { useEffect as useEffect5, useState as useState7 } from "react";
|
|
1707
1707
|
import { DEFAULT_OUTPUT as DEFAULT_OUTPUT5 } from "@dxos/conductor";
|
|
1708
|
-
import { S as S16 } from "@dxos/echo-schema";
|
|
1709
1708
|
import { Icon as Icon4 } from "@dxos/react-ui";
|
|
1710
1709
|
import { createAnchorMap as createAnchorMap7 } from "@dxos/react-ui-canvas-editor";
|
|
1711
1710
|
import { mx as mx4 } from "@dxos/react-ui-theme";
|
|
1712
|
-
var RandomShape =
|
|
1713
|
-
type:
|
|
1714
|
-
min:
|
|
1715
|
-
max:
|
|
1711
|
+
var RandomShape = Schema16.extend(ComputeShape, Schema16.Struct({
|
|
1712
|
+
type: Schema16.Literal("rng"),
|
|
1713
|
+
min: Schema16.optional(Schema16.Number),
|
|
1714
|
+
max: Schema16.optional(Schema16.Number)
|
|
1716
1715
|
}));
|
|
1717
1716
|
var createRandom = (props) => createShape({
|
|
1718
1717
|
type: "rng",
|
|
@@ -1779,13 +1778,13 @@ var randomShape = {
|
|
|
1779
1778
|
};
|
|
1780
1779
|
|
|
1781
1780
|
// packages/ui/react-ui-canvas-compute/src/shapes/Scope.tsx
|
|
1781
|
+
import { Schema as Schema17 } from "effect";
|
|
1782
1782
|
import React18 from "react";
|
|
1783
1783
|
import { DEFAULT_INPUT as DEFAULT_INPUT5 } from "@dxos/conductor";
|
|
1784
|
-
import { S as S17 } from "@dxos/echo-schema";
|
|
1785
1784
|
import { createAnchorMap as createAnchorMap8 } from "@dxos/react-ui-canvas-editor";
|
|
1786
1785
|
import { useAudioStream, Chaos, shaderPresets } from "@dxos/react-ui-sfx";
|
|
1787
|
-
var ScopeShape =
|
|
1788
|
-
type:
|
|
1786
|
+
var ScopeShape = Schema17.extend(ComputeShape, Schema17.Struct({
|
|
1787
|
+
type: Schema17.Literal("scope")
|
|
1789
1788
|
}));
|
|
1790
1789
|
var createScope = (props) => createShape({
|
|
1791
1790
|
type: "scope",
|
|
@@ -1827,13 +1826,13 @@ var scopeShape = {
|
|
|
1827
1826
|
};
|
|
1828
1827
|
|
|
1829
1828
|
// packages/ui/react-ui-canvas-compute/src/shapes/Surface.tsx
|
|
1829
|
+
import { Schema as Schema18 } from "effect";
|
|
1830
1830
|
import React19 from "react";
|
|
1831
1831
|
import { Surface } from "@dxos/app-framework";
|
|
1832
1832
|
import { DEFAULT_INPUT as DEFAULT_INPUT6 } from "@dxos/conductor";
|
|
1833
|
-
import { S as S18 } from "@dxos/echo-schema";
|
|
1834
1833
|
import { createAnchorMap as createAnchorMap9 } from "@dxos/react-ui-canvas-editor";
|
|
1835
|
-
var SurfaceShape =
|
|
1836
|
-
type:
|
|
1834
|
+
var SurfaceShape = Schema18.extend(ComputeShape, Schema18.Struct({
|
|
1835
|
+
type: Schema18.Literal("surface")
|
|
1837
1836
|
}));
|
|
1838
1837
|
var createSurface = (props) => createShape({
|
|
1839
1838
|
type: "surface",
|
|
@@ -1879,13 +1878,13 @@ var surfaceShape = {
|
|
|
1879
1878
|
};
|
|
1880
1879
|
|
|
1881
1880
|
// packages/ui/react-ui-canvas-compute/src/shapes/Switch.tsx
|
|
1881
|
+
import { Schema as Schema19 } from "effect";
|
|
1882
1882
|
import React20, { useEffect as useEffect6, useState as useState8 } from "react";
|
|
1883
1883
|
import { DEFAULT_OUTPUT as DEFAULT_OUTPUT6 } from "@dxos/conductor";
|
|
1884
|
-
import { S as S19 } from "@dxos/echo-schema";
|
|
1885
1884
|
import { Input as Input2 } from "@dxos/react-ui";
|
|
1886
1885
|
import { createAnchorMap as createAnchorMap10 } from "@dxos/react-ui-canvas-editor";
|
|
1887
|
-
var SwitchShape =
|
|
1888
|
-
type:
|
|
1886
|
+
var SwitchShape = Schema19.extend(ComputeShape, Schema19.Struct({
|
|
1887
|
+
type: Schema19.Literal("switch")
|
|
1889
1888
|
}));
|
|
1890
1889
|
var createSwitch = (props) => createShape({
|
|
1891
1890
|
type: "switch",
|
|
@@ -1926,13 +1925,13 @@ var switchShape = {
|
|
|
1926
1925
|
};
|
|
1927
1926
|
|
|
1928
1927
|
// packages/ui/react-ui-canvas-compute/src/shapes/Table.tsx
|
|
1928
|
+
import { Schema as Schema20 } from "effect";
|
|
1929
1929
|
import React21 from "react";
|
|
1930
1930
|
import { createInputSchema, createOutputSchema, GptMessage } from "@dxos/conductor";
|
|
1931
|
-
import { S as S20 } from "@dxos/echo-schema";
|
|
1932
1931
|
var InputSchema = createInputSchema(GptMessage);
|
|
1933
|
-
var OutputSchema = createOutputSchema(
|
|
1934
|
-
var TableShape =
|
|
1935
|
-
type:
|
|
1932
|
+
var OutputSchema = createOutputSchema(Schema20.mutable(Schema20.Array(GptMessage)));
|
|
1933
|
+
var TableShape = Schema20.extend(ComputeShape, Schema20.Struct({
|
|
1934
|
+
type: Schema20.Literal("table")
|
|
1936
1935
|
}));
|
|
1937
1936
|
var createTable = (props) => createShape({
|
|
1938
1937
|
type: "table",
|
|
@@ -1958,15 +1957,16 @@ var tableShape = {
|
|
|
1958
1957
|
};
|
|
1959
1958
|
|
|
1960
1959
|
// packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx
|
|
1960
|
+
import { Schema as Schema21 } from "effect";
|
|
1961
1961
|
import React22, { useRef as useRef5 } from "react";
|
|
1962
1962
|
import { ComputeValueType as ComputeValueType3, getTemplateInputSchema as getTemplateInputSchema2, TemplateOutput, VoidInput as VoidInput2 } from "@dxos/conductor";
|
|
1963
|
-
import {
|
|
1963
|
+
import { toJsonSchema as toJsonSchema2 } from "@dxos/echo-schema";
|
|
1964
1964
|
import { invariant as invariant5 } from "@dxos/invariant";
|
|
1965
1965
|
import { TextBox as TextBox4 } from "@dxos/react-ui-canvas-editor";
|
|
1966
1966
|
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx";
|
|
1967
|
-
var TemplateShape =
|
|
1968
|
-
type:
|
|
1969
|
-
valueType:
|
|
1967
|
+
var TemplateShape = Schema21.extend(ComputeShape, Schema21.Struct({
|
|
1968
|
+
type: Schema21.Literal("template"),
|
|
1969
|
+
valueType: Schema21.optional(ComputeValueType3)
|
|
1970
1970
|
}));
|
|
1971
1971
|
var TextInputComponent3 = ({ shape, title, ...props }) => {
|
|
1972
1972
|
const { node } = useComputeNodeState(shape);
|
|
@@ -1980,12 +1980,12 @@ var TextInputComponent3 = ({ shape, title, ...props }) => {
|
|
|
1980
1980
|
}
|
|
1981
1981
|
};
|
|
1982
1982
|
const handleTypeChange = (newType) => {
|
|
1983
|
-
invariant5(
|
|
1983
|
+
invariant5(Schema21.is(ComputeValueType3)(newType), "Invalid type", {
|
|
1984
1984
|
F: __dxlog_file6,
|
|
1985
|
-
L:
|
|
1985
|
+
L: 58,
|
|
1986
1986
|
S: void 0,
|
|
1987
1987
|
A: [
|
|
1988
|
-
"
|
|
1988
|
+
"Schema.is(ComputeValueType)(newType)",
|
|
1989
1989
|
"'Invalid type'"
|
|
1990
1990
|
]
|
|
1991
1991
|
});
|
|
@@ -2030,13 +2030,13 @@ var templateShape = {
|
|
|
2030
2030
|
};
|
|
2031
2031
|
|
|
2032
2032
|
// packages/ui/react-ui-canvas-compute/src/shapes/Text.tsx
|
|
2033
|
+
import { Schema as Schema22 } from "effect";
|
|
2033
2034
|
import React23 from "react";
|
|
2034
2035
|
import { DEFAULT_INPUT as DEFAULT_INPUT7 } from "@dxos/conductor";
|
|
2035
|
-
import { S as S22 } from "@dxos/echo-schema";
|
|
2036
2036
|
import { TextBox as TextBox5 } from "@dxos/react-ui-canvas-editor";
|
|
2037
2037
|
import { createAnchorMap as createAnchorMap11 } from "@dxos/react-ui-canvas-editor";
|
|
2038
|
-
var TextShape =
|
|
2039
|
-
type:
|
|
2038
|
+
var TextShape = Schema22.extend(ComputeShape, Schema22.Struct({
|
|
2039
|
+
type: Schema22.Literal("text")
|
|
2040
2040
|
}));
|
|
2041
2041
|
var createText = (props) => createShape({
|
|
2042
2042
|
type: "text",
|
|
@@ -2078,14 +2078,14 @@ var textShape = {
|
|
|
2078
2078
|
};
|
|
2079
2079
|
|
|
2080
2080
|
// packages/ui/react-ui-canvas-compute/src/shapes/Thread.tsx
|
|
2081
|
+
import { Schema as Schema23 } from "effect";
|
|
2081
2082
|
import React24, { useEffect as useEffect7, useRef as useRef6 } from "react";
|
|
2082
2083
|
import { createInputSchema as createInputSchema2, createOutputSchema as createOutputSchema2, GptMessage as GptMessage2 } from "@dxos/conductor";
|
|
2083
|
-
import { S as S23 } from "@dxos/echo-schema";
|
|
2084
2084
|
import { mx as mx5 } from "@dxos/react-ui-theme";
|
|
2085
2085
|
var InputSchema2 = createInputSchema2(GptMessage2);
|
|
2086
|
-
var OutputSchema2 = createOutputSchema2(
|
|
2087
|
-
var ThreadShape =
|
|
2088
|
-
type:
|
|
2086
|
+
var OutputSchema2 = createOutputSchema2(Schema23.mutable(Schema23.Array(GptMessage2)));
|
|
2087
|
+
var ThreadShape = Schema23.extend(ComputeShape, Schema23.Struct({
|
|
2088
|
+
type: Schema23.Literal("thread")
|
|
2089
2089
|
}));
|
|
2090
2090
|
var createThread = (props) => createShape({
|
|
2091
2091
|
type: "thread",
|
|
@@ -2141,11 +2141,11 @@ var threadShape = {
|
|
|
2141
2141
|
};
|
|
2142
2142
|
|
|
2143
2143
|
// packages/ui/react-ui-canvas-compute/src/shapes/TextToImage.tsx
|
|
2144
|
+
import { Schema as Schema24 } from "effect";
|
|
2144
2145
|
import React25 from "react";
|
|
2145
|
-
import { S as S24 } from "@dxos/echo-schema";
|
|
2146
2146
|
import { createAnchorMap as createAnchorMap12 } from "@dxos/react-ui-canvas-editor";
|
|
2147
|
-
var TextToImageShape =
|
|
2148
|
-
type:
|
|
2147
|
+
var TextToImageShape = Schema24.extend(ComputeShape, Schema24.Struct({
|
|
2148
|
+
type: Schema24.Literal("text-to-image")
|
|
2149
2149
|
}));
|
|
2150
2150
|
var createTextToImage = (props) => createShape({
|
|
2151
2151
|
type: "text-to-image",
|
|
@@ -2175,16 +2175,17 @@ var textToImageShape = {
|
|
|
2175
2175
|
};
|
|
2176
2176
|
|
|
2177
2177
|
// packages/ui/react-ui-canvas-compute/src/shapes/Trigger.tsx
|
|
2178
|
+
import { Schema as Schema25 } from "effect";
|
|
2178
2179
|
import React26, { useEffect as useEffect8 } from "react";
|
|
2179
|
-
import {
|
|
2180
|
-
import { ObjectId as ObjectId4, Ref
|
|
2181
|
-
import { FunctionTrigger, TriggerKind } from "@dxos/functions
|
|
2182
|
-
import { DXN
|
|
2180
|
+
import { VoidInput as VoidInput3 } from "@dxos/conductor";
|
|
2181
|
+
import { ObjectId as ObjectId4, Ref as Ref3 } from "@dxos/echo-schema";
|
|
2182
|
+
import { FunctionTrigger, TriggerKind, EmailTriggerOutput, QueueTriggerOutput, SubscriptionTriggerOutput, TimerTriggerOutput, WebhookTriggerOutput } from "@dxos/functions";
|
|
2183
|
+
import { DXN, SpaceId } from "@dxos/keys";
|
|
2183
2184
|
import { live, makeRef as makeRef2, useSpace } from "@dxos/react-client/echo";
|
|
2184
2185
|
import { Select as Select2 } from "@dxos/react-ui";
|
|
2185
|
-
var TriggerShape =
|
|
2186
|
-
type:
|
|
2187
|
-
functionTrigger:
|
|
2186
|
+
var TriggerShape = Schema25.extend(ComputeShape, Schema25.Struct({
|
|
2187
|
+
type: Schema25.Literal("trigger"),
|
|
2188
|
+
functionTrigger: Schema25.optional(Ref3(FunctionTrigger))
|
|
2188
2189
|
}));
|
|
2189
2190
|
var createTrigger = (props) => {
|
|
2190
2191
|
const functionTrigger = live(FunctionTrigger, {
|
|
@@ -2216,14 +2217,14 @@ var TriggerComponent = ({ shape }) => {
|
|
|
2216
2217
|
functionTrigger?.spec
|
|
2217
2218
|
]);
|
|
2218
2219
|
useEffect8(() => {
|
|
2219
|
-
shape.size.height = getHeight(getOutputSchema(functionTrigger?.spec?.
|
|
2220
|
+
shape.size.height = getHeight(getOutputSchema(functionTrigger?.spec?.kind ?? TriggerKind.Email));
|
|
2220
2221
|
}, [
|
|
2221
|
-
functionTrigger?.spec?.
|
|
2222
|
+
functionTrigger?.spec?.kind
|
|
2222
2223
|
]);
|
|
2223
2224
|
const setKind = (kind) => {
|
|
2224
|
-
if (functionTrigger?.spec?.
|
|
2225
|
+
if (functionTrigger?.spec?.kind !== kind) {
|
|
2225
2226
|
functionTrigger.spec = createTriggerSpec({
|
|
2226
|
-
triggerKind:
|
|
2227
|
+
triggerKind: kind,
|
|
2227
2228
|
spaceId: space?.id
|
|
2228
2229
|
});
|
|
2229
2230
|
}
|
|
@@ -2234,11 +2235,11 @@ var TriggerComponent = ({ shape }) => {
|
|
|
2234
2235
|
return /* @__PURE__ */ React26.createElement(FunctionBody, {
|
|
2235
2236
|
shape,
|
|
2236
2237
|
status: /* @__PURE__ */ React26.createElement(TriggerKindSelect, {
|
|
2237
|
-
value: functionTrigger.spec?.
|
|
2238
|
+
value: functionTrigger.spec?.kind,
|
|
2238
2239
|
onValueChange: (kind) => setKind(kind)
|
|
2239
2240
|
}),
|
|
2240
2241
|
inputSchema: VoidInput3,
|
|
2241
|
-
outputSchema: getOutputSchema(functionTrigger.spec.
|
|
2242
|
+
outputSchema: getOutputSchema(functionTrigger.spec.kind)
|
|
2242
2243
|
});
|
|
2243
2244
|
};
|
|
2244
2245
|
var TriggerKindSelect = ({ value, onValueChange }) => {
|
|
@@ -2248,41 +2249,41 @@ var TriggerKindSelect = ({ value, onValueChange }) => {
|
|
|
2248
2249
|
}, /* @__PURE__ */ React26.createElement(Select2.TriggerButton, {
|
|
2249
2250
|
variant: "ghost",
|
|
2250
2251
|
classNames: "w-full !px-0"
|
|
2251
|
-
}), /* @__PURE__ */ React26.createElement(Select2.Portal, null, /* @__PURE__ */ React26.createElement(Select2.Content, null, /* @__PURE__ */ React26.createElement(Select2.ScrollUpButton, null), /* @__PURE__ */ React26.createElement(Select2.Viewport, null, Object.values(TriggerKind).map((
|
|
2252
|
-
key:
|
|
2253
|
-
value:
|
|
2254
|
-
},
|
|
2252
|
+
}), /* @__PURE__ */ React26.createElement(Select2.Portal, null, /* @__PURE__ */ React26.createElement(Select2.Content, null, /* @__PURE__ */ React26.createElement(Select2.ScrollUpButton, null), /* @__PURE__ */ React26.createElement(Select2.Viewport, null, Object.values(TriggerKind).map((kind) => /* @__PURE__ */ React26.createElement(Select2.Option, {
|
|
2253
|
+
key: kind,
|
|
2254
|
+
value: kind
|
|
2255
|
+
}, kind))), /* @__PURE__ */ React26.createElement(Select2.ScrollDownButton, null), /* @__PURE__ */ React26.createElement(Select2.Arrow, null))));
|
|
2255
2256
|
};
|
|
2256
2257
|
var createTriggerSpec = (props) => {
|
|
2257
2258
|
const kind = props.triggerKind ?? TriggerKind.Email;
|
|
2258
2259
|
switch (kind) {
|
|
2259
2260
|
case TriggerKind.Timer:
|
|
2260
2261
|
return {
|
|
2261
|
-
|
|
2262
|
+
kind: TriggerKind.Timer,
|
|
2262
2263
|
cron: "*/10 * * * * *"
|
|
2263
2264
|
};
|
|
2264
2265
|
case TriggerKind.Webhook:
|
|
2265
2266
|
return {
|
|
2266
|
-
|
|
2267
|
+
kind: TriggerKind.Webhook,
|
|
2267
2268
|
method: "POST"
|
|
2268
2269
|
};
|
|
2269
2270
|
case TriggerKind.Subscription:
|
|
2270
2271
|
return {
|
|
2271
|
-
|
|
2272
|
+
kind: TriggerKind.Subscription,
|
|
2272
2273
|
filter: {}
|
|
2273
2274
|
};
|
|
2274
2275
|
case TriggerKind.Email:
|
|
2275
2276
|
return {
|
|
2276
|
-
|
|
2277
|
+
kind: TriggerKind.Email
|
|
2277
2278
|
};
|
|
2278
2279
|
case TriggerKind.Queue: {
|
|
2279
|
-
const dxn = new
|
|
2280
|
+
const dxn = new DXN(DXN.kind.QUEUE, [
|
|
2280
2281
|
"data",
|
|
2281
2282
|
props.spaceId ?? SpaceId.random(),
|
|
2282
2283
|
ObjectId4.random()
|
|
2283
2284
|
]).toString();
|
|
2284
2285
|
return {
|
|
2285
|
-
|
|
2286
|
+
kind: TriggerKind.Queue,
|
|
2286
2287
|
queue: dxn
|
|
2287
2288
|
};
|
|
2288
2289
|
}
|
|
@@ -2304,18 +2305,18 @@ var triggerShape = {
|
|
|
2304
2305
|
icon: "ph--lightning--regular",
|
|
2305
2306
|
component: TriggerComponent,
|
|
2306
2307
|
createShape: createTrigger,
|
|
2307
|
-
getAnchors: (shape) => createFunctionAnchors(shape, VoidInput3, getOutputSchema(shape.functionTrigger?.target?.spec?.
|
|
2308
|
+
getAnchors: (shape) => createFunctionAnchors(shape, VoidInput3, getOutputSchema(shape.functionTrigger?.target?.spec?.kind ?? TriggerKind.Email))
|
|
2308
2309
|
};
|
|
2309
2310
|
|
|
2310
2311
|
// packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx
|
|
2312
|
+
import { Schema as Schema26 } from "effect";
|
|
2311
2313
|
import React27, { useState as useState9 } from "react";
|
|
2312
|
-
import { S as S26 } from "@dxos/echo-schema";
|
|
2313
2314
|
import { log as log2 } from "@dxos/log";
|
|
2314
2315
|
import { useConfig } from "@dxos/react-client";
|
|
2315
2316
|
import { Icon as Icon5 } from "@dxos/react-ui";
|
|
2316
2317
|
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx";
|
|
2317
|
-
var GptRealtimeShape =
|
|
2318
|
-
type:
|
|
2318
|
+
var GptRealtimeShape = Schema26.extend(ComputeShape, Schema26.Struct({
|
|
2319
|
+
type: Schema26.Literal("gpt-realtime")
|
|
2319
2320
|
}));
|
|
2320
2321
|
var createGptRealtime = (props) => createShape({
|
|
2321
2322
|
type: "gpt-realtime",
|
|
@@ -2428,9 +2429,9 @@ var gptRealtimeShape = {
|
|
|
2428
2429
|
component: GptRealtimeComponent,
|
|
2429
2430
|
createShape: createGptRealtime,
|
|
2430
2431
|
// TODO(dmaretskyi): Can we fetch the schema dynamically?
|
|
2431
|
-
getAnchors: (shape) => createFunctionAnchors(shape,
|
|
2432
|
-
audio:
|
|
2433
|
-
}),
|
|
2432
|
+
getAnchors: (shape) => createFunctionAnchors(shape, Schema26.Struct({
|
|
2433
|
+
audio: Schema26.Any
|
|
2434
|
+
}), Schema26.Struct({})),
|
|
2434
2435
|
resizable: true
|
|
2435
2436
|
};
|
|
2436
2437
|
var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
|