@aintela/chat 0.3.7 → 0.4.0

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,15 +1,15 @@
1
1
  var Gt = Object.defineProperty;
2
- var $t = (s, t, i) => t in s ? Gt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : s[t] = i;
3
- var p = (s, t) => Gt(s, "name", { value: t, configurable: !0 });
4
- var e = (s, t, i) => $t(s, typeof t != "symbol" ? t + "" : t, i);
5
- import It from "@mui/icons-material/Psychology";
2
+ var $t = (s, t, o) => t in s ? Gt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[t] = o;
3
+ var c = (s, t) => Gt(s, "name", { value: t, configurable: !0 });
4
+ var e = (s, t, o) => $t(s, typeof t != "symbol" ? t + "" : t, o);
5
+ import bt from "@mui/icons-material/Psychology";
6
6
  import L from "@mui/icons-material/FlashOn";
7
7
  import At from "@mui/icons-material/RocketLaunch";
8
8
  import Vt from "@mui/icons-material/GeneratingTokensOutlined";
9
- import bt from "@mui/icons-material/SortByAlphaOutlined";
9
+ import It from "@mui/icons-material/SortByAlphaOutlined";
10
10
  import Mt from "@mui/icons-material/AllInclusive";
11
- import { d as vt, A as Qt } from "./environmentUtils-VZNTCzEE.js";
12
- import { jsonMember as o, jsonObject as f, AnyT as q, jsonArrayMember as xt, TypedJSON as zt } from "typedjson";
11
+ import { d as Et, A as Qt } from "./environmentUtils-VZNTCzEE.js";
12
+ import { jsonMember as i, jsonObject as f, AnyT as q, jsonArrayMember as xt, TypedJSON as zt } from "typedjson";
13
13
  const ue = {
14
14
  ChatEvent: "ChatEvent",
15
15
  ChatResponse: "ChatResponse",
@@ -49,7 +49,7 @@ const ue = {
49
49
  NotDefined: "not_defined",
50
50
  Waiting: "waiting",
51
51
  Suspended: "suspended"
52
- }, Zt = /* @__PURE__ */ p((s) => {
52
+ }, Zt = /* @__PURE__ */ c((s) => {
53
53
  switch (s.toLocaleLowerCase()) {
54
54
  case "functioncall":
55
55
  return l.FunctionCall;
@@ -105,34 +105,34 @@ const ue = {
105
105
  Dashboard: "Dashboard",
106
106
  Chart: "Chart",
107
107
  Code: "Code"
108
- }, Et = {
108
+ }, vt = {
109
109
  BI_Envision_Agent: "BI_Envision_Agent",
110
110
  BI_Master_Customer_Agent: "BI_Master_Customer_Agent",
111
111
  BI_Dedicated_Customer_Agent: "BI_Dedicated_Customer_Agent",
112
112
  Unknown: "Unknown"
113
- }, Se = {
113
+ }, Ce = {
114
114
  Interactive: "Interactive",
115
115
  Newsletter: "Newsletter"
116
- }, Ce = {
117
- [Et.BI_Envision_Agent]: {
116
+ }, Se = {
117
+ [vt.BI_Envision_Agent]: {
118
118
  name: "Envision",
119
119
  description: `Analisa dados de vendas globais
120
120
  com insights consolidados de todos os clientes
121
121
  e métricas agregadas do mercado`
122
122
  },
123
- [Et.BI_Master_Customer_Agent]: {
123
+ [vt.BI_Master_Customer_Agent]: {
124
124
  name: "Clientes Master",
125
125
  description: `Visão consolidada de todos os clientes
126
126
  com análises comparativas e benchmarks
127
127
  entre diferentes organizações`
128
128
  },
129
- [Et.BI_Dedicated_Customer_Agent]: {
129
+ [vt.BI_Dedicated_Customer_Agent]: {
130
130
  name: "Cliente Único",
131
131
  description: `Foco em um cliente específico
132
132
  com análises detalhadas e personalizadas
133
133
  para sua organização`
134
134
  },
135
- [Et.Unknown]: {
135
+ [vt.Unknown]: {
136
136
  name: "Não definido",
137
137
  description: "Não definido"
138
138
  }
@@ -141,7 +141,7 @@ para sua organização`
141
141
  BALANCED: "BALANCED",
142
142
  PRO: "PRO",
143
143
  LIVE: "LIVE"
144
- }, S = {
144
+ }, C = {
145
145
  gemini_3_5_flash: "gemini-3.5-flash",
146
146
  gemini_3_1_pro_preview: "gemini-3.1-pro-preview",
147
147
  gemini_3_1_flash_lite_preview: "gemini-3.1-flash-lite-preview",
@@ -166,7 +166,7 @@ para sua organização`
166
166
  uiToolShowcase: "uiToolShowcase",
167
167
  AUTO: "AUTO"
168
168
  }, Te = {
169
- [S.Claude_Opus_4_6]: {
169
+ [C.Claude_Opus_4_6]: {
170
170
  name: "Claude Opus 4.6",
171
171
  description: "Modelo mais avançado da anthropic, no entanto, não tão rápido como o Sonnet",
172
172
  icon: Mt,
@@ -174,7 +174,7 @@ para sua organização`
174
174
  speed: "Moderate",
175
175
  quality: "Highest"
176
176
  },
177
- [S.Claude_Sonnet_4_6]: {
177
+ [C.Claude_Sonnet_4_6]: {
178
178
  name: "Claude Sonnet 4.6",
179
179
  description: "Ótima relação velocidade/qualidade",
180
180
  icon: Mt,
@@ -182,17 +182,17 @@ para sua organização`
182
182
  speed: "Fast",
183
183
  quality: "High"
184
184
  },
185
- [S.gemini_3_1_pro_preview]: {
185
+ [C.gemini_3_1_pro_preview]: {
186
186
  name: "Gemini 3.1 Pro",
187
187
  description: `Modelo mais avançado
188
188
  Melhor qualidade para tarefas complexas
189
189
  Contexto: 2M tokens`,
190
- icon: It,
190
+ icon: bt,
191
191
  contextWindow: "2M tokens",
192
192
  speed: "Moderate",
193
193
  quality: "Highest"
194
194
  },
195
- [S.gemini_3_5_flash]: {
195
+ [C.gemini_3_5_flash]: {
196
196
  name: "Gemini 3.5 Flash",
197
197
  description: `Equilibrio ideal entre velocidade e qualidade
198
198
  Ótimo para a maioria das tarefas
@@ -202,7 +202,7 @@ Contexto: 1M tokens`,
202
202
  speed: "Fast",
203
203
  quality: "High"
204
204
  },
205
- [S.gemini_3_1_flash_lite_preview]: {
205
+ [C.gemini_3_1_flash_lite_preview]: {
206
206
  name: "Gemini 3 Lite Flash",
207
207
  description: `NOVO: Equilibrio ideal entre velocidade e qualidade
208
208
  Ótimo para a maioria das tarefas
@@ -212,7 +212,7 @@ Contexto: 1M tokens`,
212
212
  speed: "Fast",
213
213
  quality: "High"
214
214
  },
215
- [S.Gpt_5_1]: {
215
+ [C.Gpt_5_1]: {
216
216
  name: "Chat GPT 5.1",
217
217
  description: "Chat GPT 5.1",
218
218
  icon: At,
@@ -220,7 +220,7 @@ Contexto: 1M tokens`,
220
220
  speed: "Good",
221
221
  quality: "High"
222
222
  },
223
- [S.Gpt_5_2]: {
223
+ [C.Gpt_5_2]: {
224
224
  name: "Chat GPT 5.2",
225
225
  description: "Chat GPT 5.2",
226
226
  icon: At,
@@ -228,7 +228,7 @@ Contexto: 1M tokens`,
228
228
  speed: "Good",
229
229
  quality: "Highest"
230
230
  },
231
- [S.Gpt_5_5]: {
231
+ [C.Gpt_5_5]: {
232
232
  name: "Chat GPT 5.5",
233
233
  description: "A melhor inteligência em escala para fluxos de trabalho de agentes, codificação e profissionais.",
234
234
  icon: At,
@@ -236,7 +236,7 @@ Contexto: 1M tokens`,
236
236
  speed: "Good",
237
237
  quality: "Highest"
238
238
  },
239
- [S.Gpt_5_4_mini]: {
239
+ [C.Gpt_5_4_mini]: {
240
240
  name: "Chat GPT 5.4 Mini",
241
241
  description: "Modelo compacto mais robusto da OpenAi até momento para codificação, uso de computadores e subagentes.",
242
242
  icon: At,
@@ -244,40 +244,40 @@ Contexto: 1M tokens`,
244
244
  speed: "Fast",
245
245
  quality: "Highest"
246
246
  },
247
- [S["Glm-5_2"]]: {
247
+ [C["Glm-5_2"]]: {
248
248
  name: "Z.ai Glm-5",
249
249
  description: "Modelo open weights bem competente da Z.Ai. Apesar de gerar respostas mais longas o modelo é muito capaz.",
250
- icon: bt,
250
+ icon: It,
251
251
  contextWindow: "200k tokens",
252
252
  speed: "Good",
253
253
  quality: "Highest"
254
254
  },
255
- [S["Glm_4.7"]]: {
255
+ [C["Glm_4.7"]]: {
256
256
  name: "Z.ai Glm-4.7",
257
257
  description: "",
258
- icon: bt,
258
+ icon: It,
259
259
  contextWindow: "200k tokens",
260
260
  speed: "Fast",
261
261
  quality: "High"
262
262
  },
263
- [S["Glm_4.7_flash"]]: {
263
+ [C["Glm_4.7_flash"]]: {
264
264
  name: "Z.ai Glm-4.7",
265
265
  description: "",
266
- icon: bt,
266
+ icon: It,
267
267
  contextWindow: "200k tokens",
268
268
  speed: "Good",
269
269
  quality: "High"
270
270
  },
271
- [S.DeepSeek_v4_Pro]: {
271
+ [C.DeepSeek_v4_Pro]: {
272
272
  name: "DeepSeek Reasoner",
273
273
  description: `Modelo da DeepSeek com modo de raciocínio profundo (thinking mode).
274
274
  Ideal para tarefas complexas que se beneficiam de cadeia de pensamento extensa.`,
275
- icon: It,
275
+ icon: bt,
276
276
  contextWindow: "128k tokens",
277
277
  speed: "Moderate",
278
278
  quality: "Highest"
279
279
  },
280
- [S["DeepSeek_v4-Flash"]]: {
280
+ [C["DeepSeek_v4-Flash"]]: {
281
281
  name: "DeepSeek Chat",
282
282
  description: `Modelo de chat rápido da DeepSeek, sem modo de raciocínio.
283
283
  Ótimo equilíbrio entre velocidade e qualidade para uso geral.`,
@@ -286,16 +286,16 @@ Ideal para tarefas complexas que se beneficiam de cadeia de pensamento extensa.`
286
286
  speed: "Fast",
287
287
  quality: "High"
288
288
  },
289
- [S.Kimi_K26]: {
289
+ [C.Kimi_K26]: {
290
290
  name: "Kimi K2.6 Pro",
291
291
  description: `Modelo híbrido da Moonshot com modo de raciocínio (thinking) ativado por padrão.
292
292
  Melhor capacidade da família K2 para tarefas complexas.`,
293
- icon: It,
293
+ icon: bt,
294
294
  contextWindow: "256k tokens",
295
295
  speed: "Moderate",
296
296
  quality: "Highest"
297
297
  },
298
- [S.Kimi_Turbo]: {
298
+ [C.Kimi_Turbo]: {
299
299
  name: "Kimi K2 Turbo",
300
300
  description: `Variante rápida (não-thinking) da Moonshot.
301
301
  Ótima relação velocidade/qualidade para uso geral.`,
@@ -304,7 +304,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
304
304
  speed: "Fast",
305
305
  quality: "High"
306
306
  },
307
- [S["Qwen3_6-plus"]]: {
307
+ [C["Qwen3_6-plus"]]: {
308
308
  name: "Qwen 3.6 Plus - Alibaba",
309
309
  description: "Multimodal nativo, context window - 1 milhão de tokens, codificação agentiva",
310
310
  icon: L,
@@ -312,7 +312,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
312
312
  speed: "Moderate",
313
313
  quality: "Highest"
314
314
  },
315
- [S["Qwen3_7-max"]]: {
315
+ [C["Qwen3_7-max"]]: {
316
316
  name: "Qwen 3.7 Max - Alibaba",
317
317
  description: "Multimodal nativo, context window - 1 milhão de tokens, codificação agentiva",
318
318
  icon: L,
@@ -320,7 +320,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
320
320
  speed: "Moderate",
321
321
  quality: "Highest"
322
322
  },
323
- [S.uiToolShowcase]: {
323
+ [C.uiToolShowcase]: {
324
324
  name: "UiToolShowcase - Testing",
325
325
  description: "Cria um stream de testes.",
326
326
  icon: Vt,
@@ -334,8 +334,8 @@ function De(s) {
334
334
  const t = s.toLowerCase();
335
335
  return t.startsWith("gemini") || t.startsWith("live") ? "Google" : t.startsWith("claude") ? "Anthropic" : t.startsWith("gpt") ? "OpenAI" : t.startsWith("glm") ? "ZhiPu" : t.startsWith("kimi") ? "Moonshot" : t.startsWith("deepseek") ? "DeepSeek" : "Unknown";
336
336
  }
337
- p(De, "getModelVendor");
338
- const _e = /* @__PURE__ */ p((s, t) => {
337
+ c(De, "getModelVendor");
338
+ const _e = /* @__PURE__ */ c((s, t) => {
339
339
  switch (s) {
340
340
  case "Connected":
341
341
  return t.palette.primary.light;
@@ -352,14 +352,14 @@ const _e = /* @__PURE__ */ p((s, t) => {
352
352
  }
353
353
  }, "getConnectionStateColor"), U = class U {
354
354
  static replaceFirstTwoTabsPerLine(t) {
355
- const i = /^\s{15}/gm;
356
- return typeof t == "string" ? t.replaceAll(i, (a) => a.substring(15)) : t ?? "";
355
+ const o = /^\s{15}/gm;
356
+ return typeof t == "string" ? t.replaceAll(o, (a) => a.substring(15)) : t ?? "";
357
357
  }
358
358
  static jsonToString(t) {
359
359
  if (t == null) return "";
360
360
  if (typeof t != "object") return String(t);
361
- const i = Array.isArray(t) ? U.isCharArray(t) ? t.join("") : null : U.tryCollapseCharIndexedObject(t);
362
- if (i != null) return i;
361
+ const o = Array.isArray(t) ? U.isCharArray(t) ? t.join("") : null : U.tryCollapseCharIndexedObject(t);
362
+ if (o != null) return o;
363
363
  if (Array.isArray(t))
364
364
  try {
365
365
  return JSON.stringify(t, null, 2);
@@ -367,13 +367,13 @@ const _e = /* @__PURE__ */ p((s, t) => {
367
367
  return String(t);
368
368
  }
369
369
  const a = Object.keys(t), r = [];
370
- return a.forEach((c) => {
371
- let d = t[c];
372
- typeof d == "object" && (d = JSON.stringify(t[c], null, 2));
370
+ return a.forEach((p) => {
371
+ let d = t[p];
372
+ typeof d == "object" && (d = JSON.stringify(t[p], null, 2));
373
373
  const g = (d == null ? void 0 : d.toString().indexOf(`
374
374
  `)) > -1 ? `
375
375
  ` : "";
376
- r.push(`${c}:${g}${d}`);
376
+ r.push(`${p}:${g}${d}`);
377
377
  }), r.join(`
378
378
  `);
379
379
  }
@@ -394,14 +394,14 @@ const _e = /* @__PURE__ */ p((s, t) => {
394
394
  } catch {
395
395
  return String(t);
396
396
  }
397
- const i = Object.keys(t), a = [];
398
- return i.forEach((r) => {
399
- let c = t == null ? void 0 : t[r];
400
- typeof c == "object" && (c = JSON.stringify(c, null, 2));
401
- const d = (c == null ? void 0 : c.toString().indexOf(`
397
+ const o = Object.keys(t), a = [];
398
+ return o.forEach((r) => {
399
+ let p = t == null ? void 0 : t[r];
400
+ typeof p == "object" && (p = JSON.stringify(p, null, 2));
401
+ const d = (p == null ? void 0 : p.toString().indexOf(`
402
402
  `)) > -1 ? `
403
403
  ` : "";
404
- a.push(`${r}:${d}${c}`);
404
+ a.push(`${r}:${d}${p}`);
405
405
  }), a.join(`
406
406
  `);
407
407
  }
@@ -413,16 +413,16 @@ const _e = /* @__PURE__ */ p((s, t) => {
413
413
  * before reading the field. Returns undefined when absent or unparseable.
414
414
  */
415
415
  static uiSlotId(t) {
416
- var c;
417
- let i = (c = t == null ? void 0 : t.functionDetails) == null ? void 0 : c.response;
418
- for (let d = 0; d < 2 && typeof i == "string"; d++)
416
+ var p;
417
+ let o = (p = t == null ? void 0 : t.functionDetails) == null ? void 0 : p.response;
418
+ for (let d = 0; d < 2 && typeof o == "string"; d++)
419
419
  try {
420
- i = JSON.parse(i);
420
+ o = JSON.parse(o);
421
421
  } catch {
422
422
  return;
423
423
  }
424
- if (!i || typeof i != "object") return;
425
- const a = i, r = a.SlotId ?? a.slotId;
424
+ if (!o || typeof o != "object") return;
425
+ const a = o, r = a.SlotId ?? a.slotId;
426
426
  return typeof r == "string" ? r : void 0;
427
427
  }
428
428
  static fromError(t) {
@@ -438,13 +438,13 @@ const _e = /* @__PURE__ */ p((s, t) => {
438
438
  textAppendable: !1
439
439
  };
440
440
  }
441
- static fromText(t, i, a) {
441
+ static fromText(t, o, a) {
442
442
  return {
443
443
  text: t,
444
444
  eventType: l.Text,
445
- id: a ?? vt(),
445
+ id: a ?? Et(),
446
446
  created: /* @__PURE__ */ new Date(),
447
- author: i ?? "main",
447
+ author: o ?? "main",
448
448
  partial: !1,
449
449
  isStillWriting: !1,
450
450
  mustPush: !1,
@@ -457,9 +457,9 @@ const _e = /* @__PURE__ */ p((s, t) => {
457
457
  * and replayed parts are identical: an `EventType.UserAnswer` carrying functionDetails
458
458
  * {name, args, isUi, status:'Done'} that routes through the uiTool dispatcher/registry.
459
459
  */
460
- static fromUserUi(t, i, a) {
460
+ static fromUserUi(t, o, a) {
461
461
  return {
462
- id: a ?? vt(),
462
+ id: a ?? Et(),
463
463
  eventType: l.UserAnswer,
464
464
  author: "user",
465
465
  created: /* @__PURE__ */ new Date(),
@@ -470,21 +470,21 @@ const _e = /* @__PURE__ */ p((s, t) => {
470
470
  functionDetails: {
471
471
  id: "",
472
472
  name: t,
473
- args: i,
473
+ args: o,
474
474
  status: "Done",
475
475
  isUi: !0
476
476
  }
477
477
  };
478
478
  }
479
- static createWaiting(t = !1, i = !0, a, r, c) {
479
+ static createWaiting(t = !1, o = !0, a, r, p) {
480
480
  a || (a = "Waiting");
481
481
  const d = U.fromText("...", void 0, "waitingpart");
482
482
  return d.eventType = l.Waiting, d.waitingDetails = {
483
483
  startingPoint: r,
484
484
  addTimer: t,
485
- isTimerRunning: i,
485
+ isTimerRunning: o,
486
486
  status: a,
487
- stopPoint: c
487
+ stopPoint: p
488
488
  }, d;
489
489
  }
490
490
  static createSuspended() {
@@ -497,19 +497,19 @@ const _e = /* @__PURE__ */ p((s, t) => {
497
497
  static FlatParts(t) {
498
498
  if (t.length === 0)
499
499
  return;
500
- const i = t.filter((c) => c.eventType == l.Text), a = i.length > 0 ? i[0] : t[0], r = [...new Set(t.map((c) => c.eventType))];
501
- r.length == 1 ? a.eventType = r[0] : i.length > 0 && (a.eventType = l.Text), a.mustPush = !(a.eventType == l.Text || a.eventType == l.Thought || a.eventType == l.NotDefined || a.eventType == l.PartialFunctionCall), a.textAppendable = a.eventType == l.Text || a.eventType == l.Thought || a.eventType == l.PartialFunctionCall;
502
- for (const c of t) {
503
- if (!a.codeExecutionResultDetails && c.codeExecutionResultDetails && (a.codeExecutionResultDetails = c.codeExecutionResultDetails), !a.errorDetails && c.errorDetails && (a.errorDetails = c.errorDetails), !a.executableCodeDetails && c.executableCodeDetails && (a.executableCodeDetails = c.executableCodeDetails), !a.functionDetails && c.functionDetails && (a.functionDetails = c.functionDetails), a.functionDetails && c.functionDetails && c !== a) {
504
- const d = a.functionDetails, g = c.functionDetails;
500
+ const o = t.filter((p) => p.eventType == l.Text), a = o.length > 0 ? o[0] : t[0], r = [...new Set(t.map((p) => p.eventType))];
501
+ r.length == 1 ? a.eventType = r[0] : o.length > 0 && (a.eventType = l.Text), a.mustPush = !(a.eventType == l.Text || a.eventType == l.Thought || a.eventType == l.NotDefined || a.eventType == l.PartialFunctionCall), a.textAppendable = a.eventType == l.Text || a.eventType == l.Thought || a.eventType == l.PartialFunctionCall;
502
+ for (const p of t) {
503
+ if (!a.codeExecutionResultDetails && p.codeExecutionResultDetails && (a.codeExecutionResultDetails = p.codeExecutionResultDetails), !a.errorDetails && p.errorDetails && (a.errorDetails = p.errorDetails), !a.executableCodeDetails && p.executableCodeDetails && (a.executableCodeDetails = p.executableCodeDetails), !a.functionDetails && p.functionDetails && (a.functionDetails = p.functionDetails), a.functionDetails && p.functionDetails && p !== a) {
504
+ const d = a.functionDetails, g = p.functionDetails;
505
505
  !d.askUserComponent && g.askUserComponent && (d.askUserComponent = g.askUserComponent), !d.isUi && g.isUi && (d.isUi = !0), !d.clientOutput && g.clientOutput && (d.clientOutput = g.clientOutput), d.isAskUser = d.isAskUser || g.isAskUser || !!d.askUserComponent;
506
506
  }
507
- !a.rawDetails && c.rawDetails && (a.rawDetails = c.rawDetails), !a.thoughtDetails && c.thoughtDetails && (a.thoughtDetails = c.thoughtDetails), !a.errorDetails && c.errorDetails && (a.errorDetails = c.errorDetails);
507
+ !a.rawDetails && p.rawDetails && (a.rawDetails = p.rawDetails), !a.thoughtDetails && p.thoughtDetails && (a.thoughtDetails = p.thoughtDetails), !a.errorDetails && p.errorDetails && (a.errorDetails = p.errorDetails);
508
508
  }
509
509
  return a;
510
510
  }
511
511
  static isCharArray(t) {
512
- return Array.isArray(t) && t.length > 0 && t.every((i) => typeof i == "string" && i.length === 1);
512
+ return Array.isArray(t) && t.length > 0 && t.every((o) => typeof o == "string" && o.length === 1);
513
513
  }
514
514
  /**
515
515
  * Detects objects like `{0: "a", 1: "b", 2: "c", ...}` — a string that was
@@ -519,25 +519,25 @@ const _e = /* @__PURE__ */ p((s, t) => {
519
519
  */
520
520
  static tryCollapseCharIndexedObject(t) {
521
521
  if (t == null || typeof t != "object" || Array.isArray(t)) return null;
522
- const i = Object.keys(t);
523
- if (i.length === 0) return null;
524
- for (let a = 0; a < i.length; a++) {
525
- if (i[a] !== String(a)) return null;
526
- const r = t[i[a]];
522
+ const o = Object.keys(t);
523
+ if (o.length === 0) return null;
524
+ for (let a = 0; a < o.length; a++) {
525
+ if (o[a] !== String(a)) return null;
526
+ const r = t[o[a]];
527
527
  if (typeof r != "string" || r.length !== 1) return null;
528
528
  }
529
- return i.map((a) => t[a]).join("");
529
+ return o.map((a) => t[a]).join("");
530
530
  }
531
531
  static isCodeExecution(t) {
532
532
  return t.eventType === l.CodeExecutionResult || t.eventType === l.ExecutableCode;
533
533
  }
534
534
  };
535
- p(U, "InteractionPartUtils");
535
+ c(U, "InteractionPartUtils");
536
536
  let Nt = U;
537
- var Yt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ p((s, t, i, a) => {
538
- for (var r = a > 1 ? void 0 : a ? Xt(t, i) : t, c = s.length - 1, d; c >= 0; c--)
539
- (d = s[c]) && (r = (a ? d(t, i, r) : d(r)) || r);
540
- return a && r && Yt(t, i, r), r;
537
+ var Yt = Object.defineProperty, Xt = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ c((s, t, o, a) => {
538
+ for (var r = a > 1 ? void 0 : a ? Xt(t, o) : t, p = s.length - 1, d; p >= 0; p--)
539
+ (d = s[p]) && (r = (a ? d(t, o, r) : d(r)) || r);
540
+ return a && r && Yt(t, o, r), r;
541
541
  }, "__decorateClass");
542
542
  const x = {
543
543
  // KernelContent derived types
@@ -561,9 +561,9 @@ let Dt = (H = class {
561
561
  constructor() {
562
562
  e(this, "label");
563
563
  }
564
- }, p(H, "AuthorRole"), H);
564
+ }, c(H, "AuthorRole"), H);
565
565
  n([
566
- o(String)
566
+ i(String)
567
567
  ], Dt.prototype, "label", 2);
568
568
  Dt = n([
569
569
  f({ name: "AuthorRole" })
@@ -574,12 +574,12 @@ let yt = (B = class {
574
574
  e(this, "type");
575
575
  e(this, "fullName");
576
576
  }
577
- }, p(B, "EventTypeInformation"), B);
577
+ }, c(B, "EventTypeInformation"), B);
578
578
  n([
579
- o(String)
579
+ i(String)
580
580
  ], yt.prototype, "type", 2);
581
581
  n([
582
- o(String)
582
+ i(String)
583
583
  ], yt.prototype, "fullName", 2);
584
584
  yt = n([
585
585
  f({ name: "EventTypeInformation" })
@@ -602,24 +602,24 @@ let O = (K = class {
602
602
  id: this.id
603
603
  };
604
604
  }
605
- }, p(K, "LlmArtifact"), K);
605
+ }, c(K, "LlmArtifact"), K);
606
606
  n([
607
- o(String)
607
+ i(String)
608
608
  ], O.prototype, "id", 2);
609
609
  n([
610
- o(String)
610
+ i(String)
611
611
  ], O.prototype, "name", 2);
612
612
  n([
613
- o(String)
613
+ i(String)
614
614
  ], O.prototype, "mimeType", 2);
615
615
  n([
616
- o(String)
616
+ i(String)
617
617
  ], O.prototype, "description", 2);
618
618
  O = n([
619
619
  f({ name: "LlmArtifact" })
620
620
  ], O);
621
621
  var J;
622
- let T = (J = class {
622
+ let D = (J = class {
623
623
  constructor() {
624
624
  e(this, "mimeType");
625
625
  // InnerContent is ignored (JsonIgnore in C#)
@@ -628,21 +628,21 @@ let T = (J = class {
628
628
  e(this, "modelId");
629
629
  e(this, "metadata");
630
630
  }
631
- }, p(J, "KernelContent"), J);
631
+ }, c(J, "KernelContent"), J);
632
632
  n([
633
- o(String)
634
- ], T.prototype, "mimeType", 2);
633
+ i(String)
634
+ ], D.prototype, "mimeType", 2);
635
635
  n([
636
- o(String)
637
- ], T.prototype, "modelId", 2);
636
+ i(String)
637
+ ], D.prototype, "modelId", 2);
638
638
  n([
639
- o(q)
640
- ], T.prototype, "metadata", 2);
641
- T = n([
639
+ i(q)
640
+ ], D.prototype, "metadata", 2);
641
+ D = n([
642
642
  f({ name: "KernelContent" })
643
- ], T);
643
+ ], D);
644
644
  var $;
645
- let D = ($ = class {
645
+ let _ = ($ = class {
646
646
  constructor() {
647
647
  e(this, "choiceIndex", 0);
648
648
  // InnerContent is ignored (JsonIgnore in C#)
@@ -651,21 +651,21 @@ let D = ($ = class {
651
651
  e(this, "modelId");
652
652
  e(this, "metadata");
653
653
  }
654
- }, p($, "StreamingKernelContent"), $);
654
+ }, c($, "StreamingKernelContent"), $);
655
655
  n([
656
- o(Number)
657
- ], D.prototype, "choiceIndex", 2);
656
+ i(Number)
657
+ ], _.prototype, "choiceIndex", 2);
658
658
  n([
659
- o(String)
660
- ], D.prototype, "modelId", 2);
659
+ i(String)
660
+ ], _.prototype, "modelId", 2);
661
661
  n([
662
- o(Object)
663
- ], D.prototype, "metadata", 2);
664
- D = n([
662
+ i(Object)
663
+ ], _.prototype, "metadata", 2);
664
+ _ = n([
665
665
  f({ name: "StreamingKernelContent" })
666
- ], D);
666
+ ], _);
667
667
  var V;
668
- let _t = (V = class extends T {
668
+ let _t = (V = class extends D {
669
669
  constructor() {
670
670
  super();
671
671
  e(this, "text");
@@ -677,74 +677,74 @@ let _t = (V = class extends T {
677
677
  toString() {
678
678
  return this.text ?? "";
679
679
  }
680
- }, p(V, "TextContent"), V);
680
+ }, c(V, "TextContent"), V);
681
681
  n([
682
- o(String)
682
+ i(String)
683
683
  ], _t.prototype, "text", 2);
684
684
  _t = n([
685
685
  f({ name: "TextContent" })
686
686
  ], _t);
687
687
  var Q;
688
- let P = (Q = class extends D {
688
+ let R = (Q = class extends _ {
689
689
  constructor() {
690
690
  super();
691
691
  e(this, "eventName");
692
692
  e(this, "eventData");
693
693
  e(this, "sessionId");
694
694
  }
695
- }, p(Q, "StreamingToolEventContent"), Q);
695
+ }, c(Q, "StreamingToolEventContent"), Q);
696
696
  n([
697
- o(String)
698
- ], P.prototype, "eventName", 2);
697
+ i(String)
698
+ ], R.prototype, "eventName", 2);
699
699
  n([
700
- o(String)
701
- ], P.prototype, "eventData", 2);
700
+ i(String)
701
+ ], R.prototype, "eventData", 2);
702
702
  n([
703
- o(String)
704
- ], P.prototype, "sessionId", 2);
705
- P = n([
703
+ i(String)
704
+ ], R.prototype, "sessionId", 2);
705
+ R = n([
706
706
  f({ name: "StreamingToolEventContent" })
707
- ], P);
707
+ ], R);
708
708
  var Z;
709
- let R = (Z = class extends T {
709
+ let P = (Z = class extends D {
710
710
  constructor() {
711
711
  super();
712
712
  e(this, "eventName");
713
713
  e(this, "eventData");
714
714
  e(this, "sessionId");
715
715
  }
716
- }, p(Z, "ToolEventContent"), Z);
716
+ }, c(Z, "ToolEventContent"), Z);
717
717
  n([
718
- o(String)
719
- ], R.prototype, "eventName", 2);
718
+ i(String)
719
+ ], P.prototype, "eventName", 2);
720
720
  n([
721
- o(String)
722
- ], R.prototype, "eventData", 2);
721
+ i(String)
722
+ ], P.prototype, "eventData", 2);
723
723
  n([
724
- o(String)
725
- ], R.prototype, "sessionId", 2);
726
- R = n([
724
+ i(String)
725
+ ], P.prototype, "sessionId", 2);
726
+ P = n([
727
727
  f({ name: "ToolEventContent" })
728
- ], R);
728
+ ], P);
729
729
  var Y;
730
- let wt = (Y = class extends T {
730
+ let wt = (Y = class extends D {
731
731
  constructor() {
732
732
  super(...arguments);
733
733
  e(this, "url");
734
734
  e(this, "dataUri");
735
735
  }
736
- }, p(Y, "ImageContent"), Y);
736
+ }, c(Y, "ImageContent"), Y);
737
737
  n([
738
- o(String)
738
+ i(String)
739
739
  ], wt.prototype, "url", 2);
740
740
  n([
741
- o(String)
741
+ i(String)
742
742
  ], wt.prototype, "dataUri", 2);
743
743
  wt = n([
744
744
  f({ name: "ImageContent" })
745
745
  ], wt);
746
746
  var X;
747
- let v = (X = class extends T {
747
+ let E = (X = class extends D {
748
748
  constructor() {
749
749
  super(...arguments);
750
750
  e(this, "id");
@@ -754,22 +754,22 @@ let v = (X = class extends T {
754
754
  // Exception is not serializable - omit jsonMember decorator
755
755
  e(this, "exception");
756
756
  }
757
- }, p(X, "FunctionCallContent"), X);
757
+ }, c(X, "FunctionCallContent"), X);
758
758
  n([
759
- o(String)
760
- ], v.prototype, "id", 2);
759
+ i(String)
760
+ ], E.prototype, "id", 2);
761
761
  n([
762
- o(String)
763
- ], v.prototype, "pluginName", 2);
762
+ i(String)
763
+ ], E.prototype, "pluginName", 2);
764
764
  n([
765
- o(String)
766
- ], v.prototype, "functionName", 2);
765
+ i(String)
766
+ ], E.prototype, "functionName", 2);
767
767
  n([
768
- o(q)
769
- ], v.prototype, "arguments", 2);
770
- v = n([
768
+ i(q)
769
+ ], E.prototype, "arguments", 2);
770
+ E = n([
771
771
  f({ name: "FunctionCallContent" })
772
- ], v);
772
+ ], E);
773
773
  var j;
774
774
  let F = (j = class {
775
775
  constructor() {
@@ -779,28 +779,28 @@ let F = (j = class {
779
779
  e(this, "cancelUi");
780
780
  e(this, "parked");
781
781
  }
782
- }, p(j, "ToolCallPresentation"), j);
782
+ }, c(j, "ToolCallPresentation"), j);
783
783
  n([
784
- o(Boolean)
784
+ i(Boolean)
785
785
  ], F.prototype, "isUi", 2);
786
786
  n([
787
- o(String)
787
+ i(String)
788
788
  ], F.prototype, "askUserComponent", 2);
789
789
  n([
790
- o(String)
790
+ i(String)
791
791
  ], F.prototype, "argsDescription", 2);
792
792
  n([
793
- o(Boolean)
793
+ i(Boolean)
794
794
  ], F.prototype, "cancelUi", 2);
795
795
  n([
796
- o(Boolean)
796
+ i(Boolean)
797
797
  ], F.prototype, "parked", 2);
798
798
  F = n([
799
799
  f({ name: "ToolCallPresentation" })
800
800
  ], F);
801
801
  const jt = "aia:presentation";
802
802
  var tt;
803
- let I = (tt = class extends D {
803
+ let b = (tt = class extends _ {
804
804
  constructor() {
805
805
  super(...arguments);
806
806
  e(this, "id");
@@ -808,24 +808,24 @@ let I = (tt = class extends D {
808
808
  e(this, "arguments");
809
809
  e(this, "presentation");
810
810
  }
811
- }, p(tt, "StreamingFinalFunctionCallContent"), tt);
811
+ }, c(tt, "StreamingFinalFunctionCallContent"), tt);
812
812
  n([
813
- o(String, { name: "callId" })
814
- ], I.prototype, "id", 2);
813
+ i(String, { name: "callId" })
814
+ ], b.prototype, "id", 2);
815
815
  n([
816
- o(String, { name: "name" })
817
- ], I.prototype, "functionName", 2);
816
+ i(String, { name: "name" })
817
+ ], b.prototype, "functionName", 2);
818
818
  n([
819
- o(String)
820
- ], I.prototype, "arguments", 2);
819
+ i(String)
820
+ ], b.prototype, "arguments", 2);
821
821
  n([
822
- o(F)
823
- ], I.prototype, "presentation", 2);
824
- I = n([
822
+ i(F)
823
+ ], b.prototype, "presentation", 2);
824
+ b = n([
825
825
  f({ name: "StreamingFinalFunctionCallContent" })
826
- ], I);
826
+ ], b);
827
827
  var et;
828
- let b = (et = class extends T {
828
+ let I = (et = class extends D {
829
829
  constructor() {
830
830
  super(...arguments);
831
831
  e(this, "id");
@@ -833,24 +833,24 @@ let b = (et = class extends T {
833
833
  e(this, "functionName");
834
834
  e(this, "result");
835
835
  }
836
- }, p(et, "FunctionResultContent"), et);
836
+ }, c(et, "FunctionResultContent"), et);
837
837
  n([
838
- o(String, { name: "callId" })
839
- ], b.prototype, "id", 2);
838
+ i(String, { name: "callId" })
839
+ ], I.prototype, "id", 2);
840
840
  n([
841
- o(String)
842
- ], b.prototype, "pluginName", 2);
841
+ i(String)
842
+ ], I.prototype, "pluginName", 2);
843
843
  n([
844
- o(String)
845
- ], b.prototype, "functionName", 2);
844
+ i(String)
845
+ ], I.prototype, "functionName", 2);
846
846
  n([
847
- o(q)
848
- ], b.prototype, "result", 2);
849
- b = n([
847
+ i(q)
848
+ ], I.prototype, "result", 2);
849
+ I = n([
850
850
  f({ name: "FunctionResultContent" })
851
- ], b);
851
+ ], I);
852
852
  var nt;
853
- let A = (nt = class extends D {
853
+ let A = (nt = class extends _ {
854
854
  constructor() {
855
855
  super(...arguments);
856
856
  e(this, "id");
@@ -860,102 +860,102 @@ let A = (nt = class extends D {
860
860
  e(this, "presentation");
861
861
  e(this, "clientOutput");
862
862
  }
863
- }, p(nt, "StreamingFinalFunctionResultContent"), nt);
863
+ }, c(nt, "StreamingFinalFunctionResultContent"), nt);
864
864
  n([
865
- o(String, { name: "callId" })
865
+ i(String, { name: "callId" })
866
866
  ], A.prototype, "id", 2);
867
867
  n([
868
- o(String)
868
+ i(String)
869
869
  ], A.prototype, "pluginName", 2);
870
870
  n([
871
- o(String)
871
+ i(String)
872
872
  ], A.prototype, "functionName", 2);
873
873
  n([
874
- o(q)
874
+ i(q)
875
875
  ], A.prototype, "result", 2);
876
876
  n([
877
- o(F)
877
+ i(F)
878
878
  ], A.prototype, "presentation", 2);
879
879
  n([
880
- o(q)
880
+ i(q)
881
881
  ], A.prototype, "clientOutput", 2);
882
882
  A = n([
883
883
  f({ name: "StreamingFinalFunctionResultContent" })
884
884
  ], A);
885
- var it;
886
- let ht = (it = class extends T {
885
+ var ot;
886
+ let ht = (ot = class extends D {
887
887
  constructor() {
888
888
  super(...arguments);
889
889
  e(this, "id");
890
890
  e(this, "data");
891
891
  }
892
- }, p(it, "FunctionClientOutputContent"), it);
892
+ }, c(ot, "FunctionClientOutputContent"), ot);
893
893
  n([
894
- o(String, { name: "callId" })
894
+ i(String, { name: "callId" })
895
895
  ], ht.prototype, "id", 2);
896
896
  n([
897
- o(q)
897
+ i(q)
898
898
  ], ht.prototype, "data", 2);
899
899
  ht = n([
900
900
  f({ name: "FunctionClientOutputContent" })
901
901
  ], ht);
902
- var ot;
903
- let G = (ot = class extends D {
902
+ var it;
903
+ let G = (it = class extends _ {
904
904
  constructor() {
905
905
  super(...arguments);
906
906
  e(this, "id");
907
907
  e(this, "clientOutput");
908
908
  e(this, "presentation");
909
909
  }
910
- }, p(ot, "StreamingClientOutputContent"), ot);
910
+ }, c(it, "StreamingClientOutputContent"), it);
911
911
  n([
912
- o(String, { name: "callId" })
912
+ i(String, { name: "callId" })
913
913
  ], G.prototype, "id", 2);
914
914
  n([
915
- o(q)
915
+ i(q)
916
916
  ], G.prototype, "clientOutput", 2);
917
917
  n([
918
- o(F)
918
+ i(F)
919
919
  ], G.prototype, "presentation", 2);
920
920
  G = n([
921
921
  f({ name: "StreamingClientOutputContent" })
922
922
  ], G);
923
923
  var at;
924
- let St = (at = class extends T {
924
+ let Ct = (at = class extends D {
925
925
  constructor() {
926
926
  super(...arguments);
927
927
  e(this, "name");
928
928
  e(this, "args");
929
929
  }
930
- }, p(at, "UserUiContent"), at);
930
+ }, c(at, "UserUiContent"), at);
931
931
  n([
932
- o(String)
933
- ], St.prototype, "name", 2);
932
+ i(String)
933
+ ], Ct.prototype, "name", 2);
934
934
  n([
935
- o(String)
936
- ], St.prototype, "args", 2);
937
- St = n([
935
+ i(String)
936
+ ], Ct.prototype, "args", 2);
937
+ Ct = n([
938
938
  f({ name: "UserUiContent" })
939
- ], St);
939
+ ], Ct);
940
940
  var rt;
941
- let Ct = (rt = class extends T {
941
+ let St = (rt = class extends D {
942
942
  constructor() {
943
943
  super(...arguments);
944
944
  e(this, "role");
945
945
  e(this, "items");
946
946
  }
947
- }, p(rt, "ChatMessageContent"), rt);
947
+ }, c(rt, "ChatMessageContent"), rt);
948
948
  n([
949
- o(Dt)
950
- ], Ct.prototype, "role", 2);
949
+ i(Dt)
950
+ ], St.prototype, "role", 2);
951
951
  n([
952
- xt(() => T)
953
- ], Ct.prototype, "items", 2);
954
- Ct = n([
952
+ xt(() => D)
953
+ ], St.prototype, "items", 2);
954
+ St = n([
955
955
  f({ name: "ChatMessageContent" })
956
- ], Ct);
956
+ ], St);
957
957
  var st;
