@dxos/react-ui-canvas-compute 0.7.5-labs.5f04cf6 → 0.7.5-labs.e27f9b9

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.
@@ -323,6 +323,7 @@ var ComputeGraphController = class extends Resource {
323
323
  this._executor = new GraphExecutor({
324
324
  computeNodeResolver: (node) => resolveComputeNode(node)
325
325
  });
326
+ this._diagnostics = [];
326
327
  this._services = {};
327
328
  this._forcedOutputs = {};
328
329
  this._runtimeStateInputs = {};
@@ -347,6 +348,9 @@ var ComputeGraphController = class extends Resource {
347
348
  get graph() {
348
349
  return this._graph;
349
350
  }
351
+ get diagnostics() {
352
+ return this._diagnostics;
353
+ }
350
354
  get userState() {
351
355
  return this._forcedOutputs;
352
356
  }
@@ -399,7 +403,7 @@ var ComputeGraphController = class extends Resource {
399
403
  } catch (err) {
400
404
  log.catch(err, void 0, {
401
405
  F: __dxlog_file4,
402
- L: 208,
406
+ L: 215,
403
407
  S: this,
404
408
  C: (f, a) => f(...a)
405
409
  });
@@ -410,6 +414,11 @@ var ComputeGraphController = class extends Resource {
410
414
  const { meta } = await resolveComputeNode(node);
411
415
  return meta;
412
416
  }
417
+ async checkGraph() {
418
+ const executor = this._executor.clone();
419
+ await executor.load(this._graph);
420
+ this._diagnostics = executor.getDiagnostics();
421
+ }
413
422
  async evalNode(nodeId) {
414
423
  const executor = this._executor.clone();
415
424
  await executor.load(this._graph);
@@ -500,7 +509,7 @@ var ComputeGraphController = class extends Resource {
500
509
  event
501
510
  }, {
502
511
  F: __dxlog_file4,
503
- L: 351,
512
+ L: 365,
504
513
  S: this,
505
514
  C: (f, a) => f(...a)
506
515
  });
@@ -536,6 +545,9 @@ var ComputeGraphController = class extends Resource {
536
545
  });
537
546
  }
538
547
  };
548
+ _ts_decorate([
549
+ synchronized
550
+ ], ComputeGraphController.prototype, "checkGraph", null);
539
551
  _ts_decorate([
540
552
  synchronized
541
553
  ], ComputeGraphController.prototype, "exec", null);
@@ -764,8 +776,8 @@ var createFunctionAnchors = (shape, input = VoidInput, output = VoidOutput) => {
764
776
 
765
777
  // packages/ui/react-ui-canvas-compute/src/shapes/common/TypeSelect.tsx
766
778
  import React3 from "react";
767
- import { Select } from "@dxos/react-ui";
768
779
  import { ComputeValueType } from "@dxos/conductor";
780
+ import { Select } from "@dxos/react-ui";
769
781
  var TypeSelect = ({ value, onValueChange }) => {
770
782
  return /* @__PURE__ */ React3.createElement(Select.Root, {
771
783
  value,
@@ -2171,7 +2183,10 @@ var triggerShape = {
2171
2183
  // packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx
2172
2184
  import React27, { useState as useState8 } from "react";
2173
2185
  import { S as S26 } from "@dxos/echo-schema";
2186
+ import { log as log2 } from "@dxos/log";
2187
+ import { useConfig } from "@dxos/react-client";
2174
2188
  import { Icon as Icon5 } from "@dxos/react-ui";
2189
+ var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-canvas-compute/src/shapes/GptRealtime.tsx";
2175
2190
  var GptRealtimeShape = S26.extend(ComputeShape, S26.Struct({
2176
2191
  type: S26.Literal("gpt-realtime")
2177
2192
  }));
@@ -2186,6 +2201,7 @@ var createGptRealtime = (props) => createShape({
2186
2201
  var GptRealtimeComponent = ({ shape }) => {
2187
2202
  const [isLive, setIsLive] = useState8(false);
2188
2203
  const [isReady, setIsReady] = useState8(false);
2204
+ const config = useConfig();
2189
2205
  const start = async () => {
2190
2206
  setIsLive(true);
2191
2207
  try {
@@ -2207,7 +2223,8 @@ var GptRealtimeComponent = ({ shape }) => {
2207
2223
  }));
2208
2224
  const offer = await peerConnection.createOffer();
2209
2225
  await peerConnection.setLocalDescription(offer);
2210
- const response = await fetch(`${AI_SERVICE_URL}/rtc-connect`, {
2226
+ const aiServiceUrl = new URL("/rtc-connect", config.values.runtime?.services?.ai?.server ?? DEFAULT_AI_SERVICE_URL);
2227
+ const response = await fetch(aiServiceUrl, {
2211
2228
  method: "POST",
2212
2229
  body: offer.sdp,
2213
2230
  headers: {
@@ -2221,7 +2238,12 @@ var GptRealtimeComponent = ({ shape }) => {
2221
2238
  });
2222
2239
  const dataChannel = peerConnection.createDataChannel("response");
2223
2240
  const configureData = () => {
2224
- console.log("Configuring data channel");
2241
+ log2.info("Configuring data channel", void 0, {
2242
+ F: __dxlog_file7,
2243
+ L: 87,
2244
+ S: void 0,
2245
+ C: (f, a) => f(...a)
2246
+ });
2225
2247
  const event = {
2226
2248
  type: "session.update",
2227
2249
  session: {
@@ -2236,7 +2258,14 @@ var GptRealtimeComponent = ({ shape }) => {
2236
2258
  dataChannel.send(JSON.stringify(event));
2237
2259
  };
2238
2260
  dataChannel.addEventListener("open", (ev) => {
2239
- console.log("Opening data channel", ev);
2261
+ log2.info("Opening data channel", {
2262
+ ev
2263
+ }, {
2264
+ F: __dxlog_file7,
2265
+ L: 100,
2266
+ S: void 0,
2267
+ C: (f, a) => f(...a)
2268
+ });
2240
2269
  configureData();
2241
2270
  });
2242
2271
  dataChannel.addEventListener("message", async (ev) => {
@@ -2245,7 +2274,14 @@ var GptRealtimeComponent = ({ shape }) => {
2245
2274
  }
2246
2275
  });
2247
2276
  } catch (error) {
2248
- console.error("Error in realtime session:", error);
2277
+ log2.error("Error in realtime session:", {
2278
+ error
2279
+ }, {
2280
+ F: __dxlog_file7,
2281
+ L: 140,
2282
+ S: void 0,
2283
+ C: (f, a) => f(...a)
2284
+ });
2249
2285
  throw error;
2250
2286
  }
2251
2287
  };
@@ -2270,7 +2306,7 @@ var gptRealtimeShape = {
2270
2306
  }), S26.Struct({})),
2271
2307
  resizable: true
2272
2308
  };
2273
- var AI_SERVICE_URL = "http://localhost:8788";
2309
+ var DEFAULT_AI_SERVICE_URL = "http://localhost:8788";
2274
2310
 
2275
2311
  // packages/ui/react-ui-canvas-compute/src/registry.ts
2276
2312
  var computeShapes = [