@aintela/chat 0.6.0 → 0.7.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.
Files changed (57) hide show
  1. package/README.md +43 -0
  2. package/dist/components.js +7528 -7182
  3. package/dist/components.js.map +1 -1
  4. package/dist/{httpArtifactService-DYQDPVVH.js → detachedRunActivity-CjyFTKSw.js} +769 -324
  5. package/dist/detachedRunActivity-CjyFTKSw.js.map +1 -0
  6. package/dist/detachedRunModel-X59Pb5V-.js +67 -0
  7. package/dist/{detachedRunModel-1ii9qGTW.js.map → detachedRunModel-X59Pb5V-.js.map} +1 -1
  8. package/dist/hooks.js +1 -1
  9. package/dist/httpSessionService-Ckb9Cxia.js +320 -0
  10. package/dist/httpSessionService-Ckb9Cxia.js.map +1 -0
  11. package/dist/index.js +296 -274
  12. package/dist/models.js +47 -41
  13. package/dist/{serializer-BNsp8xs2.js → serializer-DNUH6kgE.js} +567 -507
  14. package/dist/serializer-DNUH6kgE.js.map +1 -0
  15. package/dist/services.js +22 -15
  16. package/dist/src/components/AiChat/AiChatContext.d.ts +3 -1
  17. package/dist/src/components/AiChat/AiChatTypes.d.ts +7 -1
  18. package/dist/src/components/AiChat/ChatPane/InteractionOriginBadge.d.ts +15 -0
  19. package/dist/src/components/AiChat/ChatPane/messageUserOrigin.test.d.ts +1 -0
  20. package/dist/src/components/AiChat/aiChatEngine.d.ts +13 -1
  21. package/dist/src/components/index.d.ts +2 -0
  22. package/dist/src/components/v2/DetachedRunTaskBox.d.ts +30 -5
  23. package/dist/src/components/v2/DetachedRunTaskBox.live.test.d.ts +1 -0
  24. package/dist/src/components/v2/DetachedRunTranscript.d.ts +89 -0
  25. package/dist/src/components/v2/DetachedRunTranscript.test.d.ts +1 -0
  26. package/dist/src/components/v2/index.d.ts +5 -0
  27. package/dist/src/components/v2/useDetachedRunLiveActivity.d.ts +30 -0
  28. package/dist/src/components/v2/useDetachedRunResumeKey.d.ts +15 -0
  29. package/dist/src/components/v2/useDetachedRunResumeKey.test.d.ts +1 -0
  30. package/dist/src/models/Interaction.d.ts +15 -0
  31. package/dist/src/models/detachedRunModel.d.ts +11 -0
  32. package/dist/src/models/enums.d.ts +3 -1
  33. package/dist/src/models/index.d.ts +4 -3
  34. package/dist/src/models/semanticKernelModel/models.d.ts +22 -1
  35. package/dist/src/services/WebSocketConnection/WebSocketConnectionV2.d.ts +2 -1
  36. package/dist/src/services/WebSocketConnection/webSocketConnection.d.ts +15 -2
  37. package/dist/src/services/detachedRun/DetachedRunFramesTransport.d.ts +68 -0
  38. package/dist/src/services/detachedRun/DetachedRunFramesTransport.test.d.ts +1 -0
  39. package/dist/src/services/detachedRun/detachedRunActivity.d.ts +25 -0
  40. package/dist/src/services/detachedRun/streamDetachedRunFrames.d.ts +110 -0
  41. package/dist/src/services/detachedRun/streamDetachedRunFrames.test.d.ts +1 -0
  42. package/dist/src/services/index.d.ts +7 -0
  43. package/dist/src/services/servers/AgentGatewayService.d.ts +1 -1
  44. package/dist/src/services/servers/AgentGatewayWSAsync.d.ts +67 -1
  45. package/dist/src/services/servers/gatewayAnnounceDetachedRun.test.d.ts +1 -0
  46. package/dist/src/services/servers/gatewayInteractionStarted.test.d.ts +1 -0
  47. package/dist/src/services/wire/decodeFrame.d.ts +6 -1
  48. package/dist/tests/fakes/fakeWebSocket.d.ts +8 -2
  49. package/dist/tests/fakes/makeGateway.d.ts +3 -1
  50. package/dist/{useChatSessions-Q41Jmr6P.js → useChatSessions-aTjNcj8q.js} +2 -2
  51. package/dist/{useChatSessions-Q41Jmr6P.js.map → useChatSessions-aTjNcj8q.js.map} +1 -1
  52. package/package.json +1 -1
  53. package/dist/detachedRunModel-1ii9qGTW.js +0 -50
  54. package/dist/httpArtifactService-DYQDPVVH.js.map +0 -1
  55. package/dist/httpSessionService-BY7JeW8d.js +0 -309
  56. package/dist/httpSessionService-BY7JeW8d.js.map +0 -1
  57. package/dist/serializer-BNsp8xs2.js.map +0 -1
