@aintela/chat 0.2.58 → 0.2.59

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.
@@ -3,7 +3,7 @@ var Wt = (s, t, i) => t in s ? wt(s, t, { enumerable: !0, configurable: !0, writ
3
3
  var l = (s, t) => wt(s, "name", { value: t, configurable: !0 });
4
4
  var e = (s, t, i) => Wt(s, typeof t != "symbol" ? t + "" : t, i);
5
5
  import { E as m, q as It, A as $t, G as Gt } from "./environmentUtils-CUVZ6Dq1.js";
6
- import { jsonMember as o, jsonObject as d, AnyT as L, jsonArrayMember as St, TypedJSON as Pt } from "typedjson";
6
+ import { jsonMember as o, jsonObject as y, AnyT as L, jsonArrayMember as Tt, TypedJSON as vt } from "typedjson";
7
7
  const R = class R {
8
8
  static replaceFirstTwoTabsPerLine(t) {
9
9
  const i = /^\s{15}/gm;
@@ -24,10 +24,10 @@ const R = class R {
24
24
  return r.forEach((p) => {
25
25
  let c = t[p];
26
26
  typeof c == "object" && (c = JSON.stringify(t[p], null, 2));
27
- const g = (c == null ? void 0 : c.toString().indexOf(`
27
+ const d = (c == null ? void 0 : c.toString().indexOf(`
28
28
  `)) > -1 ? `
29
29
  ` : "";
30
- a.push(`${p}:${g}${c}`);
30
+ a.push(`${p}:${d}${c}`);
31
31
  }), a.join(`
32
32
  `);
33
33
  }
@@ -155,8 +155,8 @@ const R = class R {
155
155
  a.length == 1 ? r.eventType = a[0] : i.length > 0 && (r.eventType = m.Text), r.mustPush = !(r.eventType == m.Text || r.eventType == m.Thought || r.eventType == m.NotDefined || r.eventType == m.PartialFunctionCall), r.textAppendable = r.eventType == m.Text || r.eventType == m.Thought || r.eventType == m.PartialFunctionCall;
156
156
  for (const p of t) {
157
157
  if (!r.codeExecutionResultDetails && p.codeExecutionResultDetails && (r.codeExecutionResultDetails = p.codeExecutionResultDetails), !r.errorDetails && p.errorDetails && (r.errorDetails = p.errorDetails), !r.executableCodeDetails && p.executableCodeDetails && (r.executableCodeDetails = p.executableCodeDetails), !r.functionDetails && p.functionDetails && (r.functionDetails = p.functionDetails), r.functionDetails && p.functionDetails && p !== r) {
158
- const c = r.functionDetails, g = p.functionDetails;
159
- !c.askUserComponent && g.askUserComponent && (c.askUserComponent = g.askUserComponent), !c.isUi && g.isUi && (c.isUi = !0), !c.clientOutput && g.clientOutput && (c.clientOutput = g.clientOutput), c.isAskUser = c.isAskUser || g.isAskUser || !!c.askUserComponent;
158
+ const c = r.functionDetails, d = p.functionDetails;
159
+ !c.askUserComponent && d.askUserComponent && (c.askUserComponent = d.askUserComponent), !c.isUi && d.isUi && (c.isUi = !0), !c.clientOutput && d.clientOutput && (c.clientOutput = d.clientOutput), c.isAskUser = c.isAskUser || d.isAskUser || !!c.askUserComponent;
160
160
  }
161
161
  !r.rawDetails && p.rawDetails && (r.rawDetails = p.rawDetails), !r.thoughtDetails && p.thoughtDetails && (r.thoughtDetails = p.thoughtDetails), !r.errorDetails && p.errorDetails && (r.errorDetails = p.errorDetails);
162
162
  }
@@ -210,36 +210,36 @@ const x = {
210
210
  StreamingFinalFunctionResultContent: "StreamingFinalFunctionResultContent",
211
211
  StreamingClientOutputContent: "StreamingClientOutputContent"
212
212
  };
213
- var W;
214
- let xt = (W = class {
213
+ var $;
214
+ let ht = ($ = class {
215
215
  constructor() {
216
216
  e(this, "label");
217
217
  }
218
- }, l(W, "AuthorRole"), W);
218
+ }, l($, "AuthorRole"), $);
219
219
  n([
220
220
  o(String)
221
- ], xt.prototype, "label", 2);
222
- xt = n([
223
- d({ name: "AuthorRole" })
224
- ], xt);
225
- var $;
226
- let gt = ($ = class {
221
+ ], ht.prototype, "label", 2);
222
+ ht = n([
223
+ y({ name: "AuthorRole" })
224
+ ], ht);
225
+ var G;
226
+ let dt = (G = class {
227
227
  constructor() {
228
228
  e(this, "type");
229
229
  e(this, "fullName");
230
230
  }
231
- }, l($, "EventTypeInformation"), $);
231
+ }, l(G, "EventTypeInformation"), G);
232
232
  n([
233
233
  o(String)
234
- ], gt.prototype, "type", 2);
234
+ ], dt.prototype, "type", 2);
235
235
  n([
236
236
  o(String)
237
- ], gt.prototype, "fullName", 2);
238
- gt = n([
239
- d({ name: "EventTypeInformation" })
240
- ], gt);
241
- var G;
242
- let v = (G = class {
237
+ ], dt.prototype, "fullName", 2);
238
+ dt = n([
239
+ y({ name: "EventTypeInformation" })
240
+ ], dt);
241
+ var q;
242
+ let k = (q = class {
243
243
  constructor() {
244
244
  e(this, "id");
245
245
  e(this, "name");
@@ -256,24 +256,24 @@ let v = (G = class {
256
256
  id: this.id
257
257
  };
258
258
  }
259
- }, l(G, "LlmArtifact"), G);
259
+ }, l(q, "LlmArtifact"), q);
260
260
  n([
261
261
  o(String)
262
- ], v.prototype, "id", 2);
262
+ ], k.prototype, "id", 2);
263
263
  n([
264
264
  o(String)
265
- ], v.prototype, "name", 2);
265
+ ], k.prototype, "name", 2);
266
266
  n([
267
267
  o(String)
268
- ], v.prototype, "mimeType", 2);
268
+ ], k.prototype, "mimeType", 2);
269
269
  n([
270
270
  o(String)
271
- ], v.prototype, "description", 2);
272
- v = n([
273
- d({ name: "LlmArtifact" })
274
- ], v);
275
- var q;
276
- let h = (q = class {
271
+ ], k.prototype, "description", 2);
272
+ k = n([
273
+ y({ name: "LlmArtifact" })
274
+ ], k);
275
+ var B;
276
+ let h = (B = class {
277
277
  constructor() {
278
278
  e(this, "mimeType");
279
279
  // InnerContent is ignored (JsonIgnore in C#)
@@ -282,7 +282,7 @@ let h = (q = class {
282
282
  e(this, "modelId");
283
283
  e(this, "metadata");
284
284
  }
285
- }, l(q, "KernelContent"), q);
285
+ }, l(B, "KernelContent"), B);
286
286
  n([
287
287
  o(String)
288
288
  ], h.prototype, "mimeType", 2);
@@ -293,10 +293,10 @@ n([
293
293
  o(L)
294
294
  ], h.prototype, "metadata", 2);
295
295
  h = n([
296
- d({ name: "KernelContent" })
296
+ y({ name: "KernelContent" })
297
297
  ], h);
298
- var B;
299
- let C = (B = class {
298
+ var M;
299
+ let C = (M = class {
300
300
  constructor() {
301
301
  e(this, "choiceIndex", 0);
302
302
  // InnerContent is ignored (JsonIgnore in C#)
@@ -305,7 +305,7 @@ let C = (B = class {
305
305
  e(this, "modelId");
306
306
  e(this, "metadata");
307
307
  }
308
- }, l(B, "StreamingKernelContent"), B);
308
+ }, l(M, "StreamingKernelContent"), M);
309
309
  n([
310
310
  o(Number)
311
311
  ], C.prototype, "choiceIndex", 2);
@@ -316,10 +316,10 @@ n([
316
316
  o(Object)
317
317
  ], C.prototype, "metadata", 2);
318
318
  C = n([
319
- d({ name: "StreamingKernelContent" })
319
+ y({ name: "StreamingKernelContent" })
320
320
  ], C);
321
- var M;
322
- let ht = (M = class extends h {
321
+ var K;
322
+ let Ct = (K = class extends h {
323
323
  constructor() {
324
324
  super();
325
325
  e(this, "text");
@@ -331,74 +331,74 @@ let ht = (M = class extends h {
331
331
  toString() {
332
332
  return this.text ?? "";
333
333
  }
334
- }, l(M, "TextContent"), M);
334
+ }, l(K, "TextContent"), K);
335
335
  n([
336
336
  o(String)
337
- ], ht.prototype, "text", 2);
338
- ht = n([
339
- d({ name: "TextContent" })
340
- ], ht);
341
- var K;
342
- let P = (K = class extends C {
337
+ ], Ct.prototype, "text", 2);
338
+ Ct = n([
339
+ y({ name: "TextContent" })
340
+ ], Ct);
341
+ var H;
342
+ let v = (H = class extends C {
343
343
  constructor() {
344
344
  super();
345
345
  e(this, "eventName");
346
346
  e(this, "eventData");
347
347
  e(this, "sessionId");
348
348
  }
349
- }, l(K, "StreamingToolEventContent"), K);
349
+ }, l(H, "StreamingToolEventContent"), H);
350
350
  n([
351
351
  o(String)
352
- ], P.prototype, "eventName", 2);
352
+ ], v.prototype, "eventName", 2);
353
353
  n([
354
354
  o(String)
355
- ], P.prototype, "eventData", 2);
355
+ ], v.prototype, "eventData", 2);
356
356
  n([
357
357
  o(String)
358
- ], P.prototype, "sessionId", 2);
359
- P = n([
360
- d({ name: "StreamingToolEventContent" })
361
- ], P);
362
- var H;
363
- let k = (H = class extends h {
358
+ ], v.prototype, "sessionId", 2);
359
+ v = n([
360
+ y({ name: "StreamingToolEventContent" })
361
+ ], v);
362
+ var Y;
363
+ let P = (Y = class extends h {
364
364
  constructor() {
365
365
  super();
366
366
  e(this, "eventName");
367
367
  e(this, "eventData");
368
368
  e(this, "sessionId");
369
369
  }
370
- }, l(H, "ToolEventContent"), H);
370
+ }, l(Y, "ToolEventContent"), Y);
371
371
  n([
372
372
  o(String)
373
- ], k.prototype, "eventName", 2);
373
+ ], P.prototype, "eventName", 2);
374
374
  n([
375
375
  o(String)
376
- ], k.prototype, "eventData", 2);
376
+ ], P.prototype, "eventData", 2);
377
377
  n([
378
378
  o(String)
379
- ], k.prototype, "sessionId", 2);
380
- k = n([
381
- d({ name: "ToolEventContent" })
382
- ], k);
383
- var Y;
384
- let Ct = (Y = class extends h {
379
+ ], P.prototype, "sessionId", 2);
380
+ P = n([
381
+ y({ name: "ToolEventContent" })
382
+ ], P);
383
+ var Q;
384
+ let Dt = (Q = class extends h {
385
385
  constructor() {
386
386
  super(...arguments);
387
387
  e(this, "url");
388
388
  e(this, "dataUri");
389
389
  }
390
- }, l(Y, "ImageContent"), Y);
390
+ }, l(Q, "ImageContent"), Q);
391
391
  n([
392
392
  o(String)
393
- ], Ct.prototype, "url", 2);
393
+ ], Dt.prototype, "url", 2);
394
394
  n([
395
395
  o(String)
396
- ], Ct.prototype, "dataUri", 2);
397
- Ct = n([
398
- d({ name: "ImageContent" })
399
- ], Ct);
400
- var Q;
401
- let U = (Q = class extends h {
396
+ ], Dt.prototype, "dataUri", 2);
397
+ Dt = n([
398
+ y({ name: "ImageContent" })
399
+ ], Dt);
400
+ var V;
401
+ let U = (V = class extends h {
402
402
  constructor() {
403
403
  super(...arguments);
404
404
  e(this, "id");
@@ -408,7 +408,7 @@ let U = (Q = class extends h {
408
408
  // Exception is not serializable - omit jsonMember decorator
409
409
  e(this, "exception");
410
410
  }
411
- }, l(Q, "FunctionCallContent"), Q);
411
+ }, l(V, "FunctionCallContent"), V);
412
412
  n([
413
413
  o(String)
414
414
  ], U.prototype, "id", 2);
@@ -422,10 +422,10 @@ n([
422
422
  o(L)
423
423
  ], U.prototype, "arguments", 2);
424
424
  U = n([
425
- d({ name: "FunctionCallContent" })
425
+ y({ name: "FunctionCallContent" })
426
426
  ], U);
427
- var V;
428
- let I = (V = class {
427
+ var X;
428
+ let I = (X = class {
429
429
  constructor() {
430
430
  e(this, "isUi");
431
431
  e(this, "askUserComponent");
@@ -433,7 +433,7 @@ let I = (V = class {
433
433
  e(this, "cancelUi");
434
434
  e(this, "parked");
435
435
  }
436
- }, l(V, "ToolCallPresentation"), V);
436
+ }, l(X, "ToolCallPresentation"), X);
437
437
  n([
438
438
  o(Boolean)
439
439
  ], I.prototype, "isUi", 2);
@@ -450,11 +450,11 @@ n([
450
450
  o(Boolean)
451
451
  ], I.prototype, "parked", 2);
452
452
  I = n([
453
- d({ name: "ToolCallPresentation" })
453
+ y({ name: "ToolCallPresentation" })
454
454
  ], I);
455
455
  const Mt = "aia:presentation";
456
- var X;
457
- let b = (X = class extends C {
456
+ var Z;
457
+ let b = (Z = class extends C {
458
458
  constructor() {
459
459
  super(...arguments);
460
460
  e(this, "id");
@@ -462,7 +462,7 @@ let b = (X = class extends C {
462
462
  e(this, "arguments");
463
463
  e(this, "presentation");
464
464
  }
465
- }, l(X, "StreamingFinalFunctionCallContent"), X);
465
+ }, l(Z, "StreamingFinalFunctionCallContent"), Z);
466
466
  n([
467
467
  o(String, { name: "callId" })
468
468
  ], b.prototype, "id", 2);
@@ -476,10 +476,10 @@ n([
476
476
  o(I)
477
477
  ], b.prototype, "presentation", 2);
478
478
  b = n([
479
- d({ name: "StreamingFinalFunctionCallContent" })
479
+ y({ name: "StreamingFinalFunctionCallContent" })
480
480
  ], b);
481
- var Z;
482
- let O = (Z = class extends h {
481
+ var j;
482
+ let O = (j = class extends h {
483
483
  constructor() {
484
484
  super(...arguments);
485
485
  e(this, "id");
@@ -487,7 +487,7 @@ let O = (Z = class extends h {
487
487
  e(this, "functionName");
488
488
  e(this, "result");
489
489
  }
490
- }, l(Z, "FunctionResultContent"), Z);
490
+ }, l(j, "FunctionResultContent"), j);
491
491
  n([
492
492
  o(String, { name: "callId" })
493
493
  ], O.prototype, "id", 2);
@@ -501,10 +501,10 @@ n([
501
501
  o(L)
502
502
  ], O.prototype, "result", 2);
503
503
  O = n([
504
- d({ name: "FunctionResultContent" })
504
+ y({ name: "FunctionResultContent" })
505
505
  ], O);
506
- var j;
507
- let N = (j = class extends C {
506
+ var tt;
507
+ let N = (tt = class extends C {
508
508
  constructor() {
509
509
  super(...arguments);
510
510
  e(this, "id");
@@ -514,7 +514,7 @@ let N = (j = class extends C {
514
514
  e(this, "presentation");
515
515
  e(this, "clientOutput");
516
516
  }
517
- }, l(j, "StreamingFinalFunctionResultContent"), j);
517
+ }, l(tt, "StreamingFinalFunctionResultContent"), tt);
518
518
  n([
519
519
  o(String, { name: "callId" })
520
520
  ], N.prototype, "id", 2);
@@ -534,34 +534,34 @@ n([
534
534
  o(L)
535
535
  ], N.prototype, "clientOutput", 2);
536
536
  N = n([
537
- d({ name: "StreamingFinalFunctionResultContent" })
537
+ y({ name: "StreamingFinalFunctionResultContent" })
538
538
  ], N);
539
- var tt;
540
- let dt = (tt = class extends h {
539
+ var et;
540
+ let yt = (et = class extends h {
541
541
  constructor() {
542
542
  super(...arguments);
543
543
  e(this, "id");
544
544
  e(this, "data");
545
545
  }
546
- }, l(tt, "FunctionClientOutputContent"), tt);
546
+ }, l(et, "FunctionClientOutputContent"), et);
547
547
  n([
548
548
  o(String, { name: "callId" })
549
- ], dt.prototype, "id", 2);
549
+ ], yt.prototype, "id", 2);
550
550
  n([
551
551
  o(L)
552
- ], dt.prototype, "data", 2);
553
- dt = n([
554
- d({ name: "FunctionClientOutputContent" })
555
- ], dt);
556
- var et;
557
- let z = (et = class extends C {
552
+ ], yt.prototype, "data", 2);
553
+ yt = n([
554
+ y({ name: "FunctionClientOutputContent" })
555
+ ], yt);
556
+ var nt;
557
+ let z = (nt = class extends C {
558
558
  constructor() {
559
559
  super(...arguments);
560
560
  e(this, "id");
561
561
  e(this, "clientOutput");
562
562
  e(this, "presentation");
563
563
  }
564
- }, l(et, "StreamingClientOutputContent"), et);
564
+ }, l(nt, "StreamingClientOutputContent"), nt);
565
565
  n([
566
566
  o(String, { name: "callId" })
567
567
  ], z.prototype, "id", 2);
@@ -572,44 +572,44 @@ n([
572
572
  o(I)
573
573
  ], z.prototype, "presentation", 2);
574
574
  z = n([
575
- d({ name: "StreamingClientOutputContent" })
575
+ y({ name: "StreamingClientOutputContent" })
576
576
  ], z);
577
- var nt;
578
- let yt = (nt = class extends h {
577
+ var it;
578
+ let ft = (it = class extends h {
579
579
  constructor() {
580
580
  super(...arguments);
581
581
  e(this, "name");
582
582
  e(this, "args");
583
583
  }
584
- }, l(nt, "UserUiContent"), nt);
584
+ }, l(it, "UserUiContent"), it);
585
585
  n([
586
586
  o(String)
587
- ], yt.prototype, "name", 2);
587
+ ], ft.prototype, "name", 2);
588
588
  n([
589
589
  o(String)
590
- ], yt.prototype, "args", 2);
591
- yt = n([
592
- d({ name: "UserUiContent" })
593
- ], yt);
594
- var it;
595
- let ft = (it = class extends h {
590
+ ], ft.prototype, "args", 2);
591
+ ft = n([
592
+ y({ name: "UserUiContent" })
593
+ ], ft);
594
+ var ot;
595
+ let St = (ot = class extends h {
596
596
  constructor() {
597
597
  super(...arguments);
598
598
  e(this, "role");
599
599
  e(this, "items");
600
600
  }
601
- }, l(it, "ChatMessageContent"), it);
601
+ }, l(ot, "ChatMessageContent"), ot);
602
602
  n([
603
- o(xt)
604
- ], ft.prototype, "role", 2);
603
+ o(ht)
604
+ ], St.prototype, "role", 2);
605
605
  n([
606
- St(() => h)
607
- ], ft.prototype, "items", 2);
608
- ft = n([
609
- d({ name: "ChatMessageContent" })
610
- ], ft);
611
- var ot;
612
- let w = (ot = class extends C {
606
+ Tt(() => h)
607
+ ], St.prototype, "items", 2);
608
+ St = n([
609
+ y({ name: "ChatMessageContent" })
610
+ ], St);
611
+ var rt;
612
+ let w = (rt = class extends C {
613
613
  constructor() {
614
614
  super(...arguments);
615
615
  e(this, "callId");
@@ -617,7 +617,7 @@ let w = (ot = class extends C {
617
617
  e(this, "arguments");
618
618
  e(this, "functionCallIndex", 0);
619
619
  }
620
- }, l(ot, "StreamingFunctionCallUpdateContent"), ot);
620
+ }, l(rt, "StreamingFunctionCallUpdateContent"), rt);
621
621
  n([
622
622
  o(String)
623
623
  ], w.prototype, "callId", 2);
@@ -631,10 +631,10 @@ n([
631
631
  o(Number)
632
632
  ], w.prototype, "functionCallIndex", 2);
633
633
  w = n([
634
- d({ name: "StreamingFunctionCallUpdateContent" })
634
+ y({ name: "StreamingFunctionCallUpdateContent" })
635
635
  ], w);
636
- var rt;
637
- let Dt = (rt = class extends C {
636
+ var at;
637
+ let Et = (at = class extends C {
638
638
  constructor() {
639
639
  super(...arguments);
640
640
  e(this, "text");
@@ -642,15 +642,15 @@ let Dt = (rt = class extends C {
642
642
  // Not decorated with @jsonMember
643
643
  e(this, "encoding");
644
644
  }
645
- }, l(rt, "StreamingTextContent"), rt);
645
+ }, l(at, "StreamingTextContent"), at);
646
646
  n([
647
647
  o(String)
648
- ], Dt.prototype, "text", 2);
649
- Dt = n([
650
- d({ name: "StreamingTextContent" })
651
- ], Dt);
652
- var at;
653
- let Et = (at = class extends C {
648
+ ], Et.prototype, "text", 2);
649
+ Et = n([
650
+ y({ name: "StreamingTextContent" })
651
+ ], Et);
652
+ var st;
653
+ let Ft = (st = class extends C {
654
654
  constructor() {
655
655
  super(...arguments);
656
656
  e(this, "text");
@@ -658,21 +658,21 @@ let Et = (at = class extends C {
658
658
  // Not decorated with @jsonMember
659
659
  e(this, "encoding");
660
660
  }
661
- }, l(at, "StreamingReasoningContent"), at);
661
+ }, l(st, "StreamingReasoningContent"), st);
662
662
  n([
663
663
  o(String)
664
- ], Et.prototype, "text", 2);
665
- Et = n([
666
- d({ name: "StreamingReasoningContent" })
667
- ], Et);
668
- var st;
669
- let _ = (st = class {
664
+ ], Ft.prototype, "text", 2);
665
+ Ft = n([
666
+ y({ name: "StreamingReasoningContent" })
667
+ ], Ft);
668
+ var pt;
669
+ let _ = (pt = class {
670
670
  constructor() {
671
671
  e(this, "instructionCategory", "");
672
672
  e(this, "description", "");
673
673
  e(this, "interactionId", "");
674
674
  }
675
- }, l(st, "InstructionSummary"), st);
675
+ }, l(pt, "InstructionSummary"), pt);
676
676
  n([
677
677
  o(String)
678
678
  ], _.prototype, "instructionCategory", 2);
@@ -683,10 +683,10 @@ n([
683
683
  o(String)
684
684
  ], _.prototype, "interactionId", 2);
685
685
  _ = n([
686
- d({ name: "InstructionSummary" })
686
+ y({ name: "InstructionSummary" })
687
687
  ], _);
688
- var pt;
689
- let E = (pt = class {
688
+ var lt;
689
+ let E = (lt = class {
690
690
  constructor() {
691
691
  e(this, "size", 0);
692
692
  e(this, "originalSize", 0);
@@ -697,7 +697,7 @@ let E = (pt = class {
697
697
  e(this, "id");
698
698
  e(this, "instructionSummaries", []);
699
699
  }
700
- }, l(pt, "SessionInformation"), pt);
700
+ }, l(lt, "SessionInformation"), lt);
701
701
  n([
702
702
  o(Number)
703
703
  ], E.prototype, "size", 2);
@@ -720,13 +720,13 @@ n([
720
720
  o(String)
721
721
  ], E.prototype, "id", 2);
722
722
  n([
723
- St(_)
723
+ Tt(_)
724
724
  ], E.prototype, "instructionSummaries", 2);
725
725
  E = n([
726
- d({ name: "SessionInformation" })
726
+ y({ name: "SessionInformation" })
727
727
  ], E);
728
- var lt;
729
- let S = (lt = class {
728
+ var ut;
729
+ let S = (ut = class {
730
730
  constructor() {
731
731
  e(this, "timestamp");
732
732
  e(this, "mimeType");
@@ -747,7 +747,7 @@ let S = (lt = class {
747
747
  e(this, "subAgentName");
748
748
  e(this, "text");
749
749
  }
750
- }, l(lt, "LlmEvent"), lt);
750
+ }, l(ut, "LlmEvent"), ut);
751
751
  n([
752
752
  o(Number)
753
753
  ], S.prototype, "timestamp", 2);
@@ -773,31 +773,31 @@ n([
773
773
  o(E)
774
774
  ], S.prototype, "sessionInformation", 2);
775
775
  n([
776
- o(gt)
776
+ o(dt)
777
777
  ], S.prototype, "eventType", 2);
778
778
  n([
779
- St(v)
779
+ Tt(k)
780
780
  ], S.prototype, "artifactsGenerated", 2);
781
781
  n([
782
782
  o(String)
783
783
  ], S.prototype, "author", 2);
784
784
  n([
785
- o(xt)
785
+ o(ht)
786
786
  ], S.prototype, "role", 2);
787
787
  n([
788
788
  o(String)
789
789
  ], S.prototype, "command", 2);
790
790
  n([
791
- o(ft)
791
+ o(St)
792
792
  ], S.prototype, "content", 2);
793
793
  n([
794
- St(() => C)
794
+ Tt(() => C)
795
795
  ], S.prototype, "streamingParts", 2);
796
796
  S = n([
797
- d({ name: "LlmEvent" })
797
+ y({ name: "LlmEvent" })
798
798
  ], S);
799
- var ut;
800
- let D = (ut = class {
799
+ var ct;
800
+ let D = (ct = class {
801
801
  constructor() {
802
802
  e(this, "timeStamp");
803
803
  e(this, "partialText");
@@ -810,7 +810,7 @@ let D = (ut = class {
810
810
  e(this, "partialEventType");
811
811
  e(this, "subAgentId");
812
812
  }
813
- }, l(ut, "PartialLlmEvent"), ut);
813
+ }, l(ct, "PartialLlmEvent"), ct);
814
814
  n([
815
815
  o(Number, { name: "ts" })
816
816
  ], D.prototype, "timeStamp", 2);
@@ -824,7 +824,7 @@ n([
824
824
  o(String, { name: "fn" })
825
825
  ], D.prototype, "functionName", 2);
826
826
  n([
827
- St(() => C)
827
+ Tt(() => C)
828
828
  ], D.prototype, "streamingParts", 2);
829
829
  n([
830
830
  o(String, { name: "fid" })
@@ -836,16 +836,16 @@ n([
836
836
  o(String, { name: "itid" })
837
837
  ], D.prototype, "iteractionId", 2);
838
838
  n([
839
- o(gt)
839
+ o(dt)
840
840
  ], D.prototype, "partialEventType", 2);
841
841
  n([
842
842
  o(String, { name: "said" })
843
843
  ], D.prototype, "subAgentId", 2);
844
844
  D = n([
845
- d({ name: "PartialLlmEvent" })
845
+ y({ name: "PartialLlmEvent" })
846
846
  ], D);
847
- var ct;
848
- let F = (ct = class {
847
+ var mt;
848
+ let F = (mt = class {
849
849
  constructor() {
850
850
  e(this, "type");
851
851
  e(this, "event");
@@ -856,7 +856,7 @@ let F = (ct = class {
856
856
  e(this, "subAgentName");
857
857
  e(this, "seq");
858
858
  }
859
- }, l(ct, "StreamingResponse"), ct);
859
+ }, l(mt, "StreamingResponse"), mt);
860
860
  n([
861
861
  o(String)
862
862
  ], F.prototype, "type", 2);
@@ -882,19 +882,19 @@ n([
882
882
  o(Number)
883
883
  ], F.prototype, "seq", 2);
884
884
  F = n([
885
- d({ name: "StreamingResponse" })
885
+ y({ name: "StreamingResponse" })
886
886
  ], F);
887
- var mt;
888
- let At = (mt = class {
887
+ var gt;
888
+ let At = (gt = class {
889
889
  constructor() {
890
890
  e(this, "events");
891
891
  }
892
- }, l(mt, "Payload"), mt);
892
+ }, l(gt, "Payload"), gt);
893
893
  n([
894
- St(S)
894
+ Tt(S)
895
895
  ], At.prototype, "events", 2);
896
896
  At = n([
897
- d({ name: "Payload" })
897
+ y({ name: "Payload" })
898
898
  ], At);
899
899
  function Rt(s) {
900
900
  var a;
@@ -986,10 +986,10 @@ const A = class A {
986
986
  return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = m.NotDefined, i.partial = ((p = (a = t.partial) == null ? void 0 : a.toString()) == null ? void 0 : p.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.subAgentId = t.subAgentId, i.subAgentName = t.subAgentName, i;
987
987
  }
988
988
  static getPartType(t) {
989
- return t instanceof ht ? "TextContent" : t instanceof U ? "FunctionCallContent" : t instanceof O ? "FunctionResultContent" : t instanceof w ? "StreamingFunctionCallUpdateContent" : t instanceof b ? "StreamingFinalFunctionCallContent" : t instanceof N ? "StreamingFinalFunctionResultContent" : t instanceof dt ? "FunctionClientOutputContent" : t instanceof z ? "StreamingClientOutputContent" : t instanceof yt ? "UserUiContent" : t instanceof Dt ? "StreamingTextContent" : t instanceof Et ? "StreamingReasoningContent" : t instanceof k ? "ToolEventContent" : t instanceof P ? "StreamingToolEventContent" : "Unknown";
989
+ return t instanceof Ct ? "TextContent" : t instanceof U ? "FunctionCallContent" : t instanceof O ? "FunctionResultContent" : t instanceof w ? "StreamingFunctionCallUpdateContent" : t instanceof b ? "StreamingFinalFunctionCallContent" : t instanceof N ? "StreamingFinalFunctionResultContent" : t instanceof yt ? "FunctionClientOutputContent" : t instanceof z ? "StreamingClientOutputContent" : t instanceof ft ? "UserUiContent" : t instanceof Et ? "StreamingTextContent" : t instanceof Ft ? "StreamingReasoningContent" : t instanceof P ? "ToolEventContent" : t instanceof v ? "StreamingToolEventContent" : "Unknown";
990
990
  }
991
991
  static parseFromTypedEvent(t) {
992
- var p, c, g, J, Ut, bt, Ot;
992
+ var p, c, d, J, Ut, bt, Ot;
993
993
  const i = A.parseFlatPropertiesTypedEvent(t);
994
994
  if (i.serverError)
995
995
  return i.parts.push(Nt.fromError(i.serverError)), i;
@@ -1013,29 +1013,31 @@ const A = class A {
1013
1013
  const T = A.getPartType(f);
1014
1014
  if (T == x.FunctionCallContent || T == x.FunctionResultContent || T == x.StreamingFinalFunctionCallContent || T == x.StreamingFinalFunctionResultContent) {
1015
1015
  var a = f;
1016
- if (a.id == "Server Error")
1016
+ if (a.id == "Server Error") {
1017
+ const g = a.arguments ?? {}, W = typeof g.error == "string" && g.error.trim().length > 0 ? g.error : JSON.stringify(a.arguments);
1017
1018
  u.eventType = m.ServerError, u.errorDetails = {
1018
- errorMessage: JSON.stringify(a.arguments)
1019
+ errorMessage: W,
1020
+ stackTrace: typeof g.stackTrace == "string" ? g.stackTrace : void 0
1019
1021
  }, u.functionDetails = void 0;
1020
- else {
1022
+ } else {
1021
1023
  u.eventType = T == x.FunctionCallContent || T == x.StreamingFinalFunctionCallContent ? m.FunctionCall : m.FunctionResponse;
1022
- let y;
1024
+ let g;
1023
1025
  try {
1024
1026
  if (a != null && a.result)
1025
1027
  if (typeof a.result == "object")
1026
- y = a.result;
1028
+ g = a.result;
1027
1029
  else if (typeof a.result == "string") {
1028
- const Tt = JSON.parse(a.result);
1029
- y = typeof Tt == "object" && Tt !== null ? Tt : a.result;
1030
+ const xt = JSON.parse(a.result);
1031
+ g = typeof xt == "object" && xt !== null ? xt : a.result;
1030
1032
  } else
1031
- y = a.result;
1032
- } catch (Tt) {
1033
- console.warn("Parse function error", Tt), y = a == null ? void 0 : a.result;
1033
+ g = a.result;
1034
+ } catch (xt) {
1035
+ console.warn("Parse function error", xt), g = a == null ? void 0 : a.result;
1034
1036
  }
1035
1037
  u.thoughtDetails = {
1036
1038
  text: ""
1037
1039
  };
1038
- const Ft = Rt(a);
1040
+ const W = Rt(a);
1039
1041
  u.functionDetails = {
1040
1042
  id: (a == null ? void 0 : a.id) ?? "",
1041
1043
  args: a == null ? void 0 : a.arguments,
@@ -1044,16 +1046,16 @@ const A = class A {
1044
1046
  text: JSON.stringify(a == null ? void 0 : a.arguments) ?? "",
1045
1047
  name: (a == null ? void 0 : a.functionName) ?? "",
1046
1048
  status: u.eventType == m.FunctionCall ? "Executing" : "Done",
1047
- response: y,
1048
- isUi: Ft.isUi,
1049
- argsDescription: Ft.argsDescription,
1049
+ response: g,
1050
+ isUi: W.isUi,
1051
+ argsDescription: W.argsDescription,
1050
1052
  // Client-only payload riding the RESULT event: live top-level `clientOutput`, or
1051
1053
  // metadata.clientOutput on the collapsed/persisted result. Calls leave it undefined.
1052
1054
  // The persisted-replay form also folds in via FunctionClientOutputContent.
1053
- clientOutput: (a == null ? void 0 : a.clientOutput) ?? ((g = a == null ? void 0 : a.metadata) == null ? void 0 : g.clientOutput),
1054
- askUserComponent: Ft.askUserComponent,
1055
+ clientOutput: (a == null ? void 0 : a.clientOutput) ?? ((d = a == null ? void 0 : a.metadata) == null ? void 0 : d.clientOutput),
1056
+ askUserComponent: W.askUserComponent,
1055
1057
  // Runtime "don't render" override on a RESULT (CallContext.CancelUiRender).
1056
- cancelUi: Ft.cancelUi
1058
+ cancelUi: W.cancelUi
1057
1059
  }, u.functionDetails.isAskUser = !!u.functionDetails.askUserComponent, t.text = a == null ? void 0 : a.arguments;
1058
1060
  }
1059
1061
  } else if (T == x.StreamingTextContent)
@@ -1069,49 +1071,49 @@ const A = class A {
1069
1071
  }, u.text = (Ot = f == null ? void 0 : f.text) == null ? void 0 : Ot.replaceAll("\\n", `
1070
1072
  `), u.textLastChunk = f.text, t.text = u.text;
1071
1073
  else if (T == x.StreamingFunctionCallUpdateContent) {
1072
- const y = f;
1073
- u.eventType = m.PartialFunctionCall, u.text = y.arguments, u.thoughtDetails = {
1074
+ const g = f;
1075
+ u.eventType = m.PartialFunctionCall, u.text = g.arguments, u.thoughtDetails = {
1074
1076
  text: ""
1075
1077
  }, u.functionDetails = {
1076
- id: y.callId ?? "",
1078
+ id: g.callId ?? "",
1077
1079
  text: u.text,
1078
1080
  status: "Composing",
1079
- name: (y == null ? void 0 : y.name) ?? "Unknown"
1081
+ name: (g == null ? void 0 : g.name) ?? "Unknown"
1080
1082
  }, t.text = u.text;
1081
1083
  } else if (T == x.ToolEventContent || T == x.StreamingToolEventContent) {
1082
1084
  u.eventType = m.ToolEvent;
1083
- const y = f;
1085
+ const g = f;
1084
1086
  u.toolDetails = {
1085
- eventName: y.eventName ?? "",
1086
- eventData: y.eventData ?? "",
1087
- sessionId: y.sessionId ?? void 0
1087
+ eventName: g.eventName ?? "",
1088
+ eventData: g.eventData ?? "",
1089
+ sessionId: g.sessionId ?? void 0
1088
1090
  };
1089
1091
  } else if (T == x.FunctionClientOutputContent) {
1090
- const y = f;
1092
+ const g = f;
1091
1093
  u.eventType = m.FunctionClientOutput, u.functionDetails = {
1092
- id: y.id ?? "",
1094
+ id: g.id ?? "",
1093
1095
  name: "",
1094
1096
  status: "Done",
1095
- clientOutput: y.data
1097
+ clientOutput: g.data
1096
1098
  };
1097
1099
  } else if (T == x.StreamingClientOutputContent) {
1098
- const y = f;
1100
+ const g = f;
1099
1101
  u.eventType = m.FunctionClientOutput, u.functionDetails = {
1100
- id: y.id ?? "",
1102
+ id: g.id ?? "",
1101
1103
  name: "",
1102
1104
  // The parked call stays Executing; interactionService folds only clientOutput onto it and
1103
1105
  // leaves the existing status untouched, so this is just to satisfy the type.
1104
1106
  status: "Executing",
1105
- clientOutput: y.clientOutput,
1107
+ clientOutput: g.clientOutput,
1106
1108
  // The park signal itself (the reason this event fires even with no prefill).
1107
- parked: Rt(y).parked
1109
+ parked: Rt(g).parked
1108
1110
  };
1109
1111
  } else if (T == x.UserUiContent) {
1110
- const y = f;
1112
+ const g = f;
1111
1113
  u.eventType = m.UserAnswer, u.author = "user", u.functionDetails = {
1112
1114
  id: "",
1113
- name: y.name ?? "",
1114
- args: y.args,
1115
+ name: g.name ?? "",
1116
+ args: g.args,
1115
1117
  status: "Done",
1116
1118
  isUi: !0
1117
1119
  };
@@ -1212,22 +1214,22 @@ const A = class A {
1212
1214
  }
1213
1215
  };
1214
1216
  l(A, "ServerEvent");
1215
- let vt = A;
1216
- const kt = [
1217
+ let kt = A;
1218
+ const Pt = [
1217
1219
  // KernelContent derived types
1218
- ht,
1219
1220
  Ct,
1221
+ Dt,
1220
1222
  U,
1221
- k,
1223
+ P,
1222
1224
  O,
1223
- dt,
1224
1225
  yt,
1225
1226
  ft,
1227
+ St,
1226
1228
  // StreamingKernelContent derived types
1227
- Dt,
1228
- w,
1229
1229
  Et,
1230
- P,
1230
+ w,
1231
+ Ft,
1232
+ v,
1231
1233
  b,
1232
1234
  N,
1233
1235
  z,
@@ -1247,18 +1249,18 @@ function _t(s, t) {
1247
1249
  }
1248
1250
  l(_t, "dotnetTypeResolver");
1249
1251
  function Lt() {
1250
- const s = new Pt(S);
1252
+ const s = new vt(S);
1251
1253
  return s.config({
1252
- knownTypes: kt,
1254
+ knownTypes: Pt,
1253
1255
  typeHintEmitter: zt,
1254
1256
  typeResolver: _t
1255
1257
  }), s;
1256
1258
  }
1257
1259
  l(Lt, "createEventSerializer");
1258
1260
  function Ht() {
1259
- const s = new Pt(F);
1261
+ const s = new vt(F);
1260
1262
  return s.config({
1261
- knownTypes: kt,
1263
+ knownTypes: Pt,
1262
1264
  typeHintEmitter: zt,
1263
1265
  typeResolver: _t
1264
1266
  }), s;
@@ -1272,11 +1274,11 @@ function Jt(s) {
1272
1274
  for (let a = 0; a < s.length; a++) {
1273
1275
  const p = s[a], c = p.charCodeAt(0);
1274
1276
  if (p === "\\" && r && a + 1 < s.length) {
1275
- const g = s[a + 1];
1276
- if (g === '"' || g === "\\" || g === "/" || g === "b" || g === "f" || g === "n" || g === "r" || g === "t") {
1277
- i += p + g, a++;
1277
+ const d = s[a + 1];
1278
+ if (d === '"' || d === "\\" || d === "/" || d === "b" || d === "f" || d === "n" || d === "r" || d === "t") {
1279
+ i += p + d, a++;
1278
1280
  continue;
1279
- } else if (g === "u" && a + 5 < s.length) {
1281
+ } else if (d === "u" && a + 5 < s.length) {
1280
1282
  i += s.substring(a, a + 6), a += 5;
1281
1283
  continue;
1282
1284
  } else {
@@ -1285,10 +1287,10 @@ function Jt(s) {
1285
1287
  }
1286
1288
  }
1287
1289
  if (p === '"') {
1288
- let g = 0;
1290
+ let d = 0;
1289
1291
  for (let J = a - 1; J >= 0 && s[J] === "\\"; J--)
1290
- g++;
1291
- g % 2 === 0 && (r = !r), i += p;
1292
+ d++;
1293
+ d % 2 === 0 && (r = !r), i += p;
1292
1294
  continue;
1293
1295
  }
1294
1296
  if (r && c < 32)
@@ -1310,8 +1312,8 @@ function Jt(s) {
1310
1312
  i += "\\b";
1311
1313
  break;
1312
1314
  default:
1313
- const g = c.toString(16).padStart(4, "0");
1314
- i += `\\u${g}`;
1315
+ const d = c.toString(16).padStart(4, "0");
1316
+ i += `\\u${d}`;
1315
1317
  break;
1316
1318
  }
1317
1319
  else
@@ -1336,18 +1338,18 @@ function jt(s) {
1336
1338
  }
1337
1339
  l(jt, "serializeEvent");
1338
1340
  export {
1339
- ft as C,
1341
+ St as C,
1340
1342
  U as F,
1341
1343
  Nt as I,
1342
1344
  S as L,
1343
1345
  x as P,
1344
- vt as S,
1345
- ht as T,
1346
+ kt as S,
1347
+ Ct as T,
1346
1348
  O as a,
1347
1349
  w as b,
1348
- Et as c,
1350
+ Ft as c,
1349
1351
  F as d,
1350
- Dt as e,
1352
+ Et as e,
1351
1353
  Lt as f,
1352
1354
  Ht as g,
1353
1355
  Zt as h,
@@ -1355,4 +1357,4 @@ export {
1355
1357
  jt as j,
1356
1358
  Jt as s
1357
1359
  };
1358
- //# sourceMappingURL=serializer-DNt8QqNO.js.map
1360
+ //# sourceMappingURL=serializer-BXSH9aYQ.js.map