@aintela/chat 0.2.22 → 0.2.26

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 (29) hide show
  1. package/dist/components.js +4518 -4442
  2. package/dist/components.js.map +1 -1
  3. package/dist/hooks.js +2 -2
  4. package/dist/{httpArtifactService-Dh9LGQ9a.js → httpArtifactService-DFlQzSgN.js} +429 -407
  5. package/dist/httpArtifactService-DFlQzSgN.js.map +1 -0
  6. package/dist/{httpSessionService-5Kr__oQL.js → httpSessionService-D9JXx3JD.js} +2 -2
  7. package/dist/{httpSessionService-5Kr__oQL.js.map → httpSessionService-D9JXx3JD.js.map} +1 -1
  8. package/dist/index.js +5 -5
  9. package/dist/models.js +1 -1
  10. package/dist/{serializer-DyHZxlAG.js → serializer-C1uBjgTd.js} +499 -457
  11. package/dist/serializer-C1uBjgTd.js.map +1 -0
  12. package/dist/services.js +2 -2
  13. package/dist/src/components/AiChat/ChatPane/parts/AskUserDispatcher.d.ts +22 -0
  14. package/dist/src/components/AiChat/ChatPane/parts/types.d.ts +17 -0
  15. package/dist/src/components/AiChat/ChatPane/parts/uiToolRegistry.d.ts +47 -2
  16. package/dist/src/components/v2/PromptV2.d.ts +8 -1
  17. package/dist/src/hooks/usePromptAssist.d.ts +7 -1
  18. package/dist/src/models/ServerEvent.d.ts +11 -0
  19. package/dist/src/models/semanticKernelModel/models.d.ts +8 -1
  20. package/dist/src/services/httpPromptAssistService.d.ts +19 -0
  21. package/dist/{useChatSessions-DttlifVk.js → useChatSessions-C1rHmRuS.js} +2 -2
  22. package/dist/{useChatSessions-DttlifVk.js.map → useChatSessions-C1rHmRuS.js.map} +1 -1
  23. package/dist/useContainerWidth-0EA-kdzl.js +260 -0
  24. package/dist/useContainerWidth-0EA-kdzl.js.map +1 -0
  25. package/package.json +1 -1
  26. package/dist/httpArtifactService-Dh9LGQ9a.js.map +0 -1
  27. package/dist/serializer-DyHZxlAG.js.map +0 -1
  28. package/dist/useContainerWidth-DsNHNR-z.js +0 -187
  29. package/dist/useContainerWidth-DsNHNR-z.js.map +0 -1
