@aintela/chat 0.4.34 → 0.4.36
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 +5618 -5519
- package/dist/components.js.map +1 -1
- package/dist/hooks.js +1 -1
- package/dist/{httpArtifactService-_66bhjGo.js → httpArtifactService-GdGsaFKS.js} +7 -4
- package/dist/httpArtifactService-GdGsaFKS.js.map +1 -0
- package/dist/{httpSessionService-B3CxFtl1.js → httpSessionService-CUujaUo6.js} +130 -113
- package/dist/httpSessionService-CUujaUo6.js.map +1 -0
- package/dist/index.js +4 -4
- package/dist/models.js +1 -1
- package/dist/{serializer-BB8Cz7YD.js → serializer-DX-yGa_k.js} +547 -524
- package/dist/serializer-DX-yGa_k.js.map +1 -0
- package/dist/services.js +2 -2
- package/dist/src/components/AiChat/AiChatContext.d.ts +2 -0
- package/dist/src/components/AiChat/AiChatTypes.d.ts +11 -0
- package/dist/src/components/AiChat/ChatPane/messageAgentSummarized.test.d.ts +1 -0
- package/dist/src/components/AiChat/ChatPane/parts/ThoughtRun.d.ts +14 -0
- package/dist/src/components/AiChat/ChatPane/reasoningHeadlines.d.ts +13 -0
- package/dist/src/components/AiChat/ChatPane/reasoningHeadlines.test.d.ts +1 -0
- package/dist/src/models/ServerEvent.d.ts +3 -0
- package/dist/src/models/enums.d.ts +2 -1
- package/dist/src/models/semanticKernelModel/models.d.ts +10 -1
- package/dist/{useChatSessions-BzgPYfyj.js → useChatSessions-BXYvvd4S.js} +2 -2
- package/dist/{useChatSessions-BzgPYfyj.js.map → useChatSessions-BXYvvd4S.js.map} +1 -1
- package/package.json +1 -1
- package/dist/httpArtifactService-_66bhjGo.js.map +0 -1
- package/dist/httpSessionService-B3CxFtl1.js.map +0 -1
- package/dist/serializer-BB8Cz7YD.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
1
|
+
var k = Object.defineProperty;
|
|
2
|
+
var L = (e, t, n) => t in e ? k(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
3
|
+
var f = (e, t) => k(e, "name", { value: t, configurable: !0 });
|
|
4
|
+
var _ = (e, t, n) => L(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
5
|
import "reflect-metadata";
|
|
6
|
-
import { p as
|
|
6
|
+
import { p as j, S as N, E as v } from "./serializer-DX-yGa_k.js";
|
|
7
7
|
function G(e) {
|
|
8
8
|
if (e === null || typeof e != "object") return e;
|
|
9
9
|
const t = e;
|
|
@@ -13,35 +13,52 @@ function G(e) {
|
|
|
13
13
|
}
|
|
14
14
|
return t;
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
function
|
|
18
|
-
var t, n, s,
|
|
19
|
-
for (const
|
|
20
|
-
if (((n = (t =
|
|
21
|
-
const l = (
|
|
16
|
+
f(G, "stripMongoDbDiscriminator");
|
|
17
|
+
function z(e) {
|
|
18
|
+
var t, n, s, o;
|
|
19
|
+
for (const r of e) {
|
|
20
|
+
if (((n = (t = r.role) == null ? void 0 : t.label) == null ? void 0 : n.toLowerCase()) !== "user") continue;
|
|
21
|
+
const l = (o = (s = r.content) == null ? void 0 : s.items) == null ? void 0 : o.find((w) => "text" in w && typeof w.text == "string");
|
|
22
22
|
if (l) return l.text;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
function
|
|
28
|
-
var s
|
|
25
|
+
f(z, "firstUserText");
|
|
26
|
+
const O = "ChatResponseMessage.ReasoningContent", P = "ChatResponseMessage.ReasoningHeadlines";
|
|
27
|
+
function b(e) {
|
|
28
|
+
var s;
|
|
29
|
+
const t = e == null ? void 0 : e.content;
|
|
30
|
+
if (!t) return;
|
|
31
|
+
const n = ((s = t.metadata) == null ? void 0 : s[P]) ?? (t.items ?? []).map((o) => {
|
|
32
|
+
var r;
|
|
33
|
+
return (r = o == null ? void 0 : o.metadata) == null ? void 0 : r[P];
|
|
34
|
+
}).find((o) => typeof o == "string");
|
|
35
|
+
if (!(typeof n != "string" || !n.trim()))
|
|
36
|
+
try {
|
|
37
|
+
const o = JSON.parse(n);
|
|
38
|
+
return Array.isArray(o) ? o.filter((r) => typeof r == "string" && r.length > 0) : void 0;
|
|
39
|
+
} catch {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
f(b, "extractHeadlines");
|
|
44
|
+
function Q(e) {
|
|
45
|
+
var s, o;
|
|
29
46
|
const t = e == null ? void 0 : e.content;
|
|
30
47
|
if (!t) return;
|
|
31
|
-
const n = (s = t.metadata) == null ? void 0 : s[
|
|
48
|
+
const n = (s = t.metadata) == null ? void 0 : s[O];
|
|
32
49
|
if (typeof n == "string" && n.trim()) return n.trim();
|
|
33
|
-
for (const
|
|
34
|
-
const l = (
|
|
50
|
+
for (const r of t.items ?? []) {
|
|
51
|
+
const l = (o = r == null ? void 0 : r.metadata) == null ? void 0 : o[O];
|
|
35
52
|
if (typeof l == "string" && l.trim()) return l.trim();
|
|
36
53
|
}
|
|
37
54
|
}
|
|
38
|
-
|
|
39
|
-
function
|
|
55
|
+
f(Q, "extractReasoning");
|
|
56
|
+
function F(e) {
|
|
40
57
|
return e === v.FunctionCall || e === v.PartialFunctionCall;
|
|
41
58
|
}
|
|
42
|
-
|
|
43
|
-
function
|
|
44
|
-
var n, s,
|
|
59
|
+
f(F, "isFunctionCallType");
|
|
60
|
+
function K(e, t) {
|
|
61
|
+
var n, s, o, r, l;
|
|
45
62
|
return {
|
|
46
63
|
...e,
|
|
47
64
|
eventType: v.FunctionResponse,
|
|
@@ -50,91 +67,91 @@ function N(e, t) {
|
|
|
50
67
|
name: ((n = t.functionDetails) == null ? void 0 : n.name) ?? e.functionDetails.name,
|
|
51
68
|
args: e.functionDetails.args ?? ((s = t.functionDetails) == null ? void 0 : s.args),
|
|
52
69
|
text: e.functionDetails.text,
|
|
53
|
-
response: (
|
|
54
|
-
status: ((
|
|
70
|
+
response: (o = t.functionDetails) == null ? void 0 : o.response,
|
|
71
|
+
status: ((r = t.functionDetails) == null ? void 0 : r.status) ?? "Done",
|
|
55
72
|
start: e.functionDetails.start,
|
|
56
73
|
end: ((l = t.functionDetails) == null ? void 0 : l.end) ?? e.functionDetails.end,
|
|
57
74
|
silent: e.functionDetails.silent
|
|
58
75
|
}
|
|
59
76
|
};
|
|
60
77
|
}
|
|
61
|
-
|
|
62
|
-
function
|
|
63
|
-
var
|
|
64
|
-
const t =
|
|
65
|
-
for (const
|
|
66
|
-
const
|
|
78
|
+
f(K, "foldResponseIntoCall");
|
|
79
|
+
function W(e) {
|
|
80
|
+
var r, l, w, R, U;
|
|
81
|
+
const t = j(), n = [], s = /* @__PURE__ */ new Map();
|
|
82
|
+
for (const A of e) {
|
|
83
|
+
const S = G(A), m = t.parse(S);
|
|
67
84
|
if (!m) continue;
|
|
68
|
-
const
|
|
69
|
-
if (!
|
|
70
|
-
const
|
|
71
|
-
let
|
|
72
|
-
|
|
85
|
+
const T = N.parseFromTypedEvent(m);
|
|
86
|
+
if (!T) continue;
|
|
87
|
+
const a = T.interactionId ?? "__root__";
|
|
88
|
+
let d = s.get(a);
|
|
89
|
+
d || (d = { llm: [], server: [], raw: [] }, s.set(a, d), n.push(a)), d.llm.push(m), d.server.push(T), d.raw.push(S);
|
|
73
90
|
}
|
|
74
|
-
const
|
|
75
|
-
for (const
|
|
76
|
-
const { llm:
|
|
77
|
-
const
|
|
78
|
-
...
|
|
79
|
-
id: `${
|
|
91
|
+
const o = [];
|
|
92
|
+
for (const A of n) {
|
|
93
|
+
const { llm: S, server: m, raw: T } = s.get(A), a = [], d = [], g = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ f((p) => {
|
|
94
|
+
const h = {
|
|
95
|
+
...p,
|
|
96
|
+
id: `${a.length + 1}-${A}`,
|
|
80
97
|
partial: !1,
|
|
81
98
|
isStillWriting: !1
|
|
82
99
|
};
|
|
83
|
-
return
|
|
100
|
+
return a.push(h), a.length - 1;
|
|
84
101
|
}, "pushPart");
|
|
85
|
-
for (let
|
|
86
|
-
const
|
|
102
|
+
for (let p = 0; p < m.length; p++) {
|
|
103
|
+
const h = m[p], C = (l = (r = S[p].role) == null ? void 0 : r.label) == null ? void 0 : l.toLowerCase();
|
|
87
104
|
if (C === "user" || C === "system") {
|
|
88
105
|
if (C === "user")
|
|
89
|
-
for (const
|
|
90
|
-
|
|
106
|
+
for (const i of h.parts)
|
|
107
|
+
i.eventType === v.UserAnswer && x(i);
|
|
91
108
|
continue;
|
|
92
109
|
}
|
|
93
|
-
if (
|
|
94
|
-
for (const
|
|
95
|
-
const
|
|
96
|
-
I === -1 ?
|
|
110
|
+
if (h.llmArtifacts && h.llmArtifacts.length > 0)
|
|
111
|
+
for (const i of h.llmArtifacts) {
|
|
112
|
+
const c = i.toArtifact(), I = d.findIndex((u) => u.id === c.id);
|
|
113
|
+
I === -1 ? d.push(c) : d[I] = c;
|
|
97
114
|
}
|
|
98
|
-
const
|
|
115
|
+
const D = Q(T[p]);
|
|
99
116
|
let $ = !1;
|
|
100
|
-
for (const
|
|
101
|
-
const
|
|
102
|
-
if (
|
|
103
|
-
const u = g.get(
|
|
104
|
-
|
|
117
|
+
for (const i of h.parts) {
|
|
118
|
+
const c = (w = i.functionDetails) == null ? void 0 : w.id;
|
|
119
|
+
if (i.eventType === v.FunctionResponse && c && g.has(c)) {
|
|
120
|
+
const u = g.get(c);
|
|
121
|
+
a[u] = K(a[u], i);
|
|
105
122
|
continue;
|
|
106
123
|
}
|
|
107
|
-
if (
|
|
108
|
-
if (g.has(
|
|
109
|
-
const u = g.get(
|
|
110
|
-
|
|
124
|
+
if (i.eventType === v.FunctionClientOutput && c) {
|
|
125
|
+
if (g.has(c)) {
|
|
126
|
+
const u = g.get(c), y = a[u];
|
|
127
|
+
a[u] = {
|
|
111
128
|
...y,
|
|
112
129
|
functionDetails: {
|
|
113
130
|
...y.functionDetails,
|
|
114
|
-
clientOutput: (
|
|
131
|
+
clientOutput: (R = i.functionDetails) == null ? void 0 : R.clientOutput
|
|
115
132
|
}
|
|
116
133
|
};
|
|
117
134
|
}
|
|
118
135
|
continue;
|
|
119
136
|
}
|
|
120
|
-
if (
|
|
121
|
-
const u = g.get(
|
|
122
|
-
|
|
137
|
+
if (F(i.eventType) && c && g.has(c)) {
|
|
138
|
+
const u = g.get(c), y = a[u];
|
|
139
|
+
a[u] = {
|
|
123
140
|
...y,
|
|
124
|
-
eventType:
|
|
125
|
-
functionDetails: { ...y.functionDetails, ...
|
|
141
|
+
eventType: i.eventType,
|
|
142
|
+
functionDetails: { ...y.functionDetails, ...i.functionDetails }
|
|
126
143
|
};
|
|
127
144
|
continue;
|
|
128
145
|
}
|
|
129
|
-
if (
|
|
130
|
-
const u = !!
|
|
131
|
-
if (!u && !y && !
|
|
146
|
+
if (i.eventType === v.Text) {
|
|
147
|
+
const u = !!i.text && i.text.length > 0, y = !!D && !$;
|
|
148
|
+
if (!u && !y && !i.thoughtDetails)
|
|
132
149
|
continue;
|
|
133
150
|
if (y) {
|
|
134
|
-
|
|
135
|
-
...
|
|
151
|
+
x({
|
|
152
|
+
...i,
|
|
136
153
|
eventType: u ? v.Text : v.Thought,
|
|
137
|
-
thoughtDetails: { text: T },
|
|
154
|
+
thoughtDetails: { text: D, headlines: b(T[p]) },
|
|
138
155
|
// A step with no answer text BECOMES the thought, and
|
|
139
156
|
// `ThoughtPart` renders `part.text` (via
|
|
140
157
|
// getPartTextContent) — leaving it empty drew the
|
|
@@ -143,52 +160,52 @@ function Q(e) {
|
|
|
143
160
|
// is the same part rebuilt from Session.Events, so it has
|
|
144
161
|
// to agree. When there IS answer text the part stays a
|
|
145
162
|
// Text and keeps it — the reasoning rides the strip.
|
|
146
|
-
text: u ?
|
|
163
|
+
text: u ? i.text : D
|
|
147
164
|
}), $ = !0;
|
|
148
165
|
continue;
|
|
149
166
|
}
|
|
150
|
-
|
|
167
|
+
x(i);
|
|
151
168
|
continue;
|
|
152
169
|
}
|
|
153
|
-
const I =
|
|
154
|
-
|
|
170
|
+
const I = x(i);
|
|
171
|
+
F(i.eventType) && c && g.set(c, I);
|
|
155
172
|
}
|
|
156
|
-
|
|
173
|
+
D && !$ && x({
|
|
157
174
|
id: "",
|
|
158
|
-
author:
|
|
175
|
+
author: h.author,
|
|
159
176
|
eventType: v.Thought,
|
|
160
|
-
created:
|
|
177
|
+
created: h.created,
|
|
161
178
|
partial: !1,
|
|
162
179
|
isStillWriting: !1,
|
|
163
180
|
mustPush: !1,
|
|
164
181
|
textAppendable: !1,
|
|
165
|
-
thoughtDetails: { text: T },
|
|
182
|
+
thoughtDetails: { text: D, headlines: b(T[p]) },
|
|
166
183
|
// Both, for the same reason as above: the renderer reads `text`.
|
|
167
|
-
text:
|
|
184
|
+
text: D
|
|
168
185
|
});
|
|
169
186
|
}
|
|
170
|
-
const
|
|
171
|
-
for (const [
|
|
172
|
-
|
|
173
|
-
created: ((
|
|
174
|
-
interactionId:
|
|
175
|
-
artifactData:
|
|
187
|
+
const M = /* @__PURE__ */ new Map();
|
|
188
|
+
for (const [p, h] of g) M.set(p, a[h]);
|
|
189
|
+
o.push({
|
|
190
|
+
created: ((U = m[0]) == null ? void 0 : U.created) ?? /* @__PURE__ */ new Date(),
|
|
191
|
+
interactionId: A,
|
|
192
|
+
artifactData: d,
|
|
176
193
|
partial: !1,
|
|
177
194
|
turn_complete: !0,
|
|
178
|
-
parts:
|
|
195
|
+
parts: a,
|
|
179
196
|
version: m.length,
|
|
180
|
-
functionMap:
|
|
181
|
-
interactionQuestion:
|
|
197
|
+
functionMap: M,
|
|
198
|
+
interactionQuestion: z(S) ?? ""
|
|
182
199
|
});
|
|
183
200
|
}
|
|
184
|
-
return
|
|
201
|
+
return o;
|
|
185
202
|
}
|
|
186
|
-
|
|
187
|
-
function
|
|
203
|
+
f(W, "decodeSessionEvents");
|
|
204
|
+
function Y(e) {
|
|
188
205
|
return (typeof e == "function" ? e() : e) ?? "";
|
|
189
206
|
}
|
|
190
|
-
|
|
191
|
-
function
|
|
207
|
+
f(Y, "resolveAccessToken");
|
|
208
|
+
function B(e, t = []) {
|
|
192
209
|
return {
|
|
193
210
|
id: e.id,
|
|
194
211
|
browserScopeId: e.id,
|
|
@@ -208,17 +225,17 @@ function O(e, t = []) {
|
|
|
208
225
|
updatedAt: e.updatedAt ? new Date(e.updatedAt) : void 0
|
|
209
226
|
};
|
|
210
227
|
}
|
|
211
|
-
|
|
212
|
-
const
|
|
228
|
+
f(B, "headerToChatSession");
|
|
229
|
+
const E = class E {
|
|
213
230
|
constructor(t, n) {
|
|
214
|
-
|
|
215
|
-
|
|
231
|
+
_(this, "serverBaseUrl");
|
|
232
|
+
_(this, "accessToken");
|
|
216
233
|
this.serverBaseUrl = t.replace(/\/$/, ""), this.accessToken = n;
|
|
217
234
|
}
|
|
218
235
|
get headers() {
|
|
219
236
|
return {
|
|
220
237
|
"Content-Type": "application/json",
|
|
221
|
-
Authorization: `Bearer ${
|
|
238
|
+
Authorization: `Bearer ${Y(this.accessToken)}`
|
|
222
239
|
};
|
|
223
240
|
}
|
|
224
241
|
async getAllSessions() {
|
|
@@ -226,7 +243,7 @@ const _ = class _ {
|
|
|
226
243
|
headers: this.headers
|
|
227
244
|
});
|
|
228
245
|
if (!t.ok) throw new Error(`getAllSessions HTTP ${t.status}`);
|
|
229
|
-
return (await t.json()).map((s) =>
|
|
246
|
+
return (await t.json()).map((s) => B(s));
|
|
230
247
|
}
|
|
231
248
|
async retrieveSession(t) {
|
|
232
249
|
const n = await fetch(`${this.serverBaseUrl}/sessions/${t}`, {
|
|
@@ -234,9 +251,9 @@ const _ = class _ {
|
|
|
234
251
|
});
|
|
235
252
|
if (n.status === 404) return null;
|
|
236
253
|
if (!n.ok) throw new Error(`retrieveSession HTTP ${n.status}`);
|
|
237
|
-
const s = await n.json(),
|
|
238
|
-
for (const
|
|
239
|
-
return
|
|
254
|
+
const s = await n.json(), o = W(s.events ?? []);
|
|
255
|
+
for (const r of o) r.sessionId = s.header.id;
|
|
256
|
+
return B(s.header, o);
|
|
240
257
|
}
|
|
241
258
|
async getLastUsedSession() {
|
|
242
259
|
return (await this.getAllSessions())[0] ?? null;
|
|
@@ -269,8 +286,8 @@ const _ = class _ {
|
|
|
269
286
|
}
|
|
270
287
|
async patchSession(t, n) {
|
|
271
288
|
if (n.overview == null) return;
|
|
272
|
-
const s = `${this.serverBaseUrl}/Session/Overview?sessionId=${encodeURIComponent(t)}&overview=${encodeURIComponent(n.overview)}`,
|
|
273
|
-
if (!
|
|
289
|
+
const s = `${this.serverBaseUrl}/Session/Overview?sessionId=${encodeURIComponent(t)}&overview=${encodeURIComponent(n.overview)}`, o = await fetch(s, { method: "PATCH", headers: this.headers });
|
|
290
|
+
if (!o.ok) throw new Error(`patchSession HTTP ${o.status}`);
|
|
274
291
|
}
|
|
275
292
|
delayedPatchActiveSession(t) {
|
|
276
293
|
}
|
|
@@ -284,11 +301,11 @@ const _ = class _ {
|
|
|
284
301
|
return t;
|
|
285
302
|
}
|
|
286
303
|
};
|
|
287
|
-
|
|
288
|
-
let
|
|
304
|
+
f(E, "HttpSessionService");
|
|
305
|
+
let H = E;
|
|
289
306
|
export {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
307
|
+
H,
|
|
308
|
+
W as d,
|
|
309
|
+
Y as r
|
|
293
310
|
};
|
|
294
|
-
//# sourceMappingURL=httpSessionService-
|
|
311
|
+
//# sourceMappingURL=httpSessionService-CUujaUo6.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpSessionService-CUujaUo6.js","sources":["../src/services/sessionEventDecoder.ts","../src/services/accessTokenProvider.ts","../src/services/httpSessionService.ts"],"sourcesContent":["import { ServerEvent } from '../models/ServerEvent';\nimport { LlmEvent } from '../models/semanticKernelModel/models';\nimport { createEventSerializer } from '../models/semanticKernelModel/serializer';\nimport { EventType } from '../models/enums';\nimport type { Interaction } from '../models/Interaction';\nimport type { InteractionPart } from '../models/InteractionPart';\nimport type { Artifact } from '../models/Artifact';\n\n/**\n * Strip the persistence-only `$type: \"MongoDbEvent\"` marker from the wire\n * object before handing it to typedjson. The server's session-detail endpoint\n * returns base-class `Event` instances (not `MongoDbEvent`), but downstream\n * resources that come through other code paths sometimes carry that marker;\n * leaving it in confuses typedjson because it isn't registered in\n * `KNOWN_CONTENT_TYPES`.\n */\nfunction stripMongoDbDiscriminator(raw: unknown): unknown {\n if (raw === null || typeof raw !== 'object') return raw;\n const obj = raw as Record<string, unknown>;\n if (obj['$type'] === 'MongoDbEvent') {\n const { ['$type']: _drop, ...rest } = obj;\n return rest;\n }\n return obj;\n}\n\nfunction firstUserText(events: LlmEvent[]): string | undefined {\n for (const e of events) {\n if (e.role?.label?.toLowerCase() !== 'user') continue;\n const item = e.content?.items?.find(p => 'text' in p && typeof (p as Record<string, unknown>).text === 'string');\n if (item) return (item as { text?: string }).text;\n }\n return undefined;\n}\n\n// The .NET semantic-kernel metadata key that carries the model's reasoning\n// trace on persisted (consolidated) events. typedjson drops `metadata` on\n// KernelContent-derived items (it's undecorated), so the reasoning only\n// survives on the RAW wire object — we read it from there.\nconst REASONING_METADATA_KEY = 'ChatResponseMessage.ReasoningContent';\n// Its companion: the headlines the server derived from that reasoning, a JSON array of strings (reasoning-trace\n// localization). Stamped by the agents server's HeadliningChatCompletionService on the same message.\nconst HEADLINES_METADATA_KEY = 'ChatResponseMessage.ReasoningHeadlines';\n\nfunction extractHeadlines(rawEvent: unknown): string[] | undefined {\n const content = (rawEvent as { content?: Record<string, any> })?.content;\n if (!content) return undefined;\n const raw = content.metadata?.[HEADLINES_METADATA_KEY]\n ?? (content.items ?? []).map((i: any) => i?.metadata?.[HEADLINES_METADATA_KEY]).find((v: unknown) => typeof v === 'string');\n if (typeof raw !== 'string' || !raw.trim()) return undefined;\n try {\n const parsed = JSON.parse(raw);\n return Array.isArray(parsed) ? parsed.filter((h): h is string => typeof h === 'string' && h.length > 0) : undefined;\n } catch {\n return undefined;\n }\n}\n\n/**\n * Pull the reasoning trace out of a raw wire event. The server duplicates it\n * onto the message `content.metadata` and onto each text item's `metadata`;\n * prefer the event-level copy, fall back to the first item that carries one.\n */\nfunction extractReasoning(rawEvent: unknown): string | undefined {\n const content = (rawEvent as { content?: Record<string, any> })?.content;\n if (!content) return undefined;\n const fromContent = content.metadata?.[REASONING_METADATA_KEY];\n if (typeof fromContent === 'string' && fromContent.trim()) return fromContent.trim();\n for (const item of content.items ?? []) {\n const r = item?.metadata?.[REASONING_METADATA_KEY];\n if (typeof r === 'string' && r.trim()) return r.trim();\n }\n return undefined;\n}\n\nfunction isFunctionCallType(t: EventType): boolean {\n return t === EventType.FunctionCall || t === EventType.PartialFunctionCall;\n}\n\n/**\n * Fold a FunctionResponse part onto the call part it answers, mirroring the\n * final state a live `merge` would have reached for that call: the call's\n * parsed `args`/`name`/`start` are preserved and the response's\n * `response`/`status`/`end` are layered on. eventType flips to\n * FunctionResponse, which is the completed-call shape the UI renders.\n */\nfunction foldResponseIntoCall(call: InteractionPart, response: InteractionPart): InteractionPart {\n return {\n ...call,\n eventType: EventType.FunctionResponse,\n functionDetails: {\n id: call.functionDetails!.id,\n name: response.functionDetails?.name ?? call.functionDetails!.name,\n args: call.functionDetails!.args ?? response.functionDetails?.args,\n text: call.functionDetails!.text,\n response: response.functionDetails?.response,\n status: response.functionDetails?.status ?? 'Done',\n start: call.functionDetails!.start,\n end: response.functionDetails?.end ?? call.functionDetails!.end,\n silent: call.functionDetails!.silent,\n },\n };\n}\n\n/**\n * Rebuilds the `Interaction[]` the chat UI renders from the historical event\n * log returned by <c>GET /sessions/{id}</c>.\n *\n * Unlike the live turn loop, this does NOT route events through\n * `InteractionService.merge`. The merge pipeline (and its `FlatParts` step) is\n * built for the *live* stream, where each event carries a single content item\n * arriving incrementally; it flattens every event down to one part. The\n * *persisted* log is different: the server stores consolidated blocks where a\n * single event's `content.items` holds many parts at once — e.g. a text\n * preamble plus several FunctionCalls. Running those through `merge` collapsed\n * each event to one part and silently dropped the rest (every function call in\n * a multi-item event disappeared on replay).\n *\n * This restore path instead reads *every* item as its own `InteractionPart`\n * (via `ServerEvent.parseFromTypedEvent`, which already maps one part per\n * item) and only applies the one piece of merge logic replay genuinely needs:\n * folding each FunctionResponse onto the call it answers, keyed by `callId`.\n * No copy-on-write cloning, no event-bus side effects, no streaming-append.\n */\nexport function decodeSessionEvents(rawEvents: unknown[]): Interaction[] {\n const serializer = createEventSerializer();\n\n // Parse + group by interactionId, preserving first-seen order so the\n // rendered timeline mirrors the wire-log order. Keep the typed LlmEvent\n // alongside the mapped ServerEvent — the former carries the role label\n // used to derive the interaction's question.\n const order: string[] = [];\n const grouped = new Map<string, { llm: LlmEvent[]; server: ServerEvent[]; raw: unknown[] }>();\n for (const raw of rawEvents) {\n const stripped = stripMongoDbDiscriminator(raw);\n const llmEvent = serializer.parse(stripped as Record<string, unknown>);\n if (!llmEvent) continue;\n const serverEvent = ServerEvent.parseFromTypedEvent(llmEvent);\n if (!serverEvent) continue;\n\n const key = serverEvent.interactionId ?? '__root__';\n let bucket = grouped.get(key);\n if (!bucket) {\n bucket = { llm: [], server: [], raw: [] };\n grouped.set(key, bucket);\n order.push(key);\n }\n bucket.llm.push(llmEvent);\n bucket.server.push(serverEvent);\n // Keep the stripped raw object — typedjson drops the item `metadata`\n // that holds the reasoning trace, so we recover it from here.\n bucket.raw.push(stripped);\n }\n\n const interactions: Interaction[] = [];\n for (const interactionId of order) {\n const { llm, server, raw } = grouped.get(interactionId)!;\n\n const parts: InteractionPart[] = [];\n const artifactData: Artifact[] = [];\n // callId → index in `parts` of the (possibly already folded) call part.\n const callIndex = new Map<string, number>();\n\n const pushPart = (part: InteractionPart) => {\n const stamped: InteractionPart = {\n ...part,\n id: `${parts.length + 1}-${interactionId}`,\n partial: false,\n isStillWriting: false,\n };\n parts.push(stamped);\n return parts.length - 1;\n };\n\n for (let i = 0; i < server.length; i++) {\n const event = server[i];\n\n // `user` events are the question (captured below as\n // interactionQuestion), and `system` events are injected context\n // (schema, instructions) — neither renders as a chat part. The\n // live turn loop never feeds these through merge either; only the\n // persisted log co-locates them under the turn's interactionId.\n const role = llm[i].role?.label?.toLowerCase();\n if (role === 'user' || role === 'system') {\n // The user/system text isn't a chat part (the question is captured as\n // interactionQuestion via firstUserText). But a user turn may carry a client-only\n // UI representation — a UserUiContent that ServerEvent mapped to a UserAnswer part —\n // which must re-hydrate on reload. Push those; drop everything else on this event.\n if (role === 'user') {\n for (const part of event.parts) {\n if (part.eventType === EventType.UserAnswer) pushPart(part);\n }\n }\n continue;\n }\n\n // Artifacts: dedupe by id, last write wins (same as the live merge).\n if (event.llmArtifacts && event.llmArtifacts.length > 0) {\n for (const llmArtifact of event.llmArtifacts) {\n const artifact = llmArtifact.toArtifact();\n const i = artifactData.findIndex(a => a.id === artifact.id);\n if (i === -1) artifactData.push(artifact);\n else artifactData[i] = artifact;\n }\n }\n\n // The model's reasoning trace for this step lives in the event's\n // metadata (dropped by typedjson — read from raw). It rides the\n // event's text item, so attach it to the first text part: a\n // non-empty answer keeps its body and carries the trace in the\n // thinking strip; an empty \"thinking-only\" step becomes a Thought.\n const reasoning = extractReasoning(raw[i]);\n let reasoningUsed = false;\n\n for (const part of event.parts) {\n const callId = part.functionDetails?.id;\n\n // A response folds onto its matching call rather than becoming\n // a separate part.\n if (part.eventType === EventType.FunctionResponse && callId && callIndex.has(callId)) {\n const idx = callIndex.get(callId)!;\n parts[idx] = foldResponseIntoCall(parts[idx], part);\n continue;\n }\n\n // A client-only output sibling folds its payload onto the call it belongs to\n // (never a separate part). This is the persisted/replay counterpart of the live\n // StreamingFinalFunctionResultContent.clientOutput; a uiTool renderer reads it.\n if (part.eventType === EventType.FunctionClientOutput && callId) {\n if (callIndex.has(callId)) {\n const idx = callIndex.get(callId)!;\n const prev = parts[idx];\n parts[idx] = {\n ...prev,\n functionDetails: {\n ...prev.functionDetails!,\n clientOutput: part.functionDetails?.clientOutput,\n },\n };\n }\n // No matching call (shouldn't happen — the call precedes its Tool message):\n // drop it rather than render a standalone part.\n continue;\n }\n\n // A repeated full call for an id we've already seen (e.g. a\n // full FunctionCall following a PartialFunctionCall) updates the\n // existing part in place instead of duplicating it.\n if (isFunctionCallType(part.eventType) && callId && callIndex.has(callId)) {\n const idx = callIndex.get(callId)!;\n const prev = parts[idx];\n parts[idx] = {\n ...prev,\n eventType: part.eventType,\n functionDetails: { ...prev.functionDetails!, ...part.functionDetails! },\n };\n continue;\n }\n\n if (part.eventType === EventType.Text) {\n const hasText = !!part.text && part.text.length > 0;\n const attachReasoning = !!reasoning && !reasoningUsed;\n\n // Empty text with no reasoning to carry is a bare\n // placeholder — the consolidated log emits these alongside\n // function calls; dropping them keeps the timeline clean.\n if (!hasText && !attachReasoning && !part.thoughtDetails) {\n continue;\n }\n\n if (attachReasoning) {\n pushPart({\n ...part,\n eventType: hasText ? EventType.Text : EventType.Thought,\n thoughtDetails: { text: reasoning!, headlines: extractHeadlines(raw[i]) },\n // A step with no answer text BECOMES the thought, and\n // `ThoughtPart` renders `part.text` (via\n // getPartTextContent) — leaving it empty drew the\n // \"Pensou por 12s\" header over a blank window. The live\n // path already sets both (see `createFromThought`); this\n // is the same part rebuilt from Session.Events, so it has\n // to agree. When there IS answer text the part stays a\n // Text and keeps it — the reasoning rides the strip.\n text: hasText ? part.text : reasoning!,\n });\n reasoningUsed = true;\n continue;\n }\n\n pushPart(part);\n continue;\n }\n\n const idx = pushPart(part);\n if (isFunctionCallType(part.eventType) && callId) {\n callIndex.set(callId, idx);\n }\n }\n\n // Reasoning with no text item to ride on (rare) — surface it so\n // the trace isn't silently lost.\n if (reasoning && !reasoningUsed) {\n pushPart({\n id: '', author: event.author, eventType: EventType.Thought,\n created: event.created, partial: false, isStillWriting: false,\n mustPush: false, textAppendable: false,\n thoughtDetails: { text: reasoning, headlines: extractHeadlines(raw[i]) },\n // Both, for the same reason as above: the renderer reads `text`.\n text: reasoning,\n });\n }\n }\n\n const functionMap = new Map<string, InteractionPart>();\n for (const [callId, idx] of callIndex) functionMap.set(callId, parts[idx]);\n\n interactions.push({\n created: server[0]?.created ?? new Date(),\n interactionId,\n artifactData,\n partial: false,\n turn_complete: true,\n parts,\n version: server.length,\n functionMap,\n interactionQuestion: firstUserText(llm) ?? '',\n });\n }\n\n return interactions;\n}\n","/**\n * A bearer-token source for the library's HTTP clients: either a fixed token\n * string (legacy behavior) or a callback resolved on EVERY request, so a\n * long-lived service always sends the freshest JWT (sign-in, silent refresh,\n * guest→real promotion) instead of the one captured at construction.\n */\nexport type AccessTokenProvider = string | (() => string | undefined);\n\n/** The current token for `provider` (empty string when a callback yields none). */\nexport function resolveAccessToken(provider: AccessTokenProvider): string {\n return (typeof provider === 'function' ? provider() : provider) ?? '';\n}\n","import { ChatSession, Customer, decodeSessionEvents, Interaction, ISessionService } from \"..\";\nimport { resolveAccessToken, type AccessTokenProvider } from \"./accessTokenProvider\";\n\n/**\n * Wire shape returned by `GET /sessions` and the `.header` of `GET /sessions/{id}`.\n * Mirrors `Envision.SemanticKernel.Models.Session.SessionHeader` on the C#\n * side after the default camelCase rename ASP.NET Core applies on serialize.\n */\ninterface SessionHeaderWire {\n id: string;\n created?: string | null;\n updatedAt?: string | null;\n user?: ChatSession['user'];\n customer?: ChatSession['customer'];\n overview?: string | null;\n agentType?: ChatSession['agentType'];\n userDescription?: string | null;\n lastQuestion?: string | null;\n activityCount?: number;\n lastGeneratedOverview?: string | null;\n artifacts?: string[];\n}\n\ninterface SessionDetailWire {\n header: SessionHeaderWire;\n events: unknown[];\n}\n\nfunction headerToChatSession(h: SessionHeaderWire, interactions: Interaction[] = []): ChatSession {\n return {\n id: h.id,\n browserScopeId: h.id,\n fullyLoaded: interactions.length > 0,\n interactions,\n artifacts: h.artifacts ?? [],\n overview: h.overview ?? '',\n agentType: h.agentType as ChatSession['agentType'],\n userDescription: h.userDescription ?? undefined,\n lastQuestion: h.lastQuestion ?? undefined,\n customer: h.customer ?? null,\n activityCount: h.activityCount ?? 0,\n user: h.user as ChatSession['user'],\n lastGeneratedOverview: h.lastGeneratedOverview ? new Date(h.lastGeneratedOverview) : null,\n sessionRunMode: 'normal' as ChatSession['sessionRunMode'],\n created: h.created ? new Date(h.created) : undefined,\n updatedAt: h.updatedAt ? new Date(h.updatedAt) : undefined,\n } as ChatSession;\n}\n\n/**\n * Minimal ISessionService over the WSServer's REST `/sessions` endpoints.\n *\n * Reads from the unified `Sessions` collection. The list endpoint returns\n * header projections; the detail endpoint returns header + the raw\n * `LlmEvent[]` log which we replay through `decodeSessionEvents` to rebuild\n * the chat UI's `Interaction[]`. Mutation methods are no-ops — write paths\n * are exercised by the live agent turn loop and the WS connection, not by\n * REST calls from the picker.\n */\nexport class HttpSessionService implements ISessionService {\n private serverBaseUrl: string;\n private accessToken: AccessTokenProvider;\n\n constructor(serverBaseUrl: string, accessToken: AccessTokenProvider) {\n this.serverBaseUrl = serverBaseUrl.replace(/\\/$/, '');\n this.accessToken = accessToken;\n }\n\n private get headers(): HeadersInit {\n return {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${resolveAccessToken(this.accessToken)}`,\n };\n }\n\n async getAllSessions(): Promise<ChatSession[]> {\n const r = await fetch(`${this.serverBaseUrl}/sessions?top=50`, {\n headers: this.headers,\n });\n if (!r.ok) throw new Error(`getAllSessions HTTP ${r.status}`);\n const headers = (await r.json()) as SessionHeaderWire[];\n return headers.map(h => headerToChatSession(h));\n }\n\n async retrieveSession(sessionId: string): Promise<ChatSession | null> {\n const r = await fetch(`${this.serverBaseUrl}/sessions/${sessionId}`, {\n headers: this.headers,\n });\n if (r.status === 404) return null;\n if (!r.ok) throw new Error(`retrieveSession HTTP ${r.status}`);\n const detail = (await r.json()) as SessionDetailWire;\n const interactions = decodeSessionEvents(detail.events ?? []);\n // The decoder doesn't know the sessionId — stamp it now so downstream\n // consumers (artifact loaders, debugging surfaces) can correlate back.\n for (const it of interactions) it.sessionId = detail.header.id;\n return headerToChatSession(detail.header, interactions);\n }\n\n async getLastUsedSession(): Promise<ChatSession | null> {\n const all = await this.getAllSessions();\n return all[0] ?? null;\n }\n\n // — Most write paths are inert: after the dual-collection collapse the\n // server populates Session UI-header fields automatically during the turn.\n // The two exceptions are rename (`patchSession` → PATCH /Session/Overview)\n // and delete (`removeSession` → DELETE /Session/{id}), which are driven by\n // the picker UI and have no WS-side equivalent. —\n\n async removeSession(sessionId: string): Promise<void> {\n const r = await fetch(`${this.serverBaseUrl}/Session/${encodeURIComponent(sessionId)}`, {\n method: 'DELETE',\n headers: this.headers,\n });\n if (!r.ok) throw new Error(`removeSession HTTP ${r.status}`);\n }\n async createSession(_sessionId: string, _agentName: string, _customer?: Customer): Promise<ChatSession | null> { return null; }\n async createAgentSession(): Promise<any> { return { sessionId: null }; }\n async closeSession(_sessionId: string): Promise<void> { /* no-op */ }\n async generateOverviewForCurrentSession(_sys: string, _model: string): Promise<string | null> { return null; }\n async storeSession(session: ChatSession): Promise<any> { return { data: session }; }\n async patchSession(sessionId: string, partial: Partial<ChatSession>): Promise<void> {\n // SessionController.PatchOverview binds sessionId/overview from the\n // query string (no body, no route params). Anything else on `partial`\n // has no server-side endpoint yet — ignore it instead of guessing.\n if (partial.overview == null) return;\n const url =\n `${this.serverBaseUrl}/Session/Overview` +\n `?sessionId=${encodeURIComponent(sessionId)}` +\n `&overview=${encodeURIComponent(partial.overview)}`;\n const r = await fetch(url, { method: 'PATCH', headers: this.headers });\n if (!r.ok) throw new Error(`patchSession HTTP ${r.status}`);\n }\n delayedPatchActiveSession(_partial: Partial<ChatSession>): void { /* no-op */ }\n\n async patchActiveSession(_partial: Partial<ChatSession>): Promise<ChatSession | null> {\n return Promise.resolve(null);\n }\n async getLlmSessionInformation(): Promise<any> { return { id: null, instructionSummaries: [] }; }\n transformIntoInstances(session: ChatSession): ChatSession { return session; }\n}\n"],"names":["stripMongoDbDiscriminator","raw","obj","_drop","rest","__name","firstUserText","events","e","_b","_a","item","_d","_c","p","REASONING_METADATA_KEY","HEADLINES_METADATA_KEY","extractHeadlines","rawEvent","content","i","v","parsed","h","extractReasoning","fromContent","r","isFunctionCallType","t","EventType","foldResponseIntoCall","call","response","_e","decodeSessionEvents","rawEvents","serializer","createEventSerializer","order","grouped","stripped","llmEvent","serverEvent","ServerEvent","key","bucket","interactions","interactionId","llm","server","parts","artifactData","callIndex","pushPart","part","stamped","event","role","llmArtifact","artifact","a","reasoning","reasoningUsed","callId","idx","prev","hasText","attachReasoning","functionMap","resolveAccessToken","provider","headerToChatSession","_HttpSessionService","serverBaseUrl","accessToken","__publicField","sessionId","detail","it","_sessionId","_agentName","_customer","_sys","_model","session","partial","url","_partial","HttpSessionService"],"mappings":";;;;;;AAgBA,SAASA,EAA0BC,GAAuB;AACtD,MAAIA,MAAQ,QAAQ,OAAOA,KAAQ,SAAU,QAAOA;AACpD,QAAMC,IAAMD;AACZ,MAAIC,EAAI,UAAa,gBAAgB;AACjC,UAAM,EAAE,CAAC,OAAO,GAAGC,GAAO,GAAGC,MAASF;AACtC,WAAOE;AAAA,EACX;AACA,SAAOF;AACX;AARSG,EAAAL,GAAA;AAUT,SAASM,EAAcC,GAAwC;;AAC3D,aAAWC,KAAKD,GAAQ;AACpB,UAAIE,KAAAC,IAAAF,EAAE,SAAF,gBAAAE,EAAQ,UAAR,gBAAAD,EAAe,mBAAkB,OAAQ;AAC7C,UAAME,KAAOC,KAAAC,IAAAL,EAAE,YAAF,gBAAAK,EAAW,UAAX,gBAAAD,EAAkB,KAAK,CAAAE,MAAK,UAAUA,KAAK,OAAQA,EAA8B,QAAS;AACvG,QAAIH,UAAcA,EAA2B;AAAA,EACjD;AAEJ;AAPSN,EAAAC,GAAA;AAaT,MAAMS,IAAyB,wCAGzBC,IAAyB;AAE/B,SAASC,EAAiBC,GAAyC;;AAC/D,QAAMC,IAAWD,KAAA,gBAAAA,EAAgD;AACjE,MAAI,CAACC,EAAS;AACd,QAAMlB,MAAMS,IAAAS,EAAQ,aAAR,gBAAAT,EAAmBM,QACvBG,EAAQ,SAAS,CAAA,GAAI,IAAI,CAACC;;AA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V,CAAS,CAAC,aAC9B,mBAAmBS,EAAQ,QAAQ,CAAC,IAC/C3D,IAAI,MAAM,MAAM4D,GAAK,EAAE,QAAQ,SAAS,SAAS,KAAK,SAAS;AACrE,QAAI,CAAC5D,EAAE,GAAI,OAAM,IAAI,MAAM,qBAAqBA,EAAE,MAAM,EAAE;AAAA,EAC9D;AAAA,EACA,0BAA0B6D,GAAsC;AAAA,EAAc;AAAA,EAE9E,MAAM,mBAAmBA,GAA6D;AAClF,WAAO,QAAQ,QAAQ,IAAI;AAAA,EAC/B;AAAA,EACA,MAAM,2BAAyC;AAAE,WAAO,EAAE,IAAI,MAAM,sBAAsB,CAAA,EAAC;AAAA,EAAK;AAAA,EAChG,uBAAuBH,GAAmC;AAAE,WAAOA;AAAA,EAAS;AAChF;AAjF2D/E,EAAAmE,GAAA;AAApD,IAAMgB,IAANhB;"}
|
package/dist/index.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import "reflect-metadata";
|
|
2
|
-
import { A as s, a as o, b as n, c as r, d as i, C as c, e as l, f as A, E as p, g as S, F as g, h as C, G as I, I as h, L as P, M as d, i as E, R as u, j as v, S as T, k as m, l as L, m as R, n as x, o as M, T as _, p as y, q as f, r as D, s as U, t as k, u as B, v as V, w as b } from "./serializer-
|
|
2
|
+
import { A as s, a as o, b as n, c as r, d as i, C as c, e as l, f as A, E as p, g as S, F as g, h as C, G as I, I as h, L as P, M as d, i as E, R as u, j as v, S as T, k as m, l as L, m as R, n as x, o as M, T as _, p as y, q as f, r as D, s as U, t as k, u as B, v as V, w as b } from "./serializer-DX-yGa_k.js";
|
|
3
3
|
import { C as H, C as N } from "./ClientMessage-DUby3KyC.js";
|
|
4
4
|
import { A as w, a as G, M as W, b as z, S as J, i as K } from "./Memory-CjrYSkzB.js";
|
|
5
5
|
import { C as X, P as Z } from "./Prompt-DZb7OaPp.js";
|
|
6
|
-
import { A as Y, a as Q, E as $, H as ee, I as ae, L as te, W as se } from "./httpArtifactService-
|
|
6
|
+
import { A as Y, a as Q, E as $, H as ee, I as ae, L as te, W as se } from "./httpArtifactService-GdGsaFKS.js";
|
|
7
7
|
import { A as ne } from "./artifactHtmlHandler-CMQJf1cX.js";
|
|
8
|
-
import { H as ie, d as ce, r as le } from "./httpSessionService-
|
|
8
|
+
import { H as ie, d as ce, r as le } from "./httpSessionService-CUujaUo6.js";
|
|
9
9
|
import { APPBAR_HEIGHT as pe, APPBAR_HEIGHT as Se, ASK_USER_CANCELLED as ge, AgentActivity as Ce, AgentActivity as Ie, AiChat as he, AiChatDrawer as Pe, AiChatFloating as de, AiChatFloating as Ee, AiChatPane as ue, AiChatProvider as ve, AiChatServiceContext as Te, AiChatPane as me, AppBar as Le, AppBar as Re, AppRail as xe, AppRail as Me, AppShell as _e, AppShell as ye, ArtifactRender as fe, AskUserDialog as De, AskUserSheet as Ue, AttachmentPreviewModal as ke, BoxedPart as Be, BrainIcon as Ve, ChartIcon as be, ChatIcon as Fe, ChatPane as He, ChatsHistory as Ne, ChatsHistory as Oe, CheckIcon as we, ChevronIcon as Ge, ChevronRightIcon as We, CloseIcon as ze, CodeIcon as Je, ComposerIcon as Ke, CurrentMessage as je, DEFAULT_PART_RENDERERS as Xe, DashboardIcon as Ze, DataExplorerIcon as qe, DelayTextComponent as Ye, EnvironmentProvider as Qe, FileIcon as $e, FunctionPart as ea, GlobeIcon as aa, HistoryIcon as ta, IDLE_TIMEOUT as sa, InertEnvironmentProvider as oa, JsxErrorBoundary as na, LIVE_TSX_DEFAULT_MAX_CHARS_FOR_FULL as ra, LastPrompts as ia, LastPrompts as ca, LinearBackgroundProgress as la, LinearProgressBarWithMarkers as Aa, ListCheckIcon as pa, LiveJsxBlock as Sa, LiveTsxConfigProvider as ga, LlmResponseRender as Ca, LoadingDots as Ia, LockClosedIcon as ha, LockOpenIcon as Pa, MOBILE_NAV_DEFAULT as da, MarkdownExtended as Ea, MentionPickerPanel as ua, MenuIcon as va, Message as Ta, MobileDrawer as ma, MobileDrawer as La, PanelIcon as Ra, PaperclipIcon as xa, PauseIcon as Ma, PenIcon as _a, PinIcon as ya, PlusIcon as fa, Prompt as Da, PromptDateMarkers as Ua, PromptGhostHint as ka, Prompt as Ba, RotateIcon as Va, RunProgressPanel as ba, RunProgressPanel as Fa, RunProgressStrip as Ha, RunProgressStrip as Na, SearchIcon as Oa, SendIcon as wa, SessionStateManagerService as Ga, SessionUsage as Wa, SessionUsage as za, SparkleIcon as Ja, Sparkline as Ka, StopIcon as ja, Stopwatch as Xa, SubAgentBox as Za, SubAgentBox as qa, SuspendedPart as Ya, TableIcon as Qa, TaskList as $a, TaskList as et, TerminalIcon as at, TextPart as tt, ThoughtPart as st, ToolIcon as ot, TrashIcon as nt, TriggerDropdown as rt, TurnAwareButton as it, UiToolDispatcher as ct, UndoIcon as lt, UsersIcon as At, V2_CHART_PALETTE as pt, WARNING_THRESHOLD as St, WaitingPart as gt, ZoomInIcon as Ct, ZoomOutIcon as It, classifyPart as ht, configureFriendlyMapping as Pt, createAiChatEngine as dt, createAiChatSessionStore as Et, createAiChatSessionStore as ut, createUiToolRegistry as vt, disposeSharedAiChatEngine as Tt, engineKeyFor as mt, extendDefaultScope as Lt, extendModuleRegistry as Rt, getDefaultJsxScope as xt, getFriendlyLabel as Mt, getSharedAiChatEngine as _t, parseClientOutput as yt, parseContentBlocks as ft, parseUiArgs as Dt, slotEnterSx as Ut, useAgentEngine as kt, useAiChatServices as Bt, useAiChatSessionStore as Vt, useCoarsePointer as bt, useEnvironment as Ft, useEnvironmentOptional as Ht, useLiveTsxMaxCharsForFull as Nt, useParkedAskUser as Ot, useResponsiveLayout as wt, useTurnOpen as Gt, useVisualViewport as Wt, v2Card as zt, v2Chip as Jt, v2IconBtn as Kt, v2MonoMeta as jt, v2SectionLabel as Xt, v2Theme as Zt } from "./components.js";
|
|
10
10
|
import { s as Yt, u as Qt, a as $t, b as es, c as as } from "./useContainerWidth-C7u70yDY.js";
|
|
11
11
|
import { A as ss, D as os, g as ns, b as rs, c as is, d as cs, e as ls, f as As, i as ps, r as Ss } from "./environmentUtils-VZNTCzEE.js";
|
|
12
12
|
import { ALLOWED_DOMAINS as Cs, ALLOWED_EMAILS as Is, AUTH_CONFIG as hs, GOOGLE_CLIENT_ID as Ps, getAgentBaseUrl as ds, getArtifactsBaseUrl as Es, getDotNetBaseUrl as us, getIconByName as vs, iconCategories as Ts, materialIcons as ms, searchIcons as Ls, setEbiContextData as Rs, setEbiContextSessionId as xs } from "./utils.js";
|
|
13
13
|
import { P as _s, S as ys, c as fs, a as Ds, e as Us, b as ks, f as Bs, i as Vs, d as bs, p as Fs, s as Hs, h as Ns, j as Os, t as ws, k as Gs } from "./predictionRows-Damfwthh.js";
|
|
14
14
|
import { a as zs, b as Js, c as Ks, d as js, f as Xs, p as Zs } from "./promptTriggers-xwMJ5gRj.js";
|
|
15
|
-
import { u as Ys } from "./useChatSessions-
|
|
15
|
+
import { u as Ys } from "./useChatSessions-BXYvvd4S.js";
|
|
16
16
|
import { Score as $s } from "./interfaces.js";
|
|
17
17
|
export {
|
|
18
18
|
Cs as ALLOWED_DOMAINS,
|
package/dist/models.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, a as s, b as n, c as o, d as i, C as r, e as l, f as C, E as g, g as p, F as S, h as m, G as T, I as c, L as A, M as E, i as M, R as d, j as v, S as y, k as u, l as f, m as x, n as R, o as z, T as h, p as F, q as L, r as U, s as b, t as N, u as P, v as G, w as I } from "./serializer-
|
|
1
|
+
import { A as a, a as s, b as n, c as o, d as i, C as r, e as l, f as C, E as g, g as p, F as S, h as m, G as T, I as c, L as A, M as E, i as M, R as d, j as v, S as y, k as u, l as f, m as x, n as R, o as z, T as h, p as F, q as L, r as U, s as b, t as N, u as P, v as G, w as I } from "./serializer-DX-yGa_k.js";
|
|
2
2
|
import { C as k, C as D } from "./ClientMessage-DUby3KyC.js";
|
|
3
3
|
import { A as q, a as w, M as B, b as J, S as K, i as V } from "./Memory-CjrYSkzB.js";
|
|
4
4
|
import { C as O, P as Q } from "./Prompt-DZb7OaPp.js";
|