@aintela/chat 0.14.5 → 0.14.7

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.
@@ -373,7 +373,7 @@ const Me = /* @__PURE__ */ p((s, t) => {
373
373
  }, "getConnectionStateColor"), U = class U {
374
374
  static replaceFirstTwoTabsPerLine(t) {
375
375
  const i = /^\s{15}/gm;
376
- return typeof t == "string" ? t.replaceAll(i, (a) => a.substring(15)) : t ?? "";
376
+ return typeof t == "string" ? t.replaceAll(i, (r) => r.substring(15)) : t ?? "";
377
377
  }
378
378
  static jsonToString(t) {
379
379
  if (t == null) return "";
@@ -386,15 +386,15 @@ const Me = /* @__PURE__ */ p((s, t) => {
386
386
  } catch {
387
387
  return String(t);
388
388
  }
389
- const a = Object.keys(t), r = [];
390
- return a.forEach((l) => {
389
+ const r = Object.keys(t), a = [];
390
+ return r.forEach((l) => {
391
391
  let u = t[l];
392
392
  typeof u == "object" && (u = JSON.stringify(t[l], null, 2));
393
393
  const f = (u == null ? void 0 : u.toString().indexOf(`
394
394
  `)) > -1 ? `
395
395
  ` : "";
396
- r.push(`${l}:${f}${u}`);
397
- }), r.join(`
396
+ a.push(`${l}:${f}${u}`);
397
+ }), a.join(`
398
398
  `);
399
399
  }
400
400
  static functionDetailsToString(t) {
@@ -414,15 +414,15 @@ const Me = /* @__PURE__ */ p((s, t) => {
414
414
  } catch {
415
415
  return String(t);
416
416
  }
417
- const i = Object.keys(t), a = [];
418
- return i.forEach((r) => {
419
- let l = t == null ? void 0 : t[r];
417
+ const i = Object.keys(t), r = [];
418
+ return i.forEach((a) => {
419
+ let l = t == null ? void 0 : t[a];
420
420
  typeof l == "object" && (l = JSON.stringify(l, null, 2));
421
421
  const u = (l == null ? void 0 : l.toString().indexOf(`
422
422
  `)) > -1 ? `
423
423
  ` : "";
424
- a.push(`${r}:${u}${l}`);
425
- }), a.join(`
424
+ r.push(`${a}:${u}${l}`);
425
+ }), r.join(`
426
426
  `);
427
427
  }
428
428
  /**
@@ -442,8 +442,8 @@ const Me = /* @__PURE__ */ p((s, t) => {
442
442
  return;
443
443
  }
444
444
  if (!i || typeof i != "object") return;
445
- const a = i, r = a.SlotId ?? a.slotId;
446
- return typeof r == "string" ? r : void 0;
445
+ const r = i, a = r.SlotId ?? r.slotId;
446
+ return typeof a == "string" ? a : void 0;
447
447
  }
448
448
  static fromError(t) {
449
449
  return {
@@ -457,11 +457,11 @@ const Me = /* @__PURE__ */ p((s, t) => {
457
457
  textAppendable: !1
458
458
  };
459
459
  }
460
- static fromText(t, i, a) {
460
+ static fromText(t, i, r) {
461
461
  return {
462
462
  text: t,
463
463
  eventType: c.Text,
464
- id: a ?? Wt(),
464
+ id: r ?? Wt(),
465
465
  created: /* @__PURE__ */ new Date(),
466
466
  author: i ?? "main",
467
467
  partial: !1,
@@ -475,9 +475,9 @@ const Me = /* @__PURE__ */ p((s, t) => {
475
475
  * and replayed parts are identical: an `EventType.UserAnswer` carrying functionDetails
476
476
  * {name, args, isUi, status:'Done'} that routes through the uiTool dispatcher/registry.
477
477
  */
478
- static fromUserUi(t, i, a) {
478
+ static fromUserUi(t, i, r) {
479
479
  return {
480
- id: a ?? Wt(),
480
+ id: r ?? Wt(),
481
481
  eventType: c.UserAnswer,
482
482
  author: "user",
483
483
  created: /* @__PURE__ */ new Date(),
@@ -493,14 +493,14 @@ const Me = /* @__PURE__ */ p((s, t) => {
493
493
  }
494
494
  };
495
495
  }
496
- static createWaiting(t = !1, i = !0, a, r, l) {
497
- a || (a = "Waiting");
496
+ static createWaiting(t = !1, i = !0, r, a, l) {
497
+ r || (r = "Waiting");
498
498
  const u = U.fromText("...", void 0, "waitingpart");
499
499
  return u.eventType = c.Waiting, u.waitingDetails = {
500
- startingPoint: r,
500
+ startingPoint: a,
501
501
  addTimer: t,
502
502
  isTimerRunning: i,
503
- status: a,
503
+ status: r,
504
504
  stopPoint: l
505
505
  }, u;
506
506
  }
@@ -514,16 +514,16 @@ const Me = /* @__PURE__ */ p((s, t) => {
514
514
  static FlatParts(t) {
515
515
  if (t.length === 0)
516
516
  return;
517
- const i = t.filter((l) => l.eventType == c.Text), a = i.length > 0 ? i[0] : t[0], r = [...new Set(t.map((l) => l.eventType))];
518
- r.length == 1 ? a.eventType = r[0] : i.length > 0 && (a.eventType = c.Text), a.mustPush = !(a.eventType == c.Text || a.eventType == c.Thought || a.eventType == c.NotDefined || a.eventType == c.PartialFunctionCall), a.textAppendable = a.eventType == c.Text || a.eventType == c.Thought || a.eventType == c.PartialFunctionCall;
517
+ const i = t.filter((l) => l.eventType == c.Text), r = i.length > 0 ? i[0] : t[0], a = [...new Set(t.map((l) => l.eventType))];
518
+ a.length == 1 ? r.eventType = a[0] : i.length > 0 && (r.eventType = c.Text), r.mustPush = !(r.eventType == c.Text || r.eventType == c.Thought || r.eventType == c.NotDefined || r.eventType == c.PartialFunctionCall), r.textAppendable = r.eventType == c.Text || r.eventType == c.Thought || r.eventType == c.PartialFunctionCall;
519
519
  for (const l of t) {
520
- if (!a.codeExecutionResultDetails && l.codeExecutionResultDetails && (a.codeExecutionResultDetails = l.codeExecutionResultDetails), !a.errorDetails && l.errorDetails && (a.errorDetails = l.errorDetails), !a.executableCodeDetails && l.executableCodeDetails && (a.executableCodeDetails = l.executableCodeDetails), !a.functionDetails && l.functionDetails && (a.functionDetails = l.functionDetails), a.functionDetails && l.functionDetails && l !== a) {
521
- const u = a.functionDetails, f = l.functionDetails;
520
+ if (!r.codeExecutionResultDetails && l.codeExecutionResultDetails && (r.codeExecutionResultDetails = l.codeExecutionResultDetails), !r.errorDetails && l.errorDetails && (r.errorDetails = l.errorDetails), !r.executableCodeDetails && l.executableCodeDetails && (r.executableCodeDetails = l.executableCodeDetails), !r.functionDetails && l.functionDetails && (r.functionDetails = l.functionDetails), r.functionDetails && l.functionDetails && l !== r) {
521
+ const u = r.functionDetails, f = l.functionDetails;
522
522
  !u.askUserComponent && f.askUserComponent && (u.askUserComponent = f.askUserComponent), !u.isUi && f.isUi && (u.isUi = !0), !u.clientOutput && f.clientOutput && (u.clientOutput = f.clientOutput), u.isAskUser = u.isAskUser || f.isAskUser || !!u.askUserComponent;
523
523
  }
524
- !a.rawDetails && l.rawDetails && (a.rawDetails = l.rawDetails), !a.thoughtDetails && l.thoughtDetails && (a.thoughtDetails = l.thoughtDetails), !a.errorDetails && l.errorDetails && (a.errorDetails = l.errorDetails);
524
+ !r.rawDetails && l.rawDetails && (r.rawDetails = l.rawDetails), !r.thoughtDetails && l.thoughtDetails && (r.thoughtDetails = l.thoughtDetails), !r.errorDetails && l.errorDetails && (r.errorDetails = l.errorDetails);
525
525
  }
526
- return a;
526
+ return r;
527
527
  }
528
528
  static isCharArray(t) {
529
529
  return Array.isArray(t) && t.length > 0 && t.every((i) => typeof i == "string" && i.length === 1);
@@ -538,12 +538,12 @@ const Me = /* @__PURE__ */ p((s, t) => {
538
538
  if (t == null || typeof t != "object" || Array.isArray(t)) return null;
539
539
  const i = Object.keys(t);
540
540
  if (i.length === 0) return null;
541
- for (let a = 0; a < i.length; a++) {
542
- if (i[a] !== String(a)) return null;
543
- const r = t[i[a]];
544
- if (typeof r != "string" || r.length !== 1) return null;
541
+ for (let r = 0; r < i.length; r++) {
542
+ if (i[r] !== String(r)) return null;
543
+ const a = t[i[r]];
544
+ if (typeof a != "string" || a.length !== 1) return null;
545
545
  }
546
- return i.map((a) => t[a]).join("");
546
+ return i.map((r) => t[r]).join("");
547
547
  }
548
548
  static isCodeExecution(t) {
549
549
  return t.eventType === c.CodeExecutionResult || t.eventType === c.ExecutableCode;
@@ -551,10 +551,10 @@ const Me = /* @__PURE__ */ p((s, t) => {
551
551
  };
552
552
  p(U, "InteractionPartUtils");
553
553
  let Bt = U;
554
- var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ p((s, t, i, a) => {
555
- for (var r = a > 1 ? void 0 : a ? ue(t, i) : t, l = s.length - 1, u; l >= 0; l--)
556
- (u = s[l]) && (r = (a ? u(t, i, r) : u(r)) || r);
557
- return a && r && pe(t, i, r), r;
554
+ var pe = Object.defineProperty, ue = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ p((s, t, i, r) => {
555
+ for (var a = r > 1 ? void 0 : r ? ue(t, i) : t, l = s.length - 1, u; l >= 0; l--)
556
+ (u = s[l]) && (a = (r ? u(t, i, a) : u(a)) || a);
557
+ return r && a && pe(t, i, a), a;
558
558
  }, "__decorateClass");
559
559
  const C = {
560
560
  // KernelContent derived types
@@ -1419,18 +1419,18 @@ Kt = n([
1419
1419
  g({ name: "Payload" })
1420
1420
  ], Kt);
1421
1421
  function Yt(s) {
1422
- var r;
1423
- const t = (s == null ? void 0 : s.presentation) ?? ((r = s == null ? void 0 : s.metadata) == null ? void 0 : r[de]);
1422
+ var a;
1423
+ const t = (s == null ? void 0 : s.presentation) ?? ((a = s == null ? void 0 : s.metadata) == null ? void 0 : a[de]);
1424
1424
  if (!t || typeof t != "object") return { isUi: !1 };
1425
- const i = t, a = /* @__PURE__ */ p((l, u) => i[l] ?? i[u], "pick");
1425
+ const i = t, r = /* @__PURE__ */ p((l, u) => i[l] ?? i[u], "pick");
1426
1426
  return {
1427
- isUi: a("isUi", "IsUi") === !0,
1428
- askUserComponent: a("askUserComponent", "AskUserComponent") || void 0,
1429
- argsDescription: a("argsDescription", "ArgsDescription") || void 0,
1427
+ isUi: r("isUi", "IsUi") === !0,
1428
+ askUserComponent: r("askUserComponent", "AskUserComponent") || void 0,
1429
+ argsDescription: r("argsDescription", "ArgsDescription") || void 0,
1430
1430
  // Runtime override on a RESULT: the UI tool chose not to render (CallContext.CancelUiRender).
1431
- cancelUi: a("cancelUi", "CancelUi") === !0 || void 0,
1431
+ cancelUi: r("cancelUi", "CancelUi") === !0 || void 0,
1432
1432
  // Live signal on the PARK event: the tool is now waiting on a human, so the drawer may open.
1433
- parked: a("parked", "Parked") === !0 || void 0
1433
+ parked: r("parked", "Parked") === !0 || void 0
1434
1434
  };
1435
1435
  }
1436
1436
  p(Yt, "readPresentation");
@@ -1471,13 +1471,14 @@ const w = class w {
1471
1471
  e(this, "visible", !0);
1472
1472
  this.interactionId = t, this.author = "main";
1473
1473
  }
1474
- static createErrorEvent(t, i) {
1474
+ static createErrorEvent(t, i, r) {
1475
1475
  const a = new w(i);
1476
1476
  a.turn_complete = !0, a.partial = !1, a.parts = [];
1477
- const r = {
1477
+ const l = {
1478
1478
  eventType: c.ServerError,
1479
1479
  errorDetails: {
1480
- errorMessage: t
1480
+ errorMessage: t,
1481
+ ...r != null && r.connectionCutoff ? { connectionCutoff: !0 } : {}
1481
1482
  },
1482
1483
  id: "",
1483
1484
  author: "main",
@@ -1486,14 +1487,14 @@ const w = class w {
1486
1487
  mustPush: !1,
1487
1488
  textAppendable: !1
1488
1489
  };
1489
- return a.parts.push(r), a;
1490
+ return a.parts.push(l), a;
1490
1491
  }
1491
1492
  static parseFlatPropertiesTypedEvent(t) {
1492
- var a, r, l, u, f;
1493
+ var r, a, l, u, f;
1493
1494
  const i = new w(t.interactionId);
1494
1495
  if (i.serverError = t.serverError, !t.interactionId && !w.carriesServerError(t))
1495
1496
  throw new Error("Interaction ID is required");
1496
- switch (i.model_session_id = "", i.server_session_id = null, i.asyncFinalResponse = t.turnComplete, i.command = (a = t.command) == null ? void 0 : a.toString(), t.sessionInformation && (i.session_information = t.sessionInformation), (!t.author || t.author == "") && console.warn('[ServerEvent] event with no author; defaulting to "main"', {
1497
+ switch (i.model_session_id = "", i.server_session_id = null, i.asyncFinalResponse = t.turnComplete, i.command = (r = t.command) == null ? void 0 : r.toString(), t.sessionInformation && (i.session_information = t.sessionInformation), (!t.author || t.author == "") && console.warn('[ServerEvent] event with no author; defaulting to "main"', {
1497
1498
  interactionId: t.interactionId,
1498
1499
  turnComplete: t.turnComplete
1499
1500
  }), t == null ? void 0 : t.author) {
@@ -1506,15 +1507,15 @@ const w = class w {
1506
1507
  default:
1507
1508
  i.author = "main";
1508
1509
  }
1509
- return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = c.NotDefined, i.partial = ((l = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : l.toLowerCase()) === "true", i.turn_complete = t.turnComplete, i.visible = t.visible, i.isFinalResponse = t.turnComplete ?? !1, i.artifactsDelta = [], t.artifactsGenerated && t.artifactsGenerated.length > 0 && (i.created = new Date(t.timestamp), i.llmArtifacts = t.artifactsGenerated), i.detachedRunId = t.detachedRunId, i.detachedRunName = t.detachedRunName, (u = t.agent) != null && u.personaId && ((f = t.agent) != null && f.role) && (i.agent = { personaId: t.agent.personaId, role: t.agent.role }), i;
1510
+ return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = c.NotDefined, i.partial = ((l = (a = t.partial) == null ? void 0 : a.toString()) == null ? void 0 : l.toLowerCase()) === "true", i.turn_complete = t.turnComplete, i.visible = t.visible, i.isFinalResponse = t.turnComplete ?? !1, i.artifactsDelta = [], t.artifactsGenerated && t.artifactsGenerated.length > 0 && (i.created = new Date(t.timestamp), i.llmArtifacts = t.artifactsGenerated), i.detachedRunId = t.detachedRunId, i.detachedRunName = t.detachedRunName, (u = t.agent) != null && u.personaId && ((f = t.agent) != null && f.role) && (i.agent = { personaId: t.agent.personaId, role: t.agent.role }), i;
1510
1511
  }
1511
1512
  static getPartType(t) {
1512
1513
  return t instanceof vt ? "TextContent" : t instanceof v ? "FunctionCallContent" : t instanceof N ? "FunctionResultContent" : t instanceof b ? "StreamingFunctionCallUpdateContent" : t instanceof O ? "StreamingFinalFunctionCallContent" : t instanceof A ? "StreamingFinalFunctionResultContent" : t instanceof Ft ? "FunctionClientOutputContent" : t instanceof q ? "StreamingClientOutputContent" : t instanceof Et ? "UserUiContent" : t instanceof Nt ? "InteractionOriginContent" : t instanceof bt ? "QueuedMessageContent" : t instanceof Ut ? "StreamingTextContent" : t instanceof Pt ? "StreamingReasoningContent" : t instanceof Mt ? "StreamingThoughtHighlightContent" : t instanceof G ? "ToolEventContent" : t instanceof M ? "StreamingToolEventContent" : "Unknown";
1513
1514
  }
1514
1515
  /** True when the event holds the SDK's "Server Error" sentinel call (`Event.GetErrorEvent`). */
1515
1516
  static carriesServerError(t) {
1516
- var a;
1517
- return (((a = t.content) == null ? void 0 : a.items) ?? []).some((r) => (r == null ? void 0 : r.id) === w.SERVER_ERROR_CALL_ID);
1517
+ var r;
1518
+ return (((r = t.content) == null ? void 0 : r.items) ?? []).some((a) => (a == null ? void 0 : a.id) === w.SERVER_ERROR_CALL_ID);
1518
1519
  }
1519
1520
  static parseFromTypedEvent(t) {
1520
1521
  var l, u, f, z, Qt, Jt, Vt;
@@ -1524,9 +1525,9 @@ const w = class w {
1524
1525
  if (!t.content && !t.streamingParts)
1525
1526
  return i;
1526
1527
  i.parts = [];
1527
- const a = [...((l = t.content) == null ? void 0 : l.items) ?? [], ...t.streamingParts ?? []];
1528
+ const r = [...((l = t.content) == null ? void 0 : l.items) ?? [], ...t.streamingParts ?? []];
1528
1529
  i.eventType = le(((u = t.eventType) == null ? void 0 : u.type) ?? "");
1529
- for (const y of a) {
1530
+ for (const y of r) {
1530
1531
  let d = {
1531
1532
  id: "",
1532
1533
  author: i.author,
@@ -1539,9 +1540,9 @@ const w = class w {
1539
1540
  };
1540
1541
  const h = w.getPartType(y);
1541
1542
  if (h == C.FunctionCallContent || h == C.FunctionResultContent || h == C.StreamingFinalFunctionCallContent || h == C.StreamingFinalFunctionResultContent) {
1542
- var r = y;
1543
- if (r.id == w.SERVER_ERROR_CALL_ID) {
1544
- const m = r.arguments ?? {}, B = typeof m.error == "string" && m.error.trim().length > 0 ? m.error : JSON.stringify(r.arguments);
1543
+ var a = y;
1544
+ if (a.id == w.SERVER_ERROR_CALL_ID) {
1545
+ const m = a.arguments ?? {}, B = typeof m.error == "string" && m.error.trim().length > 0 ? m.error : JSON.stringify(a.arguments);
1545
1546
  d.eventType = c.ServerError, d.errorDetails = {
1546
1547
  errorMessage: B,
1547
1548
  stackTrace: typeof m.stackTrace == "string" ? m.stackTrace : void 0
@@ -1550,24 +1551,24 @@ const w = class w {
1550
1551
  d.eventType = h == C.FunctionCallContent || h == C.StreamingFinalFunctionCallContent ? c.FunctionCall : c.FunctionResponse;
1551
1552
  let m;
1552
1553
  try {
1553
- if (r != null && r.result)
1554
- if (typeof r.result == "object")
1555
- m = r.result;
1556
- else if (typeof r.result == "string") {
1557
- const At = JSON.parse(r.result);
1558
- m = typeof At == "object" && At !== null ? At : r.result;
1554
+ if (a != null && a.result)
1555
+ if (typeof a.result == "object")
1556
+ m = a.result;
1557
+ else if (typeof a.result == "string") {
1558
+ const At = JSON.parse(a.result);
1559
+ m = typeof At == "object" && At !== null ? At : a.result;
1559
1560
  } else
1560
- m = r.result;
1561
+ m = a.result;
1561
1562
  } catch (At) {
1562
- console.warn("Parse function error", At), m = r == null ? void 0 : r.result;
1563
+ console.warn("Parse function error", At), m = a == null ? void 0 : a.result;
1563
1564
  }
1564
1565
  d.thoughtDetails = {
1565
1566
  text: ""
1566
1567
  };
1567
- const B = Yt(r);
1568
+ const B = Yt(a);
1568
1569
  d.functionDetails = {
1569
- id: (r == null ? void 0 : r.id) ?? "",
1570
- args: r == null ? void 0 : r.arguments,
1570
+ id: (a == null ? void 0 : a.id) ?? "",
1571
+ args: a == null ? void 0 : a.arguments,
1571
1572
  // The SETTLED call arrives as FunctionCallContent on the persisted/replay path and as
1572
1573
  // StreamingFinalFunctionCallContent on the live one — both open the call, so both stamp
1573
1574
  // `start`. Keying on the persisted type alone left every LIVE call `Executing` with no
@@ -1575,8 +1576,8 @@ const w = class w {
1575
1576
  // showed "running" with no stopwatch (AIA issue 1022). Same for `end` on the result.
1576
1577
  start: h == C.FunctionCallContent || h == C.StreamingFinalFunctionCallContent ? i.created : void 0,
1577
1578
  end: h == C.FunctionResultContent || h == C.StreamingFinalFunctionResultContent ? i.created : void 0,
1578
- text: JSON.stringify(r == null ? void 0 : r.arguments) ?? "",
1579
- name: (r == null ? void 0 : r.functionName) ?? "",
1579
+ text: JSON.stringify(a == null ? void 0 : a.arguments) ?? "",
1580
+ name: (a == null ? void 0 : a.functionName) ?? "",
1580
1581
  status: d.eventType == c.FunctionCall ? "Executing" : "Done",
1581
1582
  response: m,
1582
1583
  isUi: B.isUi,
@@ -1584,11 +1585,11 @@ const w = class w {
1584
1585
  // Client-only payload riding the RESULT event: live top-level `clientOutput`, or
1585
1586
  // metadata.clientOutput on the collapsed/persisted result. Calls leave it undefined.
1586
1587
  // The persisted-replay form also folds in via FunctionClientOutputContent.
1587
- clientOutput: (r == null ? void 0 : r.clientOutput) ?? ((f = r == null ? void 0 : r.metadata) == null ? void 0 : f.clientOutput),
1588
+ clientOutput: (a == null ? void 0 : a.clientOutput) ?? ((f = a == null ? void 0 : a.metadata) == null ? void 0 : f.clientOutput),
1588
1589
  askUserComponent: B.askUserComponent,
1589
1590
  // Runtime "don't render" override on a RESULT (CallContext.CancelUiRender).
1590
1591
  cancelUi: B.cancelUi
1591
- }, d.functionDetails.isAskUser = !!d.functionDetails.askUserComponent, t.text = r == null ? void 0 : r.arguments;
1592
+ }, d.functionDetails.isAskUser = !!d.functionDetails.askUserComponent, t.text = a == null ? void 0 : a.arguments;
1592
1593
  }
1593
1594
  } else if (h == C.StreamingTextContent)
1594
1595
  d.eventType = c.Text, d.text = (z = y == null ? void 0 : y.text) == null ? void 0 : z.replaceAll("\\n", `
@@ -1702,19 +1703,19 @@ const w = class w {
1702
1703
  ]
1703
1704
  };
1704
1705
  }
1705
- static createFromFunctionName(t, i, a) {
1706
- const r = w.createFromText("", i);
1707
- return r.parts[0].text = void 0, r.parts[0].thoughtDetails = void 0, r.parts[0].textAppendable = !1, r.parts[0].mustPush = !0, r.parts[0].functionDetails = {
1706
+ static createFromFunctionName(t, i, r) {
1707
+ const a = w.createFromText("", i);
1708
+ return a.parts[0].text = void 0, a.parts[0].thoughtDetails = void 0, a.parts[0].textAppendable = !1, a.parts[0].mustPush = !0, a.parts[0].functionDetails = {
1708
1709
  name: t,
1709
1710
  id: "callId",
1710
1711
  status: "Executing",
1711
1712
  start: /* @__PURE__ */ new Date(),
1712
1713
  end: void 0,
1713
1714
  text: "dfsdfdf",
1714
- args: a
1715
- }, r;
1715
+ args: r
1716
+ }, a;
1716
1717
  }
1717
- static createFromText(t, i, a) {
1718
+ static createFromText(t, i, r) {
1718
1719
  return {
1719
1720
  author: "main",
1720
1721
  visible: !0,
@@ -1735,8 +1736,8 @@ const w = class w {
1735
1736
  // with `eventType: Text` AND a populated `thoughtDetails`
1736
1737
  // render the text in the body and the trace in the
1737
1738
  // thinking strip.
1738
- thoughtDetails: a ? {
1739
- text: a
1739
+ thoughtDetails: r ? {
1740
+ text: r
1740
1741
  } : void 0,
1741
1742
  id: Wt(),
1742
1743
  created: /* @__PURE__ */ new Date(),
@@ -1788,8 +1789,8 @@ function me(s) {
1788
1789
  return s.name;
1789
1790
  }
1790
1791
  p(me, "getConstructorName");
1791
- function ee(s, t, i, a) {
1792
- t.constructor !== i && (s.$type = (a == null ? void 0 : a.name) ?? me(t.constructor));
1792
+ function ee(s, t, i, r) {
1793
+ t.constructor !== i && (s.$type = (r == null ? void 0 : r.name) ?? me(t.constructor));
1793
1794
  }
1794
1795
  p(ee, "dotNetTypeEmitter");
1795
1796
  function ne(s, t) {
@@ -1819,16 +1820,16 @@ function ie(s) {
1819
1820
  try {
1820
1821
  return JSON.parse(s), s;
1821
1822
  } catch {
1822
- let i = "", a = !1;
1823
- for (let r = 0; r < s.length; r++) {
1824
- const l = s[r], u = l.charCodeAt(0);
1825
- if (l === "\\" && a && r + 1 < s.length) {
1826
- const f = s[r + 1];
1823
+ let i = "", r = !1;
1824
+ for (let a = 0; a < s.length; a++) {
1825
+ const l = s[a], u = l.charCodeAt(0);
1826
+ if (l === "\\" && r && a + 1 < s.length) {
1827
+ const f = s[a + 1];
1827
1828
  if (f === '"' || f === "\\" || f === "/" || f === "b" || f === "f" || f === "n" || f === "r" || f === "t") {
1828
- i += l + f, r++;
1829
+ i += l + f, a++;
1829
1830
  continue;
1830
- } else if (f === "u" && r + 5 < s.length) {
1831
- i += s.substring(r, r + 6), r += 5;
1831
+ } else if (f === "u" && a + 5 < s.length) {
1832
+ i += s.substring(a, a + 6), a += 5;
1832
1833
  continue;
1833
1834
  } else {
1834
1835
  i += l;
@@ -1837,12 +1838,12 @@ function ie(s) {
1837
1838
  }
1838
1839
  if (l === '"') {
1839
1840
  let f = 0;
1840
- for (let z = r - 1; z >= 0 && s[z] === "\\"; z--)
1841
+ for (let z = a - 1; z >= 0 && s[z] === "\\"; z--)
1841
1842
  f++;
1842
- f % 2 === 0 && (a = !a), i += l;
1843
+ f % 2 === 0 && (r = !r), i += l;
1843
1844
  continue;
1844
1845
  }
1845
- if (a && u < 32)
1846
+ if (r && u < 32)
1846
1847
  switch (l) {
1847
1848
  case `
1848
1849
  `:
@@ -1928,4 +1929,4 @@ export {
1928
1929
  He as y,
1929
1930
  Ie as z
1930
1931
  };
1931
- //# sourceMappingURL=serializer-CdIQS0hy.js.map
1932
+ //# sourceMappingURL=serializer-Dagz_6VT.js.map