@dxos/react-ui-canvas-compute 0.8.3-main.672df60 → 0.8.3-staging.0fa589b

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.
@@ -1,10 +1,9 @@
1
1
  import "@dxos/node-std/globals";
2
2
 
3
3
  // packages/ui/react-ui-canvas-compute/src/graph/controller.ts
4
- import { FetchHttpClient } from "@effect/platform";
5
- import { Effect, Either, Exit, Layer, Scope } from "effect";
4
+ import { Effect, Either, Exit, Scope } from "effect";
6
5
  import { Event, synchronized } from "@dxos/async";
7
- import { isNotExecuted, makeValueBag, EventLogger, GptService, GraphExecutor, MockGpt, QueueService, SpaceService, FunctionCallService } from "@dxos/conductor";
6
+ import { GraphExecutor, isNotExecuted, ValueBag } from "@dxos/conductor";
8
7
  import { Resource } from "@dxos/context";
9
8
  import { log } from "@dxos/log";
10
9
 
@@ -356,20 +355,19 @@ var AUTO_TRIGGER_NODES = [
356
355
  "switch",
357
356
  "constant"
358
357
  ];
359
- var createComputeGraphController = (graph, services) => {
358
+ var createComputeGraphController = (graph, serviceContainer) => {
360
359
  const computeGraph = createComputeGraph(graph);
361
- const controller = new ComputeGraphController(computeGraph);
362
- controller.setServices(services ?? {});
360
+ const controller = new ComputeGraphController(serviceContainer, computeGraph);
363
361
  return {
364
362
  controller,
365
363
  graph
366
364
  };
367
365
  };
368
366
  var ComputeGraphController = class extends Resource {
369
- constructor(_graph) {
370
- super(), this._graph = _graph, this._executor = new GraphExecutor({
367
+ constructor(_serviceContainer, _graph) {
368
+ super(), this._serviceContainer = _serviceContainer, this._graph = _graph, this._executor = new GraphExecutor({
371
369
  computeNodeResolver: (node) => resolveComputeNode(node)
372
- }), this._diagnostics = [], this._services = {}, this._forcedOutputs = {}, this._runtimeStateInputs = {}, this._runtimeStateOutputs = {}, this.update = new Event(), this.output = new Event(), this.events = new Event();
370
+ }), this._diagnostics = [], this._forcedOutputs = {}, this._runtimeStateInputs = {}, this._runtimeStateOutputs = {}, this.update = new Event(), this.output = new Event(), this.events = new Event();
373
371
  }
374
372
  toJSON() {
375
373
  return {
@@ -381,17 +379,6 @@ var ComputeGraphController = class extends Resource {
381
379
  forcedOutputs: this._forcedOutputs
382
380
  };
383
381
  }
384
- setServices(services) {
385
- log.info("setServices", {
386
- services
387
- }, {
388
- F: __dxlog_file4,
389
- L: 149,
390
- S: this,
391
- C: (f, a) => f(...a)
392
- });
393
- Object.assign(this._services, services);
394
- }
395
382
  get graph() {
396
383
  return this._graph;
397
384
  }
@@ -450,7 +437,7 @@ var ComputeGraphController = class extends Resource {
450
437
  } catch (err) {
451
438
  log.catch(err, void 0, {
452
439
  F: __dxlog_file4,
453
- L: 218,
440
+ L: 199,
454
441
  S: this,
455
442
  C: (f, a) => f(...a)
456
443
  });
@@ -470,14 +457,14 @@ var ComputeGraphController = class extends Resource {
470
457
  const executor = this._executor.clone();
471
458
  await executor.load(this._graph);
472
459
  for (const [nodeId2, outputs] of Object.entries(this._forcedOutputs)) {
473
- executor.setOutputs(nodeId2, Effect.succeed(makeValueBag(outputs)));
460
+ executor.setOutputs(nodeId2, Effect.succeed(ValueBag.make(outputs)));
474
461
  }
475
- const services = this._createServiceLayer();
462
+ const serviceLayer = this._serviceContainer.createLayer();
476
463
  await Effect.runPromise(Effect.gen(this, function* () {
477
464
  const scope = yield* Scope.make();
478
465
  const executable = yield* Effect.promise(() => resolveComputeNode(this._graph.getNode(nodeId)));
479
466
  const computingOutputs = executable.exec != null;
480
- const effect = (computingOutputs ? executor.computeOutputs(nodeId) : executor.computeInputs(nodeId)).pipe(Effect.withSpan("runGraph"), Scope.extend(scope), Effect.flatMap(computeValueBag), Effect.provide(services), Effect.withSpan("test"), Effect.tap((values) => {
467
+ const effect = (computingOutputs ? executor.computeOutputs(nodeId) : executor.computeInputs(nodeId)).pipe(Effect.withSpan("runGraph"), Scope.extend(scope), Effect.flatMap(computeValueBag), Effect.provide(serviceLayer), Effect.withSpan("test"), Effect.tap((values) => {
481
468
  for (const [key, value] of Object.entries(values)) {
482
469
  if (computingOutputs) {
483
470
  this._onOutputComputed(nodeId, key, value);
@@ -501,7 +488,7 @@ var ComputeGraphController = class extends Resource {
501
488
  const executor = this._executor.clone();
502
489
  await executor.load(this._graph);
503
490
  for (const [nodeId, outputs] of Object.entries(this._forcedOutputs)) {
504
- executor.setOutputs(nodeId, Effect.succeed(makeValueBag(outputs)));
491
+ executor.setOutputs(nodeId, Effect.succeed(ValueBag.make(outputs)));
505
492
  }
506
493
  const triggerNodes = startFromNode != null ? [
507
494
  this._graph.getNode(startFromNode)
@@ -509,14 +496,13 @@ var ComputeGraphController = class extends Resource {
509
496
  const allAffectedNodes = [
510
497
  ...new Set(triggerNodes.flatMap((node) => executor.getAllDependantNodes(node.id)))
511
498
  ];
512
- const services = this._createServiceLayer();
513
499
  await Effect.runPromise(Effect.gen(this, function* () {
514
500
  const scope = yield* Scope.make();
515
501
  const tasks = [];
516
502
  for (const node of allAffectedNodes) {
517
503
  const executable = yield* Effect.promise(() => resolveComputeNode(this._graph.getNode(node)));
518
504
  const computingOutputs = executable.exec != null;
519
- const effect = (computingOutputs ? executor.computeOutputs(node) : executor.computeInputs(node)).pipe(Effect.withSpan("runGraph"), Scope.extend(scope), Effect.flatMap(computeValueBag), Effect.provide(services), Effect.withSpan("test"), Effect.tap((values) => {
505
+ const effect = (computingOutputs ? executor.computeOutputs(node) : executor.computeInputs(node)).pipe(Effect.withSpan("runGraph"), Scope.extend(scope), Effect.flatMap(computeValueBag), Effect.provide(this._serviceContainer.createLayer()), Effect.withSpan("test"), Effect.tap((values) => {
520
506
  for (const [key, value] of Object.entries(values)) {
521
507
  if (computingOutputs) {
522
508
  this._onOutputComputed(node, key, value);
@@ -532,18 +518,6 @@ var ComputeGraphController = class extends Resource {
532
518
  }));
533
519
  this.update.emit();
534
520
  }
535
- _createServiceLayer() {
536
- const services = {
537
- ...DEFAULT_SERVICES,
538
- ...this._services
539
- };
540
- const logLayer = Layer.succeed(EventLogger, this._createLogger());
541
- const gptLayer = Layer.succeed(GptService, services.gpt);
542
- const queueLayer = services.edgeHttpClient != null ? QueueService.fromClient(services.edgeHttpClient) : QueueService.notAvailable;
543
- const spaceLayer = services.spaceService != null ? Layer.succeed(SpaceService, services.spaceService) : SpaceService.empty;
544
- const functionCallServiceLayer = services.edgeHttpClient != null && services.spaceService != null ? Layer.succeed(FunctionCallService, FunctionCallService.fromClient(services.edgeHttpClient.baseUrl, services.spaceService.spaceId)) : Layer.succeed(FunctionCallService, FunctionCallService.mock());
545
- return Layer.mergeAll(logLayer, gptLayer, queueLayer, spaceLayer, functionCallServiceLayer, FetchHttpClient.layer);
546
- }
547
521
  _createLogger() {
548
522
  return {
549
523
  log: (event) => {
@@ -557,7 +531,7 @@ var ComputeGraphController = class extends Resource {
557
531
  event
558
532
  }, {
559
533
  F: __dxlog_file4,
560
- L: 376,
534
+ L: 335,
561
535
  S: this,
562
536
  C: (f, a) => f(...a)
563
537
  });
@@ -599,9 +573,6 @@ _ts_decorate([
599
573
  _ts_decorate([
600
574
  synchronized
601
575
  ], ComputeGraphController.prototype, "exec", null);
602
- var DEFAULT_SERVICES = {
603
- gpt: new MockGpt()
604
- };
605
576
  var computeValueBag = (bag) => {
606
577
  return Effect.all(Object.entries(bag.values).map(([key, eff]) => Effect.either(eff).pipe(Effect.map((value) => {
607
578
  if (Either.isLeft(value)) {
@@ -1037,10 +1008,10 @@ var beaconShape = {
1037
1008
  };
1038
1009
 
1039
1010
  // packages/ui/react-ui-canvas-compute/src/shapes/Boolean.tsx
1040
- import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
1041
1011
  import { Schema as Schema7 } from "effect";
1042
1012
  import React8 from "react";
1043
- import { createAnchors as createAnchors2, getAnchorPoints } from "@dxos/react-ui-canvas-editor";
1013
+ import { getAnchorPoints } from "@dxos/react-ui-canvas-editor";
1014
+ import { createAnchors as createAnchors2 } from "@dxos/react-ui-canvas-editor";
1044
1015
  var GateShape = Schema7.extend(ComputeShape, Schema7.Struct({
1045
1016
  type: Schema7.String
1046
1017
  }));
@@ -1051,25 +1022,19 @@ var createGate = (props) => createShape({
1051
1022
  },
1052
1023
  ...props
1053
1024
  });
1054
- var GateComponent = (Symbol2) => {
1055
- var _effect = _useSignals8();
1056
- try {
1057
- return () => {
1058
- return /* @__PURE__ */ React8.createElement("div", {
1059
- className: "flex w-full justify-center items-center"
1060
- }, /* @__PURE__ */ React8.createElement(Symbol2, null));
1061
- };
1062
- } finally {
1063
- _effect.f();
1064
- }
1065
- };
1066
- var defineShape = ({ type, name, icon, Symbol: Symbol2, createShape: createShape2, inputs, outputs = [
1025
+ var defineShape = ({ type, name, icon, symbol: Symbol, createShape: createShape2, inputs, outputs = [
1067
1026
  createAnchorId("output")
1068
1027
  ] }) => ({
1069
1028
  type,
1070
1029
  name,
1071
1030
  icon,
1072
- component: GateComponent(Symbol2),
1031
+ // NOTE: Preact interprets captitalized properties as React components.
1032
+ // Be careful not to name component factories with a capital letter.
1033
+ component: () => {
1034
+ return /* @__PURE__ */ React8.createElement("div", {
1035
+ className: "flex w-full justify-center items-center"
1036
+ }, /* @__PURE__ */ React8.createElement(Symbol, null));
1037
+ },
1073
1038
  createShape: createShape2,
1074
1039
  getAnchors: (shape) => createAnchors2({
1075
1040
  shape,
@@ -1077,57 +1042,50 @@ var defineShape = ({ type, name, icon, Symbol: Symbol2, createShape: createShape
1077
1042
  outputs
1078
1043
  })
1079
1044
  });
1080
- var Symbol = (pathConstructor, inputs) => {
1081
- var _effect = _useSignals8();
1082
- try {
1083
- return ({
1084
- width = 64,
1085
- height = 32,
1086
- // TODO(burdon): Same as line color.
1087
- className = "fill-neutral-200 dark:fill-neutral-800 stroke-neutral-500",
1088
- strokeWidth = 1
1089
- }) => {
1090
- const startX = width * 0.25;
1091
- const endX = width * 0.75;
1092
- const centerY = height / 2;
1093
- const paths = pathConstructor({
1094
- startX,
1095
- endX,
1096
- height
1097
- });
1098
- return /* @__PURE__ */ React8.createElement("svg", {
1099
- viewBox: `0 0 ${width} ${height}`,
1100
- className: "w-full h-full"
1101
- }, getAnchorPoints({
1102
- x: 0,
1103
- y: centerY
1104
- }, inputs).map(({ x, y }, i) => /* @__PURE__ */ React8.createElement("line", {
1105
- key: i,
1106
- x1: x,
1107
- y1: y,
1108
- x2: startX * 1.3,
1109
- y2: y,
1110
- strokeWidth,
1111
- className
1112
- })), /* @__PURE__ */ React8.createElement("line", {
1113
- x1: endX,
1114
- y1: centerY,
1115
- x2: width,
1116
- y2: centerY,
1117
- strokeWidth,
1118
- className
1119
- }), paths.map((path, i) => /* @__PURE__ */ React8.createElement("path", {
1120
- key: i,
1121
- d: path,
1122
- strokeWidth,
1123
- className
1124
- })));
1125
- };
1126
- } finally {
1127
- _effect.f();
1128
- }
1129
- };
1130
- var AndSymbol = Symbol(({ startX, endX, height }) => {
1045
+ var createSymbol = (pathConstructor, inputs) => ({
1046
+ width = 64,
1047
+ height = 32,
1048
+ // TODO(burdon): Same as line color.
1049
+ className = "fill-neutral-200 dark:fill-neutral-800 stroke-neutral-500",
1050
+ strokeWidth = 1
1051
+ }) => {
1052
+ const startX = width * 0.25;
1053
+ const endX = width * 0.75;
1054
+ const centerY = height / 2;
1055
+ const paths = pathConstructor({
1056
+ startX,
1057
+ endX,
1058
+ height
1059
+ });
1060
+ return /* @__PURE__ */ React8.createElement("svg", {
1061
+ viewBox: `0 0 ${width} ${height}`,
1062
+ className: "w-full h-full"
1063
+ }, getAnchorPoints({
1064
+ x: 0,
1065
+ y: centerY
1066
+ }, inputs).map(({ x, y }, i) => /* @__PURE__ */ React8.createElement("line", {
1067
+ key: i,
1068
+ x1: x,
1069
+ y1: y,
1070
+ x2: startX * 1.3,
1071
+ y2: y,
1072
+ strokeWidth,
1073
+ className
1074
+ })), /* @__PURE__ */ React8.createElement("line", {
1075
+ x1: endX,
1076
+ y1: centerY,
1077
+ x2: width,
1078
+ y2: centerY,
1079
+ strokeWidth,
1080
+ className
1081
+ }), paths.map((path, i) => /* @__PURE__ */ React8.createElement("path", {
1082
+ key: i,
1083
+ d: path,
1084
+ strokeWidth,
1085
+ className
1086
+ })));
1087
+ };
1088
+ var AndSymbol = createSymbol(({ startX, endX, height }) => {
1131
1089
  const arcRadius = (endX - startX) / 2;
1132
1090
  return [
1133
1091
  `
@@ -1150,14 +1108,14 @@ var andShape = defineShape({
1150
1108
  type: "and",
1151
1109
  name: "AND",
1152
1110
  icon: "ph--intersection--regular",
1153
- Symbol: AndSymbol,
1111
+ symbol: AndSymbol,
1154
1112
  createShape: createAnd,
1155
1113
  inputs: [
1156
1114
  "input.a",
1157
1115
  "input.b"
1158
1116
  ]
1159
1117
  });
1160
- var OrSymbol = Symbol(({ startX, endX, height }) => {
1118
+ var OrSymbol = createSymbol(({ startX, endX, height }) => {
1161
1119
  const arcRadius = (endX - startX) / 2;
1162
1120
  return [
1163
1121
  `
@@ -1181,14 +1139,14 @@ var orShape = defineShape({
1181
1139
  type: "or",
1182
1140
  name: "OR",
1183
1141
  icon: "ph--union--regular",
1184
- Symbol: OrSymbol,
1142
+ symbol: OrSymbol,
1185
1143
  createShape: createOr,
1186
1144
  inputs: [
1187
1145
  "input.a",
1188
1146
  "input.b"
1189
1147
  ]
1190
1148
  });
1191
- var NotSymbol = Symbol(({ startX, endX, height }) => {
1149
+ var NotSymbol = createSymbol(({ startX, endX, height }) => {
1192
1150
  return [
1193
1151
  `
1194
1152
  M ${startX},${height * 0.1}
@@ -1215,7 +1173,7 @@ var notShape = defineShape({
1215
1173
  type: "not",
1216
1174
  name: "NOT",
1217
1175
  icon: "ph--x--regular",
1218
- Symbol: NotSymbol,
1176
+ symbol: NotSymbol,
1219
1177
  createShape: createNot,
1220
1178
  inputs: [
1221
1179
  createAnchorId("input")
@@ -1223,7 +1181,7 @@ var notShape = defineShape({
1223
1181
  });
1224
1182
 
1225
1183
  // packages/ui/react-ui-canvas-compute/src/shapes/Chat.tsx
1226
- import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
1184
+ import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
1227
1185
  import { Schema as Schema8 } from "effect";
1228
1186
  import React9, { useRef as useRef2 } from "react";
1229
1187
  import { DEFAULT_OUTPUT as DEFAULT_OUTPUT3 } from "@dxos/conductor";
@@ -1233,7 +1191,7 @@ var ChatShape = Schema8.extend(ComputeShape, Schema8.Struct({
1233
1191
  type: Schema8.Literal("chat")
1234
1192
  }));
1235
1193
  var TextInputComponent = ({ shape, title, ...props }) => {
1236
- var _effect = _useSignals9();
1194
+ var _effect = _useSignals8();
1237
1195
  try {
1238
1196
  const { runtime } = useComputeNodeState(shape);
1239
1197
  const inputRef = useRef2(null);
@@ -1284,7 +1242,7 @@ var chatShape = {
1284
1242
  };
1285
1243
 
1286
1244
  // packages/ui/react-ui-canvas-compute/src/shapes/Constant.tsx
1287
- import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
1245
+ import { useSignals as _useSignals9 } from "@preact-signals/safe-react/tracking";
1288
1246
  import { Schema as Schema9 } from "effect";
1289
1247
  import React10, { useCallback as useCallback2, useRef as useRef3, useState as useState5 } from "react";
1290
1248
  import { ComputeValueType as ComputeValueType2 } from "@dxos/conductor";
@@ -1308,7 +1266,7 @@ var inferType = (value) => {
1308
1266
  }
1309
1267
  };
1310
1268
  var ConstantComponent = ({ shape, title, chat, ...props }) => {
1311
- var _effect = _useSignals10();
1269
+ var _effect = _useSignals9();
1312
1270
  try {
1313
1271
  const { node } = useComputeNodeState(shape);
1314
1272
  const [type, setType] = useState5(inferType(node.value) ?? ComputeValueType2.literals[0]);
@@ -1387,7 +1345,7 @@ var constantShape = {
1387
1345
  };
1388
1346
 
1389
1347
  // packages/ui/react-ui-canvas-compute/src/shapes/Database.tsx
1390
- import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1348
+ import { useSignals as _useSignals10 } from "@preact-signals/safe-react/tracking";
1391
1349
  import { Schema as Schema10 } from "effect";
1392
1350
  import React11 from "react";
1393
1351
  import { createAnchorMap as createAnchorMap5 } from "@dxos/react-ui-canvas-editor";
@@ -1403,7 +1361,7 @@ var createDatabase = (props) => createShape({
1403
1361
  ...props
1404
1362
  });
1405
1363
  var DatabaseComponent = ({ shape }) => {
1406
- var _effect = _useSignals11();
1364
+ var _effect = _useSignals10();
1407
1365
  try {
1408
1366
  return /* @__PURE__ */ React11.createElement(Box, {
1409
1367
  shape
@@ -1427,7 +1385,7 @@ var databaseShape = {
1427
1385
  };
1428
1386
 
1429
1387
  // packages/ui/react-ui-canvas-compute/src/shapes/Function.tsx
1430
- import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1388
+ import { useSignals as _useSignals11 } from "@preact-signals/safe-react/tracking";
1431
1389
  import { Schema as Schema11 } from "effect";
1432
1390
  import React12, { useCallback as useCallback3, useRef as useRef4 } from "react";
1433
1391
  import { AnyOutput, FunctionInput } from "@dxos/conductor";
@@ -1448,7 +1406,7 @@ var createFunction = (props) => createShape({
1448
1406
  ...props
1449
1407
  });
1450
1408
  var TextInputComponent2 = ({ shape, title, ...props }) => {
1451
- var _effect = _useSignals12();
1409
+ var _effect = _useSignals11();
1452
1410
  try {
1453
1411
  const client = useClient();
1454
1412
  const { node, runtime } = useComputeNodeState(shape);
@@ -1512,7 +1470,7 @@ var functionShape = {
1512
1470
  };
1513
1471
 
1514
1472
  // packages/ui/react-ui-canvas-compute/src/shapes/Gpt.tsx
1515
- import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1473
+ import { useSignals as _useSignals12 } from "@preact-signals/safe-react/tracking";
1516
1474
  import { Schema as Schema12 } from "effect";
1517
1475
  import React13, { useEffect as useEffect4, useState as useState6 } from "react";
1518
1476
  import { GptInput, GptOutput } from "@dxos/conductor";
@@ -1528,7 +1486,7 @@ var createGpt = (props) => createShape({
1528
1486
  ...props
1529
1487
  });
1530
1488
  var GptComponent = ({ shape }) => {
1531
- var _effect = _useSignals13();
1489
+ var _effect = _useSignals12();
1532
1490
  try {
1533
1491
  const { meta, runtime } = useComputeNodeState(shape);
1534
1492
  const [text, setText] = useState6("");
@@ -1588,7 +1546,7 @@ var gptShape = {
1588
1546
  };
1589
1547
 
1590
1548
  // packages/ui/react-ui-canvas-compute/src/shapes/Json.tsx
1591
- import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
1549
+ import { useSignals as _useSignals13 } from "@preact-signals/safe-react/tracking";
1592
1550
  import { Schema as Schema13 } from "effect";
1593
1551
  import React14 from "react";
1594
1552
  import { DEFAULT_INPUT as DEFAULT_INPUT4, DefaultOutput, JsonTransformInput } from "@dxos/conductor";
@@ -1601,7 +1559,7 @@ var JsonTransformShape = Schema13.extend(ComputeShape, Schema13.Struct({
1601
1559
  type: Schema13.Literal("json-transform")
1602
1560
  }));
1603
1561
  var JsonComponent = ({ shape, ...props }) => {
1604
- var _effect = _useSignals14();
1562
+ var _effect = _useSignals13();
1605
1563
  try {
1606
1564
  const { runtime } = useComputeNodeState(shape);
1607
1565
  const input = runtime.inputs[DEFAULT_INPUT4];
@@ -1617,7 +1575,7 @@ var JsonComponent = ({ shape, ...props }) => {
1617
1575
  }
1618
1576
  };
1619
1577
  var JsonTransformComponent = ({ shape, ...props }) => {
1620
- var _effect = _useSignals14();
1578
+ var _effect = _useSignals13();
1621
1579
  try {
1622
1580
  return /* @__PURE__ */ React14.createElement(Box, {
1623
1581
  shape
@@ -1671,7 +1629,7 @@ var jsonTransformShape = {
1671
1629
  };
1672
1630
 
1673
1631
  // packages/ui/react-ui-canvas-compute/src/shapes/Logic.tsx
1674
- import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1632
+ import { useSignals as _useSignals14 } from "@preact-signals/safe-react/tracking";
1675
1633
  import { Schema as Schema14 } from "effect";
1676
1634
  import React15 from "react";
1677
1635
  import { IfElseInput, IfElseOutput, IfInput, IfOutput } from "@dxos/conductor";
@@ -1682,7 +1640,7 @@ var IfElseShape = Schema14.extend(ComputeShape, Schema14.Struct({
1682
1640
  type: Schema14.Literal("if-else")
1683
1641
  }));
1684
1642
  var IfComponent = ({ shape, ...props }) => {
1685
- var _effect = _useSignals15();
1643
+ var _effect = _useSignals14();
1686
1644
  try {
1687
1645
  return /* @__PURE__ */ React15.createElement(FunctionBody, {
1688
1646
  shape,
@@ -1694,7 +1652,7 @@ var IfComponent = ({ shape, ...props }) => {
1694
1652
  }
1695
1653
  };
1696
1654
  var IfElseComponent = ({ shape, ...props }) => {
1697
- var _effect = _useSignals15();
1655
+ var _effect = _useSignals14();
1698
1656
  try {
1699
1657
  return /* @__PURE__ */ React15.createElement(FunctionBody, {
1700
1658
  shape,
@@ -1739,7 +1697,7 @@ var ifElseShape = {
1739
1697
  };
1740
1698
 
1741
1699
  // packages/ui/react-ui-canvas-compute/src/shapes/Queue.tsx
1742
- import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1700
+ import { useSignals as _useSignals15 } from "@preact-signals/safe-react/tracking";
1743
1701
  import { Schema as Schema15 } from "effect";
1744
1702
  import React16, { Fragment } from "react";
1745
1703
  import { DEFAULT_OUTPUT as DEFAULT_OUTPUT4, QueueInput, QueueOutput } from "@dxos/conductor";
@@ -1756,7 +1714,7 @@ var createQueue = (props) => createShape({
1756
1714
  ...props
1757
1715
  });
1758
1716
  var QueueComponent = ({ shape }) => {
1759
- var _effect = _useSignals16();
1717
+ var _effect = _useSignals15();
1760
1718
  try {
1761
1719
  const { runtime } = useComputeNodeState(shape);
1762
1720
  const items = runtime.outputs[DEFAULT_OUTPUT4]?.type === "executed" ? runtime.outputs[DEFAULT_OUTPUT4].value : [];
@@ -1783,7 +1741,7 @@ var QueueComponent = ({ shape }) => {
1783
1741
  }
1784
1742
  };
1785
1743
  var QueueItem = ({ classNames, item }) => {
1786
- var _effect = _useSignals16();
1744
+ var _effect = _useSignals15();
1787
1745
  try {
1788
1746
  if (typeof item !== "object") {
1789
1747
  return /* @__PURE__ */ React16.createElement("div", {
@@ -1812,7 +1770,7 @@ var queueShape = {
1812
1770
  };
1813
1771
 
1814
1772
  // packages/ui/react-ui-canvas-compute/src/shapes/RNG.tsx
1815
- import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
1773
+ import { useSignals as _useSignals16 } from "@preact-signals/safe-react/tracking";
1816
1774
  import { Schema as Schema16 } from "effect";
1817
1775
  import React17, { useEffect as useEffect5, useState as useState7 } from "react";
1818
1776
  import { DEFAULT_OUTPUT as DEFAULT_OUTPUT5 } from "@dxos/conductor";
@@ -1842,7 +1800,7 @@ var icons = [
1842
1800
  ];
1843
1801
  var pickIcon = () => icons[Math.floor(Math.random() * icons.length)];
1844
1802
  var RandomComponent = ({ shape }) => {
1845
- var _effect = _useSignals17();
1803
+ var _effect = _useSignals16();
1846
1804
  try {
1847
1805
  const { runtime } = useComputeNodeState(shape);
1848
1806
  const [spin, setSpin] = useState7(false);
@@ -1894,7 +1852,7 @@ var randomShape = {
1894
1852
  };
1895
1853
 
1896
1854
  // packages/ui/react-ui-canvas-compute/src/shapes/Scope.tsx
1897
- import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
1855
+ import { useSignals as _useSignals17 } from "@preact-signals/safe-react/tracking";
1898
1856
  import { Schema as Schema17 } from "effect";
1899
1857
  import React18 from "react";
1900
1858
  import { DEFAULT_INPUT as DEFAULT_INPUT5 } from "@dxos/conductor";
@@ -1913,7 +1871,7 @@ var createScope = (props) => createShape({
1913
1871
  ...props
1914
1872
  });
1915
1873
  var ScopeComponent = ({ shape }) => {
1916
- var _effect = _useSignals18();
1874
+ var _effect = _useSignals17();
1917
1875
  try {
1918
1876
  const { runtime } = useComputeNodeState(shape);
1919
1877
  const input = runtime.inputs[DEFAULT_INPUT5];
@@ -1948,7 +1906,7 @@ var scopeShape = {
1948
1906
  };
1949
1907
 
1950
1908
  // packages/ui/react-ui-canvas-compute/src/shapes/Surface.tsx
1951
- import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
1909
+ import { useSignals as _useSignals18 } from "@preact-signals/safe-react/tracking";
1952
1910
  import { Schema as Schema18 } from "effect";
1953
1911
  import React19 from "react";
1954
1912
  import { Surface } from "@dxos/app-framework";
@@ -1966,7 +1924,7 @@ var createSurface = (props) => createShape({
1966
1924
  ...props
1967
1925
  });
1968
1926
  var SurfaceComponent = ({ shape }) => {
1969
- var _effect = _useSignals19();
1927
+ var _effect = _useSignals18();
1970
1928
  try {
1971
1929
  const { runtime } = useComputeNodeState(shape);
1972
1930
  const input = runtime.inputs[DEFAULT_INPUT6];
@@ -2006,7 +1964,7 @@ var surfaceShape = {
2006
1964
  };
2007
1965
 
2008
1966
  // packages/ui/react-ui-canvas-compute/src/shapes/Switch.tsx
2009
- import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
1967
+ import { useSignals as _useSignals19 } from "@preact-signals/safe-react/tracking";
2010
1968
  import { Schema as Schema19 } from "effect";
2011
1969
  import React20, { useEffect as useEffect6, useState as useState8 } from "react";
2012
1970
  import { DEFAULT_OUTPUT as DEFAULT_OUTPUT6 } from "@dxos/conductor";
@@ -2024,7 +1982,7 @@ var createSwitch = (props) => createShape({
2024
1982
  ...props
2025
1983
  });
2026
1984
  var SwitchComponent = ({ shape }) => {
2027
- var _effect = _useSignals20();
1985
+ var _effect = _useSignals19();
2028
1986
  try {
2029
1987
  const { runtime } = useComputeNodeState(shape);
2030
1988
  const [value, setValue] = useState8(false);
@@ -2059,7 +2017,7 @@ var switchShape = {
2059
2017
  };
2060
2018
 
2061
2019
  // packages/ui/react-ui-canvas-compute/src/shapes/Table.tsx
2062
- import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
2020
+ import { useSignals as _useSignals20 } from "@preact-signals/safe-react/tracking";
2063
2021
  import { Schema as Schema20 } from "effect";
2064
2022
  import React21 from "react";
2065
2023
  import { createInputSchema, createOutputSchema, GptMessage } from "@dxos/conductor";
@@ -2077,7 +2035,7 @@ var createTable = (props) => createShape({
2077
2035
  ...props
2078
2036
  });
2079
2037
  var TableComponent = ({ shape }) => {
2080
- var _effect = _useSignals21();
2038
+ var _effect = _useSignals20();
2081
2039
  try {
2082
2040
  return /* @__PURE__ */ React21.createElement(Box, {
2083
2041
  shape
@@ -2097,7 +2055,7 @@ var tableShape = {
2097
2055
  };
2098
2056
 
2099
2057
  // packages/ui/react-ui-canvas-compute/src/shapes/Template.tsx
2100
- import { useSignals as _useSignals22 } from "@preact-signals/safe-react/tracking";
2058
+ import { useSignals as _useSignals21 } from "@preact-signals/safe-react/tracking";
2101
2059
  import { Schema as Schema21 } from "effect";
2102
2060
  import React22, { useRef as useRef5 } from "react";
2103
2061
  import { ComputeValueType as ComputeValueType3, getTemplateInputSchema as getTemplateInputSchema2, TemplateOutput, VoidInput as VoidInput2 } from "@dxos/conductor";
@@ -2110,7 +2068,7 @@ var TemplateShape = Schema21.extend(ComputeShape, Schema21.Struct({
2110
2068
  valueType: Schema21.optional(ComputeValueType3)
2111
2069
  }));
2112
2070
  var TextInputComponent3 = ({ shape, title, ...props }) => {
2113
- var _effect = _useSignals22();
2071
+ var _effect = _useSignals21();
2114
2072
  try {
2115
2073
  const { node } = useComputeNodeState(shape);
2116
2074
  const inputRef = useRef5(null);
@@ -2176,7 +2134,7 @@ var templateShape = {
2176
2134
  };
2177
2135
 
2178
2136
  // packages/ui/react-ui-canvas-compute/src/shapes/Text.tsx
2179
- import { useSignals as _useSignals23 } from "@preact-signals/safe-react/tracking";
2137
+ import { useSignals as _useSignals22 } from "@preact-signals/safe-react/tracking";
2180
2138
  import { Schema as Schema22 } from "effect";
2181
2139
  import React23 from "react";
2182
2140
  import { DEFAULT_INPUT as DEFAULT_INPUT7 } from "@dxos/conductor";
@@ -2194,7 +2152,7 @@ var createText = (props) => createShape({
2194
2152
  ...props
2195
2153
  });
2196
2154
  var TextComponent = ({ shape }) => {
2197
- var _effect = _useSignals23();
2155
+ var _effect = _useSignals22();
2198
2156
  try {
2199
2157
  const { runtime } = useComputeNodeState(shape);
2200
2158
  const input = runtime.inputs[DEFAULT_INPUT7];
@@ -2230,7 +2188,7 @@ var textShape = {
2230
2188
  };
2231
2189
 
2232
2190
  // packages/ui/react-ui-canvas-compute/src/shapes/Thread.tsx
2233
- import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
2191
+ import { useSignals as _useSignals23 } from "@preact-signals/safe-react/tracking";
2234
2192
  import { Schema as Schema23 } from "effect";
2235
2193
  import React24, { useEffect as useEffect7, useRef as useRef6 } from "react";
2236
2194
  import { createInputSchema as createInputSchema2, createOutputSchema as createOutputSchema2, GptMessage as GptMessage2 } from "@dxos/conductor";
@@ -2249,7 +2207,7 @@ var createThread = (props) => createShape({
2249
2207
  ...props
2250
2208
  });
2251
2209
  var ThreadComponent = ({ shape }) => {
2252
- var _effect = _useSignals24();
2210
+ var _effect = _useSignals23();
2253
2211
  try {
2254
2212
  const items = [];
2255
2213
  const scrollRef = useRef6(null);
@@ -2276,7 +2234,7 @@ var ThreadComponent = ({ shape }) => {
2276
2234
  }
2277
2235
  };
2278
2236
  var ThreadItem = ({ classNames, item }) => {
2279
- var _effect = _useSignals24();
2237
+ var _effect = _useSignals23();
2280
2238
  try {
2281
2239
  if (typeof item !== "object") {
2282
2240
  return /* @__PURE__ */ React24.createElement("div", {
@@ -2304,7 +2262,7 @@ var threadShape = {
2304
2262
  };
2305
2263
 
2306
2264
  // packages/ui/react-ui-canvas-compute/src/shapes/TextToImage.tsx
2307
- import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
2265
+ import { useSignals as _useSignals24 } from "@preact-signals/safe-react/tracking";
2308
2266
  import { Schema as Schema24 } from "effect";
2309
2267
  import React25 from "react";
2310
2268
  import { createAnchorMap as createAnchorMap12 } from "@dxos/react-ui-canvas-editor";
@@ -2320,7 +2278,7 @@ var createTextToImage = (props) => createShape({
2320
2278
  ...props
2321
2279
  });
2322
2280
  var TextToImageComponent = ({ shape }) => {
2323
- var _effect = _useSignals25();
2281
+ var _effect = _useSignals24();
2324
2282
  try {
2325
2283
  return /* @__PURE__ */ React25.createElement(Box, {
2326
2284
  shape
@@ -2344,7 +2302,7 @@ var textToImageShape = {
2344
2302
  };
2345
2303
 
2346
2304
  // packages/ui/react-ui-canvas-compute/src/shapes/Trigger.tsx
2347
- import { useSignals as _useSignals26 } from "@preact-signals/safe-react/tracking";
2305
+ import { useSignals as _useSignals25 } from "@preact-signals/safe-react/tracking";
2348
2306
  import { Schema as Schema25 } from "effect";
2349
2307
  import React26, { useEffect as useEffect8 } from "react";
2350
2308
  import { VoidInput as VoidInput3 } from "@dxos/conductor";
@@ -2373,7 +2331,7 @@ var createTrigger = (props) => {
2373
2331
  });
2374
2332
  };
2375
2333
  var TriggerComponent = ({ shape }) => {
2376
- var _effect = _useSignals26();
2334
+ var _effect = _useSignals25();
2377
2335
  try {
2378
2336
  const space = useSpace();
2379
2337
  const functionTrigger = shape.functionTrigger?.target;
@@ -2418,7 +2376,7 @@ var TriggerComponent = ({ shape }) => {
2418
2376
  }
2419
2377
  };
2420
2378
  var TriggerKindSelect = ({ value, onValueChange }) => {
2421
- var _effect = _useSignals26();
2379
+ var _effect = _useSignals25();
2422
2380
  try {
2423
2381
  return /* @__PURE__ */ React26.createElement(Select2.Root, {
2424
2382
  value,
@@ -2489,7 +2447,7 @@ var triggerShape = {
2489
2447
  };
2490
2448
 
2491
2449
  // packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx
2492
- import { useSignals as _useSignals27 } from "@preact-signals/safe-react/tracking";
2450
+ import { useSignals as _useSignals26 } from "@preact-signals/safe-react/tracking";
2493
2451
  import { Schema as Schema26 } from "effect";
2494
2452
  import React27, { useState as useState9 } from "react";
2495
2453
  import { log as log2 } from "@dxos/log";
@@ -2508,7 +2466,7 @@ var createGptRealtime = (props) => createShape({
2508
2466
  ...props
2509
2467
  });
2510
2468
  var GptRealtimeComponent = ({ shape }) => {
2511
- var _effect = _useSignals27();
2469
+ var _effect = _useSignals26();
2512
2470
  try {
2513
2471
  const [isLive, setIsLive] = useState9(false);
2514
2472
  const [isReady, setIsReady] = useState9(false);
@@ -2534,8 +2492,8 @@ var GptRealtimeComponent = ({ shape }) => {
2534
2492
  }));
2535
2493
  const offer = await peerConnection.createOffer();
2536
2494
  await peerConnection.setLocalDescription(offer);
2537
- const aiServiceUrl = new URL("/rtc-connect", config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL);
2538
- const response = await fetch(aiServiceUrl, {
2495
+ const AiServiceUrl = new URL("/rtc-connect", config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL);
2496
+ const response = await fetch(AiServiceUrl, {
2539
2497
  method: "POST",
2540
2498
  body: offer.sdp,
2541
2499
  headers: {