958
- let N = (st = class extends D {
958
+ let N = (st = class extends _ {
959
959
  constructor() {
960
960
  super(...arguments);
961
961
  e(this, "callId");
@@ -963,24 +963,24 @@ let N = (st = class extends D {
963
963
  e(this, "arguments");
964
964
  e(this, "functionCallIndex", 0);
965
965
  }
966
- }, p(st, "StreamingFunctionCallUpdateContent"), st);
966
+ }, c(st, "StreamingFunctionCallUpdateContent"), st);
967
967
  n([
968
- o(String)
968
+ i(String)
969
969
  ], N.prototype, "callId", 2);
970
970
  n([
971
- o(String)
971
+ i(String)
972
972
  ], N.prototype, "name", 2);
973
973
  n([
974
- o(String)
974
+ i(String)
975
975
  ], N.prototype, "arguments", 2);
976
976
  n([
977
- o(Number)
977
+ i(Number)
978
978
  ], N.prototype, "functionCallIndex", 2);
979
979
  N = n([
980
980
  f({ name: "StreamingFunctionCallUpdateContent" })
981
981
  ], N);
982
982
  var lt;
983
- let kt = (lt = class extends D {
983
+ let kt = (lt = class extends _ {
984
984
  constructor() {
985
985
  super(...arguments);
986
986
  e(this, "text");
@@ -988,15 +988,15 @@ let kt = (lt = class extends D {
988
988
  // Not decorated with @jsonMember
989
989
  e(this, "encoding");
990
990
  }
991
- }, p(lt, "StreamingTextContent"), lt);
991
+ }, c(lt, "StreamingTextContent"), lt);
992
992
  n([
993
- o(String)
993
+ i(String)
994
994
  ], kt.prototype, "text", 2);
995
995
  kt = n([
996
996
  f({ name: "StreamingTextContent" })
997
997
  ], kt);
998
- var ct;
999
- let Ft = (ct = class extends D {
998
+ var pt;
999
+ let Ft = (pt = class extends _ {
1000
1000
  constructor() {
1001
1001
  super(...arguments);
1002
1002
  e(this, "text");
@@ -1004,35 +1004,35 @@ let Ft = (ct = class extends D {
1004
1004
  // Not decorated with @jsonMember
1005
1005
  e(this, "encoding");
1006
1006
  }
1007
- }, p(ct, "StreamingReasoningContent"), ct);
1007
+ }, c(pt, "StreamingReasoningContent"), pt);
1008
1008
  n([
1009
- o(String)
1009
+ i(String)
1010
1010
  ], Ft.prototype, "text", 2);
1011
1011
  Ft = n([
1012
1012
  f({ name: "StreamingReasoningContent" })
1013
1013
  ], Ft);
1014
- var pt;
1015
- let M = (pt = class {
1014
+ var ct;
1015
+ let M = (ct = class {
1016
1016
  constructor() {
1017
1017
  e(this, "instructionCategory", "");
1018
1018
  e(this, "description", "");
1019
1019
  e(this, "interactionId", "");
1020
1020
  }
1021
- }, p(pt, "InstructionSummary"), pt);
1021
+ }, c(ct, "InstructionSummary"), ct);
1022
1022
  n([
1023
- o(String)
1023
+ i(String)
1024
1024
  ], M.prototype, "instructionCategory", 2);
1025
1025
  n([
1026
- o(String)
1026
+ i(String)
1027
1027
  ], M.prototype, "description", 2);
1028
1028
  n([
1029
- o(String)
1029
+ i(String)
1030
1030
  ], M.prototype, "interactionId", 2);
1031
1031
  M = n([
1032
1032
  f({ name: "InstructionSummary" })
1033
1033
  ], M);
1034
1034
  var ut;
1035
- let w = (ut = class {
1035
+ let T = (ut = class {
1036
1036
  constructor() {
1037
1037
  e(this, "size", 0);
1038
1038
  e(this, "originalSize", 0);
@@ -1042,35 +1042,51 @@ let w = (ut = class {
1042
1042
  e(this, "maxSize", 0);
1043
1043
  e(this, "id");
1044
1044
  e(this, "instructionSummaries", []);
1045
+ e(this, "interactionsCompressed");
1046
+ e(this, "interactionsRemoved");
1047
+ e(this, "compressionRatio");
1048
+ e(this, "newOverallCount");
1045
1049
  }
1046
- }, p(ut, "SessionInformation"), ut);
1050
+ }, c(ut, "SessionInformation"), ut);
1047
1051
  n([
1048
- o(Number)
1049
- ], w.prototype, "size", 2);
1052
+ i(Number)
1053
+ ], T.prototype, "size", 2);
1050
1054
  n([
1051
- o(Number)
1052
- ], w.prototype, "originalSize", 2);
1055
+ i(Number)
1056
+ ], T.prototype, "originalSize", 2);
1053
1057
  n([
1054
- o(Number)
1055
- ], w.prototype, "ratio", 2);
1058
+ i(Number)
1059
+ ], T.prototype, "ratio", 2);
1056
1060
  n([
1057
- o(Number)
1058
- ], w.prototype, "previousRatio", 2);
1061
+ i(Number)
1062
+ ], T.prototype, "previousRatio", 2);
1059
1063
  n([
1060
- o(Number)
1061
- ], w.prototype, "threshold", 2);
1064
+ i(Number)
1065
+ ], T.prototype, "threshold", 2);
1062
1066
  n([
1063
- o(Number)
1064
- ], w.prototype, "maxSize", 2);
1067
+ i(Number)
1068
+ ], T.prototype, "maxSize", 2);
1065
1069
  n([
1066
- o(String)
1067
- ], w.prototype, "id", 2);
1070
+ i(String)
1071
+ ], T.prototype, "id", 2);
1068
1072
  n([
1069
1073
  xt(M)
1070
- ], w.prototype, "instructionSummaries", 2);
1071
- w = n([
1074
+ ], T.prototype, "instructionSummaries", 2);
1075
+ n([
1076
+ i(Number)
1077
+ ], T.prototype, "interactionsCompressed", 2);
1078
+ n([
1079
+ i(Number)
1080
+ ], T.prototype, "interactionsRemoved", 2);
1081
+ n([
1082
+ i(Number)
1083
+ ], T.prototype, "compressionRatio", 2);
1084
+ n([
1085
+ i(Number)
1086
+ ], T.prototype, "newOverallCount", 2);
1087
+ T = n([
1072
1088
  f({ name: "SessionInformation" })
1073
- ], w);
1089
+ ], T);
1074
1090
  var dt;