@@ -1,30 +1,38 @@
1
- var qt = Object.defineProperty;
2
- var Qt = (s, t, o) => t in s ? qt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[t] = o;
3
- var p = (s, t) => qt(s, "name", { value: t, configurable: !0 });
4
- var e = (s, t, o) => Qt(s, typeof t != "symbol" ? t + "" : t, o);
5
- import Nt from "@mui/icons-material/Psychology";
6
- import L from "@mui/icons-material/FlashOn";
7
- import vt from "@mui/icons-material/RocketLaunch";
8
- import Zt from "@mui/icons-material/GeneratingTokensOutlined";
9
- import bt from "@mui/icons-material/SortByAlphaOutlined";
10
- import Ht from "@mui/icons-material/AllInclusive";
11
- import { d as It, A as Yt } from "./environmentUtils-VZNTCzEE.js";
12
- import { jsonMember as i, jsonObject as g, AnyT as q, jsonArrayMember as xt, TypedJSON as zt } from "typedjson";
13
- const me = {
1
+ var zt = Object.defineProperty;
2
+ var jt = (s, t, o) => t in s ? zt(s, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[t] = o;
3
+ var p = (s, t) => zt(s, "name", { value: t, configurable: !0 });
4
+ var e = (s, t, o) => jt(s, typeof t != "symbol" ? t + "" : t, o);
5
+ import Pt from "@mui/icons-material/Psychology";
6
+ import z from "@mui/icons-material/FlashOn";
7
+ import Nt from "@mui/icons-material/RocketLaunch";
8
+ import te from "@mui/icons-material/GeneratingTokensOutlined";
9
+ import Gt from "@mui/icons-material/SortByAlphaOutlined";
10
+ import Bt from "@mui/icons-material/AllInclusive";
11
+ import { d as Ut, A as ee } from "./environmentUtils-VZNTCzEE.js";
12
+ import { jsonMember as i, jsonObject as g, AnyT as H, jsonArrayMember as wt, TypedJSON as Vt } from "typedjson";
13
+ const ne = ["user", "whatsapp", "platform", "api"];
14
+ function Ce(s) {
15
+ const t = s == null ? void 0 : s.trim().toLowerCase();
16
+ return ne.find((o) => o === t);
17
+ }
18
+ p(Ce, "toInteractionOrigin");
19
+ const Se = {
14
20
  ChatEvent: "ChatEvent",
15
21
  ChatResponse: "ChatResponse",
16
22
  ChatRequest: "ChatRequest"
17
- }, ge = {
23
+ }, Te = {
18
24
  Interactive: "interactive",
19
25
  Autonomous: "autonomous"
20
- }, fe = {
26
+ }, xe = {
21
27
  SendMessage: "SendMessage",
22
28
  Other: "Other",
23
29
  Suspend: "Suspend",
24
30
  Close: "Close",
25
31
  Ping: "Ping",
26
- AnswerHumanTool: "AnswerHumanTool"
27
- }, l = {
32
+ AnswerHumanTool: "AnswerHumanTool",
33
+ /** Ask the server for the announcement turn of this conversation's settled detached runs (AIA Issue 1548 §5). */
34
+ AnnounceDetachedRun: "AnnounceDetachedRun"
35
+ }, c = {
28
36
  FunctionCall: "function_call",
29
37
  PartialFunctionCall: "partial_function_call",
30
38
  FunctionResponse: "function_response",
@@ -51,97 +59,97 @@ const me = {
51
59
  NotDefined: "not_defined",
52
60
  Waiting: "waiting",
53
61
  Suspended: "suspended"
54
- }, Xt = /* @__PURE__ */ p((s) => {
62
+ }, oe = /* @__PURE__ */ p((s) => {
55
63
  switch (s.toLocaleLowerCase()) {
56
64
  case "functioncall":
57
- return l.FunctionCall;
65
+ return c.FunctionCall;
58
66
  case "functionresponse":
59
- return l.FunctionResponse;
67
+ return c.FunctionResponse;
60
68
  // Streaming "final" call/result carry their own $type on the wire — map them like their collapsed
61
69
  // KernelContent forms so the top-level event classifies as call/response, not NotDefined.
62
70
  case "streamingfinalfunctioncallcontent":
63
- return l.FunctionCall;
71
+ return c.FunctionCall;
64
72
  case "streamingfinalfunctionresultcontent":
65
- return l.FunctionResponse;
73
+ return c.FunctionResponse;
66
74
  case "text":
67
- return l.Text;
75
+ return c.Text;
68
76
  case "streamingtextcontent":
69
- return l.Text;
77
+ return c.Text;
70
78
  case "partialfunctioncall":
71
- return l.PartialFunctionCall;
79
+ return c.PartialFunctionCall;
72
80
  case "streamingfunctioncallupdatecontent":
73
- return l.PartialFunctionCall;
81
+ return c.PartialFunctionCall;
74
82
  case "streamingreasoningcontent":
75
- return l.Thought;
83
+ return c.Thought;
76
84
  case "streamingthoughthighlightcontent":
77
85
  case "partialthoughthighlight":
78
- return l.ThoughtHighlight;
86
+ return c.ThoughtHighlight;
79
87
  case "functionclientoutputcontent":
80
- return l.FunctionClientOutput;
88
+ return c.FunctionClientOutput;
81
89
  case "streamingclientoutputcontent":
82
- return l.FunctionClientOutput;
90
+ return c.FunctionClientOutput;
83
91
  case "partialText":
84
- return l.Text;
92
+ return c.Text;
85
93
  case "unknown":
86
- return l.Other;
94
+ return c.Other;
87
95
  default:
88
- return l.NotDefined;
96
+ return c.NotDefined;
89
97
  }
90
- }, "GetEventTypeFromDotNetName"), he = {
91
- [l.FunctionCall]: "Executing function call",
92
- [l.FunctionResponse]: "Getting response",
93
- [l.Video]: "Video",
94
- [l.Thought]: "Thought",
95
- [l.InlineData]: "InlineData",
96
- [l.FileData]: "FileData",
97
- [l.CodeExecutionResult]: "Coding...",
98
- [l.ExecutableCode]: "Coding...",
99
- [l.Other]: "Other",
100
- [l.Text]: "Text",
101
- [l.NotDefined]: "NotDefined"
102
- }, ye = {
98
+ }, "GetEventTypeFromDotNetName"), _e = {
99
+ [c.FunctionCall]: "Executing function call",
100
+ [c.FunctionResponse]: "Getting response",
101
+ [c.Video]: "Video",
102
+ [c.Thought]: "Thought",
103
+ [c.InlineData]: "InlineData",
104
+ [c.FileData]: "FileData",
105
+ [c.CodeExecutionResult]: "Coding...",
106
+ [c.ExecutableCode]: "Coding...",
107
+ [c.Other]: "Other",
108
+ [c.Text]: "Text",
109
+ [c.NotDefined]: "NotDefined"
110
+ }, De = {
103
111
  Regular: "Regular",
104
112
  Artifact: "Artifact"
105
- }, Ce = {
113
+ }, we = {
106
114
  User: "User",
107
115
  Agent: "Agent",
108
116
  System: "System"
109
- }, Se = {
117
+ }, Fe = {
110
118
  Dashboard: "Dashboard",
111
119
  Chart: "Chart",
112
120
  Code: "Code"
113
- }, Rt = {
121
+ }, bt = {
114
122
  BI_Envision_Agent: "BI_Envision_Agent",
115
123
  BI_Master_Customer_Agent: "BI_Master_Customer_Agent",
116
124
  BI_Dedicated_Customer_Agent: "BI_Dedicated_Customer_Agent",
117
125
  Unknown: "Unknown"
118
- }, Te = {
126
+ }, Ie = {
119
127
  Interactive: "Interactive",
120
128
  Newsletter: "Newsletter"
121
- }, xe = {
122
- [Rt.BI_Envision_Agent]: {
129
+ }, Ee = {
130
+ [bt.BI_Envision_Agent]: {
123
131
  name: "Envision",
124
132
  description: `Analisa dados de vendas globais
125
133
  com insights consolidados de todos os clientes
126
134
  e métricas agregadas do mercado`
127
135
  },
128
- [Rt.BI_Master_Customer_Agent]: {
136
+ [bt.BI_Master_Customer_Agent]: {
129
137
  name: "Clientes Master",
130
138
  description: `Visão consolidada de todos os clientes
131
139
  com análises comparativas e benchmarks
132
140
  entre diferentes organizações`
133
141
  },
134
- [Rt.BI_Dedicated_Customer_Agent]: {
142
+ [bt.BI_Dedicated_Customer_Agent]: {
135
143
  name: "Cliente Único",
136
144
  description: `Foco em um cliente específico
137
145
  com análises detalhadas e personalizadas
138
146
  para sua organização`
139
147
  },
140
- [Rt.Unknown]: {
148
+ [bt.Unknown]: {
141
149
  name: "Não definido",
142
150
  description: "Não definido"
143
151
  }
144
- }, _e = {
152
+ }, ke = {
145
153
  FAST: "FAST",
146
154
  BALANCED: "BALANCED",
147
155
  PRO: "PRO",
@@ -170,11 +178,11 @@ para sua organização`
170
178
  ShowGuideDemo: "ShowGuideDemo",
171
179
  uiToolShowcase: "uiToolShowcase",
172
180
  AUTO: "AUTO"
173
- }, De = {
181
+ }, Re = {
174
182
  [T.Claude_Opus_4_6]: {
175
183
  name: "Claude Opus 4.6",
176
184
  description: "Modelo mais avançado da anthropic, no entanto, não tão rápido como o Sonnet",
177
- icon: Ht,
185
+ icon: Bt,
178
186
  contextWindow: "1M tokens",
179
187
  speed: "Moderate",
180
188
  quality: "Highest"
@@ -182,7 +190,7 @@ para sua organização`
182
190
  [T.Claude_Sonnet_4_6]: {
183
191
  name: "Claude Sonnet 4.6",
184
192
  description: "Ótima relação velocidade/qualidade",
185
- icon: Ht,
193
+ icon: Bt,
186
194
  contextWindow: "1M tokens",
187
195
  speed: "Fast",
188
196
  quality: "High"
@@ -192,7 +200,7 @@ para sua organização`
192
200
  description: `Modelo mais avançado
193
201
  Melhor qualidade para tarefas complexas
194
202
  Contexto: 2M tokens`,
195
- icon: Nt,
203
+ icon: Pt,
196
204
  contextWindow: "2M tokens",
197
205
  speed: "Moderate",
198
206
  quality: "Highest"
@@ -202,7 +210,7 @@ Contexto: 2M tokens`,
202
210
  description: `Equilibrio ideal entre velocidade e qualidade
203
211
  Ótimo para a maioria das tarefas
204
212
  Contexto: 1M tokens`,
205
- icon: L,
213
+ icon: z,
206
214
  contextWindow: "1M tokens",
207
215
  speed: "Fast",
208
216
  quality: "High"
@@ -212,7 +220,7 @@ Contexto: 1M tokens`,
212
220
  description: `NOVO: Equilibrio ideal entre velocidade e qualidade
213
221
  Ótimo para a maioria das tarefas
214
222
  Contexto: 1M tokens`,
215
- icon: L,
223
+ icon: z,
216
224
  contextWindow: "1M tokens",
217
225
  speed: "Fast",
218
226
  quality: "High"
@@ -220,7 +228,7 @@ Contexto: 1M tokens`,
220
228
  [T.Gpt_5_1]: {
221
229
  name: "Chat GPT 5.1",
222
230
  description: "Chat GPT 5.1",
223
- icon: vt,
231
+ icon: Nt,
224
232
  contextWindow: "200k tokens",
225
233
  speed: "Good",
226
234
  quality: "High"
@@ -228,7 +236,7 @@ Contexto: 1M tokens`,
228
236
  [T.Gpt_5_2]: {
229
237
  name: "Chat GPT 5.2",
230
238
  description: "Chat GPT 5.2",
231
- icon: vt,
239
+ icon: Nt,
232
240
  contextWindow: "200k tokens",
233
241
  speed: "Good",
234
242
  quality: "Highest"
@@ -236,7 +244,7 @@ Contexto: 1M tokens`,
236
244
  [T.Gpt_5_5]: {
237
245
  name: "Chat GPT 5.5",
238
246
  description: "A melhor inteligência em escala para fluxos de trabalho de agentes, codificação e profissionais.",
239
- icon: vt,
247
+ icon: Nt,
240
248
  contextWindow: "200k tokens",
241
249
  speed: "Good",
242
250
  quality: "Highest"
@@ -244,7 +252,7 @@ Contexto: 1M tokens`,
244
252
  [T.Gpt_5_4_mini]: {
245
253
  name: "Chat GPT 5.4 Mini",
246
254
  description: "Modelo compacto mais robusto da OpenAi até momento para codificação, uso de computadores e subagentes.",
247
- icon: vt,
255
+ icon: Nt,
248
256
  contextWindow: "200k tokens",
249
257
  speed: "Fast",
250
258
  quality: "Highest"
@@ -252,7 +260,7 @@ Contexto: 1M tokens`,
252
260
  [T["Glm-5_2"]]: {
253
261
  name: "Z.ai Glm-5",
254
262
  description: "Modelo open weights bem competente da Z.Ai. Apesar de gerar respostas mais longas o modelo é muito capaz.",
255
- icon: bt,
263
+ icon: Gt,
256
264
  contextWindow: "200k tokens",
257
265
  speed: "Good",
258
266
  quality: "Highest"
@@ -260,7 +268,7 @@ Contexto: 1M tokens`,
260
268
  [T["Glm_4.7"]]: {
261
269
  name: "Z.ai Glm-4.7",
262
270
  description: "",
263
- icon: bt,
271
+ icon: Gt,
264
272
  contextWindow: "200k tokens",
265
273
  speed: "Fast",
266
274
  quality: "High"
@@ -268,7 +276,7 @@ Contexto: 1M tokens`,
268
276
  [T["Glm_4.7_flash"]]: {
269
277
  name: "Z.ai Glm-4.7",
270
278
  description: "",
271
- icon: bt,
279
+ icon: Gt,
272
280
  contextWindow: "200k tokens",
273
281
  speed: "Good",
274
282
  quality: "High"
@@ -277,7 +285,7 @@ Contexto: 1M tokens`,
277
285
  name: "DeepSeek Reasoner",
278
286
  description: `Modelo da DeepSeek com modo de raciocínio profundo (thinking mode).
279
287
  Ideal para tarefas complexas que se beneficiam de cadeia de pensamento extensa.`,
280
- icon: Nt,
288
+ icon: Pt,
281
289
  contextWindow: "128k tokens",
282
290
  speed: "Moderate",
283
291
  quality: "Highest"
@@ -286,7 +294,7 @@ Ideal para tarefas complexas que se beneficiam de cadeia de pensamento extensa.`
286
294
  name: "DeepSeek Chat",
287
295
  description: `Modelo de chat rápido da DeepSeek, sem modo de raciocínio.
288
296
  Ótimo equilíbrio entre velocidade e qualidade para uso geral.`,
289
- icon: L,
297
+ icon: z,
290
298
  contextWindow: "128k tokens",
291
299
  speed: "Fast",
292
300
  quality: "High"
@@ -295,7 +303,7 @@ Ideal para tarefas complexas que se beneficiam de cadeia de pensamento extensa.`
295
303
  name: "Kimi K2.6 Pro",
296
304
  description: `Modelo híbrido da Moonshot com modo de raciocínio (thinking) ativado por padrão.
297
305
  Melhor capacidade da família K2 para tarefas complexas.`,
298
- icon: Nt,
306
+ icon: Pt,
299
307
  contextWindow: "256k tokens",
300
308
  speed: "Moderate",
301
309
  quality: "Highest"
@@ -304,7 +312,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
304
312
  name: "Kimi K2 Turbo",
305
313
  description: `Variante rápida (não-thinking) da Moonshot.
306
314
  Ótima relação velocidade/qualidade para uso geral.`,
307
- icon: L,
315
+ icon: z,
308
316
  contextWindow: "256k tokens",
309
317
  speed: "Fast",
310
318
  quality: "High"
@@ -312,7 +320,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
312
320
  [T["Qwen3_6-plus"]]: {
313
321
  name: "Qwen 3.6 Plus - Alibaba",
314
322
  description: "Multimodal nativo, context window - 1 milhão de tokens, codificação agentiva",
315
- icon: L,
323
+ icon: z,
316
324
  contextWindow: "1 milhão",
317
325
  speed: "Moderate",
318
326
  quality: "Highest"
@@ -320,7 +328,7 @@ Melhor capacidade da família K2 para tarefas complexas.`,
320
328
  [T["Qwen3_7-max"]]: {
321
329
  name: "Qwen 3.7 Max - Alibaba",
322
330
  description: "Multimodal nativo, context window - 1 milhão de tokens, codificação agentiva",
323
- icon: L,
331
+ icon: z,
324
332
  contextWindow: "1 milhão",
325
333
  speed: "Moderate",
326
334
  quality: "Highest"
@@ -328,19 +336,19 @@ Melhor capacidade da família K2 para tarefas complexas.`,
328
336
  [T.uiToolShowcase]: {
329
337
  name: "UiToolShowcase - Testing",
330
338
  description: "Cria um stream de testes.",
331
- icon: Zt,
339
+ icon: te,
332
340
  contextWindow: "256k tokens",
333
341
  speed: "Fast",
334
342
  quality: "High"
335
343
  }
336
344
  };
337
- function Fe(s) {
345
+ function Ae(s) {
338
346
  if (!s) return "Unknown";
339
347
  const t = s.toLowerCase();
340
348
  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";
341
349
  }
342
- p(Fe, "getModelVendor");
343
- const we = /* @__PURE__ */ p((s, t) => {
350
+ p(Ae, "getModelVendor");
351
+ const ve = /* @__PURE__ */ p((s, t) => {
344
352
  switch (s) {
345
353
  case "Connected":
346
354
  return t.palette.primary.light;
@@ -372,13 +380,13 @@ const we = /* @__PURE__ */ p((s, t) => {
372
380
  return String(t);
373
381
  }
374
382
  const a = Object.keys(t), r = [];
375
- return a.forEach((c) => {
376
- let d = t[c];
377
- typeof d == "object" && (d = JSON.stringify(t[c], null, 2));
383
+ return a.forEach((l) => {
384
+ let d = t[l];
385
+ typeof d == "object" && (d = JSON.stringify(t[l], null, 2));
378
386
  const f = (d == null ? void 0 : d.toString().indexOf(`
379
387
  `)) > -1 ? `
380
388
  ` : "";
381
- r.push(`${c}:${f}${d}`);
389
+ r.push(`${l}:${f}${d}`);
382
390
  }), r.join(`
383
391
  `);
384
392
  }
@@ -401,12 +409,12 @@ const we = /* @__PURE__ */ p((s, t) => {
401
409
  }
402
410
  const o = Object.keys(t), a = [];
403
411
  return o.forEach((r) => {
404
- let c = t == null ? void 0 : t[r];
405
- typeof c == "object" && (c = JSON.stringify(c, null, 2));
406
- const d = (c == null ? void 0 : c.toString().indexOf(`
412
+ let l = t == null ? void 0 : t[r];
413
+ typeof l == "object" && (l = JSON.stringify(l, null, 2));
414
+ const d = (l == null ? void 0 : l.toString().indexOf(`
407
415
  `)) > -1 ? `
408
416
  ` : "";
409
- a.push(`${r}:${d}${c}`);
417
+ a.push(`${r}:${d}${l}`);
410
418
  }), a.join(`
411
419
  `);
412
420
  }
@@ -418,8 +426,8 @@ const we = /* @__PURE__ */ p((s, t) => {
418
426
  * before reading the field. Returns undefined when absent or unparseable.
419
427
  */
420
428
  static uiSlotId(t) {
421
- var c;
422
- let o = (c = t == null ? void 0 : t.functionDetails) == null ? void 0 : c.response;
429
+ var l;
430
+ let o = (l = t == null ? void 0 : t.functionDetails) == null ? void 0 : l.response;
423
431
  for (let d = 0; d < 2 && typeof o == "string"; d++)
424
432
  try {
425
433
  o = JSON.parse(o);
@@ -433,7 +441,7 @@ const we = /* @__PURE__ */ p((s, t) => {
433
441
  static fromError(t) {
434
442
  return {
435
443
  errorDetails: { errorMessage: t },
436
- eventType: l.ServerError,
444
+ eventType: c.ServerError,
437
445
  id: "",
438
446
  author: "main",
439
447
  created: /* @__PURE__ */ new Date(),
@@ -445,8 +453,8 @@ const we = /* @__PURE__ */ p((s, t) => {
445
453
  static fromText(t, o, a) {
446
454
  return {
447
455
  text: t,
448
- eventType: l.Text,
449
- id: a ?? It(),
456
+ eventType: c.Text,
457
+ id: a ?? Ut(),
450
458
  created: /* @__PURE__ */ new Date(),
451
459
  author: o ?? "main",
452
460
  partial: !1,
@@ -462,8 +470,8 @@ const we = /* @__PURE__ */ p((s, t) => {
462
470
  */
463
471
  static fromUserUi(t, o, a) {
464
472
  return {
465
- id: a ?? It(),
466
- eventType: l.UserAnswer,
473
+ id: a ?? Ut(),
474
+ eventType: c.UserAnswer,
467
475
  author: "user",
468
476
  created: /* @__PURE__ */ new Date(),
469
477
  partial: !1,
@@ -478,20 +486,20 @@ const we = /* @__PURE__ */ p((s, t) => {
478
486
  }
479
487
  };
480
488
  }
481
- static createWaiting(t = !1, o = !0, a, r, c) {
489
+ static createWaiting(t = !1, o = !0, a, r, l) {
482
490
  a || (a = "Waiting");
483
491
  const d = b.fromText("...", void 0, "waitingpart");
484
- return d.eventType = l.Waiting, d.waitingDetails = {
492
+ return d.eventType = c.Waiting, d.waitingDetails = {
485
493
  startingPoint: r,
486
494
  addTimer: t,
487
495
  isTimerRunning: o,
488
496
  status: a,
489
- stopPoint: c
497
+ stopPoint: l
490
498
  }, d;
491
499
  }
492
500
  static createSuspended() {
493
501
  const t = b.fromText("SUSPEND");
494
- return t.eventType = l.Suspended, t;
502
+ return t.eventType = c.Suspended, t;
495
503
  }
496
504
  static getPartTextContent(t) {
497
505
  return t.text ?? "";
@@ -499,14 +507,14 @@ const we = /* @__PURE__ */ p((s, t) => {
499
507
  static FlatParts(t) {
500
508
  if (t.length === 0)
501
509
  return;
502
- const o = t.filter((c) => c.eventType == l.Text), a = o.length > 0 ? o[0] : t[0], r = [...new Set(t.map((c) => c.eventType))];
503
- 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;
504
- for (const c of t) {
505
- 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) {
506
- const d = a.functionDetails, f = c.functionDetails;
510
+ const o = t.filter((l) => l.eventType == c.Text), a = o.length > 0 ? o[0] : t[0], r = [...new Set(t.map((l) => l.eventType))];
511
+ r.length == 1 ? a.eventType = r[0] : o.length > 0 && (a.eventType = c.Text), a.mustPush = !(a.eventType == c.Text || a.eventType == c.Thought || a.eventType == c.NotDefined || a.eventType == c.PartialFunctionCall), a.textAppendable = a.eventType == c.Text || a.eventType == c.Thought || a.eventType == c.PartialFunctionCall;
512
+ for (const l of t) {
513
+ if (!a.codeExecutionResultDetails && l.codeExecutionResultDetails && (a.codeExecutionResultDetails = l.codeExecutionResultDetails), !a.errorDetails && l.errorDetails && (a.errorDetails = l.errorDetails), !a.executableCodeDetails && l.executableCodeDetails && (a.executableCodeDetails = l.executableCodeDetails), !a.functionDetails && l.functionDetails && (a.functionDetails = l.functionDetails), a.functionDetails && l.functionDetails && l !== a) {
514
+ const d = a.functionDetails, f = l.functionDetails;
507
515
  !d.askUserComponent && f.askUserComponent && (d.askUserComponent = f.askUserComponent), !d.isUi && f.isUi && (d.isUi = !0), !d.clientOutput && f.clientOutput && (d.clientOutput = f.clientOutput), d.isAskUser = d.isAskUser || f.isAskUser || !!d.askUserComponent;
508
516
  }
509
- !a.rawDetails && c.rawDetails && (a.rawDetails = c.rawDetails), !a.thoughtDetails && c.thoughtDetails && (a.thoughtDetails = c.thoughtDetails), !a.errorDetails && c.errorDetails && (a.errorDetails = c.errorDetails);
517
+ !a.rawDetails && l.rawDetails && (a.rawDetails = l.rawDetails), !a.thoughtDetails && l.thoughtDetails && (a.thoughtDetails = l.thoughtDetails), !a.errorDetails && l.errorDetails && (a.errorDetails = l.errorDetails);
510
518
  }
511
519
  return a;
512
520
  }
@@ -531,15 +539,15 @@ const we = /* @__PURE__ */ p((s, t) => {
531
539
  return o.map((a) => t[a]).join("");
532
540
  }
533
541
  static isCodeExecution(t) {
534
- return t.eventType === l.CodeExecutionResult || t.eventType === l.ExecutableCode;
542
+ return t.eventType === c.CodeExecutionResult || t.eventType === c.ExecutableCode;
535
543
  }
536
544
  };
537
545
  p(b, "InteractionPartUtils");
538
- let Ot = b;
539
- var jt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ p((s, t, o, a) => {
540
- for (var r = a > 1 ? void 0 : a ? te(t, o) : t, c = s.length - 1, d; c >= 0; c--)
541
- (d = s[c]) && (r = (a ? d(t, o, r) : d(r)) || r);
542
- return a && r && jt(t, o, r), r;
546
+ let Mt = b;
547
+ var ie = Object.defineProperty, ae = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ p((s, t, o, a) => {
548
+ for (var r = a > 1 ? void 0 : a ? ae(t, o) : t, l = s.length - 1, d; l >= 0; l--)
549
+ (d = s[l]) && (r = (a ? d(t, o, r) : d(r)) || r);
550
+ return a && r && ie(t, o, r), r;
543
551
  }, "__decorateClass");
544
552
  const C = {
545
553
  // KernelContent derived types
@@ -552,6 +560,7 @@ const C = {
552
560
  FunctionResultContent: "FunctionResultContent",
553
561
  FunctionClientOutputContent: "FunctionClientOutputContent",
554
562
  UserUiContent: "UserUiContent",
563
+ InteractionOriginContent: "InteractionOriginContent",
555
564
  // StreamingKernelContent derived types
556
565
  StreamingTextContent: "StreamingTextContent",
557
566
  StreamingFunctionCallUpdateContent: "StreamingFunctionCallUpdateContent",
@@ -559,36 +568,36 @@ const C = {
559
568
  StreamingFinalFunctionResultContent: "StreamingFinalFunctionResultContent",
560
569
  StreamingClientOutputContent: "StreamingClientOutputContent"
561
570
  };
562
- var z;
563
- let Dt = (z = class {
571
+ var B;
572
+ let It = (B = class {
564
573
  constructor() {
565
574
  e(this, "label");
566
575
  }
567
- }, p(z, "AuthorRole"), z);
576
+ }, p(B, "AuthorRole"), B);
568
577
  n([
569
578
  i(String)
570
- ], Dt.prototype, "label", 2);
571
- Dt = n([
579
+ ], It.prototype, "label", 2);
580
+ It = n([
572
581
  g({ name: "AuthorRole" })
573
- ], Dt);
574
- var B;
575
- let yt = (B = class {
582
+ ], It);
583
+ var K;
584
+ let Tt = (K = class {
576
585
  constructor() {
577
586
  e(this, "type");
578
587
  e(this, "fullName");
579
588
  }
580
- }, p(B, "EventTypeInformation"), B);
589
+ }, p(K, "EventTypeInformation"), K);
581
590
  n([
582
591
  i(String)
583
- ], yt.prototype, "type", 2);
592
+ ], Tt.prototype, "type", 2);
584
593
  n([
585
594
  i(String)
586
- ], yt.prototype, "fullName", 2);
587
- yt = n([
595
+ ], Tt.prototype, "fullName", 2);
596
+ Tt = n([
588
597
  g({ name: "EventTypeInformation" })
589
- ], yt);
590
- var K;
591
- let O = (K = class {
598
+ ], Tt);
599
+ var J;
600
+ let U = (J = class {
592
601
  constructor() {
593
602
  e(this, "id");
594
603
  e(this, "name");
@@ -605,24 +614,24 @@ let O = (K = class {
605
614
  id: this.id
606
615
  };
607
616
  }
608
- }, p(K, "LlmArtifact"), K);
617
+ }, p(J, "LlmArtifact"), J);
609
618
  n([
610
619
  i(String)
611
- ], O.prototype, "id", 2);
620
+ ], U.prototype, "id", 2);
612
621
  n([
613
622
  i(String)
614
- ], O.prototype, "name", 2);
623
+ ], U.prototype, "name", 2);
615
624
  n([
616
625
  i(String)
617
- ], O.prototype, "mimeType", 2);
626
+ ], U.prototype, "mimeType", 2);
618
627
  n([
619
628
  i(String)
620
- ], O.prototype, "description", 2);
621
- O = n([
629
+ ], U.prototype, "description", 2);
630
+ U = n([
622
631
  g({ name: "LlmArtifact" })
623
- ], O);
624
- var J;
625
- let D = (J = class {
632
+ ], U);
633
+ var V;
634
+ let x = (V = class {
626
635
  constructor() {
627
636
  e(this, "mimeType");
628
637
  // InnerContent is ignored (JsonIgnore in C#)
@@ -631,21 +640,21 @@ let D = (J = class {
631
640
  e(this, "modelId");
632
641
  e(this, "metadata");
633
642
  }
634
- }, p(J, "KernelContent"), J);
643
+ }, p(V, "KernelContent"), V);
635
644
  n([
636
645
  i(String)
637
- ], D.prototype, "mimeType", 2);
646
+ ], x.prototype, "mimeType", 2);
638
647
  n([
639
648
  i(String)
640
- ], D.prototype, "modelId", 2);
649
+ ], x.prototype, "modelId", 2);
641
650
  n([
642
- i(q)
643
- ], D.prototype, "metadata", 2);
644
- D = n([
651
+ i(H)
652
+ ], x.prototype, "metadata", 2);
653
+ x = n([
645
654
  g({ name: "KernelContent" })
646
- ], D);
647
- var V;
648
- let x = (V = class {
655
+ ], x);
656
+ var $;
657
+ let _ = ($ = class {
649
658
  constructor() {
650
659
  e(this, "choiceIndex", 0);
651
660
  // InnerContent is ignored (JsonIgnore in C#)
@@ -654,21 +663,21 @@ let x = (V = class {
654
663
  e(this, "modelId");
655
664
  e(this, "metadata");
656
665
  }
657
- }, p(V, "StreamingKernelContent"), V);
666
+ }, p($, "StreamingKernelContent"), $);
658
667
  n([
659
668
  i(Number)
660
- ], x.prototype, "choiceIndex", 2);
669
+ ], _.prototype, "choiceIndex", 2);
661
670
  n([
662
671
  i(String)
663
- ], x.prototype, "modelId", 2);
672
+ ], _.prototype, "modelId", 2);
664
673
  n([
665
674
  i(Object)
666
- ], x.prototype, "metadata", 2);
667
- x = n([
675
+ ], _.prototype, "metadata", 2);
676
+ _ = n([
668
677
  g({ name: "StreamingKernelContent" })
669
- ], x);
670
- var $;
671
- let Ft = ($ = class extends D {
678
+ ], _);
679
+ var Q;
680
+ let Et = (Q = class extends x {
672
681
  constructor() {
673
682
  super();
674
683
  e(this, "text");
@@ -680,74 +689,74 @@ let Ft = ($ = class extends D {
680
689
  toString() {
681
690
  return this.text ?? "";
682
691
  }
683
- }, p($, "TextContent"), $);
692
+ }, p(Q, "TextContent"), Q);
684
693
  n([
685
694
  i(String)
686
- ], Ft.prototype, "text", 2);
687
- Ft = n([
695
+ ], Et.prototype, "text", 2);
696
+ Et = n([
688
697
  g({ name: "TextContent" })
689
- ], Ft);
690
- var Q;
691
- let U = (Q = class extends x {
698
+ ], Et);
699
+ var Z;
700
+ let P = (Z = class extends _ {
692
701
  constructor() {
693
702
  super();
694
703
  e(this, "eventName");
695
704
  e(this, "eventData");
696
705
  e(this, "sessionId");
697
706
  }
698
- }, p(Q, "StreamingToolEventContent"), Q);
707
+ }, p(Z, "StreamingToolEventContent"), Z);
699
708
  n([
700
709
  i(String)
701
- ], U.prototype, "eventName", 2);
710
+ ], P.prototype, "eventName", 2);
702
711
  n([
703
712
  i(String)
704
- ], U.prototype, "eventData", 2);
713
+ ], P.prototype, "eventData", 2);
705
714
  n([
706
715
  i(String)
707
- ], U.prototype, "sessionId", 2);
708
- U = n([
716
+ ], P.prototype, "sessionId", 2);
717
+ P = n([
709
718
  g({ name: "StreamingToolEventContent" })
710
- ], U);
711
- var Z;
712
- let P = (Z = class extends D {
719
+ ], P);
720
+ var Y;
721
+ let G = (Y = class extends x {
713
722
  constructor() {
714
723
  super();
715
724
  e(this, "eventName");
716
725
  e(this, "eventData");
717
726
  e(this, "sessionId");
718
727
  }
719
- }, p(Z, "ToolEventContent"), Z);
728
+ }, p(Y, "ToolEventContent"), Y);
720
729
  n([
721
730
  i(String)
722
- ], P.prototype, "eventName", 2);
731
+ ], G.prototype, "eventName", 2);
723
732
  n([
724
733
  i(String)
725
- ], P.prototype, "eventData", 2);
734
+ ], G.prototype, "eventData", 2);
726
735
  n([
727
736
  i(String)
728
- ], P.prototype, "sessionId", 2);
729
- P = n([
737
+ ], G.prototype, "sessionId", 2);
738
+ G = n([
730
739
  g({ name: "ToolEventContent" })
731
- ], P);
732
- var Y;
733
- let wt = (Y = class extends D {
740
+ ], G);
741
+ var X;
742
+ let kt = (X = class extends x {
734
743
  constructor() {
735
744
  super(...arguments);
736
745
  e(this, "url");
737
746
  e(this, "dataUri");
738
747
  }
739
- }, p(Y, "ImageContent"), Y);
748
+ }, p(X, "ImageContent"), X);
740
749
  n([
741
750
  i(String)
742
- ], wt.prototype, "url", 2);
751
+ ], kt.prototype, "url", 2);
743
752
  n([
744
753
  i(String)
745
- ], wt.prototype, "dataUri", 2);
746
- wt = n([
754
+ ], kt.prototype, "dataUri", 2);
755
+ kt = n([
747
756
  g({ name: "ImageContent" })
748
- ], wt);
749
- var X;
750
- let v = (X = class extends D {
757
+ ], kt);
758
+ var j;
759
+ let R = (j = class extends x {
751
760
  constructor() {
752
761
  super(...arguments);
753
762
  e(this, "id");
@@ -757,24 +766,24 @@ let v = (X = class extends D {
757
766
  // Exception is not serializable - omit jsonMember decorator
758
767
  e(this, "exception");
759
768
  }
760
- }, p(X, "FunctionCallContent"), X);
769
+ }, p(j, "FunctionCallContent"), j);
761
770
  n([
762
771
  i(String)
763
- ], v.prototype, "id", 2);
772
+ ], R.prototype, "id", 2);
764
773
  n([
765
774
  i(String)
766
- ], v.prototype, "pluginName", 2);
775
+ ], R.prototype, "pluginName", 2);
767
776
  n([
768
777
  i(String)
769
- ], v.prototype, "functionName", 2);
778
+ ], R.prototype, "functionName", 2);
770
779
  n([
771
- i(q)
772
- ], v.prototype, "arguments", 2);
773
- v = n([
780
+ i(H)
781
+ ], R.prototype, "arguments", 2);
782
+ R = n([
774
783
  g({ name: "FunctionCallContent" })
775
- ], v);
776
- var j;
777
- let E = (j = class {
784
+ ], R);
785
+ var tt;
786
+ let E = (tt = class {
778
787
  constructor() {
779
788
  e(this, "isUi");
780
789
  e(this, "askUserComponent");
@@ -782,7 +791,7 @@ let E = (j = class {
782
791
  e(this, "cancelUi");
783
792
  e(this, "parked");
784
793
  }
785
- }, p(j, "ToolCallPresentation"), j);
794
+ }, p(tt, "ToolCallPresentation"), tt);
786
795
  n([
787
796
  i(Boolean)
788
797
  ], E.prototype, "isUi", 2);