@@ -1,34 +1,34 @@
1
- var It = Object.defineProperty;
2
- var _t = (p, t, i) => t in p ? It(p, t, { enumerable: !0, configurable: !0, writable: !0, value: i }) : p[t] = i;
3
- var u = (p, t) => It(p, "name", { value: t, configurable: !0 });
4
- var e = (p, t, i) => _t(p, typeof t != "symbol" ? t + "" : t, i);
5
- import { E as l, q as xt, A as zt, G as vt } from "./environmentUtils-BaKw5_VD.js";
6
- import { jsonMember as r, jsonObject as g, AnyT as ht, jsonArrayMember as mt, TypedJSON as At } from "typedjson";
7
- const P = class P {
1
+ var Ot = Object.defineProperty;
2
+ var Lt = (s, t, o) => t in s ? Ot(s, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[t] = o;
3
+ var c = (s, t) => Ot(s, "name", { value: t, configurable: !0 });
4
+ var e = (s, t, o) => Lt(s, typeof t != "symbol" ? t + "" : t, o);
5
+ import { E as l, q as Dt, A as Jt, G as Wt } from "./environmentUtils-BaKw5_VD.js";
6
+ import { jsonMember as r, jsonObject as m, AnyT as Et, jsonArrayMember as gt, TypedJSON as Rt } from "typedjson";
7
+ const R = class R {
8
8
  static replaceFirstTwoTabsPerLine(t) {
9
- const i = /^\s{15}/gm;
10
- return typeof t == "string" ? t.replaceAll(i, (a) => a.substring(15)) : t ?? "";
9
+ const o = /^\s{15}/gm;
10
+ return typeof t == "string" ? t.replaceAll(o, (a) => a.substring(15)) : t ?? "";
11
11
  }
12
12
  static jsonToString(t) {
13
13
  if (t == null) return "";
14
14
  if (typeof t != "object") return String(t);
15
- const i = Array.isArray(t) ? P.isCharArray(t) ? t.join("") : null : P.tryCollapseCharIndexedObject(t);
16
- if (i != null) return i;
15
+ const o = Array.isArray(t) ? R.isCharArray(t) ? t.join("") : null : R.tryCollapseCharIndexedObject(t);
16
+ if (o != null) return o;
17
17
  if (Array.isArray(t))
18
18
  try {
19
19
  return JSON.stringify(t, null, 2);
20
20
  } catch {
21
21
  return String(t);
22
22
  }
23
- const a = Object.keys(t), o = [];
24
- return a.forEach((s) => {
25
- let m = t[s];
26
- typeof m == "object" && (m = JSON.stringify(t[s], null, 2));
27
- const f = (m == null ? void 0 : m.toString().indexOf(`
23
+ const a = Object.keys(t), i = [];
24
+ return a.forEach((p) => {
25
+ let g = t[p];
26
+ typeof g == "object" && (g = JSON.stringify(t[p], null, 2));
27
+ const f = (g == null ? void 0 : g.toString().indexOf(`
28
28
  `)) > -1 ? `
29
29
  ` : "";
30
- o.push(`${s}:${f}${m}`);
31
- }), o.join(`
30
+ i.push(`${p}:${f}${g}`);
31
+ }), i.join(`
32
32
  `);
33
33
  }
34
34
  static functionDetailsToString(t) {
@@ -48,14 +48,14 @@ const P = class P {
48
48
  } catch {
49
49
  return String(t);
50
50
  }
51
- const i = Object.keys(t), a = [];
52
- return i.forEach((o) => {
53
- let s = t == null ? void 0 : t[o];
54
- typeof s == "object" && (s = JSON.stringify(s, null, 2));
55
- const m = (s == null ? void 0 : s.toString().indexOf(`
51
+ const o = Object.keys(t), a = [];
52
+ return o.forEach((i) => {
53
+ let p = t == null ? void 0 : t[i];
54
+ typeof p == "object" && (p = JSON.stringify(p, null, 2));
55
+ const g = (p == null ? void 0 : p.toString().indexOf(`
56
56
  `)) > -1 ? `
57
57
  ` : "";
58
- a.push(`${o}:${m}${s}`);
58
+ a.push(`${i}:${g}${p}`);
59
59
  }), a.join(`
60
60
  `);
61
61
  }
@@ -67,17 +67,17 @@ const P = class P {
67
67
  * before reading the field. Returns undefined when absent or unparseable.
68
68
  */
69
69
  static uiSlotId(t) {
70
- var s;
71
- let i = (s = t == null ? void 0 : t.functionDetails) == null ? void 0 : s.response;
72
- for (let m = 0; m < 2 && typeof i == "string"; m++)
70
+ var p;
71
+ let o = (p = t == null ? void 0 : t.functionDetails) == null ? void 0 : p.response;
72
+ for (let g = 0; g < 2 && typeof o == "string"; g++)
73
73
  try {
74
- i = JSON.parse(i);
74
+ o = JSON.parse(o);
75
75
  } catch {
76
76
  return;
77
77
  }
78
- if (!i || typeof i != "object") return;
79
- const a = i, o = a.SlotId ?? a.slotId;
80
- return typeof o == "string" ? o : void 0;
78
+ if (!o || typeof o != "object") return;
79
+ const a = o, i = a.SlotId ?? a.slotId;
80
+ return typeof i == "string" ? i : void 0;
81
81
  }
82
82
  static fromError(t) {
83
83
  return {
@@ -92,13 +92,13 @@ const P = class P {
92
92
  textAppendable: !1
93
93
  };
94
94
  }
95
- static fromText(t, i, a) {
95
+ static fromText(t, o, a) {
96
96
  return {
97
97
  text: t,
98
98
  eventType: l.Text,
99
- id: a ?? xt(),
99
+ id: a ?? Dt(),
100
100
  created: /* @__PURE__ */ new Date(),
101
- author: i ?? "main",
101
+ author: o ?? "main",
102
102
  partial: !1,
103
103
  isStillWriting: !1,
104
104
  mustPush: !1,
@@ -111,9 +111,9 @@ const P = class P {
111
111
  * and replayed parts are identical: an `EventType.UserAnswer` carrying functionDetails
112
112
  * {name, args, isUi, status:'Done'} that routes through the uiTool dispatcher/registry.
113
113
  */
114
- static fromUserUi(t, i, a) {
114
+ static fromUserUi(t, o, a) {
115
115
  return {
116
- id: a ?? xt(),
116
+ id: a ?? Dt(),
117
117
  eventType: l.UserAnswer,
118
118
  author: "user",
119
119
  created: /* @__PURE__ */ new Date(),
@@ -124,25 +124,25 @@ const P = class P {
124
124
  functionDetails: {
125
125
  id: "",
126
126
  name: t,
127
- args: i,
127
+ args: o,
128
128
  status: "Done",
129
129
  isUi: !0
130
130
  }
131
131
  };
132
132
  }
133
- static createWaiting(t = !1, i = !0, a, o, s) {
133
+ static createWaiting(t = !1, o = !0, a, i, p) {
134
134
  a || (a = "Waiting");
135
- const m = P.fromText("...", void 0, "waitingpart");
136
- return m.eventType = l.Waiting, m.waitingDetails = {
137
- startingPoint: o,
135
+ const g = R.fromText("...", void 0, "waitingpart");
136
+ return g.eventType = l.Waiting, g.waitingDetails = {
137
+ startingPoint: i,
138
138
  addTimer: t,
139
- isTimerRunning: i,
139
+ isTimerRunning: o,
140
140
  status: a,
141
- stopPoint: s
142
- }, m;
141
+ stopPoint: p
142
+ }, g;
143
143
  }
144
144
  static createSuspended() {
145
- const t = P.fromText("SUSPEND");
145
+ const t = R.fromText("SUSPEND");
146
146
  return t.eventType = l.Suspended, t;
147
147
  }
148
148
  static getPartTextContent(t) {
@@ -151,14 +151,14 @@ const P = class P {
151
151
  static FlatParts(t) {
152
152
  if (t.length === 0)
153
153
  return;
154
- const i = t.filter((s) => s.eventType == l.Text), a = i.length > 0 ? i[0] : t[0], o = [...new Set(t.map((s) => s.eventType))];
155
- o.length == 1 ? a.eventType = o[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;
156
- for (const s of t)
157
- !a.codeExecutionResultDetails && s.codeExecutionResultDetails && (a.codeExecutionResultDetails = s.codeExecutionResultDetails), !a.errorDetails && s.errorDetails && (a.errorDetails = s.errorDetails), !a.executableCodeDetails && s.executableCodeDetails && (a.executableCodeDetails = s.executableCodeDetails), !a.functionDetails && s.functionDetails && (a.functionDetails = s.functionDetails), !a.rawDetails && s.rawDetails && (a.rawDetails = s.rawDetails), !a.thoughtDetails && s.thoughtDetails && (a.thoughtDetails = s.thoughtDetails), !a.errorDetails && s.errorDetails && (a.errorDetails = s.errorDetails);
154
+ const o = t.filter((p) => p.eventType == l.Text), a = o.length > 0 ? o[0] : t[0], i = [...new Set(t.map((p) => p.eventType))];
155
+ i.length == 1 ? a.eventType = i[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;
156
+ for (const p of t)
157
+ !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.rawDetails && p.rawDetails && (a.rawDetails = p.rawDetails), !a.thoughtDetails && p.thoughtDetails && (a.thoughtDetails = p.thoughtDetails), !a.errorDetails && p.errorDetails && (a.errorDetails = p.errorDetails);
158
158
  return a;
159
159
  }
160
160
  static isCharArray(t) {
161
- return Array.isArray(t) && t.length > 0 && t.every((i) => typeof i == "string" && i.length === 1);
161
+ return Array.isArray(t) && t.length > 0 && t.every((o) => typeof o == "string" && o.length === 1);
162
162
  }
163
163
  /**
164
164
  * Detects objects like `{0: "a", 1: "b", 2: "c", ...}` — a string that was
@@ -168,25 +168,25 @@ const P = class P {
168
168
  */
169
169
  static tryCollapseCharIndexedObject(t) {
170
170
  if (t == null || typeof t != "object" || Array.isArray(t)) return null;
171
- const i = Object.keys(t);
172
- if (i.length === 0) return null;
173
- for (let a = 0; a < i.length; a++) {
174
- if (i[a] !== String(a)) return null;
175
- const o = t[i[a]];
176
- if (typeof o != "string" || o.length !== 1) return null;
171
+ const o = Object.keys(t);
172
+ if (o.length === 0) return null;
173
+ for (let a = 0; a < o.length; a++) {
174
+ if (o[a] !== String(a)) return null;
175
+ const i = t[o[a]];
176
+ if (typeof i != "string" || i.length !== 1) return null;
177
177
  }
178
- return i.map((a) => t[a]).join("");
178
+ return o.map((a) => t[a]).join("");
179
179
  }
180
180
  static isCodeExecution(t) {
181
181
  return t.eventType === l.CodeExecutionResult || t.eventType === l.ExecutableCode;
182
182
  }
183
183
  };
184
- u(P, "InteractionPartUtils");
185
- let Dt = P;
186
- var kt = Object.defineProperty, Lt = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ u((p, t, i, a) => {
187
- for (var o = a > 1 ? void 0 : a ? Lt(t, i) : t, s = p.length - 1, m; s >= 0; s--)
188
- (m = p[s]) && (o = (a ? m(t, i, o) : m(o)) || o);
189
- return a && o && kt(t, i, o), o;
184
+ c(R, "InteractionPartUtils");
185
+ let Ft = R;
186
+ var $t = Object.defineProperty, Gt = Object.getOwnPropertyDescriptor, n = /* @__PURE__ */ c((s, t, o, a) => {
187
+ for (var i = a > 1 ? void 0 : a ? Gt(t, o) : t, p = s.length - 1, g; p >= 0; p--)
188
+ (g = s[p]) && (i = (a ? g(t, o, i) : g(i)) || i);
189
+ return a && i && $t(t, o, i), i;
190
190
  }, "__decorateClass");
191
191
  const x = {
192
192
  // KernelContent derived types
@@ -202,38 +202,39 @@ const x = {
202
202
  StreamingTextContent: "StreamingTextContent",
203
203
  StreamingFunctionCallUpdateContent: "StreamingFunctionCallUpdateContent",
204
204
  StreamingFinalFunctionCallContent: "StreamingFinalFunctionCallContent",
205
- StreamingFinalFunctionResultContent: "StreamingFinalFunctionResultContent"
205
+ StreamingFinalFunctionResultContent: "StreamingFinalFunctionResultContent",
206
+ StreamingClientOutputContent: "StreamingClientOutputContent"
206
207
  };
207
- var v;
208
- let yt = (v = class {
208
+ var z;
209
+ let yt = (z = class {
209
210
  constructor() {
210
211
  e(this, "label");
211
212
  }
212
- }, u(v, "AuthorRole"), v);
213
+ }, c(z, "AuthorRole"), z);
213
214
  n([
214
215
  r(String)
215
216
  ], yt.prototype, "label", 2);
216
217
  yt = n([
217
- g({ name: "AuthorRole" })
218
+ m({ name: "AuthorRole" })
218
219
  ], yt);
219
- var k;
220
- let st = (k = class {
220
+ var L;
221
+ let pt = (L = class {
221
222
  constructor() {
222
223
  e(this, "type");
223
224
  e(this, "fullName");
224
225
  }
225
- }, u(k, "EventTypeInformation"), k);
226
+ }, c(L, "EventTypeInformation"), L);
226
227
  n([
227
228
  r(String)
228
- ], st.prototype, "type", 2);
229
+ ], pt.prototype, "type", 2);
229
230
  n([
230
231
  r(String)
231
- ], st.prototype, "fullName", 2);
232
- st = n([
233
- g({ name: "EventTypeInformation" })
234
- ], st);
235
- var L;
236
- let U = (L = class {
232
+ ], pt.prototype, "fullName", 2);
233
+ pt = n([
234
+ m({ name: "EventTypeInformation" })
235
+ ], pt);
236
+ var J;
237
+ let w = (J = class {
237
238
  constructor() {
238
239
  e(this, "id");
239
240
  e(this, "name");
@@ -250,24 +251,24 @@ let U = (L = class {
250
251
  id: this.id
251
252
  };
252
253
  }
253
- }, u(L, "LlmArtifact"), L);
254
+ }, c(J, "LlmArtifact"), J);
254
255
  n([
255
256
  r(String)
256
- ], U.prototype, "id", 2);
257
+ ], w.prototype, "id", 2);
257
258
  n([
258
259
  r(String)
259
- ], U.prototype, "name", 2);
260
+ ], w.prototype, "name", 2);
260
261
  n([
261
262
  r(String)
262
- ], U.prototype, "mimeType", 2);
263
+ ], w.prototype, "mimeType", 2);
263
264
  n([
264
265
  r(String)
265
- ], U.prototype, "description", 2);
266
- U = n([
267
- g({ name: "LlmArtifact" })
268
- ], U);
269
- var J;
270
- let h = (J = class {
266
+ ], w.prototype, "description", 2);
267
+ w = n([
268
+ m({ name: "LlmArtifact" })
269
+ ], w);
270
+ var W;
271
+ let h = (W = class {
271
272
  constructor() {
272
273
  e(this, "mimeType");
273
274
  // InnerContent is ignored (JsonIgnore in C#)
@@ -276,7 +277,7 @@ let h = (J = class {
276
277
  e(this, "modelId");
277
278
  e(this, "metadata");
278
279
  }
279
- }, u(J, "KernelContent"), J);
280
+ }, c(W, "KernelContent"), W);
280
281
  n([
281
282
  r(String)
282
283
  ], h.prototype, "mimeType", 2);
@@ -284,13 +285,13 @@ n([
284
285
  r(String)
285
286
  ], h.prototype, "modelId", 2);
286
287
  n([
287
- r(ht)
288
+ r(Et)
288
289
  ], h.prototype, "metadata", 2);
289
290
  h = n([
290
- g({ name: "KernelContent" })
291
+ m({ name: "KernelContent" })
291
292
  ], h);
292
- var W;
293
- let D = (W = class {
293
+ var $;
294
+ let D = ($ = class {
294
295
  constructor() {
295
296
  e(this, "choiceIndex", 0);
296
297
  // InnerContent is ignored (JsonIgnore in C#)
@@ -299,7 +300,7 @@ let D = (W = class {
299
300
  e(this, "modelId");
300
301
  e(this, "metadata");
301
302
  }
302
- }, u(W, "StreamingKernelContent"), W);
303
+ }, c($, "StreamingKernelContent"), $);
303
304
  n([
304
305
  r(Number)
305
306
  ], D.prototype, "choiceIndex", 2);
@@ -310,10 +311,10 @@ n([
310
311
  r(Object)
311
312
  ], D.prototype, "metadata", 2);
312
313
  D = n([
313
- g({ name: "StreamingKernelContent" })
314
+ m({ name: "StreamingKernelContent" })
314
315
  ], D);
315
- var $;
316
- let dt = ($ = class extends h {
316
+ var G;
317
+ let ft = (G = class extends h {
317
318
  constructor() {
318
319
  super();
319
320
  e(this, "text");
@@ -325,74 +326,74 @@ let dt = ($ = class extends h {
325
326
  toString() {
326
327
  return this.text ?? "";
327
328
  }
328
- }, u($, "TextContent"), $);
329
+ }, c(G, "TextContent"), G);
329
330
  n([
330
331
  r(String)
331
- ], dt.prototype, "text", 2);
332
- dt = n([
333
- g({ name: "TextContent" })
334
- ], dt);
335
- var G;
336
- let pt = (G = class extends D {
332
+ ], ft.prototype, "text", 2);
333
+ ft = n([
334
+ m({ name: "TextContent" })
335
+ ], ft);
336
+ var q;
337
+ let ut = (q = class extends D {
337
338
  constructor() {
338
339
  super();
339
340
  e(this, "eventName");
340
341
  e(this, "eventData");
341
342
  e(this, "sessionId");
342
343
  }
343
- }, u(G, "StreamingToolEventContent"), G);
344
+ }, c(q, "StreamingToolEventContent"), q);
344
345
  n([
345
346
  r(String)
346
- ], pt.prototype, "eventName", 2);
347
+ ], ut.prototype, "eventName", 2);
347
348
  n([
348
349
  r(String)
349
- ], pt.prototype, "eventData", 2);
350
+ ], ut.prototype, "eventData", 2);
350
351
  n([
351
352
  r(String)
352
- ], pt.prototype, "sessionId", 2);
353
- pt = n([
354
- g({ name: "StreamingToolEventContent" })
355
- ], pt);
356
- var q;
357
- let O = (q = class extends h {
353
+ ], ut.prototype, "sessionId", 2);
354
+ ut = n([
355
+ m({ name: "StreamingToolEventContent" })
356
+ ], ut);
357
+ var B;
358
+ let P = (B = class extends h {
358
359
  constructor() {
359
360
  super();
360
361
  e(this, "eventName");
361
362
  e(this, "eventData");
362
363
  e(this, "sessionId");
363
364
  }
364
- }, u(q, "ToolEventContent"), q);
365
+ }, c(B, "ToolEventContent"), B);
365
366
  n([
366
367
  r(String)
367
- ], O.prototype, "eventName", 2);
368
+ ], P.prototype, "eventName", 2);
368
369
  n([
369
370
  r(String)
370
- ], O.prototype, "eventData", 2);
371
+ ], P.prototype, "eventData", 2);
371
372
  n([
372
373
  r(String)
373
- ], O.prototype, "sessionId", 2);
374
- O = n([
375
- g({ name: "ToolEventContent" })
376
- ], O);
377
- var B;
378
- let ft = (B = class extends h {
374
+ ], P.prototype, "sessionId", 2);
375
+ P = n([
376
+ m({ name: "ToolEventContent" })
377
+ ], P);
378
+ var M;
379
+ let St = (M = class extends h {
379
380
  constructor() {
380
381
  super(...arguments);
381
382
  e(this, "url");
382
383
  e(this, "dataUri");
383
384
  }
384
- }, u(B, "ImageContent"), B);
385
+ }, c(M, "ImageContent"), M);
385
386
  n([
386
387
  r(String)
387
- ], ft.prototype, "url", 2);
388
+ ], St.prototype, "url", 2);
388
389
  n([
389
390
  r(String)
390
- ], ft.prototype, "dataUri", 2);
391
- ft = n([
392
- g({ name: "ImageContent" })
393
- ], ft);
394
- var M;
395
- let A = (M = class extends h {
391
+ ], St.prototype, "dataUri", 2);
392
+ St = n([
393
+ m({ name: "ImageContent" })
394
+ ], St);
395
+ var K;
396
+ let A = (K = class extends h {
396
397
  constructor() {
397
398
  super(...arguments);
398
399
  e(this, "id");
@@ -402,7 +403,7 @@ let A = (M = class extends h {
402
403
  // Exception is not serializable - omit jsonMember decorator
403
404
  e(this, "exception");
404
405
  }
405
- }, u(M, "FunctionCallContent"), M);
406
+ }, c(K, "FunctionCallContent"), K);
406
407
  n([
407
408
  r(String)
408
409
  ], A.prototype, "id", 2);
@@ -413,13 +414,13 @@ n([
413
414
  r(String)
414
415
  ], A.prototype, "functionName", 2);
415
416
  n([
416
- r(ht)
417
+ r(Et)
417
418
  ], A.prototype, "arguments", 2);
418
419
  A = n([
419
- g({ name: "FunctionCallContent" })
420
+ m({ name: "FunctionCallContent" })
420
421
  ], A);
421
- var K;
422
- let I = (K = class extends D {
422
+ var H;
423
+ let N = (H = class extends D {
423
424
  constructor() {
424
425
  super(...arguments);
425
426
  e(this, "id");
@@ -427,28 +428,32 @@ let I = (K = class extends D {
427
428
  e(this, "arguments");
428
429
  e(this, "isUi");
429
430
  e(this, "friendlyArgsDescription");
431
+ e(this, "askUserComponent");
430
432
  }
431
- }, u(K, "StreamingFinalFunctionCallContent"), K);
433
+ }, c(H, "StreamingFinalFunctionCallContent"), H);
432
434
  n([
433
435
  r(String, { name: "callId" })
434
- ], I.prototype, "id", 2);
436
+ ], N.prototype, "id", 2);
435
437
  n([
436
438
  r(String, { name: "name" })
437
- ], I.prototype, "functionName", 2);
439
+ ], N.prototype, "functionName", 2);
438
440
  n([
439
441
  r(String)
440
- ], I.prototype, "arguments", 2);
442
+ ], N.prototype, "arguments", 2);
441
443
  n([
442
444
  r(Boolean)
443
- ], I.prototype, "isUi", 2);
445
+ ], N.prototype, "isUi", 2);
444
446
  n([
445
447
  r(String)
446
- ], I.prototype, "friendlyArgsDescription", 2);
447
- I = n([
448
- g({ name: "StreamingFinalFunctionCallContent" })
449
- ], I);
450
- var H;
451
- let R = (H = class extends h {
448
+ ], N.prototype, "friendlyArgsDescription", 2);
449
+ n([
450
+ r(String)
451
+ ], N.prototype, "askUserComponent", 2);
452
+ N = n([
453
+ m({ name: "StreamingFinalFunctionCallContent" })
454
+ ], N);
455
+ var Y;
456
+ let O = (Y = class extends h {
452
457
  constructor() {
453
458
  super(...arguments);
454
459
  e(this, "id");
@@ -456,24 +461,24 @@ let R = (H = class extends h {
456
461
  e(this, "functionName");
457
462
  e(this, "result");
458
463
  }
459
- }, u(H, "FunctionResultContent"), H);
464
+ }, c(Y, "FunctionResultContent"), Y);
460
465
  n([
461
466
  r(String, { name: "callId" })
462
- ], R.prototype, "id", 2);
467
+ ], O.prototype, "id", 2);
463
468
  n([
464
469
  r(String)
465
- ], R.prototype, "pluginName", 2);
470
+ ], O.prototype, "pluginName", 2);
466
471
  n([
467
472
  r(String)
468
- ], R.prototype, "functionName", 2);
473
+ ], O.prototype, "functionName", 2);
469
474
  n([
470
- r(ht)
471
- ], R.prototype, "result", 2);
472
- R = n([
473
- g({ name: "FunctionResultContent" })
474
- ], R);
475
- var Y;
476
- let N = (Y = class extends D {
475
+ r(Et)
476
+ ], O.prototype, "result", 2);
477
+ O = n([
478
+ m({ name: "FunctionResultContent" })
479
+ ], O);
480
+ var v;
481
+ let F = (v = class extends D {
477
482
  constructor() {
478
483
  super(...arguments);
479
484
  e(this, "id");
@@ -482,54 +487,75 @@ let N = (Y = class extends D {
482
487
  e(this, "result");
483
488
  e(this, "isUi");
484
489
  e(this, "clientOutput");
490
+ e(this, "askUserComponent");
485
491
  }
486
- }, u(Y, "StreamingFinalFunctionResultContent"), Y);
492
+ }, c(v, "StreamingFinalFunctionResultContent"), v);
487
493
  n([
488
494
  r(String, { name: "callId" })
489
- ], N.prototype, "id", 2);
495
+ ], F.prototype, "id", 2);
490
496
  n([
491
497
  r(String)
492
- ], N.prototype, "pluginName", 2);
498
+ ], F.prototype, "pluginName", 2);
493
499
  n([
494
500
  r(String)
495
- ], N.prototype, "functionName", 2);
501
+ ], F.prototype, "functionName", 2);
496
502
  n([
497
- r(ht)
498
- ], N.prototype, "result", 2);
503
+ r(Et)
504
+ ], F.prototype, "result", 2);
499
505
  n([
500
506
  r(Boolean)
501
- ], N.prototype, "isUi", 2);
507
+ ], F.prototype, "isUi", 2);
502
508
  n([
503
509
  r(String)
504
- ], N.prototype, "clientOutput", 2);
505
- N = n([
506
- g({ name: "StreamingFinalFunctionResultContent" })
507
- ], N);
510
+ ], F.prototype, "clientOutput", 2);
511
+ n([
512
+ r(String)
513
+ ], F.prototype, "askUserComponent", 2);
514
+ F = n([
515
+ m({ name: "StreamingFinalFunctionResultContent" })
516
+ ], F);
508
517
  var Q;
509
- let ut = (Q = class extends h {
518
+ let ct = (Q = class extends h {
510
519
  constructor() {
511
520
  super(...arguments);
512
521
  e(this, "id");
513
522
  e(this, "data");
514
523
  }
515
- }, u(Q, "FunctionClientOutputContent"), Q);
524
+ }, c(Q, "FunctionClientOutputContent"), Q);
516
525
  n([
517
526
  r(String, { name: "callId" })
518
- ], ut.prototype, "id", 2);
527
+ ], ct.prototype, "id", 2);
519
528
  n([
520
529
  r(String)
521
- ], ut.prototype, "data", 2);
522
- ut = n([
523
- g({ name: "FunctionClientOutputContent" })
524
- ], ut);
530
+ ], ct.prototype, "data", 2);
531
+ ct = n([
532
+ m({ name: "FunctionClientOutputContent" })
533
+ ], ct);
525
534
  var V;
526
- let lt = (V = class extends h {
535
+ let Tt = (V = class extends D {
536
+ constructor() {
537
+ super(...arguments);
538
+ e(this, "id");
539
+ e(this, "clientOutput");
540
+ }
541
+ }, c(V, "StreamingClientOutputContent"), V);
542
+ n([
543
+ r(String, { name: "callId" })
544
+ ], Tt.prototype, "id", 2);
545
+ n([
546
+ r(String)
547
+ ], Tt.prototype, "clientOutput", 2);
548
+ Tt = n([
549
+ m({ name: "StreamingClientOutputContent" })
550
+ ], Tt);
551
+ var X;
552
+ let lt = (X = class extends h {
527
553
  constructor() {
528
554
  super(...arguments);
529
555
  e(this, "name");
530
556
  e(this, "args");
531
557
  }
532
- }, u(V, "UserUiContent"), V);
558
+ }, c(X, "UserUiContent"), X);
533
559
  n([
534
560
  r(String)
535
561
  ], lt.prototype, "name", 2);
@@ -537,27 +563,27 @@ n([
537
563
  r(String)
538
564
  ], lt.prototype, "args", 2);
539
565
  lt = n([
540
- g({ name: "UserUiContent" })
566
+ m({ name: "UserUiContent" })
541
567
  ], lt);
542
- var X;
543
- let ct = (X = class extends h {
568
+ var Z;
569
+ let mt = (Z = class extends h {
544
570
  constructor() {
545
571
  super(...arguments);
546
572
  e(this, "role");
547
573
  e(this, "items");
548
574
  }
549
- }, u(X, "ChatMessageContent"), X);
575
+ }, c(Z, "ChatMessageContent"), Z);
550
576
  n([
551
577
  r(yt)
552
- ], ct.prototype, "role", 2);
578
+ ], mt.prototype, "role", 2);
553
579
  n([
554
- mt(() => h)
555
- ], ct.prototype, "items", 2);
556
- ct = n([
557
- g({ name: "ChatMessageContent" })
558
- ], ct);
559
- var Z;
560
- let w = (Z = class extends D {
580
+ gt(() => h)
581
+ ], mt.prototype, "items", 2);
582
+ mt = n([
583
+ m({ name: "ChatMessageContent" })
584
+ ], mt);
585
+ var j;
586
+ let U = (j = class extends D {
561
587
  constructor() {
562
588
  super(...arguments);
563
589
  e(this, "callId");
@@ -565,24 +591,24 @@ let w = (Z = class extends D {
565
591
  e(this, "arguments");
566
592
  e(this, "functionCallIndex", 0);
567
593
  }
568
- }, u(Z, "StreamingFunctionCallUpdateContent"), Z);
594
+ }, c(j, "StreamingFunctionCallUpdateContent"), j);
569
595
  n([
570
596
  r(String)
571
- ], w.prototype, "callId", 2);
597
+ ], U.prototype, "callId", 2);
572
598
  n([
573
599
  r(String)
574
- ], w.prototype, "name", 2);
600
+ ], U.prototype, "name", 2);
575
601
  n([
576
602
  r(String)
577
- ], w.prototype, "arguments", 2);
603
+ ], U.prototype, "arguments", 2);
578
604
  n([
579
605
  r(Number)
580
- ], w.prototype, "functionCallIndex", 2);
581
- w = n([
582
- g({ name: "StreamingFunctionCallUpdateContent" })
583
- ], w);
584
- var j;
585
- let St = (j = class extends D {
606
+ ], U.prototype, "functionCallIndex", 2);
607
+ U = n([
608
+ m({ name: "StreamingFunctionCallUpdateContent" })
609
+ ], U);
610
+ var tt;
611
+ let xt = (tt = class extends D {
586
612
  constructor() {
587
613
  super(...arguments);
588
614
  e(this, "text");
@@ -590,15 +616,15 @@ let St = (j = class extends D {
590
616
  // Not decorated with @jsonMember
591
617
  e(this, "encoding");
592
618
  }
593
- }, u(j, "StreamingTextContent"), j);
619
+ }, c(tt, "StreamingTextContent"), tt);
594
620
  n([
595
621
  r(String)
596
- ], St.prototype, "text", 2);
597
- St = n([
598
- g({ name: "StreamingTextContent" })
599
- ], St);
600
- var tt;
601
- let Tt = (tt = class extends D {
622
+ ], xt.prototype, "text", 2);
623
+ xt = n([
624
+ m({ name: "StreamingTextContent" })
625
+ ], xt);
626
+ var et;
627
+ let ht = (et = class extends D {
602
628
  constructor() {
603
629
  super(...arguments);
604
630
  e(this, "text");
@@ -606,35 +632,35 @@ let Tt = (tt = class extends D {
606
632
  // Not decorated with @jsonMember
607
633
  e(this, "encoding");
608
634
  }
609
- }, u(tt, "StreamingReasoningContent"), tt);
635
+ }, c(et, "StreamingReasoningContent"), et);
610
636
  n([
611
637
  r(String)
612
- ], Tt.prototype, "text", 2);
613
- Tt = n([
614
- g({ name: "StreamingReasoningContent" })
615
- ], Tt);
616
- var et;
617
- let _ = (et = class {
638
+ ], ht.prototype, "text", 2);
639
+ ht = n([
640
+ m({ name: "StreamingReasoningContent" })
641
+ ], ht);
642
+ var nt;
643
+ let k = (nt = class {
618
644
  constructor() {
619
645
  e(this, "instructionCategory", "");
620
646
  e(this, "description", "");
621
647
  e(this, "interactionId", "");
622
648
  }
623
- }, u(et, "InstructionSummary"), et);
649
+ }, c(nt, "InstructionSummary"), nt);
624
650
  n([
625
651
  r(String)
626
- ], _.prototype, "instructionCategory", 2);
652
+ ], k.prototype, "instructionCategory", 2);
627
653
  n([
628
654
  r(String)
629
- ], _.prototype, "description", 2);
655
+ ], k.prototype, "description", 2);
630
656
  n([
631
657
  r(String)
632
- ], _.prototype, "interactionId", 2);
633
- _ = n([
634
- g({ name: "InstructionSummary" })
635
- ], _);
636
- var nt;
637
- let E = (nt = class {
658
+ ], k.prototype, "interactionId", 2);
659
+ k = n([
660
+ m({ name: "InstructionSummary" })
661
+ ], k);
662
+ var it;
663
+ let C = (it = class {
638
664
  constructor() {
639
665
  e(this, "size", 0);
640
666
  e(this, "originalSize", 0);
@@ -645,36 +671,36 @@ let E = (nt = class {
645
671
  e(this, "id");
646
672
  e(this, "instructionSummaries", []);
647
673
  }
648
- }, u(nt, "SessionInformation"), nt);
674
+ }, c(it, "SessionInformation"), it);
649
675
  n([
650
676
  r(Number)
651
- ], E.prototype, "size", 2);
677
+ ], C.prototype, "size", 2);
652
678
  n([
653
679
  r(Number)
654
- ], E.prototype, "originalSize", 2);
680
+ ], C.prototype, "originalSize", 2);
655
681
  n([
656
682
  r(Number)
657
- ], E.prototype, "ratio", 2);
683
+ ], C.prototype, "ratio", 2);
658
684
  n([
659
685
  r(Number)
660
- ], E.prototype, "previousRatio", 2);
686
+ ], C.prototype, "previousRatio", 2);
661
687
  n([
662
688
  r(Number)
663
- ], E.prototype, "threshold", 2);
689
+ ], C.prototype, "threshold", 2);
664
690
  n([
665
691
  r(Number)
666
- ], E.prototype, "maxSize", 2);
692
+ ], C.prototype, "maxSize", 2);
667
693
  n([
668
694
  r(String)
669
- ], E.prototype, "id", 2);
695
+ ], C.prototype, "id", 2);
670
696
  n([
671
- mt(_)
672
- ], E.prototype, "instructionSummaries", 2);
673
- E = n([
674
- g({ name: "SessionInformation" })
675
- ], E);
676
- var it;
677
- let S = (it = class {
697
+ gt(k)
698
+ ], C.prototype, "instructionSummaries", 2);
699
+ C = n([
700
+ m({ name: "SessionInformation" })
701
+ ], C);
702
+ var ot;
703
+ let S = (ot = class {
678
704
  constructor() {
679
705
  e(this, "timestamp");
680
706
  e(this, "mimeType");
@@ -695,7 +721,7 @@ let S = (it = class {
695
721
  e(this, "subAgentName");
696
722
  e(this, "text");
697
723
  }
698
- }, u(it, "LlmEvent"), it);
724
+ }, c(ot, "LlmEvent"), ot);
699
725
  n([
700
726
  r(Number)
701
727
  ], S.prototype, "timestamp", 2);
@@ -718,13 +744,13 @@ n([
718
744
  r(String)
719
745
  ], S.prototype, "interactionId", 2);
720
746
  n([
721
- r(E)
747
+ r(C)
722
748
  ], S.prototype, "sessionInformation", 2);
723
749
  n([
724
- r(st)
750
+ r(pt)
725
751
  ], S.prototype, "eventType", 2);
726
752
  n([
727
- mt(U)
753
+ gt(w)
728
754
  ], S.prototype, "artifactsGenerated", 2);
729
755
  n([
730
756
  r(String)
@@ -736,16 +762,16 @@ n([
736
762
  r(String)
737
763
  ], S.prototype, "command", 2);
738
764
  n([
739
- r(ct)
765
+ r(mt)
740
766
  ], S.prototype, "content", 2);
741
767
  n([
742
- mt(() => D)
768
+ gt(() => D)
743
769
  ], S.prototype, "streamingParts", 2);
744
770
  S = n([
745
- g({ name: "LlmEvent" })
771
+ m({ name: "LlmEvent" })
746
772
  ], S);
747
- var ot;
748
- let C = (ot = class {
773
+ var rt;
774
+ let E = (rt = class {
749
775
  constructor() {
750
776
  e(this, "timeStamp");
751
777
  e(this, "partialText");
@@ -758,42 +784,42 @@ let C = (ot = class {
758
784
  e(this, "partialEventType");
759
785
  e(this, "subAgentId");
760
786
  }
761
- }, u(ot, "PartialLlmEvent"), ot);
787
+ }, c(rt, "PartialLlmEvent"), rt);
762
788
  n([
763
789
  r(Number, { name: "ts" })
764
- ], C.prototype, "timeStamp", 2);
790
+ ], E.prototype, "timeStamp", 2);
765
791
  n([
766
792
  r(String, { name: "pt" })
767
- ], C.prototype, "partialText", 2);
793
+ ], E.prototype, "partialText", 2);
768
794
  n([
769
795
  r(String, { name: "pr" })
770
- ], C.prototype, "partialReasoning", 2);
796
+ ], E.prototype, "partialReasoning", 2);
771
797
  n([
772
798
  r(String, { name: "fn" })
773
- ], C.prototype, "functionName", 2);
799
+ ], E.prototype, "functionName", 2);
774
800
  n([
775
- mt(() => D)
776
- ], C.prototype, "streamingParts", 2);
801
+ gt(() => D)
802
+ ], E.prototype, "streamingParts", 2);
777
803
  n([
778
804
  r(String, { name: "fid" })
779
- ], C.prototype, "functionCallId", 2);
805
+ ], E.prototype, "functionCallId", 2);
780
806
  n([
781
807
  r(String, { name: "tp" })
782
- ], C.prototype, "type", 2);
808
+ ], E.prototype, "type", 2);
783
809
  n([
784
810
  r(String, { name: "itid" })
785
- ], C.prototype, "iteractionId", 2);
811
+ ], E.prototype, "iteractionId", 2);
786
812
  n([
787
- r(st)
788
- ], C.prototype, "partialEventType", 2);
813
+ r(pt)
814
+ ], E.prototype, "partialEventType", 2);
789
815
  n([
790
816
  r(String, { name: "said" })
791
- ], C.prototype, "subAgentId", 2);
792
- C = n([
793
- g({ name: "PartialLlmEvent" })
794
- ], C);
795
- var rt;
796
- let F = (rt = class {
817
+ ], E.prototype, "subAgentId", 2);
818
+ E = n([
819
+ m({ name: "PartialLlmEvent" })
820
+ ], E);
821
+ var at;
822
+ let I = (at = class {
797
823
  constructor() {
798
824
  e(this, "type");
799
825
  e(this, "event");
@@ -804,45 +830,45 @@ let F = (rt = class {
804
830
  e(this, "subAgentName");
805
831
  e(this, "seq");
806
832
  }
807
- }, u(rt, "StreamingResponse"), rt);
833
+ }, c(at, "StreamingResponse"), at);
808
834
  n([
809
835
  r(String)
810
- ], F.prototype, "type", 2);
836
+ ], I.prototype, "type", 2);
811
837
  n([
812
838
  r(S)
813
- ], F.prototype, "event", 2);
839
+ ], I.prototype, "event", 2);
814
840
  n([
815
841
  r(String)
816
- ], F.prototype, "sessionId", 2);
842
+ ], I.prototype, "sessionId", 2);
817
843
  n([
818
844
  r(String)
819
- ], F.prototype, "accessToken", 2);
845
+ ], I.prototype, "accessToken", 2);
820
846
  n([
821
- r(C, { name: "pe" })
822
- ], F.prototype, "partialEvent", 2);
847
+ r(E, { name: "pe" })
848
+ ], I.prototype, "partialEvent", 2);
823
849
  n([
824
850
  r(String)
825
- ], F.prototype, "subAgentId", 2);
851
+ ], I.prototype, "subAgentId", 2);
826
852
  n([
827
853
  r(String)
828
- ], F.prototype, "subAgentName", 2);
854
+ ], I.prototype, "subAgentName", 2);
829
855
  n([
830
856
  r(Number)
831
- ], F.prototype, "seq", 2);
832
- F = n([
833
- g({ name: "StreamingResponse" })
834
- ], F);
835
- var at;
836
- let Ct = (at = class {
857
+ ], I.prototype, "seq", 2);
858
+ I = n([
859
+ m({ name: "StreamingResponse" })
860
+ ], I);
861
+ var st;
862
+ let Ct = (st = class {
837
863
  constructor() {
838
864
  e(this, "events");
839
865
  }
840
- }, u(at, "Payload"), at);
866
+ }, c(st, "Payload"), st);
841
867
  n([
842
- mt(S)
868
+ gt(S)
843
869
  ], Ct.prototype, "events", 2);
844
870
  Ct = n([
845
- g({ name: "Payload" })
871
+ m({ name: "Payload" })
846
872
  ], Ct);
847
873
  const b = class b {
848
874
  constructor(t) {
@@ -879,10 +905,10 @@ const b = class b {
879
905
  e(this, "visible", !0);
880
906
  this.interactionId = t, this.author = "main";
881
907
  }
882
- static createErrorEvent(t, i) {
883
- const a = new b(i);
908
+ static createErrorEvent(t, o) {
909
+ const a = new b(o);
884
910
  a.turn_complete = !0, a.partial = !1, a.parts = [];
885
- const o = {
911
+ const i = {
886
912
  eventType: l.ServerError,
887
913
  errorDetails: {
888
914
  errorMessage: t
@@ -895,140 +921,155 @@ const b = class b {
895
921
  mustPush: !1,
896
922
  textAppendable: !1
897
923
  };
898
- return a.parts.push(o), a;
924
+ return a.parts.push(i), a;
899
925
  }
900
926
  static parseFlatPropertiesTypedEvent(t) {
901
- var a, o, s;
902
- const i = new b(t.interactionId);
903
- if (i.serverError = t.serverError, !t.interactionId)
927
+ var a, i, p;
928
+ const o = new b(t.interactionId);
929
+ if (o.serverError = t.serverError, !t.interactionId)
904
930
  throw new Error("Interaction ID is required");
905
- 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"', {
931
+ 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"', {
906
932
  interactionId: t.interactionId,
907
933
  turnComplete: t.turnComplete
908
934
  }), t == null ? void 0 : t.author) {
909
- case zt:
910
- i.author = "tool";
935
+ case Jt:
936
+ o.author = "tool";
911
937
  break;
912
938
  case "system":
913
- i.author = "system";
939
+ o.author = "system";
914
940
  break;
915
941
  default:
916
- i.author = "main";
942
+ o.author = "main";
917
943
  }
918
- return i.mimeType = t.mimeType, i.created = new Date(t.timestamp), i.eventType = l.NotDefined, i.partial = ((s = (o = t.partial) == null ? void 0 : o.toString()) == null ? void 0 : s.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;
944
+ return o.mimeType = t.mimeType, o.created = new Date(t.timestamp), o.eventType = l.NotDefined, o.partial = ((p = (i = t.partial) == null ? void 0 : i.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;
919
945
  }
920
946
  static getPartType(t) {
921
- return t instanceof dt ? "TextContent" : t instanceof A ? "FunctionCallContent" : t instanceof R ? "FunctionResultContent" : t instanceof w ? "StreamingFunctionCallUpdateContent" : t instanceof I ? "StreamingFinalFunctionCallContent" : t instanceof N ? "StreamingFinalFunctionResultContent" : t instanceof ut ? "FunctionClientOutputContent" : t instanceof lt ? "UserUiContent" : t instanceof St ? "StreamingTextContent" : t instanceof Tt ? "StreamingReasoningContent" : t instanceof O ? "ToolEventContent" : t instanceof pt ? "StreamingToolEventContent" : "Unknown";
947
+ return t instanceof ft ? "TextContent" : t instanceof A ? "FunctionCallContent" : t instanceof O ? "FunctionResultContent" : t instanceof U ? "StreamingFunctionCallUpdateContent" : t instanceof N ? "StreamingFinalFunctionCallContent" : t instanceof F ? "StreamingFinalFunctionResultContent" : t instanceof ct ? "FunctionClientOutputContent" : t instanceof lt ? "UserUiContent" : t instanceof xt ? "StreamingTextContent" : t instanceof ht ? "StreamingReasoningContent" : t instanceof P ? "ToolEventContent" : t instanceof ut ? "StreamingToolEventContent" : "Unknown";
922
948
  }
923
949
  static parseFromTypedEvent(t) {
924
- var s, m, f, z, Et, Ft, Nt;
925
- const i = b.parseFlatPropertiesTypedEvent(t);
926
- if (i.serverError)
927
- return i.parts.push(Dt.fromError(i.serverError)), i;
950
+ var p, g, f, _, It, Nt, bt, At;
951
+ const o = b.parseFlatPropertiesTypedEvent(t);
952
+ if (o.serverError)
953
+ return o.parts.push(Ft.fromError(o.serverError)), o;
928
954
  if (!t.content && !t.streamingParts)
929
- return i;
930
- i.parts = [];
931
- const a = [...((s = t.content) == null ? void 0 : s.items) ?? [], ...t.streamingParts ?? []];
932
- i.eventType = vt(((m = t.eventType) == null ? void 0 : m.type) ?? "");
955
+ return o;
956
+ o.parts = [];
957
+ const a = [...((p = t.content) == null ? void 0 : p.items) ?? [], ...t.streamingParts ?? []];
958
+ o.eventType = Wt(((g = t.eventType) == null ? void 0 : g.type) ?? "");
933
959
  for (const y of a) {
934
- let c = {
960
+ let u = {
935
961
  id: "",
936
- author: i.author,
937
- eventType: i.eventType,
962
+ author: o.author,
963
+ eventType: o.eventType,
938
964
  created: /* @__PURE__ */ new Date(),
939
- visible: i.visible,
940
- partial: i.partial,
965
+ visible: o.visible,
966
+ partial: o.partial,
941
967
  isStillWriting: !1,
942
968
  mustPush: !1,
943
969
  textAppendable: !1
944
970
  };
945
971
  const T = b.getPartType(y);
946
972
  if (T == x.FunctionCallContent || T == x.FunctionResultContent || T == x.StreamingFinalFunctionCallContent || T == x.StreamingFinalFunctionResultContent) {
947
- var o = y;
948
- if (o.id == "Server Error")
949
- c.eventType = l.ServerError, c.errorDetails = {
950
- errorMessage: JSON.stringify(o.arguments)
951
- }, c.functionDetails = void 0;
973
+ var i = y;
974
+ if (i.id == "Server Error")
975
+ u.eventType = l.ServerError, u.errorDetails = {
976
+ errorMessage: JSON.stringify(i.arguments)
977
+ }, u.functionDetails = void 0;
952
978
  else {
953
- c.eventType = T == x.FunctionCallContent || T == x.StreamingFinalFunctionCallContent ? l.FunctionCall : l.FunctionResponse;
979
+ u.eventType = T == x.FunctionCallContent || T == x.StreamingFinalFunctionCallContent ? l.FunctionCall : l.FunctionResponse;
954
980
  let d;
955
981
  try {
956
- if (o != null && o.result)
957
- if (typeof o.result == "object")
958
- d = o.result;
959
- else if (typeof o.result == "string") {
960
- const gt = JSON.parse(o.result);
961
- d = typeof gt == "object" && gt !== null ? gt : o.result;
982
+ if (i != null && i.result)
983
+ if (typeof i.result == "object")
984
+ d = i.result;
985
+ else if (typeof i.result == "string") {
986
+ const dt = JSON.parse(i.result);
987
+ d = typeof dt == "object" && dt !== null ? dt : i.result;
962
988
  } else
963
- d = o.result;
964
- } catch (gt) {
965
- console.warn("Parse function error", gt), d = o == null ? void 0 : o.result;
989
+ d = i.result;
990
+ } catch (dt) {
991
+ console.warn("Parse function error", dt), d = i == null ? void 0 : i.result;
966
992
  }
967
- c.thoughtDetails = {
993
+ u.thoughtDetails = {
968
994
  text: ""
969
- }, c.functionDetails = {
970
- id: (o == null ? void 0 : o.id) ?? "",
971
- args: o == null ? void 0 : o.arguments,
972
- start: T == x.FunctionCallContent ? i.created : void 0,
973
- end: T == x.FunctionResultContent ? i.created : void 0,
974
- text: JSON.stringify(o == null ? void 0 : o.arguments) ?? "",
975
- name: (o == null ? void 0 : o.functionName) ?? "",
976
- status: c.eventType == l.FunctionCall ? "Executing" : "Done",
995
+ }, u.functionDetails = {
996
+ id: (i == null ? void 0 : i.id) ?? "",
997
+ args: i == null ? void 0 : i.arguments,
998
+ start: T == x.FunctionCallContent ? o.created : void 0,
999
+ end: T == x.FunctionResultContent ? o.created : void 0,
1000
+ text: JSON.stringify(i == null ? void 0 : i.arguments) ?? "",
1001
+ name: (i == null ? void 0 : i.functionName) ?? "",
1002
+ status: u.eventType == l.FunctionCall ? "Executing" : "Done",
977
1003
  response: d,
978
- isUi: (o == null ? void 0 : o.isUi) === !0 || typeof (o == null ? void 0 : o.arguments) == "object" && (o == null ? void 0 : o.arguments) !== null && o.arguments.__isUi === !0,
1004
+ isUi: (i == null ? void 0 : i.isUi) === !0 || typeof (i == null ? void 0 : i.arguments) == "object" && (i == null ? void 0 : i.arguments) !== null && i.arguments.__isUi === !0,
979
1005
  // Friendly args summary for the chip — mirrors __isUi: the live streaming part
980
1006
  // carries `friendlyArgsDescription`; the persisted FunctionCall carries
981
1007
  // `__argsDescription` in its args (see StreamingFinalFunctionCallContent.ToKernelContent).
982
- argsDescription: (o == null ? void 0 : o.friendlyArgsDescription) ?? (typeof (o == null ? void 0 : o.arguments) == "object" && (o == null ? void 0 : o.arguments) !== null ? o.arguments.__argsDescription : void 0),
1008
+ argsDescription: (i == null ? void 0 : i.friendlyArgsDescription) ?? (typeof (i == null ? void 0 : i.arguments) == "object" && (i == null ? void 0 : i.arguments) !== null ? i.arguments.__argsDescription : void 0),
983
1009
  // Client-only payload riding the RESULT event. The streaming form carries it
984
1010
  // top-level (clientOutput); when the runtime collapses that to a sealed
985
1011
  // FunctionResultContent (ToKernelContent) the payload rides in metadata, and
986
1012
  // the client's part flattener keeps THAT collapsed part — so read both. Calls
987
1013
  // leave it undefined. The persisted-replay form folds in via FunctionClientOutputContent.
988
- clientOutput: (o == null ? void 0 : o.clientOutput) ?? ((f = o == null ? void 0 : o.metadata) == null ? void 0 : f.clientOutput)
989
- }, t.text = o == null ? void 0 : o.arguments;
1014
+ clientOutput: (i == null ? void 0 : i.clientOutput) ?? ((f = i == null ? void 0 : i.metadata) == null ? void 0 : f.clientOutput),
1015
+ // Ask-user component ([KernelUIComponent]). Mirrors __isUi/clientOutput across the
1016
+ // three shapes: the live streaming part carries it top-level (askUserComponent), a
1017
+ // persisted FunctionCall carries `__askUserComponent` in its args, and a collapsed
1018
+ // FunctionResult carries it in metadata (see the two ToKernelContent methods).
1019
+ askUserComponent: (i == null ? void 0 : i.askUserComponent) ?? (typeof (i == null ? void 0 : i.arguments) == "object" && (i == null ? void 0 : i.arguments) !== null ? i.arguments.__askUserComponent : void 0) ?? ((_ = i == null ? void 0 : i.metadata) == null ? void 0 : _.askUserComponent)
1020
+ }, u.functionDetails.isAskUser = !!u.functionDetails.askUserComponent, t.text = i == null ? void 0 : i.arguments;
990
1021
  }
991
1022
  } else if (T == x.StreamingTextContent)
992
- c.eventType = l.Text, c.text = (z = y == null ? void 0 : y.text) == null ? void 0 : z.replaceAll("\\n", `
993
- `), c.textLastChunk = y.text, t.text = c.text;
1023
+ u.eventType = l.Text, u.text = (It = y == null ? void 0 : y.text) == null ? void 0 : It.replaceAll("\\n", `
1024
+ `), u.textLastChunk = y.text, t.text = u.text;
994
1025
  else if (T == x.TextContent)
995
- c.eventType = l.Text, c.text = (Et = y == null ? void 0 : y.text) == null ? void 0 : Et.replaceAll("\\n", `
996
- `), c.textLastChunk = y.text, t.text = c.text;
1026
+ u.eventType = l.Text, u.text = (Nt = y == null ? void 0 : y.text) == null ? void 0 : Nt.replaceAll("\\n", `
1027
+ `), u.textLastChunk = y.text, t.text = u.text;
997
1028
  else if (T == x.StreamingReasoningContent)
998
- c.eventType = l.Thought, c.thoughtDetails = {
999
- text: ((Ft = y == null ? void 0 : y.text) == null ? void 0 : Ft.replaceAll("\\n", `
1029
+ u.eventType = l.Thought, u.thoughtDetails = {
1030
+ text: ((bt = y == null ? void 0 : y.text) == null ? void 0 : bt.replaceAll("\\n", `
1000
1031
  `)) ?? ""
1001
- }, c.text = (Nt = y == null ? void 0 : y.text) == null ? void 0 : Nt.replaceAll("\\n", `
1002
- `), c.textLastChunk = y.text, t.text = c.text;
1032
+ }, u.text = (At = y == null ? void 0 : y.text) == null ? void 0 : At.replaceAll("\\n", `
1033
+ `), u.textLastChunk = y.text, t.text = u.text;
1003
1034
  else if (T == x.StreamingFunctionCallUpdateContent) {
1004
1035
  const d = y;
1005
- c.eventType = l.PartialFunctionCall, c.text = d.arguments, c.thoughtDetails = {
1036
+ u.eventType = l.PartialFunctionCall, u.text = d.arguments, u.thoughtDetails = {
1006
1037
  text: ""
1007
- }, c.functionDetails = {
1038
+ }, u.functionDetails = {
1008
1039
  id: d.callId ?? "",
1009
- text: c.text,
1040
+ text: u.text,
1010
1041
  status: "Composing",
1011
1042
  name: (d == null ? void 0 : d.name) ?? "Unknown"
1012
- }, t.text = c.text;
1043
+ }, t.text = u.text;
1013
1044
  } else if (T == x.ToolEventContent || T == x.StreamingToolEventContent) {
1014
- c.eventType = l.ToolEvent;
1045
+ u.eventType = l.ToolEvent;
1015
1046
  const d = y;
1016
- c.toolDetails = {
1047
+ u.toolDetails = {
1017
1048
  eventName: d.eventName ?? "",
1018
1049
  eventData: d.eventData ?? "",
1019
1050
  sessionId: d.sessionId ?? void 0
1020
1051
  };
1021
1052
  } else if (T == x.FunctionClientOutputContent) {
1022
1053
  const d = y;
1023
- c.eventType = l.FunctionClientOutput, c.functionDetails = {
1054
+ u.eventType = l.FunctionClientOutput, u.functionDetails = {
1024
1055
  id: d.id ?? "",
1025
1056
  name: "",
1026
1057
  status: "Done",
1027
1058
  clientOutput: d.data
1028
1059
  };
1060
+ } else if (T == x.StreamingClientOutputContent) {
1061
+ const d = y;
1062
+ u.eventType = l.FunctionClientOutput, u.functionDetails = {
1063
+ id: d.id ?? "",
1064
+ name: "",
1065
+ // The parked call stays Executing; interactionService folds only clientOutput onto it and
1066
+ // leaves the existing status untouched, so this is just to satisfy the type.
1067
+ status: "Executing",
1068
+ clientOutput: d.clientOutput
1069
+ };
1029
1070
  } else if (T == x.UserUiContent) {
1030
1071
  const d = y;
1031
- c.eventType = l.UserAnswer, c.author = "user", c.functionDetails = {
1072
+ u.eventType = l.UserAnswer, u.author = "user", u.functionDetails = {
1032
1073
  id: "",
1033
1074
  name: d.name ?? "",
1034
1075
  args: d.args,
@@ -1036,14 +1077,14 @@ const b = class b {
1036
1077
  isUi: !0
1037
1078
  };
1038
1079
  } else {
1039
- c.eventType = l.NotDefined, console.warn(`Got a unmapped event_type:${i.eventType}, data:`, T, y);
1080
+ u.eventType = l.NotDefined, console.warn(`Got a unmapped event_type:${o.eventType}, data:`, T, y);
1040
1081
  continue;
1041
1082
  }
1042
- i.parts.push(c);
1083
+ o.parts.push(u);
1043
1084
  }
1044
- return i;
1085
+ return o;
1045
1086
  }
1046
- static createFromThought(t, i) {
1087
+ static createFromThought(t, o) {
1047
1088
  return {
1048
1089
  author: "main",
1049
1090
  visible: !0,
@@ -1061,9 +1102,9 @@ const b = class b {
1061
1102
  parts: [
1062
1103
  {
1063
1104
  thoughtDetails: {
1064
- text: i
1105
+ text: o
1065
1106
  },
1066
- id: xt(),
1107
+ id: Dt(),
1067
1108
  created: /* @__PURE__ */ new Date(),
1068
1109
  eventType: l.Thought,
1069
1110
  author: "main",
@@ -1075,9 +1116,9 @@ const b = class b {
1075
1116
  ]
1076
1117
  };
1077
1118
  }
1078
- static createFromFunctionName(t, i, a) {
1079
- const o = b.createFromText("", i);
1080
- return o.parts[0].text = void 0, o.parts[0].thoughtDetails = void 0, o.parts[0].textAppendable = !1, o.parts[0].mustPush = !0, o.parts[0].functionDetails = {
1119
+ static createFromFunctionName(t, o, a) {
1120
+ const i = b.createFromText("", o);
1121
+ return i.parts[0].text = void 0, i.parts[0].thoughtDetails = void 0, i.parts[0].textAppendable = !1, i.parts[0].mustPush = !0, i.parts[0].functionDetails = {
1081
1122
  name: t,
1082
1123
  id: "callId",
1083
1124
  status: "Executing",
@@ -1085,15 +1126,15 @@ const b = class b {
1085
1126
  end: void 0,
1086
1127
  text: "dfsdfdf",
1087
1128
  args: a
1088
- }, o;
1129
+ }, i;
1089
1130
  }
1090
- static createFromText(t, i, a) {
1131
+ static createFromText(t, o, a) {
1091
1132
  return {
1092
1133
  author: "main",
1093
1134
  visible: !0,
1094
1135
  eventType: l.Text,
1095
1136
  uniqueId: (/* @__PURE__ */ new Date()).getTime().toString(),
1096
- interactionId: i,
1137
+ interactionId: o,
1097
1138
  allEventTypes: [l.Text],
1098
1139
  artifactsDelta: [""],
1099
1140
  model_session_id: "",
@@ -1111,7 +1152,7 @@ const b = class b {
1111
1152
  thoughtDetails: a ? {
1112
1153
  text: a
1113
1154
  } : void 0,
1114
- id: xt(),
1155
+ id: Dt(),
1115
1156
  created: /* @__PURE__ */ new Date(),
1116
1157
  // Part eventType MUST match the outer event's eventType.
1117
1158
  // Was previously `Thought` here, which made the merger
@@ -1131,146 +1172,147 @@ const b = class b {
1131
1172
  };
1132
1173
  }
1133
1174
  };
1134
- u(b, "ServerEvent");
1135
- let bt = b;
1136
- const Rt = [
1175
+ c(b, "ServerEvent");
1176
+ let Ut = b;
1177
+ const wt = [
1137
1178
  // KernelContent derived types
1138
- dt,
1139
1179
  ft,
1180
+ St,
1140
1181
  A,
1182
+ P,
1141
1183
  O,
1142
- R,
1143
- ut,
1144
- lt,
1145
1184
  ct,
1185
+ lt,
1186
+ mt,
1146
1187
  // StreamingKernelContent derived types
1147
- St,
1148
- w,
1149
- Tt,
1150
- I,
1188
+ xt,
1189
+ U,
1190
+ ht,
1151
1191
  N,
1152
- _
1192
+ F,
1193
+ Tt,
1194
+ k
1153
1195
  ];
1154
- function Jt(p) {
1155
- return p.name;
1196
+ function qt(s) {
1197
+ return s.name;
1156
1198
  }
1157
- u(Jt, "getConstructorName");
1158
- function wt(p, t, i, a) {
1159
- t.constructor !== i && (p.$type = (a == null ? void 0 : a.name) ?? Jt(t.constructor));
1199
+ c(qt, "getConstructorName");
1200
+ function Pt(s, t, o, a) {
1201
+ t.constructor !== o && (s.$type = (a == null ? void 0 : a.name) ?? qt(t.constructor));
1160
1202
  }
1161
- u(wt, "dotNetTypeEmitter");
1162
- function Pt(p, t) {
1163
- if (p.$type != null)
1164
- return t.get(p.$type);
1203
+ c(Pt, "dotNetTypeEmitter");
1204
+ function kt(s, t) {
1205
+ if (s.$type != null)
1206
+ return t.get(s.$type);
1165
1207
  }
1166
- u(Pt, "dotnetTypeResolver");
1167
- function Ut() {
1168
- const p = new At(S);
1169
- return p.config({
1170
- knownTypes: Rt,
1171
- typeHintEmitter: wt,
1172
- typeResolver: Pt
1173
- }), p;
1208
+ c(kt, "dotnetTypeResolver");
1209
+ function _t() {
1210
+ const s = new Rt(S);
1211
+ return s.config({
1212
+ knownTypes: wt,
1213
+ typeHintEmitter: Pt,
1214
+ typeResolver: kt
1215
+ }), s;
1174
1216
  }
1175
- u(Ut, "createEventSerializer");
1176
- function Wt() {
1177
- const p = new At(F);
1178
- return p.config({
1179
- knownTypes: Rt,
1180
- typeHintEmitter: wt,
1181
- typeResolver: Pt
1182
- }), p;
1217
+ c(_t, "createEventSerializer");
1218
+ function Bt() {
1219
+ const s = new Rt(I);
1220
+ return s.config({
1221
+ knownTypes: wt,
1222
+ typeHintEmitter: Pt,
1223
+ typeResolver: kt
1224
+ }), s;
1183
1225
  }
1184
- u(Wt, "createStreamingResponseSerializer");
1185
- function Ot(p) {
1226
+ c(Bt, "createStreamingResponseSerializer");
1227
+ function zt(s) {
1186
1228
  try {
1187
- return JSON.parse(p), p;
1229
+ return JSON.parse(s), s;
1188
1230
  } catch {
1189
- let i = "", a = !1;
1190
- for (let o = 0; o < p.length; o++) {
1191
- const s = p[o], m = s.charCodeAt(0);
1192
- if (s === "\\" && a && o + 1 < p.length) {
1193
- const f = p[o + 1];
1231
+ let o = "", a = !1;
1232
+ for (let i = 0; i < s.length; i++) {
1233
+ const p = s[i], g = p.charCodeAt(0);
1234
+ if (p === "\\" && a && i + 1 < s.length) {
1235
+ const f = s[i + 1];
1194
1236
  if (f === '"' || f === "\\" || f === "/" || f === "b" || f === "f" || f === "n" || f === "r" || f === "t") {
1195
- i += s + f, o++;
1237
+ o += p + f, i++;
1196
1238
  continue;
1197
- } else if (f === "u" && o + 5 < p.length) {
1198
- i += p.substring(o, o + 6), o += 5;
1239
+ } else if (f === "u" && i + 5 < s.length) {
1240
+ o += s.substring(i, i + 6), i += 5;
1199
1241
  continue;
1200
1242
  } else {
1201
- i += s;
1243
+ o += p;
1202
1244
  continue;
1203
1245
  }
1204
1246
  }
1205
- if (s === '"') {
1247
+ if (p === '"') {
1206
1248
  let f = 0;
1207
- for (let z = o - 1; z >= 0 && p[z] === "\\"; z--)
1249
+ for (let _ = i - 1; _ >= 0 && s[_] === "\\"; _--)
1208
1250
  f++;
1209
- f % 2 === 0 && (a = !a), i += s;
1251
+ f % 2 === 0 && (a = !a), o += p;
1210
1252
  continue;
1211
1253
  }
1212
- if (a && m < 32)
1213
- switch (s) {
1254
+ if (a && g < 32)
1255
+ switch (p) {
1214
1256
  case `
1215
1257
  `:
1216
- i += "\\n";
1258
+ o += "\\n";
1217
1259
  break;
1218
1260
  case "\r":
1219
- i += "\\r";
1261
+ o += "\\r";
1220
1262
  break;
1221
1263
  case " ":
1222
- i += "\\t";
1264
+ o += "\\t";
1223
1265
  break;
1224
1266
  case "\f":
1225
- i += "\\f";
1267
+ o += "\\f";
1226
1268
  break;
1227
1269
  case "\b":
1228
- i += "\\b";
1270
+ o += "\\b";
1229
1271
  break;
1230
1272
  default:
1231
- const f = m.toString(16).padStart(4, "0");
1232
- i += `\\u${f}`;
1273
+ const f = g.toString(16).padStart(4, "0");
1274
+ o += `\\u${f}`;
1233
1275
  break;
1234
1276
  }
1235
1277
  else
1236
- i += s;
1278
+ o += p;
1237
1279
  }
1238
- return i;
1280
+ return o;
1239
1281
  }
1240
1282
  }
1241
- u(Ot, "sanitizeJsonString");
1242
- function Bt(p) {
1243
- const t = Ot(p);
1244
- return Wt().parse(t);
1283
+ c(zt, "sanitizeJsonString");
1284
+ function Yt(s) {
1285
+ const t = zt(s);
1286
+ return Bt().parse(t);
1245
1287
  }
1246
- u(Bt, "deserializePayload");
1247
- function Mt(p) {
1248
- const t = Ot(p);
1249
- return Ut().parse(t);
1288
+ c(Yt, "deserializePayload");
1289
+ function vt(s) {
1290
+ const t = zt(s);
1291
+ return _t().parse(t);
1250
1292
  }
1251
- u(Mt, "deserializeEvent");
1252
- function Kt(p) {
1253
- return Ut().stringify(p);
1293
+ c(vt, "deserializeEvent");
1294
+ function Qt(s) {
1295
+ return _t().stringify(s);
1254
1296
  }
1255
- u(Kt, "serializeEvent");
1297
+ c(Qt, "serializeEvent");
1256
1298
  export {
1257
- ct as C,
1299
+ mt as C,
1258
1300
  A as F,
1259
- Dt as I,
1301
+ Ft as I,
1260
1302
  S as L,
1261
1303
  x as P,
1262
- bt as S,
1263
- dt as T,
1264
- R as a,
1265
- w as b,
1266
- Tt as c,
1267
- F as d,
1268
- St as e,
1269
- Ut as f,
1270
- Wt as g,
1271
- Mt as h,
1272
- Bt as i,
1273
- Kt as j,
1274
- Ot as s
1304
+ Ut as S,
1305
+ ft as T,
1306
+ O as a,
1307
+ U as b,
1308
+ ht as c,
1309
+ I as d,
1310
+ xt as e,
1311
+ _t as f,
1312
+ Bt as g,
1313
+ vt as h,
1314
+ Yt as i,
1315
+ Qt as j,
1316
+ zt as s
1275
1317
  };
1276
- //# sourceMappingURL=serializer-DyHZxlAG.js.map
1318
+ //# sourceMappingURL=serializer-C1uBjgTd.js.map