1075
1091
  let h = (dt = class {
1076
1092
  constructor() {
@@ -1093,57 +1109,57 @@ let h = (dt = class {
1093
1109
  e(this, "subAgentName");
1094
1110
  e(this, "text");
1095
1111
  }
1096
- }, p(dt, "LlmEvent"), dt);
1112
+ }, c(dt, "LlmEvent"), dt);
1097
1113
  n([
1098
- o(Number)
1114
+ i(Number)
1099
1115
  ], h.prototype, "timestamp", 2);
1100
1116
  n([
1101
- o(String)
1117
+ i(String)
1102
1118
  ], h.prototype, "mimeType", 2);
1103
1119
  n([
1104
- o(Boolean)
1120
+ i(Boolean)
1105
1121
  ], h.prototype, "partial", 2);
1106
1122
  n([
1107
- o(Boolean)
1123
+ i(Boolean)
1108
1124
  ], h.prototype, "turnComplete", 2);
1109
1125
  n([
1110
- o(Boolean)
1126
+ i(Boolean)
1111
1127
  ], h.prototype, "visible", 2);
1112
1128
  n([
1113
- o(String)
1129
+ i(String)
1114
1130
  ], h.prototype, "serverError", 2);
1115
1131
  n([
1116
- o(String)
1132
+ i(String)
1117
1133
  ], h.prototype, "interactionId", 2);