@@ -801,9 +810,9 @@ n([
801
810
  E = n([
802
811
  g({ name: "ToolCallPresentation" })
803
812
  ], E);
804
- const ee = "aia:presentation";
805
- var tt;
806
- let R = (tt = class extends x {
813
+ const re = "aia:presentation";
814
+ var et;
815
+ let A = (et = class extends _ {
807
816
  constructor() {
808
817
  super(...arguments);
809
818
  e(this, "id");
@@ -811,24 +820,24 @@ let R = (tt = class extends x {
811
820
  e(this, "arguments");
812
821
  e(this, "presentation");
813
822
  }
814
- }, p(tt, "StreamingFinalFunctionCallContent"), tt);
823
+ }, p(et, "StreamingFinalFunctionCallContent"), et);
815
824
  n([
816
825
  i(String, { name: "callId" })
817
- ], R.prototype, "id", 2);
826
+ ], A.prototype, "id", 2);
818
827
  n([
819
828
  i(String, { name: "name" })
820
- ], R.prototype, "functionName", 2);
829
+ ], A.prototype, "functionName", 2);
821
830
  n([
822
831
  i(String)
823
- ], R.prototype, "arguments", 2);
832
+ ], A.prototype, "arguments", 2);
824
833
  n([
825
834
  i(E)
826
- ], R.prototype, "presentation", 2);
827
- R = n([
835
+ ], A.prototype, "presentation", 2);
836
+ A = n([
828
837
  g({ name: "StreamingFinalFunctionCallContent" })
829
- ], R);
830
- var et;
831
- let I = (et = class extends D {
838
+ ], A);
839
+ var nt;
840
+ let v = (nt = class extends x {
832
841
  constructor() {
833
842
  super(...arguments);
834
843
  e(this, "id");
@@ -836,24 +845,24 @@ let I = (et = class extends D {
836
845
  e(this, "functionName");
837
846
  e(this, "result");
838
847
  }
839
- }, p(et, "FunctionResultContent"), et);
848
+ }, p(nt, "FunctionResultContent"), nt);
840
849
  n([
841
850
  i(String, { name: "callId" })
842
- ], I.prototype, "id", 2);
851
+ ], v.prototype, "id", 2);
843
852
  n([
844
853
  i(String)
845
- ], I.prototype, "pluginName", 2);
854
+ ], v.prototype, "pluginName", 2);
846
855
  n([
847
856
  i(String)
848
- ], I.prototype, "functionName", 2);
857
+ ], v.prototype, "functionName", 2);
849
858
  n([
850
- i(q)
851
- ], I.prototype, "result", 2);
852
- I = n([
859
+ i(H)
860
+ ], v.prototype, "result", 2);
861
+ v = n([
853
862
  g({ name: "FunctionResultContent" })
854
- ], I);
855
- var nt;
856
- let A = (nt = class extends x {
863
+ ], v);
864
+ var ot;
865
+ let k = (ot = class extends _ {
857
866
  constructor() {
858
867
  super(...arguments);
859
868
  e(this, "id");
@@ -863,102 +872,115 @@ let A = (nt = class extends x {
863
872
  e(this, "presentation");
864
873
  e(this, "clientOutput");
865
874
  }
866
- }, p(nt, "StreamingFinalFunctionResultContent"), nt);
875
+ }, p(ot, "StreamingFinalFunctionResultContent"), ot);
867
876
  n([
868
877
  i(String, { name: "callId" })
869
- ], A.prototype, "id", 2);
878
+ ], k.prototype, "id", 2);
870
879
  n([
871
880
  i(String)
872
- ], A.prototype, "pluginName", 2);
881
+ ], k.prototype, "pluginName", 2);
873
882
  n([
874
883
  i(String)
875
- ], A.prototype, "functionName", 2);
884
+ ], k.prototype, "functionName", 2);
876
885
  n([
877
- i(q)
878
- ], A.prototype, "result", 2);
886
+ i(H)
887
+ ], k.prototype, "result", 2);
879
888
  n([
880
889
  i(E)
881
- ], A.prototype, "presentation", 2);
890
+ ], k.prototype, "presentation", 2);
882
891
  n([
883
- i(q)
884
- ], A.prototype, "clientOutput", 2);
885
- A = n([
892
+ i(H)
893
+ ], k.prototype, "clientOutput", 2);
894
+ k = n([
886
895
  g({ name: "StreamingFinalFunctionResultContent" })
887
- ], A);
888
- var ot;
889
- let Ct = (ot = class extends D {
896
+ ], k);
897
+ var it;
898
+ let xt = (it = class extends x {
890
899
  constructor() {
891
900
  super(...arguments);
892
901
  e(this, "id");
893
902
  e(this, "data");
894
903
  }
895
- }, p(ot, "FunctionClientOutputContent"), ot);
904
+ }, p(it, "FunctionClientOutputContent"), it);
896
905
  n([
897
906
  i(String, { name: "callId" })
898
- ], Ct.prototype, "id", 2);
907
+ ], xt.prototype, "id", 2);
899
908
  n([
900
- i(q)
901
- ], Ct.prototype, "data", 2);
902
- Ct = n([
909
+ i(H)
910
+ ], xt.prototype, "data", 2);
911
+ xt = n([
903
912
  g({ name: "FunctionClientOutputContent" })
904
- ], Ct);
905
- var it;
906
- let G = (it = class extends x {
913
+ ], xt);
914
+ var at;
915
+ let M = (at = class extends _ {
907
916
  constructor() {
908
917
  super(...arguments);
909
918
  e(this, "id");
910
919
  e(this, "clientOutput");
911
920
  e(this, "presentation");
912
921
  }
913
- }, p(it, "StreamingClientOutputContent"), it);
922
+ }, p(at, "StreamingClientOutputContent"), at);
914
923
  n([
915
924
  i(String, { name: "callId" })
916
- ], G.prototype, "id", 2);
925
+ ], M.prototype, "id", 2);
917
926
  n([
918
- i(q)
919
- ], G.prototype, "clientOutput", 2);
927
+ i(H)
928
+ ], M.prototype, "clientOutput", 2);
920
929
  n([
921
930
  i(E)
922
- ], G.prototype, "presentation", 2);
923
- G = n([
931
+ ], M.prototype, "presentation", 2);
932
+ M = n([
924
933
  g({ name: "StreamingClientOutputContent" })
925
- ], G);
926
- var at;
927
- let St = (at = class extends D {
934
+ ], M);
935
+ var rt;
936
+ let _t = (rt = class extends x {
928
937
  constructor() {
929
938
  super(...arguments);
930
939
  e(this, "name");
931
940
  e(this, "args");
932
941
  }
933
- }, p(at, "UserUiContent"), at);
942
+ }, p(rt, "UserUiContent"), rt);
934
943
  n([
935
944
  i(String)
936
- ], St.prototype, "name", 2);
945
+ ], _t.prototype, "name", 2);
937
946
  n([
938
947
  i(String)
939
- ], St.prototype, "args", 2);
940
- St = n([
948
+ ], _t.prototype, "args", 2);
949
+ _t = n([
941
950
  g({ name: "UserUiContent" })
942
- ], St);
943
- var rt;
944
- let Tt = (rt = class extends D {
951
+ ], _t);
952
+ var st;
953
+ let Rt = (st = class extends x {
954
+ constructor() {
955
+ super(...arguments);
956
+ e(this, "origin");
957
+ }
958
+ }, p(st, "InteractionOriginContent"), st);
959
+ n([
960
+ i(String)
961
+ ], Rt.prototype, "origin", 2);
962
+ Rt = n([
963
+ g({ name: "InteractionOriginContent" })
964
+ ], Rt);
965
+ var ct;
966
+ let Dt = (ct = class extends x {
945
967
  constructor() {
946
968
  super(...arguments);
947
969
  e(this, "role");
948
970
  e(this, "items");
949
971
  }
950
- }, p(rt, "ChatMessageContent"), rt);
972
+ }, p(ct, "ChatMessageContent"), ct);
951
973
  n([
952
- i(Dt)
953
- ], Tt.prototype, "role", 2);
974
+ i(It)
975
+ ], Dt.prototype, "role", 2);
954
976
  n([
955
- xt(() => D)
956
- ], Tt.prototype, "items", 2);
957
- Tt = n([
977
+ wt(() => x)
978
+ ], Dt.prototype, "items", 2);
979
+ Dt = n([
958
980
  g({ name: "ChatMessageContent" })
959
- ], Tt);
960
- var st;
961
- let N = (st = class extends x {
981
+ ], Dt);
982
+ var lt;
983
+ let O = (lt = class extends _ {
962
984
  constructor() {
963
985
  super(...arguments);
964
986
  e(this, "callId");
@@ -966,24 +988,24 @@ let N = (st = class extends x {
966
988
  e(this, "arguments");
967
989
  e(this, "functionCallIndex", 0);
968
990
  }
969
- }, p(st, "StreamingFunctionCallUpdateContent"), st);
991
+ }, p(lt, "StreamingFunctionCallUpdateContent"), lt);
970
992
  n([
971
993
  i(String)
972
- ], N.prototype, "callId", 2);
994
+ ], O.prototype, "callId", 2);
973
995
  n([
974
996
  i(String)
975
- ], N.prototype, "name", 2);
997
+ ], O.prototype, "name", 2);
976
998
  n([
977
999
  i(String)
978
- ], N.prototype, "arguments", 2);
1000
+ ], O.prototype, "arguments", 2);
979
1001
  n([
980
1002
  i(Number)
981
- ], N.prototype, "functionCallIndex", 2);
982
- N = n([
1003
+ ], O.prototype, "functionCallIndex", 2);
1004
+ O = n([
983
1005
  g({ name: "StreamingFunctionCallUpdateContent" })
984
- ], N);
985
- var lt;
986
- let kt = (lt = class extends x {
1006
+ ], O);
1007
+ var pt;
1008
+ let At = (pt = class extends _ {
987
1009
  constructor() {
988
1010
  super(...arguments);
989
1011
  e(this, "text");
@@ -991,15 +1013,15 @@ let kt = (lt = class extends x {
991
1013
  // Not decorated with @jsonMember
992
1014
  e(this, "encoding");
993
1015
  }
994
- }, p(lt, "StreamingTextContent"), lt);
1016
+ }, p(pt, "StreamingTextContent"), pt);
995
1017
  n([
996
1018
  i(String)
997
- ], kt.prototype, "text", 2);
998
- kt = n([
1019
+ ], At.prototype, "text", 2);
1020
+ At = n([
999
1021
  g({ name: "StreamingTextContent" })
1000
- ], kt);
1001
- var ct;
1002
- let Et = (ct = class extends x {
1022
+ ], At);
1023
+ var ut;
1024
+ let vt = (ut = class extends _ {
1003
1025
  constructor() {
1004
1026
  super(...arguments);
1005
1027
  e(this, "text");
@@ -1007,48 +1029,48 @@ let Et = (ct = class extends x {
1007
1029
  // Not decorated with @jsonMember
1008
1030
  e(this, "encoding");
1009
1031
  }
1010
- }, p(ct, "StreamingReasoningContent"), ct);
1032
+ }, p(ut, "StreamingReasoningContent"), ut);
1011
1033
  n([
1012
1034
  i(String)
1013
- ], Et.prototype, "text", 2);
1014
- Et = n([
1035
+ ], vt.prototype, "text", 2);
1036
+ vt = n([
1015
1037
  g({ name: "StreamingReasoningContent" })
1016
- ], Et);
1017
- var pt;
1018
- let At = (pt = class extends x {
1038
+ ], vt);
1039
+ var dt;
1040
+ let Ot = (dt = class extends _ {
1019
1041
  constructor() {
1020
1042
  super(...arguments);
1021
1043
  e(this, "headline");
1022
1044
  }
1023
- }, p(pt, "StreamingThoughtHighlightContent"), pt);
1045
+ }, p(dt, "StreamingThoughtHighlightContent"), dt);
1024
1046
  n([
1025
1047
  i(String)
1026
- ], At.prototype, "headline", 2);
1027
- At = n([
1048
+ ], Ot.prototype, "headline", 2);
1049
+ Ot = n([
1028
1050
  g({ name: "StreamingThoughtHighlightContent" })
1029
- ], At);
1030
- var ut;
1031
- let M = (ut = class {
1051
+ ], Ot);
1052
+ var mt;
1053
+ let q = (mt = class {
1032
1054
  constructor() {
1033
1055
  e(this, "instructionCategory", "");
1034
1056
  e(this, "description", "");
1035
1057
  e(this, "interactionId", "");
1036
1058
  }
1037
- }, p(ut, "InstructionSummary"), ut);
1059
+ }, p(mt, "InstructionSummary"), mt);
1038
1060
  n([
1039
1061
  i(String)
1040
- ], M.prototype, "instructionCategory", 2);
1062
+ ], q.prototype, "instructionCategory", 2);
1041
1063
  n([
1042
1064
  i(String)
1043
- ], M.prototype, "description", 2);
1065
+ ], q.prototype, "description", 2);
1044
1066
  n([
1045
1067
  i(String)
1046
- ], M.prototype, "interactionId", 2);
1047
- M = n([
1068
+ ], q.prototype, "interactionId", 2);
1069
+ q = n([
1048
1070
  g({ name: "InstructionSummary" })
1049
- ], M);
1050
- var dt;
1051
- let _ = (dt = class {
1071
+ ], q);
1072
+ var gt;
1073
+ let D = (gt = class {
1052
1074
  constructor() {
1053
1075
  e(this, "size", 0);
1054
1076
  e(this, "originalSize", 0);
@@ -1063,48 +1085,48 @@ let _ = (dt = class {
1063
1085
  e(this, "compressionRatio");
1064
1086
  e(this, "newOverallCount");
1065
1087
  }
1066
- }, p(dt, "SessionInformation"), dt);
1088
+ }, p(gt, "SessionInformation"), gt);
1067
1089
  n([
1068
1090
  i(Number)
1069
- ], _.prototype, "size", 2);
1091
+ ], D.prototype, "size", 2);
1070
1092
  n([
1071
1093
  i(Number)
1072
- ], _.prototype, "originalSize", 2);
1094
+ ], D.prototype, "originalSize", 2);
1073
1095
  n([
1074
1096
  i(Number)
1075
- ], _.prototype, "ratio", 2);
1097
+ ], D.prototype, "ratio", 2);
1076
1098
  n([
1077
1099
  i(Number)
1078
- ], _.prototype, "previousRatio", 2);
1100
+ ], D.prototype, "previousRatio", 2);
1079
1101
  n([
1080
1102
  i(Number)
1081
- ], _.prototype, "threshold", 2);
1103
+ ], D.prototype, "threshold", 2);
1082
1104
  n([
1083
1105
  i(Number)
1084
- ], _.prototype, "maxSize", 2);
1106
+ ], D.prototype, "maxSize", 2);
1085
1107
  n([
1086
1108
  i(String)
1087
- ], _.prototype, "id", 2);
1109
+ ], D.prototype, "id", 2);
1088
1110
  n([
1089
- xt(M)
1090
- ], _.prototype, "instructionSummaries", 2);
1111
+ wt(q)
1112
+ ], D.prototype, "instructionSummaries", 2);
1091
1113
  n([
1092
1114
  i(Number)
1093
- ], _.prototype, "interactionsCompressed", 2);
1115
+ ], D.prototype, "interactionsCompressed", 2);
1094
1116
  n([
1095
1117
  i(Number)
1096
- ], _.prototype, "interactionsRemoved", 2);
1118
+ ], D.prototype, "interactionsRemoved", 2);
1097
1119
  n([
1098
1120
  i(Number)
1099
- ], _.prototype, "compressionRatio", 2);
1121
+ ], D.prototype, "compressionRatio", 2);
1100
1122
  n([
1101
1123
  i(Number)
1102
- ], _.prototype, "newOverallCount", 2);
1103
- _ = n([
1124
+ ], D.prototype, "newOverallCount", 2);
1125
+ D = n([
1104
1126
  g({ name: "SessionInformation" })
1105
- ], _);
1106
- var mt;
1107
- let S = (mt = class {
1127
+ ], D);
1128
+ var ft;
1129
+ let S = (ft = class {
1108
1130
  constructor() {
1109
1131
  e(this, "timestamp");
1110
1132
  e(this, "mimeType");
@@ -1125,7 +1147,7 @@ let S = (mt = class {
1125
1147
  e(this, "detachedRunName");
1126
1148
  e(this, "text");
1127
1149
  }
1128
- }, p(mt, "LlmEvent"), mt);
1150
+ }, p(ft, "LlmEvent"), ft);
1129
1151
  n([
1130
1152
  i(Number)
1131
1153
  ], S.prototype, "timestamp", 2);
