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