1118
1134
  n([
1119
- o(w)
1135
+ i(T)
1120
1136
  ], h.prototype, "sessionInformation", 2);
1121
1137
  n([
1122
- o(yt)
1138
+ i(yt)
1123
1139
  ], h.prototype, "eventType", 2);
1124
1140
  n([
1125
1141
  xt(O)
1126
1142
  ], h.prototype, "artifactsGenerated", 2);
1127
1143
  n([
1128
- o(String)
1144
+ i(String)
1129
1145
  ], h.prototype, "author", 2);
1130
1146
  n([
1131
- o(Dt)
1147
+ i(Dt)
1132
1148
  ], h.prototype, "role", 2);
1133
1149
  n([
1134
- o(String)
1150
+ i(String)
1135
1151
  ], h.prototype, "command", 2);
1136
1152
  n([
1137
- o(Ct)
1153
+ i(St)
1138
1154
  ], h.prototype, "content", 2);
1139
1155
  n([
1140
- xt(() => D)
1156
+ xt(() => _)
1141
1157
  ], h.prototype, "streamingParts", 2);
1142
1158
  h = n([
1143
1159
  f({ name: "LlmEvent" })
1144
1160
  ], h);
1145
1161
  var mt;
1146
- let _ = (mt = class {
1162
+ let w = (mt = class {
1147
1163
  constructor() {
1148
1164
  e(this, "timeStamp");
1149
1165
  e(this, "partialText");
@@ -1156,40 +1172,40 @@ let _ = (mt = class {
1156
1172
  e(this, "partialEventType");
1157
1173
  e(this, "subAgentId");
1158
1174
  }
1159
- }, p(mt, "PartialLlmEvent"), mt);
1175
+ }, c(mt, "PartialLlmEvent"), mt);
1160
1176
  n([
1161
- o(Number, { name: "ts" })
1162
- ], _.prototype, "timeStamp", 2);
1177
+ i(Number, { name: "ts" })
1178
+ ], w.prototype, "timeStamp", 2);
1163
1179
  n([
1164
- o(String, { name: "pt" })
1165
- ], _.prototype, "partialText", 2);
1180
+ i(String, { name: "pt" })
1181
+ ], w.prototype, "partialText", 2);
1166
1182
  n([
1167
- o(String, { name: "pr" })
1168
- ], _.prototype, "partialReasoning", 2);
1183
+ i(String, { name: "pr" })
1184
+ ], w.prototype, "partialReasoning", 2);
1169
1185
  n([
1170
- o(String, { name: "fn" })
1171
- ], _.prototype, "functionName", 2);
1186
+ i(String, { name: "fn" })
1187
+ ], w.prototype, "functionName", 2);
1172
1188
  n([
1173
- xt(() => D)
1174
- ], _.prototype, "streamingParts", 2);
1189
+ xt(() => _)
1190
+ ], w.prototype, "streamingParts", 2);
1175
1191
  n([
1176
- o(String, { name: "fid" })
1177
- ], _.prototype, "functionCallId", 2);
1192
+ i(String, { name: "fid" })
1193
+ ], w.prototype, "functionCallId", 2);
1178
1194
  n([
1179
- o(String, { name: "tp" })
1180
- ], _.prototype, "type", 2);
1195
+ i(String, { name: "tp" })
1196
+ ], w.prototype, "type", 2);
1181
1197
  n([
1182
- o(String, { name: "itid" })
1183
- ], _.prototype, "iteractionId", 2);
1198
+ i(String, { name: "itid" })
1199
+ ], w.prototype, "iteractionId", 2);
1184
1200
  n([
1185
- o(yt)
1186
- ], _.prototype, "partialEventType", 2);
1201
+ i(yt)
1202
+ ], w.prototype, "partialEventType", 2);
1187
1203
  n([
1188
- o(String, { name: "said" })
1189
- ], _.prototype, "subAgentId", 2);
1190
- _ = n([
1204
+ i(String, { name: "said" })
1205
+ ], w.prototype, "subAgentId", 2);
1206
+ w = n([
1191
1207
  f({ name: "PartialLlmEvent" })
1192
- ], _);
1208
+ ], w);
1193
1209
  var gt;