@@ -1148,34 +1170,34 @@ n([
1148
1170
  i(String)
1149
1171
  ], S.prototype, "interactionId", 2);
1150
1172
  n([
1151
- i(_)
1173
+ i(D)
1152
1174
  ], S.prototype, "sessionInformation", 2);
1153
1175
  n([
1154
- i(yt)
1176
+ i(Tt)
1155
1177
  ], S.prototype, "eventType", 2);
1156
1178
  n([
1157
- xt(O)
1179
+ wt(U)
1158
1180
  ], S.prototype, "artifactsGenerated", 2);
1159
1181
  n([
1160
1182
  i(String)
1161
1183
  ], S.prototype, "author", 2);
1162
1184
  n([
1163
- i(Dt)
1185
+ i(It)
1164
1186
  ], S.prototype, "role", 2);
1165
1187
  n([
1166
1188
  i(String)
1167
1189
  ], S.prototype, "command", 2);
1168
1190
  n([
1169
- i(Tt)
1191
+ i(Dt)
1170
1192
  ], S.prototype, "content", 2);
1171
1193
  n([
1172
- xt(() => x)
1194
+ wt(() => _)
1173
1195
  ], S.prototype, "streamingParts", 2);
1174
1196
  S = n([
1175
1197
  g({ name: "LlmEvent" })
1176
1198
  ], S);