1194
1210
  let k = (gt = class {
1195
1211
  constructor() {
@@ -1202,30 +1218,30 @@ let k = (gt = class {
1202
1218
  e(this, "subAgentName");
1203
1219
  e(this, "seq");
1204
1220
  }
1205
- }, p(gt, "StreamingResponse"), gt);
1221
+ }, c(gt, "StreamingResponse"), gt);
1206
1222
  n([
1207
- o(String)
1223
+ i(String)
1208
1224
  ], k.prototype, "type", 2);
1209
1225
  n([
1210
- o(h)
1226
+ i(h)
1211
1227
  ], k.prototype, "event", 2);
1212
1228
  n([
1213
- o(String)
1229
+ i(String)
1214
1230
  ], k.prototype, "sessionId", 2);
1215
1231
  n([
1216
- o(String)
1232
+ i(String)
1217
1233
  ], k.prototype, "accessToken", 2);
1218
1234
  n([
1219
- o(_, { name: "pe" })
1235
+ i(w, { name: "pe" })
1220
1236
  ], k.prototype, "partialEvent", 2);
1221
1237
  n([
1222
- o(String)
1238
+ i(String)
1223
1239
  ], k.prototype, "subAgentId", 2);
1224
1240
  n([
1225
- o(String)
1241
+ i(String)
1226
1242
  ], k.prototype, "subAgentName", 2);
1227
1243
  n([
1228
- o(Number)
1244
+ i(Number)
1229
1245
  ], k.prototype, "seq", 2);
1230
1246
  k = n([
1231
1247
  f({ name: "StreamingResponse" })
@@ -1235,7 +1251,7 @@ let Ut = (ft = class {
1235
1251
  constructor() {
1236
1252
  e(this, "events");
1237
1253
  }
1238
- }, p(ft, "Payload"), ft);
1254
+ }, c(ft, "Payload"), ft);
1239
1255
  n([
1240
1256
  xt(h)
1241
1257
  ], Ut.prototype, "events", 2);
@@ -1246,7 +1262,7 @@ function qt(s) {
1246
1262
  var r;
1247
1263
  const t = (s == null ? void 0 : s.presentation) ?? ((r = s == null ? void 0 : s.metadata) == null ? void 0 : r[jt]);
1248
1264
  if (!t || typeof t != "object") return { isUi: !1 };
1249
- const i = t, a = /* @__PURE__ */ p((c, d) => i[c] ?? i[d], "pick");
1265
+ const o = t, a = /* @__PURE__ */ c((p, d) => o[p] ?? o[d], "pick");
1250
1266
  return {
1251
1267
  isUi: a("isUi", "IsUi") === !0,
1252
1268
  askUserComponent: a("askUserComponent", "AskUserComponent") || void 0,
@@ -1257,8 +1273,8 @@ function qt(s) {
1257
1273
  parked: a("parked", "Parked") === !0 || void 0
1258
1274
  };
1259
1275
  }
1260
- p(qt, "readPresentation");
1261
- const E = class E {
1276
+ c(qt, "readPresentation");
1277
+ const v = class v {
1262
1278
  constructor(t) {
1263
1279
  e(this, "uniqueId");
1264
1280
  e(this, "mimeType");
@@ -1293,8 +1309,8 @@ const E = class E {
1293
1309
  e(this, "visible", !0);
1294
1310
  this.interactionId = t, this.author = "main";
1295
1311
  }
1296
- static createErrorEvent(t, i) {
1297
- const a = new E(i);
1312
+ static createErrorEvent(t, o) {
1313
+ const a = new v(o);
1298
1314
  a.turn_complete = !0, a.partial = !1, a.parts = [];
1299
1315
  const r = {
1300
1316
  eventType: l.ServerError,
@@ -1312,52 +1328,52 @@ const E = class E {
1312
1328
  return a.parts.push(r), a;
1313
1329
  }
1314
1330
  static parseFlatPropertiesTypedEvent(t) {
1315
- var a, r, c;
1316
- const i = new E(t.interactionId);
1317
- if (i.serverError = t.serverError, !t.interactionId)
1331
+ var a, r, p;
1332
+ const o = new v(t.interactionId);
1333
+ if (o.serverError = t.serverError, !t.interactionId)
1318
1334
  throw new Error("Interaction ID is required");
1319
- 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"', {
1335
+ switch (o.model_session_id = "", o.server_session_id = null, o.asyncFinalResponse = t.turnComplete, o.command = (a = t.command) == null ? void 0 : a.toString(), t.sessionInformation && (o.session_information = t.sessionInformation), (!t.author || t.author == "") && console.warn('[ServerEvent] event with no author; defaulting to "main"', {
1320
1336
  interactionId: t.interactionId,
1321
1337
  turnComplete: t.turnComplete
1322
1338
  }), t == null ? void 0 : t.author) {
1323
1339
  case Qt:
1324
- i.author = "tool";
1340
+ o.author = "tool";
1325
1341
  break;
1326
1342
  case "system":
1327
- i.author = "system";
1343
+ o.author = "system";
1328
1344
  break;
1329
1345
  default:
1330
- i.author = "main";
1346
+ o.author = "main";
1331
1347
  }
1332
- return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = l.NotDefined, i.partial = ((c = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : c.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;
1348
+ return o.mimeType = t.mimeType, o.created = new Date(t.timestamp), o.eventType = l.NotDefined, o.partial = ((p = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : p.toLowerCase()) === "true", o.turn_complete = t.turnComplete, o.visible = t.visible, o.isFinalResponse = t.turnComplete ?? !1, o.artifactsDelta = [], t.artifactsGenerated && t.artifactsGenerated.length > 0 && (o.created = new Date(t.timestamp), o.llmArtifacts = t.artifactsGenerated), o.subAgentId = t.subAgentId, o.subAgentName = t.subAgentName, o;
1333
1349
  }
1334
1350
  static getPartType(t) {
1335
- return t instanceof _t ? "TextContent" : t instanceof v ? "FunctionCallContent" : t instanceof b ? "FunctionResultContent" : t instanceof N ? "StreamingFunctionCallUpdateContent" : t instanceof I ? "StreamingFinalFunctionCallContent" : t instanceof A ? "StreamingFinalFunctionResultContent" : t instanceof ht ? "FunctionClientOutputContent" : t instanceof G ? "StreamingClientOutputContent" : t instanceof St ? "UserUiContent" : t instanceof kt ? "StreamingTextContent" : t instanceof Ft ? "StreamingReasoningContent" : t instanceof R ? "ToolEventContent" : t instanceof P ? "StreamingToolEventContent" : "Unknown";
1351
+ return t instanceof _t ? "TextContent" : t instanceof E ? "FunctionCallContent" : t instanceof I ? "FunctionResultContent" : t instanceof N ? "StreamingFunctionCallUpdateContent" : t instanceof b ? "StreamingFinalFunctionCallContent" : t instanceof A ? "StreamingFinalFunctionResultContent" : t instanceof ht ? "FunctionClientOutputContent" : t instanceof G ? "StreamingClientOutputContent" : t instanceof Ct ? "UserUiContent" : t instanceof kt ? "StreamingTextContent" : t instanceof Ft ? "StreamingReasoningContent" : t instanceof P ? "ToolEventContent" : t instanceof R ? "StreamingToolEventContent" : "Unknown";
1336
1352
  }
1337
1353
  static parseFromTypedEvent(t) {
1338
- var c, d, g, W, Ot, Pt, Rt;
1339
- const i = E.parseFlatPropertiesTypedEvent(t);
1340
- if (i.serverError)
1341
- return i.parts.push(Nt.fromError(i.serverError)), i;
1354
+ var p, d, g, W, Ot, Rt, Pt;
1355
+ const o = v.parseFlatPropertiesTypedEvent(t);
1356
+ if (o.serverError)
1357
+ return o.parts.push(Nt.fromError(o.serverError)), o;
1342
1358
  if (!t.content && !t.streamingParts)
1343
- return i;
1344
- i.parts = [];
1345
- const a = [...((c = t.content) == null ? void 0 : c.items) ?? [], ...t.streamingParts ?? []];
1346
- i.eventType = Zt(((d = t.eventType) == null ? void 0 : d.type) ?? "");
1359
+ return o;
1360
+ o.parts = [];
1361
+ const a = [...((p = t.content) == null ? void 0 : p.items) ?? [], ...t.streamingParts ?? []];
1362
+ o.eventType = Zt(((d = t.eventType) == null ? void 0 : d.type) ?? "");
1347
1363
  for (const y of a) {
1348
1364
  let u = {
1349
1365
  id: "",
1350
- author: i.author,
1351
- eventType: i.eventType,
1366
+ author: o.author,
1367
+ eventType: o.eventType,
1352
1368
  created: /* @__PURE__ */ new Date(),
1353
- visible: i.visible,
1354
- partial: i.partial,
1369
+ visible: o.visible,
1370
+ partial: o.partial,
1355
1371
  isStillWriting: !1,
1356
1372
  mustPush: !1,
1357
1373
  textAppendable: !1
1358
1374
  };
1359
- const C = E.getPartType(y);
1360
- if (C == x.FunctionCallContent || C == x.FunctionResultContent || C == x.StreamingFinalFunctionCallContent || C == x.StreamingFinalFunctionResultContent) {
1375
+ const S = v.getPartType(y);
1376
+ if (S == x.FunctionCallContent || S == x.FunctionResultContent || S == x.StreamingFinalFunctionCallContent || S == x.StreamingFinalFunctionResultContent) {
1361
1377
  var r = y;
1362
1378
  if (r.id == "Server Error") {
1363
1379
  const m = r.arguments ?? {}, z = typeof m.error == "string" && m.error.trim().length > 0 ? m.error : JSON.stringify(r.arguments);
@@ -1366,7 +1382,7 @@ const E = class E {
1366
1382
  stackTrace: typeof m.stackTrace == "string" ? m.stackTrace : void 0
1367
1383
  }, u.functionDetails = void 0;
1368
1384
  } else {
1369
- u.eventType = C == x.FunctionCallContent || C == x.StreamingFinalFunctionCallContent ? l.FunctionCall : l.FunctionResponse;
1385
+ u.eventType = S == x.FunctionCallContent || S == x.StreamingFinalFunctionCallContent ? l.FunctionCall : l.FunctionResponse;
1370
1386
  let m;
1371
1387
  try {
1372
1388
  if (r != null && r.result)
@@ -1387,8 +1403,8 @@ const E = class E {
1387
1403
  u.functionDetails = {
1388
1404
  id: (r == null ? void 0 : r.id) ?? "",
1389
1405
  args: r == null ? void 0 : r.arguments,
1390
- start: C == x.FunctionCallContent ? i.created : void 0,
1391
- end: C == x.FunctionResultContent ? i.created : void 0,
1406
+ start: S == x.FunctionCallContent ? o.created : void 0,
1407
+ end: S == x.FunctionResultContent ? o.created : void 0,
1392
1408
  text: JSON.stringify(r == null ? void 0 : r.arguments) ?? "",
1393
1409
  name: (r == null ? void 0 : r.functionName) ?? "",
1394
1410
  status: u.eventType == l.FunctionCall ? "Executing" : "Done",
@@ -1404,19 +1420,19 @@ const E = class E {
1404
1420
  cancelUi: z.cancelUi
1405
1421
  }, u.functionDetails.isAskUser = !!u.functionDetails.askUserComponent, t.text = r == null ? void 0 : r.arguments;
1406
1422
  }
1407
- } else if (C == x.StreamingTextContent)
1423
+ } else if (S == x.StreamingTextContent)
1408
1424
  u.eventType = l.Text, u.text = (W = y == null ? void 0 : y.text) == null ? void 0 : W.replaceAll("\\n", `
1409
1425
  `), u.textLastChunk = y.text, t.text = u.text;
1410
- else if (C == x.TextContent)
1426
+ else if (S == x.TextContent)
1411
1427
  u.eventType = l.Text, u.text = (Ot = y == null ? void 0 : y.text) == null ? void 0 : Ot.replaceAll("\\n", `
1412
1428
  `), u.textLastChunk = y.text, t.text = u.text;
1413
- else if (C == x.StreamingReasoningContent)
1429
+ else if (S == x.StreamingReasoningContent)
1414
1430
  u.eventType = l.Thought, u.thoughtDetails = {
1415
- text: ((Pt = y == null ? void 0 : y.text) == null ? void 0 : Pt.replaceAll("\\n", `
1431
+ text: ((Rt = y == null ? void 0 : y.text) == null ? void 0 : Rt.replaceAll("\\n", `
1416
1432
  `)) ?? ""
1417
- }, u.text = (Rt = y == null ? void 0 : y.text) == null ? void 0 : Rt.replaceAll("\\n", `
1433
+ }, u.text = (Pt = y == null ? void 0 : y.text) == null ? void 0 : Pt.replaceAll("\\n", `
1418
1434
  `), u.textLastChunk = y.text, t.text = u.text;
1419
- else if (C == x.StreamingFunctionCallUpdateContent) {
1435
+ else if (S == x.StreamingFunctionCallUpdateContent) {
1420
1436
  const m = y;
1421
1437
  u.eventType = l.PartialFunctionCall, u.text = m.arguments, u.thoughtDetails = {
1422
1438
  text: ""
@@ -1426,7 +1442,7 @@ const E = class E {
1426
1442
  status: "Composing",
1427
1443
  name: (m == null ? void 0 : m.name) ?? "Unknown"
1428
1444
  }, t.text = u.text;
1429
- } else if (C == x.ToolEventContent || C == x.StreamingToolEventContent) {
1445
+ } else if (S == x.ToolEventContent || S == x.StreamingToolEventContent) {
1430
1446
  u.eventType = l.ToolEvent;
1431
1447
  const m = y;
1432
1448
  u.toolDetails = {
@@ -1434,7 +1450,7 @@ const E = class E {
1434
1450
  eventData: m.eventData ?? "",
1435
1451
  sessionId: m.sessionId ?? void 0
1436
1452
  };
1437
- } else if (C == x.FunctionClientOutputContent) {
1453
+ } else if (S == x.FunctionClientOutputContent) {
1438
1454
  const m = y;
1439
1455
  u.eventType = l.FunctionClientOutput, u.functionDetails = {
1440
1456
  id: m.id ?? "",
@@ -1442,7 +1458,7 @@ const E = class E {
1442
1458
  status: "Done",
1443
1459
  clientOutput: m.data
1444
1460
  };
1445
- } else if (C == x.StreamingClientOutputContent) {
1461
+ } else if (S == x.StreamingClientOutputContent) {
1446
1462
  const m = y;
1447
1463
  u.eventType = l.FunctionClientOutput, u.functionDetails = {
1448
1464
  id: m.id ?? "",
@@ -1454,7 +1470,7 @@ const E = class E {
1454
1470
  // The park signal itself (the reason this event fires even with no prefill).
1455
1471
  parked: qt(m).parked
1456
1472
  };
1457
- } else if (C == x.UserUiContent) {
1473
+ } else if (S == x.UserUiContent) {
1458
1474
  const m = y;
1459
1475
  u.eventType = l.UserAnswer, u.author = "user", u.functionDetails = {
1460
1476
  id: "",
@@ -1464,14 +1480,14 @@ const E = class E {
1464
1480
  isUi: !0
1465
1481
  };
1466
1482
  } else {
1467
- u.eventType = l.NotDefined, console.warn(`Got a unmapped event_type:${i.eventType}, data:`, C, y);
1483
+ u.eventType = l.NotDefined, console.warn(`Got a unmapped event_type:${o.eventType}, data:`, S, y);
1468
1484
  continue;
1469
1485
  }
1470
- i.parts.push(u);
1486
+ o.parts.push(u);
1471
1487
  }
1472
- return i;
1488
+ return o;
1473
1489
  }
1474
- static createFromThought(t, i) {
1490
+ static createFromThought(t, o) {
1475
1491
  return {
1476
1492
  author: "main",
1477
1493
  visible: !0,
@@ -1489,7 +1505,7 @@ const E = class E {
1489
1505
  parts: [
1490
1506
  {
1491
1507
  thoughtDetails: {
1492
- text: i
1508
+ text: o
1493
1509
  },
1494
1510
  // ThoughtPart renders `part.text` (via getPartTextContent), so a
1495
1511
  // thought built here with only `thoughtDetails` rendered as an
@@ -1497,8 +1513,8 @@ const E = class E {
1497
1513
  // StreamingReasoningContent — match it, or this factory produces
1498
1514
  // a part the UI cannot show. Only the demo's fake gateway builds
1499
1515
  // thoughts this way, which is why it went unnoticed.
1500
- text: i,
1501
- id: vt(),
1516
+ text: o,
1517
+ id: Et(),
1502
1518
  created: /* @__PURE__ */ new Date(),
1503
1519
  eventType: l.Thought,
1504
1520
  author: "main",
@@ -1510,8 +1526,8 @@ const E = class E {
1510
1526
  ]
1511
1527
  };
1512
1528
  }
1513
- static createFromFunctionName(t, i, a) {
1514
- const r = E.createFromText("", i);
1529
+ static createFromFunctionName(t, o, a) {
1530
+ const r = v.createFromText("", o);
1515
1531
  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 = {
1516
1532
  name: t,
1517
1533
  id: "callId",
@@ -1522,13 +1538,13 @@ const E = class E {
1522
1538
  args: a
1523
1539
  }, r;
1524
1540
  }
1525
- static createFromText(t, i, a) {
1541
+ static createFromText(t, o, a) {
1526
1542
  return {
1527
1543
  author: "main",
1528
1544
  visible: !0,
1529
1545
  eventType: l.Text,
1530
1546
  uniqueId: (/* @__PURE__ */ new Date()).getTime().toString(),
1531
- interactionId: i,
1547
+ interactionId: o,
1532
1548
  allEventTypes: [l.Text],
1533
1549
  artifactsDelta: [""],
1534
1550
  model_session_id: "",
@@ -1546,7 +1562,7 @@ const E = class E {
1546
1562
  thoughtDetails: a ? {
1547
1563
  text: a
1548
1564
  } : void 0,
1549
- id: vt(),
1565
+ id: Et(),
1550
1566
  created: /* @__PURE__ */ new Date(),
1551
1567
  // Part eventType MUST match the outer event's eventType.
1552
1568
  // Was previously `Thought` here, which made the merger
@@ -1566,24 +1582,24 @@ const E = class E {
1566
1582
  };
1567
1583
  }
1568
1584
  };
1569
- p(E, "ServerEvent");
1570
- let Wt = E;
1585
+ c(v, "ServerEvent");
1586
+ let Wt = v;
1571
1587
  const Lt = [
1572
1588
  // KernelContent derived types
1573
1589
  _t,
1574
1590
  wt,
1575
- v,
1576
- R,
1577
- b,
1591
+ E,
1592
+ P,
1593
+ I,
1578
1594
  ht,
1579
- St,
1580
1595
  Ct,
1596
+ St,
1581
1597
  // StreamingKernelContent derived types
1582
1598
  kt,
1583
1599
  N,
1584
1600
  Ft,
1585
- P,
1586
- I,
1601
+ R,
1602
+ b,
1587
1603
  A,
1588
1604
  G,
1589
1605
  M
@@ -1591,16 +1607,16 @@ const Lt = [
1591
1607
  function te(s) {
1592
1608
  return s.name;
1593
1609
  }
1594
- p(te, "getConstructorName");
1595
- function Ht(s, t, i, a) {
1596
- t.constructor !== i && (s.$type = (a == null ? void 0 : a.name) ?? te(t.constructor));
1610
+ c(te, "getConstructorName");
1611
+ function Ht(s, t, o, a) {
1612
+ t.constructor !== o && (s.$type = (a == null ? void 0 : a.name) ?? te(t.constructor));
1597
1613
  }
1598
- p(Ht, "dotNetTypeEmitter");
1614
+ c(Ht, "dotNetTypeEmitter");
1599
1615
  function Bt(s, t) {
1600
1616
  if (s.$type != null)
1601
1617
  return t.get(s.$type);
1602
1618
  }
1603
- p(Bt, "dotnetTypeResolver");
1619
+ c(Bt, "dotnetTypeResolver");
1604
1620
  function Kt() {
1605
1621
  const s = new zt(h);
1606
1622
  return s.config({
@@ -1609,7 +1625,7 @@ function Kt() {
1609
1625
  typeResolver: Bt
1610
1626
  }), s;
1611
1627
  }
1612
- p(Kt, "createEventSerializer");
1628
+ c(Kt, "createEventSerializer");
1613
1629
  function ee() {
1614
1630
  const s = new zt(k);
1615
1631
  return s.config({
@@ -1618,83 +1634,83 @@ function ee() {
1618
1634
  typeResolver: Bt
1619
1635
  }), s;
1620
1636
  }
1621
- p(ee, "createStreamingResponseSerializer");
1637
+ c(ee, "createStreamingResponseSerializer");
1622
1638
  function Jt(s) {
1623
1639
  try {
1624
1640
  return JSON.parse(s), s;
1625
1641
  } catch {
1626
- let i = "", a = !1;
1642
+ let o = "", a = !1;
1627
1643
  for (let r = 0; r < s.length; r++) {
1628
- const c = s[r], d = c.charCodeAt(0);
1629
- if (c === "\\" && a && r + 1 < s.length) {
1644
+ const p = s[r], d = p.charCodeAt(0);
1645
+ if (p === "\\" && a && r + 1 < s.length) {
1630
1646
  const g = s[r + 1];
1631
1647
  if (g === '"' || g === "\\" || g === "/" || g === "b" || g === "f" || g === "n" || g === "r" || g === "t") {
1632
- i += c + g, r++;
1648
+ o += p + g, r++;
1633
1649
  continue;
1634
1650
  } else if (g === "u" && r + 5 < s.length) {
1635
- i += s.substring(r, r + 6), r += 5;
1651
+ o += s.substring(r, r + 6), r += 5;
1636
1652
  continue;
1637
1653
  } else {
1638
- i += c;
1654
+ o += p;
1639
1655
  continue;
1640
1656
  }
1641
1657
  }
1642
- if (c === '"') {
1658
+ if (p === '"') {
1643
1659
  let g = 0;
1644
1660
  for (let W = r - 1; W >= 0 && s[W] === "\\"; W--)
1645
1661
  g++;
1646
- g % 2 === 0 && (a = !a), i += c;
1662
+ g % 2 === 0 && (a = !a), o += p;
1647
1663
  continue;
1648
1664
  }
1649
1665
  if (a && d < 32)
1650
- switch (c) {
1666
+ switch (p) {
1651
1667
  case `
1652
1668
  `:
1653
- i += "\\n";
1669
+ o += "\\n";
1654
1670
  break;
1655
1671
  case "\r":
1656
- i += "\\r";
1672
+ o += "\\r";
1657
1673
  break;
1658
1674
  case " ":
1659
- i += "\\t";
1675
+ o += "\\t";
1660
1676
  break;
1661
1677
  case "\f":
1662
- i += "\\f";
1678
+ o += "\\f";
1663
1679
  break;
1664
1680
  case "\b":
1665
- i += "\\b";
1681
+ o += "\\b";
1666
1682
  break;
1667
1683
  default:
1668
1684
  const g = d.toString(16).padStart(4, "0");
1669
- i += `\\u${g}`;
1685
+ o += `\\u${g}`;
1670
1686
  break;
1671
1687
  }
1672
1688
  else
1673
- i += c;
1689
+ o += p;
1674
1690
  }
1675
- return i;
1691
+ return o;
1676
1692
  }
1677
1693
  }
1678
- p(Jt, "sanitizeJsonString");
1694
+ c(Jt, "sanitizeJsonString");
1679
1695
  function we(s) {
1680
1696
  const t = Jt(s);
1681
1697
  return ee().parse(t);
1682
1698
  }
1683
- p(we, "deserializePayload");
1699
+ c(we, "deserializePayload");
1684
1700
  function ke(s) {
1685
1701
  const t = Jt(s);
1686
1702
  return Kt().parse(t);
1687
1703
  }
1688
- p(ke, "deserializeEvent");
1704
+ c(ke, "deserializeEvent");
1689
1705
  function Fe(s) {
1690
1706
  return Kt().stringify(s);
1691
1707
  }
1692
- p(Fe, "serializeEvent");
1708
+ c(Fe, "serializeEvent");
1693
1709
  export {
1694
- Ce as A,
1710
+ Se as A,
1695
1711
  me as C,
1696
1712
  l as E,
1697
- v as F,
1713
+ E as F,
1698
1714
  Zt as G,
1699
1715
  Nt as I,
1700
1716
  h as L,
@@ -1703,15 +1719,15 @@ export {
1703
1719
  fe as R,
1704
1720
  Wt as S,
1705
1721
  _t as T,
1706
- Se as a,
1707
- Et as b,
1722
+ Ce as a,
1723
+ vt as b,
1708
1724
  he as c,
1709
1725
  ye as d,
1710
1726
  ue as e,
1711
- Ct as f,
1727
+ St as f,
1712
1728
  ge as g,
1713
- b as h,
1714
- S as i,
1729
+ I as h,
1730
+ C as i,
1715
1731
  de as j,
1716
1732
  xe as k,
1717
1733
  N as l,
@@ -1727,4 +1743,4 @@ export {
1727
1743
  Jt as v,
1728
1744
  Fe as w
1729
1745
  };
1730
- //# sourceMappingURL=serializer-D2W42bdT.js.map
1746
+ //# sourceMappingURL=serializer-CdUT_OO2.js.map