1177
- var gt;
1178
- let F = (gt = class {
1199
+ var ht;
1200
+ let w = (ht = class {
1179
1201
  constructor() {
1180
1202
  e(this, "timeStamp");
1181
1203
  e(this, "partialText");
@@ -1188,97 +1210,129 @@ let F = (gt = class {
1188
1210
  e(this, "partialEventType");
1189
1211
  e(this, "detachedRunId");
1190
1212
  }
1191
- }, p(gt, "PartialLlmEvent"), gt);
1213
+ }, p(ht, "PartialLlmEvent"), ht);
1192
1214
  n([
1193
1215
  i(Number, { name: "ts" })
1194
- ], F.prototype, "timeStamp", 2);
1216
+ ], w.prototype, "timeStamp", 2);
1195
1217
  n([
1196
1218
  i(String, { name: "pt" })
1197
- ], F.prototype, "partialText", 2);
1219
+ ], w.prototype, "partialText", 2);
1198
1220
  n([
1199
1221
  i(String, { name: "pr" })
1200
- ], F.prototype, "partialReasoning", 2);
1222
+ ], w.prototype, "partialReasoning", 2);
1201
1223
  n([
1202
1224
  i(String, { name: "fn" })
1203
- ], F.prototype, "functionName", 2);
1225
+ ], w.prototype, "functionName", 2);
1204
1226
  n([
1205
- xt(() => x)
1206
- ], F.prototype, "streamingParts", 2);
1227
+ wt(() => _)
1228
+ ], w.prototype, "streamingParts", 2);
1207
1229
  n([
1208
1230
  i(String, { name: "fid" })
1209
- ], F.prototype, "functionCallId", 2);
1231
+ ], w.prototype, "functionCallId", 2);
1210
1232
  n([
1211
1233
  i(String, { name: "tp" })
1212
- ], F.prototype, "type", 2);
1234
+ ], w.prototype, "type", 2);
1213
1235
  n([
1214
1236
  i(String, { name: "itid" })
1215
- ], F.prototype, "iteractionId", 2);
1237
+ ], w.prototype, "iteractionId", 2);
1216
1238
  n([
1217
- i(yt)
1218
- ], F.prototype, "partialEventType", 2);
1239
+ i(Tt)
1240
+ ], w.prototype, "partialEventType", 2);
1219
1241
  n([
1220
1242
  i(String, { name: "said" })
1221
- ], F.prototype, "detachedRunId", 2);
1222
- F = n([
1243
+ ], w.prototype, "detachedRunId", 2);
1244
+ w = n([
1223
1245
  g({ name: "PartialLlmEvent" })
1224
- ], F);
1225
- var ft;
1226
- let k = (ft = class {
1246
+ ], w);
1247
+ var yt;
1248
+ let N = (yt = class {
1249
+ constructor() {
1250
+ e(this, "interactionId");
1251
+ e(this, "content");
1252
+ e(this, "origin");
1253
+ e(this, "agentId");
1254
+ e(this, "detachedRunId");
1255
+ }
1256
+ }, p(yt, "InteractionStart"), yt);
1257
+ n([
1258
+ i(String)
1259
+ ], N.prototype, "interactionId", 2);
1260
+ n([
1261
+ i(String)
1262
+ ], N.prototype, "content", 2);
1263
+ n([
1264
+ i(String)
1265
+ ], N.prototype, "origin", 2);
1266
+ n([
1267
+ i(String)
1268
+ ], N.prototype, "agentId", 2);
1269
+ n([
1270
+ i(String)
1271
+ ], N.prototype, "detachedRunId", 2);
1272
+ N = n([
1273
+ g({ name: "InteractionStart" })
1274
+ ], N);
1275
+ var Ct;
1276
+ let I = (Ct = class {
1227
1277
  constructor() {
1228
1278
  e(this, "type");
1229
1279
  e(this, "event");
1230
1280
  e(this, "sessionId");
1231
1281
  e(this, "accessToken");
1232
1282
  e(this, "partialEvent");
1283
+ e(this, "interaction");
1233
1284
  e(this, "detachedRunId");
1234
1285
  e(this, "detachedRunName");
1235
1286
  e(this, "seq");
1236
1287
  }
1237
- }, p(ft, "StreamingResponse"), ft);
1288
+ }, p(Ct, "StreamingResponse"), Ct);
1238
1289
  n([
1239
1290
  i(String)
1240
- ], k.prototype, "type", 2);
1291
+ ], I.prototype, "type", 2);
1241
1292
  n([
1242
1293
  i(S)
1243
- ], k.prototype, "event", 2);
1294
+ ], I.prototype, "event", 2);
1244
1295
  n([
1245
1296
  i(String)
1246
- ], k.prototype, "sessionId", 2);
1297
+ ], I.prototype, "sessionId", 2);
1247
1298
  n([
1248
1299
  i(String)
1249
- ], k.prototype, "accessToken", 2);
1300
+ ], I.prototype, "accessToken", 2);
1250
1301
  n([
1251
- i(F, { name: "pe" })
1252
- ], k.prototype, "partialEvent", 2);
1302
+ i(w, { name: "pe" })
1303
+ ], I.prototype, "partialEvent", 2);
1304
+ n([
1305
+ i(N)
1306
+ ], I.prototype, "interaction", 2);
1253
1307
  n([
1254
1308
  i(String)
1255
- ], k.prototype, "detachedRunId", 2);
1309
+ ], I.prototype, "detachedRunId", 2);
1256
1310
  n([
1257
1311
  i(String)
1258
- ], k.prototype, "detachedRunName", 2);
1312
+ ], I.prototype, "detachedRunName", 2);
1259
1313
  n([
1260
1314
  i(Number)
1261
- ], k.prototype, "seq", 2);
1262
- k = n([
1315
+ ], I.prototype, "seq", 2);
1316
+ I = n([
1263
1317
  g({ name: "StreamingResponse" })
1264
- ], k);
1265
- var ht;
1266
- let Ut = (ht = class {
1318
+ ], I);
1319
+ var St;
1320
+ let qt = (St = class {
1267
1321
  constructor() {
1268
1322
  e(this, "events");
1269
1323
  }
1270
- }, p(ht, "Payload"), ht);
1324
+ }, p(St, "Payload"), St);
1271
1325
  n([
1272
- xt(S)
1273
- ], Ut.prototype, "events", 2);
1274
- Ut = n([
1326
+ wt(S)
1327
+ ], qt.prototype, "events", 2);
1328
+ qt = n([
1275
1329
  g({ name: "Payload" })
1276
- ], Ut);
1277
- function Wt(s) {
1330
+ ], qt);
1331
+ function Kt(s) {
1278
1332
  var r;
1279
- const t = (s == null ? void 0 : s.presentation) ?? ((r = s == null ? void 0 : s.metadata) == null ? void 0 : r[ee]);
1333
+ const t = (s == null ? void 0 : s.presentation) ?? ((r = s == null ? void 0 : s.metadata) == null ? void 0 : r[re]);
1280
1334
  if (!t || typeof t != "object") return { isUi: !1 };
1281
- const o = t, a = /* @__PURE__ */ p((c, d) => o[c] ?? o[d], "pick");
1335
+ const o = t, a = /* @__PURE__ */ p((l, d) => o[l] ?? o[d], "pick");
1282
1336
  return {
1283
1337
  isUi: a("isUi", "IsUi") === !0,
1284
1338
  askUserComponent: a("askUserComponent", "AskUserComponent") || void 0,
@@ -1289,8 +1343,8 @@ function Wt(s) {
1289
1343
  parked: a("parked", "Parked") === !0 || void 0
1290
1344
  };
1291
1345
  }
1292
- p(Wt, "readPresentation");
1293
- const w = class w {
1346
+ p(Kt, "readPresentation");
1347
+ const F = class F {
1294
1348
  constructor(t) {
1295
1349
  e(this, "uniqueId");
1296
1350
  e(this, "mimeType");
@@ -1326,10 +1380,10 @@ const w = class w {
1326
1380
  this.interactionId = t, this.author = "main";
1327
1381
  }
1328
1382
  static createErrorEvent(t, o) {
1329
- const a = new w(o);
1383
+ const a = new F(o);
1330
1384
  a.turn_complete = !0, a.partial = !1, a.parts = [];
1331
1385
  const r = {
1332
- eventType: l.ServerError,
1386
+ eventType: c.ServerError,
1333
1387
  errorDetails: {
1334
1388
  errorMessage: t
1335
1389
  },
@@ -1343,15 +1397,15 @@ const w = class w {
1343
1397
  return a.parts.push(r), a;
1344
1398
  }
1345
1399
  static parseFlatPropertiesTypedEvent(t) {
1346
- var a, r, c;
1347
- const o = new w(t.interactionId);
1348
- if (o.serverError = t.serverError, !t.interactionId && !w.carriesServerError(t))
1400
+ var a, r, l;
1401
+ const o = new F(t.interactionId);
1402
+ if (o.serverError = t.serverError, !t.interactionId && !F.carriesServerError(t))
1349
1403
  throw new Error("Interaction ID is required");
1350
1404
  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"', {
1351
1405
  interactionId: t.interactionId,
1352
1406
  turnComplete: t.turnComplete
1353
1407
  }), t == null ? void 0 : t.author) {
1354
- case Yt:
1408
+ case ee:
1355
1409
  o.author = "tool";
1356
1410
  break;
1357
1411
  case "system":
@@ -1360,26 +1414,26 @@ const w = class w {
1360
1414
  default:
1361
1415
  o.author = "main";
1362
1416
  }
1363
- return o.mimeType = t.mimeType, o.created = new Date(t.timestamp), o.eventType = l.NotDefined, o.partial = ((c = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : c.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.detachedRunId = t.detachedRunId, o.detachedRunName = t.detachedRunName, o;
1417
+ return o.mimeType = t.mimeType, o.created = new Date(t.timestamp), o.eventType = c.NotDefined, o.partial = ((l = (r = t.partial) == null ? void 0 : r.toString()) == null ? void 0 : l.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.detachedRunId = t.detachedRunId, o.detachedRunName = t.detachedRunName, o;
1364
1418
  }
1365
1419
  static getPartType(t) {
1366
- return t instanceof Ft ? "TextContent" : t instanceof v ? "FunctionCallContent" : t instanceof I ? "FunctionResultContent" : t instanceof N ? "StreamingFunctionCallUpdateContent" : t instanceof R ? "StreamingFinalFunctionCallContent" : t instanceof A ? "StreamingFinalFunctionResultContent" : t instanceof Ct ? "FunctionClientOutputContent" : t instanceof G ? "StreamingClientOutputContent" : t instanceof St ? "UserUiContent" : t instanceof kt ? "StreamingTextContent" : t instanceof Et ? "StreamingReasoningContent" : t instanceof At ? "StreamingThoughtHighlightContent" : t instanceof P ? "ToolEventContent" : t instanceof U ? "StreamingToolEventContent" : "Unknown";
1420
+ return t instanceof Et ? "TextContent" : t instanceof R ? "FunctionCallContent" : t instanceof v ? "FunctionResultContent" : t instanceof O ? "StreamingFunctionCallUpdateContent" : t instanceof A ? "StreamingFinalFunctionCallContent" : t instanceof k ? "StreamingFinalFunctionResultContent" : t instanceof xt ? "FunctionClientOutputContent" : t instanceof M ? "StreamingClientOutputContent" : t instanceof _t ? "UserUiContent" : t instanceof Rt ? "InteractionOriginContent" : t instanceof At ? "StreamingTextContent" : t instanceof vt ? "StreamingReasoningContent" : t instanceof Ot ? "StreamingThoughtHighlightContent" : t instanceof G ? "ToolEventContent" : t instanceof P ? "StreamingToolEventContent" : "Unknown";
1367
1421
  }
1368
1422
  /** True when the event holds the SDK's "Server Error" sentinel call (`Event.GetErrorEvent`). */
1369
1423
  static carriesServerError(t) {
1370
1424
  var a;
1371
- return (((a = t.content) == null ? void 0 : a.items) ?? []).some((r) => (r == null ? void 0 : r.id) === w.SERVER_ERROR_CALL_ID);
1425
+ return (((a = t.content) == null ? void 0 : a.items) ?? []).some((r) => (r == null ? void 0 : r.id) === F.SERVER_ERROR_CALL_ID);
1372
1426
  }
1373
1427
  static parseFromTypedEvent(t) {
1374
- var c, d, f, H, Pt, Gt, Mt;
1375
- const o = w.parseFlatPropertiesTypedEvent(t);
1428
+ var l, d, f, W, Ht, Wt, Lt;
1429
+ const o = F.parseFlatPropertiesTypedEvent(t);
1376
1430
  if (o.serverError)
1377
- return o.parts.push(Ot.fromError(o.serverError)), o;
1431
+ return o.parts.push(Mt.fromError(o.serverError)), o;
1378
1432
  if (!t.content && !t.streamingParts)
1379
1433
  return o;
1380
1434
  o.parts = [];
1381
- const a = [...((c = t.content) == null ? void 0 : c.items) ?? [], ...t.streamingParts ?? []];
1382
- o.eventType = Xt(((d = t.eventType) == null ? void 0 : d.type) ?? "");
1435
+ const a = [...((l = t.content) == null ? void 0 : l.items) ?? [], ...t.streamingParts ?? []];
1436
+ o.eventType = oe(((d = t.eventType) == null ? void 0 : d.type) ?? "");
1383
1437
  for (const h of a) {
1384
1438
  let u = {
1385
1439
  id: "",
@@ -1391,34 +1445,34 @@ const w = class w {
1391
1445
  mustPush: !1,
1392
1446
  textAppendable: !1
1393
1447
  };
1394
- const y = w.getPartType(h);
1448
+ const y = F.getPartType(h);
1395
1449
  if (y == C.FunctionCallContent || y == C.FunctionResultContent || y == C.StreamingFinalFunctionCallContent || y == C.StreamingFinalFunctionResultContent) {
1396
1450
  var r = h;
1397
- if (r.id == w.SERVER_ERROR_CALL_ID) {
1398
- const m = r.arguments ?? {}, W = typeof m.error == "string" && m.error.trim().length > 0 ? m.error : JSON.stringify(r.arguments);
1399
- u.eventType = l.ServerError, u.errorDetails = {
1400
- errorMessage: W,
1451
+ if (r.id == F.SERVER_ERROR_CALL_ID) {
1452
+ const m = r.arguments ?? {}, L = typeof m.error == "string" && m.error.trim().length > 0 ? m.error : JSON.stringify(r.arguments);
1453
+ u.eventType = c.ServerError, u.errorDetails = {
1454
+ errorMessage: L,
1401
1455
  stackTrace: typeof m.stackTrace == "string" ? m.stackTrace : void 0
1402
1456
  }, u.functionDetails = void 0;
1403
1457
  } else {
1404
- u.eventType = y == C.FunctionCallContent || y == C.StreamingFinalFunctionCallContent ? l.FunctionCall : l.FunctionResponse;
1458
+ u.eventType = y == C.FunctionCallContent || y == C.StreamingFinalFunctionCallContent ? c.FunctionCall : c.FunctionResponse;
1405
1459
  let m;
1406
1460
  try {
1407
1461
  if (r != null && r.result)
1408
1462
  if (typeof r.result == "object")
1409
1463
  m = r.result;
1410
1464
  else if (typeof r.result == "string") {
1411
- const _t = JSON.parse(r.result);
1412
- m = typeof _t == "object" && _t !== null ? _t : r.result;
1465
+ const Ft = JSON.parse(r.result);
1466
+ m = typeof Ft == "object" && Ft !== null ? Ft : r.result;
1413
1467
  } else
1414
1468
  m = r.result;
1415
- } catch (_t) {
1416
- console.warn("Parse function error", _t), m = r == null ? void 0 : r.result;
1469
+ } catch (Ft) {
1470
+ console.warn("Parse function error", Ft), m = r == null ? void 0 : r.result;
1417
1471
  }
1418
1472
  u.thoughtDetails = {
1419
1473
  text: ""
1420
1474
  };
1421
- const W = Wt(r);
1475
+ const L = Kt(r);
1422
1476
  u.functionDetails = {
1423
1477
  id: (r == null ? void 0 : r.id) ?? "",
1424
1478
  args: r == null ? void 0 : r.arguments,
@@ -1431,37 +1485,37 @@ const w = class w {
1431
1485
  end: y == C.FunctionResultContent || y == C.StreamingFinalFunctionResultContent ? o.created : void 0,
1432
1486
  text: JSON.stringify(r == null ? void 0 : r.arguments) ?? "",
1433
1487
  name: (r == null ? void 0 : r.functionName) ?? "",
1434
- status: u.eventType == l.FunctionCall ? "Executing" : "Done",
1488
+ status: u.eventType == c.FunctionCall ? "Executing" : "Done",
1435
1489
  response: m,
1436
- isUi: W.isUi,
1437
- argsDescription: W.argsDescription,
1490
+ isUi: L.isUi,
1491
+ argsDescription: L.argsDescription,
1438
1492
  // Client-only payload riding the RESULT event: live top-level `clientOutput`, or
1439
1493
  // metadata.clientOutput on the collapsed/persisted result. Calls leave it undefined.
1440
1494
  // The persisted-replay form also folds in via FunctionClientOutputContent.
1441
1495
  clientOutput: (r == null ? void 0 : r.clientOutput) ?? ((f = r == null ? void 0 : r.metadata) == null ? void 0 : f.clientOutput),
1442
- askUserComponent: W.askUserComponent,
1496
+ askUserComponent: L.askUserComponent,
1443
1497
  // Runtime "don't render" override on a RESULT (CallContext.CancelUiRender).
1444
- cancelUi: W.cancelUi
1498
+ cancelUi: L.cancelUi
1445
1499
  }, u.functionDetails.isAskUser = !!u.functionDetails.askUserComponent, t.text = r == null ? void 0 : r.arguments;
1446
1500
  }
1447
1501
  } else if (y == C.StreamingTextContent)
1448
- u.eventType = l.Text, u.text = (H = h == null ? void 0 : h.text) == null ? void 0 : H.replaceAll("\\n", `
1502
+ u.eventType = c.Text, u.text = (W = h == null ? void 0 : h.text) == null ? void 0 : W.replaceAll("\\n", `
1449
1503
  `), t.text = u.text;
1450
1504
  else if (y == C.TextContent)
1451
- u.eventType = l.Text, u.text = (Pt = h == null ? void 0 : h.text) == null ? void 0 : Pt.replaceAll("\\n", `
1505
+ u.eventType = c.Text, u.text = (Ht = h == null ? void 0 : h.text) == null ? void 0 : Ht.replaceAll("\\n", `
1452
1506
  `), t.text = u.text;
1453
1507
  else if (y == C.StreamingReasoningContent)
1454
- u.eventType = l.Thought, u.thoughtDetails = {
1455
- text: ((Gt = h == null ? void 0 : h.text) == null ? void 0 : Gt.replaceAll("\\n", `
1508
+ u.eventType = c.Thought, u.thoughtDetails = {
1509
+ text: ((Wt = h == null ? void 0 : h.text) == null ? void 0 : Wt.replaceAll("\\n", `
1456
1510
  `)) ?? ""
1457
- }, u.text = (Mt = h == null ? void 0 : h.text) == null ? void 0 : Mt.replaceAll("\\n", `
1511
+ }, u.text = (Lt = h == null ? void 0 : h.text) == null ? void 0 : Lt.replaceAll("\\n", `
1458
1512
  `), t.text = u.text;
1459
1513
  else if (y == C.StreamingThoughtHighlightContent) {
1460
1514
  const m = (h == null ? void 0 : h.headline) ?? "";
1461
- u.eventType = l.ThoughtHighlight, u.thoughtDetails = { text: "", headlines: m ? [m] : [] };
1515
+ u.eventType = c.ThoughtHighlight, u.thoughtDetails = { text: "", headlines: m ? [m] : [] };
1462
1516
  } else if (y == C.StreamingFunctionCallUpdateContent) {
1463
1517
  const m = h;
1464
- u.eventType = l.PartialFunctionCall, u.text = m.arguments, u.thoughtDetails = {
1518
+ u.eventType = c.PartialFunctionCall, u.text = m.arguments, u.thoughtDetails = {
1465
1519
  text: ""
1466
1520
  }, u.functionDetails = {
1467
1521
  id: m.callId ?? "",
@@ -1470,7 +1524,7 @@ const w = class w {
1470
1524
  name: (m == null ? void 0 : m.name) ?? "Unknown"
1471
1525
  }, t.text = u.text;
1472
1526
  } else if (y == C.ToolEventContent || y == C.StreamingToolEventContent) {
1473
- u.eventType = l.ToolEvent;
1527
+ u.eventType = c.ToolEvent;
1474
1528
  const m = h;
1475
1529
  u.toolDetails = {
1476
1530
  eventName: m.eventName ?? "",
@@ -1479,7 +1533,7 @@ const w = class w {
1479
1533
  };
1480
1534
  } else if (y == C.FunctionClientOutputContent) {
1481
1535
  const m = h;
1482
- u.eventType = l.FunctionClientOutput, u.functionDetails = {
1536
+ u.eventType = c.FunctionClientOutput, u.functionDetails = {
1483
1537
  id: m.id ?? "",
1484
1538
  name: "",
1485
1539
  status: "Done",
@@ -1487,7 +1541,7 @@ const w = class w {
1487
1541
  };
1488
1542
  } else if (y == C.StreamingClientOutputContent) {
1489
1543
  const m = h;
1490
- u.eventType = l.FunctionClientOutput, u.functionDetails = {
1544
+ u.eventType = c.FunctionClientOutput, u.functionDetails = {
1491
1545
  id: m.id ?? "",
1492
1546
  name: "",
1493
1547
  // The parked call stays Executing; interactionService folds only clientOutput onto it and
@@ -1495,11 +1549,11 @@ const w = class w {
1495
1549
  status: "Executing",
1496
1550
  clientOutput: m.clientOutput,
1497
1551
  // The park signal itself (the reason this event fires even with no prefill).
1498
- parked: Wt(m).parked
1552
+ parked: Kt(m).parked
1499
1553
  };
1500
1554
  } else if (y == C.UserUiContent) {
1501
1555
  const m = h;
1502
- u.eventType = l.UserAnswer, u.author = "user", u.functionDetails = {
1556
+ u.eventType = c.UserAnswer, u.author = "user", u.functionDetails = {
1503
1557
  id: "",
1504
1558
  name: m.name ?? "",
1505
1559
  args: m.args,
@@ -1507,7 +1561,9 @@ const w = class w {
1507
1561
  isUi: !0
1508
1562
  };
1509
1563
  } else {
1510
- u.eventType = l.NotDefined, console.warn(`Got a unmapped event_type:${o.eventType}, data:`, y, h);
1564
+ if (y == C.InteractionOriginContent)
1565
+ continue;
1566
+ u.eventType = c.NotDefined, console.warn(`Got a unmapped event_type:${o.eventType}, data:`, y, h);
1511
1567
  continue;
1512
1568
  }
1513
1569
  o.parts.push(u);
@@ -1518,10 +1574,10 @@ const w = class w {
1518
1574
  return {
1519
1575
  author: "main",
1520
1576
  visible: !0,
1521
- eventType: l.Thought,
1577
+ eventType: c.Thought,
1522
1578
  uniqueId: (/* @__PURE__ */ new Date()).getTime().toString(),
1523
1579
  interactionId: t,
1524
- allEventTypes: [l.Thought],
1580
+ allEventTypes: [c.Thought],
1525
1581
  artifactsDelta: [""],
1526
1582
  model_session_id: "",
1527
1583
  created: /* @__PURE__ */ new Date(),
@@ -1541,9 +1597,9 @@ const w = class w {
1541
1597
  // a part the UI cannot show. Only the demo's fake gateway builds
1542
1598
  // thoughts this way, which is why it went unnoticed.
1543
1599
  text: o,
1544
- id: It(),
1600
+ id: Ut(),
1545
1601
  created: /* @__PURE__ */ new Date(),
1546
- eventType: l.Thought,
1602
+ eventType: c.Thought,
1547
1603
  author: "main",
1548
1604
  textAppendable: !0,
1549
1605
  partial: !0,
@@ -1553,7 +1609,7 @@ const w = class w {
1553
1609
  };
1554
1610
  }
1555
1611
  static createFromFunctionName(t, o, a) {
1556
- const r = w.createFromText("", o);
1612
+ const r = F.createFromText("", o);
1557
1613
  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 = {
1558
1614
  name: t,
1559
1615
  id: "callId",
@@ -1568,10 +1624,10 @@ const w = class w {
1568
1624
  return {
1569
1625
  author: "main",
1570
1626
  visible: !0,
1571
- eventType: l.Text,
1627
+ eventType: c.Text,
1572
1628
  uniqueId: (/* @__PURE__ */ new Date()).getTime().toString(),
1573
1629
  interactionId: o,
1574
- allEventTypes: [l.Text],
1630
+ allEventTypes: [c.Text],
1575
1631
  artifactsDelta: [""],
1576
1632
  model_session_id: "",
1577
1633
  created: /* @__PURE__ */ new Date(),
@@ -1588,7 +1644,7 @@ const w = class w {
1588
1644
  thoughtDetails: a ? {
1589
1645
  text: a
1590
1646
  } : void 0,
1591
- id: It(),
1647
+ id: Ut(),
1592
1648
  created: /* @__PURE__ */ new Date(),
1593
1649
  // Part eventType MUST match the outer event's eventType.
1594
1650
  // Was previously `Thought` here, which made the merger
@@ -1596,7 +1652,7 @@ const w = class w {
1596
1652
  // in the trace strip instead of the message body) —
1597
1653
  // the chat would show the message during streaming and
1598
1654
  // then "disappear" once the part was reclassified.
1599
- eventType: l.Text,
1655
+ eventType: c.Text,
1600
1656
  author: "main",
1601
1657
  textAppendable: !0,
1602
1658
  partial: !0,
@@ -1607,90 +1663,91 @@ const w = class w {
1607
1663
  };
1608
1664
  }
1609
1665
  };
1610
- p(w, "ServerEvent"), /** The call id the SDK puts on its error sentinel (`Event.ServerErrorIdentification`). */
1611
- e(w, "SERVER_ERROR_CALL_ID", "Server Error");
1612
- let Lt = w;
1613
- const Bt = [
1666
+ p(F, "ServerEvent"), /** The call id the SDK puts on its error sentinel (`Event.ServerErrorIdentification`). */
1667
+ e(F, "SERVER_ERROR_CALL_ID", "Server Error");
1668
+ let Jt = F;
1669
+ const $t = [
1614
1670
  // KernelContent derived types
1615
- Ft,
1616
- wt,
1671
+ Et,
1672
+ kt,
1673
+ R,
1674
+ G,
1617
1675
  v,
1618
- P,
1619
- I,
1620
- Ct,
1621
- St,
1622
- Tt,
1676
+ xt,
1677
+ _t,
1678
+ Rt,
1679
+ Dt,
1623
1680
  // StreamingKernelContent derived types
1624
- kt,
1625
- N,
1626
- Et,
1627
1681
  At,
1628
- U,
1629
- R,
1682
+ O,
1683
+ vt,
1684
+ Ot,
1685
+ P,
1630
1686
  A,
1631
- G,
1632
- M
1687
+ k,
1688
+ M,
1689
+ q
1633
1690
  ];
1634
- function ne(s) {
1691
+ function se(s) {
1635
1692
  return s.name;
1636
1693
  }
1637
- p(ne, "getConstructorName");
1638
- function Kt(s, t, o, a) {
1639
- t.constructor !== o && (s.$type = (a == null ? void 0 : a.name) ?? ne(t.constructor));
1694
+ p(se, "getConstructorName");
1695
+ function Qt(s, t, o, a) {
1696
+ t.constructor !== o && (s.$type = (a == null ? void 0 : a.name) ?? se(t.constructor));
1640
1697
  }
1641
- p(Kt, "dotNetTypeEmitter");
1642
- function Jt(s, t) {
1698
+ p(Qt, "dotNetTypeEmitter");
1699
+ function Zt(s, t) {
1643
1700
  if (s.$type != null)
1644
1701
  return t.get(s.$type);
1645
1702
  }
1646
- p(Jt, "dotnetTypeResolver");
1647
- function Vt() {
1648
- const s = new zt(S);
1703
+ p(Zt, "dotnetTypeResolver");
1704
+ function Yt() {
1705
+ const s = new Vt(S);
1649
1706
  return s.config({
1650
- knownTypes: Bt,
1651
- typeHintEmitter: Kt,
1652
- typeResolver: Jt
1707
+ knownTypes: $t,
1708
+ typeHintEmitter: Qt,
1709
+ typeResolver: Zt
1653
1710
  }), s;
1654
1711
  }
1655
- p(Vt, "createEventSerializer");
1656
- function oe() {
1657
- const s = new zt(k);
1712
+ p(Yt, "createEventSerializer");
1713
+ function ce() {
1714
+ const s = new Vt(I);
1658
1715
  return s.config({
1659
- knownTypes: Bt,
1660
- typeHintEmitter: Kt,
1661
- typeResolver: Jt
1716
+ knownTypes: $t,
1717
+ typeHintEmitter: Qt,
1718
+ typeResolver: Zt
1662
1719
  }), s;
1663
1720
  }
1664
- p(oe, "createStreamingResponseSerializer");
1665
- function $t(s) {
1721
+ p(ce, "createStreamingResponseSerializer");
1722
+ function Xt(s) {
1666
1723
  try {
1667
1724
  return JSON.parse(s), s;
1668
1725
  } catch {
1669
1726
  let o = "", a = !1;
1670
1727
  for (let r = 0; r < s.length; r++) {
1671
- const c = s[r], d = c.charCodeAt(0);
1672
- if (c === "\\" && a && r + 1 < s.length) {
1728
+ const l = s[r], d = l.charCodeAt(0);
1729
+ if (l === "\\" && a && r + 1 < s.length) {
1673
1730
  const f = s[r + 1];
1674
1731
  if (f === '"' || f === "\\" || f === "/" || f === "b" || f === "f" || f === "n" || f === "r" || f === "t") {
1675
- o += c + f, r++;
1732
+ o += l + f, r++;
1676
1733
  continue;
1677
1734
  } else if (f === "u" && r + 5 < s.length) {
1678
1735
  o += s.substring(r, r + 6), r += 5;
1679
1736
  continue;
1680
1737
  } else {
1681
- o += c;
1738
+ o += l;
1682
1739
  continue;
1683
1740
  }
1684
1741
  }
1685
- if (c === '"') {
1742
+ if (l === '"') {
1686
1743
  let f = 0;
1687
- for (let H = r - 1; H >= 0 && s[H] === "\\"; H--)
1744
+ for (let W = r - 1; W >= 0 && s[W] === "\\"; W--)
1688
1745
  f++;
1689
- f % 2 === 0 && (a = !a), o += c;
1746
+ f % 2 === 0 && (a = !a), o += l;
1690
1747
  continue;
1691
1748
  }
1692
1749
  if (a && d < 32)
1693
- switch (c) {
1750
+ switch (l) {
1694
1751
  case `
1695
1752
  `:
1696
1753
  o += "\\n";
@@ -1713,61 +1770,64 @@ function $t(s) {
1713
1770
  break;
1714
1771
  }
1715
1772
  else
1716
- o += c;
1773
+ o += l;
1717
1774
  }
1718
1775
  return o;
1719
1776
  }
1720
1777
  }
1721
- p($t, "sanitizeJsonString");
1722
- function ke(s) {
1723
- const t = $t(s);
1724
- return oe().parse(t);
1778
+ p(Xt, "sanitizeJsonString");
1779
+ function Oe(s) {
1780
+ const t = Xt(s);
1781
+ return ce().parse(t);
1725
1782
  }
1726
- p(ke, "deserializePayload");
1727
- function Ee(s) {
1728
- const t = $t(s);
1729
- return Vt().parse(t);
1783
+ p(Oe, "deserializePayload");
1784
+ function Ne(s) {
1785
+ const t = Xt(s);
1786
+ return Yt().parse(t);
1730
1787
  }
1731
- p(Ee, "deserializeEvent");
1732
- function Ae(s) {
1733
- return Vt().stringify(s);
1788
+ p(Ne, "deserializeEvent");
1789
+ function be(s) {
1790
+ return Yt().stringify(s);
1734
1791
  }
1735
- p(Ae, "serializeEvent");
1792
+ p(be, "serializeEvent");
1736
1793
  export {
1737
- xe as A,
1738
- fe as C,
1739
- l as E,
1740
- v as F,
1741
- Xt as G,
1742
- Ot as I,
1794
+ Ee as A,
1795
+ xe as C,
1796
+ c as E,
1797
+ R as F,
1798
+ oe as G,
1799
+ Rt as I,
1743
1800
  S as L,
1744
- De as M,
1801
+ Re as M,
1745
1802
  C as P,
1746
- ye as R,
1747
- Lt as S,
1748
- Ft as T,
1749
- Te as a,
1750
- Rt as b,
1751
- Se as c,
1752
- Ce as d,
1753
- me as e,
1754
- Tt as f,
1755
- he as g,
1756
- I as h,
1757
- T as i,
1758
- ge as j,
1759
- _e as k,
1760
- N as l,
1761
- Et as m,
1762
- k as n,
1763
- kt as o,
1764
- Vt as p,
1765
- oe as q,
1766
- Ee as r,
1767
- ke as s,
1768
- we as t,
1769
- Fe as u,
1770
- $t as v,
1771
- Ae as w
1803
+ De as R,
1804
+ Jt as S,
1805
+ Et as T,
1806
+ Ie as a,
1807
+ bt as b,
1808
+ Fe as c,
1809
+ we as d,
1810
+ Se as e,
1811
+ Dt as f,
1812
+ _e as g,
1813
+ v as h,
1814
+ Mt as i,
1815
+ N as j,
1816
+ T as k,
1817
+ Te as l,
1818
+ ke as m,
1819
+ O as n,
1820
+ vt as o,
1821
+ I as p,
1822
+ At as q,
1823
+ Yt as r,
1824
+ ce as s,
1825
+ Ne as t,
1826
+ Oe as u,
1827
+ ve as v,
1828
+ Ae as w,
1829
+ Xt as x,
1830
+ be as y,
1831
+ Ce as z
1772
1832
  };
1773
- //# sourceMappingURL=serializer-BNsp8xs2.js.map
1833
+ //# sourceMappingURL=serializer-DNUH6kgE.js.map